{"size": 7724, "ext": "js", "max_stars_repo_path": "typescript-samples/sketch-text-symbol-picker/node_modules/@esri/calcite-components/dist/calcite/p-416c5ece.entry.js", "max_stars_repo_name": "banuelosj/jsapi-samples", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "typescript-samples/sketch-text-symbol-picker/node_modules/@esri/calcite-components/dist/calcite/p-416c5ece.entry.js", "max_issues_repo_name": "banuelosj/jsapi-samples", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "typescript-samples/sketch-text-symbol-picker/node_modules/@esri/calcite-components/dist/calcite/p-416c5ece.entry.js", "max_forks_repo_name": "banuelosj/jsapi-samples", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 7724.0, "max_line_length": 7724, "alphanum_fraction": 0.7615225272}
import{r as t,h as e,H as a,g as i}from"./p-ff68592a.js";import{d as s}from"./p-fbd3d700.js";import{g as r}from"./p-e75286c4.js";import{g as o}from"./p-a4e6e35b.js";import{d as n,u as p,c as l,C as c}from"./p-c158d9b4.js";const h="data-calcite-tooltip-reference",f=class{constructor(e){t(this,e),this.offsetDistance=n,this.offsetSkidding=0,this.open=!1,this.placement="auto",this._referenceElement=this.getReferenceElement(),this.guid="calcite-tooltip-"+o(),this.getId=()=>this.el.id||this.guid,this.addReferences=()=>{const{_referenceElement:t}=this;if(!t)return;const e=this.getId();t.setAttribute(h,e),t.setAttribute("aria-describedby",e)},this.removeReferences=()=>{const{_referenceElement:t}=this;t&&(t.removeAttribute(h),t.removeAttribute("aria-describedby"))},this.show=()=>{this.open=!0},this.hide=()=>{this.open=!1}}offsetDistanceOffsetHandler(){this.reposition()}offsetSkiddingHandler(){this.reposition()}openHandler(){this.reposition()}placementHandler(){this.reposition()}referenceElementHandler(){this.removeReferences(),this._referenceElement=this.getReferenceElement(),this.addReferences(),this.createPopper()}componentDidLoad(){this.addReferences(),this.createPopper()}disconnectedCallback(){this.removeReferences(),this.destroyPopper()}async reposition(){const{popper:t,el:e,placement:a}=this,i=this.getModifiers();t?p({el:e,modifiers:i,placement:a,popper:t}):this.createPopper()}getReferenceElement(){const{referenceElement:t}=this;return("string"==typeof t?document.getElementById(t):t)||null}getModifiers(){const{arrowEl:t,offsetDistance:e,offsetSkidding:a}=this;return[{name:"arrow",enabled:!0,options:{element:t}},{name:"offset",enabled:!0,options:{offset:[a,e]}}]}createPopper(){this.destroyPopper();const{el:t,placement:e,_referenceElement:a}=this,i=this.getModifiers();this.popper=l({el:t,modifiers:i,placement:e,referenceEl:a})}destroyPopper(){const{popper:t}=this;t&&t.destroy(),this.popper=null}render(){const{_referenceElement:t,label:i,open:s}=this,r=t&&s,o=!r;return e(a,{"aria-hidden":o.toString(),"aria-label":i,"calcite-hydrated-hidden":o,id:this.getId(),role:"tooltip"},e("div",{class:{[c.animation]:!0,[c.animationActive]:r}},e("div",{class:"arrow",ref:t=>this.arrowEl=t}),e("div",{class:"container"},e("slot",null))))}get el(){return i(this)}static get watchers(){return{offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"]}}};f.style='@-webkit-keyframes calcite-fade-in{0%{opacity:0}100%{opacity:1}}@keyframes calcite-fade-in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes calcite-fade-in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes calcite-fade-in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes calcite-fade-in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes calcite-fade-in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes calcite-fade-in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes calcite-fade-in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}:root{--calcite-popper-transition:150ms ease-in-out}:host([hidden]){display:none}:host{display:block;position:absolute;z-index:999;-webkit-transform:scale(0);transform:scale(0)}.calcite-popper-anim{position:relative;z-index:1;-webkit-transition:var(--calcite-popper-transition);transition:var(--calcite-popper-transition);visibility:hidden;-webkit-transition-property:visibility, opacity, -webkit-transform;transition-property:visibility, opacity, -webkit-transform;transition-property:transform, visibility, opacity;transition-property:transform, visibility, opacity, -webkit-transform;opacity:0;-webkit-box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);border-radius:var(--calcite-border-radius)}:host([data-popper-placement^=bottom]) .calcite-popper-anim{-webkit-transform:translateY(-5px);transform:translateY(-5px)}:host([data-popper-placement^=top]) .calcite-popper-anim{-webkit-transform:translateY(5px);transform:translateY(5px)}:host([data-popper-placement^=left]) .calcite-popper-anim{-webkit-transform:translateX(5px);transform:translateX(5px)}:host([data-popper-placement^=right]) .calcite-popper-anim{-webkit-transform:translateX(-5px);transform:translateX(-5px)}:host([data-popper-placement]) .calcite-popper-anim--active{opacity:1;visibility:visible;-webkit-transform:translate(0);transform:translate(0)}.arrow,.arrow::before{position:absolute;width:8px;height:8px;z-index:-1}.arrow::before{content:"";-webkit-box-shadow:var(--calcite-shadow-1);box-shadow:var(--calcite-shadow-1);-webkit-transform:rotate(45deg);transform:rotate(45deg);background:var(--calcite-ui-foreground-1)}:host([data-popper-placement^=top]) .arrow{bottom:-4px}:host([data-popper-placement^=bottom]) .arrow{top:-4px}:host([data-popper-placement^=left]) .arrow{right:-4px}:host([data-popper-placement^=right]) .arrow{left:-4px}.container{position:relative;background:var(--calcite-ui-foreground-1);max-width:300px;max-height:300px;display:-ms-flexbox;display:flex;-ms-flex-pack:start;justify-content:flex-start;-ms-flex-direction:column;flex-direction:column;font-weight:500;color:var(--calcite-ui-text-1);padding:12px 16px;overflow:hidden;font-size:0.8125rem;line-height:1.5}:host([theme=dark]) .container{background:var(--calcite-ui-foreground-2)}';const m=class{constructor(e){t(this,e),this.hoverTimeouts=new WeakMap,this.selector=`[${h}]`,this.queryTooltip=t=>s(t.closest(this.selector),h),this.clearHoverTimeout=t=>{const{hoverTimeouts:e}=this;e.has(t)&&window.clearTimeout(e.get(t))},this.closeExistingTooltip=()=>{const{tooltipEl:t}=this;t&&this.toggleTooltip(t,!1)},this.focusTooltip=({tooltip:t,value:e})=>{this.closeExistingTooltip(),e&&this.clearHoverTimeout(t),this.toggleTooltip(t,e)},this.toggleTooltip=(t,e)=>{t.open=e,e&&(this.tooltipEl=t)},this.hoverToggle=({tooltip:t,value:e})=>{const{hoverTimeouts:a}=this;a.delete(t),e&&this.closeExistingTooltip(),this.toggleTooltip(t,e)},this.hoverTooltip=({tooltip:t,value:e})=>{this.clearHoverTimeout(t);const{hoverTimeouts:a}=this,i=window.setTimeout((()=>this.hoverToggle({tooltip:t,value:e})),500);a.set(t,i)},this.activeTooltipHover=t=>{const{tooltipEl:e,hoverTimeouts:a}=this;e&&a.has(e)&&(t.composedPath().includes(e)?this.clearHoverTimeout(e):this.hoverTooltip({tooltip:e,value:!1}))},this.hoverEvent=(t,e)=>{const a=this.queryTooltip(t.target);this.activeTooltipHover(t),a&&this.hoverTooltip({tooltip:a,value:e})},this.focusEvent=(t,e)=>{const a=this.queryTooltip(t.target);a&&this.focusTooltip({tooltip:a,value:e})}}render(){return e(a,null)}keyUpHandler(t){if("Escape"===r(t.key)){const{tooltipEl:t}=this;t&&(this.clearHoverTimeout(t),this.toggleTooltip(t,!1))}}mouseEnterShow(t){this.hoverEvent(t,!0)}mouseLeaveHide(t){this.hoverEvent(t,!1)}focusShow(t){this.focusEvent(t,!0)}blurHide(t){this.focusEvent(t,!1)}};export{f as calcite_tooltip,m as calcite_tooltip_manager}