12345 |
- /*
- All material copyright ESRI, All Rights Reserved, unless otherwise specified.
- See https://js.arcgis.com/4.24/esri/copyright.txt for details.
- */
- import{compileScript as e,extend as t,enableAsyncSupport as r}from"../arcade/arcadeCompiler.js";import{extend as n,executeScript as s,referencesMember as i,referencesFunction as a}from"../arcade/arcadeRuntime.js";import{parseScript as c,validateScript as u,scriptCheck as o,extractFieldLiterals as l,extractExpectedFieldLiterals as f}from"../arcade/parser.js";import{findScriptDependencies as p,findFunctionCalls as m}from"../arcade/treeAnalysis.js";import d from"../core/has.js";const y=["feature","angle","bearing","centroid","envelopeintersects","extent","geometry","isselfintersecting","ringisclockwise"];function S(){return!0}const b=S();let x=!1,A=!1,g=null,j=[];function h(t,r){if(!0===r.useAsync||!0===t.isAsync)return w(t,r);if(d("esri-csp-restrictions")){return function(e){return s(t,e)}}return e(t,r)}function w(t,r){if(null===g)throw new Error("Async Arcade must be enabled for this script");if(d("esri-csp-restrictions")||!1===b){return function(e){return g.executeScript(t,e)}}return e(t,r,!0)}function F(e){n(e),t(e,"sync"),null===g?j.push(e):(t(e,"async"),g.extend(e))}function E(e,t=[]){return c(e,t)}function v(e,t,r=""){return u(e,t,r)}function G(e,t,r,n=""){return o(e,t,r,n)}function k(e,t,r=[]){return I(c(e,r),t)}function I(e,t){if(!0===t.useAsync||!0===e.isAsync){if(null===g)throw new Error("Async Arcade must be enabled for this script");return g.executeScript(e,t)}return s(e,t)}function L(e,t){return i(e,t)}function P(e,t){return a(e,t)}function U(e,t=!1){return l(e)}function _(e){return f(e)}function C(e,t=[]){return void 0===e.usesGeometry&&p(e,t),!0===e.usesGeometry}let M=null;function z(){return M||(M=O(),M)}async function O(){const[e,t]=await Promise.all([import("../geometry/geometryEngine.js"),import("../arcade/functions/geomsync.js")]);return A=!0,t.setGeometryEngine(e),!0}let R=null;function T(){return null!==R||(R=q()),R}async function q(){await r(),g=await import("../arcade/arcadeAsyncRuntime.js");for(const e of j)g.extend(e),t(e,"async");return j=null,!0}function D(){return x}function B(){return!!g}function H(){return A}let J=null;function K(){return J||(J=N(),J)}async function N(){await T();const[e,r,n,s,i]=await Promise.all([import("../arcade/featureSetUtils.js"),import("../arcade/functions/featuresetbase.js"),import("../arcade/functions/featuresetgeom.js"),import("../arcade/functions/featuresetstats.js"),import("../arcade/functions/featuresetstring.js")]);return Z=e,g.extend([r,n,s,i]),t([r,n,s,i],"async"),x=!0,!0}function Q(e,t=[]){return void 0===e.usesFeatureSet&&p(e,t),!0===e.usesFeatureSet}function V(e,t=[]){return void 0===e.isAsync&&p(e,t),!0===e.isAsync}function W(e,t){if(t){for(const r of t)if(L(e,r))return!0;return!1}return!1}async function X(e,t,r=[],n=!1){const s="string"==typeof e?E(e):e,i=[];return s&&(!1===H()&&(C(s)||n)&&i.push(z()),!1===B()&&(!0===s.isAsync||t)&&i.push(T()),!1===D()&&(Q(s)||W(s,r))&&i.push(K())),!i.length||(await Promise.all(i),!0)}function Y(e){if(C(e))return!0;const t=m(e);let r=!1;for(let n=0;n<t.length;n++)if(y.includes(t[n])){r=!0;break}return r}let Z=null;function $(){return Z}const ee=Object.freeze(Object.defineProperty({__proto__:null,compileScript:h,extend:F,parseScript:E,validateScript:v,scriptCheck:G,parseAndExecuteScript:k,executeScript:I,referencesMember:L,referencesFunction:P,extractFieldLiterals:U,extractExpectedFieldLiterals:_,scriptUsesGeometryEngine:C,enableGeometrySupport:z,enableGeometrySupportImpl:O,enableAsyncSupport:T,enableAsyncSupportImpl:q,isFeatureSetSupportEnabled:D,isAsyncEnabled:B,isGeometryEnabled:H,enableFeatureSetSupport:K,enableFeatureSetSupportImpl:N,scriptUsesFeatureSet:Q,scriptIsAsync:V,loadScriptDependencies:X,scriptTouchesGeometry:Y,featureSetUtils:$},Symbol.toStringTag,{value:"Module"}));export{V as A,_ as a,z as b,h as c,K as d,I as e,$ as f,C as g,ee as h,F as i,G as j,k,X as l,P as m,U as n,O as o,E as p,T as q,L as r,Y as s,q as t,D as u,v,B as w,H as x,N as y,Q as z};
|