UNPKG

@zoff-tech/zt-bottom-drawer

Version:
5 lines 45 kB
import{r as t,d as e,w as n,h as i,H as a,e as o}from"./p-f6c816ce.js";import{startFocusVisible as s}from"@utils/focus-visible";import{raf as r,getElementRoot as d,renderHiddenInput as h}from"@utils/helpers";import{printIonError as l,printIonWarning as c}from"@utils/logging";import{isRTL as p}from"@utils/rtl";import{createColorClasses as m}from"@utils/theme";import{a as u,f as y,c as b,g as f,h as g}from"./p-a3c3f38c.js";import{g as x}from"./p-0b9b2444.js";import{g as w,a as v,i as k,b as j,c as C,d as O,e as P,v as D,f as z,h as V,j as A,k as T,l as $,m as I,n as E,p as S,o as M,q as W,w as R,r as F,s as L,t as B,u as H,x as Y,y as U,z as q,A as K,B as N,C as G,D as J,E as Q,F as _,G as X,H as Z,I as tt,J as et,K as nt,L as it,M as at,N as ot,O as st,P as rt,Q as dt,R as ht}from"./p-72283fec.js"; /*! * (C) Ionic http://ionicframework.com - MIT License */const lt=(t,e,n)=>{if(e&&e.year>t){return true}if(n&&n.year<t){return true}return false};const ct=(t,e,n,i)=>{if(t.day===null){return true}if(i!==undefined&&!i.includes(t.day)){return true}if(e&&k(t,e)){return true}if(n&&j(t,n)){return true}return false};const pt=(t,e,n,i,a,o,s)=>{const r=Array.isArray(n)?n:[n];const d=r.find((t=>C(e,t)))!==undefined;const h=C(e,i);const l=ct(e,a,o,s);return{disabled:l,isActive:d,isToday:h,ariaSelected:d?"true":null,ariaLabel:w(t,h,e),text:e.day!=null?v(t,e):null}};const mt=(t,{minParts:e,maxParts:n})=>{if(lt(t.year,e,n)){return true}if(e&&k(t,e)||n&&j(t,n)){return true}return false};const ut=(t,e,n)=>{const i=Object.assign(Object.assign({},O(t)),{day:null});return mt(i,{minParts:e,maxParts:n})};const yt=(t,e)=>{const n=Object.assign(Object.assign({},P(t)),{day:null});return mt(n,{maxParts:e})};const bt=(t,e,n)=>{if(Array.isArray(t)){const n=e.split("T")[0];const i=t.find((t=>t.date===n));if(i){return{textColor:i.textColor,backgroundColor:i.backgroundColor}}}else{try{return t(e)}catch(t){l("Exception thrown from provided `highlightedDates` callback. Please check your function and try again.",n,t)}}return undefined};const ft=":host{display:flex;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: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{order:3;text-align:end}:host .wheel-order-year-first .month-column{order:2;text-align:end}:host .wheel-order-year-first .year-column{order:1;text-align:start}:host .datetime-calendar,:host .datetime-year{display:flex;flex:1 1 auto;flex-flow:column}:host(.show-month-and-year) .datetime-year{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{position:absolute;visibility:hidden;pointer-events:none}@supports (inset-inline-start: 0){: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{inset-inline-start:-99999px}}@supports not (inset-inline-start: 0){: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}: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 selector(:dir(rtl)){:host(.show-month-and-year) .calendar-next-prev:dir(rtl),:host(.show-month-and-year) .calendar-days-of-week:dir(rtl),:host(.show-month-and-year) .calendar-body:dir(rtl),:host(.show-month-and-year) .datetime-time:dir(rtl){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:flex;justify-content:space-between}:host .calendar-action-buttons{display:flex;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:flex;align-items:center}:host .calendar-action-buttons ion-item ion-icon{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0;padding-top:0;padding-bottom:0}:host .calendar-days-of-week{display:grid;grid-template-columns:repeat(7, 1fr);text-align:center}:host .calendar-body{display:flex;flex-grow:1;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;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)}:host .calendar-day{-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;padding-top:0px;padding-bottom:0px;-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px;margin-top:0px;margin-bottom:0px;display:flex;position:relative;align-items:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;font-family:var(--ion-font-family, inherit);cursor:pointer;appearance:none;z-index:0}:host .calendar-day[disabled]{pointer-events:none;opacity:0.4}.calendar-day-highlight{border-radius:32px;-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:32px;height:32px;z-index:-1}:host .datetime-time{display:flex;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:flex;align-items:center}:host .time-body{border-radius:8px;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:6px;padding-bottom:6px;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;appearance:none}: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{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:16px;padding-bottom:16px;border-bottom:0.55px solid var(--ion-color-step-200, #cccccc);font-size:14px}:host .datetime-header .datetime-title{color:var(--title-color)}:host .datetime-header .datetime-selected-date{margin-top:10px}: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{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end: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}:host .calendar-body .calendar-month .calendar-month-grid{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:8px;padding-bottom:8px;height:calc(100% - 16px)}:host .calendar-day{font-size:20px}.calendar-day:focus .calendar-day-highlight,.calendar-day.calendar-day-active .calendar-day-highlight{opacity:0.2}.calendar-day.calendar-day-active .calendar-day-highlight{background:var(--ion-color-base)}.calendar-day:focus .calendar-day-highlight{background:var(--ion-color-base) !important}: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-today.calendar-day-active{color:var(--ion-color-contrast)}.calendar-day.calendar-day-today.calendar-day-active .calendar-day-highlight{background:var(--ion-color-base);opacity:1}:host .datetime-time{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:8px;padding-bottom:16px;font-size:16px}:host .datetime-time .time-header{font-weight:600}:host .datetime-buttons{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:8px;padding-bottom:8px;border-top:0.55px solid var(--ion-color-step-200, #cccccc)}:host .datetime-buttons ::slotted(ion-buttons),:host .datetime-buttons ion-buttons{display:flex;align-items:center;justify-content:space-between}:host .datetime-action-buttons{width:100%}";const gt=":host{display:flex;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: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{order:3;text-align:end}:host .wheel-order-year-first .month-column{order:2;text-align:end}:host .wheel-order-year-first .year-column{order:1;text-align:start}:host .datetime-calendar,:host .datetime-year{display:flex;flex:1 1 auto;flex-flow:column}:host(.show-month-and-year) .datetime-year{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{position:absolute;visibility:hidden;pointer-events:none}@supports (inset-inline-start: 0){: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{inset-inline-start:-99999px}}@supports not (inset-inline-start: 0){: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}: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 selector(:dir(rtl)){:host(.show-month-and-year) .calendar-next-prev:dir(rtl),:host(.show-month-and-year) .calendar-days-of-week:dir(rtl),:host(.show-month-and-year) .calendar-body:dir(rtl),:host(.show-month-and-year) .datetime-time:dir(rtl){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:flex;justify-content:space-between}:host .calendar-action-buttons{display:flex;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:flex;align-items:center}:host .calendar-action-buttons ion-item ion-icon{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0;padding-top:0;padding-bottom:0}:host .calendar-days-of-week{display:grid;grid-template-columns:repeat(7, 1fr);text-align:center}:host .calendar-body{display:flex;flex-grow:1;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;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)}:host .calendar-day{-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;padding-top:0px;padding-bottom:0px;-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px;margin-top:0px;margin-bottom:0px;display:flex;position:relative;align-items:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;font-family:var(--ion-font-family, inherit);cursor:pointer;appearance:none;z-index:0}:host .calendar-day[disabled]{pointer-events:none;opacity:0.4}.calendar-day-highlight{border-radius:32px;-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:32px;height:32px;z-index:-1}:host .datetime-time{display:flex;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:flex;align-items:center}:host .time-body{border-radius:8px;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:6px;padding-bottom:6px;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;appearance:none}: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{-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:20px;padding-inline-end:20px;padding-top:20px;padding-bottom:20px;background:var(--ion-color-base);color:var(--title-color)}: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{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:0px;padding-bottom:0px;color:var(--ion-color-step-500, gray);font-size:14px;line-height:36px}:host .calendar-body .calendar-month .calendar-month-grid{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:4px;padding-bottom:4px;grid-template-rows:repeat(6, 1fr)}:host .calendar-day{-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0;padding-inline-end:0;padding-top:13px;padding-bottom:13px;font-size:14px}.calendar-day:focus .calendar-day-highlight{background: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)}.calendar-day.calendar-day-today .calendar-day-highlight{border:1px solid var(--ion-color-base)}:host .calendar-day.calendar-day-active{color:var(--ion-color-contrast)}.calendar-day.calendar-day-active .calendar-day-highlight{border:1px solid var(--ion-color-base);background:var(--ion-color-base)}:host .datetime-time{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:8px;padding-bottom:8px}: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{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:10px;padding-bottom:10px;display:flex;align-items:center;justify-content:flex-end}:host .datetime-view-buttons ion-button{color:var(--ion-color-step-800, #333333)}";const xt=class{constructor(i){t(this,i);this.ionCancel=e(this,"ionCancel",7);this.ionChange=e(this,"ionChange",7);this.ionValueChange=e(this,"ionValueChange",7);this.ionFocus=e(this,"ionFocus",7);this.ionBlur=e(this,"ionBlur",7);this.ionStyle=e(this,"ionStyle",7);this.ionRender=e(this,"ionRender",7);this.inputId=`ion-dt-${wt++}`;this.prevPresentation=null;this.activePartsClone=[];this.warnIfIncorrectValueUsage=()=>{const{multiple:t,value:e}=this;if(!t&&Array.isArray(e)){c(`ion-datetime was passed an array of values, but multiple="false". This is incorrect usage and may result in unexpected behaviors. To dismiss this warning, pass a string to the "value" property when multiple="false".\n\n Value Passed: [${e.map((t=>`'${t}'`)).join(", ")}]\n`,this.el)}};this.setValue=t=>{this.value=t;this.ionChange.emit({value:t})};this.getActivePartsWithFallback=()=>{var t;const{defaultParts:e}=this;return(t=this.getActivePart())!==null&&t!==void 0?t:e};this.getActivePart=()=>{const{activePartsClone:t}=this;return Array.isArray(t)?t[0]:t};this.closeParentOverlay=()=>{const t=this.el.closest("ion-modal, ion-popover");if(t){t.dismiss()}};this.setWorkingParts=t=>{this.workingParts=Object.assign({},t)};this.setActiveParts=(t,e=false)=>{const{multiple:n,minParts:i,maxParts:a,activePartsClone:o}=this;const s=D(t,i,a);this.setWorkingParts(s);if(n){const t=Array.isArray(o)?o:[o];if(e){this.activeParts=t.filter((t=>!C(t,s)))}else{this.activeParts=[...t,s]}}else{this.activeParts=Object.assign({},s)}const r=this.el.querySelector('[slot="buttons"]')!==null;if(r||this.showDefaultButtons){return}this.confirm()};this.initializeKeyboardListeners=()=>{const t=this.calendarBodyRef;if(!t){return}const e=this.el.shadowRoot;const n=t.querySelector(".calendar-month:nth-of-type(2)");const i=e=>{var i;const a=e[0];if(((i=a.oldValue)===null||i===void 0?void 0:i.includes("ion-focused"))||!t.classList.contains("ion-focused")){return}this.focusWorkingDay(n)};const a=new MutationObserver(i);a.observe(t,{attributeFilter:["class"],attributeOldValue:true});this.destroyKeyboardMO=()=>{a===null||a===void 0?void 0:a.disconnect()};t.addEventListener("keydown",(t=>{const i=e.activeElement;if(!i||!i.classList.contains("calendar-day")){return}const a=z(i);let o;switch(t.key){case"ArrowDown":t.preventDefault();o=E(a);break;case"ArrowUp":t.preventDefault();o=I(a);break;case"ArrowRight":t.preventDefault();o=$(a);break;case"ArrowLeft":t.preventDefault();o=T(a);break;case"Home":t.preventDefault();o=A(a);break;case"End":t.preventDefault();o=V(a);break;case"PageUp":t.preventDefault();o=t.shiftKey?st(a):O(a);break;case"PageDown":t.preventDefault();o=t.shiftKey?ot(a):P(a);break;default:return}if(ct(o,this.minParts,this.maxParts)){return}this.setWorkingParts(Object.assign(Object.assign({},this.workingParts),o));requestAnimationFrame((()=>this.focusWorkingDay(n)))}))};this.focusWorkingDay=t=>{const e=t.querySelectorAll(".calendar-day-padding");const{day:n}=this.workingParts;if(n===null){return}const i=t.querySelector(`.calendar-day:nth-of-type(${e.length+n})`);if(i){i.focus()}};this.processMinParts=()=>{const{min:t,defaultParts:e}=this;if(t===undefined){this.minParts=undefined;return}this.minParts=S(t,e)};this.processMaxParts=()=>{const{max:t,defaultParts:e}=this;if(t===undefined){this.maxParts=undefined;return}this.maxParts=M(t,e)};this.initializeCalendarListener=()=>{const t=this.calendarBodyRef;if(!t){return}const e=t.querySelectorAll(".calendar-month");const i=e[0];const a=e[1];const o=e[2];const s=x(this);const r=s==="ios"&&typeof navigator!=="undefined"&&navigator.maxTouchPoints>1;n((()=>{t.scrollLeft=i.clientWidth*(p(this.el)?-1:1);const e=e=>{const n=t.getBoundingClientRect();const a=this.el.shadowRoot;const s=a.elementFromPoint(n.x+n.width/2,n.y+n.height/2);if(!s)return;const r=s.closest(".calendar-month");if(!r)return;const d=r.getBoundingClientRect();if(Math.abs(d.x-n.x)>2)return;if(r===i){return O(e)}else if(r===o){return P(e)}else{return}};const s=()=>{if(r){t.style.removeProperty("pointer-events");h=false}const i=e(this.workingParts);if(!i)return;const{month:o,day:s,year:d}=i;if(mt({month:o,year:d,day:null},{minParts:Object.assign(Object.assign({},this.minParts),{day:null}),maxParts:Object.assign(Object.assign({},this.maxParts),{day:null})})){return}t.style.setProperty("overflow","hidden");n((()=>{this.setWorkingParts(Object.assign(Object.assign({},this.workingParts),{month:o,day:s,year:d}));t.scrollLeft=a.clientWidth*(p(this.el)?-1:1);t.style.removeProperty("overflow")}))};let d;let h=false;const l=()=>{if(d){clearTimeout(d)}if(!h&&r){t.style.setProperty("pointer-events","none");h=true}d=setTimeout(s,50)};t.addEventListener("scroll",l);this.destroyCalendarListener=()=>{t.removeEventListener("scroll",l)}}))};this.destroyInteractionListeners=()=>{const{destroyCalendarListener:t,destroyKeyboardMO:e}=this;if(t!==undefined){t()}if(e!==undefined){e()}};this.processValue=t=>{const e=t!==null&&t!==undefined;const n=e?W(t):this.defaultParts;const{minParts:i,maxParts:a}=this;this.warnIfIncorrectValueUsage();if(e){R(n,i,a)}const o=Array.isArray(n)?n[0]:n;const{month:s,day:r,year:d,hour:h,minute:l}=rt(o,i,a);const c=dt(h);this.setWorkingParts({month:s,day:r,year:d,hour:h,minute:l,ampm:c});if(e){if(Array.isArray(n)){this.activeParts=[...n]}else{this.activeParts={month:s,day:r,year:d,hour:h,minute:l,ampm:c}}}else{this.activeParts=[]}};this.onFocus=()=>{this.ionFocus.emit()};this.onBlur=()=>{this.ionBlur.emit()};this.hasValue=()=>this.value!=null;this.nextMonth=()=>{const t=this.calendarBodyRef;if(!t){return}const e=t.querySelector(".calendar-month:last-of-type");if(!e){return}const n=e.offsetWidth*2;t.scrollTo({top:0,left:n*(p(this.el)?-1:1),behavior:"smooth"})};this.prevMonth=()=>{const t=this.calendarBodyRef;if(!t){return}const e=t.querySelector(".calendar-month:first-of-type");if(!e){return}t.scrollTo({top:0,left:0,behavior:"smooth"})};this.toggleMonthAndYearView=()=>{this.showMonthAndYear=!this.showMonthAndYear};this.showMonthAndYear=false;this.activeParts=[];this.workingParts={month:5,day:28,year:2021,hour:13,minute:52,ampm:"pm"};this.isPresented=false;this.isTimePopoverOpen=false;this.color="primary";this.name=this.inputId;this.disabled=false;this.readonly=false;this.isDateEnabled=undefined;this.min=undefined;this.max=undefined;this.presentation="date-time";this.cancelText="Cancel";this.doneText="Done";this.clearText="Clear";this.yearValues=undefined;this.monthValues=undefined;this.dayValues=undefined;this.hourValues=undefined;this.minuteValues=undefined;this.locale="default";this.firstDayOfWeek=0;this.titleSelectedDatesFormatter=undefined;this.multiple=false;this.highlightedDates=undefined;this.value=undefined;this.showDefaultTitle=false;this.showDefaultButtons=false;this.showClearButton=false;this.showDefaultTimeLabel=true;this.hourCycle=undefined;this.size="fixed";this.preferWheel=false}disabledChanged(){this.emitStyle()}minChanged(){this.processMinParts()}maxChanged(){this.processMaxParts()}yearValuesChanged(){this.parsedYearValues=F(this.yearValues)}monthValuesChanged(){this.parsedMonthValues=F(this.monthValues)}dayValuesChanged(){this.parsedDayValues=F(this.dayValues)}hourValuesChanged(){this.parsedHourValues=F(this.hourValues)}minuteValuesChanged(){this.parsedMinuteValues=F(this.minuteValues)}activePartsChanged(){this.activePartsClone=this.activeParts}valueChanged(){const{value:t,minParts:e,maxParts:n,workingParts:i}=this;if(this.hasValue()){this.warnIfIncorrectValueUsage();const a=W(t);if(a){R(a,e,n);if(Array.isArray(a)){this.activePartsClone=[...a]}else{const{month:t,day:e,year:n,hour:o,minute:s}=a;const r=o!=null?o>=12?"pm":"am":undefined;this.activePartsClone=Object.assign(Object.assign({},this.activeParts),{month:t,day:e,year:n,hour:o,minute:s,ampm:r});this.setWorkingParts(Object.assign(Object.assign({},i),{ampm:r}))}}else{c(`Unable to parse date string: ${t}. Please provide a valid ISO 8601 datetime string.`)}}this.emitStyle();this.ionValueChange.emit({value:t})}async confirm(t=false){const{isCalendarPicker:e,activeParts:n}=this;if(n!==undefined||!e){const t=Array.isArray(n);if(t&&n.length===0){this.setValue(undefined)}else{this.setValue(L(n))}}if(t){this.closeParentOverlay()}}async reset(t){this.processValue(t)}async cancel(t=false){this.ionCancel.emit();if(t){this.closeParentOverlay()}}get isCalendarPicker(){const{presentation:t}=this;return t==="date"||t==="date-time"||t==="time-date"}connectedCallback(){this.clearFocusVisible=s(this.el).destroy}disconnectedCallback(){if(this.clearFocusVisible){this.clearFocusVisible();this.clearFocusVisible=undefined}}initializeListeners(){this.initializeCalendarListener();this.initializeKeyboardListeners()}componentDidLoad(){const t=t=>{const e=t[0];if(!e.isIntersecting){return}this.initializeListeners();n((()=>{this.el.classList.add("datetime-ready")}))};const e=new IntersectionObserver(t,{threshold:.01});r((()=>e===null||e===void 0?void 0:e.observe(this.el)));const i=t=>{const e=t[0];if(e.isIntersecting){return}this.destroyInteractionListeners();this.showMonthAndYear=false;n((()=>{this.el.classList.remove("datetime-ready")}))};const a=new IntersectionObserver(i,{threshold:0});r((()=>a===null||a===void 0?void 0:a.observe(this.el)));const o=d(this.el);o.addEventListener("ionFocus",(t=>t.stopPropagation()));o.addEventListener("ionBlur",(t=>t.stopPropagation()))}componentDidRender(){const{presentation:t,prevPresentation:e,calendarBodyRef:n,minParts:i,preferWheel:a}=this;const o=!a&&["date-time","time-date","date"].includes(t);if(i!==undefined&&o&&n){const t=n.querySelector(".calendar-month:nth-of-type(1)");if(t){n.scrollLeft=t.clientWidth*(p(this.el)?-1:1)}}if(e===null){this.prevPresentation=t;return}if(t===e){return}this.prevPresentation=t;this.destroyInteractionListeners();this.initializeListeners();this.showMonthAndYear=false;r((()=>{this.ionRender.emit()}))}componentWillLoad(){const{el:t,highlightedDates:e,multiple:n,presentation:i,preferWheel:a}=this;if(n){if(i!=="date"){c('Multiple date selection is only supported for presentation="date".',t)}if(a){c('Multiple date selection is not supported with preferWheel="true".',t)}}if(e!==undefined){if(i!=="date"&&i!=="date-time"&&i!=="time-date"){c("The highlightedDates property is only supported with the date, date-time, and time-date presentations.",t)}if(a){c('The highlightedDates property is not supported with preferWheel="true".',t)}}this.processMinParts();this.processMaxParts();const o=this.parsedHourValues=F(this.hourValues);const s=this.parsedMinuteValues=F(this.minuteValues);const r=this.parsedMonthValues=F(this.monthValues);const d=this.parsedYearValues=F(this.yearValues);const h=this.parsedDayValues=F(this.dayValues);const l=this.todayParts=W(B());this.defaultParts=H(l,r,h,d,o,s);this.processValue(this.value);this.emitStyle()}emitStyle(){this.ionStyle.emit({interactive:true,datetime:true,"interactive-disabled":this.disabled})}renderFooter(){const{showDefaultButtons:t,showClearButton:e}=this;const n=this.el.querySelector('[slot="buttons"]')!==null;if(!n&&!t&&!e){return}const a=()=>{this.reset();this.setValue(undefined)};return i("div",{class:"datetime-footer"},i("div",{class:"datetime-buttons"},i("div",{class:{["datetime-action-buttons"]:true,["has-clear-button"]:this.showClearButton}},i("slot",{name:"buttons"},i("ion-buttons",null,t&&i("ion-button",{id:"cancel-button",color:this.color,onClick:()=>this.cancel(true)},this.cancelText),i("div",null,e&&i("ion-button",{id:"clear-button",color:this.color,onClick:()=>a()},this.clearText),t&&i("ion-button",{id:"confirm-button",color:this.color,onClick:()=>this.confirm(true)},this.doneText)))))))}renderWheelPicker(t=this.presentation){const e=t==="time-date"?[this.renderTimePickerColumns(t),this.renderDatePickerColumns(t)]:[this.renderDatePickerColumns(t),this.renderTimePickerColumns(t)];return i("ion-picker-internal",null,e)}renderDatePickerColumns(t){return t==="date-time"||t==="time-date"?this.renderCombinedDatePickerColumn():this.renderIndividualDatePickerColumns(t)}renderCombinedDatePickerColumn(){const{defaultParts:t,workingParts:e,locale:n,minParts:a,maxParts:o,todayParts:s,isDateEnabled:r}=this;const d=this.getActivePartsWithFallback();const h=tt(e);const c=h[h.length-1];h[0].day=1;c.day=Y(c.month,c.year);const p=a!==undefined&&j(a,h[0])?a:h[0];const m=o!==undefined&&k(o,c)?o:c;const u=U(n,s,p,m,this.parsedDayValues,this.parsedMonthValues);let y=u.items;const b=u.parts;if(r){y=y.map(((t,e)=>{const n=b[e];let i;try{i=!r(L(n))}catch(t){l("Exception thrown from provided `isDateEnabled` function. Please check your function and try again.",t)}return Object.assign(Object.assign({},t),{disabled:i})}))}const f=e.day!==null?`${e.year}-${e.month}-${e.day}`:`${t.year}-${t.month}-${t.day}`;return i("ion-picker-column-internal",{class:"date-column",color:this.color,items:y,value:f,onIonChange:t=>{if(this.destroyCalendarListener){this.destroyCalendarListener()}const{value:n}=t.detail;const i=b.find((({month:t,day:e,year:i})=>n===`${i}-${t}-${e}`));this.setWorkingParts(Object.assign(Object.assign({},e),i));this.setActiveParts(Object.assign(Object.assign({},d),i));this.initializeCalendarListener();t.stopPropagation()}})}renderIndividualDatePickerColumns(t){const{workingParts:e,isDateEnabled:n}=this;const i=t!=="year"&&t!=="time";const a=i?q(this.locale,e,this.minParts,this.maxParts,this.parsedMonthValues):[];const o=t==="date";let s=o?K(this.locale,e,this.minParts,this.maxParts,this.parsedDayValues):[];if(n){s=s.map((t=>{const{value:i}=t;const a=typeof i==="string"?parseInt(i):i;const o={month:e.month,day:a,year:e.year};let s;try{s=!n(L(o))}catch(t){l("Exception thrown from provided `isDateEnabled` function. Please check your function and try again.",t)}return Object.assign(Object.assign({},t),{disabled:s})}))}const r=t!=="month"&&t!=="time";const d=r?N(this.locale,this.defaultParts,this.minParts,this.maxParts,this.parsedYearValues):[];const h=G(this.locale,{month:"numeric",day:"numeric"});let c=[];if(h){c=[this.renderMonthPickerColumn(a),this.renderDayPickerColumn(s),this.renderYearPickerColumn(d)]}else{c=[this.renderDayPickerColumn(s),this.renderMonthPickerColumn(a),this.renderYearPickerColumn(d)]}return c}renderDayPickerColumn(t){var e;if(t.length===0){return[]}const{workingParts:n}=this;const a=this.getActivePartsWithFallback();return i("ion-picker-column-internal",{class:"day-column",color:this.color,items:t,value:(e=n.day!==null?n.day:this.defaultParts.day)!==null&&e!==void 0?e:undefined,onIonChange:t=>{if(this.destroyCalendarListener){this.destroyCalendarListener()}this.setWorkingParts(Object.assign(Object.assign({},n),{day:t.detail.value}));this.setActiveParts(Object.assign(Object.assign({},a),{day:t.detail.value}));this.initializeCalendarListener();t.stopPropagation()}})}renderMonthPickerColumn(t){if(t.length===0){return[]}const{workingParts:e}=this;const n=this.getActivePartsWithFallback();return i("ion-picker-column-internal",{class:"month-column",color:this.color,items:t,value:e.month,onIonChange:t=>{if(this.destroyCalendarListener){this.destroyCalendarListener()}this.setWorkingParts(Object.assign(Object.assign({},e),{month:t.detail.value}));this.setActiveParts(Object.assign(Object.assign({},n),{month:t.detail.value}));this.initializeCalendarListener();t.stopPropagation()}})}renderYearPickerColumn(t){if(t.length===0){return[]}const{workingParts:e}=this;const n=this.getActivePartsWithFallback();return i("ion-picker-column-internal",{class:"year-column",color:this.color,items:t,value:e.year,onIonChange:t=>{if(this.destroyCalendarListener){this.destroyCalendarListener()}this.setWorkingParts(Object.assign(Object.assign({},e),{year:t.detail.value}));this.setActiveParts(Object.assign(Object.assign({},n),{year:t.detail.value}));this.initializeCalendarListener();t.stopPropagation()}})}renderTimePickerColumns(t){if(["date","month","month-year","year"].includes(t)){return[]}const e=this.getActivePart();const n=e!==undefined;const{hoursData:i,minutesData:a,dayPeriodData:o}=J(this.locale,this.workingParts,this.hourCycle,n?this.minParts:undefined,n?this.maxParts:undefined,this.parsedHourValues,this.parsedMinuteValues);return[this.renderHourPickerColumn(i),this.renderMinutePickerColumn(a),this.renderDayPeriodPickerColumn(o)]}renderHourPickerColumn(t){const{workingParts:e}=this;if(t.length===0)return[];const n=this.getActivePartsWithFallback();return i("ion-picker-column-internal",{color:this.color,value:n.hour,items:t,numericInput:true,onIonChange:t=>{this.setWorkingParts(Object.assign(Object.assign({},e),{hour:t.detail.value}));this.setActiveParts(Object.assign(Object.assign({},n),{hour:t.detail.value}));t.stopPropagation()}})}renderMinutePickerColumn(t){const{workingParts:e}=this;if(t.length===0)return[];const n=this.getActivePartsWithFallback();return i("ion-picker-column-internal",{color:this.color,value:n.minute,items:t,numericInput:true,onIonChange:t=>{this.setWorkingParts(Object.assign(Object.assign({},e),{minute:t.detail.value}));this.setActiveParts(Object.assign(Object.assign({},n),{minute:t.detail.value}));t.stopPropagation()}})}renderDayPeriodPickerColumn(t){const{workingParts:e}=this;if(t.length===0){return[]}const n=this.getActivePartsWithFallback();const a=Q(this.locale);return i("ion-picker-column-internal",{style:a?{order:"-1"}:{},color:this.color,value:n.ampm,items:t,onIonChange:t=>{const i=ht(e,t.detail.value);this.setWorkingParts(Object.assign(Object.assign({},e),{ampm:t.detail.value,hour:i}));this.setActiveParts(Object.assign(Object.assign({},n),{ampm:t.detail.value,hour:i}));t.stopPropagation()}})}renderWheelView(t){const{locale:e}=this;const n=G(e);const a=n?"month-first":"year-first";return i("div",{class:{[`wheel-order-${a}`]:true}},this.renderWheelPicker(t))}renderCalendarHeader(t){const e=t==="ios"?b:f;const n=t==="ios"?y:g;const a=ut(this.workingParts,this.minParts,this.maxParts);const o=yt(this.workingParts,this.maxParts);const s=this.el.getAttribute("dir")||undefined;return i("div",{class:"calendar-header"},i("div",{class:"calendar-action-buttons"},i("div",{class:"calendar-month-year"},i("ion-item",{part:"month-year-button",ref:t=>this.monthYearToggleItemRef=t,button:true,"aria-label":"Show year picker",detail:false,lines:"none",onClick:()=>{var t;this.toggleMonthAndYearView();const{monthYearToggleItemRef:e}=this;if(e){const n=(t=e.shadowRoot)===null||t===void 0?void 0:t.querySelector(".item-native");if(n){const t=this.showMonthAndYear?"Hide year picker":"Show year picker";n.setAttribute("aria-label",t)}}}},i("ion-label",null,X(this.locale,this.workingParts),i("ion-icon",{"aria-hidden":"true",icon:this.showMonthAndYear?e:n,lazy:false,flipRtl:true})))),i("div",{class:"calendar-next-prev"},i("ion-buttons",null,i("ion-button",{"aria-label":"Previous month",disabled:a,onClick:()=>this.prevMonth()},i("ion-icon",{dir:s,"aria-hidden":"true",slot:"icon-only",icon:u,lazy:false,flipRtl:true})),i("ion-button",{"aria-label":"Next month",disabled:o,onClick:()=>this.nextMonth()},i("ion-icon",{dir:s,"aria-hidden":"true",slot:"icon-only",icon:y,lazy:false,flipRtl:true}))))),i("div",{class:"calendar-days-of-week","aria-hidden":"true"},_(this.locale,t,this.firstDayOfWeek%7).map((t=>i("div",{class:"day-of-week"},t)))))}renderMonth(t,e){const n=this.parsedYearValues===undefined||this.parsedYearValues.includes(e);const a=this.parsedMonthValues===undefined||this.parsedMonthValues.includes(t);const o=!n||!a;const s=mt({month:t,year:e,day:null},{minParts:Object.assign(Object.assign({},this.minParts),{day:null}),maxParts:Object.assign(Object.assign({},this.maxParts),{day:null})});const r=this.workingParts.month===t&&this.workingParts.year===e;const d=this.getActivePartsWithFallback();return i("div",{"aria-hidden":!r?"true":null,class:{"calendar-month":true,"calendar-month-disabled":!r&&s}},i("div",{class:"calendar-month-grid"},Z(t,e,this.firstDayOfWeek%7).map(((n,a)=>{const{day:s,dayOfWeek:r}=n;const{el:h,highlightedDates:c,isDateEnabled:p,multiple:m}=this;const u={month:t,day:s,year:e};const y=s===null;const{isActive:b,isToday:f,ariaLabel:g,ariaSelected:x,disabled:w,text:v}=pt(this.locale,u,this.activePartsClone,this.todayParts,this.minParts,this.maxParts,this.parsedDayValues);const k=L(u);let j=o||w;if(!j&&p!==undefined){try{j=!p(k)}catch(t){l("Exception thrown from provided `isDateEnabled` function. Please check your function and try again.",h,t)}}let C=undefined;if(c!==undefined&&!b&&s!==null){C=bt(c,k,h)}return i("button",{tabindex:"-1","data-day":s,"data-month":t,"data-year":e,"data-index":a,"data-day-of-week":r,disabled:j,class:{"calendar-day-padding":y,"calendar-day":true,"calendar-day-active":b,"calendar-day-today":f},style:C&&{color:C.textColor},"aria-hidden":y?"true":null,"aria-selected":x,"aria-label":g,onClick:()=>{if(y){return}this.setWorkingParts(Object.assign(Object.assign({},this.workingParts),{month:t,day:s,year:e}));if(m){this.setActiveParts({month:t,day:s,year:e},b)}else{this.setActiveParts(Object.assign(Object.assign({},d),{month:t,day:s,year:e}))}}},i("div",{class:"calendar-day-highlight",style:{backgroundColor:C===null||C===void 0?void 0:C.backgroundColor}}),v)}))))}renderCalendarBody(){return i("div",{class:"calendar-body ion-focusable",ref:t=>this.calendarBodyRef=t,tabindex:"0"},tt(this.workingParts).map((({month:t,year:e})=>this.renderMonth(t,e))))}renderCalendar(t){return i("div",{class:"datetime-calendar",key:"datetime-calendar"},this.renderCalendarHeader(t),this.renderCalendarBody())}renderTimeLabel(){const t=this.el.querySelector('[slot="time-label"]')!==null;if(!t&&!this.showDefaultTimeLabel){return}return i("slot",{name:"time-label"},"Time")}renderTimeOverlay(){const{hourCycle:t,isTimePopoverOpen:e,locale:n}=this;const a=et(n,t);const o=this.getActivePartsWithFallback();return[i("div",{class:"time-header"},this.renderTimeLabel()),i("button",{class:{"time-body":true,"time-body-active":e},part:`time-button${e?" active":""}`,"aria-expanded":"false","aria-haspopup":"true",onClick:async t=>{const{popoverRef:e}=this;if(e){this.isTimePopoverOpen=true;e.present(new CustomEvent("ionShadowTarget",{detail:{ionShadowTarget:t.target}}));await e.onWillDismiss();this.isTimePopoverOpen=false}}},nt(n,o,a)),i("ion-popover",{alignment:"center",translucent:true,overlayIndex:1,arrow:false,onWillPresent:t=>{const e=t.target.querySelectorAll("ion-picker-column-internal");e.forEach((t=>t.scrollActiveItemIntoView()))},style:{"--offset-y":"-10px","--min-width":"fit-content"},keyboardEvents:true,ref:t=>this.popoverRef=t},this.renderWheelPicker("time"))]}getHeaderSelectedDateText(){const{activeParts:t,multiple:e,titleSelectedDatesFormatter:n}=this;const i=Array.isArray(t);let a;if(e&&i&&t.length!==1){a=`${t.length} days`;if(n!==undefined){try{a=n(L(t))}catch(t){l("Exception in provided `titleSelectedDatesFormatter`: ",t)}}}else{a=it(this.locale,this.getActivePartsWithFallback())}return a}renderHeader(t=true){const e=this.el.querySelector('[slot="title"]')!==null;if(!e&&!this.showDefaultTitle){return}return i("div",{class:"datetime-header"},i("div",{class:"datetime-title"},i("slot",{name:"title"},"Select Date")),t&&i("div",{class:"datetime-selected-date"},this.getHeaderSelectedDateText()))}renderTime(){const{presentation:t}=this;const e=t==="time";return i("div",{class:"datetime-time"},e?this.renderWheelPicker():this.renderTimeOverlay())}renderCalendarViewMonthYearPicker(){return i("div",{class:"datetime-year"},this.renderWheelView("month-year"))}renderDatetime(t){const{presentation:e,preferWheel:n}=this;const i=e==="date"||e==="date-time"||e==="time-date";if(n&&i){return[this.renderHeader(false),this.renderWheelView(),this.renderFooter()]}switch(e){case"date-time":return[this.renderHeader(),this.renderCalendar(t),this.renderCalendarViewMonthYearPicker(),this.renderTime(),this.renderFooter()];case"time-date":return[this.renderHeader(),this.renderTime(),this.renderCalendar(t),this.renderCalendarViewMonthYearPicker(),this.renderFooter()];case"time":return[this.renderHeader(false),this.renderTime(),this.renderFooter()];case"month":case"month-year":case"year":return[this.renderHeader(false),this.renderWheelView(),this.renderFooter()];default:return[this.renderHeader(),this.renderCalendar(t),this.renderCalendarViewMonthYearPicker(),this.renderFooter()]}}render(){const{name:t,value:e,disabled:n,el:o,color:s,isPresented:r,readonly:d,showMonthAndYear:l,preferWheel:c,presentation:p,size:u}=this;const y=x(this);const b=p==="year"||p==="month"||p==="month-year";const f=l||b;const g=l&&!b;const w=p==="date"||p==="date-time"||p==="time-date";const v=w&&c;const k=w&&!c;h(true,o,t,at(e),n);return i(a,{"aria-disabled":n?"true":null,onFocus:this.onFocus,onBlur:this.onBlur,class:Object.assign({},m(s,{[y]:true,["datetime-presented"]:r,["datetime-readonly"]:d,["datetime-disabled"]:n,"show-month-and-year":f,"month-year-picker-open":g,[`datetime-presentation-${p}`]:true,[`datetime-size-${u}`]:true,[`datetime-prefer-wheel`]:v,[`datetime-grid`]:k}))},this.renderDatetime(y))}get el(){return o(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 wt=0;xt.style={ios:ft,md:gt};export{xt as ion_datetime}; //# sourceMappingURL=p-e91ce0ab.entry.js.map