@govtechsg/sgds-web-component 3.15.1-rc.1 → 3.15.1-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Badge/index.umd.min.js +1 -1
- package/components/Badge/index.umd.min.js.map +1 -1
- package/components/Breadcrumb/index.umd.min.js +6 -6
- package/components/Breadcrumb/index.umd.min.js.map +1 -1
- package/components/ComboBox/index.umd.min.js +2 -2
- package/components/ComboBox/index.umd.min.js.map +1 -1
- package/components/ComboBox/sgds-combo-box.d.ts +3 -3
- package/components/ComboBox/sgds-combo-box.js +1 -0
- package/components/ComboBox/sgds-combo-box.js.map +1 -1
- package/components/ComboBox/types.d.ts +3 -0
- package/components/Datepicker/index.umd.min.js +1 -1
- package/components/Datepicker/index.umd.min.js.map +1 -1
- package/components/Drawer/drawer.js +1 -1
- package/components/Drawer/index.umd.min.js +1 -1
- package/components/Drawer/index.umd.min.js.map +1 -1
- package/components/Dropdown/dropdown-menu.js +1 -1
- package/components/Dropdown/index.umd.min.js +1 -1
- package/components/Dropdown/index.umd.min.js.map +1 -1
- package/components/FileUpload/index.umd.min.js.map +1 -1
- package/components/FileUpload/sgds-file-upload.d.ts +3 -0
- package/components/FileUpload/sgds-file-upload.js +1 -0
- package/components/FileUpload/sgds-file-upload.js.map +1 -1
- package/components/FileUpload/types.d.ts +1 -0
- package/components/Mainnav/index.umd.min.js +9 -9
- package/components/Mainnav/index.umd.min.js.map +1 -1
- package/components/Mainnav/mainnav.js +1 -1
- package/components/Modal/index.umd.min.js +1 -1
- package/components/Modal/index.umd.min.js.map +1 -1
- package/components/Modal/modal.js +1 -1
- package/components/OverflowMenu/index.umd.min.js +6 -6
- package/components/OverflowMenu/index.umd.min.js.map +1 -1
- package/components/Pagination/index.umd.min.js.map +1 -1
- package/components/Pagination/sgds-pagination.d.ts +3 -0
- package/components/Pagination/sgds-pagination.js +1 -0
- package/components/Pagination/sgds-pagination.js.map +1 -1
- package/components/Pagination/types.d.ts +3 -0
- package/components/Radio/index.umd.min.js.map +1 -1
- package/components/Radio/sgds-radio-group.d.ts +3 -0
- package/components/Radio/sgds-radio-group.js +1 -0
- package/components/Radio/sgds-radio-group.js.map +1 -1
- package/components/Radio/types.d.ts +3 -0
- package/components/Select/index.umd.min.js +1 -1
- package/components/Select/index.umd.min.js.map +1 -1
- package/components/Stepper/index.umd.min.js.map +1 -1
- package/components/Stepper/sgds-stepper.d.ts +2 -5
- package/components/Stepper/sgds-stepper.js.map +1 -1
- package/components/Stepper/types.d.ts +5 -0
- package/components/Subnav/index.umd.min.js +1 -1
- package/components/Subnav/index.umd.min.js.map +1 -1
- package/components/Subnav/subnav.js +1 -1
- package/components/Switch/index.umd.min.js.map +1 -1
- package/components/Switch/sgds-switch.d.ts +3 -0
- package/components/Switch/sgds-switch.js +1 -0
- package/components/Switch/sgds-switch.js.map +1 -1
- package/components/Switch/types.d.ts +3 -0
- package/components/Toast/index.umd.min.js +1 -1
- package/components/Toast/index.umd.min.js.map +1 -1
- package/components/Toast/toast-container.js +1 -1
- package/components/Tooltip/index.umd.min.js +1 -1
- package/components/Tooltip/index.umd.min.js.map +1 -1
- package/components/Tooltip/tooltip.js +1 -1
- package/components/index.umd.min.js +7 -7
- package/components/index.umd.min.js.map +1 -1
- package/css/fouc.css +1 -1
- package/css/utility.css +14 -0
- package/custom-elements.json +26391 -0
- package/index.umd.min.js +7 -7
- package/index.umd.min.js.map +1 -1
- package/package.json +5 -3
- package/react/components/ComboBox/sgds-combo-box.cjs.js +1 -0
- package/react/components/ComboBox/sgds-combo-box.cjs.js.map +1 -1
- package/react/components/ComboBox/sgds-combo-box.js +1 -0
- package/react/components/ComboBox/sgds-combo-box.js.map +1 -1
- package/react/components/Drawer/drawer.cjs.js +1 -1
- package/react/components/Drawer/drawer.js +1 -1
- package/react/components/Dropdown/dropdown-menu.cjs.js +1 -1
- package/react/components/Dropdown/dropdown-menu.js +1 -1
- package/react/components/FileUpload/sgds-file-upload.cjs.js +1 -0
- package/react/components/FileUpload/sgds-file-upload.cjs.js.map +1 -1
- package/react/components/FileUpload/sgds-file-upload.js +1 -0
- package/react/components/FileUpload/sgds-file-upload.js.map +1 -1
- package/react/components/Mainnav/mainnav.cjs.js +1 -1
- package/react/components/Mainnav/mainnav.js +1 -1
- package/react/components/Modal/modal.cjs.js +1 -1
- package/react/components/Modal/modal.js +1 -1
- package/react/components/Pagination/sgds-pagination.cjs.js +1 -0
- package/react/components/Pagination/sgds-pagination.cjs.js.map +1 -1
- package/react/components/Pagination/sgds-pagination.js +1 -0
- package/react/components/Pagination/sgds-pagination.js.map +1 -1
- package/react/components/Radio/sgds-radio-group.cjs.js +1 -0
- package/react/components/Radio/sgds-radio-group.cjs.js.map +1 -1
- package/react/components/Radio/sgds-radio-group.js +1 -0
- package/react/components/Radio/sgds-radio-group.js.map +1 -1
- package/react/components/Stepper/sgds-stepper.cjs.js.map +1 -1
- package/react/components/Stepper/sgds-stepper.js.map +1 -1
- package/react/components/Subnav/subnav.cjs.js +1 -1
- package/react/components/Subnav/subnav.js +1 -1
- package/react/components/Switch/sgds-switch.cjs.js +1 -0
- package/react/components/Switch/sgds-switch.cjs.js.map +1 -1
- package/react/components/Switch/sgds-switch.js +1 -0
- package/react/components/Switch/sgds-switch.js.map +1 -1
- package/react/components/Toast/toast-container.cjs.js +1 -1
- package/react/components/Toast/toast-container.js +1 -1
- package/react/components/Tooltip/tooltip.cjs.js +1 -1
- package/react/components/Tooltip/tooltip.js +1 -1
- package/react/index.cjs.js +4 -4
- package/react/index.d.ts +1 -1
- package/react/index.js +1 -1
- package/themes/blue.css +11 -0
- package/themes/cyan.css +11 -0
- package/themes/gt/blue.css +11 -0
- package/themes/gt/cyan.css +11 -0
- package/themes/gt/magenta.css +11 -0
- package/themes/gt/pink.css +11 -0
- package/themes/gt/purple.css +11 -0
- package/themes/gt/red.css +11 -0
- package/themes/magenta.css +11 -0
- package/themes/pink.css +11 -0
- package/themes/purple.css +11 -0
- package/themes/red.css +11 -0
- package/themes/root.css +13 -0
- package/types/react.d.ts +1623 -0
|
@@ -59,7 +59,7 @@ window.ShadyDOM?.inUse&&!0===window.ShadyDOM?.noPatch&&window.ShadyDOM.wrap;cons
|
|
|
59
59
|
* @license
|
|
60
60
|
* Copyright 2020 Google LLC
|
|
61
61
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
62
|
-
*/const Ht=()=>new jt;class jt{}const qt=new WeakMap;const Zt=Rt(class extends Ft{render(t){return it}update(t,[e]){const i=e!==this._ref;return i&&void 0!==this._ref&&this._updateRefValue(void 0),(i||this._lastElementForRef!==this._element)&&(this._ref=e,this._context=t.options?.host,this._updateRefValue(this._element=t.element)),it}_updateRefValue(t){if(this.isConnected||(t=void 0),"function"==typeof this._ref){const e=this._context??globalThis;let i=qt.get(e);void 0===i&&(i=new WeakMap,qt.set(e,i)),void 0!==i.get(this._ref)&&this._ref.call(this._context,void 0),i.set(this._ref,t),void 0!==t&&this._ref.call(this._context,t)}else this._ref.value=t}get _lastElementForRef(){return"function"==typeof this._ref?qt.get(this._context??globalThis)?.get(this._ref):this._ref?.value}disconnected(){this._lastElementForRef===this._element&&this._updateRefValue(void 0)}reconnected(){this._updateRefValue(this._element)}}),Jt=["top","right","bottom","left"],Xt=Math.min,Yt=Math.max,Gt=Math.round,Kt=Math.floor,Qt=t=>({x:t,y:t}),te={left:"right",right:"left",bottom:"top",top:"bottom"},ee={start:"end",end:"start"};function ie(t,e,i){return Yt(t,Xt(e,i))}function se(t,e){return"function"==typeof t?t(e):t}function ne(t){return t.split("-")[0]}function oe(t){return t.split("-")[1]}function re(t){return"x"===t?"y":"x"}function ae(t){return"y"===t?"height":"width"}const le=new Set(["top","bottom"]);function de(t){return le.has(ne(t))?"y":"x"}function ce(t){return re(de(t))}function he(t,e,i){void 0===i&&(i=!1);const s=oe(t),n=ce(t),o=ae(n);let r="x"===n?s===(i?"end":"start")?"right":"left":"start"===s?"bottom":"top";return e.reference[o]>e.floating[o]&&(r=be(r)),[r,be(r)]}function ue(t){return t.replace(/start|end/g,t=>ee[t])}const pe=["left","right"],fe=["right","left"],ge=["top","bottom"],me=["bottom","top"];function ve(t,e,i,s){const n=oe(t);let o=function(t,e,i){switch(t){case"top":case"bottom":return i?e?fe:pe:e?pe:fe;case"left":case"right":return e?ge:me;default:return[]}}(ne(t),"start"===i,s);return n&&(o=o.map(t=>t+"-"+n),e&&(o=o.concat(o.map(ue)))),o}function be(t){return t.replace(/left|right|bottom|top/g,t=>te[t])}function ye(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 _e(t){const{x:e,y:i,width:s,height:n}=t;return{width:s,height:n,top:i,left:e,right:e+s,bottom:i+n,x:e,y:i}}function we(t,e,i){let{reference:s,floating:n}=t;const o=de(e),r=ce(e),a=ae(r),l=ne(e),d="y"===o,c=s.x+s.width/2-n.width/2,h=s.y+s.height/2-n.height/2,u=s[a]/2-n[a]/2;let p;switch(l){case"top":p={x:c,y:s.y-n.height};break;case"bottom":p={x:c,y:s.y+s.height};break;case"right":p={x:s.x+s.width,y:h};break;case"left":p={x:s.x-n.width,y:h};break;default:p={x:s.x,y:s.y}}switch(oe(e)){case"start":p[r]-=u*(i&&d?-1:1);break;case"end":p[r]+=u*(i&&d?-1:1)}return p}async function xe(t,e){var i;void 0===e&&(e={});const{x:s,y:n,platform:o,rects:r,elements:a,strategy:l}=t,{boundary:d="clippingAncestors",rootBoundary:c="viewport",elementContext:h="floating",altBoundary:u=!1,padding:p=0}=se(e,t),f=ye(p),g=a[u?"floating"===h?"reference":"floating":h],m=_e(await o.getClippingRect({element:null==(i=await(null==o.isElement?void 0:o.isElement(g)))||i?g:g.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(a.floating)),boundary:d,rootBoundary:c,strategy:l})),v="floating"===h?{x:s,y:n,width:r.floating.width,height:r.floating.height}:r.reference,b=await(null==o.getOffsetParent?void 0:o.getOffsetParent(a.floating)),y=await(null==o.isElement?void 0:o.isElement(b))&&await(null==o.getScale?void 0:o.getScale(b))||{x:1,y:1},_=_e(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:b,strategy:l}):v);return{top:(m.top-_.top+f.top)/y.y,bottom:(_.bottom-m.bottom+f.bottom)/y.y,left:(m.left-_.left+f.left)/y.x,right:(_.right-m.right+f.right)/y.x}}function $e(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Se(t){return Jt.some(e=>t[e]>=0)}const ke=new Set(["left","top"]);function Ce(){return"undefined"!=typeof window}function Ee(t){return Re(t)?(t.nodeName||"").toLowerCase():"#document"}function Pe(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function Te(t){var e;return null==(e=(Re(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function Re(t){return!!Ce()&&(t instanceof Node||t instanceof Pe(t).Node)}function Oe(t){return!!Ce()&&(t instanceof Element||t instanceof Pe(t).Element)}function Le(t){return!!Ce()&&(t instanceof HTMLElement||t instanceof Pe(t).HTMLElement)}function Ve(t){return!(!Ce()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof Pe(t).ShadowRoot)}const Ne=new Set(["inline","contents"]);function Ae(t){const{overflow:e,overflowX:i,overflowY:s,display:n}=Ze(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+i)&&!Ne.has(n)}const ze=new Set(["table","td","th"]);function Ue(t){return ze.has(Ee(t))}const Me=[":popover-open",":modal"];function De(t){return Me.some(e=>{try{return t.matches(e)}catch(t){return!1}})}const We=["transform","translate","scale","rotate","perspective"],Be=["transform","translate","scale","rotate","perspective","filter"],Ie=["paint","layout","strict","content"];function Fe(t){const e=He(),i=Oe(t)?Ze(t):t;return We.some(t=>!!i[t]&&"none"!==i[t])||!!i.containerType&&"normal"!==i.containerType||!e&&!!i.backdropFilter&&"none"!==i.backdropFilter||!e&&!!i.filter&&"none"!==i.filter||Be.some(t=>(i.willChange||"").includes(t))||Ie.some(t=>(i.contain||"").includes(t))}function He(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const je=new Set(["html","body","#document"]);function qe(t){return je.has(Ee(t))}function Ze(t){return Pe(t).getComputedStyle(t)}function Je(t){return Oe(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Xe(t){if("html"===Ee(t))return t;const e=t.assignedSlot||t.parentNode||Ve(t)&&t.host||Te(t);return Ve(e)?e.host:e}function Ye(t){const e=Xe(t);return qe(e)?t.ownerDocument?t.ownerDocument.body:t.body:Le(e)&&Ae(e)?e:Ye(e)}function Ge(t,e,i){var s;void 0===e&&(e=[]),void 0===i&&(i=!0);const n=Ye(t),o=n===(null==(s=t.ownerDocument)?void 0:s.body),r=Pe(n);if(o){const t=Ke(r);return e.concat(r,r.visualViewport||[],Ae(n)?n:[],t&&i?Ge(t):[])}return e.concat(n,Ge(n,[],i))}function Ke(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Qe(t){const e=Ze(t);let i=parseFloat(e.width)||0,s=parseFloat(e.height)||0;const n=Le(t),o=n?t.offsetWidth:i,r=n?t.offsetHeight:s,a=Gt(i)!==o||Gt(s)!==r;return a&&(i=o,s=r),{width:i,height:s,$:a}}function ti(t){return Oe(t)?t:t.contextElement}function ei(t){const e=ti(t);if(!Le(e))return Qt(1);const i=e.getBoundingClientRect(),{width:s,height:n,$:o}=Qe(e);let r=(o?Gt(i.width):i.width)/s,a=(o?Gt(i.height):i.height)/n;return r&&Number.isFinite(r)||(r=1),a&&Number.isFinite(a)||(a=1),{x:r,y:a}}const ii=Qt(0);function si(t){const e=Pe(t);return He()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:ii}function ni(t,e,i,s){void 0===e&&(e=!1),void 0===i&&(i=!1);const n=t.getBoundingClientRect(),o=ti(t);let r=Qt(1);e&&(s?Oe(s)&&(r=ei(s)):r=ei(t));const a=function(t,e,i){return void 0===e&&(e=!1),!(!i||e&&i!==Pe(t))&&e}(o,i,s)?si(o):Qt(0);let l=(n.left+a.x)/r.x,d=(n.top+a.y)/r.y,c=n.width/r.x,h=n.height/r.y;if(o){const t=Pe(o),e=s&&Oe(s)?Pe(s):s;let i=t,n=Ke(i);for(;n&&s&&e!==i;){const t=ei(n),e=n.getBoundingClientRect(),s=Ze(n),o=e.left+(n.clientLeft+parseFloat(s.paddingLeft))*t.x,r=e.top+(n.clientTop+parseFloat(s.paddingTop))*t.y;l*=t.x,d*=t.y,c*=t.x,h*=t.y,l+=o,d+=r,i=Pe(n),n=Ke(i)}}return _e({width:c,height:h,x:l,y:d})}function oi(t,e){const i=Je(t).scrollLeft;return e?e.left+i:ni(Te(t)).left+i}function ri(t,e){const i=t.getBoundingClientRect();return{x:i.left+e.scrollLeft-oi(t,i),y:i.top+e.scrollTop}}const ai=new Set(["absolute","fixed"]);function li(t,e,i){let s;if("viewport"===e)s=function(t,e){const i=Pe(t),s=Te(t),n=i.visualViewport;let o=s.clientWidth,r=s.clientHeight,a=0,l=0;if(n){o=n.width,r=n.height;const t=He();(!t||t&&"fixed"===e)&&(a=n.offsetLeft,l=n.offsetTop)}const d=oi(s);if(d<=0){const t=s.ownerDocument,e=t.body,i=getComputedStyle(e),n="CSS1Compat"===t.compatMode&&parseFloat(i.marginLeft)+parseFloat(i.marginRight)||0,r=Math.abs(s.clientWidth-e.clientWidth-n);r<=25&&(o-=r)}else d<=25&&(o+=d);return{width:o,height:r,x:a,y:l}}(t,i);else if("document"===e)s=function(t){const e=Te(t),i=Je(t),s=t.ownerDocument.body,n=Yt(e.scrollWidth,e.clientWidth,s.scrollWidth,s.clientWidth),o=Yt(e.scrollHeight,e.clientHeight,s.scrollHeight,s.clientHeight);let r=-i.scrollLeft+oi(t);const a=-i.scrollTop;return"rtl"===Ze(s).direction&&(r+=Yt(e.clientWidth,s.clientWidth)-n),{width:n,height:o,x:r,y:a}}(Te(t));else if(Oe(e))s=function(t,e){const i=ni(t,!0,"fixed"===e),s=i.top+t.clientTop,n=i.left+t.clientLeft,o=Le(t)?ei(t):Qt(1);return{width:t.clientWidth*o.x,height:t.clientHeight*o.y,x:n*o.x,y:s*o.y}}(e,i);else{const i=si(t);s={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return _e(s)}function di(t,e){const i=Xe(t);return!(i===e||!Oe(i)||qe(i))&&("fixed"===Ze(i).position||di(i,e))}function ci(t,e,i){const s=Le(e),n=Te(e),o="fixed"===i,r=ni(t,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=Qt(0);function d(){l.x=oi(n)}if(s||!s&&!o)if(("body"!==Ee(e)||Ae(n))&&(a=Je(e)),s){const t=ni(e,!0,o,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else n&&d();o&&!s&&n&&d();const c=!n||s||o?Qt(0):ri(n,a);return{x:r.left+a.scrollLeft-l.x-c.x,y:r.top+a.scrollTop-l.y-c.y,width:r.width,height:r.height}}function hi(t){return"static"===Ze(t).position}function ui(t,e){if(!Le(t)||"fixed"===Ze(t).position)return null;if(e)return e(t);let i=t.offsetParent;return Te(t)===i&&(i=i.ownerDocument.body),i}function pi(t,e){const i=Pe(t);if(De(t))return i;if(!Le(t)){let e=Xe(t);for(;e&&!qe(e);){if(Oe(e)&&!hi(e))return e;e=Xe(e)}return i}let s=ui(t,e);for(;s&&Ue(s)&&hi(s);)s=ui(s,e);return s&&qe(s)&&hi(s)&&!Fe(s)?i:s||function(t){let e=Xe(t);for(;Le(e)&&!qe(e);){if(Fe(e))return e;if(De(e))return null;e=Xe(e)}return null}(t)||i}const fi={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:i,offsetParent:s,strategy:n}=t;const o="fixed"===n,r=Te(s),a=!!e&&De(e.floating);if(s===r||a&&o)return i;let l={scrollLeft:0,scrollTop:0},d=Qt(1);const c=Qt(0),h=Le(s);if((h||!h&&!o)&&(("body"!==Ee(s)||Ae(r))&&(l=Je(s)),Le(s))){const t=ni(s);d=ei(s),c.x=t.x+s.clientLeft,c.y=t.y+s.clientTop}const u=!r||h||o?Qt(0):ri(r,l);return{width:i.width*d.x,height:i.height*d.y,x:i.x*d.x-l.scrollLeft*d.x+c.x+u.x,y:i.y*d.y-l.scrollTop*d.y+c.y+u.y}},getDocumentElement:Te,getClippingRect:function(t){let{element:e,boundary:i,rootBoundary:s,strategy:n}=t;const o=[..."clippingAncestors"===i?De(e)?[]:function(t,e){const i=e.get(t);if(i)return i;let s=Ge(t,[],!1).filter(t=>Oe(t)&&"body"!==Ee(t)),n=null;const o="fixed"===Ze(t).position;let r=o?Xe(t):t;for(;Oe(r)&&!qe(r);){const e=Ze(r),i=Fe(r);i||"fixed"!==e.position||(n=null),(o?!i&&!n:!i&&"static"===e.position&&n&&ai.has(n.position)||Ae(r)&&!i&&di(t,r))?s=s.filter(t=>t!==r):n=e,r=Xe(r)}return e.set(t,s),s}(e,this._c):[].concat(i),s],r=o[0],a=o.reduce((t,i)=>{const s=li(e,i,n);return t.top=Yt(s.top,t.top),t.right=Xt(s.right,t.right),t.bottom=Xt(s.bottom,t.bottom),t.left=Yt(s.left,t.left),t},li(e,r,n));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:pi,getElementRects:async function(t){const e=this.getOffsetParent||pi,i=this.getDimensions,s=await i(t.floating);return{reference:ci(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:i}=Qe(t);return{width:e,height:i}},getScale:ei,isElement:Oe,isRTL:function(t){return"rtl"===Ze(t).direction}};function gi(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function mi(t,e,i,s){void 0===s&&(s={});const{ancestorScroll:n=!0,ancestorResize:o=!0,elementResize:r="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=s,d=ti(t),c=n||o?[...d?Ge(d):[],...Ge(e)]:[];c.forEach(t=>{n&&t.addEventListener("scroll",i,{passive:!0}),o&&t.addEventListener("resize",i)});const h=d&&a?function(t,e){let i,s=null;const n=Te(t);function o(){var t;clearTimeout(i),null==(t=s)||t.disconnect(),s=null}return function r(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),o();const d=t.getBoundingClientRect(),{left:c,top:h,width:u,height:p}=d;if(a||e(),!u||!p)return;const f={rootMargin:-Kt(h)+"px "+-Kt(n.clientWidth-(c+u))+"px "+-Kt(n.clientHeight-(h+p))+"px "+-Kt(c)+"px",threshold:Yt(0,Xt(1,l))||1};let g=!0;function m(e){const s=e[0].intersectionRatio;if(s!==l){if(!g)return r();s?r(!1,s):i=setTimeout(()=>{r(!1,1e-7)},1e3)}1!==s||gi(d,t.getBoundingClientRect())||r(),g=!1}try{s=new IntersectionObserver(m,{...f,root:n.ownerDocument})}catch(t){s=new IntersectionObserver(m,f)}s.observe(t)}(!0),o}(d,i):null;let u,p=-1,f=null;r&&(f=new ResizeObserver(t=>{let[s]=t;s&&s.target===d&&f&&(f.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var t;null==(t=f)||t.observe(e)})),i()}),d&&!l&&f.observe(d),f.observe(e));let g=l?ni(t):null;return l&&function e(){const s=ni(t);g&&!gi(g,s)&&i();g=s,u=requestAnimationFrame(e)}(),i(),()=>{var t;c.forEach(t=>{n&&t.removeEventListener("scroll",i),o&&t.removeEventListener("resize",i)}),null==h||h(),null==(t=f)||t.disconnect(),f=null,l&&cancelAnimationFrame(u)}}const vi=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var i,s;const{x:n,y:o,placement:r,middlewareData:a}=e,l=await async function(t,e){const{placement:i,platform:s,elements:n}=t,o=await(null==s.isRTL?void 0:s.isRTL(n.floating)),r=ne(i),a=oe(i),l="y"===de(i),d=ke.has(r)?-1:1,c=o&&l?-1:1,h=se(e,t);let{mainAxis:u,crossAxis:p,alignmentAxis:f}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&"number"==typeof f&&(p="end"===a?-1*f:f),l?{x:p*c,y:u*d}:{x:u*d,y:p*c}}(e,t);return r===(null==(i=a.offset)?void 0:i.placement)&&null!=(s=a.arrow)&&s.alignmentOffset?{}:{x:n+l.x,y:o+l.y,data:{...l,placement:r}}}}},bi=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:i,y:s,placement:n}=e,{mainAxis:o=!0,crossAxis:r=!1,limiter:a={fn:t=>{let{x:e,y:i}=t;return{x:e,y:i}}},...l}=se(t,e),d={x:i,y:s},c=await xe(e,l),h=de(ne(n)),u=re(h);let p=d[u],f=d[h];if(o){const t="y"===u?"bottom":"right";p=ie(p+c["y"===u?"top":"left"],p,p-c[t])}if(r){const t="y"===h?"bottom":"right";f=ie(f+c["y"===h?"top":"left"],f,f-c[t])}const g=a.fn({...e,[u]:p,[h]:f});return{...g,data:{x:g.x-i,y:g.y-s,enabled:{[u]:o,[h]:r}}}}}},yi=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var i,s;const{placement:n,middlewareData:o,rects:r,initialPlacement:a,platform:l,elements:d}=e,{mainAxis:c=!0,crossAxis:h=!0,fallbackPlacements:u,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,...m}=se(t,e);if(null!=(i=o.arrow)&&i.alignmentOffset)return{};const v=ne(n),b=de(a),y=ne(a)===a,_=await(null==l.isRTL?void 0:l.isRTL(d.floating)),w=u||(y||!g?[be(a)]:function(t){const e=be(t);return[ue(t),e,ue(e)]}(a)),x="none"!==f;!u&&x&&w.push(...ve(a,g,f,_));const $=[a,...w],S=await xe(e,m),k=[];let C=(null==(s=o.flip)?void 0:s.overflows)||[];if(c&&k.push(S[v]),h){const t=he(n,r,_);k.push(S[t[0]],S[t[1]])}if(C=[...C,{placement:n,overflows:k}],!k.every(t=>t<=0)){var E,P;const t=((null==(E=o.flip)?void 0:E.index)||0)+1,e=$[t];if(e){if(!("alignment"===h&&b!==de(e))||C.every(t=>de(t.placement)!==b||t.overflows[0]>0))return{data:{index:t,overflows:C},reset:{placement:e}}}let i=null==(P=C.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:P.placement;if(!i)switch(p){case"bestFit":{var T;const t=null==(T=C.filter(t=>{if(x){const e=de(t.placement);return e===b||"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:T[0];t&&(i=t);break}case"initialPlacement":i=a}if(n!==i)return{reset:{placement:i}}}return{}}}},_i=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{rects:i}=e,{strategy:s="referenceHidden",...n}=se(t,e);switch(s){case"referenceHidden":{const t=$e(await xe(e,{...n,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:Se(t)}}}case"escaped":{const t=$e(await xe(e,{...n,altBoundary:!0}),i.floating);return{data:{escapedOffsets:t,escaped:Se(t)}}}default:return{}}}}},wi=(t,e,i)=>{const s=new Map,n={platform:fi,...i},o={...n.platform,_c:s};return(async(t,e,i)=>{const{placement:s="bottom",strategy:n="absolute",middleware:o=[],platform:r}=i,a=o.filter(Boolean),l=await(null==r.isRTL?void 0:r.isRTL(e));let d=await r.getElementRects({reference:t,floating:e,strategy:n}),{x:c,y:h}=we(d,s,l),u=s,p={},f=0;for(let i=0;i<a.length;i++){const{name:o,fn:g}=a[i],{x:m,y:v,data:b,reset:y}=await g({x:c,y:h,initialPlacement:s,placement:u,strategy:n,middlewareData:p,rects:d,platform:r,elements:{reference:t,floating:e}});c=null!=m?m:c,h=null!=v?v:h,p={...p,[o]:{...p[o],...b}},y&&f<=50&&(f++,"object"==typeof y&&(y.placement&&(u=y.placement),y.rects&&(d=!0===y.rects?await r.getElementRects({reference:t,floating:e,strategy:n}):y.rects),({x:c,y:h}=we(d,u,l))),i=-1)}return{x:c,y:h,placement:u,strategy:n,middlewareData:p}})(t,e,{...n,platform:o})};var xi,$i=r`:host{display:contents}.tooltip-placeholder{display:inline-block;max-width:100%}.tooltip{word-wrap:break-word;background-color:var(--sgds-surface-fixed-dark);border-radius:var(--sgds-border-radius-md);box-shadow:0 0 2px 0 rgba(0,0,0,.12),0 8px 16px 0 rgba(0,0,0,.14);color:var(--sgds-color-fixed-light);display:block;font-size:var(--sgds-font-size-14);line-break:auto;max-width:var(--sgds-dimension-320);padding:var(--sgds-padding-xs) var(--sgds-padding-sm);text-align:left;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;z-index:900}div{max-width:fit-content}`;class Si extends zt{constructor(){super(...arguments),this._myTooltip=Ht(),this._tooltipBubble=Ht(),this.content="",this.placement="top",this.trigger="hover focus",this.open=!1,this._handleClickOutOfElement=t=>{this.open&&(t.composedPath().includes(this)||this.hide())}}connectedCallback(){super.connectedCallback(),this.trigger.includes("click")&&document.addEventListener("click",this._handleClickOutOfElement)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleClickOutOfElement),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0)}firstUpdated(t){super.firstUpdated(t),this._tooltipTargetElements.forEach(t=>{t.setAttribute("data-sgds-tooltip",this.content),this.trigger.includes("hover")&&(t.addEventListener("mouseenter",()=>this.show()),t.addEventListener("mouseleave",()=>this.hide())),this.trigger.includes("focus")&&(t.addEventListener("focus",()=>this.show()),t.addEventListener("blur",()=>this.hide())),"click"===this.trigger&&t.addEventListener("click",()=>this.toggle())})}_handleSlotChange(){this._tooltipTargetElements.forEach(t=>t.setAttribute("data-sgds-tooltip",this.content))}async updateFloatingPosition(){if(!this._myTooltip.value||!this._tooltipBubble.value)return;const{x:t,y:e,placement:i,strategy:s,middlewareData:n}=await wi(this._tooltipTargetElements[0],this._tooltipBubble.value,{strategy:"fixed",placement:this.placement,middleware:[vi(8),yi(),bi(),_i()]});this._tooltipBubble.value.setAttribute("data-placement",i),Object.assign(this._tooltipBubble.value.style,{position:s,left:`${t}px`,top:`${e}px`});const{referenceHidden:o,escaped:r}=n.hide||{};this._tooltipBubble.value.style.visibility=o||r?"hidden":"visible"}async show(){this.open||(this.open=!0,this.emit("sgds-show"),await this.updateComplete,await this.updateFloatingPosition(),this._myTooltip.value&&this._tooltipBubble.value&&(this._cleanupAutoUpdate=mi(this._tooltipTargetElements[0],this._tooltipBubble.value,()=>this.updateFloatingPosition())),this.emit("sgds-after-show"))}hide(){this.open&&(this.emit("sgds-hide"),this.open=!1,this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0),setTimeout(()=>this.emit("sgds-after-hide"),0))}toggle(){this.open?this.hide():this.show()}render(){return Q`
|
|
62
|
+
*/const Ht=()=>new jt;class jt{}const qt=new WeakMap;const Zt=Rt(class extends Ft{render(t){return it}update(t,[e]){const i=e!==this._ref;return i&&void 0!==this._ref&&this._updateRefValue(void 0),(i||this._lastElementForRef!==this._element)&&(this._ref=e,this._context=t.options?.host,this._updateRefValue(this._element=t.element)),it}_updateRefValue(t){if(this.isConnected||(t=void 0),"function"==typeof this._ref){const e=this._context??globalThis;let i=qt.get(e);void 0===i&&(i=new WeakMap,qt.set(e,i)),void 0!==i.get(this._ref)&&this._ref.call(this._context,void 0),i.set(this._ref,t),void 0!==t&&this._ref.call(this._context,t)}else this._ref.value=t}get _lastElementForRef(){return"function"==typeof this._ref?qt.get(this._context??globalThis)?.get(this._ref):this._ref?.value}disconnected(){this._lastElementForRef===this._element&&this._updateRefValue(void 0)}reconnected(){this._updateRefValue(this._element)}}),Jt=["top","right","bottom","left"],Xt=Math.min,Yt=Math.max,Gt=Math.round,Kt=Math.floor,Qt=t=>({x:t,y:t}),te={left:"right",right:"left",bottom:"top",top:"bottom"},ee={start:"end",end:"start"};function ie(t,e,i){return Yt(t,Xt(e,i))}function se(t,e){return"function"==typeof t?t(e):t}function ne(t){return t.split("-")[0]}function oe(t){return t.split("-")[1]}function re(t){return"x"===t?"y":"x"}function ae(t){return"y"===t?"height":"width"}const le=new Set(["top","bottom"]);function de(t){return le.has(ne(t))?"y":"x"}function ce(t){return re(de(t))}function he(t,e,i){void 0===i&&(i=!1);const s=oe(t),n=ce(t),o=ae(n);let r="x"===n?s===(i?"end":"start")?"right":"left":"start"===s?"bottom":"top";return e.reference[o]>e.floating[o]&&(r=be(r)),[r,be(r)]}function ue(t){return t.replace(/start|end/g,t=>ee[t])}const pe=["left","right"],fe=["right","left"],ge=["top","bottom"],me=["bottom","top"];function ve(t,e,i,s){const n=oe(t);let o=function(t,e,i){switch(t){case"top":case"bottom":return i?e?fe:pe:e?pe:fe;case"left":case"right":return e?ge:me;default:return[]}}(ne(t),"start"===i,s);return n&&(o=o.map(t=>t+"-"+n),e&&(o=o.concat(o.map(ue)))),o}function be(t){return t.replace(/left|right|bottom|top/g,t=>te[t])}function ye(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 _e(t){const{x:e,y:i,width:s,height:n}=t;return{width:s,height:n,top:i,left:e,right:e+s,bottom:i+n,x:e,y:i}}function we(t,e,i){let{reference:s,floating:n}=t;const o=de(e),r=ce(e),a=ae(r),l=ne(e),d="y"===o,c=s.x+s.width/2-n.width/2,h=s.y+s.height/2-n.height/2,u=s[a]/2-n[a]/2;let p;switch(l){case"top":p={x:c,y:s.y-n.height};break;case"bottom":p={x:c,y:s.y+s.height};break;case"right":p={x:s.x+s.width,y:h};break;case"left":p={x:s.x-n.width,y:h};break;default:p={x:s.x,y:s.y}}switch(oe(e)){case"start":p[r]-=u*(i&&d?-1:1);break;case"end":p[r]+=u*(i&&d?-1:1)}return p}async function xe(t,e){var i;void 0===e&&(e={});const{x:s,y:n,platform:o,rects:r,elements:a,strategy:l}=t,{boundary:d="clippingAncestors",rootBoundary:c="viewport",elementContext:h="floating",altBoundary:u=!1,padding:p=0}=se(e,t),f=ye(p),g=a[u?"floating"===h?"reference":"floating":h],m=_e(await o.getClippingRect({element:null==(i=await(null==o.isElement?void 0:o.isElement(g)))||i?g:g.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(a.floating)),boundary:d,rootBoundary:c,strategy:l})),v="floating"===h?{x:s,y:n,width:r.floating.width,height:r.floating.height}:r.reference,b=await(null==o.getOffsetParent?void 0:o.getOffsetParent(a.floating)),y=await(null==o.isElement?void 0:o.isElement(b))&&await(null==o.getScale?void 0:o.getScale(b))||{x:1,y:1},_=_e(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:b,strategy:l}):v);return{top:(m.top-_.top+f.top)/y.y,bottom:(_.bottom-m.bottom+f.bottom)/y.y,left:(m.left-_.left+f.left)/y.x,right:(_.right-m.right+f.right)/y.x}}function $e(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Se(t){return Jt.some(e=>t[e]>=0)}const ke=new Set(["left","top"]);function Ce(){return"undefined"!=typeof window}function Ee(t){return Re(t)?(t.nodeName||"").toLowerCase():"#document"}function Pe(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function Te(t){var e;return null==(e=(Re(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function Re(t){return!!Ce()&&(t instanceof Node||t instanceof Pe(t).Node)}function Oe(t){return!!Ce()&&(t instanceof Element||t instanceof Pe(t).Element)}function Le(t){return!!Ce()&&(t instanceof HTMLElement||t instanceof Pe(t).HTMLElement)}function Ve(t){return!(!Ce()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof Pe(t).ShadowRoot)}const Ne=new Set(["inline","contents"]);function Ae(t){const{overflow:e,overflowX:i,overflowY:s,display:n}=Ze(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+i)&&!Ne.has(n)}const ze=new Set(["table","td","th"]);function Ue(t){return ze.has(Ee(t))}const Me=[":popover-open",":modal"];function De(t){return Me.some(e=>{try{return t.matches(e)}catch(t){return!1}})}const We=["transform","translate","scale","rotate","perspective"],Be=["transform","translate","scale","rotate","perspective","filter"],Ie=["paint","layout","strict","content"];function Fe(t){const e=He(),i=Oe(t)?Ze(t):t;return We.some(t=>!!i[t]&&"none"!==i[t])||!!i.containerType&&"normal"!==i.containerType||!e&&!!i.backdropFilter&&"none"!==i.backdropFilter||!e&&!!i.filter&&"none"!==i.filter||Be.some(t=>(i.willChange||"").includes(t))||Ie.some(t=>(i.contain||"").includes(t))}function He(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const je=new Set(["html","body","#document"]);function qe(t){return je.has(Ee(t))}function Ze(t){return Pe(t).getComputedStyle(t)}function Je(t){return Oe(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Xe(t){if("html"===Ee(t))return t;const e=t.assignedSlot||t.parentNode||Ve(t)&&t.host||Te(t);return Ve(e)?e.host:e}function Ye(t){const e=Xe(t);return qe(e)?t.ownerDocument?t.ownerDocument.body:t.body:Le(e)&&Ae(e)?e:Ye(e)}function Ge(t,e,i){var s;void 0===e&&(e=[]),void 0===i&&(i=!0);const n=Ye(t),o=n===(null==(s=t.ownerDocument)?void 0:s.body),r=Pe(n);if(o){const t=Ke(r);return e.concat(r,r.visualViewport||[],Ae(n)?n:[],t&&i?Ge(t):[])}return e.concat(n,Ge(n,[],i))}function Ke(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Qe(t){const e=Ze(t);let i=parseFloat(e.width)||0,s=parseFloat(e.height)||0;const n=Le(t),o=n?t.offsetWidth:i,r=n?t.offsetHeight:s,a=Gt(i)!==o||Gt(s)!==r;return a&&(i=o,s=r),{width:i,height:s,$:a}}function ti(t){return Oe(t)?t:t.contextElement}function ei(t){const e=ti(t);if(!Le(e))return Qt(1);const i=e.getBoundingClientRect(),{width:s,height:n,$:o}=Qe(e);let r=(o?Gt(i.width):i.width)/s,a=(o?Gt(i.height):i.height)/n;return r&&Number.isFinite(r)||(r=1),a&&Number.isFinite(a)||(a=1),{x:r,y:a}}const ii=Qt(0);function si(t){const e=Pe(t);return He()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:ii}function ni(t,e,i,s){void 0===e&&(e=!1),void 0===i&&(i=!1);const n=t.getBoundingClientRect(),o=ti(t);let r=Qt(1);e&&(s?Oe(s)&&(r=ei(s)):r=ei(t));const a=function(t,e,i){return void 0===e&&(e=!1),!(!i||e&&i!==Pe(t))&&e}(o,i,s)?si(o):Qt(0);let l=(n.left+a.x)/r.x,d=(n.top+a.y)/r.y,c=n.width/r.x,h=n.height/r.y;if(o){const t=Pe(o),e=s&&Oe(s)?Pe(s):s;let i=t,n=Ke(i);for(;n&&s&&e!==i;){const t=ei(n),e=n.getBoundingClientRect(),s=Ze(n),o=e.left+(n.clientLeft+parseFloat(s.paddingLeft))*t.x,r=e.top+(n.clientTop+parseFloat(s.paddingTop))*t.y;l*=t.x,d*=t.y,c*=t.x,h*=t.y,l+=o,d+=r,i=Pe(n),n=Ke(i)}}return _e({width:c,height:h,x:l,y:d})}function oi(t,e){const i=Je(t).scrollLeft;return e?e.left+i:ni(Te(t)).left+i}function ri(t,e){const i=t.getBoundingClientRect();return{x:i.left+e.scrollLeft-oi(t,i),y:i.top+e.scrollTop}}const ai=new Set(["absolute","fixed"]);function li(t,e,i){let s;if("viewport"===e)s=function(t,e){const i=Pe(t),s=Te(t),n=i.visualViewport;let o=s.clientWidth,r=s.clientHeight,a=0,l=0;if(n){o=n.width,r=n.height;const t=He();(!t||t&&"fixed"===e)&&(a=n.offsetLeft,l=n.offsetTop)}const d=oi(s);if(d<=0){const t=s.ownerDocument,e=t.body,i=getComputedStyle(e),n="CSS1Compat"===t.compatMode&&parseFloat(i.marginLeft)+parseFloat(i.marginRight)||0,r=Math.abs(s.clientWidth-e.clientWidth-n);r<=25&&(o-=r)}else d<=25&&(o+=d);return{width:o,height:r,x:a,y:l}}(t,i);else if("document"===e)s=function(t){const e=Te(t),i=Je(t),s=t.ownerDocument.body,n=Yt(e.scrollWidth,e.clientWidth,s.scrollWidth,s.clientWidth),o=Yt(e.scrollHeight,e.clientHeight,s.scrollHeight,s.clientHeight);let r=-i.scrollLeft+oi(t);const a=-i.scrollTop;return"rtl"===Ze(s).direction&&(r+=Yt(e.clientWidth,s.clientWidth)-n),{width:n,height:o,x:r,y:a}}(Te(t));else if(Oe(e))s=function(t,e){const i=ni(t,!0,"fixed"===e),s=i.top+t.clientTop,n=i.left+t.clientLeft,o=Le(t)?ei(t):Qt(1);return{width:t.clientWidth*o.x,height:t.clientHeight*o.y,x:n*o.x,y:s*o.y}}(e,i);else{const i=si(t);s={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return _e(s)}function di(t,e){const i=Xe(t);return!(i===e||!Oe(i)||qe(i))&&("fixed"===Ze(i).position||di(i,e))}function ci(t,e,i){const s=Le(e),n=Te(e),o="fixed"===i,r=ni(t,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=Qt(0);function d(){l.x=oi(n)}if(s||!s&&!o)if(("body"!==Ee(e)||Ae(n))&&(a=Je(e)),s){const t=ni(e,!0,o,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else n&&d();o&&!s&&n&&d();const c=!n||s||o?Qt(0):ri(n,a);return{x:r.left+a.scrollLeft-l.x-c.x,y:r.top+a.scrollTop-l.y-c.y,width:r.width,height:r.height}}function hi(t){return"static"===Ze(t).position}function ui(t,e){if(!Le(t)||"fixed"===Ze(t).position)return null;if(e)return e(t);let i=t.offsetParent;return Te(t)===i&&(i=i.ownerDocument.body),i}function pi(t,e){const i=Pe(t);if(De(t))return i;if(!Le(t)){let e=Xe(t);for(;e&&!qe(e);){if(Oe(e)&&!hi(e))return e;e=Xe(e)}return i}let s=ui(t,e);for(;s&&Ue(s)&&hi(s);)s=ui(s,e);return s&&qe(s)&&hi(s)&&!Fe(s)?i:s||function(t){let e=Xe(t);for(;Le(e)&&!qe(e);){if(Fe(e))return e;if(De(e))return null;e=Xe(e)}return null}(t)||i}const fi={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:i,offsetParent:s,strategy:n}=t;const o="fixed"===n,r=Te(s),a=!!e&&De(e.floating);if(s===r||a&&o)return i;let l={scrollLeft:0,scrollTop:0},d=Qt(1);const c=Qt(0),h=Le(s);if((h||!h&&!o)&&(("body"!==Ee(s)||Ae(r))&&(l=Je(s)),Le(s))){const t=ni(s);d=ei(s),c.x=t.x+s.clientLeft,c.y=t.y+s.clientTop}const u=!r||h||o?Qt(0):ri(r,l);return{width:i.width*d.x,height:i.height*d.y,x:i.x*d.x-l.scrollLeft*d.x+c.x+u.x,y:i.y*d.y-l.scrollTop*d.y+c.y+u.y}},getDocumentElement:Te,getClippingRect:function(t){let{element:e,boundary:i,rootBoundary:s,strategy:n}=t;const o=[..."clippingAncestors"===i?De(e)?[]:function(t,e){const i=e.get(t);if(i)return i;let s=Ge(t,[],!1).filter(t=>Oe(t)&&"body"!==Ee(t)),n=null;const o="fixed"===Ze(t).position;let r=o?Xe(t):t;for(;Oe(r)&&!qe(r);){const e=Ze(r),i=Fe(r);i||"fixed"!==e.position||(n=null),(o?!i&&!n:!i&&"static"===e.position&&n&&ai.has(n.position)||Ae(r)&&!i&&di(t,r))?s=s.filter(t=>t!==r):n=e,r=Xe(r)}return e.set(t,s),s}(e,this._c):[].concat(i),s],r=o[0],a=o.reduce((t,i)=>{const s=li(e,i,n);return t.top=Yt(s.top,t.top),t.right=Xt(s.right,t.right),t.bottom=Xt(s.bottom,t.bottom),t.left=Yt(s.left,t.left),t},li(e,r,n));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:pi,getElementRects:async function(t){const e=this.getOffsetParent||pi,i=this.getDimensions,s=await i(t.floating);return{reference:ci(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:i}=Qe(t);return{width:e,height:i}},getScale:ei,isElement:Oe,isRTL:function(t){return"rtl"===Ze(t).direction}};function gi(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function mi(t,e,i,s){void 0===s&&(s={});const{ancestorScroll:n=!0,ancestorResize:o=!0,elementResize:r="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=s,d=ti(t),c=n||o?[...d?Ge(d):[],...Ge(e)]:[];c.forEach(t=>{n&&t.addEventListener("scroll",i,{passive:!0}),o&&t.addEventListener("resize",i)});const h=d&&a?function(t,e){let i,s=null;const n=Te(t);function o(){var t;clearTimeout(i),null==(t=s)||t.disconnect(),s=null}return function r(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),o();const d=t.getBoundingClientRect(),{left:c,top:h,width:u,height:p}=d;if(a||e(),!u||!p)return;const f={rootMargin:-Kt(h)+"px "+-Kt(n.clientWidth-(c+u))+"px "+-Kt(n.clientHeight-(h+p))+"px "+-Kt(c)+"px",threshold:Yt(0,Xt(1,l))||1};let g=!0;function m(e){const s=e[0].intersectionRatio;if(s!==l){if(!g)return r();s?r(!1,s):i=setTimeout(()=>{r(!1,1e-7)},1e3)}1!==s||gi(d,t.getBoundingClientRect())||r(),g=!1}try{s=new IntersectionObserver(m,{...f,root:n.ownerDocument})}catch(t){s=new IntersectionObserver(m,f)}s.observe(t)}(!0),o}(d,i):null;let u,p=-1,f=null;r&&(f=new ResizeObserver(t=>{let[s]=t;s&&s.target===d&&f&&(f.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var t;null==(t=f)||t.observe(e)})),i()}),d&&!l&&f.observe(d),f.observe(e));let g=l?ni(t):null;return l&&function e(){const s=ni(t);g&&!gi(g,s)&&i();g=s,u=requestAnimationFrame(e)}(),i(),()=>{var t;c.forEach(t=>{n&&t.removeEventListener("scroll",i),o&&t.removeEventListener("resize",i)}),null==h||h(),null==(t=f)||t.disconnect(),f=null,l&&cancelAnimationFrame(u)}}const vi=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var i,s;const{x:n,y:o,placement:r,middlewareData:a}=e,l=await async function(t,e){const{placement:i,platform:s,elements:n}=t,o=await(null==s.isRTL?void 0:s.isRTL(n.floating)),r=ne(i),a=oe(i),l="y"===de(i),d=ke.has(r)?-1:1,c=o&&l?-1:1,h=se(e,t);let{mainAxis:u,crossAxis:p,alignmentAxis:f}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&"number"==typeof f&&(p="end"===a?-1*f:f),l?{x:p*c,y:u*d}:{x:u*d,y:p*c}}(e,t);return r===(null==(i=a.offset)?void 0:i.placement)&&null!=(s=a.arrow)&&s.alignmentOffset?{}:{x:n+l.x,y:o+l.y,data:{...l,placement:r}}}}},bi=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:i,y:s,placement:n}=e,{mainAxis:o=!0,crossAxis:r=!1,limiter:a={fn:t=>{let{x:e,y:i}=t;return{x:e,y:i}}},...l}=se(t,e),d={x:i,y:s},c=await xe(e,l),h=de(ne(n)),u=re(h);let p=d[u],f=d[h];if(o){const t="y"===u?"bottom":"right";p=ie(p+c["y"===u?"top":"left"],p,p-c[t])}if(r){const t="y"===h?"bottom":"right";f=ie(f+c["y"===h?"top":"left"],f,f-c[t])}const g=a.fn({...e,[u]:p,[h]:f});return{...g,data:{x:g.x-i,y:g.y-s,enabled:{[u]:o,[h]:r}}}}}},yi=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var i,s;const{placement:n,middlewareData:o,rects:r,initialPlacement:a,platform:l,elements:d}=e,{mainAxis:c=!0,crossAxis:h=!0,fallbackPlacements:u,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,...m}=se(t,e);if(null!=(i=o.arrow)&&i.alignmentOffset)return{};const v=ne(n),b=de(a),y=ne(a)===a,_=await(null==l.isRTL?void 0:l.isRTL(d.floating)),w=u||(y||!g?[be(a)]:function(t){const e=be(t);return[ue(t),e,ue(e)]}(a)),x="none"!==f;!u&&x&&w.push(...ve(a,g,f,_));const $=[a,...w],S=await xe(e,m),k=[];let C=(null==(s=o.flip)?void 0:s.overflows)||[];if(c&&k.push(S[v]),h){const t=he(n,r,_);k.push(S[t[0]],S[t[1]])}if(C=[...C,{placement:n,overflows:k}],!k.every(t=>t<=0)){var E,P;const t=((null==(E=o.flip)?void 0:E.index)||0)+1,e=$[t];if(e){if(!("alignment"===h&&b!==de(e))||C.every(t=>de(t.placement)!==b||t.overflows[0]>0))return{data:{index:t,overflows:C},reset:{placement:e}}}let i=null==(P=C.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:P.placement;if(!i)switch(p){case"bestFit":{var T;const t=null==(T=C.filter(t=>{if(x){const e=de(t.placement);return e===b||"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:T[0];t&&(i=t);break}case"initialPlacement":i=a}if(n!==i)return{reset:{placement:i}}}return{}}}},_i=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{rects:i}=e,{strategy:s="referenceHidden",...n}=se(t,e);switch(s){case"referenceHidden":{const t=$e(await xe(e,{...n,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:Se(t)}}}case"escaped":{const t=$e(await xe(e,{...n,altBoundary:!0}),i.floating);return{data:{escapedOffsets:t,escaped:Se(t)}}}default:return{}}}}},wi=(t,e,i)=>{const s=new Map,n={platform:fi,...i},o={...n.platform,_c:s};return(async(t,e,i)=>{const{placement:s="bottom",strategy:n="absolute",middleware:o=[],platform:r}=i,a=o.filter(Boolean),l=await(null==r.isRTL?void 0:r.isRTL(e));let d=await r.getElementRects({reference:t,floating:e,strategy:n}),{x:c,y:h}=we(d,s,l),u=s,p={},f=0;for(let i=0;i<a.length;i++){const{name:o,fn:g}=a[i],{x:m,y:v,data:b,reset:y}=await g({x:c,y:h,initialPlacement:s,placement:u,strategy:n,middlewareData:p,rects:d,platform:r,elements:{reference:t,floating:e}});c=null!=m?m:c,h=null!=v?v:h,p={...p,[o]:{...p[o],...b}},y&&f<=50&&(f++,"object"==typeof y&&(y.placement&&(u=y.placement),y.rects&&(d=!0===y.rects?await r.getElementRects({reference:t,floating:e,strategy:n}):y.rects),({x:c,y:h}=we(d,u,l))),i=-1)}return{x:c,y:h,placement:u,strategy:n,middlewareData:p}})(t,e,{...n,platform:o})};var xi,$i=r`:host{display:contents}.tooltip-placeholder{display:inline-block;max-width:100%}.tooltip{word-wrap:break-word;background-color:var(--sgds-surface-fixed-dark);border-radius:var(--sgds-border-radius-md);box-shadow:0 0 2px 0 rgba(0,0,0,.12),0 8px 16px 0 rgba(0,0,0,.14);color:var(--sgds-color-fixed-light);display:block;font-size:var(--sgds-font-size-14);line-break:auto;max-width:var(--sgds-dimension-320);padding:var(--sgds-padding-xs) var(--sgds-padding-sm);text-align:left;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;z-index:var(--sgds-z-index-overlay)}div{max-width:fit-content}`;class Si extends zt{constructor(){super(...arguments),this._myTooltip=Ht(),this._tooltipBubble=Ht(),this.content="",this.placement="top",this.trigger="hover focus",this.open=!1,this._handleClickOutOfElement=t=>{this.open&&(t.composedPath().includes(this)||this.hide())}}connectedCallback(){super.connectedCallback(),this.trigger.includes("click")&&document.addEventListener("click",this._handleClickOutOfElement)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleClickOutOfElement),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0)}firstUpdated(t){super.firstUpdated(t),this._tooltipTargetElements.forEach(t=>{t.setAttribute("data-sgds-tooltip",this.content),this.trigger.includes("hover")&&(t.addEventListener("mouseenter",()=>this.show()),t.addEventListener("mouseleave",()=>this.hide())),this.trigger.includes("focus")&&(t.addEventListener("focus",()=>this.show()),t.addEventListener("blur",()=>this.hide())),"click"===this.trigger&&t.addEventListener("click",()=>this.toggle())})}_handleSlotChange(){this._tooltipTargetElements.forEach(t=>t.setAttribute("data-sgds-tooltip",this.content))}async updateFloatingPosition(){if(!this._myTooltip.value||!this._tooltipBubble.value)return;const{x:t,y:e,placement:i,strategy:s,middlewareData:n}=await wi(this._tooltipTargetElements[0],this._tooltipBubble.value,{strategy:"fixed",placement:this.placement,middleware:[vi(8),yi(),bi(),_i()]});this._tooltipBubble.value.setAttribute("data-placement",i),Object.assign(this._tooltipBubble.value.style,{position:s,left:`${t}px`,top:`${e}px`});const{referenceHidden:o,escaped:r}=n.hide||{};this._tooltipBubble.value.style.visibility=o||r?"hidden":"visible"}async show(){this.open||(this.open=!0,this.emit("sgds-show"),await this.updateComplete,await this.updateFloatingPosition(),this._myTooltip.value&&this._tooltipBubble.value&&(this._cleanupAutoUpdate=mi(this._tooltipTargetElements[0],this._tooltipBubble.value,()=>this.updateFloatingPosition())),this.emit("sgds-after-show"))}hide(){this.open&&(this.emit("sgds-hide"),this.open=!1,this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0),setTimeout(()=>this.emit("sgds-after-hide"),0))}toggle(){this.open?this.hide():this.show()}render(){return Q`
|
|
63
63
|
<div ${Zt(this._myTooltip)} class="tooltip-placeholder">
|
|
64
64
|
<slot @slotchange=${()=>this._handleSlotChange()}></slot>
|
|
65
65
|
${this.open?Q`<div ${Zt(this._tooltipBubble)} class="tooltip" role="tooltip">${this.content}</div>`:null}
|