UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

2 lines • 203 kB
/*! For license information please see 8d9f637ff1b3529a8dae.js.LICENSE.txt */ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8345],{18345(e,t,n){n.r(t),n.d(t,{Dialog:()=>ti}),n(76572);var i=n(50917),o=n(34857),r=n(25339),a=n(11758),s=n(75206),l=n(27617),c=n(9223);const d=o.AH`:host{position:absolute;inset:0;z-index:var(--calcite-z-index-overlay);display:flex;block-size:100%;inline-size:100%;flex-direction:column;align-items:stretch}@keyframes calcite-scrim-fade-in{0%{--tw-bg-opacity: 0 }to{--tw-text-opacity: 1 }}.scrim{position:absolute;inset:0;display:flex;flex-direction:column;align-content:center;align-items:center;justify-content:center;overflow:hidden;animation:calcite-scrim-fade-in var(--calcite-internal-animation-timing-medium) ease-in-out;background-color:var(--calcite-scrim-background, var(--calcite-color-transparent-scrim))}.content{padding:1rem}:host([hidden]){display:none}[hidden]{display:none}`;class u extends r.WF{constructor(){super(...arguments),this.loaderRef=(0,a._)(),this.resizeObserver=(0,s.c)("resize",()=>this.handleResize()),this.messages=(0,c.u)(),this.hasContent=!1,this.loading=!1}static{this.properties={hasContent:[16,{},{state:!0}],loaderScale:[16,{},{state:!0}],loading:[7,{},{reflect:!0,type:Boolean}],messageOverrides:[0,{},{attribute:!1}]}}static{this.styles=d}connectedCallback(){super.connectedCallback(),this.resizeObserver?.observe(this.el)}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.disconnect()}handleDefaultSlotChange(e){this.hasContent=(0,l.n)(e)}getScale(e){return e<72?"s":e>=480?"l":"m"}handleResize(){const{el:e}=this;this.loaderScale=this.getScale(Math.min(e.clientHeight,e.clientWidth)??0)}render(){const{hasContent:e,loading:t,loaderScale:n,messages:i}=this;return o.qy`<div class=${(0,r.CP)("scrim")}>${t&&n?o.qy`<calcite-loader .label=${i.loading} .scale=${n} ${(0,a.K)(this.loaderRef)}></calcite-loader>`:null}<div class=${(0,r.CP)("content")} .hidden=${!e}><slot @slotchange=${this.handleDefaultSlotChange}></slot></div></div>`}}(0,i.c)("calcite-scrim",u),n(7659),n(20107);var p=n(56590),h=n(53660);const f=["top","right","bottom","left"],v=["start","end"],g=f.reduce((e,t)=>e.concat(t,t+"-"+v[0],t+"-"+v[1]),[]),m=Math.min,y=Math.max,b=Math.round,x=Math.floor,w=e=>({x:e,y:e}),E={left:"right",right:"left",bottom:"top",top:"bottom"},k={start:"end",end:"start"};function S(e,t,n){return y(e,m(t,n))}function P(e,t){return"function"==typeof e?e(t):e}function T(e){return e.split("-")[0]}function D(e){return e.split("-")[1]}function C(e){return"x"===e?"y":"x"}function z(e){return"y"===e?"height":"width"}const O=new Set(["top","bottom"]);function $(e){return O.has(T(e))?"y":"x"}function A(e){return C($(e))}function I(e,t,n){void 0===n&&(n=!1);const i=D(e),o=A(e),r=z(o);let a="x"===o?i===(n?"end":"start")?"right":"left":"start"===i?"bottom":"top";return t.reference[r]>t.floating[r]&&(a=L(a)),[a,L(a)]}function M(e){return e.replace(/start|end/g,e=>k[e])}const _=["left","right"],R=["right","left"],F=["top","bottom"],B=["bottom","top"];function L(e){return e.replace(/left|right|bottom|top/g,e=>E[e])}function H(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function N(e){const{x:t,y:n,width:i,height:o}=e;return{width:i,height:o,top:n,left:t,right:t+i,bottom:n+o,x:t,y:n}}function j(e,t,n){let{reference:i,floating:o}=e;const r=$(t),a=A(t),s=z(a),l=T(t),c="y"===r,d=i.x+i.width/2-o.width/2,u=i.y+i.height/2-o.height/2,p=i[s]/2-o[s]/2;let h;switch(l){case"top":h={x:d,y:i.y-o.height};break;case"bottom":h={x:d,y:i.y+i.height};break;case"right":h={x:i.x+i.width,y:u};break;case"left":h={x:i.x-o.width,y:u};break;default:h={x:i.x,y:i.y}}switch(D(t)){case"start":h[a]-=p*(n&&c?-1:1);break;case"end":h[a]+=p*(n&&c?-1:1)}return h}async function q(e,t){var n;void 0===t&&(t={});const{x:i,y:o,platform:r,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:p=!1,padding:h=0}=P(t,e),f=H(h),v=s[p?"floating"===u?"reference":"floating":u],g=N(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(v)))||n?v:v.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:l})),m="floating"===u?{x:i,y:o,width:a.floating.width,height:a.floating.height}:a.reference,y=await(null==r.getOffsetParent?void 0:r.getOffsetParent(s.floating)),b=await(null==r.isElement?void 0:r.isElement(y))&&await(null==r.getScale?void 0:r.getScale(y))||{x:1,y:1},x=N(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:m,offsetParent:y,strategy:l}):m);return{top:(g.top-x.top+f.top)/b.y,bottom:(x.bottom-g.bottom+f.bottom)/b.y,left:(g.left-x.left+f.left)/b.x,right:(x.right-g.right+f.right)/b.x}}function U(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function W(e){return f.some(t=>e[t]>=0)}const K=new Set(["left","top"]);function G(){return"undefined"!=typeof window}function V(e){return J(e)?(e.nodeName||"").toLowerCase():"#document"}function Y(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function X(e){var t;return null==(t=(J(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function J(e){return!!G()&&(e instanceof Node||e instanceof Y(e).Node)}function Q(e){return!!G()&&(e instanceof Element||e instanceof Y(e).Element)}function Z(e){return!!G()&&(e instanceof HTMLElement||e instanceof Y(e).HTMLElement)}function ee(e){return!(!G()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Y(e).ShadowRoot)}const te=new Set(["inline","contents"]);function ne(e){const{overflow:t,overflowX:n,overflowY:i,display:o}=fe(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&!te.has(o)}const ie=new Set(["table","td","th"]);function oe(e){return ie.has(V(e))}const re=[":popover-open",":modal"];function ae(e){return re.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const se=["transform","translate","scale","rotate","perspective"],le=["transform","translate","scale","rotate","perspective","filter"],ce=["paint","layout","strict","content"];function de(e){const t=ue(),n=Q(e)?fe(e):e;return se.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||le.some(e=>(n.willChange||"").includes(e))||ce.some(e=>(n.contain||"").includes(e))}function ue(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const pe=new Set(["html","body","#document"]);function he(e){return pe.has(V(e))}function fe(e){return Y(e).getComputedStyle(e)}function ve(e){return Q(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ge(e){if("html"===V(e))return e;const t=e.assignedSlot||e.parentNode||ee(e)&&e.host||X(e);return ee(t)?t.host:t}function me(e){const t=ge(e);return he(t)?e.ownerDocument?e.ownerDocument.body:e.body:Z(t)&&ne(t)?t:me(t)}function ye(e,t,n){var i;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=me(e),r=o===(null==(i=e.ownerDocument)?void 0:i.body),a=Y(o);if(r){const e=be(a);return t.concat(a,a.visualViewport||[],ne(o)?o:[],e&&n?ye(e):[])}return t.concat(o,ye(o,[],n))}function be(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function xe(e){const t=fe(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const o=Z(e),r=o?e.offsetWidth:n,a=o?e.offsetHeight:i,s=b(n)!==r||b(i)!==a;return s&&(n=r,i=a),{width:n,height:i,$:s}}function we(e){return Q(e)?e:e.contextElement}function Ee(e){const t=we(e);if(!Z(t))return w(1);const n=t.getBoundingClientRect(),{width:i,height:o,$:r}=xe(t);let a=(r?b(n.width):n.width)/i,s=(r?b(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const ke=w(0);function Se(e){const t=Y(e);return ue()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ke}function Pe(e,t,n,i){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),r=we(e);let a=w(1);t&&(i?Q(i)&&(a=Ee(i)):a=Ee(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Y(e))&&t}(r,n,i)?Se(r):w(0);let l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,d=o.width/a.x,u=o.height/a.y;if(r){const e=Y(r),t=i&&Q(i)?Y(i):i;let n=e,o=be(n);for(;o&&i&&t!==n;){const e=Ee(o),t=o.getBoundingClientRect(),i=fe(o),r=t.left+(o.clientLeft+parseFloat(i.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(i.paddingTop))*e.y;l*=e.x,c*=e.y,d*=e.x,u*=e.y,l+=r,c+=a,n=Y(o),o=be(n)}}return N({width:d,height:u,x:l,y:c})}function Te(e,t){const n=ve(e).scrollLeft;return t?t.left+n:Pe(X(e)).left+n}function De(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Te(e,n),y:n.top+t.scrollTop}}const Ce=new Set(["absolute","fixed"]);function ze(e,t,n){let i;if("viewport"===t)i=function(e,t){const n=Y(e),i=X(e),o=n.visualViewport;let r=i.clientWidth,a=i.clientHeight,s=0,l=0;if(o){r=o.width,a=o.height;const e=ue();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}const c=Te(i);if(c<=0){const e=i.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(i.clientWidth-t.clientWidth-o);a<=25&&(r-=a)}else c<=25&&(r+=c);return{width:r,height:a,x:s,y:l}}(e,n);else if("document"===t)i=function(e){const t=X(e),n=ve(e),i=e.ownerDocument.body,o=y(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),r=y(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let a=-n.scrollLeft+Te(e);const s=-n.scrollTop;return"rtl"===fe(i).direction&&(a+=y(t.clientWidth,i.clientWidth)-o),{width:o,height:r,x:a,y:s}}(X(e));else if(Q(t))i=function(e,t){const n=Pe(e,!0,"fixed"===t),i=n.top+e.clientTop,o=n.left+e.clientLeft,r=Z(e)?Ee(e):w(1);return{width:e.clientWidth*r.x,height:e.clientHeight*r.y,x:o*r.x,y:i*r.y}}(t,n);else{const n=Se(e);i={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return N(i)}function Oe(e,t){const n=ge(e);return!(n===t||!Q(n)||he(n))&&("fixed"===fe(n).position||Oe(n,t))}function $e(e,t,n){const i=Z(t),o=X(t),r="fixed"===n,a=Pe(e,!0,r,t);let s={scrollLeft:0,scrollTop:0};const l=w(0);function c(){l.x=Te(o)}if(i||!i&&!r)if(("body"!==V(t)||ne(o))&&(s=ve(t)),i){const e=Pe(t,!0,r,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();r&&!i&&o&&c();const d=!o||i||r?w(0):De(o,s);return{x:a.left+s.scrollLeft-l.x-d.x,y:a.top+s.scrollTop-l.y-d.y,width:a.width,height:a.height}}function Ae(e){return"static"===fe(e).position}function Ie(e,t){if(!Z(e)||"fixed"===fe(e).position)return null;if(t)return t(e);let n=e.offsetParent;return X(e)===n&&(n=n.ownerDocument.body),n}function Me(e,t){const n=Y(e);if(ae(e))return n;if(!Z(e)){let t=ge(e);for(;t&&!he(t);){if(Q(t)&&!Ae(t))return t;t=ge(t)}return n}let i=Ie(e,t);for(;i&&oe(i)&&Ae(i);)i=Ie(i,t);return i&&he(i)&&Ae(i)&&!de(i)?n:i||function(e){let t=ge(e);for(;Z(t)&&!he(t);){if(de(t))return t;if(ae(t))return null;t=ge(t)}return null}(e)||n}const _e={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:i,strategy:o}=e;const r="fixed"===o,a=X(i),s=!!t&&ae(t.floating);if(i===a||s&&r)return n;let l={scrollLeft:0,scrollTop:0},c=w(1);const d=w(0),u=Z(i);if((u||!u&&!r)&&(("body"!==V(i)||ne(a))&&(l=ve(i)),Z(i))){const e=Pe(i);c=Ee(i),d.x=e.x+i.clientLeft,d.y=e.y+i.clientTop}const p=!a||u||r?w(0):De(a,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+p.x,y:n.y*c.y-l.scrollTop*c.y+d.y+p.y}},getDocumentElement:X,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:i,strategy:o}=e;const r=[..."clippingAncestors"===n?ae(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let i=ye(e,[],!1).filter(e=>Q(e)&&"body"!==V(e)),o=null;const r="fixed"===fe(e).position;let a=r?ge(e):e;for(;Q(a)&&!he(a);){const t=fe(a),n=de(a);n||"fixed"!==t.position||(o=null),(r?!n&&!o:!n&&"static"===t.position&&o&&Ce.has(o.position)||ne(a)&&!n&&Oe(e,a))?i=i.filter(e=>e!==a):o=t,a=ge(a)}return t.set(e,i),i}(t,this._c):[].concat(n),i],a=r[0],s=r.reduce((e,n)=>{const i=ze(t,n,o);return e.top=y(i.top,e.top),e.right=m(i.right,e.right),e.bottom=m(i.bottom,e.bottom),e.left=y(i.left,e.left),e},ze(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Me,getElementRects:async function(e){const t=this.getOffsetParent||Me,n=this.getDimensions,i=await n(e.floating);return{reference:$e(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=xe(e);return{width:t,height:n}},getScale:Ee,isElement:Q,isRTL:function(e){return"rtl"===fe(e).direction}};function Re(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Fe(e,t,n,i){void 0===i&&(i={});const{ancestorScroll:o=!0,ancestorResize:r=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=i,c=we(e),d=o||r?[...c?ye(c):[],...ye(t)]:[];d.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),r&&e.addEventListener("resize",n)});const u=c&&s?function(e,t){let n,i=null;const o=X(e);function r(){var e;clearTimeout(n),null==(e=i)||e.disconnect(),i=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),r();const c=e.getBoundingClientRect(),{left:d,top:u,width:p,height:h}=c;if(s||t(),!p||!h)return;const f={rootMargin:-x(u)+"px "+-x(o.clientWidth-(d+p))+"px "+-x(o.clientHeight-(u+h))+"px "+-x(d)+"px",threshold:y(0,m(1,l))||1};let v=!0;function g(t){const i=t[0].intersectionRatio;if(i!==l){if(!v)return a();i?a(!1,i):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==i||Re(c,e.getBoundingClientRect())||a(),v=!1}try{i=new IntersectionObserver(g,{...f,root:o.ownerDocument})}catch(e){i=new IntersectionObserver(g,f)}i.observe(e)}(!0),r}(c,n):null;let p,h=-1,f=null;a&&(f=new ResizeObserver(e=>{let[i]=e;i&&i.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var e;null==(e=f)||e.observe(t)})),n()}),c&&!l&&f.observe(c),f.observe(t));let v=l?Pe(e):null;return l&&function t(){const i=Pe(e);v&&!Re(v,i)&&n(),v=i,p=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach(e=>{o&&e.removeEventListener("scroll",n),r&&e.removeEventListener("resize",n)}),null==u||u(),null==(e=f)||e.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const Be=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,i;const{placement:o,middlewareData:r,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:v=!0,...g}=P(e,t);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const m=T(o),y=$(s),b=T(s)===s,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=p||(b||!v?[L(s)]:function(e){const t=L(e);return[M(e),t,M(t)]}(s)),E="none"!==f;!p&&E&&w.push(...function(e,t,n,i){const o=D(e);let r=function(e,t,n){switch(e){case"top":case"bottom":return n?t?R:_:t?_:R;case"left":case"right":return t?F:B;default:return[]}}(T(e),"start"===n,i);return o&&(r=r.map(e=>e+"-"+o),t&&(r=r.concat(r.map(M)))),r}(s,v,f,x));const k=[s,...w],S=await q(t,g),C=[];let z=(null==(i=r.flip)?void 0:i.overflows)||[];if(d&&C.push(S[m]),u){const e=I(o,a,x);C.push(S[e[0]],S[e[1]])}if(z=[...z,{placement:o,overflows:C}],!C.every(e=>e<=0)){var O,A;const e=((null==(O=r.flip)?void 0:O.index)||0)+1,t=k[e];if(t&&("alignment"!==u||y===$(t)||z.every(e=>$(e.placement)!==y||e.overflows[0]>0)))return{data:{index:e,overflows:z},reset:{placement:t}};let n=null==(A=z.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:A.placement;if(!n)switch(h){case"bestFit":{var H;const e=null==(H=z.filter(e=>{if(E){const t=$(e.placement);return t===y||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:H[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},Le=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:i="referenceHidden",...o}=P(e,t);switch(i){case"referenceHidden":{const e=U(await q(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:W(e)}}}case"escaped":{const e=U(await q(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:W(e)}}}default:return{}}}}};function He(e){return function(e){for(let t=e;t;t=Ne(t))if(t instanceof Element&&"none"===getComputedStyle(t).display)return null;for(let t=Ne(e);t;t=Ne(t)){if(!(t instanceof Element))continue;const e=getComputedStyle(t);if("contents"!==e.display){if("static"!==e.position||de(e))return t;if("BODY"===t.tagName)return t}}return null}(e)}function Ne(e){return e.assignedSlot?e.assignedSlot:e.parentNode instanceof ShadowRoot?e.parentNode.host:e.parentNode}function je(e){const t=window.devicePixelRatio||1;return Math.round(e*t)/t}!function(){if(!o.S$){const e=_e.getOffsetParent;_e.getOffsetParent=t=>e(t,He)}}();const qe=async(e,{referenceEl:t,floatingEl:n,overlayPositioning:i="absolute",placement:o,flipDisabled:r,flipPlacements:a,offsetDistance:s,offsetSkidding:c,arrowEl:d,type:u})=>{if(!t||!n)return;const p="rtl"===(0,l.g)(n),{x:h,y:f,placement:v,strategy:g,middlewareData:m}=await((e,t,n)=>{const i=new Map,o={platform:_e,...n},r={...o.platform,_c:i};return(async(e,t,n)=>{const{placement:i="bottom",strategy:o="absolute",middleware:r=[],platform:a}=n,s=r.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=j(c,i,l),p=i,h={},f=0;for(let n=0;n<s.length;n++){const{name:r,fn:v}=s[n],{x:g,y:m,data:y,reset:b}=await v({x:d,y:u,initialPlacement:i,placement:p,strategy:o,middlewareData:h,rects:c,platform:a,elements:{reference:e,floating:t}});d=null!=g?g:d,u=null!=m?m:u,h={...h,[r]:{...h[r],...y}},b&&f<=50&&(f++,"object"==typeof b&&(b.placement&&(p=b.placement),b.rects&&(c=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:d,y:u}=j(c,p,l))),n=-1)}return{x:d,y:u,placement:p,strategy:o,middlewareData:h}})(e,t,{...o,platform:r})})(t,n,{strategy:i,placement:"auto"===o||"auto-start"===o||"auto-end"===o?void 0:Je(o,p),middleware:Ve({placement:o,flipDisabled:r,flipPlacements:a?.map(e=>Je(e,p)),offsetDistance:s,offsetSkidding:c,arrowEl:d,type:u})});if(d&&m.arrow){const{x:t,y:n}=m.arrow,i=v.split("-")[0],o=null!=t?"left":"top",r=Ze[i],a={left:"",top:"",bottom:"",right:""};"floatingLayout"in e&&(e.floatingLayout="left"===i||"right"===i?"horizontal":"vertical"),Object.assign(d.style,{...a,[o]:`${"left"==o?t:n}px`,[i]:"100%",transform:r})}const y=m.hide?.referenceHidden,b=y?"hidden":null,x=b?"none":null;n.setAttribute(Ue,v),Object.assign(n.style,{pointerEvents:x,position:g,transform:`translate(${je(h)}px,${je(f)}px)`,visibility:b})},Ue="data-placement",We=["top","bottom","right","left","top-start","top-end","bottom-start","bottom-end","right-start","right-end","left-start","left-end","leading","trailing","leading-start","leading-end","trailing-start","trailing-end"],Ke="calcite-floating-ui-anim",Ge="calcite-floating-ui-anim--active";function Ve({placement:e,flipDisabled:t,flipPlacements:n,offsetDistance:i,offsetSkidding:o,arrowEl:r,type:a}){const s=[(void 0===l&&(l={}),{name:"shift",options:l,async fn(e){const{x:t,y:n,placement:i}=e,{mainAxis:o=!0,crossAxis:r=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=P(l,e),c={x:t,y:n},d=await q(e,s),u=$(T(i)),p=C(u);let h=c[p],f=c[u];if(o){const e="y"===p?"bottom":"right";h=S(h+d["y"===p?"top":"left"],h,h-d[e])}if(r){const e="y"===u?"bottom":"right";f=S(f+d["y"===u?"top":"left"],f,f-d[e])}const v=a.fn({...e,[p]:h,[u]:f});return{...v,data:{x:v.x-t,y:v.y-n,enabled:{[p]:o,[u]:r}}}}}),Le()];var l;return"menu"===a&&s.push(Be({fallbackPlacements:n||["top-start","top","top-end","bottom-start","bottom","bottom-end"]})),s.push(function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,i;const{x:o,y:r,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:i,elements:o}=e,r=await(null==i.isRTL?void 0:i.isRTL(o.floating)),a=T(n),s=D(n),l="y"===$(n),c=K.has(a)?-1:1,d=r&&l?-1:1,u=P(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:f}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&"number"==typeof f&&(h="end"===s?-1*f:f),l?{x:h*d,y:p*c}:{x:p*c,y:h*d}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(i=s.arrow)&&i.alignmentOffset?{}:{x:o+l.x,y:r+l.y,data:{...l,placement:a}}}}}({mainAxis:"number"==typeof i?i:0,crossAxis:"number"==typeof o?o:0})),"auto"===e||"auto-start"===e||"auto-end"===e?s.push(function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,i,o;const{rects:r,middlewareData:a,placement:s,platform:l,elements:c}=t,{crossAxis:d=!1,alignment:u,allowedPlacements:p=g,autoAlignment:h=!0,...f}=P(e,t),v=void 0!==u||p===g?function(e,t,n){return(e?[...n.filter(t=>D(t)===e),...n.filter(t=>D(t)!==e)]:n.filter(e=>T(e)===e)).filter(n=>!e||D(n)===e||!!t&&M(n)!==n)}(u||null,h,p):p,m=await q(t,f),y=(null==(n=a.autoPlacement)?void 0:n.index)||0,b=v[y];if(null==b)return{};const x=I(b,r,await(null==l.isRTL?void 0:l.isRTL(c.floating)));if(s!==b)return{reset:{placement:v[0]}};const w=[m[T(b)],m[x[0]],m[x[1]]],E=[...(null==(i=a.autoPlacement)?void 0:i.overflows)||[],{placement:b,overflows:w}],k=v[y+1];if(k)return{data:{index:y+1,overflows:E},reset:{placement:k}};const S=E.map(e=>{const t=D(e.placement);return[e.placement,t&&d?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),C=(null==(o=S.filter(e=>e[2].slice(0,D(e[0])?2:3).every(e=>e<=0))[0])?void 0:o[0])||S[0][0];return C!==s?{data:{index:y+1,overflows:E},reset:{placement:C}}:{}}}}({alignment:"auto-start"===e?"start":"auto-end"===e?"end":null})):t||s.push(Be(n?{fallbackPlacements:n}:{})),r&&s.push((e=>({name:"arrow",options:e,async fn(t){const{x:n,y:i,placement:o,rects:r,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:d=0}=P(e,t)||{};if(null==c)return{};const u=H(d),p={x:n,y:i},h=A(o),f=z(h),v=await a.getDimensions(c),g="y"===h,y=g?"top":"left",b=g?"bottom":"right",x=g?"clientHeight":"clientWidth",w=r.reference[f]+r.reference[h]-p[h]-r.floating[f],E=p[h]-r.reference[h],k=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let T=k?k[x]:0;T&&await(null==a.isElement?void 0:a.isElement(k))||(T=s.floating[x]||r.floating[f]);const C=w/2-E/2,O=T/2-v[f]/2-1,$=m(u[y],O),I=m(u[b],O),M=$,_=T-v[f]-I,R=T/2-v[f]/2+C,F=S(M,R,_),B=!l.arrow&&null!=D(o)&&R!==F&&r.reference[f]/2-(R<M?$:I)-v[f]/2<0,L=B?R<M?R-M:R-_:0;return{[h]:p[h]+L,data:{[h]:F,centerOffset:R-F-L,...B&&{alignmentOffset:L}},reset:B}}}))({element:r})),s}function Ye(e){return We.includes(e)}function Xe(e,t){const n=e.filter(Ye);return n.length!==e.length&&console.warn(`${t.tagName}: Invalid value found in: flipPlacements. Try any of these: ${We.map(e=>`"${e}"`).join(", ").trim()}`,{el:t}),n}function Je(e,t=!1){const n=["left","right"];return t&&n.reverse(),e.replace(/leading/gi,n[0]).replace(/trailing/gi,n[1])}async function Qe(e,t,n=!1){if(!e.open||!t.floatingEl||!t.referenceEl)return;if(Object.assign(t.floatingEl.style,{display:"block",inset:"unset",left:"0",position:t.overlayPositioning??"absolute",top:"0"}),!et.get(e))return nt(e);const o=n?function(e){let t=tt.get(e);return t||(t=function(e,t,{signal:n,edges:i}={}){let o,r=null;const a=null!=i&&i.includes("leading"),s=null==i||i.includes("trailing"),l=()=>{null!==r&&(e.apply(o,r),o=void 0,r=null)};let c=null;const d=()=>{null!=c&&clearTimeout(c),c=setTimeout(()=>{c=null,s&&l(),u()},t)},u=()=>{null!==c&&(clearTimeout(c),c=null),o=void 0,r=null},p=function(...e){if(n?.aborted)return;o=this,r=e;const t=null==c;d(),a&&t&&l()};return p.schedule=d,p.cancel=u,p.flush=()=>{l()},n?.addEventListener("abort",u,{once:!0}),p}(qe,i.D.reposition,{edges:["leading","trailing"]}),tt.set(e,t),t)}(e):qe;await o(e,t)}const Ze={top:"",left:"rotate(-90deg)",bottom:"rotate(180deg)",right:"rotate(90deg)"},et=new WeakMap,tt=new WeakMap;async function nt(e){const{referenceEl:t,floatingEl:n}=e;if(!n.isConnected)return;const i=o.S$?(e,t,n)=>(n(),()=>{}):Fe;let r;et.set(e,{state:"pending"});const a=i(t,n,()=>{const t=e.reposition();r||(r=t)});return et.set(e,{state:"active",cleanUp:a}),r}function it(e){const{floatingEl:t}=e;t&&Object.assign(t.style,{display:"",left:"",pointerEvents:"",position:"",top:"",transform:"",visibility:""})}function ot(e){const t=et.get(e);"active"===t?.state&&t.cleanUp(),et.delete(e),tt.get(e)?.cancel(),tt.delete(e)}const rt=Math.ceil(Math.hypot(4,4));var at=n(38568),st=n(31910),lt=n(62995);const ct=({children:e,...t})=>{const n=t.level?(0,lt.Bk)(`h${t.level}`):lt.eu`div`;return(0,p.D)(t.key,lt.qy`<${n} class=${(0,r.CP)(t.class)}>${e}</${n}>`)},dt={width:12,height:6,strokeWidth:1};var ut=n(81506),pt=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],ht=pt.join(","),ft="undefined"==typeof Element,vt=ft?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,gt=!ft&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},mt=function e(t,n){var i;void 0===n&&(n=!0);var o=null==t||null===(i=t.getAttribute)||void 0===i?void 0:i.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},yt=function(e,t,n){if(mt(e))return[];var i=Array.prototype.slice.apply(e.querySelectorAll(ht));return t&&vt.call(e,ht)&&i.unshift(e),i.filter(n)},bt=function e(t,n,i){for(var o=[],r=Array.from(t);r.length;){var a=r.shift();if(!mt(a,!1))if("SLOT"===a.tagName){var s=a.assignedElements(),l=e(s.length?s:a.children,!0,i);i.flatten?o.push.apply(o,l):o.push({scopeParent:a,candidates:l})}else{vt.call(a,ht)&&i.filter(a)&&(n||!t.includes(a))&&o.push(a);var c=a.shadowRoot||"function"==typeof i.getShadowRoot&&i.getShadowRoot(a),d=!mt(c,!1)&&(!i.shadowRootFilter||i.shadowRootFilter(a));if(c&&d){var u=e(!0===c?a.children:c.children,!0,i);i.flatten?o.push.apply(o,u):o.push({scopeParent:a,candidates:u})}else r.unshift.apply(r,a.children)}}return o},xt=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},wt=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!xt(e)?0:e.tabIndex},Et=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},kt=function(e){return"INPUT"===e.tagName},St=function(e){var t=e.getBoundingClientRect(),n=t.width,i=t.height;return 0===n&&0===i},Pt=function(e,t){return!(t.disabled||mt(t)||function(e){return kt(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,i=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=vt.call(e,"details>summary:first-of-type")?e.parentElement:e;if(vt.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return St(e)}else{if("function"==typeof i){for(var r=e;e;){var a=e.parentElement,s=gt(e);if(a&&!a.shadowRoot&&!0===i(a))return St(e);e=e.assignedSlot?e.assignedSlot:a||s===e.ownerDocument?a:s.host}e=r}if(function(e){var t,n,i,o,r=e&&gt(e),a=null===(t=r)||void 0===t?void 0:t.host,s=!1;if(r&&r!==e)for(s=!!(null!==(n=a)&&void 0!==n&&null!==(i=n.ownerDocument)&&void 0!==i&&i.contains(a)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!s&&a;){var l,c,d;s=!(null===(c=a=null===(l=r=gt(a))||void 0===l?void 0:l.host)||void 0===c||null===(d=c.ownerDocument)||void 0===d||!d.contains(a))}return s}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some(function(e){return"SUMMARY"===e.tagName})}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var i=t.children.item(n);if("LEGEND"===i.tagName)return!!vt.call(t,"fieldset[disabled] *")||!i.contains(e)}return!0}t=t.parentElement}return!1}(t))},Tt=function(e,t){return!(function(e){return function(e){return kt(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||gt(e),i=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=i(window.CSS.escape(e.name));else try{t=i(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)}(t)||wt(t)<0||!Pt(e,t))},Dt=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Ct=function e(t){var n=[],i=[];return t.forEach(function(t,o){var r=!!t.scopeParent,a=r?t.scopeParent:t,s=function(e,t){var n=wt(e);return n<0&&t&&!xt(e)?0:n}(a,r),l=r?e(t.candidates):a;0===s?r?n.push.apply(n,l):n.push(a):i.push({documentOrder:o,tabIndex:s,item:t,isScope:r,content:l})}),i.sort(Et).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(n)},zt=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==vt.call(e,ht)&&Tt(t,e)},Ot=pt.concat("iframe").join(","),$t=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==vt.call(e,Ot)&&Pt(t,e)};function At(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function It(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function _t(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mt(Object(n),!0).forEach(function(t){It(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Rt=function(e){return"Tab"===(null==e?void 0:e.key)||9===(null==e?void 0:e.keyCode)},Ft=function(e){return Rt(e)&&!e.shiftKey},Bt=function(e){return Rt(e)&&e.shiftKey},Lt=function(e){return setTimeout(e,0)},Ht=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return"function"==typeof e?e.apply(void 0,n):e},Nt=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},jt=[],qt=function(e,t){var n,i=(null==t?void 0:t.document)||document,o=(null==t?void 0:t.trapStack)||jt,r=_t({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:Ft,isKeyBackward:Bt},t),a={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},s=function(e,t,n){return e&&void 0!==e[t]?e[t]:r[n||t]},l=function(e,t){var n="function"==typeof(null==t?void 0:t.composedPath)?t.composedPath():void 0;return a.containerGroups.findIndex(function(t){var i=t.container,o=t.tabbableNodes;return i.contains(e)||(null==n?void 0:n.includes(i))||o.find(function(t){return t===e})})},c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.hasFallback,o=void 0!==n&&n,a=t.params,s=void 0===a?[]:a,l=r[e];if("function"==typeof l&&(l=l.apply(void 0,function(e){return function(e){if(Array.isArray(e))return At(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return At(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?At(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(s))),!0===l&&(l=void 0),!l){if(void 0===l||!1===l)return l;throw new Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var c=l;if("string"==typeof l){try{c=i.querySelector(l)}catch(t){throw new Error("`".concat(e,'` appears to be an invalid selector; error="').concat(t.message,'"'))}if(!c&&!o)throw new Error("`".concat(e,"` as selector refers to no known node"))}return c},d=function(){var e=c("initialFocus",{hasFallback:!0});if(!1===e)return!1;if(void 0===e||e&&!$t(e,r.tabbableOptions))if(l(i.activeElement)>=0)e=i.activeElement;else{var t=a.tabbableGroups[0];e=t&&t.firstTabbableNode||c("fallbackFocus")}else null===e&&(e=c("fallbackFocus"));if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e},u=function(){if(a.containerGroups=a.containers.map(function(e){var t=function(e,t){var n;return n=(t=t||{}).getShadowRoot?bt([e],t.includeContainer,{filter:Tt.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Dt}):yt(e,t.includeContainer,Tt.bind(null,t)),Ct(n)}(e,r.tabbableOptions),n=function(e,t){return(t=t||{}).getShadowRoot?bt([e],t.includeContainer,{filter:Pt.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):yt(e,t.includeContainer,Pt.bind(null,t))}(e,r.tabbableOptions),i=t.length>0?t[0]:void 0,o=t.length>0?t[t.length-1]:void 0,a=n.find(function(e){return zt(e)}),s=n.slice().reverse().find(function(e){return zt(e)}),l=!!t.find(function(e){return wt(e)>0});return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:l,firstTabbableNode:i,lastTabbableNode:o,firstDomTabbableNode:a,lastDomTabbableNode:s,nextTabbableNode:function(e){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=t.indexOf(e);return o<0?i?n.slice(n.indexOf(e)+1).find(function(e){return zt(e)}):n.slice(0,n.indexOf(e)).reverse().find(function(e){return zt(e)}):t[o+(i?1:-1)]}}}),a.tabbableGroups=a.containerGroups.filter(function(e){return e.tabbableNodes.length>0}),a.tabbableGroups.length<=0&&!c("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(a.containerGroups.find(function(e){return e.posTabIndexesFound})&&a.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},p=function(e){var t=e.activeElement;if(t)return t.shadowRoot&&null!==t.shadowRoot.activeElement?p(t.shadowRoot):t},h=function(e){!1!==e&&e!==p(document)&&(e&&e.focus?(e.focus({preventScroll:!!r.preventScroll}),a.mostRecentlyFocusedNode=e,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(e)&&e.select()):h(d()))},f=function(e){var t=c("setReturnFocus",{params:[e]});return t||!1!==t&&e},v=function(e){var t=e.target,n=e.event,i=e.isBackward,o=void 0!==i&&i;t=t||Nt(n),u();var s=null;if(a.tabbableGroups.length>0){var d=l(t,n),p=d>=0?a.containerGroups[d]:void 0;if(d<0)s=o?a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:a.tabbableGroups[0].firstTabbableNode;else if(o){var h=a.tabbableGroups.findIndex(function(e){var n=e.firstTabbableNode;return t===n});if(h<0&&(p.container===t||$t(t,r.tabbableOptions)&&!zt(t,r.tabbableOptions)&&!p.nextTabbableNode(t,!1))&&(h=d),h>=0){var f=0===h?a.tabbableGroups.length-1:h-1,v=a.tabbableGroups[f];s=wt(t)>=0?v.lastTabbableNode:v.lastDomTabbableNode}else Rt(n)||(s=p.nextTabbableNode(t,!1))}else{var g=a.tabbableGroups.findIndex(function(e){var n=e.lastTabbableNode;return t===n});if(g<0&&(p.container===t||$t(t,r.tabbableOptions)&&!zt(t,r.tabbableOptions)&&!p.nextTabbableNode(t))&&(g=d),g>=0){var m=g===a.tabbableGroups.length-1?0:g+1,y=a.tabbableGroups[m];s=wt(t)>=0?y.firstTabbableNode:y.firstDomTabbableNode}else Rt(n)||(s=p.nextTabbableNode(t))}}else s=c("fallbackFocus");return s},g=function(e){var t=Nt(e);l(t,e)>=0||(Ht(r.clickOutsideDeactivates,e)?n.deactivate({returnFocus:r.returnFocusOnDeactivate}):Ht(r.allowOutsideClick,e)||e.preventDefault())},m=function(e){var t=Nt(e),n=l(t,e)>=0;if(n||t instanceof Document)n&&(a.mostRecentlyFocusedNode=t);else{var i;e.stopImmediatePropagation();var o=!0;if(a.mostRecentlyFocusedNode)if(wt(a.mostRecentlyFocusedNode)>0){var s=l(a.mostRecentlyFocusedNode),c=a.containerGroups[s].tabbableNodes;if(c.length>0){var u=c.findIndex(function(e){return e===a.mostRecentlyFocusedNode});u>=0&&(r.isKeyForward(a.recentNavEvent)?u+1<c.length&&(i=c[u+1],o=!1):u-1>=0&&(i=c[u-1],o=!1))}}else a.containerGroups.some(function(e){return e.tabbableNodes.some(function(e){return wt(e)>0})})||(o=!1);else o=!1;o&&(i=v({target:a.mostRecentlyFocusedNode,isBackward:r.isKeyBackward(a.recentNavEvent)})),h(i||a.mostRecentlyFocusedNode||d())}a.recentNavEvent=void 0},y=function(e){(r.isKeyForward(e)||r.isKeyBackward(e))&&function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];a.recentNavEvent=e;var n=v({event:e,isBackward:t});n&&(Rt(e)&&e.preventDefault(),h(n))}(e,r.isKeyBackward(e))},b=function(e){(function(e){return"Escape"===(null==e?void 0:e.key)||"Esc"===(null==e?void 0:e.key)||27===(null==e?void 0:e.keyCode)})(e)&&!1!==Ht(r.escapeDeactivates,e)&&(e.preventDefault(),n.deactivate())},x=function(e){var t=Nt(e);l(t,e)>=0||Ht(r.clickOutsideDeactivates,e)||Ht(r.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},w=function(){if(a.active)return function(e,t){if(e.length>0){var n=e[e.length-1];n!==t&&n._setPausedState(!0)}var i=e.indexOf(t);-1===i||e.splice(i,1),e.push(t)}(o,n),a.delayInitialFocusTimer=r.delayInitialFocus?Lt(function(){h(d())}):h(d()),i.addEventListener("focusin",m,!0),i.addEventListener("mousedown",g,{capture:!0,passive:!1}),i.addEventListener("touchstart",g,{capture:!0,passive:!1}),i.addEventListener("click",x,{capture:!0,passive:!1}),i.addEventListener("keydown",y,{capture:!0,passive:!1}),i.addEventListener("keydown",b),n},E=function(){if(a.active)return i.removeEventListener("focusin",m,!0),i.removeEventListener("mousedown",g,!0),i.removeEventListener("touchstart",g,!0),i.removeEventListener("click",x,!0),i.removeEventListener("keydown",y,!0),i.removeEventListener("keydown",b),n},k="undefined"!=typeof window&&"MutationObserver"in window?new MutationObserver(function(e){e.some(function(e){return Array.from(e.removedNodes).some(function(e){return e===a.mostRecentlyFocusedNode})})&&h(d())}):void 0,S=function(){k&&(k.disconnect(),a.active&&!a.paused&&a.containers.map(function(e){k.observe(e,{subtree:!0,childList:!0})}))};return n={get active(){return a.active},get paused(){return a.paused},activate:function(e){if(a.active)return this;var t=s(e,"onActivate"),n=s(e,"onPostActivate"),o=s(e,"checkCanFocusTrap");o||u(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=p(i),null==t||t();var r=function(){o&&u(),w(),S(),null==n||n()};return o?(o(a.containers.concat()).then(r,r),this):(r(),this)},deactivate:function(e){if(!a.active)return this;var t=_t({onDeactivate:r.onDeactivate,onPostDeactivate:r.onPostDeactivate,checkCanReturnFocus:r.checkCanReturnFocus},e);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,E(),a.active=!1,a.paused=!1,S(),function(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1),e.length>0&&!e[e.length-1]._isManuallyPaused()&&e[e.length-1]._setPausedState(!1)}(o,n);var i=s(t,"onDeactivate"),l=s(t,"onPostDeactivate"),c=s(t,"checkCanReturnFocus"),d=s(t,"returnFocus","returnFocusOnDeactivate");null==i||i();var u=function(){Lt(function(){d&&h(f(a.nodeFocusedBeforeActivation)),null==l||l()})};return d&&c?(c(f(a.nodeFocusedBeforeActivation)).then(u,u),this):(u(),this)},pause:function(e){return a.active?(a.manuallyPaused=!0,this._setPausedState(!0,e)):this},unpause:function(e){return a.active?(a.manuallyPaused=!1,o[o.length-1]!==this?this:this._setPausedState(!1,e)):this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return a.containers=t.map(function(e){return"string"==typeof e?i.querySelector(e):e}),a.active&&u(),S(),this}},Object.defineProperties(n,{_isManuallyPaused:{value:function(){return a.manuallyPaused}},_setPausedState:{value:function(e,t){if(a.paused===e)return this;if(a.paused=e,e){var n=s(t,"onPause"),i=s(t,"onPostPause");null==n||n(),E(),S(),null==i||i()}else{var o=s(t,"onUnpause"),r=s(t,"onPostUnpause");null==o||o(),u(),w(),S(),null==r||r()}return this}}}),n.updateContainerElements(e),n};function Ut(e,{focusTrapOptions:t},n){return t?.extraContainers||n?[e,...Wt(t?.extraContainers),...Wt(n)]:e}function Wt(e=[]){return Array.isArray(e)?e:[e]}const Kt=new WeakSet;const Gt=e=>(0,ut.aK)((t,n)=>{let o,r,a;const s=e.focusTrapOptions;n.onConnected(()=>{t[e.triggerProp]&&o&&c.activate()}),n.onUpdate(e=>{t.hasUpdated&&e.has("focusTrapDisabled")&&(t.focusTrapDisabled?c.deactivate():c.activate())}),n.onDisconnected(()=>c.deactivate());const c={get _instance(){},activate:()=>{const e=r||t.el;e.isConnected&&(o||(a||=Ut(e,t),o=qt(a,function(e,t){const n=t?.fallbackFocus||e,o=t?.clickOutsideDeactivates??!0;return{fallbackFocus:n,...t,document:e.ownerDocument,tabbableOptions:l.u,trapStack:(0,i.a)().focusTrapStack,clickOutsideDeactivates:t=>(Kt.has(e)||Kt.add(e),"function"==typeof o?o(t):o),onPostDeactivate:()=>{Kt.delete(e)},setReturnFocus:n=>{const i="function"==typeof t?.setReturnFocus?t.setReturnFocus(n):t?.setReturnFocus;return void 0===i?function(e,t){const n=t&&t!==document.body&&t!==document.documentElement;return!Kt.has(e)&&n&&(0,l.j)(t),!1}(e,n):i}}}(e,{...s,...t.focusTrapOptions}))),("function"==typeof t.focusTrapDisabledOverride?t.focusTrapDisabledOverride():t.focusTrapDisabled)||o.activate())},deactivate:()=>o?.deactivate(),overrideFocusTrapEl:e=>{if(o)throw new Error("Focus trap already created");r=e},setExtraContainers:e=>{const n=r||t.el;a=Ut(n,t,e)},updateContainerElements:()=>o?.updateContainerElements(a)};return c});var Vt=n(5918);const Yt=e=>(0,ut.aK)((t,n)=>{let i=!1;async function o(n){await t.componentOnReady();const o="function"==typeof e.target?e.target():e.target.value;if(o&&o.hasAttribute("popover"))return e.disabledOverride?.()||"topLayerDisabled"in t&&!0===t.topLayerDisabled||!n?(i=!1,void o.hidePopover()):(i=!0,void o.showPopover())}return n.onConnected(()=>{i&&o(!0)}),{show:async()=>{await o(!0)},hide:async()=>{await o(!1)}}});var Xt=n(26442);const Jt="container",Qt="close-button-container",Zt="has-header",en="header",tn="header-container",nn="auto",on="aria-controls",rn="aria-expanded",an=o.AH`:host{display:contents}:host([top-layer-disabled]){--calcite-floating-ui-z-index: var(--calcite-z-index-popup)}.position-container{inline-size:max-content;display:none;max-inline-size:100vw;max-block-size:100vh;inset-block-start:0;left:0;z-index:var(--calcite-floating-ui-z-index)}@starting-style{.position-container{opacity:0;inset-block-start:0;left:0}}.position-container{max-inline-size:var(--calcite-popover-max-size-x, 100vw)}.position-container[popover]{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;display:none}.position-container:popover-open{display:block}.position-container .calcite-floating-ui-anim{position:relative;transition-duration:var(--calcite-floating-ui-transition);transition-property:inset-block-start,left,opacity,display;transition-behavior:allow-discrete;opacity:0;box-shadow:0 0 16px #00000029;z-index:var(--calcite-z-index);border-radius:.25rem}.position-container[data-placement^=bottom] .calcite-floating-ui-anim{inset-block-start:-5px}.position-container[data-placement^=top] .calcite-floating-ui-anim{inset-block-start:5px}.position-container[data-placement^=left] .calcite-floating-ui-anim{left:5px}.position-container[data-placement^=right] .calcite-floating-ui-anim{left:-5px}.position-container[data-placement] .calcite-floating-ui-anim--active{opacity:1;inset-block-start:0;left:0}@starting-style{.position-container[data-placement] .calcite-floating-ui-anim--active{opacity:0}}.calcite-floating-ui-arrow{pointer-events:none;position:absolute;z-index:calc(var(--calcite-z-index) * -1);fill:var(--calcite-color-foreground-1)}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-color-border-3)}:host([scale=s]) .heading{padding:.5rem .75rem;font-size:var(--calcite-font-size-relative-base);line-height:var(--calcite-font-line-height-relative-snug)}:host(:is([scale=s],[scale=m])){--calcite-internal-popover-close-spacing: var(--calcite-spacing-xs)}:host([scale=m]) .heading{padding:.75rem 1rem;font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-relative-snug)}:host([scale=l]){--calcite-internal-popover-close-spacing: var(--calcite-spacing-sm)}:host([scale=l]) .heading{padding:1rem 1.25rem;font-size:var(--calcite-font-size-relative-lg);line-height:var(--calcite-font-line-height-relative-snug)}.position-container .calcite-floating-ui-anim{border-width:1px;border-style:solid;background-color:var(--calcite-popover-background-color, var(--calcite-color-foreground-1));border-color:var(--calcite-popover-border-color, var(--calcite-color-border-3));border-radius:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-round))}.calcite-floating-ui-arrow{fill:var(--calcite-popover-background-color, var(--calcite-color-foreground-1))}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-popover-border-color, var(--calcite-color-border-3))}.header{display:flex;flex:1 1 auto;align-items:stretch;justify-content:flex-start;border-width:0px;border-bottom-width:1px;border-style:solid;border-block-end-color:var(--calcite-popover-border-color, var(--calcite-color-border-3))}.heading{margin:0;display:block;flex:1 1 auto;align-self:center;white-space:normal;font-weight:var(--calcite-font-weight-medium);word-wrap:break-word;word-break:break-word;color:var(--calcite-popover-text-color, var(--calcite-color-text-1))}.header-container{position:relative;display:flex;height:100%;flex-direction:row;flex-wrap:nowrap;border-radius:.25rem;color:var(--calcite-popover-text-color, var(--calcite-color-text-1))}.header-container.has-header{flex-direction:column}.content{display:flex;height:100%;width:100%;flex-direction:column;flex-wrap:nowrap;align-self:center;word-wrap:break-word;word-break:break-word}.close-button{margin:auto;margin-inline-end:var(--calcite-internal-popover-close-spacing)}.close-button-container{display:flex;flex:0 0 auto}::slotted(calcite-panel),::slotted(calcite-flow){height:100%}:host([hidden]){display:none}[hidden]{display:none}`,sn=new class{constructor(){this.registeredElements=new Map,this.registeredElementCount=0,this.queryPopover=e=>{const{registeredElements:t}=this,n=e.find(e=>t.has(e));return t.get(n)},this.togglePopovers=e=>{const t=e.composedPath(),n=this.queryPopover(t);n&&!n.triggerDisabled&&(n.open=!n.open),Array.from(this.registeredElements.values()).filter(e=>e!==n&&e.autoClose&&e.open&&!t.includes(e)).forEach(e=>e.open=!1)},this.keyDownHandler=e=>{e.defaultPrevented||("Escape"===e.key?this.closeAllPopovers():(0,Xt.i)(e.key)&&this.togglePopovers(e))},this.pointerDownHandler=e=>{if(e.defaultPrevented||!(0,l.k)(e))return;const{clientX:t,clientY:n}=e;this.pointerDownPosition={x:t,y:n}},this.clickHandler=e=>{(0,l.z)(e)||e.defaultPrevented||this.pointerDownPosition&&function({startX:e,startY:t,endX:n,endY:i}){return Math.hypot(n-e,i-t)>5}({endY:e.clientY,endX:e.clientX,startY:this.pointerDownPosition.y,startX:this.pointerDownPosition.x})||(this.pointerDownPosition=void 0,this.togglePopovers(e))}}registerElement(e,t){this.registeredElementCount++,this.registeredElements.set(e,t),1===this.registeredElementCount&&this.addListeners()}unregisterElement(e){this.registeredElements.delete(e)&&this.registeredElementCount--,0===this.registeredElementCount&&this.removeListeners()}closeAllPopovers(){Array.from(this.registeredElements.values()).forEach(e=>e.open=!1)}addListeners(){window.addEventListener("pointerdown",this.pointerDownHandler),window.addEventListener("click",this.clickHandler),window.addEventListener("keydown",this.keyDownHandler)}removeListeners(){window.removeEventListener("pointerdown",this.pointerDownHandler),window.removeEventListener("click",this.clickHandler),window.removeEventListener("keydown",this.keyDownHandler)}};class ln extends r.WF{constructor(){super(...arguments),this.focusTrap=Gt({triggerProp:"open",focusTrapOptions:{allowOutsideClick:!0,escapeDeactivates:e=>(e.defaultPrevented||(this.open=!1,e.preventDefault()),!1)}})(this),this.guid=`calcite-popover-${(0