text: import{__awaiter,__generator,__spreadArray}from"tslib";
  /*!
   * (C) Ionic http://ionicframework.com - MIT License
   */import{r as registerInstance,e as createEvent,c as writeTask,h,H as Host,i as getElement}from"./index-06cd27b1.js";import{d as chevronBack,f as chevronForward,g as chevronDown,h as caretUpSharp,i as caretDownSharp}from"./index-3f6412b6.js";import{b as getIonMode}from"./ionic-global-a049bcbf.js";import{startFocusVisible}from"./focus-visible-02bf7a99.js";import{r as raf,h as renderHiddenInput,g as getElementRoot}from"./helpers-eed79a2b.js";import{i as isRTL}from"./dir-e8b767a8.js";import{c as createColorClasses}from"./theme-a24ff1ad.js";export{e as ion_picker,f as ion_picker_column}from"./overlays-942c6b99.js";import"./haptic-9a9aa7ec.js";import"./index-41bf41f2.js";import"./gesture-controller-68c023a4.js";import"./index-c841c933.js";import"./animation-c9c2a359.js";import"./backdrop-1b2f5527.js";import"./framework-delegate-a922018c.js";import"./keyboard-808e4e15.js";import"./index-c8ef55b5.js";import"./cubic-bezier-154a53a5.js";import"./ripple-effect-0576252b.js";import"./spinner-21670fb6.js";import"./spinner-configs-163ed7fb.js";import"./hardware-back-button-ace6a71b.js";var isSameDay=function(t,e){return t.month===e.month&&t.day===e.day&&t.year===e.year};var isBefore=function(t,e){return t.year<e.year||t.year===e.year&&t.month<e.month||t.year===e.year&&t.month===e.month&&t.day<e.day};var isAfter=function(t,e){return t.year>e.year||t.year===e.year&&t.month>e.month||t.year===e.year&&t.month===e.month&&t.day>e.day};var isLeapYear=function(t){return t%4===0&&t%100!==0||t%400===0};var is24Hour=function(t,e){if(e!==undefined){return e==="h23"}var a=new Intl.DateTimeFormat(t,{hour:"numeric"});var n=a.resolvedOptions();if(n.hourCycle!==undefined){return n.hourCycle==="h23"}var r=new Date("5/18/2021 00:00");var i=a.formatToParts(r);var o=i.find((function(t){return t.type==="hour"}));if(!o){throw new Error("Hour value not found from DateTimeFormat")}return o.value==="00"};var getNumDaysInMonth=function(t,e){return t===4||t===6||t===9||t===11?30:t===2?isLeapYear(e)?29:28:31};var twoDigit=function(t){return("0"+(t!==undefined?Math.abs(t):"0")).slice(-2)};var fourDigit=function(t){return("000"+(t!==undefined?Math.abs(t):"0")).slice(-4)};var convertDataToISO=function(t){var e="";if(t.year!==undefined){e=fourDigit(t.year);if(t.month!==undefined){e+="-"+twoDigit(t.month);if(t.day!==undefined){e+="-"+twoDigit(t.day);if(t.hour!==undefined){e+="T"+twoDigit(t.hour)+":"+twoDigit(t.minute)+":00";if(t.tzOffset===undefined){e+="Z"}else{e+=(t.tzOffset>0?"+":"-")+twoDigit(Math.floor(Math.abs(t.tzOffset/60)))+":"+twoDigit(t.tzOffset%60)}}}}}else if(t.hour!==undefined){e=twoDigit(t.hour)+":"+twoDigit(t.minute)}return e};var convert12HourTo24Hour=function(t,e){if(e===undefined){return t}if(e==="am"){if(t===12){return 0}return t}if(t===12){return 12}return t+12};var getStartOfWeek=function(t){var e=t.dayOfWeek;if(e===null||e===undefined){throw new Error("No day of week provided")}return subtractDays(t,e)};var getEndOfWeek=function(t){var e=t.dayOfWeek;if(e===null||e===undefined){throw new Error("No day of week provided")}return addDays(t,6-e)};var getNextDay=function(t){return addDays(t,1)};var getPreviousDay=function(t){return subtractDays(t,1)};var getPreviousWeek=function(t){return subtractDays(t,7)};var getNextWeek=function(t){return addDays(t,7)};var subtractDays=function(t,e){var a=t.month,n=t.day,r=t.year;if(n===null){throw new Error("No day provided")}var i={month:a,day:n,year:r};i.day=n-e;if(i.day<1){i.month-=1}if(i.month<1){i.month=12;i.year-=1}if(i.day<1){var o=getNumDaysInMonth(i.month,i.year);i.day=o+i.day}return i};var addDays=function(t,e){var a=t.month,n=t.day,r=t.year;if(n===null){throw new Error("No day provided")}var i={month:a,day:n,year:r};var o=getNumDaysInMonth(a,r);i.day=n+e;if(i.day>o){i.day-=o;i.month+=1}if(i.month>12){i.month=1;i.year+=1}return i};var getPreviousMonth=function(t){var e=t.month===1?12:t.month-1;var a=t.month===1?t.year-1:t.year;var n=getNumDaysInMonth(e,a);var r=n<t.day?n:t.day;return{month:e,year:a,day:r}};var getNextMonth=function(t){var e=t.month===12?1:t.month+1;var a=t.month===12?t.year+1:t.year;var n=getNumDaysInMonth(e,a);var r=n<t.day?n:t.day;return{month:e,year:a,day:r}};var changeYear=function(t,e){var a=t.month;var n=t.year+e;var r=getNumDaysInMonth(a,n);var i=r<t.day?r:t.day;return{month:a,year:n,day:i}};var getPreviousYear=function(t){return changeYear(t,-1)};var getNextYear=function(t){return changeYear(t,1)};var getInternalHourValue=function(t,e,a){if(e){return t}return convert12HourTo24Hour(t,a)};var calculateHourFromAMPM=function(t,e){var a=t.ampm,n=t.hour;var r=n;if(a==="am"&&e==="pm"){r=convert12HourTo24Hour(r,"pm")}else if(a==="pm"&&e==="am"){r=Math.abs(r-12)}return r};var getToday=function(){var t=new Date;var e=t.getTimezoneOffset();t.setHours(t.getHours()-e/60);return t.toISOString()};var minutes=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59];var hour12=[12,1,2,3,4,5,6,7,8,9,10,11];var hour23=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23];var getDaysOfWeek=function(t,e,a){if(a===void 0){a=0}var n=e==="ios"?"short":"narrow";var r=new Intl.DateTimeFormat(t,{weekday:n});var i=new Date("11/01/2020");var o=[];for(var s=a;s<a+7;s++){var d=new Date(i);d.setDate(d.getDate()+s);o.push(r.format(d))}return o};var getDaysOfMonth=function(t,e,a){var n=getNumDaysInMonth(t,e);var r=new Date(t+"/1/"+e).getDay();var i=r>=a?r-(a+1):6-(a-r);var o=[];for(var s=1;s<=n;s++){o.push({day:s,dayOfWeek:(i+s)%7})}for(var s=0;s<=i;s++){o=__spreadArray([{day:null,dayOfWeek:null}],o)}return o};var generateTime=function(t,e,a,n,r,i){if(e===void 0){e="h12"}var o=e==="h23";var s=o?hour23:hour12;var d=minutes;var l=true;var u=true;if(r){s=s.filter((function(t){return r.includes(t)}))}if(i){d=d.filter((function(t){return i.includes(t)}))}if(a){if(isSameDay(t,a)){if(a.hour!==undefined){s=s.filter((function(e){var n=t.ampm==="pm"?(e+12)%24:e;return(o?e:n)>=a.hour}));l=a.hour<13}if(a.minute!==undefined){var p=false;if(a.hour!==undefined&&t.hour!==undefined){if(t.hour>a.hour){p=true}}d=d.filter((function(t){if(p){return true}return t>=a.minute}))}}else if(isBefore(t,a)){s=[];d=[];l=u=false}}if(n){if(isSameDay(t,n)){if(n.hour!==undefined){s=s.filter((function(e){var a=t.ampm==="pm"?(e+12)%24:e;return(o?e:a)<=n.hour}));u=n.hour>=13}if(n.minute!==undefined){d=d.filter((function(t){return t<=n.minute}))}}else if(isAfter(t,n)){s=[];d=[];l=u=false}}return{hours:s,minutes:d,am:l,pm:u}};var generateMonths=function(t){return[getPreviousMonth(t),{month:t.month,year:t.year,day:t.day},getNextMonth(t)]};var getPickerMonths=function(t,e,a,n,r){var i=e.year;var o=[];if(r!==undefined){var s=r;if((n===null||n===void 0?void 0:n.month)!==undefined){s=s.filter((function(t){return t<=n.month}))}if((a===null||a===void 0?void 0:a.month)!==undefined){s=s.filter((function(t){return t>=a.month}))}s.forEach((function(e){var a=new Date(e+"/1/"+i);var n=new Intl.DateTimeFormat(t,{month:"long"}).format(a);o.push({text:n,value:e})}))}else{var d=n&&n.year===i?n.month:12;var l=a&&a.year===i?a.month:1;for(var u=l;u<=d;u++){var p=new Date(u+"/1/"+i);var c=new Intl.DateTimeFormat(t,{month:"long"}).format(p);o.push({text:c,value:u})}}return o};var getCalendarYears=function(t,e,a,n){if(n!==undefined){var r=n;if((a===null||a===void 0?void 0:a.year)!==undefined){r=r.filter((function(t){return t<=a.year}))}if((e===null||e===void 0?void 0:e.year)!==undefined){r=r.filter((function(t){return t>=e.year}))}return r}else{var i=t.year;var o=(a===null||a===void 0?void 0:a.year)||i;var s=(e===null||e===void 0?void 0:e.year)||i-100;var d=[];for(var l=o;l>=s;l--){d.push(l)}return d}};var get12HourTime=function(t){return t%12||12};var getFormattedAMPM=function(t){if(t===undefined){return""}return t.toUpperCase()};var getFormattedTime=function(t,e){if(t.hour===undefined||t.minute===undefined){return"Invalid Time"}var a=e?getFormattedHour(t.hour,e):get12HourTime(t.hour);var n=addTimePadding(t.minute);if(e){return a+":"+n}return a+":"+n+" "+getFormattedAMPM(t.ampm)};var addTimePadding=function(t){var e=t.toString();if(e.length>1){return e}return"0"+e};var getFormattedHour=function(t,e){if(!e){return t.toString()}return addTimePadding(t)};var generateDayAriaLabel=function(t,e,a){if(a.day===null){return null}var n=new Date(a.month+"/"+a.day+"/"+a.year);var r=new Intl.DateTimeFormat(t,{weekday:"long",month:"long",day:"numeric"}).format(n);return e?"Today, "+r:r};var getMonthAndDay=function(t,e){var a=new Date(e.month+"/"+e.day+"/"+e.year);return new Intl.DateTimeFormat(t,{weekday:"short",month:"short",day:"numeric"}).format(a)};var getMonthAndYear=function(t,e){var a=new Date(e.month+"/"+e.day+"/"+e.year);return new Intl.DateTimeFormat(t,{month:"long",year:"numeric"}).format(a)};var ISO_8601_REGEXP=/^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/;var TIME_REGEXP=/^((\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/;var convertToArrayOfNumbers=function(t){if(t===undefined){return}var e=t;if(typeof t==="string"){e=t.replace(/\[|\]|\s/g,"").split(",")}var a;if(Array.isArray(e)){a=e.map((function(t){return parseInt(t,10)})).filter(isFinite)}else{a=[e]}return a};var getPartsFromCalendarDay=function(t){return{month:parseInt(t.getAttribute("data-month"),10),day:parseInt(t.getAttribute("data-day"),10),year:parseInt(t.getAttribute("data-year"),10),dayOfWeek:parseInt(t.getAttribute("data-day-of-week"),10)}};var parseDate=function(t){var e=null;if(t!=null&&t!==""){e=TIME_REGEXP.exec(t);if(e){e.unshift(undefined,undefined);e[2]=e[3]=undefined}else{e=ISO_8601_REGEXP.exec(t)}}if(e===null){return undefined}for(var a=1;a<8;a++){e[a]=e[a]!==undefined?parseInt(e[a],10):undefined}var n=0;if(e[9]&&e[10]){n=parseInt(e[10],10)*60;if(e[11]){n+=parseInt(e[11],10)}if(e[9]==="-"){n*=-1}}return{year:e[1],month:e[2],day:e[3],hour:e[4],minute:e[5],second:e[6],millisecond:e[7],tzOffset:n}};var isDayDisabled=function(t,e,a,n){if(t.day===null){return true}if(n!==undefined&&!n.includes(t.day)){return true}if(e&&isBefore(t,e)){return true}if(a&&isAfter(t,a)){return true}return false};var getCalendarDayState=function(t,e,a,n,r,i,o){var s=isSameDay(e,a);var d=isSameDay(e,n);var l=isDayDisabled(e,r,i,o);return{disabled:l,isActive:s,isToday:d,ariaSelected:s?"true":null,ariaLabel:generateDayAriaLabel(t,d,e)}};var datetimeIosCss=':host{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;background:var(--background);overflow:hidden}:host(.datetime-size-fixed){width:auto;max-width:350px;height:auto}:host(.datetime-size-cover){width:100%}:host .calendar-body,:host .datetime-year{opacity:0}:host(:not(.datetime-ready)) .datetime-year{position:absolute;pointer-events:none}:host(.datetime-ready) .calendar-body{opacity:1}:host(.datetime-ready) .datetime-year{display:none;opacity:1}:host .datetime-calendar,:host .datetime-year{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-flow:column;flex-flow:column}:host(.show-month-and-year) .datetime-year{display:-ms-flexbox;display:flex}@supports (background: -webkit-named-image(apple-pay-logo-black)) and (not (aspect-ratio: 1/1)){:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{left:-99999px;position:absolute;visibility:hidden;pointer-events:none}:host-context([dir=rtl]):host(.show-month-and-year) .calendar-next-prev,:host-context([dir=rtl]).show-month-and-year .calendar-next-prev,:host-context([dir=rtl]):host(.show-month-and-year) .calendar-days-of-week,:host-context([dir=rtl]).show-month-and-year .calendar-days-of-week,:host-context([dir=rtl]):host(.show-month-and-year) .calendar-body,:host-context([dir=rtl]).show-month-and-year .calendar-body,:host-context([dir=rtl]):host(.show-month-and-year) .datetime-time,:host-context([dir=rtl]).show-month-and-year .datetime-time{left:unset;right:unset;right:-99999px}}@supports (not (background: -webkit-named-image(apple-pay-logo-black))) or ((background: -webkit-named-image(apple-pay-logo-black)) and (aspect-ratio: 1/1)){:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{display:none}}:host(.datetime-readonly),:host(.datetime-disabled){pointer-events:none}:host(.datetime-disabled){opacity:0.4}:host .datetime-header .datetime-title{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host .datetime-action-buttons.has-clear-button{width:100%}:host .datetime-action-buttons ion-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .calendar-action-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .calendar-action-buttons ion-item,:host .calendar-action-buttons ion-button{--background:translucent}:host .calendar-action-buttons ion-item ion-label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .calendar-action-buttons ion-item ion-icon{padding-left:4px;padding-right:0;padding-top:0;padding-bottom:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host .calendar-action-buttons ion-item ion-icon{padding-left:unset;padding-right:unset;-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0}}:host .calendar-days-of-week{display:grid;grid-template-columns:repeat(7, 1fr);text-align:center}:host .calendar-body{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-x:scroll;overflow-y:hidden;scrollbar-width:none;outline:none}:host .calendar-body .calendar-month{scroll-snap-align:start;scroll-snap-stop:always;-ms-flex-negative:0;flex-shrink:0;width:100%}:host .calendar-body::-webkit-scrollbar{display:none}:host .calendar-body .calendar-month-grid{display:grid;grid-template-columns:repeat(7, 1fr);height:100%}:host .calendar-day{padding-left:0px;padding-right:0px;padding-top:0px;padding-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:0px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;z-index:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host .calendar-day{padding-left:unset;padding-right:unset;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px}}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host .calendar-day{margin-left:unset;margin-right:unset;-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px}}:host .calendar-day[disabled]{pointer-events:none;opacity:0.4}:host .calendar-day:after{border-radius:32px;padding-left:4px;padding-right:4px;padding-top:4px;padding-bottom:4px;left:50%;top:50%;position:absolute;width:32px;height:32px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:" ";z-index:-1}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host .calendar-day:after{padding-left:unset;padding-right:unset;-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px}}:host-context([dir=rtl]){left:unset;right:unset;right:50%}:host .datetime-time{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host(.datetime-presentation-time) .datetime-time{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}:host ion-popover{--height:200px}:host .time-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .time-body{border-radius:8px;padding-left:12px;padding-right:12px;padding-top:6px;padding-bottom:6px;display:-ms-flexbox;display:flex;border:none;background:var(--ion-color-step-300, #edeef0);color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host .time-body{padding-left:unset;padding-right:unset;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px}}:host .time-body-active{color:var(--ion-color-base)}:host(.in-item){position:static}:host(.show-month-and-year) .calendar-action-buttons ion-item{--color:var(--ion-color-base)}:host{--background:var(--ion-color-light, #ffffff);--background-rgb:var(--ion-color-light-rgb);--title-color:var(--ion-color-step-600, #666666)}:host(.datetime-presentation-date-time),:host(.datetime-presentation-time-date),:host(.datetime-presentation-date){min-height:350px}:host .datetime-header{padding-left:16px;padding-right:16px;padding-top:16px;padding-bottom:16px;border-bottom:0.55px solid var(--ion-color-step-200, #cccccc)}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host .datetime-header{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}:host .datetime-header .datetime-title{color:var(--title-color);font-size:14px}:host .calendar-action-buttons ion-item{--padding-start:16px;--background-hover:transparent;--background-activated:transparent;font-size:16px;font-weight:600}:host .calendar-action-buttons ion-item ion-icon,:host .calendar-action-buttons ion-buttons ion-button{color:var(--ion-color-base)}:host .calendar-action-buttons ion-buttons{padding-left:0;padding-right:0;padding-top:8px;padding-bottom:0}:host .calendar-action-buttons ion-buttons ion-button{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}:host .calendar-days-of-week{padding-left:8px;padding-right:8px;padding-top:0;padding-bottom:0;color:var(--ion-color-step-300, #b3b3b3);font-size:12px;font-weight:600;line-height:24px;text-transform:uppercase}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host .calendar-days-of-week{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px}}:host .calendar-body .calendar-month .calendar-month-grid{padding-left:8px;padding-right:8px;padding-top:8px;padding-bottom:8px;height:calc(100% - 16px)}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host .calendar-body .calendar-month .calendar-month-grid{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px}}:host .calendar-day{font-size:20px}:host .calendar-day:after{opacity:0.2}:host .calendar-day:focus:after{background:var(--ion-color-base)}:host .calendar-day.calendar-day-today{color:var(--ion-color-base)}:host .calendar-day.calendar-day-active{color:var(--ion-color-base);font-weight:600}:host .calendar-day.calendar-day-active:after{background:var(--ion-color-base)}:host .calendar-day.calendar-day-today.calendar-day-active{color:var(--ion-color-contrast)}:host .calendar-day.calendar-day-today.calendar-day-active:after{background:var(--ion-color-base);opacity:1}:host .datetime-time{padding-left:16px;padding-right:16px;padding-top:8px;padding-bottom:16px;font-size:16px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host .datetime-time{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}:host .datetime-time .time-header{font-weight:600}:host .datetime-buttons{padding-left:8px;padding-right:8px;padding-top:8px;padding-bottom:8px;border-top:0.55px solid var(--ion-color-step-200, #cccccc)}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host .datetime-buttons{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px}}:host .datetime-buttons ::slotted(ion-buttons),:host .datetime-buttons ion-buttons{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}:host .datetime-action-buttons{width:100%}';var datetimeMdCss=':host{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;background:var(--background);overflow:hidden}:host(.datetime-size-fixed){width:auto;max-width:350px;height:auto}:host(.datetime-size-cover){width:100%}:host .calendar-body,:host .datetime-year{opacity:0}:host(:not(.datetime-ready)) .datetime-year{position:absolute;pointer-events:none}:host(.datetime-ready) .calendar-body{opacity:1}:host(.datetime-ready) .datetime-year{display:none;opacity:1}:host .datetime-calendar,:host .datetime-year{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-flow:column;flex-flow:column}:host(.show-month-and-year) .datetime-year{display:-ms-flexbox;display:flex}@supports (background: -webkit-named-image(apple-pay-logo-black)) and (not (aspect-ratio: 1/1)){:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{left:-99999px;position:absolute;visibility:hidden;pointer-events:none}:host-context([dir=rtl]):host(.show-month-and-year) .calendar-next-prev,:host-context([dir=rtl]).show-month-and-year .calendar-next-prev,:host-context([dir=rtl]):host(.show-month-and-year) .calendar-days-of-week,:host-context([dir=rtl]).show-month-and-year .calendar-days-of-week,:host-context([dir=rtl]):host(.show-month-and-year) .calendar-body,:host-context([dir=rtl]).show-month-and-year .calendar-body,:host-context([dir=rtl]):host(.show-month-and-year) .datetime-time,:host-context([dir=rtl]).show-month-and-year .datetime-time{left:unset;right:unset;right:-99999px}}@supports (not (background: -webkit-named-image(apple-pay-logo-black))) or ((background: -webkit-named-image(apple-pay-logo-black)) and (aspect-ratio: 1/1)){:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{display:none}}:host(.datetime-readonly),:host(.datetime-disabled){pointer-events:none}:host(.datetime-disabled){opacity:0.4}:host .datetime-header .datetime-title{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host .datetime-action-buttons.has-clear-button{width:100%}:host .datetime-action-buttons ion-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .calendar-action-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .calendar-action-buttons ion-item,:host .calendar-action-buttons ion-button{--background:translucent}:host .calendar-action-buttons ion-item ion-label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .calendar-action-buttons ion-item ion-icon{padding-left:4px;padding-right:0;padding-top:0;padding-bottom:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host .calendar-action-buttons ion-item ion-icon{padding-left:unset;padding-right:unset;-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0}}:host .calendar-days-of-week{display:grid;grid-template-columns:repeat(7, 1fr);text-align:center}:host .calendar-body{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-x:scroll;overflow-y:hidden;scrollbar-width:none;outline:none}:host .calendar-body .calendar-month{scroll-snap-align:start;scroll-snap-stop:always;-ms-flex-negative:0;flex-shrink:0;width:100%}:host .calendar-body::-webkit-scrollbar{display:none}:host .calendar-body .calendar-month-grid{display:grid;grid-template-columns:repeat(7, 1fr);height:100%}:host .calendar-day{padding-left:0px;padding-right:0px;padding-top:0px;padding-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:0px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;z-index:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host .calendar-day{padding-left:unset;padding-right:unset;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px}}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host .calendar-day{margin-left:unset;margin-right:unset;-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px}}:host .calendar-day[disabled]{pointer-events:none;opacity:0.4}:host .calendar-day:after{border-radius:32px;padding-left:4px;padding-right:4px;padding-top:4px;padding-bottom:4px;left:50%;top:50%;position:absolute;width:32px;height:32px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:" ";z-index:-1}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host .calendar-day:after{padding-left:unset;padding-right:unset;-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px}}:host-context([dir=rtl]){left:unset;right:unset;right:50%}:host .datetime-time{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host(.datetime-presentation-time) .datetime-time{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}:host ion-popover{--height:200px}:host .time-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .time-body{border-radius:8px;padding-left:12px;padding-right:12px;padding-top:6px;padding-bottom:6px;display:-ms-flexbox;display:flex;border:none;background:var(--ion-color-step-300, #edeef0);color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host .time-body{padding-left:unset;padding-right:unset;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px}}:host .time-body-active{color:var(--ion-color-base)}:host(.in-item){position:static}:host(.show-month-and-year) .calendar-action-buttons ion-item{--color:var(--ion-color-base)}:host{--background:var(--ion-color-step-100, #ffffff);--title-color:var(--ion-color-contrast)}:host .datetime-header{padding-left:20px;padding-right:20px;padding-top:20px;padding-bottom:20px;background:var(--ion-color-base);color:var(--title-color)}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host .datetime-header{padding-left:unset;padding-right:unset;-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:20px;padding-inline-end:20px}}:host .datetime-header .datetime-title{font-size:12px;text-transform:uppercase}:host .datetime-header .datetime-selected-date{margin-top:30px;font-size:34px}:host .datetime-calendar .calendar-action-buttons ion-item{--padding-start:20px}:host .calendar-action-buttons ion-item,:host .calendar-action-buttons ion-button{color:var(--ion-color-step-650, #595959)}:host .calendar-days-of-week{padding-left:10px;padding-right:10px;padding-top:0px;padding-bottom:0px;color:var(--ion-color-step-500, gray);font-size:14px;line-height:36px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host .calendar-days-of-week{padding-left:unset;padding-right:unset;-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px}}:host .calendar-body .calendar-month .calendar-month-grid{padding-left:10px;padding-right:10px;padding-top:3px;padding-bottom:0px;grid-template-rows:repeat(6, 1fr)}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host .calendar-body .calendar-month .calendar-month-grid{padding-left:unset;padding-right:unset;-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px}}:host .calendar-day{padding-left:0px;padding-right:0;padding-top:13px;padding-bottom:13px;font-size:14px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host .calendar-day{padding-left:unset;padding-right:unset;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0;padding-inline-end:0}}:host .calendar-day:focus:after{background:rgba(var(--ion-color-base-rgb), 0.2);-webkit-box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2);box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2)}:host .calendar-day.calendar-day-today{color:var(--ion-color-base)}:host .calendar-day.calendar-day-today:after{border:1px solid var(--ion-color-base)}:host .calendar-day.calendar-day-active{color:var(--ion-color-contrast)}:host .calendar-day.calendar-day-active:after{border:1px solid var(--ion-color-base);background:var(--ion-color-base)}:host .datetime-time{padding-left:16px;padding-right:16px;padding-top:8px;padding-bottom:8px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host .datetime-time{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}:host .time-header{color:var(--ion-color-step-650, #595959)}:host(.datetime-presentation-month) .datetime-year,:host(.datetime-presentation-year) .datetime-year,:host(.datetime-presentation-month-year) .datetime-year{margin-top:20px;margin-bottom:20px}:host .datetime-buttons{padding-left:10px;padding-right:10px;padding-top:10px;padding-bottom:10px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host .datetime-buttons{padding-left:unset;padding-right:unset;-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px}}:host .datetime-view-buttons ion-button{color:var(--ion-color-step-800, #333333)}';var Datetime=function(){function t(t){var e=this;registerInstance(this,t);this.ionCancel=createEvent(this,"ionCancel",7);this.ionChange=createEvent(this,"ionChange",7);this.ionFocus=createEvent(this,"ionFocus",7);this.ionBlur=createEvent(this,"ionBlur",7);this.ionStyle=createEvent(this,"ionStyle",7);this.inputId="ion-dt-"+datetimeIds++;this.overlayIsPresenting=false;this.showMonthAndYear=false;this.activeParts={month:5,day:28,year:2021,hour:13,minute:52,ampm:"pm"};this.workingParts={month:5,day:28,year:2021,hour:13,minute:52,ampm:"pm"};this.todayParts=parseDate(getToday());this.isPresented=false;this.isTimePopoverOpen=false;this.color="primary";this.name=this.inputId;this.disabled=false;this.readonly=false;this.presentation="date-time";this.cancelText="Cancel";this.doneText="Done";this.clearText="Clear";this.locale="default";this.firstDayOfWeek=0;this.showDefaultTitle=false;this.showDefaultButtons=false;this.showClearButton=false;this.showDefaultTimeLabel=true;this.size="fixed";this.closeParentOverlay=function(){var t=e.el.closest("ion-modal, ion-popover");if(t){t.dismiss()}};this.setWorkingParts=function(t){e.workingParts=Object.assign({},t)};this.setActiveParts=function(t){e.activeParts=Object.assign({},t);var a=e.el.querySelector('[slot="buttons"]')!==null;if(a||e.showDefaultButtons){return}e.confirm()};this.initializeKeyboardListeners=function(){var t=e.calendarBodyRef;if(!t){return}var a=e.el.shadowRoot;var n=t.querySelector(".calendar-month:nth-of-type(2)");var r=function(a){var r;var i=a[0];if(((r=i.oldValue)===null||r===void 0?void 0:r.includes("ion-focused"))||!t.classList.contains("ion-focused")){return}e.focusWorkingDay(n)};var i=new MutationObserver(r);i.observe(t,{attributeFilter:["class"],attributeOldValue:true});e.destroyKeyboardMO=function(){i===null||i===void 0?void 0:i.disconnect()};e.calendarBodyRef.addEventListener("keydown",(function(t){var r=a.activeElement;if(!r||!r.classList.contains("calendar-day")){return}var i=getPartsFromCalendarDay(r);var o;switch(t.key){case"ArrowDown":t.preventDefault();o=getNextWeek(i);break;case"ArrowUp":t.preventDefault();o=getPreviousWeek(i);break;case"ArrowRight":t.preventDefault();o=getNextDay(i);break;case"ArrowLeft":t.preventDefault();o=getPreviousDay(i);break;case"Home":t.preventDefault();o=getStartOfWeek(i);break;case"End":t.preventDefault();o=getEndOfWeek(i);break;case"PageUp":t.preventDefault();o=t.shiftKey?getPreviousYear(i):getPreviousMonth(i);break;case"PageDown":t.preventDefault();o=t.shiftKey?getNextYear(i):getNextMonth(i);break;default:return}if(isDayDisabled(o,e.minParts,e.maxParts)){return}e.setWorkingParts(Object.assign(Object.assign({},e.workingParts),o));requestAnimationFrame((function(){return e.focusWorkingDay(n)}))}))};this.focusWorkingDay=function(t){var a=t.querySelectorAll(".calendar-day-padding");var n=e.workingParts.day;if(n===null){return}var r=t.querySelector(".calendar-day:nth-of-type("+(a.length+n)+")");if(r){r.focus()}};this.processMinParts=function(){if(e.min===undefined){e.minParts=undefined;return}var t=parseDate(e.min),a=t.month,n=t.day,r=t.year,i=t.hour,o=t.minute;e.minParts={month:a,day:n,year:r,hour:i,minute:o}};this.processMaxParts=function(){if(e.max===undefined){e.maxParts=undefined;return}var t=parseDate(e.max),a=t.month,n=t.day,r=t.year,i=t.hour,o=t.minute;e.maxParts={month:a,day:n,year:r,hour:i,minute:o}};this.initializeCalendarIOListeners=function(){var t=e.calendarBodyRef;if(!t){return}var a=getIonMode(e);var n=t.querySelectorAll(".calendar-month");var r=n[0];var i=n[1];var o=n[2];writeTask((function(){t.scrollLeft=r.clientWidth*(isRTL(e.el)?-1:1);var n;var s;var d=function(d,l){var u=d==="start"?s:n;var p=d==="start"?r:o;var c=d==="start"?getPreviousMonth:getNextMonth;var h=l[0];if(!h.isIntersecting){return}if(e.overlayIsPresenting){e.overlayIsPresenting=false;return}if(a==="ios"){var m=h.intersectionRatio;var f=Math.abs(m-.7)<=.1;if(f){t.style.setProperty("pointer-events","none");return}}t.style.setProperty("overflow","hidden");if(u===undefined){return}u.disconnect();writeTask((function(){var a=c(e.workingParts),n=a.month,r=a.year,o=a.day;e.setWorkingParts(Object.assign(Object.assign({},e.workingParts),{month:n,day:o,year:r}));t.scrollLeft=i.clientWidth*(isRTL(e.el)?-1:1);t.style.removeProperty("overflow");t.style.removeProperty("pointer-events");if(u===undefined){return}u.observe(p)}))};n=new IntersectionObserver((function(t){return d("end",t)}),{threshold:a==="ios"?[.7,1]:1,root:t});n.observe(o);s=new IntersectionObserver((function(t){return d("start",t)}),{threshold:a==="ios"?[.7,1]:1,root:t});s.observe(r);e.destroyCalendarIO=function(){n===null||n===void 0?void 0:n.disconnect();s===null||s===void 0?void 0:s.disconnect()}}))};this.destroyListeners=function(){var t=e,a=t.destroyCalendarIO,n=t.destroyKeyboardMO;if(a!==undefined){a()}if(n!==undefined){n()}};this.initializeOverlayListener=function(){var t=e.el.closest("ion-popover, ion-modal");if(t===null){return}t.addEventListener("willPresent",(function(){e.overlayIsPresenting=true}))};this.processValue=function(t){var a=t||getToday();var n=parseDate(a),r=n.month,i=n.day,o=n.year,s=n.hour,d=n.minute,l=n.tzOffset;e.workingParts={month:r,day:i,year:o,hour:s,minute:d,tzOffset:l,ampm:s>=12?"pm":"am"};e.activeParts={month:r,day:i,year:o,hour:s,minute:d,tzOffset:l,ampm:s>=12?"pm":"am"}};this.onFocus=function(){e.ionFocus.emit()};this.onBlur=function(){e.ionBlur.emit()};this.hasValue=function(){return e.value!=null&&e.value!==""};this.nextMonth=function(){var t=e.calendarBodyRef;if(!t){return}var a=t.querySelector(".calendar-month:last-of-type");if(!a){return}var n=a.offsetWidth*2;t.scrollTo({top:0,left:n*(isRTL(e.el)?-1:1),behavior:"smooth"})};this.prevMonth=function(){var t=e.calendarBodyRef;if(!t){return}var a=t.querySelector(".calendar-month:first-of-type");if(!a){return}t.scrollTo({top:0,left:0,behavior:"smooth"})};this.toggleMonthAndYearView=function(){e.showMonthAndYear=!e.showMonthAndYear}}t.prototype.disabledChanged=function(){this.emitStyle()};t.prototype.minChanged=function(){this.processMinParts()};t.prototype.maxChanged=function(){this.processMaxParts()};t.prototype.yearValuesChanged=function(){this.parsedYearValues=convertToArrayOfNumbers(this.yearValues)};t.prototype.monthValuesChanged=function(){this.parsedMonthValues=convertToArrayOfNumbers(this.monthValues)};t.prototype.dayValuesChanged=function(){this.parsedDayValues=convertToArrayOfNumbers(this.dayValues)};t.prototype.hourValuesChanged=function(){this.parsedHourValues=convertToArrayOfNumbers(this.hourValues)};t.prototype.minuteValuesChanged=function(){this.parsedMinuteValues=convertToArrayOfNumbers(this.minuteValues)};t.prototype.activePartsChanged=function(){this.activePartsClone=this.activeParts};t.prototype.valueChanged=function(){if(this.hasValue()){var t=parseDate(this.value),e=t.month,a=t.day,n=t.year,r=t.hour,i=t.minute;this.activePartsClone=Object.assign(Object.assign({},this.activeParts),{month:e,day:a,year:n,hour:r,minute:i})}this.emitStyle();this.ionChange.emit({value:this.value})};t.prototype.confirm=function(t){if(t===void 0){t=false}return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(a){e=new Date(convertDataToISO(this.workingParts));this.workingParts.tzOffset=e.getTimezoneOffset()*-1;this.value=convertDataToISO(this.workingParts);if(t){this.closeParentOverlay()}return[2]}))}))};t.prototype.reset=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.processValue(t);return[2]}))}))};t.prototype.cancel=function(t){if(t===void 0){t=false}return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.ionCancel.emit();if(t){this.closeParentOverlay()}return[2]}))}))};t.prototype.connectedCallback=function(){this.clearFocusVisible=startFocusVisible(this.el).destroy};t.prototype.disconnectedCallback=function(){if(this.clearFocusVisible){this.clearFocusVisible();this.clearFocusVisible=undefined}};t.prototype.componentDidLoad=function(){var t=this;var e;var a=function(e){var a=e[0];if(!a.isIntersecting){return}t.initializeCalendarIOListeners();t.initializeKeyboardListeners();t.initializeOverlayListener();writeTask((function(){t.el.classList.add("datetime-ready")}))};e=new IntersectionObserver(a,{threshold:.01});raf((function(){return e===null||e===void 0?void 0:e.observe(t.el)}));var n;var r=function(e){var a=e[0];if(a.isIntersecting){return}t.destroyListeners();writeTask((function(){t.el.classList.remove("datetime-ready")}))};n=new IntersectionObserver(r,{threshold:0});raf((function(){return n===null||n===void 0?void 0:n.observe(t.el)}));var i=getElementRoot(this.el);i.addEventListener("ionFocus",(function(t){return t.stopPropagation()}));i.addEventListener("ionBlur",(function(t){return t.stopPropagation()}))};t.prototype.componentWillLoad=function(){this.processValue(this.value);this.processMinParts();this.processMaxParts();this.parsedHourValues=convertToArrayOfNumbers(this.hourValues);this.parsedMinuteValues=convertToArrayOfNumbers(this.minuteValues);this.parsedMonthValues=convertToArrayOfNumbers(this.monthValues);this.parsedYearValues=convertToArrayOfNumbers(this.yearValues);this.parsedDayValues=convertToArrayOfNumbers(this.dayValues);this.emitStyle()};t.prototype.emitStyle=function(){this.ionStyle.emit({interactive:true,datetime:true,"interactive-disabled":this.disabled})};t.prototype.renderFooter=function(){var t;var e=this;var a=this,n=a.showDefaultButtons,r=a.showClearButton;var i=this.el.querySelector('[slot="buttons"]')!==null;if(!i&&!n&&!r){return}var o=function(){e.reset();e.value=undefined};return h("div",{class:"datetime-footer"},h("div",{class:"datetime-buttons"},h("div",{class:(t={},t["datetime-action-buttons"]=true,t["has-clear-button"]=this.showClearButton,t)},h("slot",{name:"buttons"},h("ion-buttons",null,n&&h("ion-button",{id:"cancel-button",color:this.color,onClick:function(){return e.cancel(true)}},this.cancelText),h("div",null,r&&h("ion-button",{id:"clear-button",color:this.color,onClick:function(){return o()}},this.clearText),n&&h("ion-button",{id:"confirm-button",color:this.color,onClick:function(){return e.confirm(true)}},this.doneText)))))))};t.prototype.renderYearView=function(){var t=this;var e=this,a=e.presentation,n=e.workingParts;var r=getCalendarYears(this.todayParts,this.minParts,this.maxParts,this.parsedYearValues);var i=a!=="year";var o=a!=="month";var s=getPickerMonths(this.locale,n,this.minParts,this.maxParts,this.parsedMonthValues);var d=r.map((function(t){return{text:""+t,value:t}}));return h("div",{class:"datetime-year"},h("div",{class:"datetime-year-body"},h("ion-picker-internal",null,i&&h("ion-picker-column-internal",{color:this.color,items:s,value:n.month,onIonChange:function(e){t.setWorkingParts(Object.assign(Object.assign({},t.workingParts),{month:e.detail.value}));if(a==="month"||a==="month-year"){t.setActiveParts(Object.assign(Object.assign({},t.activeParts),{month:e.detail.value}))}e.stopPropagation()}}),o&&h("ion-picker-column-internal",{color:this.color,items:d,value:n.year,onIonChange:function(e){t.setWorkingParts(Object.assign(Object.assign({},t.workingParts),{year:e.detail.value}));if(a==="year"||a==="month-year"){t.setActiveParts(Object.assign(Object.assign({},t.activeParts),{year:e.detail.value}))}e.stopPropagation()}}))))};t.prototype.renderCalendarHeader=function(t){var e=this;var a=t==="ios"?chevronDown:caretUpSharp;var n=t==="ios"?chevronForward:caretDownSharp;return h("div",{class:"calendar-header"},h("div",{class:"calendar-action-buttons"},h("div",{class:"calendar-month-year"},h("ion-item",{button:true,detail:false,lines:"none",onClick:function(){return e.toggleMonthAndYearView()}},h("ion-label",null,getMonthAndYear(this.locale,this.workingParts)," ",h("ion-icon",{icon:this.showMonthAndYear?a:n,lazy:false})))),h("div",{class:"calendar-next-prev"},h("ion-buttons",null,h("ion-button",{onClick:function(){return e.prevMonth()}},h("ion-icon",{slot:"icon-only",icon:chevronBack,lazy:false,flipRtl:true})),h("ion-button",{onClick:function(){return e.nextMonth()}},h("ion-icon",{slot:"icon-only",icon:chevronForward,lazy:false,flipRtl:true}))))),h("div",{class:"calendar-days-of-week"},getDaysOfWeek(this.locale,t,this.firstDayOfWeek%7).map((function(t){return h("div",{class:"day-of-week"},t)}))))};t.prototype.renderMonth=function(t,e){var a=this;var n=this.parsedYearValues===undefined||this.parsedYearValues.includes(e);var r=this.parsedMonthValues===undefined||this.parsedMonthValues.includes(t);var i=!n||!r;return h("div",{class:"calendar-month"},h("div",{class:"calendar-month-grid"},getDaysOfMonth(t,e,this.firstDayOfWeek%7).map((function(n,r){var o=n.day,s=n.dayOfWeek;var d={month:t,day:o,year:e};var l=getCalendarDayState(a.locale,d,a.activePartsClone,a.todayParts,a.minParts,a.maxParts,a.parsedDayValues),u=l.isActive,p=l.isToday,c=l.ariaLabel,m=l.ariaSelected,f=l.disabled;return h("button",{tabindex:"-1","data-day":o,"data-month":t,"data-year":e,"data-index":r,"data-day-of-week":s,disabled:i||f,class:{"calendar-day-padding":o===null,"calendar-day":true,"calendar-day-active":u,"calendar-day-today":p},"aria-selected":m,"aria-label":c,onClick:function(){if(o===null){return}a.setWorkingParts(Object.assign(Object.assign({},a.workingParts),{month:t,day:o,year:e}));a.setActiveParts(Object.assign(Object.assign({},a.activeParts),{month:t,day:o,year:e}))}},o)}))))};t.prototype.renderCalendarBody=function(){var t=this;return h("div",{class:"calendar-body ion-focusable",ref:function(e){return t.calendarBodyRef=e},tabindex:"0"},generateMonths(this.workingParts).map((function(e){var a=e.month,n=e.year;return t.renderMonth(a,n)})))};t.prototype.renderCalendar=function(t){return h("div",{class:"datetime-calendar"},this.renderCalendarHeader(t),this.renderCalendarBody())};t.prototype.renderTimeLabel=function(){var t=this.el.querySelector('[slot="time-label"]')!==null;if(!t&&!this.showDefaultTimeLabel){return}return h("slot",{name:"time-label"},"Time")};t.prototype.renderTimePicker=function(t,e,a,n){var r=this;var i=this,o=i.color,s=i.activePartsClone,d=i.workingParts;return h("ion-picker-internal",null,h("ion-picker-column-internal",{color:o,value:s.hour,items:t,numericInput:true,onIonChange:function(t){r.setWorkingParts(Object.assign(Object.assign({},d),{hour:t.detail.value}));r.setActiveParts(Object.assign(Object.assign({},s),{hour:t.detail.value}));t.stopPropagation()}}),h("ion-picker-column-internal",{color:o,value:s.minute,items:e,numericInput:true,onIonChange:function(t){r.setWorkingParts(Object.assign(Object.assign({},d),{minute:t.detail.value}));r.setActiveParts(Object.assign(Object.assign({},s),{minute:t.detail.value}));t.stopPropagation()}}),!n&&h("ion-picker-column-internal",{color:o,value:s.ampm,items:a,onIonChange:function(t){var e=calculateHourFromAMPM(d,t.detail.value);r.setWorkingParts(Object.assign(Object.assign({},d),{ampm:t.detail.value,hour:e}));r.setActiveParts(Object.assign(Object.assign({},s),{ampm:t.detail.value,hour:e}));t.stopPropagation()}}))};t.prototype.renderTimeOverlay=function(t,e,a,n){var r=this;return[h("div",{class:"time-header"},this.renderTimeLabel()),h("button",{class:{"time-body":true,"time-body-active":this.isTimePopoverOpen},"aria-expanded":"false","aria-haspopup":"true",onClick:function(t){return __awaiter(r,void 0,void 0,(function(){var e;return __generator(this,(function(a){switch(a.label){case 0:e=this.popoverRef;if(!e)return[3,2];this.isTimePopoverOpen=true;e.present(new CustomEvent("ionShadowTarget",{detail:{ionShadowTarget:t.target}}));return[4,e.onWillDismiss()];case 1:a.sent();this.isTimePopoverOpen=false;a.label=2;case 2:return[2]}}))}))}},getFormattedTime(this.activePartsClone,n)),h("ion-popover",{alignment:"center",translucent:true,overlayIndex:1,arrow:false,onWillPresent:function(t){var e=t.target.querySelectorAll("ion-picker-column-internal");e.forEach((function(t){return t.scrollActiveItemIntoView()}))},style:{"--offset-y":"-10px"},keyboardEvents:true,ref:function(t){return r.popoverRef=t}},this.renderTimePicker(t,e,a,n))]};t.prototype.renderTime=function(){var t=this,e=t.workingParts,a=t.presentation;var n=a==="time";var r=is24Hour(this.locale,this.hourCycle);var i=generateTime(this.workingParts,r?"h23":"h12",this.minParts,this.maxParts,this.parsedHourValues,this.parsedMinuteValues),o=i.hours,s=i.minutes,d=i.am,l=i.pm;var u=o.map((function(t){return{text:getFormattedHour(t,r),value:getInternalHourValue(t,r,e.ampm)}}));var p=s.map((function(t){return{text:addTimePadding(t),value:t}}));var c=[];if(d){c.push({text:"AM",value:"am"})}if(l){c.push({text:"PM",value:"pm"})}return h("div",{class:"datetime-time"},n?this.renderTimePicker(u,p,c,r):this.renderTimeOverlay(u,p,c,r))};t.prototype.renderCalendarViewHeader=function(t){var e=this.el.querySelector('[slot="title"]')!==null;if(!e&&!this.showDefaultTitle){return}return h("div",{class:"datetime-header"},h("div",{class:"datetime-title"},h("slot",{name:"title"},"Select Date")),t==="md"&&h("div",{class:"datetime-selected-date"},getMonthAndDay(this.locale,this.activeParts)))};t.prototype.renderDatetime=function(t){var e=this.presentation;switch(e){case"date-time":return[this.renderCalendarViewHeader(t),this.renderCalendar(t),this.renderYearView(),this.renderTime(),this.renderFooter()];case"time-date":return[this.renderCalendarViewHeader(t),this.renderTime(),this.renderCalendar(t),this.renderYearView(),this.renderFooter()];case"time":return[this.renderTime(),this.renderFooter()];case"month":case"month-year":case"year":return[this.renderYearView(),this.renderFooter()];default:return[this.renderCalendarViewHeader(t),this.renderCalendar(t),this.renderYearView(),this.renderFooter()]}};t.prototype.render=function(){var t;var e=this,a=e.name,n=e.value,r=e.disabled,i=e.el,o=e.color,s=e.isPresented,d=e.readonly,l=e.showMonthAndYear,u=e.presentation,p=e.size;var c=getIonMode(this);var m=u==="year"||u==="month"||u==="month-year";var f=l||m;renderHiddenInput(true,i,a,n,r);return h(Host,{"aria-disabled":r?"true":null,onFocus:this.onFocus,onBlur:this.onBlur,class:Object.assign({},createColorClasses(o,(t={},t[c]=true,t["datetime-presented"]=s,t["datetime-readonly"]=d,t["datetime-disabled"]=r,t["show-month-and-year"]=f,t["datetime-presentation-"+u]=true,t["datetime-size-"+p]=true,t)))},this.renderDatetime(c))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{disabled:["disabledChanged"],min:["minChanged"],max:["maxChanged"],yearValues:["yearValuesChanged"],monthValues:["monthValuesChanged"],dayValues:["dayValuesChanged"],hourValues:["hourValuesChanged"],minuteValues:["minuteValuesChanged"],activeParts:["activePartsChanged"],value:["valueChanged"]}},enumerable:false,configurable:true});return t}();var datetimeIds=0;Datetime.style={ios:datetimeIosCss,md:datetimeMdCss};export{Datetime as ion_datetime};