1"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[55],{50055:(K,D,l)=>{l.r(D),l.d(D,{createArcadeExecutor:()=>H,createArcadeProfile:()=>z});var h=l(69563),C=l(42070),f=l(73587),y=l(40945),x=l(11075),b=l(88988),P=l(94813),F=l(8405),W=l(77467),Z=l(60622),G=l(39701);let d=null;function k(e,o,a,n={}){const r=o.elementType,s="value",u=r.type==="array"?[{name:s,type:r.type,elementType:r.elementType}]:r.type==="dictionary"?[{name:s,type:r.type,properties:r.properties}]:[{name:s,type:r.type}];return new f.A(e.map(c=>{const t={};return S(t,u,{[s]:c},a,n),t[s]}))}function Y(e,o,a={}){const n=e instanceof Z.A?new F.default({source:e.features,geometryType:e.geometryType,fields:e.fields,spatialReference:e.spatialReference}):e;return o.constructFeatureSet(n,a.spatialReference,null,!0,a.lruCache,a.interceptor)}function J(e,o,a={}){const{spatialReference:n,interceptor:r,lruCache:s}=a;return typeof e=="string"?o.createFeatureSetCollectionFromService(e,n,s,r):o.createFeatureSetCollectionFromMap(e,n,s,r)}function N(e,o,a,n={}){const r={};return S(r,o.properties,e,a,n),new d.Dictionary(r)}function S(e,o,a,n,r={}){const s={};for(const u of Object.keys(a))s[u.toLowerCase()]=a[u];for(const u of o){const c=u.name.toLowerCase();if(r.variablesPreProcessed)e[c]=s[c];else switch(u.type){case"array":{const t=s[c];e[c]=t==null?null:k(t,u,n,r);break}case"feature":{const t=s[c];e[c]=t==null?null:d.Feature.createFromGraphic(t,r?.timeZone);break}case"featureSet":{const t=s[c];e[c]=t==null?null:n?Y(t,n,r):null;break}case"featureSetCollection":{const t=s[c];e[c]=t==null?null:n?J(t,n,r):null;break}case"dictionary":{const t=s[c];e[c]=t==null?null:N(t,u,n,r);break}case"date":{const t=s[c];e[c]=t?t instanceof C.lY?t:r?.timeZone?C.lY.dateJSAndZoneToArcadeDate(t,r?.timeZone):C.lY.dateJSToArcadeDate(t):null;break}case"dateOnly":{const t=s[c];e[c]=t?t instanceof b.n?t:b.n.fromReader(t):null;break}case"time":{const t=s[c];e[c]=t?t instanceof P.k?t:P.k.fromReader(t):null;break}case"knowledgeGraph":case"geometry":case"boolean":case"text":case"number":e[c]=s[c]}}}function $(e,o){for(const a of e)o.push(a),a.type==="dictionary"&&$(a.properties,o);return o}function M(e,o,a,n,r){const{spatialReference:s,interceptor:u,lruCache:c,console:t,abortSignal:_,timeZone:p,services:g={portal:W.A.getDefault()}}=a,A={vars:{},spatialReference:s,interceptor:u,timeZone:p,lrucache:c,useAsync:r,services:g,console:t,abortSignal:_};return o&&S(A.vars,e.variables,o,n,a),A}function O(e,o){switch(o.getArcadeType(e)){case"number":case"text":case"boolean":case"point":case"polygon":case"polyline":case"multipoint":case"extent":return e;case"date":return e.toJSDate();case"time":case"dateOnly":return e.toString();case"feature":{const a=(e.type,e),n="geometry"in a?a.geometry():null,r="readAttributes"in a?a.readAttributes():a.attributes;return new h.default({geometry:n,attributes:r})}case"dictionary":{const a=e,n=a.attributes,r={};for(const s of Object.keys(n))r[s]=O(a.field(s),o);return r}case"array":return("toArray"in e?e.toArray():e).map(a=>O(a,o))}return e}const T={variables:[{name:"$feature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"},{name:"$userInput",type:"geometry"},{name:"$graph",type:"knowledgeGraph"}]},L={variables:[{name:"$feature",type:"feature"},{name:"$aggregatedFeatures",type:"featureSet"}]},R=new Map([["form-constraint",{variables:[{name:"$feature",type:"feature"}]}],["feature-z",{variables:[{name:"$feature",type:"feature"}]}],["field-calculation",{variables:[{name:"$feature",type:"feature"},{name:"$datastore",type:"featureSetCollection"}]}],["form-calculation",{variables:[{name:"$feature",type:"feature"},{name:"$originalFeature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$featureSet",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"},{name:"$editContext",type:"dictionary",properties:[{name:"editType",type:"text"}]}]}],["labeling",{variables:[{name:"$feature",type:"feature"}]}],["popup",T],["popup-element",T],["feature-reduction-popup",L],["feature-reduction-popup-element",L],["visualization",{variables:[{name:"$feature",type:"feature"},{name:"$view",type:"dictionary",properties:[{name:"scale",type:"number"}]}]}]]);function z(e){const o=R.get(e);if(!o){const a=Array.from(R.keys()).map(n=>`'${n}'`).join(", ");throw new y.A("createArcadeProfile:invalid-profile-name",`Invalid profile name '${e}'. You must specify one of the following values: ${a}`)}return(0,x.o8)(o)}async function H(e,o,a={}){d||(d=await(0,G.lw)());const{arcade:n,arcadeUtils:r}=d,{loadScriptDependencies:s,referencesMember:u,scriptIsAsync:c}=n,t=$(o.variables,[]),_=t.filter(i=>i.type==="featureSet"||i.type==="featureSetCollection").map(i=>i.name.toLowerCase()),p=n.parseScript(e,_);if(!p)throw new y.A("arcade:invalid-script","Unable to create SyntaxTree");const g=r.extractFieldNames(p),A=n.scriptTouchesGeometry(p),U=t.map(i=>i.name.toLowerCase()).filter(i=>u(p,i)),m=c(p,_);await s(p,m,_);const w={vars:{},spatialReference:null,useAsync:m};for(const i of U)w.vars[i]="any";const{lruCache:j}=a,I=n.compileScript(p,w),B=n.featureSetUtils(),{services:Q}=a;return{execute:(i,v={})=>
1{if(m)throw new y.A("arcade:invalid-execution-mode","Cannot execute the script in synchronous mode");const E=I(M(o,i,{lruCache:j,...v},B,m));return v.rawOutput?E:O(E,r)},executeAsync:async(i,v={})=>{const E=await I(M(o,i,{lruCache:j,services:Q,...v},B,m));return v.rawOutput?E:O(E,r)},isAsync:m,variablesUsed:U,fieldsUsed:g,geometryUsed:A,syntaxTree:p}}},73587:(K,D,l)=>{l.d(D,{A:()=>h});class h{constructor(f=[]){this._elements=f}length(){return this._elements.length}get(f){return this._elements[f]}toArray(){const f=[];for(let y=0;y<this.length();y++)f.push(this.get(y));return f}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.