@esri/solutions-components 5.0.6 → 5.0.7
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/{GARIVREH.js → 22U34PQB.js} +1 -1
- package/dist/cdn/{NGJIRF7M.js → 3RZXRWAP.js} +1 -1
- package/dist/cdn/{2DPJZTGZ.js → 3YFIPADZ.js} +1 -1
- package/dist/cdn/{3UZ6LMZQ.js → 43CYPIMQ.js} +1 -1
- package/dist/cdn/{T3XWY77W.js → 43IA3DL4.js} +1 -1
- package/dist/cdn/{N2WO3YVL.js → 4EPDGSS3.js} +1 -1
- package/dist/cdn/{LWBJ45OR.js → 4MCRCBXP.js} +1 -1
- package/dist/cdn/{CBXXTXHF.js → 4S6JHZXI.js} +1 -1
- package/dist/cdn/{52LTQZ5L.js → 5D5V3CBT.js} +1 -1
- package/dist/cdn/{NHPGVRRO.js → 5KFPWHQK.js} +1 -1
- package/dist/cdn/{NC6JL2EV.js → 5U76VYOV.js} +1 -1
- package/dist/cdn/{AOU46BFO.js → 5Z4JZB7T.js} +1 -1
- package/dist/cdn/{7UQHQGGR.js → 675G5KQQ.js} +1 -1
- package/dist/cdn/{D3Q2BMGC.js → 6ERK6VPZ.js} +1 -1
- package/dist/cdn/{YQSES45Q.js → 6XUVGEDV.js} +1 -1
- package/dist/cdn/{QKSAGMHC.js → 73QBDSXH.js} +1 -1
- package/dist/cdn/{N2JDDZHC.js → 74ZSZVS6.js} +1 -1
- package/dist/cdn/{5KUZRJBN.js → 7JYPKH72.js} +2 -2
- package/dist/cdn/{KS76NDW7.js → 7REPJ4XS.js} +1 -1
- package/dist/cdn/{UYIFEFZO.js → 7ZBCFESJ.js} +1 -1
- package/dist/cdn/{VMF3426Z.js → A26I5EAX.js} +1 -1
- package/dist/cdn/B2DK4LWH.js +2 -0
- package/dist/cdn/{LIARPICS.js → BNNZ2ZGX.js} +1 -1
- package/dist/cdn/{UZTK5BFT.js → BRG4WNOI.js} +1 -1
- package/dist/cdn/{BXXSHO4P.js → C3QDGTJR.js} +1 -1
- package/dist/cdn/{UIJUUMOH.js → CEYUKUGR.js} +1 -1
- package/dist/cdn/DKFXHHUI.js +2 -0
- package/dist/cdn/{OOSW7Q2C.js → DTI2O2YX.js} +1 -1
- package/dist/cdn/{ALXBMM22.js → EBQJE5IR.js} +1 -1
- package/dist/cdn/EEGVKRAE.js +2 -0
- package/dist/cdn/{4E2QV2RF.js → ENQQNV7P.js} +1 -1
- package/dist/cdn/{L6L2P3QS.js → ERCXFIQA.js} +1 -1
- package/dist/cdn/{KT2ORA3Q.js → EYM3QUBY.js} +1 -1
- package/dist/cdn/{JHAGL5UZ.js → FJ6NF35F.js} +1 -1
- package/dist/cdn/{IEY5UTNT.js → G7HBG2UF.js} +1 -1
- package/dist/cdn/{4KYIM4XN.js → HNRSOVZ3.js} +1 -1
- package/dist/cdn/{Z73DPA3J.js → HYX7BODW.js} +1 -1
- package/dist/cdn/{QD2Q6HPQ.js → ICP6A2TW.js} +1 -1
- package/dist/cdn/{6HDTGG3L.js → IRTMH4CU.js} +1 -1
- package/dist/cdn/{MS6GCUUL.js → JAP5VDRT.js} +1 -1
- package/dist/cdn/{654SAJ5M.js → JVBVZ7SO.js} +1 -1
- package/dist/cdn/{DXYCRHKW.js → KMVYKYBM.js} +1 -1
- package/dist/cdn/{3GLO7PZY.js → KZHT2SRK.js} +1 -1
- package/dist/cdn/{62H3JCSO.js → LFAWVGKM.js} +1 -1
- package/dist/cdn/{X43QJBP2.js → MDAQ5K75.js} +1 -1
- package/dist/cdn/{5J4YGZZD.js → NFXWBAXX.js} +1 -1
- package/dist/cdn/{MJ4LI4IV.js → NG4ZFNHE.js} +1 -1
- package/dist/cdn/{3ZEFAZQJ.js → NPR6G5AX.js} +1 -1
- package/dist/cdn/{5CJ5TY42.js → NWSKMX7S.js} +1 -1
- package/dist/cdn/{OI3ISQWM.js → OM6BG2BU.js} +1 -1
- package/dist/cdn/{I5KQH3I2.js → OX5ZGUUP.js} +1 -1
- package/dist/cdn/{XCS33CLJ.js → PGDVHQVF.js} +1 -1
- package/dist/cdn/{HSSQBD3H.js → PNJZAUGF.js} +1 -1
- package/dist/cdn/{W4AUM6QU.js → PTKWOS3W.js} +1 -1
- package/dist/cdn/{HHBYWWW3.js → QHBHKUDJ.js} +1 -1
- package/dist/cdn/{QPBV4Y7M.js → QJFN3RCP.js} +1 -1
- package/dist/cdn/{3MHFKNRH.js → QLZRRDLM.js} +1 -1
- package/dist/cdn/{RJVZG4T4.js → QMZKZWSS.js} +1 -1
- package/dist/cdn/{CYEOUBT7.js → RBNSS2LC.js} +1 -1
- package/dist/cdn/{EUJEN75Q.js → RJEWER4Y.js} +1 -1
- package/dist/cdn/{AC6MJOAB.js → RJJJCTWH.js} +1 -1
- package/dist/cdn/{L7WRG2G5.js → RVY7I3GY.js} +1 -1
- package/dist/cdn/{KD2OVMZO.js → S2O7THHA.js} +1 -1
- package/dist/cdn/{E3FUDTEG.js → S36FP6V3.js} +1 -1
- package/dist/cdn/{2ZHFKBQO.js → SA6VZSQH.js} +1 -1
- package/dist/cdn/{SRAAWOU6.js → SKRTPLGN.js} +1 -1
- package/dist/cdn/{QP3QUOVI.js → SL4JGIFV.js} +1 -1
- package/dist/cdn/{H7MJ7IGV.js → SZGK2TKC.js} +1 -1
- package/dist/cdn/{BR4TZZCB.js → THFNJ23N.js} +1 -1
- package/dist/cdn/{WCF7EVUQ.js → UHIWQ5QU.js} +1 -1
- package/dist/cdn/{F2JNLC5K.js → UKPIHN6B.js} +1 -1
- package/dist/cdn/{HTXFCOPI.js → UQ7NCQ5J.js} +1 -1
- package/dist/cdn/{OLFZ5ET5.js → UZR3P2OU.js} +1 -1
- package/dist/cdn/{EUODHGXF.js → WFL6AMNM.js} +1 -1
- package/dist/cdn/{PEBFXPSL.js → XBVKGREH.js} +1 -1
- package/dist/cdn/{SEH4C4BM.js → XFYS4DBD.js} +1 -1
- package/dist/cdn/{7WBAW4FI.js → XXUIQTGS.js} +1 -1
- package/dist/cdn/{WJK27OTO.js → Y4ZKMRDR.js} +1 -1
- package/dist/cdn/{XJTGQUMI.js → Y6MSFH7B.js} +1 -1
- package/dist/cdn/{GSTBH4J5.js → YKT6FAYV.js} +1 -1
- package/dist/cdn/{6PZREC7X.js → YTSRCWM5.js} +1 -1
- package/dist/cdn/{V3B323D4.js → ZW6PR32J.js} +1 -1
- package/dist/cdn/{ZSYY5MLI.js → ZWZFY2XW.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/runtime.js +2 -2
- package/dist/components/create-feature/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 +6 -6
- package/package.json +1 -1
- package/dist/cdn/6PZ6PVTG.js +0 -2
- package/dist/cdn/6RFIB2J7.js +0 -2
- package/dist/cdn/7JVIFSRF.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"./Z73DPA3J.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import{b as dn}from"./7JVIFSRF.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"./HYX7BODW.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import{b as dn}from"./B2DK4LWH.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 S}from"./JOQDD4HN.js";import"./JM5FJEHU.js";import d from"./KDIUYXBA.js";import a from"./UUYUTETH.js";import{a as $}from"./Z73DPA3J.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import{b as I}from"./7JVIFSRF.js";import{F as c,G as o,H as F,J as u,h as y,i as l,l as p,r as b,u as L}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([E,V,k,O,{b:v},{a:C,c:m,d:d,e:_,f:f,g:x}])=>{var M=y`@layer{:host{display:block;--calcite-label-margin-bottom: 0px;--solutions-theme-foreground-color: var(--calcite-color-foreground-1)}.width-full{width:100%!important}.height-full{height:100%!important}.notice-msg{padding:10px;width:calc(100% - 20px)}.progress-bar{padding:12px}.footer-top-button{padding-bottom:7px}.footer-button{height:35px}.feature-pagination{background-color:var(--calcite-color-foreground-1)!important;border-block-end:1px solid var(--calcite-color-border-3);display:flex;justify-content:center;padding:5px 0}.pagination-count{color:var(--calcite-color-brand);border-bottom:1px solid var(--calcite-color-brand);font-weight:700}.report-submitted-msg{position:absolute;z-index:1000}.share-node{display:flex}.overflow-auto{overflow:auto}}`,g=class extends F{constructor(){super(),this.center="",this.commentButtonText="",this.commentSubmittedMessage="",this.defaultWebmap="",this.description="",this.enableAnonymousAccess=!1,this.enableAnonymousComments=!1,this.enableComments=!1,this.enableHome=!0,this.enableLogin=!1,this.enableNewReports=!1,this.enableSearch=!0,this.enableSnapping=!1,this.enableZoom=!0,this.isMobile=!1,this.layerExpressions=[],this.layerId="",this.level="",this.loginTitle="",this.mapInfos=[],this.objectId="",this.reportButtonText="",this.reportsHeader="",this.reportSubmittedMessage="",this.showComments=!1,this.showUserImageInCommentsList=!1,this.showFeatureSymbol=!1,this.showMyReportsOnly=!1,this.submitNewReportsMessage="",this.theme="light",this.floorLevel="",this.showFullCommentTitle=!0,this.filterByMapExtent=!1,this.sortOption="newest",this.reportingArea=!1,this.reportingAreaLayer="",this.reportingAreaMessage="",this.enablePhotoLocation=!1,this.aiImageExtraction=[],this._featureCreationFailedErrorMsg="",this._filterActive=!1,this._flowItems=[],this._hasValidLayers=!1,this._reportSubmitted=!1,this._selectedLayerName="",this._showSubmitCancelButton=!1,this._showLoadingIndicator=!1,this._sidePanelCollapsed=!1,this._translations=$({name:"crowdsource-reporter",blocking:!0}),this._updatedProgressBarStatus=25,this._updatedSortOption="newest",this._commentSubmitted=!1,this._addingCommentFailed=!1,this._filterOpen=!1,this._showNextButton=!1,this._submitNextButtonDisabled=!1,this._showFilterIcon=!1,this._createFeature=c(),this._currentFeatureId="",this._editableLayerIds=[],this._featureDetails=c(),this._featureList=c(),this._selectedRelatedFeature=[],this._layerList=c(),this._createRelatedFeature=c(),this._layers=[],this._mapImageryLayersId=[],this._selectedFeature=[],this._selectedFeatureIndex=0,this._selectedLayerId="",this._shareNode=c(),this._urlParamsLoaded=!1,this._validLayers=[],this._nonVisibleValidLayers=[],this._showFullPanel=!1,this._floorExpression="",this._formElements=[],this._prevSelectedLayerId="",this._t9nLayerExpressions=[],this._reportSubmittedAlertNode=c(),this._commentSubmittedAlertNode=c(),this._sortPopoverNode=c(),this.togglePanel=b(),S(window)}static{this.properties={center:1,commentButtonText:1,commentSubmittedMessage:1,defaultWebmap:1,description:1,enableAnonymousAccess:5,enableAnonymousComments:5,enableComments:5,enableHome:5,enableLogin:5,enableNewReports:5,enableSearch:5,enableSnapping:5,enableZoom:5,isMobile:5,layerExpressions:0,layerId:1,level:1,loginTitle:1,mapInfos:0,mapView:0,objectId:1,reportButtonText:1,reportingOptions:0,reportsHeader:1,reportSubmittedMessage:1,searchConfiguration:0,showComments:5,showUserImageInCommentsList:5,showFeatureSymbol:5,showMyReportsOnly:5,submitNewReportsMessage:1,theme:1,zoomToScale:9,floorLevel:1,showFullCommentTitle:5,filterByMapExtent:5,sortOption:1,reportingArea:5,reportingAreaLayer:1,reportingAreaMessage:1,enablePhotoLocation:5,aiImageExtraction:0,_featureCreationFailedErrorMsg:16,_filterActive:16,_flowItems:16,_hasValidLayers:16,_mapInfo:16,_reportSubmitted:16,_selectedLayerName:16,_showSubmitCancelButton:16,_showLoadingIndicator:16,_sidePanelCollapsed:16,_translations:16,_updatedProgressBarStatus:16,_updatedSorting:16,_updatedSortOption:16,_commentSubmitted:16,_addingCommentFailed:16,_filterOpen:16,_showNextButton:16,_submitNextButtonDisabled:16,_showFilterIcon:16}}static{this.styles=M}static{this.shadowRootOptions=L}willUpdate(e){e.has("isMobile")&&this.isMobileWatchHandler(this.isMobile),e.has("mapView")&&this.hasUpdated&&this.mapViewWatchHandler(),e.has("floorLevel")&&this.floorLevelWatchHandler(),(e.has("reportingAreaLayer")||e.has("reportingArea")&&this.hasUpdated)&&setTimeout(()=>{this._createFeature.value&&this._createFeature.value.refresh(this.floorLevel)},50),e.has("showMyReportsOnly")&&(this.hasUpdated||this.showMyReportsOnly!==!1)&&this.showMyReportsOnlyWatchHandler(),e.has("sortOption")&&(this.hasUpdated||this.sortOption!=="newest")&&this.sortOptionWatchHandler(),e.has("filterByMapExtent")&&(this.hasUpdated||this.filterByMapExtent!==!1)&&this.filterByMapExtentChangeWatchHandler(),e.has("layerExpressions")&&(this.hasUpdated||this.layerExpressions?.length>0)&&this.layerExpressionsWatchHandler(),e.has("showFeatureSymbol")&&(this.hasUpdated||this.showFeatureSymbol!==!1)&&this.showFeatureSymbolWatchHandler(),(this._flowItems.includes("filter-panel")||this._filterOpen)&&this._filterList?.updateInitDefExpressions({initDefExpressions:this._initDefExpressions})}async isMobileWatchHandler(e){this.updatePanelState(!1,this._showFullPanel),e&&this._flowItems[this._flowItems.length-1]==="filter-panel"?(await this.backFromFilterPanel(),this._filterOpen=!0):!e&&this._filterOpen&&(await this._closeFilter(),this._flowItems=[...this._flowItems,"filter-panel"])}async mapViewWatchHandler(){await this.mapView?.when(async()=>{this.setInitExpressions(),await this.setMapView()})}async floorLevelWatchHandler(){if(this._editableLayerIds)for(let e of this._editableLayerIds){let t=this.mapView&&await d(this.mapView,e);t&&t.floorInfo?.floorField&&this._updateFloorDefinitionExpression(t)}this._flowItems[this._flowItems.length-1]==="layer-list"&&this._layerList.value&&await this._layerList.value.refresh(),this._featureList.value&&this._featureList.value.refresh(),this._createFeature.value&&this._createFeature.value.refresh(this.floorLevel)}async showMyReportsOnlyWatchHandler(){this._editableLayerIds&&(await this._updateFeatures(),this.refreshLists())}async sortOptionWatchHandler(){this.updateSortingOptions()}filterByMapExtentChangeWatchHandler(){this.refreshLists()}async layerExpressionsWatchHandler(){await this.resetFilterList(),await this.handleSelectedLayersFilter(),await this._featureList.value?.refresh()}async showFeatureSymbolWatchHandler(){await this._featureList.value?.refresh()}async updateLayerExpressionsT9n(e){if(this._t9nLayerExpressions=e||this.layerExpressions,this._filterList!=null)await this._filterList.handleUpdatingT9nData(this._t9nLayerExpressions);else if(this._currentLayerExpressions!=null){let t=structuredClone(this._currentLayerExpressions);this.handleLayerExpressionsT9n(t,this._t9nLayerExpressions),this._currentLayerExpressions=t,this._showFilterIcon=this._currentLayerExpressions?.length>0}return Promise.resolve()}async load(){this._urlParamsLoaded=!1,await this.mapView?.when(async()=>{this._layers=this.reportingOptions?Object.keys(this.reportingOptions).filter(e=>{let t=e&&this.reportingOptions&&this.reportingOptions[e];return t&&t.visible}):[],this.setInitExpressions(),await this.setMapView()})}render(){let e=this.theme==="dark"?"calcite-mode-dark":"calcite-mode-light";return l`${this._reportSubmitted&&l`<calcite-alert auto-close class=${`${e} report-submitted-msg`} icon=check-circle kind=success label @calciteAlertClose=${()=>{this._reportSubmitted=!1}} open placement=top><div slot=message .innerHTML=${(this.reportSubmittedMessage||this._translations.submitMsg)??""} ${o(this._reportSubmittedAlertNode)}></div></calcite-alert>`||""}${this._featureCreationFailedErrorMsg&&l`<calcite-alert auto-close class=${u(e)} icon=x-octagon kind=danger label @calciteAlertClose=${()=>{this._featureCreationFailedErrorMsg=""}} open placement=top><div slot=title>${this._translations.error}</div><div slot=message>${this._featureCreationFailedErrorMsg}</div></calcite-alert>`||""}${this._commentSubmitted&&l`<calcite-alert auto-close class=${`report-submitted ${e}`} icon=check-circle kind=success label @calciteAlertClose=${()=>{this._commentSubmitted=!1}} open placement=top><div slot=message .innerHTML=${(this.commentSubmittedMessage||this._translations.commentSubmittedMsg)??""} ${o(this._commentSubmittedAlertNode)}></div></calcite-alert>`||""}${this._addingCommentFailed&&l`<calcite-alert auto-close class=${u(e)} icon=x-octagon kind=danger label @calciteAlertClose=${()=>{this._addingCommentFailed=!1}} open placement=top><div slot=title>${this._translations.error}</div><div slot=message>${this._translations.addingCommentFailedMsg}</div></calcite-alert>`||""}<div><calcite-shell content-behind>${this._getReporter()}</calcite-shell></div>${this.isMobile&&this.filterModal()||""}`}updated(){this._adjustAlertStyles()}async setSelectedLayer(e,t){this._selectedLayerId=e,this._selectedLayer=this.mapView&&await d(this.mapView,e),this._selectedLayerName=t,this._validLayers.forEach(i=>{this._nonVisibleValidLayers.find(s=>s.id===i.id)||i.set("visible",!e||i.id===e)})}_getLayersConfig(e){return this.reportingOptions&&this.reportingOptions[e]?this.reportingOptions[e]:null}_getReporter(){let e=[];this._flowItems.forEach(i=>{switch(i){case"layer-list":e.push(this.getLayerListFlowItem());break;case"feature-list":e.push(this.getFeatureListFlowItem(this._selectedLayerId,this._selectedLayerName));break;case"filter-panel":e.push(this.getFilterPanel());break;case"feature-details":e.push(this.getFeatureDetailsFlowItem());break;case"reporting-layer-list":e.push(this.getChooseCategoryFlowItem());break;case"feature-create":e.push(this.getFeatureCreateFlowItem());break;case"comment-details":e.push(this.getCommentDetailsFlowItem());break;case"add-comment":e.push(this.getAddCommentFlowItem());break}});let t=this.theme==="dark"?"calcite-mode-dark":"calcite-mode-light";return l`<calcite-panel class=${`width-full ${t}`}>${this.mapView?l`<calcite-flow>${e?.length>0&&e||""}</calcite-flow>`:l`<calcite-loader label scale=m></calcite-loader>`}</calcite-panel>`}filterModal(){return(this.layerExpressions?this.layerExpressions.filter(e=>e.id===this._selectedLayerId):[]).length>0&&l`<calcite-dialog aria-labelledby=modal-title class="modal" .heading=${this._translations.filterLayerTitle.replace("{{title}}",this._selectedLayerName)} kind=brand @calciteDialogClose=${()=>{this._closeFilter()}} .open=${this._filterOpen} width=s><div>${this.mapView&&l`<instant-apps-filter-list close-btn .closeBtnOnClick=${()=>{this._closeFilter()}} combobox-overlay-positioning=fixed .layerExpressions=${this._currentLayerExpressions} @filterListReset=${()=>{this._filterActive=!1,this._featureList.value&&this._featureList.value.refresh()}} @filterUpdate=${()=>{this._filterList?.filterCount!==void 0&&this._handleFilterUpdate(this._filterList?.filterCount>0)}} .view=${this.mapView} ${o(this._setFilterList)}></instant-apps-filter-list>`||""}</div></calcite-dialog>`||""}_setFilterList(e){this._filterList=e,e&&(e.autoUpdateUrl=!1,e.resetBtn=this.isMobile,e.resetFiltersOnDisconnect=!1,e.zoomBtn=!1)}_adjustAlertStyles(){this.reportSubmittedMessage&&this._reportSubmittedAlertNode.value?.children[0]&&(this._reportSubmittedAlertNode.value.children[0].style.margin="0px"),this.commentSubmittedMessage&&this._commentSubmittedAlertNode.value?.children[0]&&(this._commentSubmittedAlertNode.value.children[0].style.margin="0px")}_toggleFilter(){this._filterOpen=!this._filterOpen}async _closeFilter(){this._filterOpen=!1,this._filterList!=null&&(this._currentLayerExpressions=await this._filterList.getCurrentLayerExpressions(),this._showFilterIcon=this._currentLayerExpressions?.length>0)}async sortOptionClick(e,t,i){this._updatedSorting={field:e,order:t},this._updatedSortOption=i,this._sortPopoverNode.value&&(this._sortPopoverNode.value.open=!1)}_toggleSort(){let e=this.reportingOptions&&this.reportingOptions[this._selectedLayerId]&&this.reportingOptions[this._selectedLayerId].like&&this.reportingOptions[this._selectedLayerId].likeField;return l`<calcite-popover auto-close label offset-distance=0 .placement=${this.isMobile?"leading-start":"bottom-start"} pointer-disabled reference-element=sort-popover ${o(this._sortPopoverNode)}><calcite-list label selection-mode=single-persist><calcite-list-item .label=${this._translations.sortNewest} @calciteListItemSelect=${()=>{this._selectedLayer&&this.sortOptionClick(this._selectedLayer.objectIdField,"desc","newest")}} .selected=${this._updatedSortOption==="newest"} value=newest></calcite-list-item><calcite-list-item .label=${this._translations.sortOldest} @calciteListItemSelect=${()=>{this._selectedLayer&&this.sortOptionClick(this._selectedLayer.objectIdField,"asc","oldest")}} .selected=${this._updatedSortOption==="oldest"} value=oldest></calcite-list-item>${e&&l`<calcite-list-item .label=${this._translations.sortHighestVoted} @calciteListItemSelect=${()=>{let t=this.reportingOptions&&this.reportingOptions[this._selectedLayerId].likeField;t!==void 0&&this.sortOptionClick(t,"desc","highestVoted")}} .selected=${this._updatedSortOption==="highestVoted"} value=highestVoted></calcite-list-item><calcite-list-item .label=${this._translations.sortLowestVoted} @calciteListItemSelect=${()=>{let t=this.reportingOptions&&this.reportingOptions[this._selectedLayerId].likeField;t&&this.sortOptionClick(t,"asc","lowestVoted")}} .selected=${this._updatedSortOption==="lowestVoted"} value=lowestVoted></calcite-list-item>`||""}</calcite-list></calcite-popover>`}async _handleFilterListReset(){this._filterActive=!1}async _handleFilterUpdate(e){this._showLoadingIndicator=!0,this._filterActive=e,this._featureList.value&&await this._featureList.value.refresh(),this._showLoadingIndicator=!1}getLayerListFlowItem(){return l`<calcite-flow-item .collapsed=${this.isMobile&&this._sidePanelCollapsed} .heading=${this.reportsHeader} .loading=${this._showLoadingIndicator} .selected=${this._flowItems[this._flowItems.length-1]==="layer-list"}>${this.isMobile&&this.getActionToExpandCollapsePanel()||""}${this._hasValidLayers&&this.enableNewReports&&l`<calcite-button appearance=solid @click=${this.navigateToChooseCategory} slot=footer width=full>${this.reportButtonText?this.reportButtonText:this._translations.createReportButtonText}</calcite-button>`||""}<calcite-panel><layer-list .applyLayerViewFilter=${this.showMyReportsOnly} class="height-full" .filterByMapExtent=${this.filterByMapExtent} .layers=${this._editableLayerIds?.length>0?this._editableLayerIds:this._layers} .mapView=${this.mapView} @layerSelect=${this.displayFeaturesList} @layersListLoaded=${this.layerListLoaded} show-feature-count show-next-icon ${o(this._layerList)}></layer-list></calcite-panel></calcite-flow-item>`}getChooseCategoryFlowItem(){let e=this.reportingOptions?Object.keys(this.reportingOptions).filter(t=>this.reportingOptions&&this.reportingOptions[t].visible&&this.reportingOptions[t].reporting&&this._layerItemsHash&&this._layerItemsHash[t]&&this._layerItemsHash[t].supportsAdd):[];return l`<calcite-flow-item .collapsed=${this.isMobile&&this._sidePanelCollapsed} .heading=${this.reportButtonText?this.reportButtonText:this._translations.createReportButtonText} @calciteFlowItemBack=${this.backFromSelectedPanel} .selected=${this._flowItems[this._flowItems.length-1]==="reporting-layer-list"}><calcite-panel><div class="progress-bar"><calcite-progress type=determinate .value=${this._updatedProgressBarStatus}></calcite-progress></div><calcite-notice class="notice-msg" icon=lightbulb kind=success open><div slot=message>${this._translations.chooseCategoryMsg}</div></calcite-notice><layer-list class="height-full" .layers=${e} .mapView=${this.mapView} @layerSelect=${this.navigateToCreateFeature}></layer-list></calcite-panel></calcite-flow-item>`}getFeatureCreateFlowItem(){return l`<calcite-flow-item .collapsed=${this.isMobile&&this._sidePanelCollapsed} .heading=${this._selectedLayerName} @calciteFlowItemBack=${this.backFromCreateFeaturePanel} .selected=${this._flowItems[this._flowItems.length-1]==="feature-create"}>${this._showSubmitCancelButton&&l`<div class=width-full slot=footer><calcite-button appearance=solid class="footer-top-button footer-button" .disabled=${this._submitNextButtonDisabled} @click=${this._showNextButton?this.onNextButtonClick.bind(this):this.onCreateFeatureSubmitButtonClick.bind(this)} width=full>${this._showNextButton?this._translations.next:this._translations.submit}</calcite-button><calcite-button appearance=outline class=footer-button @click=${this.backFromCreateFeaturePanel} width=full>${this._translations.cancel}</calcite-button></div>`||""}<calcite-panel><div class="progress-bar"><calcite-progress type=determinate .value=${this._updatedProgressBarStatus}></calcite-progress></div><create-feature app-name=reporter .aiImageExtraction=${this.aiImageExtraction} class="height-full overflow-auto" customize-submit enable-search .enablePhotoLocation=${this.enablePhotoLocation} .enableSnapping=${this.enableSnapping} .floorLevel=${this.floorLevel} .formElements=${this._formElements.find(e=>e.id===this._selectedLayerId)} .reportingAreaLayer=${this.reportingAreaLayer} .isMobile=${this.isMobile} .mapView=${this.mapView} @drawComplete=${this.onFormReady} @editingLocation=${this.editingLocation} @editingAttachment=${this.showSubmitCancelButton} @fail=${this.createFeatureFailed} @modeChanged=${this.backFromCreateFeaturePanel} @progressStatus=${this.updatedProgressStatus} @success=${this.onReportSubmitted} .searchConfiguration=${this.searchConfiguration} .selectedLayerId=${this._selectedLayerId} .reportingArea=${this.reportingArea} .reportingAreaMessage=${this.reportingAreaMessage} .submitNewReportsMessage=${this.submitNewReportsMessage} update-map-position ${o(this._createFeature)}></create-feature></calcite-panel></calcite-flow-item>`}updatedProgressStatus(e){this._updatedProgressBarStatus=e.detail}onFormReady(e){this._submitNextButtonDisabled=e.detail,this._showSubmitCancelButton=!0}editingLocation(){this._showNextButton=!0}showSubmitCancelButton(e){this._showSubmitCancelButton=!e.detail}onCreateFeatureSubmitButtonClick(){this._createFeature.value&&(this._showNextButton=!1,this._createFeature.value.submit())}backFromCreateFeaturePanel(){this._createFeature.value&&(this._showSubmitCancelButton=!1,this._showNextButton=!1,this.updateNonVisibleLayersOnMap(!1)),this.backFromSelectedPanel()}onNextButtonClick(){this._createFeature.value&&(this._showNextButton=!1,this._showSubmitCancelButton=!0,this._createFeature.value.showForm())}onCreateRelatedFeatureSubmitButtonClick(){this._createRelatedFeature.value&&this._createRelatedFeature.value.submit()}backFromCreateRelatedFeaturePanel(){this._createRelatedFeature.value&&(this._showSubmitCancelButton=!1),this.backFromSelectedPanel()}createFeatureFailed(e){console.error(e.detail),this._featureCreationFailedErrorMsg=e.detail.message}async onReportSubmitted(){this._showSubmitCancelButton=!1,this.updateNonVisibleLayersOnMap(!1),await this.navigateToHomePage(),this._reportSubmitted=!0,this._updatedProgressBarStatus=25,this._showFullPanel&&this.updatePanelState(this._sidePanelCollapsed,!1)}addCommentFailed(e){console.error(e.detail),this._addingCommentFailed=!0}async onCommentSubmitted(){this._commentSubmitted=!0,this.backFromCreateRelatedFeaturePanel(),this._showLoadingIndicator=!0,this._featureDetails.value&&await this._featureDetails.value.refresh(this._currentFeature),setTimeout(()=>{this._showLoadingIndicator=!1},300)}async navigateToHomePage(){await this.setSelectedFeatures([]),this._layerList.value&&await this._layerList.value.refresh(),this._editableLayerIds.length===1?(this._featureList.value&&await this._featureList.value.refresh(),this._flowItems=["feature-list"]):this._flowItems=["layer-list"]}async navigateToCreateFeature(e){e.detail.layerId&&e.detail.layerName&&await this.setSelectedLayer(e.detail.layerId,e.detail.layerName),this.updateNonVisibleLayersOnMap(!0),this._getFormElements(),this._showSubmitCancelButton=!1,this._showNextButton=!1,this.updatePanelState(!1,!0),this._flowItems=[...this._flowItems,"feature-create"]}navigateToChooseCategory(){this.updatePanelState(!1,!0),this._flowItems=[...this._flowItems,"reporting-layer-list"]}updateNonVisibleLayersOnMap(e){this._nonVisibleValidLayers.find(t=>t.id===this._selectedLayerId)&&this._selectedLayer&&this._selectedLayer.set("visible",e)}async layerListLoaded(e){if(this._layerList.value&&this._flowItems[this._flowItems.length-1]==="layer-list"||this._flowItems[0]==="feature-list"){let t=e.detail,i=this.mapView&&await _(this.mapView),s=[];if(this._validLayers=[],this._nonVisibleValidLayers=[],i?.forEach(a=>{t.includes(a.id)&&(this._validLayers.push(a),a.visible||this._nonVisibleValidLayers.push(a),this._getLayersConfig(a.id)?.reporting&&this._layerItemsHash&&this._layerItemsHash[a.id]&&this._layerItemsHash[a.id].supportsAdd&&s.push(a.id))}),this.handleMapClick(),this._hasValidLayers=s.length>0,!this._urlParamsLoaded&&this._editableLayerIds.length>1&&this.layerId&&this.objectId){let a=this.mapView&&await d(this.mapView,this.layerId);a&&await this.displayFeaturesList({detail:{layerId:a.id,layerName:a.title}}),this._urlParamsLoaded=!0,await this.loadFeatureFromURLParams()}}}async displayFeaturesList(e){this._showLoadingIndicator=!0,await this.setSelectedLayer(e.detail.layerId,e.detail.layerName),this.updateSortingOptions(),this.handleSelectedLayersFilter(),this._flowItems=[...this._flowItems,"feature-list"],this._prevSelectedLayerId=this._selectedLayerId,this._showLoadingIndicator=!1}updateSortingOptions(){let e=this.sortOption===""?"newest":this.sortOption,t=e==="oldest"||e==="lowestVoted"?"asc":"desc",i=this.reportingOptions?.[this._selectedLayerId]?.like?this.reportingOptions?.[this._selectedLayerId]?.likeField:"",s=this._selectedLayer&&(e==="newest"||e==="oldest")?this._selectedLayer?.objectIdField:i;this._updatedSorting={field:s||"",order:t},this._updatedSortOption=!i&&(e==="highestVoted"||e==="lowestVoted")?"newest":e}async backFromFilterPanel(){this._filterList!=null&&(this._currentLayerExpressions=await this._filterList.getCurrentLayerExpressions(),this._showFilterIcon=this._currentLayerExpressions?.length>0),this._featureList.value&&await this._featureList.value.refresh(),this.backFromSelectedPanel()}backFromSelectedPanel(){this._updatedProgressBarStatus=25;let e=[...this._flowItems];if(e[e.length-1]==="comment-details"||e[e.length-1]==="add-comment"||this.clearHighlights(),(e[e.length-1]==="reporting-layer-list"||e[e.length-1]==="feature-create"&&(e[0]==="feature-list"||e[e.length-2]==="feature-list"))&&this.updatePanelState(this._sidePanelCollapsed,!1),e.pop(),e.length===1&&e[0]==="layer-list"){this.navigateToHomePage();return}this._flowItems=[...e]}toggleSidePanel(){this._sidePanelCollapsed=!this._sidePanelCollapsed,this.togglePanel.emit({panelState:this._sidePanelCollapsed,isFormOpen:this._showFullPanel})}updatePanelState(e,t){this._sidePanelCollapsed=e,this._showFullPanel=t,this.togglePanel.emit({panelState:this._sidePanelCollapsed,isFormOpen:this._showFullPanel})}async onFeatureSelectFromList(e){await this.setSelectedFeatures([e.detail]),this._flowItems=[...this._flowItems,"feature-details"]}async getRelatedTable(){let e=this._currentFeature?.layer,t=this.mapView&&await f(this.mapView);e.relationships?.some(i=>{let s=t?.filter(a=>e.url===a.url&&a.layerId===i.relatedTableId);return s&&s.length>0?(this._relatedTable=s[0],!0):!1})}async updatingFeatureDetails(e){this._showLoadingIndicator=e}async selectionChanged(e){this.updatingFeatureDetails(!0),await this.setCurrentFeature(e.detail.selectedFeature[0]),this.highlightOnMap(e.detail.selectedFeature[0]),this._selectedFeatureIndex=e.detail.selectedFeatureIndex,this._featureDetails.value&&await this._featureDetails.value.refresh(e.detail.selectedFeature[0])}showAddCommentsPanel(){this._flowItems=[...this._flowItems,"add-comment"]}async onCommentSelectFromList(e){this._selectedRelatedFeature=[e.detail],this._flowItems=[...this._flowItems,"comment-details"]}getFeatureListFlowItem(e,t){let i=this._getLayersConfig(this._selectedLayerId)?.reporting&&this._layerItemsHash&&this._layerItemsHash[this._selectedLayerId].supportsAdd,s=this._showFilterIcon;return l`<calcite-flow-item .collapsed=${this.isMobile&&this._sidePanelCollapsed} .heading=${t} .loading=${!this.isMobile&&this._showLoadingIndicator} @calciteFlowItemBack=${this.backFromSelectedPanel} .selected=${this._flowItems[this._flowItems.length-1]==="feature-list"}>${this._toggleSort()}<calcite-action appearance=solid icon=sort-ascending-arrow id=sort-popover slot=header-actions-end .text=${this._translations.sort} title=${this._translations.sort??p}></calcite-action>${s&&l`<calcite-action appearance=solid icon=filter .indicator=${this._filterActive} @click=${()=>{this.isMobile?this._toggleFilter():this._flowItems=[...this._flowItems,"filter-panel"]}} slot=header-actions-end .text=${this._translations.filter} title=${this._translations.filter??p}></calcite-action>`||""}${this.isMobile&&this.getActionToExpandCollapsePanel()||""}${this.enableNewReports&&i&&l`<calcite-button appearance=solid @click=${this.navigateToCreateFeature} slot=footer width=full>${this.reportButtonText?this.reportButtonText:this._translations.createReportButtonText}</calcite-button>`||""}<calcite-panel>${l`<feature-list .applyLayerViewFilter=${this.showMyReportsOnly} class="height-full" .filterByMapExtent=${this.filterByMapExtent} highlight-on-hover .mapView=${this.mapView} .noFeaturesFoundMsg=${this._translations.featureErrorMsg} @featureClick=${()=>{this._showLoadingIndicator=!0}} @featureSelect=${this.onFeatureSelectFromList} page-size=30 .reportingOptions=${this.reportingOptions} .selectedLayerId=${e} .showFeatureSymbol=${this.showFeatureSymbol} .sortingInfo=${this._updatedSorting} ${o(this._featureList)}></feature-list>`}</calcite-panel></calcite-flow-item>`}getFilterPanel(){return l`<calcite-flow-item .collapsed=${this.isMobile&&this._sidePanelCollapsed} .heading=${this._translations.filterLayerTitle.replace("{{title}}",this._selectedLayerName)} .loading=${this._showLoadingIndicator} @calciteFlowItemBack=${this.backFromFilterPanel} .selected=${this._flowItems[this._flowItems.length-1]==="filter-panel"}>${this.isMobile&&this.getActionToExpandCollapsePanel()||""}<div class=width-full slot=footer><div class=width-full slot=footer><calcite-button appearance=solid class="footer-top-button footer-button" .disabled=${!this._filterActive} @click=${this.resetFilterList} width=full>${this._translations.resetFilter}</calcite-button><calcite-button appearance=outline class=footer-button @click=${this.backFromFilterPanel} width=full>${this._translations.close}</calcite-button></div></div><calcite-panel>${this.mapView&&l`<instant-apps-filter-list .closeBtnOnClick=${()=>{}} combobox-overlay-positioning=fixed .layerExpressions=${this._currentLayerExpressions} @filterListReset=${()=>{this._handleFilterListReset()}} @filterUpdate=${()=>{let e=this._filterList?.filterCount;e!==void 0&&this._handleFilterUpdate(e>0)}} .view=${this.mapView} ${o(this._setFilterList)}></instant-apps-filter-list>`||""}</calcite-panel></calcite-flow-item>`}getFeatureDetailsFlowItem(){let e=this._selectedLayer?.relationships,t=this._getLayersConfig(this._selectedLayerId)?.comment&&e&&e.length>0&&this._relatedTable;return l`<calcite-flow-item .collapsed=${this.isMobile&&this._sidePanelCollapsed} .heading=${this._selectedLayerName} .loading=${this._showLoadingIndicator} @calciteFlowItemBack=${this.backFromSelectedPanel} .selected=${this._flowItems[this._flowItems.length-1]==="feature-details"}>${this.isMobile&&this.getActionToExpandCollapsePanel()||""}${this.mapView&&l`<instant-apps-social-share class=share-node flip-rtl popover-button-icon-scale=s remove-popover-offset scale=m share-button-color=neutral share-button-type=action slot=header-actions-end social-media .view=${this.mapView} ${o(this._shareNode)}></instant-apps-social-share>`||""}${this._selectedFeature.length>1&&this.getFeaturesPagination()||""}<calcite-panel><feature-details class=full-height .enableSnapping=${this.enableSnapping} .graphics=${this._selectedFeature} .layerItemsHash=${this._layerItemsHash} .mapView=${this.mapView} @addComment=${this.showAddCommentsPanel} @commentClick=${()=>{this._showLoadingIndicator=!0}} @commentSelect=${this.onCommentSelectFromList} @featureSelectionChange=${this.selectionChanged} @likeOrDislikeClicked=${()=>{this._featureList.value&&this._featureList.value.refresh(!0)}} @loadingStatus=${i=>{this.updatingFeatureDetails(i.detail)}} .reportingOptions=${this.reportingOptions} .showFullCommentTitle=${this.showFullCommentTitle} .showUserImageInCommentsList=${this.showUserImageInCommentsList} ${o(this._featureDetails)}></feature-details>${t&&l`<calcite-button appearance=solid @click=${this.showAddCommentsPanel} slot=footer width=full>${this.commentButtonText||this._translations.comment}</calcite-button>`||""}</calcite-panel></calcite-flow-item>`}getFeaturesPagination(){return l`<div class="feature-pagination"><div><calcite-button appearance=transparent icon-start=chevron-left icon-flip-rtl=both id=solutions-back @click=${()=>this._featureDetails.value&&void this._featureDetails.value.back()} scale=s width=full></calcite-button><calcite-tooltip placement=top reference-element=solutions-back><span>${this._translations.back}</span></calcite-tooltip></div><calcite-button appearance=transparent @click=${()=>this._featureDetails.value&&void this._featureDetails.value.toggleListView()} scale=s><span class="pagination-count">${this._getCount()}</span></calcite-button><div><calcite-button appearance=transparent icon-flip-rtl=both icon-start=chevron-right id=solutions-next @click=${()=>this._featureDetails.value&&void this._featureDetails.value.next()} scale=s width=full></calcite-button><calcite-tooltip placement=top reference-element=solutions-next><span>${this._translations.next}</span></calcite-tooltip></div></div>`}getCommentDetailsFlowItem(){return l`<calcite-flow-item .collapsed=${this.isMobile&&this._sidePanelCollapsed} .heading=${this._relatedTable?.title||""} @calciteFlowItemBack=${this.backFromSelectedPanel} .selected=${this._flowItems[this._flowItems.length-1]==="comment-details"}>${this.isMobile&&this.getActionToExpandCollapsePanel()||""}<calcite-panel><info-card .enableSnapping=${this.enableSnapping} .graphics=${this._selectedRelatedFeature} .mapView=${this.mapView} @selectionChanged=${()=>{this._showLoadingIndicator=!1}}></info-card></calcite-panel></calcite-flow-item>`}getAddCommentFlowItem(){return l`<calcite-flow-item .collapsed=${this.isMobile&&this._sidePanelCollapsed} .heading=${this._relatedTable?.title||""} @calciteFlowItemBack=${this.backFromCreateRelatedFeaturePanel} .selected=${this._flowItems[this._flowItems.length-1]==="add-comment"}>${this.isMobile&&this.getActionToExpandCollapsePanel()||""}<div class=width-full slot=footer>${this._showSubmitCancelButton&&l`<div class=width-full slot=footer><calcite-button appearance=solid class="footer-top-button footer-button" @click=${this.onCreateRelatedFeatureSubmitButtonClick} width=full>${this._translations.submit}</calcite-button><calcite-button appearance=outline class=footer-button @click=${this.backFromCreateRelatedFeaturePanel} width=full>${this._translations.cancel}</calcite-button></div>`||""}</div><calcite-panel><create-related-feature customize-submit .enableSnapping=${this.enableSnapping} .mapView=${this.mapView} @fail=${this.addCommentFailed} @formReady=${this.onFormReady} @isActionPending=${this.showSubmitCancelButton} @success=${this.onCommentSubmitted} .selectedFeature=${this._currentFeature} .table=${this._relatedTable} ${o(this._createRelatedFeature)}></create-related-feature></calcite-panel></calcite-flow-item>`}async setSelectedFeatures(e){this._selectedFeature=e,await this.setCurrentFeature(this._selectedFeature.length?this._selectedFeature[0]:void 0)}async setCurrentFeature(e){if(this._currentFeature=e,e&&e.layer){let t=e.layer;t.title&&this.setSelectedLayer(t.id,t.title),this._currentFeatureId=e.attributes[t.objectIdField],this._getLayersConfig(t.id)?.comment&&t.relationships&&t.relationships.length>0&&await this.getRelatedTable()}else this._editableLayerIds.length>1&&(this.setSelectedLayer("",""),this.handlePrevLayersFilter()),this._currentFeatureId="";this._updateShareURL()}async highlightOnMap(e){if(this.clearHighlights(),e&&e.geometry&&e.layer&&e.layer.id!==void 0){let t=this.mapView&&await m(this.mapView,e.layer.id.toString());if(t){let i=Number(e.getObjectId());this._highlightHandle=this.mapView&&await x([i],t,this.mapView,!0,this.zoomToScale)}}this.updatingFeatureDetails(!1)}clearHighlights(){this._highlightHandle&&this._highlightHandle.remove()}getActionToExpandCollapsePanel(){return l`<calcite-action appearance=solid .icon=${this._sidePanelCollapsed?"chevrons-up":"chevrons-down"} @click=${this.toggleSidePanel} slot=header-actions-end .text=${(this._sidePanelCollapsed?this._translations.expand:this._translations.collapse)||""}></calcite-action>`}async setMapView(){this.mapView&&await f(this.mapView),await this.getLayersToShowInList(),await this._updateFeatures(),this._editableLayerIds?.length===1?await this.renderFeaturesList():this._flowItems=["layer-list"],this.mapView&&(this.mapView.popupEnabled=!1,this._defaultCenter&&this._defaultLevel&&(await this.mapView.goTo({center:this._defaultCenter,zoom:this._defaultLevel}),this._defaultCenter=void 0,this._defaultLevel=void 0))}handleMapClick(){this._mapClickHandle&&this._mapClickHandle.remove(),this._mapClickHandle=E.on(()=>this.mapView,"click",e=>{this.mapView&&(this.mapView.popupEnabled=!1),this.onMapClick(e)})}async onMapClick(e){if(!(this._flowItems[this._flowItems.length-1]==="feature-create"||this._flowItems[this._flowItems.length-1]==="add-comment")&&this.mapView){let t=await this.mapView.hitTest(e),i=[],s=[],a=[],n=!1;t.results.length>0&&t.results.forEach(r=>{r.type==="graphic"&&i.push(r.graphic)}),i.length>0&&(await this._setReportingGraphics(i),s=this._getNonReportingLayerGraphics(i)),this._mapImageryLayersId.length>0&&(a=await this._getIdentifiedGraphics(e.mapPoint),n=a.length>0);let h=s.concat(a);if(h.length>0){this.mapView.popupEnabled=!0;let r={features:h,location:e.mapPoint,updateLocationEnabled:!n};await this.mapView.openPopup(r)}}}async _setReportingGraphics(e){let t=e.filter(i=>{if(i.layer?.type==="feature"){let s=i.layer;return this._validLayers.includes(s)}else return!1});this._selectedLayer&&this._selectedFeature.length>0&&this._selectedLayer.id===t[0]?.layer?.id&&t[0].attributes[this._selectedLayer.objectIdField]===this._selectedFeature[0].attributes[this._selectedLayer.objectIdField]||t.length>0&&(await this.setSelectedFeatures(t),this._flowItems.length&&this._flowItems.includes("feature-details")?(this._flowItems=[...this._flowItems.slice(0,this._flowItems.indexOf("feature-details")+1)],await this.highlightOnMap(e[0])):this._flowItems=[...this._flowItems,"feature-details"])}_getNonReportingLayerGraphics(e){return e.filter(t=>{if(t.layer?.type==="feature"){let i=t.layer;return!this._validLayers.includes(i)&&i?.popupEnabled&&i?.id}else return!1})}async _getIdentifiedGraphics(e){let t=new O({geometry:e,tolerance:3,mapExtent:this.mapView?.extent}),i,s=[];for(let n of this._mapImageryLayersId){let h=this.mapView&&await d(this.mapView,n);if(h?.url&&t)try{let r=await k?.identify(h.url,t);if(r?.results?.length){s=r.results,i=h;break}}catch(r){console.error(r)}}let a=[];return s.forEach(n=>{let h=n.layerId,r=i?.sublayers?.items.find(P=>P.id===h),w=r?.popupTemplate;r?.popupEnabled&&w&&(n.feature.popupTemplate=w,a.push(n.feature))}),a}_getCount(){let e=(this._selectedFeatureIndex+1).toString(),t=this._selectedFeature.length.toString();return this._translations.indexOfTotal.replace("{{index}}",e).replace("{{total}}",t)}_updateFloorDefinitionExpression(e){let t=`${e?.floorInfo?.floorField} = '${this.floorLevel}'`,i=e.definitionExpression;e.definitionExpression=i&&i?.indexOf(this._floorExpression)>-1?i.replace(this._floorExpression,t):t,this._floorExpression=t}_getFormElements(){let e=this._selectedLayer;if(e?.floorInfo?.floorField&&this.floorLevel&&e?.formTemplate){let t=this._formElements.find(i=>i.id===e.id);(this._formElements.length===0||!t)&&this._formElements.push({id:e.id,orgElements:e.formTemplate.elements,orgExpressionInfos:e.formTemplate.expressionInfos})}}reduceToConfiguredLayers(e,t){return Object.keys(e).reduce((i,s)=>{let a=this.reportingOptions?this._getLayersConfig(s)?.visible:e[s].supportsAdd;return!t.includes(s)&&a&&i.push(s),i},[])}refreshLists(){setTimeout(()=>{this._layerList.value&&this._flowItems[this._flowItems.length-1]==="layer-list"&&this._layerList.value.refresh(),this._featureList.value&&this._featureList.value.refresh()},50)}async _updateFeatures(){for(let e of this._editableLayerIds){let t=this.mapView&&await m(this.mapView,e);t&&(await this._showMyFeaturesOnly(t),t.layer?.floorInfo?.floorField&&this.floorLevel&&this._updateFloorDefinitionExpression(t.layer))}}async _showMyFeaturesOnly(e){let t=(this.mapView?.map).portalItem.portal?.credential?.userId;if(t&&e){let i=e.layer.editFieldsInfo?.creatorField.toLowerCase();e.filter=this.showMyReportsOnly&&i?new V({where:`${i} = '${t}'`}):null}}async getLayersToShowInList(){let e=this.mapView&&await C(this.mapView,!1),t=this.mapView&&await _(this.mapView),i=[];t?.forEach(s=>{s?.type==="feature"&&s?.editingEnabled&&s?.capabilities?.operations?.supportsAdd&&(e[s.id].supportsAdd=!0),s?.editingEnabled||i.push(s.id)}),this._editableLayerIds=this.reduceToConfiguredLayers(e,i),this._layerItemsHash=e}async renderFeaturesList(){this._flowItems=["feature-list"];let e={detail:this._editableLayerIds};await this.layerListLoaded(e),await this.setSelectedLayer(this._validLayers[0].id,this._validLayers[0]?.title||""),this.updateSortingOptions(),await this.handleSelectedLayersFilter(),this._urlParamsLoaded||(this._urlParamsLoaded=!0,await this.loadFeatureFromURLParams())}_updateShareURL(){let e=this._shareNode.value?.shareUrl;if(!e)return;let t=new URL(e);this._selectedLayerId?t.searchParams.set("layerid",this._selectedLayerId):t.searchParams.delete("layerid"),this._selectedFeature?.length?t.searchParams.set("oid",this._currentFeatureId):t.searchParams.delete("oid"),this._shareNode.value&&(this._shareNode.value.autoUpdateShareUrl=!1,this._shareNode.value.shareUrl=t.href)}async loadFeatureFromURLParams(){if(this.center&&this.level&&await this.mapView?.goTo({center:this.center.split(";").map(Number),zoom:parseInt(this.level,10)}),this.layerId&&this.objectId){let e=this.mapView&&await d(this.mapView,this.layerId);if(e){let t=this.mapView&&await v([Number(this.objectId)],e,[],!0,this.mapView.spatialReference);t?.length&&(await this.setSelectedFeatures(t),this._flowItems.length&&this._flowItems[this._flowItems.length-1]!=="feature-details"?this._flowItems=[...this._flowItems,"feature-details"]:this._flowItems=[...this._flowItems])}}}async handleSelectedLayersFilter(){if(this._selectedLayer){let e=this.layerExpressions?structuredClone(this.layerExpressions.filter(t=>t.id===this._selectedLayerId)):[];this._t9nLayerExpressions!=null&&this.handleLayerExpressionsT9n(e,this._t9nLayerExpressions),this._currentLayerExpressions=e,this._showFilterIcon=this._currentLayerExpressions?.length>0,this.setActiveDefinitionExpressions()}}async handlePrevLayersFilter(){if(this._prevSelectedLayerId){let e=this.mapView&&await d(this.mapView,this._prevSelectedLayerId);e&&this._initDefExpressions&&(e.definitionExpression=this._initDefExpressions[this._prevSelectedLayerId])}}async resetFilterList(){await this._filterList?.forceReset(),this._selectedLayer!==void 0&&this._initDefExpressions&&(this._selectedLayer.definitionExpression=this._initDefExpressions[this._selectedLayerId],this._filterActive=!1)}setActiveDefinitionExpressions(){if(this._selectedLayer===void 0)return;let e=[];if(this._currentLayerExpressions&&this._currentLayerExpressions?.length>0){let t=this._currentLayerExpressions[0];for(let i of t.expressions){let{active:s,definitionExpression:a}=i;s&&a&&e.push(`(${a})`)}this._filterActive=e.length>0,this.updateFilterLayerDefExpression(e,t.operator)}}updateFilterLayerDefExpression(e,t){let i=this._initDefExpressions&&this._initDefExpressions[this._selectedLayerId],s=e?.length>0&&i?`(${e.join(t)}) AND (${i})`:e.length>0?e.join(t):i;this._selectedLayer&&(this._selectedLayer.definitionExpression=s)}setInitExpressions(){if(this._initDefExpressions={},this.mapView==null)return;let e=this.mapView.map;e.allLayers.concat(e.allTables.toArray()).forEach(t=>{if(t.type==="map-image"&&t.popupEnabled&&!this._mapImageryLayersId.includes(t.id)){this._mapImageryLayersId.push(t.id);return}if(t.type!=="feature")return;let i=t;this._initDefExpressions&&(this._initDefExpressions[i.id]=i.definitionExpression||"")})}handleLayerExpressionsT9n(e,t){e?.forEach(i=>{let s=t?.find(a=>a.id===i.id);s!=null&&(i.title=s.title,i.expressions?.forEach(a=>{let n=s.expressions?.find(h=>h.id===a.id);n!=null&&(a.name=n.name)}))})}};I("crowdsource-reporter",g);return g},"core/reactiveUtils","layers/support/FeatureFilter","rest/identify","rest/support/IdentifyParameters",a,d)
|
|
2
|
+
import{a as S}from"./JOQDD4HN.js";import"./JM5FJEHU.js";import d from"./KDIUYXBA.js";import a from"./UUYUTETH.js";import{a as $}from"./HYX7BODW.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import{b as I}from"./B2DK4LWH.js";import{F as c,G as o,H as F,J as u,h as y,i as l,l as p,r as b,u as L}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([E,V,k,O,{b:v},{a:C,c:m,d:d,e:_,f:f,g:x}])=>{var M=y`@layer{:host{display:block;--calcite-label-margin-bottom: 0px;--solutions-theme-foreground-color: var(--calcite-color-foreground-1)}.width-full{width:100%!important}.height-full{height:100%!important}.notice-msg{padding:10px;width:calc(100% - 20px)}.progress-bar{padding:12px}.footer-top-button{padding-bottom:7px}.footer-button{height:35px}.feature-pagination{background-color:var(--calcite-color-foreground-1)!important;border-block-end:1px solid var(--calcite-color-border-3);display:flex;justify-content:center;padding:5px 0}.pagination-count{color:var(--calcite-color-brand);border-bottom:1px solid var(--calcite-color-brand);font-weight:700}.report-submitted-msg{position:absolute;z-index:1000}.share-node{display:flex}.overflow-auto{overflow:auto}}`,g=class extends F{constructor(){super(),this.center="",this.commentButtonText="",this.commentSubmittedMessage="",this.defaultWebmap="",this.description="",this.enableAnonymousAccess=!1,this.enableAnonymousComments=!1,this.enableComments=!1,this.enableHome=!0,this.enableLogin=!1,this.enableNewReports=!1,this.enableSearch=!0,this.enableSnapping=!1,this.enableZoom=!0,this.isMobile=!1,this.layerExpressions=[],this.layerId="",this.level="",this.loginTitle="",this.mapInfos=[],this.objectId="",this.reportButtonText="",this.reportsHeader="",this.reportSubmittedMessage="",this.showComments=!1,this.showUserImageInCommentsList=!1,this.showFeatureSymbol=!1,this.showMyReportsOnly=!1,this.submitNewReportsMessage="",this.theme="light",this.floorLevel="",this.showFullCommentTitle=!0,this.filterByMapExtent=!1,this.sortOption="newest",this.reportingArea=!1,this.reportingAreaLayer="",this.reportingAreaMessage="",this.enablePhotoLocation=!1,this.aiImageExtraction=[],this._featureCreationFailedErrorMsg="",this._filterActive=!1,this._flowItems=[],this._hasValidLayers=!1,this._reportSubmitted=!1,this._selectedLayerName="",this._showSubmitCancelButton=!1,this._showLoadingIndicator=!1,this._sidePanelCollapsed=!1,this._translations=$({name:"crowdsource-reporter",blocking:!0}),this._updatedProgressBarStatus=25,this._updatedSortOption="newest",this._commentSubmitted=!1,this._addingCommentFailed=!1,this._filterOpen=!1,this._showNextButton=!1,this._submitNextButtonDisabled=!1,this._showFilterIcon=!1,this._createFeature=c(),this._currentFeatureId="",this._editableLayerIds=[],this._featureDetails=c(),this._featureList=c(),this._selectedRelatedFeature=[],this._layerList=c(),this._createRelatedFeature=c(),this._layers=[],this._mapImageryLayersId=[],this._selectedFeature=[],this._selectedFeatureIndex=0,this._selectedLayerId="",this._shareNode=c(),this._urlParamsLoaded=!1,this._validLayers=[],this._nonVisibleValidLayers=[],this._showFullPanel=!1,this._floorExpression="",this._formElements=[],this._prevSelectedLayerId="",this._t9nLayerExpressions=[],this._reportSubmittedAlertNode=c(),this._commentSubmittedAlertNode=c(),this._sortPopoverNode=c(),this.togglePanel=b(),S(window)}static{this.properties={center:1,commentButtonText:1,commentSubmittedMessage:1,defaultWebmap:1,description:1,enableAnonymousAccess:5,enableAnonymousComments:5,enableComments:5,enableHome:5,enableLogin:5,enableNewReports:5,enableSearch:5,enableSnapping:5,enableZoom:5,isMobile:5,layerExpressions:0,layerId:1,level:1,loginTitle:1,mapInfos:0,mapView:0,objectId:1,reportButtonText:1,reportingOptions:0,reportsHeader:1,reportSubmittedMessage:1,searchConfiguration:0,showComments:5,showUserImageInCommentsList:5,showFeatureSymbol:5,showMyReportsOnly:5,submitNewReportsMessage:1,theme:1,zoomToScale:9,floorLevel:1,showFullCommentTitle:5,filterByMapExtent:5,sortOption:1,reportingArea:5,reportingAreaLayer:1,reportingAreaMessage:1,enablePhotoLocation:5,aiImageExtraction:0,_featureCreationFailedErrorMsg:16,_filterActive:16,_flowItems:16,_hasValidLayers:16,_mapInfo:16,_reportSubmitted:16,_selectedLayerName:16,_showSubmitCancelButton:16,_showLoadingIndicator:16,_sidePanelCollapsed:16,_translations:16,_updatedProgressBarStatus:16,_updatedSorting:16,_updatedSortOption:16,_commentSubmitted:16,_addingCommentFailed:16,_filterOpen:16,_showNextButton:16,_submitNextButtonDisabled:16,_showFilterIcon:16}}static{this.styles=M}static{this.shadowRootOptions=L}willUpdate(e){e.has("isMobile")&&this.isMobileWatchHandler(this.isMobile),e.has("mapView")&&this.hasUpdated&&this.mapViewWatchHandler(),e.has("floorLevel")&&this.floorLevelWatchHandler(),(e.has("reportingAreaLayer")||e.has("reportingArea")&&this.hasUpdated)&&setTimeout(()=>{this._createFeature.value&&this._createFeature.value.refresh(this.floorLevel)},50),e.has("showMyReportsOnly")&&(this.hasUpdated||this.showMyReportsOnly!==!1)&&this.showMyReportsOnlyWatchHandler(),e.has("sortOption")&&(this.hasUpdated||this.sortOption!=="newest")&&this.sortOptionWatchHandler(),e.has("filterByMapExtent")&&(this.hasUpdated||this.filterByMapExtent!==!1)&&this.filterByMapExtentChangeWatchHandler(),e.has("layerExpressions")&&(this.hasUpdated||this.layerExpressions?.length>0)&&this.layerExpressionsWatchHandler(),e.has("showFeatureSymbol")&&(this.hasUpdated||this.showFeatureSymbol!==!1)&&this.showFeatureSymbolWatchHandler(),(this._flowItems.includes("filter-panel")||this._filterOpen)&&this._filterList?.updateInitDefExpressions({initDefExpressions:this._initDefExpressions})}async isMobileWatchHandler(e){this.updatePanelState(!1,this._showFullPanel),e&&this._flowItems[this._flowItems.length-1]==="filter-panel"?(await this.backFromFilterPanel(),this._filterOpen=!0):!e&&this._filterOpen&&(await this._closeFilter(),this._flowItems=[...this._flowItems,"filter-panel"])}async mapViewWatchHandler(){await this.mapView?.when(async()=>{this.setInitExpressions(),await this.setMapView()})}async floorLevelWatchHandler(){if(this._editableLayerIds)for(let e of this._editableLayerIds){let t=this.mapView&&await d(this.mapView,e);t&&t.floorInfo?.floorField&&this._updateFloorDefinitionExpression(t)}this._flowItems[this._flowItems.length-1]==="layer-list"&&this._layerList.value&&await this._layerList.value.refresh(),this._featureList.value&&this._featureList.value.refresh(),this._createFeature.value&&this._createFeature.value.refresh(this.floorLevel)}async showMyReportsOnlyWatchHandler(){this._editableLayerIds&&(await this._updateFeatures(),this.refreshLists())}async sortOptionWatchHandler(){this.updateSortingOptions()}filterByMapExtentChangeWatchHandler(){this.refreshLists()}async layerExpressionsWatchHandler(){await this.resetFilterList(),await this.handleSelectedLayersFilter(),await this._featureList.value?.refresh()}async showFeatureSymbolWatchHandler(){await this._featureList.value?.refresh()}async updateLayerExpressionsT9n(e){if(this._t9nLayerExpressions=e||this.layerExpressions,this._filterList!=null)await this._filterList.handleUpdatingT9nData(this._t9nLayerExpressions);else if(this._currentLayerExpressions!=null){let t=structuredClone(this._currentLayerExpressions);this.handleLayerExpressionsT9n(t,this._t9nLayerExpressions),this._currentLayerExpressions=t,this._showFilterIcon=this._currentLayerExpressions?.length>0}return Promise.resolve()}async load(){this._urlParamsLoaded=!1,await this.mapView?.when(async()=>{this._layers=this.reportingOptions?Object.keys(this.reportingOptions).filter(e=>{let t=e&&this.reportingOptions&&this.reportingOptions[e];return t&&t.visible}):[],this.setInitExpressions(),await this.setMapView()})}render(){let e=this.theme==="dark"?"calcite-mode-dark":"calcite-mode-light";return l`${this._reportSubmitted&&l`<calcite-alert auto-close class=${`${e} report-submitted-msg`} icon=check-circle kind=success label @calciteAlertClose=${()=>{this._reportSubmitted=!1}} open placement=top><div slot=message .innerHTML=${(this.reportSubmittedMessage||this._translations.submitMsg)??""} ${o(this._reportSubmittedAlertNode)}></div></calcite-alert>`||""}${this._featureCreationFailedErrorMsg&&l`<calcite-alert auto-close class=${u(e)} icon=x-octagon kind=danger label @calciteAlertClose=${()=>{this._featureCreationFailedErrorMsg=""}} open placement=top><div slot=title>${this._translations.error}</div><div slot=message>${this._featureCreationFailedErrorMsg}</div></calcite-alert>`||""}${this._commentSubmitted&&l`<calcite-alert auto-close class=${`report-submitted ${e}`} icon=check-circle kind=success label @calciteAlertClose=${()=>{this._commentSubmitted=!1}} open placement=top><div slot=message .innerHTML=${(this.commentSubmittedMessage||this._translations.commentSubmittedMsg)??""} ${o(this._commentSubmittedAlertNode)}></div></calcite-alert>`||""}${this._addingCommentFailed&&l`<calcite-alert auto-close class=${u(e)} icon=x-octagon kind=danger label @calciteAlertClose=${()=>{this._addingCommentFailed=!1}} open placement=top><div slot=title>${this._translations.error}</div><div slot=message>${this._translations.addingCommentFailedMsg}</div></calcite-alert>`||""}<div><calcite-shell content-behind>${this._getReporter()}</calcite-shell></div>${this.isMobile&&this.filterModal()||""}`}updated(){this._adjustAlertStyles()}async setSelectedLayer(e,t){this._selectedLayerId=e,this._selectedLayer=this.mapView&&await d(this.mapView,e),this._selectedLayerName=t,this._validLayers.forEach(i=>{this._nonVisibleValidLayers.find(s=>s.id===i.id)||i.set("visible",!e||i.id===e)})}_getLayersConfig(e){return this.reportingOptions&&this.reportingOptions[e]?this.reportingOptions[e]:null}_getReporter(){let e=[];this._flowItems.forEach(i=>{switch(i){case"layer-list":e.push(this.getLayerListFlowItem());break;case"feature-list":e.push(this.getFeatureListFlowItem(this._selectedLayerId,this._selectedLayerName));break;case"filter-panel":e.push(this.getFilterPanel());break;case"feature-details":e.push(this.getFeatureDetailsFlowItem());break;case"reporting-layer-list":e.push(this.getChooseCategoryFlowItem());break;case"feature-create":e.push(this.getFeatureCreateFlowItem());break;case"comment-details":e.push(this.getCommentDetailsFlowItem());break;case"add-comment":e.push(this.getAddCommentFlowItem());break}});let t=this.theme==="dark"?"calcite-mode-dark":"calcite-mode-light";return l`<calcite-panel class=${`width-full ${t}`}>${this.mapView?l`<calcite-flow>${e?.length>0&&e||""}</calcite-flow>`:l`<calcite-loader label scale=m></calcite-loader>`}</calcite-panel>`}filterModal(){return(this.layerExpressions?this.layerExpressions.filter(e=>e.id===this._selectedLayerId):[]).length>0&&l`<calcite-dialog aria-labelledby=modal-title class="modal" .heading=${this._translations.filterLayerTitle.replace("{{title}}",this._selectedLayerName)} kind=brand @calciteDialogClose=${()=>{this._closeFilter()}} .open=${this._filterOpen} width=s><div>${this.mapView&&l`<instant-apps-filter-list close-btn .closeBtnOnClick=${()=>{this._closeFilter()}} combobox-overlay-positioning=fixed .layerExpressions=${this._currentLayerExpressions} @filterListReset=${()=>{this._filterActive=!1,this._featureList.value&&this._featureList.value.refresh()}} @filterUpdate=${()=>{this._filterList?.filterCount!==void 0&&this._handleFilterUpdate(this._filterList?.filterCount>0)}} .view=${this.mapView} ${o(this._setFilterList)}></instant-apps-filter-list>`||""}</div></calcite-dialog>`||""}_setFilterList(e){this._filterList=e,e&&(e.autoUpdateUrl=!1,e.resetBtn=this.isMobile,e.resetFiltersOnDisconnect=!1,e.zoomBtn=!1)}_adjustAlertStyles(){this.reportSubmittedMessage&&this._reportSubmittedAlertNode.value?.children[0]&&(this._reportSubmittedAlertNode.value.children[0].style.margin="0px"),this.commentSubmittedMessage&&this._commentSubmittedAlertNode.value?.children[0]&&(this._commentSubmittedAlertNode.value.children[0].style.margin="0px")}_toggleFilter(){this._filterOpen=!this._filterOpen}async _closeFilter(){this._filterOpen=!1,this._filterList!=null&&(this._currentLayerExpressions=await this._filterList.getCurrentLayerExpressions(),this._showFilterIcon=this._currentLayerExpressions?.length>0)}async sortOptionClick(e,t,i){this._updatedSorting={field:e,order:t},this._updatedSortOption=i,this._sortPopoverNode.value&&(this._sortPopoverNode.value.open=!1)}_toggleSort(){let e=this.reportingOptions&&this.reportingOptions[this._selectedLayerId]&&this.reportingOptions[this._selectedLayerId].like&&this.reportingOptions[this._selectedLayerId].likeField;return l`<calcite-popover auto-close label offset-distance=0 .placement=${this.isMobile?"leading-start":"bottom-start"} pointer-disabled reference-element=sort-popover ${o(this._sortPopoverNode)}><calcite-list label selection-mode=single-persist><calcite-list-item .label=${this._translations.sortNewest} @calciteListItemSelect=${()=>{this._selectedLayer&&this.sortOptionClick(this._selectedLayer.objectIdField,"desc","newest")}} .selected=${this._updatedSortOption==="newest"} value=newest></calcite-list-item><calcite-list-item .label=${this._translations.sortOldest} @calciteListItemSelect=${()=>{this._selectedLayer&&this.sortOptionClick(this._selectedLayer.objectIdField,"asc","oldest")}} .selected=${this._updatedSortOption==="oldest"} value=oldest></calcite-list-item>${e&&l`<calcite-list-item .label=${this._translations.sortHighestVoted} @calciteListItemSelect=${()=>{let t=this.reportingOptions&&this.reportingOptions[this._selectedLayerId].likeField;t!==void 0&&this.sortOptionClick(t,"desc","highestVoted")}} .selected=${this._updatedSortOption==="highestVoted"} value=highestVoted></calcite-list-item><calcite-list-item .label=${this._translations.sortLowestVoted} @calciteListItemSelect=${()=>{let t=this.reportingOptions&&this.reportingOptions[this._selectedLayerId].likeField;t&&this.sortOptionClick(t,"asc","lowestVoted")}} .selected=${this._updatedSortOption==="lowestVoted"} value=lowestVoted></calcite-list-item>`||""}</calcite-list></calcite-popover>`}async _handleFilterListReset(){this._filterActive=!1}async _handleFilterUpdate(e){this._showLoadingIndicator=!0,this._filterActive=e,this._featureList.value&&await this._featureList.value.refresh(),this._showLoadingIndicator=!1}getLayerListFlowItem(){return l`<calcite-flow-item .collapsed=${this.isMobile&&this._sidePanelCollapsed} .heading=${this.reportsHeader} .loading=${this._showLoadingIndicator} .selected=${this._flowItems[this._flowItems.length-1]==="layer-list"}>${this.isMobile&&this.getActionToExpandCollapsePanel()||""}${this._hasValidLayers&&this.enableNewReports&&l`<calcite-button appearance=solid @click=${this.navigateToChooseCategory} slot=footer width=full>${this.reportButtonText?this.reportButtonText:this._translations.createReportButtonText}</calcite-button>`||""}<calcite-panel><layer-list .applyLayerViewFilter=${this.showMyReportsOnly} class="height-full" .filterByMapExtent=${this.filterByMapExtent} .layers=${this._editableLayerIds?.length>0?this._editableLayerIds:this._layers} .mapView=${this.mapView} @layerSelect=${this.displayFeaturesList} @layersListLoaded=${this.layerListLoaded} show-feature-count show-next-icon ${o(this._layerList)}></layer-list></calcite-panel></calcite-flow-item>`}getChooseCategoryFlowItem(){let e=this.reportingOptions?Object.keys(this.reportingOptions).filter(t=>this.reportingOptions&&this.reportingOptions[t].visible&&this.reportingOptions[t].reporting&&this._layerItemsHash&&this._layerItemsHash[t]&&this._layerItemsHash[t].supportsAdd):[];return l`<calcite-flow-item .collapsed=${this.isMobile&&this._sidePanelCollapsed} .heading=${this.reportButtonText?this.reportButtonText:this._translations.createReportButtonText} @calciteFlowItemBack=${this.backFromSelectedPanel} .selected=${this._flowItems[this._flowItems.length-1]==="reporting-layer-list"}><calcite-panel><div class="progress-bar"><calcite-progress type=determinate .value=${this._updatedProgressBarStatus}></calcite-progress></div><calcite-notice class="notice-msg" icon=lightbulb kind=success open><div slot=message>${this._translations.chooseCategoryMsg}</div></calcite-notice><layer-list class="height-full" .layers=${e} .mapView=${this.mapView} @layerSelect=${this.navigateToCreateFeature}></layer-list></calcite-panel></calcite-flow-item>`}getFeatureCreateFlowItem(){return l`<calcite-flow-item .collapsed=${this.isMobile&&this._sidePanelCollapsed} .heading=${this._selectedLayerName} @calciteFlowItemBack=${this.backFromCreateFeaturePanel} .selected=${this._flowItems[this._flowItems.length-1]==="feature-create"}>${this._showSubmitCancelButton&&l`<div class=width-full slot=footer><calcite-button appearance=solid class="footer-top-button footer-button" .disabled=${this._submitNextButtonDisabled} @click=${this._showNextButton?this.onNextButtonClick.bind(this):this.onCreateFeatureSubmitButtonClick.bind(this)} width=full>${this._showNextButton?this._translations.next:this._translations.submit}</calcite-button><calcite-button appearance=outline class=footer-button @click=${this.backFromCreateFeaturePanel} width=full>${this._translations.cancel}</calcite-button></div>`||""}<calcite-panel><div class="progress-bar"><calcite-progress type=determinate .value=${this._updatedProgressBarStatus}></calcite-progress></div><create-feature app-name=reporter .aiImageExtraction=${this.aiImageExtraction} class="height-full overflow-auto" customize-submit enable-search .enablePhotoLocation=${this.enablePhotoLocation} .enableSnapping=${this.enableSnapping} .floorLevel=${this.floorLevel} .formElements=${this._formElements.find(e=>e.id===this._selectedLayerId)} .reportingAreaLayer=${this.reportingAreaLayer} .isMobile=${this.isMobile} .mapView=${this.mapView} @drawComplete=${this.onFormReady} @editingLocation=${this.editingLocation} @editingAttachment=${this.showSubmitCancelButton} @fail=${this.createFeatureFailed} @modeChanged=${this.backFromCreateFeaturePanel} @progressStatus=${this.updatedProgressStatus} @success=${this.onReportSubmitted} .searchConfiguration=${this.searchConfiguration} .selectedLayerId=${this._selectedLayerId} .reportingArea=${this.reportingArea} .reportingAreaMessage=${this.reportingAreaMessage} .submitNewReportsMessage=${this.submitNewReportsMessage} update-map-position ${o(this._createFeature)}></create-feature></calcite-panel></calcite-flow-item>`}updatedProgressStatus(e){this._updatedProgressBarStatus=e.detail}onFormReady(e){this._submitNextButtonDisabled=e.detail,this._showSubmitCancelButton=!0}editingLocation(){this._showNextButton=!0}showSubmitCancelButton(e){this._showSubmitCancelButton=!e.detail}onCreateFeatureSubmitButtonClick(){this._createFeature.value&&(this._showNextButton=!1,this._createFeature.value.submit())}backFromCreateFeaturePanel(){this._createFeature.value&&(this._showSubmitCancelButton=!1,this._showNextButton=!1,this.updateNonVisibleLayersOnMap(!1)),this.backFromSelectedPanel()}onNextButtonClick(){this._createFeature.value&&(this._showNextButton=!1,this._showSubmitCancelButton=!0,this._createFeature.value.showForm())}onCreateRelatedFeatureSubmitButtonClick(){this._createRelatedFeature.value&&this._createRelatedFeature.value.submit()}backFromCreateRelatedFeaturePanel(){this._createRelatedFeature.value&&(this._showSubmitCancelButton=!1),this.backFromSelectedPanel()}createFeatureFailed(e){console.error(e.detail),this._featureCreationFailedErrorMsg=e.detail.message}async onReportSubmitted(){this._showSubmitCancelButton=!1,this.updateNonVisibleLayersOnMap(!1),await this.navigateToHomePage(),this._reportSubmitted=!0,this._updatedProgressBarStatus=25,this._showFullPanel&&this.updatePanelState(this._sidePanelCollapsed,!1)}addCommentFailed(e){console.error(e.detail),this._addingCommentFailed=!0}async onCommentSubmitted(){this._commentSubmitted=!0,this.backFromCreateRelatedFeaturePanel(),this._showLoadingIndicator=!0,this._featureDetails.value&&await this._featureDetails.value.refresh(this._currentFeature),setTimeout(()=>{this._showLoadingIndicator=!1},300)}async navigateToHomePage(){await this.setSelectedFeatures([]),this._layerList.value&&await this._layerList.value.refresh(),this._editableLayerIds.length===1?(this._featureList.value&&await this._featureList.value.refresh(),this._flowItems=["feature-list"]):this._flowItems=["layer-list"]}async navigateToCreateFeature(e){e.detail.layerId&&e.detail.layerName&&await this.setSelectedLayer(e.detail.layerId,e.detail.layerName),this.updateNonVisibleLayersOnMap(!0),this._getFormElements(),this._showSubmitCancelButton=!1,this._showNextButton=!1,this.updatePanelState(!1,!0),this._flowItems=[...this._flowItems,"feature-create"]}navigateToChooseCategory(){this.updatePanelState(!1,!0),this._flowItems=[...this._flowItems,"reporting-layer-list"]}updateNonVisibleLayersOnMap(e){this._nonVisibleValidLayers.find(t=>t.id===this._selectedLayerId)&&this._selectedLayer&&this._selectedLayer.set("visible",e)}async layerListLoaded(e){if(this._layerList.value&&this._flowItems[this._flowItems.length-1]==="layer-list"||this._flowItems[0]==="feature-list"){let t=e.detail,i=this.mapView&&await _(this.mapView),s=[];if(this._validLayers=[],this._nonVisibleValidLayers=[],i?.forEach(a=>{t.includes(a.id)&&(this._validLayers.push(a),a.visible||this._nonVisibleValidLayers.push(a),this._getLayersConfig(a.id)?.reporting&&this._layerItemsHash&&this._layerItemsHash[a.id]&&this._layerItemsHash[a.id].supportsAdd&&s.push(a.id))}),this.handleMapClick(),this._hasValidLayers=s.length>0,!this._urlParamsLoaded&&this._editableLayerIds.length>1&&this.layerId&&this.objectId){let a=this.mapView&&await d(this.mapView,this.layerId);a&&await this.displayFeaturesList({detail:{layerId:a.id,layerName:a.title}}),this._urlParamsLoaded=!0,await this.loadFeatureFromURLParams()}}}async displayFeaturesList(e){this._showLoadingIndicator=!0,await this.setSelectedLayer(e.detail.layerId,e.detail.layerName),this.updateSortingOptions(),this.handleSelectedLayersFilter(),this._flowItems=[...this._flowItems,"feature-list"],this._prevSelectedLayerId=this._selectedLayerId,this._showLoadingIndicator=!1}updateSortingOptions(){let e=this.sortOption===""?"newest":this.sortOption,t=e==="oldest"||e==="lowestVoted"?"asc":"desc",i=this.reportingOptions?.[this._selectedLayerId]?.like?this.reportingOptions?.[this._selectedLayerId]?.likeField:"",s=this._selectedLayer&&(e==="newest"||e==="oldest")?this._selectedLayer?.objectIdField:i;this._updatedSorting={field:s||"",order:t},this._updatedSortOption=!i&&(e==="highestVoted"||e==="lowestVoted")?"newest":e}async backFromFilterPanel(){this._filterList!=null&&(this._currentLayerExpressions=await this._filterList.getCurrentLayerExpressions(),this._showFilterIcon=this._currentLayerExpressions?.length>0),this._featureList.value&&await this._featureList.value.refresh(),this.backFromSelectedPanel()}backFromSelectedPanel(){this._updatedProgressBarStatus=25;let e=[...this._flowItems];if(e[e.length-1]==="comment-details"||e[e.length-1]==="add-comment"||this.clearHighlights(),(e[e.length-1]==="reporting-layer-list"||e[e.length-1]==="feature-create"&&(e[0]==="feature-list"||e[e.length-2]==="feature-list"))&&this.updatePanelState(this._sidePanelCollapsed,!1),e.pop(),e.length===1&&e[0]==="layer-list"){this.navigateToHomePage();return}this._flowItems=[...e]}toggleSidePanel(){this._sidePanelCollapsed=!this._sidePanelCollapsed,this.togglePanel.emit({panelState:this._sidePanelCollapsed,isFormOpen:this._showFullPanel})}updatePanelState(e,t){this._sidePanelCollapsed=e,this._showFullPanel=t,this.togglePanel.emit({panelState:this._sidePanelCollapsed,isFormOpen:this._showFullPanel})}async onFeatureSelectFromList(e){await this.setSelectedFeatures([e.detail]),this._flowItems=[...this._flowItems,"feature-details"]}async getRelatedTable(){let e=this._currentFeature?.layer,t=this.mapView&&await f(this.mapView);e.relationships?.some(i=>{let s=t?.filter(a=>e.url===a.url&&a.layerId===i.relatedTableId);return s&&s.length>0?(this._relatedTable=s[0],!0):!1})}async updatingFeatureDetails(e){this._showLoadingIndicator=e}async selectionChanged(e){this.updatingFeatureDetails(!0),await this.setCurrentFeature(e.detail.selectedFeature[0]),this.highlightOnMap(e.detail.selectedFeature[0]),this._selectedFeatureIndex=e.detail.selectedFeatureIndex,this._featureDetails.value&&await this._featureDetails.value.refresh(e.detail.selectedFeature[0])}showAddCommentsPanel(){this._flowItems=[...this._flowItems,"add-comment"]}async onCommentSelectFromList(e){this._selectedRelatedFeature=[e.detail],this._flowItems=[...this._flowItems,"comment-details"]}getFeatureListFlowItem(e,t){let i=this._getLayersConfig(this._selectedLayerId)?.reporting&&this._layerItemsHash&&this._layerItemsHash[this._selectedLayerId].supportsAdd,s=this._showFilterIcon;return l`<calcite-flow-item .collapsed=${this.isMobile&&this._sidePanelCollapsed} .heading=${t} .loading=${!this.isMobile&&this._showLoadingIndicator} @calciteFlowItemBack=${this.backFromSelectedPanel} .selected=${this._flowItems[this._flowItems.length-1]==="feature-list"}>${this._toggleSort()}<calcite-action appearance=solid icon=sort-ascending-arrow id=sort-popover slot=header-actions-end .text=${this._translations.sort} title=${this._translations.sort??p}></calcite-action>${s&&l`<calcite-action appearance=solid icon=filter .indicator=${this._filterActive} @click=${()=>{this.isMobile?this._toggleFilter():this._flowItems=[...this._flowItems,"filter-panel"]}} slot=header-actions-end .text=${this._translations.filter} title=${this._translations.filter??p}></calcite-action>`||""}${this.isMobile&&this.getActionToExpandCollapsePanel()||""}${this.enableNewReports&&i&&l`<calcite-button appearance=solid @click=${this.navigateToCreateFeature} slot=footer width=full>${this.reportButtonText?this.reportButtonText:this._translations.createReportButtonText}</calcite-button>`||""}<calcite-panel>${l`<feature-list .applyLayerViewFilter=${this.showMyReportsOnly} class="height-full" .filterByMapExtent=${this.filterByMapExtent} highlight-on-hover .mapView=${this.mapView} .noFeaturesFoundMsg=${this._translations.featureErrorMsg} @featureClick=${()=>{this._showLoadingIndicator=!0}} @featureSelect=${this.onFeatureSelectFromList} page-size=30 .reportingOptions=${this.reportingOptions} .selectedLayerId=${e} .showFeatureSymbol=${this.showFeatureSymbol} .sortingInfo=${this._updatedSorting} ${o(this._featureList)}></feature-list>`}</calcite-panel></calcite-flow-item>`}getFilterPanel(){return l`<calcite-flow-item .collapsed=${this.isMobile&&this._sidePanelCollapsed} .heading=${this._translations.filterLayerTitle.replace("{{title}}",this._selectedLayerName)} .loading=${this._showLoadingIndicator} @calciteFlowItemBack=${this.backFromFilterPanel} .selected=${this._flowItems[this._flowItems.length-1]==="filter-panel"}>${this.isMobile&&this.getActionToExpandCollapsePanel()||""}<div class=width-full slot=footer><div class=width-full slot=footer><calcite-button appearance=solid class="footer-top-button footer-button" .disabled=${!this._filterActive} @click=${this.resetFilterList} width=full>${this._translations.resetFilter}</calcite-button><calcite-button appearance=outline class=footer-button @click=${this.backFromFilterPanel} width=full>${this._translations.close}</calcite-button></div></div><calcite-panel>${this.mapView&&l`<instant-apps-filter-list .closeBtnOnClick=${()=>{}} combobox-overlay-positioning=fixed .layerExpressions=${this._currentLayerExpressions} @filterListReset=${()=>{this._handleFilterListReset()}} @filterUpdate=${()=>{let e=this._filterList?.filterCount;e!==void 0&&this._handleFilterUpdate(e>0)}} .view=${this.mapView} ${o(this._setFilterList)}></instant-apps-filter-list>`||""}</calcite-panel></calcite-flow-item>`}getFeatureDetailsFlowItem(){let e=this._selectedLayer?.relationships,t=this._getLayersConfig(this._selectedLayerId)?.comment&&e&&e.length>0&&this._relatedTable;return l`<calcite-flow-item .collapsed=${this.isMobile&&this._sidePanelCollapsed} .heading=${this._selectedLayerName} .loading=${this._showLoadingIndicator} @calciteFlowItemBack=${this.backFromSelectedPanel} .selected=${this._flowItems[this._flowItems.length-1]==="feature-details"}>${this.isMobile&&this.getActionToExpandCollapsePanel()||""}${this.mapView&&l`<instant-apps-social-share class=share-node flip-rtl popover-button-icon-scale=s remove-popover-offset scale=m share-button-color=neutral share-button-type=action slot=header-actions-end social-media .view=${this.mapView} ${o(this._shareNode)}></instant-apps-social-share>`||""}${this._selectedFeature.length>1&&this.getFeaturesPagination()||""}<calcite-panel><feature-details class=full-height .enableSnapping=${this.enableSnapping} .graphics=${this._selectedFeature} .layerItemsHash=${this._layerItemsHash} .mapView=${this.mapView} @addComment=${this.showAddCommentsPanel} @commentClick=${()=>{this._showLoadingIndicator=!0}} @commentSelect=${this.onCommentSelectFromList} @featureSelectionChange=${this.selectionChanged} @likeOrDislikeClicked=${()=>{this._featureList.value&&this._featureList.value.refresh(!0)}} @loadingStatus=${i=>{this.updatingFeatureDetails(i.detail)}} .reportingOptions=${this.reportingOptions} .showFullCommentTitle=${this.showFullCommentTitle} .showUserImageInCommentsList=${this.showUserImageInCommentsList} ${o(this._featureDetails)}></feature-details>${t&&l`<calcite-button appearance=solid @click=${this.showAddCommentsPanel} slot=footer width=full>${this.commentButtonText||this._translations.comment}</calcite-button>`||""}</calcite-panel></calcite-flow-item>`}getFeaturesPagination(){return l`<div class="feature-pagination"><div><calcite-button appearance=transparent icon-start=chevron-left icon-flip-rtl=both id=solutions-back @click=${()=>this._featureDetails.value&&void this._featureDetails.value.back()} scale=s width=full></calcite-button><calcite-tooltip placement=top reference-element=solutions-back><span>${this._translations.back}</span></calcite-tooltip></div><calcite-button appearance=transparent @click=${()=>this._featureDetails.value&&void this._featureDetails.value.toggleListView()} scale=s><span class="pagination-count">${this._getCount()}</span></calcite-button><div><calcite-button appearance=transparent icon-flip-rtl=both icon-start=chevron-right id=solutions-next @click=${()=>this._featureDetails.value&&void this._featureDetails.value.next()} scale=s width=full></calcite-button><calcite-tooltip placement=top reference-element=solutions-next><span>${this._translations.next}</span></calcite-tooltip></div></div>`}getCommentDetailsFlowItem(){return l`<calcite-flow-item .collapsed=${this.isMobile&&this._sidePanelCollapsed} .heading=${this._relatedTable?.title||""} @calciteFlowItemBack=${this.backFromSelectedPanel} .selected=${this._flowItems[this._flowItems.length-1]==="comment-details"}>${this.isMobile&&this.getActionToExpandCollapsePanel()||""}<calcite-panel><info-card .enableSnapping=${this.enableSnapping} .graphics=${this._selectedRelatedFeature} .mapView=${this.mapView} @selectionChanged=${()=>{this._showLoadingIndicator=!1}}></info-card></calcite-panel></calcite-flow-item>`}getAddCommentFlowItem(){return l`<calcite-flow-item .collapsed=${this.isMobile&&this._sidePanelCollapsed} .heading=${this._relatedTable?.title||""} @calciteFlowItemBack=${this.backFromCreateRelatedFeaturePanel} .selected=${this._flowItems[this._flowItems.length-1]==="add-comment"}>${this.isMobile&&this.getActionToExpandCollapsePanel()||""}<div class=width-full slot=footer>${this._showSubmitCancelButton&&l`<div class=width-full slot=footer><calcite-button appearance=solid class="footer-top-button footer-button" @click=${this.onCreateRelatedFeatureSubmitButtonClick} width=full>${this._translations.submit}</calcite-button><calcite-button appearance=outline class=footer-button @click=${this.backFromCreateRelatedFeaturePanel} width=full>${this._translations.cancel}</calcite-button></div>`||""}</div><calcite-panel><create-related-feature customize-submit .enableSnapping=${this.enableSnapping} .mapView=${this.mapView} @fail=${this.addCommentFailed} @formReady=${this.onFormReady} @isActionPending=${this.showSubmitCancelButton} @success=${this.onCommentSubmitted} .selectedFeature=${this._currentFeature} .table=${this._relatedTable} ${o(this._createRelatedFeature)}></create-related-feature></calcite-panel></calcite-flow-item>`}async setSelectedFeatures(e){this._selectedFeature=e,await this.setCurrentFeature(this._selectedFeature.length?this._selectedFeature[0]:void 0)}async setCurrentFeature(e){if(this._currentFeature=e,e&&e.layer){let t=e.layer;t.title&&this.setSelectedLayer(t.id,t.title),this._currentFeatureId=e.attributes[t.objectIdField],this._getLayersConfig(t.id)?.comment&&t.relationships&&t.relationships.length>0&&await this.getRelatedTable()}else this._editableLayerIds.length>1&&(this.setSelectedLayer("",""),this.handlePrevLayersFilter()),this._currentFeatureId="";this._updateShareURL()}async highlightOnMap(e){if(this.clearHighlights(),e&&e.geometry&&e.layer&&e.layer.id!==void 0){let t=this.mapView&&await m(this.mapView,e.layer.id.toString());if(t){let i=Number(e.getObjectId());this._highlightHandle=this.mapView&&await x([i],t,this.mapView,!0,this.zoomToScale)}}this.updatingFeatureDetails(!1)}clearHighlights(){this._highlightHandle&&this._highlightHandle.remove()}getActionToExpandCollapsePanel(){return l`<calcite-action appearance=solid .icon=${this._sidePanelCollapsed?"chevrons-up":"chevrons-down"} @click=${this.toggleSidePanel} slot=header-actions-end .text=${(this._sidePanelCollapsed?this._translations.expand:this._translations.collapse)||""}></calcite-action>`}async setMapView(){this.mapView&&await f(this.mapView),await this.getLayersToShowInList(),await this._updateFeatures(),this._editableLayerIds?.length===1?await this.renderFeaturesList():this._flowItems=["layer-list"],this.mapView&&(this.mapView.popupEnabled=!1,this._defaultCenter&&this._defaultLevel&&(await this.mapView.goTo({center:this._defaultCenter,zoom:this._defaultLevel}),this._defaultCenter=void 0,this._defaultLevel=void 0))}handleMapClick(){this._mapClickHandle&&this._mapClickHandle.remove(),this._mapClickHandle=E.on(()=>this.mapView,"click",e=>{this.mapView&&(this.mapView.popupEnabled=!1),this.onMapClick(e)})}async onMapClick(e){if(!(this._flowItems[this._flowItems.length-1]==="feature-create"||this._flowItems[this._flowItems.length-1]==="add-comment")&&this.mapView){let t=await this.mapView.hitTest(e),i=[],s=[],a=[],n=!1;t.results.length>0&&t.results.forEach(r=>{r.type==="graphic"&&i.push(r.graphic)}),i.length>0&&(await this._setReportingGraphics(i),s=this._getNonReportingLayerGraphics(i)),this._mapImageryLayersId.length>0&&(a=await this._getIdentifiedGraphics(e.mapPoint),n=a.length>0);let h=s.concat(a);if(h.length>0){this.mapView.popupEnabled=!0;let r={features:h,location:e.mapPoint,updateLocationEnabled:!n};await this.mapView.openPopup(r)}}}async _setReportingGraphics(e){let t=e.filter(i=>{if(i.layer?.type==="feature"){let s=i.layer;return this._validLayers.includes(s)}else return!1});this._selectedLayer&&this._selectedFeature.length>0&&this._selectedLayer.id===t[0]?.layer?.id&&t[0].attributes[this._selectedLayer.objectIdField]===this._selectedFeature[0].attributes[this._selectedLayer.objectIdField]||t.length>0&&(await this.setSelectedFeatures(t),this._flowItems.length&&this._flowItems.includes("feature-details")?(this._flowItems=[...this._flowItems.slice(0,this._flowItems.indexOf("feature-details")+1)],await this.highlightOnMap(e[0])):this._flowItems=[...this._flowItems,"feature-details"])}_getNonReportingLayerGraphics(e){return e.filter(t=>{if(t.layer?.type==="feature"){let i=t.layer;return!this._validLayers.includes(i)&&i?.popupEnabled&&i?.id}else return!1})}async _getIdentifiedGraphics(e){let t=new O({geometry:e,tolerance:3,mapExtent:this.mapView?.extent}),i,s=[];for(let n of this._mapImageryLayersId){let h=this.mapView&&await d(this.mapView,n);if(h?.url&&t)try{let r=await k?.identify(h.url,t);if(r?.results?.length){s=r.results,i=h;break}}catch(r){console.error(r)}}let a=[];return s.forEach(n=>{let h=n.layerId,r=i?.sublayers?.items.find(P=>P.id===h),w=r?.popupTemplate;r?.popupEnabled&&w&&(n.feature.popupTemplate=w,a.push(n.feature))}),a}_getCount(){let e=(this._selectedFeatureIndex+1).toString(),t=this._selectedFeature.length.toString();return this._translations.indexOfTotal.replace("{{index}}",e).replace("{{total}}",t)}_updateFloorDefinitionExpression(e){let t=`${e?.floorInfo?.floorField} = '${this.floorLevel}'`,i=e.definitionExpression;e.definitionExpression=i&&i?.indexOf(this._floorExpression)>-1?i.replace(this._floorExpression,t):t,this._floorExpression=t}_getFormElements(){let e=this._selectedLayer;if(e?.floorInfo?.floorField&&this.floorLevel&&e?.formTemplate){let t=this._formElements.find(i=>i.id===e.id);(this._formElements.length===0||!t)&&this._formElements.push({id:e.id,orgElements:e.formTemplate.elements,orgExpressionInfos:e.formTemplate.expressionInfos})}}reduceToConfiguredLayers(e,t){return Object.keys(e).reduce((i,s)=>{let a=this.reportingOptions?this._getLayersConfig(s)?.visible:e[s].supportsAdd;return!t.includes(s)&&a&&i.push(s),i},[])}refreshLists(){setTimeout(()=>{this._layerList.value&&this._flowItems[this._flowItems.length-1]==="layer-list"&&this._layerList.value.refresh(),this._featureList.value&&this._featureList.value.refresh()},50)}async _updateFeatures(){for(let e of this._editableLayerIds){let t=this.mapView&&await m(this.mapView,e);t&&(await this._showMyFeaturesOnly(t),t.layer?.floorInfo?.floorField&&this.floorLevel&&this._updateFloorDefinitionExpression(t.layer))}}async _showMyFeaturesOnly(e){let t=(this.mapView?.map).portalItem.portal?.credential?.userId;if(t&&e){let i=e.layer.editFieldsInfo?.creatorField.toLowerCase();e.filter=this.showMyReportsOnly&&i?new V({where:`${i} = '${t}'`}):null}}async getLayersToShowInList(){let e=this.mapView&&await C(this.mapView,!1),t=this.mapView&&await _(this.mapView),i=[];t?.forEach(s=>{s?.type==="feature"&&s?.editingEnabled&&s?.capabilities?.operations?.supportsAdd&&(e[s.id].supportsAdd=!0),s?.editingEnabled||i.push(s.id)}),this._editableLayerIds=this.reduceToConfiguredLayers(e,i),this._layerItemsHash=e}async renderFeaturesList(){this._flowItems=["feature-list"];let e={detail:this._editableLayerIds};await this.layerListLoaded(e),await this.setSelectedLayer(this._validLayers[0].id,this._validLayers[0]?.title||""),this.updateSortingOptions(),await this.handleSelectedLayersFilter(),this._urlParamsLoaded||(this._urlParamsLoaded=!0,await this.loadFeatureFromURLParams())}_updateShareURL(){let e=this._shareNode.value?.shareUrl;if(!e)return;let t=new URL(e);this._selectedLayerId?t.searchParams.set("layerid",this._selectedLayerId):t.searchParams.delete("layerid"),this._selectedFeature?.length?t.searchParams.set("oid",this._currentFeatureId):t.searchParams.delete("oid"),this._shareNode.value&&(this._shareNode.value.autoUpdateShareUrl=!1,this._shareNode.value.shareUrl=t.href)}async loadFeatureFromURLParams(){if(this.center&&this.level&&await this.mapView?.goTo({center:this.center.split(";").map(Number),zoom:parseInt(this.level,10)}),this.layerId&&this.objectId){let e=this.mapView&&await d(this.mapView,this.layerId);if(e){let t=this.mapView&&await v([Number(this.objectId)],e,[],!0,this.mapView.spatialReference);t?.length&&(await this.setSelectedFeatures(t),this._flowItems.length&&this._flowItems[this._flowItems.length-1]!=="feature-details"?this._flowItems=[...this._flowItems,"feature-details"]:this._flowItems=[...this._flowItems])}}}async handleSelectedLayersFilter(){if(this._selectedLayer){let e=this.layerExpressions?structuredClone(this.layerExpressions.filter(t=>t.id===this._selectedLayerId)):[];this._t9nLayerExpressions!=null&&this.handleLayerExpressionsT9n(e,this._t9nLayerExpressions),this._currentLayerExpressions=e,this._showFilterIcon=this._currentLayerExpressions?.length>0,this.setActiveDefinitionExpressions()}}async handlePrevLayersFilter(){if(this._prevSelectedLayerId){let e=this.mapView&&await d(this.mapView,this._prevSelectedLayerId);e&&this._initDefExpressions&&(e.definitionExpression=this._initDefExpressions[this._prevSelectedLayerId])}}async resetFilterList(){await this._filterList?.forceReset(),this._selectedLayer!==void 0&&this._initDefExpressions&&(this._selectedLayer.definitionExpression=this._initDefExpressions[this._selectedLayerId],this._filterActive=!1)}setActiveDefinitionExpressions(){if(this._selectedLayer===void 0)return;let e=[];if(this._currentLayerExpressions&&this._currentLayerExpressions?.length>0){let t=this._currentLayerExpressions[0];for(let i of t.expressions){let{active:s,definitionExpression:a}=i;s&&a&&e.push(`(${a})`)}this._filterActive=e.length>0,this.updateFilterLayerDefExpression(e,t.operator)}}updateFilterLayerDefExpression(e,t){let i=this._initDefExpressions&&this._initDefExpressions[this._selectedLayerId],s=e?.length>0&&i?`(${e.join(t)}) AND (${i})`:e.length>0?e.join(t):i;this._selectedLayer&&(this._selectedLayer.definitionExpression=s)}setInitExpressions(){if(this._initDefExpressions={},this.mapView==null)return;let e=this.mapView.map;e.allLayers.concat(e.allTables.toArray()).forEach(t=>{if(t.type==="map-image"&&t.popupEnabled&&!this._mapImageryLayersId.includes(t.id)){this._mapImageryLayersId.push(t.id);return}if(t.type!=="feature")return;let i=t;this._initDefExpressions&&(this._initDefExpressions[i.id]=i.definitionExpression||"")})}handleLayerExpressionsT9n(e,t){e?.forEach(i=>{let s=t?.find(a=>a.id===i.id);s!=null&&(i.title=s.title,i.expressions?.forEach(a=>{let n=s.expressions?.find(h=>h.id===a.id);n!=null&&(a.name=n.name)}))})}};I("crowdsource-reporter",g);return g},"core/reactiveUtils","layers/support/FeatureFilter","rest/identify","rest/support/IdentifyParameters",a,d)
|