@arcgis/core 4.30.0-next.20240321 → 4.30.0-next.20240322

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 (83) hide show
  1. package/arcade/Dictionary.js +1 -1
  2. package/arcade/Feature.js +1 -1
  3. package/arcade/featureset/actions/Adapted.js +1 -1
  4. package/arcade/featureset/support/shared.js +1 -1
  5. package/arcade/featureset/support/sqlUtils.js +1 -1
  6. package/arcade/parser.js +1 -1
  7. package/arcade/validation/arcadeValidator.js +1 -1
  8. package/arcade/validation/languageKeywords.js +1 -1
  9. package/assets/esri/core/workers/RemoteClient.js +1 -1
  10. package/assets/esri/core/workers/chunks/{4e4ad7ac43a72a2f88a1.js → 0005267c754235ae6784.js} +1 -1
  11. package/assets/esri/core/workers/chunks/07fd6804c7eaa8d2ac3f.js +1 -0
  12. package/assets/esri/core/workers/chunks/{ff4151d794ec73064fac.js → 10b4fbdc0f8be85737f0.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{8fc69ac4cce6d4dd5513.js → 18a9b472007d4f2b7bbb.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{f484d2a3deb3c60d7038.js → 1ad1cdde4db5ab793623.js} +1 -1
  15. package/assets/esri/core/workers/chunks/36dfc55dc536b1831918.js +1 -0
  16. package/assets/esri/core/workers/chunks/{cee492b97e841a6d4678.js → 5b41ec1bd24314f6f153.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{d518a0adc3d88700235c.js → 65680926c761bf53fd14.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{9c78ccff1c7f8ae90b06.js → 671892e733d8976e48bb.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{4be6d5660ec1c8ac7606.js → 70188e0aa47da1aa1a7f.js} +1 -1
  20. package/assets/esri/core/workers/chunks/7c212395100080cf122e.js +1 -0
  21. package/assets/esri/core/workers/chunks/8c07e1000522c3251ac0.js +1 -0
  22. package/assets/esri/core/workers/chunks/9d240e70a24520b2a810.js +1 -0
  23. package/assets/esri/core/workers/chunks/{ee1345b212cde1ff4755.js → a7ac2c5e701f44a67aa3.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{5a747af5273646ab848c.js → c38c6cae22627fbf6f3b.js} +1 -1
  25. package/assets/esri/core/workers/chunks/c4d2ff515fc70b07cb5f.js +1 -0
  26. package/assets/esri/core/workers/chunks/{96fd6fd8cbb3a2ee088e.js → caa03837b9c173ea493f.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{dd5a078b7919f749ba3e.js → d90ee005599c44bfb6ad.js} +1 -1
  28. package/assets/esri/core/workers/chunks/dc3a6ab23a13ec5deed7.js +1 -0
  29. package/assets/esri/core/workers/chunks/{eb3e82ed1653ecf348da.js → e1a2f7282d889e251809.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{52274afa07468bc555aa.js → ec52127b5ada8410acf3.js} +13 -13
  31. package/assets/esri/core/workers/chunks/f8693321bbd8a93666c7.js +1 -0
  32. package/assets/esri/core/workers/chunks/{fe7dfb8546d0fc40843c.js → fec0d24e8841ba1994f0.js} +1 -1
  33. package/chunks/LineSeries.js +1 -1
  34. package/chunks/Theme.js +1 -1
  35. package/chunks/index.js +5 -0
  36. package/chunks/languageUtils.js +1 -1
  37. package/core/number.js +1 -1
  38. package/core/workers/loaderConfig.js +1 -1
  39. package/layers/mixins/ArcGISImageService.js +1 -1
  40. package/layers/support/rasterDatasets/WCSRaster.js +1 -1
  41. package/package.json +1 -1
  42. package/rest/knowledgeGraphService.js +1 -1
  43. package/support/revision.js +1 -1
  44. package/symbols/cim/cimAnalyzer.js +1 -1
  45. package/undoredo/support/DataEditingContext.js +5 -0
  46. package/views/2d/constraints/ZoomConstraint.js +1 -1
  47. package/views/2d/engine/webgl/shaderGraph/techniques/markers/ComputedMarkerParams.js +1 -1
  48. package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
  49. package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
  50. package/views/2d/layers/features/schema/processor/symbols/utils.js +5 -0
  51. package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
  52. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  53. package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
  54. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  55. package/views/3d/terrain/TerrainRenderer.js +1 -1
  56. package/views/3d/webgl-engine/collections/Component/ComponentIntersectionData.js +1 -1
  57. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  58. package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
  59. package/views/3d/webgl-engine/lib/IntersectorInterfaces.js +1 -1
  60. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  61. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  62. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  63. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  64. package/widgets/BasemapLayerList.js +1 -1
  65. package/widgets/LayerList.js +1 -1
  66. package/widgets/TableList.js +1 -1
  67. package/arcade/lib/arcade-parser.js +0 -5
  68. package/arcade/lib/assert.js +0 -5
  69. package/arcade/lib/character.js +0 -5
  70. package/arcade/lib/comment-handler.js +0 -5
  71. package/arcade/lib/error-handler.js +0 -5
  72. package/arcade/lib/parser.js +0 -5
  73. package/arcade/lib/scanner.js +0 -5
  74. package/arcade/lib/tokenizer.js +0 -5
  75. package/arcade/lib/types.js +0 -5
  76. package/assets/esri/core/workers/chunks/12b95408753cea053a40.js +0 -1
  77. package/assets/esri/core/workers/chunks/16397420fb6067b47b25.js +0 -1
  78. package/assets/esri/core/workers/chunks/1fdbeb110fae52b96bb3.js +0 -1
  79. package/assets/esri/core/workers/chunks/689a122c77b39e5c73eb.js +0 -1
  80. package/assets/esri/core/workers/chunks/7b07f3bc68a54974cd03.js +0 -1
  81. package/assets/esri/core/workers/chunks/ad95daa3f4ad7030bf24.js +0 -1
  82. package/assets/esri/core/workers/chunks/c2573c1cb7c714435acc.js +0 -1
  83. package/assets/esri/core/workers/chunks/df38774f63984be0a478.js +0 -1
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.30/esri/copyright.txt for details.
4
+ */
5
+ var e={False:"false",Null:"null",True:"true"},t={Break:"break",Continue:"continue",Else:"else",For:"for",From:"from",Function:"function",If:"if",Import:"import",Export:"export",In:"in",Return:"return",Var:"var",While:"while"},u={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockComment:"BlockComment",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",ContinueStatement:"ContinueStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",LineComment:"LineComment",Literal:"Literal",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement"},i=["++","--"],r=["-","+","!","~"],n=["=","/=","*=","%=","+=","-="],s=["||","&&"],a=["|","&",">>","<<",">>>","^","==","!=","<","<=",">",">=","+","-","*","/","%"],D={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},o={Unknown:0,BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8,Template:10},h=["Unknown","Boolean","<end>","Identifier","Keyword","Null","Numeric","Punctuator","String","RegularExpression","Template"],c={InvalidModuleUri:"InvalidModuleUri",ForInOfLoopInitializer:"ForInOfLoopInitializer",IdentiferExpected:"IdentiferExpected",InvalidEscapedReservedWord:"InvalidEscapedReservedWord",InvalidExpression:"InvalidExpression",InvalidFunctionIdentifier:"InvalidFunctionIdentifier",InvalidHexEscapeSequence:"InvalidHexEscapeSequence",InvalidLeftHandSideInAssignment:"InvalidLeftHandSideInAssignment",InvalidLeftHandSideInForIn:"InvalidLeftHandSideInForIn",InvalidTemplateHead:"InvalidTemplateHead",InvalidVariableAssignment:"InvalidVariableAssignment",KeyMustBeString:"KeyMustBeString",NoFunctionInsideBlock:"NoFunctionInsideBlock",NoFunctionInsideFunction:"NoFunctionInsideFunction",ModuleExportRootOnly:"ModuleExportRootOnly",ModuleImportRootOnly:"ModuleImportRootOnly",PunctuatorExpected:"PunctuatorExpected",TemplateOctalLiteral:"TemplateOctalLiteral",UnexpectedBoolean:"UnexpectedBoolean",UnexpectedEndOfScript:"UnexpectedEndOfScript",UnexpectedIdentifier:"UnexpectedIdentifier",UnexpectedKeyword:"UnexpectedKeyword",UnexpectedNull:"UnexpectedNull",UnexpectedNumber:"UnexpectedNumber",UnexpectedPunctuator:"UnexpectedPunctuator",UnexpectedString:"UnexpectedString",UnexpectedTemplate:"UnexpectedTemplate",UnexpectedToken:"UnexpectedToken"},l={[c.InvalidModuleUri]:"Module uri must be a text literal.",[c.ForInOfLoopInitializer]:"for-in loop variable declaration may not have an initializer.",[c.IdentiferExpected]:"'${value}' is an invalid identifier.",[c.InvalidEscapedReservedWord]:"Keyword cannot contain escaped characters.",[c.InvalidExpression]:"Invalid expression.",[c.InvalidFunctionIdentifier]:"'${value}' is an invalid function identifier.",[c.InvalidHexEscapeSequence]:"Invalid hexadecimal escape sequence.",[c.InvalidLeftHandSideInAssignment]:"Invalid left-hand side in assignment.",[c.InvalidLeftHandSideInForIn]:"Invalid left-hand side in for-in.",[c.InvalidTemplateHead]:"Invalid template structure.",[c.InvalidVariableAssignment]:"Invalid variable assignment.",[c.KeyMustBeString]:"Object property keys must be a word starting with a letter.",[c.NoFunctionInsideBlock]:"Functions cannot be declared inside of code blocks.",[c.NoFunctionInsideFunction]:"Functions cannot be declared inside another function.",[c.ModuleExportRootOnly]:"Module exports cannot be declared inside of code blocks.",[c.ModuleImportRootOnly]:"Module import cannot be declared inside of code blocks.",[c.PunctuatorExpected]:"'${value}' expected.",[c.TemplateOctalLiteral]:"Octal literals are not allowed in template literals.",[c.UnexpectedBoolean]:"Unexpected boolean literal.",[c.UnexpectedEndOfScript]:"Unexpected end of Arcade expression.",[c.UnexpectedIdentifier]:"Unexpected identifier.",[c.UnexpectedKeyword]:"Unexpected keyword.",[c.UnexpectedNull]:"Unexpected null literal.",[c.UnexpectedNumber]:"Unexpected number.",[c.UnexpectedPunctuator]:"Unexpected ponctuator.",[c.UnexpectedString]:"Unexpected text literal.",[c.UnexpectedTemplate]:"Unexpected quasi '${value}'.",[c.UnexpectedToken]:"Unexpected token '${value}'."},d=class e extends Error{constructor({code:t,index:u,line:i,column:r,len:n=0,description:s,data:a}){super(s??t),this.declaredRootClass="esri.arcade.lib.diagnostic",this.name="ParsingError",this.code=t,this.index=u,this.line=i,this.column=r,this.len=n,this.data=a,this.description=s,this.range={start:{line:i,column:r-1},end:{line:i,column:r+n}},Error.captureStackTrace?.(this,e)}};function C(e){return!!e&&"object"==typeof e&&"type"in e&&e.type===u.Program}function F(e){return!!e&&"object"==typeof e&&"type"in e&&e.type===u.BlockStatement}function p(e){return!!e&&"object"==typeof e&&"type"in e&&e.type===u.BlockComment}function E(e){return!!e&&"object"==typeof e&&"type"in e&&e.type===u.EmptyStatement}function A(e){return!!e&&"object"==typeof e&&"type"in e&&e.type===u.VariableDeclaration}function m(e){return!!e&&"object"==typeof e&&"type"in e&&e.type===u.Identifier}function x(e){return!!e&&"object"==typeof e&&"type"in e&&e.type===u.VariableDeclarator}function B(e,t){return t.loc.end.line===e.loc.start.line&&t.loc.end.column<=e.loc.start.column}function f(e,t){return e.range[0]>=t.range[0]&&e.range[1]<=t.range[1]}var k=class{constructor(){this.comments=[],this._nodeStack=[],this._newComments=[]}insertInnerComments(e){if(!F(e)||0!==e.body.length)return;let t=[];for(let u=this._newComments.length-1;u>=0;u--){let i=this._newComments[u];e.range[1]>=i.range[0]&&(t.unshift(i),this._newComments.splice(u,1))}t.length&&(e.innerComments=t)}attachTrailingComments(e){let t=this._nodeStack.at(-1);if(!t)return;if(F(e)&&f(t,e))for(let i=this._newComments.length-1;i>=0;i--){let u=this._newComments[i];f(u,e)&&(t.trailingComments=[...t.trailingComments??[],u],this._newComments.splice(i,1))}let u=[];if(this._newComments.length>0)for(let i=this._newComments.length-1;i>=0;i--){let r=this._newComments[i];B(r,t)?(t.trailingComments=[...t.trailingComments??[],r],this._newComments.splice(i,1)):B(r,e)&&(u.unshift(r),this._newComments.splice(i,1))}if(t.trailingComments){B(t.trailingComments[0],e)&&(u=[...u,...t.trailingComments],delete t.trailingComments)}u.length>0&&(e.trailingComments=u)}attachLeadingComments(e){let t;for(;this._nodeStack.length>0;){let u=this._nodeStack[this._nodeStack.length-1];if(!(e.range[0]<=u.range[0]))break;t=u,this._nodeStack.pop()}let u=[],i=[];if(null!=t){if(!t.leadingComments)return;for(let r=t.leadingComments.length-1;r>=0;r--){let n=t.leadingComments[r];e.range[0]>=n.range[1]?(u.unshift(n),t.leadingComments.splice(r,1)):x(e)&&!p(n)&&(i.unshift(n),t.leadingComments.splice(r,1))}return 0===t.leadingComments.length&&delete t.leadingComments,u.length&&(e.leadingComments=u),void(i.length&&(e.trailingComments=[...i,...e.trailingComments??[]]))}for(let r=this._newComments.length-1;r>=0;r--){let t=this._newComments[r];e.range[0]>=t.range[0]&&(u.unshift(t),this._newComments.splice(r,1))}u.length&&(e.leadingComments=u)}attachComments(e){if(C(e)&&e.body.length>0){let t=this._nodeStack.at(-1);return t?(t.trailingComments=[...t.trailingComments??[],...this._newComments],this._newComments.length=0,void this._nodeStack.pop()):(e.trailingComments=[...this._newComments],void(this._newComments.length=0))}this.attachTrailingComments(e),this.attachLeadingComments(e),this.insertInnerComments(e),this._nodeStack.push(e)}collectComment(e){this.comments.push(e),this._newComments.push(e)}},g=/\$\{(.*?)\}/gu;function w(e,t){let u=l[e];return t?u.replace(g,((e,u)=>t[u]?.toString()??"")):u}var S=class{constructor(e=!1){this.tolerant=e,this.errors=[]}recordError(e){this.errors.push(e)}tolerate(e){if(!this.tolerant)throw e;this.recordError(e)}throwError(e){throw e.description??(e.description=w(e.code,e.data)),new d(e)}tolerateError(e){e.description??(e.description=w(e.code,e.data));let t=new d(e);if(!this.tolerant)throw t;this.recordError(t)}};function y(e,t){if(!e)throw new Error(`ASSERT: ${t}`)}var I={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7C6\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB67\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDEC0-\uDEEB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/u,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u07FD\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D3-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CD0-\u1CD2\u1CD4-\u1CFA\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7C6\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB67\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDD30-\uDD39\uDF00-\uDF1C\uDF27\uDF30-\uDF50\uDFE0-\uDFF6]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD44-\uDD46\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDC9-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3B-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC5E\uDC5F\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDC00-\uDC3A\uDCA0-\uDCE9\uDCFF\uDDA0-\uDDA7\uDDAA-\uDDD7\uDDDA-\uDDE1\uDDE3\uDDE4\uDE00-\uDE3E\uDE47\uDE50-\uDE99\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF4F-\uDF87\uDF8F-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD00-\uDD2C\uDD30-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4B\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/u},T={fromCodePoint:e=>e<65536?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10))+String.fromCharCode(56320+(e-65536&1023)),isWhiteSpace:e=>32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e),isLineTerminator:e=>10===e||13===e||8232===e||8233===e,isIdentifierStart:e=>36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&I.NonAsciiIdentifierStart.test(T.fromCodePoint(e)),isIdentifierPart:e=>36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&I.NonAsciiIdentifierPart.test(T.fromCodePoint(e)),isDecimalDigit:e=>e>=48&&e<=57,isHexDigit:e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,isOctalDigit:e=>e>=48&&e<=55};function b(e){return"0123456789abcdef".indexOf(e.toLowerCase())}function L(e){return"01234567".indexOf(e)}var v=[[],[],[]];i.forEach((e=>v[e.length-1]?.push(e))),r.forEach((e=>v[e.length-1]?.push(e))),s.forEach((e=>v[e.length-1]?.push(e))),n.forEach((e=>v[e.length-1]?.push(e))),a.forEach((e=>v[e.length-1]?.push(e)));var N=class{constructor(e,t){this.source=e,this.errorHandler=t,this._length=e.length,this.index=0,this.lineNumber=1,this.lineStart=0,this.curlyStack=[]}saveState(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart,curlyStack:this.curlyStack.slice()}}restoreState(e){this.index=e.index,this.lineNumber=e.lineNumber,this.lineStart=e.lineStart,this.curlyStack=e.curlyStack}eof(){return this.index>=this._length}throwUnexpectedToken(e=c.UnexpectedToken){this.errorHandler.throwError({code:e,index:this.index,line:this.lineNumber,column:this.index-this.lineStart+1,data:{value:this.source.charAt(this.index)}})}tolerateUnexpectedToken(e=c.UnexpectedToken){this.errorHandler.tolerateError({code:e,index:this.index,line:this.lineNumber,column:this.index-this.lineStart+1})}skipSingleLineComment(e){let t=[],u=this.index-e,i={start:{line:this.lineNumber,column:this.index-this.lineStart-e},end:{line:0,column:0}};for(;!this.eof();){let r=this.source.charCodeAt(this.index);if(this.index+=1,T.isLineTerminator(r)){i.end={line:this.lineNumber,column:this.index-this.lineStart-1};let n={multiLine:!1,start:u+e,end:this.index-1,range:[u,this.index-1],loc:i};return t.push(n),13===r&&10===this.source.charCodeAt(this.index)&&(this.index+=1),this.lineNumber+=1,this.lineStart=this.index,t}}i.end={line:this.lineNumber,column:this.index-this.lineStart};let r={multiLine:!1,start:u+e,end:this.index,range:[u,this.index],loc:i};return t.push(r),t}skipMultiLineComment(){let e=[],t=this.index-2,u={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{line:0,column:0}};for(;!this.eof();){let i=this.source.charCodeAt(this.index);if(T.isLineTerminator(i))13===i&&10===this.source.charCodeAt(this.index+1)&&(this.index+=1),this.lineNumber+=1,this.index+=1,this.lineStart=this.index;else if(42===i){if(47===this.source.charCodeAt(this.index+1)){this.index+=2,u.end={line:this.lineNumber,column:this.index-this.lineStart};let i={multiLine:!0,start:t+2,end:this.index-2,range:[t,this.index],loc:u};return e.push(i),e}this.index+=1}else this.index+=1}u.end={line:this.lineNumber,column:this.index-this.lineStart};let i={multiLine:!0,start:t+2,end:this.index,range:[t,this.index],loc:u};return e.push(i),this.tolerateUnexpectedToken(),e}scanComments(){let e=[];for(;!this.eof();){let t=this.source.charCodeAt(this.index);if(T.isWhiteSpace(t))this.index+=1;else if(T.isLineTerminator(t))this.index+=1,13===t&&10===this.source.charCodeAt(this.index)&&(this.index+=1),this.lineNumber+=1,this.lineStart=this.index;else{if(47!==t)break;if(t=this.source.charCodeAt(this.index+1),47===t){this.index+=2;let t=this.skipSingleLineComment(2);e=[...e,...t]}else{if(42!==t)break;{this.index+=2;let t=this.skipMultiLineComment();e=[...e,...t]}}}}return e}isKeyword(e){switch((e=e.toLowerCase()).length){case 2:return e===t.If||e===t.In;case 3:return e===t.Var||e===t.For;case 4:return e===t.Else;case 5:return e===t.Break||e===t.While;case 6:return e===t.Return||e===t.Import||e===t.Export;case 8:return e===t.Function||e===t.Continue;default:return!1}}codePointAt(e){let t=this.source.charCodeAt(e);if(t>=55296&&t<=56319){let u=this.source.charCodeAt(e+1);u>=56320&&u<=57343&&(t=1024*(t-55296)+u-56320+65536)}return t}scanHexEscape(e){let t="u"===e?4:2,u=0;for(let i=0;i<t;i++){if(this.eof()||!T.isHexDigit(this.source.charCodeAt(this.index)))return null;u=16*u+b(this.source[this.index]??""),this.index+=1}return String.fromCharCode(u)}scanUnicodeCodePointEscape(){let e=this.source[this.index],t=0;for("}"===e&&this.throwUnexpectedToken();!this.eof()&&(e=this.source[this.index]??"",this.index+=1,T.isHexDigit(e.charCodeAt(0)));)t=16*t+b(e);return(t>1114111||"}"!==e)&&this.throwUnexpectedToken(),T.fromCodePoint(t)}getIdentifier(){let e=this.index;for(this.index+=1;!this.eof();){let t=this.source.charCodeAt(this.index);if(92===t)return this.index=e,this.getComplexIdentifier();if(t>=55296&&t<57343)return this.index=e,this.getComplexIdentifier();if(!T.isIdentifierPart(t))break;this.index+=1}return this.source.slice(e,this.index)}getComplexIdentifier(){let e,t=this.codePointAt(this.index),u=T.fromCodePoint(t);for(this.index+=u.length,92===t&&(117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),this.index+=1,"{"===this.source[this.index]?(this.index+=1,e=this.scanUnicodeCodePointEscape()):(e=this.scanHexEscape("u"),(null===e||"\\"===e||!T.isIdentifierStart(e.charCodeAt(0)))&&this.throwUnexpectedToken()),u=e);!this.eof()&&(t=this.codePointAt(this.index),T.isIdentifierPart(t));)e=T.fromCodePoint(t),u+=e,this.index+=e.length,92===t&&(u=u.substring(0,u.length-1),117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),this.index+=1,"{"===this.source[this.index]?(this.index+=1,e=this.scanUnicodeCodePointEscape()):(e=this.scanHexEscape("u"),(null===e||"\\"===e||!T.isIdentifierPart(e.charCodeAt(0)))&&this.throwUnexpectedToken()),u+=e);return u}octalToDecimal(e){let t="0"!==e,u=L(e);return!this.eof()&&T.isOctalDigit(this.source.charCodeAt(this.index))&&(t=!0,u=8*u+L(this.source[this.index]??""),this.index+=1,"0123".includes(e)&&!this.eof()&&T.isOctalDigit(this.source.charCodeAt(this.index))&&(u=8*u+L(this.source[this.index]??""),this.index+=1)),{code:u,octal:t}}scanIdentifier(){let t,u=this.index,i=92===this.source.charCodeAt(u)?this.getComplexIdentifier():this.getIdentifier();if(t=1===i.length?o.Identifier:this.isKeyword(i)?o.Keyword:i.toLowerCase()===e.Null?o.NullLiteral:i.toLowerCase()===e.True||i.toLowerCase()===e.False?o.BooleanLiteral:o.Identifier,t!==o.Identifier&&u+i.length!==this.index){let e=this.index;this.index=u,this.tolerateUnexpectedToken(c.InvalidEscapedReservedWord),this.index=e}return{type:t,value:i,lineNumber:this.lineNumber,lineStart:this.lineStart,start:u,end:this.index}}scanPunctuator(){let e=this.index,t=this.source[this.index]??"";switch(t){case"(":case"{":"{"===t&&this.curlyStack.push("{"),this.index+=1;break;case".":case")":case";":case",":case"[":case"]":case":":case"?":case"~":this.index+=1;break;case"}":this.index+=1,this.curlyStack.pop();break;default:for(let e=v.length;e>0;e--)if(t=this.source.substring(this.index,this.index+e),v[e-1]?.includes(t)){this.index+=e;break}}return this.index===e&&this.throwUnexpectedToken(),{type:o.Punctuator,value:t,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanHexLiteral(e){let t="";for(;!this.eof()&&T.isHexDigit(this.source.charCodeAt(this.index));)t+=this.source[this.index],this.index+=1;return 0===t.length&&this.throwUnexpectedToken(),T.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:o.NumericLiteral,value:Number.parseInt(`0x${t}`,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanBinaryLiteral(e){let t="";for(;!this.eof();){let e=this.source[this.index];if("0"!==e&&"1"!==e)break;t+=this.source[this.index],this.index+=1}if(0===t.length&&this.throwUnexpectedToken(),!this.eof()){let e=this.source.charCodeAt(this.index);(T.isIdentifierStart(e)||T.isDecimalDigit(e))&&this.throwUnexpectedToken()}return{type:o.NumericLiteral,value:Number.parseInt(t,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanOctalLiteral(e,t){let u="",i=!1;for(T.isOctalDigit(e.charCodeAt(0))&&(i=!0,u=`0${this.source[this.index]}`),this.index+=1;!this.eof()&&T.isOctalDigit(this.source.charCodeAt(this.index));)u+=this.source[this.index],this.index+=1;return!i&&0===u.length&&this.throwUnexpectedToken(),(T.isIdentifierStart(this.source.charCodeAt(this.index))||T.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:o.NumericLiteral,value:Number.parseInt(u,8),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}}scanNumericLiteral(){let e=this.index,t=this.source[e]??"";y(T.isDecimalDigit(t.charCodeAt(0))||"."===t,"Numeric literal must start with a decimal digit or a decimal point");let u="";if("."!==t){if(u=this.source[this.index]??"",this.index+=1,t=this.source[this.index]??"","0"===u){if("x"===t||"X"===t)return this.index+=1,this.scanHexLiteral(e);if("b"===t||"B"===t)return this.index+=1,this.scanBinaryLiteral(e);if("o"===t||"O"===t)return this.scanOctalLiteral(t,e)}for(;T.isDecimalDigit(this.source.charCodeAt(this.index));)u+=this.source[this.index],this.index+=1;t=this.source[this.index]??""}if("."===t){for(u+=this.source[this.index],this.index+=1;T.isDecimalDigit(this.source.charCodeAt(this.index));)u+=this.source[this.index],this.index+=1;t=this.source[this.index]??""}if("e"===t||"E"===t)if(u+=this.source[this.index],this.index+=1,t=this.source[this.index]??"",("+"===t||"-"===t)&&(u+=this.source[this.index],this.index+=1),T.isDecimalDigit(this.source.charCodeAt(this.index)))for(;T.isDecimalDigit(this.source.charCodeAt(this.index));)u+=this.source[this.index],this.index+=1;else this.throwUnexpectedToken();return T.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:o.NumericLiteral,value:Number.parseFloat(u),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanStringLiteral(){let e=this.index,t=this.source[e];y("'"===t||'"'===t,"String literal must starts with a quote"),this.index+=1;let u=!1,i="";for(;!this.eof();){let e=this.source[this.index]??"";if(this.index+=1,e===t){t="";break}if("\\"===e)if(e=this.source[this.index]??"",this.index+=1,e&&T.isLineTerminator(e.charCodeAt(0)))this.lineNumber+=1,"\r"===e&&"\n"===this.source[this.index]&&(this.index+=1),this.lineStart=this.index;else switch(e){case"u":if("{"===this.source[this.index])this.index+=1,i+=this.scanUnicodeCodePointEscape();else{let t=this.scanHexEscape(e);null===t&&this.throwUnexpectedToken(),i+=t}break;case"x":{let t=this.scanHexEscape(e);null===t&&this.throwUnexpectedToken(c.InvalidHexEscapeSequence),i+=t;break}case"n":i+="\n";break;case"r":i+="\r";break;case"t":i+="\t";break;case"b":i+="\b";break;case"f":i+="\f";break;case"v":i+="\v";break;case"8":case"9":i+=e,this.tolerateUnexpectedToken();break;default:if(e&&T.isOctalDigit(e.charCodeAt(0))){let t=this.octalToDecimal(e);u=t.octal||u,i+=String.fromCharCode(t.code)}else i+=e}else{if(T.isLineTerminator(e.charCodeAt(0)))break;i+=e}}return""!==t&&(this.index=e,this.throwUnexpectedToken()),{type:o.StringLiteral,value:i,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanTemplate(){let e="",t=!1,u=this.index,i="`"===this.source[u],r=!1,n=2;for(this.index+=1;!this.eof();){let u=this.source[this.index]??"";if(this.index+=1,"`"===u){n=1,r=!0,t=!0;break}if("$"!==u)if("\\"!==u)T.isLineTerminator(u.charCodeAt(0))?(this.lineNumber+=1,"\r"===u&&"\n"===this.source[this.index]&&(this.index+=1),this.lineStart=this.index,e+="\n"):e+=u;else if(u=this.source[this.index]??"",this.index+=1,T.isLineTerminator(u.charCodeAt(0)))this.lineNumber+=1,"\r"===u&&"\n"===this.source[this.index]&&(this.index+=1),this.lineStart=this.index;else switch(u){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+="\t";break;case"u":if("{"===this.source[this.index])this.index+=1,e+=this.scanUnicodeCodePointEscape();else{let t=this.index,i=this.scanHexEscape(u);null!==i?e+=i:(this.index=t,e+=u)}break;case"x":{let t=this.scanHexEscape(u);null===t&&this.throwUnexpectedToken(c.InvalidHexEscapeSequence),e+=t;break}case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:"0"===u?(T.isDecimalDigit(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(c.TemplateOctalLiteral),e+="\0"):T.isOctalDigit(u.charCodeAt(0))?this.throwUnexpectedToken(c.TemplateOctalLiteral):e+=u}else{if("{"===this.source[this.index]){this.curlyStack.push("${"),this.index+=1,t=!0;break}e+=u}}return t||this.throwUnexpectedToken(),i||this.curlyStack.pop(),{type:o.Template,value:this.source.slice(u+1,this.index-n),cooked:e,head:i,tail:r,lineNumber:this.lineNumber,lineStart:this.lineStart,start:u,end:this.index}}lex(){if(this.eof())return{type:o.EOF,value:"",lineNumber:this.lineNumber,lineStart:this.lineStart,start:this.index,end:this.index};let e=this.source.charCodeAt(this.index);return T.isIdentifierStart(e)?this.scanIdentifier():40===e||41===e||59===e?this.scanPunctuator():39===e||34===e?this.scanStringLiteral():46===e?T.isDecimalDigit(this.source.charCodeAt(this.index+1))?this.scanNumericLiteral():this.scanPunctuator():T.isDecimalDigit(e)?this.scanNumericLiteral():96===e||125===e&&"${"===this.curlyStack[this.curlyStack.length-1]?this.scanTemplate():e>=55296&&e<57343&&T.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()}},U={None:0,Function:1,IfClause:2,ForLoop:4,WhileLoop:8},P={AsObject:0,Automatic:1};function M(e,t=0){let u=e.start-e.lineStart,i=e.lineNumber;return u<0&&(u+=t,i-=1),{index:e.start,line:i,column:u}}function O(e){return[{index:e.range[0],...e.loc.start},{index:e.range[1],...e.loc.end}]}function R(e){return e in D?D[e]:0}var z=class{constructor(e,t={},u){this.delegate=u,this.hasLineTerminator=!1,this.options={tokens:"boolean"==typeof t.tokens&&t.tokens,comments:"boolean"==typeof t.comments&&t.comments,tolerant:"boolean"==typeof t.tolerant&&t.tolerant},this.options.comments&&(this.commentHandler=new k),this.errorHandler=new S(this.options.tolerant),this.scanner=new N(e,this.errorHandler),this.context={isAssignmentTarget:!1,blockContext:U.None,curlyParsingType:P.AsObject},this.rawToken={type:o.EOF,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.endMarker={index:0,line:this.scanner.lineNumber,column:0},this.readNextRawToken(),this.endMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}throwIfInvalidType(e,t,{validTypes:u,invalidTypes:i}){u?.some((t=>e.type===t))||i?.some((t=>e.type===t))&&this.throwError(c.InvalidExpression,t)}throwError(e,t,u=this.endMarker){let{index:i,line:r,column:n}=t,s=u.index-i-1;this.errorHandler.throwError({code:e,index:i,line:r,column:n+1,len:s})}tolerateError(e,t){throw new Error("######################################### !!!")}unexpectedTokenError(e={}){let t,{rawToken:u}=e,{code:i,data:r}=e;if(u){if(!i)switch(u.type){case o.EOF:i=c.UnexpectedEndOfScript;break;case o.Identifier:i=c.UnexpectedIdentifier;break;case o.NumericLiteral:i=c.UnexpectedNumber;break;case o.StringLiteral:i=c.UnexpectedString;break;case o.Template:i=c.UnexpectedTemplate}t=u.value.toString()}else t="ILLEGAL";i??(i=c.UnexpectedToken),r||(r={value:t});let n=w(i,r);if(u){let e=u.start,t=u.lineNumber,s=u.start-u.lineStart+1;return new d({code:i,index:e,line:t,column:s,len:u.end-u.start-1,data:r,description:n})}let{index:s,line:a}=this.endMarker;return new d({code:i,index:s,line:a,column:this.endMarker.column+1,data:r,description:n})}throwUnexpectedToken(e={}){throw e.rawToken??(e.rawToken=this.rawToken),this.unexpectedTokenError(e)}collectComments(e){let{commentHandler:t}=this;!t||!e.length||e.forEach((e=>{let i={type:e.multiLine?u.BlockComment:u.LineComment,value:this.getSourceValue(e),range:e.range,loc:e.loc};t.collectComment(i)}))}peekAhead(e){let t=()=>(this.scanner.scanComments(),this.scanner.lex()),u=this.scanner.saveState(),i=e.call(this,t);return this.scanner.restoreState(u),i}getSourceValue(e){return this.scanner.source.slice(e.start,e.end)}convertToToken(e){return{type:h[e.type],value:this.getSourceValue(e),range:[e.start,e.end],loc:{start:{line:this.startMarker.line,column:this.startMarker.column},end:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}}}readNextRawToken(){this.endMarker.index=this.scanner.index,this.endMarker.line=this.scanner.lineNumber,this.endMarker.column=this.scanner.index-this.scanner.lineStart;let e=this.rawToken;this.collectComments(this.scanner.scanComments()),this.scanner.index!==this.startMarker.index&&(this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart),this.rawToken=this.scanner.lex(),this.hasLineTerminator=e.lineNumber!==this.rawToken.lineNumber,this.options.tokens&&this.rawToken.type!==o.EOF&&this.tokens.push(this.convertToToken(this.rawToken))}captureStartMarker(){return{index:this.startMarker.index,line:this.startMarker.line,column:this.startMarker.column}}getItemLocation(e){return{range:[e.index,this.endMarker.index],loc:{start:{line:e.line,column:e.column},end:{line:this.endMarker.line,column:this.endMarker.column}}}}finalize(e){return(this.delegate??this.commentHandler)&&(this.commentHandler?.attachComments(e),this.delegate?.(e)),e}expectPunctuator(e){let t=this.rawToken;this.matchPunctuator(e)?this.readNextRawToken():this.throwUnexpectedToken({rawToken:t,code:c.PunctuatorExpected,data:{value:e}})}expectKeyword(e){this.rawToken.type!==o.Keyword||this.rawToken.value.toLowerCase()!==e.toString()?this.throwUnexpectedToken({rawToken:this.rawToken}):this.readNextRawToken()}expectContextualKeyword(e){this.rawToken.type!==o.Identifier||this.rawToken.value.toLowerCase()!==e?this.throwUnexpectedToken({rawToken:this.rawToken}):this.readNextRawToken()}matchKeyword(e){return this.rawToken.type===o.Keyword&&this.rawToken.value.toLowerCase()===e}matchContextualKeyword(e){return this.rawToken.type===o.Identifier&&this.rawToken.value===e}matchPunctuator(e){return this.rawToken.type===o.Punctuator&&this.rawToken.value===e}getMatchingPunctuator(e){if("string"==typeof e&&(e=e.split("")),this.rawToken.type===o.Punctuator&&e.length)return e.find(this.matchPunctuator.bind(this))}isolateCoverGrammar(e){let t=this.context.isAssignmentTarget;this.context.isAssignmentTarget=!0;let u=e.call(this);return this.context.isAssignmentTarget=t,u}inheritCoverGrammar(e){var t;let u=this.context.isAssignmentTarget;this.context.isAssignmentTarget=!0;let i=e.call(this);return(t=this.context).isAssignmentTarget&&(t.isAssignmentTarget=u),i}withBlockContext(e,t){let u=this.context.blockContext;this.context.blockContext|=e;let i=this.context.curlyParsingType;this.context.curlyParsingType=P.Automatic;let r=t.call(this);return this.context.blockContext=u,this.context.curlyParsingType=i,r}consumeSemicolon(){if(this.matchPunctuator(";"))this.readNextRawToken();else if(!this.hasLineTerminator){if(this.rawToken.type===o.EOF||this.matchPunctuator("}"))return this.endMarker.index=this.startMarker.index,this.endMarker.line=this.startMarker.line,void(this.endMarker.column=this.startMarker.column);this.throwUnexpectedToken({rawToken:this.rawToken})}}parsePrimaryExpression(){let t=this.captureStartMarker(),i=this.rawToken;switch(i.type){case o.Identifier:return this.readNextRawToken(),this.finalize({type:u.Identifier,name:i.value,...this.getItemLocation(t)});case o.NumericLiteral:case o.StringLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:u.Literal,value:i.value,raw:this.getSourceValue(i),isString:"string"==typeof i.value,...this.getItemLocation(t)});case o.BooleanLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:u.Literal,value:i.value.toLowerCase()===e.True,raw:this.getSourceValue(i),isString:!1,...this.getItemLocation(t)});case o.NullLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:u.Literal,value:null,raw:this.getSourceValue(i),isString:!1,...this.getItemLocation(t)});case o.Template:return this.parseTemplateLiteral();case o.Punctuator:switch(i.value){case"(":return this.inheritCoverGrammar(this.parseGroupExpression.bind(this));case"[":return this.inheritCoverGrammar(this.parseArrayInitializer.bind(this));case"{":return this.inheritCoverGrammar(this.parseObjectExpression.bind(this));default:return this.throwUnexpectedToken({rawToken:this.rawToken})}case o.Keyword:return this.context.isAssignmentTarget=!1,this.throwUnexpectedToken({rawToken:this.rawToken});default:return this.throwUnexpectedToken({rawToken:this.rawToken})}}parseArrayInitializer(){let e=this.captureStartMarker();this.expectPunctuator("[");let t=[];for(;!this.matchPunctuator("]");){let e=this.captureStartMarker();this.matchPunctuator(",")?(this.readNextRawToken(),this.throwError(c.InvalidExpression,e)):(t.push(this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this))),this.matchPunctuator("]")||this.expectPunctuator(","))}return this.expectPunctuator("]"),this.finalize({type:u.ArrayExpression,elements:t,...this.getItemLocation(e)})}parseObjectPropertyKey(){let e=this.captureStartMarker(),t=this.rawToken;switch(t.type){case o.StringLiteral:return this.readNextRawToken(),this.finalize({type:u.Literal,value:t.value,raw:this.getSourceValue(t),isString:!0,...this.getItemLocation(e)});case o.Identifier:case o.BooleanLiteral:case o.NullLiteral:case o.Keyword:return this.readNextRawToken(),this.finalize({type:u.Identifier,name:t.value,...this.getItemLocation(e)});default:this.throwError(c.KeyMustBeString,e)}}parseObjectProperty(){let e=this.rawToken,t=this.captureStartMarker(),i=this.parseObjectPropertyKey(),r=!1,n=null;return this.matchPunctuator(":")?(this.readNextRawToken(),n=this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this))):e.type===o.Identifier?(r=!0,n=this.finalize({type:u.Identifier,name:e.value,...this.getItemLocation(t)})):this.throwUnexpectedToken({rawToken:this.rawToken}),this.finalize({type:u.Property,kind:"init",key:i,value:n,shorthand:r,...this.getItemLocation(t)})}parseObjectExpression(){let e=this.captureStartMarker();this.expectPunctuator("{");let t=[];for(;!this.matchPunctuator("}");)t.push(this.parseObjectProperty()),this.matchPunctuator("}")||this.expectPunctuator(",");return this.expectPunctuator("}"),this.finalize({type:u.ObjectExpression,properties:t,...this.getItemLocation(e)})}parseTemplateElement(e=!1){let t=this.rawToken;t.type!==o.Template&&this.throwUnexpectedToken({rawToken:t}),e&&!t.head&&this.throwUnexpectedToken({code:c.InvalidTemplateHead,rawToken:t});let i=this.captureStartMarker();this.readNextRawToken();let{value:r,cooked:n,tail:s}=t,a=this.finalize({type:u.TemplateElement,value:{raw:r,cooked:n},tail:s,...this.getItemLocation(i)});return a.loc.start.column+=1,a.loc.end.column-=s?1:2,a}parseTemplateLiteral(){let e=this.captureStartMarker(),t=[],i=[],r=this.parseTemplateElement(!0);for(i.push(r);!r.tail;)t.push(this.parseExpression()),r=this.parseTemplateElement(),i.push(r);return this.finalize({type:u.TemplateLiteral,quasis:i,expressions:t,...this.getItemLocation(e)})}parseGroupExpression(){this.expectPunctuator("(");let e=this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this));return this.expectPunctuator(")"),e}parseArguments(){this.expectPunctuator("(");let e=[];if(!this.matchPunctuator(")"))for(;;){let t=this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this));if(e.push(t),this.matchPunctuator(")")||(this.expectPunctuator(","),this.matchPunctuator(")")))break}return this.expectPunctuator(")"),e}parseMemberName(){let e=this.rawToken,t=this.captureStartMarker();return this.readNextRawToken(),e.type!==o.NullLiteral&&e.type!==o.Identifier&&e.type!==o.Keyword&&e.type!==o.BooleanLiteral&&this.throwUnexpectedToken({rawToken:e}),this.finalize({type:u.Identifier,name:e.value,...this.getItemLocation(t)})}parseLeftHandSideExpression(){let e,t=this.captureStartMarker(),i=this.inheritCoverGrammar(this.parsePrimaryExpression.bind(this)),r=this.captureStartMarker();for(;e=this.getMatchingPunctuator("([.");)switch(e){case"(":{this.context.isAssignmentTarget=!1,i.type!==u.Identifier&&i.type!==u.MemberExpression&&this.throwError(c.IdentiferExpected,t,r);let e=this.parseArguments();i=this.finalize({type:u.CallExpression,callee:i,arguments:e,...this.getItemLocation(t)});continue}case"[":{this.context.isAssignmentTarget=!0,this.expectPunctuator("[");let e=this.isolateCoverGrammar((()=>this.parseExpression()));this.expectPunctuator("]"),i=this.finalize({type:u.MemberExpression,computed:!0,object:i,property:e,...this.getItemLocation(t)});continue}case".":{this.context.isAssignmentTarget=!0,this.expectPunctuator(".");let e=this.parseMemberName();i=this.finalize({type:u.MemberExpression,computed:!1,object:i,property:e,...this.getItemLocation(t)});continue}}return i}parseUpdateExpression(){let e=this.captureStartMarker(),t=this.getMatchingPunctuator(i);if(t){this.readNextRawToken();let i=this.captureStartMarker(),r=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this));return r.type!==u.Identifier&&r.type!==u.MemberExpression&&r.type!==u.CallExpression&&this.throwError(c.InvalidExpression,i),this.context.isAssignmentTarget||this.tolerateError(c.InvalidLeftHandSideInAssignment,e),this.context.isAssignmentTarget=!1,this.finalize({type:u.UpdateExpression,operator:t,argument:r,prefix:!0,...this.getItemLocation(e)})}let r=this.captureStartMarker(),n=this.inheritCoverGrammar(this.parseLeftHandSideExpression.bind(this)),s=this.captureStartMarker();return this.hasLineTerminator||(t=this.getMatchingPunctuator(i),!t)?n:(n.type!==u.Identifier&&n.type!==u.MemberExpression&&this.throwError(c.InvalidExpression,r,s),this.context.isAssignmentTarget||this.tolerateError(c.InvalidLeftHandSideInAssignment,e),this.readNextRawToken(),this.context.isAssignmentTarget=!1,this.finalize({type:u.UpdateExpression,operator:t,argument:n,prefix:!1,...this.getItemLocation(e)}))}parseUnaryExpression(){let e=this.getMatchingPunctuator(r);if(e){let t=this.captureStartMarker();this.readNextRawToken();let i=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this));return this.context.isAssignmentTarget=!1,this.finalize({type:u.UnaryExpression,operator:e,argument:i,prefix:!0,...this.getItemLocation(t)})}return this.parseUpdateExpression()}parseBinaryExpression(){let e=this.rawToken,t=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this));if(this.rawToken.type!==o.Punctuator)return t;let u=this.rawToken.value,i=R(u);if(0===i)return t;this.readNextRawToken(),this.context.isAssignmentTarget=!1;let r=[e,this.rawToken],n=t,s=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this)),a=[n,u,s],D=[i];for(;this.rawToken.type===o.Punctuator&&(i=R(this.rawToken.value))>0;){for(;a.length>2&&i<=D[D.length-1];){s=a.pop();let e=a.pop();D.pop(),n=a.pop(),r.pop();let t=r[r.length-1],u=M(t,t.lineStart);a.push(this.finalize(this.createBinaryOrLogicalExpression(u,e,n,s)))}a.push(this.rawToken.value),D.push(i),r.push(this.rawToken),this.readNextRawToken(),a.push(this.inheritCoverGrammar(this.parseUnaryExpression.bind(this)))}let h=a.length-1;t=a[h];let c=r.pop();for(;h>1;){let e=r.pop();if(!e)break;let u=c?.lineStart,i=M(e,u),n=a[h-1];t=this.finalize(this.createBinaryOrLogicalExpression(i,n,a[h-2],t)),h-=2,c=e}return t}createBinaryOrLogicalExpression(e,t,i,r){let n=s.includes(t)?u.LogicalExpression:u.BinaryExpression;return n===u.BinaryExpression||((i.type===u.AssignmentExpression||i.type===u.UpdateExpression)&&this.throwError(c.InvalidExpression,...O(i)),(r.type===u.AssignmentExpression||r.type===u.UpdateExpression)&&this.throwError(c.InvalidExpression,...O(i))),{type:n,operator:t,left:i,right:r,...this.getItemLocation(e)}}parseAssignmentExpression(){let e=this.captureStartMarker(),t=this.inheritCoverGrammar(this.parseBinaryExpression.bind(this)),i=this.captureStartMarker(),r=this.getMatchingPunctuator(n);if(!r)return t;t.type!==u.Identifier&&t.type!==u.MemberExpression&&this.throwError(c.InvalidExpression,e,i),this.context.isAssignmentTarget||this.tolerateError(c.InvalidLeftHandSideInAssignment,e),this.matchPunctuator("=")||(this.context.isAssignmentTarget=!1),this.readNextRawToken();let s=this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this));return this.finalize({type:u.AssignmentExpression,left:t,operator:r,right:s,...this.getItemLocation(e)})}parseExpression(){return this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this))}parseStatements(e){let t=[];for(;this.rawToken.type!==o.EOF&&!this.matchPunctuator(e);){let e=this.parseStatementListItem();E(e)||t.push(e)}return t}parseStatementListItem(){return this.context.isAssignmentTarget=!0,this.matchKeyword(t.Function)?this.parseFunctionDeclaration():this.matchKeyword(t.Export)?this.parseExportDeclaration():this.matchKeyword(t.Import)?this.parseImportDeclaration():this.parseStatement()}parseBlock(){let e=this.captureStartMarker();this.expectPunctuator("{");let t=this.parseStatements("}");return this.expectPunctuator("}"),this.finalize({type:u.BlockStatement,body:t,...this.getItemLocation(e)})}parseObjectStatement(){let e=this.captureStartMarker(),t=this.parseObjectExpression();return this.finalize({type:u.ExpressionStatement,expression:t,...this.getItemLocation(e)})}parseBlockOrObjectStatement(){return this.context.curlyParsingType===P.AsObject||this.peekAhead((e=>{let t=e();return!(t.type!==o.Identifier&&t.type!==o.StringLiteral||(t=e(),t.type!==o.Punctuator||":"!==t.value))}))?this.parseObjectStatement():this.parseBlock()}parseIdentifier(){let e=this.rawToken;if(e.type!==o.Identifier)return null;let t=this.captureStartMarker();return this.readNextRawToken(),this.finalize({type:u.Identifier,name:e.value,...this.getItemLocation(t)})}parseVariableDeclarator(){let e=this.captureStartMarker(),t=this.parseIdentifier();t||this.throwUnexpectedToken({code:c.IdentiferExpected});let i=null;if(this.matchPunctuator("=")){this.readNextRawToken();let e=this.rawToken;try{i=this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this))}catch{this.throwUnexpectedToken({rawToken:e,code:c.InvalidVariableAssignment})}}return this.finalize({type:u.VariableDeclarator,id:t,init:i,...this.getItemLocation(e)})}parseVariableDeclarationList(){let e=[this.parseVariableDeclarator()];for(;this.matchPunctuator(",");)this.readNextRawToken(),e.push(this.parseVariableDeclarator());return e}parseVariableDeclaration(){let e=this.captureStartMarker();this.expectKeyword(t.Var);let i=this.parseVariableDeclarationList();return this.consumeSemicolon(),this.finalize({type:u.VariableDeclaration,declarations:i,kind:"var",...this.getItemLocation(e)})}parseEmptyStatement(){let e=this.captureStartMarker();return this.expectPunctuator(";"),this.finalize({type:u.EmptyStatement,...this.getItemLocation(e)})}parseExpressionStatement(){let e=this.captureStartMarker(),t=this.parseExpression();return this.consumeSemicolon(),this.finalize({type:u.ExpressionStatement,expression:t,...this.getItemLocation(e)})}parseIfClause(){return this.withBlockContext(U.IfClause,this.parseStatement.bind(this))}parseIfStatement(){let e=this.captureStartMarker();this.expectKeyword(t.If),this.expectPunctuator("(");let i=this.captureStartMarker(),r=this.parseExpression(),n=this.captureStartMarker();this.expectPunctuator(")"),(r.type===u.AssignmentExpression||r.type===u.UpdateExpression)&&this.throwError(c.InvalidExpression,i,n);let s=this.parseIfClause(),a=null;return this.matchKeyword(t.Else)&&(this.readNextRawToken(),a=this.parseIfClause()),this.finalize({type:u.IfStatement,test:r,consequent:s,alternate:a,...this.getItemLocation(e)})}parseWhileStatement(){let e=this.captureStartMarker();this.expectKeyword(t.While),this.expectPunctuator("(");let i=this.captureStartMarker(),r=this.parseExpression(),n=this.captureStartMarker();this.expectPunctuator(")"),(r.type===u.AssignmentExpression||r.type===u.UpdateExpression)&&this.throwError(c.InvalidExpression,i,n);let s=this.withBlockContext(U.WhileLoop,this.parseStatement.bind(this));return this.finalize({type:u.WhileStatement,test:r,body:s,...this.getItemLocation(e)})}parseForStatement(){let e=null,i=null,r=null,n=null,s=null,a=this.captureStartMarker();if(this.expectKeyword(t.For),this.expectPunctuator("("),this.matchPunctuator(";"))this.readNextRawToken();else if(this.matchKeyword(t.Var)){let i=this.captureStartMarker();this.readNextRawToken();let r=this.parseVariableDeclarationList();1===r.length&&this.matchKeyword(t.In)?(r[0].init&&this.throwError(c.ForInOfLoopInitializer,i),n=this.finalize({type:u.VariableDeclaration,declarations:r,kind:"var",...this.getItemLocation(i)}),this.readNextRawToken(),s=this.parseExpression()):(this.matchKeyword(t.In)&&this.throwError(c.InvalidLeftHandSideInForIn,i),e=this.finalize({type:u.VariableDeclaration,declarations:r,kind:"var",...this.getItemLocation(i)}),this.expectPunctuator(";"))}else{let i=this.context.isAssignmentTarget,r=this.captureStartMarker();e=this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this)),this.matchKeyword(t.In)?(this.context.isAssignmentTarget||this.tolerateError(c.InvalidLeftHandSideInForIn,r),e.type!==u.Identifier&&this.throwError(c.InvalidLeftHandSideInForIn,r),this.readNextRawToken(),n=e,s=this.parseExpression(),e=null):(this.context.isAssignmentTarget=i,this.expectPunctuator(";"))}n||(this.matchPunctuator(";")||(i=this.isolateCoverGrammar(this.parseExpression.bind(this))),this.expectPunctuator(";"),this.matchPunctuator(")")||(r=this.isolateCoverGrammar(this.parseExpression.bind(this)))),this.expectPunctuator(")");let D=this.withBlockContext(U.ForLoop,(()=>this.isolateCoverGrammar(this.parseStatement.bind(this))));return n&&s?this.finalize({type:u.ForInStatement,left:n,right:s,body:D,...this.getItemLocation(a)}):this.finalize({type:u.ForStatement,init:e,test:i,update:r,body:D,...this.getItemLocation(a)})}parseContinueStatement(){let e=this.captureStartMarker();return this.expectKeyword(t.Continue),this.consumeSemicolon(),this.finalize({type:u.ContinueStatement,...this.getItemLocation(e)})}parseBreakStatement(){let e=this.captureStartMarker();return this.expectKeyword(t.Break),this.consumeSemicolon(),this.finalize({type:u.BreakStatement,...this.getItemLocation(e)})}parseReturnStatement(){let e=this.captureStartMarker();this.expectKeyword(t.Return);let i=(this.matchPunctuator(";")||this.matchPunctuator("}")||this.hasLineTerminator||this.rawToken.type===o.EOF)&&this.rawToken.type!==o.StringLiteral&&this.rawToken.type!==o.Template?null:this.parseExpression();return this.consumeSemicolon(),this.finalize({type:u.ReturnStatement,argument:i,...this.getItemLocation(e)})}parseStatement(){switch(this.rawToken.type){case o.BooleanLiteral:case o.NullLiteral:case o.NumericLiteral:case o.StringLiteral:case o.Template:case o.Identifier:return this.parseExpressionStatement();case o.Punctuator:return"{"===this.rawToken.value?this.parseBlockOrObjectStatement():"("===this.rawToken.value?this.parseExpressionStatement():";"===this.rawToken.value?this.parseEmptyStatement():this.parseExpressionStatement();case o.Keyword:switch(this.rawToken.value.toLowerCase()){case t.Break:return this.parseBreakStatement();case t.Continue:return this.parseContinueStatement();case t.For:return this.parseForStatement();case t.Function:return this.parseFunctionDeclaration();case t.If:return this.parseIfStatement();case t.Return:return this.parseReturnStatement();case t.Var:return this.parseVariableDeclaration();case t.While:return this.parseWhileStatement();default:return this.parseExpressionStatement()}default:return this.throwUnexpectedToken({rawToken:this.rawToken})}}parseFormalParameters(){let e=[];if(this.expectPunctuator("("),!this.matchPunctuator(")"))for(;this.rawToken.type!==o.EOF;){let t=this.parseIdentifier();if(t||this.throwUnexpectedToken({rawToken:this.rawToken,code:c.IdentiferExpected}),e.push(t),this.matchPunctuator(")")||(this.expectPunctuator(","),this.matchPunctuator(")")))break}return this.expectPunctuator(")"),e}parseFunctionDeclaration(){(this.context.blockContext&U.Function)===U.Function&&this.throwUnexpectedToken({code:c.NoFunctionInsideFunction}),((this.context.blockContext&U.WhileLoop)===U.WhileLoop||(this.context.blockContext&U.IfClause)===U.IfClause)&&this.throwUnexpectedToken({code:c.NoFunctionInsideBlock});let e=this.captureStartMarker();this.expectKeyword(t.Function);let i=this.parseIdentifier();i||this.throwUnexpectedToken({code:c.InvalidFunctionIdentifier});let r=this.parseFormalParameters(),n=this.context.blockContext;this.context.blockContext|=U.Function;let s=this.parseBlock();return this.context.blockContext=n,this.finalize({type:u.FunctionDeclaration,id:i,params:r,body:s,...this.getItemLocation(e)})}parseScript(){let e=this.captureStartMarker(),t=this.parseStatements(),i=this.finalize({type:u.Program,body:t,...this.getItemLocation(e)});return this.options.tokens&&(i.tokens=this.tokens),this.options.tolerant&&(i.errors=this.errorHandler.errors),i}parseExportDeclaration(){this.context.blockContext!==U.None&&this.throwUnexpectedToken({code:c.ModuleExportRootOnly});let e=null,i=this.captureStartMarker();return this.expectKeyword(t.Export),this.matchKeyword(t.Var)?e=this.parseVariableDeclaration():this.matchKeyword("function")?e=this.parseFunctionDeclaration():this.throwUnexpectedToken({code:c.InvalidExpression}),this.finalize({type:u.ExportNamedDeclaration,declaration:e,specifiers:[],source:null,...this.getItemLocation(i)})}parseModuleSpecifier(){let e=this.captureStartMarker(),t=this.rawToken;if(t.type===o.StringLiteral)return this.readNextRawToken(),this.finalize({type:u.Literal,value:t.value,raw:this.getSourceValue(t),isString:!0,...this.getItemLocation(e)});this.throwError(c.InvalidModuleUri,e)}parseDefaultSpecifier(){let e=this.captureStartMarker(),t=this.parseIdentifier();return t||this.throwUnexpectedToken({code:c.IdentiferExpected}),this.finalize({type:u.ImportDefaultSpecifier,local:t,...this.getItemLocation(e)})}parseImportDeclaration(){this.context.blockContext!==U.None&&this.throwUnexpectedToken({code:c.ModuleImportRootOnly});let e=this.captureStartMarker();this.expectKeyword(t.Import);let i=this.parseDefaultSpecifier();this.expectContextualKeyword(t.From);let r=this.parseModuleSpecifier();return this.finalize({type:u.ImportDeclaration,specifiers:[i],source:r,...this.getItemLocation(e)})}};function H(e,t,u){return new z(e,t,u).parseScript()}export{A as E,E as Q,d as T,u as i,F as j,m as k,t as l,c as o,l as q,H as r};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.30/esri/copyright.txt for details.
4
4
  */
