@arcgis/ai-components 5.2.0-next.17 → 5.2.0-next.19

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 (96) hide show
  1. package/dist/agent-utils/index.d.ts +78 -0
  2. package/dist/agent-utils/index.js +116 -97
  3. package/dist/agent-utils/middlewares/trace.d.ts +2 -0
  4. package/dist/agent-utils/types.d.ts +12 -12
  5. package/dist/cdn/27NEUQN3.js +2 -0
  6. package/dist/cdn/{VKR2CBLM.js → 2NMR43NW.js} +1 -1
  7. package/dist/cdn/3YMSOD5D.js +2 -0
  8. package/dist/cdn/4I4MCV7V.js +71 -0
  9. package/dist/cdn/5SBLS4NW.js +2 -0
  10. package/dist/cdn/ASSH4WSC.js +36 -0
  11. package/dist/cdn/BFPMQT3A.js +2 -0
  12. package/dist/cdn/{LBSOW7OW.js → C7E7MJSR.js} +1 -1
  13. package/dist/cdn/{DECSD3LN.js → CIW3QMKV.js} +1 -1
  14. package/dist/cdn/CVHJMR5X.js +2 -0
  15. package/dist/cdn/E7TMP4YV.js +3 -0
  16. package/dist/cdn/{NRMBMWI5.js → EBRNMPPO.js} +19 -18
  17. package/dist/cdn/GJUD7EA3.js +3 -0
  18. package/dist/cdn/HCR23HJB.js +2 -0
  19. package/dist/cdn/I64KIZG3.js +2 -0
  20. package/dist/cdn/IB4WTK74.js +2 -0
  21. package/dist/cdn/{LQSZTK26.js → IC5P5NYY.js} +1 -1
  22. package/dist/cdn/{QZVAGRWA.js → ICA7JOSU.js} +2 -2
  23. package/dist/cdn/{C4KITTT5.js → IXAKT6L3.js} +1 -1
  24. package/dist/cdn/{NE7E52YR.js → KTK4HNL2.js} +8 -2
  25. package/dist/cdn/{6EVF6NFG.js → KTOL6IN7.js} +5 -5
  26. package/dist/cdn/{VV57ZUOI.js → L77BTGXY.js} +1 -1
  27. package/dist/cdn/NOJYPREL.js +3 -0
  28. package/dist/cdn/{FZIT3DLD.js → O3F47IO5.js} +1 -1
  29. package/dist/cdn/{OLJC5BM3.js → O7TGCM5P.js} +1 -1
  30. package/dist/cdn/PBTINZTK.js +65 -0
  31. package/dist/cdn/PDEBKVBO.js +22 -0
  32. package/dist/cdn/PDT6I6TZ.js +2 -0
  33. package/dist/cdn/PSWI3MFB.js +2 -0
  34. package/dist/cdn/ROLXMEVE.js +18 -0
  35. package/dist/cdn/RX45PCYB.js +9 -0
  36. package/dist/cdn/{W5DLXSAP.js → SMADRJ67.js} +1 -1
  37. package/dist/cdn/U53OEX6L.js +2 -0
  38. package/dist/cdn/VDXSALQI.js +2 -0
  39. package/dist/cdn/{RUURNLTP.js → W2JAKE2M.js} +1 -1
  40. package/dist/cdn/{RHF452M7.js → WAVKMZA6.js} +1 -1
  41. package/dist/cdn/{6ZW7Z36F.js → X7GE26KU.js} +2 -2
  42. package/dist/cdn/XGS5EIA5.js +14 -0
  43. package/dist/cdn/YJ3QQXF6.js +2 -0
  44. package/dist/cdn/{X4UZCTIG.js → YYY7HKYX.js} +1 -1
  45. package/dist/cdn/agent-utils/index.js +1 -1
  46. package/dist/cdn/index.js +1 -1
  47. package/dist/chunks/converterUtils.js +39 -32
  48. package/dist/chunks/dataExplorationGraph.js +12 -10
  49. package/dist/chunks/helpGraph.js +8 -8
  50. package/dist/chunks/help_prompt.js +34 -17
  51. package/dist/chunks/intent_prompt.js +2 -2
  52. package/dist/chunks/navigationGraph.js +4 -4
  53. package/dist/chunks/navigation_intent_prompt.js +8 -2
  54. package/dist/chunks/state.js +1 -1
  55. package/dist/chunks/utils2.js +8 -8
  56. package/dist/components/arcgis-assistant/customElement.d.ts +7 -0
  57. package/dist/components/arcgis-assistant/customElement.js +301 -181
  58. package/dist/components/arcgis-assistant-agent/customElement.js +5 -1
  59. package/dist/components/arcgis-assistant-chat/customElement.js +22 -17
  60. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +9 -5
  61. package/dist/components/arcgis-assistant-help-agent/customElement.js +6 -2
  62. package/dist/components/arcgis-assistant-interrupt/customElement.js +4 -4
  63. package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +16 -12
  64. package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +8 -4
  65. package/dist/components/arcgis-assistant-message-block/customElement.js +1 -1
  66. package/dist/components/arcgis-assistant-message-text/customElement.d.ts +1 -0
  67. package/dist/components/arcgis-assistant-message-text/customElement.js +12 -12
  68. package/dist/components/arcgis-assistant-navigation-agent/customElement.js +9 -5
  69. package/dist/components/arcgis-assistant-user-message/customElement.js +10 -8
  70. package/dist/docs/api.json +1 -1
  71. package/dist/docs/docs.json +1 -1
  72. package/dist/docs/vscode.html-custom-data.json +1 -1
  73. package/dist/docs/web-types.json +1 -1
  74. package/dist/loader.js +2 -2
  75. package/dist/types/lumina.d.ts +2 -2
  76. package/dist/types/preact.d.ts +2 -2
  77. package/dist/types/react.d.ts +2 -2
  78. package/dist/types/stencil.d.ts +2 -2
  79. package/dist/utils/index.d.ts +1 -2
  80. package/package.json +4 -4
  81. package/dist/cdn/3S7PBYVD.js +0 -2
  82. package/dist/cdn/5VXRVWAX.js +0 -16
  83. package/dist/cdn/CE6VDP2D.js +0 -72
  84. package/dist/cdn/CI3QSFPS.js +0 -2
  85. package/dist/cdn/F2AHA4GB.js +0 -54
  86. package/dist/cdn/GPYYAQVI.js +0 -2
  87. package/dist/cdn/K475UT3E.js +0 -2
  88. package/dist/cdn/KIQUEMI4.js +0 -14
  89. package/dist/cdn/NTGC53UD.js +0 -36
  90. package/dist/cdn/PB2ODJC7.js +0 -2
  91. package/dist/cdn/SBHLUL3Q.js +0 -2
  92. package/dist/cdn/TR3OKQPQ.js +0 -22
  93. package/dist/cdn/WIJRNMBG.js +0 -3
  94. package/dist/cdn/XBW4MWQR.js +0 -2
  95. package/dist/cdn/Z7UWJ4AI.js +0 -3
  96. package/dist/orchestrator/registry/agentRegistry.d.ts +0 -33
