/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{__decorate as e}from"tslib";import{property as t,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{drawContentHeaderActions as i}from"../css.js";import{directionModeIcons as s}from"./directionModeIcons.js";import r from"../../../../widgets/Widget.js";import{loadCalciteComponents as n}from"../../../../widgets/support/componentsUtils.js";import{tsx as c,messageBundle as d}from"../../../../widgets/support/widget.js";let l=class extends r{constructor(e){super(e),this.visibleElements={}}render(){return c("div",{class:i},this._isElementVisible("direction")?c(a,{messages:this.messages,sketchOptions:this.sketchOptions,topLayerDisabled:this.topLayerDisabled}):null)}loadDependencies(){return n({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group")})}_isElementVisible(e){return this.visibleElements?.[e]??this.sketchOptions.tooltips.visibleElements[e]}};function a(e){const{directionMode:t}=e.sketchOptions.values,o=e.messages?.sketch,i=o?.directionModeSelect?.title,r="absolute",n="relative";return c("calcite-dropdown",{key:"direction-mode",placement:"bottom-end",scale:"s",topLayerDisabled:e.topLayerDisabled,onCalciteDropdownSelect:t=>{const o=t.currentTarget.selectedItems?.[0]?.getAttribute("data-mode");e.sketchOptions.values.directionMode=o??"absolute"}},c("calcite-button",{alignment:"end",appearance:"transparent",iconStart:s[t],kind:"neutral",label:i,scale:"s",slot:"trigger",title:i}),c("calcite-dropdown-group",{selectionMode:"single"},c("calcite-dropdown-item",{"data-mode":n,"data-testid":"tooltip-direction-mode-relative",iconStart:s.relative,key:"relative",selected:t===n},o?.directionModeSelect?.relative),c("calcite-dropdown-item",{"data-mode":r,"data-testid":"tooltip-direction-mode-absolute",iconStart:s.absolute,key:"absolute",selected:t===r},o?.directionModeSelect?.absolute)))}e([d("esri/views/interactive/tooltip/t9n/Tooltip"),t()],l.prototype,"messages",void 0),e([t()],l.prototype,"sketchOptions",void 0),e([t()],l.prototype,"visibleElements",void 0),l=e([o("esri.views.interactive.tooltip.components.DrawHeaderActions")],l);export{l as DrawHeaderActions};
