// All material copyright Esri, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.30/esri/copyright.txt for details. //>>built define("require exports ../arcade/arcadeCompiler ../arcade/ArcadeModuleResolver ../arcade/arcadeRuntime ../arcade/executionError ../arcade/parser ../arcade/treeAnalysis ../arcade/functions/geomsync ../core/has ../core/maybe".split(" "),function(n,d,p,da,r,q,N,l,ea,O,fa){function P(a,b){if(!0===b.useAsync||!0===a.isAsync)return ha(a,b);if(O("esri-csp-restrictions"))return function(c){return r.executeScript(a,c)};try{return p.compileScript(a,b)}catch(c){if("esri.arcade.arcadeuncompilableerror"===c.declaredRootClass)return function(g){return r.executeScript(a, g)};throw c;}}function ha(a,b){if(null===k)throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.AsyncNotEnabled,null);if(O("esri-csp-restrictions"))return function(c){return k.executeScript(a,c)};try{return p.compileScript(a,b,!0)}catch(c){if("esri.arcade.arcadeuncompilableerror"===c.declaredRootClass)return function(g){return k.executeScript(a,g)};throw c;}}function Q(a){r.extend(a);p.extend(a,"sync");null===k?w.push(a):(p.extend(a,"async"),k.extend(a))}function x(a,b=[]){return N.parseScript(a, b)}function R(a,b,c=[]){a=N.parseScript(a,c);return y(a,b)}function y(a,b){if(!0===b.useAsync||!0===a.isAsync){if(null===k)throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.AsyncNotEnabled,null);return k.executeScript(a,b)}return r.executeScript(a,b)}function z(a,b){return l.referencesMember(a,b)}function S(a,b){return l.referencesFunction(a,b)}function T(a,b=!1){void 0===b&&(b=!1);return l.findFieldLiterals(a)}function U(a){return l.findExpectedFieldLiterals(a)}function t(a,b=[]){void 0=== a.usesGeometry&&l.findScriptDependencies(a,b);return!0===a.usesGeometry}function A(){return B?B:B=C()}async function C(){const a=await new Promise((b,c)=>n(["../geometry/geometryEngine"],b,c));D=!0;ea.setGeometryEngine(a);return!0}function u(){return null!==E?E:E=F()}async function F(){await p.enableAsyncSupport();k=await new Promise((a,b)=>n(["../arcade/arcadeAsyncRuntime"],a,b));for(const a of w)k.extend(a),p.extend(a,"async");w=null;return!0}function V(){return G}function H(){return k?!0:!1}function W(){return D} function I(){return J?J:J=K()}async function K(){await u();const [a,b,c,g,m,h]=await Promise.all([new Promise((f,e)=>n(["../arcade/featureSetUtils"],f,e)),new Promise((f,e)=>n(["../arcade/functions/featuresetbase"],f,e)),new Promise((f,e)=>n(["../arcade/functions/featuresetgeom"],f,e)),new Promise((f,e)=>n(["../arcade/functions/featuresetstats"],f,e)),new Promise((f,e)=>n(["../arcade/functions/featuresetstring"],f,e)),new Promise((f,e)=>n(["../arcade/functions/knowledgegraph"],f,e))]);X=a;k.extend([b, c,g,m,h]);p.extend([b,c,g,m,h],"async");return G=!0}function L(a,b=[]){void 0===a.usesFeatureSet&&l.findScriptDependencies(a,b);return!0===a.usesFeatureSet}function Y(a,b=[]){void 0===a.isAsync&&l.findScriptDependencies(a,b);return!0===a.isAsync}async function Z(a,b,c=[],g=!1,m=null){return v(new Set,a,b,c,g,m)}async function v(a,b,c,g=[],m=!1,h=null){b="string"===typeof b?x(b):b;const f=[];if(b&&(!1===D&&(t(b)||m)&&f.push(A()),!1===H()&&(!0===b.isAsync||c)&&f.push(u()),!1===G)){var e;if(!(e=L(b)))a:{if(g)for(const ia of g)if(z(b, ia)){e=!0;break a}e=!1}e&&f.push(I())}f.length&&await Promise.all(f);await M(a,b,h,c,m);return!0}function aa(a,b=[]){void 0===a.usesModules&&l.findScriptDependencies(a,b);return!0===a.usesModules}async function M(a,b,c=null,g=!1,m=!1){var h=l.findModuleImports(b);null===c&&0