UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

2 lines 30.2 kB
/*! For license information please see 39763.25c25b08ff6072e8.js.LICENSE.txt */ export const __rspack_esm_id=39763;export const __rspack_esm_ids=[39763];export const __webpack_modules__={76848(t,e,o){o.d(e,{UE:()=>J,ll:()=>V,rD:()=>G,UU:()=>Q,cY:()=>Y,iD:()=>j,BN:()=>I,Ej:()=>X});o(18111),o(22489),o(45367),o(92731),o(74423),o(61701);const n=Math.min,i=Math.max,r=Math.round,a=Math.floor,s=t=>({x:t,y:t}),l={left:"right",right:"left",bottom:"top",top:"bottom"};function c(t,e,o){return i(t,n(e,o))}function p(t,e){return"function"==typeof t?t(e):t}function h(t){return t.split("-")[0]}function f(t){return t.split("-")[1]}function u(t){return"x"===t?"y":"x"}function d(t){return"y"===t?"height":"width"}function g(t){const e=t[0];return"t"===e||"b"===e?"y":"x"}function m(t){return u(g(t))}function y(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const v=["left","right"],w=["right","left"],b=["top","bottom"],x=["bottom","top"];function P(t,e,o,n){const i=f(t);let r=function(t,e,o){switch(t){case"top":case"bottom":return o?e?w:v:e?v:w;case"left":case"right":return e?b:x;default:return[]}}(h(t),"start"===o,n);return i&&(r=r.map(t=>t+"-"+i),e&&(r=r.concat(r.map(y)))),r}function E(t){const e=h(t);return l[e]+t.slice(e.length)}function z(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function L(t){const{x:e,y:o,width:n,height:i}=t;return{width:n,height:i,top:o,left:e,right:e+n,bottom:o+i,x:e,y:o}}o(44114),o(81148),o(20116),o(18237),o(13579),o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698);function R(t,e,o){let{reference:n,floating:i}=t;const r=g(e),a=m(e),s=d(a),l=h(e),c="y"===r,p=n.x+n.width/2-i.width/2,u=n.y+n.height/2-i.height/2,y=n[s]/2-i[s]/2;let v;switch(l){case"top":v={x:p,y:n.y-i.height};break;case"bottom":v={x:p,y:n.y+n.height};break;case"right":v={x:n.x+n.width,y:u};break;case"left":v={x:n.x-i.width,y:u};break;default:v={x:n.x,y:n.y}}switch(f(e)){case"start":v[a]-=y*(o&&c?-1:1);break;case"end":v[a]+=y*(o&&c?-1:1)}return v}async function k(t,e){var o;void 0===e&&(e={});const{x:n,y:i,platform:r,rects:a,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:f="floating",altBoundary:u=!1,padding:d=0}=p(e,t),g=z(d),m=s[u?"floating"===f?"reference":"floating":f],y=L(await r.getClippingRect({element:null==(o=await(null==r.isElement?void 0:r.isElement(m)))||o?m:m.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(s.floating)),boundary:c,rootBoundary:h,strategy:l})),v="floating"===f?{x:n,y:i,width:a.floating.width,height:a.floating.height}:a.reference,w=await(null==r.getOffsetParent?void 0:r.getOffsetParent(s.floating)),b=await(null==r.isElement?void 0:r.isElement(w))&&await(null==r.getScale?void 0:r.getScale(w))||{x:1,y:1},x=L(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:w,strategy:l}):v);return{top:(y.top-x.top+g.top)/b.y,bottom:(x.bottom-y.bottom+g.bottom)/b.y,left:(y.left-x.left+g.left)/b.x,right:(x.right-y.right+g.right)/b.x}}const S=new Set(["left","top"]);var T=o(21306);function A(t){const e=(0,T.L9)(t);let o=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=(0,T.sb)(t),a=i?t.offsetWidth:o,s=i?t.offsetHeight:n,l=r(o)!==a||r(n)!==s;return l&&(o=a,n=s),{width:o,height:n,$:l}}function C(t){return(0,T.vq)(t)?t:t.contextElement}function O(t){const e=C(t);if(!(0,T.sb)(e))return s(1);const o=e.getBoundingClientRect(),{width:n,height:i,$:a}=A(e);let l=(a?r(o.width):o.width)/n,c=(a?r(o.height):o.height)/i;return l&&Number.isFinite(l)||(l=1),c&&Number.isFinite(c)||(c=1),{x:l,y:c}}const B=s(0);function M(t){const e=(0,T.zk)(t);return(0,T.Tc)()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:B}function D(t,e,o,n){void 0===e&&(e=!1),void 0===o&&(o=!1);const i=t.getBoundingClientRect(),r=C(t);let a=s(1);e&&(n?(0,T.vq)(n)&&(a=O(n)):a=O(t));const l=function(t,e,o){return void 0===e&&(e=!1),!(!o||e&&o!==(0,T.zk)(t))&&e}(r,o,n)?M(r):s(0);let c=(i.left+l.x)/a.x,p=(i.top+l.y)/a.y,h=i.width/a.x,f=i.height/a.y;if(r){const t=(0,T.zk)(r),e=n&&(0,T.vq)(n)?(0,T.zk)(n):n;let o=t,i=(0,T._m)(o);for(;i&&n&&e!==o;){const t=O(i),e=i.getBoundingClientRect(),n=(0,T.L9)(i),r=e.left+(i.clientLeft+parseFloat(n.paddingLeft))*t.x,a=e.top+(i.clientTop+parseFloat(n.paddingTop))*t.y;c*=t.x,p*=t.y,h*=t.x,f*=t.y,c+=r,p+=a,o=(0,T.zk)(i),i=(0,T._m)(o)}}return L({width:h,height:f,x:c,y:p})}function $(t,e){const o=(0,T.CP)(t).scrollLeft;return e?e.left+o:D((0,T.ep)(t)).left+o}function Z(t,e){const o=t.getBoundingClientRect();return{x:o.left+e.scrollLeft-$(t,o),y:o.top+e.scrollTop}}function F(t,e,o){let n;if("viewport"===e)n=function(t,e){const o=(0,T.zk)(t),n=(0,T.ep)(t),i=o.visualViewport;let r=n.clientWidth,a=n.clientHeight,s=0,l=0;if(i){r=i.width,a=i.height;const t=(0,T.Tc)();(!t||t&&"fixed"===e)&&(s=i.offsetLeft,l=i.offsetTop)}const c=$(n);if(c<=0){const t=n.ownerDocument,e=t.body,o=getComputedStyle(e),i="CSS1Compat"===t.compatMode&&parseFloat(o.marginLeft)+parseFloat(o.marginRight)||0,a=Math.abs(n.clientWidth-e.clientWidth-i);a<=25&&(r-=a)}else c<=25&&(r+=c);return{width:r,height:a,x:s,y:l}}(t,o);else if("document"===e)n=function(t){const e=(0,T.ep)(t),o=(0,T.CP)(t),n=t.ownerDocument.body,r=i(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),a=i(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-o.scrollLeft+$(t);const l=-o.scrollTop;return"rtl"===(0,T.L9)(n).direction&&(s+=i(e.clientWidth,n.clientWidth)-r),{width:r,height:a,x:s,y:l}}((0,T.ep)(t));else if((0,T.vq)(e))n=function(t,e){const o=D(t,!0,"fixed"===e),n=o.top+t.clientTop,i=o.left+t.clientLeft,r=(0,T.sb)(t)?O(t):s(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:n*r.y}}(e,o);else{const o=M(t);n={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return L(n)}function q(t,e){const o=(0,T.$4)(t);return!(o===e||!(0,T.vq)(o)||(0,T.eu)(o))&&("fixed"===(0,T.L9)(o).position||q(o,e))}function H(t,e,o){const n=(0,T.sb)(e),i=(0,T.ep)(e),r="fixed"===o,a=D(t,!0,r,e);let l={scrollLeft:0,scrollTop:0};const c=s(0);function p(){c.x=$(i)}if(n||!n&&!r)if(("body"!==(0,T.mq)(e)||(0,T.ZU)(i))&&(l=(0,T.CP)(e)),n){const t=D(e,!0,r,e);c.x=t.x+e.clientLeft,c.y=t.y+e.clientTop}else i&&p();r&&!n&&i&&p();const h=!i||n||r?s(0):Z(i,l);return{x:a.left+l.scrollLeft-c.x-h.x,y:a.top+l.scrollTop-c.y-h.y,width:a.width,height:a.height}}function N(t){return"static"===(0,T.L9)(t).position}function _(t,e){if(!(0,T.sb)(t)||"fixed"===(0,T.L9)(t).position)return null;if(e)return e(t);let o=t.offsetParent;return(0,T.ep)(t)===o&&(o=o.ownerDocument.body),o}function W(t,e){const o=(0,T.zk)(t);if((0,T.Tf)(t))return o;if(!(0,T.sb)(t)){let e=(0,T.$4)(t);for(;e&&!(0,T.eu)(e);){if((0,T.vq)(e)&&!N(e))return e;e=(0,T.$4)(e)}return o}let n=_(t,e);for(;n&&(0,T.Lv)(n)&&N(n);)n=_(n,e);return n&&(0,T.eu)(n)&&N(n)&&!(0,T.sQ)(n)?o:n||(0,T.gJ)(t)||o}const j={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:o,offsetParent:n,strategy:i}=t;const r="fixed"===i,a=(0,T.ep)(n),l=!!e&&(0,T.Tf)(e.floating);if(n===a||l&&r)return o;let c={scrollLeft:0,scrollTop:0},p=s(1);const h=s(0),f=(0,T.sb)(n);if((f||!f&&!r)&&(("body"!==(0,T.mq)(n)||(0,T.ZU)(a))&&(c=(0,T.CP)(n)),f)){const t=D(n);p=O(n),h.x=t.x+n.clientLeft,h.y=t.y+n.clientTop}const u=!a||f||r?s(0):Z(a,c);return{width:o.width*p.x,height:o.height*p.y,x:o.x*p.x-c.scrollLeft*p.x+h.x+u.x,y:o.y*p.y-c.scrollTop*p.y+h.y+u.y}},getDocumentElement:T.ep,getClippingRect:function(t){let{element:e,boundary:o,rootBoundary:r,strategy:a}=t;const s=[..."clippingAncestors"===o?(0,T.Tf)(e)?[]:function(t,e){const o=e.get(t);if(o)return o;let n=(0,T.v9)(t,[],!1).filter(t=>(0,T.vq)(t)&&"body"!==(0,T.mq)(t)),i=null;const r="fixed"===(0,T.L9)(t).position;let a=r?(0,T.$4)(t):t;for(;(0,T.vq)(a)&&!(0,T.eu)(a);){const e=(0,T.L9)(a),o=(0,T.sQ)(a);o||"fixed"!==e.position||(i=null),(r?!o&&!i:!o&&"static"===e.position&&i&&("absolute"===i.position||"fixed"===i.position)||(0,T.ZU)(a)&&!o&&q(t,a))?n=n.filter(t=>t!==a):i=e,a=(0,T.$4)(a)}return e.set(t,n),n}(e,this._c):[].concat(o),r],l=F(e,s[0],a);let c=l.top,p=l.right,h=l.bottom,f=l.left;for(let t=1;t<s.length;t++){const o=F(e,s[t],a);c=i(o.top,c),p=n(o.right,p),h=n(o.bottom,h),f=i(o.left,f)}return{width:p-f,height:h-c,x:f,y:c}},getOffsetParent:W,getElementRects:async function(t){const e=this.getOffsetParent||W,o=this.getDimensions,n=await o(t.floating);return{reference:H(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:o}=A(t);return{width:e,height:o}},getScale:O,isElement:T.vq,isRTL:function(t){return"rtl"===(0,T.L9)(t).direction}};function U(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function V(t,e,o,r){void 0===r&&(r={});const{ancestorScroll:s=!0,ancestorResize:l=!0,elementResize:c="function"==typeof ResizeObserver,layoutShift:p="function"==typeof IntersectionObserver,animationFrame:h=!1}=r,f=C(t),u=s||l?[...f?(0,T.v9)(f):[],...e?(0,T.v9)(e):[]]:[];u.forEach(t=>{s&&t.addEventListener("scroll",o,{passive:!0}),l&&t.addEventListener("resize",o)});const d=f&&p?function(t,e){let o,r=null;const s=(0,T.ep)(t);function l(){var t;clearTimeout(o),null==(t=r)||t.disconnect(),r=null}return function c(p,h){void 0===p&&(p=!1),void 0===h&&(h=1),l();const f=t.getBoundingClientRect(),{left:u,top:d,width:g,height:m}=f;if(p||e(),!g||!m)return;const y={rootMargin:-a(d)+"px "+-a(s.clientWidth-(u+g))+"px "+-a(s.clientHeight-(d+m))+"px "+-a(u)+"px",threshold:i(0,n(1,h))||1};let v=!0;function w(e){const n=e[0].intersectionRatio;if(n!==h){if(!v)return c();n?c(!1,n):o=setTimeout(()=>{c(!1,1e-7)},1e3)}1!==n||U(f,t.getBoundingClientRect())||c(),v=!1}try{r=new IntersectionObserver(w,{...y,root:s.ownerDocument})}catch(t){r=new IntersectionObserver(w,y)}r.observe(t)}(!0),l}(f,o):null;let g,m=-1,y=null;c&&(y=new ResizeObserver(t=>{let[n]=t;n&&n.target===f&&y&&e&&(y.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var t;null==(t=y)||t.observe(e)})),o()}),f&&!h&&y.observe(f),e&&y.observe(e));let v=h?D(t):null;return h&&function e(){const n=D(t);v&&!U(v,n)&&o();v=n,g=requestAnimationFrame(e)}(),o(),()=>{var t;u.forEach(t=>{s&&t.removeEventListener("scroll",o),l&&t.removeEventListener("resize",o)}),null==d||d(),null==(t=y)||t.disconnect(),y=null,h&&cancelAnimationFrame(g)}}const Y=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var o,n;const{x:i,y:r,placement:a,middlewareData:s}=e,l=await async function(t,e){const{placement:o,platform:n,elements:i}=t,r=await(null==n.isRTL?void 0:n.isRTL(i.floating)),a=h(o),s=f(o),l="y"===g(o),c=S.has(a)?-1:1,u=r&&l?-1:1,d=p(e,t);let{mainAxis:m,crossAxis:y,alignmentAxis:v}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof v&&(y="end"===s?-1*v:v),l?{x:y*u,y:m*c}:{x:m*c,y:y*u}}(e,t);return a===(null==(o=s.offset)?void 0:o.placement)&&null!=(n=s.arrow)&&n.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:a}}}}},I=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:o,y:n,placement:i,platform:r}=e,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:t=>{let{x:e,y:o}=t;return{x:e,y:o}}},...f}=p(t,e),d={x:o,y:n},m=await r.detectOverflow(e,f),y=g(h(i)),v=u(y);let w=d[v],b=d[y];if(a){const t="y"===v?"bottom":"right";w=c(w+m["y"===v?"top":"left"],w,w-m[t])}if(s){const t="y"===y?"bottom":"right";b=c(b+m["y"===y?"top":"left"],b,b-m[t])}const x=l.fn({...e,[v]:w,[y]:b});return{...x,data:{x:x.x-o,y:x.y-n,enabled:{[v]:a,[y]:s}}}}}},Q=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var o,n;const{placement:i,middlewareData:r,rects:a,initialPlacement:s,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:v=!0,fallbackPlacements:w,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:z=!0,...L}=p(t,e);if(null!=(o=r.arrow)&&o.alignmentOffset)return{};const R=h(i),k=g(s),S=h(s)===s,T=await(null==l.isRTL?void 0:l.isRTL(c.floating)),A=w||(S||!z?[E(s)]:function(t){const e=E(t);return[y(t),e,y(e)]}(s)),C="none"!==x;!w&&C&&A.push(...P(s,z,x,T));const O=[s,...A],B=await l.detectOverflow(e,L),M=[];let D=(null==(n=r.flip)?void 0:n.overflows)||[];if(u&&M.push(B[R]),v){const t=function(t,e,o){void 0===o&&(o=!1);const n=f(t),i=m(t),r=d(i);let a="x"===i?n===(o?"end":"start")?"right":"left":"start"===n?"bottom":"top";return e.reference[r]>e.floating[r]&&(a=E(a)),[a,E(a)]}(i,a,T);M.push(B[t[0]],B[t[1]])}if(D=[...D,{placement:i,overflows:M}],!M.every(t=>t<=0)){var $,Z;const t=((null==($=r.flip)?void 0:$.index)||0)+1,e=O[t];if(e){if(!("alignment"===v&&k!==g(e))||D.every(t=>g(t.placement)!==k||t.overflows[0]>0))return{data:{index:t,overflows:D},reset:{placement:e}}}let o=null==(Z=D.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:Z.placement;if(!o)switch(b){case"bestFit":{var F;const t=null==(F=D.filter(t=>{if(C){const e=g(t.placement);return e===k||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:F[0];t&&(o=t);break}case"initialPlacement":o=s}if(i!==o)return{reset:{placement:o}}}return{}}}},X=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){var o,r;const{placement:a,rects:s,platform:l,elements:c}=e,{apply:u=()=>{},...d}=p(t,e),m=await l.detectOverflow(e,d),y=h(a),v=f(a),w="y"===g(a),{width:b,height:x}=s.floating;let P,E;"top"===y||"bottom"===y?(P=y,E=v===(await(null==l.isRTL?void 0:l.isRTL(c.floating))?"start":"end")?"left":"right"):(E=y,P="end"===v?"top":"bottom");const z=x-m.top-m.bottom,L=b-m.left-m.right,R=n(x-m[P],z),k=n(b-m[E],L),S=!e.middlewareData.shift;let T=R,A=k;if(null!=(o=e.middlewareData.shift)&&o.enabled.x&&(A=L),null!=(r=e.middlewareData.shift)&&r.enabled.y&&(T=z),S&&!v){const t=i(m.left,0),e=i(m.right,0),o=i(m.top,0),n=i(m.bottom,0);w?A=b-2*(0!==t||0!==e?t+e:i(m.left,m.right)):T=x-2*(0!==o||0!==n?o+n:i(m.top,m.bottom))}await u({...e,availableWidth:A,availableHeight:T});const C=await l.getDimensions(c.floating);return b!==C.width||x!==C.height?{reset:{rects:!0}}:{}}}},J=t=>({name:"arrow",options:t,async fn(e){const{x:o,y:i,placement:r,rects:a,platform:s,elements:l,middlewareData:h}=e,{element:u,padding:g=0}=p(t,e)||{};if(null==u)return{};const y=z(g),v={x:o,y:i},w=m(r),b=d(w),x=await s.getDimensions(u),P="y"===w,E=P?"top":"left",L=P?"bottom":"right",R=P?"clientHeight":"clientWidth",k=a.reference[b]+a.reference[w]-v[w]-a.floating[b],S=v[w]-a.reference[w],T=await(null==s.getOffsetParent?void 0:s.getOffsetParent(u));let A=T?T[R]:0;A&&await(null==s.isElement?void 0:s.isElement(T))||(A=l.floating[R]||a.floating[b]);const C=k/2-S/2,O=A/2-x[b]/2-1,B=n(y[E],O),M=n(y[L],O),D=B,$=A-x[b]-M,Z=A/2-x[b]/2+C,F=c(D,Z,$),q=!h.arrow&&null!=f(r)&&Z!==F&&a.reference[b]/2-(Z<D?B:M)-x[b]/2<0,H=q?Z<D?Z-D:Z-$:0;return{[w]:v[w]+H,data:{[w]:F,centerOffset:Z-F-H,...q&&{alignmentOffset:H}},reset:q}}}),G=(t,e,o)=>{const n=new Map,i={platform:j,...o},r={...i.platform,_c:n};return(async(t,e,o)=>{const{placement:n="bottom",strategy:i="absolute",middleware:r=[],platform:a}=o,s=a.detectOverflow?a:{...a,detectOverflow:k},l=await(null==a.isRTL?void 0:a.isRTL(e));let c=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:p,y:h}=R(c,n,l),f=n,u=0;const d={};for(let o=0;o<r.length;o++){const g=r[o];if(!g)continue;const{name:m,fn:y}=g,{x:v,y:w,data:b,reset:x}=await y({x:p,y:h,initialPlacement:n,placement:f,strategy:i,middlewareData:d,rects:c,platform:s,elements:{reference:t,floating:e}});p=null!=v?v:p,h=null!=w?w:h,d[m]={...d[m],...b},x&&u<50&&(u++,"object"==typeof x&&(x.placement&&(f=x.placement),x.rects&&(c=!0===x.rects?await a.getElementRects({reference:t,floating:e,strategy:i}):x.rects),({x:p,y:h}=R(c,f,l))),o=-1)}return{x:p,y:h,placement:f,strategy:i,middlewareData:d}})(t,e,{...i,platform:r})}},21306(t,e,o){o.d(e,{$4:()=>z,CP:()=>E,L9:()=>P,Lv:()=>f,Tc:()=>b,Tf:()=>u,ZU:()=>h,_m:()=>k,ep:()=>a,eu:()=>x,gJ:()=>w,mq:()=>i,sQ:()=>v,sb:()=>c,v9:()=>R,vq:()=>l,zk:()=>r});o(18111),o(22489);function n(){return"undefined"!=typeof window}function i(t){return s(t)?(t.nodeName||"").toLowerCase():"#document"}function r(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function a(t){var e;return null==(e=(s(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function s(t){return!!n()&&(t instanceof Node||t instanceof r(t).Node)}function l(t){return!!n()&&(t instanceof Element||t instanceof r(t).Element)}function c(t){return!!n()&&(t instanceof HTMLElement||t instanceof r(t).HTMLElement)}function p(t){return!(!n()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof r(t).ShadowRoot)}function h(t){const{overflow:e,overflowX:o,overflowY:n,display:i}=P(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+o)&&"inline"!==i&&"contents"!==i}function f(t){return/^(table|td|th)$/.test(i(t))}function u(t){try{if(t.matches(":popover-open"))return!0}catch(t){}try{return t.matches(":modal")}catch(t){return!1}}const d=/transform|translate|scale|rotate|perspective|filter/,g=/paint|layout|strict|content/,m=t=>!!t&&"none"!==t;let y;function v(t){const e=l(t)?P(t):t;return m(e.transform)||m(e.translate)||m(e.scale)||m(e.rotate)||m(e.perspective)||!b()&&(m(e.backdropFilter)||m(e.filter))||d.test(e.willChange||"")||g.test(e.contain||"")}function w(t){let e=z(t);for(;c(e)&&!x(e);){if(v(e))return e;if(u(e))return null;e=z(e)}return null}function b(){return null==y&&(y="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),y}function x(t){return/^(html|body|#document)$/.test(i(t))}function P(t){return r(t).getComputedStyle(t)}function E(t){return l(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function z(t){if("html"===i(t))return t;const e=t.assignedSlot||t.parentNode||p(t)&&t.host||a(t);return p(e)?e.host:e}function L(t){const e=z(t);return x(e)?t.ownerDocument?t.ownerDocument.body:t.body:c(e)&&h(e)?e:L(e)}function R(t,e,o){var n;void 0===e&&(e=[]),void 0===o&&(o=!0);const i=L(t),a=i===(null==(n=t.ownerDocument)?void 0:n.body),s=r(i);if(a){const t=k(s);return e.concat(s,s.visualViewport||[],h(i)?i:[],t&&o?R(t):[])}return e.concat(i,R(i,[],o))}function k(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}},40158(t,e,o){o.a(t,async function(t,n){try{o.d(e,{A:()=>b});o(74423),o(44114),o(18111),o(22489),o(61701);var i=o(76848),r=o(21306),a=o(73015),s=o(5124),l=o(22441),c=o(6412),p=o(91336),h=o(717),f=o(17060),u=o(78520),d=t([f]);f=(d.then?(await d)():d)[0];var g=Object.defineProperty,m=Object.getOwnPropertyDescriptor,y=(t,e,o,n)=>{for(var i,r=n>1?void 0:n?m(e,o):e,a=t.length-1;a>=0;a--)(i=t[a])&&(r=(n?i(e,o,r):i(r))||r);return n&&r&&g(e,o,r),r};function v(t){return null!==t&&"object"==typeof t&&"getBoundingClientRect"in t&&(!("contextElement"in t)||t instanceof Element)}const w=globalThis?.HTMLElement?.prototype.hasOwnProperty("popover");let b=class extends h.A{async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.start()}disconnectedCallback(){super.disconnectedCallback(),this.stop()}async updated(t){super.updated(t),t.has("active")&&(this.active?this.start():this.stop()),t.has("anchor")&&this.handleAnchorChange(),this.active&&(await this.updateComplete,this.reposition())}async handleAnchorChange(){if(await this.stop(),this.anchor&&"string"==typeof this.anchor){const t=this.getRootNode();this.anchorEl=t.getElementById(this.anchor)}else this.anchor instanceof Element||v(this.anchor)?this.anchorEl=this.anchor:this.anchorEl=this.querySelector('[slot="anchor"]');this.anchorEl instanceof HTMLSlotElement&&(this.anchorEl=this.anchorEl.assignedElements({flatten:!0})[0]),this.anchorEl&&this.start()}start(){this.anchorEl&&this.active&&this.isConnected&&(this.popup?.showPopover?.(),this.cleanup=(0,i.ll)(this.anchorEl,this.popup,()=>{this.reposition()}))}async stop(){return new Promise(t=>{this.popup?.hidePopover?.(),this.cleanup?(this.cleanup(),this.cleanup=void 0,this.removeAttribute("data-current-placement"),this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height"),requestAnimationFrame(()=>t())):t()})}reposition(){if(!this.active||!this.anchorEl||!this.popup)return;const t=[(0,i.cY)({mainAxis:this.distance,crossAxis:this.skidding})];let e;this.sync?t.push((0,i.Ej)({apply:({rects:t})=>{const e="width"===this.sync||"both"===this.sync,o="height"===this.sync||"both"===this.sync;this.popup.style.width=e?`${t.reference.width}px`:"",this.popup.style.height=o?`${t.reference.height}px`:""}})):(this.popup.style.width="",this.popup.style.height=""),w&&!v(this.anchor)&&"scroll"===this.boundary&&(e=(0,r.v9)(this.anchorEl).filter(t=>t instanceof Element)),this.flip&&t.push((0,i.UU)({boundary:this.flipBoundary||e,fallbackPlacements:this.flipFallbackPlacements,fallbackStrategy:"best-fit"===this.flipFallbackStrategy?"bestFit":"initialPlacement",padding:this.flipPadding})),this.shift&&t.push((0,i.BN)({boundary:this.shiftBoundary||e,padding:this.shiftPadding})),this.autoSize?t.push((0,i.Ej)({boundary:this.autoSizeBoundary||e,padding:this.autoSizePadding,apply:({availableWidth:t,availableHeight:e})=>{"vertical"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-height",`${e}px`):this.style.removeProperty("--auto-size-available-height"),"horizontal"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-width",`${t}px`):this.style.removeProperty("--auto-size-available-width")}})):(this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height")),this.arrow&&t.push((0,i.UE)({element:this.arrowEl,padding:this.arrowPadding}));const o=w?t=>i.iD.getOffsetParent(t,a.WX):i.iD.getOffsetParent;(0,i.rD)(this.anchorEl,this.popup,{placement:this.placement,middleware:t,strategy:w?"absolute":"fixed",platform:{...i.iD,getOffsetParent:o}}).then(({x:t,y:e,middlewareData:o,placement:n})=>{const i="rtl"===this.localize.dir(),r={top:"bottom",right:"left",bottom:"top",left:"right"}[n.split("-")[0]];if(this.setAttribute("data-current-placement",n),Object.assign(this.popup.style,{left:`${t}px`,top:`${e}px`}),this.arrow){const t=o.arrow.x,e=o.arrow.y;let n="",a="",s="",l="";if("start"===this.arrowPlacement){const o="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";n="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"",a=i?o:"",l=i?"":o}else if("end"===this.arrowPlacement){const o="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";a=i?"":o,l=i?o:"",s="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:""}else"center"===this.arrowPlacement?(l="number"==typeof t?"calc(50% - var(--arrow-size-diagonal))":"",n="number"==typeof e?"calc(50% - var(--arrow-size-diagonal))":""):(l="number"==typeof t?`${t}px`:"",n="number"==typeof e?`${e}px`:"");Object.assign(this.arrowEl.style,{top:n,right:a,bottom:s,left:l,[r]:"calc(var(--arrow-base-offset) - var(--arrow-size-diagonal))"})}}),requestAnimationFrame(()=>this.updateHoverBridge()),this.dispatchEvent(new p.B)}render(){return s.qy` <slot name="anchor" @slotchange="${this.handleAnchorChange}"></slot> <span part="hover-bridge" class="${(0,c.H)({"popup-hover-bridge":!0,"popup-hover-bridge-visible":this.hoverBridge&&this.active})}"></span> <div popover="manual" part="popup" class="${(0,c.H)({popup:!0,"popup-active":this.active,"popup-fixed":!w,"popup-has-arrow":this.arrow})}"> <slot></slot> ${this.arrow?s.qy`<div part="arrow" class="arrow" role="presentation"></div>`:""} </div> `}constructor(){super(...arguments),this.localize=new f.c(this),this.active=!1,this.placement="top",this.boundary="viewport",this.distance=0,this.skidding=0,this.arrow=!1,this.arrowPlacement="anchor",this.arrowPadding=10,this.flip=!1,this.flipFallbackPlacements="",this.flipFallbackStrategy="best-fit",this.flipPadding=0,this.shift=!1,this.shiftPadding=0,this.autoSizePadding=0,this.hoverBridge=!1,this.updateHoverBridge=()=>{if(this.hoverBridge&&this.anchorEl&&this.popup){const t=this.anchorEl.getBoundingClientRect(),e=this.popup.getBoundingClientRect();let o=0,n=0,i=0,r=0,a=0,s=0,l=0,c=0;this.placement.includes("top")||this.placement.includes("bottom")?t.top<e.top?(o=t.left,n=t.bottom,i=t.right,r=t.bottom,a=e.left,s=e.top,l=e.right,c=e.top):(o=e.left,n=e.bottom,i=e.right,r=e.bottom,a=t.left,s=t.top,l=t.right,c=t.top):t.left<e.left?(o=t.right,n=t.top,i=e.left,r=e.top,a=t.right,s=t.bottom,l=e.left,c=e.bottom):(o=e.right,n=e.top,i=t.left,r=t.top,a=e.right,s=e.bottom,l=t.left,c=t.bottom),this.style.setProperty("--hover-bridge-top-left-x",`${o}px`),this.style.setProperty("--hover-bridge-top-left-y",`${n}px`),this.style.setProperty("--hover-bridge-top-right-x",`${i}px`),this.style.setProperty("--hover-bridge-top-right-y",`${r}px`),this.style.setProperty("--hover-bridge-bottom-left-x",`${a}px`),this.style.setProperty("--hover-bridge-bottom-left-y",`${s}px`),this.style.setProperty("--hover-bridge-bottom-right-x",`${l}px`),this.style.setProperty("--hover-bridge-bottom-right-y",`${c}px`)}}}};b.css=u.A,y([(0,l.P)(".popup")],b.prototype,"popup",2),y([(0,l.P)(".arrow")],b.prototype,"arrowEl",2),y([(0,l.MZ)()],b.prototype,"anchor",2),y([(0,l.MZ)({type:Boolean,reflect:!0})],b.prototype,"active",2),y([(0,l.MZ)({reflect:!0})],b.prototype,"placement",2),y([(0,l.MZ)()],b.prototype,"boundary",2),y([(0,l.MZ)({type:Number})],b.prototype,"distance",2),y([(0,l.MZ)({type:Number})],b.prototype,"skidding",2),y([(0,l.MZ)({type:Boolean})],b.prototype,"arrow",2),y([(0,l.MZ)({attribute:"arrow-placement"})],b.prototype,"arrowPlacement",2),y([(0,l.MZ)({attribute:"arrow-padding",type:Number})],b.prototype,"arrowPadding",2),y([(0,l.MZ)({type:Boolean})],b.prototype,"flip",2),y([(0,l.MZ)({attribute:"flip-fallback-placements",converter:{fromAttribute:t=>t.split(" ").map(t=>t.trim()).filter(t=>""!==t),toAttribute:t=>t.join(" ")}})],b.prototype,"flipFallbackPlacements",2),y([(0,l.MZ)({attribute:"flip-fallback-strategy"})],b.prototype,"flipFallbackStrategy",2),y([(0,l.MZ)({type:Object})],b.prototype,"flipBoundary",2),y([(0,l.MZ)({attribute:"flip-padding",type:Number})],b.prototype,"flipPadding",2),y([(0,l.MZ)({type:Boolean})],b.prototype,"shift",2),y([(0,l.MZ)({type:Object})],b.prototype,"shiftBoundary",2),y([(0,l.MZ)({attribute:"shift-padding",type:Number})],b.prototype,"shiftPadding",2),y([(0,l.MZ)({attribute:"auto-size"})],b.prototype,"autoSize",2),y([(0,l.MZ)()],b.prototype,"sync",2),y([(0,l.MZ)({type:Object})],b.prototype,"autoSizeBoundary",2),y([(0,l.MZ)({attribute:"auto-size-padding",type:Number})],b.prototype,"autoSizePadding",2),y([(0,l.MZ)({attribute:"hover-bridge",type:Boolean})],b.prototype,"hoverBridge",2),b=y([(0,l.EM)("wa-popup")],b),n()}catch(x){n(x)}})},78520(t,e,o){o.d(e,{A:()=>n});var n=o(5124).AH`:host{--arrow-color:black;--arrow-size:var(--wa-tooltip-arrow-size);--popup-border-width:0px;--show-duration:100ms;--hide-duration:100ms;--arrow-base-offset:var(--popup-border-width);--arrow-size-diagonal:calc((var(--arrow-size) + var(--arrow-base-offset)) * 0.7071);--arrow-padding-offset:calc(var(--arrow-size-diagonal) - var(--arrow-size));--arrow-size-div:calc(var(--arrow-size-diagonal) * 2);--arrow-clipping-corner:calc(var(--arrow-base-offset) * 1.4142);display:contents}.popup{position:absolute;isolation:isolate;max-width:var(--auto-size-available-width,none);max-height:var(--auto-size-available-height,none)}:where(.popup){inset:unset;padding:unset;margin:unset;width:unset;height:unset;color:unset;background:unset;border:unset;overflow:unset}.popup-fixed{position:fixed}.popup:not(.popup-active){display:none}.arrow{position:absolute;width:var(--arrow-size-div);height:var(--arrow-size-div);background:var(--arrow-color);z-index:3;clip-path:polygon(var(--arrow-clipping-corner) 100%,var(--arrow-base-offset) calc(100% - var(--arrow-base-offset)),calc(var(--arrow-base-offset) - 2px) calc(100% - var(--arrow-base-offset)),calc(100% - var(--arrow-base-offset)) calc(var(--arrow-base-offset) - 2px),calc(100% - var(--arrow-base-offset)) var(--arrow-base-offset),100% var(--arrow-clipping-corner),100% 100%);rotate:45deg}:host([data-current-placement|=left]) .arrow{rotate:-45deg}:host([data-current-placement|=right]) .arrow{rotate:135deg}:host([data-current-placement|=bottom]) .arrow{rotate:225deg}.popup-hover-bridge:not(.popup-hover-bridge-visible){display:none}.popup-hover-bridge{position:fixed;z-index:899;top:0;right:0;bottom:0;left:0;clip-path:polygon(var(--hover-bridge-top-left-x,0) var(--hover-bridge-top-left-y,0),var(--hover-bridge-top-right-x,0) var(--hover-bridge-top-right-y,0),var(--hover-bridge-bottom-right-x,0) var(--hover-bridge-bottom-right-y,0),var(--hover-bridge-bottom-left-x,0) var(--hover-bridge-bottom-left-y,0))}.show{animation:show var(--show-duration) ease}.hide{animation:show var(--hide-duration) ease reverse}@keyframes show{from{opacity:0}to{opacity:1}}.show-with-scale{animation:show-with-scale var(--show-duration) ease}.hide-with-scale{animation:show-with-scale var(--hide-duration) ease reverse}@keyframes show-with-scale{from{opacity:0;scale:0.8}to{opacity:1;scale:1}}`},91336(t,e,o){o.d(e,{B:()=>n});class n extends Event{constructor(){super("wa-reposition",{bubbles:!0,cancelable:!1,composed:!0})}}},73015(t,e,o){o.d(e,{WX:()=>i});o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698);var n=o(21306);function i(t){return a(t)}function r(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}function a(t){for(let e=t;e;e=r(e))if(e instanceof Element&&"none"===getComputedStyle(e).display)return null;for(let e=r(t);e;e=r(e)){if(!(e instanceof Element))continue;const t=getComputedStyle(e);if("contents"!==t.display){if("static"!==t.position||(0,n.sQ)(t))return e;if("BODY"===e.tagName)return e}}return null}}};