123456789 |
- import{hl as Xt,al as Yt,hw as qt,hu as Gt,hi as Jt,hj as Kt,hp as Qt,hk as W,hn as Zt,hq as te,hr as ee}from"./index.6c049565.js";import{g as ne}from"./guid.ae96513b.js";/*!
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
- * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
- * v1.0.0-beta.97
- */var ie=typeof global=="object"&&global&&global.Object===Object&&global,oe=typeof self=="object"&&self&&self.Object===Object&&self,Ct=ie||oe||Function("return this")(),G=Ct.Symbol,St=Object.prototype,re=St.hasOwnProperty,se=St.toString,F=G?G.toStringTag:void 0;function ae(t){var e=re.call(t,F),n=t[F];try{t[F]=void 0;var i=!0}catch{}var o=se.call(t);return i&&(e?t[F]=n:delete t[F]),o}var ce=Object.prototype,le=ce.toString;function fe(t){return le.call(t)}var ue="[object Null]",de="[object Undefined]",mt=G?G.toStringTag:void 0;function me(t){return t==null?t===void 0?de:ue:mt&&mt in Object(t)?ae(t):fe(t)}function he(t){return t!=null&&typeof t=="object"}var pe="[object Symbol]";function ge(t){return typeof t=="symbol"||he(t)&&me(t)==pe}var ve=/\s/;function we(t){for(var e=t.length;e--&&ve.test(t.charAt(e)););return e}var ye=/^\s+/;function be(t){return t&&t.slice(0,we(t)+1).replace(ye,"")}function nt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var ht=0/0,xe=/^[-+]0x[0-9a-f]+$/i,Te=/^0b[01]+$/i,Ee=/^0o[0-7]+$/i,Re=parseInt;function pt(t){if(typeof t=="number")return t;if(ge(t))return ht;if(nt(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=nt(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=be(t);var n=Te.test(t);return n||Ee.test(t)?Re(t.slice(2),n?2:8):xe.test(t)?ht:+t}var et=function(){return Ct.Date.now()},Pe="Expected a function",Oe=Math.max,Ae=Math.min;function Le(t,e,n){var i,o,a,s,r,c,f=0,m=!1,l=!1,u=!0;if(typeof t!="function")throw new TypeError(Pe);e=pt(e)||0,nt(n)&&(m=!!n.leading,l="maxWait"in n,a=l?Oe(pt(n.maxWait)||0,e):a,u="trailing"in n?!!n.trailing:u);function h(p){var P=i,E=o;return i=o=void 0,f=p,s=t.apply(E,P),s}function d(p){return f=p,r=setTimeout(b,e),m?h(p):s}function y(p){var P=p-c,E=p-f,R=e-P;return l?Ae(R,a-E):R}function g(p){var P=p-c,E=p-f;return c===void 0||P>=e||P<0||l&&E>=a}function b(){var p=et();if(g(p))return v(p);r=setTimeout(b,y(p))}function v(p){return r=void 0,u&&i?h(p):(i=o=void 0,s)}function x(){r!==void 0&&clearTimeout(r),f=0,i=c=o=r=void 0}function w(){return r===void 0?s:v(et())}function T(){var p=et(),P=g(p);if(i=arguments,o=this,c=p,P){if(r===void 0)return d(c);if(l)return clearTimeout(r),r=setTimeout(b,e),h(c)}return r===void 0&&(r=setTimeout(b,e)),s}return T.cancel=x,T.flush=w,T}function N(t){return t.split("-")[0]}function B(t){return t.split("-")[1]}function X(t){return["top","bottom"].includes(N(t))?"x":"y"}function ct(t){return t==="y"?"height":"width"}function gt(t,e,n){let{reference:i,floating:o}=t;const a=i.x+i.width/2-o.width/2,s=i.y+i.height/2-o.height/2,r=X(e),c=ct(r),f=i[c]/2-o[c]/2,m=N(e),l=r==="x";let u;switch(m){case"top":u={x:a,y:i.y-o.height};break;case"bottom":u={x:a,y:i.y+i.height};break;case"right":u={x:i.x+i.width,y:s};break;case"left":u={x:i.x-o.width,y:s};break;default:u={x:i.x,y:i.y}}switch(B(e)){case"start":u[r]-=f*(n&&l?-1:1);break;case"end":u[r]+=f*(n&&l?-1:1);break}return u}const ke=async(t,e,n)=>{const{placement:i="bottom",strategy:o="absolute",middleware:a=[],platform:s}=n,r=await(s.isRTL==null?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:o}),{x:f,y:m}=gt(c,i,r),l=i,u={},h=0;for(let d=0;d<a.length;d++){const{name:y,fn:g}=a[d],{x:b,y:v,data:x,reset:w}=await g({x:f,y:m,initialPlacement:i,placement:l,strategy:o,middlewareData:u,rects:c,platform:s,elements:{reference:t,floating:e}});if(f=b!=null?b:f,m=v!=null?v:m,u={...u,[y]:{...u[y],...x}},w&&h<=50){h++,typeof w=="object"&&(w.placement&&(l=w.placement),w.rects&&(c=w.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:o}):w.rects),{x:f,y:m}=gt(c,l,r)),d=-1;continue}}return{x:f,y:m,placement:l,strategy:o,middlewareData:u}};function Ce(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ht(t){return typeof t!="number"?Ce(t):{top:t,right:t,bottom:t,left:t}}function J(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function U(t,e){var n;e===void 0&&(e={});const{x:i,y:o,platform:a,rects:s,elements:r,strategy:c}=t,{boundary:f="clippingAncestors",rootBoundary:m="viewport",elementContext:l="floating",altBoundary:u=!1,padding:h=0}=e,d=Ht(h),g=r[u?l==="floating"?"reference":"floating":l],b=J(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(g)))==null||n?g:g.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(r.floating)),boundary:f,rootBoundary:m,strategy:c})),v=J(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({rect:l==="floating"?{...s.floating,x:i,y:o}:s.reference,offsetParent:await(a.getOffsetParent==null?void 0:a.getOffsetParent(r.floating)),strategy:c}):s[l]);return{top:b.top-v.top+d.top,bottom:v.bottom-b.bottom+d.bottom,left:b.left-v.left+d.left,right:v.right-b.right+d.right}}const Se=Math.min,He=Math.max;function it(t,e,n){return He(t,Se(e,n))}const De=t=>({name:"arrow",options:t,async fn(e){const{element:n,padding:i=0}=t!=null?t:{},{x:o,y:a,placement:s,rects:r,platform:c}=e;if(n==null)return{};const f=Ht(i),m={x:o,y:a},l=X(s),u=B(s),h=ct(l),d=await c.getDimensions(n),y=l==="y"?"top":"left",g=l==="y"?"bottom":"right",b=r.reference[h]+r.reference[l]-m[l]-r.floating[h],v=m[l]-r.reference[l],x=await(c.getOffsetParent==null?void 0:c.getOffsetParent(n));let w=x?l==="y"?x.clientHeight||0:x.clientWidth||0:0;w===0&&(w=r.floating[h]);const T=b/2-v/2,p=f[y],P=w-d[h]-f[g],E=w/2-d[h]/2+T,R=it(p,E,P),j=(u==="start"?f[y]:f[g])>0&&E!==R&&r.reference[h]<=r.floating[h]?E<p?p-E:P-E:0;return{[l]:m[l]-j,data:{[l]:R,centerOffset:E-R}}}}),_e={left:"right",right:"left",bottom:"top",top:"bottom"};function K(t){return t.replace(/left|right|bottom|top/g,e=>_e[e])}function Dt(t,e,n){n===void 0&&(n=!1);const i=B(t),o=X(t),a=ct(o);let s=o==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(s=K(s)),{main:s,cross:K(s)}}const $e={start:"end",end:"start"};function ot(t){return t.replace(/start|end/g,e=>$e[e])}const _t=["top","right","bottom","left"],je=_t.reduce((t,e)=>t.concat(e,e+"-start",e+"-end"),[]);function Ie(t,e,n){return(t?[...n.filter(o=>B(o)===t),...n.filter(o=>B(o)!==t)]:n.filter(o=>N(o)===o)).filter(o=>t?B(o)===t||(e?ot(o)!==o:!1):!0)}const Be=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,i,o,a,s;const{x:r,y:c,rects:f,middlewareData:m,placement:l,platform:u,elements:h}=e,{alignment:d=null,allowedPlacements:y=je,autoAlignment:g=!0,...b}=t,v=Ie(d,g,y),x=await U(e,b),w=(n=(i=m.autoPlacement)==null?void 0:i.index)!=null?n:0,T=v[w];if(T==null)return{};const{main:p,cross:P}=Dt(T,f,await(u.isRTL==null?void 0:u.isRTL(h.floating)));if(l!==T)return{x:r,y:c,reset:{placement:v[0]}};const E=[x[N(T)],x[p],x[P]],R=[...(o=(a=m.autoPlacement)==null?void 0:a.overflows)!=null?o:[],{placement:T,overflows:E}],S=v[w+1];if(S)return{data:{index:w+1,overflows:R},reset:{placement:S}};const H=R.slice().sort((A,M)=>A.overflows[0]-M.overflows[0]),j=(s=H.find(A=>{let{overflows:M}=A;return M.every(zt=>zt<=0)}))==null?void 0:s.placement,I=j!=null?j:H[0].placement;return I!==l?{data:{index:w+1,overflows:R},reset:{placement:I}}:{}}}};function Ne(t){const e=K(t);return[ot(t),e,ot(e)]}const vt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n;const{placement:i,middlewareData:o,rects:a,initialPlacement:s,platform:r,elements:c}=e,{mainAxis:f=!0,crossAxis:m=!0,fallbackPlacements:l,fallbackStrategy:u="bestFit",flipAlignment:h=!0,...d}=t,y=N(i),b=l||(y===s||!h?[K(s)]:Ne(s)),v=[s,...b],x=await U(e,d),w=[];let T=((n=o.flip)==null?void 0:n.overflows)||[];if(f&&w.push(x[y]),m){const{main:R,cross:S}=Dt(i,a,await(r.isRTL==null?void 0:r.isRTL(c.floating)));w.push(x[R],x[S])}if(T=[...T,{placement:i,overflows:w}],!w.every(R=>R<=0)){var p,P;const R=((p=(P=o.flip)==null?void 0:P.index)!=null?p:0)+1,S=v[R];if(S)return{data:{index:R,overflows:T},reset:{placement:S}};let H="bottom";switch(u){case"bestFit":{var E;const j=(E=T.map(I=>[I,I.overflows.filter(A=>A>0).reduce((A,M)=>A+M,0)]).sort((I,A)=>I[1]-A[1])[0])==null?void 0:E[0].placement;j&&(H=j);break}case"initialPlacement":H=s;break}if(i!==H)return{reset:{placement:H}}}return{}}}};function wt(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function yt(t){return _t.some(e=>t[e]>=0)}const Me=function(t){let{strategy:e="referenceHidden",...n}=t===void 0?{}:t;return{name:"hide",async fn(i){const{rects:o}=i;switch(e){case"referenceHidden":{const a=await U(i,{...n,elementContext:"reference"}),s=wt(a,o.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:yt(s)}}}case"escaped":{const a=await U(i,{...n,altBoundary:!0}),s=wt(a,o.floating);return{data:{escapedOffsets:s,escaped:yt(s)}}}default:return{}}}}};async function We(t,e){const{placement:n,platform:i,elements:o}=t,a=await(i.isRTL==null?void 0:i.isRTL(o.floating)),s=N(n),r=B(n),c=X(n)==="x",f=["left","top"].includes(s)?-1:1,m=a&&c?-1:1,l=typeof e=="function"?e(t):e;let{mainAxis:u,crossAxis:h,alignmentAxis:d}=typeof l=="number"?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...l};return r&&typeof d=="number"&&(h=r==="end"?d*-1:d),c?{x:h*m,y:u*f}:{x:u*f,y:h*m}}const Fe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){const{x:n,y:i}=e,o=await We(e,t);return{x:n+o.x,y:i+o.y,data:o}}}};function Ve(t){return t==="x"?"y":"x"}const Ue=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:o}=e,{mainAxis:a=!0,crossAxis:s=!1,limiter:r={fn:g=>{let{x:b,y:v}=g;return{x:b,y:v}}},...c}=t,f={x:n,y:i},m=await U(e,c),l=X(N(o)),u=Ve(l);let h=f[l],d=f[u];if(a){const g=l==="y"?"top":"left",b=l==="y"?"bottom":"right",v=h+m[g],x=h-m[b];h=it(v,h,x)}if(s){const g=u==="y"?"top":"left",b=u==="y"?"bottom":"right",v=d+m[g],x=d-m[b];d=it(v,d,x)}const y=r.fn({...e,[l]:h,[u]:d});return{...y,data:{x:y.x-n,y:y.y-i}}}}};function $t(t){return t&&t.document&&t.location&&t.alert&&t.setInterval}function C(t){if(t==null)return window;if(!$t(t)){const e=t.ownerDocument;return e&&e.defaultView||window}return t}function D(t){return C(t).getComputedStyle(t)}function _(t){return $t(t)?"":t?(t.nodeName||"").toLowerCase():""}function jt(){const t=navigator.userAgentData;return t!=null&&t.brands?t.brands.map(e=>e.brand+"/"+e.version).join(" "):navigator.userAgent}function O(t){return t instanceof C(t).HTMLElement}function L(t){return t instanceof C(t).Element}function ze(t){return t instanceof C(t).Node}function z(t){if(typeof ShadowRoot=="undefined")return!1;const e=C(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Y(t){const{overflow:e,overflowX:n,overflowY:i,display:o}=D(t);return/auto|scroll|overlay|hidden/.test(e+i+n)&&!["inline","contents"].includes(o)}function Xe(t){return["table","td","th"].includes(_(t))}function It(t){const e=/firefox/i.test(jt()),n=D(t);return n.transform!=="none"||n.perspective!=="none"||e&&n.willChange==="filter"||e&&(n.filter?n.filter!=="none":!1)||["transform","perspective"].some(i=>n.willChange.includes(i))||["paint","layout","strict","content"].some(i=>{const o=n.contain;return o!=null?o.includes(i):!1})}function Bt(){return!/^((?!chrome|android).)*safari/i.test(jt())}function lt(t){return["html","body","#document"].includes(_(t))}const bt=Math.min,V=Math.max,Q=Math.round;function k(t,e,n){var i,o,a,s;e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect();let c=1,f=1;e&&O(t)&&(c=t.offsetWidth>0&&Q(r.width)/t.offsetWidth||1,f=t.offsetHeight>0&&Q(r.height)/t.offsetHeight||1);const m=L(t)?C(t):window,l=!Bt()&&n,u=(r.left+(l&&(i=(o=m.visualViewport)==null?void 0:o.offsetLeft)!=null?i:0))/c,h=(r.top+(l&&(a=(s=m.visualViewport)==null?void 0:s.offsetTop)!=null?a:0))/f,d=r.width/c,y=r.height/f;return{width:d,height:y,top:h,right:u+d,bottom:h+y,left:u,x:u,y:h}}function $(t){return((ze(t)?t.ownerDocument:t.document)||window.document).documentElement}function tt(t){return L(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Nt(t){return k($(t)).left+tt(t).scrollLeft}function Ye(t){const e=k(t);return Q(e.width)!==t.offsetWidth||Q(e.height)!==t.offsetHeight}function qe(t,e,n){const i=O(e),o=$(e),a=k(t,i&&Ye(e),n==="fixed");let s={scrollLeft:0,scrollTop:0};const r={x:0,y:0};if(i||!i&&n!=="fixed")if((_(e)!=="body"||Y(o))&&(s=tt(e)),O(e)){const c=k(e,!0);r.x=c.x+e.clientLeft,r.y=c.y+e.clientTop}else o&&(r.x=Nt(o));return{x:a.left+s.scrollLeft-r.x,y:a.top+s.scrollTop-r.y,width:a.width,height:a.height}}function ft(t){return _(t)==="html"?t:t.assignedSlot||t.parentNode||(z(t)?t.host:null)||$(t)}function xt(t){return!O(t)||D(t).position==="fixed"?null:t.offsetParent}function Ge(t){let e=ft(t);for(z(e)&&(e=e.host);O(e)&&!lt(e);){if(It(e))return e;{const n=e.parentNode;e=z(n)?n.host:n}}return null}function rt(t){const e=C(t);let n=xt(t);for(;n&&Xe(n)&&D(n).position==="static";)n=xt(n);return n&&(_(n)==="html"||_(n)==="body"&&D(n).position==="static"&&!It(n))?e:n||Ge(t)||e}function Tt(t){if(O(t))return{width:t.offsetWidth,height:t.offsetHeight};const e=k(t);return{width:e.width,height:e.height}}function Je(t){let{rect:e,offsetParent:n,strategy:i}=t;const o=O(n),a=$(n);if(n===a)return e;let s={scrollLeft:0,scrollTop:0};const r={x:0,y:0};if((o||!o&&i!=="fixed")&&((_(n)!=="body"||Y(a))&&(s=tt(n)),O(n))){const c=k(n,!0);r.x=c.x+n.clientLeft,r.y=c.y+n.clientTop}return{...e,x:e.x-s.scrollLeft+r.x,y:e.y-s.scrollTop+r.y}}function Ke(t,e){const n=C(t),i=$(t),o=n.visualViewport;let a=i.clientWidth,s=i.clientHeight,r=0,c=0;if(o){a=o.width,s=o.height;const f=Bt();(f||!f&&e==="fixed")&&(r=o.offsetLeft,c=o.offsetTop)}return{width:a,height:s,x:r,y:c}}function Qe(t){var e;const n=$(t),i=tt(t),o=(e=t.ownerDocument)==null?void 0:e.body,a=V(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=V(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let r=-i.scrollLeft+Nt(t);const c=-i.scrollTop;return D(o||n).direction==="rtl"&&(r+=V(n.clientWidth,o?o.clientWidth:0)-a),{width:a,height:s,x:r,y:c}}function Mt(t){const e=ft(t);return lt(e)?t.ownerDocument.body:O(e)&&Y(e)?e:Mt(e)}function Z(t,e){var n;e===void 0&&(e=[]);const i=Mt(t),o=i===((n=t.ownerDocument)==null?void 0:n.body),a=C(i),s=o?[a].concat(a.visualViewport||[],Y(i)?i:[]):i,r=e.concat(s);return o?r:r.concat(Z(s))}function Ze(t,e){const n=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&z(n)){let i=e;do{if(i&&t===i)return!0;i=i.parentNode||i.host}while(i)}return!1}function tn(t,e){let n=t;for(;n&&!lt(n)&&!e.includes(n)&&!(L(n)&&["absolute","fixed"].includes(D(n).position));){const i=ft(n);n=z(i)?i.host:i}return n}function en(t,e){const n=k(t,!1,e==="fixed"),i=n.top+t.clientTop,o=n.left+t.clientLeft;return{top:i,left:o,x:o,y:i,right:o+t.clientWidth,bottom:i+t.clientHeight,width:t.clientWidth,height:t.clientHeight}}function Et(t,e,n){return e==="viewport"?J(Ke(t,n)):L(e)?en(e,n):J(Qe($(t)))}function nn(t){const e=Z(t),n=tn(t,e);let i=null;if(n&&O(n)){const o=rt(n);Y(n)?i=n:O(o)&&(i=o)}return L(i)?e.filter(o=>i&&L(o)&&Ze(o,i)&&_(o)!=="body"):[]}function on(t){let{element:e,boundary:n,rootBoundary:i,strategy:o}=t;const s=[...n==="clippingAncestors"?nn(e):[].concat(n),i],r=s[0],c=s.reduce((f,m)=>{const l=Et(e,m,o);return f.top=V(l.top,f.top),f.right=bt(l.right,f.right),f.bottom=bt(l.bottom,f.bottom),f.left=V(l.left,f.left),f},Et(e,r,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}const q={getClippingRect:on,convertOffsetParentRelativeRectToViewportRelativeRect:Je,isElement:L,getDimensions:Tt,getOffsetParent:rt,getDocumentElement:$,getElementRects:t=>{let{reference:e,floating:n,strategy:i}=t;return{reference:qe(e,rt(n),i),floating:{...Tt(n),x:0,y:0}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>D(t).direction==="rtl"};function rn(t,e,n,i){i===void 0&&(i={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:s=!0,animationFrame:r=!1}=i,c=o&&!r,f=c||a?[...L(t)?Z(t):[],...Z(e)]:[];f.forEach(d=>{c&&d.addEventListener("scroll",n,{passive:!0}),a&&d.addEventListener("resize",n)});let m=null;if(s){let d=!0;m=new ResizeObserver(()=>{d||n(),d=!1}),L(t)&&!r&&m.observe(t),m.observe(e)}let l,u=r?k(t):null;r&&h();function h(){const d=k(t);u&&(d.x!==u.x||d.y!==u.y||d.width!==u.width||d.height!==u.height)&&n(),u=d,l=requestAnimationFrame(h)}return n(),()=>{var d;f.forEach(y=>{c&&y.removeEventListener("scroll",n),a&&y.removeEventListener("resize",n)}),(d=m)==null||d.disconnect(),m=null,r&&cancelAnimationFrame(l)}}const sn=(t,e,n)=>ke(t,e,{platform:q,...n}),an=globalThis.calciteComponentsConfig,cn={floatingUINonChromiumPositioningFix:!0,...an},ln=fn();async function fn(){function t(){const e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(n=>`${n.brand}/${n.version}`).join(" "):navigator.userAgent}if(Xt.isBrowser&&cn.floatingUINonChromiumPositioningFix&&/firefox|safari/i.test(t())){const{getClippingRect:e,getElementRects:n,getOffsetParent:i}=await Yt(()=>import("./nonChromiumPlatformUtils.fd7918ba.js"),["assets/nonChromiumPlatformUtils.fd7918ba.js","assets/index.6c049565.js","assets/index.cf071e35.css","assets/guid.ae96513b.js"]);q.getClippingRect=e,q.getOffsetParent=i,q.getElementRects=n}}const Wt="data-placement",Rt=100,Pt=["top","bottom","right","left","top-start","top-end","bottom-start","bottom-end","right-start","right-end","left-start","left-end"],st={animation:"calcite-floating-ui-anim",animationActive:"calcite-floating-ui-anim--active"};function un({placement:t,disableFlip:e,flipPlacements:n,offsetDistance:i,offsetSkidding:o,arrowEl:a,type:s}){const r=[Ue(),Me()];if(s==="menu")return[...r,vt({fallbackPlacements:n||["top-start","top","top-end","bottom-start","bottom","bottom-end"]})];if(s==="popover"||s==="tooltip"){const c=[...r,Fe({mainAxis:typeof i=="number"?i:0,crossAxis:typeof o=="number"?o:0})];return t==="auto"||t==="auto-start"||t==="auto-end"?c.push(Be({alignment:t==="auto-start"?"start":t==="auto-end"?"end":null})):e||c.push(vt(n?{fallbackPlacements:n}:{})),a&&c.push(De({element:a})),c}return[]}function On(t,e){const n=t.filter(i=>Pt.includes(i));return n.length!==t.length&&console.warn(`${e.tagName}: Invalid value found in: flipPlacements. Try any of these: ${Pt.map(i=>`"${i}"`).join(", ").trim()}`,{el:e}),n}function dn(t,e){const n=["left","right"];return Gt(t)==="rtl"&&n.reverse(),e.replace(/-leading/gi,"-start").replace(/-trailing/gi,"-end").replace(/leading/gi,n[0]).replace(/trailing/gi,n[1])}async function mn(t,e,n=!1){if(!!t.open)return n?hn(e):Ft(e)}const hn=Le(Ft,Rt,{leading:!0,maxWait:Rt});async function Ft({referenceEl:t,floatingEl:e,overlayPositioning:n="absolute",placement:i,disableFlip:o,flipPlacements:a,offsetDistance:s,offsetSkidding:r,includeArrow:c=!1,arrowEl:f,type:m}){var l;if(!t||!e||c&&!f)return null;await ln;const{x:u,y:h,placement:d,strategy:y,middlewareData:g}=await sn(t,e,{strategy:n,placement:i==="auto"||i==="auto-start"||i==="auto-end"?void 0:dn(e,i),middleware:un({placement:i,disableFlip:o,flipPlacements:a,offsetDistance:s,offsetSkidding:r,arrowEl:f,type:m})});if(g!=null&&g.arrow){const{x:T,y:p}=g.arrow;Object.assign(f.style,{left:T!=null?`${T}px`:"",top:p!=null?`${p}px`:""})}const v=((l=g==null?void 0:g.hide)===null||l===void 0?void 0:l.referenceHidden)?"hidden":null,x=v?"none":null;e.setAttribute(Wt,d);const w=`translate(${Math.round(u)}px,${Math.round(h)}px)`;Object.assign(e.style,{visibility:v,pointerEvents:x,position:y,top:"0",left:"0",transform:w})}const at=new WeakMap;function pn(t,e,n){if(!n||!e)return;Vt(t,e,n);const i=t.overlayPositioning;n.style.position=i,i==="absolute"&&Ut(n);const o=rn;at.set(t,o(e,n,()=>t.reposition()))}function Vt(t,e,n){if(!n||!e)return;ut(n).removeEventListener("transitionend",dt);const i=at.get(t);i&&i(),at.delete(t)}const Ot=4,gn=Math.ceil(Math.hypot(Ot,Ot));function vn(t){!t||t.style.position!=="absolute"||ut(t).addEventListener("transitionend",dt)}function ut(t){return t.shadowRoot||t}function dt(t){const e=t.target;if(t.propertyName==="opacity"&&e.classList.contains(st.animation)){const n=wn(e);Ut(n),ut(n).removeEventListener("transitionend",dt)}}function Ut(t){t.style.transform="",t.style.top="-99999px",t.style.left="-99999px"}function wn(t){return qt(t,`[${Wt}]`)}/*!
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
- * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
- * v1.0.0-beta.97
- */const At={container:"container",arrow:"arrow"},yn=500,Lt="aria-describedby";class bn{constructor(){this.registeredElements=new WeakMap,this.hoverTimeouts=new WeakMap,this.registeredElementCount=0,this.queryTooltip=e=>{const{registeredElements:n}=this,i=e.find(o=>n.has(o));return n.get(i)},this.keyDownHandler=e=>{if(e.key==="Escape"){const{activeTooltipEl:n}=this;n&&(this.clearHoverTimeout(n),this.toggleTooltip(n,!1))}},this.mouseEnterShow=e=>{this.hoverEvent(e,!0)},this.mouseLeaveHide=e=>{this.hoverEvent(e,!1)},this.clickHandler=e=>{if(!ee(e))return;const n=this.queryTooltip(e.composedPath());this.clickedTooltip=n,n!=null&&n.closeOnClick&&(this.toggleTooltip(n,!1),this.clearHoverTimeout(n))},this.focusShow=e=>{this.focusEvent(e,!0)},this.blurHide=e=>{this.focusEvent(e,!1)},this.hoverToggle=(e,n)=>{const{hoverTimeouts:i}=this;i.delete(e),n&&this.closeExistingTooltip(),this.toggleTooltip(e,n)}}registerElement(e,n){this.registeredElementCount++,this.registeredElements.set(e,n),this.registeredElementCount===1&&this.addListeners()}unregisterElement(e){this.registeredElements.delete(e)&&this.registeredElementCount--,this.registeredElementCount===0&&this.removeListeners()}addListeners(){document.addEventListener("keydown",this.keyDownHandler),document.addEventListener("pointerover",this.mouseEnterShow,{capture:!0}),document.addEventListener("pointerout",this.mouseLeaveHide,{capture:!0}),document.addEventListener("pointerdown",this.clickHandler,{capture:!0}),document.addEventListener("focusin",this.focusShow,{capture:!0}),document.addEventListener("focusout",this.blurHide,{capture:!0})}removeListeners(){document.removeEventListener("keydown",this.keyDownHandler),document.removeEventListener("pointerover",this.mouseEnterShow,{capture:!0}),document.removeEventListener("pointerout",this.mouseLeaveHide,{capture:!0}),document.removeEventListener("pointerdown",this.clickHandler,{capture:!0}),document.removeEventListener("focusin",this.focusShow,{capture:!0}),document.removeEventListener("focusout",this.blurHide,{capture:!0})}clearHoverTimeout(e){const{hoverTimeouts:n}=this;n.has(e)&&(window.clearTimeout(n.get(e)),n.delete(e))}closeExistingTooltip(){const{activeTooltipEl:e}=this;e&&this.toggleTooltip(e,!1)}focusTooltip(e,n){this.closeExistingTooltip(),n&&this.clearHoverTimeout(e),this.toggleTooltip(e,n)}toggleTooltip(e,n){e.open=n,n&&(this.activeTooltipEl=e)}hoverTooltip(e,n){this.clearHoverTimeout(e);const{hoverTimeouts:i}=this,o=window.setTimeout(()=>this.hoverToggle(e,n),yn);i.set(e,o)}activeTooltipHover(e){const{activeTooltipEl:n,hoverTimeouts:i}=this,{type:o}=e;!n||(o==="pointerover"&&e.composedPath().includes(n)?this.clearHoverTimeout(n):o==="pointerout"&&!i.has(n)&&this.hoverTooltip(n,!1))}hoverEvent(e,n){const i=this.queryTooltip(e.composedPath());this.activeTooltipHover(e),i&&this.hoverTooltip(i,n)}focusEvent(e,n){const i=this.queryTooltip(e.composedPath());if(!i||i===this.clickedTooltip){this.clickedTooltip=null;return}this.focusTooltip(i,n)}}const xn='@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{display:block;position:absolute;z-index:999}.calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);visibility:hidden;transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:1;border-radius:0.25rem}:host([data-placement^=bottom]) .calcite-floating-ui-anim{transform:translateY(-5px)}:host([data-placement^=top]) .calcite-floating-ui-anim{transform:translateY(5px)}:host([data-placement^=left]) .calcite-floating-ui-anim{transform:translateX(5px)}:host([data-placement^=right]) .calcite-floating-ui-anim{transform:translateX(-5px)}:host([data-placement]) .calcite-floating-ui-anim--active{opacity:1;visibility:visible;transform:translate(0)}:host([calcite-hydrated-hidden]){visibility:hidden !important;pointer-events:none}.arrow,.arrow::before{position:absolute;inline-size:8px;block-size:8px;z-index:-1}.arrow::before{content:"";--tw-shadow:0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);--tw-shadow-colored:0 4px 8px -1px var(--tw-shadow-color), 0 2px 4px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);transform:rotate(45deg);background:var(--calcite-ui-foreground-1)}:host([data-placement^=top]) .arrow{inset-block-end:-4px}:host([data-placement^=bottom]) .arrow{inset-block-start:-4px}:host([data-placement^=left]) .arrow{direction:ltr;inset-inline-end:-4px}:host([data-placement^=right]) .arrow{direction:ltr;inset-inline-start:-4px}.container{position:relative;overflow:hidden;border-radius:0.25rem;background-color:var(--calcite-ui-foreground-1);padding-block:0.75rem;padding-inline:1rem;font-size:var(--calcite-font-size--2);line-height:1.375;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1);max-inline-size:20rem;max-block-size:20rem;text-align:start}.calcite-floating-ui-anim{border-radius:0.25rem;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3);background-color:var(--calcite-ui-foreground-1)}.arrow::before{outline:1px solid var(--calcite-ui-border-3)}',kt=new bn,Tn=Jt(class extends Kt{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.closeOnClick=!1,this.offsetDistance=gn,this.offsetSkidding=0,this.open=!1,this.overlayPositioning="absolute",this.placement="auto",this.guid=`calcite-tooltip-${ne()}`,this.hasLoaded=!1,this.setUpReferenceElement=(t=!0)=>{this.removeReferences(),this.effectiveReferenceElement=this.getReferenceElement(),pn(this,this.effectiveReferenceElement,this.el);const{el:e,referenceElement:n,effectiveReferenceElement:i}=this;t&&n&&!i&&console.warn(`${e.tagName}: reference-element id "${n}" was not found.`,{el:e}),this.addReferences()},this.getId=()=>this.el.id||this.guid,this.addReferences=()=>{const{effectiveReferenceElement:t}=this;if(!t)return;const e=this.getId();"setAttribute"in t&&t.setAttribute(Lt,e),kt.registerElement(t,this.el)},this.removeReferences=()=>{const{effectiveReferenceElement:t}=this;!t||("removeAttribute"in t&&t.removeAttribute(Lt),kt.unregisterElement(t))}}offsetDistanceOffsetHandler(){this.reposition(!0)}offsetSkiddingHandler(){this.reposition(!0)}openHandler(t){t?this.reposition(!0):vn(this.el)}overlayPositioningHandler(){this.reposition(!0)}placementHandler(){this.reposition(!0)}referenceElementHandler(){this.setUpReferenceElement()}connectedCallback(){this.setUpReferenceElement(this.hasLoaded)}componentDidLoad(){this.referenceElement&&!this.effectiveReferenceElement&&this.setUpReferenceElement(),this.reposition(!0),this.hasLoaded=!0}disconnectedCallback(){this.removeReferences(),Vt(this,this.effectiveReferenceElement,this.el)}async reposition(t=!1){const{el:e,effectiveReferenceElement:n,placement:i,overlayPositioning:o,offsetDistance:a,offsetSkidding:s,arrowEl:r}=this;return mn(this,{floatingEl:e,referenceEl:n,overlayPositioning:o,placement:i,offsetDistance:a,offsetSkidding:s,includeArrow:!0,arrowEl:r,type:"tooltip"},t)}getReferenceElement(){const{referenceElement:t,el:e}=this;return(typeof t=="string"?Qt(e,{id:t}):t)||null}render(){const{effectiveReferenceElement:t,label:e,open:n}=this,i=t&&n,o=!i;return W(te,{"aria-hidden":Zt(o),"aria-label":e,"aria-live":"polite","calcite-hydrated-hidden":o,id:this.getId(),role:"tooltip"},W("div",{class:{[st.animation]:!0,[st.animationActive]:i}},W("div",{class:At.arrow,ref:a=>this.arrowEl=a}),W("div",{class:At.container},W("slot",null))))}get el(){return this}static get watchers(){return{offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"]}}static get style(){return xn}},[1,"calcite-tooltip",{closeOnClick:[516,"close-on-click"],label:[1],offsetDistance:[514,"offset-distance"],offsetSkidding:[514,"offset-skidding"],open:[516],overlayPositioning:[513,"overlay-positioning"],placement:[513],referenceElement:[1,"reference-element"],effectiveReferenceElement:[32],reposition:[64]}]);function En(){if(typeof customElements=="undefined")return;["calcite-tooltip"].forEach(e=>{switch(e){case"calcite-tooltip":customElements.get(e)||customElements.define(e,Tn);break}})}En();export{st as F,Tn as T,Vt as a,En as b,pn as c,gn as d,J as e,On as f,mn as r,vn as u};
|