@arcgis/ai-components 5.2.0-next.1 → 5.2.0-next.11

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 (162) hide show
  1. package/dist/agent-utils/FunctionAgent.d.ts +2 -2
  2. package/dist/agent-utils/LLMAgent.d.ts +2 -2
  3. package/dist/agent-utils/LLMAgent.js +22 -22
  4. package/dist/agent-utils/WorkflowAgent.d.ts +2 -2
  5. package/dist/agent-utils/index.d.ts +99 -0
  6. package/dist/agent-utils/index.js +148 -0
  7. package/dist/agent-utils/middlewares/trace.js +25 -33
  8. package/dist/agent-utils/tools/FunctionTool.d.ts +2 -2
  9. package/dist/agent-utils/types.d.ts +30 -1
  10. package/dist/agent-utils/workflows/ConditionalWorkflow.d.ts +2 -2
  11. package/dist/agent-utils/workflows/LoopWorkflow.d.ts +2 -2
  12. package/dist/agent-utils/workflows/ParallelWorkflow.d.ts +2 -2
  13. package/dist/agent-utils/workflows/RouterWorkflow.d.ts +2 -2
  14. package/dist/agent-utils/workflows/SequentialWorkflow.d.ts +2 -2
  15. package/dist/agent-utils/workflows/SwitchWorkflow.d.ts +2 -2
  16. package/dist/cdn/{V2P4AIGG.js → 24QNMEFG.js} +1 -1
  17. package/dist/cdn/{NAUXSHIE.js → 34SG44C3.js} +2 -2
  18. package/dist/cdn/3JGWGKT6.js +2 -0
  19. package/dist/cdn/3NBDVZ2I.js +2 -0
  20. package/dist/cdn/3VOQD2MR.js +2 -0
  21. package/dist/cdn/434TAA3J.js +2 -0
  22. package/dist/cdn/53NTYC4I.js +2 -0
  23. package/dist/cdn/{4HU7735A.js → 5CV7R5IS.js} +6 -4
  24. package/dist/cdn/{AMP6IALT.js → 5W7S2RS4.js} +1 -1
  25. package/dist/cdn/{FL4W4VYN.js → 6ZW7Z36F.js} +16 -0
  26. package/dist/cdn/7CYGX4F4.js +2 -0
  27. package/dist/cdn/{DHOVCT6R.js → AZGGTNA3.js} +1 -1
  28. package/dist/cdn/B7WJFBOZ.js +2 -0
  29. package/dist/cdn/BX7FSMUU.js +56 -0
  30. package/dist/cdn/CHPQM77M.js +181 -0
  31. package/dist/cdn/DHKUXLU3.js +179 -0
  32. package/dist/cdn/DQSEBKOX.js +2 -0
  33. package/dist/cdn/DXVU45KM.js +2 -0
  34. package/dist/cdn/{P6OPJQMC.js → DZ2QWNUA.js} +1 -1
  35. package/dist/cdn/EBISDZ5H.js +2 -0
  36. package/dist/cdn/{MDVYQQUG.js → ERL2CB2Y.js} +5 -5
  37. package/dist/cdn/F6QHMKF5.js +2 -0
  38. package/dist/cdn/FUIGPHBH.js +2 -0
  39. package/dist/cdn/{AO7BQHKC.js → H2CHHGGH.js} +1 -1
  40. package/dist/cdn/{OH64RMOR.js → HWKDNS4K.js} +2 -2
  41. package/dist/cdn/IMQ4TVHF.js +16 -0
  42. package/dist/cdn/IOD3GDA7.js +2 -0
  43. package/dist/cdn/IR7PTESF.js +2 -0
  44. package/dist/cdn/IRZDTYO2.js +2 -0
  45. package/dist/cdn/JIWK6QK6.js +2 -0
  46. package/dist/cdn/{S6W6HV4T.js → JLKGS6Y5.js} +12 -12
  47. package/dist/cdn/K3JCH4XW.js +2 -0
  48. package/dist/cdn/KHXUWZHB.js +2 -0
  49. package/dist/cdn/LIFK3QSD.js +2 -0
  50. package/dist/cdn/NXKKG5TK.js +2 -0
  51. package/dist/cdn/{FX5JFRDL.js → O3EN27N5.js} +1 -1
  52. package/dist/cdn/O3RFFPU3.js +6 -0
  53. package/dist/cdn/P7DG5T3Z.js +9 -0
  54. package/dist/cdn/PBO6FZN6.js +2 -0
  55. package/dist/cdn/Q3ZW4FYA.js +3 -0
  56. package/dist/cdn/Q6LRANX6.js +2 -0
  57. package/dist/cdn/Q7TL5Q5N.js +2 -0
  58. package/dist/cdn/QCSN44H4.js +2 -0
  59. package/dist/cdn/R56X6ZKR.js +161 -0
  60. package/dist/cdn/{HB5A5R2E.js → RUURNLTP.js} +1 -1
  61. package/dist/cdn/T43LEBBE.js +47 -0
  62. package/dist/cdn/{ZLXN7NMF.js → T537PKP4.js} +9 -7
  63. package/dist/cdn/TR4GFL7X.js +2 -0
  64. package/dist/cdn/{3PKJWIC3.js → UPEEHMSY.js} +1 -1
  65. package/dist/cdn/WAIFKDR3.js +2 -0
  66. package/dist/cdn/WNS5ZUF5.js +2 -0
  67. package/dist/cdn/X4XY5HIE.js +2 -0
  68. package/dist/cdn/XOH56EQ2.js +2 -0
  69. package/dist/cdn/XON27U6U.js +2 -0
  70. package/dist/cdn/{H7422XUG.js → YLN2BZ5J.js} +1 -1
  71. package/dist/cdn/{2AXF774U.js → YUKR4AZW.js} +1 -1
  72. package/dist/cdn/{JY6LLOUJ.js → Z2G7MP5L.js} +3 -3
  73. package/dist/cdn/ZEYIBYSF.js +66 -0
  74. package/dist/cdn/agent-utils/index.js +2 -0
  75. package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +3 -0
  76. package/dist/cdn/agent-utils/middlewares/middleware.js +2 -0
  77. package/dist/cdn/agent-utils/middlewares/trace.js +2 -0
  78. package/dist/cdn/index.js +1 -1
  79. package/dist/cdn/main.css +1 -1
  80. package/dist/chunks/adapter.js +1390 -1323
  81. package/dist/chunks/arcgisKnowledgeGraph.js +109 -72
  82. package/dist/chunks/dataExplorationGraph.js +108 -96
  83. package/dist/chunks/generateLayerDescriptions.js +206 -168
  84. package/dist/chunks/helpGraph.js +16 -13
  85. package/dist/chunks/index.js +11 -0
  86. package/dist/chunks/intent_prompt.js +16 -0
  87. package/dist/chunks/layerStylingGraph.js +23 -20
  88. package/dist/chunks/navigationGraph.js +34 -30
  89. package/dist/chunks/orchestrator.js +241 -201
  90. package/dist/chunks/slottableRequestUtils.js +3 -7
  91. package/dist/chunks/summarize_query_response_prompt.js +9 -7
  92. package/dist/chunks/toolCallResponse.js +5 -3
  93. package/dist/components/arcgis-assistant/customElement.d.ts +15 -0
  94. package/dist/components/arcgis-assistant/customElement.js +228 -127
  95. package/dist/components/arcgis-assistant/index.js +2 -3
  96. package/dist/components/arcgis-assistant/types.d.ts +14 -1
  97. package/dist/components/arcgis-assistant-chat/customElement.d.ts +8 -2
  98. package/dist/components/arcgis-assistant-chat/customElement.js +7 -7
  99. package/dist/components/arcgis-assistant-chat-entry/customElement.d.ts +4 -1
  100. package/dist/components/arcgis-assistant-chat-entry/customElement.js +25 -18
  101. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +1 -0
  102. package/dist/components/arcgis-assistant-help-agent/customElement.js +1 -0
  103. package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +4 -1
  104. package/dist/components/arcgis-assistant-interrupt/customElement.js +13 -9
  105. package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +20 -0
  106. package/dist/components/arcgis-assistant-interrupt-preview/index.js +2 -0
  107. package/dist/components/arcgis-assistant-knowledge-agent/customElement.d.ts +7 -7
  108. package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +1 -0
  109. package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +1 -0
  110. package/dist/components/arcgis-assistant-message/customElement.d.ts +23 -0
  111. package/dist/components/arcgis-assistant-message/customElement.js +28 -26
  112. package/dist/components/arcgis-assistant-message/index.d.ts +1 -0
  113. package/dist/components/arcgis-assistant-message/index.js +2 -0
  114. package/dist/components/arcgis-assistant-message-block/customElement.d.ts +1 -1
  115. package/dist/components/arcgis-assistant-message-block/customElement.js +18 -11
  116. package/dist/components/arcgis-assistant-message-block/index.js +1 -0
  117. package/dist/components/arcgis-assistant-message-feedback/customElement.d.ts +4 -1
  118. package/dist/components/arcgis-assistant-message-footer/customElement.d.ts +4 -1
  119. package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +8 -1
  120. package/dist/components/arcgis-assistant-message-loading/customElement.js +8 -8
  121. package/dist/components/arcgis-assistant-message-loading/index.js +1 -0
  122. package/dist/components/arcgis-assistant-message-log/customElement.d.ts +4 -1
  123. package/dist/components/arcgis-assistant-message-read-aloud/customElement.d.ts +4 -1
  124. package/dist/components/arcgis-assistant-message-text/customElement.d.ts +4 -1
  125. package/dist/components/arcgis-assistant-navigation-agent/customElement.js +1 -0
  126. package/dist/components/arcgis-assistant-speech-input/customElement.d.ts +6 -1
  127. package/dist/components/arcgis-assistant-suggested-prompts/customElement.d.ts +4 -1
  128. package/dist/components/arcgis-assistant-suggested-prompts/customElement.js +8 -8
  129. package/dist/components/arcgis-assistant-user-message/customElement.d.ts +4 -1
  130. package/dist/components/arcgis-assistant-user-message/customElement.js +1 -1
  131. package/dist/docs/api.json +1 -1
  132. package/dist/docs/docs.json +1 -1
  133. package/dist/docs/vscode.html-custom-data.json +1 -1
  134. package/dist/docs/web-types.json +1 -1
  135. package/dist/index.d.ts +4 -0
  136. package/dist/loader.js +6 -5
  137. package/dist/orchestrator/registry/agentRegistry.d.ts +33 -0
  138. package/dist/types/lumina.d.ts +10 -4
  139. package/dist/types/preact.d.ts +11 -4
  140. package/dist/types/react.d.ts +12 -4
  141. package/dist/types/stencil.d.ts +10 -4
  142. package/dist/utils/index.d.ts +87 -43
  143. package/dist/utils/index.js +54 -49
  144. package/package.json +8 -7
  145. package/dist/cdn/462JBSEV.js +0 -422
  146. package/dist/cdn/7BCR6TUO.js +0 -2
  147. package/dist/cdn/7GH7VSB2.js +0 -2
  148. package/dist/cdn/7PLV4QH6.js +0 -2
  149. package/dist/cdn/DDLZOMUY.js +0 -2
  150. package/dist/cdn/FHVXO2WG.js +0 -166
  151. package/dist/cdn/GSEPHN3A.js +0 -106
  152. package/dist/cdn/MH5RPXHM.js +0 -2
  153. package/dist/cdn/NVI3I46B.js +0 -2
  154. package/dist/cdn/OAVEHGB6.js +0 -2
  155. package/dist/cdn/ON2V5XI2.js +0 -3
  156. package/dist/cdn/QR54T33D.js +0 -2
  157. package/dist/cdn/RVOAPUBN.js +0 -2
  158. package/dist/cdn/SXDLXCIM.js +0 -2
  159. package/dist/cdn/USMDJUFS.js +0 -2
  160. package/dist/cdn/V5YEZSRY.js +0 -16
  161. package/dist/cdn/Y333DGV6.js +0 -2
  162. package/dist/cdn/YY2SBO3V.js +0 -2
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import a from"./3VOQD2MR.js";import"./FUIGPHBH.js";import"./DHKUXLU3.js";import"./CHPQM77M.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([{property:d,subclass:f},{a:u,c:i,d:c}])=>{var m=Object.defineProperty,g=Object.getOwnPropertyDescriptor,p=(e,o,r,t)=>{for(var s=t>1?void 0:t?g(o,r):o,a=e.length-1,n;a>=0;a--)(n=e[a])&&(s=(t?n(o,r,s):n(s))||s);return t&&s&&m(o,r,s),s},l=class extends c{constructor(e){super(e)}getAgents(){return this.agents}getEntryNode(e){return e[0]?i(e[0],0):void 0}isTerminalAgent(e,o){return o===e.length-1}validateAgents(e){super.validateAgents(e);let o=new Map;for(let[r,t]of e.entries()){let s=e[r-1];if(t.outputSchema)for(let a of u(t.outputSchema)){let n=o.get(a)??[];n.push(`${t.name} [${r}]`),o.set(a,n)}if(!(r===0||!t.inputSchema||s?.outputSchema))throw new Error(`Workflow agent "${t.name}" declares an input schema, so upstream agent "${s.name}" must declare an output schema.`)}for(let[r,t]of o.entries())t.length>1&&console.warn(`Workflow output field "${r}" is declared by multiple steps (${t.join(", ")}). Later steps will overwrite earlier values in shared state.`)}buildEdges(e){return e.length===1?[{from:i(e[0],0),decide:()=>{}}]:e.slice(0,-1).map((o,r)=>({from:i(o,r),decide:t=>t.status==="failed"?void 0:i(e[r+1],r+1)}))}};p([d()],l.prototype,"agents",2);l=p([f("SequentialWorkflow")],l);return l},"core/accessorSupport/decorators",a)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as p}from"./BX7FSMUU.js";function f(r,e,o){return{name:r,handler:async(a,t)=>{let n=async l=>{let u=await e.beforeAgent?.(l),w=u?{...l,state:{...l.state,...u}}:l,i=await t(w),d=await e.afterAgent?.({...w,result:i});return d?{...i,...d}:i};return e.wrapAgent?await e.wrapAgent(a,n):await n(a)},hooks:e,outputKey:o?.outputKey}}function M(r,e,o){return{name:r,handler:async(a,t)=>e.wrapToolCall?await e.wrapToolCall(a,t):await t(a),outputKey:o?.outputKey}}function y(r){return r.map(e=>s(e.name,e.hooks??{})).filter(e=>!!e)}function s(r,e){let{afterModel:o,beforeModel:a,wrapModelCall:t,wrapToolCall:n}=e;if(!(!o&&!a&&!t&&!n))return p({afterModel:o,beforeModel:a,name:r,wrapModelCall:t,wrapToolCall:n})}export{f as a,M as b,y as c};
@@ -1,3 +1,3 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as e,b as n}from"./NAUXSHIE.js";import{g as r,h as i,v as s,y as c}from"./OH64RMOR.js";import"./YIMNOUTF.js";var l=r`.container{border-radius:var(--calcite-border-radius);margin-bottom:var(--calcite-spacing-md)}.block{margin:0;background-color:var(--calcite-color-foreground-1);width:100%;max-height:300px;overflow:auto}.entry{margin-left:var(--calcite-spacing-sm);padding:var(--calcite-spacing-xxs) var(--calcite-spacing-lg);border-left:1px solid var(--calcite-color-border-1)}`,o=class extends s{constructor(){super(...arguments),this.logEnabled=!1,this.showLog=!1}static{this.properties={logEnabled:5,showLog:5,log:0}}static{this.styles=l}render(){return this.log?.length&&this.showLog&&this.logEnabled?i`<div class="container"><div class="block"><calcite-accordion appearance=transparent icon-position=start icon-type=chevron scale=s>${this.log.map(a=>{let t=a.includes(`
2
+ import{a as e,b as n}from"./34SG44C3.js";import{g as r,h as i,v as s,z as c}from"./HWKDNS4K.js";import"./YIMNOUTF.js";var l=r`.container{border-radius:var(--calcite-border-radius);margin-bottom:var(--calcite-spacing-md)}.block{margin:0;background-color:var(--calcite-color-foreground-1);width:100%;max-height:300px;overflow:auto}.entry{margin-left:var(--calcite-spacing-sm);padding:var(--calcite-spacing-xxs) var(--calcite-spacing-lg);border-left:1px solid var(--calcite-color-border-1)}`,o=class extends s{constructor(){super(...arguments),this.logEnabled=!1,this.showLog=!1}static{this.properties={logEnabled:5,showLog:5,log:0}}static{this.styles=l}render(){return this.log?.length&&this.showLog&&this.logEnabled?i`<div class="container"><div class="block"><calcite-accordion appearance=transparent icon-position=start icon-type=chevron scale=s>${this.log.map(a=>{let t=a.includes(`
3
3
  `)||a.length>70;return i`<calcite-accordion-item .heading=${t?`${a.substring(0,70)}...`:a} .expanded=${t}><div class="entry">${t?e(n(a)):null}</div></calcite-accordion-item>`})}</calcite-accordion></div></div>`:null}};c("arcgis-assistant-message-log",o);export{o as ArcgisAssistantMessageLog};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as t}from"./P7DG5T3Z.js";export default $arcgis.t(([])=>{var d=async(o,r)=>{let i=o.tool_calls??[];if(i.length===0){await t({text:`LLM did not request any tool calls: ${String(o?.content)}`},r);return}await Promise.all(i.map(async a=>await t({text:`LLM invoked ${a.name} tool with arguments: ${JSON.stringify(a.args,null,2)}`},r)))};return d},"identity/IdentityManager","portal/Portal","config","core/reactiveUtils","layers/FeatureLayer","request")
@@ -1,14 +1,14 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import c from"./YY2SBO3V.js";import b from"./FHVXO2WG.js";import a from"./GSEPHN3A.js";import{Fb as I,a as w,b as h,q as E}from"./462JBSEV.js";import{a as v,c as F}from"./HB5A5R2E.js";import"./AMP6IALT.js";import"./OAVEHGB6.js";import{v as x,y as S}from"./OH64RMOR.js";import"./YIMNOUTF.js";export default $arcgis.t(([,,,,,,,,,,,,,,,{f:n,m:L},{A:z,B:u,a:$,m:C,o:y,p:N,q:A,r:R,s:T,t:b,u:_,v:V,w:q,x:j,y:k,z:M},D])=>{var B=.7,P=10,J=async(t,r)=>{try{await n({text:"Similarity search to find fields"},r);let e=y(r,"fieldSearch"),i=y(r,"layersAndFieldsRegistry"),o=y(r,"embeddingCache"),a=await e.searchFields({text:t.agentExecutionContext.assignedTask,layerIds:t.vectorSearchLayerIds,minScore:B,topResults:P,embeddingCache:o}),m=a.map(({layerId:c,results:d})=>{let g=d.map(s=>` - ${s.name} (${s.score.toFixed(2)})`).join(`
2
+ import c from"./EBISDZ5H.js";import b from"./R56X6ZKR.js";import a from"./T43LEBBE.js";import{a as v,c as F}from"./RUURNLTP.js";import"./5W7S2RS4.js";import"./NXKKG5TK.js";import{v as x,z as S}from"./HWKDNS4K.js";import{a as n}from"./P7DG5T3Z.js";import"./BX7FSMUU.js";import{a as w,b as h,q as E,ta as I}from"./DHKUXLU3.js";import"./CHPQM77M.js";import"./WNS5ZUF5.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([,,,,,,,,,,,,,,,,,{l:L},{A:z,B:u,a:$,m:C,o:m,p:N,q:A,r:R,s:T,t:b,u:_,v:V,w:q,x:j,y:k,z:M},D])=>{var B=.7,P=10,J=async(t,r)=>{try{await n({text:"Similarity search to find fields"},r);let e=m(r,"fieldSearch"),i=m(r,"layersAndFieldsRegistry"),o=m(r,"embeddingCache"),a=await e.searchFields({text:t.agentExecutionContext.assignedTask,layerIds:t.vectorSearchLayerIds,minScore:B,topResults:P,embeddingCache:o}),y=a.map(({layerId:c,results:d})=>{let g=d.map(s=>` - ${s.name} (${s.score.toFixed(2)})`).join(`
3
3
  `);return`${i.get(c)?.layerItem.name??c}:
4
4
  ${g}`}).join(`
5
5
  `),l;return a.length>0?l=`Vector search completed. Matching layers and fields with scores:
6
- ${m}`:l=`No vector search results found for score over ${B}.`,await n({text:l},r),{...t,vectorSearchFieldResults:a}}catch(e){throw await n({text:`Error during vector search: ${e instanceof Error?e.message:String(e)}`},r),new Error(`Vector search failed: ${e instanceof Error?e.message:String(e)}`)}},K=.7,U=async(t,r)=>{try{await n({text:`Similarity search to find layers: ${t.agentExecutionContext.assignedTask}`},r);let e=y(r,"layerSearch"),i=y(r,"layersAndFieldsRegistry"),o=await e.searchLayers({text:t.agentExecutionContext.assignedTask,minScore:K}),a=o.map(c=>c.id),m=o.map(({id:c,score:d})=>`${i.get(c)?.layerItem.name??c} (${d.toFixed(2)})`).join(`
6
+ ${y}`:l=`No vector search results found for score over ${B}.`,await n({text:l},r),{...t,vectorSearchFieldResults:a}}catch(e){throw await n({text:`Error during vector search: ${e instanceof Error?e.message:String(e)}`},r),new Error(`Vector search failed: ${e instanceof Error?e.message:String(e)}`)}},K=.7,U=async(t,r)=>{try{await n({text:`Similarity search to find layers: ${t.agentExecutionContext.assignedTask}`},r);let e=m(r,"layerSearch"),i=m(r,"layersAndFieldsRegistry"),o=await e.searchLayers({text:t.agentExecutionContext.assignedTask,minScore:K}),a=o.map(c=>c.id),y=o.map(({id:c,score:d})=>`${i.get(c)?.layerItem.name??c} (${d.toFixed(2)})`).join(`
7
7
  `),l;return a.length>0?l=`Vector search completed. Matching layers with scores:
8
- ${m}`:l="Vector search completed. No matching layers found.",await n({text:l},r),{...t,vectorSearchLayerIds:a}}catch(e){throw await n({text:`Error during vector search: ${e instanceof Error?e.message:String(e)}`},r),new Error(`Vector search failed: ${e instanceof Error?e.message:String(e)}`)}},G=[A,R,T,b,_,V,q,j,k,M,z],H=(t,r=3)=>{let e=t.map((o,a)=>o.type==="human"?a:-1).filter(o=>o!==-1);if(e.length===0)return[];let i=e.length>r?e[e.length-r]:e[0];return t.slice(i)},O=async(t,r)=>{await n({text:"Requesting LLM for layer query results"},r);let e=await C("navigation_intent_prompt");if(!r?.configurable)throw new Error("config.configurable is required for layer query tools");let i={layerFieldInfo:t.layerFieldInfo},o=await L({promptText:e,modelTier:"advanced",messages:H(t.agentExecutionContext.messages),inputVariables:i,tools:G});return await D(o,r),{...t,agentExecutionContext:{...t.agentExecutionContext,messages:[...t.agentExecutionContext.messages,o]}}};async function Q(t,r){let e=await new $(G).invoke({messages:H(t.agentExecutionContext.messages)},r),i=e.messages.map(a=>a.text).join(`
8
+ ${y}`:l="Vector search completed. No matching layers found.",await n({text:l},r),{...t,vectorSearchLayerIds:a}}catch(e){throw await n({text:`Error during vector search: ${e instanceof Error?e.message:String(e)}`},r),new Error(`Vector search failed: ${e instanceof Error?e.message:String(e)}`)}},G=[A,R,T,b,_,V,q,j,k,M,z],H=(t,r=3)=>{let e=t.map((o,a)=>o.type==="human"?a:-1).filter(o=>o!==-1);if(e.length===0)return[];let i=e.length>r?e[e.length-r]:e[0];return t.slice(i)},O=async(t,r)=>{await n({text:"Requesting LLM for layer query results"},r);let e=await C("navigation_intent_prompt");if(!r?.configurable)throw new Error("config.configurable is required for layer query tools");let i={layerFieldInfo:t.layerFieldInfo},o=await L({promptText:e,modelTier:"advanced",config:r,messages:H(t.agentExecutionContext.messages),inputVariables:i,tools:G});return await D(o,r),{...t,agentExecutionContext:{...t.agentExecutionContext,messages:[...t.agentExecutionContext.messages,o]}}};async function Q(t,r){let e=await new $(G,{handleToolErrors:!1}).invoke({messages:H(t.agentExecutionContext.messages)},r),i=e.messages.map(a=>a.text).join(`
9
9
  `);await n({text:`Finished executing layer filter tool: ${i}`},r);let o=e.messages.map(a=>a.text).join(`
10
- `);return{...t,outputMessage:o}}var W=async(t,r)=>(await n({text:"Exiting Layer Styling agent"},r),t),X=async(t,r)=>{try{await n({text:"Populating layer and field info"},r);let e=[];for(let i of t.vectorSearchFieldResults){let o=function(g){let s=l.get(g)?.layerItem;return s?[s.name&&`Name: ${s.name}`,s.title&&`Title: ${s.title}`,s.description&&`Description: ${s.description}`].filter(Boolean).join(" | "):g},{layerId:a,results:m}=i,l=y(r,"layersAndFieldsRegistry"),c=l.get(a)?.fieldRegistry;if(!c)continue;let d=e.find(g=>g.layerId===a);d||(d={layerId:a,layerSummary:o(a),fieldInfos:[]},e.push(d));for(let g of m){let s=c.get(g.name);s&&d.fieldInfos.push(s)}}return await n({text:"Populated layerFieldInfo"},r),{...t,layerFieldInfo:e}}catch(e){throw await n({text:"Error populating layerFieldInfo"},r),new Error(`Error populating layerFieldInfo: ${e instanceof Error?e.message:String(e)}`)}},Y=(t,r)=>{let e=t.vectorSearchLayerIds??[];if(e.length<=1)return{...t,selectedLayerId:t.vectorSearchLayerIds[0]};let{hitlResponse:i}=r.configurable;if(i?.agentId!==p.id||i.id!=="reviewLayerSelection"){let a={agentId:p.id,id:"reviewLayerSelection",kind:"singleSelection",message:"Choose a layer to apply the styles.",metadata:[...e]};throw new E(a)}let o=null;return Array.isArray(i.payload)&&i.payload.length>0&&(o=i.payload[0]),{...t,selectedLayerId:o??t.vectorSearchLayerIds[0]}},Z=(t,r)=>N(["layerSearch","fieldSearch","layersAndFieldsRegistry"],"Layer Styling Agent")(t,r),ee=()=>new I(u).addNode("requireLayerStylingServices",Z).addNode("vectorSearchLayers",U).addNode("layerSelectionHITL",Y).addNode("vectorSearchFields",J).addNode("populateLayerFieldInfo",X).addNode("agent",O).addNode("tools",Q).addNode("earlyExit",W).addEdge(w,"requireLayerStylingServices").addEdge("requireLayerStylingServices","vectorSearchLayers").addConditionalEdges("layerSelectionHITL",t=>t.vectorSearchLayerIds.length?"vectorSearchFields":"earlyExit").addConditionalEdges("vectorSearchFields",t=>t.vectorSearchFieldResults.length?"populateLayerFieldInfo":"earlyExit").addEdge("populateLayerFieldInfo","agent").addEdge("agent","tools").addEdge("tools",h).addEdge("earlyExit",h),te=String.raw`- **layerStyling** — User wants to change how features are drawn or styled on the map based on their data, such as applying color, size, transparency, symbols, or charts according to field values.
10
+ `);return{...t,outputMessage:o}}var W=async(t,r)=>(await n({text:"Exiting Layer Styling agent"},r),t),X=async(t,r)=>{try{await n({text:"Populating layer and field info"},r);let e=[];for(let i of t.vectorSearchFieldResults){let o=function(g){let s=l.get(g)?.layerItem;return s?[s.name&&`Name: ${s.name}`,s.title&&`Title: ${s.title}`,s.description&&`Description: ${s.description}`].filter(Boolean).join(" | "):g},{layerId:a,results:y}=i,l=m(r,"layersAndFieldsRegistry"),c=l.get(a)?.fieldRegistry;if(!c)continue;let d=e.find(g=>g.layerId===a);d||(d={layerId:a,layerSummary:o(a),fieldInfos:[]},e.push(d));for(let g of y){let s=c.get(g.name);s&&d.fieldInfos.push(s)}}return await n({text:"Populated layerFieldInfo"},r),{...t,layerFieldInfo:e}}catch(e){throw await n({text:"Error populating layerFieldInfo"},r),new Error(`Error populating layerFieldInfo: ${e instanceof Error?e.message:String(e)}`)}},Y=(t,r)=>{let e=t.vectorSearchLayerIds??[];if(e.length<=1)return{...t,selectedLayerId:t.vectorSearchLayerIds[0]};let{hitlResponse:i}=r.configurable;if(i?.agentId!==p.id||i.id!=="reviewLayerSelection"){let a={agentId:p.id,id:"reviewLayerSelection",kind:"singleSelection",message:"Choose a layer to apply the styles.",metadata:[...e]};throw new E(a)}let o=null;return Array.isArray(i.payload)&&i.payload.length>0&&(o=i.payload[0]),{...t,selectedLayerId:o??t.vectorSearchLayerIds[0]}},Z=(t,r)=>N(["layerSearch","fieldSearch","layersAndFieldsRegistry"],"Layer Styling Agent")(t,r),ee=()=>new I(u).addNode("requireLayerStylingServices",Z).addNode("vectorSearchLayers",U).addNode("layerSelectionHITL",Y).addNode("vectorSearchFields",J).addNode("populateLayerFieldInfo",X).addNode("agent",O).addNode("tools",Q).addNode("earlyExit",W).addEdge(w,"requireLayerStylingServices").addEdge("requireLayerStylingServices","vectorSearchLayers").addConditionalEdges("layerSelectionHITL",t=>t.vectorSearchLayerIds.length?"vectorSearchFields":"earlyExit").addConditionalEdges("vectorSearchFields",t=>t.vectorSearchFieldResults.length?"populateLayerFieldInfo":"earlyExit").addEdge("populateLayerFieldInfo","agent").addEdge("agent","tools").addEdge("tools",h).addEdge("earlyExit",h),te=String.raw`- **layerStyling** — User wants to change how features are drawn or styled on the map based on their data, such as applying color, size, transparency, symbols, or charts according to field values.
11
11
  _Example: “Color points by sales amount”_
12
12
  _Example: “Show population density with a color gradient”_
13
13
  _Example: “Create a relationship map between height and depth”_
14
- _Example: “Vary circle sizes according to population”_`,p={id:"layerStyling",name:"Layer Styling Agent",description:te,createGraph:ee,workspace:u};var f=class extends x{constructor(){super(...arguments),this.agent=p}static{this.properties={referenceElement:1}}#e;getContext(){if(!this.#e)throw new Error("arcgis-assistant-layer-styling-agent requires a mapView");return{mapView:this.#e}}load(){this.#e=v(this,"arcgis-assistant-layer-styling-agent"),F(this)}};S("arcgis-assistant-layer-styling-agent",f);return f},"identity/IdentityManager","portal/Portal","core/reactiveUtils","layers/FeatureLayer","request","intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","identity/IdentityManager","portal/Portal","core/reactiveUtils","layers/FeatureLayer","request","views/LinkChartView","rest/knowledgeGraphService",a,b,c)
14
+ _Example: “Vary circle sizes according to population”_`,p={id:"layerStyling",name:"Layer Styling Agent",description:te,createGraph:ee,workspace:u};var f=class extends x{constructor(){super(...arguments),this.agent=p}static{this.properties={referenceElement:1}}#e;getContext(){if(!this.#e)throw new Error("arcgis-assistant-layer-styling-agent requires a mapView");return{mapView:this.#e}}load(){this.#e=v(this,"arcgis-assistant-layer-styling-agent"),F(this)}};S("arcgis-assistant-layer-styling-agent",f);return f},"identity/IdentityManager","portal/Portal","config","core/reactiveUtils","layers/FeatureLayer","request","intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","identity/IdentityManager","portal/Portal","config","core/reactiveUtils","layers/FeatureLayer","request","views/LinkChartView","rest/knowledgeGraphService",a,b,c)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as y}from"./YLN2BZ5J.js";import"./QCSN44H4.js";import{a as v}from"./NXKKG5TK.js";import{g as p,h as r,n as o,t as n,u as c,v as g,w as m,z as f}from"./HWKDNS4K.js";import"./YIMNOUTF.js";export default $arcgis.t(([b])=>{var w=p`:host{--calcite-text-area-border-color: var(--calcite-color-border-1);--calcite-text-area-divider-color: var(--calcite-color-border-1);--calcite-text-area-corner-radius: var(--calcite-border-radius)}.input-container{display:flex;flex-direction:column}.footer-start{display:flex;gap:var(--calcite-spacing-md);flex-wrap:wrap;align-items:center}.footer-end{display:flex;gap:var(--calcite-spacing-md);align-items:center}.status-indicator{width:9px;height:9px;border-radius:100%;background-color:var(--calcite-color-status-success)}.status-indicator[data-status=working]{background-color:var(--calcite-color-status-warning)}.status-indicator[data-status=error]{background-color:var(--calcite-color-status-danger)}.status-text{text-transform:capitalize}.focused{--calcite-text-area-shadow: var(--calcite-shadow-sm)}`,l=class extends g{constructor(){super(...arguments),this.#s=n(),this.#a=n(),this.#t=-1,this.#e="",this.#i=t=>{t.stopPropagation();let s=t.detail;this._setDraftValue(s.value),s.focusInput&&this.#s.value&&this.#s.value.setFocus()},this.#r=t=>{let s=t.target.value??"";this.inputValue=s,this.#e=s},this._messages=y({blocking:!0}),this._inFocus=!1,this.keyboardShortcutsDisabled=!1,this.awaitingResponse=!1,this.inputValue="",this.voiceInputEnabled=!1,this.messages=new b([]),this.disabled=!1,this.arcgisCancel=o(),this.arcgisSubmit=o()}static{this.properties={_inFocus:16,_userMessages:16,keyboardShortcutsDisabled:5,entryPlaceholder:1,awaitingResponse:5,inputValue:1,status:1,voiceInputEnabled:5,messages:0,disabled:5}}static{this.styles=w}#s;#a;#t;#e;#i;#r;get _userMessages(){return this.messages.toArray().filter(t=>t.role==="user").map(({content:t})=>t)}async submitMessage(){if(this.awaitingResponse){this.arcgisCancel.emit();return}let t=this.inputValue.trim();t&&(this.arcgisSubmit.emit(t),this.inputValue="",this.#t=-1,this.#e="",this.#a.value?.clearDraftSession(),this.#s.value&&await this.#s.value.setFocus())}loaded(){this.manager.onLifecycle(()=>(this.el.addEventListener("arcgisVoiceInputDraftChange",this.#i),{remove:()=>{this.el.removeEventListener("arcgisVoiceInputDraftChange",this.#i)}}))}async _navigateHistory(t,s){let i=this.#s.value;if(!i)return;let e=this._userMessages;if(e.length===0)return;let u=i.value??"",h=i.shadowRoot?.querySelector("textarea"),a=h?.selectionStart,d=h?.selectionEnd;if(!(a==null||d==null)&&!(a!==d||t==="up"&&a!==0||t==="down"&&a!==u.length)){if(t==="up"){this.#t===-1?(this.#e=u,this.#t=e.length-1):this.#t=Math.max(0,this.#t-1),this.inputValue=e[this.#t]??"",s.preventDefault();return}this.#t!==-1&&(this.#t<e.length-1?(this.#t+=1,this.inputValue=e[this.#t]??""):(this.#t=-1,this.inputValue=this.#e),s.preventDefault())}}_setDraftValue(t){this.inputValue=t,this.#t=-1,this.#e=t}_onFocusIn(){this._inFocus=!0}_onFocusOut(){this._inFocus=!1}render(){return r`<div class="input-container"><calcite-text-area class=${m(v({focused:this._inFocus}))} .value=${this.inputValue} .placeholder=${this.entryPlaceholder??this._messages.entryPlaceholder} resize=vertical @calciteTextAreaInput=${this.#r} .disabled=${this.disabled} @keydown=${async t=>{t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||this.keyboardShortcutsDisabled||(t.key==="Enter"?(t.preventDefault(),await this.submitMessage()):t.key==="ArrowUp"?await this._navigateHistory("up",t):t.key==="ArrowDown"&&await this._navigateHistory("down",t))}} @focusin=${this._onFocusIn} @focusout=${this._onFocusOut} ${c(this.#s)}><div slot=footer-start class="footer-start"><slot name=entry-actions-start></slot></div><div slot=footer-end class="footer-end">${this.voiceInputEnabled?r`<arcgis-assistant-speech-input .awaitingResponse=${this.awaitingResponse} .inputValue=${this.inputValue} ${c(this.#a)}></arcgis-assistant-speech-input>`:null}<slot name=entry-actions-end></slot></div></calcite-text-area></div>`}};f("arcgis-assistant-chat-entry",l);return l},"core/Collection")
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{_ as h,a as E,b as y,ta as k}from"./DHKUXLU3.js";var j=new Set(["agentExecutionContext","outputMessage","summary","status"]);function x(){return{assignedTask:"",messages:[],priorSteps:[],sharedState:{},userRequest:""}}function O(r){let o=[...new Set([...r].filter(n=>j.has(n)))];if(o.length!==0)throw new Error(`ADK custom state cannot define reserved runtime fields: ${o.join(", ")}.`)}function S(r){let o=Object.entries(r);return Object.fromEntries(o.map(([n,t])=>[n,h({reducer:(i,g)=>g,default:()=>t})]))}function $(r={}){O(Object.keys(r));let o=S(r);return h.Root({...o,agentExecutionContext:h({reducer:(n,t)=>({...n,...t}),default:x}),outputMessage:h({reducer:(n="",t)=>typeof t=="string"&&t.trim()?t:n,default:()=>""}),summary:h({reducer:(n="",t)=>typeof t=="string"?t:n,default:()=>""}),status:h({reducer:(n,t)=>t??n,default:()=>{}})})}function M(r){let o=new Set;for(let t of r)for(let i of Object.keys(t.shape??{}))o.add(i);let n=Object.fromEntries([...o].map(t=>[t,void 0]));return $(n)}function C(r,o,n,t={}){let{agent:i,entryNode:g,middlewares:c=[]}=t,a=new k(n);if(Object.keys(r).length===0)throw new Error("Graph requires at least one node.");if(o.length===0)throw new Error("Graph requires at least one edge.");if(c.length>0&&!i)throw new Error("Graph middleware requires agent metadata.");let s=new Set(Object.keys(r)),l=new Map,w=new Map;for(let e of s)l.set(e,0),w.set(e,0);for(let e of o)"to"in e?(s.has(e.from)&&w.set(e.from,(w.get(e.from)??0)+1),s.has(e.to)&&l.set(e.to,(l.get(e.to)??0)+1)):s.has(e.from)&&w.set(e.from,(w.get(e.from)??0)+1);for(let[e,f]of Object.entries(r)){let u=N(i,e,c,async(d,p)=>await Promise.resolve(f(d,p))),m=async(d,p)=>await u(d,p);a=a.addNode(e,m)}for(let e of o)if("to"in e){let f=e.from,u=e.to;if(!s.has(f))throw new Error(`Graph edge references unknown from-node: ${f}`);if(!s.has(u))throw new Error(`Graph edge references unknown to-node: ${u}`);a.addEdge(f,u)}else{let f=e.from;if(!s.has(f))throw new Error(`Graph conditional edge references unknown from-node: ${f}`);a.addConditionalEdges(f,async(u,m)=>{let d=await e.decide(u,m);if(!d)return y;if(!s.has(d))throw new Error(`Graph conditional edge returned unknown node: ${d}`);return d})}let G=q(s,l,g);a.addEdge(E,G);let b=[...s].filter(e=>(w.get(e)??0)===0);for(let e of b)a.addEdge(e,y);return a}function N(r,o,n,t){return!n.length||!r?t:async(i,g)=>await n.reduceRight((c,a)=>async s=>await a.handler(s,c),async c=>{let a=await t(c.state,c.config);return{...c.state,...a}})({agent:r,config:g,nodeName:o,state:i})}function q(r,o,n){if(n){if(!r.has(n))throw new Error(`Graph entry node references unknown node: ${n}`);return n}let t=[...r].filter(i=>(o.get(i)??0)===0);if(t.length!==1)throw new Error(`Graph could not infer a single entry node (found ${t.length}). Provide an explicit entryNode or ensure exactly one node has no incoming edges.`);return t[0]}export{$ as a,M as b,C as c};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as i,b as o}from"./NAUXSHIE.js";import{g as a,h as c,v as e,y as r}from"./OH64RMOR.js";import"./YIMNOUTF.js";var s=a`.container{color:var(--calcite-color-text-1)}.content>*{margin:0}.content>*+*{margin-block-start:var(--calcite-spacing-sm)}.content :is(ol,ul){padding-inline-start:var(--calcite-spacing-lg)}.content>calcite-table{display:block;max-width:100%}.content pre{background-color:var(--calcite-color-foreground-1);padding:var(--calcite-spacing-sm);border-radius:var(--calcite-border-radius);color:var(--calcite-color-text-1);direction:ltr;max-width:100%;overflow:auto}.content pre code{display:block;white-space:pre;font-family:var(--calcite-code-family)}`,t=class extends e{static{this.properties={content:1}}static{this.styles=s}render(){return c`<div class="container"><div class="content">${i(o(this.content))}</div></div>`}};r("arcgis-assistant-message-text",t);export{t as ArcgisAssistantMessageText};
2
+ import{a as i,b as o}from"./34SG44C3.js";import{g as a,h as c,v as e,z as r}from"./HWKDNS4K.js";import"./YIMNOUTF.js";var s=a`.container{color:var(--calcite-color-text-1)}.content>*{margin:0}.content>*+*{margin-block-start:var(--calcite-spacing-sm)}.content :is(ol,ul){padding-inline-start:var(--calcite-spacing-lg)}.content>calcite-table{display:block;max-width:100%}.content pre{background-color:var(--calcite-color-foreground-1);padding:var(--calcite-spacing-sm);border-radius:var(--calcite-border-radius);color:var(--calcite-color-text-1);direction:ltr;max-width:100%;overflow:auto}.content pre code{display:block;white-space:pre;font-family:var(--calcite-code-family)}`,t=class extends e{static{this.properties={content:1}}static{this.styles=s}render(){return c`<div class="container"><div class="content">${i(o(this.content))}</div></div>`}};r("arcgis-assistant-message-text",t);export{t as ArcgisAssistantMessageText};
@@ -1,4 +1,4 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- var Y=globalThis,Z=Y.ShadowRoot&&(Y.ShadyCSS===void 0||Y.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,gt=Symbol(),Mt=new WeakMap,M=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==gt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(Z&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=Mt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Mt.set(e,t))}return t}toString(){return this.cssText}},kt=o=>new M(typeof o=="string"?o:o+"",void 0,gt),$e=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,n,r)=>s+(i=>{if(i._$cssResult$===!0)return i.cssText;if(typeof i=="number")return i;throw Error("Value passed to 'css' function must be a 'css' function result: "+i+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+o[r+1],o[0]);return new M(e,o,gt)},jt=(o,t)=>{if(Z)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),n=Y.litNonce;n!==void 0&&s.setAttribute("nonce",n),s.textContent=e.cssText,o.appendChild(s)}},vt=Z?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return kt(e)})(o):o;var{is:be,defineProperty:Ae,getOwnPropertyDescriptor:_e,getOwnPropertyNames:Ce,getOwnPropertySymbols:we,getPrototypeOf:Oe}=Object,tt=globalThis,Ht=tt.trustedTypes,Te=Ht?Ht.emptyScript:"",Se=tt.reactiveElementPolyfillSupport,k=(o,t)=>o,X={toAttribute(o,t){switch(t){case Boolean:o=o?Te:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},j=(o,t)=>!be(o,t),zt={attribute:!0,type:String,converter:X,reflect:!1,useDefault:!1,hasChanged:j};Symbol.metadata??=Symbol("metadata"),tt.litPropertyMetadata??=new WeakMap;var A=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=zt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),n=this.getPropertyDescriptor(t,s,e);n!==void 0&&Ae(this.prototype,t,n)}}static getPropertyDescriptor(t,e,s){let{get:n,set:r}=_e(this.prototype,t)??{get(){return this[e]},set(i){this[e]=i}};return{get:n,set(i){let a=n?.call(this);r?.call(this,i),this.requestUpdate(t,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??zt}static _$Ei(){if(this.hasOwnProperty(k("elementProperties")))return;let t=Oe(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(k("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(k("properties"))){let e=this.properties,s=[...Ce(e),...we(e)];for(let n of s)this.createProperty(n,e[n])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,n]of e)this.elementProperties.set(s,n)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let n=this._$Eu(e,s);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let n of s)e.unshift(vt(n))}else t!==void 0&&e.push(vt(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return jt(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){let s=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,s);if(n!==void 0&&s.reflect===!0){let r=(s.converter?.toAttribute!==void 0?s.converter:X).toAttribute(e,s.type);this._$Em=t,r==null?this.removeAttribute(n):this.setAttribute(n,r),this._$Em=null}}_$AK(t,e){let s=this.constructor,n=s._$Eh.get(t);if(n!==void 0&&this._$Em!==n){let r=s.getPropertyOptions(n),i=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:X;this._$Em=n;let a=i.fromAttribute(e,r.type);this[n]=a??this._$Ej?.get(n)??a,this._$Em=null}}requestUpdate(t,e,s,n=!1,r){if(t!==void 0){let i=this.constructor;if(n===!1&&(r=this[t]),s??=i.getPropertyOptions(t),!((s.hasChanged??j)(r,e)||s.useDefault&&s.reflect&&r===this._$Ej?.get(t)&&!this.hasAttribute(i._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:n,wrapped:r},i){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,i??e??this[t]),r!==!0||i!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),n===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[n,r]of this._$Ep)this[n]=r;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[n,r]of s){let{wrapped:i}=r,a=this[n];i!==!0||this._$AL.has(n)||a===void 0||this.C(n,void 0,r,a)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(t){}firstUpdated(t){}};A.elementStyles=[],A.shadowRootOptions={mode:"open"},A[k("elementProperties")]=new Map,A[k("finalized")]=new Map,Se?.({ReactiveElement:A}),(tt.reactiveElementVersions??=[]).push("2.1.2");var $t=globalThis,Vt=o=>o,et=$t.trustedTypes,Bt=et?et.createPolicy("lit-html",{createHTML:o=>o}):void 0,bt="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,At="?"+_,Pe=`<${At}>`,T=document,z=()=>T.createComment(""),V=o=>o===null||typeof o!="object"&&typeof o!="function",_t=Array.isArray,Qt=o=>_t(o)||typeof o?.[Symbol.iterator]=="function",Et=`[
2
+ var Y=globalThis,Z=Y.ShadowRoot&&(Y.ShadyCSS===void 0||Y.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,gt=Symbol(),Mt=new WeakMap,M=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==gt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(Z&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=Mt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Mt.set(e,t))}return t}toString(){return this.cssText}},kt=o=>new M(typeof o=="string"?o:o+"",void 0,gt),be=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,n,r)=>s+(i=>{if(i._$cssResult$===!0)return i.cssText;if(typeof i=="number")return i;throw Error("Value passed to 'css' function must be a 'css' function result: "+i+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+o[r+1],o[0]);return new M(e,o,gt)},jt=(o,t)=>{if(Z)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),n=Y.litNonce;n!==void 0&&s.setAttribute("nonce",n),s.textContent=e.cssText,o.appendChild(s)}},vt=Z?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return kt(e)})(o):o;var{is:Ae,defineProperty:_e,getOwnPropertyDescriptor:Ce,getOwnPropertyNames:we,getOwnPropertySymbols:Oe,getPrototypeOf:Te}=Object,tt=globalThis,Ht=tt.trustedTypes,Se=Ht?Ht.emptyScript:"",Pe=tt.reactiveElementPolyfillSupport,k=(o,t)=>o,X={toAttribute(o,t){switch(t){case Boolean:o=o?Se:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},j=(o,t)=>!Ae(o,t),zt={attribute:!0,type:String,converter:X,reflect:!1,useDefault:!1,hasChanged:j};Symbol.metadata??=Symbol("metadata"),tt.litPropertyMetadata??=new WeakMap;var A=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=zt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),n=this.getPropertyDescriptor(t,s,e);n!==void 0&&_e(this.prototype,t,n)}}static getPropertyDescriptor(t,e,s){let{get:n,set:r}=Ce(this.prototype,t)??{get(){return this[e]},set(i){this[e]=i}};return{get:n,set(i){let a=n?.call(this);r?.call(this,i),this.requestUpdate(t,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??zt}static _$Ei(){if(this.hasOwnProperty(k("elementProperties")))return;let t=Te(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(k("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(k("properties"))){let e=this.properties,s=[...we(e),...Oe(e)];for(let n of s)this.createProperty(n,e[n])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,n]of e)this.elementProperties.set(s,n)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let n=this._$Eu(e,s);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let n of s)e.unshift(vt(n))}else t!==void 0&&e.push(vt(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return jt(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){let s=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,s);if(n!==void 0&&s.reflect===!0){let r=(s.converter?.toAttribute!==void 0?s.converter:X).toAttribute(e,s.type);this._$Em=t,r==null?this.removeAttribute(n):this.setAttribute(n,r),this._$Em=null}}_$AK(t,e){let s=this.constructor,n=s._$Eh.get(t);if(n!==void 0&&this._$Em!==n){let r=s.getPropertyOptions(n),i=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:X;this._$Em=n;let a=i.fromAttribute(e,r.type);this[n]=a??this._$Ej?.get(n)??a,this._$Em=null}}requestUpdate(t,e,s,n=!1,r){if(t!==void 0){let i=this.constructor;if(n===!1&&(r=this[t]),s??=i.getPropertyOptions(t),!((s.hasChanged??j)(r,e)||s.useDefault&&s.reflect&&r===this._$Ej?.get(t)&&!this.hasAttribute(i._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:n,wrapped:r},i){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,i??e??this[t]),r!==!0||i!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),n===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[n,r]of this._$Ep)this[n]=r;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[n,r]of s){let{wrapped:i}=r,a=this[n];i!==!0||this._$AL.has(n)||a===void 0||this.C(n,void 0,r,a)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(t){}firstUpdated(t){}};A.elementStyles=[],A.shadowRootOptions={mode:"open"},A[k("elementProperties")]=new Map,A[k("finalized")]=new Map,Pe?.({ReactiveElement:A}),(tt.reactiveElementVersions??=[]).push("2.1.2");var $t=globalThis,Vt=o=>o,et=$t.trustedTypes,Bt=et?et.createPolicy("lit-html",{createHTML:o=>o}):void 0,bt="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,At="?"+_,Ne=`<${At}>`,T=document,z=()=>T.createComment(""),V=o=>o===null||typeof o!="object"&&typeof o!="function",_t=Array.isArray,Qt=o=>_t(o)||typeof o?.[Symbol.iterator]=="function",Et=`[
3
3
  \f\r]`,H=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Wt=/-->/g,Ft=/>/g,w=RegExp(`>|${Et}(?:([^\\s"'>=/]+)(${Et}*=${Et}*(?:[^
4
- \f\r"'\`<>=]|("|')|))|$)`,"g"),qt=/'/g,Gt=/"/g,Jt=/^(?:script|style|textarea|title)$/i,Ct=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),ps=Ct(1),us=Ct(2),fs=Ct(3),f=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Kt=new WeakMap,O=T.createTreeWalker(T,129);function Yt(o,t){if(!_t(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return Bt!==void 0?Bt.createHTML(t):t}var Zt=(o,t)=>{let e=o.length-1,s=[],n,r=t===2?"<svg>":t===3?"<math>":"",i=H;for(let a=0;a<e;a++){let c=o[a],h,u,l=-1,m=0;for(;m<c.length&&(i.lastIndex=m,u=i.exec(c),u!==null);)m=i.lastIndex,i===H?u[1]==="!--"?i=Wt:u[1]!==void 0?i=Ft:u[2]!==void 0?(Jt.test(u[2])&&(n=RegExp("</"+u[2],"g")),i=w):u[3]!==void 0&&(i=w):i===w?u[0]===">"?(i=n??H,l=-1):u[1]===void 0?l=-2:(l=i.lastIndex-u[2].length,h=u[1],i=u[3]===void 0?w:u[3]==='"'?Gt:qt):i===Gt||i===qt?i=w:i===Wt||i===Ft?i=H:(i=w,n=void 0);let v=i===w&&o[a+1].startsWith("/>")?" ":"";r+=i===H?c+Pe:l>=0?(s.push(h),c.slice(0,l)+bt+c.slice(l)+_+v):c+_+(l===-2?a:v)}return[Yt(o,r+(o[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},B=class o{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let r=0,i=0,a=t.length-1,c=this.parts,[h,u]=Zt(t,e);if(this.el=o.createElement(h,s),O.currentNode=this.el.content,e===2||e===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(n=O.nextNode())!==null&&c.length<a;){if(n.nodeType===1){if(n.hasAttributes())for(let l of n.getAttributeNames())if(l.endsWith(bt)){let m=u[i++],v=n.getAttribute(l).split(_),C=/([.?@])?(.*)/.exec(m);c.push({type:1,index:r,name:C[2],strings:v,ctor:C[1]==="."?ot:C[1]==="?"?nt:C[1]==="@"?rt:P}),n.removeAttribute(l)}else l.startsWith(_)&&(c.push({type:6,index:r}),n.removeAttribute(l));if(Jt.test(n.tagName)){let l=n.textContent.split(_),m=l.length-1;if(m>0){n.textContent=et?et.emptyScript:"";for(let v=0;v<m;v++)n.append(l[v],z()),O.nextNode(),c.push({type:2,index:++r});n.append(l[m],z())}}}else if(n.nodeType===8)if(n.data===At)c.push({type:2,index:r});else{let l=-1;for(;(l=n.data.indexOf(_,l+1))!==-1;)c.push({type:7,index:r}),l+=_.length-1}r++}}static createElement(t,e){let s=T.createElement("template");return s.innerHTML=t,s}};function S(o,t,e=o,s){if(t===f)return t;let n=s!==void 0?e._$Co?.[s]:e._$Cl,r=V(t)?void 0:t._$litDirective$;return n?.constructor!==r&&(n?._$AO?.(!1),r===void 0?n=void 0:(n=new r(o),n._$AT(o,e,s)),s!==void 0?(e._$Co??=[])[s]=n:e._$Cl=n),n!==void 0&&(t=S(o,n._$AS(o,t.values),n,s)),t}var st=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:s}=this._$AD,n=(t?.creationScope??T).importNode(e,!0);O.currentNode=n;let r=O.nextNode(),i=0,a=0,c=s[0];for(;c!==void 0;){if(i===c.index){let h;c.type===2?h=new L(r,r.nextSibling,this,t):c.type===1?h=new c.ctor(r,c.name,c.strings,this,t):c.type===6&&(h=new it(r,this,t)),this._$AV.push(h),c=s[++a]}i!==c?.index&&(r=O.nextNode(),i++)}return O.currentNode=T,n}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}},L=class o{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,n){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=S(this,t,e),V(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==f&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Qt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==d&&V(this._$AH)?this._$AA.nextSibling.data=t:this.T(T.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,n=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=B.createElement(Yt(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===n)this._$AH.p(e);else{let r=new st(n,this),i=r.u(this.options);r.p(e),this.T(i),this._$AH=r}}_$AC(t){let e=Kt.get(t.strings);return e===void 0&&Kt.set(t.strings,e=new B(t)),e}k(t){_t(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,n=0;for(let r of t)n===e.length?e.push(s=new o(this.O(z()),this.O(z()),this,this.options)):s=e[n],s._$AI(r),n++;n<e.length&&(this._$AR(s&&s._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let s=Vt(t).nextSibling;Vt(t).remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},P=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,n,r){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,n){let r=this.strings,i=!1;if(r===void 0)t=S(this,t,e,0),i=!V(t)||t!==this._$AH&&t!==f,i&&(this._$AH=t);else{let a=t,c,h;for(t=r[0],c=0;c<r.length-1;c++)h=S(this,a[s+c],e,c),h===f&&(h=this._$AH[c]),i||=!V(h)||h!==this._$AH[c],h===d?t=d:t!==d&&(t+=(h??"")+r[c+1]),this._$AH[c]=h}i&&!n&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},ot=class extends P{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}},nt=class extends P{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}},rt=class extends P{constructor(t,e,s,n,r){super(t,e,s,n,r),this.type=5}_$AI(t,e=this){if((t=S(this,t,e,0)??d)===f)return;let s=this._$AH,n=t===d&&s!==d||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==d&&(s===d||n);n&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},it=class{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){S(this,t)}},Xt={M:bt,P:_,A:At,C:1,L:Zt,R:st,D:Qt,V:S,I:L,H:P,N:nt,U:rt,B:ot,F:it},Ne=$t.litHtmlPolyfillSupport;Ne?.(B,L),($t.litHtmlVersions??=[]).push("3.3.2");var wt=(o,t,e)=>{let s=e?.renderBefore??t,n=s._$litPart$;if(n===void 0){let r=e?.renderBefore??null;s._$litPart$=n=new L(t.insertBefore(z(),r),r,void 0,e??{})}return n._$AI(o),n};var Ot=globalThis,E=class extends A{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=wt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return f}};E._$litElement$=!0,E.finalized=!0,Ot.litElementHydrateSupport?.({LitElement:E});var xe=Ot.litElementPolyfillSupport;xe?.({LitElement:E});(Ot.litElementVersions??=[]).push("4.2.2");var te=new Set,ee;var se=o=>typeof o=="string"?o:"el"in o?o.el.localName:"localName"in o?o.localName:o.declaredClass,Ts=(o,t,e,s)=>{let n=se(t);if(s?.once){let i=`${o}${n}${e}`;if(te.has(i))return;te.add(i)}let r;if(s?.detail){r={};for(let[i,a]of Object.entries(s.detail))if((typeof a=="object"||typeof a=="function")&&a!==null){let c=new WeakRef(a);Object.defineProperty(r,i,{enumerable:!0,get(){return c.deref()}})}else r[i]=a;ee?.log.interceptors?.forEach(i=>i(o,n,e,r)),console[o](`[${n}]: ${e}`,r)}else ee?.log.interceptors?.forEach(i=>i(o,n,e)),console[o](`[${n}]: ${e}`)},oe=o=>{let t=`[${se(o)}] `;return e=>{let s=e instanceof Error&&e.message?e:new Error(String(e));s.message=`${t}${s.message}`,setTimeout(()=>{throw e})}};var p=(o,t,...e)=>{try{return o?.call(t,...e)}catch(s){console.error(s,o)}},W=async(o,t,...e)=>{try{return await o?.call(t,...e)}catch(s){console.error(s,o)}};var q=Symbol.for("controller"),De=o=>typeof o=="object"&&o!==null&&(q in o||"hostConnected"in o||"hostDisconnected"in o||"hostUpdate"in o||"hostUpdated"in o),Ns=o=>typeof o?.then=="function";var F,x=o=>{F!==o&&(F=o,queueMicrotask(()=>F===o?F=void 0:0))},G=o=>F,N=[],ne=o=>{if(o===void 0){N=[];return}let t=N.indexOf(o);N=t===-1?[...N,o]:N.slice(0,t+1),queueMicrotask(()=>N=[])},re=()=>N,U,xs=o=>{U!==o&&(U=o,queueMicrotask(()=>U===o?U=void 0:0))},Le=()=>{let o=U;return U=void 0,o},ie=async(o,t)=>{let e=ct(o);if(e===void 0)return o;if(await e.ready,typeof t=="function"){let s=e.watchExports(n=>t(n,s))}return e.exports},ae=async o=>{let t=ct(o);return await t.ready,t},ct=o=>{let e=G().manager.X(o);if(e!==void 0)return e;if(De(o))return o;let s=Le();if(s!==void 0)return s},at=!1,Ds=o=>{at=!0;try{return o()}finally{at=!1}};var b=class{constructor(){this.promise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}};var ce=(o,t)=>{let e=t>Ue?Re:t/Ie,s=0,n=setInterval(()=>{s+=e,s>=t&&(clearInterval(n),o())},e);return n},Ue=4e3,Re=2e3,Ie=4;var Me=(o,t,e)=>{let s=Object.keys(o),n=s.length;R===void 0&&queueMicrotask(I),R??=new Map;let r=R.get(o);return r===void 0&&(r={callbacks:[],keyCount:n},R.set(o,r)),r.keyCount!==n&&(r.callbacks.forEach(i=>i(s)),r.callbacks=[],r.keyCount=n),r.callbacks.push(i=>{let a=h=>p(t,null,h),c=i[n];c===void 0?a(void 0):o[c]===e?a(c):a(void 0)}),e},R,I=()=>{R?.forEach(({callbacks:o},t)=>{let e=Object.keys(t);o.forEach(s=>s(e))}),R=void 0},ke=(o,t,e)=>{let s=o.manager;return s.V!==d&&s.V!==e&&s.S(void 0,void 0),s.T.length===0&&queueMicrotask(()=>s.S(void 0,void 0)),s.V=e,s.T.push((n,r)=>p(t,void 0,e===r?n:void 0)),e},je=(o=[G(),...re()],t,e)=>{let s=Array.isArray(o)?o:[o],n=s.length+1,r=i=>{n-=1,i!==void 0&&(n=Math.min(n,0)),n===0&&t(i)};s.forEach(i=>Me(i,a=>r(a===void 0?void 0:{key:a,host:i,isReactive:!1}),e));for(let i of s)if("manager"in i&&i.manager.component===i){ke(i,a=>r(a===void 0?void 0:{key:a,host:i,isReactive:!0}),e);break}return e},He=(o="",t={},e=G())=>{let s={emit:n=>{o===""&&I();let r=new CustomEvent(o,{detail:n,cancelable:!0,bubbles:!0,composed:!0,...t});return e.el.dispatchEvent(r),r}};return o===""&&je(void 0,n=>o=n.key,s),s},ze=He.bind(null,""),de;de=q;var Tt=class{constructor(t){this.#t=[],this.#e=[],this.#s=[],this.#n=[],this.#r=[],this.#c=[],this.#l=[],this.#d=[],this.#i=[],this.#p=!1,this.P=new b,this.connectedCalled=!1,this.loadedCalled=!1,this[de]=!0,this.#h=[];let e=this,s=t??G(new.target.name);e.#o=s,e.ready=e.P.promise,e.#a=he(e),e.component=s,e.#o.addController(e),e.#o.manager===void 0||(ne(e),queueMicrotask(()=>e.catchUpLifecycle()))}#t;#e;#s;#n;#r;#c;#l;#d;#i;#p;#o;catchUpLifecycle(){let{manager:t}=this.#o;t.connectedCalled&&!this.connectedCalled&&this.triggerConnected(),t.#p&&this.triggerLoad().then(()=>t.loadedCalled&&this.triggerLoaded()).catch(oe(this.#o))}#a;get exports(){return this.#a}set exports(t){let e=this.#a;e!==t&&(this.#a=t,this.#h.forEach(p),this.connectedCalled&&this.O!==!1&&this.#o.requestUpdate(this.O,e)),this.P.resolve(t)}setProvisionalExports(t,e=!0){this.#a=e?he(t):t,this.#h.forEach(p)}#h;watchExports(t){let e=()=>t(this.#a);return this.#h.push(e),()=>{this.#h.splice(this.#h.indexOf(e),1)}}get use(){return x(this.#o),ie}get useRef(){return x(this.#o),ae}get useRefSync(){return x(this.#o),ct}controllerRemoved(){this.#o.el.isConnected&&this.triggerDisconnected(),this.triggerDestroy()}onConnected(t){this.#t.push(t)}onDisconnected(t){this.#e.push(t)}onLoad(t){this.#s.push(t)}onLoaded(t){this.#n.push(t)}onUpdate(t){this.#r.push(t)}onUpdated(t){this.#c.push(t)}onDestroy(t){this.#l.push(t)}onLifecycle(t){this.#d.push(t),this.connectedCalled&&this.#o.el.isConnected&&this.#u(t)}triggerConnected(){let t=this;t.hostConnected&&p(t.hostConnected,t),t.#t.forEach(p),t.triggerLifecycle(),t.connectedCalled=!0}triggerDisconnected(){let t=this;t.hostDisconnected&&p(t.hostDisconnected,t),t.#e.forEach(p),t.#i.forEach(p),t.#i=[]}async triggerLoad(){if(this.#p)return;this.#p=!0;let t=this;t.hostLoad&&await W(t.hostLoad,t),this.#s.length>0&&await Promise.allSettled(this.#s.map(W)),this.P.resolve(this.#a)}triggerLoaded(){this.loadedCalled||(this.hostLoaded&&p(this.hostLoaded,this),this.#n.forEach(p),this.loadedCalled=!0)}triggerUpdate(t){this.hostUpdate&&p(this.hostUpdate,this,t),this.#r.forEach(le,t)}triggerUpdated(t){this.hostUpdated&&p(this.hostUpdated,this,t),this.#c.forEach(le,t)}triggerDestroy(){this.hostDestroy&&p(this.hostDestroy,this),this.#l.forEach(p)}triggerLifecycle(){this.hostLifecycle&&this.#u(()=>this.hostLifecycle()),this.#d.forEach(this.#u,this)}#u(t){x(this.#o);let e=p(t);(Array.isArray(e)?e:[e]).forEach(n=>{typeof n=="function"?this.#i.push(n):typeof n=="object"&&typeof n.remove=="function"&&this.#i.push(n.remove)})}};function le(o){p(o,void 0,this)}var pe=Tt,he=o=>{if(typeof o!="object"&&typeof o!="function"||o===null)return o;let t={get(s,n,r){if(!((n==="exports"||n==="_exports")&&n in s&&s[n]===e)&&(n in s||n in Promise.prototype||typeof n=="symbol"))return typeof s=="function"?s[n]:Reflect.get(s,n,r)}},e=new Proxy(o,t);return e};var{I:Bs}=Xt;var lt=o=>o.strings===void 0;var Ve={},ue=(o,t=Ve)=>o._$AH=t;var y={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},$=o=>(...t)=>({_$litDirective$:o,values:t}),g=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var K=(o,t)=>{let e=o._$AN;if(e===void 0)return!1;for(let s of e)s._$AO?.(t,!1),K(s,t);return!0},ht=o=>{let t,e;do{if((t=o._$AM)===void 0)break;e=t._$AN,e.delete(o),o=t}while(e?.size===0)},fe=o=>{for(let t;t=o._$AM;o=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(o))break;e.add(o),Fe(t)}};function Be(o){this._$AN!==void 0?(ht(this),this._$AM=o,fe(this)):this._$AM=o}function We(o,t=!1,e=0){let s=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(t)if(Array.isArray(s))for(let r=e;r<s.length;r++)K(s[r],!1),ht(s[r]);else s!=null&&(K(s,!1),ht(s));else K(this,o)}var Fe=o=>{o.type==y.CHILD&&(o._$AP??=We,o._$AQ??=Be)},dt=class extends g{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),fe(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(K(this,t),ht(this))}setValue(t){if(lt(this._$Ct))this._$Ct._$AI(t,this);else{let e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}};var Xs=()=>new Pt,Pt=class{},St=new WeakMap,Nt=$(class extends dt{render(o){return d}update(o,[t]){let e=t!==this.G;return e&&this.G!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.G=t,this.ht=o.options?.host,this.rt(this.ct=o.element)),d}rt(o){if(this.isConnected||(o=void 0),typeof this.G=="function"){let t=this.ht??globalThis,e=St.get(t);e===void 0&&(e=new WeakMap,St.set(t,e)),e.get(this.G)!==void 0&&this.G.call(this.ht,void 0),e.set(this.G,o),o!==void 0&&this.G.call(this.ht,o)}else this.G.value=o}get lt(){return typeof this.G=="function"?St.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var pt=o=>o.replace(Ge,(t,e)=>`${e===0?"":"-"}${t.toLowerCase()}`),Ge=/[A-Z]+(?![a-z])|[A-Z]/gu;var uo="randomUUID"in crypto;var Dt=o=>{let t=o;for(;t=t.parentNode??t.host;)if(t?.constructor?.lumina){let e=t;return e.manager?.loadedCalled||(e.J??e._offspring).push(o),(e.I??e._postLoad).promise}return!1},Lt={};function Ut(){}function Rt(o){for(let t of["Associated","Disabled","Reset","StateRestore"]){let e=`orm${t}Callback`;o.prototype["f"+e]=async function(...s){await this.componentOnReady(),(this.el??this).dispatchEvent(new CustomEvent(`luminaF${e}`,{detail:s}))}}}var Ke=(o,t)=>function(s,n){if(!globalThis.customElements)return;let i=(n??s??{}).resourcesUrl;i&&o.setAssetPath(i);for(let[a,[c,h="",u=0]]of Object.entries(t)){if(customElements.get(a))continue;let[l,m,v]=h.split(";"),C=l?l?.split(",").map(Qe):void 0,yt=C?.map(([D])=>D),J=class extends xt{static{this.formAssociated=u===1}static{this.observedAttributes=C?.map(([,D])=>D).filter(D=>D!=="")}static{this.C=yt}static{this.E=m?m?.split(","):void 0}static{this.D=v?.split(",")}static{this.L=a}static{this.K=o}constructor(){!J.B&&(J.B=c(),J.F()),super()}};customElements.define(a,J)}},ut=Object.defineProperty,Qe=o=>{let t=o.split(":");return t.length===1?[t[0],pt(t[0])]:t},Je=globalThis.HTMLElement??Ut,xt=class extends Je{constructor(){super(),this.#e={},this.#s=[],this.I=new b,this.H=new b,this.J=[];let t=this,e=t.constructor;t._offspring=t.J,t._postLoad=t.I,e.C?.forEach(s=>{Object.hasOwn(t,s)&&(t.#e[s]=t[s],delete t[s])}),e.A?t.#n({a:e.A}):e.B.then(async s=>{await e.K.p,t.#n(await(s.default?.then(n=>typeof n=="function"?{a:n}:n)??s))}).catch(s=>{t.H.reject(s),setTimeout(()=>{throw s})})}static{this.lumina=!0}static F(){for(let t of this.C??[])ut(this.prototype,t,{configurable:!0,enumerable:!0,get(){return this.#e[t]},set(e){this.#e[t]=e}});for(let t of this.E??[])ut(this.prototype,t,{async value(...e){return this.#t||await this.H.promise,await this.#t[t](...e)},configurable:!0});for(let t of this.D??[])ut(this.prototype,t,{value(...e){return this.#t[t](...e)},configurable:!0})}static{Rt(this)}#t;#e;#s;get manager(){return this.#t?.manager}attributeChangedCallback(t,e,s){this.#t?.attributeChangedCallback(t,e,s),this.#t||this.#s.push(t)}connectedCallback(){this.#t?this.#t.connectedCallback?.():queueMicrotask(()=>this.G=Dt(this))}disconnectedCallback(){this.#t?.disconnectedCallback?.()}async componentOnReady(){return await this.H.promise,this}#n(t){let e=this.constructor,s=e.L,n=this.#e,r=Object.values(t).find(l=>l.L===s),i=`${s}--lazy`,a=r;for(;a&&!Object.hasOwn(a,"lumina");)a=Object.getPrototypeOf(a);Ze(a),!e.A&&(e.A=r,customElements.define(i,r)),r.N=this;let h=document.createElement(i);r.N=void 0,this.#t=h,this.#e=h,this.#s.forEach(l=>h.attributeChangedCallback(l,null,this.getAttribute(l))),Object.entries(n).forEach(Ye,h);let u=this.isConnected;(u||this.G)&&(h.connectedCallback?.(),u||h.disconnectedCallback())}addController(){}requestUpdate(){this.#t?.requestUpdate()}};function Ye([o,t]){this[o]=t}var Ze=o=>{let t=o.prototype,e=Element.prototype;Object.hasOwn(t,"isConnected")||(t.setAttribute=function(n,r){e.setAttribute.call(this.el,n,r)},t.removeAttribute=function(n){e.removeAttribute.call(this.el,n)},t.hasAttribute=function(n){return e.hasAttribute.call(this.el,n)},ut(t,"isConnected",{get(){return Reflect.get(e,"isConnected",this.el)}}))};var ft=class extends pe{constructor(t){super(t),this.destroyed=!1,this.R=!1,this.V=d,this.T=[],this.#s=new WeakMap,this.#e=t,this.exports=void 0,this.hasDestroy=mt in t&&typeof t.destroy=="function",E.prototype.addController.call(t,{hostConnected:()=>{if(this.destroyed){let e=t.el.localName;throw t.el.remove(),new Error(`The ${e} component has already been destroyed. It cannot be used again. If you meant to disconnect and reconnect a component without automatic destroy, set the ${mt} prop.`)}this.#t!==void 0&&clearTimeout(this.#t),I();for(let e of t.M)"triggerConnected"in e?e.triggerConnected():p(e.hostConnected,e)},hostDisconnected:()=>{for(let e of t.M)"triggerDisconnected"in e?e.triggerDisconnected():p(e.hostDisconnected,e);this.hasDestroy&&!this.destroyed&&this.U()},hostUpdate:()=>{for(let e of t.M)"triggerUpdate"in e?e.triggerUpdate(this.Q):p(e.hostUpdate,e,this.Q)},hostUpdated:()=>{for(let e of t.M)"triggerUpdated"in e?e.triggerUpdated(this.Q):p(e.hostUpdated,e,this.Q);this.Q=void 0}}),queueMicrotask(()=>this.R=!0),x(t)}#t;#e;async destroy(){if(!this.destroyed){this.#e.el.isConnected&&(this.hasDestroy=!1,this.#e.el.remove()),this.#t=void 0,this.destroyed=!0;for(let t of this.#e.M)"triggerDestroy"in t?t.triggerDestroy():p(t.hostDestroy,t);this.#e.M.splice(0)}}U(){if(this.#t!==void 0&&clearTimeout(this.#t),!this.#e.el.isConnected&&!this.#e.autoDestroyDisabled){let t=()=>{this.#e.destroy()};this.#t=ce(t,Xe)}}S(t,e){let s=this.T;this.V=d,this.T=[],s.forEach(n=>n(t,e))}#s;W(t,e){(typeof e=="object"&&e!==null||typeof e=="function")&&this.#s.set(e,t)}X(t){if(typeof t=="object"&&t!==null||typeof t=="function")return this.#s.get(t)}},Xe=1e3,mt="autoDestroyDisabled";var ts=$(class extends g{constructor(o){if(super(o),o.type!==y.ATTRIBUTE||o.name!=="class"||o.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(o){return" "+Object.keys(o).filter(t=>o[t]).join(" ")+" "}update(o,[t]){if(this.st===void 0){this.st=new Set,o.strings!==void 0&&(this.nt=new Set(o.strings.join(" ").split(/\s/).filter(s=>s!=="")));for(let s in t)t[s]&&!this.nt?.has(s)&&this.st.add(s);return this.render(t)}let e=o.element.classList;for(let s of this.st)s in t||(e.remove(s),this.st.delete(s));for(let s in t){let n=!!t[s];n===this.st.has(s)||this.nt?.has(s)||(n?(e.add(s),this.st.add(s)):(e.remove(s),this.st.delete(s)))}return f}});var ye="important",es=" !"+ye,ss=$(class extends g{constructor(o){if(super(o),o.type!==y.ATTRIBUTE||o.name!=="style"||o.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(o){return Object.keys(o).reduce((t,e)=>{let s=o[e];return s==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`},"")}update(o,[t]){let{style:e}=o.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(let s of this.ft)t[s]==null&&(this.ft.delete(s),s.includes("-")?e.removeProperty(s):e[s]=null);for(let s in t){let n=t[s];if(n!=null){this.ft.add(s);let r=typeof n=="string"&&n.endsWith(es);s.includes("-")||r?e.setProperty(s,r?n.slice(0,-11):n,r?ye:""):e[s]=n}}return f}});var os=$(class extends g{constructor(o){if(super(o),o.type!==y.PROPERTY&&o.type!==y.ATTRIBUTE&&o.type!==y.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!lt(o))throw Error("`live` bindings can only contain a single expression")}render(o){return o}update(o,[t]){if(t===f||t===d)return t;let e=o.element,s=o.name;if(o.type===y.PROPERTY){if(t===e[s])return f}else if(o.type===y.BOOLEAN_ATTRIBUTE){if(!!t===e.hasAttribute(s))return f}else if(o.type===y.ATTRIBUTE&&e.getAttribute(s)===t+"")return f;return ue(o),t}});var ge=class o extends E{constructor(){super(),this.M=[],this.manager=new ft(this);let t=this,e=t.constructor,s=e.N,n=e.K.o,r=o.prototype.shouldUpdate;t.#n=s?.H??new b,t.I=s?.I??new b,t.J=s?.J??[],t._offspring=t.J,t._postLoad=t.I,t.el=s??t,t.#s=t.enableUpdating,t.enableUpdating=Ut,t.shouldUpdate!==r&&(t.#e=t.shouldUpdate,t.shouldUpdate=r),n&&(t.#t=new Map,e.elementProperties.forEach((i,a)=>t.#t.set(a,n()))),!1}static finalizeStyles(t){let e=super.finalizeStyles(t),s=this.shadowRootOptions===Lt;return this.K?.commonStyles===void 0||s?e:[this.K.commonStyles,...e]}static createProperty(t,e){let s=typeof e=="number"?e:Array.isArray(e)?e[0]:0,n=Array.isArray(e)?e[1]:void 0,r=n?.hasChanged??j,i={attribute:s&1&&typeof t=="string"?pt(t):!1,reflect:!!(s&2),type:s&4?Boolean:s&8?Number:void 0,state:!!(s&16),readOnly:!!(s&32),noAccessor:!!(s&64),useDefault:!!(s&128),c:!1,...n,hasChanged(a,c){let h=r(a,c);return i.c=h,h}};super.createProperty(t,i)}static getPropertyDescriptor(t,e,s){let n=this.K,r=super.getPropertyDescriptor(t,e,s);return s.d=r,{...r,get(){return n.t?.(this.#t.get(t)),r.get?.call(this)},set(i){let a=this.manager;if(s.readOnly&&!at&&(a.R||a.connectedCalled))throw Error(`Cannot assign to read-only property "${t}" of ${this.el.localName}. Trying to assign "${i}"`);r.set.call(this,i??void 0),s.c&&this.#t?.get(t)?.notify(),a.T.length>0&&(I(),a?.S(t,i))}}}static{this.lumina=!0}static{Rt(this)}#t;#e;#s;#n;#r;#c;get elementInternals(){return this.#c??=this.el.attachInternals(),this.#c}connectedCallback(){this.hasAttribute("defer-hydration")||this.#l(!0)}#l(t){let e=this.constructor.K.c?.(()=>this.requestUpdate());this.#r=e;let s=!this.manager.connectedCalled;t&&super.connectedCallback(),s?queueMicrotask(()=>this.#i().catch(n=>{this.#n.reject(n),setTimeout(()=>{throw n})})):e&&this.requestUpdate()}#d(t){try{this.#r.clear(),this.constructor.K.r(this.#r,()=>super.update(t))}catch(e){throw this.#r.clear(),e}}disconnectedCallback(){super.disconnectedCallback(),this.#r?.destroy(),this.#r=void 0}createRenderRoot(){let t=this.el.shadowRoot,e=this.constructor,s=e.shadowRootOptions,r=t??(s===Lt?this.el:this.el.attachShadow(s));if(t)return this.manager.connectedCalled||this.#l(!1),E.prototype.createRenderRoot.call(this),t;if(this.isConnected){let i=r.getRootNode();i.adoptedStyleSheets=[...i.adoptedStyleSheets,...e.elementStyles.map(a=>"styleSheet"in a?a.styleSheet:a)]}return r}async#i(){let t=this.el.G??Dt(this.el);t&&await t;let e=[];for(let n of this.M)"triggerLoad"in n?e.push(n.triggerLoad()):e.push(W(n.hostLoad,n));await Promise.all(e),await this.load?.(),this.manager.hasDestroy&&this.manager.onUpdate(n=>n.has(mt)&&this.manager.U()),this.#s(!0),this.performUpdate(),this.I.resolve(),await 0;let s=this.J.filter(n=>!n.manager?.loadedCalled);s.length&&await Promise.allSettled(s.map(async n=>await n.componentOnReady())),this.J.length=0,this.el.setAttribute(this.constructor.K.hydratedAttribute,"");for(let n of this.M)"triggerLoaded"in n?n.triggerLoaded():p(n.hostLoaded,n);this.loaded?.(),this.#n.resolve()}shouldUpdate(t){return this.manager.Q=t,this.#e?.(t)??!0}update(t){this.#r?this.#d(t):super.update(t)}listen(t,e,s){let n=e?.bind(this)??e;this.manager.onLifecycle(()=>(this.el.addEventListener(t,n,s),()=>this.el.removeEventListener(t,n,s)))}listenOn(t,e,s,n){let r=s?.bind(this)??s;this.manager.onLifecycle(()=>(t.addEventListener(e,r,n),()=>t.removeEventListener(e,r,n)))}async componentOnReady(){return await this.#n.promise,this}addController(t){this.M.push(t),!(q in t)&&this.renderRoot&&this.el.isConnected&&t.hostConnected?.()}removeController(t){this.M.splice(this.M.indexOf(t),1),t.controllerRemoved?.()}};var Ee=o=>{let t,e=n=>{t=new URL(n,globalThis.location?.href||void 0).href},s={...o,getAssetPath(n){let r=new URL(n,t);return r.origin!==globalThis.location?.origin?r.href:r.pathname},setAssetPath:e,customElement(n,r){r.K=s,r.L=n,customElements.get(n)||customElements.define(n,r)}};return e(o.defaultAssetPath),s};var It=class extends g{#t;#e;constructor(t){super(t);let e=this;this.#e=function(n){return e.#t.call(this,n)}}render(t){return typeof t=="function"?(this.#t=t,Nt(this.#e)):Nt(t)}},Cn=$(It);var wn=d;var Q=Ee({defaultAssetPath:"https://jsdev.arcgis.com/5.2.0-next/ai-components/",hydratedAttribute:"hydrated"}),{customElement:Nn,getAssetPath:xn,setAssetPath:Dn}=Q;Q.t=void 0;Q.o=void 0;Q.c=void 0;Q.r=void 0;export{Ns as a,x as b,ne as c,re as d,xs as e,Ds as f,$e as g,ps as h,f as i,d as j,Ts as k,oe as l,je as m,ze as n,Tt as o,Ke as p,y as q,$ as r,g as s,Xs as t,Nt as u,ge as v,wn as w,Q as x,Nn as y,xn as z};
4
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),qt=/'/g,Gt=/"/g,Jt=/^(?:script|style|textarea|title)$/i,Ct=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),ps=Ct(1),us=Ct(2),fs=Ct(3),f=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Kt=new WeakMap,O=T.createTreeWalker(T,129);function Yt(o,t){if(!_t(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return Bt!==void 0?Bt.createHTML(t):t}var Zt=(o,t)=>{let e=o.length-1,s=[],n,r=t===2?"<svg>":t===3?"<math>":"",i=H;for(let a=0;a<e;a++){let c=o[a],h,u,l=-1,m=0;for(;m<c.length&&(i.lastIndex=m,u=i.exec(c),u!==null);)m=i.lastIndex,i===H?u[1]==="!--"?i=Wt:u[1]!==void 0?i=Ft:u[2]!==void 0?(Jt.test(u[2])&&(n=RegExp("</"+u[2],"g")),i=w):u[3]!==void 0&&(i=w):i===w?u[0]===">"?(i=n??H,l=-1):u[1]===void 0?l=-2:(l=i.lastIndex-u[2].length,h=u[1],i=u[3]===void 0?w:u[3]==='"'?Gt:qt):i===Gt||i===qt?i=w:i===Wt||i===Ft?i=H:(i=w,n=void 0);let v=i===w&&o[a+1].startsWith("/>")?" ":"";r+=i===H?c+Ne:l>=0?(s.push(h),c.slice(0,l)+bt+c.slice(l)+_+v):c+_+(l===-2?a:v)}return[Yt(o,r+(o[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},B=class o{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let r=0,i=0,a=t.length-1,c=this.parts,[h,u]=Zt(t,e);if(this.el=o.createElement(h,s),O.currentNode=this.el.content,e===2||e===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(n=O.nextNode())!==null&&c.length<a;){if(n.nodeType===1){if(n.hasAttributes())for(let l of n.getAttributeNames())if(l.endsWith(bt)){let m=u[i++],v=n.getAttribute(l).split(_),C=/([.?@])?(.*)/.exec(m);c.push({type:1,index:r,name:C[2],strings:v,ctor:C[1]==="."?ot:C[1]==="?"?nt:C[1]==="@"?rt:P}),n.removeAttribute(l)}else l.startsWith(_)&&(c.push({type:6,index:r}),n.removeAttribute(l));if(Jt.test(n.tagName)){let l=n.textContent.split(_),m=l.length-1;if(m>0){n.textContent=et?et.emptyScript:"";for(let v=0;v<m;v++)n.append(l[v],z()),O.nextNode(),c.push({type:2,index:++r});n.append(l[m],z())}}}else if(n.nodeType===8)if(n.data===At)c.push({type:2,index:r});else{let l=-1;for(;(l=n.data.indexOf(_,l+1))!==-1;)c.push({type:7,index:r}),l+=_.length-1}r++}}static createElement(t,e){let s=T.createElement("template");return s.innerHTML=t,s}};function S(o,t,e=o,s){if(t===f)return t;let n=s!==void 0?e._$Co?.[s]:e._$Cl,r=V(t)?void 0:t._$litDirective$;return n?.constructor!==r&&(n?._$AO?.(!1),r===void 0?n=void 0:(n=new r(o),n._$AT(o,e,s)),s!==void 0?(e._$Co??=[])[s]=n:e._$Cl=n),n!==void 0&&(t=S(o,n._$AS(o,t.values),n,s)),t}var st=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:s}=this._$AD,n=(t?.creationScope??T).importNode(e,!0);O.currentNode=n;let r=O.nextNode(),i=0,a=0,c=s[0];for(;c!==void 0;){if(i===c.index){let h;c.type===2?h=new L(r,r.nextSibling,this,t):c.type===1?h=new c.ctor(r,c.name,c.strings,this,t):c.type===6&&(h=new it(r,this,t)),this._$AV.push(h),c=s[++a]}i!==c?.index&&(r=O.nextNode(),i++)}return O.currentNode=T,n}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}},L=class o{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,n){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=S(this,t,e),V(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==f&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Qt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==d&&V(this._$AH)?this._$AA.nextSibling.data=t:this.T(T.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,n=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=B.createElement(Yt(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===n)this._$AH.p(e);else{let r=new st(n,this),i=r.u(this.options);r.p(e),this.T(i),this._$AH=r}}_$AC(t){let e=Kt.get(t.strings);return e===void 0&&Kt.set(t.strings,e=new B(t)),e}k(t){_t(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,n=0;for(let r of t)n===e.length?e.push(s=new o(this.O(z()),this.O(z()),this,this.options)):s=e[n],s._$AI(r),n++;n<e.length&&(this._$AR(s&&s._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let s=Vt(t).nextSibling;Vt(t).remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},P=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,n,r){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,n){let r=this.strings,i=!1;if(r===void 0)t=S(this,t,e,0),i=!V(t)||t!==this._$AH&&t!==f,i&&(this._$AH=t);else{let a=t,c,h;for(t=r[0],c=0;c<r.length-1;c++)h=S(this,a[s+c],e,c),h===f&&(h=this._$AH[c]),i||=!V(h)||h!==this._$AH[c],h===d?t=d:t!==d&&(t+=(h??"")+r[c+1]),this._$AH[c]=h}i&&!n&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},ot=class extends P{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}},nt=class extends P{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}},rt=class extends P{constructor(t,e,s,n,r){super(t,e,s,n,r),this.type=5}_$AI(t,e=this){if((t=S(this,t,e,0)??d)===f)return;let s=this._$AH,n=t===d&&s!==d||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==d&&(s===d||n);n&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},it=class{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){S(this,t)}},Xt={M:bt,P:_,A:At,C:1,L:Zt,R:st,D:Qt,V:S,I:L,H:P,N:nt,U:rt,B:ot,F:it},xe=$t.litHtmlPolyfillSupport;xe?.(B,L),($t.litHtmlVersions??=[]).push("3.3.2");var wt=(o,t,e)=>{let s=e?.renderBefore??t,n=s._$litPart$;if(n===void 0){let r=e?.renderBefore??null;s._$litPart$=n=new L(t.insertBefore(z(),r),r,void 0,e??{})}return n._$AI(o),n};var Ot=globalThis,E=class extends A{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=wt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return f}};E._$litElement$=!0,E.finalized=!0,Ot.litElementHydrateSupport?.({LitElement:E});var De=Ot.litElementPolyfillSupport;De?.({LitElement:E});(Ot.litElementVersions??=[]).push("4.2.2");var te=new Set,ee;var se=o=>typeof o=="string"?o:"el"in o?o.el.localName:"localName"in o?o.localName:o.declaredClass,Ts=(o,t,e,s)=>{let n=se(t);if(s?.once){let i=`${o}${n}${e}`;if(te.has(i))return;te.add(i)}let r;if(s?.detail){r={};for(let[i,a]of Object.entries(s.detail))if((typeof a=="object"||typeof a=="function")&&a!==null){let c=new WeakRef(a);Object.defineProperty(r,i,{enumerable:!0,get(){return c.deref()}})}else r[i]=a;ee?.log.interceptors?.forEach(i=>i(o,n,e,r)),console[o](`[${n}]: ${e}`,r)}else ee?.log.interceptors?.forEach(i=>i(o,n,e)),console[o](`[${n}]: ${e}`)},oe=o=>{let t=`[${se(o)}] `;return e=>{let s=e instanceof Error&&e.message?e:new Error(String(e));s.message=`${t}${s.message}`,setTimeout(()=>{throw e})}};var p=(o,t,...e)=>{try{return o?.call(t,...e)}catch(s){console.error(s,o)}},W=async(o,t,...e)=>{try{return await o?.call(t,...e)}catch(s){console.error(s,o)}};var q=Symbol.for("controller"),Le=o=>typeof o=="object"&&o!==null&&(q in o||"hostConnected"in o||"hostDisconnected"in o||"hostUpdate"in o||"hostUpdated"in o),Ns=o=>typeof o?.then=="function";var F,x=o=>{F!==o&&(F=o,queueMicrotask(()=>F===o?F=void 0:0))},G=o=>F,N=[],ne=o=>{if(o===void 0){N=[];return}let t=N.indexOf(o);N=t===-1?[...N,o]:N.slice(0,t+1),queueMicrotask(()=>N=[])},re=()=>N,U,xs=o=>{U!==o&&(U=o,queueMicrotask(()=>U===o?U=void 0:0))},Ue=()=>{let o=U;return U=void 0,o},ie=async(o,t)=>{let e=ct(o);if(e===void 0)return o;if(await e.ready,typeof t=="function"){let s=e.watchExports(n=>t(n,s))}return e.exports},ae=async o=>{let t=ct(o);return await t.ready,t},ct=o=>{let e=G().manager.X(o);if(e!==void 0)return e;if(Le(o))return o;let s=Ue();if(s!==void 0)return s},at=!1,Ds=o=>{at=!0;try{return o()}finally{at=!1}};var b=class{constructor(){this.promise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}};var ce=(o,t)=>{let e=t>Re?Ie:t/Me,s=0,n=setInterval(()=>{s+=e,s>=t&&(clearInterval(n),o())},e);return n},Re=4e3,Ie=2e3,Me=4;var ke=(o,t,e)=>{let s=Object.keys(o),n=s.length;R===void 0&&queueMicrotask(I),R??=new Map;let r=R.get(o);return r===void 0&&(r={callbacks:[],keyCount:n},R.set(o,r)),r.keyCount!==n&&(r.callbacks.forEach(i=>i(s)),r.callbacks=[],r.keyCount=n),r.callbacks.push(i=>{let a=h=>p(t,null,h),c=i[n];c===void 0?a(void 0):o[c]===e?a(c):a(void 0)}),e},R,I=()=>{R?.forEach(({callbacks:o},t)=>{let e=Object.keys(t);o.forEach(s=>s(e))}),R=void 0},je=(o,t,e)=>{let s=o.manager;return s.V!==d&&s.V!==e&&s.S(void 0,void 0),s.T.length===0&&queueMicrotask(()=>s.S(void 0,void 0)),s.V=e,s.T.push((n,r)=>p(t,void 0,e===r?n:void 0)),e},He=(o=[G(),...re()],t,e)=>{let s=Array.isArray(o)?o:[o],n=s.length+1,r=i=>{n-=1,i!==void 0&&(n=Math.min(n,0)),n===0&&t(i)};s.forEach(i=>ke(i,a=>r(a===void 0?void 0:{key:a,host:i,isReactive:!1}),e));for(let i of s)if("manager"in i&&i.manager.component===i){je(i,a=>r(a===void 0?void 0:{key:a,host:i,isReactive:!0}),e);break}return e},ze=(o="",t={},e=G())=>{let s={emit:n=>{o===""&&I();let r=new CustomEvent(o,{detail:n,cancelable:!0,bubbles:!0,composed:!0,...t});return e.el.dispatchEvent(r),r}};return o===""&&He(void 0,n=>o=n.key,s),s},Ve=ze.bind(null,""),de;de=q;var Tt=class{constructor(t){this.#t=[],this.#e=[],this.#s=[],this.#n=[],this.#r=[],this.#c=[],this.#l=[],this.#d=[],this.#i=[],this.#p=!1,this.P=new b,this.connectedCalled=!1,this.loadedCalled=!1,this[de]=!0,this.#h=[];let e=this,s=t??G(new.target.name);e.#o=s,e.ready=e.P.promise,e.#a=he(e),e.component=s,e.#o.addController(e),e.#o.manager===void 0||(ne(e),queueMicrotask(()=>e.catchUpLifecycle()))}#t;#e;#s;#n;#r;#c;#l;#d;#i;#p;#o;catchUpLifecycle(){let{manager:t}=this.#o;t.connectedCalled&&!this.connectedCalled&&this.triggerConnected(),t.#p&&this.triggerLoad().then(()=>t.loadedCalled&&this.triggerLoaded()).catch(oe(this.#o))}#a;get exports(){return this.#a}set exports(t){let e=this.#a;e!==t&&(this.#a=t,this.#h.forEach(p),this.connectedCalled&&this.O!==!1&&this.#o.requestUpdate(this.O,e)),this.P.resolve(t)}setProvisionalExports(t,e=!0){this.#a=e?he(t):t,this.#h.forEach(p)}#h;watchExports(t){let e=()=>t(this.#a);return this.#h.push(e),()=>{this.#h.splice(this.#h.indexOf(e),1)}}get use(){return x(this.#o),ie}get useRef(){return x(this.#o),ae}get useRefSync(){return x(this.#o),ct}controllerRemoved(){this.#o.el.isConnected&&this.triggerDisconnected(),this.triggerDestroy()}onConnected(t){this.#t.push(t)}onDisconnected(t){this.#e.push(t)}onLoad(t){this.#s.push(t)}onLoaded(t){this.#n.push(t)}onUpdate(t){this.#r.push(t)}onUpdated(t){this.#c.push(t)}onDestroy(t){this.#l.push(t)}onLifecycle(t){this.#d.push(t),this.connectedCalled&&this.#o.el.isConnected&&this.#u(t)}triggerConnected(){let t=this;t.hostConnected&&p(t.hostConnected,t),t.#t.forEach(p),t.triggerLifecycle(),t.connectedCalled=!0}triggerDisconnected(){let t=this;t.hostDisconnected&&p(t.hostDisconnected,t),t.#e.forEach(p),t.#i.forEach(p),t.#i=[]}async triggerLoad(){if(this.#p)return;this.#p=!0;let t=this;t.hostLoad&&await W(t.hostLoad,t),this.#s.length>0&&await Promise.allSettled(this.#s.map(W)),this.P.resolve(this.#a)}triggerLoaded(){this.loadedCalled||(this.hostLoaded&&p(this.hostLoaded,this),this.#n.forEach(p),this.loadedCalled=!0)}triggerUpdate(t){this.hostUpdate&&p(this.hostUpdate,this,t),this.#r.forEach(le,t)}triggerUpdated(t){this.hostUpdated&&p(this.hostUpdated,this,t),this.#c.forEach(le,t)}triggerDestroy(){this.hostDestroy&&p(this.hostDestroy,this),this.#l.forEach(p)}triggerLifecycle(){this.hostLifecycle&&this.#u(()=>this.hostLifecycle()),this.#d.forEach(this.#u,this)}#u(t){x(this.#o);let e=p(t);(Array.isArray(e)?e:[e]).forEach(n=>{typeof n=="function"?this.#i.push(n):typeof n=="object"&&typeof n.remove=="function"&&this.#i.push(n.remove)})}};function le(o){p(o,void 0,this)}var he=o=>{if(typeof o!="object"&&typeof o!="function"||o===null)return o;let t={get(s,n,r){if(!((n==="exports"||n==="_exports")&&n in s&&s[n]===e)&&(n in s||n in Promise.prototype||typeof n=="symbol"))return typeof s=="function"?s[n]:Reflect.get(s,n,r)}},e=new Proxy(o,t);return e};var pe=Tt;var{I:Bs}=Xt;var lt=o=>o.strings===void 0;var Be={},ue=(o,t=Be)=>o._$AH=t;var y={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},$=o=>(...t)=>({_$litDirective$:o,values:t}),g=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var K=(o,t)=>{let e=o._$AN;if(e===void 0)return!1;for(let s of e)s._$AO?.(t,!1),K(s,t);return!0},ht=o=>{let t,e;do{if((t=o._$AM)===void 0)break;e=t._$AN,e.delete(o),o=t}while(e?.size===0)},fe=o=>{for(let t;t=o._$AM;o=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(o))break;e.add(o),qe(t)}};function We(o){this._$AN!==void 0?(ht(this),this._$AM=o,fe(this)):this._$AM=o}function Fe(o,t=!1,e=0){let s=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(t)if(Array.isArray(s))for(let r=e;r<s.length;r++)K(s[r],!1),ht(s[r]);else s!=null&&(K(s,!1),ht(s));else K(this,o)}var qe=o=>{o.type==y.CHILD&&(o._$AP??=Fe,o._$AQ??=We)},dt=class extends g{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),fe(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(K(this,t),ht(this))}setValue(t){if(lt(this._$Ct))this._$Ct._$AI(t,this);else{let e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}};var Xs=()=>new Pt,Pt=class{},St=new WeakMap,Nt=$(class extends dt{render(o){return d}update(o,[t]){let e=t!==this.G;return e&&this.G!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.G=t,this.ht=o.options?.host,this.rt(this.ct=o.element)),d}rt(o){if(this.isConnected||(o=void 0),typeof this.G=="function"){let t=this.ht??globalThis,e=St.get(t);e===void 0&&(e=new WeakMap,St.set(t,e)),e.get(this.G)!==void 0&&this.G.call(this.ht,void 0),e.set(this.G,o),o!==void 0&&this.G.call(this.ht,o)}else this.G.value=o}get lt(){return typeof this.G=="function"?St.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var pt=o=>o.replace(Ke,(t,e)=>`${e===0?"":"-"}${t.toLowerCase()}`),Ke=/[A-Z]+(?![a-z])|[A-Z]/gu;var uo="randomUUID"in crypto;var Dt=o=>{let t=o;for(;t=t.parentNode??t.host;)if(t?.constructor?.lumina){let e=t;return e.manager?.loadedCalled||(e.J??e._offspring).push(o),(e.I??e._postLoad).promise}return!1},Lt={};function Ut(){}function Rt(o){for(let t of["Associated","Disabled","Reset","StateRestore"]){let e=`orm${t}Callback`;o.prototype["f"+e]=async function(...s){await this.componentOnReady(),(this.el??this).dispatchEvent(new CustomEvent(`luminaF${e}`,{detail:s}))}}}var Qe=(o,t)=>function(s,n){if(!globalThis.customElements)return;let i=(n??s??{}).resourcesUrl;i&&o.setAssetPath(i);for(let[a,[c,h="",u=0]]of Object.entries(t)){if(customElements.get(a))continue;let[l,m,v]=h.split(";"),C=l?l?.split(",").map(Je):void 0,yt=C?.map(([D])=>D),J=class extends xt{static{this.formAssociated=u===1}static{this.observedAttributes=C?.map(([,D])=>D).filter(D=>D!=="")}static{this.C=yt}static{this.E=m?m?.split(","):void 0}static{this.D=v?.split(",")}static{this.L=a}static{this.K=o}constructor(){!J.B&&(J.B=c(),J.F()),super()}};customElements.define(a,J)}},ut=Object.defineProperty,Je=o=>{let t=o.split(":");return t.length===1?[t[0],pt(t[0])]:t},Ye=globalThis.HTMLElement??Ut,xt=class extends Ye{constructor(){super(),this.#e={},this.#s=[],this.I=new b,this.H=new b,this.J=[];let t=this,e=t.constructor;t._offspring=t.J,t._postLoad=t.I,e.C?.forEach(s=>{Object.hasOwn(t,s)&&(t.#e[s]=t[s],delete t[s])}),e.A?t.#n({a:e.A}):e.B.then(async s=>{await e.K.p,t.#n(await(s.default?.then(n=>typeof n=="function"?{a:n}:n)??s))}).catch(s=>{t.H.reject(s),setTimeout(()=>{throw s})})}static{this.lumina=!0}static F(){for(let t of this.C??[])ut(this.prototype,t,{configurable:!0,enumerable:!0,get(){return this.#e[t]},set(e){this.#e[t]=e}});for(let t of this.E??[])ut(this.prototype,t,{async value(...e){return this.#t||await this.H.promise,await this.#t[t](...e)},configurable:!0});for(let t of this.D??[])ut(this.prototype,t,{value(...e){return this.#t[t](...e)},configurable:!0})}static{Rt(this)}#t;#e;#s;get manager(){return this.#t?.manager}attributeChangedCallback(t,e,s){this.#t?.attributeChangedCallback(t,e,s),this.#t||this.#s.push(t)}connectedCallback(){this.#t?this.#t.connectedCallback?.():queueMicrotask(()=>this.G=Dt(this))}disconnectedCallback(){this.#t?.disconnectedCallback?.()}async componentOnReady(){return await this.H.promise,this}#n(t){let e=this.constructor,s=e.L,n=this.#e,r=Object.values(t).find(l=>l.L===s),i=`${s}--lazy`,a=r;for(;a&&!Object.hasOwn(a,"lumina");)a=Object.getPrototypeOf(a);Xe(a),!e.A&&(e.A=r,customElements.define(i,r)),r.N=this;let h=document.createElement(i);r.N=void 0,this.#t=h,this.#e=h,this.#s.forEach(l=>h.attributeChangedCallback(l,null,this.getAttribute(l))),Object.entries(n).forEach(Ze,h);let u=this.isConnected;(u||this.G)&&(h.connectedCallback?.(),u||h.disconnectedCallback())}addController(){}requestUpdate(){this.#t?.requestUpdate()}};function Ze([o,t]){this[o]=t}var Xe=o=>{let t=o.prototype,e=Element.prototype;Object.hasOwn(t,"isConnected")||(t.setAttribute=function(n,r){e.setAttribute.call(this.el,n,r)},t.removeAttribute=function(n){e.removeAttribute.call(this.el,n)},t.hasAttribute=function(n){return e.hasAttribute.call(this.el,n)},ut(t,"isConnected",{get(){return Reflect.get(e,"isConnected",this.el)}}))};var ft=class extends pe{constructor(t){super(t),this.destroyed=!1,this.R=!1,this.V=d,this.T=[],this.#s=new WeakMap,this.#e=t,this.exports=void 0,this.hasDestroy=mt in t&&typeof t.destroy=="function",E.prototype.addController.call(t,{hostConnected:()=>{if(this.destroyed){let e=t.el.localName;throw t.el.remove(),new Error(`The ${e} component has already been destroyed. It cannot be used again. If you meant to disconnect and reconnect a component without automatic destroy, set the ${mt} prop.`)}this.#t!==void 0&&clearTimeout(this.#t),I();for(let e of t.M)"triggerConnected"in e?e.triggerConnected():p(e.hostConnected,e)},hostDisconnected:()=>{for(let e of t.M)"triggerDisconnected"in e?e.triggerDisconnected():p(e.hostDisconnected,e);this.hasDestroy&&!this.destroyed&&this.U()},hostUpdate:()=>{for(let e of t.M)"triggerUpdate"in e?e.triggerUpdate(this.Q):p(e.hostUpdate,e,this.Q)},hostUpdated:()=>{for(let e of t.M)"triggerUpdated"in e?e.triggerUpdated(this.Q):p(e.hostUpdated,e,this.Q);this.Q=void 0}}),queueMicrotask(()=>this.R=!0),x(t)}#t;#e;async destroy(){if(!this.destroyed){this.#e.el.isConnected&&(this.hasDestroy=!1,this.#e.el.remove()),this.#t=void 0,this.destroyed=!0;for(let t of this.#e.M)"triggerDestroy"in t?t.triggerDestroy():p(t.hostDestroy,t);this.#e.M.splice(0)}}U(){if(this.#t!==void 0&&clearTimeout(this.#t),!this.#e.el.isConnected&&!this.#e.autoDestroyDisabled){let t=()=>{this.#e.destroy()};this.#t=ce(t,ts)}}S(t,e){let s=this.T;this.V=d,this.T=[],s.forEach(n=>n(t,e))}#s;W(t,e){(typeof e=="object"&&e!==null||typeof e=="function")&&this.#s.set(e,t)}X(t){if(typeof t=="object"&&t!==null||typeof t=="function")return this.#s.get(t)}},ts=1e3,mt="autoDestroyDisabled";var ye=$(class extends g{constructor(o){if(super(o),o.type!==y.ATTRIBUTE||o.name!=="class"||o.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(o){return" "+Object.keys(o).filter(t=>o[t]).join(" ")+" "}update(o,[t]){if(this.st===void 0){this.st=new Set,o.strings!==void 0&&(this.nt=new Set(o.strings.join(" ").split(/\s/).filter(s=>s!=="")));for(let s in t)t[s]&&!this.nt?.has(s)&&this.st.add(s);return this.render(t)}let e=o.element.classList;for(let s of this.st)s in t||(e.remove(s),this.st.delete(s));for(let s in t){let n=!!t[s];n===this.st.has(s)||this.nt?.has(s)||(n?(e.add(s),this.st.add(s)):(e.remove(s),this.st.delete(s)))}return f}});var ge="important",es=" !"+ge,ss=$(class extends g{constructor(o){if(super(o),o.type!==y.ATTRIBUTE||o.name!=="style"||o.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(o){return Object.keys(o).reduce((t,e)=>{let s=o[e];return s==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`},"")}update(o,[t]){let{style:e}=o.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(let s of this.ft)t[s]==null&&(this.ft.delete(s),s.includes("-")?e.removeProperty(s):e[s]=null);for(let s in t){let n=t[s];if(n!=null){this.ft.add(s);let r=typeof n=="string"&&n.endsWith(es);s.includes("-")||r?e.setProperty(s,r?n.slice(0,-11):n,r?ge:""):e[s]=n}}return f}});var os=$(class extends g{constructor(o){if(super(o),o.type!==y.PROPERTY&&o.type!==y.ATTRIBUTE&&o.type!==y.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!lt(o))throw Error("`live` bindings can only contain a single expression")}render(o){return o}update(o,[t]){if(t===f||t===d)return t;let e=o.element,s=o.name;if(o.type===y.PROPERTY){if(t===e[s])return f}else if(o.type===y.BOOLEAN_ATTRIBUTE){if(!!t===e.hasAttribute(s))return f}else if(o.type===y.ATTRIBUTE&&e.getAttribute(s)===t+"")return f;return ue(o),t}});var ve=class o extends E{constructor(){super(),this.M=[],this.manager=new ft(this);let t=this,e=t.constructor,s=e.N,n=e.K.o,r=o.prototype.shouldUpdate;t.#n=s?.H??new b,t.I=s?.I??new b,t.J=s?.J??[],t._offspring=t.J,t._postLoad=t.I,t.el=s??t,t.#s=t.enableUpdating,t.enableUpdating=Ut,t.shouldUpdate!==r&&(t.#e=t.shouldUpdate,t.shouldUpdate=r),n&&(t.#t=new Map,e.elementProperties.forEach((i,a)=>t.#t.set(a,n()))),!1}static finalizeStyles(t){let e=super.finalizeStyles(t),s=this.shadowRootOptions===Lt;return this.K?.commonStyles===void 0||s?e:[this.K.commonStyles,...e]}static createProperty(t,e){let s=typeof e=="number"?e:Array.isArray(e)?e[0]:0,n=Array.isArray(e)?e[1]:void 0,r=n?.hasChanged??j,i={attribute:s&1&&typeof t=="string"?pt(t):!1,reflect:!!(s&2),type:s&4?Boolean:s&8?Number:void 0,state:!!(s&16),readOnly:!!(s&32),noAccessor:!!(s&64),useDefault:!!(s&128),c:!1,...n,hasChanged(a,c){let h=r(a,c);return i.c=h,h}};super.createProperty(t,i)}static getPropertyDescriptor(t,e,s){let n=this.K,r=super.getPropertyDescriptor(t,e,s);return s.d=r,{...r,get(){return n.t?.(this.#t.get(t)),r.get?.call(this)},set(i){let a=this.manager;if(s.readOnly&&!at&&(a.R||a.connectedCalled))throw Error(`Cannot assign to read-only property "${t}" of ${this.el.localName}. Trying to assign "${i}"`);r.set.call(this,i??void 0),s.c&&this.#t?.get(t)?.notify(),a.T.length>0&&(I(),a?.S(t,i))}}}static{this.lumina=!0}static{Rt(this)}#t;#e;#s;#n;#r;#c;get elementInternals(){return this.#c??=this.el.attachInternals(),this.#c}connectedCallback(){this.hasAttribute("defer-hydration")||this.#l(!0)}#l(t){let e=this.constructor.K.c?.(()=>this.requestUpdate());this.#r=e;let s=!this.manager.connectedCalled;t&&super.connectedCallback(),s?queueMicrotask(()=>this.#i().catch(n=>{this.#n.reject(n),setTimeout(()=>{throw n})})):e&&this.requestUpdate()}#d(t){try{this.#r.clear(),this.constructor.K.r(this.#r,()=>super.update(t))}catch(e){throw this.#r.clear(),e}}disconnectedCallback(){super.disconnectedCallback(),this.#r?.destroy(),this.#r=void 0}createRenderRoot(){let t=this.el.shadowRoot,e=this.constructor,s=e.shadowRootOptions,r=t??(s===Lt?this.el:this.el.attachShadow(s));if(t)return this.manager.connectedCalled||this.#l(!1),E.prototype.createRenderRoot.call(this),t;if(this.isConnected){let i=r.getRootNode();i.adoptedStyleSheets=[...i.adoptedStyleSheets,...e.elementStyles.map(a=>"styleSheet"in a?a.styleSheet:a)]}return r}async#i(){let t=this.el.G??Dt(this.el);t&&await t;let e=[];for(let n of this.M)"triggerLoad"in n?e.push(n.triggerLoad()):e.push(W(n.hostLoad,n));await Promise.all(e),await this.load?.(),this.manager.hasDestroy&&this.manager.onUpdate(n=>n.has(mt)&&this.manager.U()),this.#s(!0),this.performUpdate(),this.I.resolve(),await 0;let s=this.J.filter(n=>!n.manager?.loadedCalled);s.length&&await Promise.allSettled(s.map(async n=>await n.componentOnReady())),this.J.length=0,this.el.setAttribute(this.constructor.K.hydratedAttribute,"");for(let n of this.M)"triggerLoaded"in n?n.triggerLoaded():p(n.hostLoaded,n);this.loaded?.(),this.#n.resolve()}shouldUpdate(t){return this.manager.Q=t,this.#e?.(t)??!0}update(t){this.#r?this.#d(t):super.update(t)}listen(t,e,s){let n=e?.bind(this)??e;this.manager.onLifecycle(()=>(this.el.addEventListener(t,n,s),()=>this.el.removeEventListener(t,n,s)))}listenOn(t,e,s,n){let r=s?.bind(this)??s;this.manager.onLifecycle(()=>(t.addEventListener(e,r,n),()=>t.removeEventListener(e,r,n)))}async componentOnReady(){return await this.#n.promise,this}addController(t){this.M.push(t),!(q in t)&&this.renderRoot&&this.el.isConnected&&t.hostConnected?.()}removeController(t){this.M.splice(this.M.indexOf(t),1),t.controllerRemoved?.()}};var $e=o=>{let t,e=n=>{t=new URL(n,globalThis.location?.href||void 0).href},s={...o,getAssetPath(n){let r=new URL(n,t);return r.origin!==globalThis.location?.origin?r.href:r.pathname},setAssetPath:e,customElement(n,r){r.K=s,r.L=n,customElements.get(n)||customElements.define(n,r)}};return e(o.defaultAssetPath),s};var Cn=o=>typeof o=="object"&&o!=null?ye(o):o;var It=class extends g{#t;#e;constructor(t){super(t);let e=this;this.#e=function(n){return e.#t.call(this,n)}}render(t){return typeof t=="function"?(this.#t=t,Nt(this.#e)):Nt(t)}},wn=$(It);var On=d;var Q=$e({defaultAssetPath:"https://jsdev.arcgis.com/5.2.0-next/ai-components/",hydratedAttribute:"hydrated"}),{customElement:xn,getAssetPath:Dn,setAssetPath:Ln}=Q;Q.t=void 0;Q.o=void 0;Q.c=void 0;Q.r=void 0;export{Ns as a,x as b,ne as c,re as d,xs as e,Ds as f,be as g,ps as h,f as i,d as j,Ts as k,oe as l,He as m,Ve as n,Tt as o,Qe as p,y as q,$ as r,g as s,Xs as t,Nt as u,ve as v,Cn as w,On as x,Q as y,xn as z,Dn as A};
@@ -0,0 +1,16 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import c from"./EBISDZ5H.js";import b from"./R56X6ZKR.js";import a from"./T43LEBBE.js";import{a as D,c as O}from"./RUURNLTP.js";import"./5W7S2RS4.js";import"./NXKKG5TK.js";import{v as $,z as A}from"./HWKDNS4K.js";import{a as l}from"./P7DG5T3Z.js";import"./BX7FSMUU.js";import{a as N,b as E,ta as k}from"./DHKUXLU3.js";import{Z as V}from"./CHPQM77M.js";import"./WNS5ZUF5.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([,,,,,,,,,,,,K,X,,,{j:z,l:T},{C:R,D:G,E:L,F:P,G:F,H:U,a:j,m:S,n:M,o:f,p:Q},_])=>{var Y=async(e,t)=>(await l({text:"Exiting Data Exploration agent"},t),e),Z=async(e,t)=>{await l({text:"Requesting LLM for layer filter results"},t);let a=await S("data_explore_filter_prompt");if(!t?.configurable)throw new Error("config.configurable is required for layer filter tools");let{userTimezone:d,userTimezoneOffset:o}=L(),s={layerFieldInfo:e.layerFieldInfo,userTimezone:d,userTimezoneOffset:o,queryResponse:e.queryResponse,assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps},i=await T({promptText:a,modelTier:"advanced",config:t,messages:e.dataExplorationMessages,inputVariables:s,tools:F}),r=[...e.dataExplorationMessages,i];if(!((i.tool_calls?.length??0)>0))return await l({text:"LLM determined no filter changes needed"},t),{...e,dataExplorationMessages:r};let u=r,n=i.content.toString();return await _(i,t),{...e,dataExplorationMessages:u,outputMessage:n}},ee=async(e,t)=>{await l({text:"Requesting LLM for layer query results"},t);let a=await S("data_explore_query_prompt");if(!t?.configurable)throw new Error("config.configurable is required for layer query tools");let{userTimezone:d,userTimezoneOffset:o}=L(),s=e.agentExecutionContext.sharedState.lastNavigatedFeatures,i=s&&typeof s=="object"&&"value"in s?s.value:s,r="none";if(i!=null)try{r=JSON.stringify(i)}catch{r="none"}let u={layerFieldInfo:e.layerFieldInfo,userTimezone:d,userTimezoneOffset:o,assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps,lastNavigatedFeatures:r},n=await T({promptText:a,modelTier:"advanced",config:t,messages:e.dataExplorationMessages,inputVariables:u,tools:P}),m=(n.tool_calls?.length??0)>0,g=n.content.toString();return await _(n,t),{...e,dataExplorationMessages:[...e.dataExplorationMessages,n],...m?{}:{outputMessage:g},status:"success",summary:g&&!m?M(g):"Query planning completed."}},te=async(e,t)=>{try{await l({text:"Requesting LLM for summary on query results"},t);let a=await S("summarize_query_response_prompt"),d={queryResponse:e.queryResponse,assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps},o=await z({promptText:a,modelTier:"fast",config:t,messages:e.dataExplorationMessages,inputVariables:d}),s=typeof o=="string"?o:o.content,i=new V(s);await l({text:`Received response from LLM: ${s}`},t);let r=s;return{...e,outputMessage:r,status:"success",summary:r?M(r):"Summary generated.",dataExplorationMessages:[...e.dataExplorationMessages,i]}}catch(a){throw await l({text:"Error during filter LLM request"},t),new Error(`Error during filter LLM request: ${a instanceof Error?a.message:String(a)}`)}};async function ae(e,t){if((e.queryResponse??[]).some(d=>{let o=d.details;return typeof o=="object"&&o!==null&&"error"in o}))return await l({text:"Skipping layer filter tool because query response contains an error."},t),{...e};let a=await new j(F,{handleToolErrors:!1}).invoke({messages:e.dataExplorationMessages},t);return await l({text:`Finished executing layer filter tool: ${a.messages.map(d=>d.content).join(", ")}`},t),{...e}}var se=10,re=["string","small-integer","integer"],ie=async(e,t,{includeSummaryStatistics:a=!0,includeUniqueValues:d=!0}={})=>{let o=null,s=null;try{if(t.type!=="geometry"&&t.type!=="oid"&&t.type!=="global-id"){a&&(o=await K({layer:e,field:t.name}));let i=t.domain?.type==="coded-value"?t.domain:null;d&&(re.includes(t.type)||i)&&(s=(await X({layer:e,field:t.name})).uniqueValueInfos.sort((r,u)=>u.count-r.count).slice(0,se),i&&(s=s.map(r=>({...r,value:i.getName(r.value)??r.value}))))}}catch(i){console.error(`Error fetching statistics for field ${t.name}:`,i)}return{summaryStatistics:o,uniqueValues:s}};function oe(e,t){return["string","small-integer","integer"].includes(e)||t==="coded-value"}async function ne(e,t,a,d=!0){let o=[],s=[],i=[];for(let r of e){let u=function(p){let c=t.get(p)?.layerItem;return c?[c.name&&`Name: ${c.name}`,c.title&&`Title: ${c.title}`,c.description&&`Description: ${c.description}`].filter(Boolean).join(" | "):p},{layerId:n,results:m}=r,g=a.map?.allLayers.find(p=>p.id===n),w=t.get(n)?.fieldRegistry;if(!w)continue;let h=o.find(p=>p.layerId===n);h||(h={layerId:n,layerSummary:u(n),fieldInfos:[]},o.push(h));for(let p of m){let c=w.get(p.name);if(!c)continue;let y=c.statistics,v=d&&!y?.summaryStatistics,q=oe(c.type,c.domain?.type)&&!y?.uniqueValues,C=v||q;if(i.push({layerId:n,fieldName:c.name,didFetchStatistics:C}),C){let J=ie(g,c,{includeSummaryStatistics:v,includeUniqueValues:q}).then(I=>{let x={summaryStatistics:y?.summaryStatistics??null,uniqueValues:y?.uniqueValues??null};v&&(x.summaryStatistics=I.summaryStatistics),q&&(x.uniqueValues=I.uniqueValues),w.set(c.name,{...c,statistics:x}),c.statistics=x});s.push(J)}h.fieldInfos.push(c)}}return await Promise.all(s),{layerFieldInfo:o,didFetchStatistics:s.length>0,fieldStatisticsFetchStatus:i}}var W=/\b(average|avg|mean|median|max(?:imum)?|min(?:imum)?|sum|total|count|std(?:dev|\s*deviation)|variance|null\s*count|missing\s*values?|range)\b/iu;function le(e,t){return W.test(e)||W.test(t)}var de=async(e,t)=>{try{await l({text:"Preparing field information for vector search results"},t);let a=f(t,"layersAndFieldsRegistry"),{mapView:d}=G(t),{assignedTask:o,userRequest:s}=e.agentExecutionContext,i=le(o,s),{layerFieldInfo:r,didFetchStatistics:u,fieldStatisticsFetchStatus:n}=await ne(e.vectorSearchFieldResults,a,d,i);u?await l({text:"Statistics fetched"},t):await l({text:"Statistics skipped"},t);for(let m of n)await l({text:` - ${m.fieldName} - stats ${m.didFetchStatistics?"fetched":"skipped"}`},t);return await l({text:"Field information prepared"},t),{...e,layerFieldInfo:r}}catch(a){throw await l({text:"Error during fetching statistics"},t),new Error(`Error during fetching statistics: ${a instanceof Error?a.message:String(a)}`)}},B=.7,ce=10,ue=async(e,t)=>{try{await l({text:"Similarity search to find fields"},t);let a=f(t,"fieldSearch"),d=f(t,"layersAndFieldsRegistry"),o=f(t,"embeddingCache"),s=await a.searchFields({text:e.agentExecutionContext.assignedTask,layerIds:e.vectorSearchLayerIds,minScore:B,topResults:ce,embeddingCache:o}),i=s.map(({layerId:u,results:n})=>{let m=n.map(g=>` - ${g.name} (${g.score.toFixed(2)})`).join(`
3
+ `);return`${d.get(u)?.layerItem.name??u}:
4
+ ${m}`}).join(`
5
+ `),r;return s.length>0?r=`Vector search completed. Matching layers and fields with scores:
6
+ ${i}`:r=`No vector search results found for score over ${B}.`,await l({text:r},t),{...e,vectorSearchFieldResults:s}}catch(a){throw await l({text:`Error during vector search: ${a instanceof Error?a.message:String(a)}`},t),new Error(`Vector search failed: ${a instanceof Error?a.message:String(a)}`)}},me=.7,ge=async(e,t)=>{try{await l({text:`Similarity search to find layers: ${e.agentExecutionContext.assignedTask}`},t);let a=f(t,"layerSearch"),d=f(t,"layersAndFieldsRegistry"),o=f(t,"embeddingCache"),s=await a.searchLayers({text:e.agentExecutionContext.assignedTask,minScore:me,embeddingCache:o}),i=s.map(n=>n.id),r=s.map(({id:n,score:m})=>`${d.get(n)?.layerItem.name??n} (${m.toFixed(2)})`).join(`
7
+ `),u;return i.length>0?u=`Vector search completed. Matching layers with scores:
8
+ ${r}`:u="Vector search completed. No matching layers found.",await l({text:u},t),{...e,vectorSearchLayerIds:i}}catch(a){throw await l({text:`Error during vector search: ${a instanceof Error?a.message:String(a)}`},t),new Error(`Vector search failed: ${a instanceof Error?a.message:String(a)}`)}},pe=(e,t)=>Q(["layerSearch","fieldSearch","layersAndFieldsRegistry"],"Data Exploration Agent")(e,t),fe=()=>new k(R).addNode("requireDataExplorationServices",pe).addNode("vectorSearchLayers",ge).addNode("vectorSearchFields",ue).addNode("fieldStatistics",de).addNode("queryAgent",ee).addNode("queryTools",U).addNode("summarizeQueryResponseLLM",te).addNode("filterAgent",Z).addNode("filterTools",ae).addNode("earlyExit",Y).addEdge(N,"requireDataExplorationServices").addEdge("requireDataExplorationServices","vectorSearchLayers").addConditionalEdges("vectorSearchLayers",e=>e.vectorSearchLayerIds.length?"vectorSearchFields":"earlyExit").addConditionalEdges("vectorSearchFields",e=>e.vectorSearchFieldResults.length?"fieldStatistics":"earlyExit").addEdge("fieldStatistics","queryAgent").addConditionalEdges("queryAgent",e=>(e.dataExplorationMessages[e.dataExplorationMessages.length-1]?.tool_calls?.length??0)>0?"queryTools":"filterAgent").addConditionalEdges("queryTools",e=>e.queryResponse.length?"summarizeQueryResponseLLM":"filterAgent").addEdge("summarizeQueryResponseLLM","filterAgent").addConditionalEdges("filterAgent",e=>(e.dataExplorationMessages[e.dataExplorationMessages.length-1]?.tool_calls?.length??0)>0?"filterTools":E).addEdge("filterTools",E).addEdge("earlyExit",E),he=String.raw`- **data exploration** — User is asking about the feature layer’s data (e.g. counts, summaries, statistics, field values), either for all features, a subset based on a condition, or for a subset based on the current view. And/Or user wants to include or exclude features based on field values, or visually style features differently (e.g., highlight or deemphasize them).
9
+ The Data Exploration Agent will automatically zoom to the affected features for action taken by this agent. In this case, no need to call navigation tool separately.
10
+ _Example: “Only show stations where Brand is Shell”_
11
+ _Example: “Make Shell stations stand out on the map”_
12
+ _Example: “Gray out all stations that aren’t Shell”_
13
+ This also includes questions that ask which feature meets a given condition or where a particular feature in the data is located (e.g., “Where is the spring with the highest elevation?”). However, this agent does not handle addresses.
14
+ _Example: “How many features are there?”_
15
+ _Example: “What’s the average population?”_
16
+ _Example: “Which values are in the status field?”_`,H={id:"dataExploration",name:"Data Exploration Agent",description:he,createGraph:fe,workspace:R};var b=class extends ${constructor(){super(...arguments),this.agent=H}static{this.properties={referenceElement:1}}#e;getContext(){if(!this.#e)throw new Error("arcgis-assistant-data-exploration-agent requires a mapView");return{mapView:this.#e}}load(){this.#e=D(this,"arcgis-assistant-data-exploration-agent"),O(this)}};A("arcgis-assistant-data-exploration-agent",b);return b},"identity/IdentityManager","portal/Portal","config","core/reactiveUtils","layers/FeatureLayer","request","identity/IdentityManager","portal/Portal","config","core/reactiveUtils","layers/FeatureLayer","request","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","views/LinkChartView","rest/knowledgeGraphService",a,b,c)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{$ as M,A as z,Aa as ia,B as A,Ba as ja,C as B,Ca as ka,Da as la,R as C,S as D,T as E,U as F,V as G,W as H,X as I,Y as J,Z as K,_ as L,a,aa as N,b,ba as O,c,ca as P,d,da as Q,e,f,fa as R,ga as S,h as g,ha as T,i as h,ia as U,j as i,ja as V,k as j,ka as W,l as k,la as X,m as l,ma as Y,n as m,na as Z,o as n,oa as _,p as o,pa as $,q as p,qa as aa,r as q,s as r,t as s,ta as ba,u as t,ua as ca,v as u,va as da,w as v,wa as ea,x as w,xa as fa,y as x,ya as ga,z as y,za as ha}from"./DHKUXLU3.js";import"./CHPQM77M.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export{L as Annotation,H as AsyncBatchedStore,J as BaseChannel,E as BaseCheckpointSaver,k as BaseLangGraphError,G as BaseStore,K as BinaryOperatorAggregate,d as COMMAND_SYMBOL,i as Command,e as CommandInstance,ca as CompiledStateGraph,b as END,v as EmptyChannelError,u as EmptyInputError,R as Graph,l as GraphBubbleUp,o as GraphInterrupt,m as GraphRecursionError,n as GraphValueError,c as INTERRUPT,I as InMemoryStore,w as InvalidUpdateError,F as MemorySaver,da as MessageGraph,ia as MessagesAnnotation,aa as MessagesValue,ja as MessagesZodMeta,ka as MessagesZodState,x as MultipleSubgraphsError,p as NodeInterrupt,g as Overwrite,q as ParentCommand,_ as REMOVE_ALL_MESSAGES,X as ReducedValue,z as RemoteException,a as START,f as Send,ba as StateGraph,A as StateGraphInputError,Z as StateSchema,y as UnreachableNodeError,Y as UntrackedValue,W as UntrackedValueChannel,$ as addMessages,D as copyCheckpoint,C as emptyCheckpoint,ga as entrypoint,O as getConfig,P as getCurrentTaskInput,U as getJsonSchemaFromSchema,ha as getPreviousState,V as getSchemaDefaultGetter,M as getStore,B as getSubgraphsSeenSet,N as getWriter,Q as interrupt,j as isCommand,s as isGraphBubbleUp,t as isGraphInterrupt,h as isInterrupted,r as isParentCommand,T as isSerializableSchema,S as isStandardSchema,$ as messagesStateReducer,ea as pushMessage,fa as task,la as writer};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as u,b as g,c as S}from"./XOH56EQ2.js";import a from"./TR4GFL7X.js";import{b as m,c as f}from"./FUIGPHBH.js";import{u as p}from"./DHKUXLU3.js";import"./CHPQM77M.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([{property:h,subclass:l},{watch:w},d])=>{var v=Object.defineProperty,y=Object.getOwnPropertyDescriptor,o=(t,e,s,r)=>{for(var i=r>1?void 0:r?y(e,s):e,a=t.length-1,c;a>=0;a--)(c=t[a])&&(i=(r?c(e,s,i):c(i))||i);return r&&i&&v(e,s,i),i},n=class extends d{constructor(t){super(t)}initialize(){this.addHandles(w(()=>[this.name,this.description,this.inputSchema,this.outputSchema,this.execute],()=>{this.generate()},{initial:!0,sync:!0}))}getSchemas(){return[this.inputSchema,this.outputSchema].filter(Boolean)}generate(){let t=m(this.getSchemas());this._set("workspace",t);let e=`${this.id}-execute`,s={[e]:this._invokeExecuteNode.bind(this)},r=[{from:e,decide:()=>{}}];this._set("createGraph",()=>f(s,r,t,{agent:this,entryNode:e,middlewares:this.middlewares}))}async _invokeExecuteNode(t,e){try{return this.outputSchema?await this._invokeStructured(t,e):await this._invokeUnstructured(t,e)}catch(s){if(p(s))throw s;let r=s instanceof Error?s.message:String(s);return u({outputMessage:r},"failed",r)}}async _invokeStructured(t,e){if(!this.outputSchema)throw new Error("Output schema is required for structured invocation.");let s=this._validateInputState(t),r=await this.execute(s,e);if(typeof r=="string")throw new Error("Expected execute function to return an object matching the output schema, but received a string.");return g(r,this.outputSchema,t.agentExecutionContext.messages)}async _invokeUnstructured(t,e){let s=this._validateInputState(t),r=await this.execute(s,e),i=typeof r=="string"?r:JSON.stringify(r),a=i.trim()||"FunctionAgent completed.";return u({outputMessage:i},"success",a)}_validateInputState(t){if(!this.inputSchema)return t;let e=this.inputSchema.safeParse(S(t,this.inputSchema));if(!e.success)throw new Error(`FunctionAgent input schema validation failed: ${e.error.message}`);return{...t,...e.data}}};o([h()],n.prototype,"inputSchema",2);o([h()],n.prototype,"outputSchema",2);o([h()],n.prototype,"execute",2);n=o([l("FunctionAgent")],n);return n},"core/accessorSupport/decorators","core/reactiveUtils",a)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{g as C,h as S,n as l,v as R,x as m,z as y}from"./HWKDNS4K.js";import"./YIMNOUTF.js";export default $arcgis.t(([{when:k,watch:u},I,{property:d,subclass:f}])=>{var T=C`.button{--calcite-button-background-color: var(--calcite-color-transparent);--calcite-button-border-color: transparent;--calcite-button-icon-color: var(--calcite-color-text-3);--calcite-button-text-color: var(--calcite-color-text-3);flex:0 0 auto;position:relative}.button[data-state=disabled]{--calcite-button-icon-color: var(--calcite-color-text-3);opacity:var(--calcite-opacity-disabled)}.button[data-state=listening]{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand) 14%, var(--calcite-color-foreground-1) );--calcite-button-border-color: color-mix(in srgb, var(--calcite-color-brand) 24%, transparent);--calcite-button-icon-color: var(--calcite-color-brand);--calcite-button-text-color: var(--calcite-color-brand);box-shadow:var(--calcite-shadow-sm)}.button[data-state=listening]:hover{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand-hover, var(--calcite-color-brand)) 18%, var(--calcite-color-foreground-1) )}.button[data-state=listening]:active{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand) 24%, var(--calcite-color-foreground-1) )}.button[data-state=processing]{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand) 10%, var(--calcite-color-foreground-1) );--calcite-button-border-color: color-mix(in srgb, var(--calcite-color-brand) 20%, transparent);--calcite-button-icon-color: var(--calcite-color-brand);--calcite-button-text-color: var(--calcite-color-brand)}.button[data-state=error]{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-status-danger) 12%, var(--calcite-color-foreground-1) );--calcite-button-border-color: color-mix(in srgb, var(--calcite-color-status-danger) 24%, transparent);--calcite-button-icon-color: var(--calcite-color-status-danger);--calcite-button-text-color: var(--calcite-color-status-danger)}.button[data-state=listening]:after{content:"";position:absolute;inset:-4px;border:1px solid color-mix(in srgb,var(--calcite-color-brand) 40%,transparent);border-radius:inherit;opacity:0;pointer-events:none;transform:scale(.92);animation:assistant-speech-input-recording-pulse 1.8s ease-out infinite}@keyframes assistant-speech-input-recording-pulse{0%{opacity:.65;transform:scale(.92)}70%{opacity:0;transform:scale(1.16)}to{opacity:0;transform:scale(1.16)}}@media(prefers-reduced-motion){.button[data-state=listening]:after{animation:none}}`,x=Object.defineProperty,V=Object.getOwnPropertyDescriptor,p=(e,t,s,i)=>{for(var r=i>1?void 0:i?V(t,s):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(r=(i?o(t,s,r):o(r))||r);return i&&r&&x(t,s,r),r},a=class extends I{constructor(e){super(e),this.state="idle",this.liveTranscript="",this.transcript="",this.errorCode=void 0}static isSupported(){return!1}};p([d()],a.prototype,"language",2);p([d({readOnly:!0})],a.prototype,"state",2);p([d({readOnly:!0})],a.prototype,"liveTranscript",2);p([d({readOnly:!0})],a.prototype,"transcript",2);p([d({readOnly:!0})],a.prototype,"errorCode",2);a=p([f("SpeechController")],a);var O=["audio/webm;codecs=opus","audio/webm","audio/mp4","audio/ogg;codecs=opus","audio/ogg"];function h(e){return e.replace(/\s+/gu," ").trim()}var M=Object.defineProperty,D=Object.getOwnPropertyDescriptor,g=(e,t,s,i)=>{for(var r=i>1?void 0:i?D(t,s):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(r=(i?o(t,s,r):o(r))||r);return i&&r&&M(t,s,r),r},c=class extends a{constructor(e){super(e),this._activeSessionId=null,this._mediaRecorder=null,this._mediaRecorderChunkIndex=0,this._mediaRecorderStopReason=null,this._mediaStream=null,this._pendingChunkOperations=new Set,this._recordedChunks=[],this.handleRecording=null,this.chunkTimeSlice=3e3}get _mimeType(){return typeof window>"u"||typeof window.MediaRecorder?.isTypeSupported!="function"?"":O.find(e=>window.MediaRecorder.isTypeSupported(e))??""}initialize(){c.isSupported()&&this.addHandles(k(()=>!!this.errorCode,()=>{this._set("state","error")}))}destroy(){this._mediaRecorder&&(this._mediaRecorder.onstart=null,this._mediaRecorder.ondataavailable=null,this._mediaRecorder.onerror=null,this._mediaRecorder.onstop=null),this.cancel(),this._mediaRecorder=null}_queuePendingChunkOperation(e){this._pendingChunkOperations.add(e),e.finally(()=>{this._pendingChunkOperations.delete(e)})}async _awaitPendingChunkOperations(){this._pendingChunkOperations.size&&await Promise.allSettled(Array.from(this._pendingChunkOperations))}_onDataAvailable(e){let t=this._activeSessionId;t!=null&&this._queuePendingChunkOperation(this._processDataAvailable(e,t))}async _processDataAvailable(e,t){let s=e.data;if(!s.size||t!==this._activeSessionId)return;this._recordedChunks.push(s);let i=s.type||this._mediaRecorder?.mimeType||this._mimeType,r=this._mediaRecorderStopReason==="toggle"&&this._mediaRecorder?.state==="inactive";try{if(!this.handleRecording)return;let n=h(await this.handleRecording(s,i,this._mediaRecorderChunkIndex,r)??"");if(t!==this._activeSessionId)return;n&&this._set("liveTranscript",h(`${this.liveTranscript} ${n}`))}catch(n){if(t!==this._activeSessionId)return;this._failSession(n instanceof Error&&n.message==="transcription-unavailable"?"transcription-unavailable":"transcription-failed");return}!r&&t===this._activeSessionId&&(this._mediaRecorderChunkIndex+=1)}_failSession(e){let t=this._mediaRecorder;if(t){t.onstart=null,t.ondataavailable=null,t.onerror=null,t.onstop=null;try{t.state!=="inactive"&&t.stop()}catch{}}this._activeSessionId=null,this._mediaRecorder=null,this._mediaRecorderChunkIndex=0,this._mediaRecorderStopReason=null,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._releaseMediaStream(),this._set("liveTranscript",""),this._set("transcript",""),this._set("errorCode",e)}_onError(){this._failSession("recording-failed")}_onStart(){this._set("state","listening")}_onStop(){this._handleStop()}_releaseMediaStream(){this._mediaStream?.getTracks().forEach(e=>e.stop()),this._mediaStream=null}async _handleStop(){let e=this._mediaRecorder,t=this._activeSessionId,s=this._mediaRecorderStopReason,i=e?.mimeType||this._recordedChunks.find(n=>!!n.type)?.type||"",r=[...this._recordedChunks];if(this._mediaRecorder=null,this._mediaRecorderChunkIndex=0,this._releaseMediaStream(),s==="cancel"){this._activeSessionId===t&&(this._activeSessionId=null),this._mediaRecorderStopReason=null,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._set("liveTranscript",""),this._set("transcript",""),this._set("state","idle"),this._set("errorCode",void 0);return}if(t==null){this._mediaRecorderStopReason=null,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._set("state","idle"),this._set("errorCode",void 0);return}if(await this._awaitPendingChunkOperations(),t===this._activeSessionId){if(!(i?new Blob(r,{type:i}):new Blob(r)).size){this._activeSessionId===t&&(this._activeSessionId=null),this._mediaRecorderStopReason=null,this._recordedChunks=[],this._set("errorCode","recording-failed");return}this._set("state","processing"),this._set("transcript",h(`${this.transcript} ${this.liveTranscript}`)),this._set("liveTranscript",""),this._activeSessionId===t&&(this._activeSessionId=null),this._set("state","idle"),this._set("errorCode",void 0),this._mediaRecorderStopReason=null,this._recordedChunks=[]}}start(){if(!c.isSupported()){this._set("errorCode","not-supported");return}let e=Date.now();this._activeSessionId=e,this._mediaRecorderChunkIndex=0,this._mediaRecorderStopReason=null,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._set("liveTranscript",""),this._set("transcript",""),this._set("errorCode",void 0),navigator.mediaDevices.getUserMedia({audio:!0}).then(t=>{if(e!==this._activeSessionId){t.getTracks().forEach(r=>r.stop());return}let s=this._mimeType,i=s?new window.MediaRecorder(t,{mimeType:s}):new window.MediaRecorder(t);this._mediaStream=t,this._mediaRecorder=i,this._mediaRecorderChunkIndex=0,this._mediaRecorderStopReason=null,this._recordedChunks=[],i.ondataavailable=this._onDataAvailable.bind(this),i.onerror=this._onError.bind(this),i.onstart=this._onStart.bind(this),i.onstop=this._onStop.bind(this),this._mediaRecorder.start(this.chunkTimeSlice)}).catch(t=>{e===this._activeSessionId&&(this._activeSessionId=null,this._mediaRecorder=null,this._mediaRecorderChunkIndex=0,this._mediaRecorderStopReason=null,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._releaseMediaStream(),t instanceof DOMException&&t.name==="NotAllowedError"?this._set("errorCode","not-allowed"):this._set("errorCode","recording-failed"))})}stop(){if(this._mediaRecorder){this._mediaRecorderStopReason="toggle";try{this._mediaRecorder.state!=="inactive"?this._mediaRecorder.stop():this._handleStop()}catch{}}}cancel(){let e=this._mediaRecorder;if(this._activeSessionId=null,this._mediaRecorderStopReason="cancel",this._mediaRecorderChunkIndex=0,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._set("liveTranscript",""),this._set("transcript",""),this._set("state","idle"),this._set("errorCode",void 0),!e){this._releaseMediaStream();return}try{if(e.state!=="inactive"){e.stop();return}}catch{}this._mediaRecorder=null,this._releaseMediaStream()}static isSupported(){return typeof window<"u"&&!!(window.MediaRecorder&&navigator.mediaDevices?.getUserMedia)}};g([d()],c.prototype,"_mimeType",1);g([d()],c.prototype,"handleRecording",2);g([d()],c.prototype,"chunkTimeSlice",2);c=g([f("MediaRecorderController")],c);var $=Object.getOwnPropertyDescriptor,E=(e,t,s,i)=>{for(var r=i>1?void 0:i?$(t,s):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(r=o(r)||r);return r};function w(){if(typeof window>"u")return null;let e=window;return e.SpeechRecognition??e.webkitSpeechRecognition??null}var _=class extends a{constructor(e){super(e),this._isCancelled=!1,this._recognition=null}initialize(){let e=w();if(!e)return;let t=new e;t.continuous=!0,t.interimResults=!0,this.language&&(t.lang=this.language),t.onstart=this._onStart.bind(this),t.onresult=this._onResult.bind(this),t.onerror=this._onError.bind(this),t.onend=this._onEnd.bind(this),t.onspeechend=this._onSpeechEnd.bind(this),this._recognition=t,this.addHandles(k(()=>!!this.errorCode,()=>{this._set("state","error")}))}destroy(){this._recognition&&(this._recognition.onstart=null,this._recognition.onresult=null,this._recognition.onerror=null,this._recognition.onend=null,this._recognition.onspeechend=null,this.cancel(),this._recognition=null)}_onStart(){this._isCancelled=!1,this._set("state","listening")}_onResult(e){let{finalTranscript:t,liveTranscript:s}=Array.from(e.results).reduce((i,r)=>(r.isFinal?i.finalTranscript+=r[0].transcript:i.liveTranscript+=r[0].transcript,i),{finalTranscript:"",liveTranscript:""});this._set("transcript",h(t)),this._set("liveTranscript",h(s))}_onError(e){if(e.error==="aborted"&&this._isCancelled){this._set("state","idle");return}let t="unhandled";switch(e.error){case"no-speech":t="no-speech";break;case"service-not-allowed":case"not-allowed":t="not-allowed";break;default:t="unhandled"}this._set("errorCode",t)}_onEnd(){let e=h(`${this.transcript} ${this.liveTranscript}`);if(this._set("liveTranscript",""),this._isCancelled){this._set("transcript",""),this._set("state","idle"),this._set("errorCode",void 0);return}this.errorCode?this._set("transcript",""):(this._set("transcript",e),this._set("state","idle")),this._set("errorCode",void 0)}_onSpeechEnd(){this._set("state","processing")}_reset(e=!1){this._isCancelled=e,this._set("liveTranscript",""),this._set("transcript",""),this._set("errorCode",void 0),this._set("state","idle")}start(){if(!this._recognition){this._set("errorCode","not-supported");return}this._reset(!1);try{this._recognition.start()}catch{this._set("errorCode","unhandled")}}stop(){if(this._recognition){this._set("state","processing");try{this._recognition.stop()}catch{}}}cancel(){if(this._recognition){this._reset(!0);try{this._recognition.abort()}catch{}}}static isSupported(){return!!w()}};_=E([f("WebSpeechController")],_);function b(e){let{baseValue:t,transcript:s}=e;if(!s)return t;let i=t.trim();return i?`${i} ${s}`:s}var v=class extends R{constructor(){super(...arguments),this.#t=null,this._resolvedMode="disabled",this.awaitingResponse=!1,this.inputValue="",this.mode="web-speech",this.arcgisVoiceInputDraftChange=l(),this.arcgisVoiceInputError=l(),this.arcgisVoiceInputInterimTranscription=l(),this.arcgisVoiceInputStart=l(),this.arcgisVoiceInputStop=l(),this.arcgisVoiceInputTranscription=l(),this.arcgisVoiceInputTranscriptionStreamChunk=l()}static{this.properties={_resolvedMode:16,_state:16,_errorCode:16,_liveTranscript:16,_transcript:16,_isButtonDisabled:16,_buttonLabel:16,awaitingResponse:5,inputValue:1,language:1,mode:1}}static{this.styles=T}#t;get _state(){return this._speechController?.state??"idle"}get _errorCode(){return this._speechController?.errorCode??null}get _liveTranscript(){return this._speechController?.liveTranscript??""}get _transcript(){return this._speechController?.transcript??""}get _isButtonDisabled(){return this._resolvedMode==="disabled"||this.awaitingResponse||this._state==="processing"}get _buttonLabel(){if(this.awaitingResponse)return"Voice input unavailable while assistant is responding";if(this._resolvedMode==="disabled")return"Voice input unavailable";switch(this._state){case"error":return this._errorCode==="not-allowed"?"Microphone permission denied. Retry voice input":"Retry voice input";case"listening":return"Stop voice input";case"processing":return"Processing voice input";default:return"Start voice input"}}clearDraftSession(){this.#t=null}loaded(){this.manager.onLifecycle(()=>[u(()=>[this.mode,this.language],()=>{this._configureController()},{initial:!0}),u(()=>this.awaitingResponse,t=>{t&&this._cancelActiveSession()},{initial:!0}),u(()=>this._liveTranscript,t=>{if(t){let s=h(`${this._transcript} ${t}`);this.arcgisVoiceInputInterimTranscription.emit({transcript:s}),this._applyVoiceInputTranscript(s)}}),u(()=>this._transcript,t=>{t&&(this.arcgisVoiceInputTranscription.emit({transcript:t}),this._applyVoiceInputTranscript(t,{final:!0}))}),u(()=>this._state,t=>{t==="error"&&this._errorCode&&this.arcgisVoiceInputError.emit({errorCode:this._errorCode})})])}disconnectedCallback(){super.disconnectedCallback(),this._destroySpeechController()}_configureController(){let t=this._resolveMode();this._destroySpeechController(),this._resolvedMode=t,t!=="disabled"&&(this._speechController=t==="web-speech"?new _({language:this.language}):new c({language:this.language,handleRecording:this._handleRecording.bind(this)}))}_destroySpeechController(){this._speechController?.cancel(),this._speechController?.destroy(),this._speechController=void 0}_emitDraftChange(t,s){this.arcgisVoiceInputDraftChange.emit({focusInput:s?.focusInput,value:t})}_startVoiceInputSession(){this.#t={baseValue:this.inputValue.trim(),phase:"listening",transcript:""}}_finishVoiceInputSession(){let t=this.#t;if(!t){this._emitDraftChange(this.inputValue.trim());return}let s={...t,phase:"stopped"},i=b(s);this.#t=s,this._emitDraftChange(i)}async _applyVoiceInputTranscript(t,s){let i=this.#t;if(!t||!i)return;if(i.phase==="stopped"){let o=b(i);if(this.inputValue.trim()!==o){this.clearDraftSession();return}}let r={...i,transcript:t},n=b(r);this.#t=r,this._emitDraftChange(n,{focusInput:s?.final&&r.phase==="stopped"})}async _handleToggle(){if(!(this._isButtonDisabled||!this._speechController)){if(this._state==="listening"){this._speechController.stop(),this._finishVoiceInputSession(),this.arcgisVoiceInputStop.emit();return}this._speechController.start(),this._startVoiceInputSession(),this.arcgisVoiceInputStart.emit()}}async _handleRecording(t,s,i,r){let n;return this.arcgisVoiceInputTranscriptionStreamChunk.emit({blob:t,chunkIndex:i,isFinal:r,mimeType:s,respondWithTranscript:o=>{n=o}}),n}_resolveMode(){return this.mode==="disabled"?"disabled":this.mode==="web-speech"&&_.isSupported()?"web-speech":c.isSupported()?"media-recorder":"disabled"}async _cancelActiveSession(){this._speechController&&this._resolvedMode!=="disabled"&&this._speechController.cancel(),this.clearDraftSession()}render(){return S`<calcite-button appearance=transparent class="button" data-mode=${this._resolvedMode??m} data-state=${(this._resolvedMode==="disabled"?"disabled":this._state)??m} .disabled=${this._isButtonDisabled} icon-start=microphone kind=neutral .label=${this._buttonLabel} .loading=${this._state==="processing"} round scale=m @click=${()=>{this._handleToggle()}}></calcite-button>`}};y("arcgis-assistant-speech-input",v);return v},"core/reactiveUtils","core/Accessor","core/accessorSupport/decorators")
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import a from"./3VOQD2MR.js";import"./FUIGPHBH.js";import"./DHKUXLU3.js";import"./CHPQM77M.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([{property:l,subclass:w},{c:p,d:d}])=>{var y=Object.defineProperty,m=Object.getOwnPropertyDescriptor,f=e=>{throw TypeError(e)},h=(e,t,o,n)=>{for(var r=n>1?void 0:n?m(t,o):t,s=e.length-1,g;s>=0;s--)(g=e[s])&&(r=(n?g(t,o,r):g(r))||r);return n&&r&&y(t,o,r),r},k=(e,t,o)=>t.has(e)||f("Cannot "+o),b=(e,t,o)=>t.has(e)?f("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,o),c=(e,t,o)=>(k(e,t,"access private method"),o),a,i,u=class extends d{constructor(e){super(e),b(this,a)}getAgents(){return c(this,a,i).call(this),[this.routerAgent,...Object.values(this.agentsMap)]}buildEdges(e){c(this,a,i).call(this);let t=p(this.routerAgent,0),o=new Map;for(let[n,[r]]of Object.entries(this.agentsMap).entries())o.set(r,p(e[n+1],n+1));return[{from:t,decide:n=>{let r=n[this.routerOutputKey];if(typeof r!="string"||!r)throw new Error("RouterWorkflow decideRoute could not determine next agent from state.");let s=o.get(r);if(!s)throw new Error(`RouterWorkflow decideRoute returned unknown agent: ${r}. Expected one of: ${Object.keys(this.agentsMap).join(", ")||"(none)"}.`);return s}}]}getEntryNode(){return c(this,a,i).call(this),p(this.routerAgent,0)}isTerminalAgent(e,t){return t>0}validateAgents(e){c(this,a,i).call(this),super.validateAgents(e)}};a=new WeakSet;i=function(){if(!Object.keys(this.agentsMap).length)throw new Error("RouterWorkflow requires a non-empty agentsMap.")};h([l()],u.prototype,"agentsMap",2);h([l()],u.prototype,"routerAgent",2);h([l()],u.prototype,"routerOutputKey",2);u=h([w("RouterWorkflow")],u);return u},"core/accessorSupport/decorators",a)
@@ -1,20 +1,20 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import b from"./FHVXO2WG.js";import a from"./GSEPHN3A.js";import{Fb as C,a as N,b as T}from"./462JBSEV.js";import{a as L,c as R}from"./HB5A5R2E.js";import"./AMP6IALT.js";import"./OAVEHGB6.js";import{v as E,y as $}from"./OH64RMOR.js";import"./YIMNOUTF.js";export default $arcgis.t(([,,,,,,,,,,,,,,,{a:f,f:d,l:b,m:F},{a:_,b:v,c:x,d:I,e:A,f:M,g:Z,h:q,i:j,j:V,k:O,l:z,m:S,n:G,o:h,p:B}])=>{var w=[I,A,M,Z,q,j,V,O,z];async function H(e,t){let a=await S("navigation_tool_prompt"),{mapView:r}=x(t),l=r.map.bookmarks?.map(p=>p.name).filter(Boolean)??[],i=e.vectorSearchLayerResults?.length>0?e.vectorSearchLayerResults.map((p,W)=>`${W+1}. layerId=${p.id} | title=${p.title??""} | name=${p.name??""} | score=${p.score.toFixed(2)}`).join(`
3
- `):"",c=e.vectorSearchFieldResults?.length>0?JSON.stringify(e.vectorSearchFieldResults,null,2):"",n=e.intent==="goToBookmark"&&l.length?`Available bookmarks:
2
+ import c from"./R56X6ZKR.js";import a from"./T43LEBBE.js";import{a as L,c as R}from"./RUURNLTP.js";import"./5W7S2RS4.js";import"./NXKKG5TK.js";import{v as E,z as $}from"./HWKDNS4K.js";import{a as d}from"./P7DG5T3Z.js";import"./BX7FSMUU.js";import{a as N,b as T,ta as b}from"./DHKUXLU3.js";import"./CHPQM77M.js";import{a as f}from"./WNS5ZUF5.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([,,,,,,,,,,,,,,,,,{k:C,l:F},{a:_,b:v,c:x,d:I,e:A,f:M,g:Z,h:q,i:j,j:V,k:O,l:z,m:S,n:G,o:h,p:B}])=>{var w=[I,A,M,Z,q,j,V,O,z];async function H(e,t){let a=await S("navigation_tool_prompt"),{mapView:n}=x(t),l=n.map.bookmarks?.map(p=>p.name).filter(Boolean)??[],s=e.vectorSearchLayerResults?.length>0?e.vectorSearchLayerResults.map((p,W)=>`${W+1}. layerId=${p.id} | title=${p.title??""} | name=${p.name??""} | score=${p.score.toFixed(2)}`).join(`
3
+ `):"",c=e.vectorSearchFieldResults?.length>0?JSON.stringify(e.vectorSearchFieldResults,null,2):"",r=e.intent==="goToBookmark"&&l.length?`Available bookmarks:
4
4
  ${l.map(p=>`- ${p}`).join(`
5
5
  `)}`:"",o=(e.intent==="goToLayer"||e.intent==="goToFeatures")&&e.vectorSearchLayerResults?.length?`Candidate layers:
