12 |
- import{al as gi,b1 as ss,aY as R,au as z,aN as O,aR as Q,aQ as ut,aO as $,aq as V,aG as Zt,b7 as Rs,b8 as yi,b9 as We,ba as Pi,bb as xi,bc as bi,bd as Mi,k as Si,be as Ci,h as wi,bf as ki,A as Kt,aX as vi,B as Ue,bg as oe,bh as Es,bi as qe,bj as fs,z as _e,bk as Ii,bl as ze,bm as ms,s as ce,bn as Li,a as q,t as at,bo as qt,b3 as Ti,av as Ni,g as Ai,bp as de,bq as $s,br as E,bs as ue}from"./index.6c049565.js";import{C as zi}from"./BidiEngine.d8bba3fc.js";import{c as X,P as ve,R as I,k as B,f as ie,A as ge,X as st,o as ct,g as Oe,Z as Bt,K as ye,j as Fs,h as Gs,i as rt,l as nt,m as Oi,p as Ri,q as Ei,u as $i,t as Fi,v as ps,D as Gi,E as Hi,F as _s,G as Hs,H as Je,a as Re,n as Ee}from"./enums.0295eb81.js";import{t as ae,e as Pe,f as Di}from"./MaterialKey.bbaab8f1.js";import{e as ot,b as xe,S as Xi}from"./Utils.e8554a0e.js";import{t as Yi}from"./Rect.95b0fd2e.js";import{q as Vi,C as Bi,B as Wi,v as Ui}from"./quantizationUtils.4f3ed95a.js";import{n as be}from"./GeometryUtils.4f19e772.js";import{o as qi}from"./floatRGBA.c5518572.js";function Ji(r){return typeof r=="function"}function Ds(r,t,e,s){return Ji(r)?r(t,e,s):r}const ji=` /-,
- `;function ds(r){let t=r.length;for(;t--;)if(!ji.includes(r.charAt(t)))return!1;return!0}function Xs(r,t){const e=[];let s=0,i=-1;do if(i=r.indexOf("[",s),i>=s){if(i>s){const n=r.substr(s,i-s);e.push([n,null,ds(n)])}if(s=i+1,i=r.indexOf("]",s),i>=s){if(i>s){const n=t[r.substr(s,i-s)];n&&e.push([null,n,!1])}s=i+1}}while(i!==-1);if(s<r.length-1){const n=r.substr(s);e.push([n,null,ds(n)])}return e}function Ys(r,t,e){let s="",i=null;for(const n of t){const[a,o,h]=n;if(a)h?i=a:(i&&(s+=i,i=null),s+=a);else{const l=r.attributes[o];l&&(i&&(s+=i,i=null),s+=l)}}return Vs(s,e)}function Ki(r,t,e){const s=Xs(t,r);return i=>Ys(i,s,e)}function Vs(r,t){switch(typeof r!="string"&&(r=String(r)),t){case"LowerCase":return r.toLowerCase();case"Allcaps":return r.toUpperCase();default:return r}}function ga(r,t,e,s,i,n,a=!0){const o=t/i,h=e/n,l=Math.ceil(o/2),c=Math.ceil(h/2);for(let u=0;u<n;u++)for(let f=0;f<i;f++){const m=4*(f+(a?n-u-1:u)*i);let _=0,p=0,d=0,g=0,y=0,P=0,x=0;const M=(u+.5)*h;for(let k=Math.floor(u*h);k<(u+1)*h;k++){const v=Math.abs(M-(k+.5))/c,T=(f+.5)*o,L=v*v;for(let b=Math.floor(f*o);b<(f+1)*o;b++){let w=Math.abs(T-(b+.5))/l;const N=Math.sqrt(L+w*w);N>=-1&&N<=1&&(_=2*N*N*N-3*N*N+1,_>0&&(w=4*(b+k*t),x+=_*r[w+3],d+=_,r[w+3]<255&&(_=_*r[w+3]/250),g+=_*r[w],y+=_*r[w+1],P+=_*r[w+2],p+=_))}}s[m]=g/p,s[m+1]=y/p,s[m+2]=P/p,s[m+3]=x/d}}function Y(r){return r?{r:r[0],g:r[1],b:r[2],a:r[3]/255}:{r:0,g:0,b:0,a:0}}function Qi(r){return r.type==="CIMMarkerPlacementAlongLineRandomSize"||r.type==="CIMMarkerPlacementAlongLineSameSize"||r.type==="CIMMarkerPlacementAlongLineVariableSize"||r.type==="CIMMarkerPlacementAtExtremities"||r.type==="CIMMarkerPlacementAtMeasuredUnits"||r.type==="CIMMarkerPlacementAtRatioPositions"||r.type==="CIMMarkerPlacementOnLine"||r.type==="CIMMarkerPlacementOnVertices"}const C=(r,t=0)=>isNaN(r)||r==null?t:r,Zi=r=>{if(!r)return!1;for(const t of r)switch(t.type){case"CIMGeometricEffectBuffer":case"CIMGeometricEffectOffset":return!0}return!1};function tr(){return gi(()=>import("./geometryEngineJSON.3d6e7890.js"),["assets/geometryEngineJSON.3d6e7890.js","assets/geometryEngineBase.82b25ca5.js","assets/geometryEngineJSON.f9e9a36f.js","assets/json.879c9adc.js"])}function er(r){if(!r)return"normal";switch(r.toLowerCase()){case"italic":return"italic";case"oblique":return"oblique";default:return"normal"}}function sr(r){if(!r)return"normal";switch(r.toLowerCase()){case"bold":return"bold";case"bolder":return"bolder";case"lighter":return"lighter";default:return"normal"}}function Bs(r){let t="",e="";if(r){const s=r.toLowerCase();s.includes("italic")?t="italic":s.includes("oblique")&&(t="oblique"),s.includes("bold")?e="bold":s.includes("light")&&(e="lighter")}return{style:t,weight:e}}function Ws(r){return r.underline?"underline":r.strikethrough?"line-through":"none"}function Dt(r){if(!r)return null;switch(r.type){case"CIMPolygonSymbol":if(r.symbolLayers)for(const t of r.symbolLayers){const e=Dt(t);if(e!=null)return e}break;case"CIMTextSymbol":return Dt(r.symbol);case"CIMSolidFill":return r.color}}function Xt(r){if(r)switch(r.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(r.symbolLayers)for(const t of r.symbolLayers){const e=Xt(t);if(e!==void 0)return e}break;case"CIMTextSymbol":return Xt(r.symbol);case"CIMSolidStroke":case"CIMSolidFill":return r.color}}function le(r){if(r)switch(r.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(r.symbolLayers)for(const t of r.symbolLayers){const e=le(t);if(e!==void 0)return e}break;case"CIMTextSymbol":return le(r.symbol);case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return r.width}}function Us(r){switch(r){case"Left":default:return"left";case"Right":return"right";case"Center":case"Justify":return"center"}}function qs(r){switch(r){case"Top":default:return"top";case"Center":return"middle";case"Baseline":return"baseline";case"Bottom":return"bottom"}}function ir(r){return(r?Object.keys(r):[]).map(t=>({name:t,alias:t,type:typeof r[t]=="string"?"esriFieldTypeString":"esriFieldTypeDouble"}))}const Wt=r=>r.includes("data:image/svg+xml");function is(r){if(!r)return"arial-unicode-ms";const t=r.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 ya(r){const t=rr(r)+nr(r);return is(r.family)+(t.length>0?t:"-regular")}function rr(r){if(!r.weight)return"";switch(r.weight.toLowerCase()){case"bold":case"bolder":return"-bold"}return""}function nr(r){if(!r.style)return"";switch(r.style.toLowerCase()){case"italic":case"oblique":return"-italic"}return""}const $e=new zi;function rs(r){if(!$e.hasBidiChar(r))return[r,!1];let t;return t=$e.checkContextual(r)==="rtl"?"IDNNN":"ICNNN",[$e.bidiTransform(r,t,"VLYSN"),!0]}class te{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(t,e){this.tx=t,this.ty=e}setTranslateZ(t){this.tz=t}setRotateCS(t,e){this.rz=void 0,this.rzCos=t,this.rzSin=e}setRotate(t){this.rz=t,this.rzCos=void 0,this.rzSin=void 0}setRotateY(t){this.ry=t}setScale(t){this.s=t}setMeasure(t){this.m=t}}class je{constructor(t){this._geometry=t}next(){const t=this._geometry;return this._geometry=null,t}}class ar{applyColorSubstituition(t,e){if(!e)return t;this._rasterizationCanvas||(this._rasterizationCanvas=document.createElement("canvas"));const{width:s,height:i}=t,n=this._rasterizationCanvas,a=n.getContext("2d");t!==n&&(n.width=s,n.height=i,a.drawImage(t,0,0,s,i));const o=a.getImageData(0,0,s,i).data;if(e){for(const l of e)if(l&&l.oldColor&&l.oldColor.length===4&&l.newColor&&l.newColor.length===4){const[c,u,f,m]=l.oldColor,[_,p,d,g]=l.newColor;if(c===_&&u===p&&f===d&&m===g)continue;for(let y=0;y<o.length;y+=4)c===o[y]&&u===o[y+1]&&f===o[y+2]&&m===o[y+3]&&(o[y]=_,o[y+1]=p,o[y+2]=d,o[y+3]=g)}}const h=new ImageData(o,s,i);return a.putImageData(h,0,0),n}tintImageData(t,e){if(!e)return t;this._rasterizationCanvas||(this._rasterizationCanvas=document.createElement("canvas"));const{width:s,height:i}=t,n=this._rasterizationCanvas,a=n.getContext("2d");t!==n&&(n.width=s,n.height=i,a.drawImage(t,0,0,s,i));const o=a.getImageData(0,0,s,i),h=new Uint8Array(o.data),l=new ss(e),c=[l.r/255,l.g/255,l.b/255,l.a];for(let f=0;f<h.length;f+=4)h[f+0]*=c[0],h[f+1]*=c[1],h[f+2]*=c[2],h[f+3]*=c[3];const u=new ImageData(new Uint8ClampedArray(h.buffer),s,i);return a.putImageData(u,0,0),n}}function or(r){const t=R(r);return hr(t),t}function Js(r){r&&(ut(r)?r.y=-r.y:z(r)?gs(r.rings):O(r)?gs(r.paths):Q(r)&&js(r.points))}function js(r){if(r){const t=r.length;for(let e=0;e<t;e++)r[e][1]=-r[e][1]}}function gs(r){if(r)for(const t of r)js(t)}function Ks(r){if(r)for(let t=r.length-1;t>0;--t)r[t][0]-=r[t-1][0],r[t][1]-=r[t-1][1]}function ys(r){if(r)for(const t of r)Ks(t)}function Qs(r){if(r){const t=r.length;for(let e=1;e<t;++e)r[e][0]+=r[e-1][0],r[e][1]+=r[e-1][1]}}function Ps(r){if(r)for(const t of r)Qs(t)}function hr(r){r&&(z(r)?Ps(r.rings):O(r)?Ps(r.paths):Q(r)&&Qs(r.points),Js(r))}function lr(r){r&&(Js(r),z(r)?ys(r.rings):O(r)?ys(r.paths):Q(r)&&Ks(r.points))}function cr(r){if(r)for(const t of r)Ke(t)}function Ke(r){r&&r.reverse()}function Qe(r,t,e){return[r[0]+(t[0]-r[0])*e,r[1]+(t[1]-r[1])*e]}function ur(r){return!(!r||r.length===0)&&r[0][0]===r[r.length-1][0]&&r[0][1]===r[r.length-1][1]}function he(r){return r[4]}function Jt(r,t){r[4]=t}class fe{constructor(t,e,s,i=0){this.isClosed=!1,this.multiPath=null,this.acceptPolygon=e,this.acceptPolyline=s,this.geomUnitsPerPoint=i,this.pathCount=-1,this.pathIndex=-1,this.iteratePath=!1,t&&(z(t)?e&&(this.multiPath=t.rings,this.isClosed=!0):O(t)?s&&(this.multiPath=t.paths,this.isClosed=!1):$(t)&&e&&(this.multiPath=Zs(t).rings,this.isClosed=!0),this.multiPath&&(this.pathCount=this.multiPath.length)),this.internalPlacement=new te}next(){if(!this.multiPath)return null;for(;this.iteratePath||this.pathIndex<this.pathCount-1;){this.iteratePath||this.pathIndex++;const t=this.processPath(this.multiPath[this.pathIndex]);if(t)return t}return this.pathCount=-1,this.pathIndex=-1,this.multiPath=null,null}}class Te{constructor(t,e,s,i=0){this.isClosed=!1,this.multiPath=null,this.inputGeometries=t,this.acceptPolygon=e,this.acceptPolyline=s,this.geomUnitsPerPoint=i,this.pathCount=-1,this.pathIndex=-1,this.iteratePath=!1}next(){for(;;){if(!this.multiPath){let t=this.inputGeometries.next();for(;t;){if(z(t)?this.acceptPolygon&&(this.multiPath=t.rings,this.isClosed=!0):O(t)?this.acceptPolyline&&(this.multiPath=t.paths,this.isClosed=!1):$(t)&&this.acceptPolygon&&(this.multiPath=Zs(t).rings,this.isClosed=!0),this.multiPath){this.pathCount=this.multiPath.length,this.pathIndex=-1;break}t=this.inputGeometries.next()}if(!this.multiPath)return null}for(;this.iteratePath||this.pathIndex<this.pathCount-1;){this.iteratePath||this.pathIndex++;const t=this.processPath(this.multiPath[this.pathIndex]);if(t)return t}this.pathCount=-1,this.pathIndex=-1,this.multiPath=null}}}function Zs(r){return{rings:[[[r.xmin,r.ymin],[r.xmin,r.ymax],[r.xmax,r.ymax],[r.xmax,r.ymin],[r.xmin,r.ymin]]]}}class Pt{static local(){return Pt.instance===null&&(Pt.instance=new Pt),Pt.instance}execute(t,e,s,i){return new fr(t,e,s)}}Pt.instance=null;class fr{constructor(t,e,s){this._inputGeometries=t,this._angleTolerance=e.angleTolerance!==void 0?e.angleTolerance:120,this._maxCosAngle=Math.cos((1-Math.abs(this._angleTolerance)/180)*Math.PI)}next(){let t=this._inputGeometries.next();for(;t;){if(z(t)){this._isClosed=!0;const e=R(t);return this._processMultipath(e.rings),e}if(O(t)){this._isClosed=!1;const e=R(t);return this._processMultipath(e.paths),e}if($(t)){if(this._maxCosAngle)return t;this._isClosed=!0;const e=[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]];return this._processPath(e),{rings:[e]}}t=this._inputGeometries.next()}return null}_processMultipath(t){if(t)for(const e of t)this._processPath(e)}_processPath(t){if(t){let e,s,i,n,a,o,h=t.length,l=t[0];this._isClosed&&++h;for(let c=1;c<h;++c){let u;u=this._isClosed&&c===h-1?t[0]:t[c];const f=u[0]-l[0],m=u[1]-l[1],_=Math.sqrt(f*f+m*m);c>1&&_>0&&i>0&&(e*f+s*m)/_/i<=this._maxCosAngle&&Jt(l,1),c===1&&(n=f,a=m,o=_),_>0&&(l=u,e=f,s=m,i=_)}this._isClosed&&i>0&&o>0&&(e*n+s*a)/o/i<=this._maxCosAngle&&Jt(t[0],1)}}}const Qt=.03;class jt{constructor(){this._path=[]}path(){return this._path}addPath(t,e){e||t.reverse(),Array.prototype.push.apply(this._path,t),e||t.reverse()}static mergePath(t,e){e&&Array.prototype.push.apply(t,e)}startPath(t){this._path.push(t)}lineTo(t){this._path.push(t)}close(){const t=this._path;t.length>1&&(t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]||t.push([t[0][0],t[0][1]]))}}class tt{constructor(t=0,e=!1){}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);e!==0&&(t[0]/=e,t[1]/=e)}calculateLength(t,e){const s=e[0]-t[0],i=e[1]-t[1];return Math.sqrt(s*s+i*i)}calculateSegLength(t,e){return this.calculateLength(t[e],t[e+1])}calculatePathLength(t){let e=0;const s=t?t.length:0;for(let i=0;i<s-1;++i)e+=this.calculateSegLength(t,i);return e}calculatePathArea(t){let e=0;const s=t?t.length:0;for(let i=0;i<s-1;++i)e+=(t[i+1][0]-t[i][0])*(t[i+1][1]+t[i][1]);return e/2}getCoord2D(t,e,s){return[t[0]+(e[0]-t[0])*s,t[1]+(e[1]-t[1])*s]}getSegCoord2D(t,e,s){return this.getCoord2D(t[e],t[e+1],s)}getAngle(t,e,s){const i=e[0]-t[0],n=e[1]-t[1];return Math.atan2(n,i)}getSegAngle(t,e,s){return this.getAngle(t[e],t[e+1],s)}getAngleCS(t,e,s){const i=e[0]-t[0],n=e[1]-t[1],a=Math.sqrt(i*i+n*n);return a>0?[i/a,n/a]:[1,0]}getSegAngleCS(t,e,s){return this.getAngleCS(t[e],t[e+1],s)}cut(t,e,s,i){return[s<=0?t[e]:this.getSegCoord2D(t,e,s),i>=1?t[e+1]:this.getSegCoord2D(t,e,i)]}addSegment(t,e,s){s&&t.push(e[0]),t.push(e[1])}getSubCurve(t,e,s){const i=[];return this.appendSubCurve(i,t,e,s)?i:null}appendSubCurve(t,e,s,i){const n=e?e.length-1:0;let a=0,o=!0,h=0;for(;h<n;){const l=this.calculateSegLength(e,h);if(l!==0){if(o){if(a+l>s){const c=(s-a)/l;let u=1,f=!1;a+l>=i&&(u=(i-a)/l,f=!0);const m=this.cut(e,h,c,u);if(m&&this.addSegment(t,m,o),f)break;o=!1}}else{if(a+l>i){const c=this.cut(e,h,0,(i-a)/l);c&&this.addSegment(t,c,o);break}this.addSegment(t,[e[h],e[h+1]],o)}a+=l,++h}else++h}return!0}getCIMPointAlong(t,e){const s=t?t.length-1:0;let i=0,n=-1;for(;n<s;){++n;const a=this.calculateSegLength(t,n);if(a!==0){if(i+a>e){const o=(e-i)/a;return this.getCoord2D(t[n],t[n+1],o)}i+=a}}return null}isEmpty(t,e){if(!t||t.length<=1)return!0;const s=t?t.length-1:0;let i=-1;for(;i<s;)if(++i,t[i+1][0]!==t[i][0]||t[i+1][1]!==t[i][1]||e&&t[i+1][2]!==t[i][2])return!1;return!0}offset(t,e,s,i,n){if(!t||t.length<2)return null;let a=0,o=t[a++],h=a;for(;a<t.length;){const f=t[a];f[0]===o[0]&&f[1]===o[1]||(a!==h&&(t[h]=t[a]),o=t[h++]),a++}const l=t[0][0]===t[h-1][0]&&t[0][1]===t[h-1][1];if(l&&--h,h<(l?3:2))return null;const c=[];o=l?t[h-1]:null;let u=t[0];for(let f=0;f<h;f++){const m=f===h-1?l?t[0]:null:t[f+1];if(o)if(m){const _=[m[0]-u[0],m[1]-u[1]];this.normalize(_);const p=[u[0]-o[0],u[1]-o[1]];this.normalize(p);const d=p[0]*_[1]-p[1]*_[0],g=p[0]*_[0]+p[1]*_[1];if(d===0&&g===1){u=m;continue}if(d>=0==e<=0){if(g<1){const y=[_[0]-p[0],_[1]-p[1]];this.normalize(y);const P=Math.sqrt((1+g)/2);if(P>1/i){const x=-Math.abs(e)/P;c.push([u[0]-y[0]*x,u[1]-y[1]*x])}}}else switch(s){case X.Mitered:{const y=Math.sqrt((1+g)/2);if(y>0&&1/y<i){const P=[_[0]-p[0],_[1]-p[1]];this.normalize(P);const x=Math.abs(e)/y;c.push([u[0]-P[0]*x,u[1]-P[1]*x]);break}}case X.Bevelled:c.push([u[0]+p[1]*e,u[1]-p[0]*e]),c.push([u[0]+_[1]*e,u[1]-_[0]*e]);break;case X.Rounded:if(g<1){c.push([u[0]+p[1]*e,u[1]-p[0]*e]);const y=Math.floor(2.5*(1-g));if(y>0){const P=1/y;let x=P;for(let M=1;M<y;M++,x+=P){const k=[p[1]*(1-x)+_[1]*x,-p[0]*(1-x)-_[0]*x];this.normalize(k),c.push([u[0]+k[0]*e,u[1]+k[1]*e])}}c.push([u[0]+_[1]*e,u[1]-_[0]*e])}break;case X.Square:default:if(d<0)c.push([u[0]+(p[1]+p[0])*e,u[1]+(p[1]-p[0])*e]),c.push([u[0]+(_[1]-_[0])*e,u[1]-(_[0]+_[1])*e]);else{const y=Math.sqrt((1+Math.abs(g))/2),P=[_[0]-p[0],_[1]-p[1]];this.normalize(P);const x=e/y;c.push([u[0]-P[0]*x,u[1]-P[1]*x])}}}else{const _=[u[0]-o[0],u[1]-o[1]];this.normalize(_),c.push([u[0]+_[1]*e,u[1]-_[0]*e])}else{const _=[m[0]-u[0],m[1]-u[1]];this.normalize(_),c.push([u[0]+_[1]*e,u[1]-_[0]*e])}o=u,u=m}return c.length<(l?3:2)?null:(l&&c.push([c[0][0],c[0][1]]),c)}}const Fe=1.7320508075688772,mr=5,pr=ve.OpenEnded;class xt{static local(){return xt.instance===null&&(xt.instance=new xt),xt.instance}execute(t,e,s,i){return new _r(t,e,s)}}xt.instance=null;class _r extends Te{constructor(t,e,s){super(t,!1,!0),this._curveHelper=new tt,this._width=(e.width!==void 0?e.width:mr)*s,this._arrowType=e.geometricEffectArrowType!==void 0?e.geometricEffectArrowType:e.arrowType!==void 0?e.arrowType:pr,this._offsetFlattenError=Qt*s}processPath(t){switch(this._arrowType){case ve.OpenEnded:default:return this._constructSimpleArrow(t,!0);case ve.Block:return this._constructSimpleArrow(t,!1);case ve.Crossed:return this._constructCrossedArrow(t)}}_constructSimpleArrow(t,e){const s=this._curveHelper.calculatePathLength(t);let i=this._width;s<2*i&&(i=s/2);const n=this._curveHelper.getSubCurve(t,0,s-i);if(!n)return null;const a=i/2;if(this._curveHelper.isEmpty(n,!1))return null;const o=this._constructOffset(n,-a);if(!o)return null;const h=this._constructOffset(n,a);if(!h)return null;const l=this._constructArrowBasePoint(o,-a/2);if(!l)return null;const c=this._constructArrowBasePoint(h,a/2);if(!c)return null;const u=t[t.length-1];e||(this._makeControlPoint(h,!0),this._makeControlPoint(o,!0));const f=new jt;return f.addPath(h,!0),f.lineTo(c),this._makeControlPoint(f.path()),f.lineTo(u),this._makeControlPoint(f.path()),f.lineTo(l),this._makeControlPoint(f.path()),f.addPath(o,!1),e?{paths:[f.path()]}:(f.close(),{rings:[f.path()]})}_constructCrossedArrow(t){const e=this._curveHelper.calculatePathLength(t);let s=this._width;e<s*(1+Fe+1)&&(s=e/(1+Fe+1));const i=this._curveHelper.getSubCurve(t,0,e-s*(1+Fe));if(!i)return null;const n=s/2;if(this._curveHelper.isEmpty(i,!1))return null;const a=this._constructOffset(i,n);if(!a)return null;const o=this._constructOffset(i,-n);if(!o)return null;const h=this._curveHelper.getSubCurve(t,0,e-s);if(!h||this._curveHelper.isEmpty(h,!1))return null;const l=this._constructOffset(h,n);if(!l)return null;const c=this._constructOffset(h,-n);if(!c)return null;const u=l[l.length-1],f=this._constructArrowBasePoint(l,n/2);if(!f)return null;const m=c[c.length-1],_=this._constructArrowBasePoint(c,-n/2);if(!_)return null;const p=t[t.length-1];this._makeControlPoint(a,!1),this._makeControlPoint(o,!1);const d=new jt;return d.addPath(a,!0),this._makeControlPoint(d.path()),d.lineTo(m),d.lineTo(_),this._makeControlPoint(d.path()),d.lineTo(p),this._makeControlPoint(d.path()),d.lineTo(f),this._makeControlPoint(d.path()),d.lineTo(u),this._makeControlPoint(d.path()),d.addPath(o,!1),{paths:[d.path()]}}_constructOffset(t,e){return this._curveHelper.offset(t,e,X.Rounded,4,this._offsetFlattenError)}_constructArrowBasePoint(t,e){if(!t||t.length<2)return null;const s=t[t.length-2],i=t[t.length-1],n=[i[0]-s[0],i[1]-s[1]];return this._curveHelper.normalize(n),[i[0]+n[1]*e,i[1]-n[0]*e]}_makeControlPoint(t,e=!1){Jt(e?t[0]:t[t.length-1],1)}}class bt{static local(){return bt.instance===null&&(bt.instance=new bt),bt.instance}execute(t,e,s,i){return new dr(t,e,s,i)}}bt.instance=null;class dr{constructor(t,e,s,i){this._inputGeometries=t,this._curveHelper=new tt,this._size=(e.size!==void 0?e.size:1)*s,this._offsetFlattenError=Qt*s}next(){let t=this._inputGeometries.next();for(;t;){if($(t))if(this._size>0){const e=[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]],s=this._curveHelper.offset(e,this._size,X.Rounded,4,this._offsetFlattenError);if(s)return{rings:[s]}}else{if(!(this._size<0))return t;if(Math.min(t.xmax-t.xmin,t.ymax-t.ymin)+2*this._size>0)return{xmin:t.xmin-this._size,xmax:t.xmax+this._size,ymin:t.ymin-this._size,ymax:t.ymax+this._size}}if(z(t)){if(this._size===0)return t;const e=[];for(const s of t.rings){const i=this._curveHelper.offset(s,this._size,X.Rounded,4,this._offsetFlattenError);i&&e.push(i)}if(e.length)return{rings:e}}if(O(t)&&this._size>0){const e=[];for(const s of t.paths)if(s&&s.length>1){const i=this._curveHelper.offset(s,this._size,X.Rounded,4,this._offsetFlattenError),n=this._curveHelper.offset(s,-this._size,X.Rounded,4,this._offsetFlattenError);if(i&&n){for(let a=n.length-1;a>=0;a--)i.push(n[a]);i.push([i[0][0],i[0][1]]),e.push(i)}}if(e.length)return{rings:e}}ut(t)&&this._size,t=this._inputGeometries.next()}return null}}class Mt{static local(){return Mt.instance===null&&(Mt.instance=new Mt),Mt.instance}execute(t,e,s,i){return new gr(t,e,s)}}Mt.instance=null;class gr{constructor(t,e,s){var i;this._defaultPointSize=20,this._inputGeometries=t,this._geomUnitsPerPoint=s,this._rule=(i=e.rule)!=null?i:I.FullGeometry,this._defaultSize=this._defaultPointSize*s}next(){let t;for(;t=this._inputGeometries.next();){let e;if(ut(t)?e=this._processGeom([[[t.x,t.y]]]):Q(t)?e=this._processGeom([t.points]):O(t)?e=this._processGeom(t.paths):z(t)&&(e=this._processGeom(t.rings)),e&&e.length)return{paths:e}}return null}_clone(t){return[t[0],t[1]]}_mid(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}_mix(t,e,s,i){return[t[0]*e+s[0]*i,t[1]*e+s[1]*i]}_add(t,e){return[t[0]+e[0],t[1]+e[1]]}_add2(t,e,s){return[t[0]+e,t[1]+s]}_sub(t,e){return[t[0]-e[0],t[1]-e[1]]}_dist(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}_norm(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}_normalize(t,e=1){const s=e/this._norm(t);t[0]*=s,t[1]*=s}_leftPerpendicular(t){const e=-t[1],s=t[0];t[0]=e,t[1]=s}_leftPerp(t){return[-t[1],t[0]]}_rightPerpendicular(t){const e=t[1],s=-t[0];t[0]=e,t[1]=s}_rightPerp(t){return[t[1],-t[0]]}_dotProduct(t,e){return t[0]*e[0]+t[1]*e[1]}_crossProduct(t,e){return t[0]*e[1]-t[1]*e[0]}_rotateDirect(t,e,s){const i=t[0]*e-t[1]*s,n=t[0]*s+t[1]*e;t[0]=i,t[1]=n}_makeCtrlPt(t){const e=[t[0],t[1]];return Jt(e,1),e}_addAngledTicks(t,e,s,i){const n=this._sub(s,e);this._normalize(n);const a=this._crossProduct(n,this._sub(i,e));let o;o=a>0?this._rightPerp(n):this._leftPerp(n);const h=Math.abs(a)/2,l=[];l.push([e[0]+(o[0]-n[0])*h,e[1]+(o[1]-n[1])*h]),l.push(e),l.push(s),l.push([s[0]+(o[0]+n[0])*h,s[1]+(o[1]+n[1])*h]),t.push(l)}_addBezier2(t,e,s,i,n){if(n--==0)return void t.push(i);const a=this._mid(e,s),o=this._mid(s,i),h=this._mid(a,o);this._addBezier2(t,e,a,h,n),this._addBezier2(t,h,o,i,n)}_addBezier3(t,e,s,i,n,a){if(a--==0)return void t.push(n);const o=this._mid(e,s),h=this._mid(s,i),l=this._mid(i,n),c=this._mid(o,h),u=this._mid(h,l),f=this._mid(c,u);this._addBezier3(t,e,o,c,f,a),this._addBezier3(t,f,u,l,n,a)}_add90DegArc(t,e,s,i,n){const a=n!=null?n:this._crossProduct(this._sub(s,e),this._sub(i,e))>0,o=this._mid(e,s),h=this._sub(o,e);a?this._leftPerpendicular(h):this._rightPerpendicular(h),o[0]+=h[0],o[1]+=h[1],this._addBezier3(t,e,this._mix(e,.33333,o,.66667),this._mix(s,.33333,o,.66667),s,4)}_addArrow(t,e,s){const i=e[0],n=e[1],a=e[e.length-1],o=this._sub(i,n);this._normalize(o);const h=this._crossProduct(o,this._sub(a,n)),l=.5*h,c=this._leftPerp(o),u=[a[0]-c[0]*h,a[1]-c[1]*h],f=e.length-1,m=[];m.push(s?[-c[0],-c[1]]:c);let _=[-o[0],-o[1]];for(let p=1;p<f-1;p++){const d=this._sub(e[p+1],e[p]);this._normalize(d);const g=this._dotProduct(d,_),y=this._crossProduct(d,_),P=Math.sqrt((1+g)/2),x=this._sub(d,_);this._normalize(x),x[0]/=P,x[1]/=P,m.push(y<0?[-x[0],-x[1]]:x),_=d}m.push(this._rightPerp(_));for(let p=m.length-1;p>0;p--)t.push([e[p][0]+m[p][0]*l,e[p][1]+m[p][1]*l]);t.push([u[0]+m[0][0]*l,u[1]+m[0][1]*l]),t.push([u[0]+m[0][0]*h,u[1]+m[0][1]*h]),t.push(i),t.push([u[0]-m[0][0]*h,u[1]-m[0][1]*h]),t.push([u[0]-m[0][0]*l,u[1]-m[0][1]*l]);for(let p=1;p<m.length;p++)t.push([e[p][0]-m[p][0]*l,e[p][1]-m[p][1]*l])}_cp2(t,e,s){return t.length>=2?t[1]:this._add2(t[0],e*this._defaultSize,s*this._defaultSize)}_cp3(t,e,s,i){if(t.length>=3)return t[2];const n=this._mix(t[0],1-s,e,s),a=this._sub(e,t[0]);return this._normalize(a),this._rightPerpendicular(a),[n[0]+a[0]*i*this._defaultSize,n[1]+a[1]*i*this._defaultSize]}_arrowPath(t){if(t.length>2)return t;const e=t[0],s=this._cp2(t,-4,0),i=this._sub(e,s);this._normalize(i);const n=this._rightPerp(i);return[e,s,[e[0]+(n[0]-i[0])*this._defaultSize,e[1]+(n[1]-i[1])*this._defaultSize]]}_arrowLastSeg(t){const e=t[0],s=this._cp2(t,-4,0);let i;if(t.length>=3)i=t[t.length-1];else{const n=this._sub(e,s);this._normalize(n);const a=this._rightPerp(n);i=[e[0]+(a[0]-n[0])*this._defaultSize,e[1]+(a[1]-n[1])*this._defaultSize]}return[s,i]}_processGeom(t){if(!t)return null;const e=[];for(const s of t){if(!s||s.length===0)continue;const i=s.length;let n=s[0];switch(this._rule){case I.PerpendicularFromFirstSegment:{const a=this._cp2(s,0,-1),o=this._cp3(s,a,.5,4),h=[];h.push(o),h.push(this._mid(n,a)),e.push(h);break}case I.ReversedFirstSegment:{const a=this._cp2(s,0,-1);e.push([a,n]);break}case I.PerpendicularToSecondSegment:{const a=this._cp2(s,-4,1),o=this._cp3(s,a,.882353,-1.94),h=[];h.push(this._mid(a,o)),h.push(n),e.push(h);break}case I.SecondSegmentWithTicks:{const a=this._cp2(s,-4,1),o=this._cp3(s,a,.882353,-1.94),h=this._sub(o,a);let l;l=this._crossProduct(h,this._sub(n,a))>0?this._rightPerp(l):this._leftPerp(h);const c=[];c.push([a[0]+(l[0]-h[0])/3,a[1]+(l[1]-h[1])/3]),c.push(a),c.push(o),c.push([o[0]+(l[0]+h[0])/3,o[1]+(l[1]+h[1])/3]),e.push(c);break}case I.DoublePerpendicular:{const a=this._cp2(s,0,-1),o=this._cp3(s,a,.5,3),h=this._mid(n,a),l=this._sub(h,o);this._normalize(l);const c=this._crossProduct(l,this._sub(n,o));this._leftPerpendicular(l);const u=[];u.push(n),u.push([o[0]+l[0]*c,o[1]+l[1]*c]),e.push(u);const f=[];f.push([o[0]-l[0]*c,o[1]-l[1]*c]),f.push(a),e.push(f);break}case I.OppositeToFirstSegment:{const a=this._cp2(s,0,-1),o=this._cp3(s,a,.5,3),h=this._mid(n,a),l=this._sub(h,o);this._normalize(l);const c=this._crossProduct(l,this._sub(n,o));this._leftPerpendicular(l);const u=[];u.push([o[0]+l[0]*c,o[1]+l[1]*c]),u.push([o[0]-l[0]*c,o[1]-l[1]*c]),e.push(u);break}case I.TriplePerpendicular:{const a=this._cp2(s,0,-1),o=this._cp3(s,a,.5,4),h=this._mid(n,a),l=this._sub(h,o);this._normalize(l);const c=this._crossProduct(l,this._sub(n,o));this._leftPerpendicular(l);const u=[];u.push([o[0]+l[0]*c*.8,o[1]+l[1]*c*.8]),u.push([h[0]+.8*(n[0]-h[0]),h[1]+.8*(n[1]-h[1])]),e.push(u),e.push([o,h]);const f=[];f.push([o[0]-l[0]*c*.8,o[1]-l[1]*c*.8]),f.push([h[0]+.8*(a[0]-h[0]),h[1]+.8*(a[1]-h[1])]),e.push(f);break}case I.HalfCircleFirstSegment:{const a=this._cp2(s,0,-1),o=this._cp3(s,a,.5,4),h=this._mid(n,a);let l=this._sub(a,n);const c=Math.cos(Math.PI/18),u=Math.sin(Math.PI/18),f=Math.sqrt((1+c)/2),m=Math.sqrt((1-c)/2),_=[];let p;this._crossProduct(l,this._sub(o,n))>0?(_.push(n),l=this._sub(n,h),p=a):(_.push(a),l=this._sub(a,h),p=n),this._rotateDirect(l,f,m),l[0]/=f,l[1]/=f;for(let d=1;d<=18;d++)_.push(this._add(h,l)),this._rotateDirect(l,c,u);_.push(p),e.push(_);break}case I.HalfCircleSecondSegment:{const a=this._cp2(s,0,-1),o=this._cp3(s,a,1,-1);let h=this._sub(n,a);this._normalize(h);const l=this._crossProduct(h,this._sub(o,a))/2;this._leftPerpendicular(h);const c=[a[0]+h[0]*l,a[1]+h[1]*l];h=this._sub(a,c);const u=Math.cos(Math.PI/18);let f=Math.sin(Math.PI/18);l>0&&(f=-f);const m=[a];for(let _=1;_<=18;_++)this._rotateDirect(h,u,f),m.push(this._add(c,h));e.push(m);break}case I.HalfCircleExtended:{const a=this._cp2(s,0,-2),o=this._cp3(s,a,1,-1);let h;if(i>=4)h=s[3];else{const _=this._sub(n,a);h=this._add(o,_)}const l=this._dist(a,o)/2/.75,c=this._sub(a,n);this._normalize(c,l);const u=this._sub(o,h);this._normalize(u,l);const f=[h,o];e.push(f);const m=[this._clone(o)];this._addBezier3(m,o,this._add(o,u),this._add(a,c),a,4),m.push(n),e.push(m);break}case I.OpenCircle:{const a=this._cp2(s,-2,0),o=this._sub(a,n),h=Math.cos(Math.PI/18),l=-Math.sin(Math.PI/18),c=[a];for(let u=1;u<=33;u++)this._rotateDirect(o,h,l),c.push(this._add(n,o));e.push(c);break}case I.CoverageEdgesWithTicks:{const a=this._cp2(s,0,-1);let o,h;if(i>=3)o=s[2];else{const f=this._sub(a,n),m=this._leftPerp(f);o=[n[0]+m[0]-.25*f[0],n[1]+m[1]-.25*f[1]]}if(i>=4)h=s[3];else{const f=this._mid(n,a),m=this._sub(n,a);this._normalize(m),this._leftPerpendicular(m);const _=this._crossProduct(m,this._sub(o,f));this._rightPerpendicular(m),h=[o[0]+m[0]*_*2,o[1]+m[1]*_*2]}const l=this._sub(a,n);let c,u;c=this._crossProduct(l,this._sub(o,n))>0?this._rightPerp(l):this._leftPerp(l),u=[],u.push(o),u.push(n),u.push([n[0]+(c[0]-l[0])/3,n[1]+(c[1]-l[1])/3]),e.push(u),c=this._crossProduct(l,this._sub(h,a))>0?this._rightPerp(c):this._leftPerp(l),u=[],u.push([a[0]+(c[0]+l[0])/3,a[1]+(c[1]+l[1])/3]),u.push(a),u.push(h),e.push(u);break}case I.GapExtentWithDoubleTicks:{const a=this._cp2(s,0,2),o=this._cp3(s,a,0,1);let h;if(i>=4)h=s[3];else{const l=this._sub(a,n);h=this._add(o,l)}this._addAngledTicks(e,n,a,this._mid(o,h)),this._addAngledTicks(e,o,h,this._mid(n,a));break}case I.GapExtentMidline:{const a=this._cp2(s,2,0),o=this._cp3(s,a,0,1);let h;if(i>=4)h=s[3];else{const c=this._sub(a,n);h=this._add(o,c)}const l=[];l.push(this._mid(n,o)),l.push(this._mid(a,h)),e.push(l);break}case I.Chevron:{const a=this._cp2(s,-1,-1);let o;if(i>=3)o=s[2];else{const h=this._sub(a,n);this._leftPerpendicular(h),o=this._add(n,h)}e.push([a,this._makeCtrlPt(n),o]);break}case I.PerpendicularWithArc:{const a=this._cp2(s,0,-2),o=this._cp3(s,a,.5,-1);let h=this._sub(a,n);const l=this._norm(h);h[0]/=l,h[1]/=l;const c=this._crossProduct(h,this._sub(o,n));let u=this._dotProduct(h,this._sub(o,n));u<.05*l?u=.05*l:u>.95*l&&(u=.95*l);const f=[n[0]+h[0]*u,n[1]+h[1]*u];this._leftPerpendicular(h);let m=[];m.push([f[0]-h[0]*c,f[1]-h[1]*c]),m.push([f[0]+h[0]*c,f[1]+h[1]*c]),e.push(m);const _=[a[0]+h[0]*c,a[1]+h[1]*c];h=this._sub(a,_);const p=Math.cos(Math.PI/18);let d=Math.sin(Math.PI/18);c<0&&(d=-d),m=[n,a];for(let g=1;g<=9;g++)this._rotateDirect(h,p,d),m.push(this._add(_,h));e.push(m);break}case I.ClosedHalfCircle:{const a=this._cp2(s,2,0),o=this._mid(n,a),h=this._sub(a,o),l=Math.cos(Math.PI/18),c=Math.sin(Math.PI/18),u=[n,a];for(let f=1;f<=18;f++)this._rotateDirect(h,l,c),u.push(this._add(o,h));e.push(u);break}case I.TripleParallelExtended:{const a=this._cp2(s,0,-2),o=this._cp3(s,a,1,-2),h=this._mid(n,a),l=this._sub(o,a);this._normalize(l);const c=Math.abs(this._crossProduct(l,this._sub(h,a)))/2,u=this._dist(a,o),f=[a,n];f.push([n[0]+l[0]*u*.5,n[1]+l[1]*u*.5]),e.push(f);const m=[];m.push([h[0]-l[0]*c,h[1]-l[1]*c]),m.push([h[0]+l[0]*u*.375,h[1]+l[1]*u*.375]),Jt(m[m.length-1],1),m.push([h[0]+l[0]*u*.75,h[1]+l[1]*u*.75]),e.push(m);const _=[a,o];e.push(_);break}case I.ParallelWithTicks:{const a=this._cp2(s,3,0),o=this._cp3(s,a,.5,-1),h=this._sub(o,a);this._normalize(h);const l=this._crossProduct(h,this._sub(o,n));this._leftPerpendicular(h),this._addAngledTicks(e,n,a,o),this._addAngledTicks(e,this._mix(n,1,h,l),this._mix(a,1,h,l),this._mid(n,a));break}case I.Parallel:{const a=this._cp2(s,3,0),o=this._cp3(s,a,.5,-1),h=this._sub(a,n);this._normalize(h);const l=this._leftPerp(h),c=this._crossProduct(h,this._sub(o,n));let u=[n,a];e.push(u),u=[],u.push([n[0]+l[0]*c,n[1]+l[1]*c]),u.push([a[0]+l[0]*c,a[1]+l[1]*c]),e.push(u);break}case I.PerpendicularToFirstSegment:{const a=this._cp2(s,3,0),o=this._cp3(s,a,.5,-1),h=this._mid(n,a),l=this._sub(a,n);this._normalize(l);const c=this._crossProduct(l,this._sub(o,n));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]),e.push(u);break}case I.ParallelOffset:{const a=this._cp2(s,3,0),o=this._cp3(s,a,.5,-1),h=this._sub(a,n);this._normalize(h);const l=this._crossProduct(h,this._sub(o,n));this._leftPerpendicular(h);const c=[];c.push([n[0]-h[0]*l,n[1]-h[1]*l]),c.push([a[0]-h[0]*l,a[1]-h[1]*l]),e.push(c);const u=[];u.push([n[0]+h[0]*l,n[1]+h[1]*l]),u.push([a[0]+h[0]*l,a[1]+h[1]*l]),e.push(u);break}case I.OffsetOpposite:{const a=this._cp2(s,3,0),o=this._cp3(s,a,.5,-1),h=this._sub(a,n);this._normalize(h);const l=this._crossProduct(h,this._sub(o,n));this._leftPerpendicular(h);const c=[];c.push([n[0]-h[0]*l,n[1]-h[1]*l]),c.push([a[0]-h[0]*l,a[1]-h[1]*l]),e.push(c);break}case I.OffsetSame:{const a=this._cp2(s,3,0),o=this._cp3(s,a,.5,-1),h=this._sub(a,n);this._normalize(h);const l=this._crossProduct(h,this._sub(o,n));this._leftPerpendicular(h);const c=[];c.push([n[0]+h[0]*l,n[1]+h[1]*l]),c.push([a[0]+h[0]*l,a[1]+h[1]*l]),e.push(c);break}case I.CircleWithArc:{let a=this._cp2(s,3,0);const o=this._cp3(s,a,.5,-1);let h,l;if(i>=4)h=s[3],l=this._crossProduct(this._sub(h,a),this._sub(o,a))>0;else{h=a,l=this._crossProduct(this._sub(h,n),this._sub(o,n))>0;const _=24*this._geomUnitsPerPoint,p=this._sub(h,n);this._normalize(p,_);const d=Math.sqrt(2)/2;this._rotateDirect(p,d,l?d:-d),a=this._add(n,p)}const c=this._sub(a,n),u=Math.cos(Math.PI/18),f=Math.sin(Math.PI/18),m=[a];for(let _=1;_<=36;_++)this._rotateDirect(c,u,f),m.push(this._add(n,c));this._add90DegArc(m,a,h,o,l),Jt(m[m.length-8],1),e.push(m);break}case I.DoubleJog:{let a,o,h=this._cp2(s,-3,1);if(a=i>=3?s[2]:this._add(n,this._sub(n,h)),i>=4)o=s[3];else{const g=n;n=h,o=a;const y=this._dist(n,g),P=this._dist(o,g);let x=30*this._geomUnitsPerPoint;.5*y<x&&(x=.5*y),.5*P<x&&(x=.5*P),h=this._mix(n,x/y,g,(y-x)/y),a=this._mix(o,x/P,g,(P-x)/P)}const l=this._mid(n,h),c=this._mid(o,a),u=this._dist(n,h),f=this._dist(a,o);let m=Math.min(u,f)/8;m=Math.min(m,24*this._geomUnitsPerPoint);const _=Math.cos(Math.PI/4);let p=this._sub(n,h);this._normalize(p,m),this._crossProduct(p,this._sub(o,h))>0?this._rotateDirect(p,_,-_):this._rotateDirect(p,_,_);let d=[];d.push(h),d.push(this._add(l,p)),d.push(this._sub(l,p)),d.push(n),e.push(d),p=this._sub(o,a),this._normalize(p,m),this._crossProduct(p,this._sub(n,a))<0?this._rotateDirect(p,_,_):this._rotateDirect(p,_,-_),d=[],d.push(a),d.push(this._add(c,p)),d.push(this._sub(c,p)),d.push(o),e.push(d);break}case I.PerpendicularOffset:{const a=this._cp2(s,-4,1),o=this._cp3(s,a,.882353,-1.94),h=this._sub(o,a);this._crossProduct(h,this._sub(n,a))>0?this._rightPerpendicular(h):this._leftPerpendicular(h);const l=[h[0]/8,h[1]/8],c=this._sub(this._mid(a,o),l);e.push([c,n]);break}case I.LineExcludingLastSegment:{const a=this._arrowPath(s),o=[];let h=a.length-2;for(;h--;)o.push(a[h]);e.push(o);break}case I.MultivertexArrow:{const a=this._arrowPath(s),o=[];this._addArrow(o,a,!1),e.push(o);break}case I.CrossedArrow:{const a=this._arrowPath(s),o=[];this._addArrow(o,a,!0),e.push(o);break}case I.ChevronArrow:{const[a,o]=this._arrowLastSeg(s),h=10*this._geomUnitsPerPoint,l=this._sub(n,a);this._normalize(l);const c=this._crossProduct(l,this._sub(o,a)),u=this._leftPerp(l),f=[o[0]-u[0]*c*2,o[1]-u[1]*c*2],m=[];m.push([o[0]+l[0]*h,o[1]+l[1]*h]),m.push(n),m.push([f[0]+l[0]*h,f[1]+l[1]*h]),e.push(m);break}case I.ChevronArrowOffset:{const[a,o]=this._arrowLastSeg(s),h=this._sub(n,a);this._normalize(h);const l=this._crossProduct(h,this._sub(o,a));this._leftPerpendicular(h);const c=[o[0]-h[0]*l,o[1]-h[1]*l],u=[];u.push([c[0]+h[0]*l*.5,c[1]+h[1]*l*.5]),u.push(this._mid(c,n)),u.push([c[0]-h[0]*l*.5,c[1]-h[1]*l*.5]),e.push(u);break}case I.PartialFirstSegment:{const[a,o]=this._arrowLastSeg(s),h=this._sub(n,a);this._normalize(h);const l=this._crossProduct(h,this._sub(o,a));this._leftPerpendicular(h);const c=[o[0]-h[0]*l,o[1]-h[1]*l];e.push([a,c]);break}case I.Arch:{const a=this._cp2(s,0,-1),o=this._cp3(s,a,.5,1),h=this._sub(n,a),l=this._mix(o,1,h,.55),c=this._mix(o,1,h,-.55),u=[n];this._addBezier2(u,n,l,o,4),this._addBezier2(u,o,c,a,4),e.push(u);break}case I.CurvedParallelTicks:{const a=this._cp2(s,-4,1),o=this._cp3(s,a,.882353,-1.94),h=this._sub(o,a);this._crossProduct(h,this._sub(n,a))>0?this._rightPerpendicular(h):this._leftPerpendicular(h);const l=[h[0]/8,h[1]/8],c=this._sub(this._mid(a,o),l),u=this._sub(this._mix(a,.75,o,.25),l),f=this._sub(this._mix(a,.25,o,.75),l),m=[a];this._addBezier2(m,a,u,c,3),this._addBezier2(m,c,f,o,3),e.push(m);for(let _=0;_<8;_++){const p=m[2*_+1],d=[this._clone(p)];d.push(this._add(p,[h[0]/4,h[1]/4])),e.push(d)}break}case I.Arc90Degrees:{const a=this._cp2(s,0,-1),o=this._cp3(s,a,.5,1),h=[a];this._add90DegArc(h,a,n,o),e.push(h);break}case I.FullGeometry:default:e.push(s)}}return e}}class St{static local(){return St.instance===null&&(St.instance=new St),St.instance}execute(t,e,s,i){return new yr(t,e,s)}}St.instance=null;class yr extends Te{constructor(t,e,s){super(t,!0,!0),this._curveHelper=new tt,this._beginCut=(e.beginCut!==void 0?e.beginCut:1)*s,this._endCut=(e.endCut!==void 0?e.endCut:1)*s,this._middleCut=(e.middleCut!==void 0?e.middleCut:0)*s,this._invert=e.invert!==void 0&&e.invert,this._beginCut<0&&(this._beginCut=0),this._endCut<0&&(this._endCut=0),this._middleCut<0&&(this._middleCut=0)}processPath(t){const e=this._beginCut,s=this._endCut,i=this._middleCut,n=this._curveHelper.calculatePathLength(t),a=[];if(this._invert){if(!(e===0&&s===0&&i===0))if(e+s+i>=n)a.push(t);else{let o=this._curveHelper.getSubCurve(t,0,e);o&&a.push(o),o=this._curveHelper.getSubCurve(t,.5*(n-i),.5*(n+i)),o&&a.push(o),o=this._curveHelper.getSubCurve(t,n-s,s),o&&a.push(o)}}else if(e===0&&s===0&&i===0)a.push(t);else if(!(e+s+i>=n))if(i===0){const o=this._curveHelper.getSubCurve(t,e,n-s);o&&a.push(o)}else{let o=this._curveHelper.getSubCurve(t,e,.5*(n-i));o&&a.push(o),o=this._curveHelper.getSubCurve(t,.5*(n+i),n-s),o&&a.push(o)}return a.length===0?null:{paths:a}}}const xs=1e-7;class Ne{constructor(){this._values=[],this.extPtGap=0,this.ctrlPtGap=0,this._length=0,this._currentValue=0}isEmpty(){return this._values.length===0}size(){return this._values.length}init(t,e,s=!0){if(this._setEmpty(),!t||t.length===0)return!1;for(let i=0;i<t.length;i++){let n=Math.abs(t[i]);s&&n<xs&&(n=xs),this._values.push(n),this._length+=n}return e&&1&t.length&&(this._length*=2),this._length!==0&&(this.ctrlPtGap=this.extPtGap=0,this._currentValue=-1,!0)}scale(t){const e=this._values?this._values.length:0;for(let s=0;s<e;++s)this._values[s]*=t;this._length*=t,this.extPtGap*=t,this.ctrlPtGap*=t}addValue(t){this._length+=t,this._values.push(t)}firstValue(){return this._values[0]}lastValue(){return this._values[this._values.length-1]}nextValue(){return this._currentValue++,this._currentValue===this._values.length&&(this._currentValue=0),this._values[this._currentValue]}reset(){this._currentValue=-1}length(){return this._length}_setEmpty(){this.extPtGap=this.ctrlPtGap=this._length=0,this._currentValue=-1,this._values.length=0}}class it{constructor(){this.pt=null,this.ca=0,this.sa=0}}var lt;(function(r){r[r.FAIL=0]="FAIL",r[r.END=1]="END",r[r.CONTINUE=2]="CONTINUE"})(lt||(lt={}));class Me{constructor(){this.reset()}reset(){this.segment=-1,this.segmentLength=0,this.abscissa=0,this.isPathEnd=!1,this.isPartEnd=!1}isValid(){return this.segment!==-1}copyTo(t){t.segment=this.segment,t.segmentLength=this.segmentLength,t.abscissa=this.abscissa,t.isPathEnd=this.isPathEnd,t.isPartEnd=this.isPartEnd}}class Ae extends tt{constructor(t=0,e=!1){super(t,e),this._tolerance=Qt,this._currentPosition=new Me}updateTolerance(t){this._tolerance=Qt*t}init(t,e,s=!0){return s?(this._patternLength=e.length(),this._partExtPtGap=e.extPtGap,this._partCtrlPtGap=e.ctrlPtGap):(this._patternLength=0,this._partExtPtGap=0,this._partCtrlPtGap=0),this._currentPosition.reset(),this._partSegCount=0,this._path=t,this._seg=-1,this._setPosAtNextPart()}curPositionIsValid(){return this._currentPosition.isValid()}nextPosition(t,e=lt.FAIL){const s=new Me;return!!this._nextPosition(t,s,null,e)&&(s.copyTo(this._currentPosition),!0)}curPointAndAngle(t){t.pt=this._getPoint(this._currentPosition);const[e,s]=this._getAngle(this._currentPosition);t.ca=e,t.sa=s}nextPointAndAngle(t,e,s=lt.FAIL){const i=new Me;if(!this._nextPosition(t,i,null,s))return!1;i.copyTo(this._currentPosition),e.pt=this._getPoint(i);const[n,a]=this._getAngle(i);return e.ca=n,e.sa=a,!0}nextCurve(t){if(t===0)return null;const e=[],s=new Me;return this._nextPosition(t,s,e,lt.END)?(s.copyTo(this._currentPosition),e):null}isPathEnd(){return this._currentPosition.isPathEnd}getPathEnd(){if(this._currentPosition.segment===-1)throw new Error("missing segment");return this._path[this._currentPosition.segment+1]}_nextPosition(t,e,s,i){if(this._currentPosition.isPathEnd)return!1;let n=this._currentPosition.abscissa;for(this._currentPosition.segmentLength>0&&(n/=this._currentPosition.segmentLength),this._currentPosition.copyTo(e);e.abscissa+t*this._partLengthRatio>e.segmentLength+this._tolerance;){if(s){if(s.length===0)if(n===0){const o=this._path[e.segment];s.push([o[0],o[1]])}else s.push(this.getSegCoord2D(this._path,e.segment,n));const a=this._path[e.segment+1];s.push([a[0],a[1]])}if(n=0,t-=(e.segmentLength-e.abscissa)/this._partLengthRatio,this._partSegCount)e.segment=this._nextSegment(),e.segmentLength=this.calculateSegLength(this._path,e.segment),e.abscissa=0,this._partSegCount--;else{if(!this._setPosAtNextPart())return i!==lt.FAIL&&(e.segmentLength=this.calculateSegLength(this._path,e.segment),e.isPartEnd=!0,i===lt.END?(e.abscissa=e.segmentLength,e.isPathEnd=!0):e.abscissa=e.segmentLength+t,!0);this._currentPosition.copyTo(e)}}if(e.abscissa+=t*this._partLengthRatio,s){if(s.length===0)if(n===0){const o=this._path[e.segment];s.push([o[0],o[1]])}else s.push(this.getSegCoord2D(this._path,e.segment,n));const a=e.abscissa/e.segmentLength;if(a===1){const o=this._path[e.segment+1];s.push([o[0],o[1]])}else s.push(this.getSegCoord2D(this._path,e.segment,a))}return this._partSegCount||Math.abs(e.abscissa-e.segmentLength)<this._tolerance&&(e.isPathEnd=this._partIsLast,e.isPartEnd=!0),!0}_getPoint(t){if(t.segment===-1)throw new Error("missing segment");const e=t.segmentLength<=0?0:t.abscissa/t.segmentLength;return this.getSegCoord2D(this._path,t.segment,e)}_getAngle(t){if(t.segment===-1)throw new Error("missing segment");const e=t.segmentLength<=0?0:t.abscissa/t.segmentLength;return this.getSegAngleCS(this._path,t.segment,e)}_setPosAtNextPart(){for(;this._partSegCount;)this._hasNextSegment()&&this._nextSegment(),this._partSegCount--;if(!this._hasNextSegment())return!1;for(this._partLength=0,this._partIsLast=!0,this._partSegCount=0;this._hasNextSegment();)if(this._partLength+=this.calculateSegLength(this._path,this._nextSegment()),this._partSegCount++,he(this._path[this._getEndPointIndex()])===1){this._partIsLast=!this._hasNextSegment();break}let t=this._partSegCount;for(;t;)this._previousSegment(),--t;this._currentPosition.segment=this._nextSegment(),this._currentPosition.segmentLength=this.calculateSegLength(this._path,this._currentPosition.segment),this._currentPosition.abscissa=0,this._currentPosition.isPathEnd=this._currentPosition.isPartEnd=!1,--this._partSegCount;const e=this._getStartPointIndex();this._ctrlPtBegin=he(this._path[e])===1;let s=e+this._partSegCount+1;if(s>=this._path.length&&(s=0),this._ctrlPtEnd=he(this._path[s])===1,this._patternLength>0){const i=this._ctrlPtBegin?this._partCtrlPtGap:this._partExtPtGap,n=this._ctrlPtEnd?this._partCtrlPtGap:this._partExtPtGap;let a=Math.round((this._partLength-(i+n))/this._patternLength);a<=0&&(a=i+n>0?0:1),this._partLengthRatio=this._partLength/(i+n+a*this._patternLength),this._partLengthRatio<.01&&(this._partLengthRatio=1)}else this._partLengthRatio=1;return!0}_hasNextSegment(){return this._seg<this._path.length-2}_previousSegment(){return--this._seg}_nextSegment(){return++this._seg}_getStartPointIndex(){return this._seg}_getEndPointIndex(){return this._seg+1}}class Ct{static local(){return Ct.instance===null&&(Ct.instance=new Ct),Ct.instance}execute(t,e,s,i){return new Pr(t,e,s)}}Ct.instance=null;class Pr extends Te{constructor(t,e,s){var i,n;super(t,!0,!0),this._firstCurve=null,this._walker=new Ae,this._walker.updateTolerance(s),this._endings=e.lineDashEnding,this._customDashPos=-((i=e.offsetAlongLine)!=null?i:0)*s,this._offsetAtEnd=((n=e.customEndingOffset)!=null?n:0)*s,this._pattern=new Ne,this._pattern.init(e.dashTemplate,!0),this._pattern.scale(s)}processPath(t){if(this._pattern.length()===0)return this.iteratePath=!1,{paths:[t]};if(!this.iteratePath){let i=!0;switch(this._endings){case B.HalfPattern:case B.HalfGap:default:this._pattern.extPtGap=0;break;case B.FullPattern:this.isClosed||(this._pattern.extPtGap=.5*this._pattern.firstValue());break;case B.FullGap:this.isClosed||(this._pattern.extPtGap=.5*this._pattern.lastValue());break;case B.NoConstraint:this.isClosed||(i=!1);break;case B.Custom:this.isClosed||(this._pattern.extPtGap=.5*this._offsetAtEnd)}const n=this._walker.calculatePathLength(t);if(this._pattern.isEmpty()||n<.1*this._pattern.length())return{paths:[t]};if(!this._walker.init(t,this._pattern,i))return{paths:[t]}}let e;if(this.iteratePath)e=this._pattern.nextValue();else{let i;switch(this._endings){case B.HalfPattern:default:i=.5*this._pattern.firstValue();break;case B.HalfGap:i=.5*-this._pattern.lastValue();break;case B.FullGap:i=-this._pattern.lastValue();break;case B.FullPattern:i=0;break;case B.NoConstraint:case B.Custom:i=-this._customDashPos}let n=i/this._pattern.length();n-=Math.floor(n),i=n*this._pattern.length(),this._pattern.reset(),e=this._pattern.nextValue();let a=!1;for(;i>=e;)i-=e,e=this._pattern.nextValue(),a=!a;e-=i,a?(this._walker.nextPosition(e),e=this._pattern.nextValue()):this.isClosed&&(this._firstCurve=this._walker.nextCurve(e),e=this._pattern.nextValue(),this._walker.nextPosition(e),e=this._pattern.nextValue())}let s=this._walker.nextCurve(e);return s?this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&(this._firstCurve.splice(0,1),jt.mergePath(s,this._firstCurve),this._firstCurve=null)):(e=this._pattern.nextValue(),!this._walker.nextPosition(e)||this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&(s=this._firstCurve,this._firstCurve=null)):this.iteratePath=!0):(this.iteratePath=!1,s=this._firstCurve,this._firstCurve=null),{paths:[s]}}}class wt{static local(){return wt.instance===null&&(wt.instance=new wt),wt.instance}execute(t,e,s,i){return new xr(t,e,s)}}wt.instance=null;class xr{constructor(t,e,s){switch(this._inputGeometries=t,this._curveHelper=new tt,this._width=(e.width!==void 0?e.width:2)*s,e.method){case ie.Mitered:default:this._method=X.Mitered;break;case ie.Bevelled:this._method=X.Bevelled;break;case ie.Rounded:case ie.TrueBuffer:this._method=X.Rounded;break;case ie.Square:this._method=X.Square}this._option=e.option,this._offsetFlattenError=Qt*s}next(){let t=this._inputGeometries.next();for(;t;){if($(t)&&this._width>0){if(Math.min(t.xmax-t.xmin,t.ymax-t.ymin)-2*this._width<0)return t;const e=[];return e.push([[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]),e.push([[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]]),{rings:e}}if(z(t)&&this._width>0){const e=[];for(const s of t.rings){const i=this._curveHelper.calculatePathLength(s),n=this._curveHelper.offset(s,this._width,this._method,4,this._offsetFlattenError);n&&(i<0&&n.reverse(),e.push(n))}if(e.length)return{rings:e}}t=this._inputGeometries.next()}return null}}class kt{static local(){return kt.instance===null&&(kt.instance=new kt),kt.instance}execute(t,e,s,i){return new br(t,e,s)}}kt.instance=null;class br extends Te{constructor(t,e,s){super(t,!1,!0),this._curveHelper=new tt,this._length=(e.length!==void 0?e.length:20)*s,this._angle=e.angle!==void 0?e.angle:225,this._position=e.position!==void 0?e.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(t){if(this._curveHelper.isEmpty(t,!1))return null;const e=t[0],s=t[t.length-1],i=[s[0]-e[0],s[1]-e[1]];this._curveHelper.normalize(i);const n=[e[0]+(s[0]-e[0])*this._position/100,e[1]+(s[1]-e[1])*this._position/100],a=Math.cos((90-this._angle)/180*Math.PI);let o=Math.sin((90-this._angle)/180*Math.PI);return this._mirror&&(o=-o),this._mirror=!this._mirror,{paths:[[e,[n[0]-this._length/2*a,n[1]-this._length/2*o],[n[0]+this._length/2*a,n[1]+this._length/2*o],s]]}}}class vt{static local(){return vt.instance===null&&(vt.instance=new vt),vt.instance}execute(t,e,s,i){return new Mr(t,e,s)}}vt.instance=null;class Mr{constructor(t,e,s){this._inputGeometries=t,this._offsetX=e.offsetX!==void 0?e.offsetX*s:0,this._offsetY=e.offsetY!==void 0?-e.offsetY*s:0}next(){let t=this._inputGeometries.next();for(;t;){if($(t))return{xmin:t.xmin+this._offsetX,xmax:t.xmax+this._offsetX,ymin:t.ymin+this._offsetY,ymax:t.ymax+this._offsetY};if(z(t)){const e=R(t);return this._moveMultipath(e.rings,this._offsetX,this._offsetY),e}if(O(t)){const e=R(t);return this._moveMultipath(e.paths,this._offsetX,this._offsetY),e}if(Q(t)){const e=R(t);return this._movePath(e.points,this._offsetX,this._offsetY),e}if(ut(t))return{x:t.x+this._offsetX,y:t.y+this._offsetY};t=this._inputGeometries.next()}return null}_moveMultipath(t,e,s){if(t)for(const i of t)this._movePath(i,e,s)}_movePath(t,e,s){if(t)for(const i of t)i[0]+=e,i[1]+=s}}class It{static local(){return It.instance===null&&(It.instance=new It),It.instance}execute(t,e,s,i){return new Sr(t,e,s)}}It.instance=null;class Sr{constructor(t,e,s){var i;this._inputGeometries=t,this._curveHelper=new tt,this._offset=((i=e.offset)!=null?i:1)*s,this._method=e.method,this._option=e.option,this._offsetFlattenError=Qt*s}next(){let t=this._inputGeometries.next();for(;t;){if(this._offset===0)return t;if($(t)){if(this._method===X.Rounded&&this._offset>0){const e=[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]],s=this._curveHelper.offset(e,-this._offset,this._method,4,this._offsetFlattenError);return s?{rings:[s]}:null}if(Math.min(t.xmax-t.xmin,t.ymax-t.ymin)+2*this._offset>0)return{xmin:t.xmin-this._offset,xmax:t.xmax+this._offset,ymin:t.ymin-this._offset,ymax:t.ymax+this._offset}}if(z(t)){const e=[];for(const s of t.rings){const i=this._curveHelper.offset(s,-this._offset,this._method,4,this._offsetFlattenError);i&&e.push(i)}if(e.length)return{rings:e}}if(O(t)){const e=[];for(const s of t.paths){const i=this._curveHelper.offset(s,-this._offset,this._method,4,this._offsetFlattenError);i&&e.push(i)}if(e.length)return{paths:e}}t=this._inputGeometries.next()}return null}}class Lt{static local(){return Lt.instance===null&&(Lt.instance=new Lt),Lt.instance}execute(t,e,s,i){return new Cr(t,e,s)}}Lt.instance=null;class Cr{constructor(t,e,s){this._inputGeometries=t,this._reverse=e.reverse===void 0||e.reverse}next(){let t=this._inputGeometries.next();for(;t;){if(!this._reverse)return t;if(O(t)){const e=R(t);return cr(e.paths),e}t=this._inputGeometries.next()}return null}}class Tt{static local(){return Tt.instance===null&&(Tt.instance=new Tt),Tt.instance}execute(t,e,s,i){return new wr(t,e,s)}}Tt.instance=null;class wr{constructor(t,e,s){this._inputGeometries=t,this._rotateAngle=e.angle!==void 0?e.angle*Math.PI/180:0}next(){let t=this._inputGeometries.next();for(;t;){if(this._rotateAngle===0)return t;const e=V();Zt(e,t);const s=(e[2]+e[0])/2,i=(e[3]+e[1])/2;if($(t)){const n={rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]};return this._rotateMultipath(n.rings,s,i),n}if(z(t)){const n=R(t);return this._rotateMultipath(n.rings,s,i),n}if(O(t)){const n=R(t);return this._rotateMultipath(n.paths,s,i),n}if(Q(t)){const n=R(t);return this._rotatePath(n.points,s,i),n}if(ut(t))return t;t=this._inputGeometries.next()}return null}_rotateMultipath(t,e,s){if(t)for(const i of t)this._rotatePath(i,e,s)}_rotatePath(t,e,s){if(t){const i=Math.cos(this._rotateAngle),n=Math.sin(this._rotateAngle);for(const a of t){const o=a[0]-e,h=a[1]-s;a[0]=e+o*i-h*n,a[1]=s+o*n+h*i}}}}class Nt{static local(){return Nt.instance===null&&(Nt.instance=new Nt),Nt.instance}execute(t,e,s,i){return new kr(t,e,s)}}Nt.instance=null;class kr{constructor(t,e,s){this._inputGeometries=t,this._xFactor=e.xScaleFactor!==void 0?e.xScaleFactor:1.15,this._yFactor=e.yScaleFactor!==void 0?e.yScaleFactor:1.15}next(){let t=this._inputGeometries.next();for(;t;){if(this._xFactor===1&&this._yFactor===1)return t;const e=V();Zt(e,t);const s=(e[2]+e[0])/2,i=(e[3]+e[1])/2;if($(t)){const n={rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]};return this._scaleMultipath(n.rings,s,i),n}if(z(t)){const n=R(t);return this._scaleMultipath(n.rings,s,i),n}if(O(t)){const n=R(t);return this._scaleMultipath(n.paths,s,i),n}if(Q(t)){const n=R(t);return this._scalePath(n.points,s,i),n}if(ut(t))return t;t=this._inputGeometries.next()}return null}_scaleMultipath(t,e,s){if(t)for(const i of t)this._scalePath(i,e,s)}_scalePath(t,e,s){if(t)for(const i of t){const n=(i[0]-e)*this._xFactor,a=(i[1]-s)*this._yFactor;i[0]=e+n,i[1]=s+a}}}class At{static local(){return At.instance===null&&(At.instance=new At),At.instance}execute(t,e,s,i){return new vr(t,e,s)}}At.instance=null;class vr{constructor(t,e,s){this._inputGeometries=t,this._height=(e.amplitude!==void 0?e.amplitude:2)*s,this._period=(e.period!==void 0?e.period:3)*s,this._style=e.waveform,this._height<=0&&(this._height=Math.abs(this._height)),this._period<=0&&(this._period=Math.abs(this._period)),this._pattern=new Ne,this._pattern.addValue(this._period),this._pattern.addValue(this._period),this._walker=new Ae,this._walker.updateTolerance(s)}next(){let t=this._inputGeometries.next();for(;t;){if(this._height===0||this._period===0)return t;if(O(t)){const e=this._processGeom(t.paths);if(e.length)return{paths:e}}if(z(t)){const e=this._processGeom(t.rings);if(e.length)return{rings:e}}t=this._inputGeometries.next()}return null}_processGeom(t){const e=[];for(const s of t)if(this._walker.init(s,this._pattern))switch(this._style){case ge.Sinus:default:e.push(this._constructCurve(s,!1));break;case ge.Square:e.push(this._constructSquare(s));break;case ge.Triangle:e.push(this._constructTriangle(s));break;case ge.Random:e.push(this._constructCurve(s,!0))}else e.push(s);return e}_constructCurve(t,e){const s=new jt,i=this._walker.calculatePathLength(t);let n=Math.round(i/this._period);n===0&&(n=1);const a=n*16+1,o=i/n,h=this._period/16,l=1/a,c=2*Math.PI*i/o,u=2*Math.PI*Math.random(),f=2*Math.PI*Math.random(),m=2*Math.PI*Math.random(),_=.75-Math.random()/2,p=.75-Math.random()/2,d=new it;this._walker.curPointAndAngle(d),s.startPath(d.pt);let g=0;for(;;){if(!this._walker.nextPointAndAngle(h,d)){s.lineTo(t[t.length-1]);break}{const y=g;let P;if(g+=l,e){const x=this._height/2*(1+.3*Math.sin(_*c*y+u));P=x*Math.sin(c*y+f),P+=x*Math.sin(p*c*y+m),P/=2}else P=.5*this._height*Math.sin(.5*c*y);s.lineTo([d.pt[0]-P*d.sa,d.pt[1]+P*d.ca])}}return s.path()}_constructSquare(t){const e=new jt,s=this._walker.calculatePathLength(t);Math.round(s/this._period);let i=!0;for(;;){let n=!1;if(this._walker.curPositionIsValid()){const a=new it;this._walker.curPointAndAngle(a);const o=new it;if(this._walker.nextPointAndAngle(this._period,o)){const h=new it;this._walker.nextPointAndAngle(this._period,h)&&(i?(e.startPath(a.pt),i=!1):e.lineTo(a.pt),e.lineTo([a.pt[0]-this._height/2*a.sa,a.pt[1]+this._height/2*a.ca]),e.lineTo([o.pt[0]-this._height/2*o.sa,o.pt[1]+this._height/2*o.ca]),e.lineTo([o.pt[0]+this._height/2*o.sa,o.pt[1]-this._height/2*o.ca]),e.lineTo([h.pt[0]+this._height/2*h.sa,h.pt[1]-this._height/2*h.ca]),n=!0)}}if(!n){e.lineTo(this._walker.getPathEnd());break}}return e.path()}_constructTriangle(t){const e=new jt,s=this._walker.calculatePathLength(t);Math.round(s/this._period);let i=!0;for(;;){let n=!1;if(this._walker.curPositionIsValid()){const a=new it;this._walker.curPointAndAngle(a);const o=new it;if(this._walker.nextPointAndAngle(this._period/2,o)){const h=new it;this._walker.nextPointAndAngle(this._period,h)&&(this._walker.nextPosition(this._period/2)&&(i?(e.startPath(a.pt),i=!1):e.lineTo(a.pt),e.lineTo([o.pt[0]-this._height/2*o.sa,o.pt[1]+this._height/2*o.ca]),e.lineTo([h.pt[0]+this._height/2*h.sa,h.pt[1]-this._height/2*h.ca])),n=!0)}}if(!n){e.lineTo(this._walker.getPathEnd());break}}return e.path()}}class zt{static local(){return zt.instance===null&&(zt.instance=new zt),zt.instance}execute(t,e,s,i){return new Ir(t,e,s)}}zt.instance=null;class Ir extends fe{constructor(t,e,s){var i;super(t,!0,!0),this._geometryWalker=new Ae,this._geometryWalker.updateTolerance(s),this._angleToLine=(i=e.angleToLine)!=null?i:!0,this._offset=(e.offset?e.offset:0)*s,this._originalEndings=e.endings,this._offsetAtEnd=(e.customEndingOffset?e.customEndingOffset:0)*s,this._position=-(e.offsetAlongLine?e.offsetAlongLine:0)*s,this._pattern=new Ne,this._pattern.init(e.placementTemplate,!1),this._pattern.scale(s),this._endings=this._originalEndings}processPath(t){if(this._pattern.isEmpty())return null;let e;if(this.iteratePath)e=this._pattern.nextValue();else{this._originalEndings===st.WithFullGap&&this.isClosed?this._endings=st.WithMarkers:this._endings=this._originalEndings,this._pattern.extPtGap=0;let i,n=!0;switch(this._endings){case st.NoConstraint:i=-this._position,i=this._adjustPosition(i),n=!1;break;case st.WithHalfGap:default:i=-this._pattern.lastValue()/2;break;case st.WithFullGap:i=-this._pattern.lastValue(),this._pattern.extPtGap=this._pattern.lastValue();break;case st.WithMarkers:i=0;break;case st.Custom:i=-this._position,i=this._adjustPosition(i),this._pattern.extPtGap=.5*this._offsetAtEnd}if(!this._geometryWalker.init(t,this._pattern,n))return null;this._pattern.reset();let a=0;for(;i>a;)i-=a,a=this._pattern.nextValue();a-=i,e=a,this.iteratePath=!0}const s=new it;return this._geometryWalker.nextPointAndAngle(e,s)?this._endings===st.WithFullGap&&this._geometryWalker.isPathEnd()?(this.iteratePath=!1,null):this._endings===st.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(t){let e=t/this._pattern.length();return e-=Math.floor(e),e*this._pattern.length()}}class Ot{static local(){return Ot.instance===null&&(Ot.instance=new Ot),Ot.instance}execute(t,e,s,i){return new Lr(t,e,s)}}Ot.instance=null;class Lr extends fe{constructor(t,e,s){super(t,!1,!0),this._curveHelper=new tt,this._angleToLine=e.angleToLine===void 0||e.angleToLine,this._offset=e.offset!==void 0?e.offset*s:0,this._type=e.extremityPlacement,this._position=e.offsetAlongLine!==void 0?e.offsetAlongLine*s:0,this._beginProcessed=!1}processPath(t){let e;switch(this._type){case ct.Both:default:this._beginProcessed?(e=this._atExtremities(t,this._position,!1),this._beginProcessed=!1,this.iteratePath=!1):(e=this._atExtremities(t,this._position,!0),this._beginProcessed=!0,this.iteratePath=!0);break;case ct.JustBegin:e=this._atExtremities(t,this._position,!0);break;case ct.JustEnd:e=this._atExtremities(t,this._position,!1);case ct.None:}return e}_atExtremities(t,e,s){const i=t.length;if(i<2)return null;const n=s?1:i-2,a=s?i:-1,o=s?1:-1;let h,l=0,c=s?t[0]:t[i-1];for(let u=n;u!==a;u+=o){h=c,c=t[u];const f=this._curveHelper.calculateLength(h,c);if(l+f>e){const m=(e-l)/f,[_,p]=this._curveHelper.getAngleCS(h,c,m),d=Qe(h,c,m);return this.internalPlacement.setTranslate(d[0]-this._offset*p,d[1]+this._offset*_),this._angleToLine&&this.internalPlacement.setRotateCS(-_,-p),this.internalPlacement}l+=f}return null}}class Rt{static local(){return Rt.instance===null&&(Rt.instance=new Rt),Rt.instance}execute(t,e,s,i){return new Tr(t,e,s)}}Rt.instance=null;class Tr extends fe{constructor(t,e,s){super(t,!0,!0),this._walker=new Ae,this._walker.updateTolerance(s),this._angleToLine=e.angleToLine===void 0||e.angleToLine,this._offset=e.offset!==void 0?e.offset*s:0,this._beginGap=e.beginPosition!==void 0?e.beginPosition*s:0,this._endGap=e.endPosition!==void 0?e.endPosition*s:0,this._flipFirst=e.flipFirst===void 0||e.flipFirst,this._pattern=new Ne,this._pattern.init(e.positionArray,!1,!1),this._subPathLen=0,this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0}processPath(t){if(this._pattern.isEmpty())return null;let e;if(this.iteratePath){const o=this._pattern.nextValue()*this._subPathLen,h=this._beginGap+o;e=h-this._prevPos,this._prevPos=h}else{if(this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0,this._subPathLen=this._walker.calculatePathLength(t)-this._beginGap-this._endGap,this._subPathLen<0)return this.iteratePath=!1,null;if(!this._walker.init(t,this._pattern,!1))return null;this._pattern.reset();const o=this._pattern.nextValue()*this._subPathLen,h=this._beginGap+o;e=h-this._prevPos,this._prevPos=h,this.iteratePath=!0}const s=new it;if(!this._walker.nextPointAndAngle(e,s,lt.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,a;return this._angleToLine?(n=s.ca,a=s.sa):(n=1,a=0),i&&(n=-n,a=-a),this.internalPlacement.setRotateCS(n,a),this._isFirst=!1,this._posCount--,this._posCount===0&&(this.iteratePath=!1),this.internalPlacement}}function Nr(r){return r.rings!==void 0}class Et{static local(){return Et.instance===null&&(Et.instance=new Et),Et.instance}execute(t,e,s,i){return new Ar(t,e,s,i)}}Et.instance=null;class Ar{constructor(t,e,s,i){var n,a,o,h,l,c,u,f,m;if(this._xMin=0,this._xMax=0,this._yMin=0,this._yMax=0,this._currentX=0,this._currentY=0,this._stepX=Math.abs((n=e.stepX)!=null?n:16)*s,this._stepY=Math.abs((a=e.stepY)!=null?a:16)*s,this._stepX!==0&&this._stepY!==0&&t&&Nr(t)&&t.rings){if(this._gridType=(o=e.gridType)!=null?o:Oe.Fixed,this._gridType===Oe.Random){const _=(h=e.seed)!=null?h:13,p=1;this._randomLCG=new Rs(_*p),this._randomness=((l=e.randomness)!=null?l:100)/100,this._gridAngle=0,this._shiftOddRows=!1,this._cosAngle=1,this._sinAngle=0,this._offsetX=0,this._offsetY=0}else{if(this._randomness=0,this._gridAngle=(c=e.gridAngle)!=null?c:0,this._shiftOddRows=(u=e.shiftOddRows)!=null?u:!1,this._offsetX=((f=e.offsetX)!=null?f:0)*s,this._offsetY=((m=e.offsetY)!=null?m:0)*s,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}this._graphicOriginX=0,this._graphicOriginY=0,this._internalPlacement=new te,this._calculateMinMax(t),this._geometry=t}}next(){return this._geometry?this._nextInside():null}_calculateMinMax(t){let e,s,i,n,a,o,h,l;this._xMin=0,this._xMax=0,this._yMin=0,this._yMax=0,a=o=Number.MAX_VALUE,h=l=-Number.MAX_VALUE;for(const c of t.rings){const u=c?c.length:0;for(let f=0;f<u;++f)e=c[f][0]-this._graphicOriginX-this._offsetX,s=c[f][1]-this._graphicOriginY-this._offsetY,i=this._cosAngle*e-this._sinAngle*s,n=this._sinAngle*e+this._cosAngle*s,a=Math.min(a,i),h=Math.max(h,i),o=Math.min(o,n),l=Math.max(l,n)}a+=this._graphicOriginX,h+=this._graphicOriginX,o+=this._graphicOriginY,l+=this._graphicOriginY,this._xMin=Math.round(a/this._stepX),this._xMax=Math.round(h/this._stepX),this._yMin=Math.round(o/this._stepY),this._yMax=Math.round(l/this._stepY),this._currentX=this._xMax+1,this._currentY=this._yMin-1}_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 e=this._currentY*this._stepY+this._offsetY;let s,i;return this._currentX++,this._gridType===Oe.Random?(s=this._graphicOriginX+t+this._stepX*this._randomness*(.5-this._randomLCG.getFloat())*2/3,i=this._graphicOriginY+e+this._stepY*this._randomness*(.5-this._randomLCG.getFloat())*2/3):(s=this._graphicOriginX+this._cosAngle*t+this._sinAngle*e,i=this._graphicOriginY-this._sinAngle*t+this._cosAngle*e),this._internalPlacement.setTranslate(s,i),this._internalPlacement}}}const zr=.001;class $t{static local(){return $t.instance===null&&($t.instance=new $t),$t.instance}execute(t,e,s,i){return new Or(t,e,s)}}$t.instance=null;class Or extends fe{constructor(t,e,s){super(t,!0,!0),this._curveHelper=new tt,this._angleToLine=e.angleToLine===void 0||e.angleToLine,this._offset=e.offset!==void 0?e.offset*s:0,this._relativeTo=e.relativeTo,this._position=e.startPointOffset!==void 0?e.startPointOffset*s:0,this._epsilon=zr*s}processPath(t){const e=this._position;if(this._relativeTo===Bt.SegmentMidpoint){for(this.iteratePath||(this._segmentCount=t.length,this._curSegment=1,this.iteratePath=!0);this._curSegment<this._segmentCount;){const i=this._curSegment;this._curSegment++;const n=t[i-1],a=t[i],o=this._curveHelper.calculateLength(n,a);if(o<this._epsilon)continue;const h=.5+this._position/o,[l,c]=this._curveHelper.getAngleCS(n,a,h),u=Qe(n,a,h);return this.internalPlacement.setTranslate(u[0]-this._offset*c,u[1]+this._offset*l),this._angleToLine&&this.internalPlacement.setRotateCS(l,c),this.internalPlacement}return this.iteratePath=!1,null}this._relativeTo===Bt.LineEnd&&Ke(t);const s=this.onLine(t,e);return this._relativeTo===Bt.LineEnd&&Ke(t),s}onLine(t,e){let s,i=!1;switch(this._relativeTo){case Bt.LineMiddle:default:s=this._curveHelper.calculatePathLength(t)/2+e;break;case Bt.LineBeginning:s=e;break;case Bt.LineEnd:s=e,i=!0}const n=t.length;let a,o=0,h=t[0];for(let l=1;l<n;++l){a=h,h=t[l];const c=this._curveHelper.calculateLength(a,h);if(o+c>s){const u=(s-o)/c,[f,m]=this._curveHelper.getAngleCS(a,h,u),_=Qe(a,h,u),p=i?-this._offset:this._offset;return this.internalPlacement.setTranslate(_[0]-p*m,_[1]+p*f),this._angleToLine&&(i?this.internalPlacement.setRotateCS(-f,-m):this.internalPlacement.setRotateCS(f,m)),this.internalPlacement}o+=c}return null}}class Ft{static local(){return Ft.instance===null&&(Ft.instance=new Ft),Ft.instance}execute(t,e,s,i){return new Er(t,e,s)}}Ft.instance=null;const Rr=1e-15;class Er extends fe{constructor(t,e,s){super(t,!0,!0),this._curveHelper=new tt,this._angleToLine=e.angleToLine===void 0||e.angleToLine,this._offset=e.offset!==void 0?e.offset*s:0,this._endPoints=e.placeOnEndPoints===void 0||e.placeOnEndPoints,this._controlPoints=e.placeOnControlPoints===void 0||e.placeOnControlPoints,this._regularVertices=e.placeOnRegularVertices===void 0||e.placeOnRegularVertices,this._tags=[],this._tagIterator=0}processPath(t){if(this.iteratePath||(this._preparePath(t),this.iteratePath=!0),this._tagIterator>=this._tags.length)return this._tags.length=0,this._tagIterator=0,this.iteratePath=!1,null;const e=this._tags[this._tagIterator];this._angleToLine&&this.internalPlacement.setRotate(e[2]);let s=e[0],i=e[1];if(this._offset!==0){const n=Math.cos(e[2]),a=Math.sin(e[2]);s-=this._offset*a,i+=this._offset*n}return this.internalPlacement.setTranslate(s,i),this._tagIterator++,this.internalPlacement}_preparePath(t){this._tags.length=0,this._tagIterator=0;const e=ur(t),s=t.length-1;let i,n,a=0,o=0,h=0,l=0,c=0;for(;a<s;){a++,i=t[a-1],n=t[a];const u=he(i),f=he(n);(this._angleToLine||this._offset!==0)&&(l=this._curveHelper.getAngle(i,n,0)),a===1?e?(o=l,h=u):(this._endPoints||this._controlPoints&&u===1)&&this._tags.push([i[0],i[1],l]):u===1?this._controlPoints&&this._tags.push([i[0],i[1],Se(c,l)]):this._regularVertices&&this._tags.push([i[0],i[1],Se(c,l)]),(this._angleToLine||this._offset!==0)&&(c=this._curveHelper.getAngle(i,n,1)),a===s&&(e?f===1||h===1?this._controlPoints&&this._tags.push([n[0],n[1],Se(c,o)]):this._regularVertices&&this._tags.push([n[0],n[1],Se(c,o)]):(this._endPoints||this._controlPoints&&f===1)&&this._tags.push([n[0],n[1],c]))}this._tagIterator=0}}function Se(r,t){const e=Math.PI;for(;Math.abs(t-r)>e+2*Rr;)t-r>e?t-=2*e:t+=2*e;return(r+t)/2}class $r{constructor(t=Fr){this._data=[],this._compare=t}get size(){return this._data.length}enqueue(t){if(t==null)return;const{_data:e,_compare:s}=this;e.push(t);let i=e.length-1>>>0;const n=e[i];for(;i>0;){const a=i-1>>1,o=e[a];if(!(s(o,n)<=0))break;e[a]=n,e[i]=o,i=a}}dequeue(){const{_data:t,_compare:e}=this,s=t[0],i=t.pop();if(t.length===0)return s;t[0]=i;let n=0;const a=t.length,o=t[0];let h,l,c=null;for(;;){const u=2*n+1,f=2*n+2;if(c=null,u<a&&(h=t[u],e(h,o)>0&&(c=u)),f<a&&(l=t[f],(c===null&&e(l,o)<=0||c!==null&&e(l,h)<=0)&&(c=f)),c===null)break;t[n]=t[c],t[c]=o,n=c}return s}}const Fr=(r,t)=>r<t?-1:r>t?1:0,Gr=100*222045e-21;function Hr(r){const{rings:t}=r;if(!t||t.length===0)return null;const e=Zt(V(),r);if(!e)return null;const s=4*(Math.abs(e[0])+Math.abs(e[2])+Math.abs(e[1])+Math.abs(e[3])+1)*Gr;let i=0,n=0;for(let b=0;b<t.length;b++){const w=yi(t[b]);w>n&&(n=w,i=b)}if(Math.abs(n)<=2*s*s){const b=We(V(),t[i]);return[(b[0]+b[2])/2,(b[1]+b[3])/2]}const a=Pi(t[i],!1,V());if(a===null)return null;if(t.length===1&&t[0].length<4)return a;const o=[[NaN,NaN],[NaN,NaN],[NaN,NaN],[NaN,NaN]],h=[NaN,NaN,NaN,NaN],l=[NaN,NaN,NaN,NaN];let c=!1,u=re(a,r,!0);u.distance===0&&(c=!0,o[0][0]=a[0],o[0][1]=a[1],u=re(a,r,!1)),h[0]=u.distance,l[0]=0;const f=[NaN,NaN];let m=!1,_=.25,p=-1;const d=We(V(),t[i]);let g=NaN;do if(g=NaN,o[1]=Ge(r,He(d[0],d[2],_),s,e),isNaN(o[1][0])||isNaN(o[1][1])||(u=re(o[1],r,!1),g=u.distance),!isNaN(g)&&g>s&&Ie(o[1],r))m=!0,h[1]=g,l[1]=gt(o[1],a);else if(!isNaN(g)&&g>p&&(p=g,f[0]=o[1][0],f[1]=o[1][1]),_-=.01,_<.1){if(!(p>=0))break;m=!0,h[1]=p,o[1][0]=f[0],o[1][1]=f[1],l[1]=gt(o[1],a)}while(!m);m=!1,_=.5,p=-1;let y=.01,P=1;do if(g=NaN,o[2]=Ge(r,He(d[0],d[2],_),s,e),isNaN(o[2][0])||isNaN(o[2][1])||(u=re(o[2],r,!1),g=u.distance),!isNaN(g)&&g>s&&Ie(o[2],r))m=!0,h[2]=g,l[2]=gt(o[2],a);else if(!isNaN(g)&&g>p)p=g,f[0]=o[2][0],f[1]=o[2][1];else if(g>p&&(p=g,f[0]=o[2][0],f[1]=o[2][1]),_=.5+y*P,y+=.01,P*=-1,_<.3||_>.7){if(!(p>=0))break;m=!0,h[2]=p,o[2][0]=f[0],o[2][1]=f[1],l[2]=gt(o[2],a)}while(!m);m=!1,_=.75,p=-1;do if(g=NaN,o[3]=Ge(r,He(d[0],d[2],_),s,e),isNaN(o[3][0])||isNaN(o[3][1])||(u=re(o[3],r,!1),g=u.distance),!isNaN(g)&&g>s&&Ie(o[3],r))m=!0,h[3]=g,l[3]=gt(o[3],a);else if(g>p&&(p=g,f[0]=o[3][0],f[1]=o[3][1]),_+=.01,_>.9){if(!(p>=0))break;m=!0,h[3]=p,o[3][0]=f[0],o[3][1]=f[1],l[3]=gt(o[3],a)}while(!m);const x=[0,1,2,3],M=c?0:1;let k;for(let b=M;b<4;b++)for(let w=M;w<3;w++){const N=l[w],H=l[w+1];Yr(N,H)>0&&(k=x[w],x[w]=x[w+1],x[w+1]=k,l[w]=H,l[w+1]=N)}let v=M,T=0,L=0;for(let b=M;b<4;b++){switch(b){case 0:L=2*h[x[b]];break;case 1:L=1.66666666*h[x[b]];break;case 2:L=1.33333333*h[x[b]];break;case 3:L=h[x[b]]}L>T&&(T=L,v=x[b])}return o[v]}function Ie(r,t){const{rings:e}=t;let s=0;for(const i of e){const n=i.length;for(let a=1;a<n;++a){const o=i[a-1],h=i[a];o[1]>r[1]!=h[1]>r[1]&&((h[0]-o[0])*(r[1]-o[1])-(h[1]-o[1])*(r[0]-o[0])>0?s++:s--)}}return s!==0}function re(r,t,e){if(e&&Ie(r,t))return{coord:r,distance:0};let s=1/0,i=0,n=0;const a=[0,0],{rings:o}=t;for(const h of o)if(!(h.length<2))for(let l=0;l<h.length-1;l++){xi(a,r,h,l);const c=gt(r,a);c<s&&(s=c,i=a[0],n=a[1])}return{coord:[i,n],distance:Math.sqrt(s)}}function Ge(r,t,e,s){const i=[t,0];let n=1/0,a=1/0,o=!1,h=!1;const l=[[t,s[1]-1],[t,s[3]+1]],c=[0,0],u=[0,0],f=[0,0],m=[[0,0],[0,0]],_=V(),{rings:p}=r;for(const d of p)if(!(d.length<2))for(let g=1;g<d.length;g++){if(m[0][0]=d[g-1][0],m[0][1]=d[g-1][1],m[1][0]=d[g][0],m[1][1]=d[g][1],Dr(_,m)===null||(u[0]=l[0][0],u[1]=l[0][1],f[0]=l[1][0],f[1]=l[1][1],Xr(_,u,f)===0)||!bi(l[0],l[1],m[0],m[1],c))continue;const y=c[1];n>a?y<n&&(n=y,o=!0):y<a&&(a=y,h=!0)}return o&&h?i[1]=(n+a)/2:i[0]=i[1]=NaN,i}function Dr(r,t){if(t.length<2)return null;r||(r=V());const[e,s]=t[0],[i,n]=t[1];return r[0]=Math.min(e,i),r[1]=Math.min(s,n),r[2]=Math.max(e,i),r[3]=Math.max(s,n),r}const Ce=1,we=4,bs=3,Ms=12;function Xr(r,t,e){let s=j(t,r),i=j(e,r);const n=r[0],a=r[1],o=r[2],h=r[3];if(s&i)return 0;if(!(s|i))return 4;const l=(s?1:0)|(i?2:0);do{const c=e[0]-t[0],u=e[1]-t[1];if(c>u)s&bs?(s&Ce?(t[1]+=u*(n-t[0])/c,t[0]=n):(t[1]+=u*(o-t[0])/c,t[0]=o),s=j(t,r)):i&bs?(i&Ce?(e[1]+=u*(n-e[0])/c,e[0]=n):(e[1]+=u*(o-e[0])/c,e[0]=o),i=j(e,r)):s?(s&we?(t[0]+=c*(a-t[1])/u,t[1]=a):(t[0]+=c*(h-t[1])/u,t[1]=h),s=j(t,r)):(i&we?(e[0]+=c*(a-e[1])/u,e[1]=a):(e[0]+=c*(h-e[1])/u,e[1]=h),i=j(e,r));else if(s&Ms?(s&we?(t[0]+=c*(a-t[1])/u,t[1]=a):(t[0]+=c*(h-t[1])/u,t[1]=h),s=j(t,r)):i&Ms?(i&we?(e[0]+=c*(a-e[1])/u,e[1]=a):(e[0]+=c*(h-e[1])/u,e[1]=h),i=j(e,r)):s?(s&Ce?(t[1]+=u*(n-t[0])/c,t[0]=n):(t[1]+=u*(o-t[0])/c,t[0]=o),s=j(t,r)):(i&Ce?(e[1]+=u*(n-e[0])/c,e[0]=n):(e[1]+=u*(o-e[0])/c,e[0]=o),i=j(e,r)),s&i)return 0}while(s|i);return l}function j(r,t){return(r[0]<t[0]?1:0)|(r[0]>t[2]?1:0)<<1|(r[1]<t[1]?1:0)<<2|(r[1]>t[3]?1:0)<<3}function He(r,t,e){return r+(t-r)*e}function gt(r,t){return(r[0]-t[0])*(r[0]-t[0])+(r[1]-t[1])*(r[1]-t[1])}function Yr(r,t){if(r<t)return-1;if(r>t)return 1;if(r===t)return 0;const e=isNaN(r),s=isNaN(t);return e<s?-1:e>s?1:0}class Ut{constructor(t,e,s,i){this.x=t,this.y=e,this.cellSize=s,this.distancefromCellCenter=Ci(t,e,i),this.maxDistanceToPolygon=this.distancefromCellCenter+this.cellSize*Math.SQRT2}}const Vr=1,Br=100;function Wr(r){if(!r||!r.rings||r.rings.length===0)return null;const t=We(V(),r.rings[0]);if(!t)return null;const e=t[2]-t[0],s=t[3]-t[1];if(e===0||s===0)return[t[0]+e/2,t[1]+s/2];const i=Math.max(Math.min(e,s)/Br,Vr),n=new $r((m,_)=>_.maxDistanceToPolygon-m.maxDistanceToPolygon),a=Math.min(e,s);let o=a/2,h=0,l=0;for(h=t[0];h<t[2];h+=a)for(l=t[1];l<t[3];l+=a)n.enqueue(new Ut(h+o,l+o,o,r));const c=Mi(r.rings,!1);if(c===null)return null;let u,f=new Ut(c[0],c[1],0,r);for(;n.size>0;)u=Si(n.dequeue()),u.distancefromCellCenter>f.distancefromCellCenter&&(f=u),u.maxDistanceToPolygon-f.distancefromCellCenter<=i||(o=u.cellSize/2,n.enqueue(new Ut(u.x-o,u.y-o,o,r)),n.enqueue(new Ut(u.x+o,u.y-o,o,r)),n.enqueue(new Ut(u.x-o,u.y+o,o,r)),n.enqueue(new Ut(u.x+o,u.y+o,o,r)));return[f.x,f.y]}function Ur(r){return r.rings!==void 0}class Gt{static local(){return Gt.instance===null&&(Gt.instance=new Gt),Gt.instance}execute(t,e,s,i){return new qr(t,e,s)}}Gt.instance=null;class qr{constructor(t,e,s){this._geometry=t,this._offsetX=e.offsetX!==void 0?e.offsetX*s:0,this._offsetY=e.offsetY!==void 0?e.offsetY*s:0,this._method=e.method!==void 0?e.method:ye.OnPolygon,this._internalPlacement=new te}next(){const t=this._geometry;return this._geometry=null,t&&Ur(t)?this._polygonCenter(t):null}_polygonCenter(t){let e=!1;switch(this._method){case ye.CenterOfMass:{const s=ki(t);s&&(this._internalPlacement.setTranslate(s[0]+this._offsetX,s[1]+this._offsetY),e=!0)}break;case ye.BoundingBoxCenter:{const s=V();Zt(s,t),s&&(this._internalPlacement.setTranslate((s[2]+s[0])/2+this._offsetX,(s[3]+s[1])/2+this._offsetY),e=!0)}break;case ye.OnPolygon:default:{let s;s=wi("polylabel-placement-enabled")?Wr(t):Hr(t),s!==null&&(this._internalPlacement.setTranslate(s[0]+this._offsetX,s[1]+this._offsetY),e=!0)}}return e?this._internalPlacement:null}}function Ze(r){if(!r)return null;switch(r.type){case"CIMGeometricEffectAddControlPoints":return Pt.local();case"CIMGeometricEffectArrow":return xt.local();case"CIMGeometricEffectBuffer":return bt.local();case"CIMGeometricEffectControlMeasureLine":return Mt.local();case"CIMGeometricEffectCut":return St.local();case"CIMGeometricEffectDashes":return Ct.local();case"CIMGeometricEffectDonut":return wt.local();case"CIMGeometricEffectJog":return kt.local();case"CIMGeometricEffectMove":return vt.local();case"CIMGeometricEffectOffset":return It.local();case"CIMGeometricEffectReverse":return Lt.local();case"CIMGeometricEffectRotate":return Tt.local();case"CIMGeometricEffectScale":return Nt.local();case"CIMGeometricEffectWave":return At.local()}return null}function Jr(r){if(!r)return null;switch(r.type){case"CIMMarkerPlacementAlongLineSameSize":return zt.local();case"CIMMarkerPlacementAtExtremities":return Ot.local();case"CIMMarkerPlacementAtRatioPositions":return Rt.local();case"CIMMarkerPlacementInsidePolygon":return Et.local();case"CIMMarkerPlacementOnLine":return $t.local();case"CIMMarkerPlacementOnVertices":return Ft.local();case"CIMMarkerPlacementPolygonCenter":return Gt.local()}return null}function De(r){const t=r.getFrame(0);if(t instanceof HTMLImageElement||t instanceof HTMLCanvasElement)return t;const e=document.createElement("canvas");e.width=r.width,e.height=r.height;const s=e.getContext("2d");return t instanceof ImageData?s.putImageData(t,0,0):s.drawImage(t,0,0),e}class ti{constructor(t=0,e=0,s=0,i=0){this.x=t,this.y=e,this.width=s,this.height=i}get isEmpty(){return this.width<=0||this.height<=0}union(t){this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.width=Math.max(this.width,t.width),this.height=Math.max(this.height,t.height)}}function jr(r){return`rgb(${r.slice(0,3).toString()})`}function Kr(r){return`rgba(${r.slice(0,3).toString()},${r[3]})`}class ei{constructor(t){t&&(this._textRasterizationCanvas=t)}rasterizeText(t,e){var T;this._textRasterizationCanvas||(this._textRasterizationCanvas=document.createElement("canvas"));const s=this._textRasterizationCanvas,i=s.getContext("2d");this._setFontProperties(i,e),this._parameters=e,this._textLines=t.split(/\r?\n/),this._lineHeight=this._computeLineHeight();const n=this._computeTextWidth(i,e),{decoration:a,weight:o}=e.font;this._lineThroughWidthOffset=a&&a==="line-through"?.1*this._lineHeight:0;const h=this._lineHeight*this._textLines.length;s.width=n+2*this._lineThroughWidthOffset,s.height=h,this._renderedLineHeight=Math.round(this._lineHeight*e.pixelRatio),this._renderedHaloSize=e.halo.size*e.pixelRatio,this._renderedWidth=n*e.pixelRatio,this._renderedHeight=h*e.pixelRatio,this._lineThroughWidthOffset*=e.pixelRatio;const l=(T=e.color)!=null?T:[0,0,0,0],c=e.halo&&e.halo.color?e.halo.color:[0,0,0,0];this._fillStyle=Kr(l),this._haloStyle=jr(c);const u=this._renderedLineHeight,f=this._renderedHaloSize;i.save(),i.clearRect(0,0,s.width,s.height),this._setFontProperties(i,e);const m=Qr(i.textAlign,this._renderedWidth)+f,_=f,p=f>0;let d=this._lineThroughWidthOffset,g=0;p&&this._renderHalo(i,m,_,d,g,e),g+=_,d+=m;for(const L of this._textLines)p?(i.globalCompositeOperation="destination-out",i.fillStyle="rgb(0, 0, 0)",i.fillText(L,d,g),i.globalCompositeOperation="source-over",i.fillStyle=this._fillStyle,i.fillText(L,d,g)):(i.fillStyle=this._fillStyle,i.fillText(L,d,g)),a&&a!=="none"&&this._renderDecoration(i,d,g,a,o),g+=u;i.restore();const y=this._renderedWidth+2*this._lineThroughWidthOffset,P=this._renderedHeight,x=i.getImageData(0,0,y,P),M=new Uint8Array(x.data);if(e.premultiplyColors){let L;for(let b=0;b<M.length;b+=4)L=M[b+3]/255,M[b]=M[b]*L,M[b+1]=M[b+1]*L,M[b+2]=M[b+2]*L}let k,v;switch(e.horizontalAlignment){case"left":k=-.5;break;case"right":k=.5;break;default:k=0}switch(e.verticalAlignment){case"bottom":v=-.5;break;case"top":v=.5;break;default:v=0}return{size:[y,P],image:new Uint32Array(M.buffer),sdf:!1,simplePattern:!1,anchorX:k,anchorY:v,canvas:s}}_renderHalo(t,e,s,i,n,a){const o=this._renderedWidth,h=this._renderedHeight;this._haloRasterizationCanvas||(this._haloRasterizationCanvas=document.createElement("canvas")),this._haloRasterizationCanvas.width=o,this._haloRasterizationCanvas.height=h;const l=this._haloRasterizationCanvas,c=l.getContext("2d");c.clearRect(0,0,o,h),this._setFontProperties(c,a);const{decoration:u,weight:f}=a.font;c.fillStyle=this._haloStyle,c.strokeStyle=this._haloStyle,c.lineJoin="round",this._renderHaloNative(c,e,s,u,f),t.globalAlpha=this._parameters.halo.color[3],t.drawImage(l,0,0,o,h,i,n,o,h),t.globalAlpha=1}_renderHaloNative(t,e,s,i,n){const a=this._renderedLineHeight,o=this._renderedHaloSize;for(const h of this._textLines){const l=2*o,c=5,u=.1;for(let f=0;f<c;f++){const m=(1-(c-1)*u+f*u)*l;t.lineWidth=m,t.strokeText(h,e,s),i&&i!=="none"&&this._renderDecoration(t,e,s,i,n,m)}s+=a}}_setFontProperties(t,e){const s=Math.max(e.size,.5),i=e.font,n=`${i.style} ${i.weight} ${Kt(s*e.pixelRatio).toFixed(1)}px ${i.family}, sans-serif`;let a;switch(t.font=n,t.textBaseline="top",e.horizontalAlignment){case"left":default:a="left";break;case"right":a="right";break;case"center":a="center"}t.textAlign=a}computeTextSize(t,e){this._textRasterizationCanvas||(this._textRasterizationCanvas=document.createElement("canvas"));const s=this._textRasterizationCanvas,i=s.getContext("2d");this._setFontProperties(i,e),this._parameters=e,this._textLines=t.split(/\r?\n/),this._lineHeight=this._computeLineHeight();const n=this._computeTextWidth(i,e),a=this._lineHeight*this._textLines.length;return s.width=n,s.height=a,[n*e.pixelRatio,a*e.pixelRatio]}_computeTextWidth(t,e){let s=0;for(const n of this._textLines)s=Math.max(s,t.measureText(n).width);const i=e.font;return(i.style==="italic"||i.style==="oblique"||typeof i.weight=="string"&&(i.weight==="bold"||i.weight==="bolder")||typeof i.weight=="number"&&i.weight>600)&&(s+=.3*t.measureText("w").width),s+=2*this._parameters.halo.size,Math.round(s)}_computeLineHeight(){let t=1.275*this._parameters.size;const e=this._parameters.font.decoration;return e&&e==="underline"&&(t*=1.3),Math.round(t+2*this._parameters.halo.size)}_renderDecoration(t,e,s,i,n,a){const o=.9*this._lineHeight,h=n==="bold"?.06:n==="bolder"?.09:.04;switch(t.textAlign){case"center":e-=this._renderedWidth/2;break;case"right":e-=this._renderedWidth}const l=t.textBaseline;if(i==="underline")switch(l){case"top":s+=o;break;case"middle":s+=o/2}else if(i==="line-through")switch(l){case"top":s+=o/1.5;break;case"middle":s+=o/3}const c=a?1.5*a:Math.ceil(o*h);t.save(),t.beginPath(),t.strokeStyle=t.fillStyle,t.lineWidth=c,t.moveTo(e-this._lineThroughWidthOffset,s),t.lineTo(e+this._renderedWidth+2*this._lineThroughWidthOffset,s),t.stroke(),t.restore()}}function Qr(r,t){return r==="center"?.5*t:r==="right"?t:0}class Ht{constructor(t,e,s,i){this.center=vi(t,e),this.centerT=Ue(),this.halfWidth=s/2,this.halfHeight=i/2,this.width=s,this.height=i}get x(){return this.center[0]}get y(){return this.center[1]}get blX(){return this.center[0]+this.halfWidth}get blY(){return this.center[1]+this.halfHeight}get trX(){return this.center[0]-this.halfWidth}get trY(){return this.center[1]-this.halfHeight}get xmin(){return this.x-this.halfWidth}get xmax(){return this.x+this.halfWidth}get ymin(){return this.y-this.halfHeight}get ymax(){return this.y+this.halfHeight}set x(t){this.center[0]=t}set y(t){this.center[1]=t}clone(){return new Ht(this.x,this.y,this.width,this.height)}serialize(t){return t.writeF32(this.center[0]),t.writeF32(this.center[1]),t.push(this.width),t.push(this.height),t}findCollisionDelta(t,e=4){const s=Math.abs(t.centerT[0]-this.centerT[0]),i=Math.abs(t.centerT[1]-this.centerT[1]),n=(t.halfWidth+this.halfWidth+e)/s,a=(t.halfHeight+this.halfHeight+e)/i,o=Math.min(n,a);return Math.log2(o)}extend(t){const e=Math.min(this.xmin,t.xmin),s=Math.min(this.ymin,t.ymin),i=Math.max(this.xmax,t.xmax)-e,n=Math.max(this.ymax,t.ymax)-s,a=e+i/2,o=s+n/2;this.width=i,this.height=n,this.halfWidth=i/2,this.halfHeight=n/2,this.x=a,this.y=o}static deserialize(t){const e=t.readF32(),s=t.readF32(),i=t.readInt32(),n=t.readInt32();return new Ht(e,s,i,n)}}const ns=26,si=4,Zr=ns+si,tn=ns-6,Ss=3,ht=8,en=Math.PI/180;class ii{constructor(t,e,s,i){this._rotationT=oe(),this._xBounds=0,this._yBounds=0,this.minZoom=0,this.maxZoom=255,this._bounds=null;const n=s.rect,a=new Float32Array(8);t*=i,e*=i;const o=s.code?n.width*i:s.metrics.width,h=s.code?n.height*i:s.metrics.height;a[0]=t,a[1]=e,a[2]=t+o,a[3]=e,a[4]=t,a[5]=e+h,a[6]=t+o,a[7]=e+h,this._data=a,this._setTextureCoords(n),this._scale=i,this._mosaic=s,this.x=t,this.y=e,this.maxOffset=Math.max(t+o,e+h)}get width(){return this._mosaic.metrics.width*this._scale}get mosaic(){return this._mosaic}set angle(t){this._angle=t,Es(this._rotationT,-t),this._setOffsets(this._data)}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._data),this._offsets}get char(){return String.fromCharCode(this._mosaic.code)}get code(){return this._mosaic.code}get bounds(){if(!this._bounds){const{height:t,width:e}=this._mosaic.metrics,s=e*this._scale,i=Math.abs(t)*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 a=qe(oe(),this._rotationT,this._transform);fs(n,n,a);let o=1/0,h=1/0,l=0,c=0;for(let p=0;p<4;p++){const d=n[2*p],g=n[2*p+1];o=Math.min(o,d),h=Math.min(h,g),l=Math.max(l,d),c=Math.max(c,g)}const u=l-o,f=c-h,m=o+u/2,_=h+f/2;this._bounds=new Ht(m,_,u,f)}return this._bounds}setTransform(t){this._transform=t,this._offsets=null}_setOffsets(t){this._offsets||(this._offsets={upperLeft:0,upperRight:0,lowerLeft:0,lowerRight:0});const e=this._offsets,s=new Float32Array(8),i=qe(oe(),this._rotationT,this._transform);fs(s,t,i),e.upperLeft=ot(s[0]*ht,s[1]*ht),e.upperRight=ot(s[2]*ht,s[3]*ht),e.lowerLeft=ot(s[4]*ht,s[5]*ht),e.lowerRight=ot(s[6]*ht,s[7]*ht)}_setTextureCoords({x:t,y:e,width:s,height:i}){this._texcoords={upperLeft:ot(t,e),upperRight:ot(t+s,e),lowerLeft:ot(t,e+i),lowerRight:ot(t+s,e+i)}}}const sn=(r,t)=>({code:0,page:0,sdf:!0,rect:new Yi(0,0,11,8),textureBinding:t,metrics:{advance:0,height:4,width:r,left:0,top:0}});class rn{constructor(t,e,s){this._rotation=0,this._decorate(t,e,s),this.glyphs=t,this.bounds=this._createBounds(t),this.isMultiline=e.length>1,this._hasRotation=s.angle!==0,this._transform=this._createGlyphTransform(this.bounds,s);for(const i of t)i.setTransform(this._transform)}setRotation(t){if(t===0&&this._rotation===0)return;this._rotation=t;const e=this._transform,s=Es(oe(),t);qe(e,s,e);for(const i of this.glyphs)i.setTransform(this._transform)}_decorate(t,e,s){if(!s.decoration||s.decoration==="none"||!t.length)return;const i=s.scale,n=s.decoration==="underline"?Zr:tn,a=t[0].textureBinding;for(const o of e){const h=o.startX*i,l=o.startY*i,c=(o.width+o.glyphWidthEnd)*i;t.push(new ii(h,l+n*i,sn(c,a),1))}}get boundsT(){const t=this.bounds,e=_e(Ue(),t.x,t.y);if(Ii(e,e,this._transform),this._hasRotation){const s=Math.max(t.width,t.height);return new Ht(e[0],e[1],s,s)}return new Ht(e[0],e[1],t.width,t.height)}_createBounds(t){let e=1/0,s=1/0,i=0,n=0;for(const h of t)e=Math.min(e,h.xTopLeft),s=Math.min(s,h.yTopLeft),i=Math.max(i,h.xTopLeft+h.width),n=Math.max(n,h.yBottomRight);const a=i-e,o=n-s;return new Ht(e+a/2,s+o/2,a,o)}_createGlyphTransform(t,e){const s=en*e.angle,i=oe(),n=Ue();return ze(i,i,_e(n,e.xOffset,-e.yOffset)),e.isCIM?ms(i,i,s):(ze(i,i,_e(n,t.x,t.y)),ms(i,i,s),ze(i,i,_e(n,-t.x,-t.y))),i}}class ke{constructor(t,e,s,i,n,a){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(e,s)),this.end=Math.max(0,Math.max(e,s)),this.end<t.length&&(this.glyphWidthEnd=t[this.end].metrics.width),this.width=i,this.yMin=n,this.yMax=a}}const ts=r=>r===10,Cs=r=>r===32;function nn(r,t,e){const s=new Array,i=1/e.scale,n=e.maxLineWidth*i,a=t?r.length-1:0,o=t?-1:r.length,h=t?-1:1;let l=a,c=0,u=0,f=l,m=f,_=0,p=1/0,d=0;for(;l!==o;){const{code:y,metrics:P}=r[l],x=Math.abs(P.top);if(ts(y)||Cs(y)||(p=Math.min(p,x),d=Math.max(d,x+P.height)),ts(y))l!==a&&(s.push(new ke(r,f,l-h,c,p,d)),p=1/0,d=0),c=0,f=l+h,m=l+h,u=0;else if(Cs(y))m=l+h,u=0,_=P.advance,c+=P.advance;else if(c>n){if(m!==f){const M=m-2*h;c-=_,s.push(new ke(r,f,M,c-u,p,d)),p=1/0,d=0,f=m,c=u}else s.push(new ke(r,f,l-h,c,p,d)),p=1/0,d=0,f=l,m=l,c=0;c+=P.advance,u+=P.advance}else c+=P.advance,u+=P.advance;l+=h}const g=new ke(r,f,l-h,c,p,d);return g.start>=0&&g.end<r.length&&s.push(g),s}function an(r,t){let e=0;for(let n=0;n<r.length;n++){const{width:a}=r[n];e=Math.max(a,e)}const s=t.decoration==="underline"?si:0,i=r[0].yMin;return{x:0,y:i,height:r[r.length-1].yMax+t.lineHeight*(r.length-1)+s-i,width:e}}function ri(r,t,e){const s=e.scale,i=new Array,n=nn(r,t,e),a=an(n,e),{vAlign:o,hAlign:h}=e,l=o===ae.Baseline?1:0,c=l?0:o-1,u=(1-l)*-a.y+c*(a.height/2)+(l?1:0)*-ns;for(let f=0;f<n.length;f++){const{start:m,end:_,width:p}=n[f];let d=-1*(h+1)*(p/2)-Ss;const g=f*e.lineHeight+u-Ss;n[f].startX=d,n[f].startY=g;for(let y=m;y<=_;y++){const P=r[y];if(ts(P.code))continue;const x=new ii(d+P.metrics.left,g-P.metrics.top,P,s);d+=P.metrics.advance,i.push(x)}}return new rn(i,n,e)}const dt=Math.PI/180,on=10,ni=ce.getLogger("esri.symbols.cim.CIMSymbolDrawHelper");class F{constructor(t){this._t=t}static createIdentity(){return new F([1,0,0,0,1,0])}clone(){const t=this._t;return new F(t.slice())}transform(t){const e=this._t;return[e[0]*t[0]+e[1]*t[1]+e[2],e[3]*t[0]+e[4]*t[1]+e[5]]}static createScale(t,e){return new F([t,0,0,0,e,0])}scale(t,e){const s=this._t;return s[0]*=t,s[1]*=t,s[2]*=t,s[3]*=e,s[4]*=e,s[5]*=e,this}scaleRatio(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])}static createTranslate(t,e){return new F([0,0,t,0,0,e])}translate(t,e){const s=this._t;return s[2]+=t,s[5]+=e,this}static createRotate(t){const e=Math.cos(t),s=Math.sin(t);return new F([e,-s,0,s,e,0])}rotate(t){return F.multiply(this,F.createRotate(t),this)}angle(){const t=this._t[0],e=this._t[3],s=Math.sqrt(t*t+e*e);return[t/s,e/s]}static multiply(t,e,s){const i=t._t,n=e._t,a=i[0]*n[0]+i[3]*n[1],o=i[1]*n[0]+i[4]*n[1],h=i[2]*n[0]+i[5]*n[1]+n[2],l=i[0]*n[3]+i[3]*n[4],c=i[1]*n[3]+i[4]*n[4],u=i[2]*n[3]+i[5]*n[4]+n[5],f=s._t;return f[0]=a,f[1]=o,f[2]=h,f[3]=l,f[4]=c,f[5]=u,s}invert(){const t=this._t;let e=t[0]*t[4]-t[1]*t[3];if(e===0)return new F([0,0,0,0,0,0]);e=1/e;const s=(t[1]*t[5]-t[2]*t[4])*e,i=(t[2]*t[3]-t[0]*t[5])*e,n=t[4]*e,a=-t[1]*e,o=-t[3]*e,h=t[0]*e;return new F([n,a,s,o,h,i])}}class as{constructor(t,e){this._resourceManager=t,this._transfos=[],this._sizeTransfos=[],this._geomUnitsPerPoint=1,this._placementPool=new Ti(te,void 0,void 0,100),this._earlyReturn=!1,this._mapRotation=0,this._transfos.push(e||F.createIdentity()),this._sizeTransfos.push(e?e.scaleRatio():1)}setTransform(t,e){this._transfos=[t||F.createIdentity()],this._sizeTransfos=[e||(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]}getTransformAngle(){return this._transfos[this._transfos.length-1].angle()}geomUnitsPerPoint(){return this.isEmbedded()?1:this._geomUnitsPerPoint}isEmbedded(){return this._transfos.length>1}back(){return this._transfos[this._transfos.length-1]}push(t,e){const s=e?t.scaleRatio():1;F.multiply(t,this.back(),t),this._transfos.push(t),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*s)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1)}drawSymbol(t,e,s){if(t)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(t,e);break;case"CIMTextSymbol":this.drawTextSymbol(t,e,s)}}drawMultiLayerSymbol(t,e){if(!t)return;const s=t.symbolLayers;if(!s)return;const i=t.effects;if(i&&i.length>0){const n=this.executeEffects(i,e);if(n){let a=n.next();for(;a;)this.drawSymbolLayers(s,a),a=n.next()}}else this.drawSymbolLayers(s,e)}executeEffects(t,e){const s=this._resourceManager.geometryEngine;let i=new je(e);for(const n of t){const a=Ze(n);a&&(i=a.execute(i,n,this.geomUnitsPerPoint(),s))}return i}drawSymbolLayers(t,e){let s=t.length;for(;s--;){const i=t[s];if(!i||i.enable===!1)continue;const n=i.effects;if(n&&n.length>0){const a=this.executeEffects(n,e);if(a){let o=null;for(;(o=a.next())&&(this.drawSymbolLayer(i,o),!this._earlyReturn););}}else this.drawSymbolLayer(i,e);if(this._earlyReturn)return}}drawSymbolLayer(t,e){switch(t.type){case"CIMSolidFill":this.drawSolidFill(e,t.color);break;case"CIMHatchFill":this.drawHatchFill(e,t);break;case"CIMPictureFill":this.drawPictureFill(e,t);break;case"CIMGradientFill":this.drawGradientFill(e,t);break;case"CIMSolidStroke":this.drawSolidStroke(e,t.color,t.width,t.capStyle,t.joinStyle,t.miterLimit);break;case"CIMPictureStroke":this.drawPictureStroke(e,t);break;case"CIMGradientStroke":this.drawGradientStroke(e,t);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":this.drawMarkerLayer(t,e)}}drawHatchFill(t,e){const s=this._buildHatchPolyline(e,t,this.geomUnitsPerPoint());s&&(this.pushClipPath(t),this.drawMultiLayerSymbol(e.lineSymbol,s),this.popClipPath())}drawPictureFill(t,e){}drawGradientFill(t,e){}drawPictureStroke(t,e){}drawGradientStroke(t,e){}drawMarkerLayer(t,e){const s=t.markerPlacement;if(s){const i=Jr(s);if(i){const n=s.type==="CIMMarkerPlacementInsidePolygon"||s.type==="CIMMarkerPlacementPolygonCenter"&&s.clipAtBoundary;n&&this.pushClipPath(e);const a=i.execute(e,s,this.geomUnitsPerPoint(),this._resourceManager.geometryEngine);if(a){let o=null;for(;(o=a.next())&&(this.drawMarker(t,o),!this._earlyReturn););}n&&this.popClipPath()}}else{const i=this._placementPool.acquire();if(ut(e))i.tx=e.x,i.ty=e.y,this.drawMarker(t,i);else if(z(e))[i.tx,i.ty]=Ni(e),this.drawMarker(t,i);else for(const n of e.points)if(i.tx=n[0],i.ty=n[1],this.drawMarker(t,i),this._earlyReturn)break;this._placementPool.release(i)}}drawMarker(t,e){switch(t.type){case"CIMCharacterMarker":case"CIMPictureMarker":this.drawPictureMarker(t,e);break;case"CIMVectorMarker":this.drawVectorMarker(t,e)}}drawPictureMarker(t,e){var d,g,y,P,x;if(!t)return;const s=this._resourceManager.getResource(t.url),i=(d=t.size)!=null?d:10;if(at(s)||i<=0)return;const n=s.width,a=s.height;if(!n||!a)return;const o=n/a,h=(g=t.scaleX)!=null?g:1,l=F.createIdentity(),c=t.anchorPoint;if(c){let M=c.x,k=c.y;t.anchorPointUnits!=="Absolute"&&(M*=i*o*h,k*=i),l.translate(-M,-k)}let u=(y=t.rotation)!=null?y:0;t.rotateClockwise&&(u=-u),this._mapRotation&&(u+=this._mapRotation),u&&l.rotate(u*dt);let f=(P=t.offsetX)!=null?P:0,m=(x=t.offsetY)!=null?x:0;if(f||m){if(this._mapRotation){const M=dt*this._mapRotation,k=Math.cos(M),v=Math.sin(M),T=f*v+m*k;f=f*k-m*v,m=T}l.translate(f,m)}const _=this.geomUnitsPerPoint();_!==1&&l.scale(_,_);const p=e.getAngle();p&&l.rotate(p),l.translate(e.tx,e.ty),this.push(l,!1),this.drawImage(t,i),this.pop()}drawVectorMarker(t,e){var p,d,g,y;if(!t)return;const s=t.markerGraphics;if(!s)return;const i=(p=t.size)!=null?p:10,n=t.frame,a=n?n.ymax-n.ymin:0,o=i&&a?i/a:1,h=F.createIdentity();n&&h.translate(.5*-(n.xmax+n.xmin),.5*-(n.ymax+n.ymin));const l=t.anchorPoint;if(l){let P=l.x,x=l.y;t.anchorPointUnits!=="Absolute"?n&&(P*=n.xmax-n.xmin,x*=n.ymax-n.ymin):(P/=o,x/=o),h.translate(-P,-x)}o!==1&&h.scale(o,o);let c=(d=t.rotation)!=null?d:0;t.rotateClockwise&&(c=-c),this._mapRotation&&(c+=this._mapRotation),c&&h.rotate(c*dt);let u=(g=t.offsetX)!=null?g:0,f=(y=t.offsetY)!=null?y:0;if(u||f){if(this._mapRotation){const P=dt*this._mapRotation,x=Math.cos(P),M=Math.sin(P),k=u*M+f*x;u=u*x-f*M,f=k}h.translate(u,f)}const m=this.geomUnitsPerPoint();m!==1&&h.scale(m,m);const _=e.getAngle();_&&h.rotate(_),h.translate(e.tx,e.ty),this.push(h,t.scaleSymbolsProportionally);for(const P of s)if(P&&P.symbol&&P.geometry||ni.error("Invalid marker graphic",P),this.drawSymbol(P.symbol,P.geometry,P.textString),this._earlyReturn)break;this.pop()}drawTextSymbol(t,e,s){var l,c,u,f;if(!t||!ut(e)||((l=t.height)!=null?l:10)<=0)return;const i=F.createIdentity();let n=(c=t.angle)!=null?c:0;n=-n,n&&i.rotate(n*dt);const a=(u=t.offsetX)!=null?u:0,o=(f=t.offsetY)!=null?f:0;(a||o)&&i.translate(a,o);const h=this.geomUnitsPerPoint();h!==1&&i.scale(h,h),i.translate(e.x,e.y),this.push(i,!1),this.drawText(t,s),this.pop()}_buildHatchPolyline(t,e,s){let i=(t.separation!==void 0?t.separation:4)*s,n=t.rotation!==void 0?t.rotation:0;if(i===0)return null;i<0&&(i=-i);let a=0;const o=.5*i;for(;a>o;)a-=i;for(;a<-o;)a+=i;const h=V();Zt(h,e),h[0]-=o,h[1]-=o,h[2]+=o,h[3]+=o;const l=[[h[0],h[1]],[h[0],h[3]],[h[2],h[3]],[h[2],h[1]]];for(;n>180;)n-=180;for(;n<0;)n+=180;const c=Math.cos(n*dt),u=Math.sin(n*dt),f=-i*u,m=i*c;let _,p,d,g;a=(t.offsetX!==void 0?t.offsetX*s:0)*u-(t.offsetY!==void 0?t.offsetY*s:0)*c,_=d=Number.MAX_VALUE,p=g=-Number.MAX_VALUE;for(const T of l){const L=T[0],b=T[1],w=c*L+u*b,N=-u*L+c*b;_=Math.min(_,w),d=Math.min(d,N),p=Math.max(p,w),g=Math.max(g,N)}d=Math.floor(d/i)*i;let y=c*_-u*d-f*a/i,P=u*_+c*d-m*a/i,x=c*p-u*d-f*a/i,M=u*p+c*d-m*a/i;const k=1+Math.round((g-d)/i),v=[];for(let T=0;T<k;T++)y+=f,P+=m,x+=f,M+=m,v.push([[y,P],[x,M]]);return{paths:v}}}class hn extends as{constructor(t,e){super(t,e),this.reset()}reset(){this._xmin=this._ymin=1/0,this._xmax=this._ymax=-1/0,this._clipCount=0}envelope(){return new ti(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)}bounds(){return Li(this._xmin,this._ymin,this._xmax,this._ymax)}drawSolidFill(t){if(t&&!(this._clipCount>0))if(z(t))this._processPath(t.rings,0);else if(O(t))this._processPath(t.paths,0);else if($(t)){const e=yt(t);e&&this._processPath(e.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(t,e,s){if(!t||this._clipCount>0)return;const i=.5*this.transformSize(s);if(z(t))this._processPath(t.rings,i);else if(O(t))this._processPath(t.paths,i);else if($(t)){const n=yt(t);n&&this._processPath(n.rings,i)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(t,e){z(e)&&t.markerPlacement&&(t.markerPlacement.type==="CIMMarkerPlacementInsidePolygon"||t.markerPlacement.type==="CIMMarkerPlacementPolygonCenter"&&t.markerPlacement.clipAtBoundary)?this._processPath(e.rings,0):super.drawMarkerLayer(t,e)}drawHatchFill(t,e){this.drawSolidFill(t)}drawPictureFill(t,e){this.drawSolidFill(t)}drawGradientFill(t,e){this.drawSolidFill(t)}drawPictureStroke(t,e){this.drawSolidStroke(t,null,e.width)}drawGradientStroke(t,e){this.drawSolidStroke(t,null,e.width)}pushClipPath(t){this.drawSolidFill(t),this._clipCount++}popClipPath(){this._clipCount--}drawImage(t,e){var h;const{url:s}=t,i=(h=t.scaleX)!=null?h:1;let n=i*e,a=e;const o=this._resourceManager.getResource(s);!e&&q(o)&&(n=i*o.width,a=o.height),this._merge(this.transformPt([-n/2,-a/2]),0),this._merge(this.transformPt([-n/2,a/2]),0),this._merge(this.transformPt([n/2,-a/2]),0),this._merge(this.transformPt([n/2,a/2]),0)}drawText(t,e){if(!e||e.length===0)return;this._textRasterizer||(this._textRasterizer=new ei);const s=li(t),[i,n]=this._textRasterizer.computeTextSize(e,s);let a=0;switch(t.horizontalAlignment){case"Left":a=i/2;break;case"Right":a=-i/2}let o=0;switch(t.verticalAlignment){case"Bottom":o=n/2;break;case"Top":o=-n/2;break;case"Baseline":o=n/6}this._merge(this.transformPt([-i/2+a,-n/2+o]),0),this._merge(this.transformPt([-i/2+a,n/2+o]),0),this._merge(this.transformPt([i/2+a,-n/2+o]),0),this._merge(this.transformPt([i/2+a,n/2+o]),0)}_processPath(t,e){if(t)for(const s of t){const i=s?s.length:0;if(i>1){this._merge(this.transformPt(s[0]),e);for(let n=1;n<i;n++)this._merge(this.transformPt(s[n]),e)}}}_merge(t,e){t[0]-e<this._xmin&&(this._xmin=t[0]-e),t[0]+e>this._xmax&&(this._xmax=t[0]+e),t[1]-e<this._ymin&&(this._ymin=t[1]-e),t[1]+e>this._ymax&&(this._ymax=t[1]+e)}}class Pa extends as{constructor(){super(...arguments),this._searchPoint=[0,0],this._searchDistPoint=0}hitTest(t,e,s,i,n,a){const o=a*Kt(1);this.setTransform(),this.setGeomUnitsPerPoint(o),this._searchPoint=[(t[0]+t[2])/2,(t[1]+t[3])/2],this._searchDistPoint=(t[2]-t[0])/2/o,this._textInfo=i;const h=e&&(e.type==="CIMPointSymbol"&&e.angleAlignment!=="Map"||e.type==="CIMTextSymbol");return this._mapRotation=h?n:0,this._earlyReturn=!1,this.drawSymbol(e,s),this._earlyReturn}drawSolidFill(t,e){this._hitTestFill(t)}drawHatchFill(t,e){this._hitTestFill(t)}drawPictureFill(t,e){this._hitTestFill(t)}drawGradientFill(t,e){this._hitTestFill(t)}drawSolidStroke(t,e,s,i,n,a){this._hitTestStroke(t,s)}drawPictureStroke(t,e){this._hitTestStroke(t,e.width)}drawGradientStroke(t,e){this._hitTestStroke(t,e.width)}drawMarkerLayer(t,e){t.markerPlacement&&(t.markerPlacement.type==="CIMMarkerPlacementInsidePolygon"||t.markerPlacement.type==="CIMMarkerPlacementPolygonCenter"&&t.markerPlacement.clipAtBoundary)?this._hitTestFill(e):super.drawMarkerLayer(t,e)}pushClipPath(t){}popClipPath(){}drawImage(t,e){var c;const{url:s}=t,i=(c=t.scaleX)!=null?c:1,n=this._resourceManager.getResource(s);if(at(n)||n.height===0||e===0)return;const a=e*this.geomUnitsPerPoint(),o=a*i*(n.width/n.height),h=this.reverseTransformPt(this._searchPoint),l=this._searchDistPoint;Math.abs(h[0])<o/2+l&&Math.abs(h[1])<a/2+l&&(this._earlyReturn=!0)}drawText(t,e){var p,d;const s=this._textInfo;if(!s)return;const i=s.get(t);if(!i)return;const{text:n,mosaicItem:a}=i;if(!a||a.glyphMosaicItems.length===0)return;const o=(p=t.height)!=null?p:on,h=hi(t.lineGapType,(d=t.lineGap)!=null?d:0,o),l=rs(n)[1],c=a.glyphMosaicItems,u=ri(c,l,{scale:o/Fs,angle:0,xOffset:0,yOffset:0,hAlign:ai(t.horizontalAlignment),vAlign:oi(t.verticalAlignment),maxLineWidth:512,lineHeight:Gs*Math.max(.25,Math.min(h||1,4)),decoration:t.font.decoration||"none",isCIM:!0}),f=this.reverseTransformPt(this._searchPoint),m=f[0],_=f[1];for(const g of u.glyphs)if(m>g.xTopLeft&&m<g.xBottomRight&&_>-g.yBottomRight&&_<-g.yTopLeft){this._earlyReturn=!0;break}}_hitTestFill(t){let e=null;if($(t)){const i=t;e=[[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]]}else if(z(t))e=t.rings;else{if(!O(t))return;e=t.paths}const s=this.reverseTransformPt(this._searchPoint);if(this._pointInPolygon(s,e)&&(this._earlyReturn=!0),!this._earlyReturn){const i=this.reverseTransformSize(this._searchDistPoint)*this.geomUnitsPerPoint();this._nearLine(s,e,i)&&(this._earlyReturn=!0)}}_hitTestStroke(t,e){let s=null;if($(t)){const o=t;s=[[[o.xmin,o.ymin],[o.xmin,o.ymax],[o.xmax,o.ymax],[o.xmax,o.ymin],[o.xmin,o.ymin]]]}else if(z(t))s=t.rings;else{if(!O(t))return;s=t.paths}const i=this.reverseTransformPt(this._searchPoint),n=e*this.geomUnitsPerPoint(),a=this.reverseTransformSize(this._searchDistPoint)*this.geomUnitsPerPoint();this._nearLine(i,s,n/2+a)&&(this._earlyReturn=!0)}_pointInPolygon(t,e){let s=0;for(const i of e){const n=i.length;for(let a=1;a<n;a++){const o=i[a-1],h=i[a];o[1]>t[1]!=h[1]>t[1]&&((h[0]-o[0])*(t[1]-o[1])-(h[1]-o[1])*(t[0]-o[0])>0?s++:s--)}}return s!==0}_nearLine(t,e,s){for(const i of e){const n=i.length;for(let a=1;a<n;a++){const o=i[a-1],h=i[a];let l=(h[0]-o[0])*(h[0]-o[0])+(h[1]-o[1])*(h[1]-o[1]);if(l===0)continue;l=Math.sqrt(l);const c=((h[0]-o[0])*(t[1]-o[1])-(h[1]-o[1])*(t[0]-o[0]))/l;if(Math.abs(c)<s){const u=((h[0]-o[0])*(t[0]-o[0])+(h[1]-o[1])*(t[1]-o[1]))/l;if(u>-s&&u<l+s)return!0}}}return!1}}class ln extends as{constructor(t,e,s,i){super(e,s),this._applyAdditionalRenderProps=i,this._colorSubstitutionHelper=new ar,this._ctx=t}drawSolidFill(t,e){if(!t)return;if(z(t))this._buildPath(t.rings,!0);else if(O(t))this._buildPath(t.paths,!0);else if($(t))this._buildPath(yt(t).rings,!0);else{if(!Q(t))return;console.log("CanvasDrawHelper.drawSolidFill - No implementation!")}const s=this._ctx;s.fillStyle=typeof e=="string"?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+e[3]/255+")",s.fill("evenodd")}drawSolidStroke(t,e,s,i,n,a){if(!t||!e||s===0)return;if(z(t))this._buildPath(t.rings,!0);else if(O(t))this._buildPath(t.paths,!1);else{if(!$(t))return void console.log("CanvasDrawHelper.drawSolidStroke isn't implemented!");this._buildPath(yt(t).rings,!0)}const o=this._ctx;o.strokeStyle=typeof e=="string"?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+e[3]/255+")",o.lineWidth=Math.max(this.transformSize(s),.5),this._setCapStyle(i),this._setJoinStyle(n),o.miterLimit=a,o.stroke()}pushClipPath(t){if(this._ctx.save(),z(t))this._buildPath(t.rings,!0);else if(O(t))this._buildPath(t.paths,!0);else{if(!$(t))return;this._buildPath(yt(t).rings,!0)}this._ctx.clip("evenodd")}popClipPath(){this._ctx.restore()}drawImage(t,e){var g;const{colorSubstitutions:s,url:i,tintColor:n}=t,a=(g=t.scaleX)!=null?g:1,o=this._resourceManager.getResource(i);if(at(o))return;let h=e*(o.width/o.height),l=e;e||(h=o.width,l=o.height);const c=Wt(i)||"src"in o&&Wt(o.src);let u="getFrame"in o?De(o):o;s&&(u=this._colorSubstitutionHelper.applyColorSubstituition(u,s)),this._applyAdditionalRenderProps&&!c&&n&&(u=this._colorSubstitutionHelper.tintImageData(u,n));const f=this.transformPt([0,0]),[m,_]=this.getTransformAngle(),p=this.transformSize(1),d=this._ctx;d.save(),d.setTransform({m11:a*p*m,m12:a*p*_,m21:-p*_,m22:p*m,m41:f[0],m42:f[1]}),d.drawImage(u,-h/2,-l/2,h,l),d.restore()}drawText(t,e){if(!e||e.length===0)return;this._textRasterizer||(this._textRasterizer=new ei);const s=li(t);s.size*=this.transformSize(qt(1));const i=this._textRasterizer.rasterizeText(e,s);if(!i)return;const{size:n,anchorX:a,anchorY:o,canvas:h}=i,l=n[0]*(a+.5),c=n[1]*(o-.5),u=this._ctx,f=this.transformPt([0,0]),[m,_]=this.getTransformAngle(),p=1;u.save(),u.setTransform({m11:p*m,m12:p*_,m21:-p*_,m22:p*m,m41:f[0]-p*l,m42:f[1]+p*c}),u.drawImage(h,0,0),u.restore()}drawPictureFill(t,e){if(!t)return;let{colorSubstitutions:s,height:i,offsetX:n,offsetY:a,rotation:o,scaleX:h,tintColor:l,url:c}=e;const u=this._resourceManager.getResource(c);if(at(u))return;if(z(t))this._buildPath(t.rings,!0);else if(O(t))this._buildPath(t.paths,!0);else if($(t))this._buildPath(yt(t).rings,!0);else{if(!Q(t))return;console.log("CanvasDrawHelper.drawPictureFill - No implementation!")}const f=this._ctx,m=Wt(c)||"src"in u&&Wt(u.src);let _,p="getFrame"in u?De(u):u;if(s&&(p=this._colorSubstitutionHelper.applyColorSubstituition(p,s)),this._applyAdditionalRenderProps){m||l&&(p=this._colorSubstitutionHelper.tintImageData(p,l)),_=f.createPattern(p,"repeat");const d=this.transformSize(1);o||(o=0),n?n*=d:n=0,a?a*=d:a=0,i&&(i*=d);const g=i?i/u.height:1,y=h&&i?h*i/u.width:1;if(o!==0||g!==1||y!==1||n!==0||a!==0){const P=new DOMMatrix;P.rotateSelf(0,0,-o).translateSelf(n,a).scaleSelf(y,g,1),_.setTransform(P)}}else _=f.createPattern(p,"repeat");f.save(),f.fillStyle=_,f.fill("evenodd"),f.restore()}drawPictureStroke(t,e){if(!t)return;let{colorSubstitutions:s,capStyle:i,joinStyle:n,miterLimit:a,tintColor:o,url:h,width:l}=e;const c=this._resourceManager.getResource(h);if(at(c))return;let u;if(z(t))u=t.rings;else if(O(t))u=t.paths;else if($(t))u=yt(t).rings;else{if(!Q(t))return;console.log("CanvasDrawHelper.drawPictureStroke - No implementation!")}l||(l=c.width);const f=Wt(h)||"src"in c&&Wt(c.src);let m="getFrame"in c?De(c):c;s&&(m=this._colorSubstitutionHelper.applyColorSubstituition(m,s)),this._applyAdditionalRenderProps&&(f||o&&(m=this._colorSubstitutionHelper.tintImageData(m,o)));const _=Math.max(this.transformSize(Kt(l)),.5),p=_/m.width,d=this._ctx,g=d.createPattern(m,"repeat-y");let y,P;d.save(),this._setCapStyle(i),this._setJoinStyle(n),d.miterLimit=a,d.lineWidth=_;for(let x of u)if(x=R(x),fn(x),x&&!(x.length<=1)){y=this.transformPt(x[0]);for(let M=1;M<x.length;M++){P=this.transformPt(x[M]);const k=cn(y,P),v=new DOMMatrix;v.translateSelf(0,y[1]-_/2).scaleSelf(p,p,1).rotateSelf(0,0,90-k),g.setTransform(v),d.strokeStyle=g,d.beginPath(),d.moveTo(y[0],y[1]),d.lineTo(P[0],P[1]),d.stroke(),y=P}}d.restore()}_buildPath(t,e){const s=this._ctx;if(s.beginPath(),t)for(const i of t){const n=i?i.length:0;if(n>1){let a=this.transformPt(i[0]);s.moveTo(a[0],a[1]);for(let o=1;o<n;o++)a=this.transformPt(i[o]),s.lineTo(a[0],a[1]);e&&s.closePath()}}}_setCapStyle(t){switch(t){case rt.Butt:this._ctx.lineCap="butt";break;case rt.Round:this._ctx.lineCap="round";break;case rt.Square:this._ctx.lineCap="square"}}_setJoinStyle(t){switch(t){case nt.Bevel:this._ctx.lineJoin="bevel";break;case nt.Round:this._ctx.lineJoin="round";break;case nt.Miter:this._ctx.lineJoin="miter"}}}function cn(r,t){const e=t[0]-r[0],s=t[1]-r[1];return 180/Math.PI*Math.atan2(s,e)}const yt=r=>r?{spatialReference:r.spatialReference,rings:[[[r.xmin,r.ymin],[r.xmin,r.ymax],[r.xmax,r.ymax],[r.xmax,r.ymin],[r.xmin,r.ymin]]]}:null,ai=r=>{switch(r){case"Left":return Pe.Left;case"Right":return Pe.Right;case"Center":return Pe.Center;case"Justify":return ni.warnOnce("Horizontal alignment 'justify' is not implemented. Falling back to 'center'."),Pe.Center}},oi=r=>{switch(r){case"Top":return ae.Top;case"Center":return ae.Center;case"Bottom":return ae.Bottom;case"Baseline":return ae.Baseline}},hi=(r,t,e)=>{switch(r){case"ExtraLeading":return 1+t/e;case"Multiple":return t;case"Exact":return t/e}};function li(r,t=1){const e=Ws(r),s=Bs(r.fontStyleName),i=is(r.fontFamilyName),{weight:n,style:a}=s,o=t*(r.height||5),h=Us(r.horizontalAlignment),l=qs(r.verticalAlignment),c=Dt(r),u=Xt(r.haloSymbol),f=u?t*(0|r.haloSize):0;return{color:c,size:o,horizontalAlignment:h,verticalAlignment:l,font:{family:i,style:er(a),weight:sr(n),decoration:e},halo:{size:f||0,color:u,style:a},pixelRatio:1,premultiplyColors:!0}}const un=1e-4;function fn(r){let t,e,s,i,n,a=r[0],o=1;for(;o<r.length;)t=r[o][0]-a[0],e=r[o][1]-a[1],i=t!==0?e/t:Math.PI/2,s!==void 0&&i-s<=un?(r.splice(o-1,1),a=n):(n=a,a=r[o],o++),s=i}function ee(r,t,e,s,i){if(at(r))return null;const n=r.referencesGeometry()&&i?mn(t,s,i):t,a=r.repurposeFeature(n);try{return r.evaluate({...e,$feature:a})}catch(o){return ce.getLogger("esri.views.2d.support.arcadeOnDemand").warn("Feature arcade evaluation failed:",o),null}}const Xe=new Map;function mn(r,t,e){const{transform:s,hasZ:i,hasM:n}=e;Xe.has(t)||Xe.set(t,pn(t));const a=Xe.get(t)(r.geometry,s,i,n);return{...r,geometry:a}}function pn(r){const t={};switch(r){case"esriGeometryPoint":return(e,s,i,n)=>Ui(s,t,e,i,n);case"esriGeometryPolygon":return(e,s,i,n)=>Wi(s,t,e,i,n);case"esriGeometryPolyline":return(e,s,i,n)=>Bi(s,t,e,i,n);case"esriGeometryMultipoint":return(e,s,i,n)=>Vi(s,t,e,i,n);default:return ce.getLogger("esri.views.2d.support.arcadeOnDemand").error(new Ai("mapview-arcade",`Unable to handle geometryType: ${r}`)),e=>e}}const ci=Math.PI,_n=ci/2,dn=4,gn=10,K=96/72,ws=Math.PI/180,es=ce.getLogger("esri.symbols.cim.CIMSymbolHelper");function xa(r){if(!r||!r.type)return null;let t;switch(r.type){case"cim":return r.data;case"web-style":return r;case"simple-marker":t=U.fromSimpleMarker(r);break;case"picture-marker":t=U.fromPictureMarker(r);break;case"simple-line":t=U.fromSimpleLineSymbol(r);break;case"simple-fill":t=U.fromSimpleFillSymbol(r);break;case"picture-fill":t=U.fromPictureFillSymbol(r);break;case"text":t=U.fromTextSymbol(r)}return{type:"CIMSymbolReference",symbol:t}}function Le(r,t,e){switch(t.type){case"CIMSymbolReference":return Le(r,t.symbol,e);case"CIMPointSymbol":e==null&&(e={x:0,y:0}),r.drawSymbol(t,e);break;case"CIMLineSymbol":e==null&&(e={paths:[[[0,0],[10,0]]]}),r.drawSymbol(t,e);break;case"CIMPolygonSymbol":e==null&&(e={rings:[[[0,0],[0,10],[10,10],[10,0],[0,0]]]}),r.drawSymbol(t,e);break;case"CIMTextSymbol":{const s={x:0,y:0};r.drawSymbol(t,s);break}case"CIMVectorMarker":{const s=new te;r.drawMarker(t,s);break}}return r.envelope()}function yn(r){if(!r)return 0;switch(r.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAtExtremities":case"CIMMarkerPlacementAtMeasuredUnits":case"CIMMarkerPlacementAtRatioPositions":case"CIMMarkerPlacementOnLine":case"CIMMarkerPlacementOnVertices":return Math.abs(r.offset);default:return 0}}function Pn(r){if(!r)return 0;switch(r.type){case"CIMGeometricEffectArrow":return Math.abs(.5*r.width);case"CIMGeometricEffectBuffer":return Math.abs(r.size);case"CIMGeometricEffectExtension":case"CIMGeometricEffectRadial":return Math.abs(r.length);case"CIMGeometricEffectJog":return Math.abs(.5*r.length);case"CIMGeometricEffectMove":return Math.max(Math.abs(C(r.offsetX)),Math.abs(C(r.offsetY)));case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":return Math.abs(r.offset);case"CIMGeometricEffectRegularPolygon":return Math.abs(r.radius);case"CIMGeometricEffectRotate":case"CIMGeometricEffectScale":default:return 0;case"CIMGeometricEffectTaperedPolygon":return .5*Math.max(Math.abs(r.fromWidth),Math.abs(r.toWidth));case"CIMGeometricEffectWave":return Math.abs(r.amplitude)}}function ks(r){if(!r)return 0;let t=0;for(const e of r)t+=Pn(e);return t}class ba{getSymbolInflateSize(t,e,s,i,n){return t||(t=[0,0,0,0]),e?this._getInflateSize(t,e,s,i,n):t}static safeSize(t){const e=Math.max(Math.abs(t[0]),Math.abs(t[2])),s=Math.max(Math.abs(t[1]),Math.abs(t[3]));return Math.sqrt(e*e+s*s)}_vectorMarkerBounds(t,e,s,i){let n=!0;const a=V();if(e&&e.markerGraphics)for(const o of e.markerGraphics){const h=[0,0,0,0];o.geometry&&(Zt(a,o.geometry),h[0]=0,h[1]=0,h[2]=0,h[3]=0,this.getSymbolInflateSize(h,o.symbol,s,0,i),a[0]+=h[0],a[1]+=h[1],a[2]+=h[2],a[3]+=h[3],n?(t[0]=a[0],t[1]=a[1],t[2]=a[2],t[3]=a[3],n=!1):(t[0]=Math.min(t[0],a[0]),t[1]=Math.min(t[1],a[1]),t[2]=Math.max(t[2],a[2]),t[3]=Math.max(t[3],a[3])))}return t}_getInflateSize(t,e,s,i,n){if(wn(e)){const a=this._getLayersInflateSize(t,e.symbolLayers,s,i,n),o=ks(e.effects);return o>0&&(a[0]-=o,a[1]-=o,a[2]+=o,a[3]+=o),a}return this._getTextInflatedSize(t,e,n)}_getLayersInflateSize(t,e,s,i,n){let a=!0;if(!e)return t;for(const o of e){if(!o)continue;let h=[0,0,0,0];switch(o.type){case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const c=o;let u=c.width;c.capStyle===rt.Square||c.joinStyle===nt.Miter?u/=1.4142135623730951:u/=2,h[0]=-u,h[1]=-u,h[2]=u,h[3]=u;break}case"CIMCharacterMarker":case"CIMVectorMarker":case"CIMPictureMarker":{const c=o;if(o.type==="CIMVectorMarker"){const p=o;if(h=this._vectorMarkerBounds(h,p,s,n),p.frame){const d=(p.frame.xmin+p.frame.xmax)/2,g=(p.frame.ymin+p.frame.ymax)/2;h[0]-=d,h[1]-=g,h[2]-=d,h[3]-=g;const y=p.size/(p.frame.ymax-p.frame.ymin);h[0]*=y,h[1]*=y,h[2]*=y,h[3]*=y}}else if(o.type==="CIMPictureMarker"){const p=o,d=s.getResource(p.url);let g=1;q(d)&&d.height&&(g=d.width/d.height);const y=c.size/2,P=c.size*g*p.scaleX/2;h=[-P,-y,P,y]}else{const p=c.size/2;h=[-p,-p,p,p]}if(c.anchorPoint){let p,d;c.anchorPointUnits==="Absolute"?(p=c.anchorPoint.x,d=c.anchorPoint.y):(p=c.anchorPoint.x*(h[2]-h[0]),d=c.anchorPoint.y*(h[3]-h[1])),h[0]-=p,h[1]-=d,h[2]-=p,h[3]-=d}let u=C(c.rotation);if(c.rotateClockwise&&(u=-u),i&&(u-=i),u){const p=ws*u,d=Math.cos(p),g=Math.sin(p),y=V([be,be,-be,-be]);de(y,[h[0]*d-h[1]*g,h[0]*g+h[1]*d]),de(y,[h[0]*d-h[3]*g,h[0]*g+h[3]*d]),de(y,[h[2]*d-h[1]*g,h[2]*g+h[1]*d]),de(y,[h[2]*d-h[3]*g,h[2]*g+h[3]*d]),h=y}let f=C(c.offsetX),m=C(c.offsetY);if(i){const p=ws*i,d=Math.cos(p),g=Math.sin(p),y=f*g+m*d;f=f*d-m*g,m=y}h[0]+=f,h[1]+=m,h[2]+=f,h[3]+=m;const _=yn(c.markerPlacement);_>0&&(h[0]-=_,h[1]-=_,h[2]+=_,h[3]+=_);break}}const l=ks(o.effects);l>0&&(h[0]-=l,h[1]-=l,h[2]+=l,h[3]+=l),a?(t[0]=h[0],t[1]=h[1],t[2]=h[2],t[3]=h[3],a=!1):(t[0]=Math.min(t[0],h[0]),t[1]=Math.min(t[1],h[1]),t[2]=Math.max(t[2],h[2]),t[3]=Math.max(t[3],h[3]))}return t}_getTextInflatedSize(t,e,s){var f,m;const i=(f=e.height)!=null?f:gn;if(t[0]=-i/2,t[1]=-i/2,t[2]=i/2,t[3]=i/2,!s)return t;const n=s.get(e);if(!n)return t;const{text:a,mosaicItem:o}=n;if(!o||o.glyphMosaicItems.length===0)return t;const h=hi(e.lineGapType,(m=e.lineGap)!=null?m:0,i),l=rs(a)[1],c=o.glyphMosaicItems,u=ri(c,l,{scale:i/Fs,angle:C(e.angle),xOffset:C(e.offsetX),yOffset:C(e.offsetY),hAlign:ai(e.horizontalAlignment),vAlign:oi(e.verticalAlignment),maxLineWidth:512,lineHeight:Gs*Math.max(.25,Math.min(h||1,4)),decoration:e.font.decoration||"none",isCIM:!0}).boundsT;return t[0]=u.x-u.halfWidth,t[1]=-u.y-u.halfHeight,t[2]=u.x+u.halfWidth,t[3]=-u.y+u.halfHeight,t}}class U{static getEnvelope(t,e,s){const i=new hn(s);if(Array.isArray(t)){let n;for(const a of t)n?n.union(Le(i,a,e)):n=Le(i,a,e);return n}return Le(i,t,e)}static getTextureAnchor(t,e){const s=this.getEnvelope(t,null,e);if(!s)return[0,0,0];const i=(s.x+.5*s.width)*K,n=(s.y+.5*s.height)*K,a=s.width*K+2,o=s.height*K+2;return[-i/a,-n/o,o]}static rasterize(t,e,s,i,n=!0){const a=s||this.getEnvelope(e,null,i);if(!a)return[null,0,0,0,0];const o=(a.x+.5*a.width)*K,h=(a.y+.5*a.height)*K;t.width=a.width*K,t.height=a.height*K,s||(t.width+=2,t.height+=2);const l=t.getContext("2d"),c=F.createScale(K,-K);c.translate(.5*t.width-o,.5*t.height+h);const u=new ln(l,i,c);switch(e.type){case"CIMPointSymbol":{const _={type:"point",x:0,y:0};u.drawSymbol(e,_);break}case"CIMVectorMarker":{const _=new te;u.drawMarker(e,_);break}}const f=l.getImageData(0,0,t.width,t.height),m=new Uint8Array(f.data);if(n){let _;for(let p=0;p<m.length;p+=4)_=m[p+3]/255,m[p]=m[p]*_,m[p+1]=m[p+1]*_,m[p+2]=m[p+2]*_}return[m,t.width,t.height,-o/t.width,-h/t.height]}static fromTextSymbol(t){const{angle:e,color:s,font:i,haloColor:n,haloSize:a,horizontalAlignment:o,kerning:h,text:l,verticalAlignment:c,xoffset:u,yoffset:f}=t;let m,_,p,d,g;i&&(m=i.family,_=i.style,p=i.weight,d=i.size,g=i.decoration);let y=!1;return l&&(y=rs(l)[1]),{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:{type:"CIMTextSymbol",angle:e,blockProgression:Oi.BTT,depth3D:1,extrapolateBaselines:!0,fontEffects:Ri.Normal,fontEncoding:Ei.Unicode,fontFamilyName:m||"Arial",fontStyleName:Mn(_,p),fontType:$i.Unspecified,haloSize:a,height:d,hinting:Fi.Default,horizontalAlignment:xn(o!=null?o:"center"),kerning:h,letterWidth:100,ligatures:!0,lineGapType:"Multiple",offsetX:C(u),offsetY:C(f),strikethrough:g==="line-through",underline:g==="underline",symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:W(s)}]},haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:W(n)}]},shadowColor:[0,0,0,255],shadowOffsetX:1,shadowOffsetY:1,textCase:"Normal",textDirection:y?ps.RTL:ps.LTR,verticalAlignment:bn(c!=null?c:"baseline"),verticalGlyphOrientation:Gi.Right,wordSpacing:100,billboardMode3D:Hi.FaceNearPlane},textString:l}],scaleSymbolsProportionally:!0,respectFrame:!0}],scaleX:1,angleAlignment:"Display"}}static fromPictureFillSymbol(t){const{height:e,outline:s,width:i,xoffset:n,xscale:a,yoffset:o,yscale:h}=t,l=[],c={type:"CIMPolygonSymbol",symbolLayers:l};if(s){const{cap:p,join:d,miterLimit:g,width:y}=s;l.push({type:"CIMSolidStroke",color:W(s.color),capStyle:Ye(p),joinStyle:Ve(d),miterLimit:g,width:y})}let u=t.url;t.type==="esriPFS"&&t.imageData&&(u=t.imageData);const f="angle"in t?t.angle:0,m=i*(a||1),_=e*(h||1);return l.push({type:"CIMPictureFill",invertBackfaceTexture:!1,scaleX:1,textureFilter:_s.Picture,tintColor:null,url:u,height:_,width:m,offsetX:C(n),offsetY:C(o),rotation:C(-f),colorSubstitutions:null}),c}static fromSimpleFillSymbol(t){const{color:e,style:s,outline:i}=t,n=[],a={type:"CIMPolygonSymbol",symbolLayers:n};let o=null;if(i){const{cap:h,join:l,style:c}=i;c!=="solid"&&c!=="none"&&c!=="esriSLSSolid"&&c!=="esriSLSNull"&&(o=[{type:"CIMGeometricEffectDashes",dashTemplate:vs(c,h),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]),n.push({type:"CIMSolidStroke",color:W(i.color),capStyle:Ye(h),joinStyle:Ve(l),miterLimit:i.miterLimit,width:i.width,effects:o})}if(s&&s!=="solid"&&s!=="none"&&s!=="esriSFSSolid"&&s!=="esriSFSNull"){const h={type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",color:W(e),capStyle:rt.Butt,joinStyle:nt.Miter,width:.75}]};let l=0;const c=qt(kn(s)?8:10);switch(s){case"vertical":case"esriSFSVertical":l=90;break;case"forward-diagonal":case"esriSFSForwardDiagonal":case"diagonal-cross":case"esriSFSDiagonalCross":l=-45;break;case"backward-diagonal":case"esriSFSBackwardDiagonal":l=45;break;case"cross":case"esriSFSCross":l=0}n.push({type:"CIMHatchFill",lineSymbol:h,offsetX:0,offsetY:0,rotation:l,separation:c}),s==="cross"||s==="esriSFSCross"?n.push({type:"CIMHatchFill",lineSymbol:R(h),offsetX:0,offsetY:0,rotation:90,separation:c}):s!=="diagonal-cross"&&s!=="esriSFSDiagonalCross"||n.push({type:"CIMHatchFill",lineSymbol:R(h),offsetX:0,offsetY:0,rotation:45,separation:c})}else!s||s!=="solid"&&s!=="esriSFSSolid"||n.push({type:"CIMSolidFill",enable:!0,color:W(e)});return a}static fromSimpleLineSymbol(t){const{cap:e,color:s,join:i,marker:n,miterLimit:a,style:o,width:h}=t;let l=null;o!=="solid"&&o!=="none"&&o!=="esriSLSSolid"&&o!=="esriSLSNull"&&(l=[{type:"CIMGeometricEffectDashes",dashTemplate:vs(o,e),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]);const c=[];if(n){let u;switch(n.placement){case"begin-end":u=ct.Both;break;case"begin":u=ct.JustBegin;break;case"end":u=ct.JustEnd;break;default:u=ct.None}const f=U.fromSimpleMarker(n,h,s).symbolLayers[0];f.markerPlacement={type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:u,offsetAlongLine:0},c.push(f)}return o!=="none"&&o!=="esriSLSNull"&&c.push({type:"CIMSolidStroke",color:W(s),capStyle:Ye(e),joinStyle:Ve(i),miterLimit:a,width:h,effects:l}),{type:"CIMLineSymbol",symbolLayers:c}}static fromPictureMarker(t){const{angle:e,height:s,width:i,xoffset:n,yoffset:a}=t;let o=t.url;return t.type==="esriPMS"&&t.imageData&&(o=t.imageData),{type:"CIMPointSymbol",symbolLayers:[{type:"CIMPictureMarker",invertBackfaceTexture:!1,scaleX:1,textureFilter:_s.Picture,tintColor:null,url:o,size:s,width:i,offsetX:C(n),offsetY:C(a),rotation:C(-e)}]}}static fromSimpleMarker(t,e,s){var l;const{style:i}=t,n=(l=t.color)!=null?l:s;if(i==="path"){const c=[];if("outline"in t&&t.outline){const m=t.outline;c.push({type:"CIMSolidStroke",enable:!0,width:Kt(Math.round(qt(m.width))),color:W(m.color)})}c.push({type:"CIMSolidFill",enable:!0,color:W(n),path:t.path});const[u,f]=Is("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),frame:u,markerGraphics:[{type:"CIMMarkerGraphic",geometry:f,symbol:{type:"CIMPolygonSymbol",symbolLayers:c}}]}]}}const[a,o]=Is(i);let h;if(o&&a){const c=[];if("outline"in t&&t.outline){const f=t.outline;c.push({type:"CIMSolidStroke",enable:!0,width:f.width>.667?Kt(Math.round(qt(f.width))):f.width,color:W(f.color)})}else!e||t.type!=="line-marker"||t.style!=="cross"&&t.style!=="x"||c.push({type:"CIMSolidStroke",enable:!0,width:e,color:W(n)});c.push({type:"CIMSolidFill",enable:!0,color:W(n)});const u={type:"CIMPolygonSymbol",symbolLayers:c};h={type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:C(-t.angle),size:C(t.size||6*e),offsetX:C(t.xoffset),offsetY:C(t.yoffset),frame:a,markerGraphics:[{type:"CIMMarkerGraphic",geometry:o,symbol:u}]}]}}return h}static fromCIMHatchFill(t,e){var u;const s=e*((u=t.separation)!=null?u:dn),i=s/2,n=4,a=R(t.lineSymbol);let o=this._getLineSymbolPeriod(a)||n;for(;o<n;)o*=2;const h=o/2,l={xmin:-h,xmax:h,ymin:-i,ymax:i},c=a.symbolLayers.find(f=>f.type==="CIMSolidStroke");return c&&(c.width*=e),{type:"CIMVectorMarker",frame:l,markerGraphics:[{type:"CIMMarkerGraphic",geometry:{paths:[[[-h,0],[h,0]]]},symbol:a}],size:s}}static fetchResources(t,e,s){if(t&&e)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const i=t.symbolLayers;if(!i)return;for(const n of i)switch(In(n,e,s),n.type){case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":case"CIMPictureStroke":case"CIMGradientStroke":case"CIMCharacterMarker":case"CIMPictureMarker":"url"in n&&n.url&&s.push(e.fetchResource(n.url,null));break;case"CIMVectorMarker":{const a=n.markerGraphics;if(!a)continue;for(const o of a)if(o){const h=o.symbol;h&&U.fetchResources(h,e,s)}}}}}}static _getLineSymbolPeriod(t){if(t){const e=this._getEffectsRepeat(t.effects);if(e)return e;if(t.symbolLayers){for(const s of t.symbolLayers)if(s){const i=this._getEffectsRepeat(s.effects);if(i)return i;switch(s.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const n=this._getPlacementRepeat(s.markerPlacement);if(n)return n}}}}}return 0}static _getEffectsRepeat(t){if(t){for(const e of t)if(e)switch(e.type){case"CIMGeometricEffectDashes":{const s=e.dashTemplate;if(s&&s.length){let i=0;for(const n of s)i+=n;return 1&s.length&&(i*=2),i}break}case"CIMGeometricEffectWave":return e.period;default:es.error(`unsupported geometric effect type ${e.type}`)}}return 0}static _getPlacementRepeat(t){if(t)switch(t.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAlongLineVariableSize":{const e=t.placementTemplate;if(e&&e.length){let s=0;for(const i of e)s+=i;return 1&e.length&&(s*=2),s}break}}return 0}static fromCIMInsidePolygon(t){var u;const e=t.markerPlacement,s={type:t.type,...t};s.markerPlacement=null,s.anchorPoint=null;const i=Math.abs(e.stepX),n=Math.abs(e.stepY),a=((u=e.randomness)!=null?u:100)/100;let o,h,l,c;if(e.gridType==="Random"){const f=qt(Hs),m=Math.max(Math.floor(f/i),1),_=Math.max(Math.floor(f/n),1);o=m*i/2,h=_*n/2,l=2*h;const p=new Rs(e.seed),d=a*i/1.5,g=a*n/1.5;c=[];for(let y=0;y<m;y++)for(let P=0;P<_;P++){const x=y*i-o+d*(.5-p.getFloat()),M=P*n-h+g*(.5-p.getFloat());c.push({x,y:M}),y===0&&c.push({x:x+2*o,y:M}),P===0&&c.push({x,y:M+2*h})}}else e.shiftOddRows===!0?(o=i/2,h=n,l=2*n,c=[{x:-o,y:0},{x:o,y:0},{x:0,y:h},{x:0,y:-h}]):(o=i/2,h=n/2,l=n,c=[{x:-i,y:0},{x:0,y:-n},{x:-i,y:-n},{x:0,y:0},{x:i,y:0},{x:0,y:n},{x:i,y:n},{x:-i,y:n},{x:i,y:-n}]);return{type:"CIMVectorMarker",frame:{xmin:-o,xmax:o,ymin:-h,ymax:h},markerGraphics:c.map(f=>({type:"CIMMarkerGraphic",geometry:f,symbol:{type:"CIMPointSymbol",symbolLayers:[s]}})),size:l}}static getSize(t){if(t)switch(t.type){case"CIMTextSymbol":return t.height;case"CIMPointSymbol":{let e=0;if(t.symbolLayers){for(const s of t.symbolLayers)if(s)switch(s.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const i=s.size;i>e&&(e=i);break}}}return e}case"CIMLineSymbol":case"CIMPolygonSymbol":{let e=0;if(t.symbolLayers){for(const s of t.symbolLayers)if(s)switch(s.type){case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const i=s.width;i>e&&(e=i);break}case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":if(Qi(s.markerPlacement)){const i=s.size;i>e&&(e=i)}}}return e}}}static getMarkerScaleRatio(t){if(t&&t.type==="CIMVectorMarker"&&t.scaleSymbolsProportionally!==!1&&t.frame){const e=t.frame.ymax-t.frame.ymin;return t.size/e}return 1}}class A{static findApplicableOverrides(t,e,s){if(t&&e){if(t.primitiveName){let i=!1;for(const n of s)if(n.primitiveName===t.primitiveName){i=!0;break}if(!i)for(const n of e)n.primitiveName===t.primitiveName&&s.push(n)}switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(t.effects)for(const i of t.effects)A.findApplicableOverrides(i,e,s);if(t.symbolLayers)for(const i of t.symbolLayers)A.findApplicableOverrides(i,e,s);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(t.effects)for(const i of t.effects)A.findApplicableOverrides(i,e,s);if(t.markerPlacement&&A.findApplicableOverrides(t.markerPlacement,e,s),t.type==="CIMVectorMarker"){if(t.markerGraphics)for(const i of t.markerGraphics)A.findApplicableOverrides(i,e,s),A.findApplicableOverrides(i.symbol,e,s)}else t.type==="CIMCharacterMarker"?A.findApplicableOverrides(t.symbol,e,s):t.type==="CIMHatchFill"?A.findApplicableOverrides(t.lineSymbol,e,s):t.type==="CIMPictureMarker"&&A.findApplicableOverrides(t.animatedSymbolProperties,e,s)}}}static findEffectOverrides(t,e,s){var n;if(!e||!t)return;const i=t.length;for(let a=0;a<i;a++){const o=(n=t[a])==null?void 0:n.primitiveName;if(o){let h=!1;for(const l of s)if(l.primitiveName===o){h=!0;break}if(!h)for(const l of e)l.primitiveName===o&&s.push(l)}}}static async resolveSymbolOverrides(t,e,s,i,n,a,o){if(!t||!t.symbol)return null;let{symbol:h,primitiveOverrides:l}=t;const c=!!l;if(!c&&!i)return h;h=R(h);let u=!0;if(e||(e={attributes:{}},u=!1),c){if(u||(l=l.filter(f=>{var m;return!((m=f.valueExpressionInfo)!=null&&m.expression.includes("$feature"))})),o||(l=l.filter(f=>{var m;return!((m=f.valueExpressionInfo)!=null&&m.expression.includes("$view"))})),l.length>0){const f=ir(e.attributes);await A.evaluateOverrides(l,e,{spatialReference:s,fields:f,geometryType:n},a,o)}A.applyOverrides(h,l)}return i&&A.applyDictionaryTextOverrides(h,e,i),h}static async evaluateOverrides(t,e,s,i,n){if(!e)return;let a;for(const o of t){const h=o.valueExpressionInfo;if(h&&s){a||(a=[]),o.value=void 0;const l=$s(h.expression,s.spatialReference,s.fields).then(c=>{o.value=ee(c,e,{$view:n},s.geometryType,i)});a.push(l)}}a!==void 0&&a.length>0&&await Promise.all(a)}static applyDictionaryTextOverrides(t,e,s,i="Normal"){if(t&&t.type)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":case"CIMTextSymbol":{const n=t.symbolLayers;if(!n)return;for(const a of n)a&&a.type==="CIMVectorMarker"&&A.applyDictionaryTextOverrides(a,e,s,t.type==="CIMTextSymbol"?t.textCase:i)}break;case"CIMVectorMarker":{const n=t.markerGraphics;if(!n)return;for(const a of n)a&&A.applyDictionaryTextOverrides(a,e,s)}break;case"CIMMarkerGraphic":{const n=t.textString;if(n&&n.includes("[")){const a=Xs(n,s);t.textString=Ys(e,a,i)}}}}static applyOverrides(t,e,s,i){if(t.primitiveName){for(const n of e)if(n.primitiveName===t.primitiveName){const a=vn(n.propertyName);if(i&&i.push({cim:t,nocapPropertyName:a,value:t[a]}),n.expression&&(n.value=A.toValue(n.propertyName,n.expression)),s){let o=!1;for(const h of s)h.primitiveName===t.primitiveName&&(o=!0);o||s.push(n)}q(n.value)&&(t[a]=n.value)}}switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(t.effects)for(const n of t.effects)A.applyOverrides(n,e,s,i);if(t.symbolLayers)for(const n of t.symbolLayers)A.applyOverrides(n,e,s,i);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMSolidFill":case"CIMVectorMarker":if(t.effects)for(const n of t.effects)A.applyOverrides(n,e,s,i);if(t.type==="CIMVectorMarker"&&t.markerGraphics)for(const n of t.markerGraphics)A.applyOverrides(n,e,s,i),A.applyOverrides(n.symbol,e,s,i)}}static restoreOverrides(t){for(const e of t)e.cim[e.nocapPropertyName]=e.value}static buildOverrideKey(t){let e="";for(const s of t)s.value!==void 0&&(e+=`${s.primitiveName}${s.propertyName}${JSON.stringify(s.value)}`);return e}static toValue(t,e){if(t==="DashTemplate")return e.split(" ").map(s=>Number(s));if(t==="Color"){const s=new ss(e).toRgba();return s[3]*=255,s}return e}}const Ye=r=>{if(!r)return rt.Butt;switch(r){case"butt":return rt.Butt;case"square":return rt.Square;case"round":return rt.Round}},Ve=r=>{if(!r)return nt.Miter;switch(r){case"miter":return nt.Miter;case"round":return nt.Round;case"bevel":return nt.Bevel}},xn=r=>{if(at(r))return"Center";switch(r){case"left":return"Left";case"right":return"Right";case"center":return"Center"}},bn=r=>{if(at(r))return"Center";switch(r){case"baseline":return"Baseline";case"top":return"Top";case"middle":return"Center";case"bottom":return"Bottom"}},W=r=>{if(!r)return[0,0,0,0];const{r:t,g:e,b:s,a:i}=r;return[t,e,s,255*i]},Mn=(r,t)=>{const e=Sn(t),s=Cn(r);return e&&s?`${e}-${s}`:`${e}${s}`},Sn=r=>{if(!r)return"";switch(r.toLowerCase()){case"bold":case"bolder":return"bold"}return""},Cn=r=>{if(!r)return"";switch(r.toLowerCase()){case"italic":case"oblique":return"italic"}return""},vs=(r,t)=>{const e=t==="butt";switch(r){case"dash":case"esriSLSDash":return e?[4,3]:[3,4];case"dash-dot":case"esriSLSDashDot":return e?[4,3,1,3]:[3,4,0,4];case"dot":case"esriSLSDot":return e?[1,3]:[0,4];case"long-dash":case"esriSLSLongDash":return e?[8,3]:[7,4];case"long-dash-dot":case"esriSLSLongDashDot":return e?[8,3,1,3]:[7,4,0,4];case"long-dash-dot-dot":case"esriSLSDashDotDot":return e?[8,3,1,3,1,3]:[7,4,0,4,0,4];case"short-dash":case"esriSLSShortDash":return e?[4,1]:[3,2];case"short-dash-dot":case"esriSLSShortDashDot":return e?[4,1,1,1]:[3,2,0,2];case"short-dash-dot-dot":case"esriSLSShortDashDotDot":return e?[4,1,1,1,1,1]:[3,2,0,2,0,2];case"short-dot":case"esriSLSShortDot":return e?[1,1]:[0,2];case"solid":case"esriSLSSolid":case"none":return es.error("Unexpected: style does not require rasterization"),[0,0];default:return es.error(`Tried to rasterize SLS, but found an unexpected style: ${r}!`),[0,0]}};function wn(r){return r.symbolLayers!==void 0}const Is=r=>{let s,i;const n=r;if(n==="circle"||n==="esriSMSCircle"){let o=Math.acos(.995),h=Math.ceil(ci/o/4);h===0&&(h=1),o=_n/h,h*=4;const l=[];l.push([50,0]);for(let c=1;c<h;c++)l.push([50*Math.cos(c*o),-50*Math.sin(c*o)]);l.push([50,0]),s={rings:[l]},i={xmin:-50,ymin:-50,xmax:50,ymax:50}}else if(n==="cross"||n==="esriSMSCross")s={rings:[[[0,50],[0,0],[50,0],[50,-0],[0,-0],[0,-50],[-0,-50],[-0,-0],[-50,-0],[-50,0],[-0,0],[-0,50],[0,50]]]},i={xmin:-50,ymin:-50,xmax:50,ymax:50};else if(n==="diamond"||n==="esriSMSDiamond")s={rings:[[[-50,0],[0,50],[50,0],[0,-50],[-50,0]]]},i={xmin:-50,ymin:-50,xmax:50,ymax:50};else if(n==="square"||n==="esriSMSSquare")s={rings:[[[-50,-50],[-50,50],[50,50],[50,-50],[-50,-50]]]},i={xmin:-50,ymin:-50,xmax:50,ymax:50};else if(n==="x"||n==="esriSMSX")s={rings:[[[0,0],[50-0,50],[50,50-0],[0,0],[50,0-50],[50-0,-50],[0,-0],[0-50,-50],[-50,0-50],[-0,0],[-50,50-0],[0-50,50],[0,0]]]},i={xmin:-50,ymin:-50,xmax:50,ymax:50};else if(n==="triangle"||n==="esriSMSTriangle"){const a=57.735026918962575,o=-a,h=2/3*100,l=h-100;s={rings:[[[o,l],[0,h],[a,l],[o,l]]]},i={xmin:o,ymin:l,xmax:a,ymax:h}}else n==="arrow"&&(s={rings:[[[-50,50],[50,0],[-50,-50],[-33,-20],[-33,20],[-50,50]]]},i={xmin:-50,ymin:-50,xmax:50,ymax:50});return[i,s]},kn=r=>r==="vertical"||r==="horizontal"||r==="cross"||r==="esriSFSCross"||r==="esriSFSVertical"||r==="esriSFSHorizontal",vn=r=>r&&r.charAt(0).toLowerCase()+r.substr(1);let ne;function In(r,t,e){if(!(!r.effects||q(t.geometryEngine))){if(ne)return void e.push(ne);Zi(r.effects)&&(ne=tr(),e.push(ne),ne.then(s=>t.geometryEngine=s))}}const Ls=.05;function Ln(r){return Math.max(Math.round(r/Ls),1)*Ls}const Tn=new Set(["StartTimeOffset","Duration","RepeatDelay"]);function Nn(r,t){return Tn.has(t)?Ln(r):r}function An(r){var t;if(!r)return null;switch(r.type){case"CIMPointSymbol":{const e=r.symbolLayers;return e&&e.length===1?An(e[0]):null}case"CIMVectorMarker":{const e=r.markerGraphics;if(!e||e.length!==1)return null;const s=e[0];if(!s)return null;const i=s.geometry;if(!i)return null;const n=s.symbol;return!n||n.type!=="CIMPolygonSymbol"&&n.type!=="CIMLineSymbol"||((t=n.symbolLayers)==null?void 0:t.some(a=>!!a.effects))?null:{geom:i,asFill:n.type==="CIMPolygonSymbol"}}case"sdf":return{geom:r.geom,asFill:r.asFill}}return null}function zn(r){return r?r.rings?r.rings:r.paths?r.paths:r.xmin!==void 0&&r.ymin!==void 0&&r.xmax!==void 0&&r.ymax!==void 0?[[[r.xmin,r.ymin],[r.xmin,r.ymax],[r.xmax,r.ymax],[r.xmax,r.ymin],[r.xmin,r.ymin]]]:null:null}function On(r){let t=1/0,e=-1/0,s=1/0,i=-1/0;for(const n of r)for(const a of n)a[0]<t&&(t=a[0]),a[0]>e&&(e=a[0]),a[1]<s&&(s=a[1]),a[1]>i&&(i=a[1]);return new ti(t,s,e-t,i-s)}function Ts(r){let t=1/0,e=-1/0,s=1/0,i=-1/0;for(const n of r)for(const a of n)a[0]<t&&(t=a[0]),a[0]>e&&(e=a[0]),a[1]<s&&(s=a[1]),a[1]>i&&(i=a[1]);return[t,s,e,i]}function ui(r){return r?r.rings?Ts(r.rings):r.paths?Ts(r.paths):$(r)?[r.xmin,r.ymin,r.xmax,r.ymax]:null:null}function fi(r,t,e,s,i){const[n,a,o,h]=r;if(o<n||h<a)return[0,0,0];const l=o-n,c=h-a,u=128,f=1,m=Math.floor(.5*(.5*u-f)),_=(u-2*(m+f))/Math.max(l,c),p=Math.round(l*_)+2*m,d=Math.round(c*_)+2*m;let g=1;t&&(g=d/_/(t.ymax-t.ymin));let y=0,P=0,x=1;s&&(i?t&&e&&t.ymax-t.ymin>0&&(x=(t.xmax-t.xmin)/(t.ymax-t.ymin),y=s.x/(e*x),P=s.y/e):(y=s.x,P=s.y)),y=.5*(t.xmax+t.xmin)+y*(t.xmax-t.xmin),P=.5*(t.ymax+t.ymin)+P*(t.ymax-t.ymin),y-=n,P-=a,y*=_,P*=_,y+=m,P+=m;let M=y/p-.5,k=P/d-.5;return i&&(M*=e*x,k*=e),[g,M,k]}function Ma(r){const t=zn(r.geom),e=On(t),s=128,i=1,n=Math.floor(.5*(.5*s-i)),a=(s-2*(n+i))/Math.max(e.width,e.height),o=Math.round(e.width*a)+2*n,h=Math.round(e.height*a)+2*n,l=[];for(const u of t)if(u&&u.length>1){const f=[];for(const m of u){let[_,p]=m;_-=e.x,p-=e.y,_*=a,p*=a,_+=n-.5,p+=n-.5,r.asFill?f.push([_,p]):f.push([Math.round(_),Math.round(p)])}if(r.asFill){const m=f.length-1;f[0][0]===f[m][0]&&f[0][1]===f[m][1]||f.push(f[0])}l.push(f)}const c=Rn(l,o,h,n);return r.asFill&&En(l,o,h,n,c),[$n(c,n),o,h]}function Rn(r,t,e,s){const i=t*e,n=new Array(i),a=s*s+1;for(let o=0;o<i;++o)n[o]=a;for(const o of r){const h=o.length;for(let l=1;l<h;++l){const c=o[l-1],u=o[l];let f,m,_,p;c[0]<u[0]?(f=c[0],m=u[0]):(f=u[0],m=c[0]),c[1]<u[1]?(_=c[1],p=u[1]):(_=u[1],p=c[1]);let d=Math.floor(f)-s,g=Math.floor(m)+s,y=Math.floor(_)-s,P=Math.floor(p)+s;d<0&&(d=0),g>t&&(g=t),y<0&&(y=0),P>e&&(P=e);const x=u[0]-c[0],M=u[1]-c[1],k=x*x+M*M;for(let v=d;v<g;v++)for(let T=y;T<P;T++){let L,b,w=(v-c[0])*x+(T-c[1])*M;w<0?(L=c[0],b=c[1]):w>k?(L=u[0],b=u[1]):(w/=k,L=c[0]+w*x,b=c[1]+w*M);const N=(v-L)*(v-L)+(T-b)*(T-b),H=(e-T-1)*t+v;N<n[H]&&(n[H]=N)}}}for(let o=0;o<i;++o)n[o]=Math.sqrt(n[o]);return n}function En(r,t,e,s,i){for(const n of r){const a=n.length;for(let o=1;o<a;++o){const h=n[o-1],l=n[o];let c,u,f,m;h[0]<l[0]?(c=h[0],u=l[0]):(c=l[0],u=h[0]),h[1]<l[1]?(f=h[1],m=l[1]):(f=l[1],m=h[1]);let _=Math.floor(c),p=Math.floor(u)+1,d=Math.floor(f),g=Math.floor(m)+1;_<s&&(_=s),p>t-s&&(p=t-s),d<s&&(d=s),g>e-s&&(g=e-s);for(let y=d;y<g;++y){if(h[1]>y==l[1]>y)continue;const P=(e-y-1)*t;for(let x=_;x<p;++x)x<(l[0]-h[0])*(y-h[1])/(l[1]-h[1])+h[0]&&(i[P+x]=-i[P+x]);for(let x=s;x<_;++x)i[P+x]=-i[P+x]}}}}function $n(r,t){const e=2*t,s=r.length,i=new Uint8Array(4*s);for(let n=0;n<s;++n){const a=.5-r[n]/e;qi(a,i,4*n)}return i}const Fn=96/72;class Ns{static executeEffects(t,e,s){const i=or(e),n=Fn;let a=new je(i);for(const o of t){const h=Ze(o);h&&(a=h.execute(a,o,n,s))}return a}static next(t){const e=t.next();return lr(e),e}static applyEffects(t,e,s){if(!t)return e;let i=new je(e);for(const o of t){const h=Ze(o);h&&(i=h.execute(i,o,1,s))}let n,a=null;for(;n=i.next();)a?O(a)?O(n)&&a.paths.push(...n.paths):z(a)&&z(n)&&a.rings.push(...n.rings):a=n;return a}}function Gn(r,t){let e;if(typeof r=="string")e=E(r+`-seed(${t})`);else{let s=12;e=r^t;do e=107*(e>>8^e)+s|0;while(--s!=0)}return(1+e/(1<<31))/2}function Hn(r){return Math.floor(Gn(r,Dn)*Xn)}const Dn=53290320,Xn=10,mi=ce.getLogger("esri.symbols.cim.cimAnalyzer");function os(r){switch(r){case"Butt":return Re.BUTT;case"Square":return Re.SQUARE;default:return Re.ROUND}}function hs(r){switch(r){case"Bevel":return Ee.BEVEL;case"Miter":return Ee.MITER;default:return Ee.ROUND}}function As(r,t,e,s){let i;r[t]?i=r[t]:(i={},r[t]=i),i[e]=s}function zs(r){const t=r.markerPlacement;return t&&t.angleToLine?Je.MAP:Je.SCREEN}async function Sa(r,t,e,s,i){const n=s!=null?s:[];if(!r)return n;let a,o;const h={};if(r.type!=="CIMSymbolReference")return mi.error("Expect cim type to be 'CIMSymbolReference'"),n;if(a=r.symbol,o=r.primitiveOverrides,o){const c=[];for(const u of o){const f=u.valueExpressionInfo;if(f&&t){const m=f.expression,_=$s(m,t.spatialReference,t.fields).then(p=>{at(p)||As(h,u.primitiveName,u.propertyName,p)});c.push(_)}else u.value!=null&&As(h,u.primitiveName,u.propertyName,u.value)}c.length>0&&await Promise.all(c)}const l=[];switch(U.fetchResources(a,e,l),l.length>0&&await Promise.all(l),a.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":Yn(a,o,h,t,n,e,i)}return n}function Yn(r,t,e,s,i,n,a){if(!r)return;const o=r.symbolLayers;if(!o)return;const h=r.effects;let l;const c=U.getSize(r);r.type==="CIMPointSymbol"&&r.angleAlignment==="Map"&&(l=Je.MAP);let u=o.length;for(;u--;){const f=o[u];if(!f||f.enable===!1)continue;let m;h&&h.length&&(m=[...h]);const _=f.effects;_&&_.length&&(h?m.push(..._):m=[..._]);const p=[];let d;A.findEffectOverrides(m,t,p),d=p.length>0?ia(m,p,e,s):m;const g=[];switch(A.findApplicableOverrides(f,t,g),f.type){case"CIMSolidFill":Vn(f,d,e,g,s,i);break;case"CIMPictureFill":Bn(f,d,e,g,s,n,i);break;case"CIMHatchFill":Wn(f,d,e,g,s,i);break;case"CIMGradientFill":Un(f,d,e,g,s,i);break;case"CIMSolidStroke":qn(f,d,e,g,s,i,r.type==="CIMPolygonSymbol",c);break;case"CIMPictureStroke":Jn(f,d,e,g,s,i,r.type==="CIMPolygonSymbol",c);break;case"CIMGradientStroke":jn(f,d,e,g,s,i,r.type==="CIMPolygonSymbol",c);break;case"CIMCharacterMarker":if(Be(f,d,e,g,s,i))break;break;case"CIMPictureMarker":if(Be(f,d,e,g,s,i))break;r.type==="CIMLineSymbol"&&(l=zs(f)),Kn(f,d,e,g,s,n,i,l,c);break;case"CIMVectorMarker":if(Be(f,d,e,g,s,i))break;r.type==="CIMLineSymbol"&&(l=zs(f)),Qn(f,d,e,g,s,i,n,l,c,a);break;default:mi.error("Cannot analyze CIM layer",f.type)}}}function Vn(r,t,e,s,i,n){const a=r.primitiveName,o=Y(r.color),[h,l]=et(s,a,t,null,null),c=E(JSON.stringify(r)+l).toString();n.push({type:"fill",templateHash:c,materialHash:h?()=>c:c,cim:r,materialOverrides:null,colorLocked:r.colorLocked,color:S(a,e,"Color",i,o,Z),height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,effects:t,applyRandomOffset:!1,sampleAlphaOnly:!0})}function Bn(r,t,e,s,i,n,a){const o=r.primitiveName,h=r.tintColor?Y(r.tintColor):{r:255,g:255,b:255,a:1},[l,c]=et(s,o,t,null,null),u=E(JSON.stringify(r)+c).toString(),f=E(`${r.url}${JSON.stringify(r.colorSubstitutions)}`).toString();let m=C(r.scaleX);if("width"in r){const _=r.width;let p=1;const d=n.getResource(r.url);q(d)&&(p=d.width/d.height),m/=p*(r.height/_)}a.push({type:"fill",templateHash:u,materialHash:l?()=>f:f,cim:r,materialOverrides:null,colorLocked:r.colorLocked,effects:t,color:S(o,e,"TintColor",i,h,Z),height:S(o,e,"Height",i,r.height),scaleX:S(o,e,"ScaleX",i,m),angle:S(o,e,"Rotation",i,C(r.rotation)),offsetX:S(o,e,"OffsetX",i,C(r.offsetX)),offsetY:S(o,e,"OffsetY",i,C(r.offsetY)),url:r.url,applyRandomOffset:!1,sampleAlphaOnly:!1})}function Wn(r,t,e,s,i,n){var _;const a=["Rotation","OffsetX","OffsetY"],o=s.filter(p=>p.primitiveName!==r.primitiveName||!a.includes(p.propertyName)),h=r.primitiveName,[l,c]=et(s,h,t,null,null),u=E(JSON.stringify(r)+c).toString(),f=E(`${r.separation}${JSON.stringify(r.lineSymbol)}`).toString();let m={r:255,g:255,b:255,a:1};if(r.lineSymbol){const p=(_=r.lineSymbol)==null?void 0:_.symbolLayers.find(d=>d.type==="CIMSolidStroke");p&&(m=Y(p.color))}n.push({type:"fill",templateHash:u,materialHash:l?me(f,e,o,i):f,cim:r,materialOverrides:o,colorLocked:r.colorLocked,effects:t,color:m,height:S(h,e,"Separation",i,r.separation),scaleX:1,angle:S(h,e,"Rotation",i,C(r.rotation)),offsetX:S(h,e,"OffsetX",i,C(r.offsetX)),offsetY:S(h,e,"OffsetY",i,C(r.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!0})}function Un(r,t,e,s,i,n){const a=r.primitiveName,[o,h]=et(s,a,t,null,null),l=E(JSON.stringify(r)+h).toString();n.push({type:"fill",templateHash:l,materialHash:o?me(l,e,s,i):l,cim:r,materialOverrides:null,colorLocked:r.colorLocked,effects:t,color:{r:128,g:128,b:128,a:1},height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,applyRandomOffset:!1,sampleAlphaOnly:!1})}function qn(r,t,e,s,i,n,a,o){const h=r.primitiveName,l=Y(r.color),c=r.width!==void 0?r.width:4,u=os(r.capStyle),f=hs(r.joinStyle),m=r.miterLimit,[_,p]=et(s,h,t,null,null),d=E(JSON.stringify(r)+p).toString();let g,y;if(t&&t instanceof Array&&t.length>0){const P=t[t.length-1];if(P.type==="CIMGeometricEffectDashes"&&P.lineDashEnding==="NoConstraint"&&P.offsetAlongLine===null){const x=(t=[...t]).pop();g=x.dashTemplate,y=x.scaleDash}}n.push({type:"line",templateHash:d,materialHash:_?()=>d:d,cim:r,materialOverrides:null,isOutline:a,colorLocked:r.colorLocked,effects:t,color:S(h,e,"Color",i,l,Z),width:S(h,e,"Width",i,c),cap:S(h,e,"CapStyle",i,u),join:S(h,e,"JoinStyle",i,f),miterLimit:S(h,e,"MiterLimit",i,m),referenceWidth:o,zOrder:ls(r.name),dashTemplate:g,scaleDash:y,sampleAlphaOnly:!0})}function Jn(r,t,e,s,i,n,a,o){const h=E(`${r.url}${JSON.stringify(r.colorSubstitutions)}`).toString(),l=r.primitiveName,c=Y(r.tintColor),u=r.width!==void 0?r.width:4,f=os(r.capStyle),m=hs(r.joinStyle),_=r.miterLimit,[p,d]=et(s,l,t,null,null),g=E(JSON.stringify(r)+d).toString();n.push({type:"line",templateHash:g,materialHash:p?()=>h:h,cim:r,materialOverrides:null,isOutline:a,colorLocked:r.colorLocked,effects:t,color:S(l,e,"TintColor",i,c,Z),width:S(l,e,"Width",i,u),cap:S(l,e,"CapStyle",i,f),join:S(l,e,"JoinStyle",i,m),miterLimit:S(l,e,"MiterLimit",i,_),referenceWidth:o,zOrder:ls(r.name),dashTemplate:null,scaleDash:!1,url:r.url,sampleAlphaOnly:!1})}function jn(r,t,e,s,i,n,a,o){const h=r.primitiveName,l=r.width!==void 0?r.width:4,c=os(r.capStyle),u=hs(r.joinStyle),f=r.miterLimit,[m,_]=et(s,h,t,null,null),p=E(JSON.stringify(r)+_).toString();n.push({type:"line",templateHash:p,materialHash:m?me(p,e,s,i):p,cim:r,materialOverrides:null,isOutline:a,colorLocked:r.colorLocked,effects:t,color:{r:128,g:128,b:128,a:1},width:S(h,e,"Width",i,l),cap:S(h,e,"CapStyle",i,c),join:S(h,e,"JoinStyle",i,u),miterLimit:S(h,e,"MiterLimit",i,f),referenceWidth:o,zOrder:ls(r.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1})}function Be(r,t,e,s,i,n){const a=r.markerPlacement;if(!a||a.type!=="CIMMarkerPlacementInsidePolygon")return!1;const o=a,h=Math.abs(o.stepX),l=Math.abs(o.stepY);if(h===0||l===0)return!0;const c=["Rotation","OffsetX","OffsetY"],u=s.filter(x=>x.primitiveName!==r.primitiveName||!c.includes(x.propertyName)),f="url"in r?r.url:null,[m,_]=et(s,o.primitiveName,t,null,null),p=E(JSON.stringify(r)+_).toString();let d,g,y=null;if(a.gridType==="Random"){const x=qt(Hs),M=Math.max(Math.floor(x/h),1),k=Math.max(Math.floor(x/l),1);d=l*k,y=v=>v?v*k:0,g=M*h/d}else a.shiftOddRows?(d=2*l,y=x=>x?2*x:0,g=h/l*.5):(d=l,y=null,g=h/l);let P={r:255,g:255,b:255,a:1};return"tintColor"in r&&(P=Y(r.tintColor)),n.push({type:"fill",templateHash:p,materialHash:m?me(p,e,u,i):p,cim:r,materialOverrides:u,colorLocked:r.colorLocked,effects:t,color:S(o.primitiveName,e,"TintColor",i,P,Z),height:S(o.primitiveName,e,"StepY",i,d,y),scaleX:g,angle:S(o.primitiveName,e,"GridAngle",i,o.gridAngle),offsetX:S(o.primitiveName,e,"OffsetX",i,C(o.offsetX)),offsetY:S(o.primitiveName,e,"OffsetY",i,C(o.offsetY)),url:f,applyRandomOffset:a.gridType==="Random",sampleAlphaOnly:!f}),!0}function Kn(r,t,e,s,i,n,a,o,h){var L;const l=r.primitiveName,c=C(r.size);let u=C(r.scaleX,1);const f=C(r.rotation),m=C(r.offsetX),_=C(r.offsetY),p=r.tintColor?Y(r.tintColor):{r:255,g:255,b:255,a:1},d=E(`${r.url}${JSON.stringify(r.colorSubstitutions)}${JSON.stringify(r.animatedSymbolProperties)}`).toString(),g=pi(r.markerPlacement,s,e,i),y=ra(r.animatedSymbolProperties,s,e,i),[P,x]=et(s,l,t,g,y),M=E(JSON.stringify(r)+x).toString(),k=(L=r.anchorPoint)!=null?L:{x:0,y:0};if("width"in r){const b=r.width;let w=1;const N=n.getResource(r.url);q(N)&&(w=N.width/N.height),u/=w*(c/b)}function v(b,w){return Ds(y,b,w)}const T=r.animatedSymbolProperties&&r.animatedSymbolProperties.randomizeStartTime===!0?(b,w,N,H)=>{const ft=Hn(H),mt=v(b,w);return d+`-MATERIALGROUP(${ft})-ASP(${JSON.stringify(mt)})`}:P?(b,w)=>{const N=v(b,w);return d+`-ASP(${JSON.stringify(N)})`}:d;a.push({type:"marker",templateHash:M,materialHash:T,cim:r,materialOverrides:null,colorLocked:r.colorLocked,effects:t,scaleSymbolsProportionally:!1,alignment:o,size:S(l,e,"Size",i,c),scaleX:S(l,e,"ScaleX",i,u),rotation:S(l,e,"Rotation",i,f),offsetX:S(l,e,"OffsetX",i,m),offsetY:S(l,e,"OffsetY",i,_),color:S(l,e,"TintColor",i,p,Z),anchorPoint:{x:k.x,y:-k.y},isAbsoluteAnchorPoint:r.anchorPointUnits!=="Relative",outlineColor:{r:0,g:0,b:0,a:0},outlineWidth:0,frameHeight:0,rotateClockwise:r.rotateClockwise,referenceSize:h,sizeRatio:1,markerPlacement:g,url:r.url,animatedSymbolProperties:y})}function Qn(r,t,e,s,i,n,a,o,h,l){const c=r.markerGraphics;if(!c)return;let u=0;if(r.scaleSymbolsProportionally){const m=r.frame;m&&(u=m.ymax-m.ymin)}const f=pi(r.markerPlacement,s,e,i);for(const m of c)if(m){const _=m.symbol;if(!_)continue;switch(_.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":ta(r,t,f,null,m,s,e,i,n,a,o,h,u,l);break;case"CIMTextSymbol":Zn(r,t,f,m,e,s,i,n,o,h,u)}}}function Zn(r,t,e,s,i,n,a,o,h,l,c){const u=[];A.findApplicableOverrides(s,n,u);const f=s.geometry;if(!("x"in f)||!("y"in f))return;const m=s.symbol,_=Ws(m),p=Bs(m.fontStyleName),d=is(m.fontFamilyName);m.font={family:d,decoration:_,...p};const g=r.frame,y=f.x-.5*(g.xmin+g.xmax),P=f.y-.5*(g.ymin+g.ymax),x=r.size/c,M=r.primitiveName,k=C(m.height)*x,v=C(m.angle),T=C(r.offsetX)+(C(m.offsetX)+y)*x,L=C(r.offsetY)+(C(m.offsetY)+P)*x,b=Y(Dt(m));let w=Y(Xt(m)),N=le(m);N||(w=Y(Dt(m.haloSymbol)),N=m.haloSize*x);const[H,ft]=et(n,M,t,e,null),mt=JSON.stringify(r.effects)+Number(r.colorLocked).toString()+JSON.stringify(r.anchorPoint)+r.anchorPointUnits+JSON.stringify(r.markerPlacement)+r.size.toString(),se=E(JSON.stringify(s)+mt+ft).toString();let G=S(s.primitiveName,i,"TextString",a,s.textString,Vs,m.textCase);if(G==null)return;const{fontStyleName:J}=m,Yt=d+(J?"-"+J.toLowerCase():"-regular"),pt=Yt;typeof G=="string"&&G.includes("[")&&m.fieldMap&&(G=Ki(m.fieldMap,G,m.textCase)),o.push({type:"text",templateHash:se,materialHash:H||typeof G=="function"||G.match(/\[(.*?)\]/)?(Vt,D,pe)=>pt+"-"+Ds(G,Vt,D,pe):pt+"-"+E(G),cim:m,materialOverrides:null,colorLocked:r.colorLocked,effects:t,alignment:h,anchorPoint:{x:r.anchorPoint?r.anchorPoint.x:0,y:r.anchorPoint?r.anchorPoint.y:0},isAbsoluteAnchorPoint:r.anchorPointUnits!=="Relative",fontName:Yt,decoration:_,weight:S(M,i,"Weight",a,p.weight),style:S(M,i,"Size",a,p.style),size:S(M,i,"Size",a,k),angle:S(M,i,"Rotation",a,v),offsetX:S(M,i,"OffsetX",a,T),offsetY:S(M,i,"OffsetY",a,L),horizontalAlignment:Us(m.horizontalAlignment),verticalAlignment:qs(m.verticalAlignment),text:G,color:b,outlineColor:w,outlineSize:N,referenceSize:l,sizeRatio:1,markerPlacement:e})}function ta(r,t,e,s,i,n,a,o,h,l,c,u,f,m){var y;const _=i.symbol,p=_.symbolLayers;if(!p)return;if(m)return void Os(r,t,e,s,i,a,n,o,h,l,c,u,f);let d=p.length;if(na(p))return void ea(r,t,e,s,i,p,n,a,o,h,c,u,f);const g=Ns.applyEffects(_.effects,i.geometry,l.geometryEngine);if(g)for(;d--;){const P=p[d];if(P&&P.enable!==!1)switch(P.type){case"CIMSolidFill":case"CIMSolidStroke":{const x=Ns.applyEffects(P.effects,g,l.geometryEngine),M=ui(x);if(!M)continue;const k=r.anchorPointUnits!=="Relative",[v,T,L]=fi(M,r.frame,r.size,r.anchorPoint,k),b=P.type==="CIMSolidFill",w={type:"sdf",geom:x,asFill:b},N=r.primitiveName,H=(y=C(r.size))!=null?y:10,ft=C(r.rotation),mt=C(r.offsetX),se=C(r.offsetY),G=P.path,J=P.primitiveName,Yt=Y(b?Dt(P):Xt(P)),pt=b?{r:0,g:0,b:0,a:0}:Y(Xt(P)),Vt=le(P);if(!b&&!Vt)break;let D=!1,pe="";for(const _t of n)_t.primitiveName!==J&&_t.primitiveName!==N||(_t.value!==void 0?pe+=`-${_t.primitiveName}-${_t.propertyName}-${JSON.stringify(_t.value)}`:_t.valueExpressionInfo&&(D=!0));q(t)&&typeof t=="function"&&(D=!0);const _i=JSON.stringify({...r,markerGraphics:null}),us=E(JSON.stringify(w)+G).toString(),di={type:"marker",templateHash:E(JSON.stringify(i)+JSON.stringify(P)+_i+pe).toString(),materialHash:D?()=>us:us,cim:w,materialOverrides:null,colorLocked:r.colorLocked,effects:t,scaleSymbolsProportionally:r.scaleSymbolsProportionally,alignment:c,anchorPoint:{x:T,y:L},isAbsoluteAnchorPoint:k,size:S(r.primitiveName,a,"Size",o,H),rotation:S(r.primitiveName,a,"Rotation",o,ft),offsetX:S(r.primitiveName,a,"OffsetX",o,mt),offsetY:S(r.primitiveName,a,"OffsetY",o,se),scaleX:1,frameHeight:f,rotateClockwise:r.rotateClockwise,referenceSize:u,sizeRatio:v,color:S(J,a,"Color",o,Yt,Z),outlineColor:S(J,a,"Color",o,pt,Z),outlineWidth:S(J,a,"Width",o,Vt),markerPlacement:e,animatedSymbolProperties:s,path:G};h.push(di);break}default:Os(r,t,e,s,i,a,n,o,h,l,c,u,f)}}}function ea(r,t,e,s,i,n,a,o,h,l,c,u,f){const m=i.geometry,_=n[0],p=n[1],d=ui(m);if(!d)return;const g=r.anchorPointUnits!=="Relative",[y,P,x]=fi(d,r.frame,r.size,r.anchorPoint,g),M={type:"sdf",geom:m,asFill:!0},k=r.primitiveName,v=C(r.size),T=C(r.rotation),L=C(r.offsetX),b=C(r.offsetY),w=p.path,N=p.primitiveName,H=_.primitiveName,ft=Y(Dt(p)),mt=Y(Xt(_)),se=le(_);let G=!1,J="";for(const D of a)D.primitiveName!==N&&D.primitiveName!==H&&D.primitiveName!==k||(D.value!==void 0?J+=`-${D.primitiveName}-${D.propertyName}-${JSON.stringify(D.value)}`:D.valueExpressionInfo&&(G=!0));const Yt=JSON.stringify({...r,markerGraphics:null}),pt=E(JSON.stringify(M)+w).toString(),Vt={type:"marker",templateHash:E(JSON.stringify(i)+JSON.stringify(p)+JSON.stringify(_)+Yt+J).toString(),materialHash:G?()=>pt:pt,cim:M,materialOverrides:null,colorLocked:r.colorLocked,effects:t,scaleSymbolsProportionally:r.scaleSymbolsProportionally,alignment:c,anchorPoint:{x:P,y:x},isAbsoluteAnchorPoint:g,size:S(r.primitiveName,o,"Size",h,v),rotation:S(r.primitiveName,o,"Rotation",h,T),offsetX:S(r.primitiveName,o,"OffsetX",h,L),offsetY:S(r.primitiveName,o,"OffsetY",h,b),scaleX:1,frameHeight:f,rotateClockwise:r.rotateClockwise,referenceSize:u,sizeRatio:y,color:S(N,o,"Color",h,ft,Z),outlineColor:S(H,o,"Color",h,mt,Z),outlineWidth:S(H,o,"Width",h,se),markerPlacement:e,path:w,animatedSymbolProperties:s};l.push(Vt)}function Os(r,t,e,s,i,n,a,o,h,l,c,u,f){const m=sa(r,i),_=["Rotation","OffsetX","OffsetY"],p=a.filter(b=>b.primitiveName!==r.primitiveName||!_.includes(b.propertyName));let d="";for(const b of a)b.value!==void 0&&(d+=`-${b.primitiveName}-${b.propertyName}-${JSON.stringify(b.value)}`);const[g,y,P]=U.getTextureAnchor(m,l),x=r.primitiveName,M=C(r.rotation),k=C(r.offsetX),v=C(r.offsetY),T=E(JSON.stringify(m)+d).toString(),L={type:"marker",templateHash:T,materialHash:p.length>0||q(t)&&typeof t=="function"?me(T,n,p,o):T,cim:m,materialOverrides:p,colorLocked:r.colorLocked,effects:t,scaleSymbolsProportionally:r.scaleSymbolsProportionally,alignment:c,anchorPoint:{x:g,y},isAbsoluteAnchorPoint:!1,size:r.size,rotation:S(x,n,"Rotation",o,M),offsetX:S(x,n,"OffsetX",o,k),offsetY:S(x,n,"OffsetY",o,v),color:{r:255,g:255,b:255,a:1},outlineColor:{r:0,g:0,b:0,a:0},outlineWidth:0,scaleX:1,frameHeight:f,rotateClockwise:r.rotateClockwise,referenceSize:u,sizeRatio:P/Kt(r.size),markerPlacement:e,animatedSymbolProperties:s};h.push(L)}function sa(r,t){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:[t],scaleSymbolsProportionally:r.scaleSymbolsProportionally,respectFrame:r.respectFrame,clippingPath:r.clippingPath}}function ls(r){if(r&&r.indexOf("Level_")===0){const t=parseInt(r.substr(6),10);if(!isNaN(t))return t}return 0}function Z(r){if(!r||r.length===0)return null;const t=new ss(r).toRgba();return{r:t[0],g:t[1],b:t[2],a:t[3]}}function S(r,t,e,s,i,n,a){const o=t[r];if(o){const h=o[e];if(typeof h=="string"||typeof h=="number"||h instanceof Array)return n?n.call(null,h,a):h;if(h!=null&&h instanceof ue)return(l,c,u)=>{let f=ee(h,l,{$view:u},s.geometryType,c);return f!==null&&n&&(f=n.call(null,f,a)),f!==null?f:i}}return i}function cs(r){return r&&r.charAt(0).toLowerCase()+r.substr(1)}function ia(r,t,e,s){for(const i of t)if(i.valueExpressionInfo){const n=e[i.primitiveName]&&e[i.primitiveName][i.propertyName];n instanceof ue&&(i.fn=(a,o,h)=>ee(n,a,{$view:h},s.geometryType,o))}return(i,n,a)=>{for(const h of t)h.fn&&(h.value=h.fn(i,n,a));const o=[];for(let h of r){const l=h==null?void 0:h.primitiveName;if(l){let c=!1;for(const u of t)if(u.primitiveName===l){const f=cs(u.propertyName);u.value!=null&&u.value!==h[f]&&(c||(h=R(h),c=!0),h[f]=u.value)}}o.push(h)}return o}}function pi(r,t,e,s){const i=[];if(A.findApplicableOverrides(r,t,i),i.length===0)return r;for(const n of i)if(n.valueExpressionInfo){const a=e[n.primitiveName]&&e[n.primitiveName][n.propertyName];a instanceof ue&&(n.fn=(o,h,l)=>ee(a,o,{$view:l},s.geometryType,h))}return(n,a,o)=>{for(const c of i)c.fn&&(c.value=c.fn(n,a,o));const h=R(r),l=r.primitiveName;for(const c of i)if(c.primitiveName===l){const u=cs(c.propertyName);c.value!=null&&c.value!==h[u]&&(h[u]=c.value)}return h}}function ra(r,t,e,s){const i=[];if(A.findApplicableOverrides(r,t,i),i.length===0)return r;for(const n of i)if(n.valueExpressionInfo){const a=e[n.primitiveName]&&e[n.primitiveName][n.propertyName];a instanceof ue&&(n.fn=(o,h,l)=>ee(a,o,{$view:l},s.geometryType,h))}return(n,a,o)=>{for(const c of i)c.fn&&(c.value=c.fn(n,a,o));const h=R(r),l=r.primitiveName;for(const c of i)if(c.primitiveName===l){const u=cs(c.propertyName);if(c.value!=null){const f=Nn(c.value,c.propertyName);f!==h[u]&&(h[u]=f)}}return h}}function me(r,t,e,s){for(const i of e)if(i.valueExpressionInfo){const n=t[i.primitiveName]&&t[i.primitiveName][i.propertyName];n instanceof ue&&(i.fn=(a,o,h)=>ee(n,a,{$view:h},s.geometryType,o))}return(i,n,a)=>{for(const o of e)o.fn&&(o.value=o.fn(i,n,a));return E(r+A.buildOverrideKey(e)).toString()}}function Ca(r,t){if(!t||t.length===0)return r;const e=R(r);return A.applyOverrides(e,t),e}function et(r,t,e,s,i){let n=!1,a="";for(const o of r)o.primitiveName===t&&(o.value!==void 0?a+=`-${o.primitiveName}-${o.propertyName}-${JSON.stringify(o.value)}`:o.valueExpressionInfo&&(n=!0));return q(e)&&typeof e=="function"&&(n=!0),q(s)&&typeof s=="function"&&(n=!0),q(i)&&typeof i=="function"&&(n=!0),[n,a]}const na=r=>r&&r.length===2&&r[0].enable&&r[1].enable&&r[0].type==="CIMSolidStroke"&&r[1].type==="CIMSolidFill"&&!r[0].effects&&!r[1].effects,aa={marker:xe.MARKER,fill:xe.FILL,line:xe.LINE,text:xe.TEXT};class wa{constructor(t,e,s,i){const n={minScale:e==null?void 0:e.minScale,maxScale:e==null?void 0:e.maxScale},a=oa(n);this.layers=t,this.data=e,this.hash=this._createHash()+a,this.rendererKey=s;const o={isOutline:!1,placement:null,symbologyType:Xi.DEFAULT,vvFlags:s};for(const h of t){const l=aa[h.type];o.isOutline=h.type==="line"&&h.isOutline,h.materialKey=Di(l,o),h.maxVVSize=i,h.scaleInfo=n,h.templateHash+=a}}get type(){return"expanded-cim"}_createHash(){let t="";for(const e of this.layers)t+=e.templateHash;return t}}function oa(r){return r.minScale||r.maxScale?r.minScale+"-"+r.maxScale:""}export{xa as Q,Sa as T,Pa as V,ga as a,Ma as b,Hn as c,ba as d,Gn as e,or as f,Jr as g,Ns as h,ya as i,ri as j,Ds as k,wa as l,Ca as m,rs as n,U as o,vs as p,ee as q,An as r,ti as t};
|