@arcgis/portal-components 5.2.0-next.37 → 5.2.0-next.39

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 (80) hide show
  1. package/dist/cdn/{T6JAFB2A.js → 2C475EKD.js} +1 -1
  2. package/dist/cdn/{OU2AR22N.js → 3J46PXFF.js} +1 -1
  3. package/dist/cdn/{GNBMYDRC.js → 3MBOA5WF.js} +1 -1
  4. package/dist/cdn/{GQFWFZXP.js → 3OBIA66A.js} +1 -1
  5. package/dist/cdn/{ADC752YM.js → 3Z3ZPFGJ.js} +1 -1
  6. package/dist/cdn/{6KRP5D52.js → 5NMFQE4U.js} +1 -1
  7. package/dist/cdn/5VPTTFBP.js +451 -0
  8. package/dist/cdn/{UR7W4CEV.js → 63THOLAY.js} +1 -1
  9. package/dist/cdn/{5H4VCRNA.js → 6DYBW2C6.js} +1 -1
  10. package/dist/cdn/{AX5KYSWU.js → 6RK4FBHZ.js} +1 -1
  11. package/dist/cdn/{JEXN44WM.js → 7E5GJIZV.js} +1 -1
  12. package/dist/cdn/A4CT6D4Y.js +2 -0
  13. package/dist/cdn/{E67OMPRM.js → AL57LV4E.js} +1 -1
  14. package/dist/cdn/{6XWNBD36.js → AXM6XCZD.js} +1 -1
  15. package/dist/cdn/{IILAKXVC.js → AYR65LXN.js} +1 -1
  16. package/dist/cdn/{7LC4ZEXB.js → BUJPYZSX.js} +1 -1
  17. package/dist/cdn/{DKBTJJMW.js → C7ZFXRPS.js} +1 -1
  18. package/dist/cdn/{QUEBM77K.js → D76KMXZD.js} +1 -1
  19. package/dist/cdn/EI6BAXCQ.js +2 -0
  20. package/dist/cdn/{YHXXIHQA.js → FXIP4QXJ.js} +1 -1
  21. package/dist/cdn/GE75KDIM.js +2 -0
  22. package/dist/cdn/{NZVLEDFZ.js → GJTJLK6T.js} +1 -1
  23. package/dist/cdn/{2XILGLOG.js → GKOXTQHB.js} +1 -1
  24. package/dist/cdn/{H6QISDOR.js → GQMPPCEL.js} +1 -1
  25. package/dist/cdn/{MM6SCKYE.js → GXJU3U7U.js} +1 -1
  26. package/dist/cdn/{VSAH76S7.js → HZ5W3DBR.js} +1 -1
  27. package/dist/cdn/{3ZYTCYNE.js → I5HSJRM3.js} +1 -1
  28. package/dist/cdn/IBP5XPD5.js +2 -0
  29. package/dist/cdn/IC65R4QE.js +2 -0
  30. package/dist/cdn/IHSJ4MKS.js +2 -0
  31. package/dist/cdn/{ULD747OT.js → IJ3CLFAU.js} +1 -1
  32. package/dist/cdn/{XNZQ5PXA.js → IWUJRI4G.js} +1 -1
  33. package/dist/cdn/{KPEWVVE5.js → IXVR3KMC.js} +1 -1
  34. package/dist/cdn/{4YGBHWHG.js → JS45DWQ3.js} +1 -1
  35. package/dist/cdn/{43IIAMZ3.js → JYIPREIH.js} +1 -1
  36. package/dist/cdn/{V7LZAIB6.js → JZKBUYPV.js} +1 -1
  37. package/dist/cdn/{G6YH7AFY.js → KM5XGRXL.js} +1 -1
  38. package/dist/cdn/{3PAHY5KA.js → KNRJ3WXR.js} +1 -1
  39. package/dist/cdn/{BUPFZ5MT.js → L4DRNGOL.js} +1 -1
  40. package/dist/cdn/{F6V7MLPY.js → L6KBBJEC.js} +1 -1
  41. package/dist/cdn/{BTYTNPSM.js → NJ2WDAJM.js} +1 -1
  42. package/dist/cdn/{XCZSPNKS.js → OT4PZJNB.js} +1 -1
  43. package/dist/cdn/{S745KWLM.js → QE4CNVDQ.js} +1 -1
  44. package/dist/cdn/{3MQIRMUM.js → QKCV7CY2.js} +1 -1
  45. package/dist/cdn/{3XVBYE54.js → RKNDXSVK.js} +1 -1
  46. package/dist/cdn/{S5XNEB7F.js → SLTFLCVR.js} +1 -1
  47. package/dist/cdn/{YCAVVVZV.js → SUPKZF5M.js} +1 -1
  48. package/dist/cdn/{Q22FWLJZ.js → TJAX7J4T.js} +1 -1
  49. package/dist/cdn/{DXCPWJU4.js → TKCE4WYE.js} +1 -1
  50. package/dist/cdn/TMRF4W62.js +637 -0
  51. package/dist/cdn/UZLQALHY.js +2 -0
  52. package/dist/cdn/{RR4BIAPA.js → V4EYW3O6.js} +1 -1
  53. package/dist/cdn/{74XFARCV.js → VW7DSKPH.js} +1 -1
  54. package/dist/cdn/{25UUUQAQ.js → W2SYL7IJ.js} +1 -1
  55. package/dist/cdn/{VRXKORTR.js → W4FGRGLV.js} +1 -1
  56. package/dist/cdn/{SYJSVUUR.js → W4SAWMXS.js} +1 -1
  57. package/dist/cdn/{EZ3BR2FP.js → WBZLQZYR.js} +1 -1
  58. package/dist/cdn/{Z2ZUXONU.js → WGZZB2DJ.js} +1 -1
  59. package/dist/cdn/{2MV6L7TF.js → WO23VQK3.js} +1 -1
  60. package/dist/cdn/{HVF4Z3VA.js → WSWHK6LB.js} +1 -1
  61. package/dist/cdn/{XHM6I6YG.js → WX65MRDH.js} +1 -1
  62. package/dist/cdn/{EIOSA4DR.js → ZPIXIG3Z.js} +1 -1
  63. package/dist/cdn/{HA2J6NDT.js → ZVFNCDG5.js} +1 -1
  64. package/dist/cdn/index.js +1 -1
  65. package/dist/docs/api.json +1 -1
  66. package/dist/docs/docs.json +1 -1
  67. package/dist/docs/vscode.html-custom-data.json +1 -1
  68. package/dist/docs/web-types.json +1 -1
  69. package/package.json +8 -8
  70. package/dist/cdn/5NIJVBS7.js +0 -422
  71. package/dist/cdn/7355NM43.js +0 -2
  72. package/dist/cdn/DWPIXEWQ.js +0 -2
  73. package/dist/cdn/G2YAOSMT.js +0 -2
  74. package/dist/cdn/J2KLHUBJ.js +0 -2
  75. package/dist/cdn/KDDYAFAF.js +0 -637
  76. package/dist/cdn/QUMJ5FTJ.js +0 -2
  77. package/dist/cdn/TW4LFQA5.js +0 -2
  78. package/dist/cdn/YIMNOUTF.js +0 -2
  79. /package/dist/cdn/{ZZ4DR3HN.js → JV23HJTE.js} +0 -0
  80. /package/dist/cdn/{ECNI2A4K.js → XEK22IDA.js} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{L as l,R as h,j as u,v as e}from"./ZZ4DR3HN.js";import"./YIMNOUTF.js";var o=class extends l{constructor(){super(...arguments),this.recognition=null,this.isListening=!1,this.status="idle",this.isSupported=!1,this.arcgisVoiceInputError=e(),this.arcgisVoiceInputInterimTranscription=e(),this.arcgisVoiceInputStart=e(),this.arcgisVoiceInputStop=e(),this.arcgisVoiceInputTranscription=e()}static{this.properties={isListening:16,status:16,isSupported:16,language:1}}async clearText(){this.status="idle"}async startListening(){if(!this.isSupported)return"not-supported";if(this.isListening)return"already-listening";if(!this.recognition)return"uninitialized";try{return this.recognition.start(),null}catch(n){return console.error("Failed to start listening",n),"unhandled"}}async stopListening(){this.isListening&&this.recognition?.stop()}connectedCallback(){super.connectedCallback(),this.initializeSpeechRecognition()}disconnectedCallback(){super.disconnectedCallback(),this.recognition&&this.recognition.stop()}initializeSpeechRecognition(){if(typeof window>"u")return;let n=window.SpeechRecognition??window.webkitSpeechRecognition;if(!n){this.isSupported=!1,this.arcgisVoiceInputError.emit({errorCode:"not-supported"});return}this.isSupported=!0;let t=new n;this.recognition=t,t.continuous=!0,t.interimResults=!0,this.language&&(t.lang=this.language),t.onstart=()=>{this.isListening=!0,this.status="listening",this.arcgisVoiceInputStart.emit()},t.onresult=s=>{let{finalTranscript:i,interimTranscript:a}=Array.from(s.results).slice(s.resultIndex).reduce((r,c)=>{let p=c[0].transcript;return c.isFinal?r.finalTranscript+=p:r.interimTranscript+=p,r},{finalTranscript:"",interimTranscript:""});i?this.arcgisVoiceInputTranscription.emit({text:i}):a&&this.arcgisVoiceInputInterimTranscription.emit({text:a})},t.onerror=s=>{this.isListening=!1,this.status="error";let i="unhandled";switch(s.error){case"no-speech":i="no-speech";break;case"service-not-allowed":case"not-allowed":i="not-allowed";break;default:i="unhandled";break}this.arcgisVoiceInputError.emit({errorCode:i})},t.onend=()=>{this.isListening=!1,this.status="idle",this.arcgisVoiceInputStop.emit()}}render(){return u`<slot></slot>`}};h("arcgis-portal-voice-input",o);export{o as ArcgisPortalVoiceInput};
