@arcgis/portal-components 6.0.0-next.19 → 6.0.0-next.20

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 (105) hide show
  1. package/dist/cdn/225AERRK.js +2 -0
  2. package/dist/cdn/{AL2HHH7T.js → 2267AKWE.js} +1 -1
  3. package/dist/cdn/{QPPMRBBW.js → 4I7NKRIH.js} +1 -1
  4. package/dist/cdn/{H7DF6TTK.js → 4VLEUN7I.js} +1 -1
  5. package/dist/cdn/{V5PD3E3W.js → 5D5INKHG.js} +1 -1
  6. package/dist/cdn/{FSRBM4UA.js → 67QXUNKX.js} +1 -1
  7. package/dist/cdn/{YHGQPXC4.js → 6BQUKFTK.js} +1 -1
  8. package/dist/cdn/{LH4E6B5Z.js → 6T4X4RAB.js} +1 -1
  9. package/dist/cdn/723D3EKN.js +2 -0
  10. package/dist/cdn/{LFRULIBL.js → 7PBECSW5.js} +1 -1
  11. package/dist/cdn/7XBN6ZF4.js +2 -0
  12. package/dist/cdn/{KCQV2RU6.js → AAWXEOVL.js} +1 -1
  13. package/dist/cdn/{AODUG34O.js → APLSVK3C.js} +1 -1
  14. package/dist/cdn/{CB5XUOOF.js → B474WTYE.js} +1 -1
  15. package/dist/cdn/{3SCRMD7A.js → C7KQT5QW.js} +1 -1
  16. package/dist/cdn/CL5FABMT.js +2 -0
  17. package/dist/cdn/{Q3VELMMC.js → CUJG43PQ.js} +1 -1
  18. package/dist/cdn/{3F4VSZT3.js → EQTGOMBD.js} +1 -1
  19. package/dist/cdn/{OC3UQR6Z.js → EXEAVQRP.js} +1 -1
  20. package/dist/cdn/{KGTBXDD2.js → FLUCWAMC.js} +1 -1
  21. package/dist/cdn/FN2QMDEW.js +2 -0
  22. package/dist/cdn/FXTPC2Q5.js +2 -0
  23. package/dist/cdn/{5CBLAWTC.js → GDCXUNOL.js} +1 -1
  24. package/dist/cdn/{ZMVW64CR.js → GJNGP34L.js} +1 -1
  25. package/dist/cdn/GOUAS2Q5.js +2 -0
  26. package/dist/cdn/{UMEKDIME.js → HIPJAMO4.js} +1 -1
  27. package/dist/cdn/{PMV65NI5.js → I3ECBIYX.js} +1 -1
  28. package/dist/cdn/{WH54CSSU.js → I4ZRFXQ3.js} +1 -1
  29. package/dist/cdn/{C5IKEISI.js → IAK4F5SX.js} +1 -1
  30. package/dist/cdn/{TMRRWKIA.js → IRCWBDGJ.js} +2 -2
  31. package/dist/cdn/K6LF5U7K.js +2 -0
  32. package/dist/cdn/{5RHV5HXF.js → LY7NVMME.js} +1 -1
  33. package/dist/cdn/{5ZU6KAGX.js → MK2KDBUL.js} +1 -1
  34. package/dist/cdn/{4XIHI6AF.js → MLTZSPZQ.js} +1 -1
  35. package/dist/cdn/{TZ6HFMZZ.js → MOE6L5RN.js} +1 -1
  36. package/dist/cdn/MUW2YNAS.js +2 -0
  37. package/dist/cdn/{3K3BYENR.js → MXUHZ474.js} +1 -1
  38. package/dist/cdn/{7VTDDO2O.js → NDCMZLMU.js} +1 -1
  39. package/dist/cdn/{R5PSADUV.js → O4YFPGD5.js} +1 -1
  40. package/dist/cdn/{TVFDFN6V.js → O5MB4QQ2.js} +1 -1
  41. package/dist/cdn/{YT5ON4CK.js → OQE662U3.js} +1 -1
  42. package/dist/cdn/{2V3QCHGP.js → OQUQ7Z3E.js} +1 -1
  43. package/dist/cdn/{BGPQQ2RK.js → P74FP43E.js} +1 -1
  44. package/dist/cdn/{HZTWCOYQ.js → PVPTFK7N.js} +1 -1
  45. package/dist/cdn/{LMFWH7YP.js → QJB32L7F.js} +1 -1
  46. package/dist/cdn/QSRWVCWP.js +2 -0
  47. package/dist/cdn/{OPHXWCKO.js → RAWBYOFF.js} +1 -1
  48. package/dist/cdn/{XDIDJH5L.js → RYPYVJ5U.js} +1 -1
  49. package/dist/cdn/SASCLFKY.js +2 -0
  50. package/dist/cdn/{P3GNUA6J.js → SCRIVOPW.js} +1 -1
  51. package/dist/cdn/{VLUI423B.js → SHGPWFEC.js} +1 -1
  52. package/dist/cdn/TLZO6KZO.js +2 -0
  53. package/dist/cdn/{7HOK3ICE.js → TRFH3KNJ.js} +1 -1
  54. package/dist/cdn/{OPBUKZVI.js → U4PHGRXB.js} +1 -1
  55. package/dist/cdn/UD4KPMGF.js +2 -0
  56. package/dist/cdn/{YRLNSQ23.js → UL3XBQUT.js} +1 -1
  57. package/dist/cdn/{NOI7ZXEF.js → UYROTXZP.js} +1 -1
  58. package/dist/cdn/{YO3CD3O5.js → VAJV46OF.js} +1 -1
  59. package/dist/cdn/{URCKNKEP.js → VH2IMPMN.js} +1 -1
  60. package/dist/cdn/{R2TAEKFV.js → VNVGVYX6.js} +1 -1
  61. package/dist/cdn/{ZGARJUX7.js → VXYEF3XW.js} +1 -1
  62. package/dist/cdn/WQWJVM5B.js +2 -0
  63. package/dist/cdn/{NOGXUEXV.js → Y6WQZMYW.js} +1 -1
  64. package/dist/cdn/{3QJWPWLY.js → Y72W3QFF.js} +1 -1
  65. package/dist/cdn/YERFI6P2.js +2 -0
  66. package/dist/cdn/{3MLYU2YK.js → ZJWAM6OL.js} +1 -1
  67. package/dist/cdn/{BULPEHX6.js → ZS3JUQN3.js} +1 -1
  68. package/dist/cdn/index.js +1 -1
  69. package/dist/cdn/main.css +1 -1
  70. package/dist/chunks/functionalities.js +14 -8
  71. package/dist/components/arcgis-portal-add-gps-metadata/customElement.js +145 -124
  72. package/dist/components/arcgis-portal-delete-items/customElement.js +151 -158
  73. package/dist/components/arcgis-portal-delete-items/index.js +1 -1
  74. package/dist/components/arcgis-portal-item-share-summary/customElement.d.ts +18 -11
  75. package/dist/components/arcgis-portal-item-share-summary/customElement.js +65 -62
  76. package/dist/components/arcgis-portal-item-share-summary-editable/customElement.d.ts +33 -0
  77. package/dist/components/arcgis-portal-item-share-summary-editable/customElement.js +19 -0
  78. package/dist/components/arcgis-portal-item-share-summary-editable/index.d.ts +1 -0
  79. package/dist/components/arcgis-portal-item-share-summary-editable/index.js +2 -0
  80. package/dist/components/arcgis-portal-navigation/index.js +1 -1
  81. package/dist/docs/api.json +1 -1
  82. package/dist/docs/docs.json +1 -1
  83. package/dist/docs/vscode.html-custom-data.json +1 -1
  84. package/dist/docs/web-types.json +1 -1
  85. package/dist/index.d.ts +10 -0
  86. package/dist/loader.js +1 -0
  87. package/dist/types/lumina.d.ts +6 -0
  88. package/dist/types/preact.d.ts +7 -0
  89. package/dist/types/react.d.ts +8 -0
  90. package/dist/types/stencil.d.ts +6 -0
  91. package/package.json +7 -7
  92. package/dist/cdn/2FKNF2ZK.js +0 -2
  93. package/dist/cdn/5TY55CJN.js +0 -2
  94. package/dist/cdn/7JEYW5OA.js +0 -2
  95. package/dist/cdn/AJ5H2JMU.js +0 -2
  96. package/dist/cdn/CSRJXUID.js +0 -2
  97. package/dist/cdn/JRRPPRMV.js +0 -2
  98. package/dist/cdn/NBEOY6GP.js +0 -2
  99. package/dist/cdn/RCCW6IUO.js +0 -2
  100. package/dist/cdn/T7NY3ZIG.js +0 -2
  101. package/dist/cdn/V4HA2VX4.js +0 -2
  102. package/dist/cdn/VILDP7WM.js +0 -2
  103. package/dist/cdn/XJ4QHAGD.js +0 -2
  104. package/dist/cdn/XMV3LCRM.js +0 -2
  105. /package/dist/cdn/{UUITDWRA.js → XYT4533U.js} +0 -0
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import f from"./OQE662U3.js";import e from"./NDCMZLMU.js";import d from"./QKGHH3FS.js";import"./Y5VUMGKH.js";import"./PKA745KL.js";import"./VDXESPJK.js";import"./DAAON2UO.js";import c from"./MOE6L5RN.js";import b from"./TIPQ2ZWK.js";import a from"./IAK4F5SX.js";import"./4VLEUN7I.js";import"./KV4ZZSNW.js";import"./FN2QMDEW.js";import"./AYHYABMC.js";import"./OQ3OHDEB.js";import"./I57CRKF7.js";import"./3ZC26CT6.js";import"./OUMTV5H5.js";import"./5PV2GUZW.js";export default $arcgis.t(([,,,,,a])=>{return a},a,b,c,d,e,f)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import b from"./HZTWCOYQ.js";import{c as G,d as T}from"./Y5VUMGKH.js";import{a as L}from"./VDXESPJK.js";import{a as m}from"./57MT7FOI.js";import a from"./C5IKEISI.js";import{a as A}from"./H7DF6TTK.js";import{a as F}from"./AYHYABMC.js";import{c as P}from"./OQ3OHDEB.js";import{I as f,J as $,K as C,M as I,Q as _,h as k,j as c,v as R}from"./3ZC26CT6.js";export default $arcgis.t(([{isAbortError:q},x,{b:O},{a:M}])=>{var B=["esri_livingatlas","esri_boundaries","esri_demographics","esri_nav","esri_webstyles"];function j(l){return L(l.trim()).replace(/[!*+\-&|()[\]{}^~?:"\\]/gu,"\\$&")}async function K({portal:l,searchTerm:e,num:t=100,query:r,signal:a}){let i=j(e),o=`${A(l)}portals/self/users/search`,s=[i?`(${i})`:void 0,r?.trim()?`(${r.trim()})`:void 0];l.isPortal&&s.push(...B.map(p=>`-username:${p}`));let u=o.includes("www.arcgis.com")&&l.isPortal?{disableIdentityLookup:!0,addTokenManually:!1}:{};return await O({url:o,portal:l,params:{num:Math.min(Math.max(t,1),100),q:s.filter(Boolean).join(" AND "),sortField:"relevance"},options:{...u,...a?{signal:a}:{}}})}function E(l,e){let t=["all"];return e==="user"||!l.user?.username||(e==="item"&&t.push("myContent"),t.push("myGroups"),l.user.orgId&&t.push("myOrganization")),t}function b(l){return`"${l.replace(/[\\"]/gu,"\\$&")}"`}async function H(l){let{portal:e,entityType:t,searchTerm:r,signal:a}=l,i=Math.min(Math.max(l.num??10,1),100),o=l.scope??"all";try{if(a?.throwIfAborted(),!E(e,t).includes(o))throw new Error(`Search scope "${o}" is unavailable for ${t} searches.`);if(t==="user")return{result:{entityType:t,result:await K({portal:e,searchTerm:r,num:i,query:l.query,...a?{signal:a}:{}})}};let s=G(r);if(!s)return{};let u,p=e.user;if(o==="myContent"&&p)u=`owner:${b(p.username)}`;else if(o==="myOrganization"&&p?.orgId)u=`orgid:${b(p.orgId)}`;else if(o==="myGroups"&&p){if(t==="group"){let n=await M(e,{num:i,q:T(s,l.query),searchUserAccess:"groupMember",searchUserName:p.username},{signal:a});return{result:{entityType:t,result:new x({results:n.results,total:n.total})}}}let y=await p.fetchGroups();if(a?.throwIfAborted(),!y.length)return{result:{entityType:t,result:new x({results:[],total:0})}};u=y.map(({id:n})=>{if(!n)throw new Error("A membership group is missing its ID.");return`group:${b(n)}`}).join(" OR ")}let d={num:i,query:T(s,l.query,u)};return t==="group"?{result:{entityType:t,result:await e.queryGroups(d,{signal:a})}}:{result:{entityType:t,result:await e.queryItems(d,{signal:a})}}}catch(s){if(a?.aborted||q(s))throw s;return console.error(s),{error:{code:"unhandledError"}}}}var Q=l=>P((e,t)=>{let r={searchTerm:"",scope:"all",isSearching:!1,searchFailed:!1},a,i,o=n=>{r={...r,...n},t.exports={...r,setSearchTerm:d,setScope:y}},s=()=>{a!==void 0&&(clearTimeout(a),a=void 0),i?.abort(),i=void 0},u=async(n,h)=>{let{entityType:v,num:z,portal:D,query:U}=e,{scope:S}=r;try{let{error:g,result:N}=await H({portal:D,entityType:v,searchTerm:n,num:z,query:U,signal:h,...S==="all"?{}:{scope:S}});h.aborted||o({searchFailed:!!g,searchResult:N,isSearching:!1})}catch(g){!h.aborted&&!q(g)&&(console.error(g),o({searchFailed:!0,searchResult:void 0,isSearching:!1}))}},p=n=>{let h=n.searchTerm.trim();if(s(),o({...n,searchFailed:!1,searchResult:void 0,isSearching:!!h}),l(!!h),h){i=new AbortController;let{signal:v}=i;a=setTimeout(()=>{a=void 0,u(h,v)},400)}},d=n=>{p({searchTerm:n,scope:r.scope})},y=n=>{n!==r.scope&&p({searchTerm:r.searchTerm,scope:n})};return t.onUpdate(n=>{(n.has("portal")||n.has("entityType")||n.has("query")||n.has("num")||n.has("initialSearchTerm"))&&p({searchTerm:e.initialSearchTerm,scope:n.has("portal")||n.has("entityType")?"all":r.scope})}),t.onDisconnected(s),{...r,setSearchTerm:d,setScope:y}}),J=k`:host{display:block;inline-size:100%}.entity-picker{display:flex;flex-direction:column;gap:.5rem;min-inline-size:16rem}.entity-picker__results{max-block-size:var(--arcgis-portal-entity-picker-results-max-block-size, 22rem);overflow-y:auto}.entity-picker__cards{display:flex;flex-direction:column;gap:.5rem}.entity-picker__status{color:var(--calcite-color-text-3);font-size:.875rem;margin:0;padding:.75rem}.entity-picker__selection{align-items:center;display:var(--arcgis-portal-entity-picker-selection-display, flex);gap:.5rem}.entity-picker__selection-label{flex:1;min-inline-size:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.entity-picker__input{inline-size:100%}`,w=class extends C{constructor(){super(...arguments),this._messages=F({blocking:!0,name:"portal-entity-picker"}),this.inputRef=f(),this.inputContainerRef=f(),this.resizeObserver=null,this.searchController=Q(e=>{(!e||this.mode==="popover")&&(this.popoverOpen=e)})(this),this.popoverOpen=!1,this.popoverWidth=0,this.entityType="group",this.mode="inline",this.selectionMode="single",this.selected=null,this.initialSearchTerm="",this.num=10,this.arcgisSelectionChange=R()}static{this.properties={popoverOpen:16,popoverWidth:16,portal:0,entityType:1,mode:1,selectionMode:1,selected:0,query:1,initialSearchTerm:1,num:9,icon:1,messageOverrides:0}}static{this.styles=J}get searchLabel(){let{entityType:e,_messages:t}=this;return e==="group"?t.searchGroups:e==="item"?t.searchItems:t.searchUsers}get selectedLabel(){let{entityType:e,selected:t}=this;if(t?.entityType===e)return t.entityType==="user"?t.entity.fullName||t.entity.username:t.entity.title||t.entity.id||void 0}async togglePicker(e){this.mode==="popover"&&(this.popoverOpen=e,await this.updateComplete,await this.setFocus())}async setFocus(){await this.inputRef.value?.setFocus()}firstUpdated(){this.updatePopoverWidth(),!(typeof ResizeObserver>"u"||!this.inputContainerRef.value)&&(this.resizeObserver=new ResizeObserver(()=>this.updatePopoverWidth()),this.resizeObserver.observe(this.inputContainerRef.value))}willUpdate(e){e.has("mode")&&this.mode==="inline"&&(this.popoverOpen=!1)}disconnectedCallback(){this.resizeObserver?.disconnect(),this.resizeObserver=null,super.disconnectedCallback()}updatePopoverWidth(){requestAnimationFrame(()=>{this.popoverWidth=this.inputContainerRef.value?.offsetWidth??0})}emitSelection(e){this.arcgisSelectionChange.emit(e),this.mode==="popover"&&this.togglePicker(!1)}getFocusableResults(){let e=Array.from(this.renderRoot.querySelector('slot[name="list-start"]')?.assignedElements({flatten:!0})??[]).filter(r=>r instanceof HTMLElement&&(r.tagName==="CALCITE-LIST-ITEM"||r.tabIndex>=0)),t=Array.from(this.renderRoot.querySelectorAll("calcite-list-item, arcgis-portal-group-card, arcgis-portal-item-card"));return[...e,...t]}async focusResult(e){if(e.tagName==="CALCITE-LIST-ITEM"){await e.setFocus();return}if(e.tagName==="ARCGIS-PORTAL-GROUP-CARD"){await e.restoreFocus();return}if(e.tagName==="ARCGIS-PORTAL-ITEM-CARD"){await e.restoreFocus();return}e.focus()}async focusResultAt(e){let t=this.getFocusableResults();if(!t.length)return;let r=(e+t.length)%t.length;await this.focusResult(t[r])}handleResultsKeyDown(e){if(e.defaultPrevented)return;let t=this.getFocusableResults(),r=e.composedPath(),a=t.findIndex(o=>r.includes(o));if(a===-1)return;if(this.mode==="inline"&&(e.key==="ArrowDown"||e.key==="ArrowUp")){e.preventDefault(),this.focusResultAt(a+(e.key==="ArrowDown"?1:-1));return}let i=t[a];if(i.tagName==="ARCGIS-PORTAL-GROUP-CARD"&&(e.key==="Enter"||e.key===" ")){e.preventDefault();let{group:o}=i;this.emitSelection({entityType:"group",entity:o});return}if(i.tagName==="ARCGIS-PORTAL-ITEM-CARD"&&(e.key==="Enter"||e.key===" ")){e.preventDefault();let{item:o}=i;this.emitSelection({entityType:"item",entity:o})}}renderScopeSelector(){let{entityType:e,portal:t,_messages:r}=this,{scope:a}=this.searchController,i=E(t,e);return i.length<=1?null:c`<calcite-select .label=${r.searchIn} scale=m @calciteSelectChange=${o=>{let s=i.find(u=>u===o.target.value);s&&this.searchController.setScope(s)}}>${i.map(o=>c`<calcite-option .selected=${o===a} .value=${o}>${o==="all"?e==="item"?r.allContent:r.allGroups:r[o]}</calcite-option>`)}</calcite-select>`}renderGroup(e){return m(e.id,c`<calcite-list-item .label=${e.title||e.id||""} .description=${[e.owner,e.access].filter(Boolean).join(" \xB7 ")} .selected=${this.selected?.entityType==="group"&&this.selected.entity.id===e.id} @calciteListItemSelect=${()=>this.emitSelection({entityType:"group",entity:e})}><calcite-avatar slot=content-start .fullName=${e.title??void 0} .thumbnail=${e.thumbnailUrl??void 0} scale=m></calcite-avatar></calcite-list-item>`)}renderInlineGroup(e){return m(e.id,c`<arcgis-portal-group-card .group=${e} .portal=${this.portal} .preview=${this.selectionMode==="none"?"top":void 0} .selected=${this.selected?.entityType==="group"&&this.selected.entity.id===e.id} .selection=${this.selectionMode} @arcgisGroupBrowserCardPreview=${()=>this.emitSelection({entityType:"group",entity:e})} @arcgisGroupCardSelect=${({detail:t})=>{t.selected&&this.emitSelection({entityType:"group",entity:t.group})}} .user=${this.portal.user??void 0} view=compact></arcgis-portal-group-card>`)}renderItem(e){return m(e.id,c`<calcite-list-item .label=${e.title||e.id||""} .description=${[e.type,e.owner].filter(Boolean).join(" \xB7 ")} .selected=${this.selected?.entityType==="item"&&this.selected.entity.id===e.id} @calciteListItemSelect=${()=>this.emitSelection({entityType:"item",entity:e})}><calcite-avatar slot=content-start .fullName=${e.title??void 0} .thumbnail=${e.thumbnailUrl??void 0} scale=m></calcite-avatar></calcite-list-item>`)}renderInlineItem(e){return m(e.id,c`<arcgis-portal-item-card .item=${e} .portal=${this.portal} .preview=${this.selectionMode==="none"?"top":void 0} .selected=${this.selected?.entityType==="item"&&this.selected.entity.id===e.id} .selection=${this.selectionMode} @arcgisItemBrowserCardPreview=${()=>this.emitSelection({entityType:"item",entity:e})} @arcgisItemCardSelect=${({detail:t})=>{t.selected&&this.emitSelection({entityType:"item",entity:t.item})}} .user=${this.portal.user??void 0} view=list></arcgis-portal-item-card>`)}renderUser(e){return m(e.username,c`<calcite-list-item .label=${e.fullName||e.username} .description=${e.username} .selected=${this.selected?.entityType==="user"&&this.selected.entity.username===e.username} @calciteListItemSelect=${()=>this.emitSelection({entityType:"user",entity:e})}><arcgis-portal-user-avatar slot=content-start .portal=${this.portal} .user=${e} scale=m></arcgis-portal-user-avatar></calcite-list-item>`)}renderSearchResults(){let{entityType:e,_messages:t}=this,{isSearching:r,searchFailed:a,searchResult:i,searchTerm:o}=this.searchController;if(!o.trim())return null;if(r)return c`<div role=status><calcite-loader .label=${t.searching} scale=s></calcite-loader></div>`;if(a)return c`<p class="entity-picker__status" role=alert>${t.searchFailed}</p>`;if(!(i?.result.results??[]).length){let s=e==="group"?t.noGroupsFound:e==="item"?t.noItemsFound:t.noUsersFound;return c`<p class="entity-picker__status" role=status>${s}</p>`}return this.mode==="inline"&&i?.entityType==="group"?c`<div class="entity-picker__cards"><slot name=list-start></slot>${i.result.results.map(s=>this.renderInlineGroup(s))}</div>`:this.mode==="inline"&&i?.entityType==="item"?c`<div class="entity-picker__cards"><slot name=list-start></slot>${i.result.results.map(s=>this.renderInlineItem(s))}</div>`:c`<calcite-list interaction-mode=interactive .label=${this.searchLabel} .selectionMode=${this.mode==="inline"&&this.selectionMode==="single"?"single-persist":"none"}><slot name=list-start></slot>${i?.entityType==="group"?i.result.results.map(s=>this.renderGroup(s)):i?.entityType==="item"?i.result.results.map(s=>this.renderItem(s)):i?.result.results.map(s=>this.renderUser(s))}</calcite-list>`}renderPicker(e=!0){return c`<div class="entity-picker">${this.selectedLabel&&c`<div class="entity-picker__selection"><span class="entity-picker__selection-label">${this.selectedLabel}</span><calcite-button appearance=transparent icon-start=x kind=neutral .label=${this._messages.clearSelection} @click=${()=>this.arcgisSelectionChange.emit(null)} scale=s></calcite-button></div>`||""}${this.renderScopeSelector()}<div class="entity-picker__input" ${$(this.inputContainerRef)}><calcite-input .icon=${this.icon} .clearable=${this.mode==="inline"} .label=${this.searchLabel} .placeholder=${this.searchLabel} .value=${this.searchController.searchTerm} @click=${()=>{this.mode==="popover"&&this.searchController.searchTerm.trim()&&(this.popoverOpen=!0)}} @keydown=${t=>{(t.key==="ArrowDown"||t.key==="ArrowUp")&&this.searchController.searchResult?.result.results.length&&(t.preventDefault(),this.focusResultAt(t.key==="ArrowDown"?0:-1))}} @focus=${()=>{this.mode==="popover"&&this.searchController.searchTerm.trim()&&(this.popoverOpen=!0)}} @calciteInputInput=${t=>{this.searchController.setSearchTerm(t.target.value)}} ${$(this.inputRef)}></calcite-input></div>${e&&c`<div class="entity-picker__results" @keydown=${this.handleResultsKeyDown}>${this.renderSearchResults()}</div>`||""}</div>`}render(){return this.mode==="inline"?this.renderPicker():c`${this.renderPicker(!1)}<calcite-popover .label=${this.searchLabel} .open=${this.popoverOpen} placement=bottom-start .referenceElement=${this.inputContainerRef.value} trigger-disabled @calcitePopoverClose=${e=>{!e.target.open&&this.popoverOpen&&(this.popoverOpen=!1,requestAnimationFrame(()=>{this.setFocus()}))}}><div class="entity-picker__results" style=${I({inlineSize:this.popoverWidth?`${this.popoverWidth}px`:void 0})}>${this.renderSearchResults()}</div></calcite-popover>`}};_("arcgis-portal-entity-picker",w);return w},"core/promiseUtils","portal/PortalQueryResult",a,b)
2
+ import b from"./PVPTFK7N.js";import{c as G,d as T}from"./Y5VUMGKH.js";import{a as L}from"./VDXESPJK.js";import{a as m}from"./57MT7FOI.js";import a from"./IAK4F5SX.js";import{a as A}from"./4VLEUN7I.js";import{a as F}from"./AYHYABMC.js";import{c as P}from"./OQ3OHDEB.js";import{I as f,J as $,K as C,M as I,Q as _,h as k,j as c,v as R}from"./3ZC26CT6.js";export default $arcgis.t(([{isAbortError:q},x,{b:O},{a:M}])=>{var B=["esri_livingatlas","esri_boundaries","esri_demographics","esri_nav","esri_webstyles"];function j(l){return L(l.trim()).replace(/[!*+\-&|()[\]{}^~?:"\\]/gu,"\\$&")}async function K({portal:l,searchTerm:e,num:t=100,query:r,signal:a}){let i=j(e),o=`${A(l)}portals/self/users/search`,s=[i?`(${i})`:void 0,r?.trim()?`(${r.trim()})`:void 0];l.isPortal&&s.push(...B.map(p=>`-username:${p}`));let u=o.includes("www.arcgis.com")&&l.isPortal?{disableIdentityLookup:!0,addTokenManually:!1}:{};return await O({url:o,portal:l,params:{num:Math.min(Math.max(t,1),100),q:s.filter(Boolean).join(" AND "),sortField:"relevance"},options:{...u,...a?{signal:a}:{}}})}function E(l,e){let t=["all"];return e==="user"||!l.user?.username||(e==="item"&&t.push("myContent"),t.push("myGroups"),l.user.orgId&&t.push("myOrganization")),t}function b(l){return`"${l.replace(/[\\"]/gu,"\\$&")}"`}async function H(l){let{portal:e,entityType:t,searchTerm:r,signal:a}=l,i=Math.min(Math.max(l.num??10,1),100),o=l.scope??"all";try{if(a?.throwIfAborted(),!E(e,t).includes(o))throw new Error(`Search scope "${o}" is unavailable for ${t} searches.`);if(t==="user")return{result:{entityType:t,result:await K({portal:e,searchTerm:r,num:i,query:l.query,...a?{signal:a}:{}})}};let s=G(r);if(!s)return{};let u,p=e.user;if(o==="myContent"&&p)u=`owner:${b(p.username)}`;else if(o==="myOrganization"&&p?.orgId)u=`orgid:${b(p.orgId)}`;else if(o==="myGroups"&&p){if(t==="group"){let n=await M(e,{num:i,q:T(s,l.query),searchUserAccess:"groupMember",searchUserName:p.username},{signal:a});return{result:{entityType:t,result:new x({results:n.results,total:n.total})}}}let y=await p.fetchGroups();if(a?.throwIfAborted(),!y.length)return{result:{entityType:t,result:new x({results:[],total:0})}};u=y.map(({id:n})=>{if(!n)throw new Error("A membership group is missing its ID.");return`group:${b(n)}`}).join(" OR ")}let d={num:i,query:T(s,l.query,u)};return t==="group"?{result:{entityType:t,result:await e.queryGroups(d,{signal:a})}}:{result:{entityType:t,result:await e.queryItems(d,{signal:a})}}}catch(s){if(a?.aborted||q(s))throw s;return console.error(s),{error:{code:"unhandledError"}}}}var Q=l=>P((e,t)=>{let r={searchTerm:"",scope:"all",isSearching:!1,searchFailed:!1},a,i,o=n=>{r={...r,...n},t.exports={...r,setSearchTerm:d,setScope:y}},s=()=>{a!==void 0&&(clearTimeout(a),a=void 0),i?.abort(),i=void 0},u=async(n,h)=>{let{entityType:v,num:z,portal:D,query:U}=e,{scope:S}=r;try{let{error:g,result:N}=await H({portal:D,entityType:v,searchTerm:n,num:z,query:U,signal:h,...S==="all"?{}:{scope:S}});h.aborted||o({searchFailed:!!g,searchResult:N,isSearching:!1})}catch(g){!h.aborted&&!q(g)&&(console.error(g),o({searchFailed:!0,searchResult:void 0,isSearching:!1}))}},p=n=>{let h=n.searchTerm.trim();if(s(),o({...n,searchFailed:!1,searchResult:void 0,isSearching:!!h}),l(!!h),h){i=new AbortController;let{signal:v}=i;a=setTimeout(()=>{a=void 0,u(h,v)},400)}},d=n=>{p({searchTerm:n,scope:r.scope})},y=n=>{n!==r.scope&&p({searchTerm:r.searchTerm,scope:n})};return t.onUpdate(n=>{(n.has("portal")||n.has("entityType")||n.has("query")||n.has("num")||n.has("initialSearchTerm"))&&p({searchTerm:e.initialSearchTerm,scope:n.has("portal")||n.has("entityType")?"all":r.scope})}),t.onDisconnected(s),{...r,setSearchTerm:d,setScope:y}}),J=k`:host{display:block;inline-size:100%}.entity-picker{display:flex;flex-direction:column;gap:.5rem;min-inline-size:16rem}.entity-picker__results{max-block-size:var(--arcgis-portal-entity-picker-results-max-block-size, 22rem);overflow-y:auto}.entity-picker__cards{display:flex;flex-direction:column;gap:.5rem}.entity-picker__status{color:var(--calcite-color-text-3);font-size:.875rem;margin:0;padding:.75rem}.entity-picker__selection{align-items:center;display:var(--arcgis-portal-entity-picker-selection-display, flex);gap:.5rem}.entity-picker__selection-label{flex:1;min-inline-size:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.entity-picker__input{inline-size:100%}`,w=class extends C{constructor(){super(...arguments),this._messages=F({blocking:!0,name:"portal-entity-picker"}),this.inputRef=f(),this.inputContainerRef=f(),this.resizeObserver=null,this.searchController=Q(e=>{(!e||this.mode==="popover")&&(this.popoverOpen=e)})(this),this.popoverOpen=!1,this.popoverWidth=0,this.entityType="group",this.mode="inline",this.selectionMode="single",this.selected=null,this.initialSearchTerm="",this.num=10,this.arcgisSelectionChange=R()}static{this.properties={popoverOpen:16,popoverWidth:16,portal:0,entityType:1,mode:1,selectionMode:1,selected:0,query:1,initialSearchTerm:1,num:9,icon:1,messageOverrides:0}}static{this.styles=J}get searchLabel(){let{entityType:e,_messages:t}=this;return e==="group"?t.searchGroups:e==="item"?t.searchItems:t.searchUsers}get selectedLabel(){let{entityType:e,selected:t}=this;if(t?.entityType===e)return t.entityType==="user"?t.entity.fullName||t.entity.username:t.entity.title||t.entity.id||void 0}async togglePicker(e){this.mode==="popover"&&(this.popoverOpen=e,await this.updateComplete,await this.setFocus())}async setFocus(){await this.inputRef.value?.setFocus()}firstUpdated(){this.updatePopoverWidth(),!(typeof ResizeObserver>"u"||!this.inputContainerRef.value)&&(this.resizeObserver=new ResizeObserver(()=>this.updatePopoverWidth()),this.resizeObserver.observe(this.inputContainerRef.value))}willUpdate(e){e.has("mode")&&this.mode==="inline"&&(this.popoverOpen=!1)}disconnectedCallback(){this.resizeObserver?.disconnect(),this.resizeObserver=null,super.disconnectedCallback()}updatePopoverWidth(){requestAnimationFrame(()=>{this.popoverWidth=this.inputContainerRef.value?.offsetWidth??0})}emitSelection(e){this.arcgisSelectionChange.emit(e),this.mode==="popover"&&this.togglePicker(!1)}getFocusableResults(){let e=Array.from(this.renderRoot.querySelector('slot[name="list-start"]')?.assignedElements({flatten:!0})??[]).filter(r=>r instanceof HTMLElement&&(r.tagName==="CALCITE-LIST-ITEM"||r.tabIndex>=0)),t=Array.from(this.renderRoot.querySelectorAll("calcite-list-item, arcgis-portal-group-card, arcgis-portal-item-card"));return[...e,...t]}async focusResult(e){if(e.tagName==="CALCITE-LIST-ITEM"){await e.setFocus();return}if(e.tagName==="ARCGIS-PORTAL-GROUP-CARD"){await e.restoreFocus();return}if(e.tagName==="ARCGIS-PORTAL-ITEM-CARD"){await e.restoreFocus();return}e.focus()}async focusResultAt(e){let t=this.getFocusableResults();if(!t.length)return;let r=(e+t.length)%t.length;await this.focusResult(t[r])}handleResultsKeyDown(e){if(e.defaultPrevented)return;let t=this.getFocusableResults(),r=e.composedPath(),a=t.findIndex(o=>r.includes(o));if(a===-1)return;if(this.mode==="inline"&&(e.key==="ArrowDown"||e.key==="ArrowUp")){e.preventDefault(),this.focusResultAt(a+(e.key==="ArrowDown"?1:-1));return}let i=t[a];if(i.tagName==="ARCGIS-PORTAL-GROUP-CARD"&&(e.key==="Enter"||e.key===" ")){e.preventDefault();let{group:o}=i;this.emitSelection({entityType:"group",entity:o});return}if(i.tagName==="ARCGIS-PORTAL-ITEM-CARD"&&(e.key==="Enter"||e.key===" ")){e.preventDefault();let{item:o}=i;this.emitSelection({entityType:"item",entity:o})}}renderScopeSelector(){let{entityType:e,portal:t,_messages:r}=this,{scope:a}=this.searchController,i=E(t,e);return i.length<=1?null:c`<calcite-select .label=${r.searchIn} scale=m @calciteSelectChange=${o=>{let s=i.find(u=>u===o.target.value);s&&this.searchController.setScope(s)}}>${i.map(o=>c`<calcite-option .selected=${o===a} .value=${o}>${o==="all"?e==="item"?r.allContent:r.allGroups:r[o]}</calcite-option>`)}</calcite-select>`}renderGroup(e){return m(e.id,c`<calcite-list-item .label=${e.title||e.id||""} .description=${[e.owner,e.access].filter(Boolean).join(" \xB7 ")} .selected=${this.selected?.entityType==="group"&&this.selected.entity.id===e.id} @calciteListItemSelect=${()=>this.emitSelection({entityType:"group",entity:e})}><calcite-avatar slot=content-start .fullName=${e.title??void 0} .thumbnail=${e.thumbnailUrl??void 0} scale=m></calcite-avatar></calcite-list-item>`)}renderInlineGroup(e){return m(e.id,c`<arcgis-portal-group-card .group=${e} .portal=${this.portal} .preview=${this.selectionMode==="none"?"top":void 0} .selected=${this.selected?.entityType==="group"&&this.selected.entity.id===e.id} .selection=${this.selectionMode} @arcgisGroupBrowserCardPreview=${()=>this.emitSelection({entityType:"group",entity:e})} @arcgisGroupCardSelect=${({detail:t})=>{t.selected&&this.emitSelection({entityType:"group",entity:t.group})}} .user=${this.portal.user??void 0} view=compact></arcgis-portal-group-card>`)}renderItem(e){return m(e.id,c`<calcite-list-item .label=${e.title||e.id||""} .description=${[e.type,e.owner].filter(Boolean).join(" \xB7 ")} .selected=${this.selected?.entityType==="item"&&this.selected.entity.id===e.id} @calciteListItemSelect=${()=>this.emitSelection({entityType:"item",entity:e})}><calcite-avatar slot=content-start .fullName=${e.title??void 0} .thumbnail=${e.thumbnailUrl??void 0} scale=m></calcite-avatar></calcite-list-item>`)}renderInlineItem(e){return m(e.id,c`<arcgis-portal-item-card .item=${e} .portal=${this.portal} .preview=${this.selectionMode==="none"?"top":void 0} .selected=${this.selected?.entityType==="item"&&this.selected.entity.id===e.id} .selection=${this.selectionMode} @arcgisItemBrowserCardPreview=${()=>this.emitSelection({entityType:"item",entity:e})} @arcgisItemCardSelect=${({detail:t})=>{t.selected&&this.emitSelection({entityType:"item",entity:t.item})}} .user=${this.portal.user??void 0} view=list></arcgis-portal-item-card>`)}renderUser(e){return m(e.username,c`<calcite-list-item .label=${e.fullName||e.username} .description=${e.username} .selected=${this.selected?.entityType==="user"&&this.selected.entity.username===e.username} @calciteListItemSelect=${()=>this.emitSelection({entityType:"user",entity:e})}><arcgis-portal-user-avatar slot=content-start .portal=${this.portal} .user=${e} scale=m></arcgis-portal-user-avatar></calcite-list-item>`)}renderSearchResults(){let{entityType:e,_messages:t}=this,{isSearching:r,searchFailed:a,searchResult:i,searchTerm:o}=this.searchController;if(!o.trim())return null;if(r)return c`<div role=status><calcite-loader .label=${t.searching} scale=s></calcite-loader></div>`;if(a)return c`<p class="entity-picker__status" role=alert>${t.searchFailed}</p>`;if(!(i?.result.results??[]).length){let s=e==="group"?t.noGroupsFound:e==="item"?t.noItemsFound:t.noUsersFound;return c`<p class="entity-picker__status" role=status>${s}</p>`}return this.mode==="inline"&&i?.entityType==="group"?c`<div class="entity-picker__cards"><slot name=list-start></slot>${i.result.results.map(s=>this.renderInlineGroup(s))}</div>`:this.mode==="inline"&&i?.entityType==="item"?c`<div class="entity-picker__cards"><slot name=list-start></slot>${i.result.results.map(s=>this.renderInlineItem(s))}</div>`:c`<calcite-list interaction-mode=interactive .label=${this.searchLabel} .selectionMode=${this.mode==="inline"&&this.selectionMode==="single"?"single-persist":"none"}><slot name=list-start></slot>${i?.entityType==="group"?i.result.results.map(s=>this.renderGroup(s)):i?.entityType==="item"?i.result.results.map(s=>this.renderItem(s)):i?.result.results.map(s=>this.renderUser(s))}</calcite-list>`}renderPicker(e=!0){return c`<div class="entity-picker">${this.selectedLabel&&c`<div class="entity-picker__selection"><span class="entity-picker__selection-label">${this.selectedLabel}</span><calcite-button appearance=transparent icon-start=x kind=neutral .label=${this._messages.clearSelection} @click=${()=>this.arcgisSelectionChange.emit(null)} scale=s></calcite-button></div>`||""}${this.renderScopeSelector()}<div class="entity-picker__input" ${$(this.inputContainerRef)}><calcite-input .icon=${this.icon} .clearable=${this.mode==="inline"} .label=${this.searchLabel} .placeholder=${this.searchLabel} .value=${this.searchController.searchTerm} @click=${()=>{this.mode==="popover"&&this.searchController.searchTerm.trim()&&(this.popoverOpen=!0)}} @keydown=${t=>{(t.key==="ArrowDown"||t.key==="ArrowUp")&&this.searchController.searchResult?.result.results.length&&(t.preventDefault(),this.focusResultAt(t.key==="ArrowDown"?0:-1))}} @focus=${()=>{this.mode==="popover"&&this.searchController.searchTerm.trim()&&(this.popoverOpen=!0)}} @calciteInputInput=${t=>{this.searchController.setSearchTerm(t.target.value)}} ${$(this.inputRef)}></calcite-input></div>${e&&c`<div class="entity-picker__results" @keydown=${this.handleResultsKeyDown}>${this.renderSearchResults()}</div>`||""}</div>`}render(){return this.mode==="inline"?this.renderPicker():c`${this.renderPicker(!1)}<calcite-popover .label=${this.searchLabel} .open=${this.popoverOpen} placement=bottom-start .referenceElement=${this.inputContainerRef.value} trigger-disabled @calcitePopoverClose=${e=>{!e.target.open&&this.popoverOpen&&(this.popoverOpen=!1,requestAnimationFrame(()=>{this.setFocus()}))}}><div class="entity-picker__results" style=${I({inlineSize:this.popoverWidth?`${this.popoverWidth}px`:void 0})}>${this.renderSearchResults()}</div></calcite-popover>`}};_("arcgis-portal-entity-picker",w);return w},"core/promiseUtils","portal/PortalQueryResult",a,b)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import a from"./R5PSADUV.js";import"./GUL7EIJ4.js";import"./H7DF6TTK.js";import"./KV4ZZSNW.js";import"./2FKNF2ZK.js";import{a as u}from"./AYHYABMC.js";import"./OQ3OHDEB.js";import"./I57CRKF7.js";import{I as l,J as c,K as d,Q as v,j as s,v as n}from"./3ZC26CT6.js";import"./OUMTV5H5.js";import"./5PV2GUZW.js";export default $arcgis.t(([{a:p,b:m,c:f}])=>{var a=class extends d{constructor(){super(),this.messages=u({blocking:!0}),this.buttonRef=l(),this.favoriteRequestId=0,this.handleFavoriteUpdate=t=>{let i=f(t,this.item?.id??void 0);i&&(this.isFavorite=i.favorite)},this.handleToggleFavorite=async t=>{t.preventDefault(),t.stopPropagation();let{item:i,portal:o,user:r}=this;if(!i.id||!o||!r)return;let F={id:i.id,access:i.access},h=this.isFavorite,e=!h;this.isFavorite=e;let{updated:g}=await m({currentFavorite:h,item:F,portal:o,user:r});if(!g){this.isFavorite=!e;return}this.arcgisItemFavoriteUpdate.emit({id:i.id,favorite:e})},this.isFavorite=!1,this.isFavoriteLoaded=!1,this.width="full",this.iconOnly=!1,this.scale="m",this.showTooltip=!1,this.arcgisItemFavoriteUpdate=n(),this.listenOn(window,"arcgisItemFavoriteUpdate",this.handleFavoriteUpdate)}static{this.properties={isFavorite:16,isFavoriteLoaded:16,item:0,portal:0,user:0,width:1,iconOnly:5,scale:1,showTooltip:5}}async setFocus(){await this.buttonRef.value?.setFocus()}willUpdate(t){(t.has("item")||t.has("portal")||t.has("user"))&&(this.isFavoriteLoaded=!1,this.refreshFavorite())}async refreshFavorite(){if(!this.item.id||!this.portal||!this.user){this.isFavorite=!1;return}let t=++this.favoriteRequestId,i=await p(this.item.id,this.portal,this.user);t===this.favoriteRequestId&&(this.isFavorite=i,this.isFavoriteLoaded=!0)}render(){if(!this.isFavoriteLoaded)return null;let t=this.isFavorite?this.messages.remove:this.messages.add;return s`<calcite-button .width=${this.iconOnly?"auto":this.width} .scale=${this.scale} .appearance=${this.iconOnly?"transparent":"outline-fill"} kind=neutral .iconStart=${this.isFavorite?"star-f":"star"} .ariaLabel=${this.iconOnly?t:void 0} @click=${this.handleToggleFavorite} ${c(this.buttonRef)}>${this.iconOnly?null:t}</calcite-button>${this.showTooltip?s`<calcite-tooltip .referenceElement=${this.buttonRef.value}>${t}</calcite-tooltip>`:null}`}};v("arcgis-portal-item-favorite",a);return a},a)
2
+ import a from"./O4YFPGD5.js";import"./GUL7EIJ4.js";import"./4VLEUN7I.js";import"./KV4ZZSNW.js";import"./FN2QMDEW.js";import{a as u}from"./AYHYABMC.js";import"./OQ3OHDEB.js";import"./I57CRKF7.js";import{I as l,J as c,K as d,Q as v,j as s,v as n}from"./3ZC26CT6.js";import"./OUMTV5H5.js";import"./5PV2GUZW.js";export default $arcgis.t(([{a:p,b:m,c:f}])=>{var a=class extends d{constructor(){super(),this.messages=u({blocking:!0}),this.buttonRef=l(),this.favoriteRequestId=0,this.handleFavoriteUpdate=t=>{let i=f(t,this.item?.id??void 0);i&&(this.isFavorite=i.favorite)},this.handleToggleFavorite=async t=>{t.preventDefault(),t.stopPropagation();let{item:i,portal:o,user:r}=this;if(!i.id||!o||!r)return;let F={id:i.id,access:i.access},h=this.isFavorite,e=!h;this.isFavorite=e;let{updated:g}=await m({currentFavorite:h,item:F,portal:o,user:r});if(!g){this.isFavorite=!e;return}this.arcgisItemFavoriteUpdate.emit({id:i.id,favorite:e})},this.isFavorite=!1,this.isFavoriteLoaded=!1,this.width="full",this.iconOnly=!1,this.scale="m",this.showTooltip=!1,this.arcgisItemFavoriteUpdate=n(),this.listenOn(window,"arcgisItemFavoriteUpdate",this.handleFavoriteUpdate)}static{this.properties={isFavorite:16,isFavoriteLoaded:16,item:0,portal:0,user:0,width:1,iconOnly:5,scale:1,showTooltip:5}}async setFocus(){await this.buttonRef.value?.setFocus()}willUpdate(t){(t.has("item")||t.has("portal")||t.has("user"))&&(this.isFavoriteLoaded=!1,this.refreshFavorite())}async refreshFavorite(){if(!this.item.id||!this.portal||!this.user){this.isFavorite=!1;return}let t=++this.favoriteRequestId,i=await p(this.item.id,this.portal,this.user);t===this.favoriteRequestId&&(this.isFavorite=i,this.isFavoriteLoaded=!0)}render(){if(!this.isFavoriteLoaded)return null;let t=this.isFavorite?this.messages.remove:this.messages.add;return s`<calcite-button .width=${this.iconOnly?"auto":this.width} .scale=${this.scale} .appearance=${this.iconOnly?"transparent":"outline-fill"} kind=neutral .iconStart=${this.isFavorite?"star-f":"star"} .ariaLabel=${this.iconOnly?t:void 0} @click=${this.handleToggleFavorite} ${c(this.buttonRef)}>${this.iconOnly?null:t}</calcite-button>${this.showTooltip?s`<calcite-tooltip .referenceElement=${this.buttonRef.value}>${t}</calcite-tooltip>`:null}`}};v("arcgis-portal-item-favorite",a);return a},a)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{a as i,b as p}from"./KV4ZZSNW.js";import{c as s}from"./2FKNF2ZK.js";function y(t){return i(t.restUrl)}function c(t,e){let o=p({portal:e}),r=new URL(t,o);return r.protocol="https:",e?.httpsPort&&e.httpsPort!==80&&e.httpsPort!==443&&(r.port=`${e.httpsPort}`),r.href}function u(t){let e=n(t),o=e?.helpBase;if(o?.startsWith("https://enterprise.arcgis.com/"))return`${o}portal/`;let r=o;return e?.portalDeploymentType!=="ArcGISEnterpriseOnKubernetes"&&(r+="portal/"),t.allSSL||window.location.protocol==="https:"||l(t)||window.location.port==="7443"?c(`${window.location.protocol}//${window.location.host}${r}`,t):r}function P(t){return t.isPortal?u(t):n(t).helpBase||"support.html"}function l(t){return!!(t?.isPortal&&t?.portalHostname&&!t.portalHostname.match(/:7080\//u)&&t.httpPort!==80&&t.httpsPort!==443&&window.location.protocol==="https:")}function g(t){return t.credential?.token||t.token||t.user?.credential?.token||t.portalUser?.token||""}function w(t){return t.sourceJSON?.isWebTierAuth}function d(t,e,o){if(!e?.type)return!1;let r=e.typeKeywords??[];switch(t){case"arcgisinstantapps":return e.type==="Web Mapping Application"&&r.includes("configurableApp");case"arcgis360vr":return!o&&e.type==="360 VR Experience";case"survey123":return e.type==="Form";case"datapipelines":return e.type==="Data Pipeline";case"dashboards":return e.type==="Dashboard";case"experienceBuilder":return e.type==="Web Experience"||e.type==="Web Experience Template";case"webappbuilder":return e.type==="Web Mapping Application"&&(r.includes("Web AppBuilder")||r.includes("WebAppBuilder"));case"fieldmaps":return e.type==="Web Map";case"arcgisnotebooks":return e.type==="Notebook";case"HubforArcGIS":return["Discussion","Hub Page","Hub Initiative Template","Hub Initiative","Hub Event","Hub Project"].includes(e.type);default:return!1}}function H(t,e,o){return(e??[]).some(r=>d(r,t,o))}var n=t=>t.sourceJSON,a=t=>t.portalProperties??{};function T(t){let e=a(t).homePage==="modern";return t.isPortal?e||f(t):e||b(t)}function b(t){let e=new Date("June 30, 2020").getTime();return!t.isPortal&&t.created?t.created.getTime()>=e:!1}function f(t){return t.isPortal&&a(t).homePage==="modernOnly"}function W(t){return t.type==="gallery"&&!!t.groupId}function k(t){let e=n(t);return t?.isPortal?e.supportsHostedNotebooks:!(s(["Trial Developer","Trial","Trial Press"],e.subscriptionInfo?.type)||e.subscriptionInfo?.options?.includes("Developer"))}export{y as a,c as b,P as c,g as d,w as e,H as f,n as g,T as h,W as i,k as j};
2
+ import{a as i,b as p}from"./KV4ZZSNW.js";import{d as s}from"./FN2QMDEW.js";function y(t){return i(t.restUrl)}function c(t,e){let o=p({portal:e}),r=new URL(t,o);return r.protocol="https:",e?.httpsPort&&e.httpsPort!==80&&e.httpsPort!==443&&(r.port=`${e.httpsPort}`),r.href}function u(t){let e=n(t),o=e?.helpBase;if(o?.startsWith("https://enterprise.arcgis.com/"))return`${o}portal/`;let r=o;return e?.portalDeploymentType!=="ArcGISEnterpriseOnKubernetes"&&(r+="portal/"),t.allSSL||window.location.protocol==="https:"||l(t)||window.location.port==="7443"?c(`${window.location.protocol}//${window.location.host}${r}`,t):r}function P(t){return t.isPortal?u(t):n(t).helpBase||"support.html"}function l(t){return!!(t?.isPortal&&t?.portalHostname&&!t.portalHostname.match(/:7080\//u)&&t.httpPort!==80&&t.httpsPort!==443&&window.location.protocol==="https:")}function g(t){return t.credential?.token||t.token||t.user?.credential?.token||t.portalUser?.token||""}function w(t){return t.sourceJSON?.isWebTierAuth}function d(t,e,o){if(!e?.type)return!1;let r=e.typeKeywords??[];switch(t){case"arcgisinstantapps":return e.type==="Web Mapping Application"&&r.includes("configurableApp");case"arcgis360vr":return!o&&e.type==="360 VR Experience";case"survey123":return e.type==="Form";case"datapipelines":return e.type==="Data Pipeline";case"dashboards":return e.type==="Dashboard";case"experienceBuilder":return e.type==="Web Experience"||e.type==="Web Experience Template";case"webappbuilder":return e.type==="Web Mapping Application"&&(r.includes("Web AppBuilder")||r.includes("WebAppBuilder"));case"fieldmaps":return e.type==="Web Map";case"arcgisnotebooks":return e.type==="Notebook";case"HubforArcGIS":return["Discussion","Hub Page","Hub Initiative Template","Hub Initiative","Hub Event","Hub Project"].includes(e.type);default:return!1}}function H(t,e,o){return(e??[]).some(r=>d(r,t,o))}var n=t=>t.sourceJSON,a=t=>t.portalProperties??{};function T(t){let e=a(t).homePage==="modern";return t.isPortal?e||f(t):e||b(t)}function b(t){let e=new Date("June 30, 2020").getTime();return!t.isPortal&&t.created?t.created.getTime()>=e:!1}function f(t){return t.isPortal&&a(t).homePage==="modernOnly"}function W(t){return t.type==="gallery"&&!!t.groupId}function k(t){let e=n(t);return t?.isPortal?e.supportsHostedNotebooks:!(s(["Trial Developer","Trial","Trial Press"],e.subscriptionInfo?.type)||e.subscriptionInfo?.options?.includes("Developer"))}export{y as a,c as b,P as c,g as d,w as e,H as f,n as g,T as h,W as i,k as j};
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{$ as _e,$a as Vt,A as _i,Aa as Zi,B as vi,C as bi,D as wi,Da as Ui,E as ki,Ea as tn,F as We,G as _r,Ha as wr,I as Pn,J as Tt,Ja as $n,K as Gr,Ka as Vi,L as xi,M as Ti,Ma as iu,N as Si,P as Ei,Pa as kr,Q as vr,R as Ai,Ra as Dn,S as Ra,U as zt,V as Jr,Va as Ln,W as Oi,Wa as tt,X as Ci,Y as Ge,Ya as Oe,Z as br,_ as qr,_a as he,a as M,aa as Hr,ab as q,b as gr,ba as Kr,bb as Y,c as si,ca as Ii,cb as xe,d as yr,da as Ni,ea as Yr,fa as Xr,ga as Pi,ha as Ri,ia as et,ja as Qr,k as On,ka as Mi,l as ii,la as $i,m as Cn,ma as en,n as In,na as Bt,o as oi,oa as Zt,p as ci,pa as Di,q as Nn,qa as Li,r as ui,ra as ji,s as li,sa as St,t as di,ta as Rn,u as fi,ua as Mn,v as pi,va as Fi,w as mi,wa as zi,x as hi,xa as Ut,y as gi,ya as Bi,z as yi}from"./UUITDWRA.js";import{a as rt,b as Ma,c as jn,d as $a,e as Wi,f as Gi,g as Da,j as Te,k as Ji,l as qi,m as La,o as ja}from"./K3GAZFRI.js";import{a as au,b as su,c as ai}from"./5PV2GUZW.js";var Cc=au(wa=>{"use strict";wa.byteLength=jd;wa.toByteArray=zd;wa.fromByteArray=Ud;var lt=[],Be=[],Ld=typeof Uint8Array<"u"?Uint8Array:Array,Ws="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(fr=0,Ac=Ws.length;fr<Ac;++fr)lt[fr]=Ws[fr],Be[Ws.charCodeAt(fr)]=fr;var fr,Ac;Be[45]=62;Be[95]=63;function Oc(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function jd(e){var t=Oc(e),r=t[0],n=t[1];return(r+n)*3/4-n}function Fd(e,t,r){return(t+r)*3/4-r}function zd(e){var t,r=Oc(e),n=r[0],a=r[1],s=new Ld(Fd(e,n,a)),i=0,o=a>0?n-4:n,c;for(c=0;c<o;c+=4)t=Be[e.charCodeAt(c)]<<18|Be[e.charCodeAt(c+1)]<<12|Be[e.charCodeAt(c+2)]<<6|Be[e.charCodeAt(c+3)],s[i++]=t>>16&255,s[i++]=t>>8&255,s[i++]=t&255;return a===2&&(t=Be[e.charCodeAt(c)]<<2|Be[e.charCodeAt(c+1)]>>4,s[i++]=t&255),a===1&&(t=Be[e.charCodeAt(c)]<<10|Be[e.charCodeAt(c+1)]<<4|Be[e.charCodeAt(c+2)]>>2,s[i++]=t>>8&255,s[i++]=t&255),s}function Bd(e){return lt[e>>18&63]+lt[e>>12&63]+lt[e>>6&63]+lt[e&63]}function Zd(e,t,r){for(var n,a=[],s=t;s<r;s+=3)n=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(e[s+2]&255),a.push(Bd(n));return a.join("")}function Ud(e){for(var t,r=e.length,n=r%3,a=[],s=16383,i=0,o=r-n;i<o;i+=s)a.push(Zd(e,i,i+s>o?o:i+s));return n===1?(t=e[r-1],a.push(lt[t>>2]+lt[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],a.push(lt[t>>10]+lt[t>>4&63]+lt[t<<2&63]+"=")),a.join("")}});async function Ce(e,t){if(t===void 0)return e;let r;return Promise.race([e.catch(n=>{if(!t?.aborted)throw n}),new Promise((n,a)=>{r=()=>{a(Et(t))},t.addEventListener("abort",r,{once:!0}),t.aborted&&a(Et(t))})]).finally(()=>t.removeEventListener("abort",r))}function Et(e){return e?.reason instanceof Error?e.reason:typeof e?.reason=="string"?new Error(e.reason):new Error("Aborted")}var Bf=M({AsyncGeneratorWithSetup:()=>At,IterableReadableStream:()=>ve,atee:()=>Fn,concat:()=>Ie,pipeGeneratorWithSetup:()=>za}),ve=class Fa extends ReadableStream{reader;ensureReader(){this.reader||(this.reader=this.getReader())}async next(){this.ensureReader();try{let t=await this.reader.read();return t.done?(this.reader.releaseLock(),{done:!0,value:void 0}):{done:!1,value:t.value}}catch(t){throw this.reader.releaseLock(),t}}async return(){if(this.ensureReader(),this.locked){let t=this.reader.cancel();this.reader.releaseLock(),await t}return{done:!0,value:void 0}}async throw(t){if(this.ensureReader(),this.locked){let r=this.reader.cancel();this.reader.releaseLock(),await r}throw t}[Symbol.asyncIterator](){return this}async[Symbol.asyncDispose](){await this.return()}static fromReadableStream(t){let r=t.getReader();return new Fa({start(n){return a();function a(){return r.read().then(({done:s,value:i})=>{if(s){n.close();return}return n.enqueue(i),a()})}},cancel(){r.releaseLock()}})}static fromAsyncGenerator(t){return new Fa({async pull(r){let{value:n,done:a}=await t.next();a&&r.close(),r.enqueue(n)},async cancel(r){await t.return(r)}})}};function Fn(e,t=2){let r=Array.from({length:t},()=>[]);return r.map(async function*(a){for(;;)if(a.length===0){let s=await e.next();for(let i of r)i.push(s)}else{if(a[0].done)return;yield a.shift().value}})}function Ie(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.concat(t);if(typeof e=="string"&&typeof t=="string")return e+t;if(typeof e=="number"&&typeof t=="number")return e+t;if("concat"in e&&typeof e.concat=="function")return e.concat(t);if(typeof e=="object"&&typeof t=="object"){let r={...e};for(let[n,a]of Object.entries(t))n in r&&!Array.isArray(r[n])?r[n]=Ie(r[n],a):r[n]=a;return r}else throw new Error(`Cannot concat ${typeof e} and ${typeof t}`)}var At=class{generator;setup;config;signal;firstResult;firstResultUsed=!1;constructor(e){this.generator=e.generator,this.config=e.config,this.signal=e.signal??this.config?.signal,this.setup=new Promise((t,r)=>{Oe.runWithConfig(xe(e.config),async()=>{this.firstResult=this.signal?Ce(e.generator.next(),this.signal):e.generator.next(),e.startSetup?this.firstResult.then(e.startSetup).then(t,r):this.firstResult.then(n=>t(void 0),r)},!0)})}async next(...e){return this.signal?.throwIfAborted(),this.firstResultUsed?Oe.runWithConfig(xe(this.config),this.signal?async()=>Ce(this.generator.next(...e),this.signal):async()=>this.generator.next(...e),!0):(this.firstResultUsed=!0,this.firstResult)}async return(e){return this.generator.return(e)}async throw(e){return this.generator.throw(e)}[Symbol.asyncIterator](){return this}async[Symbol.asyncDispose](){await this.return()}};async function za(e,t,r,n,...a){let s=new At({generator:t,startSetup:r,signal:n}),i=await s.setup;return{output:e(s,i,...a),setup:i}}var ou=Object.prototype.hasOwnProperty;function Bn(e,t){return ou.call(e,t)}function Zn(e){if(Array.isArray(e)){let r=new Array(e.length);for(let n=0;n<r.length;n++)r[n]=""+n;return r}if(Object.keys)return Object.keys(e);let t=[];for(let r in e)Bn(e,r)&&t.push(r);return t}function Ne(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function Un(e){let t=0,r=e.length,n;for(;t<r;){if(n=e.charCodeAt(t),n>=48&&n<=57){t++;continue}return!1}return!0}function Wt(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function Ki(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function zn(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(let r=0,n=e.length;r<n;r++)if(zn(e[r]))return!0}else if(typeof e=="object"){let r=Zn(e),n=r.length;for(var t=0;t<n;t++)if(zn(e[r[t]]))return!0}}return!1}function Hi(e,t){let r=[e];for(let n in t){let a=typeof t[n]=="object"?JSON.stringify(t[n],null,2):t[n];typeof a<"u"&&r.push(`${n}: ${a}`)}return r.join(`
2
+ import{$ as _e,$a as Vt,A as _i,Aa as Zi,B as vi,C as bi,D as wi,Da as Ui,E as ki,Ea as tn,F as We,G as _r,Ha as wr,I as Pn,J as Tt,Ja as $n,K as Gr,Ka as Vi,L as xi,M as Ti,Ma as iu,N as Si,P as Ei,Pa as kr,Q as vr,R as Ai,Ra as Dn,S as Ra,U as zt,V as Jr,Va as Ln,W as Oi,Wa as tt,X as Ci,Y as Ge,Ya as Oe,Z as br,_ as qr,_a as he,a as M,aa as Hr,ab as q,b as gr,ba as Kr,bb as Y,c as si,ca as Ii,cb as xe,d as yr,da as Ni,ea as Yr,fa as Xr,ga as Pi,ha as Ri,ia as et,ja as Qr,k as On,ka as Mi,l as ii,la as $i,m as Cn,ma as en,n as In,na as Bt,o as oi,oa as Zt,p as ci,pa as Di,q as Nn,qa as Li,r as ui,ra as ji,s as li,sa as St,t as di,ta as Rn,u as fi,ua as Mn,v as pi,va as Fi,w as mi,wa as zi,x as hi,xa as Ut,y as gi,ya as Bi,z as yi}from"./XYT4533U.js";import{a as rt,b as Ma,c as jn,d as $a,e as Wi,f as Gi,g as Da,j as Te,k as Ji,l as qi,m as La,o as ja}from"./K3GAZFRI.js";import{a as au,b as su,c as ai}from"./5PV2GUZW.js";var Cc=au(wa=>{"use strict";wa.byteLength=jd;wa.toByteArray=zd;wa.fromByteArray=Ud;var lt=[],Be=[],Ld=typeof Uint8Array<"u"?Uint8Array:Array,Ws="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(fr=0,Ac=Ws.length;fr<Ac;++fr)lt[fr]=Ws[fr],Be[Ws.charCodeAt(fr)]=fr;var fr,Ac;Be[45]=62;Be[95]=63;function Oc(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function jd(e){var t=Oc(e),r=t[0],n=t[1];return(r+n)*3/4-n}function Fd(e,t,r){return(t+r)*3/4-r}function zd(e){var t,r=Oc(e),n=r[0],a=r[1],s=new Ld(Fd(e,n,a)),i=0,o=a>0?n-4:n,c;for(c=0;c<o;c+=4)t=Be[e.charCodeAt(c)]<<18|Be[e.charCodeAt(c+1)]<<12|Be[e.charCodeAt(c+2)]<<6|Be[e.charCodeAt(c+3)],s[i++]=t>>16&255,s[i++]=t>>8&255,s[i++]=t&255;return a===2&&(t=Be[e.charCodeAt(c)]<<2|Be[e.charCodeAt(c+1)]>>4,s[i++]=t&255),a===1&&(t=Be[e.charCodeAt(c)]<<10|Be[e.charCodeAt(c+1)]<<4|Be[e.charCodeAt(c+2)]>>2,s[i++]=t>>8&255,s[i++]=t&255),s}function Bd(e){return lt[e>>18&63]+lt[e>>12&63]+lt[e>>6&63]+lt[e&63]}function Zd(e,t,r){for(var n,a=[],s=t;s<r;s+=3)n=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(e[s+2]&255),a.push(Bd(n));return a.join("")}function Ud(e){for(var t,r=e.length,n=r%3,a=[],s=16383,i=0,o=r-n;i<o;i+=s)a.push(Zd(e,i,i+s>o?o:i+s));return n===1?(t=e[r-1],a.push(lt[t>>2]+lt[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],a.push(lt[t>>10]+lt[t>>4&63]+lt[t<<2&63]+"=")),a.join("")}});async function Ce(e,t){if(t===void 0)return e;let r;return Promise.race([e.catch(n=>{if(!t?.aborted)throw n}),new Promise((n,a)=>{r=()=>{a(Et(t))},t.addEventListener("abort",r,{once:!0}),t.aborted&&a(Et(t))})]).finally(()=>t.removeEventListener("abort",r))}function Et(e){return e?.reason instanceof Error?e.reason:typeof e?.reason=="string"?new Error(e.reason):new Error("Aborted")}var Bf=M({AsyncGeneratorWithSetup:()=>At,IterableReadableStream:()=>ve,atee:()=>Fn,concat:()=>Ie,pipeGeneratorWithSetup:()=>za}),ve=class Fa extends ReadableStream{reader;ensureReader(){this.reader||(this.reader=this.getReader())}async next(){this.ensureReader();try{let t=await this.reader.read();return t.done?(this.reader.releaseLock(),{done:!0,value:void 0}):{done:!1,value:t.value}}catch(t){throw this.reader.releaseLock(),t}}async return(){if(this.ensureReader(),this.locked){let t=this.reader.cancel();this.reader.releaseLock(),await t}return{done:!0,value:void 0}}async throw(t){if(this.ensureReader(),this.locked){let r=this.reader.cancel();this.reader.releaseLock(),await r}throw t}[Symbol.asyncIterator](){return this}async[Symbol.asyncDispose](){await this.return()}static fromReadableStream(t){let r=t.getReader();return new Fa({start(n){return a();function a(){return r.read().then(({done:s,value:i})=>{if(s){n.close();return}return n.enqueue(i),a()})}},cancel(){r.releaseLock()}})}static fromAsyncGenerator(t){return new Fa({async pull(r){let{value:n,done:a}=await t.next();a&&r.close(),r.enqueue(n)},async cancel(r){await t.return(r)}})}};function Fn(e,t=2){let r=Array.from({length:t},()=>[]);return r.map(async function*(a){for(;;)if(a.length===0){let s=await e.next();for(let i of r)i.push(s)}else{if(a[0].done)return;yield a.shift().value}})}function Ie(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.concat(t);if(typeof e=="string"&&typeof t=="string")return e+t;if(typeof e=="number"&&typeof t=="number")return e+t;if("concat"in e&&typeof e.concat=="function")return e.concat(t);if(typeof e=="object"&&typeof t=="object"){let r={...e};for(let[n,a]of Object.entries(t))n in r&&!Array.isArray(r[n])?r[n]=Ie(r[n],a):r[n]=a;return r}else throw new Error(`Cannot concat ${typeof e} and ${typeof t}`)}var At=class{generator;setup;config;signal;firstResult;firstResultUsed=!1;constructor(e){this.generator=e.generator,this.config=e.config,this.signal=e.signal??this.config?.signal,this.setup=new Promise((t,r)=>{Oe.runWithConfig(xe(e.config),async()=>{this.firstResult=this.signal?Ce(e.generator.next(),this.signal):e.generator.next(),e.startSetup?this.firstResult.then(e.startSetup).then(t,r):this.firstResult.then(n=>t(void 0),r)},!0)})}async next(...e){return this.signal?.throwIfAborted(),this.firstResultUsed?Oe.runWithConfig(xe(this.config),this.signal?async()=>Ce(this.generator.next(...e),this.signal):async()=>this.generator.next(...e),!0):(this.firstResultUsed=!0,this.firstResult)}async return(e){return this.generator.return(e)}async throw(e){return this.generator.throw(e)}[Symbol.asyncIterator](){return this}async[Symbol.asyncDispose](){await this.return()}};async function za(e,t,r,n,...a){let s=new At({generator:t,startSetup:r,signal:n}),i=await s.setup;return{output:e(s,i,...a),setup:i}}var ou=Object.prototype.hasOwnProperty;function Bn(e,t){return ou.call(e,t)}function Zn(e){if(Array.isArray(e)){let r=new Array(e.length);for(let n=0;n<r.length;n++)r[n]=""+n;return r}if(Object.keys)return Object.keys(e);let t=[];for(let r in e)Bn(e,r)&&t.push(r);return t}function Ne(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function Un(e){let t=0,r=e.length,n;for(;t<r;){if(n=e.charCodeAt(t),n>=48&&n<=57){t++;continue}return!1}return!0}function Wt(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function Ki(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function zn(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(let r=0,n=e.length;r<n;r++)if(zn(e[r]))return!0}else if(typeof e=="object"){let r=Zn(e),n=r.length;for(var t=0;t<n;t++)if(zn(e[r[t]]))return!0}}return!1}function Hi(e,t){let r=[e];for(let n in t){let a=typeof t[n]=="object"?JSON.stringify(t[n],null,2):t[n];typeof a<"u"&&r.push(`${n}: ${a}`)}return r.join(`
3
3
  `)}var Yi=class extends Error{name;index;operation;tree;constructor(e,t,r,n,a){super(Hi(e,{name:t,index:r,operation:n,tree:a})),this.name=t,this.index=r,this.operation=n,this.tree=a,Object.setPrototypeOf(this,new.target.prototype),this.message=Hi(e,{name:t,index:r,operation:n,tree:a})}};var Xi=M({JsonPatchError:()=>ae,_areEquals:()=>Tr,applyOperation:()=>Ot,applyPatch:()=>pt,applyReducer:()=>Qi,deepClone:()=>cu,getValueByPointer:()=>rn,validate:()=>Ba,validator:()=>nn});var ae=Yi,cu=Ne,xr={add:function(e,t,r){if(t==="__proto__"||t==="constructor")throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor` prop is banned for security reasons");return e[t]=this.value,{newDocument:r}},remove:function(e,t,r){if(t==="__proto__"||t==="constructor")throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor` prop is banned for security reasons");var n=e[t];return delete e[t],{newDocument:r,removed:n}},replace:function(e,t,r){if(t==="__proto__"||t==="constructor")throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor` prop is banned for security reasons");var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:function(e,t,r){let n=rn(r,this.path);n&&(n=Ne(n));let a=Ot(r,{op:"remove",path:this.from}).removed;return Ot(r,{op:"add",path:this.path,value:a}),{newDocument:r,removed:n}},copy:function(e,t,r){let n=rn(r,this.from);return Ot(r,{op:"add",path:this.path,value:Ne(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:Tr(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},uu={add:function(e,t,r){return Un(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:r,index:t}},remove:function(e,t,r){return{newDocument:r,removed:e.splice(t,1)[0]}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:xr.move,copy:xr.copy,test:xr.test,_get:xr._get};function rn(e,t){if(t=="")return e;var r={op:"_get",path:t};return Ot(e,r),r.value}function Ot(e,t,r=!1,n=!0,a=!0,s=0){if(r&&(typeof r=="function"?r(t,0,e,t.path):nn(t,0)),t.path===""){let i={newDocument:e};if(t.op==="add")return i.newDocument=t.value,i;if(t.op==="replace")return i.newDocument=t.value,i.removed=e,i;if(t.op==="move"||t.op==="copy")return i.newDocument=rn(e,t.from),t.op==="move"&&(i.removed=e),i;if(t.op==="test"){if(i.test=Tr(e,t.value),i.test===!1)throw new ae("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return i.newDocument=e,i}else{if(t.op==="remove")return i.removed=e,i.newDocument=null,i;if(t.op==="_get")return t.value=e,i;if(r)throw new ae("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",s,t,e);return i}}else{n||(e=Ne(e));let i=(t.path||"").split("/"),o=e,c=1,l=i.length,f,p,y;for(typeof r=="function"?y=r:y=nn;;){if(p=i[c],p&&p.indexOf("~")!=-1&&(p=Ki(p)),a&&(p=="__proto__"||p=="prototype"&&c>0&&i[c-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&f===void 0&&(o[p]===void 0?f=i.slice(0,c).join("/"):c==l-1&&(f=t.path),f!==void 0&&y(t,0,e,f)),c++,Array.isArray(o)){if(p==="-")p=o.length;else{if(r&&!Un(p))throw new ae("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",s,t,e);Un(p)&&(p=~~p)}if(c>=l){if(r&&t.op==="add"&&p>o.length)throw new ae("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",s,t,e);let h=uu[t.op].call(t,o,p,e);if(h.test===!1)throw new ae("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return h}}else if(c>=l){let h=xr[t.op].call(t,o,p,e);if(h.test===!1)throw new ae("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return h}if(o=o[p],r&&c<l&&(!o||typeof o!="object"))throw new ae("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",s,t,e)}}}function pt(e,t,r,n=!0,a=!0){if(r&&!Array.isArray(t))throw new ae("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=Ne(e));let s=new Array(t.length);for(let i=0,o=t.length;i<o;i++)s[i]=Ot(e,t[i],r,!0,a,i),e=s[i].newDocument;return s.newDocument=e,s}function Qi(e,t,r){let n=Ot(e,t);if(n.test===!1)throw new ae("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}function nn(e,t,r,n){if(typeof e!="object"||e===null||Array.isArray(e))throw new ae("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(xr[e.op]){if(typeof e.path!="string")throw new ae("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new ae('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,r);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new ae("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new ae("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&zn(e.value))throw new ae("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,r);if(r){if(e.op=="add"){var a=e.path.split("/").length,s=n.split("/").length;if(a!==s+1&&a!==s)throw new ae("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,r)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==n)throw new ae("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,r)}else if(e.op==="move"||e.op==="copy"){var i=Ba([{op:"_get",path:e.from,value:void 0}],r);if(i&&i.name==="OPERATION_PATH_UNRESOLVABLE")throw new ae("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}}else throw new ae("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r)}function Ba(e,t,r){try{if(!Array.isArray(e))throw new ae("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)pt(Ne(t),Ne(e),r||!0);else{r=r||nn;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(a){if(a instanceof ae)return a;throw a}}function Tr(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var r=Array.isArray(e),n=Array.isArray(t),a,s,i;if(r&&n){if(s=e.length,s!=t.length)return!1;for(a=s;a--!==0;)if(!Tr(e[a],t[a]))return!1;return!0}if(r!=n)return!1;var o=Object.keys(e);if(s=o.length,s!==Object.keys(t).length)return!1;for(a=s;a--!==0;)if(!t.hasOwnProperty(o[a]))return!1;for(a=s;a--!==0;)if(i=o[a],!Tr(e[i],t[i]))return!1;return!0}return e!==e&&t!==t}function eo(e,t,r,n,a){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var s=Zn(t),i=Zn(e),o=!1,c=i.length-1;c>=0;c--){var l=i[c],f=e[l];if(Bn(t,l)&&!(t[l]===void 0&&f!==void 0&&Array.isArray(t)===!1)){var p=t[l];typeof f=="object"&&f!=null&&typeof p=="object"&&p!=null&&Array.isArray(f)===Array.isArray(p)?eo(f,p,r,n+"/"+Wt(l),a):f!==p&&(a&&r.push({op:"test",path:n+"/"+Wt(l),value:Ne(f)}),r.push({op:"replace",path:n+"/"+Wt(l),value:Ne(p)}))}else Array.isArray(e)===Array.isArray(t)?(a&&r.push({op:"test",path:n+"/"+Wt(l),value:Ne(f)}),r.push({op:"remove",path:n+"/"+Wt(l)}),o=!0):(a&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}))}if(!(!o&&s.length==i.length))for(var c=0;c<s.length;c++){var l=s[c];!Bn(e,l)&&t[l]!==void 0&&r.push({op:"add",path:n+"/"+Wt(l),value:Ne(t[l])})}}}function Gt(e,t,r=!1){var n=[];return eo(e,t,n,"",r),n}({...Xi});var cp=M({LogStreamCallbackHandler:()=>Wn,RunLog:()=>Vn,RunLogPatch:()=>nt,isLogStreamHandler:()=>Ua}),nt=class{ops;constructor(e){this.ops=e.ops??[]}concat(e){let t=this.ops.concat(e.ops),r=pt({},t);return new Vn({ops:t,state:r[r.length-1].newDocument})}},Vn=class Za extends nt{state;constructor(t){super(t),this.state=t.state}concat(t){let r=this.ops.concat(t.ops),n=pt(this.state,t.ops);return new Za({ops:r,state:n[n.length-1].newDocument})}static fromRunLogPatch(t){let r=pt({},t.ops);return new Za({ops:t.ops,state:r[r.length-1].newDocument})}},Ua=e=>e.name==="log_stream_tracer";async function to(e,t){if(t==="original")throw new Error("Do not assign inputs with original schema drop the key for now. When inputs are added to streamLog they should be added with standardized schema for streaming events.");let{inputs:r}=e;if(["retriever","llm","prompt"].includes(e.run_type))return r;if(!(Object.keys(r).length===1&&r?.input===""))return r.input}async function ro(e,t){let{outputs:r}=e;return t==="original"||["retriever","llm","prompt"].includes(e.run_type)?r:r!==void 0&&Object.keys(r).length===1&&r?.output!==void 0?r.output:r}function lu(e){return e!==void 0&&e.message!==void 0}var Wn=class extends kr{autoClose=!0;includeNames;includeTypes;includeTags;excludeNames;excludeTypes;excludeTags;_schemaFormat="original";rootId;keyMapByRunId={};counterMapByRunName={};transformStream;writer;receiveStream;name="log_stream_tracer";lc_prefer_streaming=!0;constructor(e){super({_awaitHandler:!0,...e}),this.autoClose=e?.autoClose??!0,this.includeNames=e?.includeNames,this.includeTypes=e?.includeTypes,this.includeTags=e?.includeTags,this.excludeNames=e?.excludeNames,this.excludeTypes=e?.excludeTypes,this.excludeTags=e?.excludeTags,this._schemaFormat=e?._schemaFormat??this._schemaFormat,this.transformStream=new TransformStream,this.writer=this.transformStream.writable.getWriter(),this.receiveStream=ve.fromReadableStream(this.transformStream.readable)}[Symbol.asyncIterator](){return this.receiveStream}async persistRun(e){}_includeRun(e){if(e.id===this.rootId)return!1;let t=e.tags??[],r=this.includeNames===void 0&&this.includeTags===void 0&&this.includeTypes===void 0;return this.includeNames!==void 0&&(r=r||this.includeNames.includes(e.name)),this.includeTypes!==void 0&&(r=r||this.includeTypes.includes(e.run_type)),this.includeTags!==void 0&&(r=r||t.find(n=>this.includeTags?.includes(n))!==void 0),this.excludeNames!==void 0&&(r=r&&!this.excludeNames.includes(e.name)),this.excludeTypes!==void 0&&(r=r&&!this.excludeTypes.includes(e.run_type)),this.excludeTags!==void 0&&(r=r&&t.every(n=>!this.excludeTags?.includes(n))),r}async*tapOutputIterable(e,t){for await(let r of t){if(e!==this.rootId){let n=this.keyMapByRunId[e];n&&await this.writer.write(new nt({ops:[{op:"add",path:`/logs/${n}/streamed_output/-`,value:r}]}))}yield r}}async onRunCreate(e){if(this.rootId===void 0&&(this.rootId=e.id,await this.writer.write(new nt({ops:[{op:"replace",path:"",value:{id:e.id,name:e.name,type:e.run_type,streamed_output:[],final_output:void 0,logs:{}}}]}))),!this._includeRun(e))return;this.counterMapByRunName[e.name]===void 0&&(this.counterMapByRunName[e.name]=0),this.counterMapByRunName[e.name]+=1;let t=this.counterMapByRunName[e.name];this.keyMapByRunId[e.id]=t===1?e.name:`${e.name}:${t}`;let r={id:e.id,name:e.name,type:e.run_type,tags:e.tags??[],metadata:e.extra?.metadata??{},start_time:new Date(e.start_time).toISOString(),streamed_output:[],streamed_output_str:[],final_output:void 0,end_time:void 0};this._schemaFormat==="streaming_events"&&(r.inputs=await to(e,this._schemaFormat)),await this.writer.write(new nt({ops:[{op:"add",path:`/logs/${this.keyMapByRunId[e.id]}`,value:r}]}))}async onRunUpdate(e){try{let t=this.keyMapByRunId[e.id];if(t===void 0)return;let r=[];this._schemaFormat==="streaming_events"&&r.push({op:"replace",path:`/logs/${t}/inputs`,value:await to(e,this._schemaFormat)}),r.push({op:"add",path:`/logs/${t}/final_output`,value:await ro(e,this._schemaFormat)}),e.end_time!==void 0&&r.push({op:"add",path:`/logs/${t}/end_time`,value:new Date(e.end_time).toISOString()});let n=new nt({ops:r});await this.writer.write(n)}finally{if(e.id===this.rootId){let t=new nt({ops:[{op:"replace",path:"/final_output",value:await ro(e,this._schemaFormat)}]});await this.writer.write(t),this.autoClose&&await this.writer.close()}}}async onLLMNewToken(e,t,r){let n=this.keyMapByRunId[e.id];if(n===void 0)return;let a=e.inputs.messages!==void 0,s;a?lu(r?.chunk)?s=r?.chunk:s=new _e({id:`run-${e.id}`,content:t}):s=t;let i=new nt({ops:[{op:"add",path:`/logs/${n}/streamed_output_str/-`,value:t},{op:"add",path:`/logs/${n}/streamed_output/-`,value:s}]});await this.writer.write(i)}};var pp=M({ChatGenerationChunk:()=>Gn,GenerationChunk:()=>mt,RUN_KEY:()=>Jt}),Jt="__run",mt=class no{text;generationInfo;constructor(t){this.text=t.text,this.generationInfo=t.generationInfo}concat(t){return new no({text:this.text+t.text,generationInfo:{...this.generationInfo,...t.generationInfo}})}},Gn=class ao extends mt{message;constructor(t){super(t),this.message=t.message}concat(t){return new ao({text:this.text+t.text,generationInfo:{...this.generationInfo,...t.generationInfo},message:this.message.concat(t.message)})}};function Jn({name:e,serialized:t}){return e!==void 0?e:t?.name!==void 0?t.name:t?.id!==void 0&&Array.isArray(t?.id)?t.id[t.id.length-1]:"Unnamed"}var so=e=>e.name==="event_stream_tracer",io=class extends kr{autoClose=!0;includeNames;includeTypes;includeTags;excludeNames;excludeTypes;excludeTags;runInfoMap=new Map;tappedPromises=new Map;transformStream;writer;receiveStream;readableStreamClosed=!1;name="event_stream_tracer";lc_prefer_streaming=!0;constructor(e){super({_awaitHandler:!0,...e}),this.autoClose=e?.autoClose??!0,this.includeNames=e?.includeNames,this.includeTypes=e?.includeTypes,this.includeTags=e?.includeTags,this.excludeNames=e?.excludeNames,this.excludeTypes=e?.excludeTypes,this.excludeTags=e?.excludeTags,this.transformStream=new TransformStream({flush:()=>{this.readableStreamClosed=!0}}),this.writer=this.transformStream.writable.getWriter(),this.receiveStream=ve.fromReadableStream(this.transformStream.readable)}[Symbol.asyncIterator](){return this.receiveStream}async persistRun(e){}_includeRun(e){let t=e.tags??[],r=this.includeNames===void 0&&this.includeTags===void 0&&this.includeTypes===void 0;return this.includeNames!==void 0&&(r=r||this.includeNames.includes(e.name)),this.includeTypes!==void 0&&(r=r||this.includeTypes.includes(e.runType)),this.includeTags!==void 0&&(r=r||t.find(n=>this.includeTags?.includes(n))!==void 0),this.excludeNames!==void 0&&(r=r&&!this.excludeNames.includes(e.name)),this.excludeTypes!==void 0&&(r=r&&!this.excludeTypes.includes(e.runType)),this.excludeTags!==void 0&&(r=r&&t.every(n=>!this.excludeTags?.includes(n))),r}async*tapOutputIterable(e,t){let r=await t.next();if(r.done)return;let n=this.runInfoMap.get(e);if(n===void 0){yield r.value;return}function a(i,o){return i==="llm"&&typeof o=="string"?new mt({text:o}):o}let s=this.tappedPromises.get(e);if(s===void 0){let i;s=new Promise(o=>{i=o}),this.tappedPromises.set(e,s);try{let o={event:`on_${n.runType}_stream`,run_id:e,name:n.name,tags:n.tags,metadata:n.metadata,data:{}};await this.send({...o,data:{chunk:a(n.runType,r.value)}},n),yield r.value;for await(let c of t)n.runType!=="tool"&&n.runType!=="retriever"&&await this.send({...o,data:{chunk:a(n.runType,c)}},n),yield c}finally{i?.()}}else{yield r.value;for await(let i of t)yield i}}async send(e,t){this.readableStreamClosed||this._includeRun(t)&&await this.writer.write(e)}async sendEndEvent(e,t){let r=this.tappedPromises.get(e.run_id);r!==void 0?r.then(()=>{this.send(e,t)}):await this.send(e,t)}async onLLMStart(e){let t=Jn(e),r=e.inputs.messages!==void 0?"chat_model":"llm",n={tags:e.tags??[],metadata:e.extra?.metadata??{},name:t,runType:r,inputs:e.inputs};this.runInfoMap.set(e.id,n);let a=`on_${r}_start`;await this.send({event:a,data:{input:e.inputs},name:t,tags:e.tags??[],run_id:e.id,metadata:e.extra?.metadata??{}},n)}async onLLMNewToken(e,t,r){let n=this.runInfoMap.get(e.id),a,s;if(n===void 0)throw new Error(`onLLMNewToken: Run ID ${e.id} not found in run map.`);if(this.runInfoMap.size!==1){if(n.runType==="chat_model")s="on_chat_model_stream",r?.chunk===void 0?a=new _e({content:t,id:`run-${e.id}`}):a=r.chunk.message;else if(n.runType==="llm")s="on_llm_stream",r?.chunk===void 0?a=new mt({text:t}):a=r.chunk;else throw new Error(`Unexpected run type ${n.runType}`);await this.send({event:s,data:{chunk:a},run_id:e.id,name:n.name,tags:n.tags,metadata:n.metadata},n)}}async onLLMEnd(e){let t=this.runInfoMap.get(e.id);this.runInfoMap.delete(e.id);let r;if(t===void 0)throw new Error(`onLLMEnd: Run ID ${e.id} not found in run map.`);let n=e.outputs?.generations,a;if(t.runType==="chat_model"){for(let s of n??[]){if(a!==void 0)break;a=s[0]?.message}r="on_chat_model_end"}else if(t.runType==="llm")a={generations:n?.map(s=>s.map(i=>({text:i.text,generationInfo:i.generationInfo}))),llmOutput:e.outputs?.llmOutput??{}},r="on_llm_end";else throw new Error(`onLLMEnd: Unexpected run type: ${t.runType}`);await this.sendEndEvent({event:r,data:{output:a,input:t.inputs},run_id:e.id,name:t.name,tags:t.tags,metadata:t.metadata},t)}async onChainStart(e){let t=Jn(e),r=e.run_type??"chain",n={tags:e.tags??[],metadata:e.extra?.metadata??{},name:t,runType:e.run_type},a={};e.inputs.input===""&&Object.keys(e.inputs).length===1?(a={},n.inputs={}):e.inputs.input!==void 0?(a.input=e.inputs.input,n.inputs=e.inputs.input):(a.input=e.inputs,n.inputs=e.inputs),this.runInfoMap.set(e.id,n),await this.send({event:`on_${r}_start`,data:a,name:t,tags:e.tags??[],run_id:e.id,metadata:e.extra?.metadata??{}},n)}async onChainEnd(e){let t=this.runInfoMap.get(e.id);if(this.runInfoMap.delete(e.id),t===void 0)throw new Error(`onChainEnd: Run ID ${e.id} not found in run map.`);let r=`on_${e.run_type}_end`,n=e.inputs??t.inputs??{},a={output:e.outputs?.output??e.outputs,input:n};n.input&&Object.keys(n).length===1&&(a.input=n.input,t.inputs=n.input),await this.sendEndEvent({event:r,data:a,run_id:e.id,name:t.name,tags:t.tags,metadata:t.metadata??{}},t)}async onToolStart(e){let t=Jn(e),r={tags:e.tags??[],metadata:e.extra?.metadata??{},name:t,runType:"tool",inputs:e.inputs??{}};this.runInfoMap.set(e.id,r),await this.send({event:"on_tool_start",data:{input:e.inputs??{}},name:t,run_id:e.id,tags:e.tags??[],metadata:e.extra?.metadata??{}},r)}async onToolEnd(e){let t=this.runInfoMap.get(e.id);if(this.runInfoMap.delete(e.id),t===void 0)throw new Error(`onToolEnd: Run ID ${e.id} not found in run map.`);if(t.inputs===void 0)throw new Error(`onToolEnd: Run ID ${e.id} is a tool call, and is expected to have traced inputs.`);let r=e.outputs?.output===void 0?e.outputs:e.outputs.output;await this.sendEndEvent({event:"on_tool_end",data:{output:r,input:t.inputs},run_id:e.id,name:t.name,tags:t.tags,metadata:t.metadata},t)}async onToolError(e){let t=this.runInfoMap.get(e.id);if(this.runInfoMap.delete(e.id),t===void 0)throw new Error(`onToolEnd: Run ID ${e.id} not found in run map.`);if(t.inputs===void 0)throw new Error(`onToolEnd: Run ID ${e.id} is a tool call, and is expected to have traced inputs.`);await this.sendEndEvent({event:"on_tool_error",data:{input:t.inputs,error:e.error},run_id:e.id,name:t.name,tags:t.tags,metadata:t.metadata},t)}async onRetrieverStart(e){let t=Jn(e),r={tags:e.tags??[],metadata:e.extra?.metadata??{},name:t,runType:"retriever",inputs:{query:e.inputs.query}};this.runInfoMap.set(e.id,r),await this.send({event:"on_retriever_start",data:{input:{query:e.inputs.query}},name:t,tags:e.tags??[],run_id:e.id,metadata:e.extra?.metadata??{}},r)}async onRetrieverEnd(e){let t=this.runInfoMap.get(e.id);if(this.runInfoMap.delete(e.id),t===void 0)throw new Error(`onRetrieverEnd: Run ID ${e.id} not found in run map.`);await this.sendEndEvent({event:"on_retriever_end",data:{output:e.outputs?.documents??e.outputs,input:t.inputs},run_id:e.id,name:t.name,tags:t.tags,metadata:t.metadata},t)}async handleCustomEvent(e,t,r){let n=this.runInfoMap.get(r);if(n===void 0)throw new Error(`handleCustomEvent: Run ID ${r} not found in run map.`);await this.send({event:"on_custom_event",run_id:r,name:e,tags:n.tags,metadata:n.metadata,data:t},n)}async finish(){let e=[...this.tappedPromises.values()];Promise.all(e).finally(()=>{this.writer.close()})}};var du=Object.prototype.toString,fu=e=>du.call(e)==="[object Error]",pu=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"]);function oo(e){if(!(e&&fu(e)&&e.name==="TypeError"&&typeof e.message=="string"))return!1;let{message:t,stack:r}=e;return t==="Load failed"?r===void 0||"__sentry_captured__"in e:t.startsWith("error sending request for url")?!0:pu.has(t)}function mu(e){if(typeof e=="number"){if(e<0)throw new TypeError("Expected `retries` to be a non-negative number.");if(Number.isNaN(e))throw new TypeError("Expected `retries` to be a valid number or Infinity, got NaN.")}else if(e!==void 0)throw new TypeError("Expected `retries` to be a number or Infinity.")}function qn(e,t,{min:r=0,allowInfinity:n=!1}={}){if(t!==void 0){if(typeof t!="number"||Number.isNaN(t))throw new TypeError(`Expected \`${e}\` to be a number${n?" or Infinity":""}.`);if(!n&&!Number.isFinite(t))throw new TypeError(`Expected \`${e}\` to be a finite number.`);if(t<r)throw new TypeError(`Expected \`${e}\` to be \u2265 ${r}.`)}}var hu=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}};function gu(e,t){let r=Math.max(1,e+1),n=t.randomize?Math.random()+1:1,a=Math.round(n*t.minTimeout*t.factor**(r-1));return a=Math.min(a,t.maxTimeout),a}function co(e,t){return Number.isFinite(t)?t-(performance.now()-e):t}async function yu({error:e,attemptNumber:t,retriesConsumed:r,startTime:n,options:a}){let s=e instanceof Error?e:new TypeError(`Non-error was thrown: "${e}". You should only throw errors.`);if(s instanceof hu)throw s.originalError;let i=Number.isFinite(a.retries)?Math.max(0,a.retries-r):a.retries,o=a.maxRetryTime??Number.POSITIVE_INFINITY,c=Object.freeze({error:s,attemptNumber:t,retriesLeft:i,retriesConsumed:r});if(await a.onFailedAttempt(c),co(n,o)<=0)throw s;let l=await a.shouldConsumeRetry(c),f=co(n,o);if(f<=0||i<=0)throw s;if(s instanceof TypeError&&!oo(s)){if(l)throw s;return a.signal?.throwIfAborted(),!1}if(!await a.shouldRetry(c))throw s;if(!l)return a.signal?.throwIfAborted(),!1;let p=gu(r,a),y=typeof s.retryAfterMs=="number"&&s.retryAfterMs>=0?s.retryAfterMs:void 0;y!==void 0&&(p=Math.max(p,y));let h=Math.min(p,f);return h>0&&await new Promise((m,v)=>{let b=()=>{clearTimeout(k),a.signal?.removeEventListener("abort",b),v(a.signal.reason)},k=setTimeout(()=>{a.signal?.removeEventListener("abort",b),m()},h);a.unref&&k.unref?.(),a.signal?.addEventListener("abort",b,{once:!0})}),a.signal?.throwIfAborted(),!0}async function an(e,t={}){if(t={...t},mu(t.retries),Object.hasOwn(t,"forever"))throw new Error("The `forever` option is no longer supported. For many use-cases, you can set `retries: Infinity` instead.");t.retries??=10,t.factor??=2,t.minTimeout??=1e3,t.maxTimeout??=Number.POSITIVE_INFINITY,t.maxRetryTime??=Number.POSITIVE_INFINITY,t.randomize??=!1,t.onFailedAttempt??=()=>{},t.shouldRetry??=()=>!0,t.shouldConsumeRetry??=()=>!0,qn("factor",t.factor,{min:0,allowInfinity:!1}),qn("minTimeout",t.minTimeout,{min:0,allowInfinity:!1}),qn("maxTimeout",t.maxTimeout,{min:0,allowInfinity:!0}),qn("maxRetryTime",t.maxRetryTime,{min:0,allowInfinity:!0}),t.factor>0||(t.factor=1),t.signal?.throwIfAborted();let r=0,n=0,a=performance.now();for(;!Number.isFinite(t.retries)||n<=t.retries;){r++;try{t.signal?.throwIfAborted();let s=await e(r);return t.signal?.throwIfAborted(),s}catch(s){await yu({error:s,attemptNumber:r,retriesConsumed:n,startTime:a,options:t})&&n++}}throw new Error("Retry attempts exhausted without throwing an error.")}var Hn=ai(iu(),1),Cp=M({AsyncCaller:()=>ht,classifyRateLimitError:()=>ho,parseRetryAfterMs:()=>mo}),_u=[400,401,402,403,404,405,406,407,409,413],vu=6e4,bu=[/insufficient[_ -]?quota/i,/exceeded (?:your|the current|the available).+quota/i,/usage quota/i,/quota (?:has been )?exhausted/i,/billing/i,/credit balance/i,/out of credits/i,/will reset at/i],wu=/(?:try again in|retry after)\s+(\d+(?:\.\d+)?)\s*(milliseconds?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h)\b/i;function lo(e){return typeof e=="object"&&e!==null&&"response"in e&&typeof e.response=="object"&&e.response!==null&&"status"in e.response&&typeof e.response.status=="number"?e.response.status:void 0}function fo(e){if(!(typeof e!="object"||e===null)){if("status"in e&&typeof e.status=="number")return e.status;if("statusCode"in e&&typeof e.statusCode=="number")return e.statusCode}}function Wa(e){return typeof e=="object"&&e!==null&&"message"in e&&typeof e.message=="string"?e.message:void 0}function po(e){if(!(typeof e!="object"||e===null))return"code"in e&&typeof e.code=="string"?e.code:"error"in e&&typeof e.error=="object"&&e.error!==null&&"code"in e.error&&typeof e.error.code=="string"?e.error.code:void 0}function ku(e){if(e?.headers)return typeof e.headers.get=="function"?e.headers.get("retry-after"):e.headers["retry-after"]??e.headers["Retry-After"];if(e?.response?.headers)return typeof e.response.headers.get=="function"?e.response.headers.get("retry-after"):e.response.headers["retry-after"]??e.response.headers["Retry-After"]}function xu(e){if(e==null)return;let t=wu.exec(e);if(!t)return;let r=Number(t[1]),n=t[2]?.toLowerCase();if(!(Number.isNaN(r)||!n))return n==="ms"||n.startsWith("millisecond")?r:n==="m"||n.startsWith("min")?r*6e4:n==="h"||n.startsWith("hr")||n.startsWith("hour")?r*36e5:r*1e3}function uo(e,t){if(e instanceof Error)return e;let r=new Error(t);return typeof e=="object"&&e!==null&&Object.assign(r,e),r}function Va(e,t){if(typeof e!="object"||e===null)return;let r=e;r.rateLimitType=t.action,r.rateLimitReason=t.reason,t.retryAfterMs!==void 0&&(r.retryAfterMs=t.retryAfterMs)}function mo(e){if(e==null)return;let t=e.trim();if(!t)return;let r=Number(t);if(!Number.isNaN(r)&&r>=0)return r*1e3;let n=Date.parse(t);if(!Number.isNaN(n)){let a=n-Date.now();return a>0?a:0}}function ho(e){if((lo(e)??fo(e))!==429)return;if(po(e)==="insufficient_quota")return{action:"stop",reason:"insufficient_quota"};let t=Wa(e);if(t&&bu.some(n=>n.test(t)))return{action:"stop",reason:"quota_message"};let r=mo(ku(e))??xu(t);return r!==void 0?r<=vu?{action:"wait",retryAfterMs:r,reason:"retry_after_hint"}:{action:"capacity",retryAfterMs:r,reason:"retry_after_too_large"}:{action:"capacity",reason:"headerless_429"}}var Tu=e=>{if(typeof e!="object"||e===null)return;if(Ai(e)===!1)throw e;if("message"in e&&typeof e.message=="string"&&(e.message.startsWith("Cancel")||e.message.startsWith("AbortError"))||"name"in e&&typeof e.name=="string"&&e.name==="AbortError")throw vr(e,!1);if("code"in e&&typeof e.code=="string"&&e.code==="ECONNABORTED")throw e;let t=lo(e)??fo(e);if(t&&_u.includes(+t))throw vr(e,!1);if(po(e)==="insufficient_quota"){let n=uo(e,Wa(e)??"Insufficient quota");throw n.name="InsufficientQuotaError",Va(n,{action:"stop",reason:"insufficient_quota"}),vr(n,!1)}let r=ho(e);if(r){if(r.action==="wait"){Va(e,r),vr(e,!0);return}let n=uo(e,Wa(e)??"Rate limit exceeded");throw n.name==="Error"&&(n.name=r.action==="stop"?"RateLimitQuotaExhaustedError":"RateLimitCapacityError"),Va(n,r),vr(n,r.action!=="stop")}},ht=class{maxConcurrency;maxRetries;onFailedAttempt;queue;constructor(e){this.maxConcurrency=e.maxConcurrency??1/0,this.maxRetries=e.maxRetries??6,this.onFailedAttempt=e.onFailedAttempt??Tu;let t="default"in Hn.default?Hn.default.default:Hn.default;this.queue=new t({concurrency:this.maxConcurrency})}async call(e,...t){return this.callWithRetries(this.maxRetries,e,t)}callWithRetries(e,t,r){return this.queue.add(()=>an(()=>t(...r).catch(n=>{throw n instanceof Error?n:new Error(n)}),{onFailedAttempt:({error:n})=>this.onFailedAttempt?.(n),retries:e,randomize:!0}),{throwOnTimeout:!0})}callWithOptions(e,t,...r){let n=e.maxRetries??this.maxRetries;if(e.signal){let a;return Promise.race([this.callWithRetries(n,t,r),new Promise((s,i)=>{a=()=>{i(Et(e.signal))},e.signal?.addEventListener("abort",a,{once:!0})})]).finally(()=>{e.signal&&a&&e.signal.removeEventListener("abort",a)})}return this.callWithRetries(n,t,r)}fetch(...e){return this.call(()=>fetch(...e).then(t=>t.ok?t:Promise.reject(t)))}};var Ga=class extends kr{name="RootListenersTracer";rootId;config;argOnStart;argOnEnd;argOnError;constructor({config:e,onStart:t,onEnd:r,onError:n}){super({_awaitHandler:!0}),this.config=e,this.argOnStart=t,this.argOnEnd=r,this.argOnError=n}persistRun(e){return Promise.resolve()}async onRunCreate(e){this.rootId||(this.rootId=e.id,this.argOnStart&&await this.argOnStart(e,this.config))}async onRunUpdate(e){e.id===this.rootId&&(e.error?this.argOnError&&await this.argOnError(e,this.config):this.argOnEnd&&await this.argOnEnd(e,this.config))}};function sn(e){return e?e.lc_runnable:!1}var go=class{includeNames;includeTypes;includeTags;excludeNames;excludeTypes;excludeTags;constructor(e){this.includeNames=e.includeNames,this.includeTypes=e.includeTypes,this.includeTags=e.includeTags,this.excludeNames=e.excludeNames,this.excludeTypes=e.excludeTypes,this.excludeTags=e.excludeTags}includeEvent(e,t){let r=this.includeNames===void 0&&this.includeTypes===void 0&&this.includeTags===void 0,n=e.tags??[];return this.includeNames!==void 0&&(r=r||this.includeNames.includes(e.name)),this.includeTypes!==void 0&&(r=r||this.includeTypes.includes(t)),this.includeTags!==void 0&&(r=r||n.some(a=>this.includeTags?.includes(a))),this.excludeNames!==void 0&&(r=r&&!this.excludeNames.includes(e.name)),this.excludeTypes!==void 0&&(r=r&&!this.excludeTypes.includes(t)),this.excludeTags!==void 0&&(r=r&&n.every(a=>!this.excludeTags?.includes(a))),r}},yo=e=>btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");function te(e){if(typeof e!="object"||e===null)return!1;let t=e;if(!("_zod"in t))return!1;let r=t._zod;return typeof r=="object"&&r!==null&&"def"in r}function oe(e){if(typeof e!="object"||e===null)return!1;let t=e;if(!("_def"in t)||"_zod"in t)return!1;let r=t._def;return typeof r=="object"&&r!=null&&"typeName"in r}function _o(e){return te(e)&&console.warn("[WARNING] Attempting to use Zod 4 schema in a context where Zod 3 schema is expected. This may cause unexpected behavior."),oe(e)}function Se(e){return!e||typeof e!="object"||Array.isArray(e)?!1:!!(te(e)||oe(e))}function Ja(e){return typeof e=="object"&&e!==null&&"_def"in e&&typeof e._def=="object"&&e._def!==null&&"typeName"in e._def&&e._def.typeName==="ZodLiteral"}function qa(e){return te(e)?typeof e=="object"&&e!==null&&"_zod"in e&&typeof e._zod=="object"&&e._zod!==null&&"def"in e._zod&&typeof e._zod.def=="object"&&e._zod.def!==null&&"type"in e._zod.def&&e._zod.def.type==="literal":!1}function vo(e){return!!(Ja(e)||qa(e))}async function Xn(e,t){if(te(e))try{return{success:!0,data:await $a(e,t)}}catch(r){return{success:!1,error:r}}if(oe(e))return await e.safeParseAsync(t);throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}async function Ct(e,t){if(te(e))return await $a(e,t);if(oe(e))return await e.parseAsync(t);throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}function bo(e,t){if(te(e))try{return{success:!0,data:jn(e,t)}}catch(r){return{success:!1,error:r}}if(oe(e))return e.safeParse(t);throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}function wo(e,t){if(te(e))return jn(e,t);if(oe(e))return e.parse(t);throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}function Er(e){if(te(e))return Te.get(e)?.description;if(oe(e)||"description"in e&&typeof e.description=="string")return e.description}function ko(e){if(!Se(e))return!1;if(oe(e)){let t=e._def;if(t.typeName==="ZodObject"){let r=e;return!r.shape||Object.keys(r.shape).length===0}if(t.typeName==="ZodRecord")return!0}if(te(e)){let t=e._zod.def;if(t.type==="object"){let r=e;return!r.shape||Object.keys(r.shape).length===0}if(t.type==="record")return!0}return typeof e=="object"&&e!==null&&!("shape"in e)}function Ar(e){return Se(e)?oe(e)?e._def.typeName==="ZodString":te(e)?e._zod.def.type==="string":!1:!1}function on(e){return typeof e=="object"&&e!==null&&"_def"in e&&typeof e._def=="object"&&e._def!==null&&"typeName"in e._def&&e._def.typeName==="ZodObject"}function $e(e){return te(e)?typeof e=="object"&&e!==null&&"_zod"in e&&typeof e._zod=="object"&&e._zod!==null&&"def"in e._zod&&typeof e._zod.def=="object"&&e._zod.def!==null&&"type"in e._zod.def&&e._zod.def.type==="object":!1}function cn(e){return te(e)?typeof e=="object"&&e!==null&&"_zod"in e&&typeof e._zod=="object"&&e._zod!==null&&"def"in e._zod&&typeof e._zod.def=="object"&&e._zod.def!==null&&"type"in e._zod.def&&e._zod.def.type==="array":!1}function Ha(e){return te(e)?typeof e=="object"&&e!==null&&"_zod"in e&&typeof e._zod=="object"&&e._zod!==null&&"def"in e._zod&&typeof e._zod.def=="object"&&e._zod.def!==null&&"type"in e._zod.def&&e._zod.def.type==="optional":!1}function Ka(e){return te(e)?typeof e=="object"&&e!==null&&"_zod"in e&&typeof e._zod=="object"&&e._zod!==null&&"def"in e._zod&&typeof e._zod.def=="object"&&e._zod.def!==null&&"type"in e._zod.def&&e._zod.def.type==="nullable":!1}function xo(e){return!!(on(e)||$e(e))}function Kn(e){if(oe(e))return e.shape;if(te(e))return e._zod.def.shape;throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function To(e,t){if(oe(e))return e.extend(t);if(te(e))return Ma.extend(e,t);throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function So(e){if(oe(e))return e.partial();if(te(e))return Ma.partial(Da,e,void 0);throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function Sr(e,t=!1){if(on(e))return e.strict();if($e(e)){let r=e._zod.def.shape;if(t)for(let[s,i]of Object.entries(e._zod.def.shape)){if($e(i))r[s]=Sr(i,t);else if(cn(i)){let c=i._zod.def.element;$e(c)&&(c=Sr(c,t)),r[s]=rt(i,{...i._zod.def,element:c})}else r[s]=i;let o=Te.get(i);o&&Te.add(r[s],o)}let n=rt(e,{...e._zod.def,shape:r,catchall:qi(Gi)}),a=Te.get(e);return a&&Te.add(n,a),n}throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function Yn(e,t=!1){if(on(e))return e.passthrough();if($e(e)){let r=e._zod.def.shape;if(t)for(let[s,i]of Object.entries(e._zod.def.shape)){if($e(i))r[s]=Yn(i,t);else if(cn(i)){let c=i._zod.def.element;$e(c)&&(c=Yn(c,t)),r[s]=rt(i,{...i._zod.def,element:c})}else r[s]=i;let o=Te.get(i);o&&Te.add(r[s],o)}let n=rt(e,{...e._zod.def,shape:r,catchall:Ji(Wi)}),a=Te.get(e);return a&&Te.add(n,a),n}throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function Eo(e){if(oe(e))try{let t=e.parse(void 0);return()=>t}catch{return}if(te(e))try{let t=jn(e,void 0);return()=>t}catch{return}}function Su(e){return oe(e)&&"typeName"in e._def&&e._def.typeName==="ZodEffects"}function Eu(e){return te(e)&&e._zod.def.type==="pipe"}function qt(e,t,r){let n=r.get(e);if(n!==void 0)return n;if(oe(e))return Su(e)?qt(e._def.schema,t,r):e;if(te(e)){let a=e;if(Eu(e)&&(a=qt(e._zod.def.in,t,r)),t){if($e(a)){let i={};for(let[o,c]of Object.entries(a._zod.def.shape))i[o]=qt(c,t,r);a=rt(a,{...a._zod.def,shape:i})}else if(cn(a)){let i=qt(a._zod.def.element,t,r);a=rt(a,{...a._zod.def,element:i})}else if(Ha(a)){let i=qt(a._zod.def.innerType,t,r);a=rt(a,{...a._zod.def,innerType:i})}else if(Ka(a)){let i=qt(a._zod.def.innerType,t,r);a=rt(a,{...a._zod.def,innerType:i})}}let s=Te.get(e);return s&&Te.add(a,s),r.set(e,a),a}throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}function Qn(e,t=!1){return qt(e,t,new WeakMap)}function Ao(e,t){if(oe(e)){let r=Kn(e),n={};for(let[a,s]of Object.entries(r))t(a,s)?n[a]=s.optional():n[a]=s;return e.extend(n)}if(te(e)){let r=Kn(e),n={...e._zod.def.shape};for(let[i,o]of Object.entries(r))t(i,o)&&(n[i]=new Da({type:"optional",innerType:o}));let a=rt(e,{...e._zod.def,shape:n}),s=Te.get(e);return s&&Te.add(a,s),a}throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function ea(e){return e instanceof Error&&(e.constructor.name==="ZodError"||e.constructor.name==="$ZodError")}function Ya(e){return e.replace(/[^a-zA-Z-_0-9]/g,"_")}var Au=["*","_","`"];function Ou(e){let t="";for(let[r,n]of Object.entries(e))t+=` classDef ${r} ${n};
4
4
  `;return t}function Oo(e,t,r){let{firstNode:n,lastNode:a,nodeColors:s,withStyles:i=!0,curveStyle:o="linear",wrapLabelNWords:c=9}=r??{},l=i?`%%{init: {'flowchart': {'curve': '${o}'}}}%%
5
5
  graph TD;
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import c from"./AJ5H2JMU.js";import b from"./5SKCVK2P.js";import a from"./C5FTQSU6.js";import"./PXG2SRSN.js";import"./VDXESPJK.js";import"./ULGME5RT.js";import"./DAAON2UO.js";import"./57MT7FOI.js";import"./2FKNF2ZK.js";import"./AYHYABMC.js";import"./OQ3OHDEB.js";import"./I57CRKF7.js";import"./3ZC26CT6.js";import"./OUMTV5H5.js";import"./5PV2GUZW.js";export default $arcgis.t(([,,a])=>{return a},a,b,c)
2
+ import c from"./QSRWVCWP.js";import b from"./5SKCVK2P.js";import a from"./C5FTQSU6.js";import"./PXG2SRSN.js";import"./VDXESPJK.js";import"./ULGME5RT.js";import"./DAAON2UO.js";import"./57MT7FOI.js";import"./FN2QMDEW.js";import"./AYHYABMC.js";import"./OQ3OHDEB.js";import"./I57CRKF7.js";import"./3ZC26CT6.js";import"./OUMTV5H5.js";import"./5PV2GUZW.js";export default $arcgis.t(([,,a])=>{return a},a,b,c)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import c from"./LFRULIBL.js";import b from"./5SKCVK2P.js";import a from"./C5FTQSU6.js";import"./PXG2SRSN.js";import"./VDXESPJK.js";import"./ULGME5RT.js";import"./DAAON2UO.js";import"./57MT7FOI.js";import"./2FKNF2ZK.js";import"./AYHYABMC.js";import"./OQ3OHDEB.js";import"./I57CRKF7.js";import"./3ZC26CT6.js";import"./OUMTV5H5.js";import"./5PV2GUZW.js";export default $arcgis.t(([,,,,{c:r}])=>{return r},"core/reactiveUtils","intl",a,b,c)
2
+ import c from"./7PBECSW5.js";import b from"./5SKCVK2P.js";import a from"./C5FTQSU6.js";import"./PXG2SRSN.js";import"./VDXESPJK.js";import"./ULGME5RT.js";import"./DAAON2UO.js";import"./57MT7FOI.js";import"./FN2QMDEW.js";import"./AYHYABMC.js";import"./OQ3OHDEB.js";import"./I57CRKF7.js";import"./3ZC26CT6.js";import"./OUMTV5H5.js";import"./5PV2GUZW.js";export default $arcgis.t(([,,,,{c:r}])=>{return r},"core/reactiveUtils","intl",a,b,c)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{a as N}from"./GUL7EIJ4.js";import f from"./7VTDDO2O.js";import{a as g,b as _,c as F}from"./SRWFOV5W.js";import e from"./HZTWCOYQ.js";import"./Y5VUMGKH.js";import{a as R,c as v}from"./MSSJRDR7.js";import"./VDXESPJK.js";import"./DAAON2UO.js";import c from"./TZ6HFMZZ.js";import b from"./TIPQ2ZWK.js";import{a as E}from"./57MT7FOI.js";import a from"./C5IKEISI.js";import"./H7DF6TTK.js";import"./KV4ZZSNW.js";import"./2FKNF2ZK.js";import{c as L}from"./OQ3OHDEB.js";import"./I57CRKF7.js";import{I as S,J as y,K as k,L as w,Q as P,h as T,j as o,v as d}from"./3ZC26CT6.js";import"./OUMTV5H5.js";import"./5PV2GUZW.js";export default $arcgis.t(([{a:C},,{b:D},{b:U},{d:O}])=>{var q=n=>g.includes(n)?n:"@",V=L(n=>{let e=[],a=async s=>await C({requester:async()=>await O(n.portal,s,{num:3}),key:"items",id:s}),l=async s=>await C({requester:async()=>await U(n.portal,{query:`title:${s}`,num:3}),key:"groups",id:s}),i=N(async(s,t)=>{n.isFetchingEntities=!0;let r=s.toLowerCase();switch(q(t)){case"@":let h=10;n.filteredItemsInfo={type:"user",items:e.filter(c=>c.username?.toLowerCase().includes(r)||c.fullName?.toLowerCase().includes(r)).slice(0,h)};break;case"#":let{result:u}=await a(r);n.filteredItemsInfo={type:"item",items:u?.results??[]};break;case"$":let{results:m}=await l(r);n.filteredItemsInfo={type:"group",items:m};break}(n.filteredItemsInfo?.items?.length??0)===0&&await n.closePopover(),n.isFetchingEntities=!1},400);return{fetchUsers:async()=>{try{let{users:s}=await D(n.portal);e=s??[]}catch(s){e=[],console.error("error fetching org users:",s)}},filterItems:i,getItemText:(s,t)=>{let r="";switch(q(t)){case"@":r=s.username;break;case"#":r=s.title??"";break;case"$":r=s.title??"";break}return r.trim()}}}),A=({id:n,label:e,selected:a,description:l,contentStart:i,onSelect:s})=>E(n,o`<calcite-list-item class=${w({selected:a})} .label=${e} .description=${l} .selected=${a} @pointerdown=${async t=>{t.preventDefault(),t.stopPropagation(),await s()}} ${y(t=>{a&&t&&t.scrollIntoView({block:"nearest",behavior:"smooth"})})}>${i}</calcite-list-item>`),j=T`.selected{--calcite-list-background-color: var(--calcite-color-foreground-2)}.mentionable-list{max-height:13rem;overflow-y:auto;padding:.25rem;width:min(100vw,24rem)}.mentionable-list--loading{min-height:10rem}`,M=class extends k{constructor(){super(...arguments),this.calciteTextAreaRef=S(),this.mentionableEntityController=V(this),this.handleInput=e=>{let{bubbleNewValueChange:a,checkForMention:l}=this,i=e.target.value;i||v(this.el),this._value=i,a(this._value);let s=this.nativeTextAreaRef?.selectionStart??0;l(i,s)},this.handleKeyDown=e=>{if(!this.popoverOpen){this.arcgisUserMentionableTextAreaKeyDown.emit(e),this.arcgisMentionableTextAreaKeyDown.emit(e);return}switch(e.key){case"ArrowDown":e.preventDefault(),this.selectedItemIndex=Math.min(this.selectedItemIndex+1,this.filteredItems.length-1);break;case"ArrowUp":e.preventDefault(),this.selectedItemIndex=Math.max(this.selectedItemIndex-1,0);break;case"Enter":e.preventDefault(),this.selectItem(this.filteredItems[this.selectedItemIndex]);break;case"Escape":e.preventDefault(),this.closePopover.bind(this)();break}},this.handleClosePopover=()=>{this.popoverOpen=!1,this.currentMentionQuery="",this.selectedItemIndex=0,this.currentStarter=null},this.bubbleNewValueChange=e=>{this.arcgisUserMentionableTextAreaChange.emit(e),this.arcgisMentionableTextAreaChange.emit(e)},this.checkForMention=(e,a)=>{let l=e.substring(0,a),i=F(l,this.starters??g);if(i){let{starter:s}=i;this.currentStarter=s,this.filterMentionItems(i),this.popoverOpen=!0;return}this.handleClosePopover()},this.filterMentionItems=e=>{let{mentionText:a,query:l,starter:i,startIndex:s}=e;this.currentMentionQuery=a,this.mentionStartPosition=s;let t=l.toLowerCase();this.mentionableEntityController.filterItems(t,i),this.selectedItemIndex=0},this.popoverOpen=!1,this.currentMentionQuery="",this.mentionStartPosition=0,this.selectedItemIndex=0,this.currentStarter=null,this._value="",this.filteredItemsInfo=null,this.isFetchingEntities=!1,this.popoverPlacement="bottom-start",this.disabled=!1,this.scale="m",this.rows=3,this.starters=g,this.readOnly=!1,this.arcgisMentionableSelectedIndexChange=d(),this.arcgisMentionableTextAreaChange=d(),this.arcgisMentionableTextAreaKeyDown=d(),this.arcgisUserMentionableTextAreaChange=d(),this.arcgisUserMentionableTextAreaKeyDown=d(),this.renderItemInfo=()=>{let{filteredItemsInfo:e,selectedItemIndex:a,portal:l}=this;if(!e)return null;let{items:i,type:s}=e;switch(s){case"user":return i.map((t,r)=>A({id:t.id,label:`@${t.username}`,description:t.fullName,selected:r===a,contentStart:o`<arcgis-portal-user-avatar slot=content-start .user=${t} .portal=${l} scale=m></arcgis-portal-user-avatar>`,onSelect:async()=>await this.selectItem(t)}));case"item":return i.map((t,r)=>A({id:t.id??`item-${r}`,label:`#${t.title}`,description:t.id??void 0,selected:r===a,onSelect:async()=>await this.selectItem(t),contentStart:o`<calcite-avatar slot=content-start .fullName=${t.title??void 0} .thumbnail=${t.thumbnailUrl??void 0} scale=m></calcite-avatar>`}));case"group":return i.map((t,r)=>A({id:t.id??`group-${r}`,label:`${t.title}`,description:t.id??void 0,selected:r===a,onSelect:async()=>await this.selectItem(t),contentStart:o`<calcite-avatar slot=content-start .fullName=${t.title??void 0} .thumbnail=${t.thumbnailUrl??void 0} scale=m></calcite-avatar>`}))}}}static{this.properties={popoverOpen:16,currentMentionQuery:16,mentionStartPosition:16,selectedItemIndex:16,currentStarter:16,_value:16,filteredItemsInfo:16,isFetchingEntities:16,popoverListLabel:1,popoverPlacement:1,disabled:5,portal:0,user:0,scale:1,value:1,maxLength:9,rows:9,starters:0,placeholder:1,readOnly:5}}static{this.styles=j}get filteredItems(){return this.filteredItemsInfo?.items??[]}async closePopover(){this.handleClosePopover()}async focusTextArea(){await this.calciteTextAreaRef.value?.setFocus()}async selectItem(e){let{currentStarter:a,_value:l,mentionStartPosition:i,currentMentionQuery:s,handleClosePopover:t,calciteTextAreaRef:r,nativeTextAreaRef:h,bubbleNewValueChange:u}=this;if(!e||!a)return;let m=this.mentionableEntityController.getItemText(e,a),c=m.replaceAll('"',"").trim(),p=/\s/u.test(c)?`${a}"${c}"`:`${a}${c}`,f=(l??"").substring(0,i),x=(l??"").substring(i+s.length),$=`${f}${p} ${x}`,b=_(e,a,m);b&&R(this.el,{text:p,part:b}),this._value=$,u(this._value);let I=i+p.length+1;t(),await this.updateComplete,r.value?.setFocus(),h&&(h.selectionEnd=I)}willUpdate(e){e.has("value")&&(this._value=this.value??"",this._value||v(this.el)),(e.has("portal")||e.has("user"))&&v(this.el),e.has("selectedItemIndex")&&this.arcgisMentionableSelectedIndexChange.emit(this.selectedItemIndex)}loaded(){this.updateComplete.then(()=>{let e=this.calciteTextAreaRef.value?.shadowRoot?.querySelector("textarea");e&&(this.nativeTextAreaRef=e)}),this.mentionableEntityController.fetchUsers()}render(){let{popoverPlacement:e,scale:a,_value:l,maxLength:i,rows:s,placeholder:t,readOnly:r,popoverOpen:h,closePopover:u,handleInput:m,handleKeyDown:c,disabled:p,isFetchingEntities:f,filteredItemsInfo:x,renderItemInfo:$,popoverListLabel:b}=this,I=this.calciteTextAreaRef.value,K=x?.items??[];return o`<calcite-text-area .placeholder=${t} .value=${l} .maxLength=${i} .rows=${s} .scale=${a} .readOnly=${r} .disabled=${p} @blur=${u} @calciteTextAreaInput=${m} @keydown=${c} ${y(this.calciteTextAreaRef)}></calcite-text-area>${I&&o`<calcite-popover .open=${h} .placement=${e} class="mention-popover" .label=${b} .referenceElement=${I} trigger-disabled pointer-disabled focus-trap-disabled><div class=${w({"mentionable-list":!0,"mentionable-list--loading":f})}>${f&&o`<calcite-scrim .loading=${f}></calcite-scrim>`||""}${K.length>0&&o`<calcite-list .label=${b}>${$()}</calcite-list>`||""}</div></calcite-popover>`||""}`}};P("arcgis-portal-mentionable-text-area",M);return M},a,b,c,e,f)
2
+ import{a as N}from"./GUL7EIJ4.js";import f from"./NDCMZLMU.js";import{a as g,b as _,c as F}from"./SRWFOV5W.js";import e from"./PVPTFK7N.js";import"./Y5VUMGKH.js";import{a as R,c as v}from"./MSSJRDR7.js";import"./VDXESPJK.js";import"./DAAON2UO.js";import c from"./MOE6L5RN.js";import b from"./TIPQ2ZWK.js";import{a as E}from"./57MT7FOI.js";import a from"./IAK4F5SX.js";import"./4VLEUN7I.js";import"./KV4ZZSNW.js";import"./FN2QMDEW.js";import{c as L}from"./OQ3OHDEB.js";import"./I57CRKF7.js";import{I as S,J as y,K as k,L as w,Q as P,h as T,j as o,v as d}from"./3ZC26CT6.js";import"./OUMTV5H5.js";import"./5PV2GUZW.js";export default $arcgis.t(([{a:C},,{b:D},{b:U},{d:O}])=>{var q=n=>g.includes(n)?n:"@",V=L(n=>{let e=[],a=async s=>await C({requester:async()=>await O(n.portal,s,{num:3}),key:"items",id:s}),l=async s=>await C({requester:async()=>await U(n.portal,{query:`title:${s}`,num:3}),key:"groups",id:s}),i=N(async(s,t)=>{n.isFetchingEntities=!0;let r=s.toLowerCase();switch(q(t)){case"@":let h=10;n.filteredItemsInfo={type:"user",items:e.filter(c=>c.username?.toLowerCase().includes(r)||c.fullName?.toLowerCase().includes(r)).slice(0,h)};break;case"#":let{result:u}=await a(r);n.filteredItemsInfo={type:"item",items:u?.results??[]};break;case"$":let{results:m}=await l(r);n.filteredItemsInfo={type:"group",items:m};break}(n.filteredItemsInfo?.items?.length??0)===0&&await n.closePopover(),n.isFetchingEntities=!1},400);return{fetchUsers:async()=>{try{let{users:s}=await D(n.portal);e=s??[]}catch(s){e=[],console.error("error fetching org users:",s)}},filterItems:i,getItemText:(s,t)=>{let r="";switch(q(t)){case"@":r=s.username;break;case"#":r=s.title??"";break;case"$":r=s.title??"";break}return r.trim()}}}),A=({id:n,label:e,selected:a,description:l,contentStart:i,onSelect:s})=>E(n,o`<calcite-list-item class=${w({selected:a})} .label=${e} .description=${l} .selected=${a} @pointerdown=${async t=>{t.preventDefault(),t.stopPropagation(),await s()}} ${y(t=>{a&&t&&t.scrollIntoView({block:"nearest",behavior:"smooth"})})}>${i}</calcite-list-item>`),j=T`.selected{--calcite-list-background-color: var(--calcite-color-foreground-2)}.mentionable-list{max-height:13rem;overflow-y:auto;padding:.25rem;width:min(100vw,24rem)}.mentionable-list--loading{min-height:10rem}`,M=class extends k{constructor(){super(...arguments),this.calciteTextAreaRef=S(),this.mentionableEntityController=V(this),this.handleInput=e=>{let{bubbleNewValueChange:a,checkForMention:l}=this,i=e.target.value;i||v(this.el),this._value=i,a(this._value);let s=this.nativeTextAreaRef?.selectionStart??0;l(i,s)},this.handleKeyDown=e=>{if(!this.popoverOpen){this.arcgisUserMentionableTextAreaKeyDown.emit(e),this.arcgisMentionableTextAreaKeyDown.emit(e);return}switch(e.key){case"ArrowDown":e.preventDefault(),this.selectedItemIndex=Math.min(this.selectedItemIndex+1,this.filteredItems.length-1);break;case"ArrowUp":e.preventDefault(),this.selectedItemIndex=Math.max(this.selectedItemIndex-1,0);break;case"Enter":e.preventDefault(),this.selectItem(this.filteredItems[this.selectedItemIndex]);break;case"Escape":e.preventDefault(),this.closePopover.bind(this)();break}},this.handleClosePopover=()=>{this.popoverOpen=!1,this.currentMentionQuery="",this.selectedItemIndex=0,this.currentStarter=null},this.bubbleNewValueChange=e=>{this.arcgisUserMentionableTextAreaChange.emit(e),this.arcgisMentionableTextAreaChange.emit(e)},this.checkForMention=(e,a)=>{let l=e.substring(0,a),i=F(l,this.starters??g);if(i){let{starter:s}=i;this.currentStarter=s,this.filterMentionItems(i),this.popoverOpen=!0;return}this.handleClosePopover()},this.filterMentionItems=e=>{let{mentionText:a,query:l,starter:i,startIndex:s}=e;this.currentMentionQuery=a,this.mentionStartPosition=s;let t=l.toLowerCase();this.mentionableEntityController.filterItems(t,i),this.selectedItemIndex=0},this.popoverOpen=!1,this.currentMentionQuery="",this.mentionStartPosition=0,this.selectedItemIndex=0,this.currentStarter=null,this._value="",this.filteredItemsInfo=null,this.isFetchingEntities=!1,this.popoverPlacement="bottom-start",this.disabled=!1,this.scale="m",this.rows=3,this.starters=g,this.readOnly=!1,this.arcgisMentionableSelectedIndexChange=d(),this.arcgisMentionableTextAreaChange=d(),this.arcgisMentionableTextAreaKeyDown=d(),this.arcgisUserMentionableTextAreaChange=d(),this.arcgisUserMentionableTextAreaKeyDown=d(),this.renderItemInfo=()=>{let{filteredItemsInfo:e,selectedItemIndex:a,portal:l}=this;if(!e)return null;let{items:i,type:s}=e;switch(s){case"user":return i.map((t,r)=>A({id:t.id,label:`@${t.username}`,description:t.fullName,selected:r===a,contentStart:o`<arcgis-portal-user-avatar slot=content-start .user=${t} .portal=${l} scale=m></arcgis-portal-user-avatar>`,onSelect:async()=>await this.selectItem(t)}));case"item":return i.map((t,r)=>A({id:t.id??`item-${r}`,label:`#${t.title}`,description:t.id??void 0,selected:r===a,onSelect:async()=>await this.selectItem(t),contentStart:o`<calcite-avatar slot=content-start .fullName=${t.title??void 0} .thumbnail=${t.thumbnailUrl??void 0} scale=m></calcite-avatar>`}));case"group":return i.map((t,r)=>A({id:t.id??`group-${r}`,label:`${t.title}`,description:t.id??void 0,selected:r===a,onSelect:async()=>await this.selectItem(t),contentStart:o`<calcite-avatar slot=content-start .fullName=${t.title??void 0} .thumbnail=${t.thumbnailUrl??void 0} scale=m></calcite-avatar>`}))}}}static{this.properties={popoverOpen:16,currentMentionQuery:16,mentionStartPosition:16,selectedItemIndex:16,currentStarter:16,_value:16,filteredItemsInfo:16,isFetchingEntities:16,popoverListLabel:1,popoverPlacement:1,disabled:5,portal:0,user:0,scale:1,value:1,maxLength:9,rows:9,starters:0,placeholder:1,readOnly:5}}static{this.styles=j}get filteredItems(){return this.filteredItemsInfo?.items??[]}async closePopover(){this.handleClosePopover()}async focusTextArea(){await this.calciteTextAreaRef.value?.setFocus()}async selectItem(e){let{currentStarter:a,_value:l,mentionStartPosition:i,currentMentionQuery:s,handleClosePopover:t,calciteTextAreaRef:r,nativeTextAreaRef:h,bubbleNewValueChange:u}=this;if(!e||!a)return;let m=this.mentionableEntityController.getItemText(e,a),c=m.replaceAll('"',"").trim(),p=/\s/u.test(c)?`${a}"${c}"`:`${a}${c}`,f=(l??"").substring(0,i),x=(l??"").substring(i+s.length),$=`${f}${p} ${x}`,b=_(e,a,m);b&&R(this.el,{text:p,part:b}),this._value=$,u(this._value);let I=i+p.length+1;t(),await this.updateComplete,r.value?.setFocus(),h&&(h.selectionEnd=I)}willUpdate(e){e.has("value")&&(this._value=this.value??"",this._value||v(this.el)),(e.has("portal")||e.has("user"))&&v(this.el),e.has("selectedItemIndex")&&this.arcgisMentionableSelectedIndexChange.emit(this.selectedItemIndex)}loaded(){this.updateComplete.then(()=>{let e=this.calciteTextAreaRef.value?.shadowRoot?.querySelector("textarea");e&&(this.nativeTextAreaRef=e)}),this.mentionableEntityController.fetchUsers()}render(){let{popoverPlacement:e,scale:a,_value:l,maxLength:i,rows:s,placeholder:t,readOnly:r,popoverOpen:h,closePopover:u,handleInput:m,handleKeyDown:c,disabled:p,isFetchingEntities:f,filteredItemsInfo:x,renderItemInfo:$,popoverListLabel:b}=this,I=this.calciteTextAreaRef.value,K=x?.items??[];return o`<calcite-text-area .placeholder=${t} .value=${l} .maxLength=${i} .rows=${s} .scale=${a} .readOnly=${r} .disabled=${p} @blur=${u} @calciteTextAreaInput=${m} @keydown=${c} ${y(this.calciteTextAreaRef)}></calcite-text-area>${I&&o`<calcite-popover .open=${h} .placement=${e} class="mention-popover" .label=${b} .referenceElement=${I} trigger-disabled pointer-disabled focus-trap-disabled><div class=${w({"mentionable-list":!0,"mentionable-list--loading":f})}>${f&&o`<calcite-scrim .loading=${f}></calcite-scrim>`||""}${K.length>0&&o`<calcite-list .label=${b}>${$()}</calcite-list>`||""}</div></calcite-popover>`||""}`}};P("arcgis-portal-mentionable-text-area",M);return M},a,b,c,e,f)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import h from"./2267AKWE.js";import"./SRWFOV5W.js";import g from"./PVPTFK7N.js";import"./Y5VUMGKH.js";import f from"./TRFH3KNJ.js";import"./4QYVBXZT.js";import e from"./OQUQ7Z3E.js";import"./4KTRAA2J.js";import d from"./MXUHZ474.js";import"./PKA745KL.js";import"./VDXESPJK.js";import"./ULGME5RT.js";import"./DAAON2UO.js";import c from"./MOE6L5RN.js";import b from"./TIPQ2ZWK.js";import"./57MT7FOI.js";import"./MLTZSPZQ.js";import a from"./IAK4F5SX.js";import"./4VLEUN7I.js";import"./KV4ZZSNW.js";import"./FN2QMDEW.js";import"./AYHYABMC.js";import"./OQ3OHDEB.js";import"./I57CRKF7.js";import"./3ZC26CT6.js";import"./OUMTV5H5.js";import"./5PV2GUZW.js";export default $arcgis.t(([,,,,,,,a])=>{return a},a,b,c,d,e,f,g,h)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import a from"./5SKCVK2P.js";import{d as g}from"./VDXESPJK.js";import{c as $}from"./2FKNF2ZK.js";import{a as F}from"./AYHYABMC.js";import{I as x,J as b,K as _,L as s,M as v,Q as y,h as u,j as o,v as p}from"./3ZC26CT6.js";export default $arcgis.t(([{watch:l},h,{substitute:B},{a:k,b:S,c:R,d:P}])=>{var U=u`:host{position:relative;display:flex;height:100%;flex-direction:column;overflow-y:auto;overflow-x:hidden;background-color:var(--calcite-color-background);--arcgis-browser-max-width: 100%;--arcgis-browser-pane-width: 18.75rem;--arcgis-browser-pane-z-index: 11;container-type:inline-size;container-name:portal-browser}:host([height="auto"]){height:auto;min-height:100%;flex:1 1 100%}.wrapper{display:flex;height:100%;flex-direction:column;overflow:hidden}.wrapper--fixed{overflow:hidden}.wrapper--auto{flex:1 1 100%}.wrapper--full{transform:translate(0)}.panel{display:flex;height:100%;flex-direction:column;overflow:hidden}.panel--fixed{transform:translateZ(0)}.top-bar{position:sticky;top:0;right:0;left:0;z-index:20;flex-shrink:0;flex-grow:0;border-bottom:1px solid var(--calcite-color-border-3)}.scrolling{position:relative;display:flex;min-height:0px;width:100%;flex:1 1 0%;flex-direction:column}.scrolling--panel{overflow-y:scroll}@supports (scrollbar-gutter: stable){.scrolling--panel{scrollbar-gutter:stable;overflow-y:auto}}.scrolling--full{overflow:hidden}.preview-position{position:absolute;inset:0;margin-inline:auto;width:100%;max-width:var(--arcgis-browser-max-width)}.preview-position--with-top-bar{top:3rem}.preview-desktop{width:100%}.two-up{margin-left:auto;margin-right:auto;display:flex;width:100%;flex:1 1 auto;flex-direction:row;max-width:var(--arcgis-browser-max-width)}.two-up.small{margin-top:-1px}.two-up--fullscreen{height:100%;overflow:hidden}.content__start{margin-inline-end:.25rem;padding-inline:1rem}.content{position:relative;display:flex;min-width:0px;flex:1 1 0%;flex-direction:column;overflow:hidden}.content--full{overflow-y:scroll}@supports (scrollbar-gutter: stable){.content--full{scrollbar-gutter:stable;overflow-y:auto}}.content__top{position:relative;display:flex;height:1.5rem;flex-grow:0;align-items:center;justify-content:space-between;padding-top:1.25rem;padding-bottom:.75rem;font-size:1.125rem;color:var(--calcite-color-text-1);z-index:2}.content__top__end{margin-inline-start:auto;display:grid;gap:.5rem;grid-auto-flow:column}.actions,.filter-status{flex:1 1 0%}.content__view{margin-inline-end:.25rem;min-width:0px;flex:1 1 0%;padding-inline:var(--arcgis-browser-content-padding, 1rem)}.content__view--padded-bottom{padding-bottom:1rem}.content__view--no-filters{margin-inline-start:.25rem;padding-inline-start:var(--arcgis-browser-content-padding, 1rem)}.pane{pointer-events:none;visibility:hidden;display:flex;height:100%;background-color:var(--calcite-color-background);opacity:0;transition-duration:var(--calcite-internal-animation-timing-medium);transition-property:transform,visibility,opacity;border-left:1px solid var(--calcite-color-border-3);border-right:1px solid var(--calcite-color-border-3)}.pane--open{pointer-events:auto;visibility:visible;opacity:1;transform:translate(0);box-shadow:4px 0 16px #0000000f}.preview{width:0px;flex-shrink:0;flex-grow:0;position:absolute;top:0;bottom:0;inset-inline-start:0;transition-duration:var(--calcite-internal-animation-timing-medium);transition-property:width;z-index:var(--arcgis-browser-pane-z-index)}.preview--fixed{position:fixed}.preview--active{overflow:auto;width:var(--arcgis-browser-pane-width);box-shadow:#0000000f 4px 0 16px}.filter-panel,.preview-panel{position:relative;height:100%;background-color:var(--calcite-color-background)}.filter-panel__content{padding:.75rem 1rem 0}.filter-status--mobile{width:100%}.filter-status--active{display:block}.popover-contents{width:var(--arcgis-browser-popover-width);height:var(--arcgis-browser-popover-height)}.sheet{pointer-events:none;position:fixed;inset:0;z-index:110}.sheet--top-bar{top:3rem;overflow:hidden}.sheet__background{position:absolute;inset:0;opacity:0;transition:all var(--calcite-animation-timing) ease-in-out 0s,outline 0s,outline-offset 0s;background-color:#0003}.sheet__background--hidden{display:none}.sheet--active .sheet__background{opacity:1}.sheet--active{pointer-events:auto;opacity:1}.sheet__contents{position:absolute;inset:0;opacity:0;transition:all var(--calcite-animation-timing) ease-in-out 0s,outline 0s,outline-offset 0s;top:3rem;transform:translate3d(0,24px,0)}.sheet__contents--full{top:0;--tw-shadow: 0 2px 12px -4px rgba(0, 0, 0, .2), 0 2px 4px -2px rgba(0, 0, 0, .16);--tw-shadow-colored: 0 2px 12px -4px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);inset-inline-end:0;width:100%;border:1px solid var(--calcite-color-border-3);border-inline-start:1px solid var(--calcite-color-border-3);transform:translate3d(0,24px,0)}.sheet--active .sheet__contents{opacity:1;transform:translateZ(0)}.hide{display:none}.aria-hidden{height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;position:absolute;top:0;bottom:0;width:0px;inset-inline-end:0}.content__view--flex{display:flex;flex-direction:column}.cover{display:flex;flex:1 1 0%;align-items:flex-start;justify-content:center;overflow:auto;padding-bottom:1rem;padding-top:.25rem}.no-results{height:100%;width:100%;flex:1 1 0%;text-align:center;font-size:.875rem;color:var(--calcite-color-text-2)}::slotted([slot="no-results"]){width:100%}::slotted([slot="no-content"]){width:100%}.results-wrapper{flex:1 1 0%}.results-wrapper--spaced{padding-top:1.5rem}.loader{margin-top:min(8rem,30vh);--calcite-loader-padding: 0}.filters{box-sizing:border-box;flex-grow:0;padding-inline:1.5rem 0;width:var(--arcgis-browser-pane-width)}.filters--sticky{position:sticky;top:0;height:100%}.filters__content{overflow-y:auto;height:100%;padding-top:1.5rem;box-sizing:border-box;scrollbar-gutter:stable}.filters--empty{display:none}.filters--active{opacity:1;transform:translateZ(0)}.filters__title{margin:0 0 1rem;padding:0 0 1rem;font-size:1.125rem;font-weight:500;color:var(--calcite-color-text-1);padding-inline-start:.75rem;border-bottom:1px solid var(--calcite-color-border-3)}.range{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.875rem;color:var(--calcite-color-text-1)}.container{display:flex;height:100%;width:100%;flex-direction:column;background-color:var(--calcite-color-background)}.container__header{display:flex;flex:0 1 auto;flex-direction:row;background-color:var(--calcite-color-foreground-1);border-bottom:1px solid var(--calcite-color-border-3)}.container__header__text{margin:0;flex:1 1 0%;padding:.875rem .75rem;font-size:1rem;font-weight:500;color:var(--calcite-color-text-2)}.container__content{flex:1 1 0%;overflow:auto}.container__footer{box-sizing:border-box;width:100%;flex:0 1 auto;background-color:var(--calcite-color-foreground-1);padding:.5rem}.small .filters{padding:0}.small .filters__content{padding-left:1rem;padding-right:1rem}.small .content__view{padding-inline:.5rem;margin-inline:0}.small .content__view--panel{padding-inline:0}.small .content__start{margin-inline:0;padding-inline:.5rem}@container portal-browser (max-width: 640px){:host{--arcgis-browser-pane-width: 100%}}.scrim__find{margin-top:3.5rem;opacity:.6;transition-property:opacity;transition-duration:.15s;--calcite-scrim-background: rgba(0, 0, 0, .6)}`;function C(d){return{...d,value:void 0,..."additionalParams"in d?{additionalParams:void 0}:{}}}function I(d,t={}){let{hiddenFilterIds:e,preservedFilterIds:i}=t,a=new Set([...e||[],...i||[]]);return Object.entries(d).reduce((r,[n,c])=>a.has(n)?(r[n]=c,r):(r[n]=C(c),r),{})}function q(d){let t=Math.max(d?.total??0,0),e=d?.results?.length??0;if(!t||!e)return{start:0,end:0,total:t};let i=Math.max(d?.start??1,1),a=Math.min(i+e-1,t);return{start:i,end:a,total:t}}var A=49,f=class extends _{constructor(){super(...arguments),this._messages=F({blocking:!0}),this._previewContainer=x(),this.toggleScrim=t=>{this.scrimActive=t.detail},this.checkFlowItem=()=>{this.flowItem=g(this.el,"calcite-flow-item")},this.handleResize=()=>{requestAnimationFrame(this.updatePreviewPosition)},this.updatePreviewPosition=()=>{if(this.formFactor==="small"||this.height!=="auto"||!this._previewContainer)return;this.checkFlowItem();let t=this._previewContainer.value?.getBoundingClientRect();if(!t)return;let{x:e,y:i,height:a,right:r,width:n}=t,c=a+i,m=window.innerWidth-document.body.offsetWidth,w=window.innerWidth<n||window.innerWidth<window.outerWidth&&window.innerWidth<=n+m;this.previewBoundingBox={top:Math.max(i,0),left:e,right:w?0:window.outerWidth-r-m,bottom:c>window.innerHeight?0:window.innerHeight-c}},this.pageRangeText="",this.noResults=!1,this.initialHide=!0,this.scrimActive=!1,this.panel=!1,this.preview=!1,this.loading=!1,this.hideContentTop=!1,this.alwaysShowSelection=!1,this.alwaysShowContent=!1,this.response={nextStart:-1,num:0,results:[],start:1,total:0},this.store=R(),this.formFactor="large",this.searchTerm="",this.height="full",this.arcgisAriaUpdate=p(),this.arcgisBrowserFilterClear=p(),this.arcgisBrowserFilterRemove=p(),this.ariaUpdate=p()}static{this.properties={pageRangeText:16,noResults:16,previewBoundingBox:16,initialHide:16,scrimActive:16,flowItem:16,panel:5,preview:5,loading:5,hideContentTop:5,hideTopBar:5,selected:0,alwaysShowSelection:5,alwaysShowContent:5,response:0,store:0,formFactor:1,searchTerm:1,height:3,hideFilters:5,showPreSearch:5,rangeFormatter:0,alwaysShowPagination:5}}static{this.styles=U}async scrollToTop(){this.renderRoot.querySelector(".top-bar")?.scrollIntoView({behavior:"smooth",block:"nearest"})}connectedCallback(){super.connectedCallback(),window.addEventListener("scroll",this.handleResize),window.addEventListener("resize",this.handleResize),this.el.addEventListener("arcgisItemBrowserScrimToggle",this.toggleScrim),this.checkFlowItem(),this.attachStoreWatchers()}willUpdate(t){t.has("store")&&this.attachStoreWatchers(),t.has("response")&&this.updatePage(this.response)}firstUpdated(){requestAnimationFrame(this.updatePreviewPosition)}disconnectedCallback(){this.removePreviewWatcher?.(),this.removeStoreWatcher?.(),window.removeEventListener("resize",this.handleResize),window.removeEventListener("scroll",this.handleResize),this.el.removeEventListener("arcgisItemBrowserScrimToggle",this.toggleScrim),super.disconnectedCallback()}attachStoreWatchers(){if(this.removePreviewWatcher?.(),this.removeStoreWatcher?.(),!this.store)return;this.removePreviewWatcher=P(this.store,this.updatePreviewPosition);let t=[l(()=>this.store.type,()=>this.requestUpdate()),l(()=>this.store.width,()=>this.requestUpdate()),l(()=>this.store.height,()=>this.requestUpdate()),l(()=>this.store.filtersEmpty,()=>this.requestUpdate()),l(()=>this.store.topbarEmpty,()=>this.requestUpdate()),l(()=>this.store.sortEmpty,()=>this.requestUpdate()),l(()=>this.store.filtersExpanded,()=>this.requestUpdate()),l(()=>this.store.panel,()=>this.requestUpdate()),l(()=>this.store.preview,()=>this.requestUpdate()),l(()=>this.store.searchTerm,()=>this.requestUpdate()),l(()=>this.store.hiddenFilters,()=>this.requestUpdate()),l(()=>this.store.filters,()=>this.requestUpdate()),l(()=>this.store.recycleBin,()=>this.requestUpdate())];this.removeStoreWatcher=()=>{t.forEach(e=>e.remove())}}async updatePage(t){let[e,i]=await this.updatePageRange(t);this.pageRangeText=e,this.arcgisAriaUpdate.emit(i),this.el.dispatchEvent(new CustomEvent("ariaUpdate",{detail:i})),this.noResults=S(this.store)&&this.store.recycleBin?t.results.length===0:(t?.total??0)===0,this.initialHide=!1}async updatePageRange(t){let{start:e,end:i,total:a}=q(t),r=h.formatNumber(e,{maximumFractionDigits:0}),n=h.formatNumber(i,{maximumFractionDigits:0}),c=`${h.formatNumber(a,{maximumFractionDigits:0})}${a>=1e4?"+":""}`,m=h.formatNumber(t.results?.length??0,{maximumFractionDigits:0}),w=h.formatNumber(Math.max(Math.ceil(e/Math.max(t.num||1,1)),1),{maximumFractionDigits:0});if(this.rangeFormatter)return await this.rangeFormatter({start:r,end:n,total:c,results:{items:m,page:w}});let E=this._messages.browser.pageRange,T=this._messages.browser.pageRangeAria,W=B(E,{start:r,end:n,total:c}),z=B(T,{start:r,end:n,total:c});return[W,z]}hasActiveFilter(t){return Object.values(t.filters).filter(({id:e})=>!$(k,e)).some(e=>!!e.value||e.id==="collaborations")}removeFilter(t){let e=this.store.filters[t];if(!e)return;let i=C(e),a={...this.store.filters,[t]:i};this.store.filters=a,this.arcgisBrowserFilterRemove.emit(t)}clearFilters(){let t=I(this.store.filters,{hiddenFilterIds:this.store.hiddenFilters,preservedFilterIds:["folder","group","contentType"]});this.store.filters=t,this.arcgisBrowserFilterClear.emit(null)}renderNoResults(){let t=this.noResults&&!this.loading&&!this.showPreSearch,e=this.hasActiveFilter(this.store)||!!this.searchTerm;return t?o`<div class="cover"><div class="no-results">${e?o`<slot name=no-results></slot>`:o`<slot name=no-content></slot>`}</div></div>`:null}renderPopoverContents(t,e,i){let a=this.flowItem?this.flowItem.offsetHeight:this.store.height,r=this.formFactor==="small"&&this.hasActiveFilter(this.store)&&!this.hideFilters;return this.el.style.setProperty("--arcgis-browser-popover-width",i?"100%":`${this.store.width||0}px`),this.el.style.setProperty("--arcgis-browser-popover-height",i?"100%":`${a||0}px`),o`<div class="popover-contents"><div class=${s({hide:!e,"preview-panel":!0})}><slot name=preview></slot></div><div class=${s({hide:!t,"filter-panel":!0})}><article class="container"><header class="container__header"><h2 class="container__header__text">${this._messages.browser?.refineContent}</h2><calcite-action .text=${this._messages.browser?.close} scale=m icon=x @click=${()=>{this.store.filtersExpanded=!1}}></calcite-action></header><div class="container__content"><div class="container__content__scroll"><slot name=filters-top></slot>${(this.store.panel||i)&&o`<div class="filter-container__content"><slot name=sort></slot></div>`||""}<slot name=filters></slot></div></div><div class=${s({"filter-status--mobile":!0,container__footer:!0,hide:!r})}><arcgis-portal-browser-filter-status class="filter-status" .filters=${this.store.filters} .hiddenFilterIds=${this.store.hiddenFilters||[]} .componentWidth=${this.store.width||this.flowItem?.offsetWidth||window.innerWidth} .browserWidth=${window.innerWidth} @arcgisBrowserFilterClear=${()=>this.clearFilters()} @arcgisBrowserFilterRemove=${n=>this.removeFilter(n.detail)}></arcgis-portal-browser-filter-status></div></article></div></div>`}renderFlow(){let t=!!this.store.panel,e=!!this.store.filtersExpanded&&(!this.store.filtersEmpty||!this.store.sortEmpty&&t),i=!!this.store.preview,a=!this.store.panel&&document.documentElement.clientWidth>(this.store.width||0);return o`<div class=${s({panel:!0,"panel--fixed":a})}>${!this.hideTopBar&&o`<div class=${s({"top-bar":!0,"top-bar--small":this.formFactor==="small"})}><slot name=top-bar></slot></div>`||""}<div class="scrolling scrolling--panel"><div class=${s({"two-up":!0,[this.formFactor]:!0})}><div class="content"><div><slot name=primary-filter></slot></div><div class="content__start"><slot name=content-start></slot></div>${this.loading&&!this.alwaysShowContent&&o`<div class="content__view content__view--flex"><div class="cover"><calcite-loader class="loader" label></calcite-loader></div></div>`||""}${this.noResults&&!this.loading&&o`<div class="content__view content__view--flex"><div class="cover">${this.renderNoResults()}</div></div>`||""}<div class=${s({hide:this.loading||this.noResults,content__view:!0,"content__view--panel":!!this.store.panel,"content__view--flex":!this.loading&&!this.noResults})}>${!this.store.panel&&!this.hideContentTop&&o`<div class="content__top"><span class=${s({selection:!0,hide:!this.alwaysShowSelection})}><slot name=selection></slot></span>${!this.loading&&o`<span class="range">${this.pageRangeText}</span>`||""}<span class="actions"><slot name=actions></slot></span><div class="content__top__end"><slot name=view></slot>${!t&&o`<slot name=sort></slot>`||""}</div></div>`||""}<div class="flow-content"><slot name=content></slot></div><slot name=pagination></slot><slot name=content-end></slot></div></div></div><slot name=scroll-end></slot></div>${!this.store.panel||window.innerWidth<(this.store.width||0)*2?o`<div class=${s({sheet:!0,"sheet--active":e||i,"sheet--top-bar":a})}><div class=${s({sheet__background:!0,"sheet__background--hidden":a})}></div><div class=${s({sheet__contents:!0,"sheet__contents--full":a})}>${this.renderPopoverContents(e,i,!0)}</div></div>`:o`<calcite-popover overlay-positioning=fixed .open=${i||e} label=filters .referenceElement=${this.flowItem||this.el} offset-skidding=0 offset-distance=0 trigger-disabled pointer-disabled .placement=${this.store.panel?"trailing":"auto"} @calcitePopoverOpen=${r=>{(!this.store.panel||window.innerWidth<(this.store.width||0)*2)&&(r.currentTarget.style.transform="none")}} .focusTrapOptions=${{setReturnFocus:r=>{if(!(r instanceof HTMLElement))return r;let n=g(r,"arcgis-portal-item-card, arcgis-portal-group-card");return n?.restoreFocus?(n.restoreFocus(),!1):r}}}>${this.renderPopoverContents(e,i)}</calcite-popover>`}</div>`}render(){let t=this.height==="auto",e=this.height==="full",i=!!this.store.preview,a=`${(this.store.height||window.innerHeight)-A}px`,r=t?{}:{maxHeight:a};return this.formFactor==="small"?this.renderFlow():o`<div class=${s({wrapper:!0,"wrapper--fixed":!!this.store.filtersExpanded,"wrapper--auto":t,"wrapper--full":e})}>${!this.hideTopBar&&o`<div class="top-bar"><slot name=top-bar></slot></div>`||""}<slot name=top-bar-end></slot><div class=${s({"preview-position":!0,"preview-position--with-top-bar":!this.store.topbarEmpty})} ${b(this._previewContainer)}><div class=${s({preview:!0,"preview--active":i,"preview--fixed":t})} style=${v(t&&this.previewBoundingBox?{top:`${this.previewBoundingBox.top||0}px`,...document.dir==="rtl"?{right:`${this.previewBoundingBox.right||0}px`}:{left:`${this.previewBoundingBox.left||0}px`},bottom:`${this.previewBoundingBox.bottom||0}px`}:{})}><div class=${s({pane:!0,"pane--open":i})}><div class="preview-desktop"><slot name=preview></slot></div></div></div></div><div class=${s({scrolling:!0,"scrolling--full":!t||this.panel})}>${this.scrimActive&&o`<calcite-scrim class="scrim__find"></calcite-scrim>`||""}<div class=${s({"two-up":!0,"two-up--fullscreen":e,[this.formFactor]:!0})}><div class=${s({filters:!0,"filters--sticky":!t,"filters--empty":this.store.filtersEmpty&&!this.store.preview,"filters--active":!!this.store.filtersExpanded})} style=${v(e?{}:r)}><div class="filters__content" style=${v(e?{}:r)}><slot name=filters></slot></div></div><div class=${s({content:!0,"content--full":e})}><div class="content__start"><slot name=content-start></slot></div><div class=${s({content__view:!0,"content__view--no-filters":this.store.filtersEmpty&&!this.store.preview,"content__view--flex":!0})}>${!this.hideContentTop&&o`<div class="content__top">${this.showPreSearch?null:o`<div class="content__top__summary"><span class=${s({selection:!0,hide:!this.alwaysShowSelection})}><slot name=selection></slot></span>${!this.loading&&o`<span class="range">${this.pageRangeText}<slot name=range-end></slot></span>`||""}</div>`}<span class="actions"><slot name=actions></slot></span><div class="content__top__end"><slot name=view></slot><slot name=sort></slot></div></div>`||""}${this.loading&&(!this.alwaysShowContent||this.initialHide)&&o`<div class="cover"><calcite-loader class="loader" .label=${this._messages.browser?.loading??""}></calcite-loader></div>`||""}${this.renderNoResults()}${!this.loading&&this.showPreSearch&&o`<div class="cover"><div class="no-results"><slot name=pre-search></slot></div></div>`||""}<div class=${s({hide:!!this.showPreSearch||this.loading&&!this.alwaysShowContent||!this.loading&&this.noResults||this.initialHide,"results-wrapper--spaced":this.hideContentTop,"results-wrapper":!0})}><slot name=content></slot></div><div class=${s({hide:this.loading||this.noResults&&!this.alwaysShowPagination})}><slot name=pagination></slot><slot name=content-end></slot></div></div></div></div><slot name=scroll-end></slot></div></div>`}};y("arcgis-portal-browser",f);return{a:C,b:I,c:f}},"core/reactiveUtils","intl","intl",a)
2
+ import a from"./5SKCVK2P.js";import{d as g}from"./VDXESPJK.js";import{d as $}from"./FN2QMDEW.js";import{a as F}from"./AYHYABMC.js";import{I as x,J as b,K as _,L as s,M as v,Q as y,h as u,j as o,v as p}from"./3ZC26CT6.js";export default $arcgis.t(([{watch:l},h,{substitute:B},{a:k,b:S,c:R,d:P}])=>{var U=u`:host{position:relative;display:flex;height:100%;flex-direction:column;overflow-y:auto;overflow-x:hidden;background-color:var(--calcite-color-background);--arcgis-browser-max-width: 100%;--arcgis-browser-pane-width: 18.75rem;--arcgis-browser-pane-z-index: 11;container-type:inline-size;container-name:portal-browser}:host([height="auto"]){height:auto;min-height:100%;flex:1 1 100%}.wrapper{display:flex;height:100%;flex-direction:column;overflow:hidden}.wrapper--fixed{overflow:hidden}.wrapper--auto{flex:1 1 100%}.wrapper--full{transform:translate(0)}.panel{display:flex;height:100%;flex-direction:column;overflow:hidden}.panel--fixed{transform:translateZ(0)}.top-bar{position:sticky;top:0;right:0;left:0;z-index:20;flex-shrink:0;flex-grow:0;border-bottom:1px solid var(--calcite-color-border-3)}.scrolling{position:relative;display:flex;min-height:0px;width:100%;flex:1 1 0%;flex-direction:column}.scrolling--panel{overflow-y:scroll}@supports (scrollbar-gutter: stable){.scrolling--panel{scrollbar-gutter:stable;overflow-y:auto}}.scrolling--full{overflow:hidden}.preview-position{position:absolute;inset:0;margin-inline:auto;width:100%;max-width:var(--arcgis-browser-max-width)}.preview-position--with-top-bar{top:3rem}.preview-desktop{width:100%}.two-up{margin-left:auto;margin-right:auto;display:flex;width:100%;flex:1 1 auto;flex-direction:row;max-width:var(--arcgis-browser-max-width)}.two-up.small{margin-top:-1px}.two-up--fullscreen{height:100%;overflow:hidden}.content__start{margin-inline-end:.25rem;padding-inline:1rem}.content{position:relative;display:flex;min-width:0px;flex:1 1 0%;flex-direction:column;overflow:hidden}.content--full{overflow-y:scroll}@supports (scrollbar-gutter: stable){.content--full{scrollbar-gutter:stable;overflow-y:auto}}.content__top{position:relative;display:flex;height:1.5rem;flex-grow:0;align-items:center;justify-content:space-between;padding-top:1.25rem;padding-bottom:.75rem;font-size:1.125rem;color:var(--calcite-color-text-1);z-index:2}.content__top__end{margin-inline-start:auto;display:grid;gap:.5rem;grid-auto-flow:column}.actions,.filter-status{flex:1 1 0%}.content__view{margin-inline-end:.25rem;min-width:0px;flex:1 1 0%;padding-inline:var(--arcgis-browser-content-padding, 1rem)}.content__view--padded-bottom{padding-bottom:1rem}.content__view--no-filters{margin-inline-start:.25rem;padding-inline-start:var(--arcgis-browser-content-padding, 1rem)}.pane{pointer-events:none;visibility:hidden;display:flex;height:100%;background-color:var(--calcite-color-background);opacity:0;transition-duration:var(--calcite-internal-animation-timing-medium);transition-property:transform,visibility,opacity;border-left:1px solid var(--calcite-color-border-3);border-right:1px solid var(--calcite-color-border-3)}.pane--open{pointer-events:auto;visibility:visible;opacity:1;transform:translate(0);box-shadow:4px 0 16px #0000000f}.preview{width:0px;flex-shrink:0;flex-grow:0;position:absolute;top:0;bottom:0;inset-inline-start:0;transition-duration:var(--calcite-internal-animation-timing-medium);transition-property:width;z-index:var(--arcgis-browser-pane-z-index)}.preview--fixed{position:fixed}.preview--active{overflow:auto;width:var(--arcgis-browser-pane-width);box-shadow:#0000000f 4px 0 16px}.filter-panel,.preview-panel{position:relative;height:100%;background-color:var(--calcite-color-background)}.filter-panel__content{padding:.75rem 1rem 0}.filter-status--mobile{width:100%}.filter-status--active{display:block}.popover-contents{width:var(--arcgis-browser-popover-width);height:var(--arcgis-browser-popover-height)}.sheet{pointer-events:none;position:fixed;inset:0;z-index:110}.sheet--top-bar{top:3rem;overflow:hidden}.sheet__background{position:absolute;inset:0;opacity:0;transition:all var(--calcite-animation-timing) ease-in-out 0s,outline 0s,outline-offset 0s;background-color:#0003}.sheet__background--hidden{display:none}.sheet--active .sheet__background{opacity:1}.sheet--active{pointer-events:auto;opacity:1}.sheet__contents{position:absolute;inset:0;opacity:0;transition:all var(--calcite-animation-timing) ease-in-out 0s,outline 0s,outline-offset 0s;top:3rem;transform:translate3d(0,24px,0)}.sheet__contents--full{top:0;--tw-shadow: 0 2px 12px -4px rgba(0, 0, 0, .2), 0 2px 4px -2px rgba(0, 0, 0, .16);--tw-shadow-colored: 0 2px 12px -4px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);inset-inline-end:0;width:100%;border:1px solid var(--calcite-color-border-3);border-inline-start:1px solid var(--calcite-color-border-3);transform:translate3d(0,24px,0)}.sheet--active .sheet__contents{opacity:1;transform:translateZ(0)}.hide{display:none}.aria-hidden{height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;position:absolute;top:0;bottom:0;width:0px;inset-inline-end:0}.content__view--flex{display:flex;flex-direction:column}.cover{display:flex;flex:1 1 0%;align-items:flex-start;justify-content:center;overflow:auto;padding-bottom:1rem;padding-top:.25rem}.no-results{height:100%;width:100%;flex:1 1 0%;text-align:center;font-size:.875rem;color:var(--calcite-color-text-2)}::slotted([slot="no-results"]){width:100%}::slotted([slot="no-content"]){width:100%}.results-wrapper{flex:1 1 0%}.results-wrapper--spaced{padding-top:1.5rem}.loader{margin-top:min(8rem,30vh);--calcite-loader-padding: 0}.filters{box-sizing:border-box;flex-grow:0;padding-inline:1.5rem 0;width:var(--arcgis-browser-pane-width)}.filters--sticky{position:sticky;top:0;height:100%}.filters__content{overflow-y:auto;height:100%;padding-top:1.5rem;box-sizing:border-box;scrollbar-gutter:stable}.filters--empty{display:none}.filters--active{opacity:1;transform:translateZ(0)}.filters__title{margin:0 0 1rem;padding:0 0 1rem;font-size:1.125rem;font-weight:500;color:var(--calcite-color-text-1);padding-inline-start:.75rem;border-bottom:1px solid var(--calcite-color-border-3)}.range{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.875rem;color:var(--calcite-color-text-1)}.container{display:flex;height:100%;width:100%;flex-direction:column;background-color:var(--calcite-color-background)}.container__header{display:flex;flex:0 1 auto;flex-direction:row;background-color:var(--calcite-color-foreground-1);border-bottom:1px solid var(--calcite-color-border-3)}.container__header__text{margin:0;flex:1 1 0%;padding:.875rem .75rem;font-size:1rem;font-weight:500;color:var(--calcite-color-text-2)}.container__content{flex:1 1 0%;overflow:auto}.container__footer{box-sizing:border-box;width:100%;flex:0 1 auto;background-color:var(--calcite-color-foreground-1);padding:.5rem}.small .filters{padding:0}.small .filters__content{padding-left:1rem;padding-right:1rem}.small .content__view{padding-inline:.5rem;margin-inline:0}.small .content__view--panel{padding-inline:0}.small .content__start{margin-inline:0;padding-inline:.5rem}@container portal-browser (max-width: 640px){:host{--arcgis-browser-pane-width: 100%}}.scrim__find{margin-top:3.5rem;opacity:.6;transition-property:opacity;transition-duration:.15s;--calcite-scrim-background: rgba(0, 0, 0, .6)}`;function C(d){return{...d,value:void 0,..."additionalParams"in d?{additionalParams:void 0}:{}}}function I(d,t={}){let{hiddenFilterIds:e,preservedFilterIds:i}=t,a=new Set([...e||[],...i||[]]);return Object.entries(d).reduce((r,[n,c])=>a.has(n)?(r[n]=c,r):(r[n]=C(c),r),{})}function q(d){let t=Math.max(d?.total??0,0),e=d?.results?.length??0;if(!t||!e)return{start:0,end:0,total:t};let i=Math.max(d?.start??1,1),a=Math.min(i+e-1,t);return{start:i,end:a,total:t}}var A=49,f=class extends _{constructor(){super(...arguments),this._messages=F({blocking:!0}),this._previewContainer=x(),this.toggleScrim=t=>{this.scrimActive=t.detail},this.checkFlowItem=()=>{this.flowItem=g(this.el,"calcite-flow-item")},this.handleResize=()=>{requestAnimationFrame(this.updatePreviewPosition)},this.updatePreviewPosition=()=>{if(this.formFactor==="small"||this.height!=="auto"||!this._previewContainer)return;this.checkFlowItem();let t=this._previewContainer.value?.getBoundingClientRect();if(!t)return;let{x:e,y:i,height:a,right:r,width:n}=t,c=a+i,m=window.innerWidth-document.body.offsetWidth,w=window.innerWidth<n||window.innerWidth<window.outerWidth&&window.innerWidth<=n+m;this.previewBoundingBox={top:Math.max(i,0),left:e,right:w?0:window.outerWidth-r-m,bottom:c>window.innerHeight?0:window.innerHeight-c}},this.pageRangeText="",this.noResults=!1,this.initialHide=!0,this.scrimActive=!1,this.panel=!1,this.preview=!1,this.loading=!1,this.hideContentTop=!1,this.alwaysShowSelection=!1,this.alwaysShowContent=!1,this.response={nextStart:-1,num:0,results:[],start:1,total:0},this.store=R(),this.formFactor="large",this.searchTerm="",this.height="full",this.arcgisAriaUpdate=p(),this.arcgisBrowserFilterClear=p(),this.arcgisBrowserFilterRemove=p(),this.ariaUpdate=p()}static{this.properties={pageRangeText:16,noResults:16,previewBoundingBox:16,initialHide:16,scrimActive:16,flowItem:16,panel:5,preview:5,loading:5,hideContentTop:5,hideTopBar:5,selected:0,alwaysShowSelection:5,alwaysShowContent:5,response:0,store:0,formFactor:1,searchTerm:1,height:3,hideFilters:5,showPreSearch:5,rangeFormatter:0,alwaysShowPagination:5}}static{this.styles=U}async scrollToTop(){this.renderRoot.querySelector(".top-bar")?.scrollIntoView({behavior:"smooth",block:"nearest"})}connectedCallback(){super.connectedCallback(),window.addEventListener("scroll",this.handleResize),window.addEventListener("resize",this.handleResize),this.el.addEventListener("arcgisItemBrowserScrimToggle",this.toggleScrim),this.checkFlowItem(),this.attachStoreWatchers()}willUpdate(t){t.has("store")&&this.attachStoreWatchers(),t.has("response")&&this.updatePage(this.response)}firstUpdated(){requestAnimationFrame(this.updatePreviewPosition)}disconnectedCallback(){this.removePreviewWatcher?.(),this.removeStoreWatcher?.(),window.removeEventListener("resize",this.handleResize),window.removeEventListener("scroll",this.handleResize),this.el.removeEventListener("arcgisItemBrowserScrimToggle",this.toggleScrim),super.disconnectedCallback()}attachStoreWatchers(){if(this.removePreviewWatcher?.(),this.removeStoreWatcher?.(),!this.store)return;this.removePreviewWatcher=P(this.store,this.updatePreviewPosition);let t=[l(()=>this.store.type,()=>this.requestUpdate()),l(()=>this.store.width,()=>this.requestUpdate()),l(()=>this.store.height,()=>this.requestUpdate()),l(()=>this.store.filtersEmpty,()=>this.requestUpdate()),l(()=>this.store.topbarEmpty,()=>this.requestUpdate()),l(()=>this.store.sortEmpty,()=>this.requestUpdate()),l(()=>this.store.filtersExpanded,()=>this.requestUpdate()),l(()=>this.store.panel,()=>this.requestUpdate()),l(()=>this.store.preview,()=>this.requestUpdate()),l(()=>this.store.searchTerm,()=>this.requestUpdate()),l(()=>this.store.hiddenFilters,()=>this.requestUpdate()),l(()=>this.store.filters,()=>this.requestUpdate()),l(()=>this.store.recycleBin,()=>this.requestUpdate())];this.removeStoreWatcher=()=>{t.forEach(e=>e.remove())}}async updatePage(t){let[e,i]=await this.updatePageRange(t);this.pageRangeText=e,this.arcgisAriaUpdate.emit(i),this.el.dispatchEvent(new CustomEvent("ariaUpdate",{detail:i})),this.noResults=S(this.store)&&this.store.recycleBin?t.results.length===0:(t?.total??0)===0,this.initialHide=!1}async updatePageRange(t){let{start:e,end:i,total:a}=q(t),r=h.formatNumber(e,{maximumFractionDigits:0}),n=h.formatNumber(i,{maximumFractionDigits:0}),c=`${h.formatNumber(a,{maximumFractionDigits:0})}${a>=1e4?"+":""}`,m=h.formatNumber(t.results?.length??0,{maximumFractionDigits:0}),w=h.formatNumber(Math.max(Math.ceil(e/Math.max(t.num||1,1)),1),{maximumFractionDigits:0});if(this.rangeFormatter)return await this.rangeFormatter({start:r,end:n,total:c,results:{items:m,page:w}});let E=this._messages.browser.pageRange,T=this._messages.browser.pageRangeAria,W=B(E,{start:r,end:n,total:c}),z=B(T,{start:r,end:n,total:c});return[W,z]}hasActiveFilter(t){return Object.values(t.filters).filter(({id:e})=>!$(k,e)).some(e=>!!e.value||e.id==="collaborations")}removeFilter(t){let e=this.store.filters[t];if(!e)return;let i=C(e),a={...this.store.filters,[t]:i};this.store.filters=a,this.arcgisBrowserFilterRemove.emit(t)}clearFilters(){let t=I(this.store.filters,{hiddenFilterIds:this.store.hiddenFilters,preservedFilterIds:["folder","group","contentType"]});this.store.filters=t,this.arcgisBrowserFilterClear.emit(null)}renderNoResults(){let t=this.noResults&&!this.loading&&!this.showPreSearch,e=this.hasActiveFilter(this.store)||!!this.searchTerm;return t?o`<div class="cover"><div class="no-results">${e?o`<slot name=no-results></slot>`:o`<slot name=no-content></slot>`}</div></div>`:null}renderPopoverContents(t,e,i){let a=this.flowItem?this.flowItem.offsetHeight:this.store.height,r=this.formFactor==="small"&&this.hasActiveFilter(this.store)&&!this.hideFilters;return this.el.style.setProperty("--arcgis-browser-popover-width",i?"100%":`${this.store.width||0}px`),this.el.style.setProperty("--arcgis-browser-popover-height",i?"100%":`${a||0}px`),o`<div class="popover-contents"><div class=${s({hide:!e,"preview-panel":!0})}><slot name=preview></slot></div><div class=${s({hide:!t,"filter-panel":!0})}><article class="container"><header class="container__header"><h2 class="container__header__text">${this._messages.browser?.refineContent}</h2><calcite-action .text=${this._messages.browser?.close} scale=m icon=x @click=${()=>{this.store.filtersExpanded=!1}}></calcite-action></header><div class="container__content"><div class="container__content__scroll"><slot name=filters-top></slot>${(this.store.panel||i)&&o`<div class="filter-container__content"><slot name=sort></slot></div>`||""}<slot name=filters></slot></div></div><div class=${s({"filter-status--mobile":!0,container__footer:!0,hide:!r})}><arcgis-portal-browser-filter-status class="filter-status" .filters=${this.store.filters} .hiddenFilterIds=${this.store.hiddenFilters||[]} .componentWidth=${this.store.width||this.flowItem?.offsetWidth||window.innerWidth} .browserWidth=${window.innerWidth} @arcgisBrowserFilterClear=${()=>this.clearFilters()} @arcgisBrowserFilterRemove=${n=>this.removeFilter(n.detail)}></arcgis-portal-browser-filter-status></div></article></div></div>`}renderFlow(){let t=!!this.store.panel,e=!!this.store.filtersExpanded&&(!this.store.filtersEmpty||!this.store.sortEmpty&&t),i=!!this.store.preview,a=!this.store.panel&&document.documentElement.clientWidth>(this.store.width||0);return o`<div class=${s({panel:!0,"panel--fixed":a})}>${!this.hideTopBar&&o`<div class=${s({"top-bar":!0,"top-bar--small":this.formFactor==="small"})}><slot name=top-bar></slot></div>`||""}<div class="scrolling scrolling--panel"><div class=${s({"two-up":!0,[this.formFactor]:!0})}><div class="content"><div><slot name=primary-filter></slot></div><div class="content__start"><slot name=content-start></slot></div>${this.loading&&!this.alwaysShowContent&&o`<div class="content__view content__view--flex"><div class="cover"><calcite-loader class="loader" label></calcite-loader></div></div>`||""}${this.noResults&&!this.loading&&o`<div class="content__view content__view--flex"><div class="cover">${this.renderNoResults()}</div></div>`||""}<div class=${s({hide:this.loading||this.noResults,content__view:!0,"content__view--panel":!!this.store.panel,"content__view--flex":!this.loading&&!this.noResults})}>${!this.store.panel&&!this.hideContentTop&&o`<div class="content__top"><span class=${s({selection:!0,hide:!this.alwaysShowSelection})}><slot name=selection></slot></span>${!this.loading&&o`<span class="range">${this.pageRangeText}</span>`||""}<span class="actions"><slot name=actions></slot></span><div class="content__top__end"><slot name=view></slot>${!t&&o`<slot name=sort></slot>`||""}</div></div>`||""}<div class="flow-content"><slot name=content></slot></div><slot name=pagination></slot><slot name=content-end></slot></div></div></div><slot name=scroll-end></slot></div>${!this.store.panel||window.innerWidth<(this.store.width||0)*2?o`<div class=${s({sheet:!0,"sheet--active":e||i,"sheet--top-bar":a})}><div class=${s({sheet__background:!0,"sheet__background--hidden":a})}></div><div class=${s({sheet__contents:!0,"sheet__contents--full":a})}>${this.renderPopoverContents(e,i,!0)}</div></div>`:o`<calcite-popover overlay-positioning=fixed .open=${i||e} label=filters .referenceElement=${this.flowItem||this.el} offset-skidding=0 offset-distance=0 trigger-disabled pointer-disabled .placement=${this.store.panel?"trailing":"auto"} @calcitePopoverOpen=${r=>{(!this.store.panel||window.innerWidth<(this.store.width||0)*2)&&(r.currentTarget.style.transform="none")}} .focusTrapOptions=${{setReturnFocus:r=>{if(!(r instanceof HTMLElement))return r;let n=g(r,"arcgis-portal-item-card, arcgis-portal-group-card");return n?.restoreFocus?(n.restoreFocus(),!1):r}}}>${this.renderPopoverContents(e,i)}</calcite-popover>`}</div>`}render(){let t=this.height==="auto",e=this.height==="full",i=!!this.store.preview,a=`${(this.store.height||window.innerHeight)-A}px`,r=t?{}:{maxHeight:a};return this.formFactor==="small"?this.renderFlow():o`<div class=${s({wrapper:!0,"wrapper--fixed":!!this.store.filtersExpanded,"wrapper--auto":t,"wrapper--full":e})}>${!this.hideTopBar&&o`<div class="top-bar"><slot name=top-bar></slot></div>`||""}<slot name=top-bar-end></slot><div class=${s({"preview-position":!0,"preview-position--with-top-bar":!this.store.topbarEmpty})} ${b(this._previewContainer)}><div class=${s({preview:!0,"preview--active":i,"preview--fixed":t})} style=${v(t&&this.previewBoundingBox?{top:`${this.previewBoundingBox.top||0}px`,...document.dir==="rtl"?{right:`${this.previewBoundingBox.right||0}px`}:{left:`${this.previewBoundingBox.left||0}px`},bottom:`${this.previewBoundingBox.bottom||0}px`}:{})}><div class=${s({pane:!0,"pane--open":i})}><div class="preview-desktop"><slot name=preview></slot></div></div></div></div><div class=${s({scrolling:!0,"scrolling--full":!t||this.panel})}>${this.scrimActive&&o`<calcite-scrim class="scrim__find"></calcite-scrim>`||""}<div class=${s({"two-up":!0,"two-up--fullscreen":e,[this.formFactor]:!0})}><div class=${s({filters:!0,"filters--sticky":!t,"filters--empty":this.store.filtersEmpty&&!this.store.preview,"filters--active":!!this.store.filtersExpanded})} style=${v(e?{}:r)}><div class="filters__content" style=${v(e?{}:r)}><slot name=filters></slot></div></div><div class=${s({content:!0,"content--full":e})}><div class="content__start"><slot name=content-start></slot></div><div class=${s({content__view:!0,"content__view--no-filters":this.store.filtersEmpty&&!this.store.preview,"content__view--flex":!0})}>${!this.hideContentTop&&o`<div class="content__top">${this.showPreSearch?null:o`<div class="content__top__summary"><span class=${s({selection:!0,hide:!this.alwaysShowSelection})}><slot name=selection></slot></span>${!this.loading&&o`<span class="range">${this.pageRangeText}<slot name=range-end></slot></span>`||""}</div>`}<span class="actions"><slot name=actions></slot></span><div class="content__top__end"><slot name=view></slot><slot name=sort></slot></div></div>`||""}${this.loading&&(!this.alwaysShowContent||this.initialHide)&&o`<div class="cover"><calcite-loader class="loader" .label=${this._messages.browser?.loading??""}></calcite-loader></div>`||""}${this.renderNoResults()}${!this.loading&&this.showPreSearch&&o`<div class="cover"><div class="no-results"><slot name=pre-search></slot></div></div>`||""}<div class=${s({hide:!!this.showPreSearch||this.loading&&!this.alwaysShowContent||!this.loading&&this.noResults||this.initialHide,"results-wrapper--spaced":this.hideContentTop,"results-wrapper":!0})}><slot name=content></slot></div><div class=${s({hide:this.loading||this.noResults&&!this.alwaysShowPagination})}><slot name=pagination></slot><slot name=content-end></slot></div></div></div></div><slot name=scroll-end></slot></div></div>`}};y("arcgis-portal-browser",f);return{a:C,b:I,c:f}},"core/reactiveUtils","intl","intl",a)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import d from"./YERFI6P2.js";import c from"./NDCMZLMU.js";import"./Y5VUMGKH.js";import"./VDXESPJK.js";import"./DAAON2UO.js";import b from"./TIPQ2ZWK.js";import a from"./IAK4F5SX.js";import"./4VLEUN7I.js";import"./KV4ZZSNW.js";import"./FN2QMDEW.js";import"./AYHYABMC.js";import"./OQ3OHDEB.js";import"./I57CRKF7.js";import{Q as e,v as r}from"./3ZC26CT6.js";import"./OUMTV5H5.js";import"./5PV2GUZW.js";export default $arcgis.t(([,,,a])=>{var t=class extends a{constructor(){super(),this.allowEdit=!1,this.arcgisItemShareSummaryRequest=r(),this.listen("arcgisInternalShareSummaryActivate",this.requestSharing)}static{this.properties={allowEdit:5}}requestSharing(){this.allowEdit&&this.item&&this.portal&&this.arcgisItemShareSummaryRequest.emit({item:this.item,portal:this.portal})}};e("arcgis-portal-item-share-summary-editable",t);return t},a,b,c,d)
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{_a as a}from"./UUITDWRA.js";import"./5PV2GUZW.js";async function c(e,i,o){if(o===void 0)throw new Error(["Unable to dispatch a custom event without a parent run id.",'"dispatchCustomEvent" can only be called from within an existing run (e.g.,',"inside a tool or a RunnableLambda).",`
2
+ import{_a as a}from"./XYT4533U.js";import"./5PV2GUZW.js";async function c(e,i,o){if(o===void 0)throw new Error(["Unable to dispatch a custom event without a parent run id.",'"dispatchCustomEvent" can only be called from within an existing run (e.g.,',"inside a tool or a RunnableLambda).",`
3
3
 
4
4
  If you continue to see this error, please import from "@langchain/core/callbacks/dispatch/web"`,"and explicitly pass in a config parameter.",`
5
5
 
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{$ as ec,Aa as mc,B as La,Ba as dc,C as Ua,D as Ha,Da as gc,E as kn,F as Ba,G as Zs,H as G,I as En,J as $t,K as Cn,L as Be,M as Ga,N as Wa,O as Ka,P as qa,Q as za,R as Ja,V as Ya,W as Xa,Y as Qa,Z as Za,_ as ei,aa as tc,ba as rc,c as Oa,ca as ti,da as nc,ea as sc,f as nr,g as Xs,ga as ic,h as ge,ha as oc,i as Rr,j as Na,k as sr,l as Pa,la as ac,o as Qs,p as Ra,pa as cc,qa as xn,ra as lc,s as Ma,t as st,ta as uc,u as ja,ua as ir,v as Da,va as hc,w as $a,x as Va,xa as pc,y as Fa,ya as ri,z as Mr,za as fc}from"./V5PD3E3W.js";import{$ as Zt,$a as ke,Aa as Nr,Ba as Pr,Ca as _a,D as Ws,Ea as Js,F as Oe,Fa as ya,G as Ks,H as fa,Ha as wa,Ia as ba,J as Dt,La as yt,M as ma,Na as va,O as da,Oa as Sa,P as vn,Pa as tr,Qa as ka,Sa as Ea,Ta as Ca,Ua as xa,V as qs,Va as Ta,Wa as rr,Xa as Ys,Y as Q,Ya as Z,Za as Ia,a as O,aa as zs,ab as Aa,bb as nt,e as aa,f as ca,g as la,h as ua,i as ha,ia as _t,j as pa,k as Ae,ma as er,na as Sn,sa as Ne,x as X,za as ga}from"./UUITDWRA.js";import{o as wt}from"./K3GAZFRI.js";function _c(e,t){if(e!=null){if(typeof e!="number"||Number.isNaN(e)||e<=0)throw new Error(`${t} must be greater than 0`);return e}}function bt(e){if(e==null)return;let t=typeof e=="number"?{runTimeout:e}:e,r=t.refreshOn??"auto";if(r!=="auto"&&r!=="heartbeat")throw new Error('refreshOn must be "auto" or "heartbeat"');let n=_c(t.runTimeout,"runTimeout"),s=_c(t.idleTimeout,"idleTimeout");if(!(n===void 0&&s===void 0))return{runTimeout:n,idleTimeout:s,refreshOn:r}}var W="__start__",K="__end__",We="__input__";var vt="__error__",Dr="__error_source_node__",Tn="__pregel_ns_writes";function yc(){let e=typeof process<"u"?process.env?.LANGGRAPH_DELTA_MAX_SUPERSTEPS_SINCE_SNAPSHOT:void 0;if(e!==void 0&&e!==""){let t=Number.parseInt(e,10);if(Number.isFinite(t)&&t>0)return t}return 5e3}var oe="__pregel_send",Ke="__pregel_call",le="__pregel_read",Ee="__pregel_checkpointer",Ft="__pregel_resuming",or="__pregel_task_id",$r="__pregel_stream",Lh="__pregel_resume_value",Lt="__pregel_resume_map",ue="__pregel_scratchpad",St="__pregel_previous",Uh="__pregel_durability",kt="checkpoint_id",ve="checkpoint_ns",wc="__pregel_node_finished",Vr="__pregel_node_error",ae="checkpoint_map",In="__pregel_replay_state",bc="__pregel_abort_signals",L="__interrupt__",he="__resume__",Fr="__no_writes__",Et="__return__",Ct="__previous__",z="langsmith:hidden";var si="__self__",qe="__pregel_tasks",pe="__pregel_push",An="__pregel_pull",fe="00000000-0000-0000-0000-000000000000",vc=[z,We,L,he,vt,Dr,Fr,oe,le,Ee,Uh,$r,Ft,or,Ke,Lh,ue,St,ae,ve,kt,In],ni=Symbol.for("langgraph.command"),Sc=class{[ni];constructor(e){this[ni]=e}};function On(e){let t=e;return t!=null&&typeof t.node=="string"&&t.args!==void 0}var Vt=class{lg_name="Send";node;args;timeout;constructor(e,t,r){this.node=e,this.args=jr(t),this.timeout=bt(r?.timeout)}toJSON(){return{lg_name:this.lg_name,node:this.node,args:this.args,timeout:this.timeout}}};function ee(e){return e instanceof Vt}var Ge="__overwrite__",Hh=class{lg_name="Overwrite";[Ge];constructor(e){this[Ge]=e}get value(){return this[Ge]}toJSON(){return{[Ge]:this[Ge]}}static isInstance(e){return!e||typeof e!="object"?!1:"__overwrite__"in e||"lg_name"in e&&e.lg_name==="Overwrite"}};function Pe(e){if(typeof e=="object"&&e!==null){if("__overwrite__"in e)return[!0,e[Ge]];let t=e;if(t.type==="__overwrite__"&&"value"in t)return[!0,t.value]}return[!1,void 0]}function Ut(e){return Pe(e)[0]}function Ht(e){return!e||typeof e!="object"||!("__interrupt__"in e)?!1:Array.isArray(e[L])}var _e=class extends Sc{lg_name="Command";lc_direct_tool_output=!0;graph;update;resume;goto=[];static PARENT="__parent__";constructor(e){super(e),this.resume=e.resume,this.graph=e.graph,this.update=e.update,e.goto&&(this.goto=Array.isArray(e.goto)?jr(e.goto):[jr(e.goto)])}_updateAsTuples(){return this.update&&typeof this.update=="object"&&!Array.isArray(this.update)?Object.entries(this.update):Array.isArray(this.update)&&this.update.every(e=>Array.isArray(e)&&e.length===2&&typeof e[0]=="string")?this.update:[["__root__",this.update]]}toJSON(){let e;return typeof this.goto=="string"?e=this.goto:ee(this.goto)?e=this.goto.toJSON():e=this.goto?.map(t=>typeof t=="string"?t:t.toJSON()),{lg_name:this.lg_name,update:this.update,resume:this.resume,goto:e}}};function ne(e){return typeof e!="object"||e==null?!1:"lg_name"in e&&e.lg_name==="Command"}function Bh(e){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function jr(e,t=new Map){if(e!=null&&typeof e=="object"){if(t.has(e))return t.get(e);let r;if(Array.isArray(e))r=[],t.set(e,r),e.forEach((n,s)=>{r[s]=jr(n,t)});else if(e instanceof _e||e instanceof Vt||!Bh(e))r=e,t.set(e,r);else if(ne(e))r=new _e(e),t.set(e,r);else if(On(e))r=new Vt(e.node,e.args,e.timeout!==void 0?{timeout:e.timeout}:void 0),t.set(e,r);else if("lc_serializable"in e&&e.lc_serializable)r=e,t.set(e,r);else{r={},t.set(e,r);for(let[n,s]of Object.entries(e))r[n]=jr(s,t)}return r}return e}var Ce=class extends Error{lc_error_code;constructor(e,t){let r=e??"";t?.lc_error_code&&(r=`${r}
2
+ import{$ as ec,Aa as mc,B as La,Ba as dc,C as Ua,D as Ha,Da as gc,E as kn,F as Ba,G as Zs,H as G,I as En,J as $t,K as Cn,L as Be,M as Ga,N as Wa,O as Ka,P as qa,Q as za,R as Ja,V as Ya,W as Xa,Y as Qa,Z as Za,_ as ei,aa as tc,ba as rc,c as Oa,ca as ti,da as nc,ea as sc,f as nr,g as Xs,ga as ic,h as ge,ha as oc,i as Rr,j as Na,k as sr,l as Pa,la as ac,o as Qs,p as Ra,pa as cc,qa as xn,ra as lc,s as Ma,t as st,ta as uc,u as ja,ua as ir,v as Da,va as hc,w as $a,x as Va,xa as pc,y as Fa,ya as ri,z as Mr,za as fc}from"./5D5INKHG.js";import{$ as Zt,$a as ke,Aa as Nr,Ba as Pr,Ca as _a,D as Ws,Ea as Js,F as Oe,Fa as ya,G as Ks,H as fa,Ha as wa,Ia as ba,J as Dt,La as yt,M as ma,Na as va,O as da,Oa as Sa,P as vn,Pa as tr,Qa as ka,Sa as Ea,Ta as Ca,Ua as xa,V as qs,Va as Ta,Wa as rr,Xa as Ys,Y as Q,Ya as Z,Za as Ia,a as O,aa as zs,ab as Aa,bb as nt,e as aa,f as ca,g as la,h as ua,i as ha,ia as _t,j as pa,k as Ae,ma as er,na as Sn,sa as Ne,x as X,za as ga}from"./XYT4533U.js";import{o as wt}from"./K3GAZFRI.js";function _c(e,t){if(e!=null){if(typeof e!="number"||Number.isNaN(e)||e<=0)throw new Error(`${t} must be greater than 0`);return e}}function bt(e){if(e==null)return;let t=typeof e=="number"?{runTimeout:e}:e,r=t.refreshOn??"auto";if(r!=="auto"&&r!=="heartbeat")throw new Error('refreshOn must be "auto" or "heartbeat"');let n=_c(t.runTimeout,"runTimeout"),s=_c(t.idleTimeout,"idleTimeout");if(!(n===void 0&&s===void 0))return{runTimeout:n,idleTimeout:s,refreshOn:r}}var W="__start__",K="__end__",We="__input__";var vt="__error__",Dr="__error_source_node__",Tn="__pregel_ns_writes";function yc(){let e=typeof process<"u"?process.env?.LANGGRAPH_DELTA_MAX_SUPERSTEPS_SINCE_SNAPSHOT:void 0;if(e!==void 0&&e!==""){let t=Number.parseInt(e,10);if(Number.isFinite(t)&&t>0)return t}return 5e3}var oe="__pregel_send",Ke="__pregel_call",le="__pregel_read",Ee="__pregel_checkpointer",Ft="__pregel_resuming",or="__pregel_task_id",$r="__pregel_stream",Lh="__pregel_resume_value",Lt="__pregel_resume_map",ue="__pregel_scratchpad",St="__pregel_previous",Uh="__pregel_durability",kt="checkpoint_id",ve="checkpoint_ns",wc="__pregel_node_finished",Vr="__pregel_node_error",ae="checkpoint_map",In="__pregel_replay_state",bc="__pregel_abort_signals",L="__interrupt__",he="__resume__",Fr="__no_writes__",Et="__return__",Ct="__previous__",z="langsmith:hidden";var si="__self__",qe="__pregel_tasks",pe="__pregel_push",An="__pregel_pull",fe="00000000-0000-0000-0000-000000000000",vc=[z,We,L,he,vt,Dr,Fr,oe,le,Ee,Uh,$r,Ft,or,Ke,Lh,ue,St,ae,ve,kt,In],ni=Symbol.for("langgraph.command"),Sc=class{[ni];constructor(e){this[ni]=e}};function On(e){let t=e;return t!=null&&typeof t.node=="string"&&t.args!==void 0}var Vt=class{lg_name="Send";node;args;timeout;constructor(e,t,r){this.node=e,this.args=jr(t),this.timeout=bt(r?.timeout)}toJSON(){return{lg_name:this.lg_name,node:this.node,args:this.args,timeout:this.timeout}}};function ee(e){return e instanceof Vt}var Ge="__overwrite__",Hh=class{lg_name="Overwrite";[Ge];constructor(e){this[Ge]=e}get value(){return this[Ge]}toJSON(){return{[Ge]:this[Ge]}}static isInstance(e){return!e||typeof e!="object"?!1:"__overwrite__"in e||"lg_name"in e&&e.lg_name==="Overwrite"}};function Pe(e){if(typeof e=="object"&&e!==null){if("__overwrite__"in e)return[!0,e[Ge]];let t=e;if(t.type==="__overwrite__"&&"value"in t)return[!0,t.value]}return[!1,void 0]}function Ut(e){return Pe(e)[0]}function Ht(e){return!e||typeof e!="object"||!("__interrupt__"in e)?!1:Array.isArray(e[L])}var _e=class extends Sc{lg_name="Command";lc_direct_tool_output=!0;graph;update;resume;goto=[];static PARENT="__parent__";constructor(e){super(e),this.resume=e.resume,this.graph=e.graph,this.update=e.update,e.goto&&(this.goto=Array.isArray(e.goto)?jr(e.goto):[jr(e.goto)])}_updateAsTuples(){return this.update&&typeof this.update=="object"&&!Array.isArray(this.update)?Object.entries(this.update):Array.isArray(this.update)&&this.update.every(e=>Array.isArray(e)&&e.length===2&&typeof e[0]=="string")?this.update:[["__root__",this.update]]}toJSON(){let e;return typeof this.goto=="string"?e=this.goto:ee(this.goto)?e=this.goto.toJSON():e=this.goto?.map(t=>typeof t=="string"?t:t.toJSON()),{lg_name:this.lg_name,update:this.update,resume:this.resume,goto:e}}};function ne(e){return typeof e!="object"||e==null?!1:"lg_name"in e&&e.lg_name==="Command"}function Bh(e){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function jr(e,t=new Map){if(e!=null&&typeof e=="object"){if(t.has(e))return t.get(e);let r;if(Array.isArray(e))r=[],t.set(e,r),e.forEach((n,s)=>{r[s]=jr(n,t)});else if(e instanceof _e||e instanceof Vt||!Bh(e))r=e,t.set(e,r);else if(ne(e))r=new _e(e),t.set(e,r);else if(On(e))r=new Vt(e.node,e.args,e.timeout!==void 0?{timeout:e.timeout}:void 0),t.set(e,r);else if("lc_serializable"in e&&e.lc_serializable)r=e,t.set(e,r);else{r={},t.set(e,r);for(let[n,s]of Object.entries(e))r[n]=jr(s,t)}return r}return e}var Ce=class extends Error{lc_error_code;constructor(e,t){let r=e??"";t?.lc_error_code&&(r=`${r}
3
3
 
4
4
  Troubleshooting URL: https://docs.langchain.com/oss/javascript/langgraph/${t.lc_error_code}/
5
5
  `),super(r),this.lc_error_code=t?.lc_error_code}},Nn=class extends Ce{get is_bubble_up(){return!0}},ii=class extends Ce{constructor(e,t){super(e,t),this.name="GraphRecursionError"}static get unminifiable_name(){return"GraphRecursionError"}},Bt=class extends Ce{constructor(e,t){super(e,t),this.name="GraphValueError"}static get unminifiable_name(){return"GraphValueError"}},Pn=class extends Nn{reason;constructor(e="shutdown",t){super(`Graph drained: ${e}`,t),this.name="GraphDrained",this.reason=e}static get unminifiable_name(){return"GraphDrained"}};function Rn(e){return e!==void 0&&e.name===Pn.unminifiable_name}var it=class extends Nn{interrupts;constructor(e,t){super(JSON.stringify(e,null,2),t),this.name="GraphInterrupt",this.interrupts=e??[]}static get unminifiable_name(){return"GraphInterrupt"}},Mn=class extends it{constructor(e,t){super([{value:e}],t),this.name="NodeInterrupt"}static get unminifiable_name(){return"NodeInterrupt"}},jn=class{node;error;constructor(e,t){this.node=e,this.error=t}static get unminifiable_name(){return"NodeError"}};function Gh(e){return e!=null&&typeof e=="object"&&e.constructor!=null&&e.constructor.unminifiable_name===jn.unminifiable_name}var Dn=class extends Nn{command;constructor(e){super(),this.name="ParentCommand",this.command=e}static get unminifiable_name(){return"ParentCommand"}};function oi(e){return e!==void 0&&e.name===Dn.unminifiable_name}function xt(e){return e!==void 0&&e.is_bubble_up===!0}function ot(e){return e!==void 0&&[it.unminifiable_name,Mn.unminifiable_name].includes(e.name)}var $n=class extends Ce{node;kind;timeout;elapsed;runTimeout;idleTimeout;constructor(e,t){let{node:r,elapsed:n,kind:s,runTimeout:i,idleTimeout:o}=e,a,c;if(s==="idle"){if(o===void 0)throw new Error("idleTimeout is required when kind='idle'");c=o,a=`Node "${r}" exceeded its idle timeout of ${o}ms without making progress (elapsed: ${n}ms).`}else{if(i===void 0)throw new Error("runTimeout is required when kind='run'");c=i,a=`Node "${r}" exceeded its run timeout of ${i}ms (elapsed: ${n}ms).`}super(a,t),this.name="NodeTimeoutError",this.node=r,this.kind=s,this.timeout=c,this.elapsed=n,this.runTimeout=i,this.idleTimeout=o}static get unminifiable_name(){return"NodeTimeoutError"}};function Wh(e){return e!==void 0&&e.name===$n.unminifiable_name}var Vn=class extends Ce{constructor(e,t){super(e,t),this.name="EmptyInputError"}static get unminifiable_name(){return"EmptyInputError"}},$=class extends Ce{constructor(e,t){let r=Error.stackTraceLimit;Error.stackTraceLimit=0,super(e,t),Error.stackTraceLimit=r,this.name="EmptyChannelError"}static get unminifiable_name(){return"EmptyChannelError"}},R=class extends Ce{constructor(e,t){super(e,t),this.name="InvalidUpdateError"}static get unminifiable_name(){return"InvalidUpdateError"}},Kh=class extends Ce{constructor(e,t){super(e,t),this.name="MultipleSubgraphError"}static get unminifiable_name(){return"MultipleSubgraphError"}},ai=class extends Ce{constructor(e,t){super(e,t),this.name="UnreachableNodeError"}static get unminifiable_name(){return"UnreachableNodeError"}},qh=class extends Ce{constructor(e,t){super(e,t),this.name="RemoteException"}static get unminifiable_name(){return"RemoteException"}},Lr=class extends Ce{constructor(e,t){super(e,t),this.name="StateGraphInputError",this.message="Invalid StateGraph input. Make sure to pass a valid StateDefinition, Annotation.Root, or Zod schema."}static get unminifiable_name(){return"StateGraphInputError"}},zh=()=>(globalThis[Symbol.for("LG_CHECKPOINT_SEEN_NS_SET")]===void 0&&(globalThis[Symbol.for("LG_CHECKPOINT_SEEN_NS_SET")]=new Set),globalThis[Symbol.for("LG_CHECKPOINT_SEEN_NS_SET")]);var ci=0,Ur=0;function Hr(e){let t=Date.now();return t<=ci?(Ur+=1,Ur>=1e4&&(Ur=0,t=ci+1)):Ur=0,ci=t,_a({clockseq:e,msecs:t,nsecs:Ur})}function ze(e,t){let r=t.replace(/-/g,"").match(/.{2}/g).map(n=>parseInt(n,16));return Pr(e,new Uint8Array(r))}var Br="__pregel_tasks",li="__error__",Gt="__scheduled__",ui="__interrupt__",hi="__resume__",ar=class{lg_name="DeltaSnapshot";value;constructor(e){this.value=e}};function pi(e){return e!=null&&typeof e=="object"&&e.lg_name==="DeltaSnapshot"}var kc="[...]",Jh="[Circular]",Fn=[],cr=[];function Yh(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function Ec(e,t,r,n){typeof n>"u"&&(n=Yh()),mi(e,"",0,[],void 0,0,n);var s;try{cr.length===0?s=JSON.stringify(e,t,r):s=JSON.stringify(e,Xh(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Fn.length!==0;){var i=Fn.pop();i.length===4?Object.defineProperty(i[0],i[1],i[3]):i[0][i[1]]=i[2]}}return s}function fi(e,t,r,n){var s=Object.getOwnPropertyDescriptor(n,r);s.get!==void 0?s.configurable?(Object.defineProperty(n,r,{value:e}),Fn.push([n,r,t,s])):cr.push([t,r,e]):(n[r]=e,Fn.push([n,r,t]))}function mi(e,t,r,n,s,i,o){i+=1;var a;if(typeof e=="object"&&e!==null){for(a=0;a<n.length;a++)if(n[a]===e){fi(Jh,e,t,s);return}if(typeof o.depthLimit<"u"&&i>o.depthLimit){fi(kc,e,t,s);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){fi(kc,e,t,s);return}if(n.push(e),Array.isArray(e))for(a=0;a<e.length;a++)mi(e[a],a,a,n,e,i,o);else{var c=Object.keys(e);for(a=0;a<c.length;a++){var l=c[a];mi(e[l],l,a,n,e,i,o)}}n.pop()}}function Xh(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(cr.length>0)for(var n=0;n<cr.length;n++){var s=cr[n];if(s[1]===t&&s[0]===r){r=s[2],cr.splice(n,1);break}}return e.call(this,t,r)}}var Cc=[];var xc=O({});var Tc=O({});var Ic=O({BaseChatMessageHistory:()=>di,BaseListChatMessageHistory:()=>Ln,InMemoryChatMessageHistory:()=>Qh}),di=class extends Ae{async addMessages(e){for(let t of e)await this.addMessage(t)}},Ln=class extends Ae{addUserMessage(e){return this.addMessage(new _t(e))}addAIMessage(e){return this.addMessage(new Q(e))}async addMessages(e){for(let t of e)await this.addMessage(t)}clear(){throw new Error("Not implemented.")}},Qh=class extends Ln{lc_namespace=["langchain","stores","message","in_memory"];messages=[];constructor(e){super(...arguments),this.messages=e??[]}async getMessages(){return this.messages}async addMessage(e){this.messages.push(e)}async clear(){this.messages=[]}};var Se=class{pageContent;metadata;id;constructor(e){this.pageContent=e.pageContent!==void 0?e.pageContent.toString():"",this.metadata=e.metadata??{},this.id=e.id}};var gi=class extends G{lc_namespace=["langchain_core","documents","transformers"];invoke(e,t){return this.transformDocuments(e)}},Ac=class extends gi{async transformDocuments(e){let t=[];for(let r of e){let n=await this._transformDocument(r);t.push(n)}return t}};var Oc=O({BaseDocumentTransformer:()=>gi,Document:()=>Se,MappingDocumentTransformer:()=>Ac});var Nc=O({BaseDocumentLoader:()=>_i}),_i=class{};var Pc=O({LangSmithLoader:()=>Zh}),Zh=class extends _i{datasetId;datasetName;exampleIds;asOf;splits;inlineS3Urls;offset;limit;metadata;filter;contentKey;formatContent;client;constructor(e){if(super(),e.client&&e.clientConfig)throw new Error("client and clientConfig cannot both be provided.");this.client=e.client??new va(e?.clientConfig),this.contentKey=e.contentKey?e.contentKey.split("."):[],this.formatContent=e.formatContent??ep,this.datasetId=e.datasetId,this.datasetName=e.datasetName,this.exampleIds=e.exampleIds,this.asOf=e.asOf,this.splits=e.splits,this.inlineS3Urls=e.inlineS3Urls,this.offset=e.offset,this.limit=e.limit,this.metadata=e.metadata,this.filter=e.filter}async load(){let e=[];for await(let t of this.client.listExamples({datasetId:this.datasetId,datasetName:this.datasetName,exampleIds:this.exampleIds,asOf:this.asOf,splits:this.splits,inlineS3Urls:this.inlineS3Urls,offset:this.offset,limit:this.limit,metadata:this.metadata,filter:this.filter})){let r=t.inputs;for(let i of this.contentKey)r=r[i];let n=this.formatContent(r),s=t;["created_at","modified_at"].forEach(i=>{i in s&&typeof s[i]=="object"&&(s[i]=s[i].toString())}),e.push({pageContent:n,metadata:s})}return e}};function ep(e){if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}var lr=class extends Ae{lc_namespace=["langchain_core","example_selectors","base"]};var yi=class{async getPromptAsync(e,t){return this.getPrompt(e).partial(t?.partialVariables??{})}},Rc=class extends yi{defaultPrompt;conditionals;constructor(e,t=[]){super(),this.defaultPrompt=e,this.conditionals=t}getPrompt(e){for(let[t,r]of this.conditionals)if(t(e))return r;return this.defaultPrompt}};function Mc(e){return e._modelType()==="base_llm"}function jc(e){return e._modelType()==="base_chat_model"}function Dc(e){return e.split(/\n| /).length}var $c=class Vc extends lr{examples=[];examplePrompt;getTextLength=Dc;maxLength=2048;exampleTextLengths=[];constructor(t){super(t),this.examplePrompt=t.examplePrompt,this.maxLength=t.maxLength??2048,this.getTextLength=t.getTextLength??Dc}async addExample(t){this.examples.push(t);let r=await this.examplePrompt.format(t);this.exampleTextLengths.push(this.getTextLength(r))}async calculateExampleTextLengths(t,r){if(t.length>0)return t;let{examples:n,examplePrompt:s}=r;return(await Promise.all(n.map(i=>s.format(i)))).map(i=>this.getTextLength(i))}async selectExamples(t){let r=Object.values(t).join(" "),n=this.maxLength-this.getTextLength(r),s=0,i=[];for(;n>0&&s<this.examples.length;){let o=n-this.exampleTextLengths[s];if(o<0)break;i.push(this.examples[s]),n=o,s+=1}return i}static async fromExamples(t,r){let n=new Vc(r);return await Promise.all(t.map(s=>n.addExample(s))),n}};function wi(e){return Object.keys(e).sort().map(t=>e[t])}var Fc=class Lc extends lr{vectorStoreRetriever;exampleKeys;inputKeys;constructor(t){if(super(t),this.exampleKeys=t.exampleKeys,this.inputKeys=t.inputKeys,t.vectorStore!==void 0)this.vectorStoreRetriever=t.vectorStore.asRetriever({k:t.k??4,filter:t.filter});else if(t.vectorStoreRetriever)this.vectorStoreRetriever=t.vectorStoreRetriever;else throw new Error('You must specify one of "vectorStore" and "vectorStoreRetriever".')}async addExample(t){let r=wi((this.inputKeys??Object.keys(t)).reduce((n,s)=>({...n,[s]:t[s]}),{})).join(" ");await this.vectorStoreRetriever.addDocuments([new Se({pageContent:r,metadata:t})])}async selectExamples(t){let r=wi((this.inputKeys??Object.keys(t)).reduce((s,i)=>({...s,[i]:t[i]}),{})).join(" "),n=(await this.vectorStoreRetriever.invoke(r)).map(s=>s.metadata);return this.exampleKeys?n.map(s=>this.exampleKeys.reduce((i,o)=>({...i,[o]:s[o]}),{})):n}static async fromExamples(t,r,n,s={}){let i=s.inputKeys??null,o=t.map(c=>wi(i?i.reduce((l,u)=>({...l,[u]:c[u]}),{}):c).join(" ")),a=await n.fromTexts(o,t,r,s);return new Lc({vectorStore:a,k:s.k??4,exampleKeys:s.exampleKeys,inputKeys:s.inputKeys})}};var Uc=O({BaseExampleSelector:()=>lr,BasePromptSelector:()=>yi,ConditionalPromptSelector:()=>Rc,LengthBasedExampleSelector:()=>$c,SemanticSimilarityExampleSelector:()=>Fc,isChatModel:()=>jc,isLLM:()=>Mc});var Gr="10f90ea3-90a4-4962-bf75-83a0f3c1c62a",Hc=class extends Ae{lc_namespace=["langchain","recordmanagers"]};var bi=class{uid;hash_;contentHash;metadataHash;pageContent;metadata;keyEncoder=ja;constructor(e){this.uid=e.uid,this.pageContent=e.pageContent,this.metadata=e.metadata}makeDefaultKeyEncoder(e){this.keyEncoder=e}calculateHashes(){let e=["hash_","content_hash","metadata_hash"];for(let r of e)if(r in this.metadata)throw new Error(`Metadata cannot contain key ${r} as it is reserved for internal use. Restricted keys: [${e.join(", ")}]`);let t=this._hashStringToUUID(this.pageContent);try{let r=this._hashNestedDictToUUID(this.metadata);this.contentHash=t,this.metadataHash=r}catch(r){throw new Error(`Failed to hash metadata: ${r}. Please use a dict that can be serialized using json.`)}this.hash_=this._hashStringToUUID(this.contentHash+this.metadataHash),this.uid||(this.uid=this.hash_)}toDocument(){return new Se({pageContent:this.pageContent,metadata:this.metadata})}static fromDocument(e,t){let r=new this({pageContent:e.pageContent,metadata:e.metadata,uid:t||e.uid});return r.calculateHashes(),r}_hashStringToUUID(e){return Pr(this.keyEncoder(e),Gr)}_hashNestedDictToUUID(e){let t=JSON.stringify(e,Object.keys(e).sort());return Pr(this.keyEncoder(t),Gr)}};function vi(e,t){let r=[],n=[];return t.forEach(s=>{n.push(s),n.length>=e&&(r.push(n),n=[])}),n.length>0&&r.push(n),r}function Si(e){let t=new Set,r=[];for(let n of e){if(!n.hash_)throw new Error("Hashed document does not have a hash");t.has(n.hash_)||(t.add(n.hash_),r.push(n))}return r}function ki(e){if(e===null)return t=>null;if(typeof e=="string")return t=>t.metadata[e];if(typeof e=="function")return e;throw new Error(`sourceIdKey should be null, a string or a function, got ${typeof e}`)}var Ei=e=>"load"in e&&typeof e.load=="function"&&"loadAndSplit"in e&&typeof e.loadAndSplit=="function";async function Bc(e){let{docsSource:t,recordManager:r,vectorStore:n,options:s}=e,{batchSize:i=100,cleanup:o,sourceIdKey:a,cleanupBatchSize:c=1e3,forceUpdate:l=!1}=s??{};if(o==="incremental"&&!a)throw new Error("sourceIdKey is required when cleanup mode is incremental. Please provide through 'options.sourceIdKey'.");let u=Ei(t)?await t.load():t,h=ki(a??null),p=await r.getTime(),f=0,m=0,d=0,_=0,g=vi(i??100,u);for(let y of g){let S=Si(y.map(x=>bi.fromDocument(x))),w=S.map(x=>h(x));o==="incremental"&&S.forEach((x,F)=>{if(w[F]===null)throw new Error("sourceIdKey must be provided when cleanup is incremental")});let C=await r.exists(S.map(x=>x.uid)),T=[],k=[],b=[],I=new Set;if(S.forEach((x,F)=>{if(C[F])if(l)I.add(x.uid);else{b.push(x.uid);return}T.push(x.uid),k.push(x.toDocument())}),b.length>0&&(await r.update(b,{timeAtLeast:p}),_+=b.length),k.length>0&&(await n.addDocuments(k,{ids:T}),f+=k.length-I.size,d+=I.size),await r.update(S.map(x=>x.uid),{timeAtLeast:p,groupIds:w}),o==="incremental"){w.forEach(F=>{if(!F)throw new Error("Source id cannot be null")});let x=await r.listKeys({before:p,groupIds:w});x.length>0&&(await n.delete({ids:x}),await r.deleteKeys(x),m+=x.length)}}if(o==="full"){let y=await r.listKeys({before:p,limit:c});for(;y.length>0;)await n.delete({ids:y}),await r.deleteKeys(y),m+=y.length,y=await r.listKeys({before:p,limit:c})}return{numAdded:f,numDeleted:m,numUpdated:d,numSkipped:_}}var Gc=O({RecordManager:()=>Hc,UUIDV5_NAMESPACE:()=>Gr,_HashedDocument:()=>bi,_batch:()=>vi,_deduplicateInOrder:()=>Si,_getSourceIdAssigner:()=>ki,_isBaseDocumentLoader:()=>Ei,index:()=>Bc});var Wc=O({});var Kc=O({});var qc=O({BaseMemory:()=>tp,getInputValue:()=>rp,getOutputValue:()=>np,getPromptInputKey:()=>sp}),tp=class{},zc=(e,t)=>{if(t!==void 0)return e[t];let r=Object.keys(e);if(r.length===1)return e[r[0]]},rp=(e,t)=>{let r=zc(e,t);if(!r){let n=Object.keys(e);throw new Error(`input values have ${n.length} keys, you must specify an input key or pass only 1 key as input`)}return r},np=(e,t)=>{let r=zc(e,t);if(!r&&r!==""){let n=Object.keys(e);throw new Error(`output values have ${n.length} keys, you must specify an output key or pass only 1 key as output`)}return r};function sp(e,t){let r=Object.keys(e).filter(n=>!t.includes(n)&&n!=="stop");if(r.length!==1)throw new Error(`One input key expected, but got ${r.length}`);return r[0]}var Ci=class extends ti{static lc_name(){return"OutputFunctionsParser"}lc_namespace=["langchain","output_parsers","openai_functions"];lc_serializable=!0;argsOnly=!0;constructor(e){super(),this.argsOnly=e?.argsOnly??this.argsOnly}async parseResult(e){if("message"in e[0]){let t=e[0].message.additional_kwargs.function_call;if(!t)throw new Error(`No function_call in message ${JSON.stringify(e)}`);if(!t.arguments)throw new Error(`No arguments in function_call ${JSON.stringify(e)}`);return this.argsOnly?t.arguments:JSON.stringify(t)}else throw new Error(`No message in generations ${JSON.stringify(e)}`)}},xi=class extends sc{static lc_name(){return"JsonOutputFunctionsParser"}lc_namespace=["langchain","output_parsers","openai_functions"];lc_serializable=!0;outputParser;argsOnly=!0;constructor(e){super(e),this.argsOnly=e?.argsOnly??this.argsOnly,this.outputParser=new Ci(e)}_diff(e,t){if(t)return La(e??{},t)}async parsePartialResult(e){let t=e[0];if(!t.message)return;let{message:r}=t,n=r.additional_kwargs.function_call;if(n)return this.argsOnly?qs(n.arguments):{...n,arguments:qs(n.arguments)}}async parseResult(e){let t=await this.outputParser.parseResult(e);if(!t)throw new Error(`No result from "OutputFunctionsParser" ${JSON.stringify(e)}`);return this.parse(t)}async parse(e){let t=JSON.parse(e);return this.argsOnly||(t.arguments=JSON.parse(t.arguments)),t}getFormatInstructions(){return""}},Jc=class extends ti{static lc_name(){return"JsonKeyOutputFunctionsParser"}lc_namespace=["langchain","output_parsers","openai_functions"];lc_serializable=!0;outputParser=new xi;attrName;get lc_aliases(){return{attrName:"key_name"}}constructor(e){super(e),this.attrName=e.attrName}async parseResult(e){return(await this.outputParser.parseResult(e))[this.attrName]}};var Yc=O({JsonKeyOutputFunctionsParser:()=>Jc,JsonOutputFunctionsParser:()=>xi,OutputFunctionsParser:()=>Ci});var Je=class extends G{lc_serializable=!0;lc_namespace=["langchain_core","prompts",this._getPromptType()];get lc_attributes(){return{partialVariables:void 0}}inputVariables;outputParser;partialVariables;metadata;tags;constructor(e){super(e);let{inputVariables:t}=e;if(t.includes("stop"))throw new Error("Cannot have an input variable named 'stop', as it is used internally, please rename.");Object.assign(this,e)}async mergePartialAndUserVariables(e){let t=this.partialVariables??{},r={};for(let[n,s]of Object.entries(t))typeof s=="string"?r[n]=s:r[n]=await s();return{...r,...e}}async invoke(e,t){let r={...this.metadata,...t?.metadata},n=[...this.tags??[],...t?.tags??[]];return this._callWithConfig(s=>this.formatPromptValue(s),e,{...t,tags:n,metadata:r,runType:"prompt"})}};var at=class extends Je{async formatPromptValue(e){return new Wa(await this.format(e))}};var ip=Object.prototype.toString,hr=Array.isArray||function(t){return ip.call(t)==="[object Array]"};function Ii(e){return typeof e=="function"}function op(e){return hr(e)?"array":typeof e}function Ti(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Xc(e,t){return e!=null&&typeof e=="object"&&t in e}function ap(e,t){return e!=null&&typeof e!="object"&&e.hasOwnProperty&&e.hasOwnProperty(t)}var cp=RegExp.prototype.test;function lp(e,t){return cp.call(e,t)}var up=/\S/;function hp(e){return!lp(up,e)}var pp={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function fp(e){return String(e).replace(/[&<>"'`=\/]/g,function(r){return pp[r]})}var mp=/\s*/,dp=/\s+/,Qc=/\s*=/,gp=/\s*\}/,_p=/#|\^|\/|>|\{|&|=|!/;function yp(e,t){if(!e)return[];var r=!1,n=[],s=[],i=[],o=!1,a=!1,c="",l=0;function u(){if(o&&!a)for(;i.length;)delete s[i.pop()];else i=[];o=!1,a=!1}var h,p,f;function m(b){if(typeof b=="string"&&(b=b.split(dp,2)),!hr(b)||b.length!==2)throw new Error("Invalid tags: "+b);h=new RegExp(Ti(b[0])+"\\s*"),p=new RegExp("\\s*"+Ti(b[1])),f=new RegExp("\\s*"+Ti("}"+b[1]))}m(t||xe.tags);for(var d=new Kr(e),_,g,y,S,w,C;!d.eos();){if(_=d.pos,y=d.scanUntil(h),y)for(var T=0,k=y.length;T<k;++T)S=y.charAt(T),hp(S)?(i.push(s.length),c+=S):(a=!0,r=!0,c+=" "),s.push(["text",S,_,_+1]),_+=1,S===`
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import a from"./7HOK3ICE.js";import"./4QYVBXZT.js";import"./KV4ZZSNW.js";import"./2FKNF2ZK.js";import"./AYHYABMC.js";import"./OQ3OHDEB.js";import"./I57CRKF7.js";import"./3ZC26CT6.js";import"./OUMTV5H5.js";import"./5PV2GUZW.js";export default $arcgis.t(([a])=>{return a},a)
2
+ import a from"./TRFH3KNJ.js";import"./4QYVBXZT.js";import"./KV4ZZSNW.js";import"./FN2QMDEW.js";import"./AYHYABMC.js";import"./OQ3OHDEB.js";import"./I57CRKF7.js";import"./3ZC26CT6.js";import"./OUMTV5H5.js";import"./5PV2GUZW.js";export default $arcgis.t(([a])=>{return a},a)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{a as i}from"./H7DF6TTK.js";export default $arcgis.t(([a])=>{function w(e,t){return`${i(t)}content/items/${e}`}function g(e){return e.typeKeywords?.includes("Hosted Service")&&e.type!=="Insights Workbook"&&e.type!=="Insights Data Engineering Workbook"&&e.type!=="Insights Page"}function h(e){return e.typeKeywords?.includes("View Service")}function v(e){return e.typeKeywords?.includes("Service Proxy")&&e.typeKeywords.includes("Geocoding filter")}function P(e){return e.type==="Image Collection"&&e.typeKeywords?.includes("Photo locations")}function p(e){return e?.sourceType==="mosaic-dataset"||e?.serviceSourceType==="esriImageServiceSourceTypeMosaicDataset"}function I(e,t){return e.typeKeywords?.includes("Managed Image Collection")||p(t)&&!e.typeKeywords?.includes("Tiled Imagery")}function S(e,t){return!!((e.sourceJSON?.serviceProperties?.tags||e?.serviceProperties?.tags)?.includes("hasMultidimensions")||t?.hasMultidimensions)}function K(e,t){return c(e,t)||y(e,t)}function c(e,t){return e.owner===t.username}function y(e,t){let r=e.owner,n=e.itemControl==="admin",s=["esri_livingatlas","esri_demographics","esri_boundaries"];return e.portal?.isPortal&&!c(e,t)&&n&&r?.includes("esri_")&&!s.includes(r)?!1:n}var j=(e,t)=>!!t.orgId&&e.every(r=>r.isOrgItem);function k(e){return e.typeKeywords?.includes("Spatiotemporal")}function T(e){return e.typeKeywords?.includes("View Service")}function $(e){return e.typeKeywords?.includes("Hosted Service")}function b(e){return e.typeKeywords?.includes("Multi Services View")}function M(e){return e?.hasViews&&!e.sourceSchemaChangesAllowed}async function C(e){let t=e?.portalItem;if(!t)return await Promise.resolve(null);let r=t.portal;if(r?.user){let n=`${i(r)}community/users/${r.user.username}`;return await a(n,{query:{f:"json",token:t.portal.credential?.token},responseType:"json"}).then(async s=>{let o=s.data?.groups??[];return await Promise.resolve(o)},async()=>await Promise.reject(new Error("Failed to fetch user groups")))}return await Promise.resolve(null)}async function V(e){let t=e?.portalItem;if(!t)return await Promise.resolve(null);let r=t.portal,n=`${i(r)}content/items/${t.id}/groups`;return await a(n,{query:{f:"json",token:t.portal.credential?.token},responseType:"json"}).then(async s=>{let o=s.data?.admin??[],u=s.data?.member??[],l=s.data?.other??[],d=[...o,...u,...l];return await Promise.resolve(d)},async()=>await Promise.reject(new Error("Failed to fetch item groups")))}async function q(e,t,{relationshipType:r,direction:n},s=!1){let o=`${i(t)}content/items/${e}/relatedItems`;return await a(o,{query:{f:"json",relationshipType:r,direction:n,includeRecycleBin:s},responseType:"json"})}function _(e,t){return e?.some(r=>t?.some(n=>r.id===n.id&&r.capabilities.includes("updateitemcontrol")))}return{a:w,b:g,c:h,d:v,e:P,f:I,g:S,h:K,i:j,j:k,k:T,l:$,m:b,n:M,o:C,p:V,q:q,r:_}},"request")
2
+ import{a as i}from"./4VLEUN7I.js";export default $arcgis.t(([a])=>{function w(e,t){return`${i(t)}content/items/${e}`}function g(e){return e.typeKeywords?.includes("Hosted Service")&&e.type!=="Insights Workbook"&&e.type!=="Insights Data Engineering Workbook"&&e.type!=="Insights Page"}function h(e){return e.typeKeywords?.includes("View Service")}function v(e){return e.typeKeywords?.includes("Service Proxy")&&e.typeKeywords.includes("Geocoding filter")}function P(e){return e.type==="Image Collection"&&e.typeKeywords?.includes("Photo locations")}function p(e){return e?.sourceType==="mosaic-dataset"||e?.serviceSourceType==="esriImageServiceSourceTypeMosaicDataset"}function I(e,t){return e.typeKeywords?.includes("Managed Image Collection")||p(t)&&!e.typeKeywords?.includes("Tiled Imagery")}function S(e,t){return!!((e.sourceJSON?.serviceProperties?.tags||e?.serviceProperties?.tags)?.includes("hasMultidimensions")||t?.hasMultidimensions)}function K(e,t){return c(e,t)||y(e,t)}function c(e,t){return e.owner===t.username}function y(e,t){let r=e.owner,n=e.itemControl==="admin",s=["esri_livingatlas","esri_demographics","esri_boundaries"];return e.portal?.isPortal&&!c(e,t)&&n&&r?.includes("esri_")&&!s.includes(r)?!1:n}var j=(e,t)=>!!t.orgId&&e.every(r=>r.isOrgItem);function k(e){return e.typeKeywords?.includes("Spatiotemporal")}function T(e){return e.typeKeywords?.includes("View Service")}function $(e){return e.typeKeywords?.includes("Hosted Service")}function b(e){return e.typeKeywords?.includes("Multi Services View")}function M(e){return e?.hasViews&&!e.sourceSchemaChangesAllowed}async function C(e){let t=e?.portalItem;if(!t)return await Promise.resolve(null);let r=t.portal;if(r?.user){let n=`${i(r)}community/users/${r.user.username}`;return await a(n,{query:{f:"json",token:t.portal.credential?.token},responseType:"json"}).then(async s=>{let o=s.data?.groups??[];return await Promise.resolve(o)},async()=>await Promise.reject(new Error("Failed to fetch user groups")))}return await Promise.resolve(null)}async function V(e){let t=e?.portalItem;if(!t)return await Promise.resolve(null);let r=t.portal,n=`${i(r)}content/items/${t.id}/groups`;return await a(n,{query:{f:"json",token:t.portal.credential?.token},responseType:"json"}).then(async s=>{let o=s.data?.admin??[],u=s.data?.member??[],l=s.data?.other??[],d=[...o,...u,...l];return await Promise.resolve(d)},async()=>await Promise.reject(new Error("Failed to fetch item groups")))}async function q(e,t,{relationshipType:r,direction:n},s=!1){let o=`${i(t)}content/items/${e}/relatedItems`;return await a(o,{query:{f:"json",relationshipType:r,direction:n,includeRecycleBin:s},responseType:"json"})}function _(e,t){return e?.some(r=>t?.some(n=>r.id===n.id&&r.capabilities.includes("updateitemcontrol")))}return{a:w,b:g,c:h,d:v,e:P,f:I,g:S,h:K,i:j,j:k,k:T,l:$,m:b,n:M,o:C,p:V,q:q,r:_}},"request")
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import f from"./LY7NVMME.js";import e from"./I3ECBIYX.js";import d from"./SCRIVOPW.js";import"./UL3XBQUT.js";import"./4QYVBXZT.js";import"./4KTRAA2J.js";import"./PKA745KL.js";import"./VDXESPJK.js";import"./DAAON2UO.js";import c from"./MOE6L5RN.js";import b from"./TIPQ2ZWK.js";import"./57MT7FOI.js";import"./YTVLEHJT.js";import a from"./IAK4F5SX.js";import"./4VLEUN7I.js";import"./KV4ZZSNW.js";import"./FN2QMDEW.js";import"./AYHYABMC.js";import"./OQ3OHDEB.js";import"./I57CRKF7.js";import"./3ZC26CT6.js";import"./OUMTV5H5.js";import"./5PV2GUZW.js";export default $arcgis.t(([,,,,,{g:a}])=>{return a},a,b,c,d,e,f)