5
- import e from"../config.js";import{version as t}from"../kernel.js";import{ArcadeDate as n,createDateTimeZone as r}from"../arcade/ArcadeDate.js";import{ArcadeModule as a}from"../arcade/ArcadeModule.js";import{ArcadeExecutionError as i,ExecutionErrorCodes as o}from"../arcade/executionError.js";import{ArcadeFunction as u}from"../arcade/FunctionWrapper.js";import s from"../arcade/ImmutableArray.js";import l from"../arcade/ImmutablePathArray.js";import f from"../arcade/ImmutablePointArray.js";import{esriFieldToJson as c,layerGeometryEsriRestConstants as m}from"../arcade/featureset/support/shared.js";import{format as d,parse as p}from"../core/number.js";import{DateOnly as y}from"../core/sql/DateOnly.js";import{TimeOnly as g}from"../core/sql/TimeOnly.js";import h from"../geometry/Extent.js";import b from"../geometry/Geometry.js";import N from"../geometry/Multipoint.js";import S from"../geometry/Point.js";import Z from"../geometry/Polygon.js";import T from"../geometry/Polyline.js";import D from"../geometry/SpatialReference.js";import{isClockwise as k}from"../geometry/support/coordsUtils.js";import{fromJSON as A}from"../geometry/support/jsonUtils.js";import{getLocale as C}from"../intl/locale.js";import{DateTime as j}from"luxon";class F{constructor(e){this.value=e}}class M{constructor(e){this.value=e}}const w=M,x=F,O={type:"VOID"},R={type:"BREAK"},J={type:"CONTINUE"};function v(e,t,n){return""===t||null==t||t===n||t===n?e:e=e.split(t).join(n)}function _(e){return e instanceof u}function I(e){return e instanceof a}function L(e){return!!G(e)||(!!E(e)||(!!X(e)||(!!ee(e)||(!!te(e)||(!!z(e)||(null===e||(e===O||"number"==typeof e)))))))}function Y(e,t){return void 0===e?t:e}function P(e){return null==e?"":U(e)||Q(e)?"Array":X(e)?"Date":te(e)?"Time":ee(e)?"DateOnly":G(e)?"String":z(e)?"Boolean":E(e)?"Number":"esri.arcade.Attachment"===e?.declaredClass?"Attachment":"esri.arcade.Portal"===e?.declaredClass?"Portal":"esri.arcade.Dictionary"===e?.declaredClass?"Dictionary":$(e)?"KnowledgeGraph":e instanceof a?"Module":H(e)?"Feature":e instanceof S?"Point":e instanceof Z?"Polygon":e instanceof T?"Polyline":e instanceof N?"Multipoint":e instanceof h?"Extent":_(e)?"Function":B(e)?"FeatureSet":W(e)?"FeatureSetCollection":e===O?"":"number"==typeof e&&isNaN(e)?"Number":"Unrecognized Type"}function G(e){return"string"==typeof e||e instanceof String}function z(e){return"boolean"==typeof e}function E(e){return"number"==typeof e}function V(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}function q(e){return e instanceof b}function U(e){return e instanceof Array}function H(e){return"esri.arcade.Feature"===e?.arcadeDeclaredClass}function B(e){return"esri.arcade.featureset.support.FeatureSet"===e?.declaredRootClass}function K(e){return"esri.arcade.Dictionary"===e?.declaredClass}function W(e){return"esri.arcade.featureSetCollection"===e?.declaredRootClass}function $(e){return"esri.rest.knowledgeGraph.KnowledgeGraph"===e?.declaredClass}function Q(e){return e instanceof s}function X(e){return e instanceof n}function ee(e){return e instanceof y}function te(e){return e instanceof g}function ne(e){return null!=e&&"object"==typeof e}function re(e){return e instanceof Date}function ae(e,t,n,r,a){if(e.length<t||e.length>n)throw new i(r,o.WrongNumberOfParameters,a)}function ie(e){return e<0?-Math.round(-e):Math.round(e)}function oe(e,t){return isNaN(e)||null==t||""===t?e.toString():(t=v(t,"‰",""),t=v(t,"¤",""),d(e,{pattern:t}))}function ue(e,t){return null==t||""===t?e.toISOString(!0):e.toFormat(se(t),{locale:C(),numberingSystem:"latn"})}function se(e,t=!1){e=e.replaceAll(/LTS|LT|LL?L?L?|l{1,4}/g,"[$&]");let n="";const r=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|Z{1,5}|.)/g;for(const a of e.match(r)||[])switch(a){case"D":n+="d";break;case"DD":n+="dd";break;case"DDD":n+="o";break;case"d":n+="c";break;case"ddd":n+="ccc";break;case"dddd":n+="cccc";break;case"M":n+="L";break;case"MM":n+="LL";break;case"MMM":n+="LLL";break;case"MMMM":n+="LLLL";break;case"YY":n+="yy";break;case"Y":case"YYYY":n+="yyyy";break;case"Q":n+="q";break;case"Z":n+="Z";break;case"ZZ":n+="ZZ";break;case"ZZZ":n+="ZZZ";break;case"ZZZZ":n+=t?"[ZZZZ]":"ZZZZ";break;case"ZZZZZ":n+=t?"[ZZZZZ]":"ZZZZZ";break;case"S":n+="'S'";break;case"SS":n+="'SS'";break;case"SSS":n+="u";break;case"A":case"a":n+="a";break;case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":case"X":case"x":n+=a;break;default:a.length>=2&&"["===a.slice(0,1)&&"]"===a.slice(-1)?n+=`'${a.slice(1,-1)}'`:n+=`'${a}'`}return n}function le(e,t,n){switch(n){case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}return!1}function fe(e,t,r){if(null===e){if(null===t||t===O)return le(null,null,r);if(E(t))return le(0,t,r);if(G(t))return le(0,ge(t),r);if(z(t))return le(0,ge(t),r);if(X(t))return le(0,t.toNumber(),r);if(te(t))return le(e,t.toNumber(),r);if(ee(t))return le(e,t.toNumber(),r)}if(e===O){if(null===t||t===O)return le(null,null,r);if(E(t))return le(0,t,r);if(G(t))return le(0,ge(t),r);if(z(t))return le(0,ge(t),r);if(X(t))return le(0,t.toNumber(),r);if(te(t))return le(e,t.toNumber(),r);if(ee(t))return le(e,t.toNumber(),r)}else if(E(e)){if(E(t))return le(e,t,r);if(z(t))return le(e,ge(t),r);if(null===t||t===O)return le(e,0,r);if(G(t))return le(e,ge(t),r);if(X(t))return le(e,t.toNumber(),r);if(te(t))return le(e,t.toNumber(),r);if(ee(t))return le(e,t.toNumber(),r)}else if(G(e)){if(G(t))return le(me(e),me(t),r);if(X(t))return le(ge(e),t.toNumber(),r);if(te(t))return le(ge(e),t.toNumber(),r);if(ee(t))return le(ge(e),t.toNumber(),r);if(E(t))return le(ge(e),t,r);if(null===t||t===O)return le(ge(e),0,r);if(z(t))return le(ge(e),ge(t),r)}else if(X(e)){if(X(t))return e.timeZone!==t.timeZone&&(e.isUnknownTimeZone?e=n.arcadeDateAndZoneToArcadeDate(e,t.timeZone):t.isUnknownTimeZone&&(t=n.arcadeDateAndZoneToArcadeDate(t,e.timeZone))),le(e.toNumber(),t.toNumber(),r);if(null===t||t===O)return le(e.toNumber(),0,r);if(E(t))return le(e.toNumber(),t,r);if(z(t))return le(e.toNumber(),ge(t),r);if(G(t))return le(e.toNumber(),ge(t),r);if(te(t))throw new i(null,o.CannotCompareDateAndTime,null);if(ee(t))return le(e.toNumber(),t.toNumber(),r)}else if(z(e)){if(z(t))return le(e,t,r);if(E(t))return le(ge(e),ge(t),r);if(X(t))return le(ge(e),t.toNumber(),r);if(te(t))return le(ge(e),t.toNumber(),r);if(ee(t))return le(ge(e),t.toNumber(),r);if(null===t||t===O)return le(ge(e),0,r);if(G(t))return le(ge(e),ge(t),r)}else if(ee(e)){if(X(t))return le(e.toNumber(),t.toNumber(),r);if(null===t||t===O)return le(e.toNumber(),0,r);if(E(t))return le(e.toNumber(),t,r);if(z(t))return le(e.toNumber(),ge(t),r);if(G(t))return le(e.toNumber(),ge(t),r);if(te(t))throw new i(null,o.CannotCompareDateAndTime,null);if(ee(t))return le(e.toNumber(),t.toNumber(),r)}else if(te(e)){if(X(t))throw new i(null,o.CannotCompareDateAndTime,null);if(null===t||t===O)return le(e.toNumber(),0,r);if(E(t))return le(e.toNumber(),t,r);if(z(t))return le(e.toNumber(),ge(t),r);if(G(t))return le(e.toNumber(),ge(t),r);if(te(t))return le(e.toNumber(),t.toNumber(),r);if(ee(t))throw new i(null,o.CannotCompareDateAndTime,null)}return!!ce(e,t)&&("<="===r||">="===r)}function ce(e,t){if(e===t)return!0;if(null===e&&t===O||null===t&&e===O)return!0;if(X(e)&&X(t))return e.equals(t);if(te(e)&&te(t))return e.equals(t);if(ee(e)&&ee(t))return e.equals(t);if(e instanceof l)return e.equalityTest(t);if(e instanceof f)return e.equalityTest(t);if(e instanceof S&&t instanceof S){const n=e.cache._arcadeCacheId,r=t.cache._arcadeCacheId;if(null!=n)return n===r}if(ne(e)&&ne(t)){if(e._arcadeCacheId===t._arcadeCacheId&&void 0!==e._arcadeCacheId&&null!==e._arcadeCacheId)return!0;if(e._underlyingGraphic===t._underlyingGraphic&&void 0!==e._underlyingGraphic&&null!==e._underlyingGraphic)return!0}return!1}function me(e,t){if(G(e))return e;if(null===e)return"";if(E(e))return oe(e,t);if(z(e))return e.toString();if(X(e))return ue(e,t);if(te(e))return e.toFormat(t);if(ee(e))return e.toFormat(t);if(e instanceof b)return JSON.stringify(e.toJSON());if(U(e)){const t=[];for(let n=0;n<e.length;n++)t[n]=ye(e[n]);return"["+t.join(",")+"]"}if(e instanceof s){const t=[];for(let n=0;n<e.length();n++)t[n]=ye(e.get(n));return"["+t.join(",")+"]"}return null!==e&&"object"==typeof e&&void 0!==e.castToText?e.castToText():_(e)?"object, Function":e===O?"":I(e)?"object, Module":""}function de(e){const t=[];if(!U(e))return null;if(e instanceof s){for(let n=0;n<e.length();n++)t[n]=ge(e.get(n));return t}for(let n=0;n<e.length;n++)t[n]=ge(e[n]);return t}function pe(e,t,n=!1){if(G(e))return e;if(null===e)return"";if(E(e))return oe(e,t);if(z(e))return e.toString();if(X(e))return ue(e,t);if(te(e))return e.toFormat(t);if(ee(e))return e.toFormat(t);if(e instanceof b)return e instanceof h?'{"xmin":'+e.xmin.toString()+',"ymin":'+e.ymin.toString()+","+(e.hasZ?'"zmin":'+e.zmin.toString()+",":"")+(e.hasM?'"mmin":'+e.mmin.toString()+",":"")+'"xmax":'+e.xmax.toString()+',"ymax":'+e.ymax.toString()+","+(e.hasZ?'"zmax":'+e.zmax.toString()+",":"")+(e.hasM?'"mmax":'+e.mmax.toString()+",":"")+'"spatialReference":'+je(e.spatialReference)+"}":je(e.toJSON(),((e,t)=>e.key===t.key?0:"spatialReference"===e.key?1:"spatialReference"===t.key||e.key<t.key?-1:e.key>t.key?1:0));if(U(e)){const t=[];for(let r=0;r<e.length;r++)t[r]=ye(e[r],n);return"["+t.join(",")+"]"}if(e instanceof s){const t=[];for(let r=0;r<e.length();r++)t[r]=ye(e.get(r),n);return"["+t.join(",")+"]"}return null!==e&&"object"==typeof e&&void 0!==e.castToText?e.castToText(n):_(e)?"object, Function":e===O?"":I(e)?"object, Module":""}function ye(e,t=!1){if(null===e)return"null";if(z(e)||E(e)||G(e))return JSON.stringify(e);if(e instanceof b)return pe(e,null,t);if(e instanceof s)return pe(e,null,t);if(e instanceof Array)return pe(e,null,t);if(X(e))return t?JSON.stringify(e.getTime()):JSON.stringify(ue(e,""));if(te(e))return JSON.stringify(e.toString());if(ee(e))return JSON.stringify(e.toString());if(null!==e&&"object"==typeof e){if(void 0!==e.castToText)return e.castToText(t)}else if(e===O)return"null";return"null"}function ge(e,t){return E(e)?e:null===e||""===e?0:X(e)||ee(e)||te(e)?NaN:z(e)?e?1:0:U(e)||""===e||void 0===e?NaN:void 0!==t&&G(e)?(t=v(t,"‰",""),t=v(t,"¤",""),p(e,{pattern:t})):e===O?0:Number(e)}function he(e,t){if(X(e))return e;if(G(e)){const r=be(e,t);if(r)return n.dateTimeToArcadeDate(r)}return null}function be(e,t){const n=/ (\d\d)/,a=r(t);let i=j.fromISO(e,{zone:a});return i.isValid||n.test(e)&&(e=e.replace(n,"T$1"),i=j.fromISO(e,{zone:t}),i.isValid)?i:null}function Ne(e){return z(e)?e:G(e)?"true"===(e=e.toLowerCase()):!!E(e)&&(0!==e&&!isNaN(e))}function Se(e,t){const n=JSON.parse(e);return n&&!n.spatialReference&&(n.spatialReference=t),A(n)}function Ze(e,t){return null==e?null:(null!==e.spatialReference&&void 0!==e.spatialReference||(e.spatialReference=t),e)}function Te(e){if(null===e)return null;if(e instanceof S)return"NaN"===e.x||null===e.x||isNaN(e.x)?null:e;if(e instanceof Z){if(0===e.rings.length)return null;for(const t of e.rings)if(t.length>0)return e;return null}if(e instanceof T){if(0===e.paths.length)return null;for(const t of e.paths)if(t.length>0)return e;return null}return e instanceof N?0===e.points.length?null:e:e instanceof h?"NaN"===e.xmin||null===e.xmin||isNaN(e.xmin)?null:e:null}function De(e,t){if(!e)return t;if(!e.domain)return t;let n=null,r=null;if(X(t))n=t.toNumber();else if(ee(t))n=t.toString();else if(te(t))n=t.toStorageString();else if("string"===e.field.type||"esriFieldTypeString"===e.field.type)n=me(t);else{if(null==t)return null;if(""===t)return t;n=ge(t)}for(let a=0;a<e.domain.codedValues.length;a++){const t=e.domain.codedValues[a];t.code===n&&(r=t)}return null===r?me(t):r.name}function ke(e,t){if(!e)return t;if(!e.domain)return t;let n=null;const r=me(t);for(let a=0;a<e.domain.codedValues.length;a++){const t=e.domain.codedValues[a];t.name===r&&(n=t)}return null===n?t:n.code}function Ae(e,t,n=null,r=null){if(!t)return null;if(!t.fields)return null;let a,u,s=null;for(let i=0;i<t.fields.length;i++){const n=t.fields[i];n.name.toLowerCase()===e.toString().toLowerCase()&&(s=n)}if(null===s)throw new i(null,o.FieldNotFound,null,{key:e});let l=t.typeIdField,f="id",c=t.types;if(t.subtypeField&&(l=t.subtypeField,f="code",c=t.subtypes??[]),null===r&&n&&l)r=n.hasField(l)?n.field(l):null;else if(l&&null!==r){let e=!1;for(const t of c||[])if(r===t[f]){e=!0;break}if(!e)for(const t of c||[])if(r===t.name){r=t[f],e=!0;break}e||(r=null,n&&l&&(r=n.hasField(l)?n.field(l):null))}return null!=r&&c.some((e=>e[f]===r&&(a=e.domains?.[s.name],a&&"inherited"===a.type&&(a=Ce(s.name,t),u=!0),!0))),u||a||(a=Ce(e,t)),{field:s,domain:a}}function Ce(e,t){let n;return t.fields.some((t=>(t.name.toLowerCase()===e.toLowerCase()&&(n=t.domain),!!n))),n}function je(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});const n="boolean"==typeof t.cycles&&t.cycles,r=t.cmp&&(a=t.cmp,function(e){return function(t,n){const r={key:t,value:e[t]},i={key:n,value:e[n]};return a(r,i)}});var a;const i=[];return function e(t){if(t?.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0===t)return;if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);let a,o;if(Array.isArray(t)){for(o="[",a=0;a<t.length;a++)a&&(o+=","),o+=e(t[a])||"null";return o+"]"}if(null===t)return"null";if(i.includes(t)){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}const u=i.push(t)-1,s=Object.keys(t).sort(r?.(t));for(o="",a=0;a<s.length;a++){const n=s[a],r=e(t[n]);r&&(o&&(o+=","),o+=JSON.stringify(n)+":"+r)}return i.splice(u,1),"{"+o+"}"}(e)}function Fe(e){if(null===e)return null;const t=[];for(const n of e)n?.arcadeDeclaredClass&&"esri.arcade.Feature"===n.arcadeDeclaredClass?t.push(n.geometry()):t.push(n);return t}function Me(e,t){if(!(t instanceof S))throw new i(null,o.InvalidParameter,null);e.push(t.hasZ?t.hasM?[t.x,t.y,t.z,t.m]:[t.x,t.y,t.z]:[t.x,t.y])}function we(e,t){if(U(e)||Q(e)){let n=!1,r=!1,a=[],u=t;if(U(e)){for(const t of e)Me(a,t);a.length>0&&(u=e[0].spatialReference,n=e[0].hasZ,r=e[0].hasM)}else if(e instanceof f)a=e._elements,a.length>0&&(n=e._hasZ,r=e._hasM,u=e.get(0).spatialReference);else{if(!Q(e))throw new i(null,o.InvalidParameter,null);for(const t of e.toArray())Me(a,t);a.length>0&&(u=e.get(0).spatialReference,n=!0===e.get(0).hasZ,r=!0===e.get(0).hasM)}if(0===a.length)return null;return k(a)||(a=a.slice(0).reverse()),new Z({rings:[a],spatialReference:u,hasZ:n,hasM:r})}return e}function xe(e,t){if(U(e)||Q(e)){let n=!1,r=!1,a=[],i=t;if(U(e)){for(const t of e)Me(a,t);a.length>0&&(i=e[0].spatialReference,n=!0===e[0].hasZ,r=!0===e[0].hasM)}else if(e instanceof f)a=e._elements,a.length>0&&(n=e._hasZ,r=e._hasM,i=e.get(0).spatialReference);else if(Q(e)){for(const t of e.toArray())Me(a,t);a.length>0&&(i=e.get(0).spatialReference,n=!0===e.get(0).hasZ,r=!0===e.get(0).hasM)}return 0===a.length?null:new T({paths:[a],spatialReference:i,hasZ:n,hasM:r})}return e}function Oe(e,t){if(U(e)||Q(e)){let n=!1,r=!1,a=[],i=t;if(U(e)){for(const t of e)Me(a,t);a.length>0&&(i=e[0].spatialReference,n=!0===e[0].hasZ,r=!0===e[0].hasM)}else if(e instanceof f)a=e._elements,a.length>0&&(n=e._hasZ,r=e._hasM,i=e.get(0).spatialReference);else if(Q(e)){for(const t of e.toArray())Me(a,t);a.length>0&&(i=e.get(0).spatialReference,n=!0===e.get(0).hasZ,r=!0===e.get(0).hasM)}return 0===a.length?null:new N({points:a,spatialReference:i,hasZ:n,hasM:r})}return e}function Re(e,t=!1){const n=[];if(null===e)return n;if(!0===U(e)){for(let r=0;r<e.length;r++){const a=me(e[r]);""===a&&!0!==t||n.push(a)}return n}if(e instanceof s){for(let r=0;r<e.length();r++){const a=me(e.get(r));""===a&&!0!==t||n.push(a)}return n}if(L(e)){const r=me(e);return""===r&&!0!==t||n.push(r),n}return[]}let Je=0;function ve(e){return Je++,Je%100==0?(Je=0,new Promise((t=>{setTimeout((()=>{t(e)}),0)}))):e}function _e(e,t,n){switch(n){case"&":return e&t;case"|":return e|t;case"^":return e^t;case"<<":return e<<t;case">>":return e>>t;case">>>":return e>>>t}}function Ie(e,t=null){return null==e?null:z(e)||E(e)||G(e)?e:e instanceof b?!0===t?.keepGeometryType?e:e.toJSON():e instanceof s?e.toArray().map((e=>Ie(e,t))):e instanceof Array?e.map((e=>Ie(e,t))):re(e)?e:X(e)?e.toJSDate():te(e)?e.toString():ee(e)?e.toJSDate():null!==e&&"object"==typeof e&&void 0!==e.castAsJson?e.castAsJson(t):null}async function Le(e,t,n,r,a){const i=await Ye(e,t,n);a[r]=i}async function Ye(e,t=null,n=null){if(e instanceof s&&(e=e.toArray()),null==e)return null;if(L(e)||e instanceof b||re(e)||X(e))return Ie(e,n);if(e instanceof Array){const r=[],a=[];for(const i of e)null===i||L(i)||i instanceof b||re(i)||X(i)?a.push(Ie(i,n)):(a.push(null),r.push(Le(i,t,n,a.length-1,a)));return r.length>0&&await Promise.all(r),a}return null!==e&&"object"==typeof e&&void 0!==e.castAsJsonAsync?e.castAsJsonAsync(t,n):null}function Pe(e){return Ge(e)?e.parent:e}function Ge(e){return e&&"declaredClass"in e&&"esri.layers.support.SubtypeSublayer"===e.declaredClass}function ze(e){return e&&"declaredClass"in e&&"esri.layers.SubtypeGroupLayer"===e.declaredClass}function Ee(e,t,n){const r=Pe(e.fullSchema());if(null===r)return null;if(!r.fields)return null;return Ae(t,r,e,n)}function Ve(e){const t=Pe(e.fullSchema());return null===t?null:t.fields?t.subtypeField?{subtypeField:t.subtypeField,subtypes:t.subtypes?t.subtypes.map((e=>({name:e.name,code:e.code}))):[]}:t.typeIdField?{subtypeField:t.typeIdField,subtypes:t.types?t.types.map((e=>({name:e.name,code:e.id}))):[]}:null:null}function qe(e,t,n,r){const a=Pe(e.fullSchema());if(null===a)return null;if(!a.fields)return null;const i=Ae(t,a,e,r);if(void 0===n)try{n=e.field(t)}catch(o){return null}return De(i,n)}function Ue(e,t,n,r){const a=Pe(e.fullSchema());if(null===a)return null;if(!a.fields)return null;if(void 0===n){try{n=e.field(t)}catch(i){return null}return n}return ke(Ae(t,a,e,r),n)}function He(e){return e?.timeZone??"system"}function Be(e){const t=Pe(e.fullSchema());if(null===t)return null;if(!t.fields)return null;const n=[];for(const r of t.fields)n.push(c(r));return{objectIdField:t.objectIdField,globalIdField:t.globalIdField??"",geometryType:void 0===m[t.geometryType]?"":m[t.geometryType],fields:n}}function Ke(r,a){return"system"===r&&(r=n.systemTimeZoneCanonicalName),{version:We,engineVersion:t,timeZone:r,spatialReference:a instanceof D?a.toJSON():a,application:e.applicationName??"",engine:"web",locale:C()}}const We="1.24",$e=Object.freeze(Object.defineProperty({__proto__:null,ImplicitResultE:M,ReturnResultE:F,absRound:ie,arcadeVersion:We,autoCastArrayOfPointsToMultiPoint:Oe,autoCastArrayOfPointsToPolygon:we,autoCastArrayOfPointsToPolyline:xe,autoCastFeatureToGeometry:Fe,binaryOperator:_e,breakResult:R,castAsJson:Ie,castAsJsonAsync:Ye,continueResult:J,defaultExecutingContext:Ke,defaultTimeZone:He,defaultUndefined:Y,equalityTest:ce,featureDomainCodeLookup:Ue,featureDomainValueLookup:qe,featureFullDomain:Ee,featureSchema:Be,featureSubtypes:Ve,fixNullGeometry:Te,fixSpatialReference:Ze,formatDate:ue,formatNumber:oe,getDomain:Ae,getDomainCode:ke,getDomainValue:De,getType:P,greaterThanLessThan:fe,implicitResult:w,isArray:U,isBoolean:z,isDate:X,isDateOnly:ee,isDictionary:K,isFeature:H,isFeatureSet:B,isFeatureSetCollection:W,isFunctionParameter:_,isGeometry:q,isImmutableArray:Q,isInteger:V,isJsDate:re,isKnowledgeGraph:$,isModule:I,isNumber:E,isObject:ne,isSimpleType:L,isString:G,isSubtypeGrouplayer:ze,isSubtypeSublayer:Ge,isTime:te,multiReplace:v,parseGeometryFromJson:Se,pcCheck:ae,returnResult:x,stableStringify:je,standardiseDateFormat:se,tick:ve,toBoolean:Ne,toDate:he,toNumber:ge,toNumberArray:de,toString:me,toStringArray:Re,toStringExplicit:pe,voidOperation:O},Symbol.toStringTag,{value:"Module"}));export{ze as $,w as A,O as B,R as C,J as D,fe as E,ce as F,_e as G,ae as H,Fe as I,we as J,Y as K,xe as L,Oe as M,He as N,V as O,P,se as Q,ie as R,Te as S,v as T,Be as U,Ve as V,Ee as W,qe as X,Ue as Y,Ke as Z,de as _,z as a,Ge as a0,ve as a1,Re as a2,Ae as a3,De as a4,ke as a5,re as a6,F as a7,M as a8,I as a9,ne as aa,oe as ab,ue as ac,Se as ad,je as ae,We as af,E as b,G as c,Ie as d,Ye as e,L as f,ge as g,Ne as h,_ as i,me as j,X as k,he as l,ee as m,te as n,U as o,q as p,Q as q,H as r,W as s,pe as t,B as u,K as v,$ as w,Ze as x,$e as y,x as z};
5
+ import e from"../config.js";import{version as t}from"../kernel.js";import{ArcadeDate as n,createDateTimeZone as r}from"../arcade/ArcadeDate.js";import{ArcadeModule as a}from"../arcade/ArcadeModule.js";import{ArcadeExecutionError as i,ExecutionErrorCodes as o}from"../arcade/executionError.js";import{ArcadeFunction as u}from"../arcade/FunctionWrapper.js";import s from"../arcade/ImmutableArray.js";import l from"../arcade/ImmutablePathArray.js";import f from"../arcade/ImmutablePointArray.js";import{esriFieldToJson as c,layerGeometryEsriRestConstants as m}from"../arcade/featureset/support/shared.js";import{format as d,parse as p}from"../core/number.js";import{DateOnly as y}from"../core/sql/DateOnly.js";import{TimeOnly as g}from"../core/sql/TimeOnly.js";import h from"../geometry/Extent.js";import b from"../geometry/Geometry.js";import N from"../geometry/Multipoint.js";import S from"../geometry/Point.js";import Z from"../geometry/Polygon.js";import A from"../geometry/Polyline.js";import T from"../geometry/SpatialReference.js";import{isClockwise as D}from"../geometry/support/coordsUtils.js";import{fromJSON as k}from"../geometry/support/jsonUtils.js";import{getLocale as C}from"../intl/locale.js";import{DateTime as j}from"luxon";class F{constructor(e){this.value=e}}class M{constructor(e){this.value=e}}const w=M,x=F,O={type:"VOID"},R={type:"BREAK"},J={type:"CONTINUE"};function v(e,t,n){return""===t||null==t||t===n||t===n?e:e=e.split(t).join(n)}function _(e){return e instanceof u}function I(e){return e instanceof a}function L(e){return!!G(e)||(!!E(e)||(!!X(e)||(!!ee(e)||(!!te(e)||(!!z(e)||(null===e||(e===O||"number"==typeof e)))))))}function Y(e,t){return void 0===e?t:e}function P(e){return null==e?"":U(e)||Q(e)?"Array":X(e)?"Date":te(e)?"Time":ee(e)?"DateOnly":G(e)?"String":z(e)?"Boolean":E(e)?"Number":"esri.arcade.Attachment"===e?.declaredClass?"Attachment":"esri.arcade.Portal"===e?.declaredClass?"Portal":"esri.arcade.Dictionary"===e?.declaredClass?"Dictionary":$(e)?"KnowledgeGraph":e instanceof a?"Module":H(e)?"Feature":e instanceof S?"Point":e instanceof Z?"Polygon":e instanceof A?"Polyline":e instanceof N?"Multipoint":e instanceof h?"Extent":_(e)?"Function":B(e)?"FeatureSet":W(e)?"FeatureSetCollection":e===O?"":"number"==typeof e&&isNaN(e)?"Number":"Unrecognized Type"}function G(e){return"string"==typeof e||e instanceof String}function z(e){return"boolean"==typeof e}function E(e){return"number"==typeof e}function V(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}function q(e){return e instanceof b}function U(e){return Array.isArray(e)}function H(e){return"esri.arcade.Feature"===e?.arcadeDeclaredClass}function B(e){return"esri.arcade.featureset.support.FeatureSet"===e?.declaredRootClass}function K(e){return"esri.arcade.Dictionary"===e?.declaredClass}function W(e){return"esri.arcade.featureSetCollection"===e?.declaredRootClass}function $(e){return"esri.rest.knowledgeGraph.KnowledgeGraph"===e?.declaredClass}function Q(e){return e instanceof s}function X(e){return e instanceof n}function ee(e){return e instanceof y}function te(e){return e instanceof g}function ne(e){return null!=e&&"object"==typeof e}function re(e){return e instanceof Date}function ae(e,t,n,r,a){if(e.length<t||e.length>n)throw new i(r,o.WrongNumberOfParameters,a)}function ie(e){return e<0?-Math.round(-e):Math.round(e)}function oe(e,t){return isNaN(e)||null==t||""===t?e.toString():(t=v(t,"‰",""),t=v(t,"¤",""),d(e,{pattern:t}))}function ue(e,t){return null==t||""===t?e.toISOString(!0):e.toFormat(se(t),{locale:C(),numberingSystem:"latn"})}function se(e,t=!1){e=e.replaceAll(/LTS|LT|LL?L?L?|l{1,4}/g,"[$&]");let n="";const r=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|Z{1,5}|.)/g;for(const a of e.match(r)||[])switch(a){case"D":n+="d";break;case"DD":n+="dd";break;case"DDD":n+="o";break;case"d":n+="c";break;case"ddd":n+="ccc";break;case"dddd":n+="cccc";break;case"M":n+="L";break;case"MM":n+="LL";break;case"MMM":n+="LLL";break;case"MMMM":n+="LLLL";break;case"YY":n+="yy";break;case"Y":case"YYYY":n+="yyyy";break;case"Q":n+="q";break;case"Z":n+="Z";break;case"ZZ":n+="ZZ";break;case"ZZZ":n+="ZZZ";break;case"ZZZZ":n+=t?"[ZZZZ]":"ZZZZ";break;case"ZZZZZ":n+=t?"[ZZZZZ]":"ZZZZZ";break;case"S":n+="'S'";break;case"SS":n+="'SS'";break;case"SSS":n+="u";break;case"A":case"a":n+="a";break;case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":case"X":case"x":n+=a;break;default:a.length>=2&&"["===a.slice(0,1)&&"]"===a.slice(-1)?n+=`'${a.slice(1,-1)}'`:n+=`'${a}'`}return n}function le(e,t,n){switch(n){case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}return!1}function fe(e,t,r){if(null===e){if(null===t||t===O)return le(null,null,r);if(E(t))return le(0,t,r);if(G(t))return le(0,ge(t),r);if(z(t))return le(0,ge(t),r);if(X(t))return le(0,t.toNumber(),r);if(te(t))return le(e,t.toNumber(),r);if(ee(t))return le(e,t.toNumber(),r)}if(e===O){if(null===t||t===O)return le(null,null,r);if(E(t))return le(0,t,r);if(G(t))return le(0,ge(t),r);if(z(t))return le(0,ge(t),r);if(X(t))return le(0,t.toNumber(),r);if(te(t))return le(e,t.toNumber(),r);if(ee(t))return le(e,t.toNumber(),r)}else if(E(e)){if(E(t))return le(e,t,r);if(z(t))return le(e,ge(t),r);if(null===t||t===O)return le(e,0,r);if(G(t))return le(e,ge(t),r);if(X(t))return le(e,t.toNumber(),r);if(te(t))return le(e,t.toNumber(),r);if(ee(t))return le(e,t.toNumber(),r)}else if(G(e)){if(G(t))return le(me(e),me(t),r);if(X(t))return le(ge(e),t.toNumber(),r);if(te(t))return le(ge(e),t.toNumber(),r);if(ee(t))return le(ge(e),t.toNumber(),r);if(E(t))return le(ge(e),t,r);if(null===t||t===O)return le(ge(e),0,r);if(z(t))return le(ge(e),ge(t),r)}else if(X(e)){if(X(t))return e.timeZone!==t.timeZone&&(e.isUnknownTimeZone?e=n.arcadeDateAndZoneToArcadeDate(e,t.timeZone):t.isUnknownTimeZone&&(t=n.arcadeDateAndZoneToArcadeDate(t,e.timeZone))),le(e.toNumber(),t.toNumber(),r);if(null===t||t===O)return le(e.toNumber(),0,r);if(E(t))return le(e.toNumber(),t,r);if(z(t))return le(e.toNumber(),ge(t),r);if(G(t))return le(e.toNumber(),ge(t),r);if(te(t))throw new i(null,o.CannotCompareDateAndTime,null);if(ee(t))return le(e.toNumber(),t.toNumber(),r)}else if(z(e)){if(z(t))return le(e,t,r);if(E(t))return le(ge(e),ge(t),r);if(X(t))return le(ge(e),t.toNumber(),r);if(te(t))return le(ge(e),t.toNumber(),r);if(ee(t))return le(ge(e),t.toNumber(),r);if(null===t||t===O)return le(ge(e),0,r);if(G(t))return le(ge(e),ge(t),r)}else if(ee(e)){if(X(t))return le(e.toNumber(),t.toNumber(),r);if(null===t||t===O)return le(e.toNumber(),0,r);if(E(t))return le(e.toNumber(),t,r);if(z(t))return le(e.toNumber(),ge(t),r);if(G(t))return le(e.toNumber(),ge(t),r);if(te(t))throw new i(null,o.CannotCompareDateAndTime,null);if(ee(t))return le(e.toNumber(),t.toNumber(),r)}else if(te(e)){if(X(t))throw new i(null,o.CannotCompareDateAndTime,null);if(null===t||t===O)return le(e.toNumber(),0,r);if(E(t))return le(e.toNumber(),t,r);if(z(t))return le(e.toNumber(),ge(t),r);if(G(t))return le(e.toNumber(),ge(t),r);if(te(t))return le(e.toNumber(),t.toNumber(),r);if(ee(t))throw new i(null,o.CannotCompareDateAndTime,null)}return!!ce(e,t)&&("<="===r||">="===r)}function ce(e,t){if(e===t)return!0;if(null===e&&t===O||null===t&&e===O)return!0;if(X(e)&&X(t))return e.equals(t);if(te(e)&&te(t))return e.equals(t);if(ee(e)&&ee(t))return e.equals(t);if(e instanceof l)return e.equalityTest(t);if(e instanceof f)return e.equalityTest(t);if(e instanceof S&&t instanceof S){const n=e.cache._arcadeCacheId,r=t.cache._arcadeCacheId;if(null!=n)return n===r}if(ne(e)&&ne(t)){if(e._arcadeCacheId===t._arcadeCacheId&&void 0!==e._arcadeCacheId&&null!==e._arcadeCacheId)return!0;if(e._underlyingGraphic===t._underlyingGraphic&&void 0!==e._underlyingGraphic&&null!==e._underlyingGraphic)return!0}return!1}function me(e,t){if(G(e))return e;if(null===e)return"";if(E(e))return oe(e,t);if(z(e))return e.toString();if(X(e))return ue(e,t);if(te(e))return e.toFormat(t);if(ee(e))return e.toFormat(t);if(e instanceof b)return JSON.stringify(e.toJSON());if(U(e)){const t=[];for(let n=0;n<e.length;n++)t[n]=ye(e[n]);return"["+t.join(",")+"]"}if(e instanceof s){const t=[];for(let n=0;n<e.length();n++)t[n]=ye(e.get(n));return"["+t.join(",")+"]"}return null!==e&&"object"==typeof e&&void 0!==e.castToText?e.castToText():_(e)?"object, Function":e===O?"":I(e)?"object, Module":""}function de(e){const t=[];if(!U(e))return null;if(e instanceof s){for(let n=0;n<e.length();n++)t[n]=ge(e.get(n));return t}for(let n=0;n<e.length;n++)t[n]=ge(e[n]);return t}function pe(e,t,n=!1){if(G(e))return e;if(null===e)return"";if(E(e))return oe(e,t);if(z(e))return e.toString();if(X(e))return ue(e,t);if(te(e))return e.toFormat(t);if(ee(e))return e.toFormat(t);if(e instanceof b)return e instanceof h?'{"xmin":'+e.xmin.toString()+',"ymin":'+e.ymin.toString()+","+(e.hasZ?'"zmin":'+e.zmin.toString()+",":"")+(e.hasM?'"mmin":'+e.mmin.toString()+",":"")+'"xmax":'+e.xmax.toString()+',"ymax":'+e.ymax.toString()+","+(e.hasZ?'"zmax":'+e.zmax.toString()+",":"")+(e.hasM?'"mmax":'+e.mmax.toString()+",":"")+'"spatialReference":'+je(e.spatialReference)+"}":je(e.toJSON(),((e,t)=>e.key===t.key?0:"spatialReference"===e.key?1:"spatialReference"===t.key||e.key<t.key?-1:e.key>t.key?1:0));if(U(e)){const t=[];for(let r=0;r<e.length;r++)t[r]=ye(e[r],n);return"["+t.join(",")+"]"}if(e instanceof s){const t=[];for(let r=0;r<e.length();r++)t[r]=ye(e.get(r),n);return"["+t.join(",")+"]"}return null!==e&&"object"==typeof e&&void 0!==e.castToText?e.castToText(n):_(e)?"object, Function":e===O?"":I(e)?"object, Module":""}function ye(e,t=!1){if(null===e)return"null";if(z(e)||E(e)||G(e))return JSON.stringify(e);if(e instanceof b)return pe(e,null,t);if(e instanceof s)return pe(e,null,t);if(Array.isArray(e))return pe(e,null,t);if(X(e))return t?JSON.stringify(e.getTime()):JSON.stringify(ue(e,""));if(te(e))return JSON.stringify(e.toString());if(ee(e))return JSON.stringify(e.toString());if(null!==e&&"object"==typeof e){if(void 0!==e.castToText)return e.castToText(t)}else if(e===O)return"null";return"null"}function ge(e,t){return E(e)?e:null===e||""===e?0:X(e)||ee(e)||te(e)?NaN:z(e)?e?1:0:U(e)||""===e||void 0===e?NaN:void 0!==t&&G(e)?(t=v(t,"‰",""),t=v(t,"¤",""),p(e,{pattern:t})):e===O?0:Number(e)}function he(e,t){if(X(e))return e;if(G(e)){const r=be(e,t);if(r)return n.dateTimeToArcadeDate(r)}return null}function be(e,t){const n=/ (\d\d)/,a=r(t);let i=j.fromISO(e,{zone:a});return i.isValid||n.test(e)&&(e=e.replace(n,"T$1"),i=j.fromISO(e,{zone:t}),i.isValid)?i:null}function Ne(e){return z(e)?e:G(e)?"true"===(e=e.toLowerCase()):!!E(e)&&(0!==e&&!isNaN(e))}function Se(e,t){const n=JSON.parse(e);return n&&!n.spatialReference&&(n.spatialReference=t),k(n)}function Ze(e,t){return null==e?null:(null!==e.spatialReference&&void 0!==e.spatialReference||(e.spatialReference=t),e)}function Ae(e){if(null===e)return null;if(e instanceof S)return"NaN"===e.x||null===e.x||isNaN(e.x)?null:e;if(e instanceof Z){if(0===e.rings.length)return null;for(const t of e.rings)if(t.length>0)return e;return null}if(e instanceof A){if(0===e.paths.length)return null;for(const t of e.paths)if(t.length>0)return e;return null}return e instanceof N?0===e.points.length?null:e:e instanceof h?"NaN"===e.xmin||null===e.xmin||isNaN(e.xmin)?null:e:null}function Te(e,t){if(!e)return t;if(!e.domain)return t;let n=null,r=null;if(X(t))n=t.toNumber();else if(ee(t))n=t.toString();else if(te(t))n=t.toStorageString();else if("string"===e.field.type||"esriFieldTypeString"===e.field.type)n=me(t);else{if(null==t)return null;if(""===t)return t;n=ge(t)}for(let a=0;a<e.domain.codedValues.length;a++){const t=e.domain.codedValues[a];t.code===n&&(r=t)}return null===r?me(t):r.name}function De(e,t){if(!e)return t;if(!e.domain)return t;let n=null;const r=me(t);for(let a=0;a<e.domain.codedValues.length;a++){const t=e.domain.codedValues[a];t.name===r&&(n=t)}return null===n?t:n.code}function ke(e,t,n=null,r=null){if(!t)return null;if(!t.fields)return null;let a,u,s=null;for(let i=0;i<t.fields.length;i++){const n=t.fields[i];n.name.toLowerCase()===e.toString().toLowerCase()&&(s=n)}if(null===s)throw new i(null,o.FieldNotFound,null,{key:e});let l=t.typeIdField,f="id",c=t.types;if(t.subtypeField&&(l=t.subtypeField,f="code",c=t.subtypes??[]),null===r&&n&&l)r=n.hasField(l)?n.field(l):null;else if(l&&null!==r){let e=!1;for(const t of c||[])if(r===t[f]){e=!0;break}if(!e)for(const t of c||[])if(r===t.name){r=t[f],e=!0;break}e||(r=null,n&&l&&(r=n.hasField(l)?n.field(l):null))}return null!=r&&c.some((e=>e[f]===r&&(a=e.domains?.[s.name],a&&"inherited"===a.type&&(a=Ce(s.name,t),u=!0),!0))),u||a||(a=Ce(e,t)),{field:s,domain:a}}function Ce(e,t){let n;return t.fields.some((t=>(t.name.toLowerCase()===e.toLowerCase()&&(n=t.domain),!!n))),n}function je(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});const n="boolean"==typeof t.cycles&&t.cycles,r=t.cmp&&(a=t.cmp,function(e){return function(t,n){const r={key:t,value:e[t]},i={key:n,value:e[n]};return a(r,i)}});var a;const i=[];return function e(t){if(t?.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0===t)return;if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);let a,o;if(Array.isArray(t)){for(o="[",a=0;a<t.length;a++)a&&(o+=","),o+=e(t[a])||"null";return o+"]"}if(null===t)return"null";if(i.includes(t)){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}const u=i.push(t)-1,s=Object.keys(t).sort(r?.(t));for(o="",a=0;a<s.length;a++){const n=s[a],r=e(t[n]);r&&(o&&(o+=","),o+=JSON.stringify(n)+":"+r)}return i.splice(u,1),"{"+o+"}"}(e)}function Fe(e){if(null===e)return null;const t=[];for(const n of e)n?.arcadeDeclaredClass&&"esri.arcade.Feature"===n.arcadeDeclaredClass?t.push(n.geometry()):t.push(n);return t}function Me(e,t){if(!(t instanceof S))throw new i(null,o.InvalidParameter,null);e.push(t.hasZ?t.hasM?[t.x,t.y,t.z,t.m]:[t.x,t.y,t.z]:[t.x,t.y])}function we(e,t){if(U(e)||Q(e)){let n=!1,r=!1,a=[],u=t;if(U(e)){for(const t of e)Me(a,t);a.length>0&&(u=e[0].spatialReference,n=e[0].hasZ,r=e[0].hasM)}else if(e instanceof f)a=e._elements,a.length>0&&(n=e._hasZ,r=e._hasM,u=e.get(0).spatialReference);else{if(!Q(e))throw new i(null,o.InvalidParameter,null);for(const t of e.toArray())Me(a,t);a.length>0&&(u=e.get(0).spatialReference,n=!0===e.get(0).hasZ,r=!0===e.get(0).hasM)}if(0===a.length)return null;return D(a)||(a=a.slice(0).reverse()),new Z({rings:[a],spatialReference:u,hasZ:n,hasM:r})}return e}function xe(e,t){if(U(e)||Q(e)){let n=!1,r=!1,a=[],i=t;if(U(e)){for(const t of e)Me(a,t);a.length>0&&(i=e[0].spatialReference,n=!0===e[0].hasZ,r=!0===e[0].hasM)}else if(e instanceof f)a=e._elements,a.length>0&&(n=e._hasZ,r=e._hasM,i=e.get(0).spatialReference);else if(Q(e)){for(const t of e.toArray())Me(a,t);a.length>0&&(i=e.get(0).spatialReference,n=!0===e.get(0).hasZ,r=!0===e.get(0).hasM)}return 0===a.length?null:new A({paths:[a],spatialReference:i,hasZ:n,hasM:r})}return e}function Oe(e,t){if(U(e)||Q(e)){let n=!1,r=!1,a=[],i=t;if(U(e)){for(const t of e)Me(a,t);a.length>0&&(i=e[0].spatialReference,n=!0===e[0].hasZ,r=!0===e[0].hasM)}else if(e instanceof f)a=e._elements,a.length>0&&(n=e._hasZ,r=e._hasM,i=e.get(0).spatialReference);else if(Q(e)){for(const t of e.toArray())Me(a,t);a.length>0&&(i=e.get(0).spatialReference,n=!0===e.get(0).hasZ,r=!0===e.get(0).hasM)}return 0===a.length?null:new N({points:a,spatialReference:i,hasZ:n,hasM:r})}return e}function Re(e,t=!1){const n=[];if(null===e)return n;if(!0===U(e)){for(let r=0;r<e.length;r++){const a=me(e[r]);""===a&&!0!==t||n.push(a)}return n}if(e instanceof s){for(let r=0;r<e.length();r++){const a=me(e.get(r));""===a&&!0!==t||n.push(a)}return n}if(L(e)){const r=me(e);return""===r&&!0!==t||n.push(r),n}return[]}let Je=0;function ve(e){return Je++,Je%100==0?(Je=0,new Promise((t=>{setTimeout((()=>{t(e)}),0)}))):e}function _e(e,t,n){switch(n){case"&":return e&t;case"|":return e|t;case"^":return e^t;case"<<":return e<<t;case">>":return e>>t;case">>>":return e>>>t}}function Ie(e,t=null){return null==e?null:z(e)||E(e)||G(e)?e:e instanceof b?!0===t?.keepGeometryType?e:e.toJSON():e instanceof s?e.toArray().map((e=>Ie(e,t))):Array.isArray(e)?e.map((e=>Ie(e,t))):re(e)?e:X(e)?e.toJSDate():te(e)?e.toString():ee(e)?e.toJSDate():null!==e&&"object"==typeof e&&void 0!==e.castAsJson?e.castAsJson(t):null}async function Le(e,t,n,r,a){const i=await Ye(e,t,n);a[r]=i}async function Ye(e,t=null,n=null){if(e instanceof s&&(e=e.toArray()),null==e)return null;if(L(e)||e instanceof b||re(e)||X(e))return Ie(e,n);if(Array.isArray(e)){const r=[],a=[];for(const i of e)null===i||L(i)||i instanceof b||re(i)||X(i)?a.push(Ie(i,n)):(a.push(null),r.push(Le(i,t,n,a.length-1,a)));return r.length>0&&await Promise.all(r),a}return null!==e&&"object"==typeof e&&void 0!==e.castAsJsonAsync?e.castAsJsonAsync(t,n):null}function Pe(e){return Ge(e)?e.parent:e}function Ge(e){return e&&"declaredClass"in e&&"esri.layers.support.SubtypeSublayer"===e.declaredClass}function ze(e){return e&&"declaredClass"in e&&"esri.layers.SubtypeGroupLayer"===e.declaredClass}function Ee(e,t,n){const r=Pe(e.fullSchema());if(null===r)return null;if(!r.fields)return null;return ke(t,r,e,n)}function Ve(e){const t=Pe(e.fullSchema());return null===t?null:t.fields?t.subtypeField?{subtypeField:t.subtypeField,subtypes:t.subtypes?t.subtypes.map((e=>({name:e.name,code:e.code}))):[]}:t.typeIdField?{subtypeField:t.typeIdField,subtypes:t.types?t.types.map((e=>({name:e.name,code:e.id}))):[]}:null:null}function qe(e,t,n,r){const a=Pe(e.fullSchema());if(null===a)return null;if(!a.fields)return null;const i=ke(t,a,e,r);if(void 0===n)try{n=e.field(t)}catch(o){return null}return Te(i,n)}function Ue(e,t,n,r){const a=Pe(e.fullSchema());if(null===a)return null;if(!a.fields)return null;if(void 0===n){try{n=e.field(t)}catch(i){return null}return n}return De(ke(t,a,e,r),n)}function He(e){return e?.timeZone??"system"}function Be(e){const t=Pe(e.fullSchema());if(null===t)return null;if(!t.fields)return null;const n=[];for(const r of t.fields)n.push(c(r));return{objectIdField:t.objectIdField,globalIdField:t.globalIdField??"",geometryType:void 0===m[t.geometryType]?"":m[t.geometryType],fields:n}}function Ke(r,a){return"system"===r&&(r=n.systemTimeZoneCanonicalName),{version:We,engineVersion:t,timeZone:r,spatialReference:a instanceof T?a.toJSON():a,application:e.applicationName??"",engine:"web",locale:C()}}const We="1.24",$e=Object.freeze(Object.defineProperty({__proto__:null,ImplicitResultE:M,ReturnResultE:F,absRound:ie,arcadeVersion:We,autoCastArrayOfPointsToMultiPoint:Oe,autoCastArrayOfPointsToPolygon:we,autoCastArrayOfPointsToPolyline:xe,autoCastFeatureToGeometry:Fe,binaryOperator:_e,breakResult:R,castAsJson:Ie,castAsJsonAsync:Ye,continueResult:J,defaultExecutingContext:Ke,defaultTimeZone:He,defaultUndefined:Y,equalityTest:ce,featureDomainCodeLookup:Ue,featureDomainValueLookup:qe,featureFullDomain:Ee,featureSchema:Be,featureSubtypes:Ve,fixNullGeometry:Ae,fixSpatialReference:Ze,formatDate:ue,formatNumber:oe,getDomain:ke,getDomainCode:De,getDomainValue:Te,getType:P,greaterThanLessThan:fe,implicitResult:w,isArray:U,isBoolean:z,isDate:X,isDateOnly:ee,isDictionary:K,isFeature:H,isFeatureSet:B,isFeatureSetCollection:W,isFunctionParameter:_,isGeometry:q,isImmutableArray:Q,isInteger:V,isJsDate:re,isKnowledgeGraph:$,isModule:I,isNumber:E,isObject:ne,isSimpleType:L,isString:G,isSubtypeGrouplayer:ze,isSubtypeSublayer:Ge,isTime:te,multiReplace:v,parseGeometryFromJson:Se,pcCheck:ae,returnResult:x,stableStringify:je,standardiseDateFormat:se,tick:ve,toBoolean:Ne,toDate:he,toNumber:ge,toNumberArray:de,toString:me,toStringArray:Re,toStringExplicit:pe,voidOperation:O},Symbol.toStringTag,{value:"Module"}));export{ze as $,w as A,O as B,R as C,J as D,fe as E,ce as F,_e as G,ae as H,Fe as I,we as J,Y as K,xe as L,Oe as M,He as N,V as O,P,se as Q,ie as R,Ae as S,v as T,Be as U,Ve as V,Ee as W,qe as X,Ue as Y,Ke as Z,de as _,z as a,Ge as a0,ve as a1,Re as a2,ke as a3,Te as a4,De as a5,re as a6,F as a7,M as a8,I as a9,ne as aa,oe as ab,ue as ac,Se as ad,je as ae,We as af,E as b,G as c,Ie as d,Ye as e,L as f,ge as g,Ne as h,_ as i,me as j,X as k,he as l,ee as m,te as n,U as o,q as p,Q as q,H as r,W as s,pe as t,B as u,K as v,$ as w,Ze as x,$e as y,x as z};
package/core/number.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.30/esri/copyright.txt for details.
4
4
  */