@@ -1,72 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{i as Te,j as oe,q as Re,r as $e,s as Le}from"./MAV3DW27.js";var H=class extends Le{constructor(t){if(super(t),this.it=oe,t.type!==Re.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===oe||t==null)return this._t=void 0,this.it=t;if(t===Te)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;let r=[t];return r.raw=r,this._t={_$litType$:this.constructor.resultType,strings:r,values:[]}}};H.directiveName="unsafeHTML",H.resultType=1;var Jr=$e(H);var K=function(){return K=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},K.apply(this,arguments)},ce={exports:{}},x={},ue={exports:{}},z={};function Ie(){var e={};return e["align-content"]=!1,e["align-items"]=!1,e["align-self"]=!1,e["alignment-adjust"]=!1,e["alignment-baseline"]=!1,e.all=!1,e["anchor-point"]=!1,e.animation=!1,e["animation-delay"]=!1,e["animation-direction"]=!1,e["animation-duration"]=!1,e["animation-fill-mode"]=!1,e["animation-iteration-count"]=!1,e["animation-name"]=!1,e["animation-play-state"]=!1,e["animation-timing-function"]=!1,e.azimuth=!1,e["backface-visibility"]=!1,e.background=!0,e["background-attachment"]=!0,e["background-clip"]=!0,e["background-color"]=!0,e["background-image"]=!0,e["background-origin"]=!0,e["background-position"]=!0,e["background-repeat"]=!0,e["background-size"]=!0,e["baseline-shift"]=!1,e.binding=!1,e.bleed=!1,e["bookmark-label"]=!1,e["bookmark-level"]=!1,e["bookmark-state"]=!1,e.border=!0,e["border-bottom"]=!0,e["border-bottom-color"]=!0,e["border-bottom-left-radius"]=!0,e["border-bottom-right-radius"]=!0,e["border-bottom-style"]=!0,e["border-bottom-width"]=!0,e["border-collapse"]=!0,e["border-color"]=!0,e["border-image"]=!0,e["border-image-outset"]=!0,e["border-image-repeat"]=!0,e["border-image-slice"]=!0,e["border-image-source"]=!0,e["border-image-width"]=!0,e["border-left"]=!0,e["border-left-color"]=!0,e["border-left-style"]=!0,e["border-left-width"]=!0,e["border-radius"]=!0,e["border-right"]=!0,e["border-right-color"]=!0,e["border-right-style"]=!0,e["border-right-width"]=!0,e["border-spacing"]=!0,e["border-style"]=!0,e["border-top"]=!0,e["border-top-color"]=!0,e["border-top-left-radius"]=!0,e["border-top-right-radius"]=!0,e["border-top-style"]=!0,e["border-top-width"]=!0,e["border-width"]=!0,e.bottom=!1,e["box-decoration-break"]=!0,e["box-shadow"]=!0,e["box-sizing"]=!0,e["box-snap"]=!0,e["box-suppress"]=!0,e["break-after"]=!0,e["break-before"]=!0,e["break-inside"]=!0,e["caption-side"]=!1,e.chains=!1,e.clear=!0,e.clip=!1,e["clip-path"]=!1,e["clip-rule"]=!1,e.color=!0,e["color-interpolation-filters"]=!0,e["column-count"]=!1,e["column-fill"]=!1,e["column-gap"]=!1,e["column-rule"]=!1,e["column-rule-color"]=!1,e["column-rule-style"]=!1,e["column-rule-width"]=!1,e["column-span"]=!1,e["column-width"]=!1,e.columns=!1,e.contain=!1,e.content=!1,e["counter-increment"]=!1,e["counter-reset"]=!1,e["counter-set"]=!1,e.crop=!1,e.cue=!1,e["cue-after"]=!1,e["cue-before"]=!1,e.cursor=!1,e.direction=!1,e.display=!0,e["display-inside"]=!0,e["display-list"]=!0,e["display-outside"]=!0,e["dominant-baseline"]=!1,e.elevation=!1,e["empty-cells"]=!1,e.filter=!1,e.flex=!1,e["flex-basis"]=!1,e["flex-direction"]=!1,e["flex-flow"]=!1,e["flex-grow"]=!1,e["flex-shrink"]=!1,e["flex-wrap"]=!1,e.float=!1,e["float-offset"]=!1,e["flood-color"]=!1,e["flood-opacity"]=!1,e["flow-from"]=!1,e["flow-into"]=!1,e.font=!0,e["font-family"]=!0,e["font-feature-settings"]=!0,e["font-kerning"]=!0,e["font-language-override"]=!0,e["font-size"]=!0,e["font-size-adjust"]=!0,e["font-stretch"]=!0,e["font-style"]=!0,e["font-synthesis"]=!0,e["font-variant"]=!0,e["font-variant-alternates"]=!0,e["font-variant-caps"]=!0,e["font-variant-east-asian"]=!0,e["font-variant-ligatures"]=!0,e["font-variant-numeric"]=!0,e["font-variant-position"]=!0,e["font-weight"]=!0,e.grid=!1,e["grid-area"]=!1,e["grid-auto-columns"]=!1,e["grid-auto-flow"]=!1,e["grid-auto-rows"]=!1,e["grid-column"]=!1,e["grid-column-end"]=!1,e["grid-column-start"]=!1,e["grid-row"]=!1,e["grid-row-end"]=!1,e["grid-row-start"]=!1,e["grid-template"]=!1,e["grid-template-areas"]=!1,e["grid-template-columns"]=!1,e["grid-template-rows"]=!1,e["hanging-punctuation"]=!1,e.height=!0,e.hyphens=!1,e.icon=!1,e["image-orientation"]=!1,e["image-resolution"]=!1,e["ime-mode"]=!1,e["initial-letters"]=!1,e["inline-box-align"]=!1,e["justify-content"]=!1,e["justify-items"]=!1,e["justify-self"]=!1,e.left=!1,e["letter-spacing"]=!0,e["lighting-color"]=!0,e["line-box-contain"]=!1,e["line-break"]=!1,e["line-grid"]=!1,e["line-height"]=!1,e["line-snap"]=!1,e["line-stacking"]=!1,e["line-stacking-ruby"]=!1,e["line-stacking-shift"]=!1,e["line-stacking-strategy"]=!1,e["list-style"]=!0,e["list-style-image"]=!0,e["list-style-position"]=!0,e["list-style-type"]=!0,e.margin=!0,e["margin-bottom"]=!0,e["margin-left"]=!0,e["margin-right"]=!0,e["margin-top"]=!0,e["marker-offset"]=!1,e["marker-side"]=!1,e.marks=!1,e.mask=!1,e["mask-box"]=!1,e["mask-box-outset"]=!1,e["mask-box-repeat"]=!1,e["mask-box-slice"]=!1,e["mask-box-source"]=!1,e["mask-box-width"]=!1,e["mask-clip"]=!1,e["mask-image"]=!1,e["mask-origin"]=!1,e["mask-position"]=!1,e["mask-repeat"]=!1,e["mask-size"]=!1,e["mask-source-type"]=!1,e["mask-type"]=!1,e["max-height"]=!0,e["max-lines"]=!1,e["max-width"]=!0,e["min-height"]=!0,e["min-width"]=!0,e["move-to"]=!1,e["nav-down"]=!1,e["nav-index"]=!1,e["nav-left"]=!1,e["nav-right"]=!1,e["nav-up"]=!1,e["object-fit"]=!1,e["object-position"]=!1,e.opacity=!1,e.order=!1,e.orphans=!1,e.outline=!1,e["outline-color"]=!1,e["outline-offset"]=!1,e["outline-style"]=!1,e["outline-width"]=!1,e.overflow=!1,e["overflow-wrap"]=!1,e["overflow-x"]=!1,e["overflow-y"]=!1,e.padding=!0,e["padding-bottom"]=!0,e["padding-left"]=!0,e["padding-right"]=!0,e["padding-top"]=!0,e.page=!1,e["page-break-after"]=!1,e["page-break-before"]=!1,e["page-break-inside"]=!1,e["page-policy"]=!1,e.pause=!1,e["pause-after"]=!1,e["pause-before"]=!1,e.perspective=!1,e["perspective-origin"]=!1,e.pitch=!1,e["pitch-range"]=!1,e["play-during"]=!1,e.position=!1,e["presentation-level"]=!1,e.quotes=!1,e["region-fragment"]=!1,e.resize=!1,e.rest=!1,e["rest-after"]=!1,e["rest-before"]=!1,e.richness=!1,e.right=!1,e.rotation=!1,e["rotation-point"]=!1,e["ruby-align"]=!1,e["ruby-merge"]=!1,e["ruby-position"]=!1,e["shape-image-threshold"]=!1,e["shape-outside"]=!1,e["shape-margin"]=!1,e.size=!1,e.speak=!1,e["speak-as"]=!1,e["speak-header"]=!1,e["speak-numeral"]=!1,e["speak-punctuation"]=!1,e["speech-rate"]=!1,e.stress=!1,e["string-set"]=!1,e["tab-size"]=!1,e["table-layout"]=!1,e["text-align"]=!0,e["text-align-last"]=!0,e["text-combine-upright"]=!0,e["text-decoration"]=!0,e["text-decoration-color"]=!0,e["text-decoration-line"]=!0,e["text-decoration-skip"]=!0,e["text-decoration-style"]=!0,e["text-emphasis"]=!0,e["text-emphasis-color"]=!0,e["text-emphasis-position"]=!0,e["text-emphasis-style"]=!0,e["text-height"]=!0,e["text-indent"]=!0,e["text-justify"]=!0,e["text-orientation"]=!0,e["text-overflow"]=!0,e["text-shadow"]=!0,e["text-space-collapse"]=!0,e["text-transform"]=!0,e["text-underline-position"]=!0,e["text-wrap"]=!0,e.top=!1,e.transform=!1,e["transform-origin"]=!1,e["transform-style"]=!1,e.transition=!1,e["transition-delay"]=!1,e["transition-duration"]=!1,e["transition-property"]=!1,e["transition-timing-function"]=!1,e["unicode-bidi"]=!1,e["vertical-align"]=!1,e.visibility=!1,e["voice-balance"]=!1,e["voice-duration"]=!1,e["voice-family"]=!1,e["voice-pitch"]=!1,e["voice-range"]=!1,e["voice-rate"]=!1,e["voice-stress"]=!1,e["voice-volume"]=!1,e.volume=!1,e["white-space"]=!1,e.widows=!1,e.width=!0,e["will-change"]=!1,e["word-break"]=!0,e["word-spacing"]=!0,e["word-wrap"]=!0,e["wrap-flow"]=!1,e["wrap-through"]=!1,e["writing-mode"]=!1,e["z-index"]=!1,e}function ft(e,t,r){}function ht(e,t,r){}var gt=/javascript\s*\:/img;function dt(e,t){return gt.test(t)?"":t}z.whiteList=Ie();z.getDefaultWhiteList=Ie;z.onAttr=ft;z.onIgnoreAttr=ht;z.safeAttrValue=dt;var kt={indexOf:function(e,t){var r,n;if(Array.prototype.indexOf)return e.indexOf(t);for(r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1},forEach:function(e,t,r){var n,s;if(Array.prototype.forEach)return e.forEach(t,r);for(n=0,s=e.length;n<s;n++)t.call(r,e[n],n,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(e){return String.prototype.trimRight?e.trimRight():e.replace(/(\s*$)/g,"")}},W=kt;function bt(e,t){e=W.trimRight(e),e[e.length-1]!==";"&&(e+=";");var r=e.length,n=!1,s=0,i=0,l="";function a(){if(!n){var p=W.trim(e.slice(s,i)),u=p.indexOf(":");if(u!==-1){var f=W.trim(p.slice(0,u)),h=W.trim(p.slice(u+1));if(f){var g=t(s,l.length,f,h,p);g&&(l+=g+"; ")}}}s=i+1}for(;i<r;i++){var c=e[i];if(c==="/"&&e[i+1]==="*"){var o=e.indexOf("*/",i+2);if(o===-1)break;i=o+1,s=i+1,n=!1}else c==="("?n=!0:c===")"?n=!1:c===";"?n||a():c===`
3
- `&&a()}return W.trim(l)}var xt=bt,X=z,mt=xt;function Ee(e){return e==null}function wt(e){var t={};for(var r in e)t[r]=e[r];return t}function Pe(e){e=wt(e||{}),e.whiteList=e.whiteList||X.whiteList,e.onAttr=e.onAttr||X.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||X.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||X.safeAttrValue,this.options=e}Pe.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,r=t.options,n=r.whiteList,s=r.onAttr,i=r.onIgnoreAttr,l=r.safeAttrValue,a=mt(e,function(c,o,p,u,f){var h=n[p],g=!1;if(h===!0?g=h:typeof h=="function"?g=h(u):h instanceof RegExp&&(g=h.test(u)),g!==!0&&(g=!1),u=l(p,u),!!u){var b={position:o,sourcePosition:c,source:f,isWhite:g};if(g){var m=s(p,u,b);return Ee(m)?p+":"+u:m}else{var m=i(p,u,b);if(!Ee(m))return m}}});return a};var yt=Pe;(function(e,t){var r=z,n=yt;function s(l,a){var c=new n(a);return c.process(l)}t=e.exports=s,t.FilterCSS=n;for(var i in r)t[i]=r[i]})(ue,ue.exports);var pe=ue.exports,fe={indexOf:function(e,t){var r,n;if(Array.prototype.indexOf)return e.indexOf(t);for(r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1},forEach:function(e,t,r){var n,s;if(Array.prototype.forEach)return e.forEach(t,r);for(n=0,s=e.length;n<s;n++)t.call(r,e[n],n,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(e){var t=/\s|\n|\t/,r=t.exec(e);return r?r.index:-1}},vt=pe.FilterCSS,At=pe.getDefaultWhiteList,Y=fe;function Oe(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var qe=new vt;function St(e,t,r){}function Tt(e,t,r){}function Rt(e,t,r){}function $t(e,t,r){}function Be(e){return e.replace(Et,"&lt;").replace(_t,"&gt;")}function Lt(e,t,r,n){if(r=We(r),t==="href"||t==="src"){if(r=Y.trim(r),r==="#")return"#";if(!(r.substr(0,7)==="http://"||r.substr(0,8)==="https://"||r.substr(0,7)==="mailto:"||r.substr(0,4)==="tel:"||r.substr(0,11)==="data:image/"||r.substr(0,6)==="ftp://"||r.substr(0,2)==="./"||r.substr(0,3)==="../"||r[0]==="#"||r[0]==="/"))return""}else if(t==="background"){if(Q.lastIndex=0,Q.test(r))return""}else if(t==="style"){if(_e.lastIndex=0,_e.test(r)||(ze.lastIndex=0,ze.test(r)&&(Q.lastIndex=0,Q.test(r))))return"";n!==!1&&(n=n||qe,r=n.process(r))}return r=Me(r),r}var Et=/</g,_t=/>/g,zt=/"/g,Ct=/&quot;/g,It=/&#([a-zA-Z0-9]*);?/gim,Pt=/&colon;?/gim,Ot=/&newline;?/gim,Q=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,_e=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,ze=/u\s*r\s*l\s*\(.*/gi;function De(e){return e.replace(zt,"&quot;")}function Fe(e){return e.replace(Ct,'"')}function Ne(e){return e.replace(It,function(r,n){return n[0]==="x"||n[0]==="X"?String.fromCharCode(parseInt(n.substr(1),16)):String.fromCharCode(parseInt(n,10))})}function Ve(e){return e.replace(Pt,":").replace(Ot," ")}function He(e){for(var t="",r=0,n=e.length;r<n;r++)t+=e.charCodeAt(r)<32?" ":e.charAt(r);return Y.trim(t)}function We(e){return e=Fe(e),e=Ne(e),e=Ve(e),e=He(e),e}function Me(e){return e=De(e),e=Be(e),e}function qt(){return""}function Bt(e,t){typeof t!="function"&&(t=function(){});var r=!Array.isArray(e);function n(l){return r?!0:Y.indexOf(e,l)!==-1}var s=[],i=!1;return{onIgnoreTag:function(l,a,c){if(n(l))if(c.isClosing){var o="[/removed]",p=c.position+o.length;return s.push([i!==!1?i:c.position,p]),i=!1,o}else return i||(i=c.position),"[removed]";else return t(l,a,c)},remove:function(l){var a="",c=0;return Y.forEach(s,function(o){a+=l.slice(c,o[0]),c=o[1]}),a+=l.slice(c),a}}}function Dt(e){for(var t="",r=0;r<e.length;){var n=e.indexOf("<!--",r);if(n===-1){t+=e.slice(r);break}t+=e.slice(r,n);var s=e.indexOf("-->",n);if(s===-1)break;r=s+3}return t}function Ft(e){var t=e.split("");return t=t.filter(function(r){var n=r.charCodeAt(0);return n===127?!1:n<=31?n===10||n===13:!0}),t.join("")}x.whiteList=Oe();x.getDefaultWhiteList=Oe;x.onTag=St;x.onIgnoreTag=Tt;x.onTagAttr=Rt;x.onIgnoreTagAttr=$t;x.safeAttrValue=Lt;x.escapeHtml=Be;x.escapeQuote=De;x.unescapeQuote=Fe;x.escapeHtmlEntities=Ne;x.escapeDangerHtml5Entities=Ve;x.clearNonPrintableCharacter=He;x.friendlyAttrValue=We;x.escapeAttrValue=Me;x.onIgnoreTagStripAll=qt;x.StripTagBody=Bt;x.stripCommentTag=Dt;x.stripBlankChar=Ft;x.cssFilter=qe;x.getDefaultCSSWhiteList=At;var ee={},R=fe;function Nt(e){var t=R.spaceIndex(e),r;return t===-1?r=e.slice(1,-1):r=e.slice(1,t+1),r=R.trim(r).toLowerCase(),r.slice(0,1)==="/"&&(r=r.slice(1)),r.slice(-1)==="/"&&(r=r.slice(0,-1)),r}function Vt(e){return e.slice(0,2)==="</"}function Ht(e,t,r){var n="",s=0,i=!1,l=!1,a=0,c=e.length,o="",p="";e:for(a=0;a<c;a++){var u=e.charAt(a);if(i===!1){if(u==="<"){i=a;continue}}else if(l===!1){if(u==="<"){n+=r(e.slice(s,a)),i=a,s=a;continue}if(u===">"){n+=r(e.slice(s,i)),p=e.slice(i,a+1),o=Nt(p),n+=t(i,n.length,o,p,Vt(p)),s=a+1,i=!1;continue}if(u==='"'||u==="'")for(var f=1,h=e.charAt(a-f);h.trim()===""||h==="=";){if(h==="="){l=u;continue e}h=e.charAt(a-++f)}}else if(u===l){l=!1;continue}}return s<e.length&&(n+=r(e.substr(s))),n}var Wt=/[^a-zA-Z0-9\\_:.-]/gim;function Mt(e,t){var r=0,n=0,s=[],i=!1,l=e.length;function a(f,h){if(f=R.trim(f),f=f.replace(Wt,"").toLowerCase(),!(f.length<1)){var g=t(f,h||"");g&&s.push(g)}}for(var c=0;c<l;c++){var o=e.charAt(c),p,u;if(i===!1&&o==="="){i=e.slice(r,c),r=c+1,n=e.charAt(r)==='"'||e.charAt(r)==="'"?r:jt(e,c+1);continue}if(i!==!1&&c===n){if(u=e.indexOf(o,c+1),u===-1)break;p=R.trim(e.slice(n+1,u)),a(i,p),i=!1,c=u,r=c+1;continue}if(/\s|\n|\t/.test(o))if(e=e.replace(/\s|\n|\t/g," "),i===!1)if(u=Gt(e,c),u===-1){p=R.trim(e.slice(r,c)),a(p),i=!1,r=c+1;continue}else{c=u-1;continue}else if(u=Zt(e,c-1),u===-1){p=R.trim(e.slice(r,c)),p=Ce(p),a(i,p),i=!1,r=c+1;continue}else continue}return r<e.length&&(i===!1?a(e.slice(r)):a(i,Ce(R.trim(e.slice(r))))),R.trim(s.join(" "))}function Gt(e,t){for(;t<e.length;t++){var r=e[t];if(r!==" ")return r==="="?t:-1}}function jt(e,t){for(;t<e.length;t++){var r=e[t];if(r!==" ")return r==="'"||r==='"'?t:-1}}function Zt(e,t){for(;t>0;t--){var r=e[t];if(r!==" ")return r==="="?t:-1}}function Xt(e){return e[0]==='"'&&e[e.length-1]==='"'||e[0]==="'"&&e[e.length-1]==="'"}function Ce(e){return Xt(e)?e.substr(1,e.length-2):e}ee.parseTag=Ht;ee.parseAttr=Mt;var Qt=pe.FilterCSS,y=x,Ge=ee,Ut=Ge.parseTag,Jt=Ge.parseAttr,J=fe;function U(e){return e==null}function Kt(e){var t=J.spaceIndex(e);if(t===-1)return{html:"",closing:e[e.length-2]==="/"};e=J.trim(e.slice(t+1,-1));var r=e[e.length-1]==="/";return r&&(e=J.trim(e.slice(0,-1))),{html:e,closing:r}}function Yt(e){var t={};for(var r in e)t[r]=e[r];return t}function er(e){var t={};for(var r in e)Array.isArray(e[r])?t[r.toLowerCase()]=e[r].map(function(n){return n.toLowerCase()}):t[r.toLowerCase()]=e[r];return t}function je(e){e=Yt(e||{}),e.stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=y.onIgnoreTagStripAll),e.whiteList||e.allowList?e.whiteList=er(e.whiteList||e.allowList):e.whiteList=y.whiteList,e.onTag=e.onTag||y.onTag,e.onTagAttr=e.onTagAttr||y.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||y.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||y.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||y.safeAttrValue,e.escapeHtml=e.escapeHtml||y.escapeHtml,this.options=e,e.css===!1?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new Qt(e.css))}je.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,r=t.options,n=r.whiteList,s=r.onTag,i=r.onIgnoreTag,l=r.onTagAttr,a=r.onIgnoreTagAttr,c=r.safeAttrValue,o=r.escapeHtml,p=t.cssFilter;r.stripBlankChar&&(e=y.stripBlankChar(e)),r.allowCommentTag||(e=y.stripCommentTag(e));var u=!1;r.stripIgnoreTagBody&&(u=y.StripTagBody(r.stripIgnoreTagBody,i),i=u.onIgnoreTag);var f=Ut(e,function(h,g,b,m,L){var E={sourcePosition:h,position:g,isClosing:L,isWhite:Object.prototype.hasOwnProperty.call(n,b)},_=s(b,m,E);if(!U(_))return _;if(E.isWhite){if(E.isClosing)return"</"+b+">";var Z=Kt(m),N=n[b],T=Jt(Z.html,function(O,q){var le=J.indexOf(N,O)!==-1,V=l(b,O,q,le);return U(V)?le?(q=c(b,O,q,p),q?O+'="'+q+'"':O):(V=a(b,O,q,le),U(V)?void 0:V):V});return m="<"+b,T&&(m+=" "+T),Z.closing&&(m+=" /"),m+=">",m}else return _=i(b,m,E),U(_)?o(m):_},o);return u&&(f=u.remove(f)),f};var tr=je;(function(e,t){var r=x,n=ee,s=tr;function i(a,c){var o=new s(c);return o.process(a)}t=e.exports=i,t.filterXSS=i,t.FilterXSS=s,(function(){for(var a in r)t[a]=r[a];for(var c in n)t[c]=n[c]})();function l(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}l()&&(self.filterXSS=e.exports)})(ce,ce.exports);var B=ce.exports,rr=function(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t},Ze=(function(){function e(t,r){var n=this;this.arcgisWhiteList={a:["href","style","target"],abbr:["title"],article:["style"],aside:["style"],audio:["autoplay","controls","loop","muted","preload"],b:[],blockquote:["style"],br:[],code:["style"],dd:["style"],del:["style"],details:["open","style"],div:["align","aria-hidden","aria-label","style"],dl:["style"],dt:["style"],em:[],figcaption:["style"],figure:["style"],font:["color","face","size","style"],footer:["style"],h1:["style"],h2:["style"],h3:["style"],h4:["style"],h5:["style"],h6:["style"],header:["style"],hr:[],i:[],img:["alt","border","height","src","style","width"],li:[],main:["style"],mark:["style"],nav:["style"],ol:[],p:["style"],pre:["style"],section:["style"],source:["media","src","type"],span:["aria-hidden","aria-label","style"],strong:[],sub:["style"],summary:["style"],sup:["style"],table:["border","cellpadding","cellspacing","height","style","width"],tbody:[],tr:["align","height","style","valign"],td:["align","colspan","height","nowrap","rowspan","style","valign","width"],th:["align","colspan","height","nowrap","rowspan","style","valign","width"],time:["style"],u:[],ul:[],video:["autoplay","controls","height","loop","muted","poster","preload","width"]},this.arcgisCSSWhiteList=K(K({},B.getDefaultCSSWhiteList()),{"align-items":!0,"align-self":!0,flex:!0,"flex-basis":!0,"flex-direction":!0,"flex-flow":!0,"flex-grow":!0,"flex-shrink":!0,"flex-wrap":!0,float:!0,gap:!0,grid:!0,"grid-area":!0,"grid-auto-columns":!0,"grid-auto-flow":!0,"grid-auto-rows":!0,"grid-column":!0,"grid-column-end":!0,"grid-column-start":!0,"grid-row":!0,"grid-row-end":!0,"grid-row-start":!0,"grid-template":!0,"grid-template-areas":!0,"grid-template-columns":!0,"grid-template-rows":!0,"justify-content":!0,"justify-items":!0,"justify-self":!0,"line-height":!0,overflow:!0}),this.allowedProtocols=["http","https","mailto","iform","tel","flow","lfmobile","arcgis-navigator","arcgis-appstudio-player","arcgis-survey123","arcgis-collector","arcgis-workforce","arcgis-explorer","arcgis-trek2there","arcgis-quickcapture","mspbi","comgooglemaps","pdfefile","pdfehttp","pdfehttps","boxapp","boxemm","awb","awbs","gropen","radarscope"],this.arcgisFilterOptions={allowCommentTag:!0,safeAttrValue:function(i,l,a,c){return i==="a"&&l==="href"||(i==="img"||i==="source")&&l==="src"?n.sanitizeUrl(a):B.safeAttrValue(i,l,a,c)}},this._entityMap={"&":"&#x38;","<":"&#x3C;",">":"&#x3E;",'"':"&#x22;","'":"&#x27;","/":"&#x2F;"};var s;t&&!r?s=t:t&&r?(s=Object.create(this.arcgisFilterOptions),s.css={whiteList:this.arcgisCSSWhiteList},Object.keys(t).forEach(function(i){if(i==="whiteList")s.whiteList=n._extendObjectOfArrays([n.arcgisWhiteList,t.whiteList||{}]);else if(i==="css"){var l=t.css.whiteList;l!=null&&t.css instanceof Object&&Object.keys(l).forEach(function(a){return s.css.whiteList[a]=l[a]})}else s[i]=t[i]})):(s=Object.create(this.arcgisFilterOptions),s.whiteList=this.arcgisWhiteList,s.css={whiteList:this.arcgisCSSWhiteList}),this.xssFilterOptions=s,this._xssFilter=new B.FilterXSS(s)}return e.prototype.sanitize=function(t,r){switch(r===void 0&&(r={}),typeof t){case"number":return isNaN(t)||!isFinite(t)?null:t;case"boolean":return t;case"string":return this._xssFilter.process(t);case"object":return this._iterateOverObject(t,r);default:return r.allowUndefined&&typeof t>"u"?void 0:null}},e.prototype.sanitizeUrl=function(t,r){var n=(r??{}).isProtocolRequired,s=n===void 0?!0:n,i=this._trim(t.substring(0,t.indexOf(":"))),l=t==="/",a=/^#/.test(t),c=i&&this.allowedProtocols.indexOf(i.toLowerCase())>-1;return l||a||c?B.escapeAttrValue(t):!i&&!s?B.escapeAttrValue("https://".concat(t)):""},e.prototype.sanitizeHTMLAttribute=function(t,r,n,s){return typeof this.xssFilterOptions.safeAttrValue=="function"?this.xssFilterOptions.safeAttrValue(t,r,n,s):B.safeAttrValue(t,r,n,s)},e.prototype.validate=function(t,r){r===void 0&&(r={});var n=this.sanitize(t,r);return{isValid:t===n,sanitized:n}},e.prototype.encodeHTML=function(t){var r=this;return String(t).replace(/[&<>"'\/]/g,function(n){return r._entityMap[n]})},e.prototype.encodeAttrValue=function(t){var r=/^[a-zA-Z0-9]$/;return String(t).replace(/[\x00-\xFF]/g,function(n,s){return r.test(n)?n:"&#x".concat(Number(t.charCodeAt(s)).toString(16),";")})},e.prototype._extendObjectOfArrays=function(t){var r={};return t.forEach(function(n){Object.keys(n).forEach(function(s){Array.isArray(n[s])&&Array.isArray(r[s])?r[s]=r[s].concat(n[s]):r[s]=n[s]})}),r},e.prototype._iterateOverObject=function(t,r){var n=this;r===void 0&&(r={});try{var s=!1,i=void 0;if(Array.isArray(t))i=t.reduce(function(a,c){var o=n.validate(c,r);return o.isValid?a.concat([c]):(s=!0,a.concat([o.sanitized]))},[]);else if(rr(t)){var l=Object.keys(t);i=l.reduce(function(a,c){var o=t[c],p=n.validate(o,r);return p.isValid?a[c]=o:(s=!0,a[c]=p.sanitized),a},{})}else return r.allowUndefined&&typeof t>"u"?void 0:null;return s?i:t}catch{return null}},e.prototype._trim=function(t){return String.prototype.trim?t.trim():t.replace(/(^\s*)|(\s*$)/g,"")},e})();function ke(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var P=ke();function tt(e){P=e}var C={exec:()=>null};function D(e){let t=[];return r=>{let n=Math.max(0,Math.min(3,r-1)),s=t[n];return s||(s=e(n),t[n]=s),s}}function d(e,t=""){let r=typeof e=="string"?e:e.source,n={replace:(s,i)=>{let l=typeof i=="string"?i:i.source;return l=l.replace(w.caret,"$1"),r=r.replace(s,l),n},getRegex:()=>new RegExp(r,t)};return n}var nr=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),w={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:D(e=>new RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:D(e=>new RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:D(e=>new RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:D(e=>new RegExp(`^ {0,${e}}#`)),htmlBeginRegex:D(e=>new RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:D(e=>new RegExp(`^ {0,${e}}>`))},sr=/^(?:[ \t]*(?:\n|$))+/,ir=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ar=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,j=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,lr=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,be=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,rt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,nt=d(rt).replace(/bull/g,be).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),or=d(rt).replace(/bull/g,be).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),xe=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,cr=/^[^\n]+/,me=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ur=d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",me).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),pr=d(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,be).getRegex(),ie="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",we=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,fr=d("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",we).replace("tag",ie).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),st=d(xe).replace("hr",j).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ie).getRegex(),hr=d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",st).getRegex(),ye={blockquote:hr,code:ir,def:ur,fences:ar,heading:lr,hr:j,html:fr,lheading:nt,list:pr,newline:sr,paragraph:st,table:C,text:cr},Xe=d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",j).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ie).getRegex(),gr={...ye,lheading:or,table:Xe,paragraph:d(xe).replace("hr",j).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Xe).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ie).getRegex()},dr={...ye,html:d(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",we).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:C,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:d(xe).replace("hr",j).replace("heading",` *#{1,6} *[^
4
- ]`).replace("lheading",nt).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},kr=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,br=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,it=/^( {2,}|\\)\n(?!\s*$)/,xr=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,F=/[\p{P}\p{S}]/u,ae=/[\s\p{P}\p{S}]/u,ve=/[^\s\p{P}\p{S}]/u,mr=d(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ae).getRegex(),at=/(?!~)[\p{P}\p{S}]/u,wr=/(?!~)[\s\p{P}\p{S}]/u,yr=/(?:[^\s\p{P}\p{S}]|~)/u,vr=d(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",nr?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),lt=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Ar=d(lt,"u").replace(/punct/g,F).getRegex(),Sr=d(lt,"u").replace(/punct/g,at).getRegex(),ot="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Tr=d(ot,"gu").replace(/notPunctSpace/g,ve).replace(/punctSpace/g,ae).replace(/punct/g,F).getRegex(),Rr=d(ot,"gu").replace(/notPunctSpace/g,yr).replace(/punctSpace/g,wr).replace(/punct/g,at).getRegex(),$r=d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ve).replace(/punctSpace/g,ae).replace(/punct/g,F).getRegex(),Lr=d(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,F).getRegex(),Er="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",_r=d(Er,"gu").replace(/notPunctSpace/g,ve).replace(/punctSpace/g,ae).replace(/punct/g,F).getRegex(),zr=d(/\\(punct)/,"gu").replace(/punct/g,F).getRegex(),Cr=d(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Ir=d(we).replace("(?:-->|$)","-->").getRegex(),Pr=d("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Ir).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),re=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Or=d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",re).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ct=d(/^!?\[(label)\]\[(ref)\]/).replace("label",re).replace("ref",me).getRegex(),ut=d(/^!?\[(ref)\](?:\[\])?/).replace("ref",me).getRegex(),qr=d("reflink|nolink(?!\\()","g").replace("reflink",ct).replace("nolink",ut).getRegex(),Qe=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ae={_backpedal:C,anyPunctuation:zr,autolink:Cr,blockSkip:vr,br:it,code:br,del:C,delLDelim:C,delRDelim:C,emStrongLDelim:Ar,emStrongRDelimAst:Tr,emStrongRDelimUnd:$r,escape:kr,link:Or,nolink:ut,punctuation:mr,reflink:ct,reflinkSearch:qr,tag:Pr,text:xr,url:C},Br={...Ae,link:d(/^!?\[(label)\]\((.*?)\)/).replace("label",re).getRegex(),reflink:d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",re).getRegex()},he={...Ae,emStrongRDelimAst:Rr,emStrongLDelim:Sr,delLDelim:Lr,delRDelim:_r,url:d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Qe).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:d(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Qe).getRegex()},Dr={...he,br:d(it).replace("{2,}","*").getRegex(),text:d(he.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},te={normal:ye,gfm:gr,pedantic:dr},M={normal:Ae,gfm:he,breaks:Dr,pedantic:Br},Fr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ue=e=>Fr[e];function S(e,t){if(t){if(w.escapeTest.test(e))return e.replace(w.escapeReplace,Ue)}else if(w.escapeTestNoEncode.test(e))return e.replace(w.escapeReplaceNoEncode,Ue);return e}function Je(e){try{e=encodeURI(e).replace(w.percentDecode,"%")}catch{return null}return e}function Ke(e,t){let r=e.replace(w.findPipe,(i,l,a)=>{let c=!1,o=l;for(;--o>=0&&a[o]==="\\";)c=!c;return c?"|":" |"}),n=r.split(w.splitPipe),s=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;s<n.length;s++)n[s]=n[s].trim().replace(w.slashPipe,"|");return n}function $(e,t,r){let n=e.length;if(n===0)return"";let s=0;for(;s<n;){let i=e.charAt(n-s-1);if(i===t&&!r)s++;else if(i!==t&&r)s++;else break}return e.slice(0,n-s)}function Ye(e){let t=e.split(`
5
- `),r=t.length-1;for(;r>=0&&w.blankLine.test(t[r]);)r--;return t.length-r<=2?e:t.slice(0,r+1).join(`
6
- `)}function Nr(e,t){if(e.indexOf(t[1])===-1)return-1;let r=0;for(let n=0;n<e.length;n++)if(e[n]==="\\")n++;else if(e[n]===t[0])r++;else if(e[n]===t[1]&&(r--,r<0))return n;return r>0?-2:-1}function Vr(e,t=0){let r=t,n="";for(let s of e)if(s===" "){let i=4-r%4;n+=" ".repeat(i),r+=i}else n+=s,r++;return n}function et(e,t,r,n,s){let i=t.href,l=t.title||null,a=e[1].replace(s.other.outputLinkReplace,"$1");n.state.inLink=!0;let c={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:i,title:l,text:a,tokens:n.inlineTokens(a)};return n.state.inLink=!1,c}function Hr(e,t,r){let n=e.match(r.other.indentCodeCompensation);if(n===null)return t;let s=n[1];return t.split(`
7
- `).map(i=>{let l=i.match(r.other.beginningSpace);if(l===null)return i;let[a]=l;return a.length>=s.length?i.slice(s.length):i}).join(`
8
- `)}var ne=class{options;rules;lexer;constructor(e){this.options=e||P}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let r=this.options.pedantic?t[0]:Ye(t[0]),n=r.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r,codeBlockStyle:"indented",text:n}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let r=t[0],n=Hr(r,t[3]||"",this.rules);return{type:"code",raw:r,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let r=t[2].trim();if(this.rules.other.endingHash.test(r)){let n=$(r,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(r=n.trim())}return{type:"heading",raw:$(t[0],`
9
- `),depth:t[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:$(t[0],`
10
- `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let r=$(t[0],`
11
- `).split(`
12
- `),n="",s="",i=[];for(;r.length>0;){let l=!1,a=[],c;for(c=0;c<r.length;c++)if(this.rules.other.blockquoteStart.test(r[c]))a.push(r[c]),l=!0;else if(!l)a.push(r[c]);else break;r=r.slice(c);let o=a.join(`
13
- `),p=o.replace(this.rules.other.blockquoteSetextReplace,`
14
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
15
- ${o}`:o,s=s?`${s}
16
- ${p}`:p;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,i,!0),this.lexer.state.top=u,r.length===0)break;let f=i.at(-1);if(f?.type==="code")break;if(f?.type==="blockquote"){let h=f,g=h.raw+`
17
- `+r.join(`
18
- `),b=this.blockquote(g);i[i.length-1]=b,n=n.substring(0,n.length-h.raw.length)+b.raw,s=s.substring(0,s.length-h.text.length)+b.text;break}else if(f?.type==="list"){let h=f,g=h.raw+`
19
- `+r.join(`
20
- `),b=this.list(g);i[i.length-1]=b,n=n.substring(0,n.length-f.raw.length)+b.raw,s=s.substring(0,s.length-h.raw.length)+b.raw,r=g.substring(i.at(-1).raw.length).split(`
21
- `);continue}}return{type:"blockquote",raw:n,tokens:i,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim(),n=r.length>1,s={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");let i=this.rules.other.listItemRegex(r),l=!1;for(;e;){let c=!1,o="",p="";if(!(t=i.exec(e))||this.rules.block.hr.test(e))break;o=t[0],e=e.substring(o.length);let u=Vr(t[2].split(`
22
- `,1)[0],t[1].length),f=e.split(`
23
- `,1)[0],h=!u.trim(),g=0;if(this.options.pedantic?(g=2,p=u.trimStart()):h?g=t[1].length+1:(g=u.search(this.rules.other.nonSpaceChar),g=g>4?1:g,p=u.slice(g),g+=t[1].length),h&&this.rules.other.blankLine.test(f)&&(o+=f+`
24
- `,e=e.substring(f.length+1),c=!0),!c){let b=this.rules.other.nextBulletRegex(g),m=this.rules.other.hrRegex(g),L=this.rules.other.fencesBeginRegex(g),E=this.rules.other.headingBeginRegex(g),_=this.rules.other.htmlBeginRegex(g),Z=this.rules.other.blockquoteBeginRegex(g);for(;e;){let N=e.split(`
25
- `,1)[0],T;if(f=N,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),T=f):T=f.replace(this.rules.other.tabCharGlobal," "),L.test(f)||E.test(f)||_.test(f)||Z.test(f)||b.test(f)||m.test(f))break;if(T.search(this.rules.other.nonSpaceChar)>=g||!f.trim())p+=`
26
- `+T.slice(g);else{if(h||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||L.test(u)||E.test(u)||m.test(u))break;p+=`
27
- `+f}h=!f.trim(),o+=N+`
28
- `,e=e.substring(N.length+1),u=T.slice(g)}}s.loose||(l?s.loose=!0:this.rules.other.doubleBlankLine.test(o)&&(l=!0)),s.items.push({type:"list_item",raw:o,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),s.raw+=o}let a=s.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let c of s.items){this.lexer.state.top=!1,c.tokens=this.lexer.blockTokens(c.text,[]);let o=c.tokens[0];if(c.task&&(o?.type==="text"||o?.type==="paragraph")){c.text=c.text.replace(this.rules.other.listReplaceTask,""),o.raw=o.raw.replace(this.rules.other.listReplaceTask,""),o.text=o.text.replace(this.rules.other.listReplaceTask,"");for(let u=this.lexer.inlineQueue.length-1;u>=0;u--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[u].src)){this.lexer.inlineQueue[u].src=this.lexer.inlineQueue[u].src.replace(this.rules.other.listReplaceTask,"");break}let p=this.rules.other.listTaskCheckbox.exec(c.raw);if(p){let u={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};c.checked=u.checked,s.loose?c.tokens[0]&&["paragraph","text"].includes(c.tokens[0].type)&&"tokens"in c.tokens[0]&&c.tokens[0].tokens?(c.tokens[0].raw=u.raw+c.tokens[0].raw,c.tokens[0].text=u.raw+c.tokens[0].text,c.tokens[0].tokens.unshift(u)):c.tokens.unshift({type:"paragraph",raw:u.raw,text:u.raw,tokens:[u]}):c.tokens.unshift(u)}}else c.task&&(c.task=!1);if(!s.loose){let p=c.tokens.filter(f=>f.type==="space"),u=p.length>0&&p.some(f=>this.rules.other.anyLine.test(f.raw));s.loose=u}}if(s.loose)for(let c of s.items){c.loose=!0;for(let o of c.tokens)o.type==="text"&&(o.type="paragraph")}return s}}html(e){let t=this.rules.block.html.exec(e);if(t){let r=Ye(t[0]);return{type:"html",block:!0,raw:r,pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:r}}}def(e){let t=this.rules.block.def.exec(e);if(t){let r=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:r,raw:$(t[0],`
29
- `),href:n,title:s}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let r=Ke(t[1]),n=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
30
- `):[],i={type:"table",raw:$(t[0],`
31
- `),header:[],align:[],rows:[]};if(r.length===n.length){for(let l of n)this.rules.other.tableAlignRight.test(l)?i.align.push("right"):this.rules.other.tableAlignCenter.test(l)?i.align.push("center"):this.rules.other.tableAlignLeft.test(l)?i.align.push("left"):i.align.push(null);for(let l=0;l<r.length;l++)i.header.push({text:r[l],tokens:this.lexer.inline(r[l]),header:!0,align:i.align[l]});for(let l of s)i.rows.push(Ke(l,i.header.length).map((a,c)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:i.align[c]})));return i}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let r=t[1].trim();return{type:"heading",raw:$(t[0],`
32
- `),depth:t[2].charAt(0)==="="?1:2,text:r,tokens:this.lexer.inline(r)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let r=t[1].charAt(t[1].length-1)===`
33
- `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:r,tokens:this.lexer.inline(r)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let i=$(r.slice(0,-1),"\\");if((r.length-i.length)%2===0)return}else{let i=Nr(t[2],"()");if(i===-2)return;if(i>-1){let l=(t[0].indexOf("!")===0?5:4)+t[1].length+i;t[2]=t[2].substring(0,i),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let n=t[2],s="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(n);i&&(n=i[1],s=i[3])}else s=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?n=n.slice(1):n=n.slice(1,-1)),et(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let n=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[n.toLowerCase()];if(!s){let i=r[0].charAt(0);return{type:"text",raw:i,text:i}}return et(r,s,r[0],this.lexer,this.rules)}}emStrong(e,t,r=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!(!n||!n[1]&&!n[2]&&!n[3]&&!n[4]||n[4]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[3])||!r||this.rules.inline.punctuation.exec(r))){let s=[...n[0]].length-1,i,l,a=s,c=0,o=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(o.lastIndex=0,t=t.slice(-1*e.length+s);(n=o.exec(t))!==null;){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i)continue;if(l=[...i].length,n[3]||n[4]){a+=l;continue}else if((n[5]||n[6])&&s%3&&!((s+l)%3)){c+=l;continue}if(a-=l,a>0)continue;l=Math.min(l,l+a+c);let p=[...n[0]][0].length,u=e.slice(0,s+n.index+p+l);if(Math.min(s,l)%2){let h=u.slice(1,-1);return{type:"em",raw:u,text:h,tokens:this.lexer.inlineTokens(h)}}let f=u.slice(2,-2);return{type:"strong",raw:u,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let r=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(r),s=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return n&&s&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:t[0],text:r}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,r=""){let n=this.rules.inline.delLDelim.exec(e);if(n&&(!n[1]||!r||this.rules.inline.punctuation.exec(r))){let s=[...n[0]].length-1,i,l,a=s,c=this.rules.inline.delRDelim;for(c.lastIndex=0,t=t.slice(-1*e.length+s);(n=c.exec(t))!==null;){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i||(l=[...i].length,l!==s))continue;if(n[3]||n[4]){a+=l;continue}if(a-=l,a>0)continue;l=Math.min(l,l+a);let o=[...n[0]][0].length,p=e.slice(0,s+n.index+o+l),u=p.slice(s,-s);return{type:"del",raw:p,text:u,tokens:this.lexer.inlineTokens(u)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let r,n;return t[2]==="@"?(r=t[1],n="mailto:"+r):(r=t[1],n=r),{type:"link",raw:t[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let r,n;if(t[2]==="@")r=t[0],n="mailto:"+r;else{let s;do s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(s!==t[0]);r=t[0],t[1]==="www."?n="http://"+t[0]:n=t[0]}return{type:"link",raw:t[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let r=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:r}}}},v=class ge{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||P,this.options.tokenizer=this.options.tokenizer||new ne,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:w,block:te.normal,inline:M.normal};this.options.pedantic?(r.block=te.pedantic,r.inline=M.pedantic):this.options.gfm&&(r.block=te.gfm,this.options.breaks?r.inline=M.breaks:r.inline=M.gfm),this.tokenizer.rules=r}static get rules(){return{block:te,inline:M}}static lex(t,r){return new ge(r).lex(t)}static lexInline(t,r){return new ge(r).inlineTokens(t)}lex(t){t=t.replace(w.carriageReturn,`
34
- `),this.blockTokens(t,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let n=this.inlineQueue[r];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,r=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(w.tabCharGlobal," ").replace(w.spaceLine,""));let s=1/0;for(;t;){if(t.length<s)s=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(a=>(i=a.call({lexer:this},t,r))?(t=t.substring(i.raw.length),r.push(i),!0):!1))continue;if(i=this.tokenizer.space(t)){t=t.substring(i.raw.length);let a=r.at(-1);i.raw.length===1&&a!==void 0?a.raw+=`
35
- `:r.push(i);continue}if(i=this.tokenizer.code(t)){t=t.substring(i.raw.length);let a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
36
- `)?"":`
37
- `)+i.raw,a.text+=`
38
- `+i.text,this.inlineQueue.at(-1).src=a.text):r.push(i);continue}if(i=this.tokenizer.fences(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.heading(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.hr(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.blockquote(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.list(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.html(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.def(t)){t=t.substring(i.raw.length);let a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
39
- `)?"":`
40
- `)+i.raw,a.text+=`
41
- `+i.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},r.push(i));continue}if(i=this.tokenizer.table(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.lheading(t)){t=t.substring(i.raw.length),r.push(i);continue}let l=t;if(this.options.extensions?.startBlock){let a=1/0,c=t.slice(1),o;this.options.extensions.startBlock.forEach(p=>{o=p.call({lexer:this},c),typeof o=="number"&&o>=0&&(a=Math.min(a,o))}),a<1/0&&a>=0&&(l=t.substring(0,a+1))}if(this.state.top&&(i=this.tokenizer.paragraph(l))){let a=r.at(-1);n&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
42
- `)?"":`
43
- `)+i.raw,a.text+=`
44
- `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(i),n=l.length!==t.length,t=t.substring(i.raw.length);continue}if(i=this.tokenizer.text(t)){t=t.substring(i.raw.length);let a=r.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
45
- `)?"":`
46
- `)+i.raw,a.text+=`
47
- `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(i);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){this.tokenizer.lexer=this;let n=t,s=null;if(this.tokens.links){let o=Object.keys(this.tokens.links);if(o.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)o.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,s.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)i=s[2]?s[2].length:0,n=n.slice(0,s.index+i)+"["+"a".repeat(s[0].length-i-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let l=!1,a="",c=1/0;for(;t;){if(t.length<c)c=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}l||(a=""),l=!1;let o;if(this.options.extensions?.inline?.some(u=>(o=u.call({lexer:this},t,r))?(t=t.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.escape(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.tag(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.link(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(o.raw.length);let u=r.at(-1);o.type==="text"&&u?.type==="text"?(u.raw+=o.raw,u.text+=o.text):r.push(o);continue}if(o=this.tokenizer.emStrong(t,n,a)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.codespan(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.br(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.del(t,n,a)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.autolink(t)){t=t.substring(o.raw.length),r.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(t))){t=t.substring(o.raw.length),r.push(o);continue}let p=t;if(this.options.extensions?.startInline){let u=1/0,f=t.slice(1),h;this.options.extensions.startInline.forEach(g=>{h=g.call({lexer:this},f),typeof h=="number"&&h>=0&&(u=Math.min(u,h))}),u<1/0&&u>=0&&(p=t.substring(0,u+1))}if(o=this.tokenizer.inlineText(p)){t=t.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(a=o.raw.slice(-1)),l=!0;let u=r.at(-1);u?.type==="text"?(u.raw+=o.raw,u.text+=o.text):r.push(o);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return r}infiniteLoopError(t){let r="Infinite loop on byte: "+t;if(this.options.silent)console.error(r);else throw new Error(r)}},se=class{options;parser;constructor(e){this.options=e||P}space(e){return""}code({text:e,lang:t,escaped:r}){let n=(t||"").match(w.notSpaceStart)?.[0],s=e.replace(w.endingNewline,"")+`
48
- `;return n?'<pre><code class="language-'+S(n)+'">'+(r?s:S(s,!0))+`</code></pre>
49
- `:"<pre><code>"+(r?s:S(s,!0))+`</code></pre>
50
- `}blockquote({tokens:e}){return`<blockquote>
51
- ${this.parser.parse(e)}</blockquote>
52
- `}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
53
- `}hr(e){return`<hr>
54
- `}list(e){let t=e.ordered,r=e.start,n="";for(let l=0;l<e.items.length;l++){let a=e.items[l];n+=this.listitem(a)}let s=t?"ol":"ul",i=t&&r!==1?' start="'+r+'"':"";return"<"+s+i+`>
55
- `+n+"</"+s+`>
56
- `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
57
- `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
58
- `}table(e){let t="",r="";for(let s=0;s<e.header.length;s++)r+=this.tablecell(e.header[s]);t+=this.tablerow({text:r});let n="";for(let s=0;s<e.rows.length;s++){let i=e.rows[s];r="";for(let l=0;l<i.length;l++)r+=this.tablecell(i[l]);n+=this.tablerow({text:r})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
59
- <thead>
60
- `+t+`</thead>
61
- `+n+`</table>
62
- `}tablerow({text:e}){return`<tr>
63
- ${e}</tr>
64
- `}tablecell(e){let t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+`</${r}>
65
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${S(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){let n=this.parser.parseInline(r),s=Je(e);if(s===null)return n;e=s;let i='<a href="'+e+'"';return t&&(i+=' title="'+S(t)+'"'),i+=">"+n+"</a>",i}image({href:e,title:t,text:r,tokens:n}){n&&(r=this.parser.parseInline(n,this.parser.textRenderer));let s=Je(e);if(s===null)return S(r);e=s;let i=`<img src="${e}" alt="${S(r)}"`;return t&&(i+=` title="${S(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:S(e.text)}},Se=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},A=class de{options;renderer;textRenderer;constructor(t){this.options=t||P,this.options.renderer=this.options.renderer||new se,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Se}static parse(t,r){return new de(r).parse(t)}static parseInline(t,r){return new de(r).parseInline(t)}parse(t){this.renderer.parser=this;let r="";for(let n=0;n<t.length;n++){let s=t[n];if(this.options.extensions?.renderers?.[s.type]){let l=s,a=this.options.extensions.renderers[l.type].call({parser:this},l);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){r+=a||"";continue}}let i=s;switch(i.type){case"space":{r+=this.renderer.space(i);break}case"hr":{r+=this.renderer.hr(i);break}case"heading":{r+=this.renderer.heading(i);break}case"code":{r+=this.renderer.code(i);break}case"table":{r+=this.renderer.table(i);break}case"blockquote":{r+=this.renderer.blockquote(i);break}case"list":{r+=this.renderer.list(i);break}case"checkbox":{r+=this.renderer.checkbox(i);break}case"html":{r+=this.renderer.html(i);break}case"def":{r+=this.renderer.def(i);break}case"paragraph":{r+=this.renderer.paragraph(i);break}case"text":{r+=this.renderer.text(i);break}default:{let l='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}parseInline(t,r=this.renderer){this.renderer.parser=this;let n="";for(let s=0;s<t.length;s++){let i=t[s];if(this.options.extensions?.renderers?.[i.type]){let a=this.options.extensions.renderers[i.type].call({parser:this},i);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=a||"";continue}}let l=i;switch(l.type){case"escape":{n+=r.text(l);break}case"html":{n+=r.html(l);break}case"link":{n+=r.link(l);break}case"image":{n+=r.image(l);break}case"checkbox":{n+=r.checkbox(l);break}case"strong":{n+=r.strong(l);break}case"em":{n+=r.em(l);break}case"codespan":{n+=r.codespan(l);break}case"br":{n+=r.br(l);break}case"del":{n+=r.del(l);break}case"text":{n+=r.text(l);break}default:{let a='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}},G=class{options;block;constructor(e){this.options=e||P}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?v.lex:v.lexInline}provideParser(e=this.block){return e?A.parse:A.parseInline}},Wr=class{defaults=ke();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=A;Renderer=se;TextRenderer=Se;Lexer=v;Tokenizer=ne;Hooks=G;constructor(...e){this.use(...e)}walkTokens(e,t){let r=[];for(let n of e)switch(r=r.concat(t.call(this,n)),n.type){case"table":{let s=n;for(let i of s.header)r=r.concat(this.walkTokens(i.tokens,t));for(let i of s.rows)for(let l of i)r=r.concat(this.walkTokens(l.tokens,t));break}case"list":{let s=n;r=r.concat(this.walkTokens(s.items,t));break}default:{let s=n;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(i=>{let l=s[i].flat(1/0);r=r.concat(this.walkTokens(l,t))}):s.tokens&&(r=r.concat(this.walkTokens(s.tokens,t)))}}return r}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{let n={...r};if(n.async=this.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let i=t.renderers[s.name];i?t.renderers[s.name]=function(...l){let a=s.renderer.apply(this,l);return a===!1&&(a=i.apply(this,l)),a}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=t[s.level];i?i.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),n.extensions=t),r.renderer){let s=this.defaults.renderer||new se(this.defaults);for(let i in r.renderer){if(!(i in s))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let l=i,a=r.renderer[l],c=s[l];s[l]=(...o)=>{let p=a.apply(s,o);return p===!1&&(p=c.apply(s,o)),p||""}}n.renderer=s}if(r.tokenizer){let s=this.defaults.tokenizer||new ne(this.defaults);for(let i in r.tokenizer){if(!(i in s))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let l=i,a=r.tokenizer[l],c=s[l];s[l]=(...o)=>{let p=a.apply(s,o);return p===!1&&(p=c.apply(s,o)),p}}n.tokenizer=s}if(r.hooks){let s=this.defaults.hooks||new G;for(let i in r.hooks){if(!(i in s))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let l=i,a=r.hooks[l],c=s[l];G.passThroughHooks.has(i)?s[l]=o=>{if(this.defaults.async&&G.passThroughHooksRespectAsync.has(i))return(async()=>{let u=await a.call(s,o);return c.call(s,u)})();let p=a.call(s,o);return c.call(s,p)}:s[l]=(...o)=>{if(this.defaults.async)return(async()=>{let u=await a.apply(s,o);return u===!1&&(u=await c.apply(s,o)),u})();let p=a.apply(s,o);return p===!1&&(p=c.apply(s,o)),p}}n.hooks=s}if(r.walkTokens){let s=this.defaults.walkTokens,i=r.walkTokens;n.walkTokens=function(l){let a=[];return a.push(i.call(this,l)),s&&(a=a.concat(s.call(this,l))),a}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return v.lex(e,t??this.defaults)}parser(e,t){return A.parse(e,t??this.defaults)}parseMarkdown(e){return(t,r)=>{let n={...r},s={...this.defaults,...n},i=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&n.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let l=s.hooks?await s.hooks.preprocess(t):t,a=await(s.hooks?await s.hooks.provideLexer(e):e?v.lex:v.lexInline)(l,s),c=s.hooks?await s.hooks.processAllTokens(a):a;s.walkTokens&&await Promise.all(this.walkTokens(c,s.walkTokens));let o=await(s.hooks?await s.hooks.provideParser(e):e?A.parse:A.parseInline)(c,s);return s.hooks?await s.hooks.postprocess(o):o})().catch(i);try{s.hooks&&(t=s.hooks.preprocess(t));let l=(s.hooks?s.hooks.provideLexer(e):e?v.lex:v.lexInline)(t,s);s.hooks&&(l=s.hooks.processAllTokens(l)),s.walkTokens&&this.walkTokens(l,s.walkTokens);let a=(s.hooks?s.hooks.provideParser(e):e?A.parse:A.parseInline)(l,s);return s.hooks&&(a=s.hooks.postprocess(a)),a}catch(l){return i(l)}}}onError(e,t){return r=>{if(r.message+=`
66
- Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error occurred:</p><pre>"+S(r.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(r);throw r}}},I=new Wr;function k(e,t){return I.parse(e,t)}k.options=k.setOptions=function(e){return I.setOptions(e),k.defaults=I.defaults,tt(k.defaults),k};k.getDefaults=ke;k.defaults=P;k.use=function(...e){return I.use(...e),k.defaults=I.defaults,tt(k.defaults),k};k.walkTokens=function(e,t){return I.walkTokens(e,t)};k.parseInline=I.parseInline;k.Parser=A;k.parser=A.parse;k.Renderer=se;k.TextRenderer=Se;k.Lexer=v;k.lexer=v.lex;k.Tokenizer=ne;k.Hooks=G;k.parse=k;var rn=k.options,nn=k.setOptions,sn=k.use,an=k.walkTokens,ln=k.parseInline;var on=A.parse,cn=v.lex;k.use({gfm:!0,breaks:!0,async:!1});var Mr=new Ze({whiteList:{ol:["start"],li:["value"],"calcite-table":["caption","bordered","striped","layout","scale","class"],"calcite-table-row":["slot","class"],"calcite-table-header":["heading","alignment","description","class"],"calcite-table-cell":["alignment","colspan","rowspan","class"],pre:["class"],code:["class"]}},!0);function Gr(e){return Mr.sanitize(e)}function pt(e,t){let r=e.indexOf("{",t),n=e.indexOf("[",t);return r===-1?n:n===-1?r:Math.min(r,n)}function jr(e){if(e.trimStart().startsWith("```"))return null;for(let t=pt(e,0);t!==-1;t=pt(e,t+1)){let r=0,n=0;for(let s=t;s<e.length;s++){let i=e[s];if(i==="{"?r++:i==="}"?r--:i==="["?n++:i==="]"&&n--,r<0||n<0)break;if(r===0&&n===0&&s>t)return e.slice(t,s+1)}}return null}function xn(e){if(!e)return"";let t=e,r=jr(e);if(r)try{let i=JSON.parse(r),l=`
67
-
68
- \`\`\`json
69
- ${JSON.stringify(i,null,2)}
70
- \`\`\`
71
-
72
- `;t=e.replace(r,l)}catch{}let n=Zr(t),s=Xr(n);return Gr(s)}function Zr(e){return e?k.parse(e,{async:!1}):""}function Xr(e){if(!e||typeof DOMParser>"u")return e;try{let t=new DOMParser().parseFromString(e,"text/html");return Array.from(t.querySelectorAll("table")).forEach((r,n)=>{let s=t.createElement("calcite-table");s.setAttribute("caption",`Table ${n+1}`),s.setAttribute("striped","true");let i=r.querySelector("thead");if(i){let a=Array.from(i.querySelectorAll("tr"));for(let c of a){let o=t.createElement("calcite-table-row");o.setAttribute("slot","table-header");let p=Array.from(c.querySelectorAll("th, td"));for(let u of p){let f=(u.textContent??"").trim(),h=t.createElement("calcite-table-header");h.setAttribute("heading",f),o.appendChild(h)}s.appendChild(o)}}let l=r.querySelector("tbody");(l?Array.from(l.querySelectorAll("tr")):Array.from(r.querySelectorAll("tr")).filter(a=>!i?.contains(a))).forEach((a,c)=>{let o=t.createElement("calcite-table-row"),p=!i&&c===0&&a.querySelectorAll("th").length>0;p&&o.setAttribute("slot","table-header");let u=Array.from(a.querySelectorAll("th, td"));for(let f of u){if(p&&f.localName==="th"){let m=(f.textContent??"").trim(),L=t.createElement("calcite-table-header");L.setAttribute("heading",m),o.appendChild(L);return}let h=t.createElement("calcite-table-cell"),g=f.getAttribute("colspan"),b=f.getAttribute("rowspan");g&&h.setAttribute("colspan",g),b&&h.setAttribute("rowspan",b),h.innerHTML=f.innerHTML,o.appendChild(h)}s.appendChild(o)}),r.replaceWith(s)}),t.body.innerHTML}catch{return e}}export{Jr as a,xn as b};
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
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"./MAV3DW27.js";import"./ADYIXCSG.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};
@@ -1,54 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"./YIMNOUTF.js";var e=`## Map Query Gate
3
-
4
- ### Input
5
-
6
- Assigned task:
7
- {assignedTask}
8
-
9
- Latest user request:
10
- {userRequest}
11
-
12
- Prior steps:
13
- {priorSteps}
14
-
15
- Use the assigned task as the primary instruction for the current query. The question will **not** be restated again here.
16
- Use the latest user request as supporting context when needed.
17
- Use prior steps only when needed to explain a previous result, failure, or likely next action.
18
-
19
- ### Map Context
20
-
21
- {layerSummary}
22
-
23
- ## Available agents (capabilities)
24
-
25
- {agents}
26
-
27
- ### Rules
28
-
29
- - "What layers are in this map?" \u2192 List the layer names
30
- - "What fields are in this layer?" \u2192 Call the tool to list the field names for that layer
31
- - "What can you do?" / "What can I ask?" \u2192 Suggest specific queries using EXACT layer and field names from the context above
32
- - "Tell me about this map" \u2192 Summarize layers and capabilities
33
- - "Create a chart of all wells ans their depth" \u2192 If a question is map related but not supported by available capabilities, say so. Add that support for this might be added in the future.
34
- - Questions completely unrelated to maps/GIS \u2192 Politely explain you only help with the map |
35
-
36
- ### Response Guidelines
37
-
38
- When suggesting what users can ask, be SPECIFIC using actual layer names:
39
-
40
- - "Show me water sources with elevation above 500"
41
- - "Filter Protected Areas in Panama by protection level"
42
- - "Zoom to Watershed Boundaries"
43
-
44
- For "what can I ask" responses, provide 3-5 specific example queries using fields from the context.
45
-
46
- For off-topic questions:
47
- "I can only help with this map. Try asking me to filter [LayerName] by [FieldName], or zoom to a location."
48
-
49
- Rules:
50
-
51
- - Keep responses concise
52
- - Use bullet points for lists
53
- - Use new lines (\\n) and appropriate formatting in your response
54
- `;export{e as default};
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{g as i,h as t,v as n,z as o}from"./MAV3DW27.js";import"./ADYIXCSG.js";import"./YIMNOUTF.js";var p=i`:host{display:block}`,e=class extends n{static{this.properties={block:0}}static{this.styles=p}_renderSuggestedPrompts(s){if(s.type!=="suggested-prompts")return null;let r=s.data?.prompts,a=Array.isArray(r)?r.filter(c=>typeof c=="string"):[];return a.length?t`<arcgis-assistant-suggested-prompts .prompts=${a}></arcgis-assistant-suggested-prompts>`:null}_renderBlock(s){switch(s.type){case"suggested-prompts":return this._renderSuggestedPrompts(s);case"text":return t`<arcgis-assistant-message-text .content=${s.data?.content}></arcgis-assistant-message-text>`;default:return null}}render(){return this.block?this._renderBlock(this.block):null}};o("arcgis-assistant-message-block",e);export{e as ArcgisAssistantMessageBlock};
@@ -1,2 +0,0 @@
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"./MAV3DW27.js";import"./ADYIXCSG.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};
@@ -1,14 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import c from"./HOCTVCHH.js";import b from"./QZVAGRWA.js";import a from"./NRMBMWI5.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"./MAV3DW27.js";import"./ADYIXCSG.js";import{a as n}from"./4RZPOYZ7.js";import"./6LZ6GOHF.js";import{a as w,b as h,q as E,ta as I}from"./CJIV4KJZ.js";import"./IKEF7ZHH.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}),p=a.map(({layerId:c,results:d})=>{let g=d.map(s=>` - ${s.name} (${s.score.toFixed(2)})`).join(`
3
- `);return`${i.get(c)?.layerItem.name??c}:
4
- ${g}`}).join(`
5
- `),l;return a.length>0?l=`Vector search completed. Matching layers and fields with scores:
6
- ${p}`: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),p=o.map(({id:c,score:d})=>`${i.get(c)?.layerItem.name??c} (${d.toFixed(2)})`).join(`
7
- `),l;return a.length>0?l=`Vector search completed. Matching layers with scores:
8
- ${p}`: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
- `);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:p}=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 p){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!==y.id||i.id!=="reviewLayerSelection"){let a={agentId:y.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
- _Example: “Color points by sales amount”_
12
- _Example: “Show population density with a color gradient”_
13
- _Example: “Create a relationship map between height and depth”_
14
- _Example: “Vary circle sizes according to population”_`,y={id:"layerStyling",name:"Layer Styling Agent",description:te,createGraph:ee,workspace:u};var f=class extends x{constructor(){super(...arguments),this.agent=y}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)
@@ -1,36 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import c from"./QZVAGRWA.js";import a from"./NRMBMWI5.js";import{a as L,c as R}from"./RUURNLTP.js";import"./5W7S2RS4.js";import"./NXKKG5TK.js";import{v as E,z as $}from"./MAV3DW27.js";import"./ADYIXCSG.js";import{a as d}from"./4RZPOYZ7.js";import"./6LZ6GOHF.js";import{a as N,b as T,ta as b}from"./CJIV4KJZ.js";import"./IKEF7ZHH.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
- ${l.map(p=>`- ${p}`).join(`
5
- `)}`:"",o=(e.intent==="goToLayer"||e.intent==="goToFeatures")&&e.vectorSearchLayerResults?.length?`Candidate layers:
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
- ${c.map(o=>`${o.layerName??o.layerId}:
15
- ${o.results.map(m=>` - ${m.name} (${m.score.toFixed(2)})`).join(`
16
- `)}`).join(`
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
- 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
-
20
- Supported actions:
21
- - **Zooming**: Adjust the map's zoom level (e.g., "Zoom to level 10", "Zoom in").
22
- - **Viewpoints**: Navigate to a specific center point with optional zoom or scale (e.g., "Center the map on San Francisco at zoom level 16").
23
- - **Scales**: Set the map to a specific scale (e.g., "Set the map scale to 1:50,000").
24
- - **Layers**: Zoom to the full extent of a specific layer (e.g., "Go to the water mains layer"). For the purposes of link charts, if the user requests to go to the extent of a link chart or the entities/nodes within it, that should be treated as a request to use the goToLayer tool on the link chart layer
25
- - **Features**: Zoom to features in a layer that match a filter (e.g., "Zoom to all schools in the city").
26
- - **Bookmarks**: Navigate to a predefined bookmark extent (e.g., "Go to the Downtown bookmark").
27
- - **Extents**: Reset to the initial web map extent or zoom to the full world extent (e.g., "Reset the map", "Zoom to the full world extent").
28
- - **Addresses**: Zoom to an address or place name (e.g., "Zoom to 1600 Pennsylvania Ave").
29
-
30
- _Example: “Zoom to Texas”_
31
- _Example: “Go to the water mains layer”_
32
- _Example: “Zoom to to the extent of my link chart”_
33
- _Example: “Center the map on San Francisco at scale 50000”_
34
- _Example: “Zoom to the features in the schools layer where city = 'Austin'”_
35
- _Example: “Go to the Downtown bookmark”_
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)
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{g as t,h as e,t as i,u as a,v as o,z as r}from"./MAV3DW27.js";import"./ADYIXCSG.js";import"./YIMNOUTF.js";export default $arcgis.t(([l,{watch:n}])=>{var c=t`.messages-container{display:flex;flex:1;flex-direction:column;line-height:var(--calcite-font-line-height-relative-snug)}.messages-list{padding:var(--calcite-spacing-lg);display:flex;flex-direction:column;gap:var(--calcite-spacing-xxl);flex:1 1 auto;min-height:0;justify-content:flex-end;overflow:auto}`,s=class extends o{constructor(){super(...arguments),this.#s=i(),this.loading=!1,this.messages=new l([]),this.interrupt=null}static{this.properties={loading:5,messages:0,interrupt:0}}static{this.styles=c}#s;firstUpdated(){this._scrollToEnd()}loaded(){this.manager.onLifecycle(()=>[this.messages.on("change",()=>{this._scrollToEnd()}),n(()=>[this.loading,this.interrupt],()=>{this._scrollToEnd()})])}_scrollToEnd(){requestAnimationFrame(()=>{this.#s.value?.scrollIntoView({behavior:"smooth"})})}render(){return e`<div class="messages-container"><div class="messages-list"><slot name=message-starter></slot><slot name=messages></slot><slot name=message-loading></slot></div><div ${a(this.#s)}></div></div>`}};r("arcgis-assistant-chat",s);return s},"core/Collection","core/reactiveUtils")
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as i,b as o}from"./CE6VDP2D.js";import{g as a,h as c,v as e,z as r}from"./MAV3DW27.js";import"./ADYIXCSG.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,22 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import b from"./QZVAGRWA.js";import a from"./NRMBMWI5.js";import{a as y,c as E}from"./RUURNLTP.js";import"./5W7S2RS4.js";import"./NXKKG5TK.js";import{v as u,z as d}from"./MAV3DW27.js";import"./ADYIXCSG.js";import{a as p}from"./4RZPOYZ7.js";import"./6LZ6GOHF.js";import{a as h,b as l,ta as f}from"./CJIV4KJZ.js";import"./IKEF7ZHH.js";import"./WNS5ZUF5.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([,,,,,,,,,,,,,,,,,{l:x},{I:c,J:H,a:S,m:_,n:w,o:m,p:v}])=>{var C=[H],b=e=>{if(!e||e.size===0)return"No layers available in this map.";let t=Array.from(e.values()).map(({layerItem:o,fieldRegistry:a},s)=>{let r=Array.from(a.values()).map(n=>n.name).slice(0,10).join(", "),i=a.size>10?` (and ${a.size-10} more)`:"";return`${s+1}. "${o.title}". Description: ${o.description}
3
- Fields: ${r}${i}`}).join(`
4
-
5
- `);return`This map contains ${e.size} layer(s):
6
-
7
- ${t}`},k=e=>{let t=e?.list()??[];return t.length?t.map(o=>`- ${o.agent.name}: ${o.agent.description}`).join(`
8
- `):"No agents currently available."};async function I(e,t){let o=await _("help_prompt"),a=m(t,"layersAndFieldsRegistry"),s=m(t,"agentRegistry");try{let r=await x({promptText:o,modelTier:"fast",config:t,tools:C,inputVariables:{layerSummary:b(a),agents:k(s),assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps}}),i=(r.tool_calls?.length??0)>0,n=typeof r.text=="string"?r.text.trim():"";return{...e,helpInternalState:{...e.helpInternalState,toolCallMessage:i?r:void 0},outputMessage:i?e.outputMessage:n,summary:i?"Prepared help tool call from assigned task.":"Provided map-related help based on the assigned task.",status:i?e.status:"success"}}catch(r){let i=r instanceof Error?r.message:String(r);return{...e,outputMessage:`Error invoking help agent: ${i}`,summary:"Help agent execution failed.",status:"failed"}}}var M=(e,t)=>v(["agentRegistry"],"Help Agent")(e,t);async function T(e,t){let o=new S(C,{handleToolErrors:!1});try{let a=e.helpInternalState.toolCallMessage;if(!a)throw new Error("helpToolCalling: missing helpInternalState.toolCallMessage");let s=(await o.invoke({messages:[a]},t)).messages.map(r=>r.text).join(`
9
- `);return await p({text:`Finished executing help tool: ${s}`},t),{...e,outputMessage:s,status:"success",summary:s?w(s):"Help executed.",helpInternalState:{...e.helpInternalState,toolCallMessage:void 0}}}catch(a){let s=a instanceof Error?a.message:String(a);return await p({text:`Help tool execution failed: ${s}`},t),{...e,outputMessage:`Help tool execution failed: ${s}`,status:"failed",summary:`Help tool execution failed: ${s}`,helpInternalState:{...e.helpInternalState,toolCallMessage:void 0}}}}var q=()=>new f(c).addNode("requireHelpServices",M).addNode("agent",I).addNode("tools",T).addEdge(h,"requireHelpServices").addEdge("requireHelpServices","agent").addConditionalEdges("agent",e=>e.helpInternalState.toolCallMessage?"tools":l).addEdge("tools",l),A=String.raw`- **help** — Enables users to ask questions about the map, layers, fields, and it's capabilities.
10
-
11
- _Example: “Tell me about this map”_
12
- _Example: “List all layers in this map”_
13
- _Example: “List fields in protected areas layer”_
14
- _Example: “What agents are available to me?”_
15
- _Example: “What can you do?”_
16
- _Example: “What can I ask”_
17
-
18
- Even if the user asks unrelated queries like "What are the vowels in English alphabet" or "How to cook", call this agent.
19
-
20
- IF the user asks map related queries, but those that are not performed by any of the agents, call this agent so we can respond accordingly.
21
- _Example: "Create a chart"_
22
- _Example: "Create a table"_`,$={id:"help",name:"Help Agent",description:A,createGraph:q,workspace:c};var g=class extends u{constructor(){super(...arguments),this.agent=$}static{this.properties={referenceElement:1}}#e;getContext(){if(!this.#e)throw new Error("arcgis-assistant-help-agent requires a mapView");return{mapView:this.#e}}load(){this.#e=y(this,"arcgis-assistant-help-agent"),E(this)}};d("arcgis-assistant-help-agent",g);return g},"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)
@@ -1,3 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as x}from"./434TAA3J.js";import a from"./NRMBMWI5.js";import{a as F}from"./E2HENO3T.js";import"./QSA4T3BU.js";import{a as Y}from"./5W7S2RS4.js";import"./NXKKG5TK.js";import{g as A,h,k as L,l as P,n as p,t as v,u as E,v as M,x as I,z as O}from"./MAV3DW27.js";import{b as D}from"./ADYIXCSG.js";import{a as y}from"./4RZPOYZ7.js";import"./6LZ6GOHF.js";import{U as N,a as W,b as q,ta as U,u as j}from"./CJIV4KJZ.js";import{Z as H,ja as T}from"./IKEF7ZHH.js";import"./WNS5ZUF5.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([Re,{whenOnce:$e,watch:Ae,when:Le},Pe,re,ie,K,ne,ae,De,,,Me,{property:f,subclass:Oe},{a:z,d:V,e:S,g:G,h:B,i:Q}])=>{var oe=async r=>{let e=await ce(),t=await z("default"),i=ie.getDefault(),s=(await re.getCredential(`${i.url}/sharing`)).token,o={type:"generateEmbeddings",webmapEmbeddings:r,auth:{apiUrl:t,token:s}};return e.postMessage(o),await new Promise((n,a)=>{let c=d=>{d.data==="completed"&&(e.removeEventListener("message",c),n())},l=d=>{e.removeEventListener("message",c),a(d instanceof Error?d:new Error("Embeddings worker error"))};e.addEventListener("message",c),e.addEventListener("error",l,{once:!0})}),e},ce=async()=>{{let r=(await import("./23EQTPO3.js")).default;return new r}},le=r=>{r.currentIntent="none"},de=async(r,e)=>{let t=S(e);if(r.agentExecutionContext.userRequest){let s=new T(r.agentExecutionContext.userRequest.trim());r.agentExecutionContext.messages=[...r.agentExecutionContext.messages,s],le(r)}let i=t?.services.agentRegistry.list().map(s=>s.agent.id)??[];return await y({text:`Available agents: ${[...i].join(", ")}`},e),await y({text:"Analyzing user input"},e),r},ge=async(r,e)=>(await y({text:"Exiting..."},e),r),J=r=>typeof r=="object"&&r!==null&&!Array.isArray(r),he=(r,e)=>{if(!J(r)){r!==void 0&&console.warn(`Agent "${e}" returned invalid sharedStatePatch. Ignoring it.`);return}let t={};for(let[i,s]of Object.entries(r)){if(!J(s)||!("value"in s)){console.warn(`Agent "${e}" returned invalid sharedStatePatch entry for key "${i}". Ignoring that entry.`);continue}t[i]={value:s.value}}return t},ue=r=>{let{previousSharedState:e,patch:t,agentId:i}=r;if(!t)return e;let s=Date.now(),o={...e};for(let[n,a]of Object.entries(t))a?.value!==void 0&&(o[n]={value:a.value,meta:{updatedByAgentId:i,updatedAt:s}});return o},X=r=>typeof r!="string"?void 0:r.trim()||void 0,pe=r=>{switch(r){case"failed":return"Agent failed without a summary.";case"unknown":return"Agent returned with unknown status.";case"success":return"Agent completed without a summary.";default:return"Agent completed without a summary."}},me=(r,e)=>{let t=X(e?.outputMessage),i=X(e?.summary),s=e?.status,o=s==="success"||s==="failed"?s:"unknown";o==="unknown"&&console.warn(`Agent "${r}" returned missing/invalid status. Defaulting to "unknown".`);let n=he(e?.sharedStatePatch,r);return{outputMessage:t,summary:i??t??pe(o),status:o,sharedStatePatch:n}},Z=4e3,ye=async(r,e)=>{let t=S(e);if(e?.signal?.aborted)return await y({text:"Run cancelled; skipping agent execution"},e),{...r,currentIntent:"none",requiresFollowUp:!1};let{agentRegistry:i}=t?.services??{},s=i?.get(r.currentIntent);if(!s)return console.warn(`No agent found for intent: ${r.currentIntent}`),r;await y({text:`Executing registered agent: ${s.agent.name}`},e);let o={...e??{},configurable:{...t??{},agentId:s.agent.id,context:s.getContext?await s.getContext():void 0}},n;try{let l=await s.agent.createGraph().compile().invoke({agentExecutionContext:{...r.agentExecutionContext,messages:[...r.agentExecutionContext.messages],priorSteps:structuredClone(r.agentExecutionContext.priorSteps??[]),sharedState:structuredClone(r.agentExecutionContext.sharedState??{})}},o);n=me(s.agent.name,l),await y({text:`Finished executing registered agent: ${s.agent.name}`},e)}catch(l){if(j(l)||e?.signal?.aborted||l instanceof Error&&l.name==="AbortError")throw l;let d=l instanceof Error?l.message:String(l);console.error(`Agent "${s.agent.name}" failed:`,l),await y({text:`Registered agent failed: ${s.agent.name}. ${d}`},e),n={status:"failed",outputMessage:`Agent execution failed: ${d}`,summary:`Agent execution failed: ${d}`}}let a=n.outputMessage,c=[...r.agentExecutionContext.messages];if(a){let l=a.length>Z?`${a.slice(0,Z-14)}
3
- [truncated]`:a;c.push(new H(l))}return{...r,stepCount:r.stepCount+1,lastExecutedAgent:s.agent.id,requiresFollowUp:n.status==="failed"?!0:r.requiresFollowUp,finalOutputMessage:a??"",agentExecutionContext:{...r.agentExecutionContext,messages:c,priorSteps:[...r.agentExecutionContext.priorSteps??[],{agentId:s.agent.id,assignedTask:r.agentExecutionContext.assignedTask,summary:n?.summary||"No summary provided.",status:n?.status||"unknown"}],sharedState:ue({previousSharedState:r.agentExecutionContext.sharedState,patch:n.sharedStatePatch,agentId:s.agent.id})}}},we=3,be=()=>new U(V).addNode("ingestInput",de).addNode("intentLLM",B).addNode("executeRegisteredAgent",ye).addNode("exit",ge).addEdge(W,"ingestInput").addEdge("ingestInput","intentLLM").addConditionalEdges("intentLLM",r=>r.currentIntent==="none"||r.currentIntent===r.lastExecutedAgent?"exit":"executeRegisteredAgent").addConditionalEdges("executeRegisteredAgent",r=>r.stepCount>=we||!r.requiresFollowUp?"exit":"intentLLM").addEdge("exit",q),C=class{constructor(){this.agentRegistry=new Map}register(e){let{agent:t}=e;if(this.agentRegistry.has(t.id))throw new Error(`Duplicate agent id: ${t.id}`);this.agentRegistry.set(t.id,e)}get(e){return this.agentRegistry.get(e)}list(){return[...this.agentRegistry.values()]}},R=class{constructor(e,t){this.graph=e,this.config={...t}}async waitForUser(){return await new Promise((e,t)=>{this.resolveWait=e,this.rejectWait=t})}handle(e,t){try{let i={agentId:e.agentId,id:e.id,payload:t},s=this.graph.streamEvents(null,{...this.config,configurable:{...this.config.configurable,hitlResponse:i},subgraphs:!0,version:"v2"});this.resolveWait?.(s)}catch(i){this.rejectWait?.(i)}finally{this.resolveWait=void 0,this.rejectWait=void 0}}cancel(){this.rejectWait&&(this.rejectWait(new Error("Request cancelled by user.")),this.resolveWait=void 0,this.rejectWait=void 0)}},fe=async r=>{try{return await(await G()).embedDocuments(r)}catch(e){throw console.error("Failed to generate embeddings:",e),e}},ee=async(r,e)=>{let t=e.get(r);if(t)return t;let i=await fe([r]);return e.set(r,i[0]),i[0]};async function ve(r,e,t,i){let s=`req-${Date.now()}`,o={type:"layerSearch",precomputedEmbedding:i?await ee(r,i):void 0,requestId:s,minScore:t};return await new Promise(n=>{let a=c=>{c.data.requestId===s&&n(c.data.results)};e.addEventListener("message",a,{once:!0}),e.postMessage(o)})}function Ee(r){let{worker:e}=r;return{async searchLayers({text:t,minScore:i,embeddingCache:s}){return await ve(t,e,i,s)}}}var _e=async({combinedQuery:r,layerIds:e,embeddingsWorker:t,minScore:i,topResults:s,embeddingCache:o})=>{let n=`req-${Date.now()}`,a=o?await ee(r,o):void 0,c={type:"fieldSearch",layerIdForFieldsSearch:e,precomputedEmbedding:a,requestId:n,minScore:i,topResults:s};return await new Promise(l=>{let d=u=>{if(u.data.requestId!==n)return;let g=u.data.results.map(({layerId:b,results:k})=>({layerId:b,results:k}));l(g)};t.addEventListener("message",d,{once:!0}),t.postMessage(c)})};function ke(r){let{worker:e}=r;return{async searchFields({text:t,layerIds:i,minScore:s,topResults:o,embeddingCache:n}){return await _e({combinedQuery:t,layerIds:i,embeddingsWorker:e,minScore:s,topResults:o,embeddingCache:n})}}}var Ie=r=>{let e=Q.safeParse(r);if(!e.success)throw new Error("Embeddings response validation failed. Regenerate embeddings.");return e.data},Se=(r,e)=>{let t=new Map,i=new Map;if(e.allLayers.forEach(s=>{s instanceof ne&&i.set(s.id,s)}),r.length!==i.size)throw new Error("Layer count mismatch during registry restoration. Regenerate embeddings.");for(let s of r){let o=i.get(s.id);if(!o)throw new Error(`Layer with ID ${s.id} not found in the original map during registry restoration. Regenerate embeddings.`);if(s.fields.length!==o.fields.length)throw new Error(`Field count mismatch for layer ID ${s.id} during registry restoration. Regenerate embeddings.`);let n={name:s.name,title:s.title,description:s.description},a=new Map;for(let c of s.fields){let l=o.fieldsIndex.get(c.name);if(!l)throw new Error(`Field with name ${c.name} not found in the original layer ${s.id} during registry restoration. Regenerate embeddings.`);a.set(c.name,{name:c.name,alias:o.getFieldAlias(c.name)??c.alias,description:c.description,type:l.type||"unknown",valueType:l.valueType||"unknown",domain:o.getFieldDomain(c.name)??void 0})}t.set(s.id,{layerItem:n,fieldRegistry:a})}return t},xe=async r=>{try{return(await ae(r,{responseType:"json"})).data}catch(e){throw new Error(`Failed to fetch data from ${r}: ${String(e)}`)}},Ce=async r=>{let e=r.map;if(!e?.portalItem)throw new Error("WebMap portal item is missing.");let{resources:t}=await e.portalItem.fetchResources(),i=t.find(o=>o.resource.path==="embeddings-v01.json");if(!i?.resource.url)throw new Error("Embeddings resource 'embeddings-v01.json' not found in the webmap portal item.");let s=await xe(i.resource.url);return Ie(s)},_=class r{constructor(){this.orchestratorReady=!1,this.chatHistory=[],this.priorSteps=[],this.sharedState={},this.agentRegistry=new C,this.activeRunId="",this.cancelledRunIds=new Set,this.streamEpoch=0}static async init(e){let t=new r;try{if(e.view?.map){await K.whenOnce(()=>e.view.ready);let i=await Ce(e.view),s=Se(i.layers,e.view.map);t.layersAndFieldsRegistry=s,t.embeddingsWorker=await oe(i)}return e.agents?.forEach(i=>{t.agentRegistry.register(i)}),t.orchestratorReady=!0,t}catch(i){throw console.error("Orchestrator initialization failed:",i),i}}async*ask(e){if(!this.orchestratorReady)throw new Error("Orchestrator is not ready yet.");if(!this.agentRegistry.list().length)throw new Error("Orchestrator has no registered agents.");if(++this.streamEpoch,!e.trim())return;let t=D();this.activeRunId=t,this.activeAbortController=new AbortController,this.graph||(this.graph=be().compile({checkpointer:new N}));let i=this.embeddingsWorker?Ee({worker:this.embeddingsWorker}):void 0,s=this.embeddingsWorker?ke({worker:this.embeddingsWorker}):void 0,o=new Map,n={thread_id:t,hitlResponse:null,services:{layerSearch:i,fieldSearch:s,layersAndFieldsRegistry:this.layersAndFieldsRegistry,agentRegistry:this.agentRegistry,embeddingCache:o}},a={version:"v2",streamMode:"custom",signal:this.activeAbortController.signal,configurable:n,subgraphs:!0},c=this.graph?.streamEvents({agentExecutionContext:{userRequest:e,messages:this.chatHistory,priorSteps:this.priorSteps,sharedState:this.sharedState}},a),l=++this.streamEpoch;if(yield*this.pipeStream(c,l,t),this.isRunCancelled(t)){yield{runId:t,timestamp:Date.now(),type:"cancelled",reason:"user"};return}for(;;){if(this.isRunCancelled(t)){yield{runId:t,timestamp:Date.now(),type:"cancelled",reason:"user"};return}let u=(await this.graph.getState(a,{subgraphs:!0})).tasks.find(g=>g.interrupts.length>0)?.interrupts[0]?.value;if(!u)break;this.currentInterrupt=u,this.interruptHandler=new R(this.graph,a),yield{runId:t,timestamp:Date.now(),type:"interrupt",interrupt:u};try{let g=await this.interruptHandler.waitForUser(),b=++this.streamEpoch;yield*this.pipeStream(g,b,t)}catch(g){if(this.isRunCancelled(t)){yield{runId:t,timestamp:Date.now(),type:"cancelled",reason:"user"};return}if(g){yield{runId:t,timestamp:Date.now(),type:"error",error:{message:g?.message}};return}}}if(this.isRunCancelled(t)){yield{runId:t,timestamp:Date.now(),type:"cancelled",reason:"user"};return}let d=(await this.graph.getState(a,{subgraphs:!0})).values;if(this.isRunCancelled(t)){yield{runId:t,timestamp:Date.now(),type:"cancelled",reason:"user"};return}this.chatHistory=d.agentExecutionContext.messages.length?d.agentExecutionContext.messages:this.chatHistory,this.priorSteps=d.agentExecutionContext.priorSteps?.slice(-5)??[],this.sharedState=d.agentExecutionContext.sharedState??{},yield{runId:t,timestamp:Date.now(),type:"completed",result:{content:d.finalOutputMessage}}}newConversation(){this.chatHistory=[],this.priorSteps=[],this.sharedState={}}resumeInterrupt(e){if(!this.currentInterrupt||!this.interruptHandler)throw new Error("No pending interrupt to resume.");this.interruptHandler.handle(this.currentInterrupt,e)}cancelInterrupt(){this.interruptHandler&&this.interruptHandler.cancel()}cancel(){this.activeRunId&&(this.cancelledRunIds.add(this.activeRunId),this.activeAbortController?.abort(),++this.streamEpoch,this.interruptHandler?.cancel())}async*pipeStream(e,t,i){for await(let s of e){if(this.isRunCancelled(i)||t!==this.streamEpoch)break;s.event==="on_custom_event"&&s.name==="trace_message"?yield{runId:i,timestamp:Date.now(),type:"trace",data:s.data}:s.name==="graph_ux_suggestion"&&(yield{runId:i,timestamp:Date.now(),type:"ux-suggestion",suggestion:s.data})}}isRunCancelled(e){return this.cancelledRunIds.has(e)}dispose(){this.embeddingsWorker&&(this.embeddingsWorker.terminate(),this.embeddingsWorker=void 0),this.orchestratorReady=!1}};var Fe=A`:host{display:block;width:var(--arcgis-internal-panel-width, 100%);height:var(--arcgis-internal-expand-max-height, 100%);--calcite-panel-content-bottom-space: 0}.footer-container{display:flex;flex-direction:column;flex:1 1 0;gap:var(--calcite-spacing-md)}.content-container{display:flex;flex-direction:column;flex:1 1 0;min-height:0;position:relative;overflow:auto}.suggested-prompts-container{display:flex;justify-content:center;width:100%;background:var(--calcite-panel-background-color, var(--calcite-color-background))}.suggested-prompts{display:block;padding:var(--calcite-spacing-md);max-width:100%;box-sizing:border-box}.error-notice{padding:var(--calcite-spacing-sm)}.interrupt-waiting-message{font-style:italic;color:var(--calcite-color-text-2)}`,We=Object.defineProperty,qe=Object.getOwnPropertyDescriptor,w=(r,e,t,i)=>{for(var s=i>1?void 0:i?qe(e,t):e,o=r.length-1,n;o>=0;o--)(n=r[o])&&(s=(i?n(e,t,s):n(s))||s);return i&&s&&We(e,t,s),s},je=async r=>await new Promise(e=>setTimeout(e,r)),te=r=>!r||typeof r!="object"?!1:r.name==="AbortError";async function*He(r,{chunkSize:e=5,delay:t=20}={}){let i=0;for(;i<r.length;)yield r.slice(i,i+e),i+=e,await je(t)}async function*se(r,e,t,i){for await(let s of He(r)){if(i?.aborted){yield{type:"cancelled",log:t,runId:e};return}yield{type:"block-data",blockType:"text",data:{content:s},runId:e}}}var m=class extends Me{constructor(r){super(r),this.view=null,this.loading=!1,this.processing=!1,this.processingStep=""}async load(){this._set("loading",!0);try{await this._initialize()}finally{this._set("loading",!1)}}destroy(){this.orchestrator?.dispose(),super.destroy()}async _initialize(){this.removeHandles(),await Promise.all([this.portal.load(),this.view?.when()]),this.view&&await $e(()=>!this.view.updating),this._set("orchestrator",await _.init({agents:[...this.agents],view:this.view??void 0})),this.addHandles([Ae(()=>[this.view,this.agents],()=>{this._initialize()})])}clearChatHistory(){this.orchestrator?.newConversation()}async*ask(r,e){if(!this.orchestrator)throw new Error("Orchestrator not initialized yet.");this._set("processing",!0),this._set("processingStep","");let t=[],i,s="pending";try{let o=this.orchestrator.ask(r);for await(let n of o)switch(s=n.runId,n.type){case"trace":{this._set("processingStep",n.data.text),t.push(n.data.text);break}case"completed":{this._set("processing",!1),this._set("processingStep","");let a=n.result,c=!!a.content.length,l=!!i?.length;if(!c&&!l){yield{type:"completed",error:"No response received.",log:t,runId:s};return}let d=a.content;if(yield{type:"block-start",blockType:"text",runId:s},yield*se(d,s,t,e),yield{type:"block-end",blockType:"text",runId:s},l)for(let u of i){if(e?.aborted){yield{type:"cancelled",log:t,runId:s};return}let{type:g,data:b}=u;if(yield{type:"block-start",blockType:g,runId:s},g==="text"){let k=typeof b?.content=="string"?b.content:"";yield*se(k,s,t,e)}else yield{type:"block-data",blockType:g,data:b,runId:s};yield{type:"block-end",blockType:g,runId:s}}yield{type:"completed",response:d,blocks:i,log:t,runId:s};return}case"ux-suggestion":{let a=n.suggestion;i=i?[...i,a]:[a];break}case"interrupt":{let{kind:a,message:c,metadata:l}=n.interrupt,d=Array.isArray(l)?l.filter(g=>typeof g=="string"):[],u=(()=>{switch(a){case"booleanChoice":return{type:"boolean-choice",message:c,options:d};case"singleSelection":return{type:"single-select",message:c,options:d};case"multipleSelection":return{type:"multi-select",message:c,options:d};case"textInput":return{type:"text-input",message:c};default:return{type:a,message:c,options:d}}})();this._set("processingStep","Waiting for user input..."),yield{type:"interrupt",payload:u,runId:s};break}case"cancelled":{yield{type:"cancelled",log:t,runId:s};return}case"error":{if(e?.aborted||te(n.error)){yield{type:"cancelled",log:t,runId:s};return}yield{type:"completed",error:n.error.message,log:t,runId:s};return}default:{console.warn("Unknown event type:",n);break}}}catch(o){if(e?.aborted||te(o)){yield{type:"cancelled",log:t,runId:s};return}console.warn("Error during message processing:",o),yield{type:"completed",error:"An error occurred during message processing.",log:t,runId:"error"};return}finally{this._set("processing",!1)}}cancel(){this.orchestrator?.cancel()}};w([f({readOnly:!0})],m.prototype,"orchestrator",2);w([f()],m.prototype,"agents",2);w([f()],m.prototype,"portal",2);w([f()],m.prototype,"view",2);w([f({readOnly:!0})],m.prototype,"loading",2);w([f({readOnly:!0})],m.prototype,"processing",2);w([f({readOnly:!0})],m.prototype,"processingStep",2);m=w([Oe("OrchestratorController")],m);var Te="Embeddings resource 'embeddings-v01.json' not found in the webmap portal item.",Ne="Embeddings not found for this web map.",Ue="https://developers.arcgis.com/javascript/latest/agentic-apps/ai-webmap-setup/#embeddings",$=class extends M{constructor(){super(...arguments),this._messages=F({blocking:!0}),this.#e=v(),this.#a=v(),this.#s=v(),this.#t=null,this.#o=new Map,this.#r=Pe.getDefault(),this.#i=e=>{e.stopPropagation(),this.cancelInterrupt()},this.#n=e=>{e.stopPropagation();let t=e.detail;this.submitInterrupt(t)},this.#c=e=>{e.stopPropagation(),this.keepSuggestedPrompts||(this.suggestedPrompts=[]);let t=e.detail;this._inputValue="",this.arcgisSubmit.emit(t),this.submitMessage(t)},this.#l=e=>{if(this._canceling=!0,e.stopPropagation(),this.arcgisCancel.emit(),this._interrupt){this.orchestrator?.cancelInterrupt(),this._interrupt=null;return}this._orchestratorController?.cancel(),this.#t?.abort(),this.#t=null},this.#d=e=>{e.stopPropagation();let t=e.detail;this.arcgisFeedback.emit(t)},this.#g=e=>{e.stopPropagation();let t=e.detail;this._inputValue=t.prompt,this.arcgisPromptSelect.emit(t)},this.#h=e=>{this.arcgisSlottableRequest.emit(e.detail)},this._orchestratorController=null,this._interrupt=null,this._interruptDetails=[],this._error=null,this._inputValue="",this._isAnswering=!1,this._canceling=!1,this.messages=new Re([]),this.referenceElement=null,this.suggestedPrompts=[],this.feedbackEnabled=!1,this.keepSuggestedPrompts=!1,this.logEnabled=!1,this.copyEnabled=!1,this.voiceInputEnabled=!1,this.readAloudEnabled=!1,this.assistantAvatarEnabled=!1,this.arcgisCancel=p(),this.arcgisError=p(),this.arcgisFeedback=p(),this.arcgisInterrupt=p(),this.arcgisInterruptCancel=p(),this.arcgisInterruptSubmit=p(),this.arcgisPromptSelect=p(),this.arcgisReady=p(),this.arcgisSubmit=p(),this.arcgisSlottableRequest=p({bubbles:!1,composed:!1}),this.arcgisResponse=p()}static{this.properties={_orchestratorController:16,_interrupt:16,_interruptDetails:16,_error:16,_inputValue:16,_isAnswering:16,_signedInUserId:16,_canceling:16,_isSignedIn:16,_user:16,awaitingResponse:32,awaitingResponseStep:32,interrupt:32,messages:0,orchestrator:32,entryMessage:1,heading:1,description:1,referenceElement:1,suggestedPrompts:0,feedbackEnabled:5,keepSuggestedPrompts:5,logEnabled:5,copyEnabled:5,voiceInputEnabled:5,readAloudEnabled:5,assistantAvatarEnabled:5}}static{this.styles=Fe}#e;#a;#s;#t;#o;#r;#i;#n;#c;#l;#d;#g;#h;async#u(){try{let e=Y(this.el,this.referenceElement);await e?.componentOnReady();let t=[...this.#o.values()];return t.length?(this._orchestratorController?.destroy(),this._orchestratorController=new m({agents:t,portal:this.#r,view:e?.view}),await this._orchestratorController.load(),!0):(this._error="No agents found.",!1)}catch(e){return this._error=e?.message??"Error initializing orchestrator.",P(this)(e),!1}}get _isSignedIn(){return!!this.#r?.user||!!this._signedInUserId}get _user(){return this.#r?.user?.fullName||this.#r?.user?.username}get awaitingResponse(){return this._orchestratorController?.processing??!1}get awaitingResponseStep(){return this._orchestratorController?.processingStep??""}get interrupt(){return this._interrupt}get orchestrator(){return this._orchestratorController?.orchestrator}async clearChatHistory(){this._reset(),this._orchestratorController?.clearChatHistory()}cancelInterrupt(){this.arcgisInterruptCancel.emit(),this.orchestrator?.cancelInterrupt(),this._interrupt=null}register(e){this.#o.set(e.agent.id,e)}async submitMessage(e){let t=e.trim();if(!t||(this.messages.push({id:Date.now().toString(),role:"user",content:t}),!this._orchestratorController))return;this.#t=new AbortController;let i=this._orchestratorController.ask(t,this.#t?.signal);for await(let s of i){let o=s.runId,n=this.messages.at(-1);switch(s.type){case"block-start":{this._isAnswering=!0;let a={type:s.blockType,isPending:!0};if(n?.role==="assistant"&&n.id===o){let c=[...n.blocks??[],a];this.messages.splice(-1,1,{...n,blocks:c})}else this.messages.push({role:"assistant",blocks:[a],id:o,isStreaming:!0,interrupts:this._interruptDetails}),this._interruptDetails=[];break}case"block-data":{if(n?.role!=="assistant"||n?.id!==o)break;let a=[...n.blocks??[]],c=a[a.length-1],{blockType:l,data:d}=s;if(c?.type!==l||!c.isPending)break;if(l==="text"){let u=typeof c.data?.content=="string"?c.data.content:"",g=typeof d?.content=="string"?d.content:"";a[a.length-1]={...c,data:{...c.data,content:u+g}}}else a[a.length-1]={...c,data:{...c.data,...d??{}}};this.messages.splice(-1,1,{...n,blocks:a});break}case"block-end":{if(n?.role!=="assistant"||n?.id!==o)break;let a=[...n.blocks??[]],c=a[a.length-1];if(c?.type!==s.blockType||!c.isPending)break;let l=c;a[a.length-1]={...l,data:{...l.data},isPending:!1},this.messages.splice(-1,1,{...n,blocks:a});break}case"completed":s.error?(this.messages.push({role:"assistant",log:s.log,error:s.error,id:o,interrupts:this._interruptDetails}),this._interruptDetails=[]):n?.role==="assistant"&&n.id===o&&this.messages.splice(-1,1,{...n,content:s.response,blocks:n.blocks?.map(a=>({...a,isPending:!1}))??[],isStreaming:!1,log:s.log}),this._isAnswering=!1,this.#t=null,this._canceling=!1;break;case"interrupt":this._interrupt={...s.payload,id:o},this.arcgisInterrupt.emit(this._interrupt);break;case"cancelled":n?.role==="assistant"&&n.id===o?this.messages.splice(-1,1,{...n,blocks:n.blocks?.filter(a=>a.type==="text"||!a.isPending)??[],isStreaming:!1,log:s.log,error:"(Stopped by user)"}):(this.messages.push({role:"assistant",log:s.log,error:"(Stopped by user)",id:o,interrupts:this._interruptDetails}),this._interruptDetails=[]),this._isAnswering=!1,this.#t=null,this._canceling=!1;break}}}submitInterrupt(e){this.arcgisInterruptSubmit.emit(e),this._interrupt&&(this._interruptDetails=[...this._interruptDetails,{interrupt:this._interrupt,response:e}]),this.orchestrator?.resumeInterrupt(e),this._interrupt=null}load(){this.manager.onLifecycle(this._reset.bind(this))}loaded(){this.manager.onLifecycle(()=>{this.#e.value?.addEventListener("arcgisPromptSelect",this.#g),this.#e.value?.addEventListener("arcgisSubmit",this.#c),this.#e.value?.addEventListener("arcgisCancel",this.#l),this.#e.value?.addEventListener("arcgisFeedback",this.#d);let e=Le(()=>!!this._interrupt&&!!this.#s.value,()=>{let i=this.#s.value;i.removeEventListener("arcgisSubmit",this.#n),i.removeEventListener("arcgisCancel",this.#i),i.addEventListener("arcgisSubmit",this.#n,{once:!0}),i.addEventListener("arcgisCancel",this.#i,{once:!0})}),t=this.messages.on("after-add",i=>{let s=i.item;s.role==="assistant"&&(s.error||s.content)&&this.arcgisResponse.emit(s)});return queueMicrotask(()=>{this.#u().then(i=>{i?this.arcgisReady.emit():this._error&&this.arcgisError.emit(new Error(this._error))})}),()=>{e.remove(),t.remove(),this.#e.value?.removeEventListener("arcgisPromptSelect",this.#g),this.#s.value?.removeEventListener("arcgisSubmit",this.#n),this.#s.value?.removeEventListener("arcgisCancel",this.#i),this.#e.value?.removeEventListener("arcgisSubmit",this.#c),this.#e.value?.removeEventListener("arcgisCancel",this.#l),this.#e.value?.removeEventListener("arcgisFeedback",this.#d),this._orchestratorController?.destroy(),this._orchestratorController=null}})}_reset(){this._orchestratorController?.cancel(),this.#t?.abort(),this._interrupt=null,this.messages.removeAll(),this._error=null,this._inputValue="",this._signedInUserId=void 0}_renderEntryMessage(){return this._isSignedIn?this._error?this._renderErrorNotice():this.entryMessage?this.messages.length>0?null:h`<calcite-notice open kind=brand closable icon width=full><div slot=message>${this.entryMessage}</div></calcite-notice>`:h`<slot name=entry-message></slot>`:this._renderSignInNotice()}_renderSignInNotice(){let e=this.#r;return h`<calcite-notice slot=entry-message open kind=brand icon width=full><div slot=message>You need to sign in to use the assistant chat.</div>${e?h`<calcite-link slot=link @click=${async()=>{try{let t=await De.getCredential(`${e.url}/sharing`);this._signedInUserId=t.userId,this._error=null,this.requestUpdate(),await this.#u()?this.arcgisReady.emit():this._error&&this.arcgisError.emit(new Error(this._error))}catch(t){this._error=t?.message??"Error signing in.",this.arcgisError.emit(new Error(this._error)),L("error",this,"Error signing in:",{detail:{error:t}})}}} target=_blank title="Sign in to ArcGIS Online">Sign in</calcite-link>`:h`<div slot=link>No portal information available</div>`}</calcite-notice>`}_renderErrorNotice(){return this._error?h`<calcite-notice slot=entry-message open kind=brand icon width=full>${this._error===Te?h`<div slot=message>${Ne}</div><calcite-link slot=link .href=${Ue} target=_blank title="Learn about web map embeddings">Read more</calcite-link>`:h`<div slot=message>${this._error}</div>`}</calcite-notice>`:null}render(){return h`<calcite-panel .loading=${!this._orchestratorController&&!this._error||this._orchestratorController?.loading} .heading=${this.heading??this._messages.assistantLabel} .description=${this.description} ${E(this.#e)}><slot name=header-actions-start slot=header-actions-start></slot><slot name=header-actions-end slot=header-actions-end></slot><div class="content-container"><arcgis-assistant-chat .loading=${this.awaitingResponse} .messages=${this.messages} .interrupt=${this._interrupt}><slot name=message-starter slot=message-starter></slot><slot name=messages slot=messages>${this.messages.map(e=>e.role==="assistant"?h`<arcgis-assistant-message .message=${e} .feedbackEnabled=${this.feedbackEnabled} .logEnabled=${this.logEnabled} .copyEnabled=${this.copyEnabled} .readAloudEnabled=${this.readAloudEnabled} @arcgisSlottableRequest=${this.#h} .assistantAvatarEnabled=${this.assistantAvatarEnabled}>${e.blocks?.map((t,i)=>h`<slot name=${x(e.id,i)??I} slot=${x(e.id,i)??I}><arcgis-assistant-message-block .block=${t}></arcgis-assistant-message-block></slot>`)}</arcgis-assistant-message>`:h`<arcgis-assistant-user-message .message=${e} .user=${this._user}></arcgis-assistant-user-message>`)}</slot>${this._interrupt?h`<div slot=message-loading><div class="interrupt-waiting-message">waiting for user input...</div></div>`:h`<slot name=message-loading slot=message-loading><arcgis-assistant-message-loading .loading=${this.awaitingResponse} .loadingMessage=${this.awaitingResponseStep} .assistantAvatarEnabled=${this.assistantAvatarEnabled} .interrupts=${this._interruptDetails}></arcgis-assistant-message-loading></slot>`}</arcgis-assistant-chat></div>${this._interrupt?h`<slot name=interrupt><arcgis-assistant-interrupt slot=content-bottom .type=${this._interrupt.type} .message=${this._interrupt.message} .options=${this._interrupt.options} ${E(this.#s)}></arcgis-assistant-interrupt></slot>`:this.suggestedPrompts?.length?h`<div class="suggested-prompts-container" slot=content-bottom><arcgis-assistant-suggested-prompts class="suggested-prompts" .prompts=${this.suggestedPrompts}></arcgis-assistant-suggested-prompts></div>`:null}<div class="footer-container" slot=footer>${this._renderEntryMessage()}<slot name=chat-entry><arcgis-assistant-chat-entry .awaitingResponse=${this.awaitingResponse||this._isAnswering} .inputValue=${this._inputValue} .messages=${this.messages} .voiceInputEnabled=${this.voiceInputEnabled} .disabled=${this._canceling||!this._isSignedIn||!!this._interrupt} ${E(this.#a)}><slot name=entry-actions-start slot=entry-actions-start></slot><slot name=entry-actions-end slot=entry-actions-end><calcite-button .iconStart=${this.awaitingResponse||this._isAnswering?"circle-stop":"send"} @click=${()=>{this.#a.value?.submitMessage()}} round>${this.awaitingResponse||this._isAnswering?this._messages.stopButtonLabel:this._messages.askButtonLabel}</calcite-button></slot></arcgis-assistant-chat-entry></slot><slot name=footer-content></slot></div></calcite-panel>`}};O("arcgis-assistant",$);return $},"core/Collection","core/reactiveUtils","portal/Portal","identity/IdentityManager","portal/Portal","core/reactiveUtils","layers/FeatureLayer","request","identity/IdentityManager","config","layers/FeatureLayer","core/Accessor","core/accessorSupport/decorators",a)
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as r}from"./E2HENO3T.js";import"./QSA4T3BU.js";import"./NXKKG5TK.js";import{g as a,h as e,n as i,v as c,z as l}from"./MAV3DW27.js";import"./ADYIXCSG.js";import"./YIMNOUTF.js";var o=a`:host{width:100%;padding:var(--calcite-spacing-md);background:var(--calcite-panel-background-color, var(--calcite-color-background))}calcite-panel{border-radius:var(--calcite-dialog-corner-radius, var(--calcite-corner-radius-sm));border:0 solid var(--calcite-color-brand);border-block-start-width:4px;box-shadow:var(--calcite-shadow-md);width:100%;--calcite-panel-border-color: none}.interrupt-content{padding:0 var(--calcite-spacing-md);background:var(--calcite-color-foreground-1)}`,s=class extends c{constructor(){super(...arguments),this.#t=[],this._messages=r({blocking:!0}),this.arcgisCancel=i(),this.arcgisSubmit=i()}static{this.properties={type:1,message:1,options:0}}static{this.styles=o}#t;_renderInterruptOptions(){switch(this.type){case"single-select":return e`<calcite-list selection-mode=single-persist .label=${this._messages.optionsLabel} @calciteListChange=${t=>this.#t=t.target.selectedItems[0]?.value}>${this.options?.map(t=>e`<calcite-list-item .label=${t} .value=${t}></calcite-list-item>`)}</calcite-list>`;case"multi-select":return e`<calcite-list selection-mode=multiple .label=${this._messages.optionsLabel} @calciteListChange=${t=>this.#t=t.target.selectedItems.map(n=>n.value)}>${this.options?.map(t=>e`<calcite-list-item .label=${t} .value=${t}></calcite-list-item>`)}</calcite-list>`;case"boolean-choice":return null;case"text-input":return e`<calcite-input .label=${this._messages.enterTextLabel} @calciteInputInput=${t=>this.#t=t.target.value}></calcite-input>`}}render(){return e`<calcite-panel .description=${this.message}><div class="interrupt-content">${this._renderInterruptOptions()}</div><calcite-button slot=footer-end appearance=outline @click=${()=>this.arcgisCancel.emit()}>${this._messages.cancelButtonLabel}</calcite-button><calcite-button slot=footer-end appearance=solid @click=${()=>this.arcgisSubmit.emit(this.type==="boolean-choice"?!0:this.#t)}>${this._messages.submitButtonLabel}</calcite-button></calcite-panel>`}};l("arcgis-assistant-interrupt",s);export{s as ArcgisAssistantInterrupt};
@@ -1,3 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as e,b as n}from"./CE6VDP2D.js";import{g as r,h as i,v as s,z as c}from"./MAV3DW27.js";import"./ADYIXCSG.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
- `)||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};
@@ -1,33 +0,0 @@
1
- import type { AnnotationRoot, StateGraph } from "@langchain/langgraph/web";
2
-
3
- /**
4
- * Definition of a client-side agent that can be registered with the ArcGIS Assistant Agent component.
5
- *
6
- * @see [LangGraph documentation](https://docs.langchain.com/oss/javascript/langgraph/overview)
7
- * @beta
8
- * @since 5.0
9
- */
10
- export interface AgentRegistration {
11
- /** A unique identifier for the agent. */
12
- id: string;
13
- /** A human-readable name for the agent. This must be unique, but also be semantically meaningful. */
14
- name: string;
15
- /** A brief description of the agent's purpose and functionality. */
16
- description: string;
17
- /**
18
- * A function that creates and returns the agent's state graph. This graph defines the agent's behavior,
19
- * including how it processes inputs, makes decisions, and produces outputs. The graph consists of nodes and edges
20
- * that represent the agent's deterministic logic and flow. This is a structure defined using LangGraph's StateGraph.
21
- *
22
- * @see [LangGraph documentation](https://docs.langchain.com/oss/javascript/langgraph/overview)
23
- */
24
- createGraph: () => StateGraph<unknown>;
25
- /**
26
- * The workspace variables or context required by the agent's graph. This includes messages, results,
27
- * and any other relevant data required by the LLM to make decisions and determine parameters for function calls.
28
- * This is a structure defined using LangGraph's AnnotationRoot.
29
- *
30
- * @see [LangGraph documentation](https://docs.langchain.com/oss/javascript/langgraph/overview)
31
- */
32
- workspace: AnnotationRoot<any>;
33
- }