@esri/hub-web-components 0.37.0 → 0.37.2
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.
- package/dist/cdn/{LUYCD6XC.js → 3SHBZF4M.js} +1 -1
- package/dist/cdn/{WSZ646NX.js → 425VBETO.js} +1 -1
- package/dist/cdn/{DWHYYJWL.js → 77R2C3NY.js} +1 -1
- package/dist/cdn/{6KXJSY7Y.js → CP5CMZPK.js} +1 -1
- package/dist/cdn/{WYR6Q7EO.js → DEVEFEZB.js} +1 -1
- package/dist/cdn/{LYGNBPBU.js → DIAOUTLA.js} +1 -1
- package/dist/cdn/{QEFXV6RZ.js → G3DW5HI6.js} +1 -1
- package/dist/cdn/{I4SZ26IC.js → GTMYGR72.js} +1 -1
- package/dist/cdn/{CRYH3HP6.js → HSKNYFFN.js} +1 -1
- package/dist/cdn/{C43VMDWA.js → IV7AWQ4I.js} +1 -1
- package/dist/cdn/{QSJ7YSO6.js → JEQW7KPC.js} +1 -1
- package/dist/cdn/M3ZUOUC3.js +6 -0
- package/dist/cdn/{KOIXC3C5.js → MKMW2OIY.js} +1 -1
- package/dist/cdn/{IZFBGDUY.js → MTV6GBRX.js} +1 -1
- package/dist/cdn/{7TFL3HIH.js → NQJLGBVK.js} +1 -1
- package/dist/cdn/{SP3TJB3V.js → OAR2EXND.js} +1 -1
- package/dist/cdn/{RGS7XNRL.js → RIMWN7PN.js} +1 -1
- package/dist/cdn/{VVZSLXLZ.js → SMQJD2L6.js} +1 -1
- package/dist/cdn/{HFYPZ352.js → SNHGQLES.js} +1 -1
- package/dist/cdn/{C7GXIRVU.js → TWLLLMPH.js} +1 -1
- package/dist/cdn/{4UIONHOK.js → UAGYDOBI.js} +1 -1
- package/dist/cdn/{2KL5NQNG.js → UTLMCJD2.js} +1 -1
- package/dist/cdn/{J62I2GA3.js → V76BJGGX.js} +1 -1
- package/dist/cdn/{MYXI3DVH.js → VJWEGXQY.js} +1 -1
- package/dist/cdn/W5FA4IWP.js +10 -0
- package/dist/cdn/{KWMAHRAP.js → WTEVUXDK.js} +1 -1
- package/dist/cdn/{V6XW7PC2.js → YXKNVWVS.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/runtime.js +1 -1
- package/dist/components/arcgis-chat-ui/functional/chat-response/customElement.js +1 -1
- package/dist/components/arcgis-hub-ai-assistant/customElement.js +12 -17
- package/dist/components/arcgis-hub-entity-view-layout/customElement.js +42 -36
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +3 -3
- package/dist/cdn/7GI7PCWY.js +0 -10
- package/dist/cdn/E6BGJQ3F.js +0 -6
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/0.37/LICENSE.txt */
|
|
2
|
-
import f from"./
|
|
2
|
+
import f from"./VJWEGXQY.js";import e from"./XX3BCLUI.js";import d from"./MAKNOF2E.js";import{b as R}from"./W5FA4IWP.js";import"./ALUW2GDJ.js";import"./DCLYV35L.js";import"./SDXNFZ6Q.js";import"./XLV625TR.js";import"./NFD3QJ6J.js";import"./Q4GV7FFJ.js";import"./HWUCFNAD.js";import"./LLGS7DKU.js";import"./TO5XR7VA.js";import"./DJ3H7LZE.js";import"./PJFE4OSA.js";import"./25TYOHZS.js";import"./XZDHV5BV.js";import"./L6IQ6LTS.js";import"./DCXY72PD.js";import"./YBDFIKTN.js";import"./QA5B2Y37.js";import"./HUVYHMSC.js";import"./FY3KPATI.js";import"./DH2QF3YA.js";import"./UOAJQR2X.js";import"./PM6CSPJD.js";import"./JG22JJ4C.js";import"./6M5DP7YF.js";import"./HM2SQ34E.js";import"./HF75SET4.js";import"./O247GUBF.js";import"./EIMMNTTE.js";import"./YMX7NNEY.js";import"./M5TH54YS.js";import"./HH5PXKUQ.js";import"./WL6CGZLR.js";import"./K4VVZ2OR.js";import"./THLIDOGM.js";import"./FZNKGW4A.js";import"./LK454DSU.js";import"./AYFB34A7.js";import"./53V23CCM.js";import"./SNSHV52T.js";import"./HITR5JF7.js";import"./E2RL5I2B.js";import"./4ZRQCNU2.js";import"./YLRR2XFD.js";import"./LEVMADAS.js";import"./U7SPPU37.js";import"./JSOZV4HA.js";import"./VXJI546E.js";import"./ZQPTNYU6.js";import"./UCUSWPVC.js";import"./HTYDCXX6.js";import"./LDJN5446.js";import"./6LDEVQEO.js";import"./ZUFDLSS7.js";import"./2NJPYBHN.js";import"./635V3Q2N.js";import"./3MGFA2AN.js";import"./2WQEISGF.js";import"./CBIG4EMI.js";import"./IXINH2FU.js";import"./UJKN7G7W.js";import"./K3HMF5GC.js";import"./NPWIO5CS.js";import"./B6CP7FIT.js";import"./XP6ZXTST.js";import"./ZVGAVULD.js";import"./V3U3RRL7.js";import"./LVCMKKG7.js";import"./UTQMJRMF.js";import"./AEPE3IDB.js";import"./UR5INQGU.js";import"./HV466M4A.js";import"./GJINUBO7.js";import"./5GNQYAFV.js";import"./BHYFMWFH.js";import"./47ZOSUE6.js";import"./JI5AIZ2W.js";import"./SVAOM6PB.js";import"./WTJOWA2D.js";import"./II3OUQDN.js";import{b as M}from"./3SHBZF4M.js";import{h as k,i as E}from"./6VA6IJMP.js";import"./2PUMWMNI.js";import"./L3H4QXUA.js";import{A as b,B as v,H as D,a as x,b as u,o as S,z as g}from"./RIMWN7PN.js";import"./BMRPHSYL.js";import"./FMBEHWFY.js";import"./3WN3ZWUP.js";import"./AM4QVJ44.js";import"./GVF26EON.js";import"./K672BF4Z.js";import"./HSFPILSC.js";import"./2W2UGJLH.js";import"./XI72UBIK.js";import"./H3CSIYXV.js";import"./46NFE3O2.js";import"./MUN2QI43.js";import"./U2H7HOIC.js";import"./IEDSJLNB.js";import"./NR4ANSZX.js";import"./I3LGHXIN.js";import"./S2TL4ARK.js";import"./WBUC7HJI.js";import"./SD326B2E.js";import"./HZHPBMYE.js";import"./MYXIS5RQ.js";import"./PWESAKVV.js";import c from"./K5O2OVOP.js";import"./Y7N6UKCC.js";import"./H2V2RZ6M.js";import"./CU2TSBCT.js";import"./OQOFL4GS.js";import"./KUB4GMLQ.js";import"./FDDXGLRF.js";import"./RGKBSVQD.js";import"./FZ7ZK37I.js";import"./FLC2JTMP.js";import"./RL2IUUBA.js";import"./4QEFMWHF.js";import"./J2P53GWU.js";import a from"./BU6RNCBS.js";import"./ZM3EAORZ.js";import"./YCEXTCZD.js";import"./5V53QYYF.js";import"./A36IL72A.js";import"./P7D42LBQ.js";import"./ZFP6AZG7.js";import"./NE7SMAEP.js";import"./2B6D4MGZ.js";import"./HEPYE6RX.js";import"./7GTUV67W.js";import"./USNX342T.js";import"./DKMYTCOT.js";import"./IONZ3SDQ.js";export default $arcgis.t(([,,,,V])=>{var P={FINDER:"finder"};async function F(i){let{skillId:t,message:e,context:s,token:a,conversationId:o,apiUrl:n="https://api.example.com",pauseMs:c=1e3,retries:d=3}=i,y={Authorization:`Bearer ${a}`,Accept:"application/json","Content-Type":"application/json"},_=`${n}/skills/${t}/chat`,w={message:e,context:s};o&&(w.conversationId=o);try{let l=await fetch(_,{method:"POST",headers:y,body:JSON.stringify(w)});if(!l.ok)throw new Error(`HTTP error! status: ${l.status}`);let r=await l.json(),L=o??r.conversationId,U=r.inquiryId,$=r.hasMore||r.message==null,T=r.sequenceNumber,m=[];r.message&&m.push(r);let I=0;for(;$&&I<d;){await new Promise(C=>setTimeout(C,c));let p=await fetch(_,{method:"POST",headers:y,body:JSON.stringify({conversationId:L,inquiryId:U,ackSequenceNumber:T})});if(!p.ok)throw new Error(`HTTP error! status: ${p.status}`);let h=await p.json();h.message&&m.push(h),$=h.hasMore,h.message!=null&&(T+=1),I++}return m}catch(l){return console.error("Error during request:",l),[]}}async function q({message:i,context:t,token:e,conversationId:s,apiUrl:a="https://hub.arcgis.com/api/assistants/v1",pauseMs:o=1e3,retries:n=100}){return await F({skillId:P.FINDER,message:i,context:t,token:e,conversationId:s??void 0,apiUrl:a,pauseMs:o,retries:n})}var N=i=>{if(i?.length!==2||i[0].length!==2||i[1].length!==2)return"0, 0";let t=i[0][0],e=i[0][1],s=i[1][0],a=(i[1][1]+e)/2,o=(s+t)/2;return`${a}, ${o}`},z=i=>{if(i?.length!==2||i[0].length!==2||i[1].length!==2)return 1;let t=i[0][0],e=i[0][1],s=i[1][0],a=i[1][1],o=Math.abs(s-t),n=Math.abs(a-e),c=Math.log2(360/o),d=Math.log2(180/n);return Math.floor(Math.min(c,d))+2},G=x`@layer{arcgis-hub-ai-assistant{arcgis-feature-table{height:300px}esri-feature-table{height:300px}}}`;function H(i){return i.replace("http://","").replace("https://","").split(/[/?#]/u)[0]}async function j(i,t,e){try{let[s,a]=await Promise.all([k(i,{authentication:t,portal:e}),E(i,{authentication:t,portal:e})]);return{title:s.title,description:a.assistant?.description,extent:s.extent,hub:H(s.url),location:a.assistant?.location??"",defaultSuggestions:a.assistant?.examplePrompts??[],modified:s.modified}}catch(s){throw console.error("Error fetching configuration:",s),s}}function A(i,t){return t?.map?.layers.find(e=>e.portalItem?.id===i)}var f=class extends v{constructor(){super(...arguments),this.disconnectContext=()=>{},this._messages=M({blocking:!0}),this._mapView=null,this._featureTable=g(),this._mapElRef=g(),this.handleArcGISLocationClick=t=>{let e=t.detail;e.longitude&&e.latitude&&e.zoom&&(this.mapVisible=!0,this._mapView?.goTo({center:[e.longitude,e.latitude],zoom:e.zoom}))},this.handleFinderResponse=async(t,e)=>{let s=await q({message:t,conversationId:e,context:{kind:"FinderRequest",item:this.itemId??void 0,modified:this.itemModifiedDate},token:R(this._context,"session.token",""),apiUrl:this._context.assistantApiUrl});if(s.length===0)throw new Error("Finder response is empty or invalid");return s},this.handleUpdateMapVisibility=t=>{this.mapVisible=t.detail},this._mapReady=t=>{let{view:e,viewElement:s}=t.detail;this._mapView=e,this._mapRef=s},this.handleArcGISDataClick=async t=>{let e=t.detail.data.id;if(this.mapVisible=!0,this.mapShowTable=!0,!A(e,this._mapView))try{await this._mapElRef.value?.addLayer(e);let s=A(e,this._mapView);s&&(this.mapLayers.push(e),this._featureTable.value&&(this._featureTable.value.layer=s,this._layers=[...this._layers,s],this._featureTable.value.layers=this._layers))}catch(s){console.error("could not add layer:",s)}},this._context=V(this),this.mapEnabled=!0,this.mapVisible=!1,this.itemId=null,this.botTitle=void 0,this.extent=[[-77.119,38.791],[-76.909,38.995]],this.mapLayers=[],this._layers=[],this.mapShowTable=!0,this.location="USA",this.hub="https://hub.arcgis.com",this.botDescription=void 0,this.defaultSuggestions=[],this.itemModifiedDate=0}static{this.properties={_mapRef:16,_context:16,mapEnabled:5,mapVisible:5,itemId:1,botTitle:1,extent:0,mapLayers:0,_layers:0,mapShowTable:5,location:1,hub:1,botDescription:1,defaultSuggestions:0,itemModifiedDate:9}}static{this.shadowRootOptions=S}static{this.styles=G}get _botTitle(){return this.botTitle||this._messages.defaultBotTitle}get _botDescription(){return this.botDescription||this._messages.defaultBotDescription}async load(){if(this.itemId){let t=await j(this.itemId,this._context.session,`${this._context.portalUrl}/sharing/rest`);this.botTitle=t.title,this.botDescription=t.description??"",this.hub=t.hub,this.location=t.location,this.extent=t.extent,this.defaultSuggestions=t.defaultSuggestions,this.itemModifiedDate=t.modified}}render(){return u`<arcgis-chat-shell .aboutContent=${this._botDescription} .mapEnabled=${this.mapEnabled} .mapVisible=${this.mapEnabled&&this.mapVisible} @arcgisUpdateMapVisibility=${this.handleUpdateMapVisibility}><arcgis-chat-ui .ariaLabel=${this._messages.aria.chat} .botDescription=${this._botDescription} .botTitle=${this._botTitle} .defaultSuggestions=${this.defaultSuggestions} slot=leftPanel .getFinderResponse=${this.handleFinderResponse} @arcgisAddDataClick=${this.handleArcGISDataClick} @arcgisLocationClick=${this.handleArcGISLocationClick} .domain=${this.hub}></arcgis-chat-ui><arcgis-hub-map-view .ariaLabel=${this._messages.aria.map} slot=map .location=${`${N(this.extent)},${z(this.extent)}`} mouse-wheel=zoom legend search layer-list hide-error @arcgisHubMapViewReady=${this._mapReady} ${b(this._mapElRef)}></arcgis-hub-map-view>${this.mapShowTable&&u`<arcgis-feature-table .ariaLabel=${this._messages.aria.featureTable} .referenceElement=${this._mapRef} slot=featureTable show-layer-dropdown ${b(this._featureTable)}></arcgis-feature-table>`||""}</arcgis-chat-shell>`}};D("arcgis-hub-ai-assistant",f);return f},a,c,d,e,f)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/0.37/LICENSE.txt */
|
|
2
|
-
import f from"./XX3BCLUI.js";import d from"./MAKNOF2E.js";import{k as o}from"./
|
|
2
|
+
import f from"./XX3BCLUI.js";import d from"./MAKNOF2E.js";import{k as o}from"./W5FA4IWP.js";import"./ALUW2GDJ.js";import"./DCLYV35L.js";import"./SDXNFZ6Q.js";import"./XLV625TR.js";import"./NFD3QJ6J.js";import"./Q4GV7FFJ.js";import"./HWUCFNAD.js";import"./LLGS7DKU.js";import"./TO5XR7VA.js";import"./DJ3H7LZE.js";import"./PJFE4OSA.js";import"./25TYOHZS.js";import"./XZDHV5BV.js";import"./L6IQ6LTS.js";import"./DCXY72PD.js";import"./YBDFIKTN.js";import"./QA5B2Y37.js";import"./HUVYHMSC.js";import"./FY3KPATI.js";import"./DH2QF3YA.js";import"./UOAJQR2X.js";import"./PM6CSPJD.js";import"./JG22JJ4C.js";import"./6M5DP7YF.js";import"./HM2SQ34E.js";import"./HF75SET4.js";import"./O247GUBF.js";import"./EIMMNTTE.js";import"./YMX7NNEY.js";import"./M5TH54YS.js";import"./HH5PXKUQ.js";import"./WL6CGZLR.js";import"./K4VVZ2OR.js";import"./THLIDOGM.js";import"./FZNKGW4A.js";import"./LK454DSU.js";import"./AYFB34A7.js";import"./53V23CCM.js";import"./SNSHV52T.js";import"./HITR5JF7.js";import"./E2RL5I2B.js";import"./4ZRQCNU2.js";import"./YLRR2XFD.js";import"./LEVMADAS.js";import"./U7SPPU37.js";import"./JSOZV4HA.js";import"./VXJI546E.js";import"./ZQPTNYU6.js";import"./UCUSWPVC.js";import"./HTYDCXX6.js";import"./LDJN5446.js";import"./6LDEVQEO.js";import"./ZUFDLSS7.js";import"./2NJPYBHN.js";import"./635V3Q2N.js";import"./3MGFA2AN.js";import"./2WQEISGF.js";import"./CBIG4EMI.js";import"./IXINH2FU.js";import"./UJKN7G7W.js";import"./K3HMF5GC.js";import"./NPWIO5CS.js";import"./B6CP7FIT.js";import"./XP6ZXTST.js";import"./ZVGAVULD.js";import"./V3U3RRL7.js";import"./LVCMKKG7.js";import"./UTQMJRMF.js";import"./AEPE3IDB.js";import"./UR5INQGU.js";import"./HV466M4A.js";import"./GJINUBO7.js";import"./5GNQYAFV.js";import"./BHYFMWFH.js";import"./47ZOSUE6.js";import"./JI5AIZ2W.js";import"./SVAOM6PB.js";import"./WTJOWA2D.js";import"./II3OUQDN.js";import"./6VA6IJMP.js";import{B as e,H as a,b as s}from"./RIMWN7PN.js";import"./BMRPHSYL.js";import"./FMBEHWFY.js";import"./3WN3ZWUP.js";import"./AM4QVJ44.js";import"./GVF26EON.js";import"./K672BF4Z.js";import"./HSFPILSC.js";import"./2W2UGJLH.js";import"./XI72UBIK.js";import"./H3CSIYXV.js";import"./46NFE3O2.js";import"./MUN2QI43.js";import"./U2H7HOIC.js";import"./IEDSJLNB.js";import"./NR4ANSZX.js";import"./I3LGHXIN.js";import"./S2TL4ARK.js";import"./WBUC7HJI.js";import"./SD326B2E.js";import"./HZHPBMYE.js";import"./MYXIS5RQ.js";import"./PWESAKVV.js";import c from"./K5O2OVOP.js";import"./Y7N6UKCC.js";import"./H2V2RZ6M.js";import"./CU2TSBCT.js";import"./OQOFL4GS.js";import"./KUB4GMLQ.js";import"./FDDXGLRF.js";import"./RGKBSVQD.js";import"./FZ7ZK37I.js";import"./FLC2JTMP.js";import"./RL2IUUBA.js";import"./4QEFMWHF.js";import"./J2P53GWU.js";import b from"./BU6RNCBS.js";import"./ZM3EAORZ.js";import"./YCEXTCZD.js";import"./5V53QYYF.js";import"./A36IL72A.js";import"./P7D42LBQ.js";import"./ZFP6AZG7.js";import"./NE7SMAEP.js";import"./2B6D4MGZ.js";import"./HEPYE6RX.js";import"./7GTUV67W.js";import"./USNX342T.js";import"./DKMYTCOT.js";import"./IONZ3SDQ.js";export default $arcgis.t(([,,,{a:r}])=>{var t=class extends e{constructor(){super(...arguments),this.associationType="initiative"}static{this.properties={_associatedEntitiesQuery:16,entity:0,associationType:1}}get _context(){return r()}willUpdate(i){(i.has("entity")||i.has("associationType"))&&this._init()}async _init(){this.entity&&(this._associatedEntitiesQuery=await o(this.entity,this.associationType,this._context))}render(){return this.entity&&s`<arcgis-hub-gallery layout=compact limit=5 link-target=siteRelative .query=${this._associatedEntitiesQuery}></arcgis-hub-gallery>`||""}};a("arcgis-hub-entity-associations-card",t);return t},b,c,d,f)
|
package/dist/cdn/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/0.37/LICENSE.txt */
|
|
2
|
-
import{G as i,p as t}from"./
|
|
2
|
+
import{G as i,p as t}from"./RIMWN7PN.js";import"./BMRPHSYL.js";import"./IONZ3SDQ.js";var e=t(i,{"arcgis-chat-shell":[()=>import("./NQJLGBVK.js"),"_messages:,aboutContent,mapEnabled,mapVisible"],"arcgis-chat-ui":[()=>import("./77R2C3NY.js"),"_messages:,botDescription,botTitle,conversationId,defaultSuggestions:,domain,getFinderResponse:,inputText;submitUserMessage"],"arcgis-hub-ai-assistant":[()=>import("./WTEVUXDK.js"),"_layers:,_messages:,botDescription,botTitle,defaultSuggestions:,extent:,hub,itemId,itemModifiedDate,location,mapEnabled,mapLayers:,mapShowTable,mapVisible"],"arcgis-hub-entity-view-layout":[()=>import("./M3ZUOUC3.js"),"_messages:,entity:,isEditMode"],"arcgis-hub-entity-associations-card":[()=>import("./YXKNVWVS.js"),"associationType,entity:"],"arcgis-hub-entity-metrics-card":[()=>import("./SMQJD2L6.js"),"entity:"],"arcgis-hub-entity-status-card":[()=>import("./SNHGQLES.js"),"_messages:,entity:"],"arcgis-nav-card":[()=>import("./TWLLLMPH.js"),"_messages:,activatedNode:,debug,isEditMode,node:,sections:,translations:,utils:"],"arcgis-text-card":[()=>import("./V76BJGGX.js"),"html"],"arcgis-layout":[()=>import("./OAR2EXND.js"),"activatedNode:,debug,isEditMode,layout:,options:;getCardEl"],"arcgis-layout-column":[()=>import("./JEQW7KPC.js"),"activatedNode:,debug,isEditMode,node:,utils:"],"arcgis-layout-container":[()=>import("./CP5CMZPK.js"),"_messages:,debug,isEditMode,isPublishing,layout:,options:"],"arcgis-layout-editor-toolbar":[()=>import("./425VBETO.js"),"exitEditMode:,isLayoutDirty,isLayoutValid,isPublishing,publishLayout:,resetLayout:"],"arcgis-layout-node-controls":[()=>import("./MTV6GBRX.js"),"activatedNode:,isEditMode,isLayoutValid,layoutElement:,layoutNodeConfig:,messages:,node:"],"arcgis-layout-node-editor":[()=>import("./HSKNYFFN.js"),"layoutNodeConfig:,node:;;setFocus"],"arcgis-layout-node-wrapper":[()=>import("./G3DW5HI6.js"),"activatedNode:,isEditMode,node:"],"arcgis-layout-row":[()=>import("./MKMW2OIY.js"),"activatedNode:,debug,isEditMode,node:,utils:"],"arcgis-layout-section":[()=>import("./GTMYGR72.js"),"activatedNode:,debug,isEditMode,node:,utils:"]});e({resourcesUrl:import.meta.url});var s=new CSSStyleSheet;s.replaceSync("@layer{:not([hydrated]):is(arcgis-chat-shell,arcgis-chat-ui,arcgis-hub-ai-assistant,arcgis-hub-entity-view-layout,arcgis-hub-entity-associations-card,arcgis-hub-entity-metrics-card,arcgis-hub-entity-status-card,arcgis-nav-card,arcgis-text-card,arcgis-layout,arcgis-layout-container){visibility:hidden}:root{--acme-components-text-color: #111}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,s];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,i)
|
package/dist/chunks/runtime.js
CHANGED
|
@@ -3,7 +3,7 @@ import "../cdn/main.css";
|
|
|
3
3
|
import { css as e } from "lit";
|
|
4
4
|
import { makeRuntime as s } from "@arcgis/lumina";
|
|
5
5
|
import { trackAccess as r, createObservable as a, createTrackingTarget as c, runTracked as o } from "@arcgis/core/applications/Components/reactiveUtils.js";
|
|
6
|
-
const m = e``, t = s({ defaultAssetPath: "https://js.arcgis.com/0.37.
|
|
6
|
+
const m = e``, t = s({ defaultAssetPath: "https://js.arcgis.com/0.37.2/hub-web-components/", hydratedAttribute: "hydrated", commonStyles: m }), { customElement: u, getAssetPath: d, setAssetPath: p } = t;
|
|
7
7
|
t.t = r;
|
|
8
8
|
t.o = a;
|
|
9
9
|
t.c = c;
|
|
@@ -30,7 +30,7 @@ const O = ({ message: n, addDataClick: p, addLocationClick: $, viewDetailsClick:
|
|
|
30
30
|
return a`<calcite-accordion-item .description=${e.sourcesDescription} .heading=${e.sourcesHeading} icon-start=information data-field-name=sources expanded><div class="sources">${s(d, (r) => r.id, (r) => a`<div class="wrapper source">${H({ messageId: o, source: r, domain: u, showOutlinks: !0, addDataClick: p, addDataLabel: e.addDataLabel, viewDetailsClick: b, viewDetailsLabel: e.viewDetailsLabel })}</div>`)}</div></calcite-accordion-item>`;
|
|
31
31
|
}
|
|
32
32
|
function y(o) {
|
|
33
|
-
return a`<calcite-accordion-item .description=${e.mapDescription} .heading=${e.mapHeading} icon-start=map data-field-name=map expanded><div>${o.name}</div><arcgis-hub-map-view .location=${`${o.latitude}, ${o.longitude}, ${o.zoom ?? 0}`} @arcgisHubMapViewReady=${m} legend layer-list search></arcgis-hub-map-view><calcite-button data-message-id=${n.messageId ?? k} round icon-start=extent appearance=outline-fill @click=${$}>${e.addLocationLabel}</calcite-button></calcite-accordion-item>`;
|
|
33
|
+
return a`<calcite-accordion-item .description=${e.mapDescription} .heading=${e.mapHeading} icon-start=map data-field-name=map expanded><div>${o.name}</div><arcgis-hub-map-view .location=${`${o.latitude}, ${o.longitude}, ${o.zoom ?? 0}`} @arcgisHubMapViewReady=${m} legend layer-list search hide-error></arcgis-hub-map-view><calcite-button data-message-id=${n.messageId ?? k} round icon-start=extent appearance=outline-fill @click=${$}>${e.addLocationLabel}</calcite-button></calcite-accordion-item>`;
|
|
34
34
|
}
|
|
35
35
|
function m(o) {
|
|
36
36
|
const d = o.target;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/0.37/LICENSE.txt */
|
|
2
2
|
import { c as v } from "../../chunks/runtime.js";
|
|
3
|
-
import { css as R, html as
|
|
3
|
+
import { css as R, html as _ } from "lit";
|
|
4
4
|
import { LitElement as E, noShadowRoot as M } from "@arcgis/lumina";
|
|
5
|
-
import { getItem as
|
|
5
|
+
import { getItem as A, getItemData as V } from "@esri/arcgis-rest-portal";
|
|
6
6
|
import { createRef as $, ref as I } from "lit/directives/ref.js";
|
|
7
7
|
import { u as L } from "../../chunks/useT9n.js";
|
|
8
8
|
import { u as x } from "../../chunks/useGlobalContext.js";
|
|
@@ -38,8 +38,8 @@ async function z(e) {
|
|
|
38
38
|
let b = r.hasMore || r.message == null, y = r.sequenceNumber;
|
|
39
39
|
const m = [];
|
|
40
40
|
r.message && m.push(r);
|
|
41
|
-
let
|
|
42
|
-
for (; b &&
|
|
41
|
+
let w = 0;
|
|
42
|
+
for (; b && w < d; ) {
|
|
43
43
|
await new Promise((k) => setTimeout(k, h));
|
|
44
44
|
const p = await fetch(g, {
|
|
45
45
|
method: "POST",
|
|
@@ -53,14 +53,14 @@ async function z(e) {
|
|
|
53
53
|
if (!p.ok)
|
|
54
54
|
throw new Error(`HTTP error! status: ${p.status}`);
|
|
55
55
|
const c = await p.json();
|
|
56
|
-
c.message && m.push(c), b = c.hasMore, c.message != null && (y += 1),
|
|
56
|
+
c.message && m.push(c), b = c.hasMore, c.message != null && (y += 1), w++;
|
|
57
57
|
}
|
|
58
58
|
return m;
|
|
59
59
|
} catch (l) {
|
|
60
60
|
return console.error("Error during request:", l), [];
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
async function
|
|
63
|
+
async function F({
|
|
64
64
|
message: e,
|
|
65
65
|
context: t,
|
|
66
66
|
token: s,
|
|
@@ -80,7 +80,7 @@ async function U({
|
|
|
80
80
|
retries: n
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
|
-
const
|
|
83
|
+
const U = (e) => {
|
|
84
84
|
if (e?.length !== 2 || e[0].length !== 2 || e[1].length !== 2)
|
|
85
85
|
return "0, 0";
|
|
86
86
|
const t = e[0][0], s = e[0][1], i = e[1][0], a = (e[1][1] + s) / 2, n = (i + t) / 2;
|
|
@@ -97,8 +97,8 @@ function G(e) {
|
|
|
97
97
|
async function H(e, t, s) {
|
|
98
98
|
try {
|
|
99
99
|
const [i, o] = await Promise.all([
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
A(e, { authentication: t, portal: s }),
|
|
101
|
+
V(e, { authentication: t, portal: s })
|
|
102
102
|
]);
|
|
103
103
|
return {
|
|
104
104
|
title: i.title,
|
|
@@ -126,7 +126,7 @@ class O extends E {
|
|
|
126
126
|
zoom: s.zoom
|
|
127
127
|
}));
|
|
128
128
|
}, this.handleFinderResponse = async (t, s) => {
|
|
129
|
-
const i = await
|
|
129
|
+
const i = await F({
|
|
130
130
|
message: t,
|
|
131
131
|
conversationId: s,
|
|
132
132
|
context: {
|
|
@@ -138,12 +138,7 @@ class O extends E {
|
|
|
138
138
|
// Use getWithDefault() to safely access session, which may be undefined for unauthenticated users.
|
|
139
139
|
// TypeScript's IArcGISContext type does not reflect this possibility. See: https://devtopia.esri.com/dc/hub/issues/15096
|
|
140
140
|
token: C(this._context, "session.token", ""),
|
|
141
|
-
|
|
142
|
-
// until either the hub-components package is bumped (currently on 5.410) or hub-components
|
|
143
|
-
// is moved to this repo. https://devtopia.esri.com/dc/hub/issues/15166. Once this is resolved
|
|
144
|
-
// modify the code underneath to this._context.assistantApiUrl
|
|
145
|
-
// - Krishaan
|
|
146
|
-
apiUrl: this._context.hubUrl ? `${this._context.hubUrl}/api/assistants/v1` : void 0
|
|
141
|
+
apiUrl: this._context.assistantApiUrl
|
|
147
142
|
});
|
|
148
143
|
if (i.length === 0)
|
|
149
144
|
throw new Error("Finder response is empty or invalid");
|
|
@@ -190,7 +185,7 @@ class O extends E {
|
|
|
190
185
|
}
|
|
191
186
|
}
|
|
192
187
|
render() {
|
|
193
|
-
return
|
|
188
|
+
return _`<arcgis-chat-shell .aboutContent=${this._botDescription} .mapEnabled=${this.mapEnabled} .mapVisible=${this.mapEnabled && this.mapVisible} @arcgisUpdateMapVisibility=${this.handleUpdateMapVisibility}><arcgis-chat-ui .ariaLabel=${this._messages.aria.chat} .botDescription=${this._botDescription} .botTitle=${this._botTitle} .defaultSuggestions=${this.defaultSuggestions} slot=leftPanel .getFinderResponse=${this.handleFinderResponse} @arcgisAddDataClick=${this.handleArcGISDataClick} @arcgisLocationClick=${this.handleArcGISLocationClick} .domain=${this.hub}></arcgis-chat-ui><arcgis-hub-map-view .ariaLabel=${this._messages.aria.map} slot=map .location=${`${U(this.extent)},${q(this.extent)}`} mouse-wheel=zoom legend search layer-list hide-error @arcgisHubMapViewReady=${this._mapReady} ${I(this._mapElRef)}></arcgis-hub-map-view>${this.mapShowTable && _`<arcgis-feature-table .ariaLabel=${this._messages.aria.featureTable} .referenceElement=${this._mapRef} slot=featureTable show-layer-dropdown ${I(this._featureTable)}></arcgis-feature-table>` || ""}</arcgis-chat-shell>`;
|
|
194
189
|
}
|
|
195
190
|
}
|
|
196
191
|
v("arcgis-hub-ai-assistant", O);
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/0.37/LICENSE.txt */
|
|
2
2
|
import { c as k } from "../../chunks/runtime.js";
|
|
3
3
|
import { LitElement as L, createEvent as y, noShadowRoot as A } from "@arcgis/lumina";
|
|
4
|
-
import { getProp as
|
|
4
|
+
import { getProp as i, getWithDefault as H, MetricVisibility as p, getTypeFromEntity as E, Logger as c, cloneObject as m, updateHubEntity as P, capitalize as S } from "@esri/hub-common";
|
|
5
5
|
import { u as R } from "../../chunks/useT9n.js";
|
|
6
6
|
import { isTargetEntityScopeConfigured as n, showNotice as b } from "@esri/hub-components";
|
|
7
7
|
import { g as $ } from "../../chunks/state.js";
|
|
8
8
|
import { constants as w, dictionary as v } from "@esri/telemetry-dictionary-hub";
|
|
9
9
|
import { html as f } from "lit";
|
|
10
10
|
const I = async (t, e) => {
|
|
11
|
-
const
|
|
11
|
+
const a = !!t.summary, r = !!t.description, s = !!i(t, "view.embeds[0]"), C = !!i(t, "view.featuredImageUrl"), O = a || r || s || C;
|
|
12
12
|
let d = "";
|
|
13
13
|
e?.isAuthenticated && (d = `?token=${e.session.token}`);
|
|
14
|
-
const T = `${
|
|
14
|
+
const T = `${i(t, "view.featuredImageUrl")}${d}`, u = H(t, "view.metricDisplays", []), g = u.filter((o) => o.visibility === p.featured), x = u.filter((o) => o.visibility !== p.hidden);
|
|
15
15
|
let h = [];
|
|
16
|
-
h =
|
|
16
|
+
h = i(t, "typeKeywords");
|
|
17
17
|
const l = h.filter(
|
|
18
18
|
(o) => o.startsWith("ref|initiative")
|
|
19
19
|
);
|
|
@@ -103,35 +103,41 @@ const I = async (t, e) => {
|
|
|
103
103
|
html: "<h2>{{about:translate}}</h2>"
|
|
104
104
|
}
|
|
105
105
|
},
|
|
106
|
-
|
|
106
|
+
// NOTE: we use getProp here and elsewhere to conditionally include nodes in the layout based on the presence of data in the project entity.
|
|
107
|
+
// we could instead use syntax like {{entity.summary:optional}} or {{entity.view.timeline.stages:optional:2}} in the properties of a node
|
|
108
|
+
// so that interpolation removes them later. however, we should not do that because that means that our layout and our processed layout
|
|
109
|
+
// in the layout container have different shapes which could lead to bugs and makes it more difficult to reason about the code.
|
|
110
|
+
// by using getProp to conditionally include nodes in the layout, we ensure that the layout and processed layout have the same shape
|
|
111
|
+
// and we can be confident that if a node is in the layout then it will be rendered in the processed layout (assuming it's not filtered out for some reason).
|
|
112
|
+
i(t, "summary") && {
|
|
107
113
|
id: "about-summary",
|
|
108
114
|
tag: "arcgis-text-card",
|
|
109
115
|
readOnly: !0,
|
|
110
116
|
properties: {
|
|
111
|
-
html: "<p>{{entity.summary
|
|
117
|
+
html: "<p>{{entity.summary}}</p>"
|
|
112
118
|
}
|
|
113
119
|
},
|
|
114
|
-
|
|
120
|
+
i(t, "view.embeds[0]") && {
|
|
115
121
|
id: "about-embed",
|
|
116
122
|
tag: "arcgis-hub-embed-card",
|
|
117
123
|
properties: {
|
|
118
|
-
embed:
|
|
124
|
+
embed: i(t, "view.embeds[0]")
|
|
119
125
|
}
|
|
120
126
|
},
|
|
121
|
-
{
|
|
127
|
+
i(t, "description") && {
|
|
122
128
|
id: "about-description",
|
|
123
129
|
tag: "arcgis-text-card",
|
|
124
130
|
readOnly: !0,
|
|
125
131
|
properties: {
|
|
126
|
-
html: "<p>{{entity.description
|
|
132
|
+
html: "<p>{{entity.description}}</p>"
|
|
127
133
|
}
|
|
128
134
|
},
|
|
129
|
-
|
|
135
|
+
i(t, "view.featuredImageUrl") && {
|
|
130
136
|
id: "about-featured-image",
|
|
131
137
|
tag: "arcgis-hub-image",
|
|
132
138
|
properties: {
|
|
133
139
|
src: T,
|
|
134
|
-
alt:
|
|
140
|
+
alt: i(t, "view.featuredImageAltText") || ""
|
|
135
141
|
}
|
|
136
142
|
},
|
|
137
143
|
g.length > 0 && {
|
|
@@ -149,14 +155,14 @@ const I = async (t, e) => {
|
|
|
149
155
|
entity: "{{entity}}"
|
|
150
156
|
}
|
|
151
157
|
},
|
|
152
|
-
|
|
158
|
+
i(t, "view.featuredContentIds.length") > 0 && {
|
|
153
159
|
id: "featured-content-header",
|
|
154
160
|
tag: "arcgis-text-card",
|
|
155
161
|
properties: {
|
|
156
162
|
html: "<h2>{{featuredContent:translate}}</h2>"
|
|
157
163
|
}
|
|
158
164
|
},
|
|
159
|
-
|
|
165
|
+
i(t, "view.featuredContentIds.length") > 0 && {
|
|
160
166
|
id: "featured-content-gallery",
|
|
161
167
|
tag: "arcgis-hub-gallery-card",
|
|
162
168
|
properties: {
|
|
@@ -178,7 +184,7 @@ const I = async (t, e) => {
|
|
|
178
184
|
{
|
|
179
185
|
predicates: [
|
|
180
186
|
{
|
|
181
|
-
id:
|
|
187
|
+
id: i(t, "view.featuredContentIds")
|
|
182
188
|
}
|
|
183
189
|
]
|
|
184
190
|
}
|
|
@@ -210,13 +216,13 @@ const I = async (t, e) => {
|
|
|
210
216
|
entity: "{{entity}}"
|
|
211
217
|
}
|
|
212
218
|
},
|
|
213
|
-
{
|
|
219
|
+
i(t, "view.timeline.stages")?.length && {
|
|
214
220
|
id: "status-timeline",
|
|
215
221
|
tag: "arcgis-hub-timeline",
|
|
216
222
|
readOnly: !0,
|
|
217
223
|
properties: {
|
|
218
224
|
canCollapse: "{{entity.view.timeline.canCollapse:optional}}",
|
|
219
|
-
stages: "{{entity.view.timeline.stages
|
|
225
|
+
stages: "{{entity.view.timeline.stages}}"
|
|
220
226
|
}
|
|
221
227
|
},
|
|
222
228
|
{
|
|
@@ -425,7 +431,7 @@ const I = async (t, e) => {
|
|
|
425
431
|
]
|
|
426
432
|
};
|
|
427
433
|
}, V = async (t, e) => {
|
|
428
|
-
const
|
|
434
|
+
const a = !!t.summary, r = !!t.description;
|
|
429
435
|
return {
|
|
430
436
|
schemaVersion: 2,
|
|
431
437
|
history: [],
|
|
@@ -505,27 +511,27 @@ const I = async (t, e) => {
|
|
|
505
511
|
columnProps: { width: { xs: 12, md: 8 } },
|
|
506
512
|
properties: {},
|
|
507
513
|
children: [
|
|
508
|
-
(
|
|
514
|
+
(a || r) && {
|
|
509
515
|
id: "about-header",
|
|
510
516
|
tag: "arcgis-text-card",
|
|
511
517
|
properties: {
|
|
512
518
|
html: "<h2>{{about:translate}}</h2>"
|
|
513
519
|
}
|
|
514
520
|
},
|
|
515
|
-
{
|
|
521
|
+
i(t, "summary") && {
|
|
516
522
|
id: "about-summary",
|
|
517
523
|
tag: "arcgis-text-card",
|
|
518
524
|
readOnly: !0,
|
|
519
525
|
properties: {
|
|
520
|
-
html: "<p>{{entity.summary
|
|
526
|
+
html: "<p>{{entity.summary}}</p>"
|
|
521
527
|
}
|
|
522
528
|
},
|
|
523
|
-
{
|
|
529
|
+
i(t, "description") && {
|
|
524
530
|
id: "about-description",
|
|
525
531
|
tag: "arcgis-text-card",
|
|
526
532
|
readOnly: !0,
|
|
527
533
|
properties: {
|
|
528
|
-
html: "<p>{{entity.description
|
|
534
|
+
html: "<p>{{entity.description}}</p>"
|
|
529
535
|
}
|
|
530
536
|
}
|
|
531
537
|
].filter(Boolean)
|
|
@@ -660,8 +666,8 @@ const I = async (t, e) => {
|
|
|
660
666
|
]
|
|
661
667
|
};
|
|
662
668
|
}, _ = async (t, e) => {
|
|
663
|
-
let
|
|
664
|
-
return E(t) === "project" ?
|
|
669
|
+
let a;
|
|
670
|
+
return E(t) === "project" ? a = await I(t, e) : a = await V(t), a;
|
|
665
671
|
};
|
|
666
672
|
class D extends L {
|
|
667
673
|
constructor() {
|
|
@@ -680,20 +686,20 @@ class D extends L {
|
|
|
680
686
|
return this.entity && E(this.entity);
|
|
681
687
|
}
|
|
682
688
|
willUpdate(e) {
|
|
683
|
-
e.has("entity") && this._init().catch((
|
|
684
|
-
c.error("Error initializing ArcgisHubEntityViewLayout >>>",
|
|
689
|
+
e.has("entity") && this._init().catch((a) => {
|
|
690
|
+
c.error("Error initializing ArcgisHubEntityViewLayout >>>", a);
|
|
685
691
|
});
|
|
686
692
|
}
|
|
687
693
|
async _init() {
|
|
688
694
|
let e;
|
|
689
|
-
this.entity && (e =
|
|
695
|
+
this.entity && (e = i(this.entity, "layout"), e || (e = await _(this.entity, this._context)), this._layout = e);
|
|
690
696
|
}
|
|
691
697
|
async _handleLayoutPublished(e) {
|
|
692
|
-
const { layout:
|
|
698
|
+
const { layout: a, successCallback: r } = e.detail;
|
|
693
699
|
try {
|
|
694
|
-
this._isPublishing = !0, this._layout =
|
|
695
|
-
const
|
|
696
|
-
|
|
700
|
+
this._isPublishing = !0, this._layout = a;
|
|
701
|
+
const s = m(this.entity);
|
|
702
|
+
s.layout = a, await P(this._entityType, s, this._context), r && await r(), c.info(`Successfully published layout for ${this._entityType} ${this.entity.id} >>>`, this._layout), b({
|
|
697
703
|
title: this._messages.publishSuccess,
|
|
698
704
|
message: "",
|
|
699
705
|
configuration: {
|
|
@@ -708,8 +714,8 @@ class D extends L {
|
|
|
708
714
|
...v.category.content.action.update.label.layout.details.publish,
|
|
709
715
|
response: w.response.SUCCESS
|
|
710
716
|
}), this.arcgisHubEntityViewPublished.emit();
|
|
711
|
-
} catch (
|
|
712
|
-
c.error(`Error publishing layout for ${this._entityType} ${this.entity.id} >>>`,
|
|
717
|
+
} catch (s) {
|
|
718
|
+
c.error(`Error publishing layout for ${this._entityType} ${this.entity.id} >>>`, s), b({
|
|
713
719
|
title: this._messages.publishError,
|
|
714
720
|
message: "",
|
|
715
721
|
configuration: {
|
|
@@ -729,8 +735,8 @@ class D extends L {
|
|
|
729
735
|
}
|
|
730
736
|
}
|
|
731
737
|
async _handleLayoutReset(e) {
|
|
732
|
-
const
|
|
733
|
-
|
|
738
|
+
const a = m(this.entity);
|
|
739
|
+
a.layout && delete a.layout, this._layout = await _(a, this._context), e.detail.successCallback && await e.detail.successCallback();
|
|
734
740
|
}
|
|
735
741
|
render() {
|
|
736
742
|
return this._layout ? f`<calcite-alert auto-close auto-close-duration=slow icon=information label="internal layout alert" kind=info open><div slot=title>${S(this._entityType || "")} view rendered as layout</div><div slot=message>We are rendering ${this._entityType} views on dev/QA alpha orgs using the new layout system. This system is
|