5
- import{escapeRegExpString as e}from"./string.js";import{getLocale as t}from"../intl/locale.js";const n={ar:[".",","],bg:[","," "],bs:[",","."],ca:[",","."],cs:[","," "],da:[",","."],de:[",","."],"de-ch":[".","’"],el:[",","."],en:[".",","],"en-au":[".",","],es:[",","."],"es-mx":[".",","],et:[","," "],fi:[","," "],fr:[","," "],"fr-ch":[","," "],he:[".",","],hi:[".",",","#,##,##0.###"],hr:[",","."],hu:[","," "],id:[",","."],it:[",","."],"it-ch":[".","’"],ja:[".",","],ko:[".",","],lt:[","," "],lv:[","," "],mk:[",","."],nb:[","," "],nl:[",","."],pl:[","," "],pt:[",","."],"pt-pt":[","," "],ro:[",","."],ru:[","," "],sk:[","," "],sl:[",","."],sr:[",","."],sv:[","," "],th:[".",","],tr:[",","."],uk:[","," "],vi:[",","."],zh:[".",","]};function r(e=t()){let r=(e=e.toLowerCase())in n;if(!r){const t=e.split("-");t.length>1&&t[0]in n&&(e=t[0],r=!0),r||(e="en")}const[s,l,o="#,##0.###"]=n[e];return{decimal:s,group:l,pattern:o}}function s(e,t){const n=r((t={...t}).locale);t.customs=n;const s=t.pattern||n.pattern;return isNaN(e)||Math.abs(e)===1/0?null:o(e,s,t)}const l=/[#0,]*[#0](?:\.0*#*)?/;function o(e,t,n){const r=(n=n||{}).customs.group,s=n.customs.decimal,o=t.split(";"),c=o[0];if((t=o[e<0?1:0]||"-"+c).includes("%"))e*=100;else if(t.includes("‰"))e*=1e3;else{if(t.includes("¤"))throw new Error("currency notation not supported");if(t.includes("E"))throw new Error("exponential notation not supported")}const a=l,p=c.match(a);if(!p)throw new Error("unable to find a number expression in pattern: "+t);return!1===n.fractional&&(n.places=0),t.replace(a,i(e,p[0],{decimal:s,group:r,places:n.places,round:n.round}))}function i(e,t,n){!0===(n=n||{}).places&&(n.places=0),n.places===1/0&&(n.places=6);const r=t.split("."),s="string"==typeof n.places&&n.places.indexOf(",");let l=n.places;s?l=n.places.substring(s+1):+l>=0||(l=(r[1]||[]).length),n.round<0||(e=Number(e.toFixed(Number(l))));const o=String(Math.abs(e)).split("."),i=o[1]||"";if(r[1]||n.places){s&&(n.places=n.places.substring(0,s));const e=void 0!==n.places?n.places:r[1]&&r[1].lastIndexOf("0")+1;+e>i.length&&(o[1]=i.padEnd(Number(e),"0")),+l<i.length&&(o[1]=i.substr(0,Number(l)))}else o[1]&&o.pop();const c=r[0].replace(",","");let a=c.indexOf("0");-1!==a&&(a=c.length-a,a>o[0].length&&(o[0]=o[0].padStart(a,"0")),c.includes("#")||(o[0]=o[0].substr(o[0].length-a)));let p,u,d=r[0].lastIndexOf(",");if(-1!==d){p=r[0].length-d-1;const e=r[0].substr(0,d);d=e.lastIndexOf(","),-1!==d&&(u=e.length-d-1)}const g=[];for(let f=o[0];f;){const e=f.length-p;g.push(e>0?f.substr(e):f),f=e>0?f.slice(0,e):"",u&&(p=u,u=void 0)}return o[0]=g.reverse().join(n.group||","),o.join(n.decimal||".")}function c(e){return a(e).regexp}function a(t){const n=r((t=t||{}).locale),s=t.pattern||n.pattern,o=n.group,i=n.decimal;let c=1;if(s.includes("%"))c/=100;else if(s.includes("‰"))c/=1e3;else if(s.includes("¤"))throw new Error("currency notation not supported");const a=s.split(";");1===a.length&&a.push("-"+a[0]);const p=g(a,(n=>(n="(?:"+e(n,".")+")").replace(l,(e=>{const n={signed:!1,separator:t.strict?o:[o,""],fractional:t.fractional,decimal:i,exponent:!1},r=e.split(".");let s=t.places;1===r.length&&1!==c&&(r[1]="###"),1===r.length||0===s?n.fractional=!1:(void 0===s&&(s=t.pattern?r[1].lastIndexOf("0")+1:1/0),s&&null==t.fractional&&(n.fractional=!0),!t.places&&+s<r[1].length&&(s+=","+r[1].length),n.places=s);const l=r[0].split(",");return l.length>1&&(n.groupSize=l.pop().length,l.length>1&&(n.groupSize2=l.pop().length)),"("+u(n)+")"}))),!0);return{regexp:p.replaceAll(/[\xa0 ]/g,"[\\s\\xa0]"),group:o,decimal:i,factor:c}}function p(e,t){const n=a(t),r=new RegExp("^"+n.regexp+"$").exec(e);if(!r)return NaN;let s=r[1];if(!r[1]){if(!r[2])return NaN;s=r[2],n.factor*=-1}return s=s.replaceAll(new RegExp("["+n.group+"\\s\\xa0]","g"),"").replace(n.decimal,"."),Number(s)*n.factor}function u(e){"places"in(e=e||{})||(e.places=1/0),"string"!=typeof e.decimal&&(e.decimal="."),"fractional"in e&&!String(e.places).startsWith("0")||(e.fractional=[!0,!1]),"exponent"in e||(e.exponent=[!0,!1]),"eSigned"in e||(e.eSigned=[!0,!1]);const t=d(e),n=g(e.fractional,(t=>{let n="";return t&&0!==e.places&&(n="\\"+e.decimal,e.places===1/0?n="(?:"+n+"\\d+)?":n+="\\d{"+e.places+"}"),n}),!0);let r=t+n;return n&&(r="(?:(?:"+r+")|(?:"+n+"))"),r+g(e.exponent,(t=>t?"([eE]"+d({signed:e.eSigned})+")":""))}function d(t){"signed"in(t=t||{})||(t.signed=[!0,!1]),"separator"in t?"groupSize"in t||(t.groupSize=3):t.separator="";return g(t.signed,(e=>e?"[-+]":""),!0)+g(t.separator,(n=>{if(!n)return"(?:\\d+)";" "===(n=e(n))?n="\\s":" "===n&&(n="\\s\\xa0");const r=t.groupSize,s=t.groupSize2;if(s){const e="(?:0|[1-9]\\d{0,"+(s-1)+"}(?:["+n+"]\\d{"+s+"})*["+n+"]\\d{"+r+"})";return r-s>0?"(?:"+e+"|(?:0|[1-9]\\d{0,"+(r-1)+"}))":e}return"(?:0|[1-9]\\d{0,"+(r-1)+"}(?:["+n+"]\\d{"+r+"})*)"}),!0)}const g=(e,t,n)=>{if(!(e instanceof Array))return t(e);const r=[];for(let s=0;s<e.length;s++)r.push(t(e[s]));return f(r.join("|"),Boolean(n))},f=(e,t)=>"("+(t?"?:":"")+e+")";export{a as _parseInfo,s as format,r as getCustoms,p as parse,c as regexp};
5
+ import{escapeRegExpString as e}from"./string.js";import{getLocale as t}from"../intl/locale.js";const n={ar:[".",","],bg:[","," "],bs:[",","."],ca:[",","."],cs:[","," "],da:[",","."],de:[",","."],"de-ch":[".","’"],el:[",","."],en:[".",","],"en-au":[".",","],es:[",","."],"es-mx":[".",","],et:[","," "],fi:[","," "],fr:[","," "],"fr-ch":[","," "],he:[".",","],hi:[".",",","#,##,##0.###"],hr:[",","."],hu:[","," "],id:[",","."],it:[",","."],"it-ch":[".","’"],ja:[".",","],ko:[".",","],lt:[","," "],lv:[","," "],mk:[",","."],nb:[","," "],nl:[",","."],pl:[","," "],pt:[",","."],"pt-pt":[","," "],ro:[",","."],ru:[","," "],sk:[","," "],sl:[",","."],sr:[",","."],sv:[","," "],th:[".",","],tr:[",","."],uk:[","," "],vi:[",","."],zh:[".",","]};function r(e=t()){let r=(e=e.toLowerCase())in n;if(!r){const t=e.split("-");t.length>1&&t[0]in n&&(e=t[0],r=!0),r||(e="en")}const[s,l,o="#,##0.###"]=n[e];return{decimal:s,group:l,pattern:o}}function s(e,t){const n=r((t={...t}).locale);t.customs=n;const s=t.pattern||n.pattern;return isNaN(e)||Math.abs(e)===1/0?null:o(e,s,t)}const l=/[#0,]*[#0](?:\.0*#*)?/;function o(e,t,n){const r=(n=n||{}).customs.group,s=n.customs.decimal,o=t.split(";"),a=o[0];if((t=o[e<0?1:0]||"-"+a).includes("%"))e*=100;else if(t.includes("‰"))e*=1e3;else{if(t.includes("¤"))throw new Error("currency notation not supported");if(t.includes("E"))throw new Error("exponential notation not supported")}const c=l,p=a.match(c);if(!p)throw new Error("unable to find a number expression in pattern: "+t);return!1===n.fractional&&(n.places=0),t.replace(c,i(e,p[0],{decimal:s,group:r,places:n.places,round:n.round}))}function i(e,t,n){!0===(n=n||{}).places&&(n.places=0),n.places===1/0&&(n.places=6);const r=t.split("."),s="string"==typeof n.places&&n.places.indexOf(",");let l=n.places;s?l=n.places.substring(s+1):+l>=0||(l=(r[1]||[]).length),n.round<0||(e=Number(e.toFixed(Number(l))));const o=String(Math.abs(e)).split("."),i=o[1]||"";if(r[1]||n.places){s&&(n.places=n.places.substring(0,s));const e=void 0!==n.places?n.places:r[1]&&r[1].lastIndexOf("0")+1;+e>i.length&&(o[1]=i.padEnd(Number(e),"0")),+l<i.length&&(o[1]=i.substr(0,Number(l)))}else o[1]&&o.pop();const a=r[0].replace(",","");let c=a.indexOf("0");-1!==c&&(c=a.length-c,c>o[0].length&&(o[0]=o[0].padStart(c,"0")),a.includes("#")||(o[0]=o[0].substr(o[0].length-c)));let p,u,d=r[0].lastIndexOf(",");if(-1!==d){p=r[0].length-d-1;const e=r[0].substr(0,d);d=e.lastIndexOf(","),-1!==d&&(u=e.length-d-1)}const g=[];for(let f=o[0];f;){const e=f.length-p;g.push(e>0?f.substr(e):f),f=e>0?f.slice(0,e):"",u&&(p=u,u=void 0)}return o[0]=g.reverse().join(n.group||","),o.join(n.decimal||".")}function a(e){return c(e).regexp}function c(t){const n=r((t=t||{}).locale),s=t.pattern||n.pattern,o=n.group,i=n.decimal;let a=1;if(s.includes("%"))a/=100;else if(s.includes("‰"))a/=1e3;else if(s.includes("¤"))throw new Error("currency notation not supported");const c=s.split(";");1===c.length&&c.push("-"+c[0]);const p=g(c,(n=>(n="(?:"+e(n,".")+")").replace(l,(e=>{const n={signed:!1,separator:t.strict?o:[o,""],fractional:t.fractional,decimal:i,exponent:!1},r=e.split(".");let s=t.places;1===r.length&&1!==a&&(r[1]="###"),1===r.length||0===s?n.fractional=!1:(void 0===s&&(s=t.pattern?r[1].lastIndexOf("0")+1:1/0),s&&null==t.fractional&&(n.fractional=!0),!t.places&&+s<r[1].length&&(s+=","+r[1].length),n.places=s);const l=r[0].split(",");return l.length>1&&(n.groupSize=l.pop().length,l.length>1&&(n.groupSize2=l.pop().length)),"("+u(n)+")"}))),!0);return{regexp:p.replaceAll(/[\xa0 ]/g,"[\\s\\xa0]"),group:o,decimal:i,factor:a}}function p(e,t){const n=c(t),r=new RegExp("^"+n.regexp+"$").exec(e);if(!r)return NaN;let s=r[1];if(!r[1]){if(!r[2])return NaN;s=r[2],n.factor*=-1}return s=s.replaceAll(new RegExp("["+n.group+"\\s\\xa0]","g"),"").replace(n.decimal,"."),Number(s)*n.factor}function u(e){"places"in(e=e||{})||(e.places=1/0),"string"!=typeof e.decimal&&(e.decimal="."),"fractional"in e&&!String(e.places).startsWith("0")||(e.fractional=[!0,!1]),"exponent"in e||(e.exponent=[!0,!1]),"eSigned"in e||(e.eSigned=[!0,!1]);const t=d(e),n=g(e.fractional,(t=>{let n="";return t&&0!==e.places&&(n="\\"+e.decimal,e.places===1/0?n="(?:"+n+"\\d+)?":n+="\\d{"+e.places+"}"),n}),!0);let r=t+n;return n&&(r="(?:(?:"+r+")|(?:"+n+"))"),r+g(e.exponent,(t=>t?"([eE]"+d({signed:e.eSigned})+")":""))}function d(t){"signed"in(t=t||{})||(t.signed=[!0,!1]),"separator"in t?"groupSize"in t||(t.groupSize=3):t.separator="";return g(t.signed,(e=>e?"[-+]":""),!0)+g(t.separator,(n=>{if(!n)return"(?:\\d+)";" "===(n=e(n))?n="\\s":" "===n&&(n="\\s\\xa0");const r=t.groupSize,s=t.groupSize2;if(s){const e="(?:0|[1-9]\\d{0,"+(s-1)+"}(?:["+n+"]\\d{"+s+"})*["+n+"]\\d{"+r+"})";return r-s>0?"(?:"+e+"|(?:0|[1-9]\\d{0,"+(r-1)+"}))":e}return"(?:0|[1-9]\\d{0,"+(r-1)+"}(?:["+n+"]\\d{"+r+"})*)"}),!0)}const g=(e,t,n)=>{if(!Array.isArray(e))return t(e);const r=[];for(let s=0;s<e.length;s++)r.push(t(e[s]));return f(r.join("|"),Boolean(n))},f=(e,t)=>"("+(t?"?:":"")+e+")";export{c as _parseInfo,s as format,r as getCustoms,p as parse,a as regexp};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.30/esri/copyright.txt for details.
4
4
  */
5
- import"../../config.js";import"../../request.js";import"../Error.js";import"../Logger.js";import"../urlUtils.js";import"../has.js";let s=null;const a={};function r(s){const r={async:s.async,isDebug:s.isDebug,locale:s.locale,baseUrl:s.baseUrl,has:{...s.has},map:{...s.map},packages:s.packages?.concat()||[],paths:{...s.paths}};return s.hasOwnProperty("async")||(r.async=!0),s.hasOwnProperty("isDebug")||(r.isDebug=!1),s.baseUrl||(r.baseUrl=a.baseUrl),r}export{s as defaultLoaderUrl,r as loaderConfig};
5
+ import"../../config.js";import"../../request.js";import"../Error.js";import"../Logger.js";import"../urlUtils.js";import"../has.js";let s=null;const a={};function r(s){const r={async:s.async,isDebug:s.isDebug,locale:s.locale,baseUrl:s.baseUrl,has:{...s.has},map:{...s.map},packages:s.packages?.concat()||[],paths:{...a.paths,...s.paths}};return s.hasOwnProperty("async")||(r.async=!0),s.hasOwnProperty("isDebug")||(r.isDebug=!1),s.baseUrl||(r.baseUrl=a.baseUrl),r}export{s as defaultLoaderUrl,r as loaderConfig};