import{p as n}from"./p-b4215fed.js";
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const e=(n,e)=>n.month===e.month&&n.day===e.day&&n.year===e.year;const t=(n,e)=>!!(n.year<e.year||n.year===e.year&&n.month<e.month||n.year===e.year&&n.month===e.month&&n.day!==null&&n.day<e.day);const o=(n,e)=>!!(n.year>e.year||n.year===e.year&&n.month>e.month||n.year===e.year&&n.month===e.month&&n.day!==null&&n.day>e.day);const r=(e,r,s)=>{const d=Array.isArray(e)?e:[e];for(const i of d){if(r!==undefined&&t(i,r)||s!==undefined&&o(i,s)){n("The value provided to ion-datetime is out of bounds.\n\n"+`Min: ${JSON.stringify(r)}\n`+`Max: ${JSON.stringify(s)}\n`+`Value: ${JSON.stringify(e)}`);break}}};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const s=n=>n%4===0&&n%100!==0||n%400===0;const d=(n,e)=>{if(e!==undefined){return e==="h23"}const t=new Intl.DateTimeFormat(n,{hour:"numeric"});const o=t.resolvedOptions();if(o.hourCycle!==undefined){return o.hourCycle==="h23"}const r=new Date("5/18/2021 00:00");const s=t.formatToParts(r);const d=s.find((n=>n.type==="hour"));if(!d){throw new Error("Hour value not found from DateTimeFormat")}return d.value==="00"};const i=(n,e)=>n===4||n===6||n===9||n===11?30:n===2?s(e)?29:28:31;const u=(n,e={month:"numeric",year:"numeric"})=>{const t=new Intl.DateTimeFormat(n,e).formatToParts(new Date);return t[0].type==="month"};const a=n=>{const e=new Intl.DateTimeFormat(n,{hour:"numeric"}).formatToParts(new Date);return e[0].type==="dayPeriod"};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const c=/^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/;const f=/^((\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/;const l=n=>{if(n===undefined){return}let e=n;if(typeof n==="string"){e=n.replace(/\[|\]|\s/g,"").split(",")}let t;if(Array.isArray(e)){t=e.map((n=>parseInt(n,10))).filter(isFinite)}else{t=[e]}return t};const m=n=>({month:parseInt(n.getAttribute("data-month"),10),day:parseInt(n.getAttribute("data-day"),10),year:parseInt(n.getAttribute("data-year"),10),dayOfWeek:parseInt(n.getAttribute("data-day-of-week"),10)});function y(n){if(Array.isArray(n)){return n.map((n=>y(n)))}let e=null;if(n!=null&&n!==""){e=f.exec(n);if(e){e.unshift(undefined,undefined);e[2]=e[3]=undefined}else{e=c.exec(n)}}if(e===null){return undefined}for(let n=1;n<8;n++){e[n]=e[n]!==undefined?parseInt(e[n],10):undefined}return{year:e[1],month:e[2],day:e[3],hour:e[4],minute:e[5],ampm:e[4]<12?"am":"pm"}}const h=(n,e,r)=>{if(e&&t(n,e)){return e}else if(r&&o(n,r)){return r}return n};const v=n=>n>=12?"pm":"am";const w=(n,e)=>{const{month:t,day:o,year:r,hour:s,minute:d}=y(n);const u=r!==null&&r!==void 0?r:e.year;const a=t!==null&&t!==void 0?t:12;return{month:a,day:o!==null&&o!==void 0?o:i(a,u),year:u,hour:s!==null&&s!==void 0?s:23,minute:d!==null&&d!==void 0?d:59}};const $=(n,e)=>{const{month:t,day:o,year:r,hour:s,minute:d}=y(n);return{month:t!==null&&t!==void 0?t:1,day:o!==null&&o!==void 0?o:1,year:r!==null&&r!==void 0?r:e.year,hour:s!==null&&s!==void 0?s:0,minute:d!==null&&d!==void 0?d:0}};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const p=n=>("0"+(n!==undefined?Math.abs(n):"0")).slice(-2);const T=n=>("000"+(n!==undefined?Math.abs(n):"0")).slice(-4);function O(n){if(Array.isArray(n)){return n.map((n=>O(n)))}let e="";if(n.year!==undefined){e=T(n.year);if(n.month!==undefined){e+="-"+p(n.month);if(n.day!==undefined){e+="-"+p(n.day);if(n.hour!==undefined){e+=`T${p(n.hour)}:${p(n.minute)}:00`}}}}else if(n.hour!==undefined){e=p(n.hour)+":"+p(n.minute)}return e}const I=(n,e)=>{if(e===undefined){return n}if(e==="am"){if(n===12){return 0}return n}if(n===12){return 12}return n+12};const D=n=>{const{dayOfWeek:e}=n;if(e===null||e===undefined){throw new Error("No day of week provided")}return Z(n,e)};const b=n=>{const{dayOfWeek:e}=n;if(e===null||e===undefined){throw new Error("No day of week provided")}return C(n,6-e)};const j=n=>C(n,1);const M=n=>Z(n,1);const k=n=>Z(n,7);const x=n=>C(n,7);const Z=(n,e)=>{const{month:t,day:o,year:r}=n;if(o===null){throw new Error("No day provided")}const s={month:t,day:o,year:r};s.day=o-e;if(s.day<1){s.month-=1}if(s.month<1){s.month=12;s.year-=1}if(s.day<1){const n=i(s.month,s.year);s.day=n+s.day}return s};const C=(n,e)=>{const{month:t,day:o,year:r}=n;if(o===null){throw new Error("No day provided")}const s={month:t,day:o,year:r};const d=i(t,r);s.day=o+e;if(s.day>d){s.day-=d;s.month+=1}if(s.month>12){s.month=1;s.year+=1}return s};const U=n=>{const e=n.month===1?12:n.month-1;const t=n.month===1?n.year-1:n.year;const o=i(e,t);const r=o<n.day?o:n.day;return{month:e,year:t,day:r}};const G=n=>{const e=n.month===12?1:n.month+1;const t=n.month===12?n.year+1:n.year;const o=i(e,t);const r=o<n.day?o:n.day;return{month:e,year:t,day:r}};const N=(n,e)=>{const t=n.month;const o=n.year+e;const r=i(t,o);const s=r<n.day?r:n.day;return{month:t,year:o,day:s}};const g=n=>N(n,-1);const A=n=>N(n,1);const E=(n,e,t)=>{if(e){return n}return I(n,t)};const W=(n,e)=>{const{ampm:t,hour:o}=n;let r=o;if(t==="am"&&e==="pm"){r=I(r,"pm")}else if(t==="pm"&&e==="am"){r=Math.abs(r-12)}return r};const F=(n,t,o)=>{const{month:r,day:s,year:d}=n;const u=h(Object.assign({},n),t,o);const a=i(r,d);if(s!==null&&a<s){u.day=a}if(t!==undefined&&e(u,t)){if(u.hour!==undefined&&t.hour!==undefined){if(u.hour<t.hour){u.hour=t.hour;u.minute=t.minute}else if(u.hour===t.hour&&u.minute!==undefined&&t.minute!==undefined&&u.minute<t.minute){u.minute=t.minute}}}if(o!==undefined&&e(n,o)){if(u.hour!==undefined&&o.hour!==undefined){if(u.hour>o.hour){u.hour=o.hour;u.minute=o.minute}else if(u.hour===o.hour&&u.minute!==undefined&&o.minute!==undefined&&u.minute>o.minute){u.minute=o.minute}}}return u};const J=(n,e,t,o,r,s)=>{const{hour:d,minute:i,day:u,month:a,year:c}=n;const f=Object.assign(Object.assign({},n),{dayOfWeek:undefined});if(e!==undefined){f.month=P(a,e)}if(u!==null&&t!==undefined){f.day=P(u,t)}if(o!==undefined){f.year=P(c,o)}if(d!==undefined&&r!==undefined){f.hour=P(d,r);f.ampm=v(f.hour)}if(i!==undefined&&s!==undefined){f.minute=P(i,s)}return f};const P=(n,e)=>{let t=e[0];let o=Math.abs(t-n);for(let r=1;r<e.length;r++){const s=e[r];const d=Math.abs(s-n);if(d<o){t=s;o=d}}return t};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const S=n=>{if(n===undefined){return""}return n.toUpperCase()};const H=(n,e,t)=>{const o={hour:e.hour,minute:e.minute};if(o.hour===undefined||o.minute===undefined){return"Invalid Time"}return new Intl.DateTimeFormat(n,{hour:"numeric",minute:"numeric",timeZone:"UTC",hourCycle:t?"h23":"h12"}).format(new Date(O(Object.assign({year:2023,day:1,month:1},o))+"Z"))};const R=n=>{const e=n.toString();if(e.length>1){return e}return`0${e}`};const q=(n,e)=>{if(e){return R(n)}if(n===0){return"12"}return n.toString()};const z=(n,e,t)=>{if(t.day===null){return null}const o=new Date(`${t.month}/${t.day}/${t.year} GMT+0000`);const r=new Intl.DateTimeFormat(n,{weekday:"long",month:"long",day:"numeric",timeZone:"UTC"}).format(o);return e?`Today, ${r}`:r};const B=(n,e)=>{const t=new Date(`${e.month}/${e.day}/${e.year} GMT+0000`);return new Intl.DateTimeFormat(n,{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}).format(t)};const K=(n,e)=>{const t=new Date(`${e.month}/${e.day}/${e.year} GMT+0000`);return new Intl.DateTimeFormat(n,{month:"long",year:"numeric",timeZone:"UTC"}).format(t)};const L=(n,e)=>Y(n,e,{month:"short",day:"numeric",year:"numeric"});const Q=(n,e)=>_(n,e,{day:"numeric"}).find((n=>n.type==="day")).value;const V=(n,e)=>Y(n,e,{year:"numeric"});const X=n=>{const e=n.hour!==undefined&&n.minute!==undefined?` ${n.hour}:${n.minute}`:"";return new Date(`${n.month}/${n.day}/${n.year}${e} GMT+0000`)};const Y=(n,e,t)=>{const o=X(e);return nn(n,t).format(o)};const _=(n,e,t)=>{const o=X(e);return nn(n,t).formatToParts(o)};const nn=(n,e)=>new Intl.DateTimeFormat(n,Object.assign(Object.assign({},e),{timeZone:"UTC"}));const en=n=>{if("RelativeTimeFormat"in Intl){const e=new Intl.RelativeTimeFormat(n,{numeric:"auto"}).format(0,"day");return e.charAt(0).toUpperCase()+e.slice(1)}else{return"Today"}};const tn=n=>{const e=n.getTimezoneOffset();n.setMinutes(n.getMinutes()-e);return n};const on=tn(new Date("2022T01:00"));const rn=tn(new Date("2022T13:00"));const sn=(n,e)=>{const t=e==="am"?on:rn;const o=new Intl.DateTimeFormat(n,{hour:"numeric",timeZone:"UTC"}).formatToParts(t).find((n=>n.type==="dayPeriod"));if(o){return o.value}return S(e)};const dn=n=>Array.isArray(n)?n.join(","):n;
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const un=()=>tn(new Date).toISOString();const an=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59];const cn=[0,1,2,3,4,5,6,7,8,9,10,11];const fn=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23];const ln=(n,e,t=0)=>{const o=e==="ios"?"short":"narrow";const r=new Intl.DateTimeFormat(n,{weekday:o});const s=new Date("11/01/2020");const d=[];for(let n=t;n<t+7;n++){const e=new Date(s);e.setDate(e.getDate()+n);d.push(r.format(e))}return d};const mn=(n,e,t)=>{const o=i(n,e);const r=new Date(`${n}/1/${e}`).getDay();const s=r>=t?r-(t+1):6-(t-r);let d=[];for(let n=1;n<=o;n++){d.push({day:n,dayOfWeek:(s+n)%7})}for(let n=0;n<=s;n++){d=[{day:null,dayOfWeek:null},...d]}return d};const yn=(n,r="h12",s,d,i,u)=>{const a=r==="h23";let c=a?fn:cn;let f=an;let l=true;let m=true;if(i){c=c.filter((n=>i.includes(n)))}if(u){f=f.filter((n=>u.includes(n)))}if(s){if(e(n,s)){if(s.hour!==undefined){c=c.filter((e=>{const t=n.ampm==="pm"?(e+12)%24:e;return(a?e:t)>=s.hour}));l=s.hour<13}if(s.minute!==undefined){let e=false;if(s.hour!==undefined&&n.hour!==undefined){if(n.hour>s.hour){e=true}}f=f.filter((n=>{if(e){return true}return n>=s.minute}))}}else if(t(n,s)){c=[];f=[];l=m=false}}if(d){if(e(n,d)){if(d.hour!==undefined){c=c.filter((e=>{const t=n.ampm==="pm"?(e+12)%24:e;return(a?e:t)<=d.hour}));m=d.hour>=12}if(d.minute!==undefined&&n.hour===d.hour){f=f.filter((n=>n<=d.minute))}}else if(o(n,d)){c=[];f=[];l=m=false}}return{hours:c,minutes:f,am:l,pm:m}};const hn=n=>[U(n),{month:n.month,year:n.year,day:n.day},G(n)];const vn=(n,e,t,o,r,s={month:"long"})=>{const{year:d}=e;const i=[];if(r!==undefined){let e=r;if((o===null||o===void 0?void 0:o.month)!==undefined){e=e.filter((n=>n<=o.month))}if((t===null||t===void 0?void 0:t.month)!==undefined){e=e.filter((n=>n>=t.month))}e.forEach((e=>{const t=new Date(`${e}/1/${d} GMT+0000`);const o=new Intl.DateTimeFormat(n,Object.assign(Object.assign({},s),{timeZone:"UTC"})).format(t);i.push({text:o,value:e})}))}else{const e=o&&o.year===d?o.month:12;const r=t&&t.year===d?t.month:1;for(let t=r;t<=e;t++){const e=new Date(`${t}/1/${d} GMT+0000`);const o=new Intl.DateTimeFormat(n,Object.assign(Object.assign({},s),{timeZone:"UTC"})).format(e);i.push({text:o,value:t})}}return i};const wn=(n,e,t,o,r,s={day:"numeric"})=>{const{month:d,year:u}=e;const a=[];const c=i(d,u);const f=(o===null||o===void 0?void 0:o.day)!==null&&(o===null||o===void 0?void 0:o.day)!==undefined&&o.year===u&&o.month===d?o.day:c;const l=(t===null||t===void 0?void 0:t.day)!==null&&(t===null||t===void 0?void 0:t.day)!==undefined&&t.year===u&&t.month===d?t.day:1;if(r!==undefined){let e=r;e=e.filter((n=>n>=l&&n<=f));e.forEach((e=>{const t=new Date(`${d}/${e}/${u} GMT+0000`);const o=new Intl.DateTimeFormat(n,Object.assign(Object.assign({},s),{timeZone:"UTC"})).format(t);a.push({text:o,value:e})}))}else{for(let e=l;e<=f;e++){const t=new Date(`${d}/${e}/${u} GMT+0000`);const o=new Intl.DateTimeFormat(n,Object.assign(Object.assign({},s),{timeZone:"UTC"})).format(t);a.push({text:o,value:e})}}return a};const $n=(n,e,t,o,r)=>{var s,d;let i=[];if(r!==undefined){i=r;if((o===null||o===void 0?void 0:o.year)!==undefined){i=i.filter((n=>n<=o.year))}if((t===null||t===void 0?void 0:t.year)!==undefined){i=i.filter((n=>n>=t.year))}}else{const{year:n}=e;const r=(s=o===null||o===void 0?void 0:o.year)!==null&&s!==void 0?s:n;const u=(d=t===null||t===void 0?void 0:t.year)!==null&&d!==void 0?d:n-100;for(let n=u;n<=r;n++){i.push(n)}}return i.map((t=>({text:V(n,{year:t,month:e.month,day:e.day}),value:t})))};const pn=(n,e)=>{if(n.month===e.month&&n.year===e.year){return[n]}return[n,...pn(G(n),e)]};const Tn=(n,t,o,r,s,d)=>{let i=[];let u=[];let a=pn(o,r);if(d){a=a.filter((({month:n})=>d.includes(n)))}a.forEach((d=>{const a={month:d.month,day:null,year:d.year};const c=wn(n,a,o,r,s,{month:"short",day:"numeric",weekday:"short"});const f=[];const l=[];c.forEach((o=>{const r=e(Object.assign(Object.assign({},a),{day:o.value}),t);l.push({text:r?en(n):o.text,value:`${a.year}-${a.month}-${o.value}`});f.push({month:a.month,year:a.year,day:o.value})}));u=[...u,...f];i=[...i,...l]}));return{parts:u,items:i}};const On=(n,e,t,o,r,s,i)=>{const u=d(n,t);const{hours:a,minutes:c,am:f,pm:l}=yn(e,u?"h23":"h12",o,r,s,i);const m=a.map((n=>({text:q(n,u),value:E(n,u,e.ampm)})));const y=c.map((n=>({text:R(n),value:n})));const h=[];if(f&&!u){h.push({text:sn(n,"am"),value:"am"})}if(l&&!u){h.push({text:sn(n,"pm"),value:"pm"})}return{minutesData:y,hoursData:m,dayPeriodData:h}};export{wn as A,$n as B,u as C,On as D,a as E,ln as F,K as G,mn as H,hn as I,d as J,H as K,B as L,dn as M,A as N,g as O,h as P,v as Q,W as R,Y as S,L as T,Q as a,o as b,e as c,U as d,G as e,m as f,z as g,b as h,t as i,D as j,M as k,j as l,k as m,x as n,w as o,$ as p,y as q,l as r,O as s,un as t,J as u,F as v,r as w,i as x,Tn as y,vn as z};
//# sourceMappingURL=p-08cc8763.js.map