/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
import{a as k}from"./QUFMR3GW.js";import{a as v}from"./YGX7CUXN.js";import{a as b}from"./TLYY3J5P.js";import"./WGGFNK4Z.js";import{e as p}from"./EH5Y2TRK.js";import"./UANLRLKZ.js";import"./DVG3NA3H.js";import"./OAOQ5BXS.js";import{E as l,F as d,G as h,H as r,J as i,L as u,M as f,S as m,g as s,h as n}from"./PGOMURMZ.js";var y=s`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline}:host a{cursor:pointer;font-family:inherit;text-decoration-line:none;outline-color:transparent;font-size:inherit;-webkit-appearance:none;color:var(--calcite-link-text-color, var(--calcite-color-text-link));line-height:inherit;white-space:initial;background-image:linear-gradient(currentColor,currentColor),linear-gradient(var(--calcite-color-brand-underline),var(--calcite-color-brand-underline));background-position-x:0 100%;background-position-y:min(1.5em,100%);background-repeat:no-repeat;background-size:0% var(--calcite-border-width-sm),100% var(--calcite-border-width-sm)}:host a:hover,:host a:focus{background-size:100% var(--calcite-border-width-sm),100% var(--calcite-border-width-sm)}:host a:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(var(--calcite-spacing-base) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}:host a:active{background-size:100% var(--calcite-border-width-md),100% var(--calcite-border-width-md)}:host a:active.calcite--rtl{background-position:100% 100%,100% 100%}:host a{transition-property:background-color,block-size,border-color,box-shadow,color,inset-block-end,inset-block-start,inset-inline-end,inset-inline-start,inset-size,opacity,outline-color,transform,background-size;transition-duration:var(--calcite-animation-timing);transition-timing-function:ease-in-out}calcite-icon{inline-size:1em;block-size:1em;min-inline-size:unset;min-block-size:unset}.calcite-link--icon{vertical-align:middle;margin-block-start:-.25em}:host .calcite-link--icon.icon-start{margin-inline-end:.5rem}:host .calcite-link--icon.icon-end{margin-inline-start:.5rem}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([hidden]){display:none}[hidden]{display:none}`,c={calciteLinkIcon:"calcite-link--icon",iconStart:"icon-start",iconEnd:"icon-end"},a=class extends h{constructor(){super(),this.anchorRef=l(),this.direction=p(),this.focusSetter=b()(this),this.interactiveContainer=k(this),this.keyDownHandler=t=>{v(t.key)&&(t.preventDefault(),this.el.click())},this.anchorClickHandler=t=>{t.isTrusted||t.stopPropagation()},this.disabled=!1,this.download=!1,this.listen("click",this.clickHandler)}static{this.properties={disabled:[7,{},{reflect:!0,type:Boolean}],download:[3,{converter:u},{reflect:!0}],href:[3,{},{reflect:!0}],iconEnd:[3,{type:String},{reflect:!0}],iconFlipRtl:[3,{},{reflect:!0}],iconStart:[3,{type:String},{reflect:!0}],rel:1,target:1}}static{this.styles=y}async setFocus(t){return this.focusSetter(()=>this.anchorRef.value,t)}clickHandler(t){t.isTrusted||this.anchorRef.value?.click()}render(){let{download:t}=this,o=this.direction,e=!this.href;return this.el.role="presentation",this.interactiveContainer({disabled:this.disabled,children:n`<a class=${r({[f.rtl]:o==="rtl"})} download=${(t===!0||t===""?"":t||void 0)??i} href=${(this.href||void 0)??i} @click=${this.anchorClickHandler} @keydown=${e?this.keyDownHandler:void 0} rel=${this.rel??i} .role=${e?"button":void 0} tabindex=${(e?0:void 0)??i} target=${(this.href?this.target:void 0)??i} ${d(this.anchorRef)}>${n`${this.iconStart?this.renderIcon("start"):null}<slot></slot>${this.iconEnd?this.renderIcon("end"):null}`}</a>`})}renderIcon(t){let o=t==="start",e=o?this.iconStart:this.iconEnd,g=this.iconFlipRtl==="both"||this.iconFlipRtl===t;return n`<calcite-icon class=${r({[c.calciteLinkIcon]:!0,[o?c.iconStart:c.iconEnd]:!0})} .flipRtl=${g} .icon=${e} scale=s></calcite-icon>`}};m("calcite-link",a);export{a as Link};
