-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path4959.a15de6678e093036.js
1 lines (1 loc) · 66.6 KB
/
4959.a15de6678e093036.js
1
"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[4959],{4959:(st,V,y)=>{y.r(V),y.d(V,{ion_datetime:()=>W,ion_picker:()=>F,ion_picker_column:()=>R});var w=y(5861),a=y(7205),D=y(9358),A=y(5729),$=y(1112),P=y(3756),O=y(4147),E=y(5062),_=y(2854),o=y(1479),v=y(3280),M=y(9442),T=y(7683);const L=(t,e,i,n)=>!!(null===t.day||void 0!==n&&!n.includes(t.day)||e&&(0,o.i)(t,e)||i&&(0,o.a)(t,i)),j=(t,{minParts:e,maxParts:i})=>!!(((t,e,i)=>!!(e&&e.year>t||i&&i.year<t))(t.year,e,i)||e&&(0,o.i)(t,e)||i&&(0,o.a)(t,i)),W=class{constructor(t){(0,a.r)(this,t),this.ionCancel=(0,a.e)(this,"ionCancel",7),this.ionChange=(0,a.e)(this,"ionChange",7),this.ionFocus=(0,a.e)(this,"ionFocus",7),this.ionBlur=(0,a.e)(this,"ionBlur",7),this.ionStyle=(0,a.e)(this,"ionStyle",7),this.ionRender=(0,a.e)(this,"ionRender",7),this.inputId="ion-dt-"+J++,this.highlightActiveParts=!1,this.todayParts=(0,o.p)((0,o.e)()),this.prevPresentation=null,this.showMonthAndYear=!1,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.isPresented=!1,this.isTimePopoverOpen=!1,this.color="primary",this.name=this.inputId,this.disabled=!1,this.readonly=!1,this.presentation="date-time",this.cancelText="Cancel",this.doneText="Done",this.clearText="Clear",this.locale="default",this.firstDayOfWeek=0,this.multiple=!1,this.showDefaultTitle=!1,this.showDefaultButtons=!1,this.showClearButton=!1,this.showDefaultTimeLabel=!0,this.size="fixed",this.preferWheel=!1,this.closeParentOverlay=()=>{const e=this.el.closest("ion-modal, ion-popover");e&&e.dismiss()},this.setWorkingParts=e=>{this.workingParts=Object.assign({},e)},this.setActiveParts=(e,i=!1)=>{const{multiple:n,activePartsClone:r,highlightActiveParts:s}=this;if(n){const d=Array.isArray(r)?r:[r];this.activeParts=i?d.filter(h=>!(0,o.b)(h,e)):s?[...d,e]:[e]}else this.activeParts=Object.assign({},e);this.highlightActiveParts=!0,null===this.el.querySelector('[slot="buttons"]')&&!this.showDefaultButtons&&this.confirm()},this.getCalendarBodyEl=()=>{var e;return this.calendarBodyRef||(null===(e=this.el.shadowRoot)||void 0===e?void 0:e.querySelector(".calendar-body"))},this.initializeKeyboardListeners=()=>{const e=this.getCalendarBodyEl();if(!e)return;const i=this.el.shadowRoot,n=e.querySelector(".calendar-month:nth-of-type(2)"),s=new MutationObserver(l=>{var d;(null===(d=l[0].oldValue)||void 0===d?void 0:d.includes("ion-focused"))||!e.classList.contains("ion-focused")||this.focusWorkingDay(n)});s.observe(e,{attributeFilter:["class"],attributeOldValue:!0}),this.destroyKeyboardMO=()=>{s?.disconnect()},e.addEventListener("keydown",l=>{const d=i.activeElement;if(!d||!d.classList.contains("calendar-day"))return;const h=(0,o.f)(d);let c;switch(l.key){case"ArrowDown":l.preventDefault(),c=(0,o.n)(h);break;case"ArrowUp":l.preventDefault(),c=(0,o.m)(h);break;case"ArrowRight":l.preventDefault(),c=(0,o.l)(h);break;case"ArrowLeft":l.preventDefault(),c=(0,o.k)(h);break;case"Home":l.preventDefault(),c=(0,o.j)(h);break;case"End":l.preventDefault(),c=(0,o.h)(h);break;case"PageUp":l.preventDefault(),c=l.shiftKey?(0,o.I)(h):(0,o.c)(h);break;case"PageDown":l.preventDefault(),c=l.shiftKey?(0,o.H)(h):(0,o.d)(h);break;default:return}L(c,this.minParts,this.maxParts)||(this.setWorkingParts(Object.assign(Object.assign({},this.workingParts),c)),requestAnimationFrame(()=>this.focusWorkingDay(n)))})},this.focusWorkingDay=e=>{const i=e.querySelectorAll(".calendar-day-padding"),{day:n}=this.workingParts;if(null===n)return;const r=e.querySelector(`.calendar-day:nth-of-type(${i.length+n})`);r&&r.focus()},this.processMinParts=()=>{if(void 0===this.min)return void(this.minParts=void 0);const{month:e,day:i,year:n,hour:r,minute:s}=(0,o.p)(this.min);this.minParts={month:e,day:i,year:n,hour:r,minute:s}},this.processMaxParts=()=>{if(void 0===this.max)return void(this.maxParts=void 0);const{month:e,day:i,year:n,hour:r,minute:s}=(0,o.p)(this.max);this.maxParts={month:e,day:i,year:n,hour:r,minute:s}},this.initializeCalendarListener=()=>{const e=this.getCalendarBodyEl();if(!e)return;const i=e.querySelectorAll(".calendar-month"),n=i[0],r=i[1],s=i[2],d="ios"===(0,A.b)(this)&&typeof navigator<"u"&&navigator.maxTouchPoints>1;(0,a.c)(()=>{e.scrollLeft=n.clientWidth*((0,E.i)(this.el)?-1:1);const h=u=>{const g=e.getBoundingClientRect(),x=this.el.shadowRoot.elementFromPoint(g.x+g.width/2,g.y+g.height/2);if(!x)return;const k=x.closest(".calendar-month");if(!k)return;const C=k.getBoundingClientRect();return Math.abs(C.x-g.x)>2?void 0:k===n?(0,o.c)(u):k===s?(0,o.d)(u):void 0},c=()=>{d&&(e.style.removeProperty("pointer-events"),m=!1);const u=h(this.workingParts);if(!u)return;const{month:g,day:f,year:x}=u;j({month:g,year:x,day:null},{minParts:Object.assign(Object.assign({},this.minParts),{day:null}),maxParts:Object.assign(Object.assign({},this.maxParts),{day:null})})||(e.style.setProperty("overflow","hidden"),(0,a.c)(()=>{this.setWorkingParts(Object.assign(Object.assign({},this.workingParts),{month:g,day:f,year:x})),e.scrollLeft=r.clientWidth*((0,E.i)(this.el)?-1:1),e.style.removeProperty("overflow")}))};let p,m=!1;const b=()=>{p&&clearTimeout(p),!m&&d&&(e.style.setProperty("pointer-events","none"),m=!0),p=setTimeout(c,50)};e.addEventListener("scroll",b),this.destroyCalendarListener=()=>{e.removeEventListener("scroll",b)}})},this.destroyInteractionListeners=()=>{const{destroyCalendarListener:e,destroyKeyboardMO:i}=this;void 0!==e&&e(),void 0!==i&&i()},this.processValue=e=>{this.highlightActiveParts=!!e;let i=(0,o.p)(e||(0,o.e)());const{minParts:n,maxParts:r,multiple:s}=this;!s&&Array.isArray(e)&&(this.value=e[0],i=i[0]),(0,o.w)(i,n,r);const l=Array.isArray(i)?i[0]:i,{month:d,day:h,year:c,hour:p,minute:m,tzOffset:b}=(0,o.J)(l,n,r),u=(0,o.K)(p);this.setWorkingParts({month:d,day:h,year:c,hour:p,minute:m,tzOffset:b,ampm:u}),this.activeParts=Array.isArray(i)?[...i]:{month:d,day:h,year:c,hour:p,minute:m,tzOffset:b,ampm:u}},this.onFocus=()=>{this.ionFocus.emit()},this.onBlur=()=>{this.ionBlur.emit()},this.hasValue=()=>null!=this.value&&""!==this.value,this.nextMonth=()=>{const e=this.getCalendarBodyEl();if(!e)return;const i=e.querySelector(".calendar-month:last-of-type");i&&e.scrollTo({top:0,left:2*i.offsetWidth*((0,E.i)(this.el)?-1:1),behavior:"smooth"})},this.prevMonth=()=>{const e=this.getCalendarBodyEl();!e||!e.querySelector(".calendar-month:first-of-type")||e.scrollTo({top:0,left:0,behavior:"smooth"})},this.toggleMonthAndYearView=()=>{this.showMonthAndYear=!this.showMonthAndYear}}disabledChanged(){this.emitStyle()}minChanged(){this.processMinParts()}maxChanged(){this.processMaxParts()}yearValuesChanged(){this.parsedYearValues=(0,o.o)(this.yearValues)}monthValuesChanged(){this.parsedMonthValues=(0,o.o)(this.monthValues)}dayValuesChanged(){this.parsedDayValues=(0,o.o)(this.dayValues)}hourValuesChanged(){this.parsedHourValues=(0,o.o)(this.hourValues)}minuteValuesChanged(){this.parsedMinuteValues=(0,o.o)(this.minuteValues)}activePartsChanged(){this.activePartsClone=this.activeParts}valueChanged(){const{value:t,minParts:e,maxParts:i,workingParts:n,multiple:r}=this;if(this.hasValue()){if(!r&&Array.isArray(t))return void(this.value=t[0]);const s=(0,o.p)(t);if(s)if((0,o.w)(s,e,i),Array.isArray(s))this.activePartsClone=[...s];else{const{month:l,day:d,year:h,hour:c,minute:p}=s,m=c?c>=12?"pm":"am":void 0;this.activePartsClone=Object.assign(Object.assign({},this.activeParts),{month:l,day:d,year:h,hour:c,minute:p,ampm:m}),this.setWorkingParts(Object.assign(Object.assign({},n),{ampm:m}))}else(0,O.p)(`Unable to parse date string: ${t}. Please provide a valid ISO 8601 datetime string.`)}this.emitStyle(),this.ionChange.emit({value:t})}confirm(t=!1){var e=this;return(0,w.Z)(function*(){const{highlightActiveParts:i,isCalendarPicker:n,activeParts:r}=e;if(i||!n){const s=Array.isArray(r);if(s&&0===r.length)e.value=void 0;else{if(s){const l=(0,o.q)(r).map(d=>new Date(d));for(let d=0;d<l.length;d++)r[d].tzOffset=-1*l[d].getTimezoneOffset()}else{const l=new Date((0,o.q)(r));r.tzOffset=-1*l.getTimezoneOffset()}e.value=(0,o.q)(r)}}t&&e.closeParentOverlay()})()}reset(t){var e=this;return(0,w.Z)(function*(){e.processValue(t)})()}cancel(t=!1){var e=this;return(0,w.Z)(function*(){e.ionCancel.emit(),t&&e.closeParentOverlay()})()}get isCalendarPicker(){const{presentation:t}=this;return"date"===t||"date-time"===t||"time-date"===t}connectedCallback(){this.clearFocusVisible=(0,$.startFocusVisible)(this.el).destroy}disconnectedCallback(){this.clearFocusVisible&&(this.clearFocusVisible(),this.clearFocusVisible=void 0)}initializeListeners(){this.initializeCalendarListener(),this.initializeKeyboardListeners()}componentDidLoad(){const e=new IntersectionObserver(s=>{!s[0].isIntersecting||(this.initializeListeners(),(0,a.c)(()=>{this.el.classList.add("datetime-ready")}))},{threshold:.01});(0,P.r)(()=>e?.observe(this.el));const n=new IntersectionObserver(s=>{s[0].isIntersecting||(this.destroyInteractionListeners(),(0,a.c)(()=>{this.el.classList.remove("datetime-ready")}))},{threshold:0});(0,P.r)(()=>n?.observe(this.el));const r=(0,P.g)(this.el);r.addEventListener("ionFocus",s=>s.stopPropagation()),r.addEventListener("ionBlur",s=>s.stopPropagation())}componentDidRender(){const{presentation:t,prevPresentation:e}=this;null!==e?t!==e&&(this.prevPresentation=t,this.destroyInteractionListeners(),this.initializeListeners(),this.showMonthAndYear=!1,(0,P.r)(()=>{this.ionRender.emit()})):this.prevPresentation=t}componentWillLoad(){const{el:t,multiple:e,presentation:i,preferWheel:n}=this;e&&("date"!==i&&(0,O.p)('Multiple date selection is only supported for presentation="date".',t),n&&(0,O.p)('Multiple date selection is not supported with preferWheel="true".',t)),this.processMinParts(),this.processMaxParts(),this.processValue(this.value),this.parsedHourValues=(0,o.o)(this.hourValues),this.parsedMinuteValues=(0,o.o)(this.minuteValues),this.parsedMonthValues=(0,o.o)(this.monthValues),this.parsedYearValues=(0,o.o)(this.yearValues),this.parsedDayValues=(0,o.o)(this.dayValues),this.emitStyle()}emitStyle(){this.ionStyle.emit({interactive:!0,datetime:!0,"interactive-disabled":this.disabled})}renderFooter(){const{showDefaultButtons:t,showClearButton:e}=this;if(null===this.el.querySelector('[slot="buttons"]')&&!t&&!e)return;const n=()=>{this.reset(),this.value=void 0};return(0,a.h)("div",{class:"datetime-footer"},(0,a.h)("div",{class:"datetime-buttons"},(0,a.h)("div",{class:{"datetime-action-buttons":!0,"has-clear-button":this.showClearButton}},(0,a.h)("slot",{name:"buttons"},(0,a.h)("ion-buttons",null,t&&(0,a.h)("ion-button",{id:"cancel-button",color:this.color,onClick:()=>this.cancel(!0)},this.cancelText),(0,a.h)("div",null,e&&(0,a.h)("ion-button",{id:"clear-button",color:this.color,onClick:()=>n()},this.clearText),t&&(0,a.h)("ion-button",{id:"confirm-button",color:this.color,onClick:()=>this.confirm(!0)},this.doneText)))))))}renderWheelPicker(t=this.presentation){const e="time-date"===t?[this.renderTimePickerColumns(t),this.renderDatePickerColumns(t)]:[this.renderDatePickerColumns(t),this.renderTimePickerColumns(t)];return(0,a.h)("ion-picker-internal",null,e)}renderDatePickerColumns(t){return"date-time"===t||"time-date"===t?this.renderCombinedDatePickerColumn():this.renderIndividualDatePickerColumns(t)}renderCombinedDatePickerColumn(){const{activeParts:t,workingParts:e,locale:i,minParts:n,maxParts:r,todayParts:s,isDateEnabled:l}=this,d=(0,o.C)(e);for(let g=0;g<=d.length-1;g++)d[g].day=null;const p=(0,o.r)(i,e,s,n||d[0],r||d[d.length-1],this.parsedDayValues,this.parsedMonthValues);let m=p.items;const b=p.parts;return l&&(m=m.map((g,f)=>{const x=b[f];let k;try{k=!l((0,o.q)(x))}catch(C){(0,O.b)("Exception thrown from provided `isDateEnabled` function. Please check your function and try again.",C)}return Object.assign(Object.assign({},g),{disabled:k})})),(0,a.h)("ion-picker-column-internal",{class:"date-column",color:this.color,items:m,value:e.day?`${e.year}-${e.month}-${e.day}`:`${s.year}-${s.month}-${s.day}`,onIonChange:g=>{this.destroyCalendarListener&&this.destroyCalendarListener();const{value:f}=g.detail,x=b.find(({month:k,day:C,year:z})=>f===`${z}-${k}-${C}`);this.setWorkingParts(Object.assign(Object.assign({},e),x)),Array.isArray(t)||this.setActiveParts(Object.assign(Object.assign({},t),x)),this.initializeCalendarListener(),g.stopPropagation()}})}renderIndividualDatePickerColumns(t){const{workingParts:e,isDateEnabled:i}=this,r="year"!==t&&"time"!==t?(0,o.s)(this.locale,e,this.minParts,this.maxParts,this.parsedMonthValues):[];let l="date"===t?(0,o.t)(this.locale,e,this.minParts,this.maxParts,this.parsedDayValues):[];i&&(l=l.map(c=>{const{value:p}=c,m="string"==typeof p?parseInt(p):p,b={month:e.month,day:m,year:e.year};let u;try{u=!i((0,o.q)(b))}catch(g){(0,O.b)("Exception thrown from provided `isDateEnabled` function. Please check your function and try again.",g)}return Object.assign(Object.assign({},c),{disabled:u})}));const h="month"!==t&&"time"!==t?(0,o.u)(this.todayParts,this.minParts,this.maxParts,this.parsedYearValues):[];return[this.renderMonthPickerColumn(r),this.renderDayPickerColumn(l),this.renderYearPickerColumn(h)]}renderDayPickerColumn(t){var e;if(0===t.length)return[];const{activeParts:i,workingParts:n}=this;return(0,a.h)("ion-picker-column-internal",{class:"day-column",color:this.color,items:t,value:null!==(e=n.day||this.todayParts.day)&&void 0!==e?e:void 0,onIonChange:r=>{this.destroyCalendarListener&&this.destroyCalendarListener(),this.setWorkingParts(Object.assign(Object.assign({},n),{day:r.detail.value})),Array.isArray(i)||this.setActiveParts(Object.assign(Object.assign({},i),{day:r.detail.value})),this.initializeCalendarListener(),r.stopPropagation()}})}renderMonthPickerColumn(t){if(0===t.length)return[];const{activeParts:e,workingParts:i}=this;return(0,a.h)("ion-picker-column-internal",{class:"month-column",color:this.color,items:t,value:i.month,onIonChange:n=>{this.destroyCalendarListener&&this.destroyCalendarListener(),this.setWorkingParts(Object.assign(Object.assign({},i),{month:n.detail.value})),Array.isArray(e)||this.setActiveParts(Object.assign(Object.assign({},e),{month:n.detail.value})),this.initializeCalendarListener(),n.stopPropagation()}})}renderYearPickerColumn(t){if(0===t.length)return[];const{activeParts:e,workingParts:i}=this;return(0,a.h)("ion-picker-column-internal",{class:"year-column",color:this.color,items:t,value:i.year,onIonChange:n=>{this.destroyCalendarListener&&this.destroyCalendarListener(),this.setWorkingParts(Object.assign(Object.assign({},i),{year:n.detail.value})),Array.isArray(e)||this.setActiveParts(Object.assign(Object.assign({},e),{year:n.detail.value})),this.initializeCalendarListener(),n.stopPropagation()}})}renderTimePickerColumns(t){if(["date","month","month-year","year"].includes(t))return[];const{hoursData:e,minutesData:i,dayPeriodData:n}=(0,o.v)(this.locale,this.workingParts,this.hourCycle,this.value?this.minParts:void 0,this.value?this.maxParts:void 0,this.parsedHourValues,this.parsedMinuteValues);return[this.renderHourPickerColumn(e),this.renderMinutePickerColumn(i),this.renderDayPeriodPickerColumn(n)]}renderHourPickerColumn(t){const{workingParts:e,activePartsClone:i}=this;return 0===t.length?[]:(0,a.h)("ion-picker-column-internal",{color:this.color,value:i.hour,items:t,numericInput:!0,onIonChange:n=>{this.setWorkingParts(Object.assign(Object.assign({},e),{hour:n.detail.value})),Array.isArray(i)||this.setActiveParts(Object.assign(Object.assign({},i),{hour:n.detail.value})),n.stopPropagation()}})}renderMinutePickerColumn(t){const{workingParts:e,activePartsClone:i}=this;return 0===t.length?[]:(0,a.h)("ion-picker-column-internal",{color:this.color,value:i.minute,items:t,numericInput:!0,onIonChange:n=>{this.setWorkingParts(Object.assign(Object.assign({},e),{minute:n.detail.value})),Array.isArray(i)||this.setActiveParts(Object.assign(Object.assign({},i),{minute:n.detail.value})),n.stopPropagation()}})}renderDayPeriodPickerColumn(t){const{workingParts:e,activePartsClone:i}=this;if(0===t.length)return[];const n=(0,o.x)(this.locale);return(0,a.h)("ion-picker-column-internal",{style:n?{order:"-1"}:{},color:this.color,value:i.ampm,items:t,onIonChange:r=>{const s=(0,o.L)(e,r.detail.value);this.setWorkingParts(Object.assign(Object.assign({},e),{ampm:r.detail.value,hour:s})),Array.isArray(i)||this.setActiveParts(Object.assign(Object.assign({},i),{ampm:r.detail.value,hour:s})),r.stopPropagation()}})}renderWheelView(t){const{locale:e}=this,n=(0,o.y)(e)?"month-first":"year-first";return(0,a.h)("div",{class:{[`wheel-order-${n}`]:!0}},this.renderWheelPicker(t))}renderCalendarHeader(t){const e="ios"===t?D.l:D.p,i="ios"===t?D.o:D.q,n=((t,e,i)=>{const n=Object.assign(Object.assign({},(0,o.c)(this.workingParts)),{day:null});return j(n,{minParts:e,maxParts:i})})(0,this.minParts,this.maxParts),r=((t,e)=>{const i=Object.assign(Object.assign({},(0,o.d)(this.workingParts)),{day:null});return j(i,{maxParts:e})})(0,this.maxParts);return(0,a.h)("div",{class:"calendar-header"},(0,a.h)("div",{class:"calendar-action-buttons"},(0,a.h)("div",{class:"calendar-month-year"},(0,a.h)("ion-item",{button:!0,detail:!1,lines:"none",onClick:()=>this.toggleMonthAndYearView()},(0,a.h)("ion-label",null,(0,o.A)(this.locale,this.workingParts)," ",(0,a.h)("ion-icon",{icon:this.showMonthAndYear?e:i,lazy:!1})))),(0,a.h)("div",{class:"calendar-next-prev"},(0,a.h)("ion-buttons",null,(0,a.h)("ion-button",{disabled:n,onClick:()=>this.prevMonth()},(0,a.h)("ion-icon",{slot:"icon-only",icon:D.c,lazy:!1,flipRtl:!0})),(0,a.h)("ion-button",{disabled:r,onClick:()=>this.nextMonth()},(0,a.h)("ion-icon",{slot:"icon-only",icon:D.o,lazy:!1,flipRtl:!0}))))),(0,a.h)("div",{class:"calendar-days-of-week"},(0,o.z)(this.locale,t,this.firstDayOfWeek%7).map(s=>(0,a.h)("div",{class:"day-of-week"},s))))}renderMonth(t,e){const{highlightActiveParts:i}=this,n=void 0===this.parsedYearValues||this.parsedYearValues.includes(e),r=void 0===this.parsedMonthValues||this.parsedMonthValues.includes(t),s=!n||!r,l=j({month:t,year:e,day:null},{minParts:Object.assign(Object.assign({},this.minParts),{day:null}),maxParts:Object.assign(Object.assign({},this.maxParts),{day:null})});return(0,a.h)("div",{class:{"calendar-month":!0,"calendar-month-disabled":!(this.workingParts.month===t&&this.workingParts.year===e)&&l}},(0,a.h)("div",{class:"calendar-month-grid"},(0,o.B)(t,e,this.firstDayOfWeek%7).map((h,c)=>{const{day:p,dayOfWeek:m}=h,{isDateEnabled:b,multiple:u}=this,g={month:t,day:p,year:e},{isActive:f,isToday:x,ariaLabel:k,ariaSelected:C,disabled:z}=((t,e,i,n,r,s,l)=>{const h=void 0!==(Array.isArray(i)?i:[i]).find(m=>(0,o.b)(e,m)),c=(0,o.b)(e,n);return{disabled:L(e,r,s,l),isActive:h,isToday:c,ariaSelected:h?"true":null,ariaLabel:(0,o.g)(t,c,e)}})(this.locale,g,this.activePartsClone,this.todayParts,this.minParts,this.maxParts,this.parsedDayValues);let I=s||z;if(!I&&void 0!==b)try{I=!b((0,o.q)(g))}catch(ot){(0,O.b)("Exception thrown from provided `isDateEnabled` function. Please check your function and try again.",ot)}return(0,a.h)("button",{tabindex:"-1","data-day":p,"data-month":t,"data-year":e,"data-index":c,"data-day-of-week":m,disabled:I,class:{"calendar-day-padding":null===p,"calendar-day":!0,"calendar-day-active":f&&i,"calendar-day-today":x},"aria-selected":C,"aria-label":k,onClick:()=>{null!==p&&(this.setWorkingParts(Object.assign(Object.assign({},this.workingParts),{month:t,day:p,year:e})),u?this.setActiveParts({month:t,day:p,year:e},f):this.setActiveParts(Object.assign(Object.assign({},this.activeParts),{month:t,day:p,year:e})))}},p)})))}renderCalendarBody(){return(0,a.h)("div",{class:"calendar-body ion-focusable",ref:t=>this.calendarBodyRef=t,tabindex:"0"},(0,o.C)(this.workingParts).map(({month:t,year:e})=>this.renderMonth(t,e)))}renderCalendar(t){return(0,a.h)("div",{class:"datetime-calendar"},this.renderCalendarHeader(t),this.renderCalendarBody())}renderTimeLabel(){if(null!==this.el.querySelector('[slot="time-label"]')||this.showDefaultTimeLabel)return(0,a.h)("slot",{name:"time-label"},"Time")}renderTimeOverlay(){var t=this;const e=(0,o.D)(this.locale,this.hourCycle);return[(0,a.h)("div",{class:"time-header"},this.renderTimeLabel()),(0,a.h)("button",{class:{"time-body":!0,"time-body-active":this.isTimePopoverOpen},"aria-expanded":"false","aria-haspopup":"true",onClick:(i=(0,w.Z)(function*(n){const{popoverRef:r}=t;r&&(t.isTimePopoverOpen=!0,r.present(new CustomEvent("ionShadowTarget",{detail:{ionShadowTarget:n.target}})),yield r.onWillDismiss(),t.isTimePopoverOpen=!1)}),function(r){return i.apply(this,arguments)})},(0,o.E)(this.locale,this.activePartsClone,e)),(0,a.h)("ion-popover",{alignment:"center",translucent:!0,overlayIndex:1,arrow:!1,onWillPresent:i=>{i.target.querySelectorAll("ion-picker-column-internal").forEach(r=>r.scrollActiveItemIntoView())},style:{"--offset-y":"-10px","--min-width":"fit-content"},keyboardEvents:!0,ref:i=>this.popoverRef=i},this.renderWheelPicker("time"))];var i}renderCalendarViewHeader(t){if(null!==this.el.querySelector('[slot="title"]')||this.showDefaultTitle)return(0,a.h)("div",{class:"datetime-header"},(0,a.h)("div",{class:"datetime-title"},(0,a.h)("slot",{name:"title"},"Select Date")),"md"===t&&!this.multiple&&(0,a.h)("div",{class:"datetime-selected-date"},(0,o.F)(this.locale,this.activeParts)))}renderTime(){const{presentation:t}=this;return(0,a.h)("div",{class:"datetime-time"},"time"===t?this.renderWheelPicker():this.renderTimeOverlay())}renderCalendarViewMonthYearPicker(){return(0,a.h)("div",{class:"datetime-year"},this.renderWheelView("month-year"))}renderDatetime(t){const{presentation:e,preferWheel:i}=this;if(i&&("date"===e||"date-time"===e||"time-date"===e))return[this.renderWheelView(),this.renderFooter()];switch(e){case"date-time":return[this.renderCalendarViewHeader(t),this.renderCalendar(t),this.renderCalendarViewMonthYearPicker(),this.renderTime(),this.renderFooter()];case"time-date":return[this.renderCalendarViewHeader(t),this.renderTime(),this.renderCalendar(t),this.renderCalendarViewMonthYearPicker(),this.renderFooter()];case"time":return[this.renderTime(),this.renderFooter()];case"month":case"month-year":case"year":return[this.renderWheelView(),this.renderFooter()];default:return[this.renderCalendarViewHeader(t),this.renderCalendar(t),this.renderCalendarViewMonthYearPicker(),this.renderFooter()]}}render(){const{name:t,value:e,disabled:i,el:n,color:r,isPresented:s,readonly:l,showMonthAndYear:d,preferWheel:h,presentation:c,size:p}=this,m=(0,A.b)(this),b="year"===c||"month"===c||"month-year"===c,u=d||b,g=d&&!b,f="date"===c||"date-time"===c||"time-date"===c,x=f&&h,k=f&&!h;return(0,P.e)(!0,n,t,(0,o.G)(e),i),(0,a.h)(a.H,{"aria-disabled":i?"true":null,onFocus:this.onFocus,onBlur:this.onBlur,class:Object.assign({},(0,_.c)(r,{[m]:!0,"datetime-presented":s,"datetime-readonly":l,"datetime-disabled":i,"show-month-and-year":u,"month-year-picker-open":g,[`datetime-presentation-${c}`]:!0,[`datetime-size-${p}`]:!0,"datetime-prefer-wheel":x,"datetime-grid":k}))},this.renderDatetime(m))}get el(){return(0,a.i)(this)}static get watchers(){return{disabled:["disabledChanged"],min:["minChanged"],max:["maxChanged"],yearValues:["yearValuesChanged"],monthValues:["monthValuesChanged"],dayValues:["dayValuesChanged"],hourValues:["hourValuesChanged"],minuteValues:["minuteValuesChanged"],activeParts:["activePartsChanged"],value:["valueChanged"]}}};let J=0;W.style={ios:':host{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;background:var(--background);overflow:hidden}ion-picker-column-internal{min-width:26px}:host(.datetime-size-fixed){width:auto;height:auto}:host(.datetime-size-fixed:not(.datetime-prefer-wheel)){max-width:350px}:host(.datetime-size-fixed.datetime-prefer-wheel){min-width:350px;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}: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 .wheel-order-year-first .day-column{-ms-flex-order:3;order:3;text-align:end}:host .wheel-order-year-first .month-column{-ms-flex-order:2;order:2;text-align:end}:host .wheel-order-year-first .year-column{-ms-flex-order:1;order:1;text-align:start}: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(.month-year-picker-open) .datetime-footer{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 .calendar-month-disabled{scroll-snap-align:none}: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;position:absolute;top:50%;left:50%;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 .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:not(.datetime-prefer-wheel)),:host(.datetime-presentation-time-date:not(.datetime-prefer-wheel)),:host(.datetime-presentation-date:not(.datetime-prefer-wheel)){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%}',md:':host{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;background:var(--background);overflow:hidden}ion-picker-column-internal{min-width:26px}:host(.datetime-size-fixed){width:auto;height:auto}:host(.datetime-size-fixed:not(.datetime-prefer-wheel)){max-width:350px}:host(.datetime-size-fixed.datetime-prefer-wheel){min-width:350px;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}: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 .wheel-order-year-first .day-column{-ms-flex-order:3;order:3;text-align:end}:host .wheel-order-year-first .month-column{-ms-flex-order:2;order:2;text-align:end}:host .wheel-order-year-first .year-column{-ms-flex-order:1;order:1;text-align:start}: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(.month-year-picker-open) .datetime-footer{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 .calendar-month-disabled{scroll-snap-align:none}: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;position:absolute;top:50%;left:50%;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 .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)}'};const B=t=>{const e=(0,M.c)(),i=(0,M.c)(),n=(0,M.c)();return i.addElement(t.querySelector("ion-backdrop")).fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),n.addElement(t.querySelector(".picker-wrapper")).fromTo("transform","translateY(100%)","translateY(0%)"),e.addElement(t).easing("cubic-bezier(.36,.66,.04,1)").duration(400).addAnimation([i,n])},S=t=>{const e=(0,M.c)(),i=(0,M.c)(),n=(0,M.c)();return i.addElement(t.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)",.01),n.addElement(t.querySelector(".picker-wrapper")).fromTo("transform","translateY(0%)","translateY(100%)"),e.addElement(t).easing("cubic-bezier(.36,.66,.04,1)").duration(400).addAnimation([i,n])},F=class{constructor(t){(0,a.r)(this,t),this.didPresent=(0,a.e)(this,"ionPickerDidPresent",7),this.willPresent=(0,a.e)(this,"ionPickerWillPresent",7),this.willDismiss=(0,a.e)(this,"ionPickerWillDismiss",7),this.didDismiss=(0,a.e)(this,"ionPickerDidDismiss",7),this.presented=!1,this.keyboardClose=!0,this.buttons=[],this.columns=[],this.duration=0,this.showBackdrop=!0,this.backdropDismiss=!0,this.animated=!0,this.onBackdropTap=()=>{this.dismiss(void 0,v.B)},this.dispatchCancelHandler=e=>{if((0,v.i)(e.detail.role)){const n=this.buttons.find(r=>"cancel"===r.role);this.callButtonHandler(n)}}}connectedCallback(){(0,v.e)(this.el)}present(){var t=this;return(0,w.Z)(function*(){yield(0,v.d)(t,"pickerEnter",B,B,void 0),t.duration>0&&(t.durationTimeout=setTimeout(()=>t.dismiss(),t.duration))})()}dismiss(t,e){return this.durationTimeout&&clearTimeout(this.durationTimeout),(0,v.f)(this,t,e,"pickerLeave",S,S)}onDidDismiss(){return(0,v.g)(this.el,"ionPickerDidDismiss")}onWillDismiss(){return(0,v.g)(this.el,"ionPickerWillDismiss")}getColumn(t){return Promise.resolve(this.columns.find(e=>e.name===t))}buttonClick(t){var e=this;return(0,w.Z)(function*(){const i=t.role;return(0,v.i)(i)?e.dismiss(void 0,i):(yield e.callButtonHandler(t))?e.dismiss(e.getSelected(),t.role):Promise.resolve()})()}callButtonHandler(t){var e=this;return(0,w.Z)(function*(){return!(t&&!1===(yield(0,v.s)(t.handler,e.getSelected())))})()}getSelected(){const t={};return this.columns.forEach((e,i)=>{const n=void 0!==e.selectedIndex?e.options[e.selectedIndex]:void 0;t[e.name]={text:n?n.text:void 0,value:n?n.value:void 0,columnIndex:i}}),t}render(){const{htmlAttributes:t}=this,e=(0,A.b)(this);return(0,a.h)(a.H,Object.assign({"aria-modal":"true",tabindex:"-1"},t,{style:{zIndex:`${2e4+this.overlayIndex}`},class:Object.assign({[e]:!0,[`picker-${e}`]:!0,"overlay-hidden":!0},(0,_.g)(this.cssClass)),onIonBackdropTap:this.onBackdropTap,onIonPickerWillDismiss:this.dispatchCancelHandler}),(0,a.h)("ion-backdrop",{visible:this.showBackdrop,tappable:this.backdropDismiss}),(0,a.h)("div",{tabindex:"0"}),(0,a.h)("div",{class:"picker-wrapper ion-overlay-wrapper",role:"dialog"},(0,a.h)("div",{class:"picker-toolbar"},this.buttons.map(i=>(0,a.h)("div",{class:et(i)},(0,a.h)("button",{type:"button",onClick:()=>this.buttonClick(i),class:it(i)},i.text)))),(0,a.h)("div",{class:"picker-columns"},(0,a.h)("div",{class:"picker-above-highlight"}),this.presented&&this.columns.map(i=>(0,a.h)("ion-picker-column",{col:i})),(0,a.h)("div",{class:"picker-below-highlight"}))),(0,a.h)("div",{tabindex:"0"}))}get el(){return(0,a.i)(this)}},et=t=>({[`picker-toolbar-${t.role}`]:void 0!==t.role,"picker-toolbar-button":!0}),it=t=>Object.assign({"picker-button":!0,"ion-activatable":!0},(0,_.g)(t.cssClass));F.style={ios:".sc-ion-picker-ios-h{--border-radius:0;--border-style:solid;--min-width:auto;--width:100%;--max-width:500px;--min-height:auto;--max-height:auto;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;left:0;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;font-family:var(--ion-font-family, inherit);contain:strict;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1001}[dir=rtl].sc-ion-picker-ios-h,[dir=rtl] .sc-ion-picker-ios-h{left:unset;right:unset;right:0}.overlay-hidden.sc-ion-picker-ios-h{display:none}.picker-wrapper.sc-ion-picker-ios{border-radius:var(--border-radius);left:0;right:0;bottom:0;margin-left:auto;margin-right:auto;margin-top:auto;margin-bottom:auto;-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0);display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);contain:strict;overflow:hidden;z-index:10}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.picker-wrapper.sc-ion-picker-ios{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}.picker-toolbar.sc-ion-picker-ios{width:100%;background:transparent;contain:strict;z-index:1}.picker-button.sc-ion-picker-ios{border:0;font-family:inherit}.picker-button.sc-ion-picker-ios:active,.picker-button.sc-ion-picker-ios:focus{outline:none}.picker-columns.sc-ion-picker-ios{display:-ms-flexbox;display:flex;position:relative;-ms-flex-pack:center;justify-content:center;margin-bottom:var(--ion-safe-area-bottom, 0);contain:strict;direction:ltr;overflow:hidden}.picker-above-highlight.sc-ion-picker-ios,.picker-below-highlight.sc-ion-picker-ios{display:none;pointer-events:none}.sc-ion-picker-ios-h{--background:var(--ion-background-color, #fff);--border-width:1px 0 0;--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-250, #c8c7cc)));--height:260px;--backdrop-opacity:var(--ion-backdrop-opacity, 0.26);color:var(--ion-item-color, var(--ion-text-color, #000))}.picker-toolbar.sc-ion-picker-ios{display:-ms-flexbox;display:flex;height:44px;border-bottom:0.55px solid var(--border-color)}.picker-toolbar-button.sc-ion-picker-ios{-ms-flex:1;flex:1;text-align:end}.picker-toolbar-button.sc-ion-picker-ios:last-child .picker-button.sc-ion-picker-ios{font-weight:600}.picker-toolbar-button.sc-ion-picker-ios:first-child{font-weight:normal;text-align:start}.picker-button.sc-ion-picker-ios,.picker-button.ion-activated.sc-ion-picker-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:1em;padding-right:1em;padding-top:0;padding-bottom:0;height:44px;background:transparent;color:var(--ion-color-primary, #3880ff);font-size:16px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.picker-button.sc-ion-picker-ios,.picker-button.ion-activated.sc-ion-picker-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:1em;padding-inline-start:1em;-webkit-padding-end:1em;padding-inline-end:1em}}.picker-columns.sc-ion-picker-ios{height:215px;-webkit-perspective:1000px;perspective:1000px}.picker-above-highlight.sc-ion-picker-ios{left:0;top:0;-webkit-transform:translate3d(0, 0, 90px);transform:translate3d(0, 0, 90px);display:block;position:absolute;width:100%;height:81px;border-bottom:1px solid var(--border-color);background:-webkit-gradient(linear, left top, left bottom, color-stop(20%, var(--background, var(--ion-background-color, #fff))), to(rgba(var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255)), 0.8)));background:linear-gradient(to bottom, var(--background, var(--ion-background-color, #fff)) 20%, rgba(var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255)), 0.8) 100%);z-index:10}[dir=rtl].sc-ion-picker-ios .picker-above-highlight.sc-ion-picker-ios,[dir=rtl].sc-ion-picker-ios-h .picker-above-highlight.sc-ion-picker-ios,[dir=rtl] .sc-ion-picker-ios-h .picker-above-highlight.sc-ion-picker-ios{left:unset;right:unset;right:0}.picker-below-highlight.sc-ion-picker-ios{left:0;top:115px;-webkit-transform:translate3d(0, 0, 90px);transform:translate3d(0, 0, 90px);display:block;position:absolute;width:100%;height:119px;border-top:1px solid var(--border-color);background:-webkit-gradient(linear, left bottom, left top, color-stop(30%, var(--background, var(--ion-background-color, #fff))), to(rgba(var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255)), 0.8)));background:linear-gradient(to top, var(--background, var(--ion-background-color, #fff)) 30%, rgba(var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255)), 0.8) 100%);z-index:11}[dir=rtl].sc-ion-picker-ios .picker-below-highlight.sc-ion-picker-ios,[dir=rtl].sc-ion-picker-ios-h .picker-below-highlight.sc-ion-picker-ios,[dir=rtl] .sc-ion-picker-ios-h .picker-below-highlight.sc-ion-picker-ios{left:unset;right:unset;right:0}",md:".sc-ion-picker-md-h{--border-radius:0;--border-style:solid;--min-width:auto;--width:100%;--max-width:500px;--min-height:auto;--max-height:auto;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;left:0;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;font-family:var(--ion-font-family, inherit);contain:strict;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1001}[dir=rtl].sc-ion-picker-md-h,[dir=rtl] .sc-ion-picker-md-h{left:unset;right:unset;right:0}.overlay-hidden.sc-ion-picker-md-h{display:none}.picker-wrapper.sc-ion-picker-md{border-radius:var(--border-radius);left:0;right:0;bottom:0;margin-left:auto;margin-right:auto;margin-top:auto;margin-bottom:auto;-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0);display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);contain:strict;overflow:hidden;z-index:10}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.picker-wrapper.sc-ion-picker-md{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}.picker-toolbar.sc-ion-picker-md{width:100%;background:transparent;contain:strict;z-index:1}.picker-button.sc-ion-picker-md{border:0;font-family:inherit}.picker-button.sc-ion-picker-md:active,.picker-button.sc-ion-picker-md:focus{outline:none}.picker-columns.sc-ion-picker-md{display:-ms-flexbox;display:flex;position:relative;-ms-flex-pack:center;justify-content:center;margin-bottom:var(--ion-safe-area-bottom, 0);contain:strict;direction:ltr;overflow:hidden}.picker-above-highlight.sc-ion-picker-md,.picker-below-highlight.sc-ion-picker-md{display:none;pointer-events:none}.sc-ion-picker-md-h{--background:var(--ion-background-color, #fff);--border-width:0.55px 0 0;--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.13))));--height:260px;--backdrop-opacity:var(--ion-backdrop-opacity, 0.26);color:var(--ion-item-color, var(--ion-text-color, #000))}.picker-toolbar.sc-ion-picker-md{display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end;height:44px}.picker-button.sc-ion-picker-md,.picker-button.ion-activated.sc-ion-picker-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:1.1em;padding-right:1.1em;padding-top:0;padding-bottom:0;height:44px;background:transparent;color:var(--ion-color-primary, #3880ff);font-size:14px;font-weight:500;text-transform:uppercase;-webkit-box-shadow:none;box-shadow:none}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.picker-button.sc-ion-picker-md,.picker-button.ion-activated.sc-ion-picker-md{padding-left:unset;padding-right:unset;-webkit-padding-start:1.1em;padding-inline-start:1.1em;-webkit-padding-end:1.1em;padding-inline-end:1.1em}}.picker-columns.sc-ion-picker-md{height:216px;-webkit-perspective:1800px;perspective:1800px}.picker-above-highlight.sc-ion-picker-md{left:0;top:0;-webkit-transform:translate3d(0, 0, 90px);transform:translate3d(0, 0, 90px);position:absolute;width:100%;height:81px;border-bottom:1px solid var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.13))));background:-webkit-gradient(linear, left top, left bottom, color-stop(20%, var(--ion-background-color, #fff)), to(rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8)));background:linear-gradient(to bottom, var(--ion-background-color, #fff) 20%, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8) 100%);z-index:10}[dir=rtl].sc-ion-picker-md .picker-above-highlight.sc-ion-picker-md,[dir=rtl].sc-ion-picker-md-h .picker-above-highlight.sc-ion-picker-md,[dir=rtl] .sc-ion-picker-md-h .picker-above-highlight.sc-ion-picker-md{left:unset;right:unset;right:0}.picker-below-highlight.sc-ion-picker-md{left:0;top:115px;-webkit-transform:translate3d(0, 0, 90px);transform:translate3d(0, 0, 90px);position:absolute;width:100%;height:119px;border-top:1px solid var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.13))));background:-webkit-gradient(linear, left bottom, left top, color-stop(30%, var(--ion-background-color, #fff)), to(rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8)));background:linear-gradient(to top, var(--ion-background-color, #fff) 30%, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8) 100%);z-index:11}[dir=rtl].sc-ion-picker-md .picker-below-highlight.sc-ion-picker-md,[dir=rtl].sc-ion-picker-md-h .picker-below-highlight.sc-ion-picker-md,[dir=rtl] .sc-ion-picker-md-h .picker-below-highlight.sc-ion-picker-md{left:unset;right:unset;right:0}"};const R=class{constructor(t){(0,a.r)(this,t),this.ionPickerColChange=(0,a.e)(this,"ionPickerColChange",7),this.optHeight=0,this.rotateFactor=0,this.scaleFactor=1,this.velocity=0,this.y=0,this.noAnimate=!0}colChanged(){this.refresh()}connectedCallback(){var t=this;return(0,w.Z)(function*(){let e=0,i=.81;"ios"===(0,A.b)(t)&&(e=-.46,i=1),t.rotateFactor=e,t.scaleFactor=i,t.gesture=(yield Promise.resolve().then(y.bind(y,3139))).createGesture({el:t.el,gestureName:"picker-swipe",gesturePriority:100,threshold:0,passive:!1,onStart:r=>t.onStart(r),onMove:r=>t.onMove(r),onEnd:r=>t.onEnd(r)}),t.gesture.enable(),t.tmrId=setTimeout(()=>{t.noAnimate=!1,t.refresh(!0)},250)})()}componentDidLoad(){const t=this.optsEl;t&&(this.optHeight=t.firstElementChild?t.firstElementChild.clientHeight:0),this.refresh()}disconnectedCallback(){cancelAnimationFrame(this.rafId),clearTimeout(this.tmrId),this.gesture&&(this.gesture.destroy(),this.gesture=void 0)}emitColChange(){this.ionPickerColChange.emit(this.col)}setSelected(t,e){const i=t>-1?-t*this.optHeight:0;this.velocity=0,cancelAnimationFrame(this.rafId),this.update(i,e,!0),this.emitColChange()}update(t,e,i){if(!this.optsEl)return;let n=0,r=0;const{col:s,rotateFactor:l}=this,d=s.selectedIndex=this.indexForY(-t),h=0===e?"":e+"ms",c=`scale(${this.scaleFactor})`,p=this.optsEl.children;for(let m=0;m<p.length;m++){const b=p[m],u=s.options[m],g=m*this.optHeight+t;let f="";if(0!==l){const k=g*l;Math.abs(k)<=90?(n=0,r=90,f=`rotateX(${k}deg) `):n=-9999}else r=0,n=g;const x=d===m;f+=`translate3d(0px,${n}px,${r}px) `,1!==this.scaleFactor&&!x&&(f+=c),this.noAnimate?(u.duration=0,b.style.transitionDuration=""):e!==u.duration&&(u.duration=e,b.style.transitionDuration=h),f!==u.transform&&(u.transform=f),b.style.transform=f,x!==u.selected&&(u.selected=x,x?b.classList.add(Y):b.classList.remove(Y))}this.col.prevSelected=d,i&&(this.y=t),this.lastIndex!==d&&((0,T.b)(),this.lastIndex=d)}decelerate(){if(0!==this.velocity){this.velocity*=rt,this.velocity=this.velocity>0?Math.max(this.velocity,1):Math.min(this.velocity,-1);let t=this.y+this.velocity;t>this.minY?(t=this.minY,this.velocity=0):t<this.maxY&&(t=this.maxY,this.velocity=0),this.update(t,0,!0),Math.round(t)%this.optHeight!=0||Math.abs(this.velocity)>1?this.rafId=requestAnimationFrame(()=>this.decelerate()):(this.velocity=0,this.emitColChange(),(0,T.h)())}else if(this.y%this.optHeight!=0){const t=Math.abs(this.y%this.optHeight);this.velocity=t>this.optHeight/2?1:-1,this.decelerate()}}indexForY(t){return Math.min(Math.max(Math.abs(Math.round(t/this.optHeight)),0),this.col.options.length-1)}onStart(t){t.event.cancelable&&t.event.preventDefault(),t.event.stopPropagation(),(0,T.a)(),cancelAnimationFrame(this.rafId);const e=this.col.options;let i=e.length-1,n=0;for(let r=0;r<e.length;r++)e[r].disabled||(i=Math.min(i,r),n=Math.max(n,r));this.minY=-i*this.optHeight,this.maxY=-n*this.optHeight}onMove(t){t.event.cancelable&&t.event.preventDefault(),t.event.stopPropagation();let e=this.y+t.deltaY;e>this.minY?(e=Math.pow(e,.8),this.bounceFrom=e):e<this.maxY?(e+=Math.pow(this.maxY-e,.9),this.bounceFrom=e):this.bounceFrom=0,this.update(e,0,!1)}onEnd(t){if(this.bounceFrom>0)return this.update(this.minY,100,!0),void this.emitColChange();if(this.bounceFrom<0)return this.update(this.maxY,100,!0),void this.emitColChange();if(this.velocity=(0,P.l)(-H,23*t.velocityY,H),0===this.velocity&&0===t.deltaY){const e=t.event.target.closest(".picker-opt");e?.hasAttribute("opt-index")&&this.setSelected(parseInt(e.getAttribute("opt-index"),10),K)}else{if(this.y+=t.deltaY,Math.abs(t.velocityY)<.05){const e=t.deltaY>0,i=Math.abs(this.y)%this.optHeight/this.optHeight;e&&i>.5?this.velocity=-1*Math.abs(this.velocity):!e&&i<=.5&&(this.velocity=Math.abs(this.velocity))}this.decelerate()}}refresh(t){let e=this.col.options.length-1,i=0;const n=this.col.options;for(let s=0;s<n.length;s++)n[s].disabled||(e=Math.min(e,s),i=Math.max(i,s));if(0!==this.velocity)return;const r=(0,P.l)(e,this.col.selectedIndex||0,i);if(this.col.prevSelected!==r||t){const s=r*this.optHeight*-1;this.velocity=0,this.update(s,K,!0)}}render(){const t=this.col,i=(0,A.b)(this);return(0,a.h)(a.H,{class:{[i]:!0,"picker-col":!0,"picker-opts-left":"left"===this.col.align,"picker-opts-right":"right"===this.col.align},style:{"max-width":this.col.columnWidth}},t.prefix&&(0,a.h)("div",{class:"picker-prefix",style:{width:t.prefixWidth}},t.prefix),(0,a.h)("div",{class:"picker-opts",style:{maxWidth:t.optionsWidth},ref:n=>this.optsEl=n},t.options.map((n,r)=>(0,a.h)("button",{type:"button",class:{"picker-opt":!0,"picker-opt-disabled":!!n.disabled},"opt-index":r},n.text))),t.suffix&&(0,a.h)("div",{class:"picker-suffix",style:{width:t.suffixWidth}},t.suffix))}get el(){return(0,a.i)(this)}static get watchers(){return{col:["colChanged"]}}},Y="picker-opt-selected",rt=.97,H=90,K=150;R.style={ios:".picker-col{display:-ms-flexbox;display:flex;position:relative;-ms-flex:1;flex:1;-ms-flex-pack:center;justify-content:center;height:100%;-webkit-box-sizing:content-box;box-sizing:content-box;contain:content}.picker-opts{position:relative;-ms-flex:1;flex:1;max-width:100%}.picker-opt{left:0;top:0;display:block;position:absolute;width:100%;border:0;text-align:center;text-overflow:ellipsis;white-space:nowrap;contain:strict;overflow:hidden;will-change:transform}[dir=rtl] .picker-opt,:host-context([dir=rtl]) .picker-opt{left:unset;right:unset;right:0}.picker-opt.picker-opt-disabled{pointer-events:none}.picker-opt-disabled{opacity:0}.picker-opts-left{-ms-flex-pack:start;justify-content:flex-start}.picker-opts-right{-ms-flex-pack:end;justify-content:flex-end}.picker-opt:active,.picker-opt:focus{outline:none}.picker-prefix{position:relative;-ms-flex:1;flex:1;text-align:end;white-space:nowrap}.picker-suffix{position:relative;-ms-flex:1;flex:1;text-align:start;white-space:nowrap}.picker-col{padding-left:4px;padding-right:4px;padding-top:0;padding-bottom:0;-webkit-transform-style:preserve-3d;transform-style:preserve-3d}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.picker-col{padding-left:unset;padding-right:unset;-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px}}.picker-prefix,.picker-suffix,.picker-opts{top:77px;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;color:inherit;font-size:20px;line-height:42px;pointer-events:none}.picker-opt{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;-webkit-transform-origin:center center;transform-origin:center center;height:46px;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out;background:transparent;color:inherit;font-size:20px;line-height:42px;-webkit-backface-visibility:hidden;backface-visibility:hidden;pointer-events:auto}[dir=rtl] .picker-opt,:host-context([dir=rtl]) .picker-opt{-webkit-transform-origin:calc(100% - center) center;transform-origin:calc(100% - center) center}",md:".picker-col{display:-ms-flexbox;display:flex;position:relative;-ms-flex:1;flex:1;-ms-flex-pack:center;justify-content:center;height:100%;-webkit-box-sizing:content-box;box-sizing:content-box;contain:content}.picker-opts{position:relative;-ms-flex:1;flex:1;max-width:100%}.picker-opt{left:0;top:0;display:block;position:absolute;width:100%;border:0;text-align:center;text-overflow:ellipsis;white-space:nowrap;contain:strict;overflow:hidden;will-change:transform}[dir=rtl] .picker-opt,:host-context([dir=rtl]) .picker-opt{left:unset;right:unset;right:0}.picker-opt.picker-opt-disabled{pointer-events:none}.picker-opt-disabled{opacity:0}.picker-opts-left{-ms-flex-pack:start;justify-content:flex-start}.picker-opts-right{-ms-flex-pack:end;justify-content:flex-end}.picker-opt:active,.picker-opt:focus{outline:none}.picker-prefix{position:relative;-ms-flex:1;flex:1;text-align:end;white-space:nowrap}.picker-suffix{position:relative;-ms-flex:1;flex:1;text-align:start;white-space:nowrap}.picker-col{padding-left:8px;padding-right:8px;padding-top:0;padding-bottom:0;-webkit-transform-style:preserve-3d;transform-style:preserve-3d}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.picker-col{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px}}.picker-prefix,.picker-suffix,.picker-opts{top:77px;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;color:inherit;font-size:22px;line-height:42px;pointer-events:none}.picker-opt{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;height:43px;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out;background:transparent;color:inherit;font-size:22px;line-height:42px;-webkit-backface-visibility:hidden;backface-visibility:hidden;pointer-events:auto}.picker-prefix,.picker-suffix,.picker-opt.picker-opt-selected{color:var(--ion-color-primary, #3880ff)}"}}}]);