@esri/solutions-components 5.0.4 → 5.0.5
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/{UB33RJV2.js → 23DKMPGJ.js} +1 -1
- package/dist/cdn/{4WNB4SNS.js → 2ECRQJCU.js} +1 -1
- package/dist/cdn/{NGBSDZLF.js → 2JBJVGPJ.js} +1 -1
- package/dist/cdn/{3ZOEAKII.js → 2YCDW2EI.js} +1 -1
- package/dist/cdn/{36QZL2SP.js → 33HIGVEX.js} +1 -1
- package/dist/cdn/{HVZTHZYK.js → 4O4QS3DG.js} +1 -1
- package/dist/cdn/{F7DGHROD.js → 57INLFON.js} +1 -1
- package/dist/cdn/{44QGF64X.js → 5BEMMNL7.js} +1 -1
- package/dist/cdn/{RVR6SP4R.js → 5G3AHODR.js} +1 -1
- package/dist/cdn/{QOM6K67N.js → 5QP3RIEO.js} +1 -1
- package/dist/cdn/{O24ZIQLV.js → 5QSIKX2L.js} +1 -1
- package/dist/cdn/{5IWB7DXV.js → 5YORDAVH.js} +1 -1
- package/dist/cdn/{KAOZIOH3.js → 67TUHEUB.js} +1 -1
- package/dist/cdn/{TTKCR26F.js → 6HNQQRYK.js} +1 -1
- package/dist/cdn/{575KOORD.js → 6LSHZOMB.js} +1 -1
- package/dist/cdn/{32ZJRLO4.js → 6QODI424.js} +1 -1
- package/dist/cdn/{AXGMN3DZ.js → 7DOH2ZMP.js} +1 -1
- package/dist/cdn/{CPLUG3BV.js → ADJCIRZS.js} +1 -1
- package/dist/cdn/{ZB4IUY3Y.js → BA4FCDQY.js} +1 -1
- package/dist/cdn/{IWBYP44R.js → BADKNCL4.js} +1 -1
- package/dist/cdn/{5ISRU637.js → BCTFO27G.js} +1 -1
- package/dist/cdn/{N3WEX2WW.js → BGBLGDVO.js} +1 -1
- package/dist/cdn/BXKV2QC3.js +2 -0
- package/dist/cdn/{M5MQY5WC.js → DV233ITZ.js} +1 -1
- package/dist/cdn/{L65LKW2L.js → DY3BUOEI.js} +1 -1
- package/dist/cdn/EIQZRLWQ.js +2 -0
- package/dist/cdn/{CKHU23WZ.js → EKZZ7R2V.js} +1 -1
- package/dist/cdn/{PO4PTHS6.js → EPMMVHPO.js} +1 -1
- package/dist/cdn/{OZIXJ6HO.js → EQXQ6YNY.js} +1 -1
- package/dist/cdn/{L26O3GTC.js → HNPTTIXC.js} +1 -1
- package/dist/cdn/{OBMP2HIH.js → IHDRZQU4.js} +1 -1
- package/dist/cdn/{G3KEPG5G.js → IQ6XED24.js} +1 -1
- package/dist/cdn/{AFNUHTXR.js → JSX7H42C.js} +1 -1
- package/dist/cdn/{IGM6M6VG.js → K2BF5736.js} +1 -1
- package/dist/cdn/{3L4JPZ3K.js → K7O46PDI.js} +1 -1
- package/dist/cdn/{IB4U627P.js → KUZQPBVI.js} +1 -1
- package/dist/cdn/{ZRDBHNKL.js → LLIZZGSY.js} +1 -1
- package/dist/cdn/{G235DVXM.js → M2MN2QB7.js} +1 -1
- package/dist/cdn/{P3DGGTC5.js → M6DR7QBF.js} +1 -1
- package/dist/cdn/{SXF342EH.js → MDHKDE77.js} +1 -1
- package/dist/cdn/{Q5LUK5CM.js → MJDNGEFJ.js} +1 -1
- package/dist/cdn/{GKBTOBYA.js → MP5X6HGT.js} +1 -1
- package/dist/cdn/{YA5DNYPF.js → MSGOASUF.js} +1 -1
- package/dist/cdn/{G2FGKUNI.js → MWCQXZOT.js} +1 -1
- package/dist/cdn/{VPSUD6VW.js → N6EQBPC2.js} +1 -1
- package/dist/cdn/{ZZQ73LQE.js → NARQQKRW.js} +1 -1
- package/dist/cdn/{R7OZWCO2.js → NJJEOZ2G.js} +1 -1
- package/dist/cdn/{FZ5LAVZL.js → NORNRIIE.js} +1 -1
- package/dist/cdn/{3UVV2MNJ.js → QPRIL54J.js} +1 -1
- package/dist/cdn/{R2KIT5QB.js → QZZ2CQWS.js} +1 -1
- package/dist/cdn/{DCOGVHCK.js → R47OTDC2.js} +1 -1
- package/dist/cdn/{DQY6HKSD.js → RBCOT3CJ.js} +1 -1
- package/dist/cdn/{4WIRUOFC.js → RGFLXW4Q.js} +1 -1
- package/dist/cdn/{5QZHZP3H.js → RQEYXUDW.js} +1 -1
- package/dist/cdn/{OXUKEA5J.js → RTVWZSKJ.js} +1 -1
- package/dist/cdn/{MPJ5N4H3.js → RYRVUHB7.js} +1 -1
- package/dist/cdn/{RTZ7K25B.js → S42I3DOW.js} +1 -1
- package/dist/cdn/SFZEAERJ.js +2 -0
- package/dist/cdn/{643OMX6D.js → SIUK7OO4.js} +1 -1
- package/dist/cdn/{VW2776MR.js → SQYHEYVJ.js} +1 -1
- package/dist/cdn/{SIUGRN4Q.js → TAZIMIFF.js} +1 -1
- package/dist/cdn/{25XM6BTJ.js → TF3C523O.js} +1 -1
- package/dist/cdn/{YPV5332T.js → TGH6D5IY.js} +1 -1
- package/dist/cdn/{CS224C6F.js → TZPSZTAH.js} +1 -1
- package/dist/cdn/{UV3U3JVV.js → UV4D2QFA.js} +1 -1
- package/dist/cdn/{SVY3DB6Z.js → VEUUNFWR.js} +1 -1
- package/dist/cdn/{2ZUQERRA.js → VGIXK3YM.js} +1 -1
- package/dist/cdn/{BE7WFZ3U.js → VPMYUEFF.js} +1 -1
- package/dist/cdn/{NRATHJBP.js → VVURRW2F.js} +1 -1
- package/dist/cdn/{IHGHHRTQ.js → VW52F2EM.js} +1 -1
- package/dist/cdn/{LLCJDTO5.js → W33YWBF5.js} +1 -1
- package/dist/cdn/{QCX5HMBY.js → WXE6AACQ.js} +1 -1
- package/dist/cdn/{H4AJJYCF.js → X5T6TZW3.js} +1 -1
- package/dist/cdn/{UGC66GAG.js → XLBMKYPQ.js} +1 -1
- package/dist/cdn/{V7HBTLA3.js → XWJFP7BZ.js} +1 -1
- package/dist/cdn/{TWDX3YCN.js → Y3CBLTF5.js} +1 -1
- package/dist/cdn/{FYYI54CE.js → YE7JMYIB.js} +1 -1
- package/dist/cdn/{ETSHZHZS.js → YT2I5RUD.js} +1 -1
- package/dist/cdn/{NNF53M5N.js → YUWQWOOF.js} +1 -1
- package/dist/cdn/{5SWGGS6Z.js → Z6NMQGEQ.js} +1 -1
- package/dist/cdn/{HV4LZMLU.js → ZD3OZO6O.js} +1 -1
- package/dist/cdn/{N2D6RJ3H.js → ZFSMRICA.js} +1 -1
- package/dist/cdn/{WDDMJBPJ.js → ZNG42S47.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/runtime.js +2 -2
- package/dist/components/layer-list/customElement.js +1 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/solutions-components_commit.txt +7 -4
- package/package.json +1 -1
- package/dist/cdn/2GBXQUSA.js +0 -2
- package/dist/cdn/HW7HHHMK.js +0 -2
- package/dist/cdn/RORBHQJC.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{a as pn}from"./M5MQY5WC.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import{b as dn}from"./HW7HHHMK.js";import{H as fn,h as cn,r as ln}from"./46DQNAMV.js";import"./OR4HXHSY.js";function Pi(){var e;return!!(!((e=window?.navigator)===null||e===void 0)&&e.globalPrivacyControl)}function ji(e={}){let{disabled:t,portal:n,requireConsent:r,userPrivacySettings:i}=e;if(r)if(i?.accepted){if(i?.functional===!1&&i?.performance===!1&&i?.targeting===!1)return!0}else return!0;return i?.accepted===!0&&i?.functional===!1&&i?.performance===!1&&i?.targeting===!1||t||n?.eueiEnabled===!1||Pi()?!0:!(!n||Ti(n)||Ni(n)||_i(n))}function Ti(e){return e.eueiEnabled&&e.user&&e.user.orgId===e.id}function Ni(e){return e.user&&!e.user.orgId&&e.ipCntryCode==="US"}function _i(e){return!e.user&&e.ipCntryCode==="US"}var Ue={storage:{},memory:!0,get(e){let t;try{t=window.localStorage&&window.localStorage.getItem(e)||this.storage[e]}catch{t=this.storage[e]}if(t)try{return JSON.parse(t)}catch{return}else return},set(e,t){let n=JSON.stringify(t);try{window.localStorage.setItem(e,n)}catch{this.memory||(console.error("setting local storage failed, falling back to in-memory storage"),this.memory=!0),this.storage[e]=t}},delete(e){try{window.localStorage.removeItem(e)}catch{this.memory||(console.error("setting local storage failed, falling back to in-memory storage"),this.memory=!0),delete this.storage[e]}}},Er="esri-telemetry";function Ci(e){return new Promise((t,n)=>{e.onload=t,e.onerror=n,(!Ui(e)||e.body)&&t()})}function Mi(e){let{id:t,dataAttribute:n}=e;return!!document.getElementById(t)||!!document.querySelector(`[data-${Er}="${n}"]`)}function Ui(e){let{body:t,src:n,id:r,dataAttribute:i,section:o="body",type:s="text/javascript",async:a=!1,defer:u=!1,onload:c,onerror:p}=e;if(typeof window>"u")throw new Fe("Window is undefined: Cannot add script element.");if(Mi(e)){console.log(`script (${r||i}) is already present, skipping`);return}let l=Di({id:r,dataAttribute:i,type:s,async:a,defer:u,body:t,src:n,onload:c,onerror:p});return o==="body"?document.body.appendChild(l):document.head.appendChild(l)}var Fe=class extends Error{};function Di({id:e,dataAttribute:t,type:n,async:r,defer:i,body:o,src:s,onload:a,onerror:u}){let c=document.createElement("script");return e&&(c.id=e),t&&c.setAttribute(`data-${Er}`,t),s&&(c.src=s),o&&(c.innerText=o),c.type=n,c.async=r,c.defer=i,a&&(c.onload=a),u&&(c.onerror=u),c}function Ri(e){return e.map(t=>{let n=[];return["src","id","dataAttribute","type"].forEach(r=>{let i=r;r==="dataAttribute"&&(i="data-esri-telemetry"),t[r]&&n.push(`${i}="${t[r]}"`)}),["async","defer"].forEach(r=>{t[r]&&n.push(`${r}`)}),`<script ${n.join(" ")}>${t.body?t.body:""}<\/script>`}).join("")}var zi=["esri.com","esriuk.com","esri.de","esri.ca","esrifrance.fr","esri.nl","esri-portugal.pt","esribulgaria.com","esri.fi","esri.kr","esrimalaysia.com.my","esri.es","esriaustralia.com.au","esri-southafrica.com","esri.cl","esrichina.com.cn","esri.co","esriturkey.com.tr","geodata.no","esriitalia.it","esri.pl"],kt=class{constructor(t){var n,r,i;this.trackers=[],this.options=t,this.debug=t.debug,this.suppressDisabledWarnings=t.suppressDisabledWarnings,this.logger=t.logger||console,t.userPrivacySettings&&(this._userPrivacySettings=t.userPrivacySettings),t.requireConsent&&!t.userPrivacySettings&&(this._userPrivacySettings={accepted:!1,performance:!1,targeting:!1,functional:!1,id:Vi(),timestamp:Date.now()},t.userPrivacySettings=this._userPrivacySettings),this.disabled=ji(t),this.disabled&&!this.suppressDisabledWarnings&&this.logger.info("Telemetry Disabled");let o=((n=t.portal)===null||n===void 0?void 0:n.user)||t.user;o&&this.setUser(o,(i=(r=t.portal)===null||r===void 0?void 0:r.subscriptionInfo)===null||i===void 0?void 0:i.type),this.disabled||this.initializeTrackers()}shouldInitializeTrackers(t,n,r){let i=!n&&!t?.accepted,o=r.every(s=>t?.[s]);return i||o}filterTrackers(t){return this.options.plugins.filter(n=>t.includes(n.name))}initializeTrackers(){let t=this._userPrivacySettings,n=this.options.requireConsent;this.trackers=[],this.options.plugins&&(t?(this.shouldInitializeTrackers(t,n,["performance"])&&this.trackers.push(...this.filterTrackers(["amazon"])),this.shouldInitializeTrackers(t,n,["performance","targeting","functional"])&&this.trackers.push(...this.filterTrackers(["adobe-analytics","googleAnalytics","siteimprove"]))):this.trackers.push(...this.options.plugins)),this.trackers.length||this.logger.info("No trackers configured")}getScriptTags(){return this.trackers.map(t=>t.getScriptTags&&t.getScriptTags()).join("")}async init(){let t=this.trackers.map(n=>n.init());await Promise.all(t)}setUser(t={},n="Public"){t=typeof t=="string"?{username:t}:t,this.user=t,this.user.accountType=n;let r;if(t.email&&t.email.split){let i=t.email.split("@")[1];r=zi.filter(o=>i===o).length>0}(r||["In House","Demo and Marketing"].indexOf(n)>-1)&&(this.user.internalUser=!0)}async updateUserPrivacySettings(t){let{accepted:n,performance:r,targeting:i,functional:o}=this._userPrivacySettings,s=t.accepted&&!n&&!this.options.requireConsent&&(!t.performance||!t.targeting||!t.functional)||!t.performance&&r||!t.targeting&&i||!t.functional&&o;return this._userPrivacySettings=t,s||(this.disabled=!1,this.initializeTrackers(),await this.init()),{reload:s}}logPageView(t,n={},r={}){if(this.disabled&&!this.suppressDisabledWarnings)return this.logger.info("Page view was not logged because telemetry is disabled."),!1;let i=this.trackers.filter(({disabled:a,hasError:u})=>!a&&!u);if(!i.length)return this.logger.info("Page view was not logged because no enabled telemetry-plugins are registered."),!1;let o=this.preProcess(n,r);this.debug&&this.logger.info("Tracking page view",JSON.stringify(o));let s=i.map(a=>a.logPageView(t,o));return Promise.all(s).then(),!0}logEvent(t,n={}){if(this.disabled&&!this.suppressDisabledWarnings)return this.logger.info("Event was not logged because telemetry is disabled."),!1;let r=this.trackers.filter(({disabled:s,hasError:a})=>!s&&!a);if(!r.length)return this.logger.info("Event was not logged because no enabled telemetry-plugins are registered."),!1;let i=this.preProcess(t,n);this.debug&&this.logger.info("Tracking event",JSON.stringify(i));let o=r.map(s=>s.logEvent(i));return Promise.all(o).then(),!0}logError(t={}){t=Object.assign({eventType:"error"},t),this.logEvent(t)}startWorkflow(t,n={}){let r={name:t,start:Date.now(),steps:[],workflowId:Math.floor((1+Math.random())*17592186044416).toString(16)};this.saveWorkflow(r);let i=Object.assign({name:t,step:"start"},n);return this.logWorkflow(i),r}stepWorkflow(t,n,r={}){let i=typeof r=="string"?r:r.details,o=Object.assign({name:t,step:n,details:i},r);this.logWorkflow(o)}endWorkflow(t,n={}){let r=Object.assign({name:t,step:"finish"},n);this.logWorkflow(r)}cancelWorkflow(t,n={}){let r=Object.assign({name:t,step:"cancel"},n);this.logWorkflow(r)}getWorkflow(t){let n=Ue.get(`TELEMETRY-WORKFLOW:${t}`);if(n){let r=Date.now()-n.start,i=1800*1e3;if(r<i)return n;this.deleteWorkflow(n)}}saveWorkflow(t){Ue.set(`TELEMETRY-WORKFLOW:${t.name}`,t)}deleteWorkflow(t){Ue.delete(`TELEMETRY-WORKFLOW:${t.name}`)}logWorkflow(t={}){t=this.preProcess(t);let n=this.getWorkflow(t.name);n||(this.startWorkflow(t.name),n=this.getWorkflow(t.name)),n.steps.push(t.step),n.duration=(Date.now()-n.start)/1e3,["cancel","finish"].indexOf(t.step)>-1?this.deleteWorkflow(n):this.saveWorkflow(n);let r=Object.assign(t,{eventType:"workflow",category:t.name,action:t.step,label:t.details,duration:n.duration,workflowId:n.workflowId});this.logEvent(r)}preProcess(t={},n={}){let r={};return this.user&&(r={user:"unknown",org:"unknown",lastLogin:this.user.lastLogin,userSince:this.user.created,internalUser:this.user.internalUser||!1,accountType:this.user.accountType}),Object.entries(Object.assign(Object.assign({},t),r)).reduce(Li(n.omitComplexData,this.logger),{})}disable(){this.disabled=!0,this.trackers.forEach(t=>{var n;t.hasError||(t.disabled=!0,(n=t.disable)===null||n===void 0||n.call(t))})}disableTracker(t){var n;let r=this.trackers.find(({name:i})=>i===t);r&&!r.hasError&&(r.disabled=!0,(n=r.disable)===null||n===void 0||n.call(r))}enableTracker(t){var n;let r=this.trackers.find(({name:i})=>i===t);r&&!r.hasError&&(r.disabled=!1,(n=r.enable)===null||n===void 0||n.call(r))}};function Li(e,t){return function(n,[r,i]){return $i(i)?n[r]=i:e||(t.warn(`You are trying to log a non-primitive value, ${r}:${JSON.stringify(i)}. This will get logged as [object Object]`),n[r]=i),n}}function $i(e){return["string","number","boolean","undefined"].includes(typeof e)||e&&typeof e.valueOf()=="string"}function Vi(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function Gt(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}var At=class{constructor(t){var n;if(this.name="googleAnalytics",this.dimensions={},this.metrics={},this.isInitialized=!1,typeof window<"u"&&!(!((n=t?.measurementIds)===null||n===void 0)&&n.length))throw new Error("at least one measurementId needs to be provided in your configuration");Object.assign(this,t)}_getScripts(){return[{dataAttribute:"google-analytics",async:!0,src:`https://www.googletagmanager.com/gtag/js?id=${this.measurementIds?this.measurementIds[0]:""}`}]}getScriptTags(){return Ri(this._getScripts())}async init(){if(!this.isInitialized){if(typeof window>"u")throw new Fe("Window is undefined: Cannot add script element.");await Promise.all(this._getScripts().map(t=>Ci(t))),this.injectConfig(),this.isInitialized=!0}}logPageView(t,n={}){let r=this.buildCustomParams(n),i=Object.assign({page_title:t||window.location.pathname},r);return window.gtag("event","page_view",i),!0}logEvent(t){let{action:n}=t,r=Gt(t,["action"]),i=n||"other",o=this.buildCustomParams(r);return window.gtag("event",i,o),!0}disable(){this.measurementIds&&this.measurementIds.forEach(t=>{window[`ga-disable-${t}`]=!0})}enable(){this.measurementIds&&this.measurementIds.forEach(t=>{window[`ga-disable-${t}`]=void 0})}injectConfig(){window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date);let t={custom_map:this.createDimensionsAndMetricsCustomMap(this.dimensions,this.metrics),send_page_view:!1,anonymize_ip:!0};this.measurementIds.forEach(n=>{window.gtag("config",n,t)})}buildCustomParams(t){let n,{category:r,label:i}=t;return n=this.verifyCustomDimensionAndMetrics(t),r&&(n=Object.assign(Object.assign({},n),{event_category:r})),i&&(n=Object.assign(Object.assign({},n),{event_label:i})),n}verifyCustomDimensionAndMetrics(t){let n=this.createDimensionsAndMetricsCustomMap(this.dimensions,this.metrics),r=Object.values(n);return Object.keys(t).filter(i=>r.includes(i)).reduce((i,o)=>Object.assign(i,{[o]:t[o]}),{})}createDimensionsAndMetricsCustomMap(t={},n={}){let r=this.createMetricCustomMap(n),i=this.createDimensionCustomMap(t);return Object.assign(Object.assign({},r),i)}createMetricCustomMap(t={}){return Object.keys(t).map(function(n){return{key:`metric${t[n]}`,value:n}}).filter(n=>n).reduce((n,{key:r,value:i})=>(n[r]=i,n),{})}createDimensionCustomMap(t={}){return Object.keys(t).map(function(n){return{key:`dimension${t[n]}`,value:n}}).filter(n=>n).reduce((n,{key:r,value:i})=>(n[r]=i,n),{})}},gn="TELEMETRY_COGNITO_CREDENTIALS";function Wi(e,t={}){let n=`https://cognito-identity${t.fips===!0?"-fips":""}.us-east-1.amazonaws.com/`,r=Ue.get(gn);if(r&&Date.now()/1e3<r.Expiration)return Promise.resolve(r);let i={method:"POST",headers:{"Content-type":"application/x-amz-json-1.1","X-Amz-Target":"AWSCognitoIdentityService.GetId"},body:JSON.stringify({IdentityPoolId:e})};return fetch(n,i).then(o=>{if(!o.ok)throw new Error(o.statusText);return o.json()}).then(o=>{let{IdentityId:s}=o,a={method:"POST",headers:{"Content-type":"application/x-amz-json-1.1","X-Amz-Target":"AWSCognitoIdentityService.GetCredentialsForIdentity"},body:JSON.stringify({IdentityId:s})};return fetch(n,a)}).then(o=>{if(!o.ok)throw new Error(o.statusText);return o.json()}).then(({Credentials:o})=>(Ue.set(gn,o),o))}function Pr({telemetryData:e,dimensionLookup:t={},excludeKeys:n=[]}){return Object.keys(e).filter(r=>!n.includes(r)).map(r=>t[r]?{key:Hi(t,r),value:e[r]}:{key:r,value:qi(e,r)}).reduce((r,{key:i,value:o})=>(r[i]=o,r),{})}function qi(e,t){return t==="json"?e[t]?JSON.stringify(e[t]):"null":e[t]===void 0?"null":e[t].toString()}function Hi(e,t){return`dimension${e[t]}`}var Ki=["size","duration","position","number","count"];function jr(e,t={}){return Object.keys(e).filter(n=>t[n]||Ki.includes(n)).map(n=>t[n]?{key:Gi(t,n),value:e[n]}:{key:n,value:e[n]}).reduce((n,{key:r,value:i})=>(n[r]=i,n),{})}function Gi(e,t){return`metric${e[t]}`}function Ji({event:e={},dimensionLookup:t={},metricLookup:n={}}){var r,i;let{pathname:o,eventType:s="other"}=e,a=jr(e,n),u=Pr({telemetryData:Object.assign({eventType:s},e),dimensionLookup:t,excludeKeys:["workflow","pathname",...Object.keys(a),...Object.keys(n)]}),c=Object.assign(Object.assign({name:s},u),a);return typeof document<"u"&&document.referrer&&(c.referrer=document.referrer),typeof window<"u"&&!c.hostname&&(c.hostname=(r=window.location)===null||r===void 0?void 0:r.hostname),c.path=typeof window<"u"&&window.location.pathname?(i=window.location)===null||i===void 0?void 0:i.pathname:o,c}function Xi({page:e,previousPage:t={},options:n={},dimensionLookup:r={},metricLookup:i={}}){let o=jr(n,i),s=Pr({telemetryData:n,dimensionLookup:r,excludeKeys:["workflow",...Object.keys(o),...Object.keys(i)]}),{referrer:a,title:u}=document||{},{hostname:c,pathname:p}=window&&window.location?window.location:{};return Object.assign(Object.assign({name:"pageView",referrer:a,hostname:c,path:e||p,pageUrl:e||p,pageName:u,previousPageUrl:t.pageUrl,previousPageName:t.pageName},s),o)}function hn(e,t,n,r,i){for(t=t.split?t.split("."):t,r=0;r<t.length;r++)e=e?e[t[r]]:i;return e===i?n:e}var Fi="function",Bi="string",ne="undefined",Qi="boolean",Be="object",Yi="array",Zi="number",eo="symbol",to="null",no=function(){},Tr="any",Nr="*",we="__",ro="form",io="input",oo="button",so="select",Qe=typeof process!==ne?process:{};Qe.env&&Qe.env.NODE_ENV;var Z=typeof document!==ne;Qe.versions!=null&&Qe.versions.node!=null;typeof Deno!==ne&&Deno.core;Z&&window.name==="nodejs"||typeof navigator!==ne&&typeof navigator.userAgent!==ne&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function _r(e,t){return t.charAt(0)[e]()+t.slice(1)}var ao=_r.bind(null,"toUpperCase"),uo=_r.bind(null,"toLowerCase");function co(e){return Cr(e)?ao(to):typeof e===Be?go(e):Object.prototype.toString.call(e).slice(8,-1)}function Ye(e,t){t===void 0&&(t=!0);var n=co(e);return t?uo(n):n}function $e(e,t){return typeof t===e}var ee=$e.bind(null,Fi),le=$e.bind(null,Bi),Se=$e.bind(null,ne),lo=$e.bind(null,Qi);$e.bind(null,eo);function Cr(e){return e===null}function fo(e){return Ye(e)===Zi&&!isNaN(e)}function Mr(e){return Ye(e)===Yi}function Q(e){if(!po(e))return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function po(e){return e&&(typeof e===Be||e!==null)}function go(e){return ee(e.constructor)?e.constructor.name:null}function ho(e){return e instanceof Error||le(e.message)&&e.constructor&&fo(e.constructor.stackTraceLimit)}function Ur(e,t){if(typeof t!="object"||Cr(t))return!1;if(t instanceof e)return!0;var n=Ye(new e(""));if(ho(t))for(;t;){if(Ye(t)===n)return!0;t=Object.getPrototypeOf(t)}return!1}Ur.bind(null,TypeError);Ur.bind(null,SyntaxError);function nt(e,t){var n=e instanceof Element||e instanceof HTMLDocument;return n&&t?mo(e,t):n}function mo(e,t){return t===void 0&&(t=""),e&&e.nodeName===t.toUpperCase()}function rt(e){var t=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(t))}}rt(nt,ro);rt(nt,oo);rt(nt,io);rt(nt,so);function yo(e){return e?Mr(e)?e:[e]:[]}function mn(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function vo(){if(Z){var e=navigator,t=e.languages;return e.userLanguage||(t&&t.length?t[0]:e.language)}}function bo(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function wo(e){return(function(t){for(var n,r=Object.create(null),i=/([^&=]+)=?([^&]*)/g;n=i.exec(t);){var o=mn(n[1]),s=mn(n[2]);if(o)if(o.substring(o.length-2)==="[]"){var a=r[o=o.substring(0,o.length-2)]||(r[o]=[]);r[o]=Array.isArray(a)?a:[],r[o].push(s)}else r[o]=s===""||s}for(var u in r){var c=u.split("[");c.length>1&&(xo(r,c.map(function(p){return p.replace(/[?[\]\\ ]/g,"")}),r[u]),delete r[u])}return r})((function(t){return Z&&window.location.search.substring(1)})())}function xo(e,t,n){for(var r=t.length-1,i=0;i<r;++i){var o=t[i];if(o==="__proto__"||o==="constructor")break;o in e||(e[o]={}),e=e[o]}e[t[r]]=n}function xe(){for(var e="",t=0,n=4294967295*Math.random()|0;t++<36;){var r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[t-1],i=15&n;e+=r=="-"||r=="4"?r:(r=="x"?i:3&i|8).toString(16),n=t%8==0?4294967295*Math.random()|0:n>>4}return e}var me="global",Ee=we+me+we,Pe=typeof self===Be&&self.self===self&&self||typeof global===Be&&global[me]===global&&global||void 0;function pe(e){return Pe[Ee][e]}function ge(e,t){return Pe[Ee][e]=t}function Te(e){delete Pe[Ee][e]}function Ne(e,t,n){var r;try{if(Jt(e)){var i=window[e];r=i[t].bind(i)}}catch{}return r||n}Pe[Ee]||(Pe[Ee]={});var We={};function Jt(e){if(typeof We[e]!==ne)return We[e];try{var t=window[e];t.setItem(ne,ne),t.removeItem(ne)}catch{return We[e]=!1}return We[e]=!0}function T(){return T=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},T.apply(null,arguments)}var ce="function",oe="undefined",De="reducer",Dr="@@redux/",It=Dr+"INIT",So=Dr+Math.random().toString(36),yn=(function(){return typeof Symbol===ce&&Symbol.observable||"@@observable"})(),qe=" != "+ce;function Rr(e,t,n){var r;if(typeof t===ce&&typeof n===oe&&(n=t,t=void 0),typeof n!==oe){if(typeof n!==ce)throw new Error("enhancer"+qe);return n(Rr)(e,t)}if(typeof e!==ce)throw new Error(De+qe);var i=e,o=t,s=[],a=s,u=!1;function c(){a===s&&(a=s.slice())}function p(){return o}function l(y){if(typeof y!==ce)throw new Error("Listener"+qe);var b=!0;return c(),a.push(y),function(){if(b){b=!1,c();var S=a.indexOf(y);a.splice(S,1)}}}function x(y){if(!Q(y))throw new Error("Act != obj");if(typeof y.type===oe)throw new Error("ActType "+oe);if(u)throw new Error("Dispatch in "+De);try{u=!0,o=i(o,y)}finally{u=!1}for(var b=s=a,S=0;S<b.length;S++)(0,b[S])();return y}return x({type:It}),(r={dispatch:x,subscribe:l,getState:p,replaceReducer:function(y){if(typeof y!==ce)throw new Error("next "+De+qe);i=y,x({type:It})}})[yn]=function(){var y,b=l;return(y={subscribe:function(S){if(typeof S!="object")throw new TypeError("Observer != obj");function h(){S.next&&S.next(p())}return h(),{unsubscribe:b(h)}}})[yn]=function(){return this},y},r}function Oo(e,t){var n=t&&t.type;return"action "+(n&&n.toString()||"?")+De+" "+e+" returns "+oe}function je(){var e=[].slice.call(arguments);return e.length===0?function(t){return t}:e.length===1?e[0]:e.reduce(function(t,n){return function(){return t(n.apply(void 0,[].slice.call(arguments)))}})}function ko(){var e=arguments;return function(t){return function(n,r,i){var o,s=t(n,r,i),a=s.dispatch,u={getState:s.getState,dispatch:function(c){return a(c)}};return o=[].slice.call(e).map(function(c){return c(u)}),T({},s,{dispatch:a=je.apply(void 0,o)(s.dispatch)})}}}var fe=we+"anon_id",ye=we+"user_id",ke=we+"user_traits",Et="analytics",ue="userId",Oe="anonymousId",Je=["bootstrap","params","campaign","initializeStart","initialize","initializeEnd","ready","resetStart","reset","resetEnd","pageStart","page","pageEnd","pageAborted","trackStart","track","trackEnd","trackAborted","identifyStart","identify","identifyEnd","identifyAborted","userIdChanged","registerPlugins","enablePlugin","disablePlugin","online","offline","setItemStart","setItem","setItemEnd","setItemAborted","removeItemStart","removeItem","removeItemEnd","removeItemAborted"],Pt=["name","EVENTS","config","loaded"],j=Je.reduce(function(e,t){return e[t]=t,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),vn=/^utm_/,bn=/^an_prop_/,wn=/^an_trait_/;function Ao(e){var t=e.storage.setItem;return function(n){return function(r){return function(i){if(i.type===j.bootstrap){var o=i.params,s=i.user,a=i.persistedUser,u=i.initialUser,c=a.userId===s.userId;a.anonymousId!==s.anonymousId&&t(fe,s.anonymousId),c||t(ye,s.userId),u.traits&&t(ke,T({},c&&a.traits?a.traits:{},u.traits));var p=Object.keys(i.params);if(p.length){var l=o.an_uid,x=o.an_event,y=p.reduce(function(b,S){if(S.match(vn)||S.match(/^(d|g)clid/)){var h=S.replace(vn,"");b.campaign[h==="campaign"?"name":h]=o[S]}return S.match(bn)&&(b.props[S.replace(bn,"")]=o[S]),S.match(wn)&&(b.traits[S.replace(wn,"")]=o[S]),b},{campaign:{},props:{},traits:{}});n.dispatch(T({type:j.params,raw:o},y,l?{userId:l}:{})),l&&setTimeout(function(){return e.identify(l,y.traits)},0),x&&setTimeout(function(){return e.track(x,y.props)},0),Object.keys(y.campaign).length&&n.dispatch({type:j.campaign,campaign:y.campaign})}}return r(i)}}}}function Io(e){return function(t,n){if(t===void 0&&(t={}),n===void 0&&(n={}),n.type===j.setItemEnd){if(n.key===fe)return T({},t,{anonymousId:n.value});if(n.key===ye)return T({},t,{userId:n.value})}switch(n.type){case j.identify:return Object.assign({},t,{userId:n.userId,traits:T({},t.traits,n.traits)});case j.reset:return[ye,fe,ke].forEach(function(r){e.removeItem(r)}),Object.assign({},t,{userId:null,anonymousId:null,traits:{}});default:return t}}}function xn(e){return{userId:e.getItem(ye),anonymousId:e.getItem(fe),traits:e.getItem(ke)}}var jt=function(e){return we+"TEMP"+we+e};function Eo(e){var t=e.storage,n=t.setItem,r=t.removeItem,i=t.getItem;return function(o){return function(s){return function(a){var u=a.userId,c=a.traits,p=a.options;if(a.type===j.reset&&([ye,ke,fe].forEach(function(y){r(y)}),[ue,Oe,"traits"].forEach(function(y){Te(jt(y))})),a.type===j.identify){i(fe)||n(fe,xe());var l=i(ye),x=i(ke)||{};l&&l!==u&&o.dispatch({type:j.userIdChanged,old:{userId:l,traits:x},new:{userId:u,traits:c},options:p}),u&&n(ye,u),c&&n(ke,T({},x,c))}return s(a)}}}}var Me={};function Sn(e,t){Me[e]&&ee(Me[e])&&(Me[e](t),delete Me[e])}function zr(e,t,n){return new Promise(function(r,i){return t()?r(e):n<1?i(T({},e,{queue:!0})):new Promise(function(o){return setTimeout(o,10)}).then(function(o){return zr(e,t,n-10).then(r,i)})})}function Po(e){return{abort:e}}function Lr(e,t,n){var r={},i=t(),o=e.getState(),s=o.plugins,a=o.queue,u=o.user;if(!o.context.offline&&a&&a.actions&&a.actions.length){var c=a.actions.reduce(function(l,x,y){return s[x.plugin].loaded?(l.process.push(x),l.processIndex.push(y)):(l.requeue.push(x),l.requeueIndex.push(y)),l},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(c.processIndex&&c.processIndex.length){c.processIndex.forEach(function(l){var x=a.actions[l],y=x.plugin,b=x.payload.type,S=i[y][b];if(S&&ee(S)){var h,f=(function(w,v){return w===void 0&&(w={}),v===void 0&&(v={}),[ue,Oe].reduce(function(A,k){return w.hasOwnProperty(k)&&v[k]&&v[k]!==w[k]&&(A[k]=v[k]),A},w)})(x.payload,u),m=r[f.meta.rid];if(!m&&(h=S({payload:f,config:s[y].config,instance:n,abort:Po}))&&Q(h)&&h.abort)return void(r[f.meta.rid]=!0);if(!m){var O=b+":"+y;e.dispatch(T({},f,{type:O,_:{called:O,from:"queueDrain"}}))}}});var p=a.actions.filter(function(l,x){return!~c.processIndex.indexOf(x)});a.actions=p}}}var dt=function(e){var t=e.data,n=e.action,r=e.instance,i=e.state,o=e.allPlugins,s=e.allMatches,a=e.store,u=e.EVENTS;try{var c=i.plugins,p=i.context,l=n.type,x=l.match(Ae),y=t.exact.map(function(h){return h.pluginName});x&&(y=s.during.map(function(h){return h.pluginName}));var b=(function(h,f){return function(m,O,w){var v=O.config,A=O.name,k=A+"."+m.type;w&&(k=w.event);var C=m.type.match(Ae)?(function(M,P,z,U,q){return function($,E){var H=U?U.name:M,D=E&&ze(E)?E:z;if(U&&(!(D=E&&ze(E)?E:[M]).includes(M)||D.length!==1))throw new Error("Method "+P+" can only abort "+M+" plugin. "+JSON.stringify(D)+" input valid");return T({},q,{abort:{reason:$,plugins:D,caller:P,_:H}})}})(A,k,f,w,m):(function(M,P){return function(){throw new Error(M.type+" action not cancellable. Remove abort in "+P)}})(m,k);return{payload:jo(m),instance:h,config:v||{},abort:C}}})(r,y),S=t.exact.reduce(function(h,f){var m=f.pluginName,O=f.methodName,w=!1;return O.match(/^initialize/)||O.match(/^reset/)||(w=!c[m].loaded),p.offline&&O.match(/^(page|track|identify)/)&&(w=!0),h[""+m]=w,h},{});return Promise.resolve(t.exact.reduce(function(h,f,m){var O=f.pluginName;return Promise.resolve(h).then(function(w){function v(){return Promise.resolve(w)}var A=(function(){if(t.namespaced&&t.namespaced[O])return Promise.resolve(t.namespaced[O].reduce(function(k,C,M){return Promise.resolve(k).then(function(P){return C.method&&ee(C.method)?((function($,E){var H=jn($);if(H&&H.name===E){var D=jn(H.method);throw new Error([E+" plugin is calling method "+$,"Plugins cant call self","Use "+H.method+" "+(D?"or "+D.method:"")+" in "+E+" plugin insteadof "+$].join(`
|
|
2
|
+
import{a as pn}from"./DV233ITZ.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import{b as dn}from"./EIQZRLWQ.js";import{H as fn,h as cn,r as ln}from"./46DQNAMV.js";import"./OR4HXHSY.js";function Pi(){var e;return!!(!((e=window?.navigator)===null||e===void 0)&&e.globalPrivacyControl)}function ji(e={}){let{disabled:t,portal:n,requireConsent:r,userPrivacySettings:i}=e;if(r)if(i?.accepted){if(i?.functional===!1&&i?.performance===!1&&i?.targeting===!1)return!0}else return!0;return i?.accepted===!0&&i?.functional===!1&&i?.performance===!1&&i?.targeting===!1||t||n?.eueiEnabled===!1||Pi()?!0:!(!n||Ti(n)||Ni(n)||_i(n))}function Ti(e){return e.eueiEnabled&&e.user&&e.user.orgId===e.id}function Ni(e){return e.user&&!e.user.orgId&&e.ipCntryCode==="US"}function _i(e){return!e.user&&e.ipCntryCode==="US"}var Ue={storage:{},memory:!0,get(e){let t;try{t=window.localStorage&&window.localStorage.getItem(e)||this.storage[e]}catch{t=this.storage[e]}if(t)try{return JSON.parse(t)}catch{return}else return},set(e,t){let n=JSON.stringify(t);try{window.localStorage.setItem(e,n)}catch{this.memory||(console.error("setting local storage failed, falling back to in-memory storage"),this.memory=!0),this.storage[e]=t}},delete(e){try{window.localStorage.removeItem(e)}catch{this.memory||(console.error("setting local storage failed, falling back to in-memory storage"),this.memory=!0),delete this.storage[e]}}},Er="esri-telemetry";function Ci(e){return new Promise((t,n)=>{e.onload=t,e.onerror=n,(!Ui(e)||e.body)&&t()})}function Mi(e){let{id:t,dataAttribute:n}=e;return!!document.getElementById(t)||!!document.querySelector(`[data-${Er}="${n}"]`)}function Ui(e){let{body:t,src:n,id:r,dataAttribute:i,section:o="body",type:s="text/javascript",async:a=!1,defer:u=!1,onload:c,onerror:p}=e;if(typeof window>"u")throw new Fe("Window is undefined: Cannot add script element.");if(Mi(e)){console.log(`script (${r||i}) is already present, skipping`);return}let l=Di({id:r,dataAttribute:i,type:s,async:a,defer:u,body:t,src:n,onload:c,onerror:p});return o==="body"?document.body.appendChild(l):document.head.appendChild(l)}var Fe=class extends Error{};function Di({id:e,dataAttribute:t,type:n,async:r,defer:i,body:o,src:s,onload:a,onerror:u}){let c=document.createElement("script");return e&&(c.id=e),t&&c.setAttribute(`data-${Er}`,t),s&&(c.src=s),o&&(c.innerText=o),c.type=n,c.async=r,c.defer=i,a&&(c.onload=a),u&&(c.onerror=u),c}function Ri(e){return e.map(t=>{let n=[];return["src","id","dataAttribute","type"].forEach(r=>{let i=r;r==="dataAttribute"&&(i="data-esri-telemetry"),t[r]&&n.push(`${i}="${t[r]}"`)}),["async","defer"].forEach(r=>{t[r]&&n.push(`${r}`)}),`<script ${n.join(" ")}>${t.body?t.body:""}<\/script>`}).join("")}var zi=["esri.com","esriuk.com","esri.de","esri.ca","esrifrance.fr","esri.nl","esri-portugal.pt","esribulgaria.com","esri.fi","esri.kr","esrimalaysia.com.my","esri.es","esriaustralia.com.au","esri-southafrica.com","esri.cl","esrichina.com.cn","esri.co","esriturkey.com.tr","geodata.no","esriitalia.it","esri.pl"],kt=class{constructor(t){var n,r,i;this.trackers=[],this.options=t,this.debug=t.debug,this.suppressDisabledWarnings=t.suppressDisabledWarnings,this.logger=t.logger||console,t.userPrivacySettings&&(this._userPrivacySettings=t.userPrivacySettings),t.requireConsent&&!t.userPrivacySettings&&(this._userPrivacySettings={accepted:!1,performance:!1,targeting:!1,functional:!1,id:Vi(),timestamp:Date.now()},t.userPrivacySettings=this._userPrivacySettings),this.disabled=ji(t),this.disabled&&!this.suppressDisabledWarnings&&this.logger.info("Telemetry Disabled");let o=((n=t.portal)===null||n===void 0?void 0:n.user)||t.user;o&&this.setUser(o,(i=(r=t.portal)===null||r===void 0?void 0:r.subscriptionInfo)===null||i===void 0?void 0:i.type),this.disabled||this.initializeTrackers()}shouldInitializeTrackers(t,n,r){let i=!n&&!t?.accepted,o=r.every(s=>t?.[s]);return i||o}filterTrackers(t){return this.options.plugins.filter(n=>t.includes(n.name))}initializeTrackers(){let t=this._userPrivacySettings,n=this.options.requireConsent;this.trackers=[],this.options.plugins&&(t?(this.shouldInitializeTrackers(t,n,["performance"])&&this.trackers.push(...this.filterTrackers(["amazon"])),this.shouldInitializeTrackers(t,n,["performance","targeting","functional"])&&this.trackers.push(...this.filterTrackers(["adobe-analytics","googleAnalytics","siteimprove"]))):this.trackers.push(...this.options.plugins)),this.trackers.length||this.logger.info("No trackers configured")}getScriptTags(){return this.trackers.map(t=>t.getScriptTags&&t.getScriptTags()).join("")}async init(){let t=this.trackers.map(n=>n.init());await Promise.all(t)}setUser(t={},n="Public"){t=typeof t=="string"?{username:t}:t,this.user=t,this.user.accountType=n;let r;if(t.email&&t.email.split){let i=t.email.split("@")[1];r=zi.filter(o=>i===o).length>0}(r||["In House","Demo and Marketing"].indexOf(n)>-1)&&(this.user.internalUser=!0)}async updateUserPrivacySettings(t){let{accepted:n,performance:r,targeting:i,functional:o}=this._userPrivacySettings,s=t.accepted&&!n&&!this.options.requireConsent&&(!t.performance||!t.targeting||!t.functional)||!t.performance&&r||!t.targeting&&i||!t.functional&&o;return this._userPrivacySettings=t,s||(this.disabled=!1,this.initializeTrackers(),await this.init()),{reload:s}}logPageView(t,n={},r={}){if(this.disabled&&!this.suppressDisabledWarnings)return this.logger.info("Page view was not logged because telemetry is disabled."),!1;let i=this.trackers.filter(({disabled:a,hasError:u})=>!a&&!u);if(!i.length)return this.logger.info("Page view was not logged because no enabled telemetry-plugins are registered."),!1;let o=this.preProcess(n,r);this.debug&&this.logger.info("Tracking page view",JSON.stringify(o));let s=i.map(a=>a.logPageView(t,o));return Promise.all(s).then(),!0}logEvent(t,n={}){if(this.disabled&&!this.suppressDisabledWarnings)return this.logger.info("Event was not logged because telemetry is disabled."),!1;let r=this.trackers.filter(({disabled:s,hasError:a})=>!s&&!a);if(!r.length)return this.logger.info("Event was not logged because no enabled telemetry-plugins are registered."),!1;let i=this.preProcess(t,n);this.debug&&this.logger.info("Tracking event",JSON.stringify(i));let o=r.map(s=>s.logEvent(i));return Promise.all(o).then(),!0}logError(t={}){t=Object.assign({eventType:"error"},t),this.logEvent(t)}startWorkflow(t,n={}){let r={name:t,start:Date.now(),steps:[],workflowId:Math.floor((1+Math.random())*17592186044416).toString(16)};this.saveWorkflow(r);let i=Object.assign({name:t,step:"start"},n);return this.logWorkflow(i),r}stepWorkflow(t,n,r={}){let i=typeof r=="string"?r:r.details,o=Object.assign({name:t,step:n,details:i},r);this.logWorkflow(o)}endWorkflow(t,n={}){let r=Object.assign({name:t,step:"finish"},n);this.logWorkflow(r)}cancelWorkflow(t,n={}){let r=Object.assign({name:t,step:"cancel"},n);this.logWorkflow(r)}getWorkflow(t){let n=Ue.get(`TELEMETRY-WORKFLOW:${t}`);if(n){let r=Date.now()-n.start,i=1800*1e3;if(r<i)return n;this.deleteWorkflow(n)}}saveWorkflow(t){Ue.set(`TELEMETRY-WORKFLOW:${t.name}`,t)}deleteWorkflow(t){Ue.delete(`TELEMETRY-WORKFLOW:${t.name}`)}logWorkflow(t={}){t=this.preProcess(t);let n=this.getWorkflow(t.name);n||(this.startWorkflow(t.name),n=this.getWorkflow(t.name)),n.steps.push(t.step),n.duration=(Date.now()-n.start)/1e3,["cancel","finish"].indexOf(t.step)>-1?this.deleteWorkflow(n):this.saveWorkflow(n);let r=Object.assign(t,{eventType:"workflow",category:t.name,action:t.step,label:t.details,duration:n.duration,workflowId:n.workflowId});this.logEvent(r)}preProcess(t={},n={}){let r={};return this.user&&(r={user:"unknown",org:"unknown",lastLogin:this.user.lastLogin,userSince:this.user.created,internalUser:this.user.internalUser||!1,accountType:this.user.accountType}),Object.entries(Object.assign(Object.assign({},t),r)).reduce(Li(n.omitComplexData,this.logger),{})}disable(){this.disabled=!0,this.trackers.forEach(t=>{var n;t.hasError||(t.disabled=!0,(n=t.disable)===null||n===void 0||n.call(t))})}disableTracker(t){var n;let r=this.trackers.find(({name:i})=>i===t);r&&!r.hasError&&(r.disabled=!0,(n=r.disable)===null||n===void 0||n.call(r))}enableTracker(t){var n;let r=this.trackers.find(({name:i})=>i===t);r&&!r.hasError&&(r.disabled=!1,(n=r.enable)===null||n===void 0||n.call(r))}};function Li(e,t){return function(n,[r,i]){return $i(i)?n[r]=i:e||(t.warn(`You are trying to log a non-primitive value, ${r}:${JSON.stringify(i)}. This will get logged as [object Object]`),n[r]=i),n}}function $i(e){return["string","number","boolean","undefined"].includes(typeof e)||e&&typeof e.valueOf()=="string"}function Vi(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function Gt(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}var At=class{constructor(t){var n;if(this.name="googleAnalytics",this.dimensions={},this.metrics={},this.isInitialized=!1,typeof window<"u"&&!(!((n=t?.measurementIds)===null||n===void 0)&&n.length))throw new Error("at least one measurementId needs to be provided in your configuration");Object.assign(this,t)}_getScripts(){return[{dataAttribute:"google-analytics",async:!0,src:`https://www.googletagmanager.com/gtag/js?id=${this.measurementIds?this.measurementIds[0]:""}`}]}getScriptTags(){return Ri(this._getScripts())}async init(){if(!this.isInitialized){if(typeof window>"u")throw new Fe("Window is undefined: Cannot add script element.");await Promise.all(this._getScripts().map(t=>Ci(t))),this.injectConfig(),this.isInitialized=!0}}logPageView(t,n={}){let r=this.buildCustomParams(n),i=Object.assign({page_title:t||window.location.pathname},r);return window.gtag("event","page_view",i),!0}logEvent(t){let{action:n}=t,r=Gt(t,["action"]),i=n||"other",o=this.buildCustomParams(r);return window.gtag("event",i,o),!0}disable(){this.measurementIds&&this.measurementIds.forEach(t=>{window[`ga-disable-${t}`]=!0})}enable(){this.measurementIds&&this.measurementIds.forEach(t=>{window[`ga-disable-${t}`]=void 0})}injectConfig(){window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date);let t={custom_map:this.createDimensionsAndMetricsCustomMap(this.dimensions,this.metrics),send_page_view:!1,anonymize_ip:!0};this.measurementIds.forEach(n=>{window.gtag("config",n,t)})}buildCustomParams(t){let n,{category:r,label:i}=t;return n=this.verifyCustomDimensionAndMetrics(t),r&&(n=Object.assign(Object.assign({},n),{event_category:r})),i&&(n=Object.assign(Object.assign({},n),{event_label:i})),n}verifyCustomDimensionAndMetrics(t){let n=this.createDimensionsAndMetricsCustomMap(this.dimensions,this.metrics),r=Object.values(n);return Object.keys(t).filter(i=>r.includes(i)).reduce((i,o)=>Object.assign(i,{[o]:t[o]}),{})}createDimensionsAndMetricsCustomMap(t={},n={}){let r=this.createMetricCustomMap(n),i=this.createDimensionCustomMap(t);return Object.assign(Object.assign({},r),i)}createMetricCustomMap(t={}){return Object.keys(t).map(function(n){return{key:`metric${t[n]}`,value:n}}).filter(n=>n).reduce((n,{key:r,value:i})=>(n[r]=i,n),{})}createDimensionCustomMap(t={}){return Object.keys(t).map(function(n){return{key:`dimension${t[n]}`,value:n}}).filter(n=>n).reduce((n,{key:r,value:i})=>(n[r]=i,n),{})}},gn="TELEMETRY_COGNITO_CREDENTIALS";function Wi(e,t={}){let n=`https://cognito-identity${t.fips===!0?"-fips":""}.us-east-1.amazonaws.com/`,r=Ue.get(gn);if(r&&Date.now()/1e3<r.Expiration)return Promise.resolve(r);let i={method:"POST",headers:{"Content-type":"application/x-amz-json-1.1","X-Amz-Target":"AWSCognitoIdentityService.GetId"},body:JSON.stringify({IdentityPoolId:e})};return fetch(n,i).then(o=>{if(!o.ok)throw new Error(o.statusText);return o.json()}).then(o=>{let{IdentityId:s}=o,a={method:"POST",headers:{"Content-type":"application/x-amz-json-1.1","X-Amz-Target":"AWSCognitoIdentityService.GetCredentialsForIdentity"},body:JSON.stringify({IdentityId:s})};return fetch(n,a)}).then(o=>{if(!o.ok)throw new Error(o.statusText);return o.json()}).then(({Credentials:o})=>(Ue.set(gn,o),o))}function Pr({telemetryData:e,dimensionLookup:t={},excludeKeys:n=[]}){return Object.keys(e).filter(r=>!n.includes(r)).map(r=>t[r]?{key:Hi(t,r),value:e[r]}:{key:r,value:qi(e,r)}).reduce((r,{key:i,value:o})=>(r[i]=o,r),{})}function qi(e,t){return t==="json"?e[t]?JSON.stringify(e[t]):"null":e[t]===void 0?"null":e[t].toString()}function Hi(e,t){return`dimension${e[t]}`}var Ki=["size","duration","position","number","count"];function jr(e,t={}){return Object.keys(e).filter(n=>t[n]||Ki.includes(n)).map(n=>t[n]?{key:Gi(t,n),value:e[n]}:{key:n,value:e[n]}).reduce((n,{key:r,value:i})=>(n[r]=i,n),{})}function Gi(e,t){return`metric${e[t]}`}function Ji({event:e={},dimensionLookup:t={},metricLookup:n={}}){var r,i;let{pathname:o,eventType:s="other"}=e,a=jr(e,n),u=Pr({telemetryData:Object.assign({eventType:s},e),dimensionLookup:t,excludeKeys:["workflow","pathname",...Object.keys(a),...Object.keys(n)]}),c=Object.assign(Object.assign({name:s},u),a);return typeof document<"u"&&document.referrer&&(c.referrer=document.referrer),typeof window<"u"&&!c.hostname&&(c.hostname=(r=window.location)===null||r===void 0?void 0:r.hostname),c.path=typeof window<"u"&&window.location.pathname?(i=window.location)===null||i===void 0?void 0:i.pathname:o,c}function Xi({page:e,previousPage:t={},options:n={},dimensionLookup:r={},metricLookup:i={}}){let o=jr(n,i),s=Pr({telemetryData:n,dimensionLookup:r,excludeKeys:["workflow",...Object.keys(o),...Object.keys(i)]}),{referrer:a,title:u}=document||{},{hostname:c,pathname:p}=window&&window.location?window.location:{};return Object.assign(Object.assign({name:"pageView",referrer:a,hostname:c,path:e||p,pageUrl:e||p,pageName:u,previousPageUrl:t.pageUrl,previousPageName:t.pageName},s),o)}function hn(e,t,n,r,i){for(t=t.split?t.split("."):t,r=0;r<t.length;r++)e=e?e[t[r]]:i;return e===i?n:e}var Fi="function",Bi="string",ne="undefined",Qi="boolean",Be="object",Yi="array",Zi="number",eo="symbol",to="null",no=function(){},Tr="any",Nr="*",we="__",ro="form",io="input",oo="button",so="select",Qe=typeof process!==ne?process:{};Qe.env&&Qe.env.NODE_ENV;var Z=typeof document!==ne;Qe.versions!=null&&Qe.versions.node!=null;typeof Deno!==ne&&Deno.core;Z&&window.name==="nodejs"||typeof navigator!==ne&&typeof navigator.userAgent!==ne&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function _r(e,t){return t.charAt(0)[e]()+t.slice(1)}var ao=_r.bind(null,"toUpperCase"),uo=_r.bind(null,"toLowerCase");function co(e){return Cr(e)?ao(to):typeof e===Be?go(e):Object.prototype.toString.call(e).slice(8,-1)}function Ye(e,t){t===void 0&&(t=!0);var n=co(e);return t?uo(n):n}function $e(e,t){return typeof t===e}var ee=$e.bind(null,Fi),le=$e.bind(null,Bi),Se=$e.bind(null,ne),lo=$e.bind(null,Qi);$e.bind(null,eo);function Cr(e){return e===null}function fo(e){return Ye(e)===Zi&&!isNaN(e)}function Mr(e){return Ye(e)===Yi}function Q(e){if(!po(e))return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function po(e){return e&&(typeof e===Be||e!==null)}function go(e){return ee(e.constructor)?e.constructor.name:null}function ho(e){return e instanceof Error||le(e.message)&&e.constructor&&fo(e.constructor.stackTraceLimit)}function Ur(e,t){if(typeof t!="object"||Cr(t))return!1;if(t instanceof e)return!0;var n=Ye(new e(""));if(ho(t))for(;t;){if(Ye(t)===n)return!0;t=Object.getPrototypeOf(t)}return!1}Ur.bind(null,TypeError);Ur.bind(null,SyntaxError);function nt(e,t){var n=e instanceof Element||e instanceof HTMLDocument;return n&&t?mo(e,t):n}function mo(e,t){return t===void 0&&(t=""),e&&e.nodeName===t.toUpperCase()}function rt(e){var t=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(t))}}rt(nt,ro);rt(nt,oo);rt(nt,io);rt(nt,so);function yo(e){return e?Mr(e)?e:[e]:[]}function mn(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function vo(){if(Z){var e=navigator,t=e.languages;return e.userLanguage||(t&&t.length?t[0]:e.language)}}function bo(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function wo(e){return(function(t){for(var n,r=Object.create(null),i=/([^&=]+)=?([^&]*)/g;n=i.exec(t);){var o=mn(n[1]),s=mn(n[2]);if(o)if(o.substring(o.length-2)==="[]"){var a=r[o=o.substring(0,o.length-2)]||(r[o]=[]);r[o]=Array.isArray(a)?a:[],r[o].push(s)}else r[o]=s===""||s}for(var u in r){var c=u.split("[");c.length>1&&(xo(r,c.map(function(p){return p.replace(/[?[\]\\ ]/g,"")}),r[u]),delete r[u])}return r})((function(t){return Z&&window.location.search.substring(1)})())}function xo(e,t,n){for(var r=t.length-1,i=0;i<r;++i){var o=t[i];if(o==="__proto__"||o==="constructor")break;o in e||(e[o]={}),e=e[o]}e[t[r]]=n}function xe(){for(var e="",t=0,n=4294967295*Math.random()|0;t++<36;){var r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[t-1],i=15&n;e+=r=="-"||r=="4"?r:(r=="x"?i:3&i|8).toString(16),n=t%8==0?4294967295*Math.random()|0:n>>4}return e}var me="global",Ee=we+me+we,Pe=typeof self===Be&&self.self===self&&self||typeof global===Be&&global[me]===global&&global||void 0;function pe(e){return Pe[Ee][e]}function ge(e,t){return Pe[Ee][e]=t}function Te(e){delete Pe[Ee][e]}function Ne(e,t,n){var r;try{if(Jt(e)){var i=window[e];r=i[t].bind(i)}}catch{}return r||n}Pe[Ee]||(Pe[Ee]={});var We={};function Jt(e){if(typeof We[e]!==ne)return We[e];try{var t=window[e];t.setItem(ne,ne),t.removeItem(ne)}catch{return We[e]=!1}return We[e]=!0}function T(){return T=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},T.apply(null,arguments)}var ce="function",oe="undefined",De="reducer",Dr="@@redux/",It=Dr+"INIT",So=Dr+Math.random().toString(36),yn=(function(){return typeof Symbol===ce&&Symbol.observable||"@@observable"})(),qe=" != "+ce;function Rr(e,t,n){var r;if(typeof t===ce&&typeof n===oe&&(n=t,t=void 0),typeof n!==oe){if(typeof n!==ce)throw new Error("enhancer"+qe);return n(Rr)(e,t)}if(typeof e!==ce)throw new Error(De+qe);var i=e,o=t,s=[],a=s,u=!1;function c(){a===s&&(a=s.slice())}function p(){return o}function l(y){if(typeof y!==ce)throw new Error("Listener"+qe);var b=!0;return c(),a.push(y),function(){if(b){b=!1,c();var S=a.indexOf(y);a.splice(S,1)}}}function x(y){if(!Q(y))throw new Error("Act != obj");if(typeof y.type===oe)throw new Error("ActType "+oe);if(u)throw new Error("Dispatch in "+De);try{u=!0,o=i(o,y)}finally{u=!1}for(var b=s=a,S=0;S<b.length;S++)(0,b[S])();return y}return x({type:It}),(r={dispatch:x,subscribe:l,getState:p,replaceReducer:function(y){if(typeof y!==ce)throw new Error("next "+De+qe);i=y,x({type:It})}})[yn]=function(){var y,b=l;return(y={subscribe:function(S){if(typeof S!="object")throw new TypeError("Observer != obj");function h(){S.next&&S.next(p())}return h(),{unsubscribe:b(h)}}})[yn]=function(){return this},y},r}function Oo(e,t){var n=t&&t.type;return"action "+(n&&n.toString()||"?")+De+" "+e+" returns "+oe}function je(){var e=[].slice.call(arguments);return e.length===0?function(t){return t}:e.length===1?e[0]:e.reduce(function(t,n){return function(){return t(n.apply(void 0,[].slice.call(arguments)))}})}function ko(){var e=arguments;return function(t){return function(n,r,i){var o,s=t(n,r,i),a=s.dispatch,u={getState:s.getState,dispatch:function(c){return a(c)}};return o=[].slice.call(e).map(function(c){return c(u)}),T({},s,{dispatch:a=je.apply(void 0,o)(s.dispatch)})}}}var fe=we+"anon_id",ye=we+"user_id",ke=we+"user_traits",Et="analytics",ue="userId",Oe="anonymousId",Je=["bootstrap","params","campaign","initializeStart","initialize","initializeEnd","ready","resetStart","reset","resetEnd","pageStart","page","pageEnd","pageAborted","trackStart","track","trackEnd","trackAborted","identifyStart","identify","identifyEnd","identifyAborted","userIdChanged","registerPlugins","enablePlugin","disablePlugin","online","offline","setItemStart","setItem","setItemEnd","setItemAborted","removeItemStart","removeItem","removeItemEnd","removeItemAborted"],Pt=["name","EVENTS","config","loaded"],j=Je.reduce(function(e,t){return e[t]=t,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),vn=/^utm_/,bn=/^an_prop_/,wn=/^an_trait_/;function Ao(e){var t=e.storage.setItem;return function(n){return function(r){return function(i){if(i.type===j.bootstrap){var o=i.params,s=i.user,a=i.persistedUser,u=i.initialUser,c=a.userId===s.userId;a.anonymousId!==s.anonymousId&&t(fe,s.anonymousId),c||t(ye,s.userId),u.traits&&t(ke,T({},c&&a.traits?a.traits:{},u.traits));var p=Object.keys(i.params);if(p.length){var l=o.an_uid,x=o.an_event,y=p.reduce(function(b,S){if(S.match(vn)||S.match(/^(d|g)clid/)){var h=S.replace(vn,"");b.campaign[h==="campaign"?"name":h]=o[S]}return S.match(bn)&&(b.props[S.replace(bn,"")]=o[S]),S.match(wn)&&(b.traits[S.replace(wn,"")]=o[S]),b},{campaign:{},props:{},traits:{}});n.dispatch(T({type:j.params,raw:o},y,l?{userId:l}:{})),l&&setTimeout(function(){return e.identify(l,y.traits)},0),x&&setTimeout(function(){return e.track(x,y.props)},0),Object.keys(y.campaign).length&&n.dispatch({type:j.campaign,campaign:y.campaign})}}return r(i)}}}}function Io(e){return function(t,n){if(t===void 0&&(t={}),n===void 0&&(n={}),n.type===j.setItemEnd){if(n.key===fe)return T({},t,{anonymousId:n.value});if(n.key===ye)return T({},t,{userId:n.value})}switch(n.type){case j.identify:return Object.assign({},t,{userId:n.userId,traits:T({},t.traits,n.traits)});case j.reset:return[ye,fe,ke].forEach(function(r){e.removeItem(r)}),Object.assign({},t,{userId:null,anonymousId:null,traits:{}});default:return t}}}function xn(e){return{userId:e.getItem(ye),anonymousId:e.getItem(fe),traits:e.getItem(ke)}}var jt=function(e){return we+"TEMP"+we+e};function Eo(e){var t=e.storage,n=t.setItem,r=t.removeItem,i=t.getItem;return function(o){return function(s){return function(a){var u=a.userId,c=a.traits,p=a.options;if(a.type===j.reset&&([ye,ke,fe].forEach(function(y){r(y)}),[ue,Oe,"traits"].forEach(function(y){Te(jt(y))})),a.type===j.identify){i(fe)||n(fe,xe());var l=i(ye),x=i(ke)||{};l&&l!==u&&o.dispatch({type:j.userIdChanged,old:{userId:l,traits:x},new:{userId:u,traits:c},options:p}),u&&n(ye,u),c&&n(ke,T({},x,c))}return s(a)}}}}var Me={};function Sn(e,t){Me[e]&&ee(Me[e])&&(Me[e](t),delete Me[e])}function zr(e,t,n){return new Promise(function(r,i){return t()?r(e):n<1?i(T({},e,{queue:!0})):new Promise(function(o){return setTimeout(o,10)}).then(function(o){return zr(e,t,n-10).then(r,i)})})}function Po(e){return{abort:e}}function Lr(e,t,n){var r={},i=t(),o=e.getState(),s=o.plugins,a=o.queue,u=o.user;if(!o.context.offline&&a&&a.actions&&a.actions.length){var c=a.actions.reduce(function(l,x,y){return s[x.plugin].loaded?(l.process.push(x),l.processIndex.push(y)):(l.requeue.push(x),l.requeueIndex.push(y)),l},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(c.processIndex&&c.processIndex.length){c.processIndex.forEach(function(l){var x=a.actions[l],y=x.plugin,b=x.payload.type,S=i[y][b];if(S&&ee(S)){var h,f=(function(w,v){return w===void 0&&(w={}),v===void 0&&(v={}),[ue,Oe].reduce(function(A,k){return w.hasOwnProperty(k)&&v[k]&&v[k]!==w[k]&&(A[k]=v[k]),A},w)})(x.payload,u),m=r[f.meta.rid];if(!m&&(h=S({payload:f,config:s[y].config,instance:n,abort:Po}))&&Q(h)&&h.abort)return void(r[f.meta.rid]=!0);if(!m){var O=b+":"+y;e.dispatch(T({},f,{type:O,_:{called:O,from:"queueDrain"}}))}}});var p=a.actions.filter(function(l,x){return!~c.processIndex.indexOf(x)});a.actions=p}}}var dt=function(e){var t=e.data,n=e.action,r=e.instance,i=e.state,o=e.allPlugins,s=e.allMatches,a=e.store,u=e.EVENTS;try{var c=i.plugins,p=i.context,l=n.type,x=l.match(Ae),y=t.exact.map(function(h){return h.pluginName});x&&(y=s.during.map(function(h){return h.pluginName}));var b=(function(h,f){return function(m,O,w){var v=O.config,A=O.name,k=A+"."+m.type;w&&(k=w.event);var C=m.type.match(Ae)?(function(M,P,z,U,q){return function($,E){var H=U?U.name:M,D=E&&ze(E)?E:z;if(U&&(!(D=E&&ze(E)?E:[M]).includes(M)||D.length!==1))throw new Error("Method "+P+" can only abort "+M+" plugin. "+JSON.stringify(D)+" input valid");return T({},q,{abort:{reason:$,plugins:D,caller:P,_:H}})}})(A,k,f,w,m):(function(M,P){return function(){throw new Error(M.type+" action not cancellable. Remove abort in "+P)}})(m,k);return{payload:jo(m),instance:h,config:v||{},abort:C}}})(r,y),S=t.exact.reduce(function(h,f){var m=f.pluginName,O=f.methodName,w=!1;return O.match(/^initialize/)||O.match(/^reset/)||(w=!c[m].loaded),p.offline&&O.match(/^(page|track|identify)/)&&(w=!0),h[""+m]=w,h},{});return Promise.resolve(t.exact.reduce(function(h,f,m){var O=f.pluginName;return Promise.resolve(h).then(function(w){function v(){return Promise.resolve(w)}var A=(function(){if(t.namespaced&&t.namespaced[O])return Promise.resolve(t.namespaced[O].reduce(function(k,C,M){return Promise.resolve(k).then(function(P){return C.method&&ee(C.method)?((function($,E){var H=jn($);if(H&&H.name===E){var D=jn(H.method);throw new Error([E+" plugin is calling method "+$,"Plugins cant call self","Use "+H.method+" "+(D?"or "+D.method:"")+" in "+E+" plugin insteadof "+$].join(`
|
|
3
3
|
`))}})(C.methodName,C.pluginName),Promise.resolve(C.method({payload:P,instance:r,abort:(z=P,U=O,q=C.pluginName,function($,E){return T({},z,{abort:{reason:$,plugins:E||[U],caller:l,from:q||U}})}),config:An(C.pluginName,c,o),plugins:c})).then(function($){var E=Q($)?$:{};return Promise.resolve(T({},P,E))})):P;var z,U,q})},Promise.resolve(n))).then(function(k){w[O]=k});w[O]=n})();return A&&A.then?A.then(v):v()})},Promise.resolve({}))).then(function(h){return Promise.resolve(t.exact.reduce(function(f,m,O){try{var w=t.exact.length===O+1,v=m.pluginName,A=o[v];return Promise.resolve(f).then(function(k){var C=h[v]?h[v]:{};if(x&&(C=k),gt(C,v))return pt({data:C,method:l,instance:r,pluginName:v,store:a}),Promise.resolve(k);if(gt(k,v))return w&&pt({data:k,method:l,instance:r,store:a}),Promise.resolve(k);if(S.hasOwnProperty(v)&&S[v]===!0)return a.dispatch({type:"queue",plugin:v,payload:C,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(k);var M=b(h[v],o[v]);return Promise.resolve(A[l]({abort:M.abort,payload:C,instance:r,config:An(v,c,o),plugins:c})).then(function(P){var z=Q(P)?P:{},U=T({},k,z),q=h[v];if(gt(q,v))pt({data:q,method:l,instance:r,pluginName:v,store:a});else{var $=l+":"+v;($.match(/:/g)||[]).length<2&&!l.match(On)&&!l.match(kn)&&r.dispatch(T({},x?U:C,{type:$,_:{called:$,from:"submethod"}}))}return Promise.resolve(U)})})}catch(k){return Promise.reject(k)}},Promise.resolve(n))).then(function(f){if(!(l.match(Ae)||l.match(/^registerPlugin/)||l.match(kn)||l.match(On)||l.match(/^params/)||l.match(/^userIdChanged/))){if(u.plugins.includes(l),f._&&f._.originalAction===l)return f;var m=T({},f,{_:{originalAction:f.type,called:f.type,from:"engineEnd"}});$r(f,t.exact.length)&&!l.match(/End$/)&&(m=T({},m,{type:f.type+"Aborted"})),a.dispatch(m)}return f})})}catch(h){return Promise.reject(h)}},Ae=/Start$/,On=/^bootstrap/,kn=/^ready/;function pt(e){var t=e.pluginName,n=e.method+"Aborted"+(t?":"+t:"");e.store.dispatch(T({},e.data,{type:n,_:{called:n,from:"abort"}}))}function An(e,t,n){var r=t[e]||n[e];return r&&r.config?r.config:{}}function In(e,t){return t.reduce(function(n,r){return r[e]?n.concat({methodName:e,pluginName:r.name,method:r[e]}):n},[])}function En(e,t){var n=e.replace(Ae,""),r=t?":"+t:"";return[""+e+r,""+n+r,n+"End"+r]}function gt(e,t){var n=e.abort;return!!n&&(n===!0||Pn(n,t)||n&&Pn(n.plugins,t))}function $r(e,t){var n=e.abort;if(!n)return!1;if(n===!0||le(n))return!0;var r=n.plugins;return ze(n)&&n.length===t||ze(r)&&r.length===t}function ze(e){return Array.isArray(e)}function Pn(e,t){return!(!e||!ze(e))&&e.includes(t)}function jn(e){var t=e.match(/(.*):(.*)/);return!!t&&{method:t[1],name:t[2]}}function jo(e){return Object.keys(e).reduce(function(t,n){return n==="type"||(t[n]=Q(e[n])?Object.assign({},e[n]):e[n]),t},{})}function To(e,t,n){var r={};return function(i){return function(o){return function(s){try{var a,u=function(w){return a?w:o(l)},c=s.type,p=s.plugins,l=s;if(s.abort)return Promise.resolve(o(s));if(c===j.enablePlugin&&i.dispatch({type:j.initializeStart,plugins:p,disabled:[],fromEnable:!0,meta:s.meta}),c===j.disablePlugin&&setTimeout(function(){return Sn(s.meta.rid,{payload:s})},0),c===j.initializeEnd){var x=t(),y=Object.keys(x),b=y.filter(function(w){return p.includes(w)}).map(function(w){return x[w]}),S=[],h=[],f=s.disabled,m=b.map(function(w){var v=w.loaded,A=w.name,k=w.config;return zr(w,function(){return v({config:k})},1e4).then(function(C){return r[A]||(i.dispatch({type:j.pluginReadyType(A),name:A,events:Object.keys(w).filter(function(M){return!Pt.includes(M)})}),r[A]=!0),S=S.concat(A),w}).catch(function(C){if(C instanceof Error)throw new Error(C);return h=h.concat(C.name),C})});Promise.all(m).then(function(w){var v={plugins:S,failed:h,disabled:f};setTimeout(function(){y.length===m.length+f.length&&i.dispatch(T({},{type:j.ready},v))},0)})}var O=(function(){if(c!==j.bootstrap)return/^ready:([^:]*)$/.test(c)&&setTimeout(function(){return Lr(i,t,e)},0),Promise.resolve((function(w,v,A,k,C){try{var M=ee(v)?v():v,P=w.type,z=P.replace(Ae,"");if(w._&&w._.called)return Promise.resolve(w);var U=A.getState(),q=(H=M,(D=U.plugins)===void 0&&(D={}),(N=w.options)===void 0&&(N={}),Object.keys(H).filter(function(d){var g=N.plugins||{};return lo(g[d])?g[d]:g.all!==!1&&(!D[d]||D[d].enabled!==!1)}).map(function(d){return H[d]}));P===j.initializeStart&&w.fromEnable&&(q=Object.keys(U.plugins).filter(function(d){var g=U.plugins[d];return w.plugins.includes(d)&&!g.initialized}).map(function(d){return M[d]}));var $=q.map(function(d){return d.name}),E=(function(d,g){var I=En(d).map(function(_){return In(_,g)});return g.reduce(function(_,L){var R=L.name,X=En(d,R).map(function(ie){return In(ie,g)}),W=X[0],G=X[1],V=X[2];return W.length&&(_.beforeNS[R]=W),G.length&&(_.duringNS[R]=G),V.length&&(_.afterNS[R]=V),_},{before:I[0],beforeNS:{},during:I[1],duringNS:{},after:I[2],afterNS:{}})})(P,q);return Promise.resolve(dt({action:w,data:{exact:E.before,namespaced:E.beforeNS},state:U,allPlugins:M,allMatches:E,instance:A,store:k,EVENTS:C})).then(function(d){function g(){var L=(function(){if(P.match(Ae))return Promise.resolve(dt({action:T({},I,{type:z+"End"}),data:{exact:E.after,namespaced:E.afterNS},state:U,allPlugins:M,allMatches:E,instance:A,store:k,EVENTS:C})).then(function(R){R.meta&&R.meta.hasCallback&&Sn(R.meta.rid,{payload:R})})})();return L&&L.then?L.then(function(){return d}):d}if($r(d,$.length))return d;var I,_=(function(){if(P!==z)return Promise.resolve(dt({action:T({},d,{type:z}),data:{exact:E.during,namespaced:E.duringNS},state:U,allPlugins:M,allMatches:E,instance:A,store:k,EVENTS:C})).then(function(L){I=L});I=d})();return _&&_.then?_.then(g):g()})}catch(d){return Promise.reject(d)}var H,D,N})(s,t,e,i,n)).then(function(w){var v=o(w);return a=1,v})})();return Promise.resolve(O&&O.then?O.then(u):u(O))}catch(w){return Promise.reject(w)}}}}}function No(e){return function(t){return function(n){return function(r){var i=r.type,o=r.key,s=r.value,a=r.options;if(i===j.setItem||i===j.removeItem){if(r.abort)return n(r);i===j.setItem?e.setItem(o,s,a):e.removeItem(o,a)}return n(r)}}}}var _o=function(){var e=this;this.before=[],this.after=[],this.addMiddleware=function(t,n){e[n]=e[n].concat(t)},this.removeMiddleware=function(t,n){var r=e[n].findIndex(function(i){return i===t});r!==-1&&(e[n]=[].concat(e[n].slice(0,r),e[n].slice(r+1)))},this.dynamicMiddlewares=function(t){return function(n){return function(r){return function(i){var o={getState:n.getState,dispatch:function(a){return n.dispatch(a)}},s=e[t].map(function(a){return a(o)});return je.apply(void 0,s)(r)(i)}}}}};function Co(e){return function(t,n){t===void 0&&(t={});var r={};if(n.type==="initialize:aborted")return t;if(/^registerPlugin:([^:]*)$/.test(n.type)){var i=Tn(n.type,"registerPlugin"),o=e()[i];if(!o||!i)return t;var s=n.enabled,a=o.config;return r[i]={enabled:s,initialized:!!s&&!o.initialize,loaded:!!s&&!!o.loaded({config:a}),config:a},T({},t,r)}if(/^initialize:([^:]*)$/.test(n.type)){var u=Tn(n.type,j.initialize),c=e()[u];return c&&u?(r[u]=T({},t[u],{initialized:!0,loaded:!!c.loaded({config:c.config})}),T({},t,r)):t}if(/^ready:([^:]*)$/.test(n.type))return r[n.name]=T({},t[n.name],{loaded:!0}),T({},t,r);switch(n.type){case j.disablePlugin:return T({},t,Nn(n.plugins,!1,t));case j.enablePlugin:return T({},t,Nn(n.plugins,!0,t));default:return t}}}function Tn(e,t){return e.substring(t.length+1,e.length)}function Nn(e,t,n){return e.reduce(function(r,i){return r[i]=T({},n[i],{enabled:t}),r},n)}function Vr(e){try{return JSON.parse(JSON.stringify(e))}catch{}return e}var Mo={last:{},history:[]};function Uo(e,t){e===void 0&&(e=Mo);var n=t.options,r=t.meta;if(t.type===j.track){var i=Vr(T({event:t.event,properties:t.properties},Object.keys(n).length&&{options:n},{meta:r}));return T({},e,{last:i,history:e.history.concat(i)})}return e}var Do={actions:[]};function Ro(e,t){e===void 0&&(e=Do);var n=t.payload;switch(t.type){case"queue":var r;return r=n&&n.type&&n.type===j.identify?[t].concat(e.actions):e.actions.concat(t),T({},e,{actions:r});case"dequeue":return[];default:return e}}var Wr=/#.*$/;function zo(e){var t=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(t&&t[3]?t[3].split("?")[0].replace(Wr,""):"")}var qr,Hr,Kr,Gr,Lo=function(e){if(e===void 0&&(e={}),!Z)return e;var t=document,n=t.title,r=t.referrer,i=window,o=i.location,s=i.innerWidth,a=i.innerHeight,u=o.hash,c=o.search,p=(function(x){var y=(function(){if(Z){for(var b,S=document.getElementsByTagName("link"),h=0;b=S[h];h++)if(b.getAttribute("rel")==="canonical")return b.getAttribute("href")}})();return y?y.match(/\?/)?y:y+x:window.location.href.replace(Wr,"")})(c),l={title:n,url:p,path:zo(p),hash:u,search:c,width:s,height:a};return r&&r!==""&&(l.referrer=r),T({},l,e)},$o={last:{},history:[]};function Vo(e,t){e===void 0&&(e=$o);var n=t.options;if(t.type===j.page){var r=Vr(T({properties:t.properties,meta:t.meta},Object.keys(n).length&&{options:n}));return T({},e,{last:r,history:e.history.concat(r)})}return e}qr=(function(){if(!Z)return!1;var e=navigator.appVersion;return~e.indexOf("Win")?"Windows":~e.indexOf("Mac")?"MacOS":~e.indexOf("X11")?"UNIX":~e.indexOf("Linux")?"Linux":"Unknown OS"})(),Hr=Z?document.referrer:null,Kr=vo(),Gr=bo();var _n={initialized:!1,sessionId:xe(),app:null,version:null,debug:!1,offline:!!Z&&!navigator.onLine,os:{name:qr},userAgent:Z?navigator.userAgent:"node",library:{name:Et,version:"0.13.1"},timezone:Gr,locale:Kr,campaign:{},referrer:Hr};function Wo(e,t){e===void 0&&(e=_n);var n=e.initialized,r=t.campaign;switch(t.type){case j.campaign:return T({},e,{campaign:r});case j.offline:return T({},e,{offline:!0});case j.online:return T({},e,{offline:!1});default:return n?e:T({},_n,e,{initialized:!0})}}var qo=["plugins","reducers","storage"];function Ho(e,t,n){if(Z){var r=window[(n?"add":"remove")+"EventListener"];e.split(" ").forEach(function(i){r(i,t)})}}function Ko(e){var t=Ho.bind(null,"online offline",function(n){return Promise.resolve(!navigator.onLine).then(e)});return t(!0),function(n){return t(!1)}}function Jr(){return ge(Et,[]),function(e){return function(t,n,r){var i=e(t,n,r),o=i.dispatch;return Object.assign(i,{dispatch:function(s){return Pe[Ee][Et].push(s.action||s),o(s)}})}}}function Cn(e){return function(){return je(je.apply(null,arguments),Jr())}}function ht(e){return e?Mr(e)?e:[e]:[]}function Mn(e,t,n){e===void 0&&(e={});var r,i,o=xe();return t&&(Me[o]=(r=t,i=(function(s){for(var a,u=s||Array.prototype.slice.call(arguments),c=0;c<u.length;c++)if(ee(u[c])){a=u[c];break}return a})(n),function(s){i&&i(s),r(s)})),T({},e,{rid:o,ts:new Date().getTime()},t?{hasCallback:!0}:{})}function Go(e){e===void 0&&(e={});var t=e.reducers||{},n=e.initialUser||{},r=(e.plugins||[]).reduce(function(d,g){if(ee(g))return d.middlewares=d.middlewares.concat(g),d;if(g.NAMESPACE&&(g.name=g.NAMESPACE),!g.name)throw new Error("https://lytics.dev/errors/1");g.config||(g.config={});var I=g.EVENTS?Object.keys(g.EVENTS).map(function(R){return g.EVENTS[R]}):[];d.pluginEnabled[g.name]=!(g.enabled===!1||g.config.enabled===!1),delete g.enabled,g.methods&&(d.methods[g.name]=Object.keys(g.methods).reduce(function(R,X){var W;return R[X]=(W=g.methods[X],function(){for(var G=Array.prototype.slice.call(arguments),V=new Array(W.length),ie=0;ie<G.length;ie++)V[ie]=G[ie];return V[V.length]=v,W.apply({instance:v},V)}),R},{}),delete g.methods);var _=Object.keys(g).concat(I),L=new Set(d.events.concat(_));if(d.events=Array.from(L),d.pluginsArray=d.pluginsArray.concat(g),d.plugins[g.name])throw new Error(g.name+"AlreadyLoaded");return d.plugins[g.name]=g,d.plugins[g.name].loaded||(d.plugins[g.name].loaded=function(){return!0}),d},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),i=e.storage?e.storage:{getItem:pe,setItem:ge,removeItem:Te},o=(function(d){return function(g,I,_){return I.getState("user")[g]||(_&&Q(_)&&_[g]?_[g]:xn(d)[g]||pe(jt(g))||null)}})(i),s=r.plugins,a=r.events.filter(function(d){return!Pt.includes(d)}).sort(),u=new Set(a.concat(Je).filter(function(d){return!Pt.includes(d)})),c=Array.from(u).sort(),p=function(){return s},l=new _o,x=l.addMiddleware,y=l.removeMiddleware,b=l.dynamicMiddlewares,S=function(){throw new Error("Abort disabled inListener")},h=wo(),f=xn(i),m=T({},f,n,h.an_uid?{userId:h.an_uid}:{},h.an_aid?{anonymousId:h.an_aid}:{});m.anonymousId||(m.anonymousId=xe());var O=T({enable:function(d,g){return new Promise(function(I){E.dispatch({type:j.enablePlugin,plugins:ht(d),_:{originalAction:j.enablePlugin}},I,[g])})},disable:function(d,g){return new Promise(function(I){E.dispatch({type:j.disablePlugin,plugins:ht(d),_:{originalAction:j.disablePlugin}},I,[g])})}},r.methods),w=!1,v={identify:function(d,g,I,_){try{var L=le(d)?d:null,R=Q(d)?d:g,X=I||{},W=v.user();ge(jt(ue),L);var G=L||R.userId||o(ue,v,R);return Promise.resolve(new Promise(function(V){E.dispatch(T({type:j.identifyStart,userId:G,traits:R||{},options:X,anonymousId:W.anonymousId},W.id&&W.id!==L&&{previousId:W.id}),V,[g,I,_])}))}catch(V){return Promise.reject(V)}},track:function(d,g,I,_){try{var L=Q(d)?d.event:d;if(!L||!le(L))throw new Error("EventMissing");var R=Q(d)?d:g||{},X=Q(I)?I:{};return Promise.resolve(new Promise(function(W){E.dispatch({type:j.trackStart,event:L,properties:R,options:X,userId:o(ue,v,g),anonymousId:o(Oe,v,g)},W,[g,I,_])}))}catch(W){return Promise.reject(W)}},page:function(d,g,I){try{var _=Q(d)?d:{},L=Q(g)?g:{};return Promise.resolve(new Promise(function(R){E.dispatch({type:j.pageStart,properties:Lo(_),options:L,userId:o(ue,v,_),anonymousId:o(Oe,v,_)},R,[d,g,I])}))}catch(R){return Promise.reject(R)}},user:function(d){if(d===ue||d==="id")return o(ue,v);if(d===Oe||d==="anonId")return o(Oe,v);var g=v.getState("user");return d?hn(g,d):g},reset:function(d){return new Promise(function(g){E.dispatch({type:j.resetStart},g,d)})},ready:function(d){return w&&d({plugins:O,instance:v}),v.on(j.ready,function(g){d&&d(g),w=!0})},on:function(d,g){if(!d||!ee(g))return!1;if(d===j.bootstrap)throw new Error(".on disabled for "+d);var I=/Start$|Start:/;if(d==="*"){var _=function(W){return function(G){return function(V){return V.type.match(I)&&g({payload:V,instance:v,plugins:s}),G(V)}}},L=function(W){return function(G){return function(V){return V.type.match(I)||g({payload:V,instance:v,plugins:s}),G(V)}}};return x(_,He),x(L,Ke),function(){y(_,He),y(L,Ke)}}var R=d.match(I)?He:Ke,X=function(W){return function(G){return function(V){return V.type===d&&g({payload:V,instance:v,plugins:s,abort:S}),G(V)}}};return x(X,R),function(){return y(X,R)}},once:function(d,g){if(!d||!ee(g))return!1;if(d===j.bootstrap)throw new Error(".once disabled for "+d);var I=v.on(d,function(_){g({payload:_.payload,instance:v,plugins:s,abort:S}),I()});return I},getState:function(d){var g=E.getState();return d?hn(g,d):Object.assign({},g)},dispatch:function(d){var g=le(d)?{type:d}:d;if(Je.includes(g.type))throw new Error("reserved action "+g.type);var I=T({},g,{_:T({originalAction:g.type},d._||{})});E.dispatch(I)},enablePlugin:O.enable,disablePlugin:O.disable,plugins:O,storage:{getItem:i.getItem,setItem:function(d,g,I){E.dispatch({type:j.setItemStart,key:d,value:g,options:I})},removeItem:function(d,g){E.dispatch({type:j.removeItemStart,key:d,options:g})}},setAnonymousId:function(d,g){v.storage.setItem(fe,d,g)},events:{core:Je,plugins:a}},A=r.middlewares.concat([function(d){return function(g){return function(I){return I.meta||(I.meta=Mn()),g(I)}}},b(He),To(v,p,{all:c,plugins:a}),No(i),Ao(v),Eo(v),b(Ke)]),k={context:Wo,user:Io(i),page:Vo,track:Uo,plugins:Co(p),queue:Ro},C=je,M=je;if(Z&&e.debug){var P=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;P&&(C=P({trace:!0,traceLimit:25})),M=function(){return arguments.length===0?Jr():Q(typeof arguments[0])?Cn():Cn().apply(null,arguments)}}var z,U=(function(d){return Object.keys(d).reduce(function(g,I){return qo.includes(I)||(g[I]=d[I]),g},{})})(e),q=r.pluginsArray.reduce(function(d,g){var I=g.name,_=g.config,L=g.loaded,R=r.pluginEnabled[I];return d[I]={enabled:R,initialized:!!R&&!g.initialize,loaded:!!L({config:_}),config:_},d},{}),$={context:U,user:m,plugins:q},E=Rr((function(d){for(var g=Object.keys(d),I={},_=0;_<g.length;_++){var L=g[_];typeof d[L]===ce&&(I[L]=d[L])}var R,X=Object.keys(I);try{(function(W){Object.keys(W).forEach(function(G){var V=W[G];if(typeof V(void 0,{type:It})===oe||typeof V(void 0,{type:So})===oe)throw new Error(De+" "+G+" "+oe)})})(I)}catch(W){R=W}return function(W,G){if(W===void 0&&(W={}),R)throw R;for(var V=!1,ie={},lt=0;lt<X.length;lt++){var Ve=X[lt],un=W[Ve],ft=(0,I[Ve])(un,G);if(typeof ft===oe){var Ei=Oo(Ve,G);throw new Error(Ei)}ie[Ve]=ft,V=V||ft!==un}return V?ie:W}})(T({},k,t)),$,M(C(ko.apply(void 0,A))));E.dispatch=(z=E.dispatch,function(d,g,I){var _=T({},d,{meta:Mn(d.meta,g,ht(I))});return z.apply(null,[_])});var H=Object.keys(s);E.dispatch({type:j.bootstrap,plugins:H,config:U,params:h,user:m,initialUser:n,persistedUser:f});var D=H.filter(function(d){return r.pluginEnabled[d]}),N=H.filter(function(d){return!r.pluginEnabled[d]});return E.dispatch({type:j.registerPlugins,plugins:H,enabled:r.pluginEnabled}),r.pluginsArray.map(function(d,g){var I=d.bootstrap,_=d.config,L=d.name;I&&ee(I)&&I({instance:v,config:_,payload:d}),E.dispatch({type:j.registerPluginType(L),name:L,enabled:r.pluginEnabled[L],plugin:d}),r.pluginsArray.length===g+1&&E.dispatch({type:j.initializeStart,plugins:D,disabled:N})}),Ko(function(d){E.dispatch({type:d?j.offline:j.online})}),(function(d,g,I){setInterval(function(){return Lr(d,g,I)},3e3)})(E,p,v),v}var He="before",Ke="after",ve="cookie",he=Br(),Xt=it,Xr=it;function Fr(e){return he?it(e,"",-1):Te(e)}function Br(){if(he!==void 0)return he;var e=ve+ve;try{it(e,e),he=document.cookie.indexOf(e)!==-1,Fr(e)}catch{he=!1}return he}function it(e,t,n,r,i,o){if(typeof window<"u"){var s=arguments.length>1;return he===!1&&(s?ge(e,t):pe(e)),s?document.cookie=e+"="+encodeURIComponent(t)+(n?"; expires="+new Date(+new Date+1e3*n).toUTCString()+(r?"; path="+r:"")+(i?"; domain="+i:"")+(o?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var se="localStorage",Jo=Jt.bind(null,se),Ft=Ne(se,"getItem",pe),Xo=Ne(se,"setItem",ge),Qr=Ne(se,"removeItem",Te),ae="sessionStorage",Fo=Jt.bind(null,ae),Bo=Ne(ae,"getItem",pe),Qo=Ne(ae,"setItem",ge);Ne(ae,"removeItem",Te);function Ie(e){var t=e;try{if((t=JSON.parse(e))==="true")return!0;if(t==="false")return!1;if(Q(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch{}if(t!==null&&t!=="")return t}var Yo=Jo(),Zo=Fo(),es=Br();function Yr(e,t){if(e){var n=Bt(t),r=!en(n),i=Qt(n)?Ie(localStorage.getItem(e)):void 0;if(r&&!Se(i))return i;var o=Yt(n)?Ie(Xt(e)):void 0;if(r&&o)return o;var s=Zt(n)?Ie(sessionStorage.getItem(e)):void 0;if(r&&s)return s;var a=pe(e);return r?a:{localStorage:i,sessionStorage:s,cookie:o,global:a}}}function ts(e,t,n){if(e&&!Se(t)){var r={},i=Bt(n),o=JSON.stringify(t),s=!en(i);return Qt(i)&&(r[se]=Ge(se,t,Ie(localStorage.getItem(e))),localStorage.setItem(e,o),s)?r[se]:Yt(i)&&(r[ve]=Ge(ve,t,Ie(Xt(e))),Xr(e,o),s)?r[ve]:Zt(i)&&(r[ae]=Ge(ae,t,Ie(sessionStorage.getItem(e))),sessionStorage.setItem(e,o),s)?r[ae]:(r[me]=Ge(me,t,pe(e)),ge(e,t),s?r[me]:r)}}function ns(e,t){if(e){var n=Bt(t),r=Yr(e,Nr),i={};return!Se(r.localStorage)&&Qt(n)&&(localStorage.removeItem(e),i[se]=r.localStorage),!Se(r.cookie)&&Yt(n)&&(Fr(e),i[ve]=r.cookie),!Se(r.sessionStorage)&&Zt(n)&&(sessionStorage.removeItem(e),i[ae]=r.sessionStorage),!Se(r.global)&&ot(n,me)&&(Te(e),i[me]=r.global),i}}function Bt(e){return e?le(e)?e:e.storage:Tr}function Qt(e){return Yo&&ot(e,se)}function Yt(e){return es&&ot(e,ve)}function Zt(e){return Zo&&ot(e,ae)}function en(e){return e===Nr||e==="all"}function ot(e,t){return e===Tr||e===t||en(e)}function Ge(e,t,n){return{location:e,current:t,previous:n}}var rs={setItem:ts,getItem:Yr,removeItem:ns};function is(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Un(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Dn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Un(Object(n),!0).forEach(function(r){is(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Un(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function os(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={storage:rs};return Go(Dn(Dn({},t),e))}function te(e){"@babel/helpers - typeof";return te=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},te(e)}function ss(e,t){if(te(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(te(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function as(e){var t=ss(e,"string");return te(t)=="symbol"?t:t+""}function tn(e,t,n){return(t=as(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function J(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Rn(Object(n),!0).forEach(function(r){tn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rn(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Zr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zn={exports:{}},Ln={exports:{}},$n;function ei(){return $n||($n=1,(function(e){function t(n,r){this.v=n,this.k=r}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Ln)),Ln.exports}var Vn={exports:{}},Wn={exports:{}},qn;function ti(){return qn||(qn=1,(function(e){function t(n,r,i,o){var s=Object.defineProperty;try{s({},"",{})}catch{s=0}e.exports=t=function(a,u,c,p){function l(x,y){t(a,x,function(b){return this._invoke(x,y,b)})}u?s?s(a,u,{value:c,enumerable:!p,configurable:!p,writable:!p}):a[u]=c:(l("next",0),l("throw",1),l("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r,i,o)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Wn)),Wn.exports}var Hn;function ni(){return Hn||(Hn=1,(function(e){var t=ti();function n(){var r,i,o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.toStringTag||"@@toStringTag";function u(h,f,m,O){var w=f&&f.prototype instanceof p?f:p,v=Object.create(w.prototype);return t(v,"_invoke",(function(A,k,C){var M,P,z,U=0,q=C||[],$=!1,E={p:0,n:0,v:r,a:H,f:H.bind(r,4),d:function(D,N){return M=D,P=0,z=r,E.n=N,c}};function H(D,N){for(P=D,z=N,i=0;!$&&U&&!d&&i<q.length;i++){var d,g=q[i],I=E.p,_=g[2];D>3?(d=_===N)&&(z=g[(P=g[4])?5:(P=3,3)],g[4]=g[5]=r):g[0]<=I&&((d=D<2&&I<g[1])?(P=0,E.v=N,E.n=g[1]):I<_&&(d=D<3||g[0]>N||N>_)&&(g[4]=D,g[5]=N,E.n=_,P=0))}if(d||D>1)return c;throw $=!0,N}return function(D,N,d){if(U>1)throw TypeError("Generator is already running");for($&&N===1&&H(N,d),P=N,z=d;(i=P<2?r:z)||!$;){M||(P?P<3?(P>1&&(E.n=-1),H(P,z)):E.n=z:E.v=z);try{if(U=2,M){if(P||(D="next"),i=M[D]){if(!(i=i.call(M,z)))throw TypeError("iterator result is not an object");if(!i.done)return i;z=i.value,P<2&&(P=0)}else P===1&&(i=M.return)&&i.call(M),P<2&&(z=TypeError("The iterator does not provide a '"+D+"' method"),P=1);M=r}else if((i=($=E.n<0)?z:A.call(k,E))!==c)break}catch(g){M=r,P=1,z=g}finally{U=1}}return{value:i,done:$}}})(h,m,O),!0),v}var c={};function p(){}function l(){}function x(){}i=Object.getPrototypeOf;var y=[][s]?i(i([][s]())):(t(i={},s,function(){return this}),i),b=x.prototype=p.prototype=Object.create(y);function S(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,x):(h.__proto__=x,t(h,a,"GeneratorFunction")),h.prototype=Object.create(b),h}return l.prototype=x,t(b,"constructor",x),t(x,"constructor",l),l.displayName="GeneratorFunction",t(x,a,"GeneratorFunction"),t(b),t(b,a,"Generator"),t(b,s,function(){return this}),t(b,"toString",function(){return"[object Generator]"}),(e.exports=n=function(){return{w:u,m:S}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(Vn)),Vn.exports}var Kn={exports:{}},Gn={exports:{}},Jn={exports:{}},Xn;function ri(){return Xn||(Xn=1,(function(e){var t=ei(),n=ti();function r(i,o){function s(u,c,p,l){try{var x=i[u](c),y=x.value;return y instanceof t?o.resolve(y.v).then(function(b){s("next",b,p,l)},function(b){s("throw",b,p,l)}):o.resolve(y).then(function(b){x.value=b,p(x)},function(b){return s("throw",b,p,l)})}catch(b){l(b)}}var a;this.next||(n(r.prototype),n(r.prototype,typeof Symbol=="function"&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),n(this,"_invoke",function(u,c,p){function l(){return new o(function(x,y){s(u,p,x,y)})}return a=a?a.then(l,l):l()},!0)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(Jn)),Jn.exports}var Fn;function ii(){return Fn||(Fn=1,(function(e){var t=ni(),n=ri();function r(i,o,s,a,u){return new n(t().w(i,o,s,a),u||Promise)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(Gn)),Gn.exports}var Bn;function us(){return Bn||(Bn=1,(function(e){var t=ii();function n(r,i,o,s,a){var u=t(r,i,o,s,a);return u.next().then(function(c){return c.done?c.value:u.next()})}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(Kn)),Kn.exports}var Qn={exports:{}},Yn;function cs(){return Yn||(Yn=1,(function(e){function t(n){var r=Object(n),i=[];for(var o in r)i.unshift(o);return function s(){for(;i.length;)if((o=i.pop())in r)return s.value=o,s.done=!1,s;return s.done=!0,s}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Qn)),Qn.exports}var Zn={exports:{}},er={exports:{}},tr;function ls(){return tr||(tr=1,(function(e){function t(n){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(er)),er.exports}var nr;function fs(){return nr||(nr=1,(function(e){var t=ls().default;function n(r){if(r!=null){var i=r[typeof Symbol=="function"&&Symbol.iterator||"@@iterator"],o=0;if(i)return i.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length))return{next:function(){return r&&o>=r.length&&(r=void 0),{value:r&&r[o++],done:!r}}}}throw new TypeError(t(r)+" is not iterable")}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(Zn)),Zn.exports}var rr;function ds(){return rr||(rr=1,(function(e){var t=ei(),n=ni(),r=us(),i=ii(),o=ri(),s=cs(),a=fs();function u(){var c=n(),p=c.m(u),l=(Object.getPrototypeOf?Object.getPrototypeOf(p):p.__proto__).constructor;function x(S){var h=typeof S=="function"&&S.constructor;return!!h&&(h===l||(h.displayName||h.name)==="GeneratorFunction")}var y={throw:1,return:2,break:3,continue:3};function b(S){var h,f;return function(m){h||(h={stop:function(){return f(m.a,2)},catch:function(){return m.v},abrupt:function(O,w){return f(m.a,y[O],w)},delegateYield:function(O,w,v){return h.resultName=w,f(m.d,a(O),v)},finish:function(O){return f(m.f,O)}},f=function(O,w,v){m.p=h.prev,m.n=h.next;try{return O(w,v)}finally{h.next=m.n}}),h.resultName&&(h[h.resultName]=m.v,h.resultName=void 0),h.sent=m.v,h.next=m.n;try{return S.call(this,h)}finally{m.p=h.prev,m.n=h.next}}}return(e.exports=u=function(){return{wrap:function(S,h,f,m){return c.w(b(S),h,f,m&&m.reverse())},isGeneratorFunction:x,mark:c.m,awrap:function(S,h){return new t(S,h)},AsyncIterator:o,async:function(S,h,f,m,O){return(x(h)?i:r)(b(S),h,f,m,O)},keys:s,values:a}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=u,e.exports.__esModule=!0,e.exports.default=e.exports})(zn)),zn.exports}var mt,ir;function ps(){if(ir)return mt;ir=1;var e=ds()();mt=e;try{regeneratorRuntime=e}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}return mt}var gs=ps(),K=Zr(gs);function or(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(c){return void n(c)}a.done?t(u):Promise.resolve(u).then(r,i)}function re(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(u){or(o,r,i,s,a,"next",u)}function a(u){or(o,r,i,s,a,"throw",u)}s(void 0)})}}var sr=function(){};function hs(e,t){var n,r,i,o=(t=t||{}).initial||[],s=t.max||1/0,a=t.interval||1e4,u=t.onEmpty||sr,c=t.onPause||sr;function p(x){clearInterval(n);var y=o.splice(0,s);return y.length&&e(y,o),o.length?x?p():l():(i=!1,u(o))}function l(){i=!0,n=setInterval(p,a)}return o.length&&l(),{flush:function(x){p(x)},resume:p,push:function(x){return(r=o.push(x))>=s&&!t.throttle&&p(),i||l(),r},size:function(){return o.length},pause:function(x){x&&p(),clearInterval(n),i=!1,c(o)}}}var Xe="__",st="session",oi=Xe+st,si="page",ar=["id","createdAt","created"];function Tt(e){var t=e?new Date(e):new Date;return[t.toISOString(),t.getTime()]}function ai(){var e=Tt(),t=e[0],n=e[1];return{id:xe(),created:n,createdAt:t}}var ms={session:[Bo,Qo],page:[pe,ge]};function at(e,t){for(var n=ms[e],r=n[0],i=n[1],o=ai(),s=!1,a={},u=0;u<ar.length;u++){var c=ar[u],p=Xe+e+Xe+st+Xe+c,l=r(p);s=t||!l,(t||!t&&!l)&&i(p,o[c]);var x=l&&!t?l:o[c],y=c!=="created"?x:Number(x);a[c]=y}return nn(a,s)}function nn(e,t){var n=Date.now();return e.elapsed=n-e.created,e.expires&&(e.remaining=Math.max(e.expires-n,0),e.isExpired=e.remaining===0),e.isNew=t,e}function Le(e,t){e===void 0&&(e=30);var n=Xt(oi),r=n?JSON.parse(n):Ze(e);return t?r:nn(r,!n)}function Ze(e,t,n){e===void 0&&(e=30);var r=n?Le(e,!0):ai(),i=60*e,o=r.created;if(n){var s=Tt(),a=s[0],u=s[1];r.modified=u,r.modifiedAt=a,o=u}var c=Tt(o+1e3*i),p=c[0];return r.expires=c[1],r.expiresAt=p,r.duration=1e3*i,t&&(r=Object.assign(r,t)),Xr(oi,JSON.stringify(r),i),nn(r,!n)}var ys=function(e,t){return Ze(e,t,!0)},ui=at.bind(null,st),vs=at.bind(null,st,!0),rn=at.bind(null,si),ur=at.bind(null,si,!0),be=typeof window<"u";function bs(e){return typeof e=="string"}function cr(e){return typeof e=="boolean"}var yt,lr;function ws(){if(lr)return yt;lr=1;var e=function(f){return t(f)&&!n(f)};function t(f){return!!f&&typeof f=="object"}function n(f){var m=Object.prototype.toString.call(f);return m==="[object RegExp]"||m==="[object Date]"||o(f)}var r=typeof Symbol=="function"&&Symbol.for,i=r?Symbol.for("react.element"):60103;function o(f){return f.$$typeof===i}function s(f){return Array.isArray(f)?[]:{}}function a(f,m){return m.clone!==!1&&m.isMergeableObject(f)?S(s(f),f,m):f}function u(f,m,O){return f.concat(m).map(function(w){return a(w,O)})}function c(f,m){if(!m.customMerge)return S;var O=m.customMerge(f);return typeof O=="function"?O:S}function p(f){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(f).filter(function(m){return Object.propertyIsEnumerable.call(f,m)}):[]}function l(f){return Object.keys(f).concat(p(f))}function x(f,m){try{return m in f}catch{return!1}}function y(f,m){return x(f,m)&&!(Object.hasOwnProperty.call(f,m)&&Object.propertyIsEnumerable.call(f,m))}function b(f,m,O){var w={};return O.isMergeableObject(f)&&l(f).forEach(function(v){w[v]=a(f[v],O)}),l(m).forEach(function(v){y(f,v)||(x(f,v)&&O.isMergeableObject(m[v])?w[v]=c(v,O)(f[v],m[v],O):w[v]=a(m[v],O))}),w}function S(f,m,O){O=O||{},O.arrayMerge=O.arrayMerge||u,O.isMergeableObject=O.isMergeableObject||e,O.cloneUnlessOtherwiseSpecified=a;var w=Array.isArray(m),v=Array.isArray(f),A=w===v;return A?w?O.arrayMerge(f,m,O):b(f,m,O):a(m,O)}S.all=function(f,m){if(!Array.isArray(f))throw new Error("first argument should be an array");return f.reduce(function(O,w){return S(O,w,m)},{})};var h=S;return yt=h,yt}var xs=ws(),Ss=Zr(xs),Nt=new TextEncoder,Os={appstream2:"appstream",cloudhsmv2:"cloudhsm",email:"ses",marketplace:"aws-marketplace",mobile:"AWSMobileHubService",pinpoint:"mobiletargeting",queue:"sqs","git-codecommit":"codecommit","mturk-requester-sandbox":"mturk-requester","personalize-runtime":"personalize"},ks=new Set(["authorization","content-type","content-length","user-agent","presigned-expires","expect","x-amzn-trace-id","range","connection"]),_t=class{constructor({accessKeyId:t,secretAccessKey:n,sessionToken:r,service:i,region:o,cache:s,retries:a,initRetryMs:u}){if(t==null)throw new TypeError("accessKeyId is a required option");if(n==null)throw new TypeError("secretAccessKey is a required option");this.accessKeyId=t,this.secretAccessKey=n,this.sessionToken=r,this.service=i,this.region=o,this.cache=s||new Map,this.retries=a??10,this.initRetryMs=u||50}async sign(t,n){if(t instanceof Request){let{method:o,url:s,headers:a,body:u}=t;n=Object.assign({method:o,url:s,headers:a},n),n.body==null&&a.has("Content-Type")&&(n.body=u!=null&&a.has("X-Amz-Content-Sha256")?u:await t.clone().arrayBuffer()),t=s}let r=new Ct(Object.assign({url:t.toString()},n,this,n&&n.aws)),i=Object.assign({},n,await r.sign());delete i.aws;try{return new Request(i.url.toString(),i)}catch(o){if(o instanceof TypeError)return new Request(i.url.toString(),Object.assign({duplex:"half"},i));throw o}}async fetch(t,n){for(let r=0;r<=this.retries;r++){let i=fetch(await this.sign(t,n));if(r===this.retries)return i;let o=await i;if(o.status<500&&o.status!==429)return o;await new Promise(s=>setTimeout(s,Math.random()*this.initRetryMs*Math.pow(2,r)))}throw new Error("An unknown error occurred, ensure retries is not negative")}},Ct=class{constructor({method:t,url:n,headers:r,body:i,accessKeyId:o,secretAccessKey:s,sessionToken:a,service:u,region:c,cache:p,datetime:l,signQuery:x,appendSessionToken:y,allHeaders:b,singleEncode:S}){if(n==null)throw new TypeError("url is a required option");if(o==null)throw new TypeError("accessKeyId is a required option");if(s==null)throw new TypeError("secretAccessKey is a required option");this.method=t||(i?"POST":"GET"),this.url=new URL(n),this.headers=new Headers(r||{}),this.body=i,this.accessKeyId=o,this.secretAccessKey=s,this.sessionToken=a;let h,f;(!u||!c)&&([h,f]=As(this.url,this.headers)),this.service=u||h||"",this.region=c||f||"us-east-1",this.cache=p||new Map,this.datetime=l||new Date().toISOString().replace(/[:-]|\.\d{3}/g,""),this.signQuery=x,this.appendSessionToken=y||this.service==="iotdevicegateway",this.headers.delete("Host"),this.service==="s3"&&!this.signQuery&&!this.headers.has("X-Amz-Content-Sha256")&&this.headers.set("X-Amz-Content-Sha256","UNSIGNED-PAYLOAD");let m=this.signQuery?this.url.searchParams:this.headers;if(m.set("X-Amz-Date",this.datetime),this.sessionToken&&!this.appendSessionToken&&m.set("X-Amz-Security-Token",this.sessionToken),this.signableHeaders=["host",...this.headers.keys()].filter(w=>b||!ks.has(w)).sort(),this.signedHeaders=this.signableHeaders.join(";"),this.canonicalHeaders=this.signableHeaders.map(w=>w+":"+(w==="host"?this.url.host:(this.headers.get(w)||"").replace(/\s+/g," "))).join(`
|
|
4
4
|
`),this.credentialString=[this.datetime.slice(0,8),this.region,this.service,"aws4_request"].join("/"),this.signQuery&&(this.service==="s3"&&!m.has("X-Amz-Expires")&&m.set("X-Amz-Expires","86400"),m.set("X-Amz-Algorithm","AWS4-HMAC-SHA256"),m.set("X-Amz-Credential",this.accessKeyId+"/"+this.credentialString),m.set("X-Amz-SignedHeaders",this.signedHeaders)),this.service==="s3")try{this.encodedPath=decodeURIComponent(this.url.pathname.replace(/\+/g," "))}catch{this.encodedPath=this.url.pathname}else this.encodedPath=this.url.pathname.replace(/\/+/g,"/");S||(this.encodedPath=encodeURIComponent(this.encodedPath).replace(/%2F/g,"/")),this.encodedPath=pr(this.encodedPath);let O=new Set;this.encodedSearch=[...this.url.searchParams].filter(([w])=>{if(!w)return!1;if(this.service==="s3"){if(O.has(w))return!1;O.add(w)}return!0}).map(w=>w.map(v=>pr(encodeURIComponent(v)))).sort(([w,v],[A,k])=>w<A?-1:w>A?1:v<k?-1:v>k?1:0).map(w=>w.join("=")).join("&")}async sign(){return this.signQuery?(this.url.searchParams.set("X-Amz-Signature",await this.signature()),this.sessionToken&&this.appendSessionToken&&this.url.searchParams.set("X-Amz-Security-Token",this.sessionToken)):this.headers.set("Authorization",await this.authHeader()),{method:this.method,url:this.url,headers:this.headers,body:this.body}}async authHeader(){return["AWS4-HMAC-SHA256 Credential="+this.accessKeyId+"/"+this.credentialString,"SignedHeaders="+this.signedHeaders,"Signature="+await this.signature()].join(", ")}async signature(){let t=this.datetime.slice(0,8),n=[this.secretAccessKey,t,this.region,this.service].join(),r=this.cache.get(n);if(!r){let i=await _e("AWS4"+this.secretAccessKey,t),o=await _e(i,this.region),s=await _e(o,this.service);r=await _e(s,"aws4_request"),this.cache.set(n,r)}return vt(await _e(r,await this.stringToSign()))}async stringToSign(){return["AWS4-HMAC-SHA256",this.datetime,this.credentialString,vt(await fr(await this.canonicalString()))].join(`
|
|
5
5
|
`)}async canonicalString(){return[this.method.toUpperCase(),this.encodedPath,this.encodedSearch,this.canonicalHeaders+`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{a as E}from"./LLYTIOG4.js";import{b as k}from"./PZ4L77M5.js";import c from"./KDIUYXBA.js";import a from"./UUYUTETH.js";import{a as V}from"./M5MQY5WC.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import{b as C}from"./HW7HHHMK.js";import{F as d,G as u,H as S,J as p,K as v,h as b,i as o,r as w,u as L}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([x,N,D,W,R,{a:$,d:G,f:T},{c:_,g:I,j:O}])=>{var P=b`@layer{:host{display:block}.div-visible{display:inherit}.div-not-visible{display:none}.padding-bottom-1{padding-bottom:1rem}.padding-top-1{padding-top:1rem}.search-widget{width:100%!important;border:1px solid var(--calcite-color-border-input)}.w-100{width:100%}.search-distance{display:flex;padding-top:1rem}.font-bold{font:bold}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.tooltip-container{display:flex}.padding-start-1-2{padding-inline-start:.5rem}.padding-end-1-2{padding-inline-end:.5rem}.icon{--calcite-color-icon-color: var(--calcite-color-brand)}.tooltip-message{padding:5px 8px;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2);max-width:400px}}`,m=class extends S{constructor(){super(),this.bufferColor=[227,139,79,.8],this.bufferOutlineColor=[255,255,255],this.customLabelEnabled=!1,this.enabledLayerIds=[],this.enableLayerFeatures=!0,this.enableLayerFeaturesOnLoad=!1,this.enableSearchDistance=!0,this.enableSearchDistanceOnLoad=!1,this.enableSketchTools=!0,this.geometries=[],this.headerLabelClass="font-bold",this.isUpdate=!1,this.layerViews=[],this.noResultText="",this.selectionLayerIds=[],this.searchDistanceEnabled=!1,this.useLayerFeaturesEnabled=!1,this._numSelected=0,this._searchTerm="",this._selectionLoading=!1,this._translations=V({name:"map-select-tools",blocking:!0}),this._bufferTools=d(),this._drawTools=d(),this._labelName=d(),this._pnContextConsumer=k({context:E,subscribe:!0}),this._searchElement=d(),this._selectedIds=[],this._selectionLabel="",this._graphics=[],this._featuresCollection={},this.selectionSetChange=w(),this.listenOn(window,"searchConfigurationChange",this.searchConfigurationChangeChanged),this.listenOn(window,"distanceChanged",this.distanceChanged),this.listenOn(window,"unitChanged",this.unitChanged)}static{this.properties={bufferColor:1,bufferOutlineColor:1,customLabelEnabled:5,enabledLayerIds:0,enableLayerFeatures:5,enableLayerFeaturesOnLoad:5,enableSearchDistance:5,enableSearchDistanceOnLoad:5,enableSketchTools:5,defaultBufferDistance:9,defaultBufferUnit:1,geometries:0,headerLabelClass:1,isUpdate:5,layerViews:0,mapView:0,noResultText:1,searchConfiguration:0,selectionSet:0,selectionLayerIds:0,selectLayerView:0,sketchLineSymbol:0,sketchPointSymbol:0,sketchPolygonSymbol:0,searchDistanceEnabled:5,useLayerFeaturesEnabled:5,_numSelected:16,_searchTerm:16,_selectionLoading:16,_translations:16}}static{this.styles=P}static{this.shadowRootOptions=L}willUpdate(e){e.has("geometries")&&(this.hasUpdated||this.geometries?.length>0)&&this.watchGeometriesHandler(this.geometries,e.get("geometries")),e.has("mapView")&&this.mapView&&this.mapViewWatchHandler(this.mapView,e.get("mapView")),e.has("searchConfiguration")&&this.searchConfiguration&&this.watchSearchConfigurationHandler(this.searchConfiguration,e.get("searchConfiguration")),e.has("defaultBufferUnit")&&this.hasUpdated&&(this.selectionSet&&(this.selectionSet.unit=this.defaultBufferUnit),this._bufferTools.value&&this.defaultBufferUnit!==void 0&&(this._bufferTools.value.unit=this.defaultBufferUnit),this._updateLabel()),e.has("defaultBufferDistance")&&this.hasUpdated&&(this.selectionSet&&(this.selectionSet.distance=this.defaultBufferDistance),this._updateLabel())}async watchGeometriesHandler(e,t){if(e!==t&&e.length>0)return this._highlightWithOIDsOrGeoms()}async mapViewWatchHandler(e,t){e&&e!==t&&await this._init()}async watchSearchConfigurationHandler(e,t){JSON.stringify(e)!==JSON.stringify(t)&&await this._initSearchWidget()}async clearSelection(){return this._clearResults(!0,!0)}async getSelection(){return/\S+/gm.test(this._selectionLabel)||await this._updateLabel(),{id:this.isUpdate&&this.selectionSet?this.selectionSet.id:Date.now(),searchResult:this._searchResult,buffer:this._bufferGeometry,distance:this._bufferTools.value?.distance,download:!0,unit:this._bufferTools.value?.unit,label:this._selectionLabel,selectedIds:this._selectedIds,layerView:this.selectLayerView,geometries:this.geometries,graphics:this._graphics,selectLayers:this.layerViews,skipGeomOIDs:this._skipGeomOIDs,searchDistanceEnabled:this.searchDistanceEnabled,workflowType:this._workflowType,useLayerFeaturesEnabled:this.useLayerFeaturesEnabled,sketchGraphic:this._sketchGraphic}}searchConfigurationChangeChanged(e){this.searchConfiguration=e.detail}async distanceChanged(e){await this._distanceChanged(e.detail)}async unitChanged(e){e.detail.newValue!==e.detail.oldValue&&(this._unit=e.detail.newValue,await this._updateLabel())}async loaded(){await this._init()}render(){let e=this.enableSketchTools?"":"display-none",t=this.enableSketchTools?"padding-top-1":"";return o`${this._getMapLayerPicker()}<div class="border-bottom"></div><div class="padding-top-sides-1"><div class="search-widget" ${u(this._searchElement)}></div><div class=${p(t)}><map-draw-tools active class=${p(e)} .editGraphicsEnabled=${!this.useLayerFeaturesEnabled} .graphics=${this._graphics} .mapView=${this.mapView} @sketchGraphicsChange=${s=>{this._sketchGraphicsChanged(s)}} .pointSymbol=${this.sketchPointSymbol} .polygonSymbol=${this.sketchPolygonSymbol} .polylineSymbol=${this.sketchLineSymbol} ${u(this._drawTools)}></map-draw-tools></div>${this.enableSearchDistance?this._getBufferOptions():void 0}${this.enableLayerFeatures?this._getUseLayerFeaturesOptions():void 0}${this._getNumSelected()}</div><div class="border-bottom"></div>${this._getNameInput()}`}_getBufferOptions(){this.enableSearchDistanceOnLoad&&(this.searchDistanceEnabled=!0,this.enableSearchDistanceOnLoad=!1);let e=this.searchDistanceEnabled?"search-distance":"div-not-visible",t=typeof this.selectionSet?.distance=="number"?this.selectionSet.distance:this.defaultBufferDistance;return o`<div><div class="padding-top-1 display-flex"><calcite-label class="label-margin-0 w-100" layout=inline-space-between><div class="tooltip-container">${this._translations.searchDistance}<calcite-icon class="padding-start-1-2 icon" .flipRtl=${this._translations._lang?.toLowerCase()!=="he"} icon=question id=search-distance-icon scale=s></calcite-icon></div></calcite-label><calcite-popover closable label overlay-positioning=fixed reference-element=search-distance-icon><span class="tooltip-message">${this._translations.useSearchDistanceTootip}</span></calcite-popover><calcite-switch .checked=${this.searchDistanceEnabled} @calciteSwitchChange=${()=>this.searchDistanceEnabled=!this.searchDistanceEnabled}></calcite-switch></div><div class=${p(e)}><buffer-tools .disabled=${!this.searchDistanceEnabled} .distance=${t} .geometries=${this.geometries} @bufferComplete=${s=>{this._bufferComplete(s)}} .unit=${this.selectionSet?.unit||this.defaultBufferUnit} ${u(this._bufferTools)}></buffer-tools></div></div>`}_getUseLayerFeaturesOptions(){this.enableLayerFeaturesOnLoad&&(this.useLayerFeaturesEnabled=!0,this.enableLayerFeaturesOnLoad=!1);let e=this.useLayerFeaturesEnabled?"div-visible":"div-not-visible";return o`<div><div class="padding-top-1 display-flex"><calcite-label class="label-margin-0 w-100" layout=inline-space-between><div class="tooltip-container">${this._translations.useLayerFeatures}<calcite-icon class="padding-start-1-2 icon" .flipRtl=${this._translations._lang?.toLowerCase()!=="he"} icon=question id=use-layer-features-icon scale=s></calcite-icon></div></calcite-label><calcite-popover closable label overlay-positioning=fixed reference-element=use-layer-features-icon><span class="tooltip-message">${this._translations.useLayerFeaturesTooltip}</span></calcite-popover><calcite-switch .checked=${this.useLayerFeaturesEnabled} @calciteSwitchChange=${()=>{this._useLayerFeaturesEnabledChanged()}}></calcite-switch></div><div class=${`${e} padding-top-1`}><map-layer-picker .enabledLayerIds=${this.selectionLayerIds} .mapView=${this.mapView} @layerSelectionChange=${t=>{this._layerSelectionChange(t)}} .selectedIds=${this.layerViews.map(t=>t.layer.id)}></map-layer-picker></div></div>`}_getNumSelected(){let e=this._translations._lang==="en"?`${this._translations.selectionLoading}...`:this._translations.selectionLoading;return o`<div class="padding-top-1 padding-bottom-1" style=${v({"align-items":"end",display:"flex"})}>${this._selectionLoading?o`<div><calcite-loader class="info-blue padding-end-1-2" inline .label=${e||""} scale=m type=indeterminate></calcite-loader></div>`:o`<calcite-icon class="info-blue padding-end-1-2" icon=feature-layer scale=s></calcite-icon>`}<calcite-input-message class="info-blue" scale=m>${this._selectionLoading?e:this.noResultText&&this._numSelected===0?this.noResultText:this._translations.selectedFeatures.replace("{{n}}",this._numSelected.toString())}</calcite-input-message></div>`}_getNameInput(){let e=this.customLabelEnabled?"":"display-none";return o`<div class=${`padding-sides-1 padding-top-1 ${e}`}><calcite-label class=${p(this.headerLabelClass)}>${this._translations.listName}<calcite-input @input=${()=>{this._selectionLabel=this._labelName.value?this._labelName.value.value:""}} .placeholder=${this._translations.listNamePlaceholder} .value=${this._selectionLabel||""} ${u(this._labelName)}></calcite-input></calcite-label></div>`}_getMapLayerPicker(){let e=this.selectionSet?.layerView?.layer.id;return o`<div class="display-flex padding-sides-1 padding-bottom-1"><calcite-label class=${`${this.headerLabelClass} width-full label-margin-0`}>${this._translations.inputLayer}<map-layer-picker .enabledLayerIds=${this.enabledLayerIds} .mapView=${this.mapView} @layerSelectionChange=${t=>{this._inputLayerSelectionChange(t)}} .selectedIds=${this.selectLayerView?[this.selectLayerView.layer.id]:this.selectionSet&&e!==void 0?[e]:[]}></map-layer-picker></calcite-label></div>`}async _init(){this._initGraphicsLayer(),await this._initSelectionSet(),await this._initSearchWidget()}async _initSelectionSet(){this.selectionSet&&(this._searchTerm=this.selectionSet.searchResult?.name,this._searchResult=this.selectionSet.searchResult,this._selectedIds=this.selectionSet.selectedIds,this._skipGeomOIDs=this.selectionSet.skipGeomOIDs||[],this.searchDistanceEnabled=this.selectionSet.searchDistanceEnabled,this.useLayerFeaturesEnabled=this.selectionSet.useLayerFeaturesEnabled,this._distance=this.selectionSet.searchDistanceEnabled?this.selectionSet.distance:0,this._unit=this.selectionSet.unit,this._workflowType=this.selectionSet.workflowType,this.selectLayerView=this.selectionSet.layerView,this._sketchGraphic=this.selectionSet.sketchGraphic,this.geometries=[...this.selectionSet?.geometries||[]],this._graphics=this.geometries.reduce((e,t)=>{let s=t.type==="point"?this.sketchPointSymbol:t.type==="polyline"?this.sketchLineSymbol:this.sketchPolygonSymbol;return e.push(new D({geometry:t,symbol:s})),e},[]),this._selectionLabel=this.selectionSet?.label,this.useLayerFeaturesEnabled||await this._drawTools.value?.updateGraphics(),this.selectionSet.layerView&&this.mapView&&await O(this.selectionSet.selectedIds,this.selectionSet.layerView,this.mapView,!1))}async _initSearchWidget(){if(this.mapView&&this._searchElement.value){let e=this.searchConfiguration&&this._getSearchConfig(this.searchConfiguration,this.mapView),t={view:this.mapView,container:this._searchElement.value,searchTerm:this._searchTerm,...e};this._searchWidget?(this._searchWidget.view=this.mapView,this._searchWidget.searchTerm=this._searchTerm):this._searchWidget=new R(t),this._searchWidget&&(this._searchWidget.popupEnabled=!1,this._searchWidget.resultGraphicEnabled=!1,this._searchWidget.viewModel.addHandles(this._searchWidget.on("search-clear",()=>{let s=this._searchClearLabel();this._searchResult?.name&&this._clearResults(!1,s)})),this._searchWidget.viewModel.addHandles(this._searchWidget.on("select-result",s=>{this._selectResult(s.result)})),await this._searchWidget.when(()=>{this._searchWidget&&(this._searchWidget.allPlaceholder=this.searchConfiguration?.allPlaceholder&&this.searchConfiguration.allPlaceholder.toLowerCase()!=="find address or place"?this.searchConfiguration.allPlaceholder:this._translations.placeholder)}))}}async _selectResult(e){if(e){this._searchResult=e;let t=e.feature,s=t?.layer,i=this.selectLayerView?.layer,a=Number(t?.getObjectId()),l;s?.sourceJSON?.isView&&s.url&&(l=await this._getViewSourceUrl(s.url));let r;i?.sourceJSON?.isView&&i.url&&(r=await this._getViewSourceUrl(i.url));let c=s?.url?.toLowerCase(),n=l?.toLowerCase(),h=i?.url?.toLowerCase(),y=r?.toLowerCase(),g=c&&h&&(c===h||c===y||n===h||n===y)&&!Number.isNaN(a),F=g?[a]:void 0;this._workflowType="SEARCH",this._updateLabel();let f=[e.feature];this._updateSelection(f,g,F),this._drawTools.value&&(this._drawTools.value.graphics=f),this._searchWidget?.resultGraphic&&(this._searchWidget.resultGraphic.visible=!1)}else{let t=this._searchClearLabel();this._clearResults(!1,t)}}async _getViewSourceUrl(e){let t="",s=`${e}/sources?f=json`;try{let i=await x(s,{query:{f:"json"}});i?.data?.services?.length===1&&(t=i.data.services[0].url)}catch(i){console.log(i)}return t}_searchClearLabel(){return this._searchResult?.name&&this._labelName.value&&this._labelName.value.value.indexOf(this._searchResult.name)>-1}_getSearchConfig(e,t){let s=e?.sources;return s&&s?.length>0?(e={...e,includeDefaultSources:!1},s.forEach(i=>{if(i.hasOwnProperty("layer")){let a=i,l=a.layer?.id,r=l?t.map?.findLayerById(l):null,c=a?.layer?.url;r&&a?a.layer=r:c&&(a.layer=new N(c))}}),s?.forEach(i=>{if(i.hasOwnProperty("locator")){let a=i;if(a?.name==="ArcGIS World Geocoding Service"){let l=a.outFields||["Addr_type","Match_addr","StAddr","City"];a.outFields=l,a.singleLineFieldName="SingleLine"}a.url=a.url,delete a.url}})):e={...e,includeDefaultSources:!0},e}_initGraphicsLayer(){let e=this._pnContextConsumer.value,t=this._translations.bufferLayer;if(this.mapView){let s=this.mapView.map.layers.findIndex(i=>i.title===t);if(s>-1)this._bufferGraphicsLayer=this.mapView.map.layers.getItemAt(s);else if(this._bufferGraphicsLayer=new W({title:t,listMode:"hide"}),this._bufferGraphicsLayer){e.managedLayers[t]="buffer";let i=this.mapView.map.layers.findIndex(a=>a.title===this._translations.sketchLayer);i>-1?this.mapView.map.layers.add(this._bufferGraphicsLayer,i):this.mapView.map.layers.add(this._bufferGraphicsLayer)}}}async _sketchGraphicsChanged(e,t=!1){let s=e.detail.graphics;if(s.length>0&&s[0])if(t||(this._sketchGraphic=s[0]),this._workflowType=this.useLayerFeaturesEnabled?"SELECT":"SKETCH",this._workflowType==="SKETCH"&&this._drawTools.value&&await this._drawTools.value.updateGraphics(),await this._updateLabel(),this._clearSearchWidget(),this.useLayerFeaturesEnabled&&!t){let i=Array.isArray(s)?s.map(a=>a.geometry):this.geometries;await this._selectLayerFeatures(i[0])}else{let i=s.reduce((l,r)=>(r?.layer?.objectIdField?l.push(Number(r.attributes[r.layer.objectIdField])):r.getObjectId&&l.push(Number(r.getObjectId())),l),[]),a=e.detail.useOIDs&&i.length>0;this._updateSelection(s,a,i),a&&await this._highlightFeatures(i)}else await this._clearResults(!0,!0)}async _highlightWithOIDsOrGeoms(){return this._skipGeomOIDs&&this._skipGeomOIDs?.length>0?(this._selectedIds=this._skipGeomOIDs,this._highlightFeatures(this._selectedIds)):this._geomQuery(this.geometries)}async _highlightFeatures(e){let t=this._pnContextConsumer.value;if(t.removeHandles(),e.length>0&&this.selectLayerView&&this.mapView){let s=await I(e,this.selectLayerView,this.mapView);t.highlightHandles.push(s)}this._numSelected=e.length,this.selectionSetChange.emit(e.length)}async _selectFeatures(e){this._selectionLoading=!0,this._selectedIds=this.selectLayerView&&await $(e,this.selectLayerView.layer)||[],this._selectionLoading=!1,this._drawTools.value&&(this._drawTools.value.graphics=this._graphics),await this._highlightFeatures(this._selectedIds)}async _bufferComplete(e){this._bufferGeometry=Array.isArray(e.detail)?e.detail[0]:e.detail;let t=this._bufferTools.value&&Number(this._bufferTools.value.distance),s=0;if(this._bufferGeometry){let i={type:"simple-fill",color:this.bufferColor,outline:{color:this.bufferOutlineColor,width:1}},a=new D({geometry:this._bufferGeometry,symbol:i});this._bufferGraphicsLayer&&a&&this.mapView&&(this._bufferGraphicsLayer.removeAll(),this._bufferGraphicsLayer.add(a),await this._selectFeatures([this._bufferGeometry]),a.geometry?.extent&&await this.mapView.goTo(a.geometry.extent)),s=t,t=0}else this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),await this._highlightWithOIDsOrGeoms();await this._distanceChanged({oldValue:t,newValue:s})}_geomQuery(e){let t=T(e);return t?this._selectFeatures(t):Promise.resolve()}async _clearResults(e=!0,t=!1){this._selectedIds=[],this._distance=void 0,this._unit=void 0,t&&(this._selectionLabel="",this._labelName.value&&(this._labelName.value.value="")),this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),e&&this._searchWidget&&this._clearSearchWidget(),this._pnContextConsumer.value.removeHandles(),this._drawTools.value?.clear&&(this._graphics=[],await this._drawTools.value.clear()),this._numSelected=this._selectedIds.length,this.selectionSetChange.emit(this._numSelected)}_clearSearchWidget(){this._searchWidget?.clear(),this._searchResult=void 0}_updateSelection(e,t,s){this._selectedIds=t&&s?s:this._selectedIds,this._skipGeomOIDs=t?s:void 0,this.geometries=Array.isArray(e)?e.reduce((i,a)=>(a.geometry&&i.push(a.geometry),i),[]):this.geometries,this._graphics=e}async _updateLabel(){if(this.enableSearchDistance){let e=this._translations.sketch&&this._selectionLabel.indexOf(this._translations.sketch)>-1,t=this._translations.select&&this._selectionLabel.indexOf(this._translations.select)>-1,s=this._selectionLabel.indexOf(this._searchResult?.name)>-1,i=this._workflowType==="SEARCH"?this._searchResult?.name:this._workflowType==="SELECT"?this._translations.select:this._translations.sketch,a=this._bufferTools.value?this._bufferTools.value.unit:this._unit,l=this._bufferTools.value&&a&&await this._bufferTools.value.getTranslatedUnit(a),r=Number.isNaN(Number(this._distance))&&this._bufferTools.value?this._bufferTools.value.distance:this._distance;this._selectionLabel=e||t||s||!this._selectionLabel?`${i} ${r} ${l}`:this._selectionLabel,this._labelName.value&&(this._labelName.value.value=this._selectionLabel)}}async _layerSelectionChange(e){if(Array.isArray(e.detail)&&e.detail.length>0){let t=e.detail.reduce((s,i)=>(this.mapView&&s.push(_(this.mapView,i)),s),[]);return Promise.all(t).then(s=>{this.layerViews=s.reduce((i,a)=>(a&&i.push(a),i),[]),this._featuresCollection={},this._sketchGraphic&&this._sketchGraphicsChanged({detail:{graphics:[this._sketchGraphic],useOIDs:!1}})})}}async _inputLayerSelectionChange(e){let t=e?.detail?.length>0?e.detail[0]:"";(!this.selectLayerView||t!==this.selectLayerView.layer.id)&&(this.selectLayerView=this.mapView&&await _(this.mapView,t),await this._updateLabel(),this._bufferGeometry?await this._selectFeatures([this._bufferGeometry]):await this._highlightWithOIDsOrGeoms())}async _distanceChanged(e){e.newValue!==e.oldValue&&(this._distance=e.newValue,await this._updateLabel())}async _selectLayerFeatures(e){this._selectionLoading=!0;let t=this.layerViews.map(s=>(this._featuresCollection[s.layer.id]=[],G(0,s.layer,e,this._featuresCollection)));return Promise.all(t).then(async s=>{this._selectionLoading=!1;let i=[];s.forEach(n=>{Object.keys(n).forEach(h=>{i=i.concat(n[h])})});let a=!1;i.forEach(n=>{let h=n.geometry;n.symbol=h&&h.type==="point"?this.sketchPointSymbol:h&&h.type==="polyline"?this.sketchLineSymbol:h&&h.type==="polygon"?this.sketchPolygonSymbol:void 0,a=n?.layer?.hasOwnProperty("objectIdField")||n.hasOwnProperty("getObjectId")});let l=this.layerViews[0].layer,r=this.selectLayerView?.layer,c=a&&l.url===r?.url&&r?.layerId===l.layerId;await this._sketchGraphicsChanged({detail:{graphics:i,useOIDs:c}},!0)})}_useLayerFeaturesEnabledChanged(){this.useLayerFeaturesEnabled=!this.useLayerFeaturesEnabled,this._sketchGraphic&&this._sketchGraphicsChanged({detail:{graphics:[this._sketchGraphic],useOIDs:!1}})}};C("map-select-tools",m);return m},"request","layers/FeatureLayer","Graphic","layers/GraphicsLayer","widgets/Search",a,c)
|
|
2
|
+
import{a as E}from"./LLYTIOG4.js";import{b as k}from"./PZ4L77M5.js";import c from"./KDIUYXBA.js";import a from"./UUYUTETH.js";import{a as V}from"./DV233ITZ.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import{b as C}from"./EIQZRLWQ.js";import{F as d,G as u,H as S,J as p,K as v,h as b,i as o,r as w,u as L}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([x,N,D,W,R,{a:$,d:G,f:T},{c:_,g:I,j:O}])=>{var P=b`@layer{:host{display:block}.div-visible{display:inherit}.div-not-visible{display:none}.padding-bottom-1{padding-bottom:1rem}.padding-top-1{padding-top:1rem}.search-widget{width:100%!important;border:1px solid var(--calcite-color-border-input)}.w-100{width:100%}.search-distance{display:flex;padding-top:1rem}.font-bold{font:bold}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.tooltip-container{display:flex}.padding-start-1-2{padding-inline-start:.5rem}.padding-end-1-2{padding-inline-end:.5rem}.icon{--calcite-color-icon-color: var(--calcite-color-brand)}.tooltip-message{padding:5px 8px;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2);max-width:400px}}`,m=class extends S{constructor(){super(),this.bufferColor=[227,139,79,.8],this.bufferOutlineColor=[255,255,255],this.customLabelEnabled=!1,this.enabledLayerIds=[],this.enableLayerFeatures=!0,this.enableLayerFeaturesOnLoad=!1,this.enableSearchDistance=!0,this.enableSearchDistanceOnLoad=!1,this.enableSketchTools=!0,this.geometries=[],this.headerLabelClass="font-bold",this.isUpdate=!1,this.layerViews=[],this.noResultText="",this.selectionLayerIds=[],this.searchDistanceEnabled=!1,this.useLayerFeaturesEnabled=!1,this._numSelected=0,this._searchTerm="",this._selectionLoading=!1,this._translations=V({name:"map-select-tools",blocking:!0}),this._bufferTools=d(),this._drawTools=d(),this._labelName=d(),this._pnContextConsumer=k({context:E,subscribe:!0}),this._searchElement=d(),this._selectedIds=[],this._selectionLabel="",this._graphics=[],this._featuresCollection={},this.selectionSetChange=w(),this.listenOn(window,"searchConfigurationChange",this.searchConfigurationChangeChanged),this.listenOn(window,"distanceChanged",this.distanceChanged),this.listenOn(window,"unitChanged",this.unitChanged)}static{this.properties={bufferColor:1,bufferOutlineColor:1,customLabelEnabled:5,enabledLayerIds:0,enableLayerFeatures:5,enableLayerFeaturesOnLoad:5,enableSearchDistance:5,enableSearchDistanceOnLoad:5,enableSketchTools:5,defaultBufferDistance:9,defaultBufferUnit:1,geometries:0,headerLabelClass:1,isUpdate:5,layerViews:0,mapView:0,noResultText:1,searchConfiguration:0,selectionSet:0,selectionLayerIds:0,selectLayerView:0,sketchLineSymbol:0,sketchPointSymbol:0,sketchPolygonSymbol:0,searchDistanceEnabled:5,useLayerFeaturesEnabled:5,_numSelected:16,_searchTerm:16,_selectionLoading:16,_translations:16}}static{this.styles=P}static{this.shadowRootOptions=L}willUpdate(e){e.has("geometries")&&(this.hasUpdated||this.geometries?.length>0)&&this.watchGeometriesHandler(this.geometries,e.get("geometries")),e.has("mapView")&&this.mapView&&this.mapViewWatchHandler(this.mapView,e.get("mapView")),e.has("searchConfiguration")&&this.searchConfiguration&&this.watchSearchConfigurationHandler(this.searchConfiguration,e.get("searchConfiguration")),e.has("defaultBufferUnit")&&this.hasUpdated&&(this.selectionSet&&(this.selectionSet.unit=this.defaultBufferUnit),this._bufferTools.value&&this.defaultBufferUnit!==void 0&&(this._bufferTools.value.unit=this.defaultBufferUnit),this._updateLabel()),e.has("defaultBufferDistance")&&this.hasUpdated&&(this.selectionSet&&(this.selectionSet.distance=this.defaultBufferDistance),this._updateLabel())}async watchGeometriesHandler(e,t){if(e!==t&&e.length>0)return this._highlightWithOIDsOrGeoms()}async mapViewWatchHandler(e,t){e&&e!==t&&await this._init()}async watchSearchConfigurationHandler(e,t){JSON.stringify(e)!==JSON.stringify(t)&&await this._initSearchWidget()}async clearSelection(){return this._clearResults(!0,!0)}async getSelection(){return/\S+/gm.test(this._selectionLabel)||await this._updateLabel(),{id:this.isUpdate&&this.selectionSet?this.selectionSet.id:Date.now(),searchResult:this._searchResult,buffer:this._bufferGeometry,distance:this._bufferTools.value?.distance,download:!0,unit:this._bufferTools.value?.unit,label:this._selectionLabel,selectedIds:this._selectedIds,layerView:this.selectLayerView,geometries:this.geometries,graphics:this._graphics,selectLayers:this.layerViews,skipGeomOIDs:this._skipGeomOIDs,searchDistanceEnabled:this.searchDistanceEnabled,workflowType:this._workflowType,useLayerFeaturesEnabled:this.useLayerFeaturesEnabled,sketchGraphic:this._sketchGraphic}}searchConfigurationChangeChanged(e){this.searchConfiguration=e.detail}async distanceChanged(e){await this._distanceChanged(e.detail)}async unitChanged(e){e.detail.newValue!==e.detail.oldValue&&(this._unit=e.detail.newValue,await this._updateLabel())}async loaded(){await this._init()}render(){let e=this.enableSketchTools?"":"display-none",t=this.enableSketchTools?"padding-top-1":"";return o`${this._getMapLayerPicker()}<div class="border-bottom"></div><div class="padding-top-sides-1"><div class="search-widget" ${u(this._searchElement)}></div><div class=${p(t)}><map-draw-tools active class=${p(e)} .editGraphicsEnabled=${!this.useLayerFeaturesEnabled} .graphics=${this._graphics} .mapView=${this.mapView} @sketchGraphicsChange=${s=>{this._sketchGraphicsChanged(s)}} .pointSymbol=${this.sketchPointSymbol} .polygonSymbol=${this.sketchPolygonSymbol} .polylineSymbol=${this.sketchLineSymbol} ${u(this._drawTools)}></map-draw-tools></div>${this.enableSearchDistance?this._getBufferOptions():void 0}${this.enableLayerFeatures?this._getUseLayerFeaturesOptions():void 0}${this._getNumSelected()}</div><div class="border-bottom"></div>${this._getNameInput()}`}_getBufferOptions(){this.enableSearchDistanceOnLoad&&(this.searchDistanceEnabled=!0,this.enableSearchDistanceOnLoad=!1);let e=this.searchDistanceEnabled?"search-distance":"div-not-visible",t=typeof this.selectionSet?.distance=="number"?this.selectionSet.distance:this.defaultBufferDistance;return o`<div><div class="padding-top-1 display-flex"><calcite-label class="label-margin-0 w-100" layout=inline-space-between><div class="tooltip-container">${this._translations.searchDistance}<calcite-icon class="padding-start-1-2 icon" .flipRtl=${this._translations._lang?.toLowerCase()!=="he"} icon=question id=search-distance-icon scale=s></calcite-icon></div></calcite-label><calcite-popover closable label overlay-positioning=fixed reference-element=search-distance-icon><span class="tooltip-message">${this._translations.useSearchDistanceTootip}</span></calcite-popover><calcite-switch .checked=${this.searchDistanceEnabled} @calciteSwitchChange=${()=>this.searchDistanceEnabled=!this.searchDistanceEnabled}></calcite-switch></div><div class=${p(e)}><buffer-tools .disabled=${!this.searchDistanceEnabled} .distance=${t} .geometries=${this.geometries} @bufferComplete=${s=>{this._bufferComplete(s)}} .unit=${this.selectionSet?.unit||this.defaultBufferUnit} ${u(this._bufferTools)}></buffer-tools></div></div>`}_getUseLayerFeaturesOptions(){this.enableLayerFeaturesOnLoad&&(this.useLayerFeaturesEnabled=!0,this.enableLayerFeaturesOnLoad=!1);let e=this.useLayerFeaturesEnabled?"div-visible":"div-not-visible";return o`<div><div class="padding-top-1 display-flex"><calcite-label class="label-margin-0 w-100" layout=inline-space-between><div class="tooltip-container">${this._translations.useLayerFeatures}<calcite-icon class="padding-start-1-2 icon" .flipRtl=${this._translations._lang?.toLowerCase()!=="he"} icon=question id=use-layer-features-icon scale=s></calcite-icon></div></calcite-label><calcite-popover closable label overlay-positioning=fixed reference-element=use-layer-features-icon><span class="tooltip-message">${this._translations.useLayerFeaturesTooltip}</span></calcite-popover><calcite-switch .checked=${this.useLayerFeaturesEnabled} @calciteSwitchChange=${()=>{this._useLayerFeaturesEnabledChanged()}}></calcite-switch></div><div class=${`${e} padding-top-1`}><map-layer-picker .enabledLayerIds=${this.selectionLayerIds} .mapView=${this.mapView} @layerSelectionChange=${t=>{this._layerSelectionChange(t)}} .selectedIds=${this.layerViews.map(t=>t.layer.id)}></map-layer-picker></div></div>`}_getNumSelected(){let e=this._translations._lang==="en"?`${this._translations.selectionLoading}...`:this._translations.selectionLoading;return o`<div class="padding-top-1 padding-bottom-1" style=${v({"align-items":"end",display:"flex"})}>${this._selectionLoading?o`<div><calcite-loader class="info-blue padding-end-1-2" inline .label=${e||""} scale=m type=indeterminate></calcite-loader></div>`:o`<calcite-icon class="info-blue padding-end-1-2" icon=feature-layer scale=s></calcite-icon>`}<calcite-input-message class="info-blue" scale=m>${this._selectionLoading?e:this.noResultText&&this._numSelected===0?this.noResultText:this._translations.selectedFeatures.replace("{{n}}",this._numSelected.toString())}</calcite-input-message></div>`}_getNameInput(){let e=this.customLabelEnabled?"":"display-none";return o`<div class=${`padding-sides-1 padding-top-1 ${e}`}><calcite-label class=${p(this.headerLabelClass)}>${this._translations.listName}<calcite-input @input=${()=>{this._selectionLabel=this._labelName.value?this._labelName.value.value:""}} .placeholder=${this._translations.listNamePlaceholder} .value=${this._selectionLabel||""} ${u(this._labelName)}></calcite-input></calcite-label></div>`}_getMapLayerPicker(){let e=this.selectionSet?.layerView?.layer.id;return o`<div class="display-flex padding-sides-1 padding-bottom-1"><calcite-label class=${`${this.headerLabelClass} width-full label-margin-0`}>${this._translations.inputLayer}<map-layer-picker .enabledLayerIds=${this.enabledLayerIds} .mapView=${this.mapView} @layerSelectionChange=${t=>{this._inputLayerSelectionChange(t)}} .selectedIds=${this.selectLayerView?[this.selectLayerView.layer.id]:this.selectionSet&&e!==void 0?[e]:[]}></map-layer-picker></calcite-label></div>`}async _init(){this._initGraphicsLayer(),await this._initSelectionSet(),await this._initSearchWidget()}async _initSelectionSet(){this.selectionSet&&(this._searchTerm=this.selectionSet.searchResult?.name,this._searchResult=this.selectionSet.searchResult,this._selectedIds=this.selectionSet.selectedIds,this._skipGeomOIDs=this.selectionSet.skipGeomOIDs||[],this.searchDistanceEnabled=this.selectionSet.searchDistanceEnabled,this.useLayerFeaturesEnabled=this.selectionSet.useLayerFeaturesEnabled,this._distance=this.selectionSet.searchDistanceEnabled?this.selectionSet.distance:0,this._unit=this.selectionSet.unit,this._workflowType=this.selectionSet.workflowType,this.selectLayerView=this.selectionSet.layerView,this._sketchGraphic=this.selectionSet.sketchGraphic,this.geometries=[...this.selectionSet?.geometries||[]],this._graphics=this.geometries.reduce((e,t)=>{let s=t.type==="point"?this.sketchPointSymbol:t.type==="polyline"?this.sketchLineSymbol:this.sketchPolygonSymbol;return e.push(new D({geometry:t,symbol:s})),e},[]),this._selectionLabel=this.selectionSet?.label,this.useLayerFeaturesEnabled||await this._drawTools.value?.updateGraphics(),this.selectionSet.layerView&&this.mapView&&await O(this.selectionSet.selectedIds,this.selectionSet.layerView,this.mapView,!1))}async _initSearchWidget(){if(this.mapView&&this._searchElement.value){let e=this.searchConfiguration&&this._getSearchConfig(this.searchConfiguration,this.mapView),t={view:this.mapView,container:this._searchElement.value,searchTerm:this._searchTerm,...e};this._searchWidget?(this._searchWidget.view=this.mapView,this._searchWidget.searchTerm=this._searchTerm):this._searchWidget=new R(t),this._searchWidget&&(this._searchWidget.popupEnabled=!1,this._searchWidget.resultGraphicEnabled=!1,this._searchWidget.viewModel.addHandles(this._searchWidget.on("search-clear",()=>{let s=this._searchClearLabel();this._searchResult?.name&&this._clearResults(!1,s)})),this._searchWidget.viewModel.addHandles(this._searchWidget.on("select-result",s=>{this._selectResult(s.result)})),await this._searchWidget.when(()=>{this._searchWidget&&(this._searchWidget.allPlaceholder=this.searchConfiguration?.allPlaceholder&&this.searchConfiguration.allPlaceholder.toLowerCase()!=="find address or place"?this.searchConfiguration.allPlaceholder:this._translations.placeholder)}))}}async _selectResult(e){if(e){this._searchResult=e;let t=e.feature,s=t?.layer,i=this.selectLayerView?.layer,a=Number(t?.getObjectId()),l;s?.sourceJSON?.isView&&s.url&&(l=await this._getViewSourceUrl(s.url));let r;i?.sourceJSON?.isView&&i.url&&(r=await this._getViewSourceUrl(i.url));let c=s?.url?.toLowerCase(),n=l?.toLowerCase(),h=i?.url?.toLowerCase(),y=r?.toLowerCase(),g=c&&h&&(c===h||c===y||n===h||n===y)&&!Number.isNaN(a),F=g?[a]:void 0;this._workflowType="SEARCH",this._updateLabel();let f=[e.feature];this._updateSelection(f,g,F),this._drawTools.value&&(this._drawTools.value.graphics=f),this._searchWidget?.resultGraphic&&(this._searchWidget.resultGraphic.visible=!1)}else{let t=this._searchClearLabel();this._clearResults(!1,t)}}async _getViewSourceUrl(e){let t="",s=`${e}/sources?f=json`;try{let i=await x(s,{query:{f:"json"}});i?.data?.services?.length===1&&(t=i.data.services[0].url)}catch(i){console.log(i)}return t}_searchClearLabel(){return this._searchResult?.name&&this._labelName.value&&this._labelName.value.value.indexOf(this._searchResult.name)>-1}_getSearchConfig(e,t){let s=e?.sources;return s&&s?.length>0?(e={...e,includeDefaultSources:!1},s.forEach(i=>{if(i.hasOwnProperty("layer")){let a=i,l=a.layer?.id,r=l?t.map?.findLayerById(l):null,c=a?.layer?.url;r&&a?a.layer=r:c&&(a.layer=new N(c))}}),s?.forEach(i=>{if(i.hasOwnProperty("locator")){let a=i;if(a?.name==="ArcGIS World Geocoding Service"){let l=a.outFields||["Addr_type","Match_addr","StAddr","City"];a.outFields=l,a.singleLineFieldName="SingleLine"}a.url=a.url,delete a.url}})):e={...e,includeDefaultSources:!0},e}_initGraphicsLayer(){let e=this._pnContextConsumer.value,t=this._translations.bufferLayer;if(this.mapView){let s=this.mapView.map.layers.findIndex(i=>i.title===t);if(s>-1)this._bufferGraphicsLayer=this.mapView.map.layers.getItemAt(s);else if(this._bufferGraphicsLayer=new W({title:t,listMode:"hide"}),this._bufferGraphicsLayer){e.managedLayers[t]="buffer";let i=this.mapView.map.layers.findIndex(a=>a.title===this._translations.sketchLayer);i>-1?this.mapView.map.layers.add(this._bufferGraphicsLayer,i):this.mapView.map.layers.add(this._bufferGraphicsLayer)}}}async _sketchGraphicsChanged(e,t=!1){let s=e.detail.graphics;if(s.length>0&&s[0])if(t||(this._sketchGraphic=s[0]),this._workflowType=this.useLayerFeaturesEnabled?"SELECT":"SKETCH",this._workflowType==="SKETCH"&&this._drawTools.value&&await this._drawTools.value.updateGraphics(),await this._updateLabel(),this._clearSearchWidget(),this.useLayerFeaturesEnabled&&!t){let i=Array.isArray(s)?s.map(a=>a.geometry):this.geometries;await this._selectLayerFeatures(i[0])}else{let i=s.reduce((l,r)=>(r?.layer?.objectIdField?l.push(Number(r.attributes[r.layer.objectIdField])):r.getObjectId&&l.push(Number(r.getObjectId())),l),[]),a=e.detail.useOIDs&&i.length>0;this._updateSelection(s,a,i),a&&await this._highlightFeatures(i)}else await this._clearResults(!0,!0)}async _highlightWithOIDsOrGeoms(){return this._skipGeomOIDs&&this._skipGeomOIDs?.length>0?(this._selectedIds=this._skipGeomOIDs,this._highlightFeatures(this._selectedIds)):this._geomQuery(this.geometries)}async _highlightFeatures(e){let t=this._pnContextConsumer.value;if(t.removeHandles(),e.length>0&&this.selectLayerView&&this.mapView){let s=await I(e,this.selectLayerView,this.mapView);t.highlightHandles.push(s)}this._numSelected=e.length,this.selectionSetChange.emit(e.length)}async _selectFeatures(e){this._selectionLoading=!0,this._selectedIds=this.selectLayerView&&await $(e,this.selectLayerView.layer)||[],this._selectionLoading=!1,this._drawTools.value&&(this._drawTools.value.graphics=this._graphics),await this._highlightFeatures(this._selectedIds)}async _bufferComplete(e){this._bufferGeometry=Array.isArray(e.detail)?e.detail[0]:e.detail;let t=this._bufferTools.value&&Number(this._bufferTools.value.distance),s=0;if(this._bufferGeometry){let i={type:"simple-fill",color:this.bufferColor,outline:{color:this.bufferOutlineColor,width:1}},a=new D({geometry:this._bufferGeometry,symbol:i});this._bufferGraphicsLayer&&a&&this.mapView&&(this._bufferGraphicsLayer.removeAll(),this._bufferGraphicsLayer.add(a),await this._selectFeatures([this._bufferGeometry]),a.geometry?.extent&&await this.mapView.goTo(a.geometry.extent)),s=t,t=0}else this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),await this._highlightWithOIDsOrGeoms();await this._distanceChanged({oldValue:t,newValue:s})}_geomQuery(e){let t=T(e);return t?this._selectFeatures(t):Promise.resolve()}async _clearResults(e=!0,t=!1){this._selectedIds=[],this._distance=void 0,this._unit=void 0,t&&(this._selectionLabel="",this._labelName.value&&(this._labelName.value.value="")),this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),e&&this._searchWidget&&this._clearSearchWidget(),this._pnContextConsumer.value.removeHandles(),this._drawTools.value?.clear&&(this._graphics=[],await this._drawTools.value.clear()),this._numSelected=this._selectedIds.length,this.selectionSetChange.emit(this._numSelected)}_clearSearchWidget(){this._searchWidget?.clear(),this._searchResult=void 0}_updateSelection(e,t,s){this._selectedIds=t&&s?s:this._selectedIds,this._skipGeomOIDs=t?s:void 0,this.geometries=Array.isArray(e)?e.reduce((i,a)=>(a.geometry&&i.push(a.geometry),i),[]):this.geometries,this._graphics=e}async _updateLabel(){if(this.enableSearchDistance){let e=this._translations.sketch&&this._selectionLabel.indexOf(this._translations.sketch)>-1,t=this._translations.select&&this._selectionLabel.indexOf(this._translations.select)>-1,s=this._selectionLabel.indexOf(this._searchResult?.name)>-1,i=this._workflowType==="SEARCH"?this._searchResult?.name:this._workflowType==="SELECT"?this._translations.select:this._translations.sketch,a=this._bufferTools.value?this._bufferTools.value.unit:this._unit,l=this._bufferTools.value&&a&&await this._bufferTools.value.getTranslatedUnit(a),r=Number.isNaN(Number(this._distance))&&this._bufferTools.value?this._bufferTools.value.distance:this._distance;this._selectionLabel=e||t||s||!this._selectionLabel?`${i} ${r} ${l}`:this._selectionLabel,this._labelName.value&&(this._labelName.value.value=this._selectionLabel)}}async _layerSelectionChange(e){if(Array.isArray(e.detail)&&e.detail.length>0){let t=e.detail.reduce((s,i)=>(this.mapView&&s.push(_(this.mapView,i)),s),[]);return Promise.all(t).then(s=>{this.layerViews=s.reduce((i,a)=>(a&&i.push(a),i),[]),this._featuresCollection={},this._sketchGraphic&&this._sketchGraphicsChanged({detail:{graphics:[this._sketchGraphic],useOIDs:!1}})})}}async _inputLayerSelectionChange(e){let t=e?.detail?.length>0?e.detail[0]:"";(!this.selectLayerView||t!==this.selectLayerView.layer.id)&&(this.selectLayerView=this.mapView&&await _(this.mapView,t),await this._updateLabel(),this._bufferGeometry?await this._selectFeatures([this._bufferGeometry]):await this._highlightWithOIDsOrGeoms())}async _distanceChanged(e){e.newValue!==e.oldValue&&(this._distance=e.newValue,await this._updateLabel())}async _selectLayerFeatures(e){this._selectionLoading=!0;let t=this.layerViews.map(s=>(this._featuresCollection[s.layer.id]=[],G(0,s.layer,e,this._featuresCollection)));return Promise.all(t).then(async s=>{this._selectionLoading=!1;let i=[];s.forEach(n=>{Object.keys(n).forEach(h=>{i=i.concat(n[h])})});let a=!1;i.forEach(n=>{let h=n.geometry;n.symbol=h&&h.type==="point"?this.sketchPointSymbol:h&&h.type==="polyline"?this.sketchLineSymbol:h&&h.type==="polygon"?this.sketchPolygonSymbol:void 0,a=n?.layer?.hasOwnProperty("objectIdField")||n.hasOwnProperty("getObjectId")});let l=this.layerViews[0].layer,r=this.selectLayerView?.layer,c=a&&l.url===r?.url&&r?.layerId===l.layerId;await this._sketchGraphicsChanged({detail:{graphics:i,useOIDs:c}},!0)})}_useLayerFeaturesEnabledChanged(){this.useLayerFeaturesEnabled=!this.useLayerFeaturesEnabled,this._sketchGraphic&&this._sketchGraphicsChanged({detail:{graphics:[this._sketchGraphic],useOIDs:!1}})}};C("map-select-tools",m);return m},"request","layers/FeatureLayer","Graphic","layers/GraphicsLayer","widgets/Search",a,c)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import e from"./KDIUYXBA.js";import b from"./UUYUTETH.js";import{a as u}from"./
|
|
2
|
+
import e from"./KDIUYXBA.js";import b from"./UUYUTETH.js";import{a as u}from"./DV233ITZ.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import{b as p}from"./EIQZRLWQ.js";import{F as c,G as h,H as d,h as l,i as a,r as i,u as n}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([{b:m},{d:b}])=>{var f=l`@layer{:host{display:block!important}.display-none{display:none}.padding-1{padding:1rem}.position-relative{position:relative}.overflow-auto{overflow:auto}.height-full{height:100%}.position-static{position:static!important}.z-index-500{z-index:500!important}card-manager{display:block}}`,r=class extends d{constructor(){super(),this.customInfoText="",this.enableEditGeometry=!1,this.enableSnapping=!1,this.isMobile=!1,this.zoomAndScrollToSelected=!1,this.selectedFeaturesIds=[],this.enableCreateFeatures=!0,this.createBtnLabel="",this.selectingFeatureFromMap=!1,this.showSketchWidgets=!1,this._cardLoading=!1,this._graphics=[],this._showCreateFeatureComponent=!1,this._showSubmitBtn=!1,this._translations=u({name:"card-manager",blocking:!0}),this._isFeatureCreated=!1,this._createFeature=c(),this.createWorkFlowStarted=i(),this.backFromCreateWorkFlow=i(),this.featureOrRecordSubmitted=i(),this.listenOn(window,"featureSelectionChange",this.featureSelectionChange),this.listenOn(window,"layerSelectionChange",this.layerSelectionChange),this.listenOn(window,"relatedRecordToggled",this.relatedRecordToggled)}static{this.properties={customInfoText:1,enableEditGeometry:5,enableSnapping:5,isMobile:5,layerOrTable:0,mapView:0,zoomAndScrollToSelected:5,selectedFeaturesIds:0,enableCreateFeatures:5,createBtnLabel:1,selectingFeatureFromMap:5,showSketchWidgets:5,_cardLoading:16,_graphics:16,_showCreateFeatureComponent:16,_showSubmitBtn:16,_translations:16}}static{this.styles=f}static{this.shadowRootOptions=n}async featureSelectionChange(e){this._showCreateFeatureComponent&&!this._isFeatureCreated&&this._backFromCreateFeature();let t=e.detail;this._graphics=await this._getFeaturesByIds(t)}async layerSelectionChange(e){this._showCreateFeatureComponent&&this._backFromCreateFeature();let t=e.detail[0];this.layerOrTable=this.mapView?await b(this.mapView,t):void 0}async relatedRecordToggled(e){let t=e.detail;this.layerOrTable=t}async load(){this.selectedFeaturesIds?.length>0&&(this._graphics=await this._getFeaturesByIds(this.selectedFeaturesIds))}render(){let e=this._graphics?.length>0?"":"display-none",t=this._graphics?.length===0&&this._showCreateFeatureComponent?"":"display-none",s=this._graphics?.length>0||this._showCreateFeatureComponent?"display-none":"",g=this.layerOrTable?.isTable,F=this.customInfoText?this.customInfoText:this.selectingFeatureFromMap?this._translations.selectFeaturesFromMapToStart:this._translations.selectFeaturesToStart,w=this.enableCreateFeatures&&this.layerOrTable?.capabilities?.operations?.supportsAdd,o=this.createBtnLabel?this.createBtnLabel:g?this._translations.createRecord:this._translations.createFeature,_=!this.layerOrTable,C=this.enableSnapping&&!this.layerOrTable?.isTable;return a`<div class="overflow-auto height-full"><calcite-shell class=${`position-relative ${e}`}><div class="position-static z-index-500 height-full"><info-card .allowEditing=${this.layerOrTable?.editingEnabled} .enableEditGeometry=${this.enableEditGeometry} .enableSnapping=${C} .graphics=${this._graphics} .isLoading=${this._cardLoading} .isMobile=${this.isMobile} .mapView=${this.mapView} position=relative show-close-btn></info-card></div></calcite-shell><calcite-shell class=${`position-relative ${s}`}><calcite-panel><div class=padding-1><calcite-notice .icon=${this.selectingFeatureFromMap?"map":"table"} icon-flip-rtl open><div slot=message>${F}</div></calcite-notice></div>${!this.isMobile&&w&&a`<calcite-button .disabled=${_} @click=${()=>this._createFeatureBtnClicked()} slot=footer width=full>${o}</calcite-button>`||""}</calcite-panel></calcite-shell><calcite-shell class=${`position-relative ${t}`}><calcite-flow-item selected><calcite-panel .heading=${o}><calcite-action appearance=solid class="back-button hydrated" icon=chevron-left @click=${this._backFromCreateFeature} scale=s slot=header-actions-start text></calcite-action>${this.getEditorComponent()}${this._showSubmitBtn&&a`<calcite-button appearance=solid class="footer-top-button footer-button" @click=${()=>this._createFeature.value&&void this._createFeature.value.submit()} slot=footer width=full>${this._translations.create}</calcite-button>`||""}</calcite-panel></calcite-flow-item></calcite-shell></div>`}getEditorComponent(){let e=this.enableSnapping&&!this.layerOrTable?.isTable&&this.enableCreateFeatures;return a`<div>${this._showCreateFeatureComponent&&a`<create-feature customize-submit .enableSnapping=${e} .mapView=${this.mapView} .isMobile=${this.isMobile} @drawComplete=${()=>{this._showSubmitBtn=!0}} @editingAttachment=${t=>{this._showSubmitBtn=!t.detail}} @progressStatus=${()=>{setTimeout(()=>{this._isFeatureCreated=!1},2e3)}} @success=${this._featureCreated} .showSketchWidgets=${this.showSketchWidgets} .selectedLayerId=${this.layerOrTable?.id} .showLayerVisibilityMsg=${this.layerOrTable?.visible===!1} ${h(this._createFeature)}></create-feature>`||""}</div>`}async _getFeaturesByIds(e){return(e.length>0&&this.layerOrTable&&this.mapView?await m(e,this.layerOrTable,[],!0,this.mapView?.spatialReference):[]).sort((t,s)=>e.indexOf(Number(t.getObjectId()))-e.indexOf(Number(s.getObjectId())))}_createFeatureBtnClicked(){this._showCreateFeatureComponent=!0,this.createWorkFlowStarted.emit()}async _backFromCreateFeature(){this._createFeature.value&&(this._showCreateFeatureComponent=!1,this.backFromCreateWorkFlow.emit()),this._showSubmitBtn=!1}_featureCreated(){this._showCreateFeatureComponent=!1,this._showSubmitBtn=!1,this._isFeatureCreated=!0,this.featureOrRecordSubmitted.emit(),setTimeout(()=>{this._showCreateFeatureComponent=!0},50)}};p("card-manager",r);return r},b,e)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import b from"./
|
|
2
|
+
import b from"./MP5X6HGT.js";import a from"./5QSIKX2L.js";import"./PZ4L77M5.js";import"./JE7L7M3J.js";import"./DV233ITZ.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import"./AOBFPJ2R.js";import"./JK6XUSIM.js";import"./UPHYUDLT.js";import"./QJJXVRMV.js";import"./7FMLZNDR.js";import"./LL5C4DHP.js";import"./WPAMUSBR.js";import"./XJPOVJV7.js";import"./LDNQ56OK.js";import"./3HUY3T5F.js";import"./Z6G5PBUQ.js";import"./J3QMHA2M.js";import"./TKZAMPEI.js";import"./2IHQU2FX.js";import"./CGLFPVBM.js";import"./OEJAW72H.js";import"./5JJMGPOW.js";import"./TYX345MZ.js";import"./5UWT66A7.js";import"./EIQZRLWQ.js";import"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([,a])=>{return a},a,b)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import b from"./KDIUYXBA.js";import a from"./UUYUTETH.js";import{a as m}from"./
|
|
2
|
+
import b from"./KDIUYXBA.js";import a from"./UUYUTETH.js";import{a as m}from"./DV233ITZ.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import{b as _}from"./EIQZRLWQ.js";import{F as p,G as c,H as g,J as h,h as d,i as r,r as s,u as l}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([f,a,,{e:w}])=>{var v=d`@layer{:host{display:block}#feature-form{padding-top:0}.esri-editor__prompt--danger{position:relative!important;width:100%!important;background-color:var(--calcite-color-foreground-1)!important}.esri-feature__content-node{background-color:var(--calcite-color-foreground-1)!important}.hide-editor-toolbar .esri-editor__panel-toolbar{display:none!important}.position-absolute{position:absolute;inset:0;overflow:auto}.esri-editor__panel-content{padding-block:10px!important}}`,n=class extends g{constructor(){super(),this.enableEditGeometry=!1,this.enableSnapping=!1,this.graphicIndex=0,this.graphics=[],this.open=!1,this.allowMultipleEditing=!1,this._editorLoading=!1,this._translations=m({name:"edit-card",blocking:!0}),this._editContainer=p(),this._shouldClose=!1,this._shouldEmitEditsComplete=!1,this.closeEdit=s(),this.editorInitialized=s(),this.editsComplete=s(),this.refreshGraphics=s(),this.creatingFeature=s(),this.listenOn(window,"featureSelectionChange",this.featureSelectionChange),this.listenOn(window,"mapChanged",this.mapChanged)}static{this.properties={enableEditGeometry:5,enableSnapping:5,graphicIndex:9,graphics:0,mapView:0,open:5,allowMultipleEditing:5,_editorLoading:16,_translations:16}}static{this.styles=v}static{this.shadowRootOptions=l}async graphicsWatchHandler(){this.graphics.length===0&&this.open&&await this._closeEdit(!0)}async openWatchHandler(t){t&&this.graphics?.length>0&&this.graphicIndex>-1&&(this._editorLoading=!0,await this._initEditorWidget(),this.graphicIndex>-1&&this.graphics.length>0&&this.open&&!this._shouldClose&&await this._startUpdate(),this._editorLoading=!1),t||await this._closeEdit(!0)}async featureSelectionChange(){this.open&&await this._closeEdit(!1)}async mapChanged(){this.open&&await this._closeEdit(!1)}willUpdate(t){if(t.has("graphics")&&this.graphicsWatchHandler(),t.has("open")&&(this.hasUpdated||this.open!==!1)&&this.openWatchHandler(this.open),this.graphics?.length>0&&this.graphics[0]?.layer){this._layer=this.graphics[0].layer,this._layerEditHandle&&this._layerEditHandle.remove();let e=this._layer.type==="subtype-sublayer"?this._layer.parent:this._layer;e&&(this._layerEditHandle=e.on("edits",()=>{this._shouldEmitEditsComplete=!0}))}}render(){let t=this.graphics?.length>0&&this.graphics[0]?!this.graphics[0].layer.editingEnabled:!0,e=this._editorLoading?"display-none":"position-absolute",o=this._editorLoading?"":"display-none";return r`<div class="position-absolute">${t?r`<calcite-notice kind=warning open slot=content-top width=full><div slot=message>${this._translations.enableEditing}</div></calcite-notice>`:void 0}<div class="position-absolute"><div class=${h(e)} id=feature-form ${c(this._editContainer)}></div><calcite-loader class=${h(o)} label scale=s></calcite-loader></div></div>`}async _initEditorWidget(){if(this.mapView&&this.graphics&&this.graphics.length>0&&this.graphics[0]){this._editor&&this._editor.destroy();let t=document.createElement("div"),e=await w(this.mapView),o=this.enableSnapping&&this.enableEditGeometry,u=e.map(i=>({layer:i,geometryUpdatesEnabled:this.enableEditGeometry}));this._editor=new f({view:this.mapView,layerInfos:u,visibleElements:{flow:!0,settingsMenu:o,sketch:!1,snappingControls:o},container:t}),this._attachmentHandle&&this._activeWorkflowHandle&&(this._attachmentHandle.remove(),this._activeWorkflowHandle.remove()),this._attachmentHandle=a.when(()=>this._editor?.viewModel.state==="adding-attachment"||this._editor?.viewModel.state==="editing-attachment"||this._editor?.viewModel.state==="creating-features",()=>{this._shouldClose=!1}),this._activeWorkflowHandle=a.watch(()=>this._editor?.viewModel.activeWorkflow,i=>{(i?.type==="update"||i?.type==="create-features")&&(this._shouldClose=!1),(!i?.type&&!i?.hasPendingEdits&&!this._editor?.activeWorkflow||!this._editor?.activeWorkflow?.started)&&(this.allowMultipleEditing=!1,this.open=!1)}),a.watch(()=>this._editor?.viewModel.state,i=>{i==="creating-features"&&this.graphics[0].layer.isTable&&!(this._editor?.viewModel).featureTemplatesLayers.items[0].isTable&&this.creatingFeature.emit(),this._shouldEmitEditsComplete&&i==="ready"&&!this._editor?.activeWorkflow&&(this.editsComplete.emit(),this._shouldEmitEditsComplete=!1)}),this.enableSnapping||t.classList.add("hide-editor-toolbar"),this._editContainer.value&&this._editContainer.value.appendChild(t),this._editor&&this.editorInitialized.emit(this._editor)}}async _closeEdit(t){this._shouldClose=!0,t&&this._editor?.activeWorkflow?(this._editor.activeWorkflow?.activeWorkflow?.hasPendingEdits&&(await this._editor.activeWorkflow.reset(),await this._editor.cancelWorkflow()),this._editor.destroy()):this.graphicIndex>-1&&this.graphics?.length>0&&this.refreshGraphics.emit(this.graphics),this.enableSnapping&&((this.mapView?.ui.view).grid=null),this._shouldClose=!1,this.closeEdit.emit()}async _startUpdate(){this.allowMultipleEditing?await this._editor?.startUpdateFeaturesWorkflow(this.graphics):await this._editor?.startUpdateWorkflowAtFeatureEdit(this.graphics[this.graphicIndex]),this._shouldClose=!0}};_("edit-card",n);return n},"widgets/Editor","core/reactiveUtils",a,b)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import a from"./
|
|
2
|
+
import a from"./5QSIKX2L.js";import{b as m}from"./PZ4L77M5.js";import{a as g}from"./DV233ITZ.js";import{b as p}from"./EIQZRLWQ.js";import{F as l,G as d,H as h,L as s,h as c,i}from"./46DQNAMV.js";export default $arcgis.t(([,,,{b:u,t:f,z:r}])=>{var b=c`*[tabindex]:focus-visible{outline:solid 2px var(--calcite-color-brand);outline-offset:2px}.display-flex{display:flex}.align-items-center{align-items:center}.justify-content-center{justify-content:center}.screenshot-container{width:100%;overflow:hidden}.footer{width:100%}.footer-override{--calcite-dialog-footer-space: 0px}.footer-card{width:200px;height:100px;cursor:pointer;padding-bottom:2px}.padding-1{padding:1rem}.padding-bottom-1{padding-bottom:1rem}.padding-end-1{padding-inline-end:1rem}.padding-start-1{padding-inline-start:1rem}.padding-top-1{padding-top:1rem}.padding-top-1-2{padding-top:.5rem}.background-black{background-color:var(--calcite-color-foreground-3)}calcite-card:hover img{-webkit-filter:brightness(30%);filter:brightness(30%);-webkit-transition:all .1s ease;-moz-transition:all .1s ease;-o-transition:all .1s ease;-ms-transition:all .1s ease;transition:all .1s ease}calcite-card:hover{outline:2px solid var(--calcite-color-brand);box-sizing:border-box;cursor:pointer}.calcite-card-selected{outline:2px solid var(--calcite-color-brand);box-sizing:border-box;cursor:pointer}calcite-card:hover .hover-text{opacity:1;color:#fff}.hover-text{transition:.1s ease;opacity:0;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);text-align:center;display:flex;flex-direction:row;align-items:center;height:100%;font-size:var(--calcite-spacing-lg)}.card-image-wrap{width:100%;position:relative;margin-bottom:0;-webkit-box-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto}.footer-card img{background-color:var(--calcite-color-surface-2)}.card-image{width:100%;display:block}video,img{max-width:100%;height:auto}img{overflow-clip-margin:content-box;overflow:clip;display:block;object-fit:contain}`,n=class extends h{constructor(){super(...arguments),this.open=!1,this._screenshots=[],this._translations=g({name:"solution-snapshot-gallery",blocking:!0}),this._configContextConsumer=m({context:u,subscribe:!0}),this._displayText="",this._paginationControl=l(),this._screenshotNames=[]}static{this.properties={card:0,screenshot:0,itemProperties:0,open:5,_screenshots:16,_translations:16}}static{this.styles=b}willUpdate(t){t.has("screenshot")&&this.screenshot&&(this._displayText=this.screenshot.description||this.screenshot.alt),t.has("itemProperties")&&this.itemProperties&&(this._screenshots=this.itemProperties.preview.filter(e=>e.format==="image"),this._screenshotNames=this._screenshots.map(e=>e.name))}render(){return i`<calcite-dialog class="footer-override" .heading=${this.card?.title} modal @calciteDialogClose=${()=>this.open=!1} .open=${this.open} outside-close-disabled width=l>${this._getScreenshotView()}${this._getFooter()}</calcite-dialog>`}_getScreenshotView(){return this.screenshot?i`<div class="display-flex justify-content-center screenshot-container">${this._getImage(this.screenshot)}</div>`:""}_getFooter(){let t=this._screenshotNames.indexOf(this.screenshot?.name||""),e=document.body.classList.contains("calcite-mode-dark")?"calcite-mode-dark":"";return i`<div class="footer" slot=footer><div class=${`display-flex align-items-center padding-start-1 padding-top-1-2 background-black ${e}`}><calcite-label layout=inline><calcite-pagination class="padding-end-1" @calcitePaginationChange=${this._changeScreenshot} page-size=1 start-item=${t+1} total-items=${this._screenshots.length??s} ${d(this._paginationControl)}></calcite-pagination><span tabindex=0>${this._displayText}</span></calcite-label></div>${this._getCards()}</div>`}_changeScreenshot(){this.screenshot=this._screenshots[this._paginationControl.value.startItem-1]}_getCards(){return i`<calcite-card-group class="card-group padding-1" .label=${this._translations.seeSolutionScreenshots} selection-mode=single>${this._screenshots.map(t=>{let e=t.name===this.screenshot?.name;return i`<calcite-card class=${`footer-card ${e?"calcite-card-selected":""}`} .label=${t.alt} @click=${()=>this._showScreenshot(t)} @keydown=${o=>f(o,()=>this._showScreenshot(t))} .selected=${e}><div class="card-image-wrap" slot=thumbnail>${this._getImage(t,"thumbnail")}<div class="hover-text">${this._translations.viewScreenshot}</div></div></calcite-card>`})}</calcite-card-group>`}_getImage(t,e){return i`<img alt=${t.alt??s} slot=${e??s} src=${this._getSource(this._configContextConsumer.value.authentication,this.card?.id||"",t.name)??s}>`}_showScreenshot(t){this.screenshot=t}_getSource(t,e,o){let a=this._configContextConsumer.value;return a.agoBasedEnterpriseSolutionsGroupId&&a.isEnterprise?r(e||"",o,void 0,a.agolPortalUrl):t?r(e||"",o,t):""}};p("solution-snapshot-gallery",n);return n},"identity/IdentityManager","identity/OAuthInfo","portal/Portal",a)
|