6
- ${i}`:"",m=e.intent==="goToFeatures"&&e.vectorSearchFieldResults?.length?`Candidate fields:
7
- ${c}`:"",u={intent:e.intent,bookmarksSection:n,layersSection:o,fieldsSection:m,currentZoom:r.zoom,assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps},s=await F({promptText:a,modelTier:"fast",inputVariables:u,tools:w}),g=(s.tool_calls?.length??0)>0,y=typeof s.text=="string"?s.text.trim():"",P=y.length>0;return{...e,navigationInternalState:{...e.navigationInternalState,toolCallMessage:g?s:void 0},outputMessage:g?e.outputMessage:y,status:g?e.status:P?"success":"failed"}}var K=e=>{let t=typeof e=="string"?e:String(e);try{let a=JSON.parse(t);if(a&&typeof a=="object"&&typeof a.text=="string")return a}catch{console.warn("Failed to parse tool response as JSON:",t)}return{text:t}};async function Q(e,t){let a=new _(w);try{let r=e.navigationInternalState.toolCallMessage;if(!r)throw new Error("navigationToolCalling: missing navigationInternalState.toolCallMessage");let{messages:l}=await a.invoke({messages:[r]},t),i="",c;for(let n of l){let o=K(n.content);o.text&&(i+=`${o.text}
8
- `),o.sharedStatePatch&&(c={...c,...o.sharedStatePatch})}return await d({text:`Finished executing navigation tool: ${i}`},t),{...e,outputMessage:i,sharedStatePatch:c,status:"success",summary:i?G(i):"Navigation executed.",navigationInternalState:{...e.navigationInternalState,toolCallMessage:void 0}}}catch(r){let l=r instanceof Error?r.message:String(r);return await d({text:`Navigation tool execution failed: ${l}`},t),{...e,outputMessage:`Navigation tool execution failed: ${l}`,status:"failed",summary:`Navigation tool execution failed: ${l}`,navigationInternalState:{...e.navigationInternalState,toolCallMessage:void 0}}}}async function U(e,t){let a=await S("navigation_intent_prompt"),{mapView:r}=x(t),l=w.map(s=>({name:s.name,description:s.description,schema:s.schema})),i=r.map.bookmarks?.map(s=>s.name).filter(Boolean)??[],c=i.length?`Available bookmarks:
9
- ${i.map(s=>`- ${s}`).join(`
10
- `)}`:"",n={tools:l.map(({name:s,description:g,schema:y})=>`${s}: ${g}, ${JSON.stringify(y)}`).join(`
11
- `),bookmarks:c,assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps},o=f.object({intent:f.string()}),m=await b({promptText:a,inputVariables:n,schema:o,modelTier:"fast"}),u=typeof m.intent=="string"?m.intent.trim().replace(/^"|"$/gu,""):"";return{...e,intent:u||""}}var X=.7,Y=async(e,t)=>{try{await d({text:`Similarity search to find layers: ${e.agentExecutionContext.assignedTask}`},t);let a=h(t,"layerSearch"),r=h(t,"layersAndFieldsRegistry"),l=h(t,"embeddingCache"),i=(await a.searchLayers({text:e.agentExecutionContext.assignedTask,minScore:X,embeddingCache:l})).map(({id:n,score:o})=>{let m=r.get(n)?.layerItem;return{id:n,title:m?.title,name:m?.name??void 0,score:o}}),c;return i.length>0?c=`Vector search completed. Matching layers:
12
- ${i.map(n=>`- layerId=${n.id} | title=${n.title??""} | name=${n.name??""} | score=${n.score.toFixed(2)}`).join(`
13
- `)}`:c="Vector search completed. No matching layers found.",await d({text:c},t),{...e,vectorSearchLayerResults:i}}catch(a){throw await d({text:`Error during vector search layers: ${a instanceof Error?a.message:String(a)}`},t),a}},D=.7,ee=10,te=async(e,t)=>{try{await d({text:`Similarity search to find fields: ${e.agentExecutionContext.assignedTask}`},t);let a=h(t,"fieldSearch"),r=h(t,"layersAndFieldsRegistry"),l=h(t,"embeddingCache"),i=e.vectorSearchLayerResults?.map(o=>o.id)??[];if(i.length===0)return await d({text:"No candidate layers for field search"},t),e;let c=(await a.searchFields({text:e.agentExecutionContext.assignedTask,layerIds:i,minScore:D,topResults:ee,embeddingCache:l})).map(({layerId:o,results:m})=>{let u=r.get(o)?.fieldRegistry;return{layerId:o,layerName:r.get(o)?.layerItem.name,results:m.map(s=>{let g=u?.get(s.name);return{name:s.name,score:s.score,type:g?.type,alias:g?.alias,description:g?.description,statistics:g?.statistics}})}}),n;return c.length>0?n=`Vector search completed. Matching layers and fields:
6
+ ${s}`:"",m=e.intent==="goToFeatures"&&e.vectorSearchFieldResults?.length?`Candidate fields:
7
+ ${c}`:"",u={intent:e.intent,bookmarksSection:r,layersSection:o,fieldsSection:m,currentZoom:n.zoom,assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps},i=await F({promptText:a,modelTier:"fast",config:t,inputVariables:u,tools:w}),g=(i.tool_calls?.length??0)>0,y=typeof i.text=="string"?i.text.trim():"",P=y.length>0;return{...e,navigationInternalState:{...e.navigationInternalState,toolCallMessage:g?i:void 0},outputMessage:g?e.outputMessage:y,status:g?e.status:P?"success":"failed"}}var K=e=>{let t=typeof e=="string"?e:String(e);try{let a=JSON.parse(t);if(a&&typeof a=="object"&&typeof a.text=="string")return a}catch{console.warn("Failed to parse tool response as JSON:",t)}return{text:t}};async function Q(e,t){let a=new _(w,{handleToolErrors:!1});try{let n=e.navigationInternalState.toolCallMessage;if(!n)throw new Error("navigationToolCalling: missing navigationInternalState.toolCallMessage");let{messages:l}=await a.invoke({messages:[n]},t),s="",c;for(let r of l){let o=K(r.content);o.text&&(s+=`${o.text}
8
+ `),o.sharedStatePatch&&(c={...c,...o.sharedStatePatch})}return await d({text:`Finished executing navigation tool: ${s}`},t),{...e,outputMessage:s,sharedStatePatch:c,status:"success",summary:s?G(s):"Navigation executed.",navigationInternalState:{...e.navigationInternalState,toolCallMessage:void 0}}}catch(n){let l=n instanceof Error?n.message:String(n);return await d({text:`Navigation tool execution failed: ${l}`},t),{...e,outputMessage:`Navigation tool execution failed: ${l}`,status:"failed",summary:`Navigation tool execution failed: ${l}`,navigationInternalState:{...e.navigationInternalState,toolCallMessage:void 0}}}}async function U(e,t){let a=await S("navigation_intent_prompt"),{mapView:n}=x(t),l=w.map(i=>({name:i.name,description:i.description,schema:i.schema})),s=n.map.bookmarks?.map(i=>i.name).filter(Boolean)??[],c=s.length?`Available bookmarks:
9
+ ${s.map(i=>`- ${i}`).join(`
10
+ `)}`:"",r={tools:l.map(({name:i,description:g,schema:y})=>`${i}: ${g}, ${JSON.stringify(y)}`).join(`
11
+ `),bookmarks:c,assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps},o=f.object({intent:f.string()}),m=await C({promptText:a,config:t,inputVariables:r,schema:o,modelTier:"fast"}),u=typeof m.intent=="string"?m.intent.trim().replace(/^"|"$/gu,""):"";return{...e,intent:u||""}}var X=.7,Y=async(e,t)=>{try{await d({text:`Similarity search to find layers: ${e.agentExecutionContext.assignedTask}`},t);let a=h(t,"layerSearch"),n=h(t,"layersAndFieldsRegistry"),l=h(t,"embeddingCache"),s=(await a.searchLayers({text:e.agentExecutionContext.assignedTask,minScore:X,embeddingCache:l})).map(({id:r,score:o})=>{let m=n.get(r)?.layerItem;return{id:r,title:m?.title,name:m?.name??void 0,score:o}}),c;return s.length>0?c=`Vector search completed. Matching layers:
12
+ ${s.map(r=>`- layerId=${r.id} | title=${r.title??""} | name=${r.name??""} | score=${r.score.toFixed(2)}`).join(`
13
+ `)}`:c="Vector search completed. No matching layers found.",await d({text:c},t),{...e,vectorSearchLayerResults:s}}catch(a){throw await d({text:`Error during vector search layers: ${a instanceof Error?a.message:String(a)}`},t),a}},D=.7,ee=10,te=async(e,t)=>{try{await d({text:`Similarity search to find fields: ${e.agentExecutionContext.assignedTask}`},t);let a=h(t,"fieldSearch"),n=h(t,"layersAndFieldsRegistry"),l=h(t,"embeddingCache"),s=e.vectorSearchLayerResults?.map(o=>o.id)??[];if(s.length===0)return await d({text:"No candidate layers for field search"},t),e;let c=(await a.searchFields({text:e.agentExecutionContext.assignedTask,layerIds:s,minScore:D,topResults:ee,embeddingCache:l})).map(({layerId:o,results:m})=>{let u=n.get(o)?.fieldRegistry;return{layerId:o,layerName:n.get(o)?.layerItem.name,results:m.map(i=>{let g=u?.get(i.name);return{name:i.name,score:i.score,type:g?.type,alias:g?.alias,description:g?.description,statistics:g?.statistics}})}}),r;return c.length>0?r=`Vector search completed. Matching layers and fields:
14
14
  ${c.map(o=>`${o.layerName??o.layerId}:
15
15
  ${o.results.map(m=>` - ${m.name} (${m.score.toFixed(2)})`).join(`
16
16
  `)}`).join(`
17
- `)}`:n=`No vector search field results found for score over ${D}.`,await d({text:n},t),{...e,vectorSearchFieldResults:c}}catch(a){throw await d({text:`Error during vector search fields: ${a instanceof Error?a.message:String(a)}`},t),a}},ae=(e,t)=>B(["layerSearch","layersAndFieldsRegistry"],"Navigation Agent")(e,t),oe=()=>new C(v).addNode("requireNavigationServices",ae).addNode("intentLLM",U).addNode("vectorSearchLayers",Y).addNode("vectorSearchFields",te).addNode("agent",H).addNode("tools",Q).addEdge(N,"requireNavigationServices").addEdge("requireNavigationServices","intentLLM").addConditionalEdges("intentLLM",e=>e.intent==="goToLayer"||e.intent==="goToFeatures"?"vectorSearchLayers":"agent",{vectorSearchLayers:"vectorSearchLayers",agent:"agent"}).addConditionalEdges("vectorSearchLayers",e=>e.intent==="goToFeatures"?"vectorSearchFields":"agent",{vectorSearchFields:"vectorSearchFields",agent:"agent"}).addEdge("vectorSearchFields","agent").addEdge("agent","tools").addEdge("tools",T),se=String.raw`- **navigation** — Enables users to interact with the map by navigating to specific locations, layers, features, or extents.
17
+ `)}`:r=`No vector search field results found for score over ${D}.`,await d({text:r},t),{...e,vectorSearchFieldResults:c}}catch(a){throw await d({text:`Error during vector search fields: ${a instanceof Error?a.message:String(a)}`},t),a}},ae=(e,t)=>B(["layerSearch","layersAndFieldsRegistry"],"Navigation Agent")(e,t),oe=()=>new b(v).addNode("requireNavigationServices",ae).addNode("intentLLM",U).addNode("vectorSearchLayers",Y).addNode("vectorSearchFields",te).addNode("agent",H).addNode("tools",Q).addEdge(N,"requireNavigationServices").addEdge("requireNavigationServices","intentLLM").addConditionalEdges("intentLLM",e=>e.intent==="goToLayer"||e.intent==="goToFeatures"?"vectorSearchLayers":"agent",{vectorSearchLayers:"vectorSearchLayers",agent:"agent"}).addConditionalEdges("vectorSearchLayers",e=>e.intent==="goToFeatures"?"vectorSearchFields":"agent",{vectorSearchFields:"vectorSearchFields",agent:"agent"}).addEdge("vectorSearchFields","agent").addEdge("agent","tools").addEdge("tools",T),ie=String.raw`- **navigation** — Enables users to interact with the map by navigating to specific locations, layers, features, or extents.
18
18
  This includes zooming, panning, centering, or geocoding based on user input. The agent is designed to handle explicit map movement requests. NOTE: DO NOT call this agent if the user asks "show me...", that is meant to be handled by another agent. If the query is about where a certain address is, call this agent.
19
19
 
20
20
  Supported actions:
@@ -33,4 +33,4 @@ ${o.results.map(m=>` - ${m.name} (${m.score.toFixed(2)})`).join(`
33
33
  _Example: “Center the map on San Francisco at scale 50000”_
