Liferay.Loader.define("analytics-reports-web@2.0.38/js/components/TimeSpanSelector",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/form","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../context/ChartStateContext","../context/ConnectionContext"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function({disabledNextTimeSpan:e,disabledPreviousPeriodButton:t,timeSpanKey:a,timeSpanOptions:c}){const{validAnalyticsConnection:u}=(0,l.useContext)(i.default),d=(0,l.useContext)(o.ChartDispatchContext);return l.default.createElement("div",{className:"d-flex"},l.default.createElement(r.ClaySelect,{"aria-label":Liferay.Language.get("select-date-range"),className:"bg-white",disabled:!u,onChange:e=>{const{value:t}=e.target;d({payload:{key:t},type:"CHANGE_TIME_SPAN_KEY"})},value:a},c.map((e=>l.default.createElement(r.ClaySelect.Option,{key:e.key,label:e.label,value:e.key})))),l.default.createElement("div",{className:"d-flex flex-shrink-0 ml-2"},l.default.createElement(n.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("previous-period"),className:"mr-1","data-tooltip-align":"top-right",disabled:!u||t,displayType:"secondary",onClick:()=>d({type:"PREV_TIME_SPAN"}),small:!0,symbol:"angle-left",title:t?Liferay.Language.get("you-cannot-choose-a-date-prior-to-the-publication-date"):void 0}),l.default.createElement(n.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("next-period"),disabled:!u||e,displayType:"secondary",onClick:()=>d({type:"NEXT_TIME_SPAN"}),small:!0,symbol:"angle-right"})))};var n=a("@frontend-taglib-clay$clayui/button"),r=a("@frontend-taglib-clay$clayui/form"),l=(u(a("liferay!frontend-js-react-web$prop-types")),function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var l=n?Object.getOwnPropertyDescriptor(e,r):null;l&&(l.get||l.set)?Object.defineProperty(a,r,l):a[r]=e[r]}a.default=e,t&&t.set(e,a);return a}(a("liferay!frontend-js-react-web$react"))),o=a("../context/ChartStateContext"),i=u(a("../context/ConnectionContext"));function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}function u(e){return e&&e.__esModule?e:{default:e}}}}));
//# sourceMappingURL=TimeSpanSelector.js.map