UNPKG

@tindtechnologies/universalviewer

Version:

The Universal Viewer is a community-developed open source project on a mission to help you share your 📚📜📰📽️📻🗿 with the 🌎

1 lines 25.1 kB
"use strict";(self.webpackChunkUV=self.webpackChunkUV||[]).push([[8520],{884:(e,t,n)=>{n.d(t,{a:()=>i,b:()=>s,c:()=>u,d:()=>h,e:()=>f,f:()=>o,h:()=>r,i:()=>c,n:()=>l,p:()=>d,r:()=>a});var i=function(e){return"function"==typeof __zone_symbol__requestAnimationFrame?__zone_symbol__requestAnimationFrame(e):"function"==typeof requestAnimationFrame?requestAnimationFrame(e):setTimeout(e)},r=function(e){return!!e.shadowRoot&&!!e.attachShadow},o=function(e){var t=e.closest("ion-item");return t?t.querySelector("ion-label"):null},a=function(e,t,n,i,o){if(e||r(t)){var a=t.querySelector("input.aux-input");a||((a=t.ownerDocument.createElement("input")).type="hidden",a.classList.add("aux-input"),t.appendChild(a)),a.disabled=o,a.name=n,a.value=i||""}},u=function(e,t,n){return Math.max(e,Math.min(t,n))},s=function(e,t){if(!e){var n="ASSERT: "+t;throw console.error(n),new Error(n)}},l=function(e){return e.timeStamp||Date.now()},d=function(e){if(e){var t=e.changedTouches;if(t&&t.length>0){var n=t[0];return{x:n.clientX,y:n.clientY}}if(void 0!==e.pageX)return{x:e.pageX,y:e.pageY}}return{x:0,y:0}},c=function(e){var t="rtl"===document.dir;switch(e){case"start":return t;case"end":return!t;default:throw new Error('"'+e+'" is not a valid value for [side]. Use "start" or "end" instead.')}},h=function(e,t){var n=e._original||e;return{_original:e,emit:f(n.emit.bind(n),t)}},f=function(e,t){var n;return void 0===t&&(t=0),function(){for(var i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];clearTimeout(n),n=setTimeout.apply(void 0,[e,t].concat(i))}}},8520:(e,t,n)=>{n.r(t),n.d(t,{ion_datetime:()=>H});var i=n(5873),r=n(884),o=n(636),a=n(1178),u=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{s(i.next(e))}catch(e){o(e)}}function u(e){try{s(i.throw(e))}catch(e){o(e)}}function s(e){e.done?r(e.value):new n((function(t){t(e.value)})).then(a,u)}s((i=i.apply(e,t||[])).next())}))},s=function(e,t){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},l=function(e,t,n,i){if(e!==O&&e!==A){if(e===P)return void 0!==n&&void 0!==n.hour?n.hour<12?"AM":"PM":t?t.toUpperCase():"";if(e===z)return void 0!==n&&void 0!==n.hour?n.hour<12?"am":"pm":t||"";if(null==t)return"";if(e===D||e===C||e===F||e===N||e===I||e===Y)return x(t);if(e===M)return k(t);if(e===S)return(i.monthNames?i.monthNames:B)[t-1];if(e===E)return(i.monthShortNames?i.monthShortNames:L)[t-1];if(e===T||e===V){if(0===t)return"12";if(t>12&&(t-=12),e===T&&t<10)return"0"+t}return t.toString()}try{return t=new Date(n.year,n.month-1,n.day).getDay(),e===O?(i.dayNames?i.dayNames:j)[t]:(i.dayShortNames?i.dayShortNames:q)[t]}catch(e){}},d=function(e,t,n,i,r){return void 0===i&&(i=0),void 0===r&&(r=0),parseInt("1"+k(e)+x(t)+x(n)+x(i)+x(r),10)},c=function(e){return d(e.year,e.month,e.day,e.hour,e.minute)},h=/^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/,f=/^((\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/,m=function(e){var t=null;if(null!=e&&""!==e&&((t=f.exec(e))?(t.unshift(void 0,void 0),t[2]=t[3]=void 0):t=h.exec(e)),null!==t){for(var n=1;n<8;n++)t[n]=void 0!==t[n]?parseInt(t[n],10):void 0;var i=0;return t[9]&&t[10]&&(i=60*parseInt(t[10],10),t[11]&&(i+=parseInt(t[11],10)),"-"===t[9]&&(i*=-1)),{year:t[1],month:t[2],day:t[3],hour:t[4],minute:t[5],second:t[6],millisecond:t[7],tzOffset:i}}},p=function(e,t){return t===P||t===z?e.hour<12?"am":"pm":t===T||t===V?e.hour>12?e.hour-12:0===e.hour?12:e.hour:e[v(t)]},v=function(e){for(var t in _)if(_[t].f===e)return _[t].k},y=function(e){var t="";return void 0!==e.year?(t=k(e.year),void 0!==e.month&&(t+="-"+x(e.month),void 0!==e.day&&(t+="-"+x(e.day),void 0!==e.hour&&(t+="T"+x(e.hour)+":"+x(e.minute)+":"+x(e.second),e.millisecond>0&&(t+="."+w(e.millisecond)),void 0===e.tzOffset?t+="Z":t+=(e.tzOffset>0?"+":"-")+x(Math.floor(Math.abs(e.tzOffset/60)))+":"+x(e.tzOffset%60))))):void 0!==e.hour&&(t=x(e.hour)+":"+x(e.minute),void 0!==e.second&&(t+=":"+x(e.second),void 0!==e.millisecond&&(t+="."+w(e.millisecond)))),t},g=function(e,t){var n;if(null!=e)return"string"==typeof e&&(e=e.replace(/\[|\]/g,"").split(",")),Array.isArray(e)&&(n=e.map((function(e){return e.toString().trim()}))),void 0!==n&&0!==n.length||console.warn('Invalid "'+t+'Names". Must be an array of strings, or a comma separated string.'),n},b=function(e,t){var n;return"string"==typeof e&&(e=e.replace(/\[|\]|\s/g,"").split(",")),0===(n=Array.isArray(e)?e.map((function(e){return parseInt(e,10)})).filter(isFinite):[e]).length&&console.warn('Invalid "'+t+'Values". Must be an array of numbers, or a comma separated string of numbers.'),n},x=function(e){return("0"+(void 0!==e?Math.abs(e):"0")).slice(-2)},w=function(e){return("00"+(void 0!==e?Math.abs(e):"0")).slice(-3)},k=function(e){return("000"+(void 0!==e?Math.abs(e):"0")).slice(-4)},M="YYYY",D="YY",S="MMMM",E="MMM",C="MM",O="DDDD",A="DDD",F="DD",N="HH",T="hh",V="h",I="mm",Y="ss",P="A",z="a",_=[{f:M,k:"year"},{f:S,k:"month"},{f:O,k:"day"},{f:E,k:"month"},{f:A,k:"day"},{f:D,k:"year"},{f:C,k:"month"},{f:F,k:"day"},{f:N,k:"hour"},{f:T,k:"hour"},{f:I,k:"minute"},{f:Y,k:"second"},{f:"M",k:"month"},{f:"D",k:"day"},{f:"H",k:"hour"},{f:V,k:"hour"},{f:"m",k:"minute"},{f:"s",k:"second"},{f:P,k:"ampm"},{f:z,k:"ampm"}],j=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],q=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],B=["January","February","March","April","May","June","July","August","September","October","November","December"],L=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],W=[T,V,I,"m",Y,"s"],H=function(){function e(e){var t=this;(0,i.r)(this,e),this.inputId="ion-dt-"+U++,this.locale={},this.datetimeMin={},this.datetimeMax={},this.datetimeValue={},this.isExpanded=!1,this.name=this.inputId,this.disabled=!1,this.readonly=!1,this.displayFormat="MMM D, YYYY",this.cancelText="Cancel",this.doneText="Done",this.onClick=function(){t.setFocus(),t.open()},this.onFocus=function(){t.ionFocus.emit()},this.onBlur=function(){t.ionBlur.emit()},this.ionCancel=(0,i.c)(this,"ionCancel",7),this.ionChange=(0,i.c)(this,"ionChange",7),this.ionFocus=(0,i.c)(this,"ionFocus",7),this.ionBlur=(0,i.c)(this,"ionBlur",7),this.ionStyle=(0,i.c)(this,"ionStyle",7)}return e.prototype.disabledChanged=function(){this.emitStyle()},e.prototype.valueChanged=function(){this.updateDatetimeValue(this.value),this.emitStyle(),this.ionChange.emit({value:this.value})},e.prototype.componentWillLoad=function(){this.locale={monthNames:g(this.monthNames,"monthNames"),monthShortNames:g(this.monthShortNames,"monthShortNames"),dayNames:g(this.dayNames,"dayNames"),dayShortNames:g(this.dayShortNames,"dayShortNames")},this.updateDatetimeValue(this.value),this.emitStyle()},e.prototype.open=function(){return u(this,void 0,void 0,(function(){var e,t,n=this;return s(this,(function(i){switch(i.label){case 0:return this.disabled||this.isExpanded?[2]:(e=this.generatePickerOptions(),[4,a.k.create(e)]);case 1:return t=i.sent(),this.isExpanded=!0,t.onDidDismiss().then((function(){n.isExpanded=!1,n.setFocus()})),t.addEventListener("ionPickerColChange",(function(e){return u(n,void 0,void 0,(function(){var n,i,r,o;return s(this,(function(a){return n=e.detail,i=n.selectedIndex,r=n.options,(o={})[n.name]={value:r[i].value},this.updateDatetimeValue(o),t.columns=this.generateColumns(),[2]}))}))})),[4,t.present()];case 2:return i.sent(),[2]}}))}))},e.prototype.emitStyle=function(){this.ionStyle.emit({interactive:!0,datetime:!0,"has-placeholder":null!=this.placeholder,"has-value":this.hasValue(),"interactive-disabled":this.disabled})},e.prototype.updateDatetimeValue=function(e){!function(e,t){if(!t||"string"==typeof t){var n=function(e){void 0===e&&(e=""),null==e&&(e=""),10!==e.length&&7!==e.length||(e+=" ");var t="string"==typeof e&&e.length>0?new Date(e):new Date;return new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))}(t);Number.isNaN(n.getTime())||(t=n.toISOString())}if(t&&""!==t){if("string"==typeof t){if(t=m(t))return Object.assign(e,t),!0}else{if(t.year||t.hour||t.month||t.day||t.minute||t.second){t.ampm&&t.hour&&(t.hour.value="pm"===t.ampm.value?12===t.hour.value?12:t.hour.value+12:12===t.hour.value?0:t.hour.value);for(var i=0,r=Object.keys(t);i<r.length;i++){var o=r[i];e[o]=t[o].value}return!0}if(t.ampm)return t.hour={value:t.hour?t.hour.value:"pm"===t.ampm.value?e.hour<12?e.hour+12:e.hour:e.hour>=12?e.hour-12:e.hour},e.hour=t.hour.value,!0}console.warn('Error parsing date: "'+t+'". Please provide a valid ISO 8601 datetime format: https://www.w3.org/TR/NOTE-datetime')}else for(var a in e)e.hasOwnProperty(a)&&delete e[a]}(this.datetimeValue,e)},e.prototype.generatePickerOptions=function(){var e=this,t=(0,i.f)(this),n=Object.assign(Object.assign({mode:t},this.pickerOptions),{columns:this.generateColumns()}),r=n.buttons;return r&&0!==r.length||(n.buttons=[{text:this.cancelText,role:"cancel",handler:function(){e.updateDatetimeValue(e.value),e.ionCancel.emit()}},{text:this.doneText,handler:function(t){e.updateDatetimeValue(t);var n=new Date(y(e.datetimeValue));e.datetimeValue.tzOffset=-1*n.getTimezoneOffset(),e.value=y(e.datetimeValue)}}]),n},e.prototype.generateColumns=function(){var e=this,t=this.pickerFormat||this.displayFormat||R;if(0===t.length)return[];this.calcMinMax(),-1===(t=t.replace("DDDD","{~}").replace("DDD","{~}")).indexOf("D")&&(t=t.replace("{~}","D"));var n=function(e){var t=[];e=e.replace(/[^\w\s]/gi," "),_.forEach((function(t){t.f.length>1&&e.indexOf(t.f)>-1&&e.indexOf(t.f+t.f.charAt(0))<0&&(e=e.replace(t.f," "+t.f+" "))}));var n=e.split(" ").filter((function(e){return e.length>0}));return n.forEach((function(e,i){_.forEach((function(r){if(e===r.f){if((e===P||e===z)&&(t.indexOf(V)<0&&t.indexOf(T)<0||-1===W.indexOf(n[i-1])))return;t.push(e)}}))})),t}(t=t.replace(/{~}/g,"")).map((function(t){var n,i=v(t),r=e;n=r[i+"Values"]?b(r[i+"Values"],i):function(e,t,n){var i=[];if(e===M||e===D){if(void 0===n.year||void 0===t.year)throw new Error("min and max year is undefined");for(var r=n.year;r>=t.year;r--)i.push(r)}else if(e===S||e===E||e===C||"M"===e||e===T||e===V)for(r=1;r<13;r++)i.push(r);else if(e===O||e===A||e===F||"D"===e)for(r=1;r<32;r++)i.push(r);else if(e===N||"H"===e)for(r=0;r<24;r++)i.push(r);else if(e===I||"m"===e)for(r=0;r<60;r++)i.push(r);else if(e===Y||"s"===e)for(r=0;r<60;r++)i.push(r);else e!==P&&e!==z||i.push("am","pm");return i}(t,e.datetimeMin,e.datetimeMax);var o=n.map((function(n){return{value:n,text:l(t,n,void 0,e.locale)}})),a=function(e,t){var n=p(e,t);if(void 0!==n)return n;var i=m((new Date).toISOString());return p(i,t)}(e.datetimeValue,t),u=o.findIndex((function(e){return e.value===a}));return{name:i,selectedIndex:u>=0?u:0,options:o}})),i=this.datetimeMin,r=this.datetimeMax;return["month","day","hour","minute"].filter((function(e){return!n.find((function(t){return t.name===e}))})).forEach((function(e){i[e]=0,r[e]=0})),this.validateColumns(J(n))},e.prototype.validateColumns=function(e){var t=new Date,n=c(this.datetimeMin),i=c(this.datetimeMax),r=e.find((function(e){return"year"===e.name})),o=t.getFullYear();if(r){r.options.find((function(e){return e.value===t.getFullYear()}))||(o=r.options[0].value);var a=r.selectedIndex;if(void 0!==a){var u=r.options[a];u&&(o=u.value)}}var s,l=this.validateColumn(e,"month",1,n,i,[o,0,0,0,0],[o,12,31,23,59]),d=4===(s=l)||6===s||9===s||11===s?30:2===s?function(e){return e%4==0&&e%100!=0||e%400==0}(o)?29:28:31,h=this.validateColumn(e,"day",2,n,i,[o,l,0,0,0],[o,l,d,23,59]),f=this.validateColumn(e,"hour",3,n,i,[o,l,h,0,0],[o,l,h,23,59]);return this.validateColumn(e,"minute",4,n,i,[o,l,h,f,0],[o,l,h,f,59]),e},e.prototype.calcMinMax=function(){var e=(new Date).getFullYear();if(void 0!==this.yearValues){var t=b(this.yearValues,"year");void 0===this.min&&(this.min=Math.min.apply(Math,t).toString()),void 0===this.max&&(this.max=Math.max.apply(Math,t).toString())}else void 0===this.min&&(this.min=(e-100).toString()),void 0===this.max&&(this.max=e.toString());var n=this.datetimeMin=m(this.min),i=this.datetimeMax=m(this.max);n.year=n.year||e,i.year=i.year||e,n.month=n.month||1,i.month=i.month||12,n.day=n.day||1,i.day=i.day||31,n.hour=n.hour||0,i.hour=i.hour||23,n.minute=n.minute||0,i.minute=i.minute||59,n.second=n.second||0,i.second=i.second||59,n.year>i.year&&(console.error("min.year > max.year"),n.year=i.year-100),n.year===i.year&&(n.month>i.month?(console.error("min.month > max.month"),n.month=1):n.month===i.month&&n.day>i.day&&(console.error("min.day > max.day"),n.day=1))},e.prototype.validateColumn=function(e,t,n,i,o,a,u){var s=e.find((function(e){return e.name===t}));if(!s)return 0;for(var l=a.slice(),c=u.slice(),h=s.options,f=h.length-1,m=0,p=0;p<h.length;p++){var v=h[p],y=v.value;l[n]=v.value,c[n]=v.value,(v.disabled=y<a[n]||y>u[n]||d(c[0],c[1],c[2],c[3],c[4])<i||d(l[0],l[1],l[2],l[3],l[4])>o)||(f=Math.min(f,p),m=Math.max(m,p))}var g=s.selectedIndex=(0,r.c)(f,s.selectedIndex,m),b=s.options[g];return b?b.value:0},Object.defineProperty(e.prototype,"text",{get:function(){var e=this.displayFormat||this.pickerFormat||R;if(void 0!==this.value&&null!==this.value&&0!==this.value.length)return function(e,t,n){if(void 0!==t){var i=[],r=!1;if(_.forEach((function(o,a){if(e.indexOf(o.f)>-1){var u="{"+a+"}",s=l(o.f,t[o.k],t,n);r||void 0===s||null==t[o.k]||(r=!0),i.push(u,s||""),e=e.replace(o.f,u)}})),r){for(var o=0;o<i.length;o+=2)e=e.replace(i[o],i[o+1]);return e}}}(e,this.datetimeValue,this.locale)},enumerable:!0,configurable:!0}),e.prototype.hasValue=function(){return void 0!==this.text},e.prototype.setFocus=function(){this.buttonEl&&this.buttonEl.focus()},e.prototype.render=function(){var e,t=this,n=this,a=n.inputId,u=n.text,s=n.disabled,l=n.readonly,d=n.isExpanded,c=n.el,h=n.placeholder,f=(0,i.f)(this),m=a+"-lbl",p=(0,r.f)(c),v=void 0===u&&null!=h,y=void 0===u?null!=h?h:"":u;return p&&(p.id=m),(0,r.r)(!0,c,this.name,this.value,this.disabled),(0,i.h)(i.H,{onClick:this.onClick,role:"combobox","aria-disabled":s?"true":null,"aria-expanded":""+d,"aria-haspopup":"true","aria-labelledby":m,class:(e={},e[f]=!0,e["datetime-disabled"]=s,e["datetime-readonly"]=l,e["datetime-placeholder"]=v,e["in-item"]=(0,o.h)("ion-item",c),e)},(0,i.h)("div",{class:"datetime-text"},y),(0,i.h)("button",{type:"button",onFocus:this.onFocus,onBlur:this.onBlur,disabled:this.disabled,ref:function(e){return t.buttonEl=e}}))},Object.defineProperty(e.prototype,"el",{get:function(){return(0,i.d)(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e,"watchers",{get:function(){return{disabled:["disabledChanged"],value:["valueChanged"]}},enumerable:!0,configurable:!0}),Object.defineProperty(e,"style",{get:function(){return":host{padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:-ms-flexbox;display:flex;position:relative;min-width:16px;min-height:1.2em;font-family:var(--ion-font-family,inherit);text-overflow:ellipsis;white-space:nowrap;overflow:hidden;z-index:2}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}:host(.in-item){position:static}:host(.datetime-placeholder){color:var(--placeholder-color)}:host(.datetime-disabled){opacity:.3;pointer-events:none}:host(.datetime-readonly){pointer-events:none}button{left:0;top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none}:host-context([dir=rtl]) button,[dir=rtl] button{left:unset;right:unset;right:0}button::-moz-focus-inner{border:0}.datetime-text{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;-ms-flex:1;flex:1;min-height:inherit;direction:ltr;overflow:inherit}:host-context([dir=rtl]) .datetime-text,[dir=rtl] .datetime-text{direction:rtl}:host{--placeholder-color:var(--ion-placeholder-color,var(--ion-color-step-400,#999));--padding-top:10px;--padding-end:0;--padding-bottom:11px;--padding-start:16px}"},enumerable:!0,configurable:!0}),e}(),J=function(e){for(var t,n,i=[],r=0;r<e.length;r++){t=e[r],i.push(0);for(var o=0,a=t.options;o<a.length;o++)(n=a[o].text.length)>i[r]&&(i[r]=n)}return 2===i.length?(n=Math.max(i[0],i[1]),e[0].align="right",e[1].align="left",e[0].optionsWidth=e[1].optionsWidth=17*n+"px"):3===i.length&&(n=Math.max(i[0],i[2]),e[0].align="right",e[1].columnWidth=17*i[1]+"px",e[0].optionsWidth=e[2].optionsWidth=17*n+"px",e[2].align="left"),e},R="MMM D, YYYY",U=0},1178:(e,t,n)=>{n.d(t,{B:()=>O,a:()=>d,b:()=>l,c:()=>f,d:()=>g,e:()=>b,f:()=>k,g:()=>m,h:()=>v,i:()=>D,j:()=>y,k:()=>c,p:()=>h,s:()=>C});var i=n(5873),r=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{s(i.next(e))}catch(e){o(e)}}function u(e){try{s(i.throw(e))}catch(e){o(e)}}function s(e){e.done?r(e.value):new n((function(t){t(e.value)})).then(a,u)}s((i=i.apply(e,t||[])).next())}))},o=function(e,t){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},a=void 0,u=0,s=function(e){return{create:function(t){return m(e,t)},dismiss:function(t,n,i){return v(document,t,n,e,i)},getTop:function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,y(document,e)]}))}))}}},l=s("ion-alert"),d=s("ion-action-sheet"),c=s("ion-picker"),h=s("ion-popover"),f=function(e){var t=document;p(t);var n=u++;e.overlayIndex=n,e.hasAttribute("id")||(e.id="ion-overlay-"+n)},m=function(e,t){return customElements.whenDefined(e).then((function(){var n=document,i=n.createElement(e);return i.classList.add("overlay-hidden"),Object.assign(i,t),x(n).appendChild(i),i.componentOnReady()}))},p=function(e){0===u&&(u=1,e.addEventListener("focusin",(function(t){var n=y(e);if(n&&n.backdropDismiss&&!S(n,t.target)){var i=n.querySelector("input,button");i&&i.focus()}})),e.addEventListener("ionBackButton",(function(t){var n=y(e);n&&n.backdropDismiss&&t.detail.register(100,(function(){return n.dismiss(void 0,O)}))})),e.addEventListener("keyup",(function(t){if("Escape"===t.key){var n=y(e);n&&n.backdropDismiss&&n.dismiss(void 0,O)}})))},v=function(e,t,n,i,r){var o=y(e,i,r);return o?o.dismiss(t,n):Promise.reject("overlay does not exist")},y=function(e,t,n){var i=function(e,t){return void 0===t&&(t="ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker,ion-popover,ion-toast"),Array.from(e.querySelectorAll(t)).filter((function(e){return e.overlayIndex>0}))}(e,t);return void 0===n?i[i.length-1]:i.find((function(e){return e.id===n}))},g=function(e,t,n,u,s){return r(a,void 0,void 0,(function(){var r;return o(this,(function(o){switch(o.label){case 0:return e.presented?[2]:(e.presented=!0,e.willPresent.emit(),r=e.enterAnimation?e.enterAnimation:i.i.get(t,"ios"===e.mode?n:u),[4,w(e,r,e.el,s)]);case 1:return o.sent()&&e.didPresent.emit(),[2]}}))}))},b=function(e,t,n,u,s,l,d){return r(a,void 0,void 0,(function(){var r,a;return o(this,(function(o){switch(o.label){case 0:if(!e.presented)return[2,!1];e.presented=!1,o.label=1;case 1:return o.trys.push([1,3,,4]),e.willDismiss.emit({data:t,role:n}),r=e.leaveAnimation?e.leaveAnimation:i.i.get(u,"ios"===e.mode?s:l),[4,w(e,r,e.el,d)];case 2:return o.sent(),e.didDismiss.emit({data:t,role:n}),[3,4];case 3:return a=o.sent(),console.error(a),[3,4];case 4:return e.el.remove(),[2,!0]}}))}))},x=function(e){return e.querySelector("ion-app")||e.body},w=function(e,t,u,s){return r(a,void 0,void 0,(function(){var r,a,l,d,c;return o(this,(function(o){switch(o.label){case 0:if(e.animation)return e.animation.destroy(),e.animation=void 0,[2,!1];u.classList.remove("overlay-hidden"),r=u.shadowRoot||e.el,l=!0,o.label=1;case 1:return o.trys.push([1,4,,5]),[4,n.e(1605).then(n.bind(n,1605))];case 2:return[4,o.sent().create(t,r,s)];case 3:return a=o.sent(),[3,5];case 4:return o.sent(),(a=t(r,s)).fill("both"),l=!1,[3,5];case 5:return e.animation=a,e.animated&&i.i.getBoolean("animated",!0)||a.duration(0),e.keyboardClose&&a.beforeAddWrite((function(){var e=u.ownerDocument.activeElement;e&&e.matches("input, ion-input, ion-textarea")&&e.blur()})),[4,a.playAsync()];case 6:return d=o.sent(),c=void 0===d||a.hasCompleted,l&&a.destroy(),e.animation=void 0,[2,c]}}))}))},k=function(e,t){var n,i=new Promise((function(e){return n=e}));return M(e,t,(function(e){n(e.detail)})),i},M=function(e,t,n){var i=function(r){e.removeEventListener(t,i),n(r)};e.addEventListener(t,i)},D=function(e){return"cancel"===e||e===O},S=function(e,t){for(;t;){if(t===e)return!0;t=t.parentElement}return!1},E=function(e){return e()},C=function(e,t){if("function"==typeof e)return i.i.get("_zoneGate",E)((function(){try{return e(t)}catch(e){console.error(e)}}))},O="backdrop"},636:(e,t,n)=>{n.d(t,{c:()=>r,g:()=>o,h:()=>i,o:()=>u});var i=function(e,t){return null!==t.closest(e)},r=function(e){var t;return"string"==typeof e&&e.length>0?((t={"ion-color":!0})["ion-color-"+e]=!0,t):void 0},o=function(e){var t={};return function(e){return void 0!==e?(Array.isArray(e)?e:e.split(" ")).filter((function(e){return null!=e})).map((function(e){return e.trim()})).filter((function(e){return""!==e})):[]}(e).forEach((function(e){return t[e]=!0})),t},a=/^[a-z][a-z0-9+\-.]*:/,u=function(e,t,n){return i=void 0,r=void 0,u=function(){var i;return function(e,t){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}}(this,(function(r){return null!=e&&"#"!==e[0]&&!a.test(e)&&(i=document.querySelector("ion-router"))?(null!=t&&t.preventDefault(),[2,i.push(e,n)]):[2,!1]}))},new((o=void 0)||(o=Promise))((function(e,t){function n(e){try{s(u.next(e))}catch(e){t(e)}}function a(e){try{s(u.throw(e))}catch(e){t(e)}}function s(t){t.done?e(t.value):new o((function(e){e(t.value)})).then(n,a)}s((u=u.apply(i,r||[])).next())}));var i,r,o,u}}}]);