/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["require","exports","../../../chunks/_rollupPluginBabelHelpers","../../../chunks/tslib.es6","../../../core/uuid","../../../core/accessorSupport/decorators/property","../../../core/arrayUtils","../../../core/has","../../../core/accessorSupport/ensureType","../../../core/accessorSupport/decorators/subclass","../../Widget","../css","../DurationMode","./Label","./LabeledColorPicker","../../support/widgetUtils","../../support/decorators/messageBundle","../../support/jsxFactory"],(function(o,e,r,t,s,i,a,n,l,c,u,d,p,_,b,h,C,g){"use strict";function f({active:o,label:e,...r}){return g.tsx("calcite-button",{alignment:"center",appearance:o?"solid":"outline",scale:"s",width:"half",...r},e)}e.DurationConfigurator=function(e){function t(o){var r;return(r=e.call(this,o)||this).colorPickerVisible=!0,r._modeSelectorId=`mode-selector-${s.generateUUID()}`,r._colorPickerId=`color-picker-${s.generateUUID()}`,r._onColorChange=o=>{r.options.color=o},r._setContinuous=()=>{r.options.mode=p.DurationMode.Continuous},r._setHourly=()=>{r.options.mode=p.DurationMode.Hourly},r}r._inheritsLoose(t,e);var i=t.prototype;return i.loadDependencies=function(){return Promise.all([new Promise(((e,r)=>o(["../../../chunks/calcite-button"],e,r))),new Promise(((e,r)=>o(["../../../chunks/calcite-label"],e,r)))])},i.render=function(){const o=this._messages.duration,{color:e,mode:r}=this.options;return g.tsx("div",{class:d.DURATION_CONFIGURATOR_CSS.base},g.tsx(_.Label,{for:this._modeSelectorId,label:o.modeLabel},g.tsx("div",{class:d.DURATION_CONFIGURATOR_CSS.radioGroup},g.tsx(f,{active:r===p.DurationMode.Continuous,label:o.continuousLabel,onclick:this._setContinuous}),g.tsx(f,{active:r===p.DurationMode.Hourly,label:o.hourlyLabel,onclick:this._setHourly}))),this.colorPickerVisible&&g.tsx(b.LabeledColorPicker,{id:this._colorPickerId,label:o.colorLabel,value:e,onChange:this._onColorChange}))},t}(u),t.__decorate([i.property()],e.DurationConfigurator.prototype,"options",void 0),t.__decorate([i.property()],e.DurationConfigurator.prototype,"colorPickerVisible",void 0),t.__decorate([i.property(),C.messageBundle("esri/widgets/ShadowCast/t9n/ShadowCast")],e.DurationConfigurator.prototype,"_messages",void 0),e.DurationConfigurator=t.__decorate([c.subclass("esri.widgets.ShadowCast.components.DurationConfigurator")],e.DurationConfigurator),Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
