@arcgis/core 4.25.0-next.20221014 → 4.25.0-next.20221015

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/arcade/arcadeRuntime.js +1 -1
  2. package/arcade/functions/featuresetbase.js +1 -1
  3. package/arcade/functions/featuresetgeom.js +1 -1
  4. package/arcade/functions/featuresetstring.js +1 -1
  5. package/arcade/functions/geometry.js +1 -1
  6. package/assets/esri/core/workers/RemoteClient.js +1 -1
  7. package/assets/esri/core/workers/chunks/0439cac609d6109d37b6.js +1 -0
  8. package/assets/esri/core/workers/chunks/27ac78a350d4f24ad7b6.js +1 -0
  9. package/assets/esri/core/workers/chunks/306cf603b4ab2fbd8abd.js +1 -0
  10. package/assets/esri/core/workers/chunks/447eeae56c61a8e3b6e3.js +1 -0
  11. package/assets/esri/core/workers/chunks/{67efbea3621c0345a990.js → 63dbede7309f22ec3561.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{8de412bd25654f85d491.js → cdcb512710f6f33af84e.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{c0142d207900d8b40b46.js → e967ffca641947212992.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{d0e614026500ffbdca90.js → ea771551382731d2dd2b.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{1fc204e30858a1e843cf.js → f3602470674e4cf06ebc.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{dcf395dfcb2844d63513.js → f827083b19b310990ca1.js} +1 -1
  17. package/assets/esri/themes/base/widgets/_Directions.scss +1 -8
  18. package/assets/esri/themes/dark/main.css +1 -1
  19. package/assets/esri/themes/light/main.css +1 -1
  20. package/assets/esri/themes/light/view.css +1 -1
  21. package/geohash/GeohashTree.js +1 -1
  22. package/package.json +1 -1
  23. package/portal/support/portalLayers.js +1 -1
  24. package/rest/query/operations/pbfJSONFeatureSet.js +1 -1
  25. package/support/revision.js +1 -1
  26. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  27. package/symbols/cim/CIMSymbolHelper.js +1 -1
  28. package/symbols/cim/CIMSymbolRasterizer.js +1 -1
  29. package/symbols/support/previewCIMSymbol.js +1 -1
  30. package/views/2d/layers/features/schemaUtils.js +1 -1
  31. package/views/2d/layers/support/clusterUtils.js +1 -1
  32. package/widgets/Attachments.js +1 -1
  33. package/widgets/Directions.js +1 -1
  34. package/widgets/UtilityNetworkTrace.js +1 -1
  35. package/assets/esri/core/workers/chunks/24e5ad342c89f4839039.js +0 -1
  36. package/assets/esri/core/workers/chunks/579469915c99e12c470e.js +0 -1
  37. package/assets/esri/core/workers/chunks/bfa6040ac9ee774c74ba.js +0 -1
  38. package/assets/esri/core/workers/chunks/f0d9d15202ed7474a3a9.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{ArcadeModule as e}from"./ArcadeModule.js";import{ArcadeModuleLoader as t}from"./ArcadeModuleLoader.js";import n from"./Dictionary.js";import{ArcadeExecutionError as r,ExecutionErrorCodes as o,ensureArcadeExecutionError as l}from"./executionError.js";import a from"./Feature.js";import{NativeFunction as i,ArcadeFunction as s,ScopeMarshalledFunction as u,wrapModuleScopedResponse as c}from"./FunctionWrapper.js";import{y as f,a as p,s as d,p as h,o as w,v as m,i as g,c as v,m as y,R as b,x,w as S,b as I,g as F,I as C,j as R,r as A,u as M,q as E}from"../chunks/languageUtils.js";import{addFunctionDeclaration as L}from"./treeAnalysis.js";import{A as N}from"../chunks/array.js";import{registerFunctions as O}from"./functions/date.js";import{registerFunctions as B,geometryMember as j}from"./functions/geometry.js";import{registerFunctions as k}from"./functions/geomsync.js";import{registerFunctions as D}from"./functions/maths.js";import{registerFunctions as K}from"./functions/stats.js";import{registerFunctions as U}from"./functions/string.js";import q from"../geometry/Geometry.js";import G from"../geometry/SpatialReference.js";class P extends s{constructor(e,t){super(),this.definition=null,this.context=null,this.definition=e,this.context=t}createFunction(e){return(...t)=>{const n={spatialReference:this.context.spatialReference,console:this.context.console,lrucache:this.context.lrucache,exports:this.context.exports,libraryResolver:this.context.libraryResolver,interceptor:this.context.interceptor,localScope:{},depthCounter:{depth:e.depthCounter.depth+1},globalScope:this.context.globalScope};if(n.depthCounter.depth>64)throw new r(e,o.MaximumCallDepth,null);return Ie(this.definition,n,t,null)}}call(e,t){return V(e,t,((n,l,a)=>{const i={spatialReference:e.spatialReference,globalScope:e.globalScope,depthCounter:{depth:e.depthCounter.depth+1},libraryResolver:e.libraryResolver,exports:e.exports,console:e.console,lrucache:e.lrucache,interceptor:e.interceptor,localScope:{}};if(i.depthCounter.depth>64)throw new r(e,o.MaximumCallDepth,t);return Ie(this.definition,i,a,t)}))}marshalledCall(e,t,n,r){return r(e,t,((o,l,a)=>{const i={spatialReference:e.spatialReference,globalScope:n.globalScope,depthCounter:{depth:e.depthCounter.depth+1},libraryResolver:e.libraryResolver,exports:e.exports,console:e.console,lrucache:e.lrucache,interceptor:e.interceptor,localScope:{}};return a=a.map((t=>!g(t)||t instanceof u?t:c(t,e,r))),c(Ie(this.definition,i,a,t),n,r)}))}}class T extends e{constructor(e){super(e)}global(e){const t=this.executingContext.globalScope[e.toLowerCase()];if(t.valueset||(t.value=_(this.executingContext,t.node),t.valueset=!0),g(t.value)&&!(t.value instanceof u)){const e=new u;e.fn=t.value,e.parameterEvaluator=V,e.context=this.executingContext,t.value=e}return t.value}setGlobal(e,t){if(g(t))throw new r(null,o.AssignModuleFunction,null);this.executingContext.globalScope[e.toLowerCase()]={value:t,valueset:!0,node:null}}hasGlobal(e){return void 0===this.executingContext.exports[e]&&(e=e.toLowerCase()),void 0!==this.executingContext.exports[e]}loadModule(e){let n=e.spatialReference;null==n&&(n=new G({wkid:102100})),this.moduleScope=Ce({},e.customfunctions),this.executingContext={spatialReference:n,globalScope:this.moduleScope,localScope:null,libraryResolver:new t(e.libraryResolver._moduleSingletons,this.source.syntax.loadedModules),exports:{},console:e.console?e.console:Ae,lrucache:e.lrucache,interceptor:e.interceptor,depthCounter:{depth:1}},_(this.executingContext,this.source.syntax)}}function W(e,t){const n=[];for(let r=0;r<t.arguments.length;r++)n.push(_(e,t.arguments[r]));return n}function V(e,t,n){try{return!0===t.preparsed?n(e,null,t.arguments):n(e,t,W(e,t))}catch(r){throw r}}function _(e,t){try{switch(t?.type){case"EmptyStatement":return m;case"VariableDeclarator":return ue(e,t);case"VariableDeclaration":return se(e,t);case"ImportDeclaration":return ae(e,t);case"ExportNamedDeclaration":return ie(e,t);case"BlockStatement":case"Program":return re(e,t);case"FunctionDeclaration":return le(e,t);case"ReturnStatement":return oe(e,t);case"IfStatement":return ne(e,t);case"ExpressionStatement":return te(e,t);case"AssignmentExpression":return ee(e,t);case"UpdateExpression":return Z(e,t);case"BreakStatement":return w;case"ContinueStatement":return h;case"TemplateElement":return we(e,t);case"TemplateLiteral":return ge(e,t);case"ForStatement":return J(e,t);case"ForInStatement":return H(e,t);case"WhileStatement":return Q(e,t);case"Identifier":return ve(e,t);case"MemberExpression":return ce(e,t);case"Literal":return t.value;case"CallExpression":return ye(e,t);case"UnaryExpression":return fe(e,t);case"BinaryExpression":return de(e,t);case"LogicalExpression":return he(e,t);case"ArrayExpression":return pe(e,t);case"ObjectExpression":return Y(e,t);case"Property":return z(e,t);default:throw new r(e,o.Unrecognised,t)}}catch(n){throw l(e,t,n)}}function Y(e,t){const l={},a=new Map;for(let n=0;n<t.properties.length;n++){const i=_(e,t.properties[n]);if(g(i.value))throw new r(e,o.NoFunctionInDictionary,t);if(!1===v(i.key))throw new r(e,o.KeyMustBeString,t);let s=i.key.toString();const u=s.toLowerCase();a.has(u)?s=a.get(u):a.set(u,s),i.value===m?l[s]=null:l[s]=i.value}const i=new n(l);return i.immutable=!1,i}function z(e,t){return{key:"Identifier"===t.key.type?t.key.name:_(e,t.key),value:_(e,t.value)}}function H(e,t){const l=_(e,t.right);"VariableDeclaration"===t.left.type&&_(e,t.left);let a=null,i="";if("VariableDeclaration"===t.left.type){const e=t.left.declarations[0].id;"Identifier"===e.type&&(i=e.name)}else"Identifier"===t.left.type&&(i=t.left.name);if(!i)throw new r(e,o.InvalidIdentifier,t);if(i=i.toLowerCase(),null!=e.localScope&&void 0!==e.localScope[i]&&(a=e.localScope[i]),null===a&&void 0!==e.globalScope[i]&&(a=e.globalScope[i]),null===a)throw new r(e,o.InvalidIdentifier,t);if(y(l)||v(l)){const n=l.length;for(let r=0;r<n;r++){a.value=r;const n=_(e,t.body);if(n===w)break;if(n instanceof b)return n}return m}if(x(l)){for(let n=0;n<l.length();n++){a.value=n;const r=_(e,t.body);if(r===w)break;if(r instanceof b)return r}return m}if(!(l instanceof n||S(l)))return m;{const n=l.keys();for(let r=0;r<n.length;r++){a.value=n[r];const o=_(e,t.body);if(o===w)break;if(o instanceof b)return o}}}function J(e,t){null!==t.init&&_(e,t.init);const n={testResult:!0,lastAction:m};do{X(e,t,n)}while(!0===n.testResult);return n.lastAction instanceof b?n.lastAction:m}function Q(e,t){const n={testResult:!0,lastAction:m};if(n.testResult=_(e,t.test),!1===n.testResult)return m;if(!0!==n.testResult)throw new r(e,o.BooleanConditionRequired,t);for(;!0===n.testResult&&(n.lastAction=_(e,t.body),n.lastAction!==w)&&!(n.lastAction instanceof b);)if(n.testResult=_(e,t.test),!0!==n.testResult&&!1!==n.testResult)throw new r(e,o.BooleanConditionRequired,t);return n.lastAction instanceof b?n.lastAction:m}function X(e,t,n){if(null!==t.test){if(n.testResult=_(e,t.test),!1===n.testResult)return;if(!0!==n.testResult)throw new r(e,o.BooleanConditionRequired,t)}n.lastAction=_(e,t.body),n.lastAction!==w?n.lastAction instanceof b?n.testResult=!1:null!==t.update&&_(e,t.update):n.testResult=!1}function Z(e,t){let l,a=null,i="";if("MemberExpression"===t.argument.type){if(a=_(e,t.argument.object),!0===t.argument.computed?i=_(e,t.argument.property):"Identifier"===t.argument.property.type&&(i=t.argument.property.name),y(a)){if(!I(i))throw new r(e,o.ArrayAccessorMustBeNumber,t);if(i<0&&(i=a.length+i),i<0||i>=a.length)throw new r(e,o.OutOfBounds,t);l=F(a[i]),a[i]="++"===t.operator?l+1:l-1}else if(a instanceof n){if(!1===v(i))throw new r(e,o.KeyAccessorMustBeString,t);if(!0!==a.hasField(i))throw new r(e,o.FieldNotFound,t);l=F(a.field(i)),a.setField(i,"++"===t.operator?l+1:l-1)}else if(S(a)){if(!1===v(i))throw new r(e,o.KeyAccessorMustBeString,t);if(!0!==a.hasField(i))throw new r(e,o.FieldNotFound,t);l=F(a.field(i)),a.setField(i,"++"===t.operator?l+1:l-1)}else{if(x(a))throw new r(e,o.Immutable,t);if(!(a instanceof T))throw new r(e,o.InvalidParameter,t);if(!1===v(i))throw new r(e,o.ModuleAccessorMustBeString,t);if(!0!==a.hasGlobal(i))throw new r(e,o.ModuleExportNotFound,t);l=F(a.global(i)),a.setGlobal(i,"++"===t.operator?l+1:l-1)}return!1===t.prefix?l:"++"===t.operator?l+1:l-1}if(a="Identifier"===t.argument.type?t.argument.name.toLowerCase():"",!a)throw new r(e,o.InvalidIdentifier,t);if(null!=e.localScope&&void 0!==e.localScope[a])return l=F(e.localScope[a].value),e.localScope[a]={value:"++"===t.operator?l+1:l-1,valueset:!0,node:t},!1===t.prefix?l:"++"===t.operator?l+1:l-1;if(void 0!==e.globalScope[a])return l=F(e.globalScope[a].value),e.globalScope[a]={value:"++"===t.operator?l+1:l-1,valueset:!0,node:t},!1===t.prefix?l:"++"===t.operator?l+1:l-1;throw new r(e,o.InvalidIdentifier,t)}function $(e,t,n,l,a){switch(t){case"=":return e===m?null:e;case"/=":return F(n)/F(e);case"*=":return F(n)*F(e);case"-=":return F(n)-F(e);case"+=":return v(n)||v(e)?R(n)+R(e):F(n)+F(e);case"%=":return F(n)%F(e);default:throw new r(a,o.UnsupportedOperator,l)}}function ee(e,t){const l=_(e,t.right);let a=null,i="";if("MemberExpression"===t.left.type){if(a=_(e,t.left.object),!0===t.left.computed)i=_(e,t.left.property);else{if("Identifier"!==t.left.property.type)throw new r(e,o.InvalidIdentifier,t);i=t.left.property.name}if(y(a)){if(!I(i))throw new r(e,o.ArrayAccessorMustBeNumber,t);if(i<0&&(i=a.length+i),i<0||i>a.length)throw new r(e,o.OutOfBounds,t);if(i===a.length){if("="!==t.operator)throw new r(e,o.OutOfBounds,t);a[i]=$(l,t.operator,a[i],t,e)}else a[i]=$(l,t.operator,a[i],t,e)}else if(a instanceof n){if(!1===v(i))throw new r(e,o.KeyAccessorMustBeString,t);if(!0===a.hasField(i))a.setField(i,$(l,t.operator,a.field(i),t,e));else{if("="!==t.operator)throw new r(e,o.FieldNotFound,t,{key:i});a.setField(i,$(l,t.operator,null,t,e))}}else if(S(a)){if(!1===v(i))throw new r(e,o.KeyAccessorMustBeString,t);if(!0===a.hasField(i))a.setField(i,$(l,t.operator,a.field(i),t,e));else{if("="!==t.operator)throw new r(e,o.FieldNotFound,t,{key:i});a.setField(i,$(l,t.operator,null,t,e))}}else{if(x(a))throw new r(e,o.Immutable,t);if(!(a instanceof T))throw new r(e,o.InvalidIdentifier,t);if(!1===v(i))throw new r(e,o.ModuleAccessorMustBeString,t);if(!0!==a.hasGlobal(i))throw new r(e,o.ModuleExportNotFound,t);a.setGlobal(i,$(l,t.operator,a.global(i),t,e))}return m}if(a=t.left.name.toLowerCase(),null!=e.localScope&&void 0!==e.localScope[a])return e.localScope[a]={value:$(l,t.operator,e.localScope[a].value,t,e),valueset:!0,node:t.right},m;if(void 0!==e.globalScope[a])return e.globalScope[a]={value:$(l,t.operator,e.globalScope[a].value,t,e),valueset:!0,node:t.right},m;throw new r(e,o.InvalidIdentifier,t)}function te(e,t){if("AssignmentExpression"===t.expression.type||"UpdateExpression"===t.expression.type)return _(e,t.expression);if("CallExpression"===t.expression.type){const n=_(e,t.expression);return n===m?m:new C(n)}{const n=_(e,t.expression);return n===m?m:new C(n)}}function ne(e,t){const n=_(e,t.test);if(!0===n)return _(e,t.consequent);if(!1===n)return null!==t.alternate?_(e,t.alternate):m;throw new r(e,o.BooleanConditionRequired,t)}function re(e,t){let n=m;for(let r=0;r<t.body.length;r++)if(n=_(e,t.body[r]),n instanceof b||n===w||n===h)return n;return n}function oe(e,t){if(null===t.argument)return new b(m);const n=_(e,t.argument);return new b(n)}function le(e,t){const n=t.id.name.toLowerCase();return e.globalScope[n]={valueset:!0,node:null,value:new P(t,e)},m}function ae(e,t){const n=t.specifiers[0].local.name.toLowerCase(),r=e.libraryResolver.loadLibrary(n);let o=null;return e.libraryResolver._moduleSingletons?.has(r.uri)?o=e.libraryResolver._moduleSingletons.get(r.uri):(o=new T(r),o.loadModule(e),e.libraryResolver._moduleSingletons?.set(r.uri,o)),e.globalScope[n]={value:o,valueset:!0,node:t},m}function ie(e,t){if(_(e,t.declaration),"FunctionDeclaration"===t.declaration.type)e.exports[t.declaration.id.name.toLowerCase()]="function";else if("VariableDeclaration"===t.declaration.type)for(const n of t.declaration.declarations)e.exports[n.id.name.toLowerCase()]="variable";return m}function se(e,t){for(let n=0;n<t.declarations.length;n++)_(e,t.declarations[n]);return m}function ue(e,t){let n=null===t.init?null:_(e,t.init);if(n===m&&(n=null),"Identifier"!==t.id.type)throw new r(e,o.InvalidIdentifier,t);const l=t.id.name.toLowerCase();return null!=e.localScope?e.localScope[l]={value:n,valueset:!0,node:t.init}:e.globalScope[l]={value:n,valueset:!0,node:t.init},m}function ce(e,t){try{const l=_(e,t.object);if(null===l)throw new r(e,o.MemberOfNull,t);if(!1===t.computed){if("Identifier"===t.property.type){if(l instanceof n||S(l))return l.field(t.property.name);if(l instanceof q)return j(l,t.property.name,t,e);if(l instanceof T){if(!l.hasGlobal(t.property.name))throw new r(e,o.InvalidIdentifier,t);return l.global(t.property.name)}}throw new r(e,o.InvalidMemberAccessKey,t)}{let a=_(e,t.property);if(l instanceof n||S(l)){if(v(a))return l.field(a);throw new r(e,o.InvalidMemberAccessKey,t)}if(l instanceof T){if(v(a))return l.global(a);throw new r(e,o.InvalidMemberAccessKey,t)}if(l instanceof q){if(v(a))return j(l,a,t,e);throw new r(e,o.InvalidMemberAccessKey,t)}if(y(l)){if(I(a)&&isFinite(a)&&Math.floor(a)===a){if(a<0&&(a=l.length+a),a>=l.length||a<0)throw new r(e,o.OutOfBounds,t);return l[a]}throw new r(e,o.InvalidMemberAccessKey,t)}if(v(l)){if(I(a)&&isFinite(a)&&Math.floor(a)===a){if(a<0&&(a=l.length+a),a>=l.length||a<0)throw new r(e,o.OutOfBounds,t);return l[a]}throw new r(e,o.InvalidMemberAccessKey,t)}if(x(l)){if(I(a)&&isFinite(a)&&Math.floor(a)===a){if(a<0&&(a=l.length()+a),a>=l.length()||a<0)throw new r(e,o.OutOfBounds,t);return l.get(a)}throw new r(e,o.InvalidMemberAccessKey,t)}throw new r(e,o.InvalidMemberAccessKey,t)}}catch(l){throw l}}function fe(e,t){try{const n=_(e,t.argument);if(p(n)){if("!"===t.operator)return!n;if("-"===t.operator)return-1*F(n);if("+"===t.operator)return 1*F(n);if("~"===t.operator)return~F(n);throw new r(e,o.UnsupportedUnaryOperator,t)}if("~"===t.operator)return~F(n);if("-"===t.operator)return-1*F(n);if("+"===t.operator)return 1*F(n);throw new r(e,o.UnsupportedUnaryOperator,t)}catch(n){throw n}}function pe(e,t){try{const n=[];for(let l=0;l<t.elements.length;l++){const a=_(e,t.elements[l]);if(g(a))throw new r(e,o.NoFunctionInArray,t);a===m?n.push(null):n.push(a)}return n}catch(n){throw n}}function de(e,t){try{const n=[_(e,t.left),_(e,t.right)],l=n[0],a=n[1];switch(t.operator){case"|":case"<<":case">>":case">>>":case"^":case"&":return M(F(l),F(a),t.operator);case"==":return d(l,a);case"!=":return!d(l,a);case"<":case">":case"<=":case">=":return A(l,a,t.operator);case"+":return v(l)||v(a)?R(l)+R(a):F(l)+F(a);case"-":return F(l)-F(a);case"*":return F(l)*F(a);case"/":return F(l)/F(a);case"%":return F(l)%F(a);default:throw new r(e,o.UnsupportedOperator,t)}}catch(n){throw n}}function he(e,t){try{const n=_(e,t.left);if(p(n))switch(t.operator){case"||":if(!0===n)return n;{const n=_(e,t.right);if(p(n))return n;throw new r(e,o.LogicExpressionOrAnd,t)}case"&&":if(!1===n)return n;{const n=_(e,t.right);if(p(n))return n;throw new r(e,o.LogicExpressionOrAnd,t)}default:throw new r(e,o.LogicExpressionOrAnd,t)}throw new r(e,o.LogicalExpressionOnlyBoolean,t)}catch(n){throw n}}function we(e,t){return t.value?t.value.cooked:""}function me(e,t,n){if(g(e))throw new r(t,o.NoFunctionInTemplateLiteral,n);return e}function ge(e,t){let n="",r=0;for(const o of t.quasis)if(n+=o.value?o.value.cooked:"",!1===o.tail){n+=t.expressions[r]?R(me(_(e,t.expressions[r]),e,t)):"",r++}return n}function ve(e,t){let n;try{const l=t.name.toLowerCase();if(null!=e.localScope&&void 0!==e.localScope[l])return n=e.localScope[l],!0===n.valueset||(n.value=_(e,n.node),n.valueset=!0),n.value;if(void 0!==e.globalScope[l])return n=e.globalScope[l],!0===n.valueset||(n.value=_(e,n.node),n.valueset=!0),n.value;throw new r(e,o.InvalidIdentifier,t)}catch(l){throw l}}function ye(e,t){try{if("MemberExpression"===t.callee.type){const n=_(e,t.callee.object);if(!(n instanceof T))throw new r(e,o.FuncionNotFound,t);const l=!1===t.callee.computed?t.callee.property.name:_(e,t.callee.property);if(!n.hasGlobal(l))throw new r(e,o.FuncionNotFound,t);const a=n.global(l);if(!g(a))throw new r(e,o.CallNonFunction,t);return a.call(e,t)}if("Identifier"!==t.callee.type)throw new r(e,o.FuncionNotFound,t);if(null!=e.localScope&&void 0!==e.localScope[t.callee.name.toLowerCase()]){const n=e.localScope[t.callee.name.toLowerCase()];if(g(n.value))return n.value.call(e,t);throw new r(e,o.CallNonFunction,t)}if(void 0!==e.globalScope[t.callee.name.toLowerCase()]){const n=e.globalScope[t.callee.name.toLowerCase()];if(g(n.value))return n.value.call(e,t);throw new r(e,o.CallNonFunction,t)}throw new r(e,o.FuncionNotFound,t)}catch(n){throw n}}const be={};function xe(e,t,n,r){try{const o=_(e,t.arguments[n]);if(d(o,r))return _(e,t.arguments[n+1]);{const o=t.arguments.length-n;return 1===o?_(e,t.arguments[n]):2===o?null:3===o?_(e,t.arguments[n+2]):xe(e,t,n+2,r)}}catch(o){throw o}}function Se(e,t,n,l){try{if(!0===l)return _(e,t.arguments[n+1]);if(3===t.arguments.length-n)return _(e,t.arguments[n+2]);{const l=_(e,t.arguments[n+2]);if(!1===p(l))throw new r(e,o.BooleanConditionRequired,t.arguments[n+2]);return Se(e,t,n+2,l)}}catch(a){throw a}}function Ie(e,t,n,l){try{const a=e.body;if(n.length!==e.params.length)throw new r(t,o.WrongNumberOfParameters,l);if(null!=t.localScope)for(let r=0;r<n.length;r++)t.localScope[e.params[r].name.toLowerCase()]={value:n[r],valueset:!0,node:null};const i=_(t,a);if(i instanceof b)return i.value;if(i===w)throw new r(t,o.UnexpectedToken,l);if(i===h)throw new r(t,o.UnexpectedToken,l);return i instanceof C?i.value:i}catch(a){throw a}}O(be,V),U(be,V),D(be,V),B(be,V),K(be,V),k(be,V),be.iif=function(e,t){try{f(null===t.arguments?[]:t.arguments,3,3,e,t);const n=_(e,t.arguments[0]);if(!1===p(n))throw new r(e,o.BooleanConditionRequired,t);return _(e,!0===n?t.arguments[1]:t.arguments[2])}catch(n){throw n}},be.decode=function(e,t){try{if(t.arguments.length<2)throw new r(e,o.WrongNumberOfParameters,t);if(2===t.arguments.length)return _(e,t.arguments[1]);{if((t.arguments.length-1)%2==0)throw new r(e,o.WrongNumberOfParameters,t);const n=_(e,t.arguments[0]);return xe(e,t,1,n)}}catch(n){throw n}},be.when=function(e,t){try{if(t.arguments.length<3)throw new r(e,o.WrongNumberOfParameters,t);if(t.arguments.length%2==0)throw new r(e,o.WrongNumberOfParameters,t);const n=_(e,t.arguments[0]);if(!1===p(n))throw new r(e,o.BooleanConditionRequired,t.arguments[0]);return Se(e,t,0,n)}catch(n){throw n}};for(const Le in be)be[Le]={value:new i(be[Le]),valueset:!0,node:null};const Fe=function(){};function Ce(e,t){const r=new Fe;e||(e={}),t||(t={});const o=new n({newline:"\n",tab:"\t",singlequote:"'",doublequote:'"',forwardslash:"/",backwardslash:"\\"});o.immutable=!1,r.textformatting={value:o,valueset:!0,node:null};for(const n in t)r[n]={value:new i(t[n]),native:!0,valueset:!0,node:null};for(const n in e)e[n]&&"esri.Graphic"===e[n].declaredClass?r[n]={value:a.createFromGraphic(e[n]),valueset:!0,node:null}:r[n]={value:e[n],valueset:!0,node:null};return r}Fe.prototype=be,Fe.prototype.infinity={value:Number.POSITIVE_INFINITY,valueset:!0,node:null},Fe.prototype.pi={value:Math.PI,valueset:!0,node:null};const Re={fixSpatialReference:E,parseArguments:W,standardFunction:V};function Ae(e){console.log(e)}function Me(e){const t={mode:"sync",compiled:!1,functions:{},signatures:[],standardFunction:V,evaluateIdentifier:ve};for(let n=0;n<e.length;n++)e[n].registerFunctions(t);for(const n in t.functions)be[n]={value:new i(t.functions[n]),valueset:!0,node:null},Fe.prototype[n]=be[n];for(let n=0;n<t.signatures.length;n++)L(t.signatures[n],"async")}function Ee(e,n){let l=n.spatialReference;null==l&&(l=new G({wkid:102100}));let a=null;e.usesModules&&(a=new t(new Map,e.loadedModules));const i={spatialReference:l,globalScope:Ce(n.vars,n.customfunctions),localScope:null,exports:{},libraryResolver:a,console:n.console?n.console:Ae,lrucache:n.lrucache,interceptor:n.interceptor,depthCounter:{depth:1}};let s=_(i,e);if(s instanceof b&&(s=s.value),s instanceof C&&(s=s.value),s===m&&(s=null),s===w)throw new r(i,o.IllegalResult,null);if(s===h)throw new r(i,o.IllegalResult,null);if(g(s))throw new r(i,o.IllegalResult,null);return s}Me([N]);export{Ee as executeScript,Me as extend,Re as functionHelper};
5
+ import{ArcadeModule as e}from"./ArcadeModule.js";import{ArcadeModuleLoader as t}from"./ArcadeModuleLoader.js";import n from"./Dictionary.js";import{ArcadeExecutionError as r,ExecutionErrorCodes as o,ensureArcadeExecutionError as l}from"./executionError.js";import a from"./Feature.js";import{NativeFunction as i,ArcadeFunction as s,ScopeMarshalledFunction as u,wrapModuleScopedResponse as c}from"./FunctionWrapper.js";import{y as f,a as p,s as d,p as h,o as w,v as m,i as g,c as v,m as y,R as b,x,w as S,b as I,g as F,I as C,j as R,r as A,u as M,q as E}from"../chunks/languageUtils.js";import{addFunctionDeclaration as L}from"./treeAnalysis.js";import{A as N}from"../chunks/array.js";import{registerFunctions as O}from"./functions/date.js";import{registerFunctions as B,geometryMember as j}from"./functions/geometry.js";import{registerFunctions as k}from"./functions/geomsync.js";import{registerFunctions as D}from"./functions/maths.js";import{registerFunctions as K}from"./functions/stats.js";import{registerFunctions as U}from"./functions/string.js";import q from"../geometry/Geometry.js";import G from"../geometry/SpatialReference.js";class P extends s{constructor(e,t){super(),this.definition=null,this.context=null,this.definition=e,this.context=t}createFunction(e){return(...t)=>{const n={spatialReference:this.context.spatialReference,console:this.context.console,lrucache:this.context.lrucache,exports:this.context.exports,libraryResolver:this.context.libraryResolver,interceptor:this.context.interceptor,localScope:{},depthCounter:{depth:e.depthCounter.depth+1},globalScope:this.context.globalScope};if(n.depthCounter.depth>64)throw new r(e,o.MaximumCallDepth,null);return Ie(this.definition,n,t,null)}}call(e,t){return V(e,t,((n,l,a)=>{const i={spatialReference:e.spatialReference,globalScope:e.globalScope,depthCounter:{depth:e.depthCounter.depth+1},libraryResolver:e.libraryResolver,exports:e.exports,console:e.console,lrucache:e.lrucache,interceptor:e.interceptor,localScope:{}};if(i.depthCounter.depth>64)throw new r(e,o.MaximumCallDepth,t);return Ie(this.definition,i,a,t)}))}marshalledCall(e,t,n,r){return r(e,t,((o,l,a)=>{const i={spatialReference:e.spatialReference,globalScope:n.globalScope,depthCounter:{depth:e.depthCounter.depth+1},libraryResolver:e.libraryResolver,exports:e.exports,console:e.console,lrucache:e.lrucache,interceptor:e.interceptor,localScope:{}};return a=a.map((t=>!g(t)||t instanceof u?t:c(t,e,r))),c(Ie(this.definition,i,a,t),n,r)}))}}class T extends e{constructor(e){super(e)}global(e){const t=this.executingContext.globalScope[e.toLowerCase()];if(t.valueset||(t.value=_(this.executingContext,t.node),t.valueset=!0),g(t.value)&&!(t.value instanceof u)){const e=new u;e.fn=t.value,e.parameterEvaluator=V,e.context=this.executingContext,t.value=e}return t.value}setGlobal(e,t){if(g(t))throw new r(null,o.AssignModuleFunction,null);this.executingContext.globalScope[e.toLowerCase()]={value:t,valueset:!0,node:null}}hasGlobal(e){return void 0===this.executingContext.exports[e]&&(e=e.toLowerCase()),void 0!==this.executingContext.exports[e]}loadModule(e){let n=e.spatialReference;null==n&&(n=new G({wkid:102100})),this.moduleScope=Ce({},e.customfunctions),this.executingContext={spatialReference:n,globalScope:this.moduleScope,localScope:null,libraryResolver:new t(e.libraryResolver._moduleSingletons,this.source.syntax.loadedModules),exports:{},console:e.console?e.console:Ae,lrucache:e.lrucache,interceptor:e.interceptor,depthCounter:{depth:1}},_(this.executingContext,this.source.syntax)}}function W(e,t){const n=[];for(let r=0;r<t.arguments.length;r++)n.push(_(e,t.arguments[r]));return n}function V(e,t,n){try{return!0===t.preparsed?n(e,null,t.arguments):n(e,t,W(e,t))}catch(r){throw r}}function _(e,t){try{switch(t?.type){case"EmptyStatement":return m;case"VariableDeclarator":return ue(e,t);case"VariableDeclaration":return se(e,t);case"ImportDeclaration":return ae(e,t);case"ExportNamedDeclaration":return ie(e,t);case"BlockStatement":case"Program":return re(e,t);case"FunctionDeclaration":return le(e,t);case"ReturnStatement":return oe(e,t);case"IfStatement":return ne(e,t);case"ExpressionStatement":return te(e,t);case"AssignmentExpression":return ee(e,t);case"UpdateExpression":return Z(e,t);case"BreakStatement":return w;case"ContinueStatement":return h;case"TemplateElement":return we(e,t);case"TemplateLiteral":return ge(e,t);case"ForStatement":return J(e,t);case"ForInStatement":return H(e,t);case"WhileStatement":return Q(e,t);case"Identifier":return ve(e,t);case"MemberExpression":return ce(e,t);case"Literal":return t.value;case"CallExpression":return ye(e,t);case"UnaryExpression":return fe(e,t);case"BinaryExpression":return de(e,t);case"LogicalExpression":return he(e,t);case"ArrayExpression":return pe(e,t);case"ObjectExpression":return Y(e,t);case"Property":return z(e,t);default:throw new r(e,o.Unrecognised,t)}}catch(n){throw l(e,t,n)}}function Y(e,t){const l={},a=new Map;for(let n=0;n<t.properties.length;n++){const i=_(e,t.properties[n]);if(g(i.value))throw new r(e,o.NoFunctionInDictionary,t);if(!1===v(i.key))throw new r(e,o.KeyMustBeString,t);let s=i.key.toString();const u=s.toLowerCase();a.has(u)?s=a.get(u):a.set(u,s),i.value===m?l[s]=null:l[s]=i.value}const i=new n(l);return i.immutable=!1,i}function z(e,t){return{key:"Identifier"===t.key.type?t.key.name:_(e,t.key),value:_(e,t.value)}}function H(e,t){const l=_(e,t.right);"VariableDeclaration"===t.left.type&&_(e,t.left);let a=null,i="";if("VariableDeclaration"===t.left.type){const e=t.left.declarations[0].id;"Identifier"===e.type&&(i=e.name)}else"Identifier"===t.left.type&&(i=t.left.name);if(!i)throw new r(e,o.InvalidIdentifier,t);if(i=i.toLowerCase(),null!=e.localScope&&void 0!==e.localScope[i]&&(a=e.localScope[i]),null===a&&void 0!==e.globalScope[i]&&(a=e.globalScope[i]),null===a)throw new r(e,o.InvalidIdentifier,t);if(y(l)||v(l)){const n=l.length;for(let r=0;r<n;r++){a.value=r;const n=_(e,t.body);if(n===w)break;if(n instanceof b)return n}return m}if(x(l)){for(let n=0;n<l.length();n++){a.value=n;const r=_(e,t.body);if(r===w)break;if(r instanceof b)return r}return m}if(!(l instanceof n||S(l)))return m;{const n=l.keys();for(let r=0;r<n.length;r++){a.value=n[r];const o=_(e,t.body);if(o===w)break;if(o instanceof b)return o}}}function J(e,t){null!==t.init&&_(e,t.init);const n={testResult:!0,lastAction:m};do{X(e,t,n)}while(!0===n.testResult);return n.lastAction instanceof b?n.lastAction:m}function Q(e,t){const n={testResult:!0,lastAction:m};if(n.testResult=_(e,t.test),!1===n.testResult)return m;if(!0!==n.testResult)throw new r(e,o.BooleanConditionRequired,t);for(;!0===n.testResult&&(n.lastAction=_(e,t.body),n.lastAction!==w)&&!(n.lastAction instanceof b);)if(n.testResult=_(e,t.test),!0!==n.testResult&&!1!==n.testResult)throw new r(e,o.BooleanConditionRequired,t);return n.lastAction instanceof b?n.lastAction:m}function X(e,t,n){if(null!==t.test){if(n.testResult=_(e,t.test),!1===n.testResult)return;if(!0!==n.testResult)throw new r(e,o.BooleanConditionRequired,t)}n.lastAction=_(e,t.body),n.lastAction!==w?n.lastAction instanceof b?n.testResult=!1:null!==t.update&&_(e,t.update):n.testResult=!1}function Z(e,t){let l,a=null,i="";if("MemberExpression"===t.argument.type){if(a=_(e,t.argument.object),!0===t.argument.computed?i=_(e,t.argument.property):"Identifier"===t.argument.property.type&&(i=t.argument.property.name),y(a)){if(!I(i))throw new r(e,o.ArrayAccessorMustBeNumber,t);if(i<0&&(i=a.length+i),i<0||i>=a.length)throw new r(e,o.OutOfBounds,t);l=F(a[i]),a[i]="++"===t.operator?l+1:l-1}else if(a instanceof n){if(!1===v(i))throw new r(e,o.KeyAccessorMustBeString,t);if(!0!==a.hasField(i))throw new r(e,o.FieldNotFound,t);l=F(a.field(i)),a.setField(i,"++"===t.operator?l+1:l-1)}else if(S(a)){if(!1===v(i))throw new r(e,o.KeyAccessorMustBeString,t);if(!0!==a.hasField(i))throw new r(e,o.FieldNotFound,t);l=F(a.field(i)),a.setField(i,"++"===t.operator?l+1:l-1)}else{if(x(a))throw new r(e,o.Immutable,t);if(!(a instanceof T))throw new r(e,o.InvalidParameter,t);if(!1===v(i))throw new r(e,o.ModuleAccessorMustBeString,t);if(!0!==a.hasGlobal(i))throw new r(e,o.ModuleExportNotFound,t);l=F(a.global(i)),a.setGlobal(i,"++"===t.operator?l+1:l-1)}return!1===t.prefix?l:"++"===t.operator?l+1:l-1}if(a="Identifier"===t.argument.type?t.argument.name.toLowerCase():"",!a)throw new r(e,o.InvalidIdentifier,t);if(null!=e.localScope&&void 0!==e.localScope[a])return l=F(e.localScope[a].value),e.localScope[a]={value:"++"===t.operator?l+1:l-1,valueset:!0,node:t},!1===t.prefix?l:"++"===t.operator?l+1:l-1;if(void 0!==e.globalScope[a])return l=F(e.globalScope[a].value),e.globalScope[a]={value:"++"===t.operator?l+1:l-1,valueset:!0,node:t},!1===t.prefix?l:"++"===t.operator?l+1:l-1;throw new r(e,o.InvalidIdentifier,t)}function $(e,t,n,l,a){switch(t){case"=":return e===m?null:e;case"/=":return F(n)/F(e);case"*=":return F(n)*F(e);case"-=":return F(n)-F(e);case"+=":return v(n)||v(e)?R(n)+R(e):F(n)+F(e);case"%=":return F(n)%F(e);default:throw new r(a,o.UnsupportedOperator,l)}}function ee(e,t){const l=_(e,t.right);let a=null,i="";if("MemberExpression"===t.left.type){if(a=_(e,t.left.object),!0===t.left.computed)i=_(e,t.left.property);else{if("Identifier"!==t.left.property.type)throw new r(e,o.InvalidIdentifier,t);i=t.left.property.name}if(y(a)){if(!I(i))throw new r(e,o.ArrayAccessorMustBeNumber,t);if(i<0&&(i=a.length+i),i<0||i>a.length)throw new r(e,o.OutOfBounds,t);if(i===a.length){if("="!==t.operator)throw new r(e,o.OutOfBounds,t);a[i]=$(l,t.operator,a[i],t,e)}else a[i]=$(l,t.operator,a[i],t,e)}else if(a instanceof n){if(!1===v(i))throw new r(e,o.KeyAccessorMustBeString,t);if(!0===a.hasField(i))a.setField(i,$(l,t.operator,a.field(i),t,e));else{if("="!==t.operator)throw new r(e,o.FieldNotFound,t,{key:i});a.setField(i,$(l,t.operator,null,t,e))}}else if(S(a)){if(!1===v(i))throw new r(e,o.KeyAccessorMustBeString,t);if(!0===a.hasField(i))a.setField(i,$(l,t.operator,a.field(i),t,e));else{if("="!==t.operator)throw new r(e,o.FieldNotFound,t,{key:i});a.setField(i,$(l,t.operator,null,t,e))}}else{if(x(a))throw new r(e,o.Immutable,t);if(!(a instanceof T))throw new r(e,o.InvalidIdentifier,t);if(!1===v(i))throw new r(e,o.ModuleAccessorMustBeString,t);if(!0!==a.hasGlobal(i))throw new r(e,o.ModuleExportNotFound,t);a.setGlobal(i,$(l,t.operator,a.global(i),t,e))}return m}if(a=t.left.name.toLowerCase(),null!=e.localScope&&void 0!==e.localScope[a])return e.localScope[a]={value:$(l,t.operator,e.localScope[a].value,t,e),valueset:!0,node:t.right},m;if(void 0!==e.globalScope[a])return e.globalScope[a]={value:$(l,t.operator,e.globalScope[a].value,t,e),valueset:!0,node:t.right},m;throw new r(e,o.InvalidIdentifier,t)}function te(e,t){if("AssignmentExpression"===t.expression.type||"UpdateExpression"===t.expression.type)return _(e,t.expression);if("CallExpression"===t.expression.type){const n=_(e,t.expression);return n===m?m:new C(n)}{const n=_(e,t.expression);return n===m?m:new C(n)}}function ne(e,t){const n=_(e,t.test);if(!0===n)return _(e,t.consequent);if(!1===n)return null!==t.alternate?_(e,t.alternate):m;throw new r(e,o.BooleanConditionRequired,t)}function re(e,t){let n=m;for(let r=0;r<t.body.length;r++)if(n=_(e,t.body[r]),n instanceof b||n===w||n===h)return n;return n}function oe(e,t){if(null===t.argument)return new b(m);const n=_(e,t.argument);return new b(n)}function le(e,t){const n=t.id.name.toLowerCase();return e.globalScope[n]={valueset:!0,node:null,value:new P(t,e)},m}function ae(e,t){const n=t.specifiers[0].local.name.toLowerCase(),r=e.libraryResolver.loadLibrary(n);let o=null;return e.libraryResolver._moduleSingletons?.has(r.uri)?o=e.libraryResolver._moduleSingletons.get(r.uri):(o=new T(r),o.loadModule(e),e.libraryResolver._moduleSingletons?.set(r.uri,o)),e.globalScope[n]={value:o,valueset:!0,node:t},m}function ie(e,t){if(_(e,t.declaration),"FunctionDeclaration"===t.declaration.type)e.exports[t.declaration.id.name.toLowerCase()]="function";else if("VariableDeclaration"===t.declaration.type)for(const n of t.declaration.declarations)e.exports[n.id.name.toLowerCase()]="variable";return m}function se(e,t){for(let n=0;n<t.declarations.length;n++)_(e,t.declarations[n]);return m}function ue(e,t){let n=null===t.init?null:_(e,t.init);if(n===m&&(n=null),"Identifier"!==t.id.type)throw new r(e,o.InvalidIdentifier,t);const l=t.id.name.toLowerCase();return null!=e.localScope?e.localScope[l]={value:n,valueset:!0,node:t.init}:e.globalScope[l]={value:n,valueset:!0,node:t.init},m}function ce(e,t){try{const l=_(e,t.object);if(null===l)throw new r(e,o.MemberOfNull,t);if(!1===t.computed){if("Identifier"===t.property.type){if(l instanceof n||S(l))return l.field(t.property.name);if(l instanceof q)return j(l,t.property.name,t,e);if(l instanceof T){if(!l.hasGlobal(t.property.name))throw new r(e,o.InvalidIdentifier,t);return l.global(t.property.name)}}throw new r(e,o.InvalidMemberAccessKey,t)}{let a=_(e,t.property);if(l instanceof n||S(l)){if(v(a))return l.field(a);throw new r(e,o.InvalidMemberAccessKey,t)}if(l instanceof T){if(v(a))return l.global(a);throw new r(e,o.InvalidMemberAccessKey,t)}if(l instanceof q){if(v(a))return j(l,a,t,e);throw new r(e,o.InvalidMemberAccessKey,t)}if(y(l)){if(I(a)&&isFinite(a)&&Math.floor(a)===a){if(a<0&&(a=l.length+a),a>=l.length||a<0)throw new r(e,o.OutOfBounds,t);return l[a]}throw new r(e,o.InvalidMemberAccessKey,t)}if(v(l)){if(I(a)&&isFinite(a)&&Math.floor(a)===a){if(a<0&&(a=l.length+a),a>=l.length||a<0)throw new r(e,o.OutOfBounds,t);return l[a]}throw new r(e,o.InvalidMemberAccessKey,t)}if(x(l)){if(I(a)&&isFinite(a)&&Math.floor(a)===a){if(a<0&&(a=l.length()+a),a>=l.length()||a<0)throw new r(e,o.OutOfBounds,t);return l.get(a)}throw new r(e,o.InvalidMemberAccessKey,t)}throw new r(e,o.InvalidMemberAccessKey,t)}}catch(l){throw l}}function fe(e,t){try{const n=_(e,t.argument);if(p(n)){if("!"===t.operator)return!n;if("-"===t.operator)return-1*F(n);if("+"===t.operator)return 1*F(n);if("~"===t.operator)return~F(n);throw new r(e,o.UnsupportedUnaryOperator,t)}if("~"===t.operator)return~F(n);if("-"===t.operator)return-1*F(n);if("+"===t.operator)return 1*F(n);throw new r(e,o.UnsupportedUnaryOperator,t)}catch(n){throw n}}function pe(e,t){try{const n=[];for(let l=0;l<t.elements.length;l++){const a=_(e,t.elements[l]);if(g(a))throw new r(e,o.NoFunctionInArray,t);a===m?n.push(null):n.push(a)}return n}catch(n){throw n}}function de(e,t){try{const n=[_(e,t.left),_(e,t.right)],l=n[0],a=n[1];switch(t.operator){case"|":case"<<":case">>":case">>>":case"^":case"&":return M(F(l),F(a),t.operator);case"==":return d(l,a);case"!=":return!d(l,a);case"<":case">":case"<=":case">=":return A(l,a,t.operator);case"+":return v(l)||v(a)?R(l)+R(a):F(l)+F(a);case"-":return F(l)-F(a);case"*":return F(l)*F(a);case"/":return F(l)/F(a);case"%":return F(l)%F(a);default:throw new r(e,o.UnsupportedOperator,t)}}catch(n){throw n}}function he(e,t){try{const n=_(e,t.left);if(p(n))switch(t.operator){case"||":if(!0===n)return n;{const n=_(e,t.right);if(p(n))return n;throw new r(e,o.LogicExpressionOrAnd,t)}case"&&":if(!1===n)return n;{const n=_(e,t.right);if(p(n))return n;throw new r(e,o.LogicExpressionOrAnd,t)}default:throw new r(e,o.LogicExpressionOrAnd,t)}throw new r(e,o.LogicalExpressionOnlyBoolean,t)}catch(n){throw n}}function we(e,t){return t.value?t.value.cooked:""}function me(e,t,n){if(g(e))throw new r(t,o.NoFunctionInTemplateLiteral,n);return e}function ge(e,t){let n="",r=0;for(const o of t.quasis)if(n+=o.value?o.value.cooked:"",!1===o.tail){n+=t.expressions[r]?R(me(_(e,t.expressions[r]),e,t)):"",r++}return n}function ve(e,t){let n;try{const l=t.name.toLowerCase();if(null!=e.localScope&&void 0!==e.localScope[l])return n=e.localScope[l],!0===n.valueset||(n.value=_(e,n.node),n.valueset=!0),n.value;if(void 0!==e.globalScope[l])return n=e.globalScope[l],!0===n.valueset||(n.value=_(e,n.node),n.valueset=!0),n.value;throw new r(e,o.InvalidIdentifier,t)}catch(l){throw l}}function ye(e,t){try{if("MemberExpression"===t.callee.type){const n=_(e,t.callee.object);if(!(n instanceof T))throw new r(e,o.FuncionNotFound,t);const l=!1===t.callee.computed?t.callee.property.name:_(e,t.callee.property);if(!n.hasGlobal(l))throw new r(e,o.FuncionNotFound,t);const a=n.global(l);if(!g(a))throw new r(e,o.CallNonFunction,t);return a.call(e,t)}if("Identifier"!==t.callee.type)throw new r(e,o.FuncionNotFound,t);if(null!=e.localScope&&void 0!==e.localScope[t.callee.name.toLowerCase()]){const n=e.localScope[t.callee.name.toLowerCase()];if(g(n.value))return n.value.call(e,t);throw new r(e,o.CallNonFunction,t)}if(void 0!==e.globalScope[t.callee.name.toLowerCase()]){const n=e.globalScope[t.callee.name.toLowerCase()];if(g(n.value))return n.value.call(e,t);throw new r(e,o.CallNonFunction,t)}throw new r(e,o.FuncionNotFound,t)}catch(n){throw n}}const be={};function xe(e,t,n,r){try{const o=_(e,t.arguments[n]);if(d(o,r))return _(e,t.arguments[n+1]);{const o=t.arguments.length-n;return 1===o?_(e,t.arguments[n]):2===o?null:3===o?_(e,t.arguments[n+2]):xe(e,t,n+2,r)}}catch(o){throw o}}function Se(e,t,n,l){try{if(!0===l)return _(e,t.arguments[n+1]);if(3===t.arguments.length-n)return _(e,t.arguments[n+2]);{const l=_(e,t.arguments[n+2]);if(!1===p(l))throw new r(e,o.BooleanConditionRequired,t.arguments[n+2]);return Se(e,t,n+2,l)}}catch(a){throw a}}function Ie(e,t,n,l){try{const a=e.body;if(n.length!==e.params.length)throw new r(t,o.WrongNumberOfParameters,l);if(null!=t.localScope)for(let r=0;r<n.length;r++)t.localScope[e.params[r].name.toLowerCase()]={value:n[r],valueset:!0,node:null};const i=_(t,a);if(i instanceof b)return i.value;if(i===w)throw new r(t,o.UnexpectedToken,l);if(i===h)throw new r(t,o.UnexpectedToken,l);return i instanceof C?i.value:i}catch(a){throw a}}O(be,V),U(be,V),D(be,V),B(be,V),K(be,V),k(be,V),be.iif=function(e,t){try{f(null===t.arguments?[]:t.arguments,3,3,e,t);const n=_(e,t.arguments[0]);if(!1===p(n))throw new r(e,o.BooleanConditionRequired,t);return _(e,!0===n?t.arguments[1]:t.arguments[2])}catch(n){throw n}},be.decode=function(e,t){try{if(t.arguments.length<2)throw new r(e,o.WrongNumberOfParameters,t);if(2===t.arguments.length)return _(e,t.arguments[1]);{if((t.arguments.length-1)%2==0)throw new r(e,o.WrongNumberOfParameters,t);const n=_(e,t.arguments[0]);return xe(e,t,1,n)}}catch(n){throw n}},be.when=function(e,t){try{if(t.arguments.length<3)throw new r(e,o.WrongNumberOfParameters,t);if(t.arguments.length%2==0)throw new r(e,o.WrongNumberOfParameters,t);const n=_(e,t.arguments[0]);if(!1===p(n))throw new r(e,o.BooleanConditionRequired,t.arguments[0]);return Se(e,t,0,n)}catch(n){throw n}};for(const Le in be)be[Le]={value:new i(be[Le]),valueset:!0,node:null};const Fe=function(){};function Ce(e,t){const r=new Fe;e||(e={}),t||(t={});const o=new n({newline:"\n",tab:"\t",singlequote:"'",doublequote:'"',forwardslash:"/",backwardslash:"\\"});o.immutable=!1,r.textformatting={value:o,valueset:!0,node:null};for(const n in t)r[n]={value:new i(t[n]),native:!0,valueset:!0,node:null};for(const n in e)e[n]&&"esri.Graphic"===e[n].declaredClass?r[n]={value:a.createFromGraphic(e[n]),valueset:!0,node:null}:r[n]={value:e[n],valueset:!0,node:null};return r}Fe.prototype=be,Fe.prototype.infinity={value:Number.POSITIVE_INFINITY,valueset:!0,node:null},Fe.prototype.pi={value:Math.PI,valueset:!0,node:null};const Re={fixSpatialReference:E,parseArguments:W,standardFunction:V};function Ae(e){console.log(e)}function Me(e){const t={mode:"sync",compiled:!1,functions:{},signatures:[],standardFunction:V,evaluateIdentifier:ve};for(let n=0;n<e.length;n++)e[n].registerFunctions(t);for(const n in t.functions)be[n]={value:new i(t.functions[n]),valueset:!0,node:null},Fe.prototype[n]=be[n];for(let n=0;n<t.signatures.length;n++)L(t.signatures[n],"sync")}function Ee(e,n){let l=n.spatialReference;null==l&&(l=new G({wkid:102100}));let a=null;e.usesModules&&(a=new t(new Map,e.loadedModules));const i={spatialReference:l,globalScope:Ce(n.vars,n.customfunctions),localScope:null,exports:{},libraryResolver:a,console:n.console?n.console:Ae,lrucache:n.lrucache,interceptor:n.interceptor,depthCounter:{depth:1}};let s=_(i,e);if(s instanceof b&&(s=s.value),s instanceof C&&(s=s.value),s===m&&(s=null),s===w)throw new r(i,o.IllegalResult,null);if(s===h)throw new r(i,o.IllegalResult,null);if(g(s))throw new r(i,o.IllegalResult,null);return s}Me([N]);export{Ee as executeScript,Me as extend,Re as functionHelper};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import e from"../ArcadePortal.js";import t from"../Dictionary.js";import{ArcadeExecutionError as n,ExecutionErrorCodes as i}from"../executionError.js";import a from"../Feature.js";import r from"../featureSetCollection.js";import{getPortal as s,lookupUser as o,convertToFeatureSet as l,constructFeatureSetFromPortalItem as f,constructFeatureSet as c,constructFeatureSetFromRelationship as u,constructFeatureSetFromUrl as d,constructAssociationMetaDataFeatureSetFromUrl as m}from"../featureSetUtils.js";import p from"../ImmutableArray.js";import{y,A as g,j as w,T as h,h as I,m as F,w as E,c as D,x as b,i as A,g as N,X as x,L as S}from"../../chunks/languageUtils.js";import{SqlExpressionAdapted as v,StringToCodeAdapted as $,FieldRename as L,AdaptedFeatureSet as T,OriginalField as j}from"../featureset/actions/Adapted.js";import P from"../featureset/actions/AttributeFilter.js";import R from"../featureset/actions/OrderBy.js";import O from"../featureset/actions/Top.js";import C from"../featureset/sources/Empty.js";import M from"../featureset/sources/FeatureLayerMemory.js";import k from"../featureset/support/OrderbyClause.js";import{cloneField as H}from"../featureset/support/shared.js";import{isSingleField as z}from"../featureset/support/sqlUtils.js";import{calculateStat as G}from"./fieldStats.js";import{isPromiseLike as U}from"../../core/promiseUtils.js";import{WhereClause as W}from"../../core/sql/WhereClause.js";import _ from"../../layers/FeatureLayer.js";import B from"../../layers/support/Field.js";function J(e,t,n,i){if(1===i.length){if(F(i[0]))return G(e,i[0],-1);if(b(i[0]))return G(e,i[0].toArray(),-1)}return G(e,i,-1)}async function V(e,t,n){const i=e.getVariables();if(i.length>0){const a=[];for(let e=0;e<i.length;e++){const r={name:i[e]};a.push(await t.evaluateIdentifier(n,r))}const r={};for(let e=0;e<i.length;e++)r[i[e]]=a[e];return e.parameters=r,e}return e}function q(e,t,n=null){for(const i in e)if(i.toLowerCase()===t.toLowerCase())return e[i];return n}function K(e){if(null===e)return null;const t={type:q(e,"type",""),name:q(e,"name","")};if("range"===t.type)t.range=q(e,"range",[]);else{t.codedValues=[];for(const n of q(e,"codedValues",[]))t.codedValues.push({name:q(n,"name",""),code:q(n,"code",null)})}return t}function X(e){if(null===e)return null;const t={},n=q(e,"wkt",null);null!==n&&(t.wkt=n);const i=q(e,"wkid",null);return null!==i&&(t.wkid=i),t}function Y(e){if(null===e)return null;const t={hasZ:q(e,"hasz",!1),hasM:q(e,"hasm",!1)},n=q(e,"spatialreference",null);n&&(t.spatialReference=X(n));const i=q(e,"x",null);if(null!==i)return t.x=i,t.y=q(e,"y",null),t;const a=q(e,"rings",null);if(null!==a)return t.rings=a,t;const r=q(e,"paths",null);if(null!==r)return t.paths=r,t;const s=q(e,"points",null);if(null!==s)return t.points=s,t;for(const o of["xmin","xmax","ymin","ymax","zmin","zmax","mmin","mmax"]){const n=q(e,o,null);null!==n&&(t[o]=n)}return t}function Z(e,t){for(const n of t)if(n===e)return!0;return!1}function Q(e){return!!e.layerDefinition&&(!!e.featureSet&&(!1!==Z(e.layerDefinition.geometryType,["","esriGeometryPoint","esriGeometryPolyline","esriGeometryPolygon","esriGeometryMultipoint","esriGeometryEnvelope"])&&(null!==e.layerDefinition.objectIdField&&""!==e.layerDefinition.objectIdField&&(!1!==F(e.layerDefinition.fields)&&!1!==F(e.featureSet.features)))))}function ee(G){"async"===G.mode&&(G.functions.getuser=function(a,r){return G.standardFunctionAsync(a,r,(async(l,f,c)=>{y(c,0,2,a,r);let u=g(c[1],""),d=!0===u;if(u=!0===u||!1===u?"":w(u),0===c.length||c[0]instanceof e){let e=null;a.services&&a.services.portal&&(e=a.services.portal),c.length>0&&(e=s(c[0],e));const n=await o(e,u,d);if(n){const e=JSON.parse(JSON.stringify(n));for(const t of["lastLogin","created","modified"])void 0!==e[t]&&null!==e[t]&&(e[t]=new Date(e[t]));return t.convertObjectToArcadeDictionary(e)}return null}let m=null;if(h(c[0])&&(m=c[0]),m){if(d=!1,u)return null;await m.load();const n=await m.getOwningSystemUrl();if(!n){if(!u){const e=await m.getIdentityUser();return e?t.convertObjectToArcadeDictionary({username:e}):null}return null}let i=null;a.services&&a.services.portal&&(i=a.services.portal),i=s(new e(n),i);const r=await o(i,u,d);if(r){const e=JSON.parse(JSON.stringify(r));for(const t of["lastLogin","created","modified"])void 0!==e[t]&&null!==e[t]&&(e[t]=new Date(e[t]));return t.convertObjectToArcadeDictionary(e)}return null}throw new n(a,i.InvalidParameter,r)}))},G.signatures.push({name:"getuser",min:"1",max:"2"}),G.functions.featuresetbyid=function(e,t){return G.standardFunctionAsync(e,t,((a,s,o)=>{if(y(o,2,4,e,t),o[0]instanceof r){const a=w(o[1]);let r=g(o[2],null);const s=I(g(o[3],!0));if(null===r&&(r=["*"]),!1===F(r))throw new n(e,i.InvalidParameter,t);return o[0].featureSetById(a,s,r)}throw new n(e,i.InvalidParameter,t)}))},G.signatures.push({name:"featuresetbyid",min:"2",max:"4"}),G.functions.getfeatureset=function(e,t){return G.standardFunctionAsync(e,t,((a,r,s)=>{if(y(s,1,2,e,t),E(s[0])){let t=g(s[1],"datasource");return null===t&&(t="datasource"),t=w(t).toLowerCase(),l(s[0].fullSchema(),t,e.lrucache,e.interceptor,e.spatialReference)}throw new n(e,i.InvalidParameter,t)}))},G.signatures.push({name:"getfeatureset",min:"1",max:"2"}),G.functions.featuresetbyportalitem=function(t,a){return G.standardFunctionAsync(t,a,((r,o,l)=>{if(y(l,2,5,t,a),null===l[0])throw new n(t,i.PortalRequired,a);if(l[0]instanceof e){const e=w(l[1]),r=w(l[2]);let o=g(l[3],null);const c=I(g(l[4],!0));if(null===o&&(o=["*"]),!1===F(o))throw new n(t,i.InvalidParameter,a);let u=null;return t.services&&t.services.portal&&(u=t.services.portal),u=s(l[0],u),f(e,r,t.spatialReference,o,c,u,t.lrucache,t.interceptor)}if(!1===D(l[0]))throw new n(t,i.PortalRequired,a);const c=w(l[0]),u=w(l[1]);let d=g(l[2],null);const m=I(g(l[3],!0));if(null===d&&(d=["*"]),!1===F(d))throw new n(t,i.InvalidParameter,a);if(t.services&&t.services.portal)return f(c,u,t.spatialReference,d,m,t.services.portal,t.lrucache,t.interceptor);throw new n(t,i.PortalRequired,a)}))},G.signatures.push({name:"featuresetbyportalitem",min:"2",max:"5"}),G.functions.featuresetbyname=function(e,t){return G.standardFunctionAsync(e,t,((a,s,o)=>{if(y(o,2,4,e,t),o[0]instanceof r){const a=w(o[1]);let r=g(o[2],null);const s=I(g(o[3],!0));if(null===r&&(r=["*"]),!1===F(r))throw new n(e,i.InvalidParameter,t);return o[0].featureSetByName(a,s,r)}throw new n(e,i.InvalidParameter,t)}))},G.signatures.push({name:"featuresetbyname",min:"2",max:"4"}),G.functions.featureset=function(e,a){return G.standardFunction(e,a,((r,s,o)=>{y(o,1,1,e,a);let l=o[0];const f={layerDefinition:{geometryType:"",objectIdField:"",globalIdField:"",typeIdField:"",fields:[]},featureSet:{geometryType:"",features:[]}};if(D(l))l=JSON.parse(l),void 0!==l.layerDefinition?(f.layerDefinition=l.layerDefinition,f.featureSet=l.featureSet,l.layerDefinition.spatialReference&&(f.layerDefinition.spatialReference=l.layerDefinition.spatialReference)):(f.featureSet.features=l.features,f.featureSet.geometryType=l.geometryType,f.layerDefinition.geometryType=f.featureSet.geometryType,f.layerDefinition.objectIdField=l.objectIdFieldName,f.layerDefinition.typeIdField=l.typeIdFieldName,f.layerDefinition.globalIdField=l.globalIdFieldName,f.layerDefinition.fields=l.fields,l.spatialReference&&(f.layerDefinition.spatialReference=l.spatialReference));else{if(!(o[0]instanceof t))throw new n(e,i.InvalidParameter,a);{l=JSON.parse(o[0].castToText(!0));const e=q(l,"layerdefinition");if(null!==e){f.layerDefinition.geometryType=q(e,"geometrytype",""),f.featureSet.geometryType=f.layerDefinition.geometryType,f.layerDefinition.globalIdField=q(e,"globalidfield",""),f.layerDefinition.objectIdField=q(e,"objectidfield",""),f.layerDefinition.typeIdField=q(e,"typeidfield","");const t=q(e,"spatialreference",null);t&&(f.layerDefinition.spatialReference=X(t));for(const i of q(e,"fields",[])){const e={name:q(i,"name",""),alias:q(i,"alias",""),type:q(i,"type",""),nullable:q(i,"nullable",!0),editable:q(i,"editable",!0),length:q(i,"length",null),domain:K(q(i,"domain"))};f.layerDefinition.fields.push(e)}const n=q(l,"featureset",null);if(n){const e={};for(const t of f.layerDefinition.fields)e[t.name.toLowerCase()]=t.name;for(const t of q(n,"features",[])){const n={},i=q(t,"attributes",{});for(const t in i)n[e[t.toLowerCase()]]=i[t];f.featureSet.features.push({attributes:n,geometry:Y(q(t,"geometry",null))})}}}else{f.layerDefinition.geometryType=q(l,"geometrytype",""),f.featureSet.geometryType=f.layerDefinition.geometryType,f.layerDefinition.objectIdField=q(l,"objectidfieldname",""),f.layerDefinition.typeIdField=q(l,"typeidfieldname","");const e=q(l,"spatialreference",null);e&&(f.layerDefinition.spatialReference=X(e));for(const n of q(l,"fields",[])){const e={name:q(n,"name",""),alias:q(n,"alias",""),type:q(n,"type",""),nullable:q(n,"nullable",!0),editable:q(n,"editable",!0),length:q(n,"length",null),domain:K(q(n,"domain"))};f.layerDefinition.fields.push(e)}const t={};for(const n of f.layerDefinition.fields)t[n.name.toLowerCase()]=n.name;for(const n of q(l,"features",[])){const e={},i=q(n,"attributes",{});for(const n in i)e[t[n.toLowerCase()]]=i[n];f.featureSet.features.push({attributes:e,geometry:Y(q(n,"geometry",null))})}}}}if(!1===Q(f))throw new n(e,i.InvalidParameter,a);return M.create(f,e.spatialReference)}))},G.signatures.push({name:"featureset",min:"1",max:"1"}),G.functions.filter=function(e,t){return G.standardFunctionAsync(e,t,(async(a,r,s)=>{if(y(s,2,2,e,t),F(s[0])||b(s[0])){const a=[];let r=s[0];r instanceof p&&(r=r.toArray());let o=null;if(!A(s[1]))throw new n(e,i.InvalidParameter,t);o=s[1].createFunction(e);for(const e of r){const t=o(e);U(t)?!0===await t&&a.push(e):!0===t&&a.push(e)}return a}if(h(s[0])){const t=await s[0].load(),n=W.create(s[1],t.getFieldsIndex()),i=n.getVariables();if(i.length>0){const t=[];for(let n=0;n<i.length;n++){const a={name:i[n]};t.push(await G.evaluateIdentifier(e,a))}const a={};for(let e=0;e<i.length;e++)a[i[e]]=t[e];return n.parameters=a,new P({parentfeatureset:s[0],whereclause:n})}return new P({parentfeatureset:s[0],whereclause:n})}throw new n(e,i.InvalidParameter,t)}))},G.signatures.push({name:"filter",min:"2",max:"2"}),G.functions.orderby=function(e,t){return G.standardFunctionAsync(e,t,(async(a,r,s)=>{if(y(s,2,2,e,t),h(s[0])){const e=new k(s[1]);return new R({parentfeatureset:s[0],orderbyclause:e})}throw new n(e,i.InvalidParameter,t)}))},G.signatures.push({name:"orderby",min:"2",max:"2"}),G.functions.top=function(e,t){return G.standardFunctionAsync(e,t,(async(a,r,s)=>{if(y(s,2,2,e,t),h(s[0]))return new O({parentfeatureset:s[0],topnum:s[1]});if(F(s[0]))return N(s[1])>=s[0].length?s[0].slice(0):s[0].slice(0,N(s[1]));if(b(s[0]))return N(s[1])>=s[0].length()?s[0].slice(0):s[0].slice(0,N(s[1]));throw new n(e,i.InvalidParameter,t)}))},G.signatures.push({name:"top",min:"2",max:"2"}),G.functions.first=function(e,t){return G.standardFunctionAsync(e,t,(async(n,i,r)=>{if(y(r,1,1,e,t),h(r[0])){const e=await r[0].first(n.abortSignal);if(null!==e){const t=a.createFromGraphicLikeObject(e.geometry,e.attributes,r[0]);return t._underlyingGraphic=e,t}return e}return F(r[0])?0===r[0].length?null:r[0][0]:b(r[0])?0===r[0].length()?null:r[0].get(0):null}))},G.signatures.push({name:"first",min:"1",max:"1"}),G.functions.attachments=function(e,a){return G.standardFunctionAsync(e,a,(async(r,s,o)=>{y(o,1,2,e,a);const l={minsize:-1,maxsize:-1,types:null,returnMetadata:!1};if(o.length>1)if(o[1]instanceof t){if(o[1].hasField("minsize")&&(l.minsize=N(o[1].field("minsize"))),o[1].hasField("metadata")&&(l.returnMetadata=I(o[1].field("metadata"))),o[1].hasField("maxsize")&&(l.maxsize=N(o[1].field("maxsize"))),o[1].hasField("types")){const e=x(o[1].field("types"),!1);e.length>0&&(l.types=e)}}else if(null!==o[1])throw new n(e,i.InvalidParameter,a);if(E(o[0])){let t=o[0]._layer;return t instanceof _&&(t=c(t,e.spatialReference,["*"],!0,e.lrucache,e.interceptor)),null===t?[]:!1===h(t)?[]:(await t.load(),t.queryAttachments(o[0].field(t.objectIdField),l.minsize,l.maxsize,l.types,l.returnMetadata))}if(null===o[0])return[];throw new n(e,i.InvalidParameter,a)}))},G.signatures.push({name:"attachments",min:"1",max:"2"}),G.functions.featuresetbyrelationshipname=function(e,t){return G.standardFunctionAsync(e,t,(async(a,r,s)=>{y(s,2,4,e,t);const o=s[0],l=w(s[1]);let f=g(s[2],null);const m=I(g(s[3],!0));if(null===f&&(f=["*"]),!1===F(f))throw new n(e,i.InvalidParameter,t);if(null===s[0])return null;if(!E(s[0]))throw new n(e,i.InvalidParameter,t);let p=o._layer;if(p instanceof _&&(p=c(p,e.spatialReference,["*"],!0,e.lrucache,e.interceptor)),null===p)return null;if(!1===h(p))return null;p=await p.load();const D=p.relationshipMetaData().filter((e=>e.name===l));if(0===D.length)return null;if(void 0!==D[0].relationshipTableId&&null!==D[0].relationshipTableId&&D[0].relationshipTableId>-1)return u(p,D[0],o.field(p.objectIdField),p.spatialReference,f,m,e.lrucache,e.interceptor);let b=p.serviceUrl();if(!b)return null;b="/"===b.charAt(b.length-1)?b+D[0].relatedTableId.toString():b+"/"+D[0].relatedTableId.toString();const A=await d(b,p.spatialReference,f,m,e.lrucache,e.interceptor);await A.load();let N=A.relationshipMetaData();if(N=N.filter((e=>e.id===D[0].id)),!1===o.hasField(D[0].keyField)||null===o.field(D[0].keyField)){const e=await p.getFeatureByObjectId(o.field(p.objectIdField),[D[0].keyField]);if(e){const t=W.create(N[0].keyField+"= @id",A.getFieldsIndex());return t.parameters={id:e.attributes[D[0].keyField]},A.filter(t)}return new C({parentfeatureset:A})}const x=W.create(N[0].keyField+"= @id",A.getFieldsIndex());return x.parameters={id:o.field(D[0].keyField)},A.filter(x)}))},G.signatures.push({name:"featuresetbyrelationshipname",min:"2",max:"4"}),G.functions.featuresetbyassociation=function(e,t){return G.standardFunctionAsync(e,t,(async(a,r,s)=>{y(s,2,3,e,t);const o=s[0],l=w(g(s[1],"")).toLowerCase(),f=D(s[2])?w(s[2]):null;if(null===s[0])return null;if(!E(s[0]))throw new n(e,i.InvalidParameter,t);let u=o._layer;if(u instanceof _&&(u=c(u,e.spatialReference,["*"],!0,e.lrucache,e.interceptor)),null===u)return null;if(!1===h(u))return null;await u.load();const d=u.serviceUrl(),p=await m(d,e.spatialReference);let I=null,F=null,b=!1;if(null!==f&&""!==f&&void 0!==f){for(const e of p.terminals)e.terminalName===f&&(F=e.terminalId);null===F&&(b=!0)}const A=p.associations.getFieldsIndex(),N=A.get("TOGLOBALID").name,x=A.get("FROMGLOBALID").name,P=A.get("TOTERMINALID").name,R=A.get("FROMTERMINALID").name,O=A.get("FROMNETWORKSOURCEID").name,C=A.get("TONETWORKSOURCEID").name,M=A.get("ASSOCIATIONTYPE").name,k=A.get("ISCONTENTVISIBLE").name,z=A.get("OBJECTID").name;for(const e of u.fields)if("global-id"===e.type){I=o.field(e.name);break}let G=null,U=new v(new B({name:"percentalong",alias:"percentalong",type:"double"}),W.create("0",p.associations.getFieldsIndex())),J=new v(new B({name:"side",alias:"side",type:"string"}),W.create("''",p.associations.getFieldsIndex()));const V="globalid",q="globalId",K={};for(const e in p.lkp)K[e]=p.lkp[e].sourceId;const X=new $(new B({name:"classname",alias:"classname",type:"string"}),null,K);let Y="";switch(l){case"midspan":{Y=`((${N}='${I}') OR ( ${x}='${I}')) AND (${M} IN (5))`,X.codefield=W.create(`CASE WHEN (${N}='${I}') THEN ${O} ELSE ${C} END`,p.associations.getFieldsIndex());const e=H(T.findField(p.associations.fields,x));e.name=V,e.alias=V,G=new v(e,W.create(`CASE WHEN (${x}='${I}') THEN ${N} ELSE ${x} END`,p.associations.getFieldsIndex())),U=p.unVersion>=4?new j(T.findField(p.associations.fields,A.get("PERCENTALONG").name)):new v(new B({name:"percentalong",alias:"percentalong",type:"double"}),W.create("0",p.associations.getFieldsIndex()));break}case"junctionedge":{Y=`((${N}='${I}') OR ( ${x}='${I}')) AND (${M} IN (4,6))`,X.codefield=W.create(`CASE WHEN (${N}='${I}') THEN ${O} ELSE ${C} END`,p.associations.getFieldsIndex());const e=H(T.findField(p.associations.fields,x));e.name=V,e.alias=V,G=new v(e,W.create(`CASE WHEN (${x}='${I}') THEN ${N} ELSE ${x} END`,p.associations.getFieldsIndex())),J=new v(new B({name:"side",alias:"side",type:"string"}),W.create(`CASE WHEN (${M}=4) THEN 'from' ELSE 'to' END`,p.associations.getFieldsIndex()));break}case"connected":{let e=`${N}='@T'`,t=`${x}='@T'`;null!==F&&(e+=` AND ${P}=@A`,t+=` AND ${R}=@A`),Y="(("+e+") OR ("+t+"))",Y=S(Y,"@T",I??""),e=S(e,"@T",I??""),null!==F&&(e=S(e,"@A",F.toString()),Y=S(Y,"@A",F.toString())),X.codefield=W.create("CASE WHEN "+e+` THEN ${O} ELSE ${C} END`,p.associations.getFieldsIndex());const n=H(T.findField(p.associations.fields,x));n.name=V,n.alias=V,G=new v(n,W.create("CASE WHEN "+e+` THEN ${x} ELSE ${N} END`,p.associations.getFieldsIndex()));break}case"container":Y=`${N}='${I}' AND ${M} = 2`,null!==F&&(Y+=` AND ${P} = `+F.toString()),X.codefield=O,Y="( "+Y+" )",G=new L(T.findField(p.associations.fields,x),V,V);case"content":Y=`(${x}='${I}' AND ${M} = 2)`,null!==F&&(Y+=` AND ${R} = `+F.toString()),X.codefield=C,Y="( "+Y+" )",G=new L(T.findField(p.associations.fields,N),V,V);break;case"structure":Y=`(${N}='${I}' AND ${M} = 3)`,null!==F&&(Y+=` AND ${P} = `+F.toString()),X.codefield=O,Y="( "+Y+" )",G=new L(T.findField(p.associations.fields,x),V,q);break;case"attached":Y=`(${x}='${I}' AND ${M} = 3)`,null!==F&&(Y+=` AND ${R} = `+F.toString()),X.codefield=C,Y="( "+Y+" )",G=new L(T.findField(p.associations.fields,N),V,q);break;default:throw new n(e,i.InvalidParameter,t)}b&&(Y="1 <> 1");return new T({parentfeatureset:p.associations,adaptedFields:[new j(T.findField(p.associations.fields,z)),new j(T.findField(p.associations.fields,k)),G,J,X,U],extraFilter:Y?W.create(Y,p.associations.getFieldsIndex()):null})}))},G.signatures.push({name:"featuresetbyassociation",min:"2",max:"6"}),G.functions.groupby=function(e,a){return G.standardFunctionAsync(e,a,(async(r,s,o)=>{if(y(o,3,3,e,a),!h(o[0]))throw new n(e,i.InvalidParameter,a);const l=await o[0].load(),f=[],c=[];let u=!1,d=[];if(D(o[1]))d.push(o[1]);else if(o[1]instanceof t)d.push(o[1]);else if(F(o[1]))d=o[1];else{if(!b(o[1]))throw new n(e,i.InvalidParameter,a);d=o[1].toArray()}for(const m of d)if(D(m)){const e=W.create(w(m),l.getFieldsIndex()),t=!0===z(e)?w(m):"%%%%FIELDNAME";f.push({name:t,expression:e}),"%%%%FIELDNAME"===t&&(u=!0)}else{if(!(m instanceof t))throw new n(e,i.InvalidParameter,a);{const t=m.hasField("name")?m.field("name"):"%%%%FIELDNAME",r=m.hasField("expression")?m.field("expression"):"";if("%%%%FIELDNAME"===t&&(u=!0),!t)throw new n(e,i.InvalidParameter,a);f.push({name:t,expression:W.create(r||t,l.getFieldsIndex())})}}if(d=[],D(o[2]))d.push(o[2]);else if(F(o[2]))d=o[2];else if(b(o[2]))d=o[2].toArray();else{if(!(o[2]instanceof t))throw new n(e,i.InvalidParameter,a);d.push(o[2])}for(const m of d){if(!(m instanceof t))throw new n(e,i.InvalidParameter,a);{const t=m.hasField("name")?m.field("name"):"",r=m.hasField("statistic")?m.field("statistic"):"",s=m.hasField("expression")?m.field("expression"):"";if(!t||!r||!s)throw new n(e,i.InvalidParameter,a);c.push({name:t,statistic:r.toLowerCase(),expression:W.create(s,l.getFieldsIndex())})}}if(u){const e={};for(const n of l.fields)e[n.name.toLowerCase()]=1;for(const n of f)"%%%%FIELDNAME"!==n.name&&(e[n.name.toLowerCase()]=1);for(const n of c)"%%%%FIELDNAME"!==n.name&&(e[n.name.toLowerCase()]=1);let t=0;for(const n of f)if("%%%%FIELDNAME"===n.name){for(;1===e["field_"+t.toString()];)t++;e["field_"+t.toString()]=1,n.name="FIELD_"+t.toString()}}for(const t of f)await V(t.expression,G,e);for(const t of c)await V(t.expression,G,e);return o[0].groupby(f,c)}))},G.signatures.push({name:"groupby",min:"3",max:"3"}),G.functions.distinct=function(e,a){return G.standardFunctionAsync(e,a,(async(r,s,o)=>{if(h(o[0])){y(o,2,2,e,a);const r=await o[0].load(),s=[];let l=[];if(D(o[1]))l.push(o[1]);else if(o[1]instanceof t)l.push(o[1]);else if(F(o[1]))l=o[1];else{if(!b(o[1]))throw new n(e,i.InvalidParameter,a);l=o[1].toArray()}let f=!1;for(const o of l)if(D(o)){const e=W.create(w(o),r.getFieldsIndex()),t=!0===z(e)?w(o):"%%%%FIELDNAME";s.push({name:t,expression:e}),"%%%%FIELDNAME"===t&&(f=!0)}else{if(!(o instanceof t))throw new n(e,i.InvalidParameter,a);{const t=o.hasField("name")?o.field("name"):"%%%%FIELDNAME",l=o.hasField("expression")?o.field("expression"):"";if("%%%%FIELDNAME"===t&&(f=!0),!t)throw new n(e,i.InvalidParameter,a);s.push({name:t,expression:W.create(l||t,r.getFieldsIndex())})}}if(f){const e={};for(const n of r.fields)e[n.name.toLowerCase()]=1;for(const n of s)"%%%%FIELDNAME"!==n.name&&(e[n.name.toLowerCase()]=1);let t=0;for(const n of s)if("%%%%FIELDNAME"===n.name){for(;1===e["field_"+t.toString()];)t++;e["field_"+t.toString()]=1,n.name="FIELD_"+t.toString()}}for(const t of s)await V(t.expression,G,e);return o[0].groupby(s,[])}return J("distinct",r,s,o)}))})}export{ee as registerFunctions};
5
+ import e from"../ArcadePortal.js";import t from"../Dictionary.js";import{ArcadeExecutionError as n,ExecutionErrorCodes as i}from"../executionError.js";import a from"../Feature.js";import r from"../featureSetCollection.js";import{getPortal as s,lookupUser as o,convertToFeatureSet as l,constructFeatureSetFromPortalItem as f,constructFeatureSet as c,constructFeatureSetFromRelationship as u,constructFeatureSetFromUrl as d,constructAssociationMetaDataFeatureSetFromUrl as m}from"../featureSetUtils.js";import p from"../ImmutableArray.js";import{y,A as g,j as w,T as h,h as I,m as F,w as E,c as D,x as b,i as A,g as N,X as x,L as S}from"../../chunks/languageUtils.js";import{SqlExpressionAdapted as v,StringToCodeAdapted as $,FieldRename as L,AdaptedFeatureSet as T,OriginalField as j}from"../featureset/actions/Adapted.js";import P from"../featureset/actions/AttributeFilter.js";import R from"../featureset/actions/OrderBy.js";import O from"../featureset/actions/Top.js";import C from"../featureset/sources/Empty.js";import M from"../featureset/sources/FeatureLayerMemory.js";import k from"../featureset/support/OrderbyClause.js";import{cloneField as H}from"../featureset/support/shared.js";import{isSingleField as z}from"../featureset/support/sqlUtils.js";import{calculateStat as G}from"./fieldStats.js";import{isPromiseLike as U}from"../../core/promiseUtils.js";import{WhereClause as W}from"../../core/sql/WhereClause.js";import _ from"../../layers/FeatureLayer.js";import B from"../../layers/support/Field.js";function J(e,t,n,i){if(1===i.length){if(F(i[0]))return G(e,i[0],-1);if(b(i[0]))return G(e,i[0].toArray(),-1)}return G(e,i,-1)}async function V(e,t,n){const i=e.getVariables();if(i.length>0){const a=[];for(let e=0;e<i.length;e++){const r={name:i[e]};a.push(await t.evaluateIdentifier(n,r))}const r={};for(let e=0;e<i.length;e++)r[i[e]]=a[e];return e.parameters=r,e}return e}function q(e,t,n=null){for(const i in e)if(i.toLowerCase()===t.toLowerCase())return e[i];return n}function K(e){if(null===e)return null;const t={type:q(e,"type",""),name:q(e,"name","")};if("range"===t.type)t.range=q(e,"range",[]);else{t.codedValues=[];for(const n of q(e,"codedValues",[]))t.codedValues.push({name:q(n,"name",""),code:q(n,"code",null)})}return t}function X(e){if(null===e)return null;const t={},n=q(e,"wkt",null);null!==n&&(t.wkt=n);const i=q(e,"wkid",null);return null!==i&&(t.wkid=i),t}function Y(e){if(null===e)return null;const t={hasZ:q(e,"hasz",!1),hasM:q(e,"hasm",!1)},n=q(e,"spatialreference",null);n&&(t.spatialReference=X(n));const i=q(e,"x",null);if(null!==i)return t.x=i,t.y=q(e,"y",null),t;const a=q(e,"rings",null);if(null!==a)return t.rings=a,t;const r=q(e,"paths",null);if(null!==r)return t.paths=r,t;const s=q(e,"points",null);if(null!==s)return t.points=s,t;for(const o of["xmin","xmax","ymin","ymax","zmin","zmax","mmin","mmax"]){const n=q(e,o,null);null!==n&&(t[o]=n)}return t}function Z(e,t){for(const n of t)if(n===e)return!0;return!1}function Q(e){return!!e.layerDefinition&&(!!e.featureSet&&(!1!==Z(e.layerDefinition.geometryType,["","esriGeometryPoint","esriGeometryPolyline","esriGeometryPolygon","esriGeometryMultipoint","esriGeometryEnvelope"])&&(null!==e.layerDefinition.objectIdField&&""!==e.layerDefinition.objectIdField&&(!1!==F(e.layerDefinition.fields)&&!1!==F(e.featureSet.features)))))}function ee(G){"async"===G.mode&&(G.functions.getuser=function(a,r){return G.standardFunctionAsync(a,r,(async(l,f,c)=>{y(c,0,2,a,r);let u=g(c[1],""),d=!0===u;if(u=!0===u||!1===u?"":w(u),0===c.length||c[0]instanceof e){let e=null;a.services&&a.services.portal&&(e=a.services.portal),c.length>0&&(e=s(c[0],e));const n=await o(e,u,d);if(n){const e=JSON.parse(JSON.stringify(n));for(const t of["lastLogin","created","modified"])void 0!==e[t]&&null!==e[t]&&(e[t]=new Date(e[t]));return t.convertObjectToArcadeDictionary(e)}return null}let m=null;if(h(c[0])&&(m=c[0]),m){if(d=!1,u)return null;await m.load();const n=await m.getOwningSystemUrl();if(!n){if(!u){const e=await m.getIdentityUser();return e?t.convertObjectToArcadeDictionary({username:e}):null}return null}let i=null;a.services&&a.services.portal&&(i=a.services.portal),i=s(new e(n),i);const r=await o(i,u,d);if(r){const e=JSON.parse(JSON.stringify(r));for(const t of["lastLogin","created","modified"])void 0!==e[t]&&null!==e[t]&&(e[t]=new Date(e[t]));return t.convertObjectToArcadeDictionary(e)}return null}throw new n(a,i.InvalidParameter,r)}))},G.signatures.push({name:"getuser",min:1,max:2}),G.functions.featuresetbyid=function(e,t){return G.standardFunctionAsync(e,t,((a,s,o)=>{if(y(o,2,4,e,t),o[0]instanceof r){const a=w(o[1]);let r=g(o[2],null);const s=I(g(o[3],!0));if(null===r&&(r=["*"]),!1===F(r))throw new n(e,i.InvalidParameter,t);return o[0].featureSetById(a,s,r)}throw new n(e,i.InvalidParameter,t)}))},G.signatures.push({name:"featuresetbyid",min:2,max:4}),G.functions.getfeatureset=function(e,t){return G.standardFunctionAsync(e,t,((a,r,s)=>{if(y(s,1,2,e,t),E(s[0])){let t=g(s[1],"datasource");return null===t&&(t="datasource"),t=w(t).toLowerCase(),l(s[0].fullSchema(),t,e.lrucache,e.interceptor,e.spatialReference)}throw new n(e,i.InvalidParameter,t)}))},G.signatures.push({name:"getfeatureset",min:1,max:2}),G.functions.featuresetbyportalitem=function(t,a){return G.standardFunctionAsync(t,a,((r,o,l)=>{if(y(l,2,5,t,a),null===l[0])throw new n(t,i.PortalRequired,a);if(l[0]instanceof e){const e=w(l[1]),r=w(l[2]);let o=g(l[3],null);const c=I(g(l[4],!0));if(null===o&&(o=["*"]),!1===F(o))throw new n(t,i.InvalidParameter,a);let u=null;return t.services&&t.services.portal&&(u=t.services.portal),u=s(l[0],u),f(e,r,t.spatialReference,o,c,u,t.lrucache,t.interceptor)}if(!1===D(l[0]))throw new n(t,i.PortalRequired,a);const c=w(l[0]),u=w(l[1]);let d=g(l[2],null);const m=I(g(l[3],!0));if(null===d&&(d=["*"]),!1===F(d))throw new n(t,i.InvalidParameter,a);if(t.services&&t.services.portal)return f(c,u,t.spatialReference,d,m,t.services.portal,t.lrucache,t.interceptor);throw new n(t,i.PortalRequired,a)}))},G.signatures.push({name:"featuresetbyportalitem",min:2,max:5}),G.functions.featuresetbyname=function(e,t){return G.standardFunctionAsync(e,t,((a,s,o)=>{if(y(o,2,4,e,t),o[0]instanceof r){const a=w(o[1]);let r=g(o[2],null);const s=I(g(o[3],!0));if(null===r&&(r=["*"]),!1===F(r))throw new n(e,i.InvalidParameter,t);return o[0].featureSetByName(a,s,r)}throw new n(e,i.InvalidParameter,t)}))},G.signatures.push({name:"featuresetbyname",min:2,max:4}),G.functions.featureset=function(e,a){return G.standardFunction(e,a,((r,s,o)=>{y(o,1,1,e,a);let l=o[0];const f={layerDefinition:{geometryType:"",objectIdField:"",globalIdField:"",typeIdField:"",fields:[]},featureSet:{geometryType:"",features:[]}};if(D(l))l=JSON.parse(l),void 0!==l.layerDefinition?(f.layerDefinition=l.layerDefinition,f.featureSet=l.featureSet,l.layerDefinition.spatialReference&&(f.layerDefinition.spatialReference=l.layerDefinition.spatialReference)):(f.featureSet.features=l.features,f.featureSet.geometryType=l.geometryType,f.layerDefinition.geometryType=f.featureSet.geometryType,f.layerDefinition.objectIdField=l.objectIdFieldName,f.layerDefinition.typeIdField=l.typeIdFieldName,f.layerDefinition.globalIdField=l.globalIdFieldName,f.layerDefinition.fields=l.fields,l.spatialReference&&(f.layerDefinition.spatialReference=l.spatialReference));else{if(!(o[0]instanceof t))throw new n(e,i.InvalidParameter,a);{l=JSON.parse(o[0].castToText(!0));const e=q(l,"layerdefinition");if(null!==e){f.layerDefinition.geometryType=q(e,"geometrytype",""),f.featureSet.geometryType=f.layerDefinition.geometryType,f.layerDefinition.globalIdField=q(e,"globalidfield",""),f.layerDefinition.objectIdField=q(e,"objectidfield",""),f.layerDefinition.typeIdField=q(e,"typeidfield","");const t=q(e,"spatialreference",null);t&&(f.layerDefinition.spatialReference=X(t));for(const i of q(e,"fields",[])){const e={name:q(i,"name",""),alias:q(i,"alias",""),type:q(i,"type",""),nullable:q(i,"nullable",!0),editable:q(i,"editable",!0),length:q(i,"length",null),domain:K(q(i,"domain"))};f.layerDefinition.fields.push(e)}const n=q(l,"featureset",null);if(n){const e={};for(const t of f.layerDefinition.fields)e[t.name.toLowerCase()]=t.name;for(const t of q(n,"features",[])){const n={},i=q(t,"attributes",{});for(const t in i)n[e[t.toLowerCase()]]=i[t];f.featureSet.features.push({attributes:n,geometry:Y(q(t,"geometry",null))})}}}else{f.layerDefinition.geometryType=q(l,"geometrytype",""),f.featureSet.geometryType=f.layerDefinition.geometryType,f.layerDefinition.objectIdField=q(l,"objectidfieldname",""),f.layerDefinition.typeIdField=q(l,"typeidfieldname","");const e=q(l,"spatialreference",null);e&&(f.layerDefinition.spatialReference=X(e));for(const n of q(l,"fields",[])){const e={name:q(n,"name",""),alias:q(n,"alias",""),type:q(n,"type",""),nullable:q(n,"nullable",!0),editable:q(n,"editable",!0),length:q(n,"length",null),domain:K(q(n,"domain"))};f.layerDefinition.fields.push(e)}const t={};for(const n of f.layerDefinition.fields)t[n.name.toLowerCase()]=n.name;for(const n of q(l,"features",[])){const e={},i=q(n,"attributes",{});for(const n in i)e[t[n.toLowerCase()]]=i[n];f.featureSet.features.push({attributes:e,geometry:Y(q(n,"geometry",null))})}}}}if(!1===Q(f))throw new n(e,i.InvalidParameter,a);return M.create(f,e.spatialReference)}))},G.signatures.push({name:"featureset",min:1,max:1}),G.functions.filter=function(e,t){return G.standardFunctionAsync(e,t,(async(a,r,s)=>{if(y(s,2,2,e,t),F(s[0])||b(s[0])){const a=[];let r=s[0];r instanceof p&&(r=r.toArray());let o=null;if(!A(s[1]))throw new n(e,i.InvalidParameter,t);o=s[1].createFunction(e);for(const e of r){const t=o(e);U(t)?!0===await t&&a.push(e):!0===t&&a.push(e)}return a}if(h(s[0])){const t=await s[0].load(),n=W.create(s[1],t.getFieldsIndex()),i=n.getVariables();if(i.length>0){const t=[];for(let n=0;n<i.length;n++){const a={name:i[n]};t.push(await G.evaluateIdentifier(e,a))}const a={};for(let e=0;e<i.length;e++)a[i[e]]=t[e];return n.parameters=a,new P({parentfeatureset:s[0],whereclause:n})}return new P({parentfeatureset:s[0],whereclause:n})}throw new n(e,i.InvalidParameter,t)}))},G.signatures.push({name:"filter",min:2,max:2}),G.functions.orderby=function(e,t){return G.standardFunctionAsync(e,t,(async(a,r,s)=>{if(y(s,2,2,e,t),h(s[0])){const e=new k(s[1]);return new R({parentfeatureset:s[0],orderbyclause:e})}throw new n(e,i.InvalidParameter,t)}))},G.signatures.push({name:"orderby",min:2,max:2}),G.functions.top=function(e,t){return G.standardFunctionAsync(e,t,(async(a,r,s)=>{if(y(s,2,2,e,t),h(s[0]))return new O({parentfeatureset:s[0],topnum:s[1]});if(F(s[0]))return N(s[1])>=s[0].length?s[0].slice(0):s[0].slice(0,N(s[1]));if(b(s[0]))return N(s[1])>=s[0].length()?s[0].slice(0):s[0].slice(0,N(s[1]));throw new n(e,i.InvalidParameter,t)}))},G.signatures.push({name:"top",min:2,max:2}),G.functions.first=function(e,t){return G.standardFunctionAsync(e,t,(async(n,i,r)=>{if(y(r,1,1,e,t),h(r[0])){const e=await r[0].first(n.abortSignal);if(null!==e){const t=a.createFromGraphicLikeObject(e.geometry,e.attributes,r[0]);return t._underlyingGraphic=e,t}return e}return F(r[0])?0===r[0].length?null:r[0][0]:b(r[0])?0===r[0].length()?null:r[0].get(0):null}))},G.signatures.push({name:"first",min:1,max:1}),G.functions.attachments=function(e,a){return G.standardFunctionAsync(e,a,(async(r,s,o)=>{y(o,1,2,e,a);const l={minsize:-1,maxsize:-1,types:null,returnMetadata:!1};if(o.length>1)if(o[1]instanceof t){if(o[1].hasField("minsize")&&(l.minsize=N(o[1].field("minsize"))),o[1].hasField("metadata")&&(l.returnMetadata=I(o[1].field("metadata"))),o[1].hasField("maxsize")&&(l.maxsize=N(o[1].field("maxsize"))),o[1].hasField("types")){const e=x(o[1].field("types"),!1);e.length>0&&(l.types=e)}}else if(null!==o[1])throw new n(e,i.InvalidParameter,a);if(E(o[0])){let t=o[0]._layer;return t instanceof _&&(t=c(t,e.spatialReference,["*"],!0,e.lrucache,e.interceptor)),null===t?[]:!1===h(t)?[]:(await t.load(),t.queryAttachments(o[0].field(t.objectIdField),l.minsize,l.maxsize,l.types,l.returnMetadata))}if(null===o[0])return[];throw new n(e,i.InvalidParameter,a)}))},G.signatures.push({name:"attachments",min:1,max:2}),G.functions.featuresetbyrelationshipname=function(e,t){return G.standardFunctionAsync(e,t,(async(a,r,s)=>{y(s,2,4,e,t);const o=s[0],l=w(s[1]);let f=g(s[2],null);const m=I(g(s[3],!0));if(null===f&&(f=["*"]),!1===F(f))throw new n(e,i.InvalidParameter,t);if(null===s[0])return null;if(!E(s[0]))throw new n(e,i.InvalidParameter,t);let p=o._layer;if(p instanceof _&&(p=c(p,e.spatialReference,["*"],!0,e.lrucache,e.interceptor)),null===p)return null;if(!1===h(p))return null;p=await p.load();const D=p.relationshipMetaData().filter((e=>e.name===l));if(0===D.length)return null;if(void 0!==D[0].relationshipTableId&&null!==D[0].relationshipTableId&&D[0].relationshipTableId>-1)return u(p,D[0],o.field(p.objectIdField),p.spatialReference,f,m,e.lrucache,e.interceptor);let b=p.serviceUrl();if(!b)return null;b="/"===b.charAt(b.length-1)?b+D[0].relatedTableId.toString():b+"/"+D[0].relatedTableId.toString();const A=await d(b,p.spatialReference,f,m,e.lrucache,e.interceptor);await A.load();let N=A.relationshipMetaData();if(N=N.filter((e=>e.id===D[0].id)),!1===o.hasField(D[0].keyField)||null===o.field(D[0].keyField)){const e=await p.getFeatureByObjectId(o.field(p.objectIdField),[D[0].keyField]);if(e){const t=W.create(N[0].keyField+"= @id",A.getFieldsIndex());return t.parameters={id:e.attributes[D[0].keyField]},A.filter(t)}return new C({parentfeatureset:A})}const x=W.create(N[0].keyField+"= @id",A.getFieldsIndex());return x.parameters={id:o.field(D[0].keyField)},A.filter(x)}))},G.signatures.push({name:"featuresetbyrelationshipname",min:2,max:4}),G.functions.featuresetbyassociation=function(e,t){return G.standardFunctionAsync(e,t,(async(a,r,s)=>{y(s,2,3,e,t);const o=s[0],l=w(g(s[1],"")).toLowerCase(),f=D(s[2])?w(s[2]):null;if(null===s[0])return null;if(!E(s[0]))throw new n(e,i.InvalidParameter,t);let u=o._layer;if(u instanceof _&&(u=c(u,e.spatialReference,["*"],!0,e.lrucache,e.interceptor)),null===u)return null;if(!1===h(u))return null;await u.load();const d=u.serviceUrl(),p=await m(d,e.spatialReference);let I=null,F=null,b=!1;if(null!==f&&""!==f&&void 0!==f){for(const e of p.terminals)e.terminalName===f&&(F=e.terminalId);null===F&&(b=!0)}const A=p.associations.getFieldsIndex(),N=A.get("TOGLOBALID").name,x=A.get("FROMGLOBALID").name,P=A.get("TOTERMINALID").name,R=A.get("FROMTERMINALID").name,O=A.get("FROMNETWORKSOURCEID").name,C=A.get("TONETWORKSOURCEID").name,M=A.get("ASSOCIATIONTYPE").name,k=A.get("ISCONTENTVISIBLE").name,z=A.get("OBJECTID").name;for(const e of u.fields)if("global-id"===e.type){I=o.field(e.name);break}let G=null,U=new v(new B({name:"percentalong",alias:"percentalong",type:"double"}),W.create("0",p.associations.getFieldsIndex())),J=new v(new B({name:"side",alias:"side",type:"string"}),W.create("''",p.associations.getFieldsIndex()));const V="globalid",q="globalId",K={};for(const e in p.lkp)K[e]=p.lkp[e].sourceId;const X=new $(new B({name:"classname",alias:"classname",type:"string"}),null,K);let Y="";switch(l){case"midspan":{Y=`((${N}='${I}') OR ( ${x}='${I}')) AND (${M} IN (5))`,X.codefield=W.create(`CASE WHEN (${N}='${I}') THEN ${O} ELSE ${C} END`,p.associations.getFieldsIndex());const e=H(T.findField(p.associations.fields,x));e.name=V,e.alias=V,G=new v(e,W.create(`CASE WHEN (${x}='${I}') THEN ${N} ELSE ${x} END`,p.associations.getFieldsIndex())),U=p.unVersion>=4?new j(T.findField(p.associations.fields,A.get("PERCENTALONG").name)):new v(new B({name:"percentalong",alias:"percentalong",type:"double"}),W.create("0",p.associations.getFieldsIndex()));break}case"junctionedge":{Y=`((${N}='${I}') OR ( ${x}='${I}')) AND (${M} IN (4,6))`,X.codefield=W.create(`CASE WHEN (${N}='${I}') THEN ${O} ELSE ${C} END`,p.associations.getFieldsIndex());const e=H(T.findField(p.associations.fields,x));e.name=V,e.alias=V,G=new v(e,W.create(`CASE WHEN (${x}='${I}') THEN ${N} ELSE ${x} END`,p.associations.getFieldsIndex())),J=new v(new B({name:"side",alias:"side",type:"string"}),W.create(`CASE WHEN (${M}=4) THEN 'from' ELSE 'to' END`,p.associations.getFieldsIndex()));break}case"connected":{let e=`${N}='@T'`,t=`${x}='@T'`;null!==F&&(e+=` AND ${P}=@A`,t+=` AND ${R}=@A`),Y="(("+e+") OR ("+t+"))",Y=S(Y,"@T",I??""),e=S(e,"@T",I??""),null!==F&&(e=S(e,"@A",F.toString()),Y=S(Y,"@A",F.toString())),X.codefield=W.create("CASE WHEN "+e+` THEN ${O} ELSE ${C} END`,p.associations.getFieldsIndex());const n=H(T.findField(p.associations.fields,x));n.name=V,n.alias=V,G=new v(n,W.create("CASE WHEN "+e+` THEN ${x} ELSE ${N} END`,p.associations.getFieldsIndex()));break}case"container":Y=`${N}='${I}' AND ${M} = 2`,null!==F&&(Y+=` AND ${P} = `+F.toString()),X.codefield=O,Y="( "+Y+" )",G=new L(T.findField(p.associations.fields,x),V,V);case"content":Y=`(${x}='${I}' AND ${M} = 2)`,null!==F&&(Y+=` AND ${R} = `+F.toString()),X.codefield=C,Y="( "+Y+" )",G=new L(T.findField(p.associations.fields,N),V,V);break;case"structure":Y=`(${N}='${I}' AND ${M} = 3)`,null!==F&&(Y+=` AND ${P} = `+F.toString()),X.codefield=O,Y="( "+Y+" )",G=new L(T.findField(p.associations.fields,x),V,q);break;case"attached":Y=`(${x}='${I}' AND ${M} = 3)`,null!==F&&(Y+=` AND ${R} = `+F.toString()),X.codefield=C,Y="( "+Y+" )",G=new L(T.findField(p.associations.fields,N),V,q);break;default:throw new n(e,i.InvalidParameter,t)}b&&(Y="1 <> 1");return new T({parentfeatureset:p.associations,adaptedFields:[new j(T.findField(p.associations.fields,z)),new j(T.findField(p.associations.fields,k)),G,J,X,U],extraFilter:Y?W.create(Y,p.associations.getFieldsIndex()):null})}))},G.signatures.push({name:"featuresetbyassociation",min:2,max:6}),G.functions.groupby=function(e,a){return G.standardFunctionAsync(e,a,(async(r,s,o)=>{if(y(o,3,3,e,a),!h(o[0]))throw new n(e,i.InvalidParameter,a);const l=await o[0].load(),f=[],c=[];let u=!1,d=[];if(D(o[1]))d.push(o[1]);else if(o[1]instanceof t)d.push(o[1]);else if(F(o[1]))d=o[1];else{if(!b(o[1]))throw new n(e,i.InvalidParameter,a);d=o[1].toArray()}for(const m of d)if(D(m)){const e=W.create(w(m),l.getFieldsIndex()),t=!0===z(e)?w(m):"%%%%FIELDNAME";f.push({name:t,expression:e}),"%%%%FIELDNAME"===t&&(u=!0)}else{if(!(m instanceof t))throw new n(e,i.InvalidParameter,a);{const t=m.hasField("name")?m.field("name"):"%%%%FIELDNAME",r=m.hasField("expression")?m.field("expression"):"";if("%%%%FIELDNAME"===t&&(u=!0),!t)throw new n(e,i.InvalidParameter,a);f.push({name:t,expression:W.create(r||t,l.getFieldsIndex())})}}if(d=[],D(o[2]))d.push(o[2]);else if(F(o[2]))d=o[2];else if(b(o[2]))d=o[2].toArray();else{if(!(o[2]instanceof t))throw new n(e,i.InvalidParameter,a);d.push(o[2])}for(const m of d){if(!(m instanceof t))throw new n(e,i.InvalidParameter,a);{const t=m.hasField("name")?m.field("name"):"",r=m.hasField("statistic")?m.field("statistic"):"",s=m.hasField("expression")?m.field("expression"):"";if(!t||!r||!s)throw new n(e,i.InvalidParameter,a);c.push({name:t,statistic:r.toLowerCase(),expression:W.create(s,l.getFieldsIndex())})}}if(u){const e={};for(const n of l.fields)e[n.name.toLowerCase()]=1;for(const n of f)"%%%%FIELDNAME"!==n.name&&(e[n.name.toLowerCase()]=1);for(const n of c)"%%%%FIELDNAME"!==n.name&&(e[n.name.toLowerCase()]=1);let t=0;for(const n of f)if("%%%%FIELDNAME"===n.name){for(;1===e["field_"+t.toString()];)t++;e["field_"+t.toString()]=1,n.name="FIELD_"+t.toString()}}for(const t of f)await V(t.expression,G,e);for(const t of c)await V(t.expression,G,e);return o[0].groupby(f,c)}))},G.signatures.push({name:"groupby",min:3,max:3}),G.functions.distinct=function(e,a){return G.standardFunctionAsync(e,a,(async(r,s,o)=>{if(h(o[0])){y(o,2,2,e,a);const r=await o[0].load(),s=[];let l=[];if(D(o[1]))l.push(o[1]);else if(o[1]instanceof t)l.push(o[1]);else if(F(o[1]))l=o[1];else{if(!b(o[1]))throw new n(e,i.InvalidParameter,a);l=o[1].toArray()}let f=!1;for(const o of l)if(D(o)){const e=W.create(w(o),r.getFieldsIndex()),t=!0===z(e)?w(o):"%%%%FIELDNAME";s.push({name:t,expression:e}),"%%%%FIELDNAME"===t&&(f=!0)}else{if(!(o instanceof t))throw new n(e,i.InvalidParameter,a);{const t=o.hasField("name")?o.field("name"):"%%%%FIELDNAME",l=o.hasField("expression")?o.field("expression"):"";if("%%%%FIELDNAME"===t&&(f=!0),!t)throw new n(e,i.InvalidParameter,a);s.push({name:t,expression:W.create(l||t,r.getFieldsIndex())})}}if(f){const e={};for(const n of r.fields)e[n.name.toLowerCase()]=1;for(const n of s)"%%%%FIELDNAME"!==n.name&&(e[n.name.toLowerCase()]=1);let t=0;for(const n of s)if("%%%%FIELDNAME"===n.name){for(;1===e["field_"+t.toString()];)t++;e["field_"+t.toString()]=1,n.name="FIELD_"+t.toString()}}for(const t of s)await V(t.expression,G,e);return o[0].groupby(s,[])}return J("distinct",r,s,o)}))})}export{ee as registerFunctions};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{ArcadeExecutionError as e,ExecutionErrorCodes as n}from"../executionError.js";import{shapeExtent as t}from"../kernel.js";import{G as r,y as i,j as a,T as s}from"../../chunks/languageUtils.js";import u from"../featureset/actions/SpatialFilter.js";import o from"../featureset/sources/Empty.js";import l from"../../geometry/Geometry.js";import{relate as c,crosses as f,touches as p,within as m,overlaps as d,contains as w,intersects as y}from"../../geometry/geometryEngineAsync.js";function h(e){return e instanceof l}function S(i,a,c,S){return S(i,a,(async(S,R,v)=>{if(v.length<2)throw new e(i,n.WrongNumberOfParameters,a);if(null===(v=r(v))[0]&&null===v[1])return!1;if(s(v[0])){if(v[1]instanceof l)return new u({parentfeatureset:v[0],relation:c,relationGeom:v[1]});if(null===v[1])return new o({parentfeatureset:v[0]});throw new e(i,n.InvalidParameter,a)}if(h(v[0])){if(h(v[1])){switch(c){case"esriSpatialRelEnvelopeIntersects":return y(t(v[0]),t(v[1]));case"esriSpatialRelIntersects":return y(v[0],v[1]);case"esriSpatialRelContains":return w(v[0],v[1]);case"esriSpatialRelOverlaps":return d(v[0],v[1]);case"esriSpatialRelWithin":return m(v[0],v[1]);case"esriSpatialRelTouches":return p(v[0],v[1]);case"esriSpatialRelCrosses":return f(v[0],v[1])}throw new e(i,n.InvalidParameter,a)}if(s(v[1]))return new u({parentfeatureset:v[1],relation:c,relationGeom:v[0]});if(null===v[1])return!1;throw new e(i,n.InvalidParameter,a)}if(null!==v[0])throw new e(i,n.InvalidParameter,a);return s(v[1])?new o({parentfeatureset:v[1]}):!(v[1]instanceof l||null===v[1])&&void 0}))}function R(t){"async"===t.mode&&(t.functions.intersects=function(e,n){return S(e,n,"esriSpatialRelIntersects",t.standardFunctionAsync)},t.functions.envelopeintersects=function(e,n){return S(e,n,"esriSpatialRelEnvelopeIntersects",t.standardFunctionAsync)},t.signatures.push({name:"envelopeintersects",min:"2",max:"2"}),t.functions.contains=function(e,n){return S(e,n,"esriSpatialRelContains",t.standardFunctionAsync)},t.functions.overlaps=function(e,n){return S(e,n,"esriSpatialRelOverlaps",t.standardFunctionAsync)},t.functions.within=function(e,n){return S(e,n,"esriSpatialRelWithin",t.standardFunctionAsync)},t.functions.touches=function(e,n){return S(e,n,"esriSpatialRelTouches",t.standardFunctionAsync)},t.functions.crosses=function(e,n){return S(e,n,"esriSpatialRelCrosses",t.standardFunctionAsync)},t.functions.relate=function(u,f){return t.standardFunctionAsync(u,f,((t,p,m)=>{if(m=r(m),i(m,3,3,u,f),h(m[0])&&h(m[1]))return c(m[0],m[1],a(m[2]));if(m[0]instanceof l&&null===m[1])return!1;if(m[1]instanceof l&&null===m[0])return!1;if(s(m[0])&&null===m[1])return new o({parentfeatureset:m[0]});if(s(m[1])&&null===m[0])return new o({parentfeatureset:m[1]});if(s(m[0])&&m[1]instanceof l)return m[0].relate(m[1],a(m[2]));if(s(m[1])&&m[0]instanceof l)return m[1].relate(m[0],a(m[2]));if(null===m[0]&&null===m[1])return!1;throw new e(u,n.InvalidParameter,f)}))})}export{R as registerFunctions};
5
+ import{ArcadeExecutionError as e,ExecutionErrorCodes as n}from"../executionError.js";import{shapeExtent as t}from"../kernel.js";import{G as r,y as i,j as a,T as s}from"../../chunks/languageUtils.js";import u from"../featureset/actions/SpatialFilter.js";import o from"../featureset/sources/Empty.js";import l from"../../geometry/Geometry.js";import{relate as c,crosses as f,touches as p,within as m,overlaps as d,contains as w,intersects as y}from"../../geometry/geometryEngineAsync.js";function h(e){return e instanceof l}function S(i,a,c,S){return S(i,a,(async(S,R,v)=>{if(v.length<2)throw new e(i,n.WrongNumberOfParameters,a);if(null===(v=r(v))[0]&&null===v[1])return!1;if(s(v[0])){if(v[1]instanceof l)return new u({parentfeatureset:v[0],relation:c,relationGeom:v[1]});if(null===v[1])return new o({parentfeatureset:v[0]});throw new e(i,n.InvalidParameter,a)}if(h(v[0])){if(h(v[1])){switch(c){case"esriSpatialRelEnvelopeIntersects":return y(t(v[0]),t(v[1]));case"esriSpatialRelIntersects":return y(v[0],v[1]);case"esriSpatialRelContains":return w(v[0],v[1]);case"esriSpatialRelOverlaps":return d(v[0],v[1]);case"esriSpatialRelWithin":return m(v[0],v[1]);case"esriSpatialRelTouches":return p(v[0],v[1]);case"esriSpatialRelCrosses":return f(v[0],v[1])}throw new e(i,n.InvalidParameter,a)}if(s(v[1]))return new u({parentfeatureset:v[1],relation:c,relationGeom:v[0]});if(null===v[1])return!1;throw new e(i,n.InvalidParameter,a)}if(null!==v[0])throw new e(i,n.InvalidParameter,a);return s(v[1])?new o({parentfeatureset:v[1]}):!(v[1]instanceof l||null===v[1])&&void 0}))}function R(t){"async"===t.mode&&(t.functions.intersects=function(e,n){return S(e,n,"esriSpatialRelIntersects",t.standardFunctionAsync)},t.functions.envelopeintersects=function(e,n){return S(e,n,"esriSpatialRelEnvelopeIntersects",t.standardFunctionAsync)},t.signatures.push({name:"envelopeintersects",min:2,max:2}),t.functions.contains=function(e,n){return S(e,n,"esriSpatialRelContains",t.standardFunctionAsync)},t.functions.overlaps=function(e,n){return S(e,n,"esriSpatialRelOverlaps",t.standardFunctionAsync)},t.functions.within=function(e,n){return S(e,n,"esriSpatialRelWithin",t.standardFunctionAsync)},t.functions.touches=function(e,n){return S(e,n,"esriSpatialRelTouches",t.standardFunctionAsync)},t.functions.crosses=function(e,n){return S(e,n,"esriSpatialRelCrosses",t.standardFunctionAsync)},t.functions.relate=function(u,f){return t.standardFunctionAsync(u,f,((t,p,m)=>{if(m=r(m),i(m,3,3,u,f),h(m[0])&&h(m[1]))return c(m[0],m[1],a(m[2]));if(m[0]instanceof l&&null===m[1])return!1;if(m[1]instanceof l&&null===m[0])return!1;if(s(m[0])&&null===m[1])return new o({parentfeatureset:m[0]});if(s(m[1])&&null===m[0])return new o({parentfeatureset:m[1]});if(s(m[0])&&m[1]instanceof l)return m[0].relate(m[1],a(m[2]));if(s(m[1])&&m[0]instanceof l)return m[1].relate(m[0],a(m[2]));if(null===m[0]&&null===m[1])return!1;throw new e(u,n.InvalidParameter,f)}))})}export{R as registerFunctions};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import n from"../Dictionary.js";import{ArcadeExecutionError as e,ExecutionErrorCodes as a}from"../executionError.js";import{y as t,w as r,P as o,g as i,j as c,T as s,Y as d,O as u,Q as m,Z as f,S as l,_ as y,A as v,t as w,N as p}from"../../chunks/languageUtils.js";import{layerFieldEsriConstants as T}from"../featureset/support/shared.js";function h(e){return e&&e.domain?"coded-value"===e.domain.type||"codedValue"===e.domain.type?n.convertObjectToArcadeDictionary({type:"codedValue",name:e.domain.name,dataType:T[e.field.type],codedValues:e.domain.codedValues.map((n=>({name:n.name,code:n.code})))}):n.convertObjectToArcadeDictionary({type:"range",name:e.domain.name,dataType:T[e.field.type],min:e.domain.min,max:e.domain.max}):null}function A(T){"async"===T.mode&&(T.functions.domain=function(n,u){return T.standardFunctionAsync(n,u,(async(m,f,l)=>{if(t(l,2,3,n,u),r(l[0])){return h(o(l[0],c(l[1]),void 0===l[2]?void 0:i(l[2])))}if(s(l[0])){await l[0]._ensureLoaded();return h(d(c(l[1]),l[0],null,void 0===l[2]?void 0:i(l[2])))}throw new e(n,a.InvalidParameter,u)}))},T.functions.subtypes=function(o,i){return T.standardFunctionAsync(o,i,(async(c,d,m)=>{if(t(m,1,1,o,i),r(m[0])){const e=u(m[0]);return e?n.convertObjectToArcadeDictionary(e):null}if(s(m[0])){await m[0]._ensureLoaded();const e=m[0].subtypes();return e?n.convertObjectToArcadeDictionary(e):null}throw new e(o,a.InvalidParameter,i)}))},T.functions.domainname=function(n,o){return T.standardFunctionAsync(n,o,(async(u,l,y)=>{if(t(y,2,4,n,o),r(y[0]))return m(y[0],c(y[1]),y[2],void 0===y[3]?void 0:i(y[3]));if(s(y[0])){await y[0]._ensureLoaded();const n=d(c(y[1]),y[0],null,void 0===y[3]?void 0:i(y[3]));return f(n,y[2])}throw new e(n,a.InvalidParameter,o)}))},T.signatures.push({name:"domainname",min:"2",max:"4"}),T.functions.domaincode=function(n,o){return T.standardFunctionAsync(n,o,(async(u,m,f)=>{if(t(f,2,4,n,o),r(f[0]))return l(f[0],c(f[1]),f[2],void 0===f[3]?void 0:i(f[3]));if(s(f[0])){await f[0]._ensureLoaded();const n=d(c(f[1]),f[0],null,void 0===f[3]?void 0:i(f[3]));return y(n,f[2])}throw new e(n,a.InvalidParameter,o)}))},T.signatures.push({name:"domaincode",min:"2",max:"4"})),T.functions.text=function(n,e){return T.standardFunctionAsync(n,e,((a,r,o)=>{if(t(o,1,2,n,e),!s(o[0]))return w(o[0],o[1]);{const n=v(o[1],"");if(""===n)return o[0].castToText();if("schema"===n.toLowerCase())return o[0].convertToText("schema",a.abortSignal);if("featureset"===n.toLowerCase())return o[0].convertToText("featureset",a.abortSignal)}}))},T.functions.gdbversion=function(n,o){return T.standardFunctionAsync(n,o,(async(i,c,d)=>{if(t(d,1,1,n,o),r(d[0]))return d[0].gdbVersion();if(s(d[0])){return(await d[0].load()).gdbVersion}throw new e(n,a.InvalidParameter,o)}))},T.functions.schema=function(o,i){return T.standardFunctionAsync(o,i,(async(c,d,u)=>{if(t(u,1,1,o,i),s(u[0]))return await u[0].load(),n.convertObjectToArcadeDictionary(u[0].schema());if(r(u[0])){const e=p(u[0]);return e?n.convertObjectToArcadeDictionary(e):null}throw new e(o,a.InvalidParameter,i)}))}}export{A as registerFunctions};
5
+ import n from"../Dictionary.js";import{ArcadeExecutionError as e,ExecutionErrorCodes as a}from"../executionError.js";import{y as t,w as r,P as o,g as i,j as c,T as s,Y as d,O as u,Q as m,Z as f,S as l,_ as y,A as v,t as w,N as p}from"../../chunks/languageUtils.js";import{layerFieldEsriConstants as T}from"../featureset/support/shared.js";function h(e){return e&&e.domain?"coded-value"===e.domain.type||"codedValue"===e.domain.type?n.convertObjectToArcadeDictionary({type:"codedValue",name:e.domain.name,dataType:T[e.field.type],codedValues:e.domain.codedValues.map((n=>({name:n.name,code:n.code})))}):n.convertObjectToArcadeDictionary({type:"range",name:e.domain.name,dataType:T[e.field.type],min:e.domain.min,max:e.domain.max}):null}function A(T){"async"===T.mode&&(T.functions.domain=function(n,u){return T.standardFunctionAsync(n,u,(async(m,f,l)=>{if(t(l,2,3,n,u),r(l[0])){return h(o(l[0],c(l[1]),void 0===l[2]?void 0:i(l[2])))}if(s(l[0])){await l[0]._ensureLoaded();return h(d(c(l[1]),l[0],null,void 0===l[2]?void 0:i(l[2])))}throw new e(n,a.InvalidParameter,u)}))},T.functions.subtypes=function(o,i){return T.standardFunctionAsync(o,i,(async(c,d,m)=>{if(t(m,1,1,o,i),r(m[0])){const e=u(m[0]);return e?n.convertObjectToArcadeDictionary(e):null}if(s(m[0])){await m[0]._ensureLoaded();const e=m[0].subtypes();return e?n.convertObjectToArcadeDictionary(e):null}throw new e(o,a.InvalidParameter,i)}))},T.functions.domainname=function(n,o){return T.standardFunctionAsync(n,o,(async(u,l,y)=>{if(t(y,2,4,n,o),r(y[0]))return m(y[0],c(y[1]),y[2],void 0===y[3]?void 0:i(y[3]));if(s(y[0])){await y[0]._ensureLoaded();const n=d(c(y[1]),y[0],null,void 0===y[3]?void 0:i(y[3]));return f(n,y[2])}throw new e(n,a.InvalidParameter,o)}))},T.signatures.push({name:"domainname",min:2,max:4}),T.functions.domaincode=function(n,o){return T.standardFunctionAsync(n,o,(async(u,m,f)=>{if(t(f,2,4,n,o),r(f[0]))return l(f[0],c(f[1]),f[2],void 0===f[3]?void 0:i(f[3]));if(s(f[0])){await f[0]._ensureLoaded();const n=d(c(f[1]),f[0],null,void 0===f[3]?void 0:i(f[3]));return y(n,f[2])}throw new e(n,a.InvalidParameter,o)}))},T.signatures.push({name:"domaincode",min:2,max:4})),T.functions.text=function(n,e){return T.standardFunctionAsync(n,e,((a,r,o)=>{if(t(o,1,2,n,e),!s(o[0]))return w(o[0],o[1]);{const n=v(o[1],"");if(""===n)return o[0].castToText();if("schema"===n.toLowerCase())return o[0].convertToText("schema",a.abortSignal);if("featureset"===n.toLowerCase())return o[0].convertToText("featureset",a.abortSignal)}}))},T.functions.gdbversion=function(n,o){return T.standardFunctionAsync(n,o,(async(i,c,d)=>{if(t(d,1,1,n,o),r(d[0]))return d[0].gdbVersion();if(s(d[0])){return(await d[0].load()).gdbVersion}throw new e(n,a.InvalidParameter,o)}))},T.functions.schema=function(o,i){return T.standardFunctionAsync(o,i,(async(c,d,u)=>{if(t(u,1,1,o,i),s(u[0]))return await u[0].load(),n.convertObjectToArcadeDictionary(u[0].schema());if(r(u[0])){const e=p(u[0]);return e?n.convertObjectToArcadeDictionary(e):null}throw new e(o,a.InvalidParameter,i)}))}}export{A as registerFunctions};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import e from"../Dictionary.js";import n from"../Feature.js";import t from"../ImmutablePointArray.js";import{y as r,m as a,x as i,q as o,F as s,G as l,v as c,c as f,j as u,k as m,b as h,a as p,i as w,f as d,w as y,s as g,H as R}from"../../chunks/languageUtils.js";import I from"../../geometry/Extent.js";import v from"../../geometry/Geometry.js";import P from"../../geometry/Multipoint.js";import x from"../../geometry/Point.js";import b from"../../geometry/Polygon.js";import F from"../../geometry/Polyline.js";import{angle2D as j,angleBetween2D as O,bearing2D as S,bearingBetween2D as N,pathsSelfIntersecting as k}from"./centroid.js";import{fromJSON as J}from"../../geometry/support/jsonUtils.js";import{ArcadeExecutionError as G,ExecutionErrorCodes as z}from"../executionError.js";import D from"../ImmutablePathArray.js";import{isClockwise as _}from"../../geometry/support/coordsUtils.js";function M(e){return e&&"esri.arcade.Feature"===e.arcadeDeclaredClass}function C(D,C){D.ringisclockwise=function(e,n){return C(e,n,((o,s,l)=>{r(l,1,1,e,n);let c=[],f=!1,u=!1;if(null===l[0])return!1;if(a(l[0])){for(const t of l[0]){if(!(t instanceof x))throw new G(e,z.InvalidParameter,n);c.push(t.hasZ?t.hasM?[t.x,t.y,t.z,t.m]:[t.x,t.y,t.z]:[t.x,t.y])}c.length>0&&(f=l[0][0].hasZ,u=l[0][0].hasM)}else if(l[0]instanceof t)c=l[0]._elements,c.length>0&&(f=l[0]._hasZ,u=l[0]._hasM);else{if(!i(l[0]))throw new G(e,z.InvalidParameter,n);for(const t of l[0].toArray()){if(!(t instanceof x))throw new G(e,z.InvalidParameter,n);c.push(t.hasZ?t.hasM?[t.x,t.y,t.z,t.m]:[t.x,t.y,t.z]:[t.x,t.y])}c.length>0&&(f=l[0].get(0).hasZ,u=l[0].get(0).hasM)}return!(c.length<3)&&_(c,u,f)}))},D.polygon=function(t,a){return C(t,a,((i,l,c)=>{r(c,1,1,t,a);let f=null;if(c[0]instanceof e){if(f=o(n.parseGeometryFromDictionary(c[0]),t.spatialReference),f instanceof b==!1)throw new G(t,z.InvalidParameter,a)}else f=c[0]instanceof b?J(c[0].toJSON()):o(new b(JSON.parse(c[0])),t.spatialReference);if(null!==f&&!1===f.spatialReference.equals(t.spatialReference))throw new G(t,z.WrongSpatialReference,a);return s(f)}))},D.polyline=function(t,a){return C(t,a,((i,l,c)=>{r(c,1,1,t,a);let f=null;if(c[0]instanceof e){if(f=o(n.parseGeometryFromDictionary(c[0]),t.spatialReference),f instanceof F==!1)throw new G(t,z.InvalidParameter,a)}else f=c[0]instanceof F?J(c[0].toJSON()):o(new F(JSON.parse(c[0])),t.spatialReference);if(null!==f&&!1===f.spatialReference.equals(t.spatialReference))throw new G(t,z.WrongSpatialReference,a);return s(f)}))},D.point=function(t,a){return C(t,a,((i,l,c)=>{r(c,1,1,t,a);let f=null;if(c[0]instanceof e){if(f=o(n.parseGeometryFromDictionary(c[0]),t.spatialReference),f instanceof x==!1)throw new G(t,z.InvalidParameter,a)}else f=c[0]instanceof x?J(c[0].toJSON()):o(new x(JSON.parse(c[0])),t.spatialReference);if(null!==f&&!1===f.spatialReference.equals(t.spatialReference))throw new G(t,z.WrongSpatialReference,a);return s(f)}))},D.multipoint=function(t,a){return C(t,a,((i,l,c)=>{r(c,1,1,t,a);let f=null;if(c[0]instanceof e){if(f=o(n.parseGeometryFromDictionary(c[0]),t.spatialReference),f instanceof P==!1)throw new G(t,z.InvalidParameter,a)}else f=c[0]instanceof P?J(c[0].toJSON()):o(new P(JSON.parse(c[0])),t.spatialReference);if(null!==f&&!1===f.spatialReference.equals(t.spatialReference))throw new G(t,z.WrongSpatialReference,a);return s(f)}))},D.extent=function(t,a){return C(t,a,((i,c,f)=>{f=l(f),r(f,1,1,t,a);let u=null;if(f[0]instanceof e)u=o(n.parseGeometryFromDictionary(f[0]),t.spatialReference);else if(f[0]instanceof x){const e={xmin:f[0].x,ymin:f[0].y,xmax:f[0].x,ymax:f[0].y,spatialReference:f[0].spatialReference.toJSON()},n=f[0];n.hasZ?(e.zmin=n.z,e.zmax=n.z):n.hasM&&(e.mmin=n.m,e.mmax=n.m),u=J(e)}else u=f[0]instanceof b||f[0]instanceof F||f[0]instanceof P?J(f[0].extent?.toJSON()):f[0]instanceof I?J(f[0].toJSON()):o(new I(JSON.parse(f[0])),t.spatialReference);if(null!==u&&!1===u.spatialReference.equals(t.spatialReference))throw new G(t,z.WrongSpatialReference,a);return s(u)}))},D.geometry=function(t,a){return C(t,a,((i,l,c)=>{r(c,1,1,t,a);let f=null;if(null===c[0])return null;if(f=M(c[0])?o(c[0].geometry(),t.spatialReference):c[0]instanceof e?o(n.parseGeometryFromDictionary(c[0]),t.spatialReference):o(J(JSON.parse(c[0])),t.spatialReference),null!==f&&!1===f.spatialReference.equals(t.spatialReference))throw new G(t,z.WrongSpatialReference,a);return s(f)}))},D.setgeometry=function(e,n){return C(e,n,((t,a,i)=>{if(r(i,2,2,e,n),!M(i[0]))throw new G(e,z.InvalidParameter,n);if(!0===i[0].immutable)throw new G(e,z.Immutable,n);if(!(i[1]instanceof v||null===i[1]))throw new G(e,z.InvalidParameter,n);return i[0]._geometry=i[1],c}))},D.feature=function(t,r){return C(t,r,((a,i,s)=>{if(0===s.length)throw new G(t,z.WrongNumberOfParameters,r);let l=null;if(1===s.length)if(f(s[0]))l=n.fromJson(JSON.parse(s[0]));else if(M(s[0]))l=n.createFromArcadeFeature(s[0]);else if(s[0]instanceof v)l=n.createFromGraphicLikeObject(s[0],null,null);else{if(!(s[0]instanceof e))throw new G(t,z.InvalidParameter,r);{let t=s[0].hasField("geometry")?s[0].field("geometry"):null,r=s[0].hasField("attributes")?s[0].field("attributes"):null;null!==t&&t instanceof e&&(t=n.parseGeometryFromDictionary(t)),null!==r&&(r=n.parseAttributesFromDictionary(r)),l=n.createFromGraphicLikeObject(t,r,null)}}else if(2===s.length){let a=null,i=null;if(null!==s[0])if(s[0]instanceof v)a=s[0];else{if(!(a instanceof e))throw new G(t,z.InvalidParameter,r);a=n.parseGeometryFromDictionary(s[0])}if(null!==s[1]){if(!(s[1]instanceof e))throw new G(t,z.InvalidParameter,r);i=n.parseAttributesFromDictionary(s[1])}l=n.createFromGraphicLikeObject(a,i,null)}else{let a=null;const i={};if(null!==s[0])if(s[0]instanceof v)a=s[0];else{if(!(a instanceof e))throw new G(t,z.InvalidParameter,r);a=n.parseGeometryFromDictionary(s[0])}for(let e=1;e<s.length;e+=2){const n=u(s[e]),a=s[e+1];if(!(null==a||f(a)||isNaN(a)||m(a)||h(a)||p(a)))throw new G(t,z.InvalidParameter,r);if(w(a)||!1===d(a))throw new G(t,z.InvalidParameter,r);i[n]=a===c?null:a}l=n.createFromGraphicLikeObject(a,i,null)}return l._geometry=o(l.geometry(),t.spatialReference),l.immutable=!1,l}))},D.dictionary=function(n,t){return C(n,t,((r,o,s)=>{if(0===s.length){const n=new e;return n.immutable=!1,n}if(1===s.length&&f(s[0]))try{const n=JSON.parse(s[0]),t=e.convertObjectToArcadeDictionary(n,!1);return t.immutable=!1,t}catch(y){throw new G(n,z.InvalidParameter,t)}if(s.length%2!=0)throw new G(n,z.WrongNumberOfParameters,t);const l={};for(let e=0;e<s.length;e+=2){const r=u(s[e]),o=s[e+1];if(!(null==o||f(o)||isNaN(o)||m(o)||h(o)||p(o)||a(o)||i(o)))throw new G(n,z.InvalidParameter,t);if(w(o))throw new G(n,z.InvalidParameter,t);l[r]=o===c?null:o}const d=new e(l);return d.immutable=!1,d}))},D.haskey=function(n,t){return C(n,t,((a,i,o)=>{r(o,2,2,n,t);const s=u(o[1]);if(M(o[0]))return o[0].hasField(s);if(o[0]instanceof e)return o[0].hasField(s);throw new G(n,z.InvalidParameter,t)}))},D.hasvalue=function(n,t){return C(n,t,((a,i,o)=>{if(r(o,2,2,n,t),null===o[0]||null===o[1])return!1;const s=u(o[1]);if(y(o[0]))return!!o[0].hasField(s)&&null!==o[0].field(s);if(o[0]instanceof e)return!!o[0].hasField(s)&&null!==o[0].field(s);if(o[0]instanceof v){return null!==W(o[0],s,null,null,!1)}return!1}))},D.indexof=function(e,n){return C(e,n,((t,o,s)=>{r(s,2,2,e,n);const l=s[1];if(a(s[0])){for(let e=0;e<s[0].length;e++)if(g(l,s[0][e]))return e;return-1}if(i(s[0])){const e=s[0].length();for(let n=0;n<e;n++)if(g(l,s[0].get(n)))return n;return-1}throw new G(e,z.InvalidParameter,n)}))},D.angle=function(e,n){return C(e,n,((t,a,i)=>{if(i=l(i),r(i,2,3,e,n),!(i[0]instanceof x))throw new G(e,z.InvalidParameter,n);if(!(i[1]instanceof x))throw new G(e,z.InvalidParameter,n);if(i.length>2&&!(i[2]instanceof x))throw new G(e,z.InvalidParameter,n);return 2===i.length?j(i[0],i[1]):O(i[0],i[1],i[2])}))},D.bearing=function(e,n){return C(e,n,((t,a,i)=>{if(i=l(i),r(i,2,3,e,n),!(i[0]instanceof x))throw new G(e,z.InvalidParameter,n);if(!(i[1]instanceof x))throw new G(e,z.InvalidParameter,n);if(i.length>2&&!(i[2]instanceof x))throw new G(e,z.InvalidParameter,n);return 2===i.length?S(i[0],i[1]):N(i[0],i[1],i[2])}))},D.isselfintersecting=function(e,n){return C(e,n,((t,o,s)=>{s=l(s),r(s,1,1,e,n);let c=s[0];if(c instanceof b)return c.isSelfIntersecting;if(c instanceof F)return c=c.paths,k(c);if(c instanceof P){const e=c.points;for(let n=0;n<e.length;n++)for(let t=0;t<e.length;t++)if(t!==n){let r=!0;for(let a=0;a<e[n].length;a++)if(e[n][a]!==e[t][a]){r=!1;break}if(!0===r)return!0}}return!(!a(c)&&!i(c))&&(c=R(c,e.spatialReference),null!==c&&(c=c.paths),k(c))}))}}let Z=0;function W(n,r,a,i,o=!0){let s;switch(r=r.toLowerCase()){case"hasz":{const e=n.hasZ;return void 0!==e&&e}case"hasm":{const e=n.hasM;return void 0!==e&&e}case"spatialreference":{let t=n.spatialReference._arcadeCacheId;if(void 0===t){let e=!0;Object.freeze&&Object.isFrozen(n.spatialReference)&&(e=!1),e&&(Z++,n.spatialReference._arcadeCacheId=Z,t=Z)}const r=new e({wkt:n.spatialReference.wkt,wkid:n.spatialReference.wkid});return void 0!==t&&(r._arcadeCacheId="SPREF"+t.toString()),r}}switch(n.type){case"extent":switch(r){case"xmin":case"xmax":case"ymin":case"ymax":case"zmin":case"zmax":case"mmin":case"mmax":{const e=n[r];return void 0!==e?e:null}case"type":return"Extent"}break;case"polygon":switch(r){case"rings":s=n.cache._arcadeCacheId,void 0===s&&(Z++,s=Z,n.cache._arcadeCacheId=s);return new D(n.rings,n.spatialReference,!0===n.hasZ,!0===n.hasM,s);case"type":return"Polygon"}break;case"point":switch(r){case"x":case"y":case"z":case"m":return void 0!==n[r]?n[r]:null;case"type":return"Point"}break;case"polyline":switch(r){case"paths":s=n.cache._arcadeCacheId,void 0===s&&(Z++,s=Z,n.cache._arcadeCacheId=s);return new D(n.paths,n.spatialReference,!0===n.hasZ,!0===n.hasM,s);case"type":return"Polyline"}break;case"multipoint":switch(r){case"points":s=n.cache._arcadeCacheId,void 0===s&&(Z++,s=Z,n.cache._arcadeCacheId=s);return new t(n.points,n.spatialReference,!0===n.hasZ,!0===n.hasM,s,1);case"type":return"Multipoint"}}if(o)throw new G(a,z.InvalidIdentifier,i);return null}export{W as geometryMember,C as registerFunctions};
5
+ import e from"../Dictionary.js";import n from"../Feature.js";import t from"../ImmutablePointArray.js";import{y as r,m as a,x as i,q as o,F as s,G as l,v as c,c as f,j as u,k as m,b as h,a as p,i as w,f as d,w as y,s as g,H as R}from"../../chunks/languageUtils.js";import I from"../../geometry/Extent.js";import v from"../../geometry/Geometry.js";import P from"../../geometry/Multipoint.js";import x from"../../geometry/Point.js";import b from"../../geometry/Polygon.js";import F from"../../geometry/Polyline.js";import{angle2D as j,angleBetween2D as O,bearing2D as S,bearingBetween2D as N,pathsSelfIntersecting as k}from"./centroid.js";import{fromJSON as J}from"../../geometry/support/jsonUtils.js";import{ArcadeExecutionError as G,ExecutionErrorCodes as z}from"../executionError.js";import D from"../ImmutablePathArray.js";import{isClockwise as _}from"../../geometry/support/coordsUtils.js";function M(e){return e&&"esri.arcade.Feature"===e.arcadeDeclaredClass}function C(D,C){D.ringisclockwise=function(e,n){return C(e,n,((o,s,l)=>{r(l,1,1,e,n);let c=[],f=!1,u=!1;if(null===l[0])return!1;if(a(l[0])){for(const t of l[0]){if(!(t instanceof x))throw new G(e,z.InvalidParameter,n);c.push(t.hasZ?t.hasM?[t.x,t.y,t.z,t.m]:[t.x,t.y,t.z]:[t.x,t.y])}c.length>0&&(f=l[0][0].hasZ,u=l[0][0].hasM)}else if(l[0]instanceof t)c=l[0]._elements,c.length>0&&(f=l[0]._hasZ,u=l[0]._hasM);else{if(!i(l[0]))throw new G(e,z.InvalidParameter,n);for(const t of l[0].toArray()){if(!(t instanceof x))throw new G(e,z.InvalidParameter,n);c.push(t.hasZ?t.hasM?[t.x,t.y,t.z,t.m]:[t.x,t.y,t.z]:[t.x,t.y])}c.length>0&&(f=l[0].get(0).hasZ,u=l[0].get(0).hasM)}return!(c.length<3)&&_(c,u,f)}))},D.polygon=function(t,a){return C(t,a,((i,l,c)=>{r(c,1,1,t,a);let f=null;if(c[0]instanceof e){if(f=o(n.parseGeometryFromDictionary(c[0]),t.spatialReference),f instanceof b==!1)throw new G(t,z.InvalidParameter,a)}else f=c[0]instanceof b?J(c[0].toJSON()):o(new b(JSON.parse(c[0])),t.spatialReference);if(null!==f&&!1===f.spatialReference.equals(t.spatialReference))throw new G(t,z.WrongSpatialReference,a);return s(f)}))},D.polyline=function(t,a){return C(t,a,((i,l,c)=>{r(c,1,1,t,a);let f=null;if(c[0]instanceof e){if(f=o(n.parseGeometryFromDictionary(c[0]),t.spatialReference),f instanceof F==!1)throw new G(t,z.InvalidParameter,a)}else f=c[0]instanceof F?J(c[0].toJSON()):o(new F(JSON.parse(c[0])),t.spatialReference);if(null!==f&&!1===f.spatialReference.equals(t.spatialReference))throw new G(t,z.WrongSpatialReference,a);return s(f)}))},D.point=function(t,a){return C(t,a,((i,l,c)=>{r(c,1,1,t,a);let f=null;if(c[0]instanceof e){if(f=o(n.parseGeometryFromDictionary(c[0]),t.spatialReference),f instanceof x==!1)throw new G(t,z.InvalidParameter,a)}else f=c[0]instanceof x?J(c[0].toJSON()):o(new x(JSON.parse(c[0])),t.spatialReference);if(null!==f&&!1===f.spatialReference.equals(t.spatialReference))throw new G(t,z.WrongSpatialReference,a);return s(f)}))},D.multipoint=function(t,a){return C(t,a,((i,l,c)=>{r(c,1,1,t,a);let f=null;if(c[0]instanceof e){if(f=o(n.parseGeometryFromDictionary(c[0]),t.spatialReference),f instanceof P==!1)throw new G(t,z.InvalidParameter,a)}else f=c[0]instanceof P?J(c[0].toJSON()):o(new P(JSON.parse(c[0])),t.spatialReference);if(null!==f&&!1===f.spatialReference.equals(t.spatialReference))throw new G(t,z.WrongSpatialReference,a);return s(f)}))},D.extent=function(t,a){return C(t,a,((i,c,f)=>{f=l(f),r(f,1,1,t,a);let u=null;if(f[0]instanceof e)u=o(n.parseGeometryFromDictionary(f[0]),t.spatialReference);else if(f[0]instanceof x){const e={xmin:f[0].x,ymin:f[0].y,xmax:f[0].x,ymax:f[0].y,spatialReference:f[0].spatialReference.toJSON()},n=f[0];n.hasZ?(e.zmin=n.z,e.zmax=n.z):n.hasM&&(e.mmin=n.m,e.mmax=n.m),u=J(e)}else u=f[0]instanceof b||f[0]instanceof F||f[0]instanceof P?J(f[0].extent?.toJSON()):f[0]instanceof I?J(f[0].toJSON()):o(new I(JSON.parse(f[0])),t.spatialReference);if(null!==u&&!1===u.spatialReference.equals(t.spatialReference))throw new G(t,z.WrongSpatialReference,a);return s(u)}))},D.geometry=function(t,a){return C(t,a,((i,l,c)=>{r(c,1,1,t,a);let f=null;if(null===c[0])return null;if(f=M(c[0])?o(c[0].geometry(),t.spatialReference):c[0]instanceof e?o(n.parseGeometryFromDictionary(c[0]),t.spatialReference):o(J(JSON.parse(c[0])),t.spatialReference),null!==f&&!1===f.spatialReference.equals(t.spatialReference))throw new G(t,z.WrongSpatialReference,a);return s(f)}))},D.setgeometry=function(e,n){return C(e,n,((t,a,i)=>{if(r(i,2,2,e,n),!M(i[0]))throw new G(e,z.InvalidParameter,n);if(!0===i[0].immutable)throw new G(e,z.Immutable,n);if(!(i[1]instanceof v||null===i[1]))throw new G(e,z.InvalidParameter,n);return i[0]._geometry=i[1],c}))},D.feature=function(t,r){return C(t,r,((a,i,s)=>{if(0===s.length)throw new G(t,z.WrongNumberOfParameters,r);let l=null;if(1===s.length)if(f(s[0]))l=n.fromJson(JSON.parse(s[0]));else if(M(s[0]))l=n.createFromArcadeFeature(s[0]);else if(s[0]instanceof v)l=n.createFromGraphicLikeObject(s[0],null,null);else{if(!(s[0]instanceof e))throw new G(t,z.InvalidParameter,r);{let t=s[0].hasField("geometry")?s[0].field("geometry"):null,r=s[0].hasField("attributes")?s[0].field("attributes"):null;null!==t&&t instanceof e&&(t=n.parseGeometryFromDictionary(t)),null!==r&&(r=n.parseAttributesFromDictionary(r)),l=n.createFromGraphicLikeObject(t,r,null)}}else if(2===s.length){let a=null,i=null;if(null!==s[0])if(s[0]instanceof v)a=s[0];else{if(!(a instanceof e))throw new G(t,z.InvalidParameter,r);a=n.parseGeometryFromDictionary(s[0])}if(null!==s[1]){if(!(s[1]instanceof e))throw new G(t,z.InvalidParameter,r);i=n.parseAttributesFromDictionary(s[1])}l=n.createFromGraphicLikeObject(a,i,null)}else{let a=null;const i={};if(null!==s[0])if(s[0]instanceof v)a=s[0];else{if(!(a instanceof e))throw new G(t,z.InvalidParameter,r);a=n.parseGeometryFromDictionary(s[0])}for(let e=1;e<s.length;e+=2){const n=u(s[e]),a=s[e+1];if(!(null==a||f(a)||isNaN(a)||m(a)||h(a)||p(a)))throw new G(t,z.InvalidParameter,r);if(w(a)||!1===d(a))throw new G(t,z.InvalidParameter,r);i[n]=a===c?null:a}l=n.createFromGraphicLikeObject(a,i,null)}return l._geometry=o(l.geometry(),t.spatialReference),l.immutable=!1,l}))},D.dictionary=function(n,t){return C(n,t,((r,o,s)=>{if(0===s.length){const n=new e;return n.immutable=!1,n}if(1===s.length&&f(s[0]))try{const n=JSON.parse(s[0]),t=e.convertObjectToArcadeDictionary(n,!1);return t.immutable=!1,t}catch(y){throw new G(n,z.InvalidParameter,t)}if(s.length%2!=0)throw new G(n,z.WrongNumberOfParameters,t);const l={};for(let e=0;e<s.length;e+=2){const r=u(s[e]),o=s[e+1];if(!(null==o||f(o)||isNaN(o)||m(o)||h(o)||p(o)||a(o)||i(o)))throw new G(n,z.InvalidParameter,t);if(w(o))throw new G(n,z.InvalidParameter,t);l[r]=o===c?null:o}const d=new e(l);return d.immutable=!1,d}))},D.haskey=function(n,t){return C(n,t,((a,i,o)=>{r(o,2,2,n,t);const s=u(o[1]);if(M(o[0]))return o[0].hasField(s);if(o[0]instanceof e)return o[0].hasField(s);if(o[0]instanceof v){const e=W(o[0],s,null,null,2);return!e||"notfound"!==e.keystate}throw new G(n,z.InvalidParameter,t)}))},D.hasvalue=function(n,t){return C(n,t,((a,i,o)=>{if(r(o,2,2,n,t),null===o[0]||null===o[1])return!1;const s=u(o[1]);if(y(o[0]))return!!o[0].hasField(s)&&null!==o[0].field(s);if(o[0]instanceof e)return!!o[0].hasField(s)&&null!==o[0].field(s);if(o[0]instanceof v){return null!==W(o[0],s,null,null,0)}return!1}))},D.indexof=function(e,n){return C(e,n,((t,o,s)=>{r(s,2,2,e,n);const l=s[1];if(a(s[0])){for(let e=0;e<s[0].length;e++)if(g(l,s[0][e]))return e;return-1}if(i(s[0])){const e=s[0].length();for(let n=0;n<e;n++)if(g(l,s[0].get(n)))return n;return-1}throw new G(e,z.InvalidParameter,n)}))},D.angle=function(e,n){return C(e,n,((t,a,i)=>{if(i=l(i),r(i,2,3,e,n),!(i[0]instanceof x))throw new G(e,z.InvalidParameter,n);if(!(i[1]instanceof x))throw new G(e,z.InvalidParameter,n);if(i.length>2&&!(i[2]instanceof x))throw new G(e,z.InvalidParameter,n);return 2===i.length?j(i[0],i[1]):O(i[0],i[1],i[2])}))},D.bearing=function(e,n){return C(e,n,((t,a,i)=>{if(i=l(i),r(i,2,3,e,n),!(i[0]instanceof x))throw new G(e,z.InvalidParameter,n);if(!(i[1]instanceof x))throw new G(e,z.InvalidParameter,n);if(i.length>2&&!(i[2]instanceof x))throw new G(e,z.InvalidParameter,n);return 2===i.length?S(i[0],i[1]):N(i[0],i[1],i[2])}))},D.isselfintersecting=function(e,n){return C(e,n,((t,o,s)=>{s=l(s),r(s,1,1,e,n);let c=s[0];if(c instanceof b)return c.isSelfIntersecting;if(c instanceof F)return c=c.paths,k(c);if(c instanceof P){const e=c.points;for(let n=0;n<e.length;n++)for(let t=0;t<e.length;t++)if(t!==n){let r=!0;for(let a=0;a<e[n].length;a++)if(e[n][a]!==e[t][a]){r=!1;break}if(!0===r)return!0}}return!(!a(c)&&!i(c))&&(c=R(c,e.spatialReference),null!==c&&(c=c.paths),k(c))}))}}let Z=0;function W(n,r,a,i,o=1){let s;switch(r=r.toLowerCase()){case"hasz":{const e=n.hasZ;return void 0!==e&&e}case"hasm":{const e=n.hasM;return void 0!==e&&e}case"spatialreference":{let t=n.spatialReference._arcadeCacheId;if(void 0===t){let e=!0;Object.freeze&&Object.isFrozen(n.spatialReference)&&(e=!1),e&&(Z++,n.spatialReference._arcadeCacheId=Z,t=Z)}const r=new e({wkt:n.spatialReference.wkt,wkid:n.spatialReference.wkid});return void 0!==t&&(r._arcadeCacheId="SPREF"+t.toString()),r}}switch(n.type){case"extent":switch(r){case"xmin":case"xmax":case"ymin":case"ymax":case"zmin":case"zmax":case"mmin":case"mmax":{const e=n[r];return void 0!==e?e:null}case"type":return"Extent"}break;case"polygon":switch(r){case"rings":s=n.cache._arcadeCacheId,void 0===s&&(Z++,s=Z,n.cache._arcadeCacheId=s);return new D(n.rings,n.spatialReference,!0===n.hasZ,!0===n.hasM,s);case"type":return"Polygon"}break;case"point":switch(r){case"x":case"y":case"z":case"m":return void 0!==n[r]?n[r]:null;case"type":return"Point"}break;case"polyline":switch(r){case"paths":s=n.cache._arcadeCacheId,void 0===s&&(Z++,s=Z,n.cache._arcadeCacheId=s);return new D(n.paths,n.spatialReference,!0===n.hasZ,!0===n.hasM,s);case"type":return"Polyline"}break;case"multipoint":switch(r){case"points":s=n.cache._arcadeCacheId,void 0===s&&(Z++,s=Z,n.cache._arcadeCacheId=s);return new t(n.points,n.spatialReference,!0===n.hasZ,!0===n.hasM,s,1);case"type":return"Multipoint"}}if(1===o)throw new G(a,z.InvalidIdentifier,i);return 2===o?{keystate:"notfound"}:null}export{W as geometryMember,C as registerFunctions};
@@ -1 +1 @@
1
- var RemoteClient;(()=>{var e={88277:(e,t,n)=>{n.p=self.esriConfig.assetsPath+"/esri/core/workers/"},68773:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s}),n(80442);var r=n(78286),o=n(17202);const s={analysisTheme:{accentColor:[255,128,0],textColor:"white"},apiKey:void 0,applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",portalUrl:"https://www.arcgis.com",routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&((0,r.RH)(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="4.25.0";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}-next.${o.r}/assets`}s.defaultAssetsPath=s.assetsPath}},20102:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(22974),o=n(92604),s=n(58896);class i extends s.Z{constructor(e,t,n){if(super(e,t,n),!(this instanceof i))return new i(e,t,n)}toJSON(){if(null!=this.details)try{return{name:this.name,message:this.message,details:JSON.parse(JSON.stringify(this.details,((e,t)=>{if(t&&"object"==typeof t&&"function"==typeof t.toJSON)return t;try{return(0,r.d9)(t)}catch(e){return"[object]"}})))}}catch(e){throw o.Z.getLogger("esri.core.Error").error(e),e}return{name:this.name,message:this.message,details:this.details}}static fromJSON(e){return new i(e.name,e.message,e.details)}}i.prototype.type="error"},92604:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(68773),o=(n(80442),n(70586)),s=n(19153);const i={info:0,warn:1,error:2,none:3};class a{constructor(e){this.level=null,this._module="",this._parent=null,this.writer=null,this._loggedMessages={error:new Map,warn:new Map,info:new Map},null!=e.level&&(this.level=e.level),null!=e.writer&&(this.writer=e.writer),this._module=e.module,a._loggers[this.module]=this;const t=this.module.lastIndexOf(".");-1!==t&&(this._parent=a.getLogger(this.module.slice(0,t)))}get module(){return this._module}get parent(){return this._parent}error(...e){this._log("error","always",...e)}warn(...e){this._log("warn","always",...e)}info(...e){this._log("info","always",...e)}errorOnce(...e){this._log("error","once",...e)}warnOnce(...e){this._log("warn","once",...e)}infoOnce(...e){this._log("info","once",...e)}errorOncePerTick(...e){this._log("error","oncePerTick",...e)}warnOncePerTick(...e){this._log("warn","oncePerTick",...e)}infoOncePerTick(...e){this._log("info","oncePerTick",...e)}get test(){const e=this;return{loggedMessages:e._loggedMessages,clearLoggedWarnings:()=>e._loggedMessages.warn.clear()}}static get testSingleton(){return{resetLoggers(e={}){const t=a._loggers;return a._loggers=e,t},set throttlingDisabled(e){a._throttlingDisabled=e}}}static getLogger(e){let t=a._loggers[e];return t||(t=new a({module:e})),t}_log(e,t,...n){if(this._matchLevel(e)){if("always"!==t&&!a._throttlingDisabled){const r=this._argsToKey(n),o=this._loggedMessages[e].get(r);if("once"===t&&null!=o||"oncePerTick"===t&&o&&o>=a._tickCounter)return;this._loggedMessages[e].set(r,a._tickCounter),a._scheduleTickCounterIncrement()}for(const t of r.Z.log.interceptors)if(t(e,this.module,...n))return;this._inheritedWriter()(e,this.module,...n)}}_parentWithMember(e,t){let n=this;for(;(0,o.pC)(n);){const t=n[e];if((0,o.pC)(t))return t;n=n.parent}return t}_inheritedWriter(){return this._parentWithMember("writer",this._consoleWriter)}_consoleWriter(e,t,...n){console[e](`[${t}]`,...n)}_matchLevel(e){const t=r.Z.log.level?r.Z.log.level:"warn";return i[this._parentWithMember("level",t)]<=i[e]}_argsToKey(...e){return(0,s.hP)(JSON.stringify(e,((e,t)=>"object"!=typeof t||Array.isArray(t)?t:"[Object]")))}static _scheduleTickCounterIncrement(){a._tickCounterScheduled||(a._tickCounterScheduled=!0,Promise.resolve().then((()=>{a._tickCounter++,a._tickCounterScheduled=!1})))}}a._loggers={},a._tickCounter=0,a._tickCounterScheduled=!1,a._throttlingDisabled=!1},58896:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(78286);class o{constructor(e,t,n){this.name=e,this.details=n,this instanceof o&&(this.message=(t&&function(e,t){return e.replace(/\$\{([^\s\:\}]*)(?:\:([^\s\:\}]+))?\}/g,((e,n)=>{if(""===n)return"$";const o=(0,r.hS)(n,t)??"";if(void 0===o)throw new Error(`could not find key "${n}" in template`);return o.toString()}))}(t,n))??"")}toString(){return"["+this.name+"]: "+this.message}}},77734:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});class r{constructor(e=1){this._seed=e}set seed(e){this._seed=e??Math.random()*r._m}getInt(){return this._seed=(r._a*this._seed+r._c)%r._m,this._seed}getFloat(){return this.getInt()/(r._m-1)}getIntRange(e,t){return Math.round(this.getFloatRange(e,t))}getFloatRange(e,t){const n=t-e;return e+this.getInt()/r._m*n}}r._m=2147483647,r._a=48271,r._c=0},67676:(e,t,n)=>{"use strict";n.d(t,{FY:()=>m,Od:()=>y,SO:()=>d,Vx:()=>i,a9:()=>u,cq:()=>p,e$:()=>b,e5:()=>a,fS:()=>s,w6:()=>f,zG:()=>c});var r=n(70586),o=n(77734);function s(e,t,n){if((0,r.Wi)(e)&&(0,r.Wi)(t))return!0;if((0,r.Wi)(e)||(0,r.Wi)(t)||e.length!==t.length)return!1;if(n){for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1}else for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function i(e,t){let n=e.length!==t.length;n&&(e.length=t.length);for(let r=0;r<t.length;++r)e[r]!==t[r]&&(e[r]=t[r],n=!0);return n}function a(e,t,n){let r,o;return n?(r=t.filter((t=>!e.some((e=>n(e,t))))),o=e.filter((e=>!t.some((t=>n(t,e)))))):(r=t.filter((t=>!e.includes(t))),o=e.filter((e=>!t.includes(e)))),{added:r,removed:o}}function c(e){return e&&"number"==typeof e.length}const l=!!Array.prototype.fill;function u(e,t){if(l)return new Array(e).fill(t);const n=new Array(e);for(let r=0;r<e;r++)n[r]=t;return n}function f(e,t){void 0===t&&(t=e,e=0);const n=new Array(t-e);for(let r=e;r<t;r++)n[r-e]=r;return n}class d{constructor(){this.last=0}}const h=new d;function p(e,t,n,r){r=r||h;const o=Math.max(0,r.last-10);for(let s=o;s<n;++s)if(e[s]===t)return r.last=s,s;const s=Math.min(o,n);for(let n=0;n<s;++n)if(e[n]===t)return r.last=n,n;return-1}function b(e,t,n,r){const o=n??e.length,s=p(e,t,o,r);if(-1!==s)return e[s]=e[o-1],null==n&&e.pop(),t}const g=new Set;function m(e,t,n=e.length,r=t.length,o,s){if(0===r||0===n)return n;g.clear();for(let e=0;e<r;++e)g.add(t[e]);o=o||h;const i=Math.max(0,o.last-10);for(let t=i;t<n;++t)if(g.has(e[t])&&(s&&s.push(e[t]),g.delete(e[t]),e[t]=e[n-1],--n,--t,0===g.size||0===n))return g.clear(),n;for(let t=0;t<i;++t)if(g.has(e[t])&&(s&&s.push(e[t]),g.delete(e[t]),e[t]=e[n-1],--n,--t,0===g.size||0===n))return g.clear(),n;return g.clear(),n}function y(e,t){const n=e.indexOf(t);return-1!==n?(e.splice(n,1),t):null}new o.Z},60235:(e,t,n)=>{"use strict";n.d(t,{Mr:()=>i,x9:()=>a});var r=n(80442);const o=new Set;function s(e,t,n=!1){n&&o.has(t)||(n&&o.add(t),e.warn(`🛑 DEPRECATED - ${t}`))}function i(e,t,n={}){if((0,r.Z)("esri-deprecation-warnings")){const{moduleName:r}=n;a(e,"Property: "+(r?r+"::":"")+t,n)}}function a(e,t,n={}){if((0,r.Z)("esri-deprecation-warnings")){const{replacement:r,version:o,see:i,warnOnce:a}=n;let c=t;r&&(c+=`\n\t🛠️ Replacement: ${r}`),o&&(c+=`\n\t⚙️ Version: ${o}`),i&&(c+=`\n\t🔗 See ${i} for more details.`),s(e,c,a)}}},91460:(e,t,n)=>{"use strict";function r(e){return e&&("function"==typeof e.on||"function"==typeof e.addEventListener)}function o(e,t,n){if(!r(e))throw new TypeError("target is not a Evented or EventTarget object");if("on"in e)return e.on(t,n);if(Array.isArray(t)){const r=t.slice();for(const t of r)e.addEventListener(t,n);return{remove(){for(const t of r)e.removeEventListener(t,n)}}}return e.addEventListener(t,n),{remove(){e.removeEventListener(t,n)}}}function s(e,t,n){if(!r(e))throw new TypeError("target is not a Evented or EventTarget object");if("once"in e)return e.once(t,n);const s=o(e,t,(t=>{s.remove(),n.call(e,t)}));return{remove(){s.remove()}}}n.d(t,{IH:()=>s,on:()=>o,vT:()=>r})},80442:(e,t,n)=>{"use strict";let r;function o(e){return"function"==typeof r[e]?r[e]=r[e](globalThis):r[e]}n.d(t,{Z:()=>o}),r=globalThis.dojoConfig?.has||globalThis.esriConfig?.has?{...globalThis.dojoConfig?.has,...globalThis.esriConfig?.has}:{},o.add=(e,t,n,s)=>((s||void 0===r[e])&&(r[e]=t),n&&o(e)),o.cache=r,o.add("esri-deprecation-warnings",!0),(()=>{o.add("host-webworker",void 0!==globalThis.WorkerGlobalScope&&self instanceof globalThis.WorkerGlobalScope);const e="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(o.add("host-browser",e),o.add("host-node","object"==typeof globalThis.process&&globalThis.process.versions?.node&&globalThis.process.versions.v8),o.add("dom",e),o("host-browser")){const e=navigator,t=e.userAgent,n=e.appVersion,r=parseFloat(n);if(o.add("wp",parseFloat(t.split("Windows Phone")[1])||void 0),o.add("msapp",parseFloat(t.split("MSAppHost/")[1])||void 0),o.add("khtml",n.includes("Konqueror")?r:void 0),o.add("edge",parseFloat(t.split("Edge/")[1])||void 0),o.add("opr",parseFloat(t.split("OPR/")[1])||void 0),o.add("webkit",!o("wp")&&!o("edge")&&parseFloat(t.split("WebKit/")[1])||void 0),o.add("chrome",!o("edge")&&!o("opr")&&parseFloat(t.split("Chrome/")[1])||void 0),o.add("android",!o("wp")&&parseFloat(t.split("Android ")[1])||void 0),o.add("safari",!n.includes("Safari")||o("wp")||o("chrome")||o("android")||o("edge")||o("opr")?void 0:parseFloat(n.split("Version/")[1])),o.add("mac",n.includes("Macintosh")),!o("wp")&&t.match(/(iPhone|iPod|iPad)/)){const e=RegExp.$1.replace(/P/,"p"),n=t.match(/OS ([\d_]+)/)?RegExp.$1:"1",r=parseFloat(n.replace(/_/,".").replace(/_/g,""));o.add(e,r),o.add("ios",r)}o.add("trident",parseFloat(n.split("Trident/")[1])||void 0),o("webkit")||(!t.includes("Gecko")||o("wp")||o("khtml")||o("trident")||o("edge")||o.add("mozilla",r),o("mozilla")&&o.add("ff",parseFloat(t.split("Firefox/")[1]||t.split("Minefield/")[1])||void 0))}})(),(()=>{if(globalThis.navigator){const e=navigator.userAgent,t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),n=/iPhone/i.test(e);t&&o.add("esri-mobile",t),n&&o.add("esri-iPhone",n),o.add("esri-geolocation",!!navigator.geolocation)}o.add("esri-canvas-svg-support",!o("trident")),o.add("esri-wasm","WebAssembly"in globalThis),o.add("esri-shared-array-buffer",(()=>{const e="SharedArrayBuffer"in globalThis,t=!1===globalThis.crossOriginIsolated;return e&&!t})),o.add("wasm-simd",(()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])))),o.add("esri-atomics","Atomics"in globalThis),o.add("esri-workers","Worker"in globalThis),o.add("web-feat:cache","caches"in globalThis),o.add("esri-workers-arraybuffer-transfer",!o("safari")||Number(o("safari"))>=12),o.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),o.add("featurelayer-simplify-payload-size-factors",[1,1,4]),o.add("featurelayer-snapshot-enabled",!0),o.add("featurelayer-snapshot-point-min-threshold",8e4),o.add("featurelayer-snapshot-point-max-threshold",4e5),o.add("featurelayer-snapshot-point-coverage",.1),o.add("featurelayer-advanced-symbols",!1),o.add("featurelayer-pbf",!0),o.add("featurelayer-pbf-statistics",!1),o.add("feature-layers-workers",!0),o.add("feature-polyline-generalization-factor",1),o.add("mapview-transitions-duration",200),o.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),o.add("mapserver-pbf-enabled",!1),o.add("mapimagelayer-popup-identify-max-tolerance",20),o.add("heatmap-allow-raster-fallback",!0),o.add("heatmap-force-raster",!1),o("host-webworker")||o("host-browser")&&(o.add("esri-csp-restrictions",(()=>{try{new Function}catch{return!0}return!1})),o.add("esri-image-decode",(()=>{if("decode"in new Image){const e=new Image;return e.src='data:image/svg+xml;charset=UTF-8,<svg version="1.1" xmlns="http://www.w3.org/2000/svg"></svg>',void e.decode().then((()=>{o.add("esri-image-decode",!0,!0,!0)})).catch((()=>{o.add("esri-image-decode",!1,!0,!0)}))}return!1})),o.add("esri-url-encodes-apostrophe",(()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")})))})()},22974:(e,t,n)=>{"use strict";n.d(t,{Vo:()=>c,d9:()=>a,fS:()=>p,y7:()=>b,yd:()=>i});var r=n(67676),o=(n(80442),n(70586)),s=n(1533);function i(e,t){let n;if(t)for(n in e)e.hasOwnProperty(n)&&(void 0===e[n]?delete e[n]:e[n]instanceof Object&&i(e[n],!0));else for(n in e)e.hasOwnProperty(n)&&void 0===e[n]&&delete e[n];return e}function a(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=h(e);if((0,o.pC)(t))return t;if(l(e))return e.clone();if(u(e))return e.map(a);if(f(e))return e.clone();const n={};for(const t of Object.getOwnPropertyNames(e))n[t]=a(e[t]);return n}function c(e){if(!e||"object"!=typeof e||"function"==typeof e||e instanceof HTMLElement)return e;const t=h(e);if((0,o.pC)(t))return t;if(u(e)){let t=!0;const n=e.map((e=>{const n=c(e);return null!=e&&null==n&&(t=!1),n}));return t?n:null}if(l(e))return e.clone();if(!f(e)){const t=new(0,Object.getPrototypeOf(e).constructor);for(const n of Object.getOwnPropertyNames(e)){const r=e[n],o=c(r);if(null!=r&&null==o)return null;t[n]=o}return t}return null}function l(e){return"function"==typeof e.clone}function u(e){return"function"==typeof e.map&&"function"==typeof e.forEach}function f(e){return"function"==typeof e.notifyChange&&"function"==typeof e.watch}function d(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function h(e){if((0,s.W0)(e)||(0,s.lq)(e)||(0,s.KZ)(e)||(0,s.z3)(e)||(0,s.Uc)(e)||(0,s.Hx)(e)||(0,s.ZY)(e)||(0,s.xZ)(e)||(0,s.fS)(e))return(0,s.tP)(e);if(e instanceof Date)return new Date(e.getTime());if(e instanceof ArrayBuffer)return e.slice(0,e.byteLength);if(e instanceof Map){const t=new Map;for(const[n,r]of e)t.set(n,a(r));return t}if(e instanceof Set){const t=new Set;for(const n of e)t.add(a(n));return t}return null}function p(e,t){return e===t||"number"==typeof e&&isNaN(e)&&"number"==typeof t&&isNaN(t)||"function"==typeof(e||{}).getTime&&"function"==typeof(t||{}).getTime&&e.getTime()===t.getTime()||!1}function b(e,t){return e===t||(null==e||"string"==typeof e?e===t:"number"==typeof e?e===t||"number"==typeof t&&isNaN(e)&&isNaN(t):e instanceof Date?t instanceof Date&&e.getTime()===t.getTime():Array.isArray(e)?Array.isArray(t)&&(0,r.fS)(e,t):e instanceof Set?t instanceof Set&&function(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}(e,t):e instanceof Map?t instanceof Map&&function(e,t){if(e.size!==t.size)return!1;for(const[n,r]of e){const e=t.get(n);if(e!==r||void 0===e&&!t.has(n))return!1}return!0}(e,t):!!d(e)&&d(t)&&function(e,t){if(null===e||null===t)return!1;const n=Object.keys(e);if(null===t||Object.keys(t).length!==n.length)return!1;for(const r of n)if(e[r]!==t[r]||!Object.prototype.hasOwnProperty.call(t,r))return!1;return!0}(e,t))}},70586:(e,t,n)=>{"use strict";function r(e){return null!=e}function o(e){return null==e}function s(e,t){return r(e)?t(e):null}function i(e){return e}function a(e,t){return c(e,t),e}function c(e,t){if(o(e))throw new Error(t??"value is None")}function l(e,t){return r(e)?e:"function"==typeof t?t():t}function u(e,t){return r(e)?e:t}function f(e){return r(e)&&e.destroy(),null}function d(e){return r(e)&&e.dispose(),null}function h(e){return r(e)&&e.remove(),null}function p(e){return r(e)&&e.abort(),null}function b(e){return r(e)&&e.release(),null}function g(e,t,n){return r(e)&&r(t)?r(n)?n(e,t):e.equals(t):e===t}function m(e){return null}function y(e,t){const n=new Array;for(const r of e)n.push(v(r,null,t));return n}function w(e,t){for(const n of e)s(n,t)}function v(e,t,n){return r(e)?n(e):t}function _(e){return e.filter((e=>r(e)))}function O(e,...t){let n=e;for(let e=0;e<t.length&&n;++e)n=n[t[e]];return n}function k(e){return e}n.d(t,{Fd:()=>y,IM:()=>p,JR:()=>w,M2:()=>d,O3:()=>c,Pt:()=>l,R2:()=>v,RY:()=>b,SC:()=>f,U2:()=>O,Wg:()=>i,Wi:()=>o,_W:()=>g,hw:()=>h,j0:()=>k,lV:()=>_,pC:()=>r,s3:()=>a,wN:()=>m,yl:()=>u,yw:()=>s})},78286:(e,t,n)=>{"use strict";n.d(t,{RB:()=>i,RH:()=>o,hS:()=>s});var r=n(22974);function o(e,t,n=!1){return c(e,t,n)}function s(e,t){if(null!=t)return t[e]||a(e.split("."),!1,t)}function i(e,t,n){const r=e.split("."),o=r.pop(),s=a(r,!0,n);s&&o&&(s[o]=t)}function a(e,t,n){let r=n;for(const n of e){if(null==r)return;if(!(n in r)){if(!t)return;r[n]={}}r=r[n]}return r}function c(e,t,n){return t?Object.keys(t).reduce(((e,o)=>{let s=e[o],i=t[o];return s===i?e:void 0===s?(e[o]=(0,r.d9)(i),e):(Array.isArray(i)||Array.isArray(e)?(s=s?Array.isArray(s)?e[o]=s.concat():e[o]=[s]:e[o]=[],i&&(Array.isArray(i)||(i=[i]),n?i.forEach((e=>{s.includes(e)||s.push(e)})):e[o]=i.concat())):i&&"object"==typeof i?e[o]=c(s,i,n):e.hasOwnProperty(o)&&!t.hasOwnProperty(o)||(e[o]=i),e)}),e||{}):e}},95330:(e,t,n)=>{"use strict";n.d(t,{e4:()=>O,zE:()=>c,dD:()=>w,hh:()=>C,Ds:()=>S,as:()=>v,WW:()=>_,R8:()=>y,D_:()=>m,Hc:()=>f,y8:()=>k,fu:()=>p,$F:()=>b,r9:()=>d,k_:()=>l,H9:()=>h,Yn:()=>A,gx:()=>P,Hl:()=>g});const r=(o=globalThis,{setTimeout:(e,t)=>{const n=o.setTimeout(e,t);return{remove:()=>o.clearTimeout(n)}}});var o;n(60235);var s=n(20102),i=n(91460),a=(n(92604),n(70586));function c(e="Aborted"){return new s.Z("AbortError",e)}function l(e,t="Aborted"){if(f(e))throw c(t)}function u(e){return(0,a.pC)(e)?"aborted"in e?e:e.signal:e}function f(e){const t=u(e);return(0,a.pC)(t)&&t.aborted}function d(e){if(m(e))throw e}function h(e){if(!m(e))throw e}function p(e,t){const n=u(e);if(!(0,a.Wi)(n)){if(!n.aborted)return(0,i.IH)(n,"abort",(()=>t()));t()}}function b(e,t){const n=u(e);if(!(0,a.Wi)(n))return l(n),(0,i.IH)(n,"abort",(()=>t(c())))}function g(e,t){const n=u(t);return(0,a.Wi)(n)?e:new Promise(((n,r)=>{let o=p(t,(()=>r(c())));const s=()=>o=(0,a.hw)(o);e.then(s,s),e.then(n,r)}))}function m(e){return"AbortError"===e?.name}async function y(e){try{return await e}catch(e){if(!m(e))throw e;return}}function w(){let e=null;const t=new Promise(((t,n)=>{e={promise:void 0,resolve:t,reject:n}}));return e.promise=t,e}async function v(e){if(!e)return;if("function"!=typeof e.forEach){const t=Object.keys(e),n=t.map((t=>e[t])),r=await v(n),o={};return t.map(((e,t)=>o[e]=r[t])),o}const t=e;return new Promise((e=>{const n=[];let r=t.length;0===r&&e(n),t.forEach((t=>{const o={promise:t||Promise.resolve(t)};n.push(o),o.promise.then((e=>{o.value=e})).catch((e=>{o.error=e})).then((()=>{--r,0===r&&e(n)}))}))}))}async function _(e){return(await v(e)).filter((e=>!!e.value)).map((e=>e.value))}function O(e,t,n){const r=new AbortController;return p(n,(()=>r.abort())),new Promise(((n,o)=>{let s=setTimeout((()=>{s=0,n(t)}),e);p(r,(()=>{s&&(clearTimeout(s),o(c()))}))}))}function k(e){return e&&"function"==typeof e.then}function P(e){return k(e)?e:Promise.resolve(e)}function S(e,t=-1){let n,r,o,s,i=null;const l=(...u)=>{if(n){r=u,s&&s.reject(c()),s=w();const e=(0,a.j0)(s.promise);if(i){const e=i;i=null,e.abort()}return e}if(o=s||w(),s=null,t>0){const r=new AbortController;n=P(e(...u,r.signal));const o=n;O(t).then((()=>{n===o&&(s?r.abort():i=r)}))}else n=1,n=P(e(...u));const f=()=>{const e=r;r=o=n=i=null,null!=e&&l(...e)},d=n,h=o;return d.then(f,f),d.then(h.resolve,h.reject),(0,a.j0)(h.promise)};return l}function C(){let e,t;const n=new Promise(((n,r)=>{e=n,t=r})),o=t=>{e(t)};return o.resolve=t=>e(t),o.reject=e=>t(e),o.timeout=(e,t)=>r.setTimeout((()=>o.reject(t)),e),o.promise=n,o}async function A(e){await Promise.resolve(),l(e)}},19153:(e,t,n)=>{"use strict";n.d(t,{Cb:()=>l,Qs:()=>a,gx:()=>i,hP:()=>c});var r=n(78286);const o=/\{([^\}]+)\}/g;function s(e){return e??""}function i(e,t){return e.replace(o,"object"==typeof t?(e,n)=>s((0,r.hS)(n,t)):(e,n)=>s(t(n)))}function a(e,t){return e.replace(/([\.$?*|{}\(\)\[\]\\\/\+\-^])/g,(e=>t&&t.includes(e)?e:`\\${e}`))}function c(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t}function l(e){return(new DOMParser).parseFromString(e||"","text/html").body.innerText||""}},1533:(e,t,n)=>{"use strict";function r(e,t){if(e.forEach)e.forEach(t);else for(let n=0;n<e.length;n++)t(e[n],n,e)}function o(e,t,n){if(e.slice)return e.slice(t,n);void 0===t?t=0:(t<0&&(t+=e.length),t=Math.min(e.length,Math.max(0,t))),void 0===n?n=e.length:(n<0&&(n+=e.length),n=Math.min(e.length,Math.max(0,n)));const r=Math.max(0,n-t),o=new(0,e.constructor)(r);for(let n=0;n<r;n++)o[n]=e[t+n];return o}function s(e){return e instanceof ArrayBuffer||e&&e.constructor&&"ArrayBuffer"===e.constructor.name}function i(e){return e instanceof Int8Array||e&&e.constructor&&"Int8Array"===e.constructor.name}function a(e){return e instanceof Uint8Array||e&&e.constructor&&"Uint8Array"===e.constructor.name}function c(e){return e instanceof Uint8ClampedArray||e&&e.constructor&&"Uint8ClampedArray"===e.constructor.name}function l(e){return e instanceof Int16Array||e&&e.constructor&&"Int16Array"===e.constructor.name}function u(e){return e instanceof Uint16Array||e&&e.constructor&&"Uint16Array"===e.constructor.name}function f(e){return e instanceof Int32Array||e&&e.constructor&&"Int32Array"===e.constructor.name}function d(e){return e instanceof Uint32Array||e&&e.constructor&&"Uint32Array"===e.constructor.name}function h(e){return e instanceof Float32Array||e&&e.constructor&&"Float32Array"===e.constructor.name}function p(e){return e instanceof Float64Array||e&&e.constructor&&"Float64Array"===e.constructor.name}n.d(t,{Ed:()=>r,Hx:()=>f,KZ:()=>c,Uc:()=>u,W0:()=>i,ZY:()=>d,eP:()=>s,fS:()=>p,lq:()=>a,tP:()=>o,xZ:()=>h,z3:()=>l})},17452:(e,t,n)=>{"use strict";n.d(t,{$U:()=>re,AH:()=>V,B7:()=>A,D6:()=>U,Fv:()=>Z,HK:()=>K,Hu:()=>de,Ie:()=>ue,L:()=>k,Ml:()=>be,P$:()=>B,PF:()=>F,Qj:()=>le,R9:()=>y,TI:()=>O,YP:()=>H,Yd:()=>ae,ZN:()=>he,_l:()=>X,b7:()=>j,ed:()=>N,fZ:()=>ge,fl:()=>pe,hF:()=>q,hO:()=>oe,io:()=>ee,jc:()=>z,kl:()=>L,mN:()=>P,oC:()=>te,oh:()=>W,qg:()=>E,rS:()=>Q,sJ:()=>Y,tD:()=>$,tm:()=>I,u0:()=>S,v_:()=>D,vt:()=>ce});var r=n(68773),o=n(20102),s=n(92604),i=n(70586);const a=s.Z.getLogger("esri.core.urlUtils"),c=r.Z.request,l="esri/config: esriConfig.request.proxyUrl is not set.",u=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,f=/^\s*http:/i,d=/^\s*https:/i,h=/^\s*file:/i,p=/:\d+$/,b=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,g=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),m=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");class y{constructor(e=""){this.uri=e,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let t=(0,i.j0)(this.uri.match(g));this.scheme=t[2]||(t[1]?"":null),this.authority=t[4]||(t[3]?"":null),this.path=t[5],this.query=t[7]||(t[6]?"":null),this.fragment=t[9]||(t[8]?"":null),null!=this.authority&&(t=(0,i.j0)(this.authority.match(m)),this.user=t[3]||null,this.password=t[4]||null,this.host=t[6]||t[7],this.port=t[9]||null)}toString(){return this.uri}}const w={};let v=new y(r.Z.applicationUrl);let _=function(){const e=(0,i.j0)(v.path),t=e.substring(0,e.lastIndexOf(e.split("/")[e.split("/").length-1]));return`${v.scheme}://${v.host}${null!=v.port?`:${v.port}`:""}${t}`}();const O=()=>v,k=()=>_;function P(e){if(!e)return null;const t={path:null,query:null},n=new y(e),r=e.indexOf("?");return null===n.query?t.path=e:(t.path=e.substring(0,r),t.query=S(n.query)),n.fragment&&(t.hash=n.fragment,null===n.query&&(t.path=t.path.substring(0,t.path.length-(n.fragment.length+1)))),t}function S(e){const t=e.split("&"),n={};for(const e of t){if(!e)continue;const t=e.indexOf("=");let r,o;t<0?(r=decodeURIComponent(e),o=""):(r=decodeURIComponent(e.slice(0,t)),o=decodeURIComponent(e.slice(t+1)));let s=n[r];"string"==typeof s&&(s=n[r]=[s]),Array.isArray(s)?s.push(o):n[r]=o}return n}function C(e){return e&&"object"==typeof e&&"toJSON"in e&&"function"==typeof e.toJSON}function A(e,t){return e?t&&"function"==typeof t?Object.keys(e).map((n=>encodeURIComponent(n)+"="+encodeURIComponent(t(n,e[n])))).join("&"):Object.keys(e).map((n=>{const r=e[n];if(null==r)return"";const o=encodeURIComponent(n)+"=",s=t&&t[n];return s?o+encodeURIComponent(s(r)):Array.isArray(r)?r.map((e=>C(e)?o+encodeURIComponent(JSON.stringify(e)):o+encodeURIComponent(e))).join("&"):C(r)?o+encodeURIComponent(JSON.stringify(r)):o+encodeURIComponent(r)})).filter((e=>e)).join("&"):""}function j(e=!1){let t,n=c.proxyUrl;if("string"==typeof e){t=re(e);const r=N(e);r&&(n=r.proxyUrl)}else t=!!e;if(!n)throw a.warn(l),new o.Z("urlutils:proxy-not-set",l);return t&&se()&&(n=oe(n)),P(n)}function E(e){const t=N(e);let n,r;if(t){const e=T(t.proxyUrl);n=e.path,r=e.query?S(e.query):null}if(n){const t=P(e);e=n+"?"+t.path;const o=A({...r,...t.query});o&&(e=`${e}?${o}`)}return e}const x={path:"",query:""};function T(e){const t=e.indexOf("?");return-1!==t?(x.path=e.slice(0,t),x.query=e.slice(t+1)):(x.path=e,x.query=null),x}function M(e){return(e=ie(e=function(e){return e&&"/"===e[e.length-1]?e:`${e}/`}(e=T(e).path),!0)).toLowerCase()}function $(e){const t={proxyUrl:e.proxyUrl,urlPrefix:M(e.urlPrefix)},n=c.proxyRules,r=t.urlPrefix;let o=n.length;for(let e=0;e<n.length;e++){const t=n[e].urlPrefix;if(0===r.indexOf(t)){if(r.length===t.length)return-1;o=e;break}0===t.indexOf(r)&&(o=e+1)}return n.splice(o,0,t),o}function N(e){const t=c.proxyRules,n=M(e);for(let e=0;e<t.length;e++)if(0===n.indexOf(t[e].urlPrefix))return t[e]}function I(e,t){return e=R(e),t=R(t),ie(e)===ie(t)}function R(e){const t=(e=Z(e)).indexOf("/sharing");return t>0?e.substring(0,t):e.replace(/\/+$/,"")}function W(e){const t=t=>null==t||t instanceof RegExp&&t.test(e)||"string"==typeof t&&e.startsWith(t),n=c.interceptors;if(n)for(const e of n)if(Array.isArray(e.urls)){if(e.urls.some(t))return e}else if(t(e.urls))return e;return null}function U(e,t,n=!1){if(!e||!t)return!1;const r=fe(e),o=fe(t);return!(!n&&r.scheme!==o.scheme)&&null!=r.host&&null!=o.host&&r.host.toLowerCase()===o.host.toLowerCase()&&r.port===o.port}function L(e){if("string"==typeof e){if(!H(e))return!0;e=fe(e)}if(U(e,v))return!0;const t=c.trustedServers||[];for(let n=0;n<t.length;n++){const r=J(t[n]);for(let t=0;t<r.length;t++)if(U(e,r[t]))return!0}return!1}function J(e){return w[e]||(ne(e)||te(e)?w[e]=[new y(q(e))]:w[e]=[new y(`http://${e}`),new y(`https://${e}`)]),w[e]}function q(e,t=_,n){return te(e)?n&&n.preserveProtocolRelative?e:"http"===v.scheme&&v.authority===B(e).slice(2)?`http:${e}`:`https:${e}`:ne(e)?e:(0,i.j0)(D("/"===e[0]?function(e){const t=e.indexOf("//"),n=e.indexOf("/",t+2);return-1===n?e:e.slice(0,n)}(t):t,e))}function F(e,t=_,n){if(null==e||!H(e))return e;const r=Z(e),o=r.toLowerCase(),s=Z(t).toLowerCase().replace(/\/+$/,""),i=n?Z(n).toLowerCase().replace(/\/+$/,""):null;if(i&&0!==s.indexOf(i))return e;const a=(e,t,n)=>-1===(n=e.indexOf(t,n))?e.length:n;let c=a(o,"/",o.indexOf("//")+2),l=-1;for(;o.slice(0,c+1)===s.slice(0,c)+"/"&&(l=c+1,c!==o.length);)c=a(o,"/",c+1);if(-1===l)return e;if(i&&l<i.length)return e;e=r.slice(l);const u=s.slice(l-1).replace(/[^/]+/g,"").length;if(u>0)for(let t=0;t<u;t++)e=`../${e}`;else e=`./${e}`;return e}function Z(e){return function(e){const t=c.httpsDomains;if(!function(e){return null!=e&&f.test(e)||"http"===v.scheme&&te(e)}(e))return e;const n=e.indexOf("/",7);let r;if(r=-1===n?e:e.slice(0,n),r=r.toLowerCase().slice(7),p.test(r)){if(!r.endsWith(":80"))return e;r=r.slice(0,-3),e=e.replace(":80","")}return"http"===v.scheme&&r===v.authority&&!b.test(e)||(se()&&r===v.authority||t&&t.some((e=>r===e||r.endsWith(`.${e}`)))||se()&&!N(e))&&(e=oe(e)),e}(e=function(e){return e.replace(/^(https?:\/\/)(arcgis\.com)/i,"$1www.$2")}(e=function(e){if(/^https?:\/\//i.test(e)){const t=T(e);e=(e=t.path.replace(/\/{2,}/g,"/")).replace("/","//"),t.query&&(e+=`?${t.query}`)}return e}(e=q(e=e.trim()))))}function D(...e){const t=e.filter(i.pC);if(!t||!t.length)return;const n=[];if(H(t[0])){const e=t[0],r=e.indexOf("//");-1!==r&&(n.push(e.slice(0,r+1)),function(e){return null!=e&&h.test(e)}(t[0])&&(n[0]+="/"),t[0]=e.slice(r+2))}else"/"===t[0][0]&&n.push("");const r=t.reduce(((e,t)=>t?e.concat(t.split("/")):e),[]);for(let e=0;e<r.length;e++){const t=r[e];".."===t&&n.length>0&&".."!==n[n.length-1]?n.pop():(!t&&e===r.length-1||t&&("."!==t||0===n.length))&&n.push(t)}return n.join("/")}function B(e,t=!1){if(null==e||z(e)||K(e))return null;let n=e.indexOf("://");if(-1===n&&te(e))n=2;else{if(-1===n)return null;n+=3}const r=e.indexOf("/",n);return-1!==r&&(e=e.slice(0,r)),t&&(e=ie(e,!0)),e}function H(e){return te(e)||ne(e)}function z(e){return null!=e&&"blob:"===e.slice(0,5)}function K(e){return null!=e&&"data:"===e.slice(0,5)}function V(e){const t=Y(e);if(!t||!t.isBase64)return null;const n=atob(t.data),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r.buffer}function Q(e){return btoa(String.fromCharCode.apply(null,e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const G=/^data:(.*?)(;base64)?,(.*)$/;function Y(e){const t=e.match(G);if(!t)return null;const[,n,r,o]=t;return{mediaType:n,isBase64:!!r,data:o}}function X(e){return e.isBase64?`data:${e.mediaType};base64,${e.data}`:`data:${e.mediaType},${e.data}`}function ee(e,t){(function(e,t){if(!e)return!1;const n=document.createElement("a");if(!("download"in n))return!1;const r=URL.createObjectURL(e);return n.download=t,n.href=r,n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r),!0})(e,t)||function(e,t){!!window.navigator.msSaveOrOpenBlob&&window.navigator.msSaveOrOpenBlob(e,t)}(e,t)}function te(e){return null!=e&&"/"===e[0]&&"/"===e[1]}function ne(e){return null!=e&&u.test(e)}function re(e){return null!=e&&d.test(e)||"https"===v.scheme&&te(e)}function oe(e){return te(e)?`https:${e}`:e.replace(f,"https:")}function se(){return"https"===v.scheme}function ie(e,t=!1){return te(e)?e.slice(2):(e=e.replace(u,""),t&&e.length>1&&"/"===e[0]&&"/"===e[1]&&(e=e.slice(2)),e)}function ae(e){let t=0;if(H(e)){const n=e.indexOf("//");-1!==n&&(t=n+2)}const n=e.lastIndexOf("/");return n<t?e:e.slice(0,n+1)}function ce(e,t){if(!e)return"";const n=P(e).path.replace(/\/+$/,""),r=n.substring(n.lastIndexOf("/")+1);if(!t?.length)return r;const o=new RegExp(`.(${t.join("|")})$`,"ig");return r.replace(o,"")}function le(e){return e.replace(/\/+$/,"")}function ue(e,t,n){if(!(t&&n&&e&&H(e)))return e;const r=e.indexOf("//"),o=e.indexOf("/",r+2),s=e.indexOf(":",r+2),i=Math.min(o<0?e.length:o,s<0?e.length:s);return e.slice(r+2,i).toLowerCase()!==t.toLowerCase()?e:`${e.slice(0,r+2)}${n}${e.slice(i)}`}function fe(e){return"string"==typeof e?new y(q(e)):(e.scheme||(e.scheme=v.scheme),e)}function de(e,t){const n=P(e),r=Object.keys(n.query||{});return r.length>0&&t&&t.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${r.join(", ")}.`),n.path}function he(e,t,n){const r=P(e),o=r.query||{};return o[t]=String(n),`${r.path}?${A(o)}`}function pe(e,t){const n=P(e),r=n.query||{};for(const e in t)r[e]=t[e];const o=A(r);return o?`${n.path}?${o}`:n.path}function be(e){if((0,i.Wi)(e))return null;const t=e.match(me);return t?t[2]:null}function ge(e){if((0,i.Wi)(e))return null;const t=e.match(me);return t?{path:t[1],extension:t[2]}:{path:e,extension:null}}const me=/([^.]*)\.([^\/]*)$/},25045:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>y});var r=n(40330),o=n(20102),s=n(91460),i=n(70586),a=n(95330),c=n(94362),l=n(17202);const u={statsWorker:()=>Promise.all([n.e(1400),n.e(1562),n.e(3847),n.e(6841)]).then(n.bind(n,36841)),geometryEngineWorker:()=>Promise.all([n.e(5837),n.e(8227)]).then(n.bind(n,48227)),CSVSourceWorker:()=>Promise.all([n.e(4547),n.e(1400),n.e(1534),n.e(1562),n.e(5886),n.e(3847),n.e(9777),n.e(8833),n.e(4807),n.e(8850)]).then(n.bind(n,14478)),EdgeProcessingWorker:()=>Promise.all([n.e(6481),n.e(212),n.e(2062)]).then(n.bind(n,49594)),ElevationSamplerWorker:()=>Promise.all([n.e(4547),n.e(1400),n.e(1562),n.e(4807),n.e(6481),n.e(6459),n.e(98)]).then(n.bind(n,61787)),FeatureServiceSnappingSourceWorker:()=>Promise.all([n.e(4547),n.e(4588),n.e(1400),n.e(1534),n.e(1562),n.e(5886),n.e(3847),n.e(4599),n.e(9777),n.e(8833),n.e(4807),n.e(2508)]).then(n.bind(n,65967)),GeoJSONSourceWorker:()=>Promise.all([n.e(4547),n.e(1400),n.e(1534),n.e(1562),n.e(5886),n.e(3847),n.e(9777),n.e(8833),n.e(4807),n.e(3281),n.e(7845)]).then(n.bind(n,97845)),LercWorker:()=>n.e(3027).then(n.bind(n,23027)),MemorySourceWorker:()=>Promise.all([n.e(4547),n.e(1400),n.e(1534),n.e(1562),n.e(5886),n.e(3847),n.e(9777),n.e(8833),n.e(4807),n.e(3281),n.e(639)]).then(n.bind(n,30639)),PBFDecoderWorker:()=>Promise.all([n.e(1400),n.e(1562),n.e(5886),n.e(802)]).then(n.bind(n,10802)),Pipeline:()=>Promise.all([n.e(4547),n.e(8476),n.e(4588),n.e(1400),n.e(1534),n.e(1562),n.e(5886),n.e(3847),n.e(4599),n.e(9777),n.e(8833),n.e(4325),n.e(7483)]).then(n.bind(n,37138)),PointCloudWorker:()=>Promise.all([n.e(4547),n.e(1400),n.e(1562),n.e(9324)]).then(n.bind(n,90447)),RasterWorker:()=>Promise.all([n.e(4547),n.e(1400),n.e(1562),n.e(8363),n.e(3645),n.e(4370)]).then(n.bind(n,61576)),SceneLayerSnappingSourceWorker:()=>Promise.all([n.e(4547),n.e(1400),n.e(1534),n.e(1562),n.e(5886),n.e(3847),n.e(9777),n.e(6481),n.e(212),n.e(5259)]).then(n.bind(n,65381)),SceneLayerWorker:()=>n.e(1412).then(n.bind(n,31412)),WFSSourceWorker:()=>Promise.all([n.e(4547),n.e(1400),n.e(1534),n.e(1562),n.e(5886),n.e(3847),n.e(9777),n.e(8833),n.e(4807),n.e(3281),n.e(3230)]).then(n.bind(n,43230)),WorkerTileHandler:()=>Promise.all([n.e(4325),n.e(1785),n.e(6810),n.e(3388)]).then(n.bind(n,56456))},{CLOSE:f,ABORT:d,INVOKE:h,RESPONSE:p,OPEN_PORT:b,ON:g}=c.Cs;class m{constructor(e){this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._invoke=e,this._timer=null,this._process=this._process.bind(this)}push(e){e.type===c.Cs.ABORT?this._cancelledJobIds.add(e.jobId):(this._invokeMessages.push(e),null===this._timer&&(this._timer=setTimeout(this._process,0)))}clear(){this._invokeMessages.length=0,this._cancelledJobIds.clear(),this._timer=null}_process(){this._timer=null;for(const e of this._invokeMessages)this._cancelledJobIds.has(e.jobId)||this._invoke(e);this._cancelledJobIds.clear(),this._invokeMessages.length=0}}class y{constructor(e,t,n){this._port=e,this._getNextJob=n,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new m((e=>this._onInvokeMessage(e))),this._client=t.client,this._onMessage=this._onMessage.bind(this),this._channel=t.channel,this._schedule=t.schedule,this._port.addEventListener("message",this._onMessage),this._port.start()}static connect(e){const t=new MessageChannel;let n;n="function"==typeof e?new e:"default"in e&&"function"==typeof e.default?new e.default:e;const r=new y(t.port1,{channel:t,client:n},(()=>null));return"object"==typeof n&&"remoteClient"in n&&(n.remoteClient=r),y.clients.set(r,n),t.port2}static loadWorker(e){const t=u[e];return t?t():Promise.resolve(null)}close(){this._post({type:f}),this._close()}isBusy(){return this._outJobs.size>0}invoke(e,t,n){const r=n&&n.signal,s=n&&n.transferList;if(!this._port)return Promise.reject(new o.Z("worker:port-closed",`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:t}));const l=(0,c.jt)();return new Promise(((n,o)=>{if((0,a.Hc)(r))return this._processWork(),void o((0,a.zE)());const c=(0,a.fu)(r,(()=>{const e=this._outJobs.get(l);e&&(this._outJobs.delete(l),this._processWork(),(0,i.hw)(e.abortHandle),this._post({type:d,jobId:l}),o((0,a.zE)()))})),u={resolve:n,reject:o,abortHandle:c,debugInfo:e};this._outJobs.set(l,u),this._post({type:h,jobId:l,methodName:e,abortable:null!=r},t,s)}))}on(e,t){const n=new MessageChannel;function r(e){t(e.data)}return this._port.postMessage({type:c.Cs.ON,eventType:e,port:n.port2},[n.port2]),n.port1.addEventListener("message",r),n.port1.start(),{remove(){n.port1.postMessage({type:c.Cs.CLOSE}),n.port1.close(),n.port1.removeEventListener("message",r)}}}jobAdded(){this._processWork()}openPort(){const e=new MessageChannel;return this._post({type:b,port:e.port2}),e.port1}_processWork(){if(this._outJobs.size>=2)return;const e=this._getNextJob();if(!e)return;const{methodName:t,data:n,invokeOptions:r,deferred:o}=e;this.invoke(t,n,r).then((e=>o.resolve(e))).catch((e=>o.reject(e)))}_close(){this._channel&&(this._channel=void 0),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach((e=>{(0,i.hw)(e.abortHandle),e.reject((0,a.zE)(`Worker closing, aborting job calling '${e.debugInfo}'`))})),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=this._client=this._schedule=null}_onMessage(e){(0,i.pC)(this._schedule)?this._schedule((()=>this._processMessage(e))):this._processMessage(e)}_processMessage(e){const t=(0,c.QM)(e);if(t)switch(t.type){case p:this._onResponseMessage(t);break;case h:this._invokeQueue.push(t);break;case d:this._onAbortMessage(t);break;case f:this._onCloseMessage();break;case b:this._onOpenPortMessage(t);break;case g:this._onOnMessage(t)}}_onAbortMessage(e){const t=this._inJobs,n=e.jobId,r=t.get(n);this._invokeQueue.push(e),r&&(r.controller&&r.controller.abort(),t.delete(n))}_onCloseMessage(){const e=this._client;this._close(),e&&"destroy"in e&&y.clients.get(this)===e&&e.destroy(),y.clients.delete(this),e&&e.remoteClient&&(e.remoteClient=null)}_onInvokeMessage(e){const{methodName:t,jobId:n,data:r,abortable:o}=e,s=o?new AbortController:null,i=this._inJobs;let l,u=this._client,f=u[t];try{if(!f&&t&&t.includes(".")){const e=t.split(".");for(let t=0;t<e.length-1;t++)u=u[e[t]],f=u[e[t+1]]}if("function"!=typeof f)throw new TypeError(`${t} is not a function`);l=f.call(u,r,{client:this,signal:s?s.signal:null})}catch(e){return void this._post({type:p,jobId:n,error:(0,c.AB)(e)})}(0,a.y8)(l)?(i.set(n,{controller:s,promise:l}),l.then((e=>{i.has(n)&&(i.delete(n),this._post({type:p,jobId:n},e))}),(e=>{i.has(n)&&(i.delete(n),(0,a.D_)(e)||this._post({type:p,jobId:n,error:(0,c.AB)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:p,jobId:n},l)}_onOpenPortMessage(e){new y(e.port,{client:this._client},(()=>null))}_onOnMessage(e){const{port:t}=e,n=this._client.on(e.eventType,(e=>{t.postMessage(e)})),r=(0,s.on)(e.port,"message",(e=>{(0,c.QM)(e)?.type===c.Cs.CLOSE&&(r.remove(),n.remove(),t.close())}))}_onResponseMessage(e){const{jobId:t,error:n,data:r}=e,s=this._outJobs;if(!s.has(t))return;const a=s.get(t);s.delete(t),this._processWork(),(0,i.hw)(a.abortHandle),n?a.reject(o.Z.fromJSON(JSON.parse(n))):a.resolve(r)}_post(e,t,n){return(0,c.oi)(this._port,e,t,n)}}y.kernelInfo={revision:l.$,version:r.i8,buildDate:l.r},y.clients=new Map},94362:(e,t,n)=>{"use strict";n.d(t,{AB:()=>a,Cs:()=>r,QM:()=>l,jt:()=>i,oi:()=>c});var r,o=n(80442);!function(e){e[e.HANDSHAKE=0]="HANDSHAKE",e[e.OPEN=1]="OPEN",e[e.OPENED=2]="OPENED",e[e.RESPONSE=3]="RESPONSE",e[e.INVOKE=4]="INVOKE",e[e.ABORT=5]="ABORT",e[e.CLOSE=6]="CLOSE",e[e.OPEN_PORT=7]="OPEN_PORT",e[e.ON=8]="ON"}(r||(r={}));let s=0;function i(){return s++}function a(e){return e?"string"==typeof e?JSON.stringify({name:"message",message:e}):e.toJSON?JSON.stringify(e):JSON.stringify({name:e.name,message:e.message,details:e.details||{stack:e.stack}}):null}function c(e,t,n,o){if(t.type===r.OPEN_PORT)return void e.postMessage(t,[t.port]);if(t.type!==r.INVOKE&&t.type!==r.RESPONSE)return void e.postMessage(t);let s;!function(e){return e&&"object"==typeof e&&("result"in e||"transferList"in e)}(n)?(s=u(o),t.data=n):(s=u(n.transferList),t.data=n.result),s?e.postMessage(t,s):e.postMessage(t)}function l(e){if(!e)return null;const t=e.data;return t?"string"==typeof t?JSON.parse(t):t:null}function u(e){if(!e||!e.length)return null;if((0,o.Z)("esri-workers-arraybuffer-transfer"))return e;const t=e.filter((e=>!function(e){return e instanceof ArrayBuffer||e&&e.constructor&&"ArrayBuffer"===e.constructor.name}(e)));return t.length?t:null}},40330:(e,t,n)=>{"use strict";n.d(t,{Dp:()=>l,Nv:()=>i,i8:()=>s,id:()=>a,qh:()=>c});var r=n(80442),o=n(17452);const s="4.25",i={async request(e,t){const{default:r}=await n.e(3172).then(n.bind(n,3172)),s=e.options,i=s.responseType;s.signal=t?.signal,s.responseType="native"===i||"native-request-init"===i?"native-request-init":i&&["blob","json","text"].includes(i)&&(0,o.oh)(e.url)?.after?i:"array-buffer";const a=await r(e.url,s),c={data:a.data,ssl:a.ssl};switch(a.requestOptions?.responseType){case"native-request-init":return delete c.data.signal,c;case"blob":c.data=await c.data.arrayBuffer();break;case"json":c.data=(new TextEncoder).encode(JSON.stringify(c.data)).buffer;break;case"text":c.data=(new TextEncoder).encode(c.data).buffer}return{result:c,transferList:[c.data]}}};let a;function c(e){a=e}function l(e){const t=a&&a.findCredential(e);return t&&t.token?(0,o.ZN)(e,"token",t.token):e}(0,r.Z)("host-webworker")},17202:(e,t,n)=>{"use strict";n.d(t,{$:()=>o,r:()=>r});const r="20221014",o="9845b29c31731421313e7fa72bc78b7309bf7063"}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,n),s.exports}n.m=e,n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>"chunks/"+{9:"00bbcd20b3ff26bf4e33",81:"e0457f3c3605e6963fe3",98:"dbf72099949febfae5a1",212:"4641e10e0e8e9d257521",223:"01fa42244b5e7498bb06",247:"9d9e3a38c54c41f7764c",402:"f0d9d15202ed7474a3a9",565:"c0142d207900d8b40b46",576:"7fdd029a76a7ab1c3d83",639:"f607bb297787cc5987f5",661:"bee19483591ff9994495",719:"af047eb141d7522d2aaa",739:"cf0efbd948f6cec4e91e",802:"dae39baaab110eafce8b",819:"d1ead6e8aa7e8e21fbc6",837:"24e5ad342c89f4839039",911:"f9506f185c9c7a28cab5",958:"a824435cb5bdd44486ae",1070:"4b7b54389fcd2f9918e4",1074:"1dcdde67304e8fe11fc0",1387:"7f31aac852462567f2e7",1400:"2d6d089176b6bd490b9f",1412:"cd11fcc3d9678ab4e115",1421:"6196cfdeb91ceba52af3",1423:"28c56e6fe5dec59423cb",1433:"4d5bdf18feeb9c8cb6ff",1534:"933f9b62a3a20e768927",1545:"c2c288d42129354dc218",1562:"e7b6f062a3a6357a76f8",1612:"9ac9fe42bb4a10308b2e",1761:"1a0e49dc1584f4eb006a",1773:"03ba86d2fd88270a0af4",1785:"3b5be512567d9c1c6fe6",2062:"c9c0dd4d9aaa9b794bd5",2133:"de6a1d1cfdc147455d57",2134:"63ed004a15ccd6bb4491",2324:"86cdbe154a7a3b3906c6",2508:"7a9e3f338f519c80f4b9",2664:"3e97c75c4b3a21b53b08",2710:"90c8d4df966803beb4c1",2855:"f33a0d4f1cfa08fdfed7",3027:"b88c012fa0b0e229a5e3",3172:"878bc2b24cc45418e819",3230:"d32b8fed33fccff22dc2",3281:"2a63949c3aad9ace1b44",3388:"0a2751a8c5fcb73cd7dc",3492:"1596b8a7b9c6533684d3",3529:"4b460f4a0ae2073e33ad",3645:"f684794c7fd8267f5331",3668:"965a8f23a36ff5f767e9",3743:"dcf395dfcb2844d63513",3810:"0c60d1901db74aca19e3",3847:"2e4a53412cf5bba1dfa5",3852:"b71a0a8a2f446c671161",4028:"ef684bae73b2861da9f1",4046:"f6f440a34cad6ea40f35",4166:"c067b0cec2d3fecdc3d2",4202:"46af54c9f3c14fd8c2c0",4210:"bcc462dfd250c252b399",4242:"23c595791a6c3926e597",4268:"a39a51e8a8369f6489bb",4325:"d91140bc583925e4faf6",4358:"71a4618d959a09302c51",4370:"8075832080224a0e9783",4436:"2e7b8bd584b0fb7896de",4475:"988a142646a0b05c9814",4499:"5a95c545405f5e3cb502",4547:"b728e77d1fa4b8439b14",4588:"e232e442b8efb4076cc4",4599:"e6c66a61b7b5ac4aef54",4695:"cfd83bad25be40fe14e9",4807:"cacdb5a9d31d0aaadbe3",4889:"16e9bd57f774944d0bf8",4992:"ef146810884ad0f267bb",5004:"2522e626a37bfa2eb4b3",5207:"9492ef8c526851e7f8a9",5235:"1888bf3e0ea96b682bd4",5259:"81087a50c8d8695cb523",5329:"0e21e5b4d065567a6a91",5468:"0da7751c5bb4827dd255",5546:"d0e614026500ffbdca90",5587:"a6906cf8378bfca89811",5732:"469ba1b24cdeea0758ec",5837:"ed59ec7a8688437ebdbc",5853:"c8a72cea37449aa40c4a",5886:"7e599e62d5c3e20474df",6233:"4cb64ccb5fba126f9a66",6237:"b686422160ea7e7ff5bb",6261:"64c503c9246e651af975",6418:"48cb5f427fc7a8a83c81",6459:"274b4cdf6c8d77e8a2e6",6481:"2e3a4fc59789013185f4",6584:"4c0d7a074083aa9614bb",6636:"67efbea3621c0345a990",6710:"d828a0656e7351a74fc4",6748:"2c862f7497dd9933e0ac",6774:"c8402e32307a7b7eaaeb",6794:"10293b5c137c35b6c3fd",6810:"9bbcf17003f5650c4d96",6841:"8ee3da8677255b8c8709",6913:"8de412bd25654f85d491",6925:"2b2db231b234d7dd84e6",7035:"5abda500f5d5607155ab",7062:"e18503945ba8018b4be1",7126:"1475f89d86cfd422fd18",7160:"4d3c8f2c91223611ad9a",7202:"be752b2870b0a5134ac1",7269:"0cfb97b9f38c31b3b33a",7272:"c8a12264ea2c5020aa85",7275:"5e3686b68e1b5dfa0169",7277:"c2a6ac7046134f725cf3",7374:"9954cb1c0c50fb5b4833",7476:"bc89fbcd29f97caf1276",7483:"1fc204e30858a1e843cf",7541:"b17ff3dfdc638f9f5705",7572:"9383dab07abf7e29139e",7698:"ae96278f3df6ec54db79",7827:"59807a54b655261fa86d",7845:"8179031362a3b32545a1",7873:"4c989506b46bfec9c5ed",8092:"236cc6c02c45051e8ea9",8096:"22a990a8d4d4587866a5",8227:"ee04b1c0c42cb1b18b24",8325:"fbd49164a684776bce68",8326:"2d157ce4aab466555593",8363:"7bc9a3137dd2dc89e9cf",8383:"e8f4d7d25cf3383852e9",8476:"71b80cc32f9fc61fbbf8",8636:"6564744b18b3a87a954f",8694:"2d70499eacbd1d2a33a7",8758:"bfa6040ac9ee774c74ba",8794:"91da49191ab09160a4df",8828:"2eb2d49c549e53934b8b",8833:"e7f4306c1f727afc5a45",8850:"8b08e9883ebae3eef429",8882:"d255a9b7e7a5d5d91dab",8899:"579469915c99e12c470e",9070:"fc521bcd4fce711edb7e",9169:"76b75ac18c8239687321",9243:"47f88f15bae6918d46af",9268:"7fab18074b130b71a648",9291:"179efcf889111d2576c5",9296:"fcccbf3571b8d85833e8",9300:"3af4c3eb337fcc36878d",9324:"04b217c123ee55adb989",9356:"244cabe1762b545f06a0",9513:"b07fb0807e1bf2555c82",9777:"f6772f57bb1466e50d63",9790:"43200e78f2aa13a20bea",9880:"1b5bdd80db9a1a410ff8",9884:"356db8b8297282c77291",9903:"d2dd80fd9d54764edb45",9904:"b4da35f1093f3731f9ac",9956:"efd284732b5e6f8b29a5"}[e]+".js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");r.length&&(e=r[r.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{var e={134:1};n.f.i=(t,r)=>{e[t]||importScripts(n.p+n.u(t))};var t=self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[],r=t.push.bind(t);t.push=t=>{var[o,s,i]=t;for(var a in s)n.o(s,a)&&(n.m[a]=s[a]);for(i&&i(n);o.length;)e[o.pop()]=1;r(t)}})(),n(88277);var r=n(25045);RemoteClient=r})();
1
+ var RemoteClient;(()=>{var e={88277:(e,t,n)=>{n.p=self.esriConfig.assetsPath+"/esri/core/workers/"},68773:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s}),n(80442);var r=n(78286),o=n(17202);const s={analysisTheme:{accentColor:[255,128,0],textColor:"white"},apiKey:void 0,applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",portalUrl:"https://www.arcgis.com",routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&((0,r.RH)(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="4.25.0";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}-next.${o.r}/assets`}s.defaultAssetsPath=s.assetsPath}},20102:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(22974),o=n(92604),s=n(58896);class i extends s.Z{constructor(e,t,n){if(super(e,t,n),!(this instanceof i))return new i(e,t,n)}toJSON(){if(null!=this.details)try{return{name:this.name,message:this.message,details:JSON.parse(JSON.stringify(this.details,((e,t)=>{if(t&&"object"==typeof t&&"function"==typeof t.toJSON)return t;try{return(0,r.d9)(t)}catch(e){return"[object]"}})))}}catch(e){throw o.Z.getLogger("esri.core.Error").error(e),e}return{name:this.name,message:this.message,details:this.details}}static fromJSON(e){return new i(e.name,e.message,e.details)}}i.prototype.type="error"},92604:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(68773),o=(n(80442),n(70586)),s=n(19153);const i={info:0,warn:1,error:2,none:3};class a{constructor(e){this.level=null,this._module="",this._parent=null,this.writer=null,this._loggedMessages={error:new Map,warn:new Map,info:new Map},null!=e.level&&(this.level=e.level),null!=e.writer&&(this.writer=e.writer),this._module=e.module,a._loggers[this.module]=this;const t=this.module.lastIndexOf(".");-1!==t&&(this._parent=a.getLogger(this.module.slice(0,t)))}get module(){return this._module}get parent(){return this._parent}error(...e){this._log("error","always",...e)}warn(...e){this._log("warn","always",...e)}info(...e){this._log("info","always",...e)}errorOnce(...e){this._log("error","once",...e)}warnOnce(...e){this._log("warn","once",...e)}infoOnce(...e){this._log("info","once",...e)}errorOncePerTick(...e){this._log("error","oncePerTick",...e)}warnOncePerTick(...e){this._log("warn","oncePerTick",...e)}infoOncePerTick(...e){this._log("info","oncePerTick",...e)}get test(){const e=this;return{loggedMessages:e._loggedMessages,clearLoggedWarnings:()=>e._loggedMessages.warn.clear()}}static get testSingleton(){return{resetLoggers(e={}){const t=a._loggers;return a._loggers=e,t},set throttlingDisabled(e){a._throttlingDisabled=e}}}static getLogger(e){let t=a._loggers[e];return t||(t=new a({module:e})),t}_log(e,t,...n){if(this._matchLevel(e)){if("always"!==t&&!a._throttlingDisabled){const r=this._argsToKey(n),o=this._loggedMessages[e].get(r);if("once"===t&&null!=o||"oncePerTick"===t&&o&&o>=a._tickCounter)return;this._loggedMessages[e].set(r,a._tickCounter),a._scheduleTickCounterIncrement()}for(const t of r.Z.log.interceptors)if(t(e,this.module,...n))return;this._inheritedWriter()(e,this.module,...n)}}_parentWithMember(e,t){let n=this;for(;(0,o.pC)(n);){const t=n[e];if((0,o.pC)(t))return t;n=n.parent}return t}_inheritedWriter(){return this._parentWithMember("writer",this._consoleWriter)}_consoleWriter(e,t,...n){console[e](`[${t}]`,...n)}_matchLevel(e){const t=r.Z.log.level?r.Z.log.level:"warn";return i[this._parentWithMember("level",t)]<=i[e]}_argsToKey(...e){return(0,s.hP)(JSON.stringify(e,((e,t)=>"object"!=typeof t||Array.isArray(t)?t:"[Object]")))}static _scheduleTickCounterIncrement(){a._tickCounterScheduled||(a._tickCounterScheduled=!0,Promise.resolve().then((()=>{a._tickCounter++,a._tickCounterScheduled=!1})))}}a._loggers={},a._tickCounter=0,a._tickCounterScheduled=!1,a._throttlingDisabled=!1},58896:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(78286);class o{constructor(e,t,n){this.name=e,this.details=n,this instanceof o&&(this.message=(t&&function(e,t){return e.replace(/\$\{([^\s\:\}]*)(?:\:([^\s\:\}]+))?\}/g,((e,n)=>{if(""===n)return"$";const o=(0,r.hS)(n,t)??"";if(void 0===o)throw new Error(`could not find key "${n}" in template`);return o.toString()}))}(t,n))??"")}toString(){return"["+this.name+"]: "+this.message}}},77734:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});class r{constructor(e=1){this._seed=e}set seed(e){this._seed=e??Math.random()*r._m}getInt(){return this._seed=(r._a*this._seed+r._c)%r._m,this._seed}getFloat(){return this.getInt()/(r._m-1)}getIntRange(e,t){return Math.round(this.getFloatRange(e,t))}getFloatRange(e,t){const n=t-e;return e+this.getInt()/r._m*n}}r._m=2147483647,r._a=48271,r._c=0},67676:(e,t,n)=>{"use strict";n.d(t,{FY:()=>m,Od:()=>y,SO:()=>d,Vx:()=>i,a9:()=>u,cq:()=>p,e$:()=>b,e5:()=>a,fS:()=>s,w6:()=>f,zG:()=>c});var r=n(70586),o=n(77734);function s(e,t,n){if((0,r.Wi)(e)&&(0,r.Wi)(t))return!0;if((0,r.Wi)(e)||(0,r.Wi)(t)||e.length!==t.length)return!1;if(n){for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1}else for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function i(e,t){let n=e.length!==t.length;n&&(e.length=t.length);for(let r=0;r<t.length;++r)e[r]!==t[r]&&(e[r]=t[r],n=!0);return n}function a(e,t,n){let r,o;return n?(r=t.filter((t=>!e.some((e=>n(e,t))))),o=e.filter((e=>!t.some((t=>n(t,e)))))):(r=t.filter((t=>!e.includes(t))),o=e.filter((e=>!t.includes(e)))),{added:r,removed:o}}function c(e){return e&&"number"==typeof e.length}const l=!!Array.prototype.fill;function u(e,t){if(l)return new Array(e).fill(t);const n=new Array(e);for(let r=0;r<e;r++)n[r]=t;return n}function f(e,t){void 0===t&&(t=e,e=0);const n=new Array(t-e);for(let r=e;r<t;r++)n[r-e]=r;return n}class d{constructor(){this.last=0}}const h=new d;function p(e,t,n,r){r=r||h;const o=Math.max(0,r.last-10);for(let s=o;s<n;++s)if(e[s]===t)return r.last=s,s;const s=Math.min(o,n);for(let n=0;n<s;++n)if(e[n]===t)return r.last=n,n;return-1}function b(e,t,n,r){const o=n??e.length,s=p(e,t,o,r);if(-1!==s)return e[s]=e[o-1],null==n&&e.pop(),t}const g=new Set;function m(e,t,n=e.length,r=t.length,o,s){if(0===r||0===n)return n;g.clear();for(let e=0;e<r;++e)g.add(t[e]);o=o||h;const i=Math.max(0,o.last-10);for(let t=i;t<n;++t)if(g.has(e[t])&&(s&&s.push(e[t]),g.delete(e[t]),e[t]=e[n-1],--n,--t,0===g.size||0===n))return g.clear(),n;for(let t=0;t<i;++t)if(g.has(e[t])&&(s&&s.push(e[t]),g.delete(e[t]),e[t]=e[n-1],--n,--t,0===g.size||0===n))return g.clear(),n;return g.clear(),n}function y(e,t){const n=e.indexOf(t);return-1!==n?(e.splice(n,1),t):null}new o.Z},60235:(e,t,n)=>{"use strict";n.d(t,{Mr:()=>i,x9:()=>a});var r=n(80442);const o=new Set;function s(e,t,n=!1){n&&o.has(t)||(n&&o.add(t),e.warn(`🛑 DEPRECATED - ${t}`))}function i(e,t,n={}){if((0,r.Z)("esri-deprecation-warnings")){const{moduleName:r}=n;a(e,"Property: "+(r?r+"::":"")+t,n)}}function a(e,t,n={}){if((0,r.Z)("esri-deprecation-warnings")){const{replacement:r,version:o,see:i,warnOnce:a}=n;let c=t;r&&(c+=`\n\t🛠️ Replacement: ${r}`),o&&(c+=`\n\t⚙️ Version: ${o}`),i&&(c+=`\n\t🔗 See ${i} for more details.`),s(e,c,a)}}},91460:(e,t,n)=>{"use strict";function r(e){return e&&("function"==typeof e.on||"function"==typeof e.addEventListener)}function o(e,t,n){if(!r(e))throw new TypeError("target is not a Evented or EventTarget object");if("on"in e)return e.on(t,n);if(Array.isArray(t)){const r=t.slice();for(const t of r)e.addEventListener(t,n);return{remove(){for(const t of r)e.removeEventListener(t,n)}}}return e.addEventListener(t,n),{remove(){e.removeEventListener(t,n)}}}function s(e,t,n){if(!r(e))throw new TypeError("target is not a Evented or EventTarget object");if("once"in e)return e.once(t,n);const s=o(e,t,(t=>{s.remove(),n.call(e,t)}));return{remove(){s.remove()}}}n.d(t,{IH:()=>s,on:()=>o,vT:()=>r})},80442:(e,t,n)=>{"use strict";let r;function o(e){return"function"==typeof r[e]?r[e]=r[e](globalThis):r[e]}n.d(t,{Z:()=>o}),r=globalThis.dojoConfig?.has||globalThis.esriConfig?.has?{...globalThis.dojoConfig?.has,...globalThis.esriConfig?.has}:{},o.add=(e,t,n,s)=>((s||void 0===r[e])&&(r[e]=t),n&&o(e)),o.cache=r,o.add("esri-deprecation-warnings",!0),(()=>{o.add("host-webworker",void 0!==globalThis.WorkerGlobalScope&&self instanceof globalThis.WorkerGlobalScope);const e="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(o.add("host-browser",e),o.add("host-node","object"==typeof globalThis.process&&globalThis.process.versions?.node&&globalThis.process.versions.v8),o.add("dom",e),o("host-browser")){const e=navigator,t=e.userAgent,n=e.appVersion,r=parseFloat(n);if(o.add("wp",parseFloat(t.split("Windows Phone")[1])||void 0),o.add("msapp",parseFloat(t.split("MSAppHost/")[1])||void 0),o.add("khtml",n.includes("Konqueror")?r:void 0),o.add("edge",parseFloat(t.split("Edge/")[1])||void 0),o.add("opr",parseFloat(t.split("OPR/")[1])||void 0),o.add("webkit",!o("wp")&&!o("edge")&&parseFloat(t.split("WebKit/")[1])||void 0),o.add("chrome",!o("edge")&&!o("opr")&&parseFloat(t.split("Chrome/")[1])||void 0),o.add("android",!o("wp")&&parseFloat(t.split("Android ")[1])||void 0),o.add("safari",!n.includes("Safari")||o("wp")||o("chrome")||o("android")||o("edge")||o("opr")?void 0:parseFloat(n.split("Version/")[1])),o.add("mac",n.includes("Macintosh")),!o("wp")&&t.match(/(iPhone|iPod|iPad)/)){const e=RegExp.$1.replace(/P/,"p"),n=t.match(/OS ([\d_]+)/)?RegExp.$1:"1",r=parseFloat(n.replace(/_/,".").replace(/_/g,""));o.add(e,r),o.add("ios",r)}o.add("trident",parseFloat(n.split("Trident/")[1])||void 0),o("webkit")||(!t.includes("Gecko")||o("wp")||o("khtml")||o("trident")||o("edge")||o.add("mozilla",r),o("mozilla")&&o.add("ff",parseFloat(t.split("Firefox/")[1]||t.split("Minefield/")[1])||void 0))}})(),(()=>{if(globalThis.navigator){const e=navigator.userAgent,t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),n=/iPhone/i.test(e);t&&o.add("esri-mobile",t),n&&o.add("esri-iPhone",n),o.add("esri-geolocation",!!navigator.geolocation)}o.add("esri-canvas-svg-support",!o("trident")),o.add("esri-wasm","WebAssembly"in globalThis),o.add("esri-shared-array-buffer",(()=>{const e="SharedArrayBuffer"in globalThis,t=!1===globalThis.crossOriginIsolated;return e&&!t})),o.add("wasm-simd",(()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])))),o.add("esri-atomics","Atomics"in globalThis),o.add("esri-workers","Worker"in globalThis),o.add("web-feat:cache","caches"in globalThis),o.add("esri-workers-arraybuffer-transfer",!o("safari")||Number(o("safari"))>=12),o.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),o.add("featurelayer-simplify-payload-size-factors",[1,1,4]),o.add("featurelayer-snapshot-enabled",!0),o.add("featurelayer-snapshot-point-min-threshold",8e4),o.add("featurelayer-snapshot-point-max-threshold",4e5),o.add("featurelayer-snapshot-point-coverage",.1),o.add("featurelayer-advanced-symbols",!1),o.add("featurelayer-pbf",!0),o.add("featurelayer-pbf-statistics",!1),o.add("feature-layers-workers",!0),o.add("feature-polyline-generalization-factor",1),o.add("mapview-transitions-duration",200),o.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),o.add("mapserver-pbf-enabled",!1),o.add("mapimagelayer-popup-identify-max-tolerance",20),o.add("heatmap-allow-raster-fallback",!0),o.add("heatmap-force-raster",!1),o("host-webworker")||o("host-browser")&&(o.add("esri-csp-restrictions",(()=>{try{new Function}catch{return!0}return!1})),o.add("esri-image-decode",(()=>{if("decode"in new Image){const e=new Image;return e.src='data:image/svg+xml;charset=UTF-8,<svg version="1.1" xmlns="http://www.w3.org/2000/svg"></svg>',void e.decode().then((()=>{o.add("esri-image-decode",!0,!0,!0)})).catch((()=>{o.add("esri-image-decode",!1,!0,!0)}))}return!1})),o.add("esri-url-encodes-apostrophe",(()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")})))})()},22974:(e,t,n)=>{"use strict";n.d(t,{Vo:()=>c,d9:()=>a,fS:()=>p,y7:()=>b,yd:()=>i});var r=n(67676),o=(n(80442),n(70586)),s=n(1533);function i(e,t){let n;if(t)for(n in e)e.hasOwnProperty(n)&&(void 0===e[n]?delete e[n]:e[n]instanceof Object&&i(e[n],!0));else for(n in e)e.hasOwnProperty(n)&&void 0===e[n]&&delete e[n];return e}function a(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=h(e);if((0,o.pC)(t))return t;if(l(e))return e.clone();if(u(e))return e.map(a);if(f(e))return e.clone();const n={};for(const t of Object.getOwnPropertyNames(e))n[t]=a(e[t]);return n}function c(e){if(!e||"object"!=typeof e||"function"==typeof e||e instanceof HTMLElement)return e;const t=h(e);if((0,o.pC)(t))return t;if(u(e)){let t=!0;const n=e.map((e=>{const n=c(e);return null!=e&&null==n&&(t=!1),n}));return t?n:null}if(l(e))return e.clone();if(!f(e)){const t=new(0,Object.getPrototypeOf(e).constructor);for(const n of Object.getOwnPropertyNames(e)){const r=e[n],o=c(r);if(null!=r&&null==o)return null;t[n]=o}return t}return null}function l(e){return"function"==typeof e.clone}function u(e){return"function"==typeof e.map&&"function"==typeof e.forEach}function f(e){return"function"==typeof e.notifyChange&&"function"==typeof e.watch}function d(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function h(e){if((0,s.W0)(e)||(0,s.lq)(e)||(0,s.KZ)(e)||(0,s.z3)(e)||(0,s.Uc)(e)||(0,s.Hx)(e)||(0,s.ZY)(e)||(0,s.xZ)(e)||(0,s.fS)(e))return(0,s.tP)(e);if(e instanceof Date)return new Date(e.getTime());if(e instanceof ArrayBuffer)return e.slice(0,e.byteLength);if(e instanceof Map){const t=new Map;for(const[n,r]of e)t.set(n,a(r));return t}if(e instanceof Set){const t=new Set;for(const n of e)t.add(a(n));return t}return null}function p(e,t){return e===t||"number"==typeof e&&isNaN(e)&&"number"==typeof t&&isNaN(t)||"function"==typeof(e||{}).getTime&&"function"==typeof(t||{}).getTime&&e.getTime()===t.getTime()||!1}function b(e,t){return e===t||(null==e||"string"==typeof e?e===t:"number"==typeof e?e===t||"number"==typeof t&&isNaN(e)&&isNaN(t):e instanceof Date?t instanceof Date&&e.getTime()===t.getTime():Array.isArray(e)?Array.isArray(t)&&(0,r.fS)(e,t):e instanceof Set?t instanceof Set&&function(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}(e,t):e instanceof Map?t instanceof Map&&function(e,t){if(e.size!==t.size)return!1;for(const[n,r]of e){const e=t.get(n);if(e!==r||void 0===e&&!t.has(n))return!1}return!0}(e,t):!!d(e)&&d(t)&&function(e,t){if(null===e||null===t)return!1;const n=Object.keys(e);if(null===t||Object.keys(t).length!==n.length)return!1;for(const r of n)if(e[r]!==t[r]||!Object.prototype.hasOwnProperty.call(t,r))return!1;return!0}(e,t))}},70586:(e,t,n)=>{"use strict";function r(e){return null!=e}function o(e){return null==e}function s(e,t){return r(e)?t(e):null}function i(e){return e}function a(e,t){return c(e,t),e}function c(e,t){if(o(e))throw new Error(t??"value is None")}function l(e,t){return r(e)?e:"function"==typeof t?t():t}function u(e,t){return r(e)?e:t}function f(e){return r(e)&&e.destroy(),null}function d(e){return r(e)&&e.dispose(),null}function h(e){return r(e)&&e.remove(),null}function p(e){return r(e)&&e.abort(),null}function b(e){return r(e)&&e.release(),null}function g(e,t,n){return r(e)&&r(t)?r(n)?n(e,t):e.equals(t):e===t}function m(e){return null}function y(e,t){const n=new Array;for(const r of e)n.push(v(r,null,t));return n}function w(e,t){for(const n of e)s(n,t)}function v(e,t,n){return r(e)?n(e):t}function _(e){return e.filter((e=>r(e)))}function O(e,...t){let n=e;for(let e=0;e<t.length&&n;++e)n=n[t[e]];return n}function k(e){return e}n.d(t,{Fd:()=>y,IM:()=>p,JR:()=>w,M2:()=>d,O3:()=>c,Pt:()=>l,R2:()=>v,RY:()=>b,SC:()=>f,U2:()=>O,Wg:()=>i,Wi:()=>o,_W:()=>g,hw:()=>h,j0:()=>k,lV:()=>_,pC:()=>r,s3:()=>a,wN:()=>m,yl:()=>u,yw:()=>s})},78286:(e,t,n)=>{"use strict";n.d(t,{RB:()=>i,RH:()=>o,hS:()=>s});var r=n(22974);function o(e,t,n=!1){return c(e,t,n)}function s(e,t){if(null!=t)return t[e]||a(e.split("."),!1,t)}function i(e,t,n){const r=e.split("."),o=r.pop(),s=a(r,!0,n);s&&o&&(s[o]=t)}function a(e,t,n){let r=n;for(const n of e){if(null==r)return;if(!(n in r)){if(!t)return;r[n]={}}r=r[n]}return r}function c(e,t,n){return t?Object.keys(t).reduce(((e,o)=>{let s=e[o],i=t[o];return s===i?e:void 0===s?(e[o]=(0,r.d9)(i),e):(Array.isArray(i)||Array.isArray(e)?(s=s?Array.isArray(s)?e[o]=s.concat():e[o]=[s]:e[o]=[],i&&(Array.isArray(i)||(i=[i]),n?i.forEach((e=>{s.includes(e)||s.push(e)})):e[o]=i.concat())):i&&"object"==typeof i?e[o]=c(s,i,n):e.hasOwnProperty(o)&&!t.hasOwnProperty(o)||(e[o]=i),e)}),e||{}):e}},95330:(e,t,n)=>{"use strict";n.d(t,{e4:()=>O,zE:()=>c,dD:()=>w,hh:()=>C,Ds:()=>S,as:()=>v,WW:()=>_,R8:()=>y,D_:()=>m,Hc:()=>f,y8:()=>k,fu:()=>p,$F:()=>b,r9:()=>d,k_:()=>l,H9:()=>h,Yn:()=>A,gx:()=>P,Hl:()=>g});const r=(o=globalThis,{setTimeout:(e,t)=>{const n=o.setTimeout(e,t);return{remove:()=>o.clearTimeout(n)}}});var o;n(60235);var s=n(20102),i=n(91460),a=(n(92604),n(70586));function c(e="Aborted"){return new s.Z("AbortError",e)}function l(e,t="Aborted"){if(f(e))throw c(t)}function u(e){return(0,a.pC)(e)?"aborted"in e?e:e.signal:e}function f(e){const t=u(e);return(0,a.pC)(t)&&t.aborted}function d(e){if(m(e))throw e}function h(e){if(!m(e))throw e}function p(e,t){const n=u(e);if(!(0,a.Wi)(n)){if(!n.aborted)return(0,i.IH)(n,"abort",(()=>t()));t()}}function b(e,t){const n=u(e);if(!(0,a.Wi)(n))return l(n),(0,i.IH)(n,"abort",(()=>t(c())))}function g(e,t){const n=u(t);return(0,a.Wi)(n)?e:new Promise(((n,r)=>{let o=p(t,(()=>r(c())));const s=()=>o=(0,a.hw)(o);e.then(s,s),e.then(n,r)}))}function m(e){return"AbortError"===e?.name}async function y(e){try{return await e}catch(e){if(!m(e))throw e;return}}function w(){let e=null;const t=new Promise(((t,n)=>{e={promise:void 0,resolve:t,reject:n}}));return e.promise=t,e}async function v(e){if(!e)return;if("function"!=typeof e.forEach){const t=Object.keys(e),n=t.map((t=>e[t])),r=await v(n),o={};return t.map(((e,t)=>o[e]=r[t])),o}const t=e;return new Promise((e=>{const n=[];let r=t.length;0===r&&e(n),t.forEach((t=>{const o={promise:t||Promise.resolve(t)};n.push(o),o.promise.then((e=>{o.value=e})).catch((e=>{o.error=e})).then((()=>{--r,0===r&&e(n)}))}))}))}async function _(e){return(await v(e)).filter((e=>!!e.value)).map((e=>e.value))}function O(e,t,n){const r=new AbortController;return p(n,(()=>r.abort())),new Promise(((n,o)=>{let s=setTimeout((()=>{s=0,n(t)}),e);p(r,(()=>{s&&(clearTimeout(s),o(c()))}))}))}function k(e){return e&&"function"==typeof e.then}function P(e){return k(e)?e:Promise.resolve(e)}function S(e,t=-1){let n,r,o,s,i=null;const l=(...u)=>{if(n){r=u,s&&s.reject(c()),s=w();const e=(0,a.j0)(s.promise);if(i){const e=i;i=null,e.abort()}return e}if(o=s||w(),s=null,t>0){const r=new AbortController;n=P(e(...u,r.signal));const o=n;O(t).then((()=>{n===o&&(s?r.abort():i=r)}))}else n=1,n=P(e(...u));const f=()=>{const e=r;r=o=n=i=null,null!=e&&l(...e)},d=n,h=o;return d.then(f,f),d.then(h.resolve,h.reject),(0,a.j0)(h.promise)};return l}function C(){let e,t;const n=new Promise(((n,r)=>{e=n,t=r})),o=t=>{e(t)};return o.resolve=t=>e(t),o.reject=e=>t(e),o.timeout=(e,t)=>r.setTimeout((()=>o.reject(t)),e),o.promise=n,o}async function A(e){await Promise.resolve(),l(e)}},19153:(e,t,n)=>{"use strict";n.d(t,{Cb:()=>l,Qs:()=>a,gx:()=>i,hP:()=>c});var r=n(78286);const o=/\{([^\}]+)\}/g;function s(e){return e??""}function i(e,t){return e.replace(o,"object"==typeof t?(e,n)=>s((0,r.hS)(n,t)):(e,n)=>s(t(n)))}function a(e,t){return e.replace(/([\.$?*|{}\(\)\[\]\\\/\+\-^])/g,(e=>t&&t.includes(e)?e:`\\${e}`))}function c(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t}function l(e){return(new DOMParser).parseFromString(e||"","text/html").body.innerText||""}},1533:(e,t,n)=>{"use strict";function r(e,t){if(e.forEach)e.forEach(t);else for(let n=0;n<e.length;n++)t(e[n],n,e)}function o(e,t,n){if(e.slice)return e.slice(t,n);void 0===t?t=0:(t<0&&(t+=e.length),t=Math.min(e.length,Math.max(0,t))),void 0===n?n=e.length:(n<0&&(n+=e.length),n=Math.min(e.length,Math.max(0,n)));const r=Math.max(0,n-t),o=new(0,e.constructor)(r);for(let n=0;n<r;n++)o[n]=e[t+n];return o}function s(e){return e instanceof ArrayBuffer||e&&e.constructor&&"ArrayBuffer"===e.constructor.name}function i(e){return e instanceof Int8Array||e&&e.constructor&&"Int8Array"===e.constructor.name}function a(e){return e instanceof Uint8Array||e&&e.constructor&&"Uint8Array"===e.constructor.name}function c(e){return e instanceof Uint8ClampedArray||e&&e.constructor&&"Uint8ClampedArray"===e.constructor.name}function l(e){return e instanceof Int16Array||e&&e.constructor&&"Int16Array"===e.constructor.name}function u(e){return e instanceof Uint16Array||e&&e.constructor&&"Uint16Array"===e.constructor.name}function f(e){return e instanceof Int32Array||e&&e.constructor&&"Int32Array"===e.constructor.name}function d(e){return e instanceof Uint32Array||e&&e.constructor&&"Uint32Array"===e.constructor.name}function h(e){return e instanceof Float32Array||e&&e.constructor&&"Float32Array"===e.constructor.name}function p(e){return e instanceof Float64Array||e&&e.constructor&&"Float64Array"===e.constructor.name}n.d(t,{Ed:()=>r,Hx:()=>f,KZ:()=>c,Uc:()=>u,W0:()=>i,ZY:()=>d,eP:()=>s,fS:()=>p,lq:()=>a,tP:()=>o,xZ:()=>h,z3:()=>l})},17452:(e,t,n)=>{"use strict";n.d(t,{$U:()=>re,AH:()=>V,B7:()=>A,D6:()=>U,Fv:()=>Z,HK:()=>K,Hu:()=>de,Ie:()=>ue,L:()=>k,Ml:()=>be,P$:()=>B,PF:()=>F,Qj:()=>le,R9:()=>y,TI:()=>O,YP:()=>H,Yd:()=>ae,ZN:()=>he,_l:()=>X,b7:()=>j,ed:()=>N,fZ:()=>ge,fl:()=>pe,hF:()=>q,hO:()=>oe,io:()=>ee,jc:()=>z,kl:()=>L,mN:()=>P,oC:()=>te,oh:()=>W,qg:()=>E,rS:()=>Q,sJ:()=>Y,tD:()=>$,tm:()=>I,u0:()=>S,v_:()=>D,vt:()=>ce});var r=n(68773),o=n(20102),s=n(92604),i=n(70586);const a=s.Z.getLogger("esri.core.urlUtils"),c=r.Z.request,l="esri/config: esriConfig.request.proxyUrl is not set.",u=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,f=/^\s*http:/i,d=/^\s*https:/i,h=/^\s*file:/i,p=/:\d+$/,b=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,g=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),m=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");class y{constructor(e=""){this.uri=e,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let t=(0,i.j0)(this.uri.match(g));this.scheme=t[2]||(t[1]?"":null),this.authority=t[4]||(t[3]?"":null),this.path=t[5],this.query=t[7]||(t[6]?"":null),this.fragment=t[9]||(t[8]?"":null),null!=this.authority&&(t=(0,i.j0)(this.authority.match(m)),this.user=t[3]||null,this.password=t[4]||null,this.host=t[6]||t[7],this.port=t[9]||null)}toString(){return this.uri}}const w={};let v=new y(r.Z.applicationUrl);let _=function(){const e=(0,i.j0)(v.path),t=e.substring(0,e.lastIndexOf(e.split("/")[e.split("/").length-1]));return`${v.scheme}://${v.host}${null!=v.port?`:${v.port}`:""}${t}`}();const O=()=>v,k=()=>_;function P(e){if(!e)return null;const t={path:null,query:null},n=new y(e),r=e.indexOf("?");return null===n.query?t.path=e:(t.path=e.substring(0,r),t.query=S(n.query)),n.fragment&&(t.hash=n.fragment,null===n.query&&(t.path=t.path.substring(0,t.path.length-(n.fragment.length+1)))),t}function S(e){const t=e.split("&"),n={};for(const e of t){if(!e)continue;const t=e.indexOf("=");let r,o;t<0?(r=decodeURIComponent(e),o=""):(r=decodeURIComponent(e.slice(0,t)),o=decodeURIComponent(e.slice(t+1)));let s=n[r];"string"==typeof s&&(s=n[r]=[s]),Array.isArray(s)?s.push(o):n[r]=o}return n}function C(e){return e&&"object"==typeof e&&"toJSON"in e&&"function"==typeof e.toJSON}function A(e,t){return e?t&&"function"==typeof t?Object.keys(e).map((n=>encodeURIComponent(n)+"="+encodeURIComponent(t(n,e[n])))).join("&"):Object.keys(e).map((n=>{const r=e[n];if(null==r)return"";const o=encodeURIComponent(n)+"=",s=t&&t[n];return s?o+encodeURIComponent(s(r)):Array.isArray(r)?r.map((e=>C(e)?o+encodeURIComponent(JSON.stringify(e)):o+encodeURIComponent(e))).join("&"):C(r)?o+encodeURIComponent(JSON.stringify(r)):o+encodeURIComponent(r)})).filter((e=>e)).join("&"):""}function j(e=!1){let t,n=c.proxyUrl;if("string"==typeof e){t=re(e);const r=N(e);r&&(n=r.proxyUrl)}else t=!!e;if(!n)throw a.warn(l),new o.Z("urlutils:proxy-not-set",l);return t&&se()&&(n=oe(n)),P(n)}function E(e){const t=N(e);let n,r;if(t){const e=T(t.proxyUrl);n=e.path,r=e.query?S(e.query):null}if(n){const t=P(e);e=n+"?"+t.path;const o=A({...r,...t.query});o&&(e=`${e}?${o}`)}return e}const x={path:"",query:""};function T(e){const t=e.indexOf("?");return-1!==t?(x.path=e.slice(0,t),x.query=e.slice(t+1)):(x.path=e,x.query=null),x}function M(e){return(e=ie(e=function(e){return e&&"/"===e[e.length-1]?e:`${e}/`}(e=T(e).path),!0)).toLowerCase()}function $(e){const t={proxyUrl:e.proxyUrl,urlPrefix:M(e.urlPrefix)},n=c.proxyRules,r=t.urlPrefix;let o=n.length;for(let e=0;e<n.length;e++){const t=n[e].urlPrefix;if(0===r.indexOf(t)){if(r.length===t.length)return-1;o=e;break}0===t.indexOf(r)&&(o=e+1)}return n.splice(o,0,t),o}function N(e){const t=c.proxyRules,n=M(e);for(let e=0;e<t.length;e++)if(0===n.indexOf(t[e].urlPrefix))return t[e]}function I(e,t){return e=R(e),t=R(t),ie(e)===ie(t)}function R(e){const t=(e=Z(e)).indexOf("/sharing");return t>0?e.substring(0,t):e.replace(/\/+$/,"")}function W(e){const t=t=>null==t||t instanceof RegExp&&t.test(e)||"string"==typeof t&&e.startsWith(t),n=c.interceptors;if(n)for(const e of n)if(Array.isArray(e.urls)){if(e.urls.some(t))return e}else if(t(e.urls))return e;return null}function U(e,t,n=!1){if(!e||!t)return!1;const r=fe(e),o=fe(t);return!(!n&&r.scheme!==o.scheme)&&null!=r.host&&null!=o.host&&r.host.toLowerCase()===o.host.toLowerCase()&&r.port===o.port}function L(e){if("string"==typeof e){if(!H(e))return!0;e=fe(e)}if(U(e,v))return!0;const t=c.trustedServers||[];for(let n=0;n<t.length;n++){const r=J(t[n]);for(let t=0;t<r.length;t++)if(U(e,r[t]))return!0}return!1}function J(e){return w[e]||(ne(e)||te(e)?w[e]=[new y(q(e))]:w[e]=[new y(`http://${e}`),new y(`https://${e}`)]),w[e]}function q(e,t=_,n){return te(e)?n&&n.preserveProtocolRelative?e:"http"===v.scheme&&v.authority===B(e).slice(2)?`http:${e}`:`https:${e}`:ne(e)?e:(0,i.j0)(D("/"===e[0]?function(e){const t=e.indexOf("//"),n=e.indexOf("/",t+2);return-1===n?e:e.slice(0,n)}(t):t,e))}function F(e,t=_,n){if(null==e||!H(e))return e;const r=Z(e),o=r.toLowerCase(),s=Z(t).toLowerCase().replace(/\/+$/,""),i=n?Z(n).toLowerCase().replace(/\/+$/,""):null;if(i&&0!==s.indexOf(i))return e;const a=(e,t,n)=>-1===(n=e.indexOf(t,n))?e.length:n;let c=a(o,"/",o.indexOf("//")+2),l=-1;for(;o.slice(0,c+1)===s.slice(0,c)+"/"&&(l=c+1,c!==o.length);)c=a(o,"/",c+1);if(-1===l)return e;if(i&&l<i.length)return e;e=r.slice(l);const u=s.slice(l-1).replace(/[^/]+/g,"").length;if(u>0)for(let t=0;t<u;t++)e=`../${e}`;else e=`./${e}`;return e}function Z(e){return function(e){const t=c.httpsDomains;if(!function(e){return null!=e&&f.test(e)||"http"===v.scheme&&te(e)}(e))return e;const n=e.indexOf("/",7);let r;if(r=-1===n?e:e.slice(0,n),r=r.toLowerCase().slice(7),p.test(r)){if(!r.endsWith(":80"))return e;r=r.slice(0,-3),e=e.replace(":80","")}return"http"===v.scheme&&r===v.authority&&!b.test(e)||(se()&&r===v.authority||t&&t.some((e=>r===e||r.endsWith(`.${e}`)))||se()&&!N(e))&&(e=oe(e)),e}(e=function(e){return e.replace(/^(https?:\/\/)(arcgis\.com)/i,"$1www.$2")}(e=function(e){if(/^https?:\/\//i.test(e)){const t=T(e);e=(e=t.path.replace(/\/{2,}/g,"/")).replace("/","//"),t.query&&(e+=`?${t.query}`)}return e}(e=q(e=e.trim()))))}function D(...e){const t=e.filter(i.pC);if(!t||!t.length)return;const n=[];if(H(t[0])){const e=t[0],r=e.indexOf("//");-1!==r&&(n.push(e.slice(0,r+1)),function(e){return null!=e&&h.test(e)}(t[0])&&(n[0]+="/"),t[0]=e.slice(r+2))}else"/"===t[0][0]&&n.push("");const r=t.reduce(((e,t)=>t?e.concat(t.split("/")):e),[]);for(let e=0;e<r.length;e++){const t=r[e];".."===t&&n.length>0&&".."!==n[n.length-1]?n.pop():(!t&&e===r.length-1||t&&("."!==t||0===n.length))&&n.push(t)}return n.join("/")}function B(e,t=!1){if(null==e||z(e)||K(e))return null;let n=e.indexOf("://");if(-1===n&&te(e))n=2;else{if(-1===n)return null;n+=3}const r=e.indexOf("/",n);return-1!==r&&(e=e.slice(0,r)),t&&(e=ie(e,!0)),e}function H(e){return te(e)||ne(e)}function z(e){return null!=e&&"blob:"===e.slice(0,5)}function K(e){return null!=e&&"data:"===e.slice(0,5)}function V(e){const t=Y(e);if(!t||!t.isBase64)return null;const n=atob(t.data),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r.buffer}function Q(e){return btoa(String.fromCharCode.apply(null,e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const G=/^data:(.*?)(;base64)?,(.*)$/;function Y(e){const t=e.match(G);if(!t)return null;const[,n,r,o]=t;return{mediaType:n,isBase64:!!r,data:o}}function X(e){return e.isBase64?`data:${e.mediaType};base64,${e.data}`:`data:${e.mediaType},${e.data}`}function ee(e,t){(function(e,t){if(!e)return!1;const n=document.createElement("a");if(!("download"in n))return!1;const r=URL.createObjectURL(e);return n.download=t,n.href=r,n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r),!0})(e,t)||function(e,t){!!window.navigator.msSaveOrOpenBlob&&window.navigator.msSaveOrOpenBlob(e,t)}(e,t)}function te(e){return null!=e&&"/"===e[0]&&"/"===e[1]}function ne(e){return null!=e&&u.test(e)}function re(e){return null!=e&&d.test(e)||"https"===v.scheme&&te(e)}function oe(e){return te(e)?`https:${e}`:e.replace(f,"https:")}function se(){return"https"===v.scheme}function ie(e,t=!1){return te(e)?e.slice(2):(e=e.replace(u,""),t&&e.length>1&&"/"===e[0]&&"/"===e[1]&&(e=e.slice(2)),e)}function ae(e){let t=0;if(H(e)){const n=e.indexOf("//");-1!==n&&(t=n+2)}const n=e.lastIndexOf("/");return n<t?e:e.slice(0,n+1)}function ce(e,t){if(!e)return"";const n=P(e).path.replace(/\/+$/,""),r=n.substring(n.lastIndexOf("/")+1);if(!t?.length)return r;const o=new RegExp(`.(${t.join("|")})$`,"ig");return r.replace(o,"")}function le(e){return e.replace(/\/+$/,"")}function ue(e,t,n){if(!(t&&n&&e&&H(e)))return e;const r=e.indexOf("//"),o=e.indexOf("/",r+2),s=e.indexOf(":",r+2),i=Math.min(o<0?e.length:o,s<0?e.length:s);return e.slice(r+2,i).toLowerCase()!==t.toLowerCase()?e:`${e.slice(0,r+2)}${n}${e.slice(i)}`}function fe(e){return"string"==typeof e?new y(q(e)):(e.scheme||(e.scheme=v.scheme),e)}function de(e,t){const n=P(e),r=Object.keys(n.query||{});return r.length>0&&t&&t.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${r.join(", ")}.`),n.path}function he(e,t,n){const r=P(e),o=r.query||{};return o[t]=String(n),`${r.path}?${A(o)}`}function pe(e,t){const n=P(e),r=n.query||{};for(const e in t)r[e]=t[e];const o=A(r);return o?`${n.path}?${o}`:n.path}function be(e){if((0,i.Wi)(e))return null;const t=e.match(me);return t?t[2]:null}function ge(e){if((0,i.Wi)(e))return null;const t=e.match(me);return t?{path:t[1],extension:t[2]}:{path:e,extension:null}}const me=/([^.]*)\.([^\/]*)$/},25045:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>y});var r=n(40330),o=n(20102),s=n(91460),i=n(70586),a=n(95330),c=n(94362),l=n(17202);const u={statsWorker:()=>Promise.all([n.e(1400),n.e(1562),n.e(3847),n.e(6841)]).then(n.bind(n,36841)),geometryEngineWorker:()=>Promise.all([n.e(5837),n.e(8227)]).then(n.bind(n,48227)),CSVSourceWorker:()=>Promise.all([n.e(4547),n.e(1400),n.e(1534),n.e(1562),n.e(5886),n.e(3847),n.e(9777),n.e(8833),n.e(4807),n.e(8850)]).then(n.bind(n,14478)),EdgeProcessingWorker:()=>Promise.all([n.e(6481),n.e(212),n.e(2062)]).then(n.bind(n,49594)),ElevationSamplerWorker:()=>Promise.all([n.e(4547),n.e(1400),n.e(1562),n.e(4807),n.e(6481),n.e(6459),n.e(98)]).then(n.bind(n,61787)),FeatureServiceSnappingSourceWorker:()=>Promise.all([n.e(4547),n.e(4588),n.e(1400),n.e(1534),n.e(1562),n.e(5886),n.e(3847),n.e(4599),n.e(9777),n.e(8833),n.e(4807),n.e(2508)]).then(n.bind(n,65967)),GeoJSONSourceWorker:()=>Promise.all([n.e(4547),n.e(1400),n.e(1534),n.e(1562),n.e(5886),n.e(3847),n.e(9777),n.e(8833),n.e(4807),n.e(3281),n.e(7845)]).then(n.bind(n,97845)),LercWorker:()=>n.e(3027).then(n.bind(n,23027)),MemorySourceWorker:()=>Promise.all([n.e(4547),n.e(1400),n.e(1534),n.e(1562),n.e(5886),n.e(3847),n.e(9777),n.e(8833),n.e(4807),n.e(3281),n.e(639)]).then(n.bind(n,30639)),PBFDecoderWorker:()=>Promise.all([n.e(1400),n.e(1562),n.e(5886),n.e(802)]).then(n.bind(n,10802)),Pipeline:()=>Promise.all([n.e(4547),n.e(8476),n.e(4588),n.e(1400),n.e(1534),n.e(1562),n.e(5886),n.e(3847),n.e(4599),n.e(9777),n.e(8833),n.e(4325),n.e(7483)]).then(n.bind(n,37138)),PointCloudWorker:()=>Promise.all([n.e(4547),n.e(1400),n.e(1562),n.e(9324)]).then(n.bind(n,90447)),RasterWorker:()=>Promise.all([n.e(4547),n.e(1400),n.e(1562),n.e(8363),n.e(3645),n.e(4370)]).then(n.bind(n,61576)),SceneLayerSnappingSourceWorker:()=>Promise.all([n.e(4547),n.e(1400),n.e(1534),n.e(1562),n.e(5886),n.e(3847),n.e(9777),n.e(6481),n.e(212),n.e(5259)]).then(n.bind(n,65381)),SceneLayerWorker:()=>n.e(1412).then(n.bind(n,31412)),WFSSourceWorker:()=>Promise.all([n.e(4547),n.e(1400),n.e(1534),n.e(1562),n.e(5886),n.e(3847),n.e(9777),n.e(8833),n.e(4807),n.e(3281),n.e(3230)]).then(n.bind(n,43230)),WorkerTileHandler:()=>Promise.all([n.e(4325),n.e(1785),n.e(6810),n.e(3388)]).then(n.bind(n,56456))},{CLOSE:f,ABORT:d,INVOKE:h,RESPONSE:p,OPEN_PORT:b,ON:g}=c.Cs;class m{constructor(e){this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._invoke=e,this._timer=null,this._process=this._process.bind(this)}push(e){e.type===c.Cs.ABORT?this._cancelledJobIds.add(e.jobId):(this._invokeMessages.push(e),null===this._timer&&(this._timer=setTimeout(this._process,0)))}clear(){this._invokeMessages.length=0,this._cancelledJobIds.clear(),this._timer=null}_process(){this._timer=null;for(const e of this._invokeMessages)this._cancelledJobIds.has(e.jobId)||this._invoke(e);this._cancelledJobIds.clear(),this._invokeMessages.length=0}}class y{constructor(e,t,n){this._port=e,this._getNextJob=n,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new m((e=>this._onInvokeMessage(e))),this._client=t.client,this._onMessage=this._onMessage.bind(this),this._channel=t.channel,this._schedule=t.schedule,this._port.addEventListener("message",this._onMessage),this._port.start()}static connect(e){const t=new MessageChannel;let n;n="function"==typeof e?new e:"default"in e&&"function"==typeof e.default?new e.default:e;const r=new y(t.port1,{channel:t,client:n},(()=>null));return"object"==typeof n&&"remoteClient"in n&&(n.remoteClient=r),y.clients.set(r,n),t.port2}static loadWorker(e){const t=u[e];return t?t():Promise.resolve(null)}close(){this._post({type:f}),this._close()}isBusy(){return this._outJobs.size>0}invoke(e,t,n){const r=n&&n.signal,s=n&&n.transferList;if(!this._port)return Promise.reject(new o.Z("worker:port-closed",`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:t}));const l=(0,c.jt)();return new Promise(((n,o)=>{if((0,a.Hc)(r))return this._processWork(),void o((0,a.zE)());const c=(0,a.fu)(r,(()=>{const e=this._outJobs.get(l);e&&(this._outJobs.delete(l),this._processWork(),(0,i.hw)(e.abortHandle),this._post({type:d,jobId:l}),o((0,a.zE)()))})),u={resolve:n,reject:o,abortHandle:c,debugInfo:e};this._outJobs.set(l,u),this._post({type:h,jobId:l,methodName:e,abortable:null!=r},t,s)}))}on(e,t){const n=new MessageChannel;function r(e){t(e.data)}return this._port.postMessage({type:c.Cs.ON,eventType:e,port:n.port2},[n.port2]),n.port1.addEventListener("message",r),n.port1.start(),{remove(){n.port1.postMessage({type:c.Cs.CLOSE}),n.port1.close(),n.port1.removeEventListener("message",r)}}}jobAdded(){this._processWork()}openPort(){const e=new MessageChannel;return this._post({type:b,port:e.port2}),e.port1}_processWork(){if(this._outJobs.size>=2)return;const e=this._getNextJob();if(!e)return;const{methodName:t,data:n,invokeOptions:r,deferred:o}=e;this.invoke(t,n,r).then((e=>o.resolve(e))).catch((e=>o.reject(e)))}_close(){this._channel&&(this._channel=void 0),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach((e=>{(0,i.hw)(e.abortHandle),e.reject((0,a.zE)(`Worker closing, aborting job calling '${e.debugInfo}'`))})),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=this._client=this._schedule=null}_onMessage(e){(0,i.pC)(this._schedule)?this._schedule((()=>this._processMessage(e))):this._processMessage(e)}_processMessage(e){const t=(0,c.QM)(e);if(t)switch(t.type){case p:this._onResponseMessage(t);break;case h:this._invokeQueue.push(t);break;case d:this._onAbortMessage(t);break;case f:this._onCloseMessage();break;case b:this._onOpenPortMessage(t);break;case g:this._onOnMessage(t)}}_onAbortMessage(e){const t=this._inJobs,n=e.jobId,r=t.get(n);this._invokeQueue.push(e),r&&(r.controller&&r.controller.abort(),t.delete(n))}_onCloseMessage(){const e=this._client;this._close(),e&&"destroy"in e&&y.clients.get(this)===e&&e.destroy(),y.clients.delete(this),e&&e.remoteClient&&(e.remoteClient=null)}_onInvokeMessage(e){const{methodName:t,jobId:n,data:r,abortable:o}=e,s=o?new AbortController:null,i=this._inJobs;let l,u=this._client,f=u[t];try{if(!f&&t&&t.includes(".")){const e=t.split(".");for(let t=0;t<e.length-1;t++)u=u[e[t]],f=u[e[t+1]]}if("function"!=typeof f)throw new TypeError(`${t} is not a function`);l=f.call(u,r,{client:this,signal:s?s.signal:null})}catch(e){return void this._post({type:p,jobId:n,error:(0,c.AB)(e)})}(0,a.y8)(l)?(i.set(n,{controller:s,promise:l}),l.then((e=>{i.has(n)&&(i.delete(n),this._post({type:p,jobId:n},e))}),(e=>{i.has(n)&&(i.delete(n),(0,a.D_)(e)||this._post({type:p,jobId:n,error:(0,c.AB)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:p,jobId:n},l)}_onOpenPortMessage(e){new y(e.port,{client:this._client},(()=>null))}_onOnMessage(e){const{port:t}=e,n=this._client.on(e.eventType,(e=>{t.postMessage(e)})),r=(0,s.on)(e.port,"message",(e=>{(0,c.QM)(e)?.type===c.Cs.CLOSE&&(r.remove(),n.remove(),t.close())}))}_onResponseMessage(e){const{jobId:t,error:n,data:r}=e,s=this._outJobs;if(!s.has(t))return;const a=s.get(t);s.delete(t),this._processWork(),(0,i.hw)(a.abortHandle),n?a.reject(o.Z.fromJSON(JSON.parse(n))):a.resolve(r)}_post(e,t,n){return(0,c.oi)(this._port,e,t,n)}}y.kernelInfo={revision:l.$,version:r.i8,buildDate:l.r},y.clients=new Map},94362:(e,t,n)=>{"use strict";n.d(t,{AB:()=>a,Cs:()=>r,QM:()=>l,jt:()=>i,oi:()=>c});var r,o=n(80442);!function(e){e[e.HANDSHAKE=0]="HANDSHAKE",e[e.OPEN=1]="OPEN",e[e.OPENED=2]="OPENED",e[e.RESPONSE=3]="RESPONSE",e[e.INVOKE=4]="INVOKE",e[e.ABORT=5]="ABORT",e[e.CLOSE=6]="CLOSE",e[e.OPEN_PORT=7]="OPEN_PORT",e[e.ON=8]="ON"}(r||(r={}));let s=0;function i(){return s++}function a(e){return e?"string"==typeof e?JSON.stringify({name:"message",message:e}):e.toJSON?JSON.stringify(e):JSON.stringify({name:e.name,message:e.message,details:e.details||{stack:e.stack}}):null}function c(e,t,n,o){if(t.type===r.OPEN_PORT)return void e.postMessage(t,[t.port]);if(t.type!==r.INVOKE&&t.type!==r.RESPONSE)return void e.postMessage(t);let s;!function(e){return e&&"object"==typeof e&&("result"in e||"transferList"in e)}(n)?(s=u(o),t.data=n):(s=u(n.transferList),t.data=n.result),s?e.postMessage(t,s):e.postMessage(t)}function l(e){if(!e)return null;const t=e.data;return t?"string"==typeof t?JSON.parse(t):t:null}function u(e){if(!e||!e.length)return null;if((0,o.Z)("esri-workers-arraybuffer-transfer"))return e;const t=e.filter((e=>!function(e){return e instanceof ArrayBuffer||e&&e.constructor&&"ArrayBuffer"===e.constructor.name}(e)));return t.length?t:null}},40330:(e,t,n)=>{"use strict";n.d(t,{Dp:()=>l,Nv:()=>i,i8:()=>s,id:()=>a,qh:()=>c});var r=n(80442),o=n(17452);const s="4.25",i={async request(e,t){const{default:r}=await n.e(3172).then(n.bind(n,3172)),s=e.options,i=s.responseType;s.signal=t?.signal,s.responseType="native"===i||"native-request-init"===i?"native-request-init":i&&["blob","json","text"].includes(i)&&(0,o.oh)(e.url)?.after?i:"array-buffer";const a=await r(e.url,s),c={data:a.data,ssl:a.ssl};switch(a.requestOptions?.responseType){case"native-request-init":return delete c.data.signal,c;case"blob":c.data=await c.data.arrayBuffer();break;case"json":c.data=(new TextEncoder).encode(JSON.stringify(c.data)).buffer;break;case"text":c.data=(new TextEncoder).encode(c.data).buffer}return{result:c,transferList:[c.data]}}};let a;function c(e){a=e}function l(e){const t=a&&a.findCredential(e);return t&&t.token?(0,o.ZN)(e,"token",t.token):e}(0,r.Z)("host-webworker")},17202:(e,t,n)=>{"use strict";n.d(t,{$:()=>o,r:()=>r});const r="20221015",o="cb41a0fa390a91031e584947652202f955227603"}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,n),s.exports}n.m=e,n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>"chunks/"+{9:"00bbcd20b3ff26bf4e33",81:"e0457f3c3605e6963fe3",98:"dbf72099949febfae5a1",212:"4641e10e0e8e9d257521",223:"01fa42244b5e7498bb06",247:"9d9e3a38c54c41f7764c",402:"27ac78a350d4f24ad7b6",565:"e967ffca641947212992",576:"7fdd029a76a7ab1c3d83",639:"f607bb297787cc5987f5",661:"bee19483591ff9994495",719:"af047eb141d7522d2aaa",739:"cf0efbd948f6cec4e91e",802:"dae39baaab110eafce8b",819:"d1ead6e8aa7e8e21fbc6",837:"306cf603b4ab2fbd8abd",911:"f9506f185c9c7a28cab5",958:"a824435cb5bdd44486ae",1070:"4b7b54389fcd2f9918e4",1074:"1dcdde67304e8fe11fc0",1387:"7f31aac852462567f2e7",1400:"2d6d089176b6bd490b9f",1412:"cd11fcc3d9678ab4e115",1421:"6196cfdeb91ceba52af3",1423:"28c56e6fe5dec59423cb",1433:"4d5bdf18feeb9c8cb6ff",1534:"933f9b62a3a20e768927",1545:"c2c288d42129354dc218",1562:"e7b6f062a3a6357a76f8",1612:"9ac9fe42bb4a10308b2e",1761:"1a0e49dc1584f4eb006a",1773:"03ba86d2fd88270a0af4",1785:"3b5be512567d9c1c6fe6",2062:"c9c0dd4d9aaa9b794bd5",2133:"de6a1d1cfdc147455d57",2134:"63ed004a15ccd6bb4491",2324:"86cdbe154a7a3b3906c6",2508:"7a9e3f338f519c80f4b9",2664:"3e97c75c4b3a21b53b08",2710:"90c8d4df966803beb4c1",2855:"f33a0d4f1cfa08fdfed7",3027:"b88c012fa0b0e229a5e3",3172:"878bc2b24cc45418e819",3230:"d32b8fed33fccff22dc2",3281:"2a63949c3aad9ace1b44",3388:"0a2751a8c5fcb73cd7dc",3492:"1596b8a7b9c6533684d3",3529:"4b460f4a0ae2073e33ad",3645:"f684794c7fd8267f5331",3668:"965a8f23a36ff5f767e9",3743:"f827083b19b310990ca1",3810:"0c60d1901db74aca19e3",3847:"2e4a53412cf5bba1dfa5",3852:"b71a0a8a2f446c671161",4028:"ef684bae73b2861da9f1",4046:"f6f440a34cad6ea40f35",4166:"c067b0cec2d3fecdc3d2",4202:"46af54c9f3c14fd8c2c0",4210:"bcc462dfd250c252b399",4242:"23c595791a6c3926e597",4268:"a39a51e8a8369f6489bb",4325:"d91140bc583925e4faf6",4358:"71a4618d959a09302c51",4370:"8075832080224a0e9783",4436:"2e7b8bd584b0fb7896de",4475:"988a142646a0b05c9814",4499:"5a95c545405f5e3cb502",4547:"b728e77d1fa4b8439b14",4588:"e232e442b8efb4076cc4",4599:"e6c66a61b7b5ac4aef54",4695:"cfd83bad25be40fe14e9",4807:"cacdb5a9d31d0aaadbe3",4889:"16e9bd57f774944d0bf8",4992:"ef146810884ad0f267bb",5004:"2522e626a37bfa2eb4b3",5207:"9492ef8c526851e7f8a9",5235:"1888bf3e0ea96b682bd4",5259:"81087a50c8d8695cb523",5329:"0e21e5b4d065567a6a91",5468:"0da7751c5bb4827dd255",5546:"ea771551382731d2dd2b",5587:"a6906cf8378bfca89811",5732:"469ba1b24cdeea0758ec",5837:"ed59ec7a8688437ebdbc",5853:"c8a72cea37449aa40c4a",5886:"7e599e62d5c3e20474df",6233:"4cb64ccb5fba126f9a66",6237:"b686422160ea7e7ff5bb",6261:"64c503c9246e651af975",6418:"48cb5f427fc7a8a83c81",6459:"274b4cdf6c8d77e8a2e6",6481:"2e3a4fc59789013185f4",6584:"4c0d7a074083aa9614bb",6636:"63dbede7309f22ec3561",6710:"d828a0656e7351a74fc4",6748:"2c862f7497dd9933e0ac",6774:"c8402e32307a7b7eaaeb",6794:"10293b5c137c35b6c3fd",6810:"9bbcf17003f5650c4d96",6841:"8ee3da8677255b8c8709",6913:"cdcb512710f6f33af84e",6925:"2b2db231b234d7dd84e6",7035:"5abda500f5d5607155ab",7062:"e18503945ba8018b4be1",7126:"1475f89d86cfd422fd18",7160:"4d3c8f2c91223611ad9a",7202:"be752b2870b0a5134ac1",7269:"0cfb97b9f38c31b3b33a",7272:"c8a12264ea2c5020aa85",7275:"5e3686b68e1b5dfa0169",7277:"c2a6ac7046134f725cf3",7374:"9954cb1c0c50fb5b4833",7476:"bc89fbcd29f97caf1276",7483:"f3602470674e4cf06ebc",7541:"b17ff3dfdc638f9f5705",7572:"9383dab07abf7e29139e",7698:"ae96278f3df6ec54db79",7827:"59807a54b655261fa86d",7845:"8179031362a3b32545a1",7873:"4c989506b46bfec9c5ed",8092:"236cc6c02c45051e8ea9",8096:"22a990a8d4d4587866a5",8227:"ee04b1c0c42cb1b18b24",8325:"fbd49164a684776bce68",8326:"2d157ce4aab466555593",8363:"7bc9a3137dd2dc89e9cf",8383:"e8f4d7d25cf3383852e9",8476:"71b80cc32f9fc61fbbf8",8636:"6564744b18b3a87a954f",8694:"2d70499eacbd1d2a33a7",8758:"0439cac609d6109d37b6",8794:"91da49191ab09160a4df",8828:"2eb2d49c549e53934b8b",8833:"e7f4306c1f727afc5a45",8850:"8b08e9883ebae3eef429",8882:"d255a9b7e7a5d5d91dab",8899:"447eeae56c61a8e3b6e3",9070:"fc521bcd4fce711edb7e",9169:"76b75ac18c8239687321",9243:"47f88f15bae6918d46af",9268:"7fab18074b130b71a648",9291:"179efcf889111d2576c5",9296:"fcccbf3571b8d85833e8",9300:"3af4c3eb337fcc36878d",9324:"04b217c123ee55adb989",9356:"244cabe1762b545f06a0",9513:"b07fb0807e1bf2555c82",9777:"f6772f57bb1466e50d63",9790:"43200e78f2aa13a20bea",9880:"1b5bdd80db9a1a410ff8",9884:"356db8b8297282c77291",9903:"d2dd80fd9d54764edb45",9904:"b4da35f1093f3731f9ac",9956:"efd284732b5e6f8b29a5"}[e]+".js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");r.length&&(e=r[r.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{var e={134:1};n.f.i=(t,r)=>{e[t]||importScripts(n.p+n.u(t))};var t=self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[],r=t.push.bind(t);t.push=t=>{var[o,s,i]=t;for(var a in s)n.o(s,a)&&(n.m[a]=s[a]);for(i&&i(n);o.length;)e[o.pop()]=1;r(t)}})(),n(88277);var r=n(25045);RemoteClient=r})();