esri-map-view
Version:
Display an Esri map view as a web component.
2 lines • 15.3 kB
JavaScript
function t(t,e,n){const o="undefined"!=typeof HTMLElement?HTMLElement.prototype:null;for(;t&&t!==o;){const o=Object.getOwnPropertyDescriptor(t,e);if(o&&(!n||o.get))return o;t=Object.getPrototypeOf(t)}}var e=(e,n)=>{var o;Object.entries(null!=(o=n.o.t)?o:{}).map((([o,[l]])=>{if(31&l||32&l){const l=e[o],i=t(Object.getPrototypeOf(e),o,!0)||Object.getOwnPropertyDescriptor(e,o);i&&Object.defineProperty(e,o,{get(){return i.get.call(this)},set(t){i.set.call(this,t)},configurable:!0,enumerable:!0}),n.l.has(o)?e[o]=n.l.get(o):void 0!==l&&(e[o]=l)}}))},n=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},o=(t,n)=>{n&&(t.__stencil__getHostRef=()=>n,n.i=t,512&n.o.u&&e(t,n))},l=(t,e)=>(0,console.error)(t,e),i=new Map,s=new Map,r="undefined"!=typeof window?window:{},c={u:0,h:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,o)=>t.addEventListener(e,n,o),rel:(t,e,n,o)=>t.removeEventListener(e,n,o),ce:(t,e)=>new CustomEvent(t,e)},u=t=>Promise.resolve(t),a=(()=>{try{return!!r.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),f=!!a&&(()=>!!r.document&&Object.getOwnPropertyDescriptor(r.document.adoptedStyleSheets,"length").writable)(),d=!1,h=[],p=[],m=(t,e)=>n=>{t.push(n),d||(d=!0,e&&4&c.u?b(y):c.raf(y))},v=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){l(t)}t.length=0},y=()=>{v(h),v(p),(d=h.length>0)&&c.raf(y)},b=t=>u().then(t),$=m(p,!0),w=t=>{const e=new URL(t,c.h);return e.origin!==r.location.origin?e.href:e.pathname};function j(t){var e,n,o;return null!=(o=null==(n=null==(e=t.head)?void 0:e.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?o:void 0}var g,O=new WeakMap,S=t=>"sc-"+t.p,k=t=>"object"==(t=typeof t)||"function"===t,M=(t,e,...n)=>{let o=null,l=null,i=!1,s=!1;const r=[],c=e=>{for(let n=0;n<e.length;n++)o=e[n],Array.isArray(o)?c(o):null!=o&&"boolean"!=typeof o&&((i="function"!=typeof t&&!k(o))&&(o+=""),i&&s?r[r.length-1].m+=o:r.push(i?E(null,o):o),s=i)};if(c(n),e){e.key&&(l=e.key);{const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}}const u=E(t,null);return u.v=e,r.length>0&&(u.$=r),u.j=l,u},E=(t,e)=>({u:0,O:t,m:null!=e?e:null,S:null,$:null,v:null,j:null}),C={},L=t=>{if(!t)return;const e=Object.keys(t);if(0===e.length)return;let n=!1;for(const o of e){if(n)break;for(const e of t[o])if("string"==typeof e){n=!0;break}}if(!n)return t;const o={};for(const n of e)o[n]=t[n].map((t=>"string"==typeof t?{[t]:0}:t));return o},R=(t,e)=>null==t||k(t)?t:1&e?t+"":t,D=t=>{var e;return null==(e=n(t))?void 0:e.$hostElement$},P=(t,e)=>{const n=D(t);return{emit:t=>T(n,e,{bubbles:!0,composed:!0,cancelable:!0,detail:t})}},T=(t,e,n)=>{const o=c.ce(e,n);return t.dispatchEvent(o),o},x=(t,e,o,l,i,s)=>{if(o===l)return;let r=((t,e)=>e in t)(t,e);if(e.toLowerCase(),"class"===e){const e=t.classList,n=H(o);let i=H(l);e.remove(...n.filter((t=>t&&!i.includes(t)))),e.add(...i.filter((t=>t&&!n.includes(t))))}else if("key"===e);else{if("a"===e[0]&&e.startsWith("attr:")){const o=e.slice(5);let i;{const e=n(t);if(e&&e.o&&e.o.t){const t=e.o.t[o];t&&t[1]&&(i=t[1])}}return i||(i=o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),void(null==l||!1===l?!1===l&&""!==t.getAttribute(i)||t.removeAttribute(i):t.setAttribute(i,!0===l?"":l))}if("p"===e[0]&&e.startsWith("prop:")){const n=e.slice(5);try{t[n]=l}catch(t){}return}{const n=k(l);if((r||n&&null!==l)&&!i)try{if(t.tagName.includes("-"))t[e]!==l&&(t[e]=l);else{const n=null==l?"":l;"list"===e?r=!1:null!=o&&t[e]===n||("function"==typeof t.__lookupSetter__(e)?t[e]=n:t.setAttribute(e,n))}}catch(t){}null==l||!1===l?!1===l&&""!==t.getAttribute(e)||t.removeAttribute(e):(!r||4&s||i)&&!n&&1===t.nodeType&&t.setAttribute(e,l=!0===l?"":l)}}},A=/\s/,H=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(A):[]),N=(t,e,n)=>{const o=11===e.S.nodeType&&e.S.host?e.S.host:e.S,l=t&&t.v||{},i=e.v||{};for(const t of U(Object.keys(l)))t in i||x(o,t,l[t],void 0,n,e.u);for(const t of U(Object.keys(i)))x(o,t,l[t],i[t],n,e.u)};function U(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var W=!1,z=(t,e,n)=>{const o=e.$[n];let l,i,s=0;if(!r.document)throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");if(l=o.S=r.document.createElement(o.O),N(null,o,W),o.$){const e="template"===o.O?l.content:l;for(s=0;s<o.$.length;++s)i=z(t,o,s),i&&e.appendChild(i)}return l["s-hn"]=g,l},V=(t,e,n,o,l,i)=>{let s,r=t;for("template"===n.O&&(r=r.content);l<=i;++l)o[l]&&(s=z(null,n,l),s&&(o[l].S=s,Y(r,s,e)))},q=(t,e,n)=>{for(let o=e;o<=n;++o){const e=t[o];if(e){const t=e.S;t&&t.remove()}}},F=(t,e,n=!1)=>t.O===e.O&&(n?(n&&!t.j&&e.j&&(t.j=e.j),!0):t.j===e.j),G=(t,e,n=!1)=>{const o=e.S=t.S,l=t.$,i=e.$;N(t,e,W),null!==l&&null!==i?((t,e,n,o,l=!1)=>{let i,s,r=0,c=0,u=0,a=0,f=e.length-1,d=e[0],h=e[f],p=o.length-1,m=o[0],v=o[p];const y="template"===n.O?t.content:t;for(;r<=f&&c<=p;)if(null==d)d=e[++r];else if(null==h)h=e[--f];else if(null==m)m=o[++c];else if(null==v)v=o[--p];else if(F(d,m,l))G(d,m,l),d=e[++r],m=o[++c];else if(F(h,v,l))G(h,v,l),h=e[--f],v=o[--p];else if(F(d,v,l))G(d,v,l),Y(y,d.S,h.S.nextSibling),d=e[++r],v=o[--p];else if(F(h,m,l))G(h,m,l),Y(y,h.S,d.S),h=e[--f],m=o[++c];else{for(u=-1,a=r;a<=f;++a)if(e[a]&&null!==e[a].j&&e[a].j===m.j){u=a;break}u>=0?(s=e[u],s.O!==m.O?i=z(e&&e[c],n,u):(G(s,m,l),e[u]=void 0,i=s.S),m=o[++c]):(i=z(e&&e[c],n,c),m=o[++c]),i&&Y(d.S.parentNode,i,d.S)}r>f?V(t,null==o[p+1]?null:o[p+1].S,n,o,c,p):c>p&&q(e,r,f)})(o,l,e,i,n):null!==i?V(o,null,e,i,0,i.length-1):!n&&null!==l&&q(l,0,l.length-1)},Y=(t,e,n)=>t.__insertBefore?t.__insertBefore(e,n):null==t?void 0:t.insertBefore(e,n),Z=(t,e)=>{if(e&&!t.k&&e["s-p"]){const n=e["s-p"].push(new Promise((o=>t.k=()=>{e["s-p"].splice(n-1,1),o()})))}},_=(t,e)=>{if(t.u|=16,4&t.u)return void(t.u|=512);Z(t,t.M);const n=()=>B(t,e);if(!e)return $(n);queueMicrotask((()=>{n()}))},B=(t,e)=>{const n=t.$hostElement$,o=t.i;if(!o)throw Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let l;return e?(t.C.length&&t.C.forEach((t=>t(n))),l=et(o,"componentWillLoad",void 0,n)):l=et(o,"componentWillUpdate",void 0,n),l=I(l,(()=>et(o,"componentWillRender",void 0,n))),I(l,(()=>K(t,o,e)))},I=(t,e)=>J(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),J=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,K=async(t,e,n)=>{var o;const l=t.$hostElement$,i=l["s-rc"];n&&(t=>{const e=t.o;((t,e)=>{var n,o,l;const i=S(e),u=s.get(i);if(!r.document)return i;if(t=11===t.nodeType?t:r.document,u)if("string"==typeof u){let l,s=O.get(t=t.head||t);if(s||O.set(t,s=new Set),!s.has(i)){l=r.document.createElement("style"),l.textContent=u;const d=null!=(n=c.L)?n:j(r.document);if(null!=d&&l.setAttribute("nonce",d),!(1&e.u))if("HEAD"===t.nodeName){const e=t.querySelectorAll("link[rel=preconnect]"),n=e.length>0?e[e.length-1].nextSibling:t.querySelector("style");t.insertBefore(l,(null==n?void 0:n.parentNode)===t?n:null)}else if("host"in t)if(a){const e=new(null!=(o=t.defaultView)?o:t.ownerDocument.defaultView).CSSStyleSheet;e.replaceSync(u),f?t.adoptedStyleSheets.unshift(e):t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.textContent=u+e.textContent:t.prepend(l)}else t.append(l);1&e.u&&t.insertBefore(l,null),4&e.u&&(l.textContent+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),s&&s.add(i)}}else{let e=O.get(t);if(e||O.set(t,e=new Set),!e.has(i)){const n=null!=(l=t.defaultView)?l:t.ownerDocument.defaultView;let o;if(u.constructor===n.CSSStyleSheet)o=u;else{o=new n.CSSStyleSheet;for(let t=0;t<u.cssRules.length;t++)o.insertRule(u.cssRules[t].cssText,t)}f?t.adoptedStyleSheets.push(o):t.adoptedStyleSheets=[...t.adoptedStyleSheets,o],e.add(i)}}})(t.$hostElement$.getRootNode(),e)})(t);Q(t,e,l,n),i&&(i.map((t=>t())),l["s-rc"]=void 0);{const e=null!=(o=l["s-p"])?o:[],n=()=>X(t);0===e.length?n():(Promise.all(e).then(n).catch(n),t.u|=4,e.length=0)}},Q=(t,e,n,o)=>{try{e=e.render(),t.u&=-17,t.u|=2,((t,e,n=!1)=>{const o=t.$hostElement$,l=t.o,i=t.R||E(null,null),s=(t=>t&&t.O===C)(e)?e:M(null,null,e);if(g=o.tagName,l.D&&(s.v=s.v||{},l.D.forEach((([t,e])=>{s.v[e]=o[t]}))),n&&s.v)for(const t of Object.keys(s.v))o.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(s.v[t]=o[t]);s.O=null,s.u|=4,t.R=s,s.S=i.S=o,G(i,s,n)})(t,e,o)}catch(e){l(e,t.$hostElement$)}return null},X=t=>{const e=t.$hostElement$,n=t.i,o=t.M;et(n,"componentDidRender",void 0,e),64&t.u?et(n,"componentDidUpdate",void 0,e):(t.u|=64,nt(e),et(n,"componentDidLoad",void 0,e),t.P(e),o||tt()),t.k&&(t.k(),t.k=void 0),512&t.u&&b((()=>_(t,!1))),t.u&=-517},tt=()=>{b((()=>T(r,"appload",{detail:{namespace:"esri-map-view"}})))},et=(t,e,n,o)=>{if(t&&t[e])try{return t[e](n)}catch(t){l(t,o)}},nt=t=>t.classList.add("hydrated"),ot=(t,e,o,i)=>{const s=n(t);if(!s)return;if(!s)throw Error(`Couldn't find host element for "${i.p}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`);const r=s.$hostElement$,c=s.l.get(e),u=s.u,a=s.i;if(o=R(o,i.t[e][0]),!(8&u&&void 0!==c||o===c||Number.isNaN(c)&&Number.isNaN(o))){if(s.l.set(e,o),i.T){const t=i.T[e];t&&t.map((t=>{try{const[[n,l]]=Object.entries(t);(128&u||1&l)&&(a?a[n](o,c,e):s.C.push((()=>{s.i[n](o,c,e)})))}catch(t){l(t,r)}}))}if(2&u){if(a.componentShouldUpdate&&!1===a.componentShouldUpdate(o,c,e)&&!(16&u))return;16&u||_(s,!1)}}},lt=(e,o,l)=>{var i,s;const r=e.prototype;{e.watchers&&!o.T&&(o.T=L(e.watchers)),e.deserializers&&!o.A&&(o.A=e.deserializers),e.serializers&&!o.H&&(o.H=e.serializers);const u=Object.entries(null!=(i=o.t)?i:{});if(u.map((([e,[i]])=>{if(31&i||2&l&&32&i){const{get:s,set:c}=t(r,e)||{};s&&(o.t[e][0]|=2048),c&&(o.t[e][0]|=4096),(1&l||!s)&&Object.defineProperty(r,e,{get(){{if(!(2048&o.t[e][0]))return((t,e)=>n(this).l.get(e))(0,e);const t=n(this),l=t?t.i:r;if(!l)return;return l[e]}},configurable:!0,enumerable:!0}),Object.defineProperty(r,e,{set(t){const s=n(this);if(s){if(c)return void 0===(32&i?this[e]:s.$hostElement$[e])&&s.l.get(e)&&(t=s.l.get(e)),c.call(this,R(t,i)),void ot(this,e,t=32&i?this[e]:s.$hostElement$[e],o);{if(!(1&l&&4096&o.t[e][0]))return ot(this,e,t,o),void(1&l&&!s.i&&s.C.push((()=>{4096&o.t[e][0]&&s.i[e]!==s.l.get(e)&&(s.i[e]=t)})));const n=()=>{const n=s.i[e];!s.l.get(e)&&n&&s.l.set(e,n),s.i[e]=R(t,i),ot(this,e,s.i[e],o)};s.i?n():s.C.push((()=>{n()}))}}}})}})),1&l){const t=new Map;r.attributeChangedCallback=function(e,l,i){c.jmp((()=>{var s;const c=t.get(e),a=n(this);if(this.hasOwnProperty(c)&&(i=this[c],delete this[c]),r.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==i)return;if(null==c){const t=null==a?void 0:a.u;if(a&&t&&!(8&t)&&i!==l){const n=a.i,r=null==(s=o.T)?void 0:s[e];null==r||r.forEach((o=>{const[[s,r]]=Object.entries(o);null!=n[s]&&(128&t||1&r)&&n[s].call(n,i,l,e)}))}return}const f=u.find((([t])=>t===c)),d=f&&4&f[1][0],h=d&&null===i&&void 0===this[c];d&&(i=null!==i&&"false"!==i);const p=Object.getOwnPropertyDescriptor(r,c);h||i==this[c]||p.get&&!p.set||(this[c]=i)}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=o.T)?s:{}),...u.filter((([t,e])=>31&e[0])).map((([e,n])=>{var l;const i=n[1]||e;return t.set(i,e),512&n[0]&&(null==(l=o.D)||l.push([e,i])),i}))]))}}return e},it=(t,e)=>{et(t,"connectedCallback",void 0,e)},st=(t,e)=>{et(t,"disconnectedCallback",void 0,e||t)},rt=(t,e={})=>{var o;if(!r.document)return void console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");const u=[],f=e.exclude||[],d=r.customElements,h=r.document.head,p=h.querySelector("meta[charset]"),m=r.document.createElement("style"),v=[];let y,b=!0;if(Object.assign(c,e),c.h=new URL(e.resourcesUrl||"./",r.document.baseURI).href,t.map((t=>{t[1].map((e=>{var o,r;const h={u:e[0],p:e[1],t:e[2],N:e[3]};h.t=e[2],h.D=[],h.T=L(e[4]),h.H=null!=(o=e[5])?o:{},h.A=null!=(r=e[6])?r:{};const p=h.p,m=class extends HTMLElement{"s-p";"s-rc";hasRegisteredEventListeners=!1;constructor(t){super(t),((t,e)=>{const n={u:0,$hostElement$:t,o:e,l:new Map,U:new Map};n.W=new Promise((t=>n.P=t)),t["s-p"]=[],t["s-rc"]=[],n.C=[];const o=n;t.__stencil__getHostRef=()=>o})(t=this,h)}connectedCallback(){n(this)&&(this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),y&&(clearTimeout(y),y=null),b?v.push(this):c.jmp((()=>(t=>{if(!(1&c.u)){const e=n(t);if(!e)return;const o=e.o,r=()=>{};if(1&e.u)(null==e?void 0:e.i)?it(e.i,t):(null==e?void 0:e.W)&&e.W.then((()=>it(e.i,t)));else{e.u|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){Z(e,e.M=n);break}}o.t&&Object.entries(o.t).map((([e,[n]])=>{if(31&n&&Object.prototype.hasOwnProperty.call(t,e)){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n)=>{let o;try{if(!(32&e.u)){if(e.u|=32,n.V){const s=((t,e)=>{const n=t.p.replace(/-/g,"_"),o=t.V;if(!o)return;const s=i.get(o);return s?s[n]:import(`./${o}.entry.js`).then((t=>(i.set(o,t),t[n])),(t=>{l(t,e.$hostElement$)}))
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n,e);if(s&&"then"in s){const t=()=>{};o=await s,t()}else o=s;if(!o)throw Error(`Constructor for "${n.p}#${e.q}" was not found`);o.isProxied||(n.T=L(o.watchers),n.H=o.serializers,n.A=o.deserializers,lt(o,n,2),o.isProxied=!0);const r=()=>{};e.u|=8;try{new o(e)}catch(e){l(e,t)}e.u&=-9,e.u|=128,r(),it(e.i,t)}else o=t.constructor,customElements.whenDefined(t.localName).then((()=>e.u|=128));if(o&&o.style){let t;"string"==typeof o.style&&(t=o.style);const e=S(n);if(!s.has(e)){const o=()=>{};((t,e,n)=>{let o=s.get(t);a&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=e:o.replaceSync(e)):o=e,s.set(t,o)})(e,t,!!(1&n.u)),o()}}}const r=e.M,c=()=>_(e,!0);r&&r["s-rc"]?r["s-rc"].push(c):c()}catch(n){l(n,t),e.k&&(e.k(),e.k=void 0),e.P&&e.P(t)}})(t,e,o)}r()}})(this))))}disconnectedCallback(){c.jmp((()=>(async t=>{if(!(1&c.u)){const e=n(t);(null==e?void 0:e.i)?st(e.i,t):(null==e?void 0:e.W)&&e.W.then((()=>st(e.i,t)))}O.has(t)&&O.delete(t),t.shadowRoot&&O.has(t.shadowRoot)&&O.delete(t.shadowRoot)})(this))),c.raf((()=>{var t;const e=n(this);if(!e)return;const o=v.findIndex((t=>t===this));o>-1&&v.splice(o,1),(null==(t=null==e?void 0:e.R)?void 0:t.S)instanceof Node&&!e.R.S.isConnected&&delete e.R.S}))}componentOnReady(){var t;return null==(t=n(this))?void 0:t.W}};h.V=t[0],f.includes(p)||d.get(p)||(u.push(p),d.define(p,lt(m,h,1)))}))})),u.length>0&&(m.textContent+=u.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",m.innerHTML.length)){m.setAttribute("data-styles","");const t=null!=(o=c.L)?o:j(r.document);null!=t&&m.setAttribute("nonce",t),h.insertBefore(m,p?p.nextSibling:h.firstChild)}b=!1,v.length?v.map((t=>t.connectedCallback())):c.jmp((()=>y=setTimeout(tt,30)))},ct=t=>c.L=t;export{D as a,rt as b,P as c,w as g,M as h,u as p,o as r,ct as s}