2
+ import{L as l,R as h,j as u,v as e}from"./JV23HJTE.js";import"./UZLQALHY.js";var o=class extends l{constructor(){super(...arguments),this.recognition=null,this.isListening=!1,this.status="idle",this.isSupported=!1,this.arcgisVoiceInputError=e(),this.arcgisVoiceInputInterimTranscription=e(),this.arcgisVoiceInputStart=e(),this.arcgisVoiceInputStop=e(),this.arcgisVoiceInputTranscription=e()}static{this.properties={isListening:16,status:16,isSupported:16,language:1}}async clearText(){this.status="idle"}async startListening(){if(!this.isSupported)return"not-supported";if(this.isListening)return"already-listening";if(!this.recognition)return"uninitialized";try{return this.recognition.start(),null}catch(n){return console.error("Failed to start listening",n),"unhandled"}}async stopListening(){this.isListening&&this.recognition?.stop()}connectedCallback(){super.connectedCallback(),this.initializeSpeechRecognition()}disconnectedCallback(){super.disconnectedCallback(),this.recognition&&this.recognition.stop()}initializeSpeechRecognition(){if(typeof window>"u")return;let n=window.SpeechRecognition??window.webkitSpeechRecognition;if(!n){this.isSupported=!1,this.arcgisVoiceInputError.emit({errorCode:"not-supported"});return}this.isSupported=!0;let t=new n;this.recognition=t,t.continuous=!0,t.interimResults=!0,this.language&&(t.lang=this.language),t.onstart=()=>{this.isListening=!0,this.status="listening",this.arcgisVoiceInputStart.emit()},t.onresult=s=>{let{finalTranscript:i,interimTranscript:a}=Array.from(s.results).slice(s.resultIndex).reduce((r,c)=>{let p=c[0].transcript;return c.isFinal?r.finalTranscript+=p:r.interimTranscript+=p,r},{finalTranscript:"",interimTranscript:""});i?this.arcgisVoiceInputTranscription.emit({text:i}):a&&this.arcgisVoiceInputInterimTranscription.emit({text:a})},t.onerror=s=>{this.isListening=!1,this.status="error";let i="unhandled";switch(s.error){case"no-speech":i="no-speech";break;case"service-not-allowed":case"not-allowed":i="not-allowed";break;default:i="unhandled";break}this.arcgisVoiceInputError.emit({errorCode:i})},t.onend=()=>{this.isListening=!1,this.status="idle",this.arcgisVoiceInputStop.emit()}}render(){return u`<slot></slot>`}};h("arcgis-portal-voice-input",o);export{o as ArcgisPortalVoiceInput};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{i as o}from"./ZZ4DR3HN.js";var c={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},n=Symbol(),e=class{get taskComplete(){return this.t||(this.i===1?this.t=new Promise(((t,s)=>{this.o=t,this.h=s})):this.i===3?this.t=Promise.reject(this.l):this.t=Promise.resolve(this.u)),this.t}constructor(t,s,r){this.p=0,this.i=0,(this._=t).addController(this);let i=typeof s=="object"?s:{task:s,args:r};this.v=i.task,this.j=i.args,this.m=i.argsEqual??u,this.k=i.onComplete,this.A=i.onError,this.autoRun=i.autoRun??!0,"initialValue"in i&&(this.u=i.initialValue,this.i=2,this.O=this.T?.())}hostUpdate(){this.autoRun===!0&&this.S()}hostUpdated(){this.autoRun==="afterUpdate"&&this.S()}T(){if(this.j===void 0)return;let t=this.j();if(!Array.isArray(t))throw Error("The args function must return an array");return t}async S(){let t=this.T(),s=this.O;this.O=t,t===s||t===void 0||s!==void 0&&this.m(s,t)||await this.run(t)}async run(t){let s,r;t??=this.T(),this.O=t,this.i===1?this.q?.abort():(this.t=void 0,this.o=void 0,this.h=void 0),this.i=1,this.autoRun==="afterUpdate"?queueMicrotask((()=>this._.requestUpdate())):this._.requestUpdate();let i=++this.p;this.q=new AbortController;let a=!1;try{s=await this.v(t,{signal:this.q.signal})}catch(l){a=!0,r=l}if(this.p===i){if(s===n)this.i=0;else{if(a===!1){try{this.k?.(s)}catch{}this.i=2,this.o?.(s)}else{try{this.A?.(r)}catch{}this.i=3,this.h?.(r)}this.u=s,this.l=r}this._.requestUpdate()}}abort(t){this.i===1&&this.q?.abort(t)}get value(){return this.u}get error(){return this.l}get status(){return this.i}render(t){switch(this.i){case 0:return t.initial?.();case 1:return t.pending?.();case 2:return t.complete?.(this.value);case 3:return t.error?.(this.error);default:throw Error("Unexpected status: "+this.i)}}},u=(h,t)=>h===t||h.length===t.length&&h.every(((s,r)=>!o(s,t[r])));export{c as a,e as b};
2
+ import{i as o}from"./JV23HJTE.js";var c={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},n=Symbol(),e=class{get taskComplete(){return this.t||(this.i===1?this.t=new Promise(((t,s)=>{this.o=t,this.h=s})):this.i===3?this.t=Promise.reject(this.l):this.t=Promise.resolve(this.u)),this.t}constructor(t,s,r){this.p=0,this.i=0,(this._=t).addController(this);let i=typeof s=="object"?s:{task:s,args:r};this.v=i.task,this.j=i.args,this.m=i.argsEqual??u,this.k=i.onComplete,this.A=i.onError,this.autoRun=i.autoRun??!0,"initialValue"in i&&(this.u=i.initialValue,this.i=2,this.O=this.T?.())}hostUpdate(){this.autoRun===!0&&this.S()}hostUpdated(){this.autoRun==="afterUpdate"&&this.S()}T(){if(this.j===void 0)return;let t=this.j();if(!Array.isArray(t))throw Error("The args function must return an array");return t}async S(){let t=this.T(),s=this.O;this.O=t,t===s||t===void 0||s!==void 0&&this.m(s,t)||await this.run(t)}async run(t){let s,r;t??=this.T(),this.O=t,this.i===1?this.q?.abort():(this.t=void 0,this.o=void 0,this.h=void 0),this.i=1,this.autoRun==="afterUpdate"?queueMicrotask((()=>this._.requestUpdate())):this._.requestUpdate();let i=++this.p;this.q=new AbortController;let a=!1;try{s=await this.v(t,{signal:this.q.signal})}catch(l){a=!0,r=l}if(this.p===i){if(s===n)this.i=0;else{if(a===!1){try{this.k?.(s)}catch{}this.i=2,this.o?.(s)}else{try{this.A?.(r)}catch{}this.i=3,this.h?.(r)}this.u=s,this.l=r}this._.requestUpdate()}}abort(t){this.i===1&&this.q?.abort(t)}get value(){return this.u}get error(){return this.l}get status(){return this.i}render(t){switch(this.i){case 0:return t.initial?.();case 1:return t.pending?.();case 2:return t.complete?.(this.value);case 3:return t.error?.(this.error);default:throw Error("Unexpected status: "+this.i)}}},u=(h,t)=>h===t||h.length===t.length&&h.every(((s,r)=>!o(s,t[r])));export{c as a,e as b};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{A as k,B as w,C as V,D as m,E as h,F as A,G as D,H as y,k as P}from"./ZZ4DR3HN.js";var b=(s,f,c)=>{let p=new Map;for(let e=f;e<=c;e++)p.set(s[e],e);return p},I=w(class extends V{constructor(s){if(super(s),s.type!==k.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,f,c){let p;c===void 0?c=f:f!==void 0&&(p=f);let e=[],n=[],o=0;for(let a of s)e[o]=p?p(a,o):o,n[o]=c(a,o),o++;return{values:n,keys:e}}render(s,f,c){return this.dt(s,f,c).values}update(s,[f,c,p]){let e=D(s),{values:n,keys:o}=this.dt(f,c,p);if(!Array.isArray(e))return this.ut=o,n;let a=this.ut??=[],u=[],v,g,t=0,l=e.length-1,r=0,i=n.length-1;for(;t<=l&&r<=i;)if(e[t]===null)t++;else if(e[l]===null)l--;else if(a[t]===o[r])u[r]=h(e[t],n[r]),t++,r++;else if(a[l]===o[i])u[i]=h(e[l],n[i]),l--,i--;else if(a[t]===o[i])u[i]=h(e[t],n[i]),m(s,u[i+1],e[t]),t++,i--;else if(a[l]===o[r])u[r]=h(e[l],n[r]),m(s,e[t],e[l]),l--,r++;else if(v===void 0&&(v=b(o,r,i),g=b(a,t,l)),v.has(a[t]))if(v.has(a[l])){let d=g.get(o[r]),x=d!==void 0?e[d]:null;if(x===null){let C=m(s,e[t]);h(C,n[r]),u[r]=C}else u[r]=h(x,n[r]),m(s,e[t],x),e[d]=null;r++}else y(e[l]),l--;else y(e[t]),t++;for(;r<=i;){let d=m(s,u[i+1]);h(d,n[r]),u[r++]=d}for(;t<=l;){let d=e[t++];d!==null&&y(d)}return this.ut=o,A(s,u),P}});export{I as a};
2
+ import{A as k,B as w,C as V,D as m,E as h,F as A,G as D,H as y,k as P}from"./JV23HJTE.js";var b=(s,f,c)=>{let p=new Map;for(let e=f;e<=c;e++)p.set(s[e],e);return p},I=w(class extends V{constructor(s){if(super(s),s.type!==k.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,f,c){let p;c===void 0?c=f:f!==void 0&&(p=f);let e=[],n=[],o=0;for(let a of s)e[o]=p?p(a,o):o,n[o]=c(a,o),o++;return{values:n,keys:e}}render(s,f,c){return this.dt(s,f,c).values}update(s,[f,c,p]){let e=D(s),{values:n,keys:o}=this.dt(f,c,p);if(!Array.isArray(e))return this.ut=o,n;let a=this.ut??=[],u=[],v,g,t=0,l=e.length-1,r=0,i=n.length-1;for(;t<=l&&r<=i;)if(e[t]===null)t++;else if(e[l]===null)l--;else if(a[t]===o[r])u[r]=h(e[t],n[r]),t++,r++;else if(a[l]===o[i])u[i]=h(e[l],n[i]),l--,i--;else if(a[t]===o[i])u[i]=h(e[t],n[i]),m(s,u[i+1],e[t]),t++,i--;else if(a[l]===o[r])u[r]=h(e[l],n[r]),m(s,e[t],e[l]),l--,r++;else if(v===void 0&&(v=b(o,r,i),g=b(a,t,l)),v.has(a[t]))if(v.has(a[l])){let d=g.get(o[r]),x=d!==void 0?e[d]:null;if(x===null){let C=m(s,e[t]);h(C,n[r]),u[r]=C}else u[r]=h(x,n[r]),m(s,e[t],x),e[d]=null;r++}else y(e[l]),l--;else y(e[t]),t++;for(;r<=i;){let d=m(s,u[i+1]);h(d,n[r]),u[r++]=d}for(;t<=l;){let d=e[t++];d!==null&&y(d)}return this.ut=o,A(s,u),P}});export{I as a};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import b from"./NZVLEDFZ.js";import a from"./JEXN44WM.js";import"./QUEBM77K.js";import{L as o,R as s,j as e,v as r}from"./ZZ4DR3HN.js";import"./YIMNOUTF.js";export default $arcgis.t(([,{c:n}])=>{var c=960,i=class extends o{constructor(){super(...arguments),this.options=[],this.view="",this.viewText="View",this.store=n(),this.arcgisBrowserViewChange=r()}static{this.properties={options:0,view:1,viewText:1,store:0}}renderOption(t){return e`<calcite-dropdown-item .selected=${t.value===this.view} @calciteDropdownItemSelect=${()=>{this.arcgisBrowserViewChange.emit(t.value)}} .iconStart=${t.value} icon-flip-rtl=start>${t.title}</calcite-dropdown-item>`}renderButton(){let t=this.options.find(a=>a.value===this.view),l=this.store.width||window.innerWidth;return e`<calcite-button class="button" slot=trigger scale=m appearance=outline-fill kind=neutral .iconStart=${t?.value} icon-flip-rtl=start .label=${`${this.viewText}: ${t?.title||""}`}>${l>c?t?.title:null}</calcite-button>`}render(){return e`<calcite-dropdown placement=bottom-end scale=m overlay-positioning=fixed width=s>${this.renderButton()}<calcite-dropdown-group selection-mode=single>${this.options.map(t=>this.renderOption(t))}</calcite-dropdown-group></calcite-dropdown>`}};s("arcgis-portal-browser-view",i);return i},a,b)
2
+ import b from"./GJTJLK6T.js";import a from"./7E5GJIZV.js";import"./D76KMXZD.js";import{L as o,R as s,j as e,v as r}from"./JV23HJTE.js";import"./UZLQALHY.js";export default $arcgis.t(([,{c:n}])=>{var c=960,i=class extends o{constructor(){super(...arguments),this.options=[],this.view="",this.viewText="View",this.store=n(),this.arcgisBrowserViewChange=r()}static{this.properties={options:0,view:1,viewText:1,store:0}}renderOption(t){return e`<calcite-dropdown-item .selected=${t.value===this.view} @calciteDropdownItemSelect=${()=>{this.arcgisBrowserViewChange.emit(t.value)}} .iconStart=${t.value} icon-flip-rtl=start>${t.title}</calcite-dropdown-item>`}renderButton(){let t=this.options.find(a=>a.value===this.view),l=this.store.width||window.innerWidth;return e`<calcite-button class="button" slot=trigger scale=m appearance=outline-fill kind=neutral .iconStart=${t?.value} icon-flip-rtl=start .label=${`${this.viewText}: ${t?.title||""}`}>${l>c?t?.title:null}</calcite-button>`}render(){return e`<calcite-dropdown placement=bottom-end scale=m overlay-positioning=fixed width=s>${this.renderButton()}<calcite-dropdown-group selection-mode=single>${this.options.map(t=>this.renderOption(t))}</calcite-dropdown-group></calcite-dropdown>`}};s("arcgis-portal-browser-view",i);return i},a,b)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as y}from"./ECNI2A4K.js";import{a as v}from"./6XWNBD36.js";import{J as d,K as u,L as g,O as m,R as p,h,j as n,v as l}from"./ZZ4DR3HN.js";export default $arcgis.t(([{watch:w}])=>{var c=1440*60*1e3;function i(a){let e=typeof a=="string"?Number.parseInt(a,10):typeof a=="number"?a:(a??new Date).valueOf(),t=new Date(e);return t.setHours(0,0,0,0),t.valueOf()}function f(a){return i(a)+c-1}var b=7*c,$=h`:host{display:block}.custom-date-picker{margin-top:.5rem;margin-bottom:.5rem;margin-inline-start:1.75rem;width:12.75rem}`,D=["custom","last30","last7","never","today","yesterday"],o=class extends g{constructor(){super(...arguments),this._messages=v({name:"portal-browser",blocking:!0}),this._datePicker=d(),this.today="",this.debouncedRangeChangeHandler=y(()=>this.rangeChangeHandler(),200),this.property="created",this.range=null,this.expanded=!1,this.includeNever=!1,this.arcgisBrowserFilter=l()}static{this.properties={property:1,serverProperty:1,range:1,start:1,end:1,store:0,expanded:5,includeNever:5}}static{this.styles=$}connectedCallback(){super.connectedCallback();let e=new Date;this.today=`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`,this.attachStoreWatcher(),this.range&&(this.range!=="custom"||this.start&&this.end)&&this.arcgisBrowserFilter.emit(this.getEventDetail())}willUpdate(e){(e.has("store")||e.has("property"))&&this.attachStoreWatcher(),(e.has("range")||e.has("start")||e.has("end"))&&this.range==="custom"&&this.setDatePickerValue()}disconnectedCallback(){this.removeStoreWatcher?.(),super.disconnectedCallback()}attachStoreWatcher(){if(this.removeStoreWatcher?.(),!this.store)return;let e=w(()=>{let t=this.store?.filters?.[this.property];return{value:t?.value,additionalParams:t?.additionalParams}},()=>{let t=this.store?.filters?.[this.property];!(t?.value||t?.additionalParams)&&this.isActive()&&this.resetDatePicker()});this.removeStoreWatcher=()=>e.remove()}resetDatePicker(){this.range=null,this.start=null,this.end=null,this._datePicker.value&&(this._datePicker.value.valueAsDate=[])}getValue(){let e=i(),t=f();switch(this.range){case"yesterday":return[e-c,e-1];case"today":return[e,t];case"last7":return[e-b,t];case"last30":return[e-c*30,t];case"never":return[-1,-1];case"custom":{let r=i(this.start),s=f(this.end);return[r,s]}default:return null}}getEventDetail(){let e=this._messages?.filterDate,t=this.getValue(),r=this.serverProperty??(this.property==="modified"?"modified":"uploaded"),s=this.range?e?.[this.range]??"":"",k=e?.[this.property]??"";return{id:this.property,value:t?`(${r}:[${t[0]} TO ${t[1]}])`:"",range:this.range,start:t?new Date(t[0]):void 0,end:t?new Date(t[1]):void 0,label:this.range?k.replace("${date}",s):""}}isActive(){return!!(this.range&&(this.range!=="custom"||this.start&&this.end))}setDatePickerValue(){!this._datePicker.value||this.range!=="custom"||!this.start||!this.end||(this._datePicker.value.valueAsDate=[new Date(i(this.start)),new Date(i(this.end))])}rangeChangeHandler(){let e=this._datePicker.value?.valueAsDate,[t,r]=Array.isArray(e)?e:[];t&&r&&(this.start=t,this.end=r,this.arcgisBrowserFilter.emit(this.getEventDetail()))}renderRange(e){let t=this._messages.filterDate;return n`<calcite-tree-item data-range=${e??m} .selected=${e===this.range}>${t[e]}</calcite-tree-item>`}render(){let e=this._messages.filterDate,t=this.includeNever?D:D.filter(r=>r!=="never");return n`<arcgis-portal-browser-filter .heading=${e.title[this.property]} .expanded=${this.expanded} .active=${this.isActive()} .filterId=${this.property} @arcgisBrowserFilterRemove=${()=>{this.resetDatePicker(),this.arcgisBrowserFilter.emit(this.getEventDetail())}}><calcite-tree selection-mode=children scale=m @calciteTreeSelect=${r=>{let s=r.target.selectedItems?.[0]?.dataset.range;this.range=this.range===s?null:s,!(this.range==="custom"&&!(this.start&&this.end))&&this.arcgisBrowserFilter.emit(this.getEventDetail())}}>${t.map(r=>this.renderRange(r))}</calcite-tree>${this.range==="custom"&&n`<calcite-input-date-picker class="custom-date-picker" @calciteInputDatePickerChange=${()=>this.debouncedRangeChangeHandler()} scale=s .max=${this.today} calendars=1 layout=vertical month-style=abbreviated proximity-selection-disabled range ${u(this._datePicker)}></calcite-input-date-picker>`||""}</arcgis-portal-browser-filter>`}};p("arcgis-portal-browser-filter-date",o);return o},"core/reactiveUtils")
2
+ import{a as y}from"./XEK22IDA.js";import{a as v}from"./AXM6XCZD.js";import{J as d,K as u,L as g,O as m,R as p,h,j as n,v as l}from"./JV23HJTE.js";export default $arcgis.t(([{watch:w}])=>{var c=1440*60*1e3;function i(a){let e=typeof a=="string"?Number.parseInt(a,10):typeof a=="number"?a:(a??new Date).valueOf(),t=new Date(e);return t.setHours(0,0,0,0),t.valueOf()}function f(a){return i(a)+c-1}var b=7*c,$=h`:host{display:block}.custom-date-picker{margin-top:.5rem;margin-bottom:.5rem;margin-inline-start:1.75rem;width:12.75rem}`,D=["custom","last30","last7","never","today","yesterday"],o=class extends g{constructor(){super(...arguments),this._messages=v({name:"portal-browser",blocking:!0}),this._datePicker=d(),this.today="",this.debouncedRangeChangeHandler=y(()=>this.rangeChangeHandler(),200),this.property="created",this.range=null,this.expanded=!1,this.includeNever=!1,this.arcgisBrowserFilter=l()}static{this.properties={property:1,serverProperty:1,range:1,start:1,end:1,store:0,expanded:5,includeNever:5}}static{this.styles=$}connectedCallback(){super.connectedCallback();let e=new Date;this.today=`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`,this.attachStoreWatcher(),this.range&&(this.range!=="custom"||this.start&&this.end)&&this.arcgisBrowserFilter.emit(this.getEventDetail())}willUpdate(e){(e.has("store")||e.has("property"))&&this.attachStoreWatcher(),(e.has("range")||e.has("start")||e.has("end"))&&this.range==="custom"&&this.setDatePickerValue()}disconnectedCallback(){this.removeStoreWatcher?.(),super.disconnectedCallback()}attachStoreWatcher(){if(this.removeStoreWatcher?.(),!this.store)return;let e=w(()=>{let t=this.store?.filters?.[this.property];return{value:t?.value,additionalParams:t?.additionalParams}},()=>{let t=this.store?.filters?.[this.property];!(t?.value||t?.additionalParams)&&this.isActive()&&this.resetDatePicker()});this.removeStoreWatcher=()=>e.remove()}resetDatePicker(){this.range=null,this.start=null,this.end=null,this._datePicker.value&&(this._datePicker.value.valueAsDate=[])}getValue(){let e=i(),t=f();switch(this.range){case"yesterday":return[e-c,e-1];case"today":return[e,t];case"last7":return[e-b,t];case"last30":return[e-c*30,t];case"never":return[-1,-1];case"custom":{let r=i(this.start),s=f(this.end);return[r,s]}default:return null}}getEventDetail(){let e=this._messages?.filterDate,t=this.getValue(),r=this.serverProperty??(this.property==="modified"?"modified":"uploaded"),s=this.range?e?.[this.range]??"":"",k=e?.[this.property]??"";return{id:this.property,value:t?`(${r}:[${t[0]} TO ${t[1]}])`:"",range:this.range,start:t?new Date(t[0]):void 0,end:t?new Date(t[1]):void 0,label:this.range?k.replace("${date}",s):""}}isActive(){return!!(this.range&&(this.range!=="custom"||this.start&&this.end))}setDatePickerValue(){!this._datePicker.value||this.range!=="custom"||!this.start||!this.end||(this._datePicker.value.valueAsDate=[new Date(i(this.start)),new Date(i(this.end))])}rangeChangeHandler(){let e=this._datePicker.value?.valueAsDate,[t,r]=Array.isArray(e)?e:[];t&&r&&(this.start=t,this.end=r,this.arcgisBrowserFilter.emit(this.getEventDetail()))}renderRange(e){let t=this._messages.filterDate;return n`<calcite-tree-item data-range=${e??m} .selected=${e===this.range}>${t[e]}</calcite-tree-item>`}render(){let e=this._messages.filterDate,t=this.includeNever?D:D.filter(r=>r!=="never");return n`<arcgis-portal-browser-filter .heading=${e.title[this.property]} .expanded=${this.expanded} .active=${this.isActive()} .filterId=${this.property} @arcgisBrowserFilterRemove=${()=>{this.resetDatePicker(),this.arcgisBrowserFilter.emit(this.getEventDetail())}}><calcite-tree selection-mode=children scale=m @calciteTreeSelect=${r=>{let s=r.target.selectedItems?.[0]?.dataset.range;this.range=this.range===s?null:s,!(this.range==="custom"&&!(this.start&&this.end))&&this.arcgisBrowserFilter.emit(this.getEventDetail())}}>${t.map(r=>this.renderRange(r))}</calcite-tree>${this.range==="custom"&&n`<calcite-input-date-picker class="custom-date-picker" @calciteInputDatePickerChange=${()=>this.debouncedRangeChangeHandler()} scale=s .max=${this.today} calendars=1 layout=vertical month-style=abbreviated proximity-selection-disabled range ${u(this._datePicker)}></calcite-input-date-picker>`||""}</arcgis-portal-browser-filter>`}};p("arcgis-portal-browser-filter-date",o);return o},"core/reactiveUtils")
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"./YIMNOUTF.js";var e=`## ArcgisKnowledge Agent - Lucene Generation for Graph Search
2
+ import"./UZLQALHY.js";var e=`## ArcgisKnowledge Agent - Lucene Generation for Graph Search
3
3
 
4
4
  You are an assistant that generates a lucene query for graph query searching.
5
5
 
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import d from"./BTYTNPSM.js";import b from"./O3KBWLGU.js";import"./4YGBHWHG.js";import a from"./JEXN44WM.js";import{a as f}from"./6XWNBD36.js";import"./G2YAOSMT.js";import"./QUEBM77K.js";import{L as n,N as c,R as l,h as e,j as s,p as o}from"./ZZ4DR3HN.js";import"./YIMNOUTF.js";export default $arcgis.t(([,,{a:d,b:h}])=>{var p=e`.banner{box-sizing:border-box;width:100%;left:0;text-align:center;font-family:var(--calcite-font-family);background-color:#fff;color:#000;padding:var(--calcite-spacing-sm);font-size:var(--calcite-font-size);text-transform:uppercase;overflow-wrap:break-word}.invalid-container{background-color:#fff;color:#000;display:flex;align-items:center;justify-content:center;gap:8px}.invalid-icon{--calcite-icon-color: var(--calcite-color-status-danger)}.invalid-message{text-align:center;font-family:var(--calcite-font-family);background-color:#fff;color:#000;padding:var(--calcite-spacing-sm);font-size:var(--calcite-font-size);overflow-wrap:break-word}`,r=class extends n{constructor(){super(...arguments),this.classificationModel=d(this),this.messages=f(),this._classificationDataTask=h(this),this.portalClassificationSchema=this.classificationModel.portalClassificationSchema,this.status=this.classificationModel.status,this.missingExistingClassification=!1,this.variant="full",this.autoDestroyDisabled=!1,this.validationErrors=""}static{this.properties={portalClassificationSchema:16,status:16,itemClassification:16,portalItem:0,missingExistingClassification:5,variant:1,autoDestroyDisabled:5,validationErrors:1}}static{this.styles=p}async destroy(){await this.manager.destroy()}willUpdate(a){if(a.has("portalItem")){let{portalItem:i}=this;i?.load().then(()=>{i?.id&&i?.loaded&&i?.classification&&!this.missingExistingClassification?this.classificationModel.validateClassification(this.variant==="preview"?null:i.id,i.classification,i?.portal.restUrl).catch(o(this)).then(t=>{this.validationErrors=t??""}):this.validationErrors=""}).catch(o(this))}}getStyle(){let a={};if(this.variant==="preview"&&(a.fontSize="var(--calcite-font-size-sm)",a.padding="var(--calcite-spacing-xs)"),this.itemClassification&&this.portalClassificationSchema){let i=this.itemClassification.classification,t=this.portalClassificationSchema.classificationMetadata.classificationValueProperties.find(({value:m})=>m===i);t?.backgroundColor&&(a.backgroundColor=t.backgroundColor),t?.textColor&&(a.color=t.textColor)}return a}render(){return this._classificationDataTask.render({pending:void 0,error:void 0,complete:()=>this.portalClassificationSchema&&this.portalItem?.portal.authMode!=="anonymous"?this.validationErrors&&this.variant==="full"?s`<div class="invalid-container"><calcite-icon class="invalid-icon" scale=s icon=exclamation-mark-triangle .textLabel=${this.messages.invalidclassificationerror}></calcite-icon><span class="invalid-message">${this.messages.invalidclassificationerror}</span></div>`:s`<div class="banner" style=${c(this.getStyle())}>${this.itemClassification?.banner??this.messages.notyetclassified??"Not yet classified"}</div>`:""})}};l("arcgis-portal-classification-banner",r);return r},a,b,d)
2
+ import d from"./NJ2WDAJM.js";import b from"./O3KBWLGU.js";import"./JS45DWQ3.js";import a from"./7E5GJIZV.js";import{a as f}from"./AXM6XCZD.js";import"./IBP5XPD5.js";import"./D76KMXZD.js";import{L as n,N as c,R as l,h as e,j as s,p as o}from"./JV23HJTE.js";import"./UZLQALHY.js";export default $arcgis.t(([,,{a:d,b:h}])=>{var p=e`.banner{box-sizing:border-box;width:100%;left:0;text-align:center;font-family:var(--calcite-font-family);background-color:#fff;color:#000;padding:var(--calcite-spacing-sm);font-size:var(--calcite-font-size);text-transform:uppercase;overflow-wrap:break-word}.invalid-container{background-color:#fff;color:#000;display:flex;align-items:center;justify-content:center;gap:8px}.invalid-icon{--calcite-icon-color: var(--calcite-color-status-danger)}.invalid-message{text-align:center;font-family:var(--calcite-font-family);background-color:#fff;color:#000;padding:var(--calcite-spacing-sm);font-size:var(--calcite-font-size);overflow-wrap:break-word}`,r=class extends n{constructor(){super(...arguments),this.classificationModel=d(this),this.messages=f(),this._classificationDataTask=h(this),this.portalClassificationSchema=this.classificationModel.portalClassificationSchema,this.status=this.classificationModel.status,this.missingExistingClassification=!1,this.variant="full",this.autoDestroyDisabled=!1,this.validationErrors=""}static{this.properties={portalClassificationSchema:16,status:16,itemClassification:16,portalItem:0,missingExistingClassification:5,variant:1,autoDestroyDisabled:5,validationErrors:1}}static{this.styles=p}async destroy(){await this.manager.destroy()}willUpdate(a){if(a.has("portalItem")){let{portalItem:i}=this;i?.load().then(()=>{i?.id&&i?.loaded&&i?.classification&&!this.missingExistingClassification?this.classificationModel.validateClassification(this.variant==="preview"?null:i.id,i.classification,i?.portal.restUrl).catch(o(this)).then(t=>{this.validationErrors=t??""}):this.validationErrors=""}).catch(o(this))}}getStyle(){let a={};if(this.variant==="preview"&&(a.fontSize="var(--calcite-font-size-sm)",a.padding="var(--calcite-spacing-xs)"),this.itemClassification&&this.portalClassificationSchema){let i=this.itemClassification.classification,t=this.portalClassificationSchema.classificationMetadata.classificationValueProperties.find(({value:m})=>m===i);t?.backgroundColor&&(a.backgroundColor=t.backgroundColor),t?.textColor&&(a.color=t.textColor)}return a}render(){return this._classificationDataTask.render({pending:void 0,error:void 0,complete:()=>this.portalClassificationSchema&&this.portalItem?.portal.authMode!=="anonymous"?this.validationErrors&&this.variant==="full"?s`<div class="invalid-container"><calcite-icon class="invalid-icon" scale=s icon=exclamation-mark-triangle .textLabel=${this.messages.invalidclassificationerror}></calcite-icon><span class="invalid-message">${this.messages.invalidclassificationerror}</span></div>`:s`<div class="banner" style=${c(this.getStyle())}>${this.itemClassification?.banner??this.messages.notyetclassified??"Not yet classified"}</div>`:""})}};l("arcgis-portal-classification-banner",r);return r},a,b,d)
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"./YIMNOUTF.js";var e=`# Navigation Tool Instructions
2
+ import"./UZLQALHY.js";var e=`# Navigation Tool Instructions
3
3
 
4
4
  CRITICAL: You are FORBIDDEN from making multiple tool calls. You MUST make exactly ONE tool call.
5
5
 
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import b from"./O3KBWLGU.js";import{b as h}from"./4YGBHWHG.js";import a from"./JEXN44WM.js";import{n as f}from"./ZZ4DR3HN.js";export default $arcgis.t(([g,{property:c,subclass:C},{a:p},{a:d,b:m}])=>{var w=Object.defineProperty,y=Object.getOwnPropertyDescriptor,e=(t,a,s,i)=>{for(var r=i>1?void 0:i?y(a,s):a,l=t.length-1,n;l>=0;l--)(n=t[l])&&(r=(i?n(a,s,r):n(r))||r);return i&&r&&w(a,s,r),r},o=class extends g{constructor(){super(...arguments),this.fetching=!1,this.status="idle",this.error=void 0,this.portalUrl=void 0,this._itemClassificationValidationErrors=new Map,this.fetchingPromise=new f}get primaryAttribute(){return this.portalClassificationSchema?.classificationMetadata.primaryAttribute}setPortalClassificationData({portalUrl:t,schema:a}){this.portalUrl=t,this.portalClassificationSchema=a,this.status="loaded",this.fetchingPromise.resolve(!0)}setFetching(t){this.fetching=t}async loadPortalClassificationData(t,{signal:a}){this.status="loading";let{result:s,error:i}=await d(t,a);if(i){i.name==="AbortError"?console.log("Request aborted."):(this.error=i,this.status="error",this.fetchingPromise.reject(i));return}else this.setPortalClassificationData({schema:s,portalUrl:t})}async validateClassification(t,a,s,i){if(!a)return"";let r=t?this._itemClassificationValidationErrors.get(t):void 0;if(r)return await r;let l=(async()=>{let{error:n}=await m(s,a,i??{});return n?n?.details.raw.messages.join(", "):""})();return t&&this._itemClassificationValidationErrors.set(t,l),t?await this._itemClassificationValidationErrors.get(t):await l}};e([c()],o.prototype,"portalClassificationSchema",2);e([c()],o.prototype,"fetching",2);e([c()],o.prototype,"status",2);e([c()],o.prototype,"error",2);e([c()],o.prototype,"portalUrl",2);e([c()],o.prototype,"_itemClassificationValidationErrors",2);o=e([C("custom.ClassificationModel")],o);var u;function P(t){return u??=new o(t),u}var A=p(P),S=t=>new h(t,{task:async([a],{signal:s})=>{if(!a)throw new Error("Portal item is required to load classification data");if(a.loaded||await a.load({signal:s}),t.itemClassification=a.classification,t.classificationModel.status==="loading"&&await t.classificationModel.fetchingPromise.promise,!t.portalItem?.portal.hasClassificationSchema){t.classificationModel.setPortalClassificationData({portalUrl:a.portal.restUrl,schema:void 0});return}(t.classificationModel.status==="idle"||t.classificationModel.status==="loaded"&&t.classificationModel.portalUrl!==a.portal.restUrl)&&await t.classificationModel.loadPortalClassificationData(a.portal.restUrl,{signal:s})},args:()=>[t.portalItem]});return{a:A,b:S}},"core/Accessor","core/accessorSupport/decorators",a,b)
2
+ import b from"./O3KBWLGU.js";import{b as h}from"./JS45DWQ3.js";import a from"./7E5GJIZV.js";import{n as f}from"./JV23HJTE.js";export default $arcgis.t(([g,{property:c,subclass:C},{a:p},{a:d,b:m}])=>{var w=Object.defineProperty,y=Object.getOwnPropertyDescriptor,e=(t,a,s,i)=>{for(var r=i>1?void 0:i?y(a,s):a,l=t.length-1,n;l>=0;l--)(n=t[l])&&(r=(i?n(a,s,r):n(r))||r);return i&&r&&w(a,s,r),r},o=class extends g{constructor(){super(...arguments),this.fetching=!1,this.status="idle",this.error=void 0,this.portalUrl=void 0,this._itemClassificationValidationErrors=new Map,this.fetchingPromise=new f}get primaryAttribute(){return this.portalClassificationSchema?.classificationMetadata.primaryAttribute}setPortalClassificationData({portalUrl:t,schema:a}){this.portalUrl=t,this.portalClassificationSchema=a,this.status="loaded",this.fetchingPromise.resolve(!0)}setFetching(t){this.fetching=t}async loadPortalClassificationData(t,{signal:a}){this.status="loading";let{result:s,error:i}=await d(t,a);if(i){i.name==="AbortError"?console.log("Request aborted."):(this.error=i,this.status="error",this.fetchingPromise.reject(i));return}else this.setPortalClassificationData({schema:s,portalUrl:t})}async validateClassification(t,a,s,i){if(!a)return"";let r=t?this._itemClassificationValidationErrors.get(t):void 0;if(r)return await r;let l=(async()=>{let{error:n}=await m(s,a,i??{});return n?n?.details.raw.messages.join(", "):""})();return t&&this._itemClassificationValidationErrors.set(t,l),t?await this._itemClassificationValidationErrors.get(t):await l}};e([c()],o.prototype,"portalClassificationSchema",2);e([c()],o.prototype,"fetching",2);e([c()],o.prototype,"status",2);e([c()],o.prototype,"error",2);e([c()],o.prototype,"portalUrl",2);e([c()],o.prototype,"_itemClassificationValidationErrors",2);o=e([C("custom.ClassificationModel")],o);var u;function P(t){return u??=new o(t),u}var A=p(P),S=t=>new h(t,{task:async([a],{signal:s})=>{if(!a)throw new Error("Portal item is required to load classification data");if(a.loaded||await a.load({signal:s}),t.itemClassification=a.classification,t.classificationModel.status==="loading"&&await t.classificationModel.fetchingPromise.promise,!t.portalItem?.portal.hasClassificationSchema){t.classificationModel.setPortalClassificationData({portalUrl:a.portal.restUrl,schema:void 0});return}(t.classificationModel.status==="idle"||t.classificationModel.status==="loaded"&&t.classificationModel.portalUrl!==a.portal.restUrl)&&await t.classificationModel.loadPortalClassificationData(a.portal.restUrl,{signal:s})},args:()=>[t.portalItem]});return{a:A,b:S}},"core/Accessor","core/accessorSupport/decorators",a,b)
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"./YIMNOUTF.js";var e=`## GIS Agent Orchestrator
2
+ import"./UZLQALHY.js";var e=`## GIS Agent Orchestrator
3
3
 
4
4
  You are an orchestrator for an ArcGIS Maps SDK for JavaScript system.
5
5
 
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"./YIMNOUTF.js";var e=`## Membership Bind Parameters
2
+ import"./UZLQALHY.js";var e=`## Membership Bind Parameters
3
3
 
4
4
  The current map contains a subset of entities and relationships from the database. Their membership is available to Cypher queries as lists of string identifiers through these bind parameters:
5
5
 
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"./YIMNOUTF.js";var e=`## Task: Summarize Geographic Features
2
+ import"./UZLQALHY.js";var e=`## Task: Summarize Geographic Features
3
3
 
4
4
  You are given features from ArcGIS Feature layer for multiple layers:
5
5
  {queryResponse}
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as m}from"./43IIAMZ3.js";import{a as h}from"./6XWNBD36.js";import"./G2YAOSMT.js";import"./QUEBM77K.js";import{L as b,O as a,R as d,h as c,j as i,v as u}from"./ZZ4DR3HN.js";import"./YIMNOUTF.js";var g=c`.spacing-y{margin:var(--calcite-spacing-md) 0}.portal-classification-form-element-tooltip{display:flex;justify-content:space-between;align-items:center}`;function s(o,e){return o.uiElement===e}var n=class extends b{constructor(){super(...arguments),this.messages=h(),this.isRequiredErrors=new Set,this.arcgisAttributeValueChange=u()}static{this.properties={validationMsg:16,attributeKey:1,attribute:0,value:0,renderingInfo:0,isRequiredErrors:0}}static{this.styles=g}willUpdate(e){(e.has("renderingInfo")||e.has("isRequiredErrors"))&&(this.validationMsg=this._getValidationMessage())}_getValidationMessage(){if(this.renderingInfo?.attributeValidationResult)return this.renderingInfo.attributeValidationResult;if(this.isRequiredErrors.has(this.attributeKey))return this.messages.requiredfield??"This is a required field."}renderCheckbox(){return s(this.attribute,"checkbox")?i`<calcite-label class="spacing-y" .for=${this.attributeKey} layout=inline><calcite-checkbox .checked=${this.value} id=${this.attributeKey??a} @calciteCheckboxChange=${e=>this.arcgisAttributeValueChange.emit({[this.attributeKey]:e.target.checked})} .required=${this.attribute.isRequired??!1} .status=${this.validationMsg?"invalid":"valid"}></calcite-checkbox>${this.attribute.label}</calcite-label>`:null}renderDateInput(){return s(this.attribute,"date")?i`<calcite-label .for=${this.attributeKey}>${this.attribute.label}<calcite-input-date-picker id=${this.attributeKey??a} .name=${this.attribute.label} @calciteInputDatePickerChange=${e=>this.isConnected&&this.arcgisAttributeValueChange.emit({[this.attributeKey]:e.target.value})} overlay-positioning=fixed .required=${this.attribute.isRequired} .status=${this.validationMsg?"invalid":"valid"} validation-icon=exclamation-mark-triangle .validationMessage=${this.validationMsg} .value=${this.value}></calcite-input-date-picker></calcite-label>`:null}renderTextInput(){if(!s(this.attribute,"text"))return null;let e=this.attribute.label,t=this.attribute.description;return i`<calcite-label .for=${this.attributeKey}><div class="portal-classification-form-element-tooltip">${e}${this.attribute.labelTooltip&&i`<div><calcite-icon scale=s icon=information .id=${`tooltip-button-${this.attribute.bannerLabel}`} text-label=${this.messages.information??"Information"??a}></calcite-icon><calcite-tooltip .referenceElement=${`tooltip-button-${this.attribute.bannerLabel}`} placement=right>${this.attribute.labelTooltip}</calcite-tooltip></div>`||""}</div><calcite-input-text id=${this.attributeKey??a} .label=${e} .name=${this.attributeKey} @calciteInputTextChange=${r=>this.arcgisAttributeValueChange.emit({[this.attributeKey]:r.target.value})} .placeholder=${t} .required=${this.attribute.isRequired} .status=${this.validationMsg?"invalid":"valid"} validation-icon=exclamation-mark-triangle .validationMessage=${this.validationMsg} .value=${this.value}></calcite-input-text></calcite-label>`}renderSingleSelect(){return s(this.attribute,"single-select")?i`<calcite-label .for=${this.attributeKey}>${this.attribute.label}<calcite-combobox selection-mode=single id=${this.attributeKey??a} .label=${this.attribute.label} .name=${this.attributeKey} @calciteComboboxChange=${e=>this.arcgisAttributeValueChange.emit({[this.attributeKey]:e.target.value})} .placeholder=${this.attribute.description??this.messages.selectanoption} .required=${this.attribute.isRequired} .status=${this.validationMsg?"invalid":"valid"} overlay-positioning=fixed validation-icon=exclamation-mark-triangle .validationMessage=${this.validationMsg} .value=${this.value} data-testid=${`single-select-${this.attributeKey}`}>${this._renderSingleSelectComboboxOptions()}</calcite-combobox></calcite-label>`:null}_renderSingleSelectComboboxOptions(){if(!Array.isArray(this.renderingInfo?.valueExpressionResult))return;let e=this.value;return m(this.renderingInfo?.valueExpressionResult,t=>t.label,t=>i`<calcite-combobox-item .selected=${e===t.value} .heading=${t.label} .value=${t.value} data-testid=${`single-combobox-item-${t.value}`}></calcite-combobox-item>`)}_renderComboboxOptions(){if(!Array.isArray(this.renderingInfo?.valueExpressionResult))return;let e=this.value;return this.renderingInfo?.valueExpressionResult.map(t=>i`<calcite-combobox-item .selected=${e?.includes(t.value)} .heading=${t.label} .value=${t.value} data-testid=${`combobox-item-${t.value}`}></calcite-combobox-item>`)}renderMultiSelect(){return s(this.attribute,"multi-select")?i`<calcite-label .for=${this.attributeKey}>${this.attribute.label}<calcite-combobox id=${this.attributeKey??a} .label=${this.attribute.label} .name=${this.attributeKey} @calciteComboboxChange=${e=>{let t=e.target.value;this.arcgisAttributeValueChange.emit({[this.attributeKey]:t?Array.isArray(t)?t:[t]:void 0})}} .placeholder=${this.attribute.description??this.messages.selectoptions} .required=${this.attribute.isRequired} .status=${this.validationMsg?"invalid":"valid"} validation-icon=exclamation-mark-triangle .validationMessage=${this.validationMsg} .value=${this.value}>${this._renderComboboxOptions()}</calcite-combobox></calcite-label>`:null}_renderGroupedComboboxOptions(){if(!this.renderingInfo?.valueExpressionResult||Array.isArray(this.renderingInfo?.valueExpressionResult))return;let e=this.value;return Object.entries(this.renderingInfo?.valueExpressionResult).map(([t,r])=>i`<calcite-combobox-item .selected=${e?.includes(t)} .heading=${t} .value=${t}>${r.map(l=>i`<calcite-combobox-item .selected=${e?.includes(l.value)} .heading=${l.label} .value=${l.value} data-testid=${`grouped-combobox-item-${l.value}`}></calcite-combobox-item>`)}</calcite-combobox-item>`)}renderMultiGroupedSelectNested(){return s(this.attribute,"multi-grouped-select-nested")?i`<calcite-label .for=${this.attributeKey}>${this.attribute.label}<calcite-combobox id=${this.attributeKey??a} .label=${this.attribute.label} .name=${this.attributeKey} @calciteComboboxChange=${e=>{let t=e.target.value;this.arcgisAttributeValueChange.emit({[this.attributeKey]:t?Array.isArray(t)?t:[t]:void 0})}} .placeholder=${this.attribute.description??this.messages.selectoptions} .required=${this.attribute.isRequired} .status=${this.validationMsg?"invalid":"valid"} validation-icon=exclamation-mark-triangle .validationMessage=${this.validationMsg} .value=${this.value}>${this._renderGroupedComboboxOptions()}</calcite-combobox></calcite-label>`:null}render(){switch(this.attribute.uiElement){case"checkbox":return this.renderCheckbox();case"date":return this.renderDateInput();case"multi-select":return this.renderMultiSelect();case"multi-grouped-select-nested":return this.renderMultiGroupedSelectNested();case"single-select":return this.renderSingleSelect();case"text":return this.renderTextInput();default:return i`<div>Not Implemented Yet.</div>`}}};d("arcgis-portal-classification-form-element",n);export{n as ArcgisPortalClassificationFormElement};
2
+ import{a as m}from"./JYIPREIH.js";import{a as h}from"./AXM6XCZD.js";import"./IBP5XPD5.js";import"./D76KMXZD.js";import{L as b,O as a,R as d,h as c,j as i,v as u}from"./JV23HJTE.js";import"./UZLQALHY.js";var g=c`.spacing-y{margin:var(--calcite-spacing-md) 0}.portal-classification-form-element-tooltip{display:flex;justify-content:space-between;align-items:center}`;function s(o,e){return o.uiElement===e}var n=class extends b{constructor(){super(...arguments),this.messages=h(),this.isRequiredErrors=new Set,this.arcgisAttributeValueChange=u()}static{this.properties={validationMsg:16,attributeKey:1,attribute:0,value:0,renderingInfo:0,isRequiredErrors:0}}static{this.styles=g}willUpdate(e){(e.has("renderingInfo")||e.has("isRequiredErrors"))&&(this.validationMsg=this._getValidationMessage())}_getValidationMessage(){if(this.renderingInfo?.attributeValidationResult)return this.renderingInfo.attributeValidationResult;if(this.isRequiredErrors.has(this.attributeKey))return this.messages.requiredfield??"This is a required field."}renderCheckbox(){return s(this.attribute,"checkbox")?i`<calcite-label class="spacing-y" .for=${this.attributeKey} layout=inline><calcite-checkbox .checked=${this.value} id=${this.attributeKey??a} @calciteCheckboxChange=${e=>this.arcgisAttributeValueChange.emit({[this.attributeKey]:e.target.checked})} .required=${this.attribute.isRequired??!1} .status=${this.validationMsg?"invalid":"valid"}></calcite-checkbox>${this.attribute.label}</calcite-label>`:null}renderDateInput(){return s(this.attribute,"date")?i`<calcite-label .for=${this.attributeKey}>${this.attribute.label}<calcite-input-date-picker id=${this.attributeKey??a} .name=${this.attribute.label} @calciteInputDatePickerChange=${e=>this.isConnected&&this.arcgisAttributeValueChange.emit({[this.attributeKey]:e.target.value})} overlay-positioning=fixed .required=${this.attribute.isRequired} .status=${this.validationMsg?"invalid":"valid"} validation-icon=exclamation-mark-triangle .validationMessage=${this.validationMsg} .value=${this.value}></calcite-input-date-picker></calcite-label>`:null}renderTextInput(){if(!s(this.attribute,"text"))return null;let e=this.attribute.label,t=this.attribute.description;return i`<calcite-label .for=${this.attributeKey}><div class="portal-classification-form-element-tooltip">${e}${this.attribute.labelTooltip&&i`<div><calcite-icon scale=s icon=information .id=${`tooltip-button-${this.attribute.bannerLabel}`} text-label=${this.messages.information??"Information"??a}></calcite-icon><calcite-tooltip .referenceElement=${`tooltip-button-${this.attribute.bannerLabel}`} placement=right>${this.attribute.labelTooltip}</calcite-tooltip></div>`||""}</div><calcite-input-text id=${this.attributeKey??a} .label=${e} .name=${this.attributeKey} @calciteInputTextChange=${r=>this.arcgisAttributeValueChange.emit({[this.attributeKey]:r.target.value})} .placeholder=${t} .required=${this.attribute.isRequired} .status=${this.validationMsg?"invalid":"valid"} validation-icon=exclamation-mark-triangle .validationMessage=${this.validationMsg} .value=${this.value}></calcite-input-text></calcite-label>`}renderSingleSelect(){return s(this.attribute,"single-select")?i`<calcite-label .for=${this.attributeKey}>${this.attribute.label}<calcite-combobox selection-mode=single id=${this.attributeKey??a} .label=${this.attribute.label} .name=${this.attributeKey} @calciteComboboxChange=${e=>this.arcgisAttributeValueChange.emit({[this.attributeKey]:e.target.value})} .placeholder=${this.attribute.description??this.messages.selectanoption} .required=${this.attribute.isRequired} .status=${this.validationMsg?"invalid":"valid"} overlay-positioning=fixed validation-icon=exclamation-mark-triangle .validationMessage=${this.validationMsg} .value=${this.value} data-testid=${`single-select-${this.attributeKey}`}>${this._renderSingleSelectComboboxOptions()}</calcite-combobox></calcite-label>`:null}_renderSingleSelectComboboxOptions(){if(!Array.isArray(this.renderingInfo?.valueExpressionResult))return;let e=this.value;return m(this.renderingInfo?.valueExpressionResult,t=>t.label,t=>i`<calcite-combobox-item .selected=${e===t.value} .heading=${t.label} .value=${t.value} data-testid=${`single-combobox-item-${t.value}`}></calcite-combobox-item>`)}_renderComboboxOptions(){if(!Array.isArray(this.renderingInfo?.valueExpressionResult))return;let e=this.value;return this.renderingInfo?.valueExpressionResult.map(t=>i`<calcite-combobox-item .selected=${e?.includes(t.value)} .heading=${t.label} .value=${t.value} data-testid=${`combobox-item-${t.value}`}></calcite-combobox-item>`)}renderMultiSelect(){return s(this.attribute,"multi-select")?i`<calcite-label .for=${this.attributeKey}>${this.attribute.label}<calcite-combobox id=${this.attributeKey??a} .label=${this.attribute.label} .name=${this.attributeKey} @calciteComboboxChange=${e=>{let t=e.target.value;this.arcgisAttributeValueChange.emit({[this.attributeKey]:t?Array.isArray(t)?t:[t]:void 0})}} .placeholder=${this.attribute.description??this.messages.selectoptions} .required=${this.attribute.isRequired} .status=${this.validationMsg?"invalid":"valid"} validation-icon=exclamation-mark-triangle .validationMessage=${this.validationMsg} .value=${this.value}>${this._renderComboboxOptions()}</calcite-combobox></calcite-label>`:null}_renderGroupedComboboxOptions(){if(!this.renderingInfo?.valueExpressionResult||Array.isArray(this.renderingInfo?.valueExpressionResult))return;let e=this.value;return Object.entries(this.renderingInfo?.valueExpressionResult).map(([t,r])=>i`<calcite-combobox-item .selected=${e?.includes(t)} .heading=${t} .value=${t}>${r.map(l=>i`<calcite-combobox-item .selected=${e?.includes(l.value)} .heading=${l.label} .value=${l.value} data-testid=${`grouped-combobox-item-${l.value}`}></calcite-combobox-item>`)}</calcite-combobox-item>`)}renderMultiGroupedSelectNested(){return s(this.attribute,"multi-grouped-select-nested")?i`<calcite-label .for=${this.attributeKey}>${this.attribute.label}<calcite-combobox id=${this.attributeKey??a} .label=${this.attribute.label} .name=${this.attributeKey} @calciteComboboxChange=${e=>{let t=e.target.value;this.arcgisAttributeValueChange.emit({[this.attributeKey]:t?Array.isArray(t)?t:[t]:void 0})}} .placeholder=${this.attribute.description??this.messages.selectoptions} .required=${this.attribute.isRequired} .status=${this.validationMsg?"invalid":"valid"} validation-icon=exclamation-mark-triangle .validationMessage=${this.validationMsg} .value=${this.value}>${this._renderGroupedComboboxOptions()}</calcite-combobox></calcite-label>`:null}render(){switch(this.attribute.uiElement){case"checkbox":return this.renderCheckbox();case"date":return this.renderDateInput();case"multi-select":return this.renderMultiSelect();case"multi-grouped-select-nested":return this.renderMultiGroupedSelectNested();case"single-select":return this.renderSingleSelect();case"text":return this.renderTextInput();default:return i`<div>Not Implemented Yet.</div>`}}};d("arcgis-portal-classification-form-element",n);export{n as ArcgisPortalClassificationFormElement};
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"./YIMNOUTF.js";var e=`# ArcGIS Knowledge Graph Cypher Rules
2
+ import"./UZLQALHY.js";var e=`# ArcGIS Knowledge Graph Cypher Rules
3
3
 