34
34
  _Example: “Zoom to the features in the schools layer where city = 'Austin'”_
35
35
  _Example: “Go to the Downtown bookmark”_
36
- _Example: “Where is Mount Rainier?”_`,J={id:"navigation",name:"Navigation Agent",description:se,createGraph:oe,workspace:v};var k=class extends E{constructor(){super(...arguments),this.agent=J}static{this.properties={referenceElement:1}}#e;getContext(){if(!this.#e)throw new Error("arcgis-assistant-navigation-agent requires a mapView");return{mapView:this.#e}}load(){this.#e=L(this,"arcgis-assistant-navigation-agent"),R(this)}};$("arcgis-assistant-navigation-agent",k);return k},"identity/IdentityManager","portal/Portal","core/reactiveUtils","layers/FeatureLayer","request","identity/IdentityManager","portal/Portal","core/reactiveUtils","layers/FeatureLayer","request","intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","views/LinkChartView","rest/knowledgeGraphService",a,b)
36
+ _Example: “Where is Mount Rainier?”_`,J={id:"navigation",name:"Navigation Agent",description:ie,createGraph:oe,workspace:v};var k=class extends E{constructor(){super(...arguments),this.agent=J}static{this.properties={referenceElement:1}}#e;getContext(){if(!this.#e)throw new Error("arcgis-assistant-navigation-agent requires a mapView");return{mapView:this.#e}}load(){this.#e=L(this,"arcgis-assistant-navigation-agent"),R(this)}};$("arcgis-assistant-navigation-agent",k);return k},"identity/IdentityManager","portal/Portal","config","core/reactiveUtils","layers/FeatureLayer","request","identity/IdentityManager","portal/Portal","config","core/reactiveUtils","layers/FeatureLayer","request","intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","views/LinkChartView","rest/knowledgeGraphService",a,c)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import a from"./3VOQD2MR.js";import"./FUIGPHBH.js";import"./DHKUXLU3.js";import"./CHPQM77M.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([{property:g,subclass:p},{c:d,d:u}])=>{var f=Object.defineProperty,w=Object.getOwnPropertyDescriptor,c=(e,r,n,o)=>{for(var t=o>1?void 0:o?w(r,n):r,i=e.length-1,a;i>=0;i--)(a=e[i])&&(t=(o?a(r,n,t):a(t))||t);return o&&t&&f(r,n,t),t},s=class extends u{constructor(e){super(e)}getAgents(){return this.agents}buildNodes(e){let r=super.buildNodes(e);return r[l]=()=>({}),r}buildEdges(e){let r=this.condition;if(!r)throw new Error("ConditionalWorkflow requires a condition.");let n=d(e[0],0),o=d(e[1],1);return[{from:l,decide:async(t,i)=>await Promise.resolve(r(t,i))?n:o}]}getEntryNode(){return l}isTerminalAgent(){return!0}validateAgents(e){if(super.validateAgents(e),e.length!==2)throw new Error(`ConditionalWorkflow requires exactly 2 agents; received ${e.length}.`)}};c([g()],s.prototype,"condition",2);c([g()],s.prototype,"agents",2);s=c([p("ConditionalWorkflow")],s);var l="__conditional_decide";return s},"core/accessorSupport/decorators",a)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{g as e,h as a,v as s,z as i}from"./HWKDNS4K.js";import"./YIMNOUTF.js";var r=e`.container{display:flex;align-items:center;gap:var(--calcite-spacing-md);background:color-mix(in srgb,var(--calcite-color-brand) 15%,var(--calcite-color-foreground-1));color:var(--calcite-color-text-1);padding:var(--calcite-spacing-md);border-radius:var(--calcite-border-radius);width:fit-content;margin-left:auto;justify-content:flex-end}.avatar{display:flex;align-items:center;justify-content:center}@container (min-width: 480px){.container{max-width:80%}}`,t=class extends s{static{this.properties={content:1,user:1,message:0}}static{this.styles=r}_getContent(){return this.message?.role==="user"?this.message.content:this.content}render(){return a`<div class="container"><div><slot name=content>${this._getContent()}</slot></div><slot name=icon><div class="avatar"><calcite-avatar .fullName=${this.user} scale=s></calcite-avatar></div></slot></div>`}};i("arcgis-assistant-user-message",t);export{t as ArcgisAssistantUserMessage};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as u,b as S,c as v}from"./XOH56EQ2.js";import b from"./TR4GFL7X.js";import{b as f,c as y}from"./FUIGPHBH.js";import a from"./T43LEBBE.js";import"./P7DG5T3Z.js";import{c as d}from"./DXVU45KM.js";import{b as c}from"./BX7FSMUU.js";import{O as g,u as l}from"./DHKUXLU3.js";import"./CHPQM77M.js";import"./WNS5ZUF5.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([,,{watch:T},,,{property:m,subclass:_},{f:h},w])=>{var k=Object.defineProperty,x=Object.getOwnPropertyDescriptor,a=(e,s,t,r)=>{for(var o=r>1?void 0:r?x(s,t):s,n=e.length-1,p;n>=0;n--)(p=e[n])&&(o=(r?p(s,t,o):p(o))||o);return r&&o&&k(s,t,o),o},i=class extends w{constructor(e){super(e),this.modelTier="default"}initialize(){this.addHandles(T(()=>[this.description,this.inputSchema,this.modelTier,this.name,this.outputSchema,this.prompt,this.tools],()=>{this.generate()},{initial:!0,sync:!0}))}getSchemas(){return[this.inputSchema,this.outputSchema].filter(Boolean)}generate(){let e=f(this.getSchemas());this._set("workspace",e);let s=this.id,t={[s]:this._invoke.bind(this)},r=[{from:s,decide:()=>{}}];this._set("createGraph",()=>y(t,r,e,{agent:this,entryNode:s,middlewares:this.middlewares}))}async _invoke(e,s){try{return this.outputSchema?await this._invokeStructured(e,s):await this._invokeUnstructured(e,s)}catch(t){if(l(t))throw t;let r=t instanceof Error?t.message:String(t);return u({outputMessage:r},"failed",r)}}async _invokeStructured(e,s){if(!this.outputSchema)throw new Error("Output schema is required for structured invocation.");let t=await c({model:await h({modelTier:this.modelTier}),systemPrompt:await this._getPromptWithInputVariables(e),tools:this._getTools(),checkpointer:!0,middleware:d(this.middlewares),responseFormat:this.outputSchema}).invoke({messages:e.agentExecutionContext.messages},s);if(!("structuredResponse"in t)||t.structuredResponse===void 0)throw new Error("LLMAgent did not receive structured output from createAgent.");return S(t.structuredResponse,this.outputSchema,t.messages)}async _invokeUnstructured(e,s){let t=(await c({model:await h({modelTier:this.modelTier}),systemPrompt:await this._getPromptWithInputVariables(e),tools:this._getTools(),checkpointer:!0,middleware:d(this.middlewares)}).invoke({messages:e.agentExecutionContext.messages},s)).messages,r=t.at(-1)?.content??"",o=typeof r=="string"?r:JSON.stringify(r),n=o.trim()||"LLMAgent completed.";return u({agentExecutionContext:{...e.agentExecutionContext,messages:t},outputMessage:o},"success",n)}async _getPromptWithInputVariables(e){let s=v(e,this.inputSchema);for(let{outputKey:t}of this.middlewares)t&&(s[String(t)]=e[t]);return await g.fromTemplate(this.prompt).format(s)}_getTools(){return this.tools?.map(e=>e.getTool())??[]}};a([m()],i.prototype,"prompt",2);a([m()],i.prototype,"tools",2);a([m()],i.prototype,"inputSchema",2);a([m()],i.prototype,"outputSchema",2);a([m()],i.prototype,"modelTier",2);i=a([_("LLMAgent")],i);return i},"identity/IdentityManager","portal/Portal","core/reactiveUtils","layers/FeatureLayer","request","core/accessorSupport/decorators",a,b)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ var f=(...o)=>{let t=[];for(let s=0;s<o.length;++s){let n=o[s];if(typeof n=="string")t.push(n);else if(Array.isArray(n))t.push.apply(t,n);else if(typeof n=="object")for(let r in n)n[r]&&t.push(r)}let e=t.join(" ");return t.length=0,e},l=(o,t)=>{let e=o;for(;e;){if(e===t)return!0;if(!e.parentNode)return!1;e.parentNode instanceof ShadowRoot?e=e.parentNode.host:e=e.parentNode}return!1},m=(o,t,e)=>{let s=u(t).subscribe;return s(n=>{n.some(i=>l(o,i.target))&&e()})},c={},u=o=>{let t=o.join(","),e=c[t];if(e!==void 0)return e;let s=new Set,n=new MutationObserver(i=>s.forEach(a=>a(i)));globalThis.document&&n.observe(document.documentElement,{attributes:!0,attributeFilter:o,subtree:!0});let r={subscribe:i=>(s.add(i),()=>{s.delete(i),s.size===0&&(n.disconnect(),c[t]=void 0)})};return c[t]=r,r},d=(o,t)=>{let e=o;for(;e;){let s=e.closest?.(t);if(s)return s;let n=e.getRootNode?.();if(n===globalThis.document)return;e=n?.host}};var h=(o,t,e)=>d(o,`[${t}]`)?.getAttribute(t)??e;export{f as a,m as b,d as c,h as d};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{b as e,c as i}from"./HB5A5R2E.js";import"./AMP6IALT.js";import"./OAVEHGB6.js";import{v as s,y as a}from"./OH64RMOR.js";import"./YIMNOUTF.js";var t=class extends s{static{this.properties={agent:0,context:0}}async getContext(){return e(this.context)?await this.context():this.context}load(){i(this)}};a("arcgis-assistant-agent",t);export{t as ArcgisAssistantAgent};
2
+ import{b as e,c as i}from"./RUURNLTP.js";import"./5W7S2RS4.js";import"./NXKKG5TK.js";import{v as s,z as a}from"./HWKDNS4K.js";import"./YIMNOUTF.js";var t=class extends s{static{this.properties={agent:0,context:0}}async getContext(){return e(this.context)?await this.context():this.context}load(){i(this)}};a("arcgis-assistant-agent",t);export{t as ArcgisAssistantAgent};
@@ -0,0 +1,6 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import a from"./3VOQD2MR.js";import{a as C,c as N}from"./FUIGPHBH.js";import"./DHKUXLU3.js";import"./CHPQM77M.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([{property:B,subclass:D},{a:h,b:S,c:p,d:A}])=>{var G=Object.defineProperty,z=Object.getOwnPropertyDescriptor,P=(t,e,s,n)=>{for(var r=n>1?void 0:n?z(e,s):e,o=t.length-1,a;o>=0;o--)(a=t[o])&&(r=(n?a(e,s,r):a(r))||r);return n&&r&&G(e,s,r),r},x=class extends A{constructor(t){super(t)}getAgents(){return this.agents}generate(){let t=this.getAgents();this.validateAgents(t);for(let o of t)o.generate();let e=S(t.flatMap(o=>o.getSchemas()));for(let[o]of t.entries())e[_(o)]=void 0;let s=C(e),n=this.buildNodes(t),r=this.buildEdges(t);return{workspace:s,createGraph:()=>N(n,r,s,{entryNode:this.getEntryNode(t)})}}getEntryNode(t){return y}isTerminalAgent(t,e){return!1}buildNodes(t){let e={};for(let[s,n]of t.entries()){let r=_(s),o=p(n,s);e[o]=async(a,u)=>{let l=await n.run(F(a,n),u),i={},m=i;return m[r]=l,i}}return e[y]=()=>({}),e[k]=s=>R(s,t),e}buildEdges(t){return[...t.map((e,s)=>({from:y,to:p(e,s)})),...t.map((e,s)=>({from:p(e,s),to:k}))]}};P([B()],x.prototype,"agents",2);x=P([D("ParallelWorkflow")],x);var y="__parallel_fanOut",k="__parallel_join";function _(t){return`__parallel_update_${t}`}function W(t,e){return Object.fromEntries(e.filter(s=>Object.hasOwn(t,s)).map(s=>[s,t[s]]))}function F(t,e){let s=e.inputSchema;return s?{...W(t,h(s)),agentExecutionContext:t.agentExecutionContext,outputMessage:t.outputMessage,status:void 0,summary:""}:{...t,status:void 0,summary:""}}function I(t,e){return t.outputSchema?W(e,h(t.outputSchema)):{}}function K(t,e){let s=t.agentExecutionContext?.messages??[],n=e.agentExecutionContext?.messages??[];return n.length>s.length?n.slice(s.length):void 0}function R(t,e){let s=[],n=[],r=[],o={},a={},u=new Set;for(let[m,J]of e.entries()){let E=_(m),d=t[E];if(a[E]=void 0,!d||typeof d!="object")continue;let c=d,b=c.outputMessage,O=K(t,c),v=c.summary,$=I(J,c),w=b.trim();typeof b=="string"&&w&&s.push(w);let j=v.trim();typeof v=="string"&&j&&n.push(j),Array.isArray(O)&&r.push(...O),c.status&&u.add(c.status);for(let[f,g]of Object.entries($))if(!(g===void 0||f.startsWith("__parallel_update_"))&&!M(t[f],g)){if(!Object.hasOwn(o,f)){o[f]=g;continue}if(!M(o[f],g))throw new Error(`ParallelWorkflow detected conflicting updates for state key "${f}".`)}}let l={...a,...o},i=l;return r.length>0&&(i.agentExecutionContext={...t.agentExecutionContext,messages:[...t.agentExecutionContext.messages,...r]}),s.length&&(i.outputMessage=s.join(`
3
+
4
+ `)),n.length&&(i.summary=n.join(`
5
+
6
+ `)),u.size&&(i.status=u.has("failed")?"failed":u.has("success")?"success":void 0),l}function M(t,e){return t===e?!0:t&&e?JSON.stringify(t)===JSON.stringify(e):!1}return x},"core/accessorSupport/decorators",a)
@@ -0,0 +1,9 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{Ra as i}from"./CHPQM77M.js";async function n(a,t,e){if(e===void 0)throw new Error(["Unable to dispatch a custom event without a parent run id.",'"dispatchCustomEvent" can only be called from within an existing run (e.g.,',"inside a tool or a RunnableLambda).",`
3
+
4
+ If you continue to see this error, please import from "@langchain/core/callbacks/dispatch/web"`,"and explicitly pass in a config parameter.",`
5
+
6
+ Or, if you are calling this from a custom tool, ensure you're using the "tool" helper constructor as documented here:`,`
7
+ |`,`
8
+ \u2514-> https://js.langchain.com/docs/how_to/custom_tools#tool-function`,`
9
+ `].join(" "));let o=await i(e),s=o?.getParentRunId();o!==void 0&&s!==void 0&&await o.handleCustomEvent?.(a,t,s)}var u=async(a,t)=>{await n("trace_message",a,t)},m=async(a,t)=>{await n("graph_ux_suggestion",a,t)};export{u as a,m as b};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{g as e,h as t,v as r,z as a}from"./HWKDNS4K.js";import"./YIMNOUTF.js";var p=e`.interrupt-details ul{margin-block:var(--calcite-spacing-xxs) 0;padding-inline-start:var(--calcite-spacing-xxl)}.interrupt-details li{margin-block:0}.interrupts-container{display:flex;flex-direction:column;gap:var(--calcite-spacing-lg)}`,s=class extends r{static{this.properties={interrupts:0}}static{this.styles=p}render(){return this.interrupts?.length?t`<calcite-block collapsible expanded heading="Assistant Questions"><div class="interrupts-container">${this.interrupts?.map(({interrupt:l,response:i})=>t`<div class="interrupt-details"><div>Q: ${l.message}</div><ul>${Array.isArray(i)?i.length?i.map(n=>t`<li>${n}</li>`):t`<li>(Question skipped)</li>`:t`<li>${i!=null?String(i):"(Question skipped)"}</li>`}</ul></div>`)}</div></calcite-block>`:null}};a("arcgis-assistant-interrupt-preview",s);export{s as ArcgisAssistantInterruptPreview};