4
4
  ## GOAL
5
5
 
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import b from"./WSNLUGEP.js";import{a as D}from"./2XILGLOG.js";import a from"./HMBSJR37.js";import"./6W2IHKCA.js";import{a as R}from"./ECNI2A4K.js";import{b as E}from"./G2YAOSMT.js";import"./QUEBM77K.js";import{J as M,K as g,L as S,M as v,R as k,h as A,j as d,v as u}from"./ZZ4DR3HN.js";import"./YIMNOUTF.js";export default $arcgis.t(([{a:P,d:L},{a:x,d:O}])=>{var y=["@","#","$"],F=400;function q(n,t){let a=null;for(let l of t){let r=l.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&"),s=new RegExp(`${r}"([^"\\n]*)"?$`,"u"),e=n.match(s);if(e){let c=e[0],o=n.length-c.length,h=e[1]??"";(!a||o>a.startIndex)&&(a={starter:l,mentionText:c,query:h,startIndex:o})}let i=new RegExp(`${r}[\\p{L}\\p{N}_-]+$`,"u"),m=n.match(i);if(m){let c=m[0],o=n.length-c.length,h=c.slice(l.length);(!a||o>a.startIndex)&&(a={starter:l,mentionText:c,query:h,startIndex:o})}}return a}var U=n=>y.includes(n)?n:"@",N=E(n=>{let t=[],a=async s=>await x({requester:async()=>await L(n.portal,s,{num:3}),key:"items",id:s}),l=async s=>await x({requester:async()=>await P(n.portal,{query:`title:${s}`,num:3}),key:"groups",id:s}),r=R(async(s,e)=>{n.isFetchingEntities=!0;let i=s.toLowerCase();switch(U(e)){case"@":let m=10;n.filteredItemsInfo={type:"user",items:t.filter(h=>h.username?.toLowerCase().includes(i)||h.fullName?.toLowerCase().includes(i)).slice(0,m)};break;case"#":let{result:c}=await a(i);n.filteredItemsInfo={type:"item",items:c?.results??[]};break;case"$":let{results:o}=await l(i);n.filteredItemsInfo={type:"group",items:o};break}(n.filteredItemsInfo?.items?.length??0)===0&&await n.closePopover(),n.isFetchingEntities=!1},F);return{fetchUsers:async()=>{try{let{users:s}=await O(n.portal);t=s??[]}catch(s){t=[],console.error("error fetching org users:",s)}},filterItems:r,getItemText:(s,e)=>{let i="";switch(U(e)){case"@":i=s.username;break;case"#":i=s.title??"";break;case"$":i=s.title??"";break}return i.trim()}}}),$=({id:n,label:t,selected:a,description:l,contentStart:r,onSelect:s})=>D(n,d`<calcite-list-item class=${v({selected:a})} .label=${t} .description=${l} .selected=${a} @pointerdown=${async e=>{e.preventDefault(),e.stopPropagation(),await s()}} ${g(e=>{a&&e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})})}>${r}</calcite-list-item>`),K=A`.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}`,w=class extends S{constructor(){super(...arguments),this.calciteTextAreaRef=M(),this.mentionableEntityController=N(this),this.handleInput=t=>{let{bubbleNewValueChange:a,checkForMention:l}=this,r=t.target.value;this._value=r,a(this._value);let s=this.nativeTextAreaRef?.selectionStart??0;l(r,s)},this.handleKeyDown=t=>{if(!this.popoverOpen){this.arcgisUserMentionableTextAreaKeyDown.emit(t),this.arcgisMentionableTextAreaKeyDown.emit(t);return}switch(t.key){case"ArrowDown":t.preventDefault(),this.selectedItemIndex=Math.min(this.selectedItemIndex+1,this.filteredItems.length-1);break;case"ArrowUp":t.preventDefault(),this.selectedItemIndex=Math.max(this.selectedItemIndex-1,0);break;case"Enter":t.preventDefault(),this.selectItem(this.filteredItems[this.selectedItemIndex]);break;case"Escape":t.preventDefault(),this.closePopover.bind(this)();break}},this.handleClosePopover=()=>{this.popoverOpen=!1,this.currentMentionQuery="",this.selectedItemIndex=0,this.currentStarter=null},this.bubbleNewValueChange=t=>{this.arcgisUserMentionableTextAreaChange.emit(t),this.arcgisMentionableTextAreaChange.emit(t)},this.checkForMention=(t,a)=>{let l=t.substring(0,a),r=q(l,this.starters??y);if(r){let{starter:s}=r;this.currentStarter=s,this.filterMentionItems(r),this.popoverOpen=!0;return}this.handleClosePopover()},this.filterMentionItems=t=>{let{mentionText:a,query:l,starter:r,startIndex:s}=t;this.currentMentionQuery=a,this.mentionStartPosition=s;let e=l.toLowerCase();this.mentionableEntityController.filterItems(e,r),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=y,this.readOnly=!1,this.arcgisMentionableSelectedIndexChange=u(),this.arcgisMentionableTextAreaChange=u(),this.arcgisMentionableTextAreaKeyDown=u(),this.arcgisUserMentionableTextAreaChange=u(),this.arcgisUserMentionableTextAreaKeyDown=u(),this.renderItemInfo=()=>{let{filteredItemsInfo:t,selectedItemIndex:a,portal:l}=this;if(!t)return null;let{items:r,type:s}=t;switch(s){case"user":return r.map((e,i)=>$({id:e.id,label:`@${e.username}`,description:e.fullName,selected:i===a,contentStart:d`<arcgis-portal-user-avatar slot=content-start .user=${e} .portal=${l} scale=m></arcgis-portal-user-avatar>`,onSelect:async()=>await this.selectItem(e)}));case"item":return r.map((e,i)=>$({id:e.id??`item-${i}`,label:`#${e.title}`,description:e.id??void 0,selected:i===a,onSelect:async()=>await this.selectItem(e),contentStart:d`<calcite-avatar slot=content-start .fullName=${e.title??void 0} .thumbnail=${e.thumbnailUrl??void 0} scale=m></calcite-avatar>`}));case"group":return r.map((e,i)=>$({id:e.id??`group-${i}`,label:`${e.title}`,description:e.id??void 0,selected:i===a,onSelect:async()=>await this.selectItem(e),contentStart:d`<calcite-avatar slot=content-start .fullName=${e.title??void 0} .thumbnail=${e.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=K}get filteredItems(){return this.filteredItemsInfo?.items??[]}async closePopover(){this.handleClosePopover()}async focusTextArea(){await this.calciteTextAreaRef.value?.setFocus()}async selectItem(t){let{currentStarter:a,_value:l,mentionStartPosition:r,currentMentionQuery:s,handleClosePopover:e,calciteTextAreaRef:i,nativeTextAreaRef:m,bubbleNewValueChange:c}=this;if(!t||!a)return;let o=this.mentionableEntityController.getItemText(t,a).replaceAll('"',"").trim(),h=/\s/u.test(o)?`${a}"${o}"`:`${a}${o}`,f=(l??"").substring(0,r),p=(l??"").substring(r+s.length),I=`${f}${h} ${p}`;this._value=I,c(this._value);let b=r+h.length+1;e(),await this.updateComplete,i.value?.setFocus(),m&&(m.selectionEnd=b)}willUpdate(t){t.has("value")&&(this._value=this.value??""),t.has("selectedItemIndex")&&this.arcgisMentionableSelectedIndexChange.emit(this.selectedItemIndex)}loaded(){this.updateComplete.then(()=>{let t=this.calciteTextAreaRef.value?.shadowRoot?.querySelector("textarea");t&&(this.nativeTextAreaRef=t)}),this.mentionableEntityController.fetchUsers()}render(){let{popoverPlacement:t,scale:a,_value:l,maxLength:r,rows:s,placeholder:e,readOnly:i,popoverOpen:m,closePopover:c,handleInput:o,handleKeyDown:h,disabled:f,isFetchingEntities:p,filteredItemsInfo:I,renderItemInfo:b,popoverListLabel:C}=this,T=this.calciteTextAreaRef.value,_=I?.items??[];return d`<calcite-text-area .placeholder=${e} .value=${l} .maxLength=${r} .rows=${s} .scale=${a} .readOnly=${i} .disabled=${f} @blur=${c} @calciteTextAreaInput=${o} @keydown=${h} ${g(this.calciteTextAreaRef)}></calcite-text-area>${T&&d`<calcite-popover .open=${m} .placement=${t} class="mention-popover" .label=${C} .referenceElement=${T} trigger-disabled pointer-disabled focus-trap-disabled><div class=${v({"mentionable-list":!0,"mentionable-list--loading":p})}>${p&&d`<calcite-scrim .loading=${p}></calcite-scrim>`||""}${_.length>0&&d`<calcite-list .label=${C}>${b()}</calcite-list>`||""}</div></calcite-popover>`||""}`}};k("arcgis-portal-mentionable-text-area",w);return w},a,b)
2
+ import b from"./WSNLUGEP.js";import{a as D}from"./GKOXTQHB.js";import a from"./HMBSJR37.js";import"./6W2IHKCA.js";import{a as R}from"./XEK22IDA.js";import{b as E}from"./IBP5XPD5.js";import"./D76KMXZD.js";import{J as M,K as g,L as S,M as v,R as k,h as A,j as d,v as u}from"./JV23HJTE.js";import"./UZLQALHY.js";export default $arcgis.t(([{a:P,d:L},{a:x,d:O}])=>{var y=["@","#","$"],F=400;function q(n,t){let a=null;for(let l of t){let r=l.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&"),s=new RegExp(`${r}"([^"\\n]*)"?$`,"u"),e=n.match(s);if(e){let c=e[0],o=n.length-c.length,h=e[1]??"";(!a||o>a.startIndex)&&(a={starter:l,mentionText:c,query:h,startIndex:o})}let i=new RegExp(`${r}[\\p{L}\\p{N}_-]+$`,"u"),m=n.match(i);if(m){let c=m[0],o=n.length-c.length,h=c.slice(l.length);(!a||o>a.startIndex)&&(a={starter:l,mentionText:c,query:h,startIndex:o})}}return a}var U=n=>y.includes(n)?n:"@",N=E(n=>{let t=[],a=async s=>await x({requester:async()=>await L(n.portal,s,{num:3}),key:"items",id:s}),l=async s=>await x({requester:async()=>await P(n.portal,{query:`title:${s}`,num:3}),key:"groups",id:s}),r=R(async(s,e)=>{n.isFetchingEntities=!0;let i=s.toLowerCase();switch(U(e)){case"@":let m=10;n.filteredItemsInfo={type:"user",items:t.filter(h=>h.username?.toLowerCase().includes(i)||h.fullName?.toLowerCase().includes(i)).slice(0,m)};break;case"#":let{result:c}=await a(i);n.filteredItemsInfo={type:"item",items:c?.results??[]};break;case"$":let{results:o}=await l(i);n.filteredItemsInfo={type:"group",items:o};break}(n.filteredItemsInfo?.items?.length??0)===0&&await n.closePopover(),n.isFetchingEntities=!1},F);return{fetchUsers:async()=>{try{let{users:s}=await O(n.portal);t=s??[]}catch(s){t=[],console.error("error fetching org users:",s)}},filterItems:r,getItemText:(s,e)=>{let i="";switch(U(e)){case"@":i=s.username;break;case"#":i=s.title??"";break;case"$":i=s.title??"";break}return i.trim()}}}),$=({id:n,label:t,selected:a,description:l,contentStart:r,onSelect:s})=>D(n,d`<calcite-list-item class=${v({selected:a})} .label=${t} .description=${l} .selected=${a} @pointerdown=${async e=>{e.preventDefault(),e.stopPropagation(),await s()}} ${g(e=>{a&&e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})})}>${r}</calcite-list-item>`),K=A`.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}`,w=class extends S{constructor(){super(...arguments),this.calciteTextAreaRef=M(),this.mentionableEntityController=N(this),this.handleInput=t=>{let{bubbleNewValueChange:a,checkForMention:l}=this,r=t.target.value;this._value=r,a(this._value);let s=this.nativeTextAreaRef?.selectionStart??0;l(r,s)},this.handleKeyDown=t=>{if(!this.popoverOpen){this.arcgisUserMentionableTextAreaKeyDown.emit(t),this.arcgisMentionableTextAreaKeyDown.emit(t);return}switch(t.key){case"ArrowDown":t.preventDefault(),this.selectedItemIndex=Math.min(this.selectedItemIndex+1,this.filteredItems.length-1);break;case"ArrowUp":t.preventDefault(),this.selectedItemIndex=Math.max(this.selectedItemIndex-1,0);break;case"Enter":t.preventDefault(),this.selectItem(this.filteredItems[this.selectedItemIndex]);break;case"Escape":t.preventDefault(),this.closePopover.bind(this)();break}},this.handleClosePopover=()=>{this.popoverOpen=!1,this.currentMentionQuery="",this.selectedItemIndex=0,this.currentStarter=null},this.bubbleNewValueChange=t=>{this.arcgisUserMentionableTextAreaChange.emit(t),this.arcgisMentionableTextAreaChange.emit(t)},this.checkForMention=(t,a)=>{let l=t.substring(0,a),r=q(l,this.starters??y);if(r){let{starter:s}=r;this.currentStarter=s,this.filterMentionItems(r),this.popoverOpen=!0;return}this.handleClosePopover()},this.filterMentionItems=t=>{let{mentionText:a,query:l,starter:r,startIndex:s}=t;this.currentMentionQuery=a,this.mentionStartPosition=s;let e=l.toLowerCase();this.mentionableEntityController.filterItems(e,r),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=y,this.readOnly=!1,this.arcgisMentionableSelectedIndexChange=u(),this.arcgisMentionableTextAreaChange=u(),this.arcgisMentionableTextAreaKeyDown=u(),this.arcgisUserMentionableTextAreaChange=u(),this.arcgisUserMentionableTextAreaKeyDown=u(),this.renderItemInfo=()=>{let{filteredItemsInfo:t,selectedItemIndex:a,portal:l}=this;if(!t)return null;let{items:r,type:s}=t;switch(s){case"user":return r.map((e,i)=>$({id:e.id,label:`@${e.username}`,description:e.fullName,selected:i===a,contentStart:d`<arcgis-portal-user-avatar slot=content-start .user=${e} .portal=${l} scale=m></arcgis-portal-user-avatar>`,onSelect:async()=>await this.selectItem(e)}));case"item":return r.map((e,i)=>$({id:e.id??`item-${i}`,label:`#${e.title}`,description:e.id??void 0,selected:i===a,onSelect:async()=>await this.selectItem(e),contentStart:d`<calcite-avatar slot=content-start .fullName=${e.title??void 0} .thumbnail=${e.thumbnailUrl??void 0} scale=m></calcite-avatar>`}));case"group":return r.map((e,i)=>$({id:e.id??`group-${i}`,label:`${e.title}`,description:e.id??void 0,selected:i===a,onSelect:async()=>await this.selectItem(e),contentStart:d`<calcite-avatar slot=content-start .fullName=${e.title??void 0} .thumbnail=${e.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=K}get filteredItems(){return this.filteredItemsInfo?.items??[]}async closePopover(){this.handleClosePopover()}async focusTextArea(){await this.calciteTextAreaRef.value?.setFocus()}async selectItem(t){let{currentStarter:a,_value:l,mentionStartPosition:r,currentMentionQuery:s,handleClosePopover:e,calciteTextAreaRef:i,nativeTextAreaRef:m,bubbleNewValueChange:c}=this;if(!t||!a)return;let o=this.mentionableEntityController.getItemText(t,a).replaceAll('"',"").trim(),h=/\s/u.test(o)?`${a}"${o}"`:`${a}${o}`,f=(l??"").substring(0,r),p=(l??"").substring(r+s.length),I=`${f}${h} ${p}`;this._value=I,c(this._value);let b=r+h.length+1;e(),await this.updateComplete,i.value?.setFocus(),m&&(m.selectionEnd=b)}willUpdate(t){t.has("value")&&(this._value=this.value??""),t.has("selectedItemIndex")&&this.arcgisMentionableSelectedIndexChange.emit(this.selectedItemIndex)}loaded(){this.updateComplete.then(()=>{let t=this.calciteTextAreaRef.value?.shadowRoot?.querySelector("textarea");t&&(this.nativeTextAreaRef=t)}),this.mentionableEntityController.fetchUsers()}render(){let{popoverPlacement:t,scale:a,_value:l,maxLength:r,rows:s,placeholder:e,readOnly:i,popoverOpen:m,closePopover:c,handleInput:o,handleKeyDown:h,disabled:f,isFetchingEntities:p,filteredItemsInfo:I,renderItemInfo:b,popoverListLabel:C}=this,T=this.calciteTextAreaRef.value,_=I?.items??[];return d`<calcite-text-area .placeholder=${e} .value=${l} .maxLength=${r} .rows=${s} .scale=${a} .readOnly=${i} .disabled=${f} @blur=${c} @calciteTextAreaInput=${o} @keydown=${h} ${g(this.calciteTextAreaRef)}></calcite-text-area>${T&&d`<calcite-popover .open=${m} .placement=${t} class="mention-popover" .label=${C} .referenceElement=${T} trigger-disabled pointer-disabled focus-trap-disabled><div class=${v({"mentionable-list":!0,"mentionable-list--loading":p})}>${p&&d`<calcite-scrim .loading=${p}></calcite-scrim>`||""}${_.length>0&&d`<calcite-list .label=${C}>${b()}</calcite-list>`||""}</div></calcite-popover>`||""}`}};k("arcgis-portal-mentionable-text-area",w);return w},a,b)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as b,b as k}from"./6W2IHKCA.js";import{J as c,K as h,L as g,N as f,O as $,R as d,h as m,j as l}from"./ZZ4DR3HN.js";import"./YIMNOUTF.js";var E=/^#[0-9a-f]{3}$/iu,x=/^#[0-9a-f]{6}$/iu;function u(o){return I(o)||v(o)}function I(o){return o?.length===4&&E.test(o)}function v(o){return o?.length===7&&x.test(o)}function O(o){if(!u(o))return null;let t=o.replace("#","");if(t.length===3){let[e,i,r]=t.split("");return{r:Number.parseInt(`${e}${e}`,16),g:Number.parseInt(`${i}${i}`,16),b:Number.parseInt(`${r}${r}`,16)}}return{r:Number.parseInt(t.slice(0,2),16),g:Number.parseInt(t.slice(2,4),16),b:Number.parseInt(t.slice(4,6),16)}}function w(o){let t=0;for(let i=0;i<o.length;i++)t=o.charCodeAt(i)+((t<<5)-t);let e="#";for(let i=0;i<3;i++){let r=t>>i*8&255;e+=`00${r.toString(16)}`.slice(-2)}return e}function y(o){let{r:t,g:e,b:i}=o;t/=255,e/=255,i/=255;let r=Math.max(t,e,i),n=Math.min(t,e,i),s=r-n;if(s===0)return 0;let a=0;switch(r){case t:a=(e-i)/s+(e<i?6:0);break;case e:a=(i-t)/s+2;break;default:a=(t-e)/s+4;break}return Math.round(a*60)}function M(o){let t=O(o);return t?y(t):0}var T=m`:host{display:inline-block}:host([scale="s"]){height:1.5rem;width:1.5rem;font-size:.625rem}:host([scale="m"]){height:2rem;width:2rem;font-size:.75rem}:host([scale="l"]){font-size:1rem;height:2.75rem;width:2.75rem}:host([scale="xl"]){font-size:1.25rem;height:4rem;width:4rem}.icon{display:flex;color:var(--calcite-color-text-3)}.background{position:relative;display:flex;height:100%;width:100%;align-items:center;justify-content:center}.initials{position:absolute;font-weight:700;text-transform:uppercase;color:var(--calcite-color-text-2)}.thumbnail{height:100%;width:100%}.tooltip-text{margin:0;padding:0;font-size:.75rem;color:var(--calcite-color-text-2)}calcite-tooltip{pointer-events:none}`,p=class extends g{constructor(){super(...arguments),this.imageEl=c(),this.fallbackEl=c(),this.tooltipEl=c(),this.imageError=!1,this.tooltipOpen=!1,this.tooltip=!1,this.scale="m"}static{this.properties={imageError:16,tooltipOpen:16,group:0,portal:0,tooltip:5,scale:3}}static{this.styles=T}willUpdate(t){t.has("group")&&(this.imageError=!1)}updated(){let t=this.tooltipEl.value,e=this.imageEl.value||this.fallbackEl.value;t&&e&&(t.referenceElement=e)}isDarkMode(){return!!this.el.closest(".calcite-mode-dark")}getThumbnailURI(){let{group:t,portal:e}=this;if(!t)return null;if(t.thumbnailUrl)return t.thumbnailUrl;let i=t.thumbnail;if(!i)return null;if(i.startsWith("http"))return i;if(!e||!t.id)return null;let r=k(e),n=r?`?token=${r}`:"";return`${b(e)}community/groups/${t.id}/info/${i}${n}`}generateFillColor(){let{id:t,title:e}=this.group||{},i=t?`#${t.slice(Math.max(0,t.length-6))}`:"",r=t&&u(i)?i:w(e||"");if(!t&&!e||!u(r))return"var(--calcite-color-foreground-2)";let n=M(r),s=this.isDarkMode()?20:90;return`hsl(${n}, 60%, ${s}%)`}generateInitials(){let t=this.group?.title?.trim().charAt(0);return t?.match(/^\w+$/u)?t:null}getIconScale(){return this.scale==="xl"?"l":this.scale==="xs"?"s":this.scale}renderTooltip(){return!this.tooltip||!this.group?.title?null:l`<calcite-tooltip .open=${this.tooltipOpen} close-on-click placement=bottom-start offset-distance=6 offset-skidding=0 ${h(this.tooltipEl)}><p class="tooltip-text">${this.group.title}</p></calcite-tooltip>`}render(){let t=this.getThumbnailURI();if(t&&!this.imageError)return l`<img class="thumbnail" src=${t??$} alt @error=${()=>{this.imageError=!0}} @mouseenter=${()=>{this.tooltipOpen=!0}} @mouseleave=${()=>{this.tooltipOpen=!1}} @focusin=${()=>{this.tooltipOpen=!0}} @focusout=${()=>{this.tooltipOpen=!1}} ${h(this.imageEl)}>${this.renderTooltip()}`;let e=this.generateInitials();return l`<span class="background" style=${f({backgroundColor:this.generateFillColor()})} @mouseenter=${()=>{this.tooltipOpen=!0}} @mouseleave=${()=>{this.tooltipOpen=!1}} @focusin=${()=>{this.tooltipOpen=!0}} @focusout=${()=>{this.tooltipOpen=!1}} ${h(this.fallbackEl)}>${e?l`<span aria-hidden=true class="initials">${e}</span>`:l`<calcite-icon class="icon" icon=users .scale=${this.getIconScale()}></calcite-icon>`}</span>${this.renderTooltip()}`}};d("arcgis-portal-group-thumbnail",p);export{p as ArcgisPortalGroupThumbnail};
2
+ import{a as b,b as k}from"./6W2IHKCA.js";import{J as c,K as h,L as g,N as f,O as $,R as d,h as m,j as l}from"./JV23HJTE.js";import"./UZLQALHY.js";var E=/^#[0-9a-f]{3}$/iu,x=/^#[0-9a-f]{6}$/iu;function u(o){return I(o)||v(o)}function I(o){return o?.length===4&&E.test(o)}function v(o){return o?.length===7&&x.test(o)}function O(o){if(!u(o))return null;let t=o.replace("#","");if(t.length===3){let[e,i,r]=t.split("");return{r:Number.parseInt(`${e}${e}`,16),g:Number.parseInt(`${i}${i}`,16),b:Number.parseInt(`${r}${r}`,16)}}return{r:Number.parseInt(t.slice(0,2),16),g:Number.parseInt(t.slice(2,4),16),b:Number.parseInt(t.slice(4,6),16)}}function w(o){let t=0;for(let i=0;i<o.length;i++)t=o.charCodeAt(i)+((t<<5)-t);let e="#";for(let i=0;i<3;i++){let r=t>>i*8&255;e+=`00${r.toString(16)}`.slice(-2)}return e}function y(o){let{r:t,g:e,b:i}=o;t/=255,e/=255,i/=255;let r=Math.max(t,e,i),n=Math.min(t,e,i),s=r-n;if(s===0)return 0;let a=0;switch(r){case t:a=(e-i)/s+(e<i?6:0);break;case e:a=(i-t)/s+2;break;default:a=(t-e)/s+4;break}return Math.round(a*60)}function M(o){let t=O(o);return t?y(t):0}var T=m`:host{display:inline-block}:host([scale="s"]){height:1.5rem;width:1.5rem;font-size:.625rem}:host([scale="m"]){height:2rem;width:2rem;font-size:.75rem}:host([scale="l"]){font-size:1rem;height:2.75rem;width:2.75rem}:host([scale="xl"]){font-size:1.25rem;height:4rem;width:4rem}.icon{display:flex;color:var(--calcite-color-text-3)}.background{position:relative;display:flex;height:100%;width:100%;align-items:center;justify-content:center}.initials{position:absolute;font-weight:700;text-transform:uppercase;color:var(--calcite-color-text-2)}.thumbnail{height:100%;width:100%}.tooltip-text{margin:0;padding:0;font-size:.75rem;color:var(--calcite-color-text-2)}calcite-tooltip{pointer-events:none}`,p=class extends g{constructor(){super(...arguments),this.imageEl=c(),this.fallbackEl=c(),this.tooltipEl=c(),this.imageError=!1,this.tooltipOpen=!1,this.tooltip=!1,this.scale="m"}static{this.properties={imageError:16,tooltipOpen:16,group:0,portal:0,tooltip:5,scale:3}}static{this.styles=T}willUpdate(t){t.has("group")&&(this.imageError=!1)}updated(){let t=this.tooltipEl.value,e=this.imageEl.value||this.fallbackEl.value;t&&e&&(t.referenceElement=e)}isDarkMode(){return!!this.el.closest(".calcite-mode-dark")}getThumbnailURI(){let{group:t,portal:e}=this;if(!t)return null;if(t.thumbnailUrl)return t.thumbnailUrl;let i=t.thumbnail;if(!i)return null;if(i.startsWith("http"))return i;if(!e||!t.id)return null;let r=k(e),n=r?`?token=${r}`:"";return`${b(e)}community/groups/${t.id}/info/${i}${n}`}generateFillColor(){let{id:t,title:e}=this.group||{},i=t?`#${t.slice(Math.max(0,t.length-6))}`:"",r=t&&u(i)?i:w(e||"");if(!t&&!e||!u(r))return"var(--calcite-color-foreground-2)";let n=M(r),s=this.isDarkMode()?20:90;return`hsl(${n}, 60%, ${s}%)`}generateInitials(){let t=this.group?.title?.trim().charAt(0);return t?.match(/^\w+$/u)?t:null}getIconScale(){return this.scale==="xl"?"l":this.scale==="xs"?"s":this.scale}renderTooltip(){return!this.tooltip||!this.group?.title?null:l`<calcite-tooltip .open=${this.tooltipOpen} close-on-click placement=bottom-start offset-distance=6 offset-skidding=0 ${h(this.tooltipEl)}><p class="tooltip-text">${this.group.title}</p></calcite-tooltip>`}render(){let t=this.getThumbnailURI();if(t&&!this.imageError)return l`<img class="thumbnail" src=${t??$} alt @error=${()=>{this.imageError=!0}} @mouseenter=${()=>{this.tooltipOpen=!0}} @mouseleave=${()=>{this.tooltipOpen=!1}} @focusin=${()=>{this.tooltipOpen=!0}} @focusout=${()=>{this.tooltipOpen=!1}} ${h(this.imageEl)}>${this.renderTooltip()}`;let e=this.generateInitials();return l`<span class="background" style=${f({backgroundColor:this.generateFillColor()})} @mouseenter=${()=>{this.tooltipOpen=!0}} @mouseleave=${()=>{this.tooltipOpen=!1}} @focusin=${()=>{this.tooltipOpen=!0}} @focusout=${()=>{this.tooltipOpen=!1}} ${h(this.fallbackEl)}>${e?l`<span aria-hidden=true class="initials">${e}</span>`:l`<calcite-icon class="icon" icon=users .scale=${this.getIconScale()}></calcite-icon>`}</span>${this.renderTooltip()}`}};d("arcgis-portal-group-thumbnail",p);export{p as ArcgisPortalGroupThumbnail};
@@ -1,3 +1,3 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"./YIMNOUTF.js";var o=`(function(){"use strict";const h=(a,r)=>{if(a.length!==r.length)throw new Error("Vectors must be the same length");let c=0,t=0,e=0;for(let n=0;n<a.length;++n){const s=a[n],l=r[n];c+=s*l,t+=s*s,e+=l*l}const i=Math.sqrt(t*e);if(i===0)return 0;const m=c/i;return Math.max(-1,Math.min(1,m))},f=(a,r,c=.6)=>{const t=[],e=[...a];for(;t.length<r&&e.length>0;){let i=-1,m=-1/0;for(let n=0;n<e.length;n++){const s=e[n].score,l=t.length===0?0:Math.max(...t.map(o=>h(e[n].vector,o.vector))),d=c*s-(1-c)*l;d>m&&(m=d,i=n)}t.push(e[i]),e.splice(i,1)}return t.map(({name:i,score:m})=>({name:i,score:m}))};let p=[];const u=new Map,v=12,y=10,M=a=>{p=a.layers.map(r=>({id:r.id,vector:r.vector}))},E=a=>{u.clear();for(const r of a.layers){const c=r.fields.map(t=>({name:t.name,vector:t.vector}));u.set(r.id,c)}};globalThis.addEventListener("message",a=>{(async()=>{const{type:r,webmapEmbeddings:c,layerIdForFieldsSearch:t=[],requestId:e,precomputedEmbedding:i,minScore:m=0,topResults:n=v}=a.data;switch(r){case"generateEmbeddings":{c&&(M(c),E(c)),globalThis.postMessage("completed");break}case"layerSearch":{if(p.length>0)try{const s=p.map(o=>({id:o.id,vector:o.vector,score:h(i,o.vector)})),d=f(s.map(o=>({name:o.id,vector:o.vector,score:o.score})),y).map(({name:o,score:b})=>({id:o,score:b}));globalThis.postMessage({requestId:e,results:d})}catch(s){globalThis.postMessage({requestId:e,results:[],error:s instanceof Error?s.message:"Calculation error"})}else globalThis.postMessage({requestId:e,results:[],error:"Layer embeddings not initialized"});break}case"fieldSearch":{if(t.length>0)try{const s=t.map(l=>{const d=u.get(l);if(!d)return{layerId:l,results:[]};const o=d.map(g=>({name:g.name,vector:g.vector,score:h(i,g.vector)})).filter(({score:g})=>g>=m),b=f(o,n);return{layerId:l,results:b}});globalThis.postMessage({requestId:e,results:s})}catch(s){globalThis.postMessage({requestId:e,results:[],error:s instanceof Error?s.message:"Field search calculation error"})}break}default:console.warn("Unknown message type:",r)}})()})})();
2
+ import"./UZLQALHY.js";var o=`(function(){"use strict";const h=(a,r)=>{if(a.length!==r.length)throw new Error("Vectors must be the same length");let c=0,t=0,e=0;for(let n=0;n<a.length;++n){const s=a[n],l=r[n];c+=s*l,t+=s*s,e+=l*l}const i=Math.sqrt(t*e);if(i===0)return 0;const m=c/i;return Math.max(-1,Math.min(1,m))},f=(a,r,c=.6)=>{const t=[],e=[...a];for(;t.length<r&&e.length>0;){let i=-1,m=-1/0;for(let n=0;n<e.length;n++){const s=e[n].score,l=t.length===0?0:Math.max(...t.map(o=>h(e[n].vector,o.vector))),d=c*s-(1-c)*l;d>m&&(m=d,i=n)}t.push(e[i]),e.splice(i,1)}return t.map(({name:i,score:m})=>({name:i,score:m}))};let p=[];const u=new Map,v=12,y=10,M=a=>{p=a.layers.map(r=>({id:r.id,vector:r.vector}))},E=a=>{u.clear();for(const r of a.layers){const c=r.fields.map(t=>({name:t.name,vector:t.vector}));u.set(r.id,c)}};globalThis.addEventListener("message",a=>{(async()=>{const{type:r,webmapEmbeddings:c,layerIdForFieldsSearch:t=[],requestId:e,precomputedEmbedding:i,minScore:m=0,topResults:n=v}=a.data;switch(r){case"generateEmbeddings":{c&&(M(c),E(c)),globalThis.postMessage("completed");break}case"layerSearch":{if(p.length>0)try{const s=p.map(o=>({id:o.id,vector:o.vector,score:h(i,o.vector)})),d=f(s.map(o=>({name:o.id,vector:o.vector,score:o.score})),y).map(({name:o,score:b})=>({id:o,score:b}));globalThis.postMessage({requestId:e,results:d})}catch(s){globalThis.postMessage({requestId:e,results:[],error:s instanceof Error?s.message:"Calculation error"})}else globalThis.postMessage({requestId:e,results:[],error:"Layer embeddings not initialized"});break}case"fieldSearch":{if(t.length>0)try{const s=t.map(l=>{const d=u.get(l);if(!d)return{layerId:l,results:[]};const o=d.map(g=>({name:g.name,vector:g.vector,score:h(i,g.vector)})).filter(({score:g})=>g>=m),b=f(o,n);return{layerId:l,results:b}});globalThis.postMessage({requestId:e,results:s})}catch(s){globalThis.postMessage({requestId:e,results:[],error:s instanceof Error?s.message:"Field search calculation error"})}break}default:console.warn("Unknown message type:",r)}})()})})();
3
3
  `,r=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",o],{type:"text/javascript;charset=utf-8"});function a(t){let e;try{if(e=r&&(self.URL||self.webkitURL).createObjectURL(r),!e)throw"";let s=new Worker(e,{name:t?.name});return s.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),s}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(o),{name:t?.name})}}export{a as default};