!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.ons=e()}(this,function(){"use strict";function t(t){mt.set(t,!0)}function e(t){var e=gt.get(t,[])||[];gt.delete(t),e.forEach(function(t){return t()})}function n(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};if(function(t,e){gt.has(t)||gt.set(t,[]),gt.get(t).push(e)}(n,i),function(e){return e.childNodes.length>0&&t(e),mt.has(e)}(n))e(n);else{new MutationObserver(function(i){t(n),e(n)}).observe(n,{childList:!0,characterData:!0}),setImmediate(function(){t(n),e(n)})}}function i(t){t._destroy instanceof Function?t._destroy():t.remove()}function r(t,e){return e={exports:{}},t(e,e.exports),e.exports}function o(t){var e=Fn.has(t),n=/^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(t);return!e&&n}function a(t){var e=t.isConnected;if(void 0!==e)return e;for(var n=t;n&&!(n.__CE_isImportDocument||n instanceof Document);)n=n.parentNode||(window.ShadowRoot&&n instanceof ShadowRoot?n.host:void 0);return!(!n||!(n.__CE_isImportDocument||n instanceof Document))}function s(t,e){for(var n=e;n&&n!==t&&!n.nextSibling;)n=n.parentNode;return n&&n!==t?n.nextSibling:null}function u(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set,i=t;i;){if(i.nodeType===Node.ELEMENT_NODE){var r=i;e(r);var o=r.localName;if("link"===o&&"import"===r.getAttribute("rel")){var a=r.import;if(a instanceof Node&&!n.has(a)){n.add(a);for(var l=a.firstChild;l;l=l.nextSibling)u(l,e,n)}i=s(t,r);continue}if("template"===o){i=s(t,r);continue}var c=r.__CE_shadowRoot;if(c)for(var h=c.firstChild;h;h=h.nextSibling)u(h,e,n)}i=function(t,e){return e.firstChild?e.firstChild:s(t,e)}(t,i)}}function l(t,e,n){t[e]=n}var c=function(){var t=window.getComputedStyle(document.documentElement,""),e=(Array.prototype.slice.call(t).join("").match(/-(moz|webkit|ms)-/)||""===t.OLink&&["","o"])[1];return function(t){return"-"+e+"-"+G.hyphenate(t)}}(),h=function(t,e){return Object.keys(e).forEach(function(n){n in t.style?t.style[n]=e[n]:c(n)in t.style?t.style[c(n)]=e[n]:G.warn("No such style property: "+n)}),t};h.clear=function(t){for(var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"").split(/\s+/).reduce(function(t,e){return t.concat([G.hyphenate(e),c(e)])},[]),n=[],i=t.style.length-1;i>=0;i--)!function(i){var r=t.style[i];(0===e.length||e.some(function(t){return 0===r.indexOf(t)}))&&n.push(r)}(i);n.forEach(function(e){return t.style[e]=""}),""===t.getAttribute("style")&&t.removeAttribute("style")};var d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f=(function(){function t(t){this.value=t}function e(e){function n(r,o){try{var a=e[r](o),s=a.value;s instanceof t?Promise.resolve(s.value).then(function(t){n("next",t)},function(t){n("throw",t)}):i(a.done?"return":"normal",a.value)}catch(t){i("throw",t)}}function i(t,e){switch(t){case"return":r.resolve({value:e,done:!0});break;case"throw":r.reject(e);break;default:r.resolve({value:e,done:!1})}(r=r.next)?n(r.key,r.arg):o=null}var r,o;this._invoke=function(t,e){return new Promise(function(i,a){var s={key:t,arg:e,resolve:i,reject:a,next:null};o?o=o.next=s:(r=o=s,n(t,e))})},"function"!=typeof e.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(e.prototype[Symbol.asyncIterator]=function(){return this}),e.prototype.next=function(t){return this._invoke("next",t)},e.prototype.throw=function(t){return this._invoke("throw",t)},e.prototype.return=function(t){return this._invoke("return",t)}}(),function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}),p=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),m=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},g=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},v=function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,i)}if("value"in r)return r.value;var a=r.get;if(void 0!==a)return a.call(i)},_=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},b=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},y=function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)},k=window.HTMLElement,w=new(function(){function t(){f(this,t),this._selectedPlatform=null,this._ignorePlatformSelect=!1}return p(t,[{key:"select",value:function(t){"string"==typeof t&&(this._selectedPlatform=t.trim().toLowerCase())}},{key:"_getSelectedPlatform",value:function(){return this._ignorePlatformSelect?null:this._selectedPlatform}},{key:"_runOnActualPlatform",value:function(t){this._ignorePlatformSelect=!0;var e=t();return this._ignorePlatformSelect=!1,e}},{key:"isWebView",value:function(){if("loading"===document.readyState||"uninitialized"==document.readyState)throw new Error("isWebView() method is available after dom contents loaded.");return!!(window.cordova||window.phonegap||window.PhoneGap)}},{key:"isIPhone",value:function(){return/iPhone/i.test(navigator.userAgent)}},{key:"isIPhoneX",value:function(){return this.isIPhone()&&375===window.screen.width&&812===window.screen.height}},{key:"isIPad",value:function(){return/iPad/i.test(navigator.userAgent)}},{key:"isIPod",value:function(){return/iPod/i.test(navigator.userAgent)}},{key:"isIOS",value:function(){return this._getSelectedPlatform()?"ios"===this._getSelectedPlatform():"object"!==("undefined"==typeof device?"undefined":d(device))||/browser/i.test(device.platform)?/iPhone|iPad|iPod/i.test(navigator.userAgent):/iOS/i.test(device.platform)}},{key:"isIOS7above",value:function(){if("object"===("undefined"==typeof device?"undefined":d(device))&&!/browser/i.test(device.platform))return/iOS/i.test(device.platform)&&parseInt(device.version.split(".")[0])>=7;if(/iPhone|iPad|iPod/i.test(navigator.userAgent)){var t=(navigator.userAgent.match(/\b[0-9]+_[0-9]+(?:_[0-9]+)?\b/)||[""])[0].replace(/_/g,".");return parseInt(t.split(".")[0])>=7}return!1}},{key:"isIOSSafari",value:function(){var t=window.navigator,e=t.userAgent;return!(!this.isIOS()||-1===e.indexOf("Safari")||-1===e.indexOf("Version")||t.standalone)}},{key:"isWKWebView",value:function(){var t=/constructor/i.test(k);return!(!(this.isIOS()&&window.webkit&&window.webkit.messageHandlers&&window.indexedDB)||t)}},{key:"isUIWebView",value:function(){return!(!this.isIOS()||this.isIOSSafari()||this.isWKWebView())}},{key:"isAndroidPhone",value:function(){return/Android/i.test(navigator.userAgent)&&/Mobile/i.test(navigator.userAgent)}},{key:"isAndroidTablet",value:function(){return/Android/i.test(navigator.userAgent)&&!/Mobile/i.test(navigator.userAgent)}},{key:"isAndroid",value:function(){return this._getSelectedPlatform()?"android"===this._getSelectedPlatform():/Android/i.test("object"!==("undefined"==typeof device?"undefined":d(device))||/browser/i.test(device.platform)?navigator.userAgent:device.platform)}},{key:"isWP",value:function(){return this._getSelectedPlatform()?"wp"===this._getSelectedPlatform():"object"!==("undefined"==typeof device?"undefined":d(device))||/browser/i.test(device.platform)?/Windows Phone|IEMobile|WPDesktop/i.test(navigator.userAgent):/Win32NT|WinCE/i.test(device.platform)}},{key:"isBlackBerry",value:function(){return this._getSelectedPlatform()?"blackberry"===this._getSelectedPlatform():"object"!==("undefined"==typeof device?"undefined":d(device))||/browser/i.test(device.platform)?/BlackBerry|RIM Tablet OS|BB10/i.test(navigator.userAgent):/BlackBerry/i.test(device.platform)}},{key:"isOpera",value:function(){return this._getSelectedPlatform()?"opera"===this._getSelectedPlatform():!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0}},{key:"isFirefox",value:function(){return this._getSelectedPlatform()?"firefox"===this._getSelectedPlatform():"undefined"!=typeof InstallTrigger}},{key:"isSafari",value:function(){return this._getSelectedPlatform()?"safari"===this._getSelectedPlatform():Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0||"[object SafariRemoteNotification]"===(!window["safari"]||safari.pushNotification).toString()}},{key:"isChrome",value:function(){return this._getSelectedPlatform()?"chrome"===this._getSelectedPlatform():!(!window.chrome||window.opera||navigator.userAgent.indexOf(" OPR/")>=0||navigator.userAgent.indexOf(" Edge/")>=0)}},{key:"isIE",value:function(){return this._getSelectedPlatform()?"ie"===this._getSelectedPlatform():!!document.documentMode}},{key:"isEdge",value:function(){return this._getSelectedPlatform()?"edge"===this._getSelectedPlatform():navigator.userAgent.indexOf(" Edge/")>=0}},{key:"getMobileOS",value:function(){return this.isAndroid()?"android":this.isIOS()?"ios":this.isWP()?"wp":"other"}},{key:"getIOSDevice",value:function(){return this.isIPhone()?"iphone":this.isIPad()?"ipad":this.isIPod()?"ipod":"na"}}]),t}()),E={_variables:{},defineVariable:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"!=typeof t)throw new Error("Variable name must be a string.");if("string"!=typeof e&&"function"!=typeof e)throw new Error("Variable value must be a string or a function.");if(this._variables.hasOwnProperty(t)&&!n)throw new Error('"'+t+'" is already defined.');this._variables[t]=e},getVariable:function(t){return this._variables.hasOwnProperty(t)?this._variables[t]:null},removeVariable:function(t){delete this._variables[t]},getAllVariables:function(){return this._variables},_parsePart:function(t){var e=void 0,n=!1,i=0,r=[];if(0===t.length)throw new Error("Unable to parse empty string.");for(var o=0;o<t.length;o++)if("$"===(e=t.charAt(o))&&"{"===t.charAt(o+1)){if(n)throw new Error("Nested interpolation not supported.");t.substring(i,o).length>0&&r.push(t.substring(i,o)),i=o,n=!0}else if("}"===e){if(!n)throw new Error("} must be preceeded by ${");t.substring(i,o+1).length>0&&r.push(t.substring(i,o+1)),i=o+1,n=!1}if(n)throw new Error("Unterminated interpolation.");return r.push(t.substring(i,t.length)),r},_replaceToken:function(t){var e=t.match(/^\${(.*?)}$/);if(e){var n=e[1].trim(),i=this.getVariable(n);if(null===i)throw new Error('Variable "'+n+'" does not exist.');if("string"==typeof i)return i;var r=i();if("string"!=typeof r)throw new Error("Must return a string.");return r}return t},_replaceTokens:function(t){return t.map(this._replaceToken.bind(this))},_parseExpression:function(t){return t.split(",").map(function(t){return t.trim()}).map(this._parsePart.bind(this)).map(this._replaceTokens.bind(this)).map(function(t){return t.join("")})},evaluate:function(t){return t?this._parseExpression(t):[]}};E.defineVariable("mobileOS",w.getMobileOS()),E.defineVariable("iOSDevice",w.getIOSDevice()),E.defineVariable("runtime",function(){return w.isWebView()?"cordova":"browser"});var C={};C.config={autoStatusBarFill:!0,animationsDisabled:!1,warningsDisabled:!1},C.nullElement=window.document.createElement("div"),C.isEnabledAutoStatusBarFill=function(){return!!C.config.autoStatusBarFill},C.normalizePageHTML=function(t){return(""+t).trim()},C.waitDOMContentLoaded=function(t){if("loading"===window.document.readyState||"uninitialized"==window.document.readyState){window.document.addEventListener("DOMContentLoaded",function e(){t(),window.document.removeEventListener("DOMContentLoaded",e)})}else setImmediate(t)},C.autoStatusBarFill=function(t){var e=function e(){C.shouldFillStatusBar()&&t(),document.removeEventListener("deviceready",e)};"object"===("undefined"==typeof device?"undefined":d(device))?document.addEventListener("deviceready",e):-1===["complete","interactive"].indexOf(document.readyState)?C.waitDOMContentLoaded(e):e()},C.shouldFillStatusBar=function(){return C.isEnabledAutoStatusBarFill()&&(w.isWebView()&&w.isIOS7above()&&!w.isIPhoneX()||document.body.querySelector(".ons-status-bar-mock.ios"))},C.templateStore={_storage:{},get:function(t){return C.templateStore._storage[t]||null},set:function(t,e){C.templateStore._storage[t]=e}},window.document.addEventListener("_templateloaded",function(t){"ons-template"===t.target.nodeName.toLowerCase()&&C.templateStore.set(t.templateId,t.template)},!1),C.waitDOMContentLoaded(function(){function t(t){for(var e=window.document.querySelectorAll(t),n=0;n<e.length;n++)C.templateStore.set(e[n].getAttribute("id"),e[n].textContent||e[n].content)}t('script[type="text/ons-template"]'),t('script[type="text/template"]'),t('script[type="text/ng-template"]'),t("template")}),C.getTemplateHTMLAsync=function(t){return new Promise(function(e,n){C.waitDOMContentLoaded(function(){var i=C.templateStore.get(t);if(i){if(i instanceof DocumentFragment)return e(i);var r="string"==typeof i?i:i[1];return e(C.normalizePageHTML(r))}var o=window.document.getElementById(t);if(o){var a=o.textContent||o.content;return e(a)}var s=new XMLHttpRequest;s.open("GET",t,!0),s.onload=function(){var i=s.responseText;if(s.status>=400&&s.status<600)n(i);else{var r=G.createFragment(i);G.arrayFrom(r.querySelectorAll("script")).forEach(function(t){var e=document.createElement("script");e.type=t.type||"text/javascript",e.appendChild(document.createTextNode(t.text||t.textContent||t.innerHTML)),t.parentNode.replaceChild(e,t)}),C.templateStore.set(t,r),e(r)}},s.onerror=function(){throw new Error("The page is not found: "+t)},s.send(null)})})},C.getPageHTMLAsync=function(t){var e=E.evaluate(t);return function t(n){return"string"!=typeof n?Promise.reject("Must specify a page."):C.getTemplateHTMLAsync(n).catch(function(n){return 0===e.length?Promise.reject(n):t(e.shift())})}(e.shift())};var A=function(){function t(e){if(f(this,t),this._animators=e.animators,this._baseClass=e.baseClass,this._baseClassName=e.baseClassName||e.baseClass.name,this._animation=e.defaultAnimation||"default",this._animationOptions=e.defaultAnimationOptions||{},!this._animators[this._animation])throw new Error("No such animation: "+this._animation)}return p(t,[{key:"setAnimationOptions",value:function(t){this._animationOptions=t}},{key:"newAnimator",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments[1],n=null;if(t.animation instanceof this._baseClass)return t.animation;var i=null;if("string"==typeof t.animation&&(i=this._animators[t.animation]),!i&&e)n=e;else{i=i||this._animators[this._animation];var r=G.extend({},this._animationOptions,t.animationOptions||{},C.config.animationsDisabled?{duration:0,delay:0}:{});"function"==typeof(n=new i(r))&&(n=new n(r))}if(!(n instanceof this._baseClass))throw new Error('"animator" is not an instance of '+this._baseClassName+".");return n}}],[{key:"parseAnimationOptionsString",value:function(t){try{if("string"==typeof t){var e=G.animationOptionsParse(t);if("object"===(void 0===e?"undefined":d(e))&&null!==e)return e;console.error('"animation-options" attribute must be a JSON object string: '+t)}return{}}catch(e){return console.error('"animation-options" attribute must be a JSON object string: '+t),{}}}}]),t}(),S=!0,O={quiet:"material--flat",light:"material--flat",outline:"material--flat",cta:"","large--quiet":"material--flat large","large--cta":"large",noborder:"",tappable:""},P={};P.android=function(t){var e=t.tagName.toLowerCase();if(!G.hasModifier(t,"material")){var n=(t.getAttribute("modifier")||"").trim().split(/\s+/).map(function(t){return O.hasOwnProperty(t)?O[t]:t});n.unshift("material"),t.setAttribute("modifier",n.join(" ").trim())}-1===["ons-alert-dialog-button","ons-toolbar-button","ons-back-button","ons-button","ons-list-item","ons-fab","ons-speed-dial","ons-speed-dial-item","ons-tab"].indexOf(e)||t.hasAttribute("ripple")||t.querySelector("ons-ripple")||("ons-list-item"===e?t.hasAttribute("tappable")&&(t.setAttribute("ripple",""),t.removeAttribute("tappable")):t.setAttribute("ripple",""))},P.ios=function(t){G.removeModifier(t,"material")&&(G.removeModifier(t,"material--flat")&&G.addModifier(t,G.removeModifier(t,"large")?"large--quiet":"quiet"),t.getAttribute("modifier")||t.removeAttribute("modifier")),t.hasAttribute("ripple")&&("ons-list-item"===t.tagName.toLowerCase()&&t.setAttribute("tappable",""),t.removeAttribute("ripple"))};var x={android:!0},T=function(t,e){if(S&&!t.hasAttribute("disable-auto-styling")){var n=w.getMobileOS();if(P.hasOwnProperty(n)&&(x.hasOwnProperty(n)||e))return n}return null},L=function(t,e,n){return T(e,n)?t.split(/\s+/).map(function(t){return O.hasOwnProperty(t)?O[t]:t}).join(" "):t},D={isEnabled:function(){return S},enable:function(){return S=!0},disable:function(){return S=!1},prepare:function(t,e){var n=T(t,e);n&&P[n](t)},mapModifier:L,getPlatform:T,restoreModifier:function(t){if("android"===T(t)){var e=t.getAttribute("modifier")||"",n=L(e,t);if(/(^|\s+)material($|\s+)/i.test(e)||(n="material "+n),n!==e)return t.setAttribute("modifier",n.trim()),!0}return!1}},M=function(){function t(){f(this,t)}return p(t,null,[{key:"diff",value:function(e,n){function i(e){var n={};return t.split(e).forEach(function(t){return n[t]=t}),n}e=i((""+e).trim()),n=i((""+n).trim());var r=Object.keys(e).reduce(function(t,e){return n[e]||t.push(e),t},[]);return{added:Object.keys(n).reduce(function(t,n){return e[n]||t.push(n),t},[]),removed:r}}},{key:"applyDiffToClassList",value:function(t,e,n){t.added.map(function(t){return n.replace(/\*/g,t)}).forEach(function(t){return t.split(/\s+/).forEach(function(t){return e.add(t)})}),t.removed.map(function(t){return n.replace(/\*/g,t)}).forEach(function(t){return t.split(/\s+/).forEach(function(t){return e.remove(t)})})}},{key:"applyDiffToElement",value:function(e,n,i){Object.keys(i).forEach(function(r){for(var o=!r||G.match(n,r)?[n]:Array.prototype.filter.call(n.querySelectorAll(r),function(t){return!G.findParent(t,n.tagName,function(t){return t===n})}),a=0;a<o.length;a++)t.applyDiffToClassList(e,o[a].classList,i[r])})}},{key:"onModifierChanged",value:function(e,n,i,r){t.applyDiffToElement(t.diff(e,n),i,r),D.restoreModifier(i)}},{key:"refresh",value:function(e,n){t.applyDiffToElement(t.diff("",e.getAttribute("modifier")||""),e,n)}},{key:"initModifier",value:function(e,n){var i=e.getAttribute("modifier");"string"==typeof i&&t.applyDiffToElement({removed:[],added:t.split(i)},e,n)}},{key:"split",value:function(t){return"string"!=typeof t?[]:t.trim().split(/ +/).filter(function(t){return""!==t})}},{key:"addModifier",value:function(e,n){if(e.hasAttribute("modifier")){var i=t.split(e.getAttribute("modifier"));-1==i.indexOf(n)&&(i.push(n),e.setAttribute("modifier",i.join(" ")))}else e.setAttribute("modifier",n)}},{key:"removeModifier",value:function(e,n){if(e.hasAttribute("modifier")){var i=t.split(e.getAttribute("modifier")),r=i.indexOf(n);-1!==r&&(i.splice(r,1),e.setAttribute("modifier",i.join(" ")))}}}]),t}(),I={_ready:!1,_domContentLoaded:!1,_onDOMContentLoaded:function(){I._domContentLoaded=!0,w.isWebView()?window.document.addEventListener("deviceready",function(){I._ready=!0},!1):I._ready=!0},addBackButtonListener:function(t){if(!this._domContentLoaded)throw new Error("This method is available after DOMContentLoaded");this._ready?window.document.addEventListener("backbutton",t,!1):window.document.addEventListener("deviceready",function(){window.document.addEventListener("backbutton",t,!1)})},removeBackButtonListener:function(t){if(!this._domContentLoaded)throw new Error("This method is available after DOMContentLoaded");this._ready?window.document.removeEventListener("backbutton",t,!1):window.document.addEventListener("deviceready",function(){window.document.removeEventListener("backbutton",t,!1)})}};window.addEventListener("DOMContentLoaded",function(){return I._onDOMContentLoaded()},!1);var N={_store:{},_genId:function(){var t=0;return function(){return t++}}(),set:function(t,e){t.dataset.deviceBackButtonHandlerId&&this.remove(t);var n=t.dataset.deviceBackButtonHandlerId=N._genId();this._store[n]=e},remove:function(t){t.dataset.deviceBackButtonHandlerId&&(delete this._store[t.dataset.deviceBackButtonHandlerId],delete t.dataset.deviceBackButtonHandlerId)},get:function(t){if(t.dataset.deviceBackButtonHandlerId){var e=t.dataset.deviceBackButtonHandlerId;if(!this._store[e])throw new Error;return this._store[e]}},has:function(t){if(!t.dataset)return!1;var e=t.dataset.deviceBackButtonHandlerId;return!!this._store[e]}},q=new(function(){function t(){f(this,t),this._isEnabled=!1,this._boundCallback=this._callback.bind(this)}return p(t,[{key:"enable",value:function(){this._isEnabled||(I.addBackButtonListener(this._boundCallback),this._isEnabled=!0)}},{key:"disable",value:function(){this._isEnabled&&(I.removeBackButtonListener(this._boundCallback),this._isEnabled=!1)}},{key:"fireDeviceBackButtonEvent",value:function(){var t=document.createEvent("Event");t.initEvent("backbutton",!0,!0),document.dispatchEvent(t)}},{key:"_callback",value:function(){this._dispatchDeviceBackButtonEvent()}},{key:"createHandler",value:function(t,e){if(!(t instanceof HTMLElement))throw new Error("element must be an instance of HTMLElement");if(!(e instanceof Function))throw new Error("callback must be an instance of Function");var n={_callback:e,_element:t,disable:function(){N.remove(t)},setListener:function(t){this._callback=t},enable:function(){N.set(t,this)},isEnabled:function(){return N.get(t)===this},destroy:function(){N.remove(t),this._callback=this._element=null}};return n.enable(),n}},{key:"_dispatchDeviceBackButtonEvent",value:function(){function t(e){return{_element:e,callParentHandler:function(){for(var e=this._element.parentNode;e;){if(i=N.get(e))return i._callback(t(e));e=e.parentNode}}}}var e=this._captureTree(),n=this._findHandlerLeafElement(e),i=N.get(n);i._callback(t(n))}},{key:"_captureTree",value:function(){function t(e){var n={element:e,children:Array.prototype.concat.apply([],function(t){for(var e=[],n=0;n<t.length;n++)e.push(t[n]);return e}(e.children).map(function(e){if("none"===e.style.display||!1===e._isShown)return[];if(0===e.children.length&&!N.has(e))return[];var n=t(e);return 0!==n.children.length||N.has(n.element)?[n]:[]}))};if(!N.has(n.element))for(var i=0;i<n.children.length;i++){var r=n.children[i];if(N.has(r.element))return r}return n}return t(document.body)}},{key:"_findHandlerLeafElement",value:function(t){function e(t){return 0===t.children.length?t.element:1===t.children.length?e(t.children[0]):t.children.map(function(t){return t.element}).reduce(function(t,e){if(!t)return e;var n=parseInt(window.getComputedStyle(t,"").zIndex,10),i=parseInt(window.getComputedStyle(e,"").zIndex,10);if(!isNaN(n)&&!isNaN(i))return n>i?t:e;throw new Error("Capturing backbutton-handler is failure.")},null)}return e(t)}}]),t}());C.AnimatorFactory=A,C.ModifierUtil=M,C.dbbDispatcher=q;var B=function(t,e){return t.substr(0,e.length)===e},j=function(t,e){return t.substr(t.length-e.length,e.length)===e},H=function(t){return t.slice(1,-1)},R=function(t){return B(t,"{")&&j(t,"}")},z=function(t){return B(t,"[")&&j(t,"]")},F=function(t){return B(t,"'")&&j(t,"'")||B(t,'"')&&j(t,'"')},V=function(t,e,n){throw new Error("Unexpected token '"+t+"' at position "+(n.length-e.length-1)+" in string: '"+n+"'")},W=function(t,e,n){return"true"===t||"false"===t?"true"===t:F(t)?H(t):isNaN(t)?R(t)?U(H(t)):z(t)?Y(H(t)):void V(t,e,n):+t},X=function(t){var e=(t=t.trim()).length;if(":"===t[0]||","===t[0])e=1;else if("{"===t[0]||"["===t[0]){for(var n=t.charCodeAt(0),i=1,r=1;r<t.length;r++)if(t.charCodeAt(r)===n)i++;else if(t.charCodeAt(r)===n+2&&0==--i){e=r+1;break}}else if("'"===t[0]||'"'===t[0]){for(var o=1;o<t.length;o++)if(t[o]===t[0]){e=o+1;break}}else for(var a=1;a<t.length;a++)if(-1!==[" ",",",":"].indexOf(t[a])){e=a;break}return t.slice(0,e)},U=function(t){for(var e=t=t.trim(),n={},i=!0,r=void 0,o=void 0,a=void 0;t.length>0;)if(o=a,a=X(t),t=t.slice(a.length,t.length).trim(),":"===a&&(!i||!o||","===o)||","===a&&i||":"!==a&&","!==a&&o&&","!==o&&":"!==o)V(a,t,e);else if(":"===a&&i&&o){if(o=F(o)?H(o):o,!function(t){return/^[A-Z_$][A-Z0-9_$]*$/i.test(t)}(o))throw new Error("Invalid key token '"+o+"' at position 0 in string: '"+e+"'");r=o,i=!1}else","===a&&!i&&o&&(n[r]=W(o,t,e),i=!0);return a&&(n[r]=W(a,t,e)),n},Y=function(t){for(var e=t=t.trim(),n=[],i=void 0,r=void 0;t.length>0;)i=r,r=X(t),t=t.slice(r.length,t.length).trim(),","!==r||i&&","!==i?","===r&&n.push(W(i,t,e)):V(r,t,e);return r&&(","!==r?n.push(W(r,t,e)):V(r,t,e)),n},G={};G.globals={fabOffset:0},G.prepareQuery=function(t){return t instanceof Function?t:function(e){return G.match(e,t)}},G.match=function(t,e){return(t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector).call(t,e)},G.findChild=function(t,e){for(var n=G.prepareQuery(e),i=0;i<t.childNodes.length;i++){var r=t.childNodes[i];if(r.nodeType===Node.ELEMENT_NODE&&n(r))return r}return null},G.findParent=function(t,e,n){for(var i=G.prepareQuery(e),r=t.parentNode;;){if(!r||r===document||r instanceof DocumentFragment||n&&n(r))return null;if(i(r))return r;r=r.parentNode}},G.isAttached=function(t){return document.body.contains(t)},G.hasAnyComponentAsParent=function(t){for(;t&&document.documentElement!==t;)if((t=t.parentNode)&&t.nodeName.toLowerCase().match(/(ons-navigator|ons-tabbar|ons-modal)/))return!0;return!1},G.isPageControl=function(t){return t.nodeName.match(/^ons-(navigator|splitter|tabbar|page)$/i)},G.propagateAction=function(t,e){for(var n=0;n<t.childNodes.length;n++){var i=t.childNodes[n];i[e]instanceof Function?i[e]():G.propagateAction(i,e)}},G.camelize=function(t){return t.toLowerCase().replace(/-([a-z])/g,function(t,e){return e.toUpperCase()})},G.hyphenate=function(t){return t.replace(/([a-zA-Z])([A-Z])/g,"$1-$2").toLowerCase()},G.create=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.split("."),i=document.createElement(n.shift()||"div");return n.length&&(i.className=n.join(" ")),h(i,e),i},G.createElement=function(t){var e=document.createElement("div");if(t instanceof DocumentFragment?e.appendChild(document.importNode(t,!0)):e.innerHTML=t.trim(),e.children.length>1)throw new Error('"html" must be one wrapper element.');var n=e.children[0];return e.children[0].remove(),n},G.createFragment=function(t){var e=document.createElement("template");return e.innerHTML=t,document.importNode(e.content,!0)},G.extend=function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];for(var r=0;r<n.length;r++)if(n[r])for(var o=Object.keys(n[r]),a=0;a<o.length;a++){var s=o[a];t[s]=n[r][s]}return t},G.arrayFrom=function(t){return Array.prototype.slice.apply(t)},G.parseJSONObjectSafely=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{var n=JSON.parse(""+t);if("object"===(void 0===n?"undefined":d(n))&&null!==n)return n}catch(t){return e}return e},G.findFromPath=function(t){t=t.split(".");for(var e,n=window;e=t.shift();)n=n[e];return n},G.getTopPage=function(t){return t&&("ons-page"===t.tagName.toLowerCase()?t:t.topPage)||null},G.findToolbarPage=function(t){var e=G.getTopPage(t);if(e){if(e._canAnimateToolbar())return e;for(var n=0;n<e._contentElement.children.length;n++){var i=G.getTopPage(e._contentElement.children[n]);if(i&&!/ons-tabbar/i.test(e._contentElement.children[n].tagName))return G.findToolbarPage(i)}}return null},G.triggerElementEvent=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});return Object.keys(n).forEach(function(t){i[t]=n[t]}),t.dispatchEvent(i),i},G.hasModifier=function(t,e){return!!t.hasAttribute("modifier")&&RegExp("(^|\\s+)"+e+"($|\\s+)","i").test(t.getAttribute("modifier"))},G.addModifier=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.autoStyle&&(e=D.mapModifier(e,t,n.forceAutoStyle)),!G.hasModifier(t,e)&&(t.setAttribute("modifier",((t.getAttribute("modifier")||"")+" "+e).trim()),!0)},G.removeModifier=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(n.autoStyle&&(e=D.mapModifier(e,t,n.forceAutoStyle)),!t.getAttribute("modifier")||!G.hasModifier(t,e))return!1;var i=t.getAttribute("modifier").split(/\s+/).filter(function(t){return t&&t!==e});return i.length?t.setAttribute("modifier",i.join(" ")):t.removeAttribute("modifier"),!0},G.toggleModifier=function(){var t=arguments.length>2?arguments.length<=2?void 0:arguments[2]:{},e="boolean"==typeof t?t:t.force;("boolean"==typeof e?e:!G.hasModifier.apply(G,arguments))?G.addModifier.apply(G,arguments):G.removeModifier.apply(G,arguments)},G.restoreClass=function(t,e,n){e.split(/\s+/).forEach(function(e){return""!==e&&!t.classList.contains(e)&&t.classList.add(e)}),t.hasAttribute("modifier")&&M.refresh(t,n)},G.updateParentPosition=function(t){!t._parentUpdated&&t.parentElement&&("static"===window.getComputedStyle(t.parentElement).getPropertyValue("position")&&(t.parentElement.style.position="relative"),t._parentUpdated=!0)},G.toggleAttribute=function(t,e,n){n?t.setAttribute(e,"boolean"==typeof n?"":n):t.removeAttribute(e)},G.bindListeners=function(t,e){e.forEach(function(e){var n=e.replace(/^_[a-z]/,"_bound"+e[1].toUpperCase());t[n]=t[n]||t[e].bind(t)})},G.each=function(t,e){return Object.keys(t).forEach(function(n){return e(n,t[n])})},G.updateRipple=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};void 0===e&&(e=t.hasAttribute("ripple"));var i=G.findChild(t,"ons-ripple");if(e){if(!i){var r=document.createElement("ons-ripple");Object.keys(n).forEach(function(t){return r.setAttribute(t,n[t])}),t.insertBefore(r,t.firstChild)}}else i&&i.remove()},G.animationOptionsParse=function(t){if(t=t.trim(),R(t))return U(H(t));if(z(t))return Y(H(t));throw new Error("Provided string must be object or array like: "+t)},G.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},G.defer=function(){var t={};return t.promise=new Promise(function(e,n){t.resolve=e,t.reject=n}),t},G.warn=function(){if(!C.config.warningsDisabled){var t;(t=console).warn.apply(t,arguments)}},G.preventScroll=function(t){var e=function(t){return t.cancelable&&t.preventDefault()};t.on("touchmove",e),t.on("dragend",function n(i){t.off("touchmove",e),t.off("dragend",n)})},G.isValidGesture=function(t){return void 0!==t.gesture&&(t.gesture.distance<=15||t.gesture.deltaTime<=100)};var $={};$.capitalize=function(t){return t.charAt(0).toUpperCase()+t.slice(1)},$.buildTransitionValue=function(t){t.property=t.property||"all",t.duration=t.duration||.4,t.timing=t.timing||"linear";return t.property.split(/ +/).map(function(e){return e+" "+t.duration+"s "+t.timing}).join(", ")},$.onceOnTransitionEnd=function(t,e){if(!t)return function(){};var n=function(n){t==n.target&&(n.stopPropagation(),i(),e())},i=function(){$._transitionEndEvents.forEach(function(e){t.removeEventListener(e,n,!1)})};return $._transitionEndEvents.forEach(function(e){t.addEventListener(e,n,!1)}),i},$._transitionEndEvents="ontransitionend"in window?["transitionend"]:"onwebkittransitionend"in window?["webkitTransitionEnd"]:"webkit"===$.vendorPrefix||"o"===$.vendorPrefix||"moz"===$.vendorPrefix||"ms"===$.vendorPrefix?[$.vendorPrefix+"TransitionEnd","transitionend"]:[],$._cssPropertyDict=function(){for(var t=window.getComputedStyle(document.documentElement,""),e={},n="A".charCodeAt(0),i="z".charCodeAt(0),r=0;r<t.length;r++){var o=t[r].replace(/^[-]+/,"").replace(/[-][a-z]/g,function(t){return t.substr(1).toUpperCase()}).replace(/^moz/,"Moz");n<=o.charCodeAt(0)&&i>=o.charCodeAt(0)&&"cssText"!==o&&"parentText"!==o&&(e[o]=!0)}return e}(),$.hasCssProperty=function(t){return t in $._cssPropertyDict},$.vendorPrefix=function(){var t=window.getComputedStyle(document.documentElement,"");return(Array.prototype.slice.call(t).join("").match(/-(moz|webkit|ms)-/)||""===t.OLink&&["","o"])[1]}(),$.forceLayoutAtOnce=function(t,e){this.batchImmediate(function(){t.forEach(function(t){t.offsetHeight}),e()})},$.batchImmediate=function(){var t=[];return function(e){0===t.length&&setImmediate(function(){var e=t.slice(0);t=[],e.forEach(function(t){t()})}),t.push(e)}}(),$.batchAnimationFrame=function(){var t=[],e=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,1e3/60)};return function(n){0===t.length&&e(function(){var e=t.slice(0);t=[],e.forEach(function(t){t()})}),t.push(n)}}(),$.transitionPropertyName=function(){if($.hasCssProperty("transitionDuration"))return"transition";if($.hasCssProperty($.vendorPrefix+"TransitionDuration"))return $.vendorPrefix+"Transition";throw new Error("Invalid state")}();var K=function t(e){if(!(this instanceof t))return new t(e);if(e instanceof HTMLElement)this.elements=[e];else{if("[object Array]"!==Object.prototype.toString.call(e))throw new Error("First argument must be an array or an instance of HTMLElement.");this.elements=e}this.transitionQueue=[],this.lastStyleAttributeDict=[]};K.prototype={transitionQueue:void 0,elements:void 0,play:function(t){return"function"==typeof t&&this.transitionQueue.push(function(e){t(),e()}),this.startAnimation(),this},queue:function(t,e){var n=this.transitionQueue;if(t&&e&&(e.css=t,t=new K.Transition(e)),t instanceof Function||t instanceof K.Transition||(t=new K.Transition(t.css?t:{css:t})),t instanceof Function)n.push(t);else{if(!(t instanceof K.Transition))throw new Error("Invalid arguments");n.push(t.build())}return this},wait:function(t){return t>0&&this.transitionQueue.push(function(e){setTimeout(e,1e3*t)}),this},saveStyle:function(){return this.transitionQueue.push(function(t){this.elements.forEach(function(t,e){for(var n=this.lastStyleAttributeDict[e]={},i=0;i<t.style.length;i++)n[t.style[i]]=t.style[t.style[i]]}.bind(this)),t()}.bind(this)),this},restoreStyle:function(t){var e=this;if((t=t||{}).transition&&!t.duration)throw new Error('"options.duration" is required when "options.transition" is enabled.');var n=$.transitionPropertyName;if(t.transition||t.duration&&t.duration>0){var i=t.transition||"all "+t.duration+"s "+(t.timing||"linear");this.transitionQueue.push(function(r){var o,a=this.elements,s=function(){a.forEach(function(t){t.style[n]=""})},u=$.onceOnTransitionEnd(a[0],function(){clearTimeout(o),s(),r()});o=setTimeout(function(){u(),s(),r()},1e3*t.duration*1.4),a.forEach(function(t,r){var o=e.lastStyleAttributeDict[r];if(!o)throw new Error("restoreStyle(): The style is not saved. Invoke saveStyle() before.");e.lastStyleAttributeDict[r]=void 0;for(var a,s=0,u=t.style.length;s<u;s++)a=t.style[s],void 0===o[a]&&(o[a]="");t.style[n]=i,Object.keys(o).forEach(function(e){e!==n&&(t.style[e]=o[e])}),t.style[n]=i})})}else this.transitionQueue.push(function(t){e.elements.forEach(function(t,i){t.style[n]="none";var r=e.lastStyleAttributeDict[i];if(!r)throw new Error("restoreStyle(): The style is not saved. Invoke saveStyle() before.");e.lastStyleAttributeDict[i]=void 0;for(var o=0;o<t.style.length;o++)void 0===r[t.style[o]]&&(r[t.style[o]]="");Object.keys(r).forEach(function(e){t.style[e]=r[e]})}),t()});return this},startAnimation:function(){return this._dequeueTransition(),this},_dequeueTransition:function(){var t=this.transitionQueue.shift();if(this._currentTransition)throw new Error("Current transition exists.");this._currentTransition=t;var e=this,n=!1;t&&t.call(this,function(){if(n)throw new Error("Invalid state: This callback is called twice.");n=!0,e._currentTransition=void 0,e._dequeueTransition()})}},K.runAll=function(){for(var t=0;t<arguments.length;t++)arguments[t].play()},(K.Transition=function(t){this.options=t||{},this.options.duration=this.options.duration||0,this.options.timing=this.options.timing||"linear",this.options.css=this.options.css||{},this.options.property=this.options.property||"all"}).prototype={build:function(){if(0===Object.keys(this.options.css).length)throw new Error("options.css is required.");var t=function(t){var e={};return Object.keys(t).forEach(function(n){var i=t[n];if($.hasCssProperty(n))e[n]=i;else{var r=$.vendorPrefix+$.capitalize(n);$.hasCssProperty(r)?e[r]=i:(e[r]=i,e[n]=i)}}),e}(this.options.css);if(this.options.duration>0){var e=$.buildTransitionValue(this.options),n=this;return function(i){var r,o=this.elements,a=1e3*n.options.duration*1.4,s=$.onceOnTransitionEnd(o[0],function(){clearTimeout(r),i()});r=setTimeout(function(){s(),i()},a),o.forEach(function(n){n.style[$.transitionPropertyName]=e,Object.keys(t).forEach(function(e){n.style[e]=t[e]})})}}if(this.options.duration<=0)return function(e){var n=this.elements;n.forEach(function(e){e.style[$.transitionPropertyName]="",Object.keys(t).forEach(function(n){e.style[n]=t[n]})}),n.length>0?$.forceLayoutAtOnce(n,function(){$.batchAnimationFrame(e)}):$.batchAnimationFrame(e)}}};var Q,J,Z,tt,et=function t(e,n){return new t.Instance(e,n||{})};et.defaults={behavior:{touchAction:"pan-y",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},et.DOCUMENT=document,et.HAS_POINTEREVENTS=navigator.pointerEnabled||navigator.msPointerEnabled,et.HAS_TOUCHEVENTS="ontouchstart"in window,et.IS_MOBILE=/mobile|tablet|ip(ad|hone|od)|android|silk/i.test(navigator.userAgent),et.NO_MOUSEEVENTS=et.HAS_TOUCHEVENTS&&et.IS_MOBILE||et.HAS_POINTEREVENTS,et.CALCULATE_INTERVAL=25;var nt={},it=et.DIRECTION_DOWN="down",rt=et.DIRECTION_LEFT="left",ot=et.DIRECTION_UP="up",at=et.DIRECTION_RIGHT="right",st=et.POINTER_MOUSE="mouse",ut=et.POINTER_TOUCH="touch",lt=et.POINTER_PEN="pen",ct=et.EVENT_START="start",ht=et.EVENT_MOVE="move",dt=et.EVENT_END="end",ft=et.EVENT_RELEASE="release",pt=et.EVENT_TOUCH="touch";et.READY=!1,et.plugins=et.plugins||{},et.gestures=et.gestures||{},J=et.utils={extend:function(t,e,n){for(var i in e)!e.hasOwnProperty(i)||void 0!==t[i]&&n||(t[i]=e[i]);return t},on:function(t,e,n){t.addEventListener(e,n,!1)},off:function(t,e,n){t.removeEventListener(e,n,!1)},each:function(t,e,n){var i,r;if("forEach"in t)t.forEach(e,n);else if(void 0!==t.length){for(i=0,r=t.length;i<r;i++)if(!1===e.call(n,t[i],i,t))return}else for(i in t)if(t.hasOwnProperty(i)&&!1===e.call(n,t[i],i,t))return},inStr:function(t,e){return t.indexOf(e)>-1},inArray:function(t,e,n){if(n){for(var i=0,r=t.length;i<r;i++)if(Object.keys(e).every(function(n){return t[i][n]===e[n]}))return i;return-1}if(t.indexOf)return t.indexOf(e);for(var i=0,r=t.length;i<r;i++)if(t[i]===e)return i;return-1},toArray:function(t){return Array.prototype.slice.call(t,0)},hasParent:function(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1},getCenter:function(t){var e=[],n=[],i=[],r=[],o=Math.min,a=Math.max;return 1===t.length?{pageX:t[0].pageX,pageY:t[0].pageY,clientX:t[0].clientX,clientY:t[0].clientY}:(J.each(t,function(t){e.push(t.pageX),n.push(t.pageY),i.push(t.clientX),r.push(t.clientY)}),{pageX:(o.apply(Math,e)+a.apply(Math,e))/2,pageY:(o.apply(Math,n)+a.apply(Math,n))/2,clientX:(o.apply(Math,i)+a.apply(Math,i))/2,clientY:(o.apply(Math,r)+a.apply(Math,r))/2})},getVelocity:function(t,e,n){return{x:Math.abs(e/t)||0,y:Math.abs(n/t)||0}},getAngle:function(t,e){var n=e.clientX-t.clientX,i=e.clientY-t.clientY;return 180*Math.atan2(i,n)/Math.PI},getDirection:function(t,e){return Math.abs(t.clientX-e.clientX)>=Math.abs(t.clientY-e.clientY)?t.clientX-e.clientX>0?rt:at:t.clientY-e.clientY>0?ot:it},getDistance:function(t,e){var n=e.clientX-t.clientX,i=e.clientY-t.clientY;return Math.sqrt(n*n+i*i)},getScale:function(t,e){return t.length>=2&&e.length>=2?this.getDistance(e[0],e[1])/this.getDistance(t[0],t[1]):1},getRotation:function(t,e){return t.length>=2&&e.length>=2?this.getAngle(e[1],e[0])-this.getAngle(t[1],t[0]):0},isVertical:function(t){return t==ot||t==it},setPrefixedCss:function(t,e,n,i){var r=["","Webkit","Moz","O","ms"];e=J.toCamelCase(e);for(var o=0;o<r.length;o++){var a=e;if(r[o]&&(a=r[o]+a.slice(0,1).toUpperCase()+a.slice(1)),a in t.style){t.style[a]=(null===i||i)&&n||"";break}}},toggleBehavior:function(t,e,n){if(e&&t&&t.style){J.each(e,function(e,i){J.setPrefixedCss(t,i,e,n)});var i=n&&function(){return!1};"none"==e.userSelect&&(t.onselectstart=i),"none"==e.userDrag&&(t.ondragstart=i)}},toCamelCase:function(t){return t.replace(/[_-]([a-z])/g,function(t){return t[1].toUpperCase()})}},Q=et.event={preventMouseEvents:!1,started:!1,shouldDetect:!1,on:function(t,e,n,i){var r=e.split(" ");J.each(r,function(e){J.on(t,e,n),i&&i(e)})},off:function(t,e,n,i){var r=e.split(" ");J.each(r,function(e){J.off(t,e,n),i&&i(e)})},onTouch:function(t,e,n){var i=this,r=function(r){var o,a=r.type.toLowerCase(),s=et.HAS_POINTEREVENTS,u=J.inStr(a,"mouse");u&&i.preventMouseEvents||(u&&e==ct&&0===r.button?(i.preventMouseEvents=!1,i.shouldDetect=!0):s&&e==ct?i.shouldDetect=1===r.buttons||tt.matchType(ut,r):u||e!=ct||(i.preventMouseEvents=!0,i.shouldDetect=!0),s&&e!=dt&&tt.updatePointer(e,r),i.shouldDetect&&(o=i.doDetect.call(i,r,e,t,n)),o==dt&&(i.preventMouseEvents=!1,i.shouldDetect=!1,tt.reset()),s&&e==dt&&tt.updatePointer(e,r))};return this.on(t,nt[e],r),r},doDetect:function(t,e,n,i){var r=this.getTouchList(t,e),o=r.length,a=e,s=r.trigger,u=o;e==ct?s=pt:e==dt&&(s=ft,u=r.length-(t.changedTouches?t.changedTouches.length:1)),u>0&&this.started&&(a=ht),this.started=!0;var l=this.collectEventData(n,a,r,t);return e!=dt&&i.call(Z,l),s&&(l.changedLength=u,l.eventType=s,i.call(Z,l),l.eventType=a,delete l.changedLength),a==dt&&(i.call(Z,l),this.started=!1),a},determineEventTypes:function(){var t;return t=et.HAS_POINTEREVENTS?window.PointerEvent?["pointerdown","pointermove","pointerup pointercancel lostpointercapture"]:["MSPointerDown","MSPointerMove","MSPointerUp MSPointerCancel MSLostPointerCapture"]:et.NO_MOUSEEVENTS?["touchstart","touchmove","touchend touchcancel"]:["touchstart mousedown","touchmove mousemove","touchend touchcancel mouseup"],nt[ct]=t[0],nt[ht]=t[1],nt[dt]=t[2],nt},getTouchList:function(t,e){if(et.HAS_POINTEREVENTS)return tt.getTouchList();if(t.touches){if(e==ht)return t.touches;var n=[],i=[].concat(J.toArray(t.touches),J.toArray(t.changedTouches)),r=[];return J.each(i,function(t){-1===J.inArray(n,t.identifier)&&r.push(t),n.push(t.identifier)}),r}return t.identifier=1,[t]},collectEventData:function(t,e,n,i){var r=ut;return J.inStr(i.type,"mouse")||tt.matchType(st,i)?r=st:tt.matchType(lt,i)&&(r=lt),{center:J.getCenter(n),timeStamp:Date.now(),target:i.target,touches:n,eventType:e,pointerType:r,srcEvent:i,preventDefault:function(){var t=this.srcEvent;t.preventManipulation&&t.preventManipulation(),t.preventDefault&&t.preventDefault()},stopPropagation:function(){this.srcEvent.stopPropagation()},stopDetect:function(){return Z.stopDetect()}}}},tt=et.PointerEvent={pointers:{},getTouchList:function(){var t=[];return J.each(this.pointers,function(e){t.push(e)}),t},updatePointer:function(t,e){t==dt||t!=dt&&1!==e.buttons?delete this.pointers[e.pointerId]:(e.identifier=e.pointerId,this.pointers[e.pointerId]=e)},matchType:function(t,e){if(!e.pointerType)return!1;var n=e.pointerType,i={};return i[st]=n===(e.MSPOINTER_TYPE_MOUSE||st),i[ut]=n===(e.MSPOINTER_TYPE_TOUCH||ut),i[lt]=n===(e.MSPOINTER_TYPE_PEN||lt),i[t]},reset:function(){this.pointers={}}},Z=et.detection={gestures:[],current:null,previous:null,stopped:!1,startDetect:function(t,e){this.current||(this.stopped=!1,this.current={inst:t,startEvent:J.extend({},e),lastEvent:!1,lastCalcEvent:!1,futureCalcEvent:!1,lastCalcData:{},name:""},this.detect(e))},detect:function(t){if(this.current&&!this.stopped){t=this.extendEventData(t);var e=this.current.inst,n=e.options;return J.each(this.gestures,function(i){!this.stopped&&e.enabled&&n[i.name]&&i.handler.call(i,t,e)},this),this.current&&(this.current.lastEvent=t),t.eventType==dt&&this.stopDetect(),t}},stopDetect:function(){this.previous=J.extend({},this.current),this.current=null,this.stopped=!0},getCalculatedData:function(t,e,n,i,r){var o=this.current,a=!1,s=o.lastCalcEvent,u=o.lastCalcData;s&&t.timeStamp-s.timeStamp>et.CALCULATE_INTERVAL&&(e=s.center,n=t.timeStamp-s.timeStamp,i=t.center.clientX-s.center.clientX,r=t.center.clientY-s.center.clientY,a=!0),t.eventType!=pt&&t.eventType!=ft||(o.futureCalcEvent=t),o.lastCalcEvent&&!a||(u.velocity=J.getVelocity(n,i,r),u.angle=J.getAngle(e,t.center),u.direction=J.getDirection(e,t.center),o.lastCalcEvent=o.futureCalcEvent||t,o.futureCalcEvent=t),t.velocityX=u.velocity.x,t.velocityY=u.velocity.y,t.interimAngle=u.angle,t.interimDirection=u.direction},extendEventData:function(t){var e=this.current,n=e.startEvent,i=e.lastEvent||n;t.eventType!=pt&&t.eventType!=ft||(n.touches=[],J.each(t.touches,function(t){n.touches.push({clientX:t.clientX,clientY:t.clientY})}));var r=t.timeStamp-n.timeStamp,o=t.center.clientX-n.center.clientX,a=t.center.clientY-n.center.clientY;return this.getCalculatedData(t,i.center,r,o,a),J.extend(t,{startEvent:n,deltaTime:r,deltaX:o,deltaY:a,distance:J.getDistance(n.center,t.center),angle:J.getAngle(n.center,t.center),direction:J.getDirection(n.center,t.center),scale:J.getScale(n.touches,t.touches),rotation:J.getRotation(n.touches,t.touches)}),t},register:function(t){var e=t.defaults||{};return void 0===e[t.name]&&(e[t.name]=!0),J.extend(et.defaults,e,!0),t.index=t.index||1e3,this.gestures.push(t),this.gestures.sort(function(t,e){return t.index<e.index?-1:t.index>e.index?1:0}),this.gestures}},et.Instance=function(t,e){var n=this;et.READY||(Q.determineEventTypes(),J.each(et.gestures,function(t){Z.register(t)}),Q.onTouch(et.DOCUMENT,ht,Z.detect),Q.onTouch(et.DOCUMENT,dt,Z.detect),et.READY=!0),this.element=t,this.enabled=!0,J.each(e,function(t,n){delete e[n],e[J.toCamelCase(n)]=t}),this.options=J.extend(J.extend({},et.defaults),e||{}),this.options.behavior&&J.toggleBehavior(this.element,this.options.behavior,!0),this.eventStartHandler=Q.onTouch(t,ct,function(t){n.enabled&&t.eventType==ct?Z.startDetect(n,t):t.eventType==pt&&Z.detect(t)}),this.eventHandlers=[]},et.Instance.prototype={on:function(t,e){var n=this;return Q.on(n.element,t,e,function(t){n.eventHandlers.push({gesture:t,handler:e})}),n},off:function(t,e){var n=this;return Q.off(n.element,t,e,function(t){var i=J.inArray(n.eventHandlers,{gesture:t,handler:e},!0);i>=0&&n.eventHandlers.splice(i,1)}),n},trigger:function(t,e){e||(e={});var n=et.DOCUMENT.createEvent("Event");n.initEvent(t,!0,!0),n.gesture=e;var i=this.element;return J.hasParent(e.target,i)&&(i=e.target),i.dispatchEvent(n),this},enable:function(t){return this.enabled=t,this},dispose:function(){var t,e;for(J.toggleBehavior(this.element,this.options.behavior,!1),t=-1;e=this.eventHandlers[++t];)J.off(this.element,e.gesture,e.handler);return this.eventHandlers=[],Q.off(this.element,nt[ct],this.eventStartHandler),null}},function(t){var e=!1;et.gestures.Drag={name:t,index:50,handler:function(n,i){var r=Z.current;if(!(i.options.dragMaxTouches>0&&n.touches.length>i.options.dragMaxTouches))switch(n.eventType){case ct:e=!1;break;case ht:if(n.distance<i.options.dragMinDistance&&r.name!=t)return;var o=r.startEvent.center;if(r.name!=t&&(r.name=t,i.options.dragDistanceCorrection&&n.distance>0)){var a=Math.abs(i.options.dragMinDistance/n.distance);o.pageX+=n.deltaX*a,o.pageY+=n.deltaY*a,o.clientX+=n.deltaX*a,o.clientY+=n.deltaY*a,n=Z.extendEventData(n)}(r.lastEvent.dragLockToAxis||i.options.dragLockToAxis&&i.options.dragLockMinDistance<=n.distance)&&(n.dragLockToAxis=!0);var s=r.lastEvent.direction;n.dragLockToAxis&&s!==n.direction&&(J.isVertical(s)?n.direction=n.deltaY<0?ot:it:n.direction=n.deltaX<0?rt:at),e||(i.trigger(t+"start",n),e=!0),i.trigger(t,n),i.trigger(t+n.direction,n);var u=J.isVertical(n.direction);(i.options.dragBlockVertical&&u||i.options.dragBlockHorizontal&&!u)&&n.preventDefault();break;case ft:e&&n.changedLength<=i.options.dragMaxTouches&&(i.trigger(t+"end",n),e=!1);break;case dt:e=!1}},defaults:{dragMinDistance:10,dragDistanceCorrection:!0,dragMaxTouches:1,dragBlockHorizontal:!1,dragBlockVertical:!1,dragLockToAxis:!1,dragLockMinDistance:25}}}("drag"),et.gestures.Gesture={name:"gesture",index:1337,handler:function(t,e){e.trigger(this.name,t)}},function(t){var e;et.gestures.Hold={name:t,index:10,defaults:{holdTimeout:500,holdThreshold:2},handler:function(n,i){var r=i.options,o=Z.current;switch(n.eventType){case ct:clearTimeout(e),o.name=t,e=setTimeout(function(){o&&o.name==t&&i.trigger(t,n)},r.holdTimeout);break;case ht:n.distance>r.holdThreshold&&clearTimeout(e);break;case ft:clearTimeout(e)}}}}("hold"),et.gestures.Release={name:"release",index:1/0,handler:function(t,e){t.eventType==ft&&e.trigger(this.name,t)}},et.gestures.Swipe={name:"swipe",index:40,defaults:{swipeMinTouches:1,swipeMaxTouches:1,swipeVelocityX:.6,swipeVelocityY:.6},handler:function(t,e){if(t.eventType==ft){var n=t.touches.length,i=e.options;if(n<i.swipeMinTouches||n>i.swipeMaxTouches)return;(t.velocityX>i.swipeVelocityX||t.velocityY>i.swipeVelocityY)&&(e.trigger(this.name,t),e.trigger(this.name+t.direction,t))}}},function(t){var e=!1;et.gestures.Tap={name:t,index:100,handler:function(n,i){var r,o,a=i.options,s=Z.current,u=Z.previous;switch(n.eventType){case ct:e=!1;break;case ht:e=e||n.distance>a.tapMaxDistance;break;case dt:!J.inStr(n.srcEvent.type,"cancel")&&n.deltaTime<a.tapMaxTime&&!e&&(r=u&&u.lastEvent&&n.timeStamp-u.lastEvent.timeStamp,o=!1,u&&u.name==t&&r&&r<a.doubleTapInterval&&n.distance<a.doubleTapDistance&&(i.trigger("doubletap",n),o=!0),o&&!a.tapAlways||(s.name=t,i.trigger(s.name,n)))}},defaults:{tapMaxTime:250,tapMaxDistance:10,tapAlways:!0,doubleTapDistance:20,doubleTapInterval:300}}}("tap"),et.gestures.Touch={name:"touch",index:-1/0,defaults:{preventDefault:!1,preventMouse:!1},handler:function(t,e){e.options.preventMouse&&t.pointerType==st?t.stopDetect():(e.options.preventDefault&&t.preventDefault(),t.eventType==pt&&e.trigger("touch",t))}},function(t){var e=!1;et.gestures.Transform={name:t,index:45,defaults:{transformMinScale:.01,transformMinRotation:1},handler:function(n,i){switch(n.eventType){case ct:e=!1;break;case ht:if(n.touches.length<2)return;var r=Math.abs(1-n.scale),o=Math.abs(n.rotation);if(r<i.options.transformMinScale&&o<i.options.transformMinRotation)return;Z.current.name=t,e||(i.trigger(t+"start",n),e=!0),i.trigger(t,n),o>i.options.transformMinRotation&&i.trigger("rotate",n),r>i.options.transformMinScale&&(i.trigger("pinch",n),i.trigger("pinch"+(n.scale<1?"in":"out"),n));break;case ft:e&&n.changedLength<2&&(i.trigger(t+"end",n),e=!1)}}}}("transform");var mt=new WeakMap,gt=new WeakMap,vt=new(function(){function t(){f(this,t),this.queue=[]}return p(t,[{key:"add",value:function(t,e){var n=this;this.queue.push(t),1===this.queue.length&&setImmediate(this.queue[0]),e.then(function(){n.queue.shift(),n.queue.length>0&&setTimeout(n.queue[0],1e3/30)})}}]),t}()),_t=function(t,e){["id","class","animation"].forEach(function(n){return e.hasOwnProperty(n)&&t.setAttribute(n,e[n])}),e.modifier&&G.addModifier(t,e.modifier)},bt={};bt._createAlertDialog=function(t){var e="";t.isPrompt&&(e='\n      <input\n        class="text-input text-input--underbar"\n        type="'+(t.inputType||"text")+'"\n        placeholder="'+(t.placeholder||"")+'"\n        value="'+(t.defaultValue||"")+'"\n        style="width: 100%; margin-top: 10px;"\n      />\n    ');var i="";t.buttonLabels.forEach(function(e,n){i+='\n      <ons-alert-dialog-button\n        class="\n          '+(n===t.primaryButtonIndex?" alert-dialog-button--primal":"")+"\n          "+(t.buttonLabels.length<=2?" alert-dialog-button--rowfooter":"")+'\n        " \n        style="position: relative;">\n        '+e+"\n      </ons-alert-dialog-button>\n    "});var r={},o=function(){r.dialog.onDialogCancel&&r.dialog.removeEventListener("dialog-cancel",r.dialog.onDialogCancel),Object.keys(r).forEach(function(t){return delete r[t]}),r=null,t.destroy instanceof Function&&t.destroy()};r.dialog=document.createElement("ons-alert-dialog"),r.dialog.innerHTML='\n    <div class="alert-dialog-mask"></div>\n    <div class="alert-dialog">\n      <div class="alert-dialog-container">\n        <div class="alert-dialog-title">\n          '+(t.title||"")+'\n        </div>\n        <div class="alert-dialog-content">\n          '+(t.message||t.messageHTML)+"\n          "+e+'\n        </div>\n        <div class="\n          alert-dialog-footer\n          '+(t.buttonLabels.length<=2?" alert-dialog-footer--rowfooter":"")+'\n        ">\n          '+i+"\n        </div>\n      </div>\n    </div>\n  ",n(r.dialog),_t(r.dialog,t);var a=G.defer();return t.isPrompt&&t.submitOnEnter&&(r.input=r.dialog.querySelector(".text-input"),r.input.onkeypress=function(e){13===e.keyCode&&r.dialog.hide().then(function(){if(r){var e=r.input.value;o(),t.callback(e),a.resolve(e)}})}),r.footer=r.dialog.querySelector(".alert-dialog-footer"),G.arrayFrom(r.dialog.querySelectorAll(".alert-dialog-button")).forEach(function(e,n){e.onclick=function(){r.dialog.hide().then(function(){if(r){var e=n;t.isPrompt&&(e=n===t.primaryButtonIndex?r.input.value:null),r.dialog.remove(),o(),t.callback(e),a.resolve(e)}})},r.footer.appendChild(e)}),t.cancelable&&(r.dialog.cancelable=!0,r.dialog.onDialogCancel=function(){setImmediate(function(){r.dialog.remove(),o()});var e=t.isPrompt?null:-1;t.callback(e),a.resolve(e)},r.dialog.addEventListener("dialog-cancel",r.dialog.onDialogCancel,!1)),document.body.appendChild(r.dialog),t.compile(r.dialog),setImmediate(function(){r.dialog.show().then(function(){r.input&&t.isPrompt&&t.autofocus&&r.input.focus()})}),a.promise};var yt=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e=g({},e),"string"==typeof t?e.message=t:e=t,!e.message&&!e.messageHTML)throw new Error("Notifications must contain a message.");return(e.hasOwnProperty("buttonLabels")||e.hasOwnProperty("buttonLabel"))&&(e.buttonLabels=e.buttonLabels||e.buttonLabel,Array.isArray(e.buttonLabels)||(e.buttonLabels=[e.buttonLabels||""])),G.extend({compile:function(t){return t},callback:function(t){return t},animation:"default",cancelable:!1,primaryButtonIndex:(e.buttonLabels||n.buttonLabels||[]).length-1},n,e)};bt.alert=function(t,e){return e=yt(t,e,{buttonLabels:["OK"],title:"Alert"}),bt._createAlertDialog(e)},bt.confirm=function(t,e){return e=yt(t,e,{buttonLabels:["Cancel","OK"],title:"Confirm"}),bt._createAlertDialog(e)},bt.prompt=function(t,e){return e=yt(t,e,{buttonLabels:["OK"],title:"Alert",isPrompt:!0,autofocus:!0,submitOnEnter:!0}),bt._createAlertDialog(e)},bt.toast=function(t,e){e=yt(t,e,{timeout:0,force:!1});var n=G.createElement("\n    <ons-toast>\n      "+e.message+"\n      "+(e.buttonLabels?"<button>"+e.buttonLabels[0]+"</button>":"")+"\n    </ons-toast>\n  ");_t(n,e);var i=G.defer(),r=function(t){n&&n.hide().then(function(){n&&(n.remove(),n=null,e.callback(t),i.resolve(t))})};e.buttonLabels&&(G.findChild(n._toast,"button").onclick=function(){return r(0)}),document.body.appendChild(n),e.compile(n);var o=function(){n.parentElement&&n.show(e).then(function(){e.timeout&&setTimeout(function(){return r(-1)},e.timeout)})};return e.force?o():vt.add(o,i.promise),i.promise};var kt=function(){};kt.prototype={on:function(t,e){this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(e)},once:function(t,e){var n=this;this.on(t,function i(){return n.off(t,i),e.apply(null,arguments)})},off:function(t,e){this._events=this._events||{},t in this._events!=!1&&(this._events[t]=this._events[t].filter(function(t){return!!e&&e!==t}))},emit:function(t){if(this._events=this._events||{},t in this._events!=!1)for(var e=0;e<this._events[t].length;e++)this._events[t][e].apply(this,Array.prototype.slice.call(arguments,1))}},kt.mixin=function(t){for(var e=["on","once","off","emit"],n=0;n<e.length;n++)"function"==typeof t?t.prototype[e[n]]=kt.prototype[e[n]]:t[e[n]]=kt.prototype[e[n]]},window.MicroEvent=kt;var wt=function(){var t={_isPortrait:!1,isPortrait:function(){return this._isPortrait()},isLandscape:function(){return!this.isPortrait()},_init:function(){return document.addEventListener("DOMContentLoaded",this._onDOMContentLoaded.bind(this),!1),"orientation"in window?window.addEventListener("orientationchange",this._onOrientationChange.bind(this),!1):window.addEventListener("resize",this._onResize.bind(this),!1),this._isPortrait=function(){return window.innerHeight>window.innerWidth},this},_onDOMContentLoaded:function(){this._installIsPortraitImplementation(),this.emit("change",{isPortrait:this.isPortrait()})},_installIsPortraitImplementation:function(){var t=window.innerWidth<window.innerHeight;"orientation"in window?window.orientation%180==0?this._isPortrait=function(){return 0===Math.abs(window.orientation%180)?t:!t}:this._isPortrait=function(){return 90===Math.abs(window.orientation%180)?t:!t}:this._isPortrait=function(){return window.innerHeight>window.innerWidth}},_onOrientationChange:function(){var t=this,e=this._isPortrait(),n=0,i=setInterval(function(){n++;var r=window.innerWidth,o=window.innerHeight;e&&r<=o||!e&&r>=o?(t.emit("change",{isPortrait:e}),clearInterval(i)):50===n&&(t.emit("change",{isPortrait:e}),clearInterval(i))},20)},_onResize:function(){this.emit("change",{isPortrait:this.isPortrait()})}};return kt.mixin(t),t}()._init(),Et={add:function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return n.forEach(function(e){return G.addModifier(t,e)})},remove:function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return n.forEach(function(e){return G.removeModifier(t,e)})},contains:G.hasModifier,toggle:G.toggleModifier},Ct=new kt;Ct._visible=!1;var At=function(){Ct._visible=!0,Ct.emit("show")},St=function(){Ct._visible=!1,Ct.emit("hide")},Ot=function(){G.warn("ons-keyboard: Cordova Keyboard plugin is not present.")};document.addEventListener("deviceready",function(){("undefined"!=typeof Keyboard?(Keyboard.onshow=At,Keyboard.onhide=St,Ct.emit("init",{visible:Keyboard.isVisible}),!0):void 0!==cordova.plugins&&void 0!==cordova.plugins.Keyboard&&(window.addEventListener("native.keyboardshow",At),window.addEventListener("native.keyboardhide",St),Ct.emit("init",{visible:cordova.plugins.Keyboard.isVisible}),!0))||((document.querySelector("[ons-keyboard-active]")||document.querySelector("[ons-keyboard-inactive]"))&&Ot(),Ct.on=Ot)});var Pt=function(){var t=0;return function(){return t++}}(),xt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};f(this,t),this._lockList=[],this._waitList=[],this._log=e.log||function(){}}return p(t,[{key:"lock",value:function(){var t=this,e=function e(){t._unlock(e)};return e.id=Pt(),this._lockList.push(e),this._log("lock: "+e.id),e}},{key:"_unlock",value:function(t){var e=this._lockList.indexOf(t);if(-1===e)throw new Error("This function is not registered in the lock list.");this._lockList.splice(e,1),this._log("unlock: "+t.id),this._tryToFreeWaitList()}},{key:"_tryToFreeWaitList",value:function(){for(;!this.isLocked()&&this._waitList.length>0;)this._waitList.shift()()}},{key:"waitUnlock",value:function(t){if(!(t instanceof Function))throw new Error("The callback param must be a function.");this.isLocked()?this._waitList.push(t):t()}},{key:"isLocked",value:function(){return this._lockList.length>0}}]),t}(),Tt=function(){function t(e,n){f(this,t),this._loader=e instanceof Function?e:function(t,e){var n=t.page,i=t.parent;C.getPageHTMLAsync(n).then(function(t){var n=G.createElement(t);i.appendChild(n),e(n)})},this._unloader=n instanceof Function?n:i}return p(t,[{key:"load",value:function(t,e){var n=t.page,i=t.parent,r=t.params,o=void 0===r?{}:r;this._loader({page:n,parent:i,params:o},function(t){if(!(t instanceof Element))throw Error("pageElement must be an instance of Element.");e(t)})}},{key:"unload",value:function(t){if(!(t instanceof Element))throw Error("pageElement must be an instance of Element.");this._unloader(t)}},{key:"internalLoader",set:function(t){if(!(t instanceof Function))throw Error("First parameter must be an instance of Function");this._loader=t},get:function(){return this._loader}}]),t}(),Lt=new Tt,Dt=new Tt(function(t,e){var n=t.page,i=t.parent,r=G.createElement(n.trim());i.appendChild(r),e(r)},i),Mt={animit:K,defaultPageLoader:Lt,elements:{},GestureDetector:et,modifier:Et,notification:bt,orientation:wt,pageAttributeExpression:E,PageLoader:Tt,platform:w,softwareKeyboard:Ct,_autoStyle:D,_internal:C,_readyLock:new xt,_util:G};Mt.platform.select((window.location.search.match(/platform=([\w-]+)/)||[])[1]),function(){var t=Mt._readyLock.lock();window.addEventListener("DOMContentLoaded",function(){Mt.isWebView()?window.document.addEventListener("deviceready",t,!1):t()},!1)}(),Mt.isReady=function(){return!Mt._readyLock.isLocked()},Mt.isWebView=Mt.platform.isWebView,Mt.ready=function(t){Mt.isReady()?t():Mt._readyLock.waitUnlock(t)},Mt.setDefaultDeviceBackButtonListener=function(t){if(!Mt.isReady())throw new Error("This method must be called after ons.isReady() is true.");Mt._defaultDeviceBackButtonHandler.setListener(t)},Mt.disableDeviceBackButtonHandler=function(){if(!Mt.isReady())throw new Error("This method must be called after ons.isReady() is true.");C.dbbDispatcher.disable()},Mt.enableDeviceBackButtonHandler=function(){if(!Mt.isReady())throw new Error("This method must be called after ons.isReady() is true.");C.dbbDispatcher.enable()},Mt.fireDeviceBackButtonEvent=function(){C.dbbDispatcher.fireDeviceBackButtonEvent()},Mt.enableAutoStatusBarFill=function(){if(Mt.isReady())throw new Error("This method must be called before ons.isReady() is true.");C.config.autoStatusBarFill=!0},Mt.disableAutoStatusBarFill=function(){if(Mt.isReady())throw new Error("This method must be called before ons.isReady() is true.");C.config.autoStatusBarFill=!1},Mt.mockStatusBar=function(){if(Mt.isReady())throw new Error("This method must be called before ons.isReady() is true.");var t=function(){if(!document.body.children[0]||!document.body.children[0].classList.contains("ons-status-bar-mock")){var t=w.isAndroid(),e=function(t){return'<i class="'+t.split("-")[0]+" "+t+'"></i>'},n=t?e("zmdi-twitter")+" "+e("zmdi-google-play"):"No SIM "+e("fa-wifi"),i=t?"":"12:28 PM",r=t?e("zmdi-network")+" "+e("zmdi-wifi")+" "+e("zmdi-battery")+" 12:28 PM":"80% "+e("fa-battery-three-quarters");document.body.insertBefore(G.createElement('<div class="ons-status-bar-mock '+(t?"android":"ios")+'"><div>'+n+"</div><div>"+i+"</div><div>"+r+"</div></div>"),document.body.firstChild)}};document.body?t():C.waitDOMContentLoaded(t)},Mt.disableAnimations=function(){C.config.animationsDisabled=!0},Mt.enableAnimations=function(){C.config.animationsDisabled=!1},Mt._disableWarnings=function(){C.config.warningsDisabled=!0},Mt._enableWarnings=function(){C.config.warningsDisabled=!1},Mt.disableAutoStyling=D.disable,Mt.enableAutoStyling=D.enable,Mt.disableIconAutoPrefix=function(){if(!Mt.elements.Icon)throw new Error("Expected 'ons-icon' Custom Element to be registered before calling this method.");Mt.elements.Icon.setAutoPrefix(!1)},Mt.forcePlatformStyling=function(t){Mt.enableAutoStyling(),Mt.platform.select(t||"ios"),Mt._util.arrayFrom(document.querySelectorAll("*")).forEach(function(t){"ons-if"===t.tagName.toLowerCase()?t._platformUpdate():t.tagName.match(/^ons-/i)&&(D.prepare(t,!0),"ons-tabbar"===t.tagName.toLowerCase()&&t._updatePosition())})},Mt.preload=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Promise.all((t instanceof Array?t:[t]).map(function(t){if("string"!=typeof t)throw new Error("Expected string arguments but got "+(void 0===t?"undefined":d(t)));return C.getTemplateHTMLAsync(t)}))},Mt.createElement=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=function(t){var n=Mt._util.createElement(t);if(n.remove(),e.append){(e.append instanceof HTMLElement?e.append:document.body).insertBefore(n,e.insertBefore||null),e.link instanceof Function&&e.link(n)}return n};return"<"===(t=t.trim()).charAt(0)?n(t):C.getPageHTMLAsync(t).then(n)},Mt.createPopover=Mt.createDialog=Mt.createAlertDialog=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Mt.createElement(t,g({append:!0},e))},Mt.openActionSheet=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(t){if(!(Object.hasOwnProperty.call(t,"buttons")&&t.buttons instanceof Array))throw new Error('"options.buttons" must be an instance of Array.');if(Object.hasOwnProperty.call(t,"callback")&&!(t.callback instanceof Function))throw new Error('"options.callback" must be an instance of Function.');if(Object.hasOwnProperty.call(t,"compile")&&!(t.compile instanceof Function))throw new Error('"options.compile" must be an instance of Function.');if(Object.hasOwnProperty.call(t,"destroy")&&!(t.destroy instanceof Function))throw new Error('"options.destroy" must be an instance of Function.')}(t);var e=G.createElement("\n    <ons-action-sheet\n      "+(t.title?'title="'+t.title+'"':"")+"\n      "+(t.cancelable?"cancelable":"")+"\n      "+(t.modifier?'modifier="'+t.modifier+'"':"")+"\n      "+(t.maskColor?'mask-color="'+t.maskColor+'"':"")+"\n      "+(t.id?'id="'+t.id+'"':"")+"\n      "+(t.class?'class="'+t.class+'"':"")+'\n    >\n      <div class="action-sheet"></div>\n    </ons-action-sheet>\n  '),n=G.defer(),i=function i(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;e&&(t.destroy&&t.destroy(e),e.removeEventListener("dialog-cancel",i,!1),e.remove(),e=null,t.callback&&t.callback(o),n.resolve(o))};e.addEventListener("dialog-cancel",i,!1);var r=document.createDocumentFragment();return t.buttons.forEach(function(n,o){var a="string"==typeof n?{label:n}:g({},n);t.destructive===o&&(a.modifier=(a.modifier||"")+" destructive");var s=G.createElement("\n      <ons-action-sheet-button\n        "+(a.icon?'icon="'+a.icon+'"':"")+"\n        "+(a.modifier?'modifier="'+a.modifier+'"':"")+"\n      >\n        "+a.label+"\n      </ons-action-sheet-button>\n    ");s.onclick=function(t){return e.hide().then(function(){return i(t,o)})},r.appendChild(s)}),G.findChild(e,".action-sheet").appendChild(r),document.body.appendChild(e),t.compile&&t.compile(el.dialog),setImmediate(function(){return e.show({animation:t.animation,animationOptions:t.animationOptions})}),n.promise},Mt.resolveLoadingPlaceholder=function(t,e){var n=Mt._util.arrayFrom(window.document.querySelectorAll("[ons-loading-placeholder]"));if(0===n.length)throw new Error("No ons-loading-placeholder exists.");n.filter(function(t){return!t.getAttribute("page")}).forEach(function(n){n.setAttribute("ons-loading-placeholder",t),Mt._resolveLoadingPlaceholder(n,t,e)})},Mt._setupLoadingPlaceHolders=function(){Mt.ready(function(){Mt._util.arrayFrom(window.document.querySelectorAll("[ons-loading-placeholder]")).forEach(function(t){var e=t.getAttribute("ons-loading-placeholder");"string"==typeof e&&Mt._resolveLoadingPlaceholder(t,e)})})},Mt._resolveLoadingPlaceholder=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(t,e){return e()};e&&Mt.createElement(e).then(function(e){e.style.display="none",t.appendChild(e),n(e,function(){for(;t.firstChild&&t.firstChild!==e;)t.removeChild(t.firstChild);e.style.display=""})}).catch(function(t){return Promise.reject("Unabled to resolve placeholder: "+t)})};var It="currentScript"in document?function(){return document.currentScript}:function(){return document.scripts[document.scripts.length-1]};Mt.getScriptPage=function(){return It()&&/ons-page/i.test(It().parentElement.tagName)&&It().parentElement||null},window.customElements&&(window.customElements.forcePolyfill=!0);var Nt=r(function(t){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)}),qt=r(function(t){var e=t.exports={version:"2.5.1"};"number"==typeof __e&&(__e=e)}),Bt=function(t){return"object"===(void 0===t?"undefined":d(t))?null!==t:"function"==typeof t},jt=function(t){if(!Bt(t))throw TypeError(t+" is not an object!");return t},Ht=function(t){try{return!!t()}catch(t){return!0}},Rt=!Ht(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),zt=Nt.document,Ft=Bt(zt)&&Bt(zt.createElement),Vt=function(t){return Ft?zt.createElement(t):{}},Wt=!Rt&&!Ht(function(){return 7!=Object.defineProperty(Vt("div"),"a",{get:function(){return 7}}).a}),Xt=function(t,e){if(!Bt(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!Bt(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!Bt(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!Bt(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")},Ut=Object.defineProperty,Yt={f:Rt?Object.defineProperty:function(t,e,n){if(jt(t),e=Xt(e,!0),jt(n),Wt)try{return Ut(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},Gt=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},$t=Rt?function(t,e,n){return Yt.f(t,e,Gt(1,n))}:function(t,e,n){return t[e]=n,t},Kt={}.hasOwnProperty,Qt=function(t,e){return Kt.call(t,e)},Jt=0,Zt=Math.random(),te=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++Jt+Zt).toString(36))},ee=r(function(t){var e=te("src"),n=Function.toString,i=(""+n).split("toString");qt.inspectSource=function(t){return n.call(t)},(t.exports=function(t,n,r,o){var a="function"==typeof r;a&&(Qt(r,"name")||$t(r,"name",n)),t[n]!==r&&(a&&(Qt(r,e)||$t(r,e,t[n]?""+t[n]:i.join(String(n)))),t===Nt?t[n]=r:o?t[n]?t[n]=r:$t(t,n,r):(delete t[n],$t(t,n,r)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[e]||n.call(this)})}),ne=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t},ie=function(t,e,n){if(ne(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,r){return t.call(e,n,i,r)}}return function(){return t.apply(e,arguments)}},re=function t(e,n,i){var r,o,a,s,u=e&t.F,l=e&t.G,c=e&t.P,h=e&t.B,d=l?Nt:e&t.S?Nt[n]||(Nt[n]={}):(Nt[n]||{}).prototype,f=l?qt:qt[n]||(qt[n]={}),p=f.prototype||(f.prototype={});l&&(i=n);for(r in i)a=((o=!u&&d&&void 0!==d[r])?d:i)[r],s=h&&o?ie(a,Nt):c&&"function"==typeof a?ie(Function.call,a):a,d&&ee(d,r,a,e&t.U),f[r]!=a&&$t(f,r,s),c&&p[r]!=a&&(p[r]=a)};Nt.core=qt,re.F=1,re.G=2,re.S=4,re.P=8,re.B=16,re.W=32,re.U=64,re.R=128;var oe=re,ae={f:{}.propertyIsEnumerable},se={}.toString,ue=function(t){return se.call(t).slice(8,-1)},le=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==ue(t)?t.split(""):Object(t)},ce=function(t){if(void 0==t)throw TypeError("Can't call method on  "+t);return t},he=function(t){return le(ce(t))},de=Object.getOwnPropertyDescriptor,fe={f:Rt?de:function(t,e){if(t=he(t),e=Xt(e,!0),Wt)try{return de(t,e)}catch(t){}if(Qt(t,e))return Gt(!ae.f.call(t,e),t[e])}},pe=function(t,e){if(jt(t),!Bt(e)&&null!==e)throw TypeError(e+": can't set as prototype!")},me={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,n){try{(n=ie(Function.call,fe.f(Object.prototype,"__proto__").set,2))(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,i){return pe(t,i),e?t.__proto__=i:n(t,i),t}}({},!1):void 0),check:pe};oe(oe.S,"Object",{setPrototypeOf:me.set});var ge=Nt["__core-js_shared__"]||(Nt["__core-js_shared__"]={}),ve=function(t){return ge[t]||(ge[t]={})},_e=r(function(t){var e=ve("wks"),n=Nt.Symbol,i="function"==typeof n;(t.exports=function(t){return e[t]||(e[t]=i&&n[t]||(i?n:te)("Symbol."+t))}).store=e}),be=_e("toStringTag"),ye="Arguments"==ue(function(){return arguments}()),ke=function(t){var e,n,i;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),be))?n:ye?ue(e):"Object"==(i=ue(e))&&"function"==typeof e.callee?"Arguments":i},we={};we[_e("toStringTag")]="z",we+""!="[object z]"&&ee(Object.prototype,"toString",function(){return"[object "+ke(this)+"]"},!0);var Ee=Math.ceil,Ce=Math.floor,Ae=function(t){return isNaN(t=+t)?0:(t>0?Ce:Ee)(t)},Se={},Oe=Math.min,Pe=function(t){return t>0?Oe(Ae(t),9007199254740991):0},xe=Math.max,Te=Math.min,Le=ve("keys"),De=function(t){return Le[t]||(Le[t]=te(t))},Me=function(t){return function(e,n,i){var r,o=he(e),a=Pe(o.length),s=function(t,e){return(t=Ae(t))<0?xe(t+e,0):Te(t,e)}(i,a);if(t&&n!=n){for(;a>s;)if((r=o[s++])!=r)return!0}else for(;a>s;s++)if((t||s in o)&&o[s]===n)return t||s||0;return!t&&-1}}(!1),Ie=De("IE_PROTO"),Ne="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),qe=Object.keys||function(t){return function(t,e){var n,i=he(t),r=0,o=[];for(n in i)n!=Ie&&Qt(i,n)&&o.push(n);for(;e.length>r;)Qt(i,n=e[r++])&&(~Me(o,n)||o.push(n));return o}(t,Ne)},Be=Rt?Object.defineProperties:function(t,e){jt(t);for(var n,i=qe(e),r=i.length,o=0;r>o;)Yt.f(t,n=i[o++],e[n]);return t},je=Nt.document,He=je&&je.documentElement,Re=De("IE_PROTO"),ze=function(){},Fe=function(){var t,e=Vt("iframe"),n=Ne.length;for(e.style.display="none",He.appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),Fe=t.F;n--;)delete Fe.prototype[Ne[n]];return Fe()},Ve=Object.create||function(t,e){var n;return null!==t?(ze.prototype=jt(t),n=new ze,ze.prototype=null,n[Re]=t):n=Fe(),void 0===e?n:Be(n,e)},We=Yt.f,Xe=_e("toStringTag"),Ue=function(t,e,n){t&&!Qt(t=n?t:t.prototype,Xe)&&We(t,Xe,{configurable:!0,value:e})},Ye={};$t(Ye,_e("iterator"),function(){return this});var Ge=function(t,e,n){t.prototype=Ve(Ye,{next:Gt(1,n)}),Ue(t,e+" Iterator")},$e=De("IE_PROTO"),Ke=Object.prototype,Qe=Object.getPrototypeOf||function(t){return t=function(t){return Object(ce(t))}(t),Qt(t,$e)?t[$e]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?Ke:null},Je=_e("iterator"),Ze=!([].keys&&"next"in[].keys()),tn=function(){return this},en=function(t,e,n,i,r,o,a){Ge(n,e,i);var s,u,l,c=function(t){if(!Ze&&t in p)return p[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},h=e+" Iterator",d="values"==r,f=!1,p=t.prototype,m=p[Je]||p["@@iterator"]||r&&p[r],g=m||c(r),v=r?d?c("entries"):g:void 0,_="Array"==e?p.entries||m:m;if(_&&(l=Qe(_.call(new t)))!==Object.prototype&&l.next&&(Ue(l,h,!0),Qt(l,Je)||$t(l,Je,tn)),d&&m&&"values"!==m.name&&(f=!0,g=function(){return m.call(this)}),(Ze||f||!p[Je])&&$t(p,Je,g),Se[e]=g,Se[h]=tn,r)if(s={values:d?g:c("values"),keys:o?g:c("keys"),entries:v},a)for(u in s)u in p||ee(p,u,s[u]);else oe(oe.P+oe.F*(Ze||f),e,s);return s},nn=function(t){return function(e,n){var i,r,o=String(ce(e)),a=Ae(n),s=o.length;return a<0||a>=s?t?"":void 0:(i=o.charCodeAt(a))<55296||i>56319||a+1===s||(r=o.charCodeAt(a+1))<56320||r>57343?t?o.charAt(a):i:t?o.slice(a,a+2):r-56320+(i-55296<<10)+65536}}(!0);en(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=nn(e,n),this._i+=t.length,{value:t,done:!1})});var rn=_e("unscopables"),on=Array.prototype;void 0==on[rn]&&$t(on,rn,{});var an=function(t){on[rn][t]=!0},sn=function(t,e){return{value:e,done:!!t}},un=en(Array,"Array",function(t,e){this._t=he(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,sn(1)):"keys"==e?sn(0,n):"values"==e?sn(0,t[n]):sn(0,[n,t[n]])},"values");Se.Arguments=Se.Array,an("keys"),an("values"),an("entries");for(var ln=_e("iterator"),cn=_e("toStringTag"),hn=Se.Array,dn={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},fn=qe(dn),pn=0;pn<fn.length;pn++){var mn,gn=fn[pn],vn=dn[gn],_n=Nt[gn],bn=_n&&_n.prototype;if(bn&&(bn[ln]||$t(bn,ln,hn),bn[cn]||$t(bn,cn,gn),Se[gn]=hn,vn))for(mn in un)bn[mn]||ee(bn,mn,un[mn],!0)}var yn=function(t,e,n){for(var i in e)ee(t,i,e[i],n);return t},kn=function(t,e,n,i){if(!(t instanceof e)||void 0!==i&&i in t)throw TypeError(n+": incorrect invocation!");return t},wn=_e("iterator"),En=Array.prototype,Cn=_e("iterator"),An=qt.getIteratorMethod=function(t){if(void 0!=t)return t[Cn]||t["@@iterator"]||Se[ke(t)]},Sn=r(function(t){var e={},n={},i=t.exports=function(t,i,r,o,a){var s,u,l,c,h=a?function(){return t}:An(t),d=ie(r,o,i?2:1),f=0;if("function"!=typeof h)throw TypeError(t+" is not iterable!");if(function(t){return void 0!==t&&(Se.Array===t||En[wn]===t)}(h)){for(s=Pe(t.length);s>f;f++)if((c=i?d(jt(u=t[f])[0],u[1]):d(t[f]))===e||c===n)return c}else for(l=h.call(t);!(u=l.next()).done;)if((c=function(t,e,n,i){try{return i?e(jt(n)[0],n[1]):e(n)}catch(e){var r=t.return;throw void 0!==r&&jt(r.call(t)),e}}(l,d,u.value,i))===e||c===n)return c};i.BREAK=e,i.RETURN=n}),On=_e("species"),Pn=r(function(t){var e=te("meta"),n=Yt.f,i=0,r=Object.isExtensible||function(){return!0},o=!Ht(function(){return r(Object.preventExtensions({}))}),a=function(t){n(t,e,{value:{i:"O"+ ++i,w:{}}})},s=t.exports={KEY:e,NEED:!1,fastKey:function(t,n){if(!Bt(t))return"symbol"==(void 0===t?"undefined":d(t))?t:("string"==typeof t?"S":"P")+t;if(!Qt(t,e)){if(!r(t))return"F";if(!n)return"E";a(t)}return t[e].i},getWeak:function(t,n){if(!Qt(t,e)){if(!r(t))return!0;if(!n)return!1;a(t)}return t[e].w},onFreeze:function(t){return o&&s.NEED&&r(t)&&!Qt(t,e)&&a(t),t}}}),xn=function(t,e){if(!Bt(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t},Tn=Yt.f,Ln=Pn.fastKey,Dn=Rt?"_s":"size",Mn=function(t,e){var n,i=Ln(e);if("F"!==i)return t._i[i];for(n=t._f;n;n=n.n)if(n.k==e)return n},In={getConstructor:function(t,e,n,i){var r=t(function(t,o){kn(t,r,e,"_i"),t._t=e,t._i=Ve(null),t._f=void 0,t._l=void 0,t[Dn]=0,void 0!=o&&Sn(o,n,t[i],t)});return yn(r.prototype,{clear:function(){for(var t=xn(this,e),n=t._i,i=t._f;i;i=i.n)i.r=!0,i.p&&(i.p=i.p.n=void 0),delete n[i.i];t._f=t._l=void 0,t[Dn]=0},delete:function(t){var n=xn(this,e),i=Mn(n,t);if(i){var r=i.n,o=i.p;delete n._i[i.i],i.r=!0,o&&(o.n=r),r&&(r.p=o),n._f==i&&(n._f=r),n._l==i&&(n._l=o),n[Dn]--}return!!i},forEach:function(t){xn(this,e);for(var n,i=ie(t,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(i(n.v,n.k,this);n&&n.r;)n=n.p},has:function(t){return!!Mn(xn(this,e),t)}}),Rt&&Tn(r.prototype,"size",{get:function(){return xn(this,e)[Dn]}}),r},def:function(t,e,n){var i,r,o=Mn(t,e);return o?o.v=n:(t._l=o={i:r=Ln(e,!0),k:e,v:n,p:i=t._l,n:void 0,r:!1},t._f||(t._f=o),i&&(i.n=o),t[Dn]++,"F"!==r&&(t._i[r]=o)),t},getEntry:Mn,setStrong:function(t,e,n){en(t,e,function(t,n){this._t=xn(t,e),this._k=n,this._l=void 0},function(){for(var t=this._k,e=this._l;e&&e.r;)e=e.p;return this._t&&(this._l=e=e?e.n:this._t._f)?"keys"==t?sn(0,e.k):"values"==t?sn(0,e.v):sn(0,[e.k,e.v]):(this._t=void 0,sn(1))},n?"entries":"values",!n,!0),function(t){var e=Nt[t];Rt&&e&&!e[On]&&Yt.f(e,On,{configurable:!0,get:function(){return this}})}(e)}},Nn=_e("iterator"),qn=!1;try{[7][Nn]().return=function(){qn=!0}}catch(t){}var Bn=me.set,jn=function(t,e,n,i,r,o){var a=Nt[t],s=a,u=r?"set":"add",l=s&&s.prototype,c={},h=function(t){var e=l[t];ee(l,t,"delete"==t?function(t){return!(o&&!Bt(t))&&e.call(this,0===t?0:t)}:"has"==t?function(t){return!(o&&!Bt(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return o&&!Bt(t)?void 0:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,n){return e.call(this,0===t?0:t,n),this})};if("function"==typeof s&&(o||l.forEach&&!Ht(function(){(new s).entries().next()}))){var d=new s,f=d[u](o?{}:-0,1)!=d,p=Ht(function(){d.has(1)}),m=function(t,e){if(!e&&!qn)return!1;var n=!1;try{var i=[7],r=i[Nn]();r.next=function(){return{done:n=!0}},i[Nn]=function(){return r},t(i)}catch(t){}return n}(function(t){new s(t)}),g=!o&&Ht(function(){for(var t=new s,e=5;e--;)t[u](e,e);return!t.has(-0)});m||((s=e(function(e,n){kn(e,s,t);var i=function(t,e,n){var i,r=e.constructor;return r!==n&&"function"==typeof r&&(i=r.prototype)!==n.prototype&&Bt(i)&&Bn&&Bn(t,i),t}(new a,e,s);return void 0!=n&&Sn(n,r,i[u],i),i})).prototype=l,l.constructor=s),(p||g)&&(h("delete"),h("has"),r&&h("get")),(g||f)&&h(u),o&&l.clear&&delete l.clear}else s=i.getConstructor(e,t,r,u),yn(s.prototype,n),Pn.NEED=!0;return Ue(s,t),c[t]=s,oe(oe.G+oe.W+oe.F*(s!=a),c),o||i.setStrong(s,t,r),s},Hn=(jn("Set",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{add:function(t){return In.def(xn(this,"Set"),t=0===t?0:t,t)}},In),function(t){return function(){if(ke(this)!=t)throw TypeError(t+"#toJSON isn't generic");return function(t,e){var n=[];return Sn(t,!1,n.push,n,e),n}(this)}});oe(oe.P+oe.R,"Set",{toJSON:Hn("Set")});var Rn=function(t){oe(oe.S,t,{of:function(){for(var t=arguments.length,e=Array(t);t--;)e[t]=arguments[t];return new this(e)}})};Rn("Set");var zn=function(t){oe(oe.S,t,{from:function(t){var e,n,i,r,o=arguments[1];return ne(this),(e=void 0!==o)&&ne(o),void 0==t?new this:(n=[],e?(i=0,r=ie(o,arguments[2],2),Sn(t,!1,function(t){n.push(r(t,i++))})):Sn(t,!1,n.push,n),new this(n))}})};zn("Set");jn("Map",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{get:function(t){var e=In.getEntry(xn(this,"Map"),t);return e&&e.v},set:function(t,e){return In.def(xn(this,"Map"),0===t?0:t,e)}},In,!0);oe(oe.P+oe.R,"Map",{toJSON:Hn("Map")}),Rn("Map"),zn("Map");var Fn=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]),Vn={custom:1,failed:2},Wn=function(){function t(){f(this,t),this._localNameToDefinition=new Map,this._constructorToDefinition=new Map,this._patches=[],this._hasPatches=!1}return p(t,[{key:"setDefinition",value:function(t,e){this._localNameToDefinition.set(t,e),this._constructorToDefinition.set(e.constructor,e)}},{key:"localNameToDefinition",value:function(t){return this._localNameToDefinition.get(t)}},{key:"constructorToDefinition",value:function(t){return this._constructorToDefinition.get(t)}},{key:"addPatch",value:function(t){this._hasPatches=!0,this._patches.push(t)}},{key:"patchTree",value:function(t){var e=this;this._hasPatches&&u(t,function(t){return e.patch(t)})}},{key:"patch",value:function(t){if(this._hasPatches&&!t.__CE_patched){t.__CE_patched=!0;for(var e=0;e<this._patches.length;e++)this._patches[e](t)}}},{key:"connectTree",value:function(t){var e=[];u(t,function(t){return e.push(t)});for(var n=0;n<e.length;n++){var i=e[n];i.__CE_state===Vn.custom?a(i)&&this.connectedCallback(i):this.upgradeElement(i)}}},{key:"disconnectTree",value:function(t){var e=[];u(t,function(t){return e.push(t)});for(var n=0;n<e.length;n++){var i=e[n];i.__CE_state===Vn.custom&&this.disconnectedCallback(i)}}},{key:"patchAndUpgradeTree",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Set,i=[];if(u(t,function(t){if("link"===t.localName&&"import"===t.getAttribute("rel")){var r=t.import;r instanceof Node&&"complete"===r.readyState?(r.__CE_isImportDocument=!0,r.__CE_hasRegistry=!0):t.addEventListener("load",function(){var i=t.import;i.__CE_documentLoadHandled||(i.__CE_documentLoadHandled=!0,i.__CE_isImportDocument=!0,i.__CE_hasRegistry=!0,n.delete(i),e.patchAndUpgradeTree(i,n))})}else i.push(t)},n),this._hasPatches)for(var r=0;r<i.length;r++)this.patch(i[r]);for(var o=0;o<i.length;o++)this.upgradeElement(i[o])}},{key:"upgradeElement",value:function(t){if(void 0===t.__CE_state){var e=this.localNameToDefinition(t.localName);if(e){e.constructionStack.push(t);var n=e.constructor;try{try{if(new n!==t)throw new Error("The custom element constructor did not produce the element being upgraded.")}finally{e.constructionStack.pop()}}catch(e){throw t.__CE_state=Vn.failed,e}if(t.__CE_state=Vn.custom,t.__CE_definition=e,e.attributeChangedCallback)for(var i=e.observedAttributes,r=0;r<i.length;r++){var o=i[r],s=t.getAttribute(o);null!==s&&this.attributeChangedCallback(t,o,null,s,null)}a(t)&&this.connectedCallback(t)}}}},{key:"connectedCallback",value:function(t){var e=t.__CE_definition;e.connectedCallback&&e.connectedCallback.call(t),t.__CE_isConnectedCallbackCalled=!0}},{key:"disconnectedCallback",value:function(t){t.__CE_isConnectedCallbackCalled||this.connectedCallback(t);var e=t.__CE_definition;e.disconnectedCallback&&e.disconnectedCallback.call(t),t.__CE_isConnectedCallbackCalled=void 0}},{key:"attributeChangedCallback",value:function(t,e,n,i,r){var o=t.__CE_definition;o.attributeChangedCallback&&o.observedAttributes.indexOf(e)>-1&&o.attributeChangedCallback.call(t,e,n,i,r)}}]),t}(),Xn=function(){function t(e,n){f(this,t),this._internals=e,this._document=n,this._observer=void 0,this._internals.patchAndUpgradeTree(this._document),"loading"===this._document.readyState&&(this._observer=new MutationObserver(this._handleMutations.bind(this)),this._observer.observe(this._document,{childList:!0,subtree:!0}))}return p(t,[{key:"disconnect",value:function(){this._observer&&this._observer.disconnect()}},{key:"_handleMutations",value:function(t){var e=this._document.readyState;"interactive"!==e&&"complete"!==e||this.disconnect();for(var n=0;n<t.length;n++)for(var i=t[n].addedNodes,r=0;r<i.length;r++){var o=i[r];this._internals.patchAndUpgradeTree(o)}}}]),t}(),Un=function(){function t(){var e=this;f(this,t),this._value=void 0,this._resolve=void 0,this._promise=new Promise(function(t){e._resolve=t,e._value&&t(e._value)})}return p(t,[{key:"resolve",value:function(t){if(this._value)throw new Error("Already resolved.");this._value=t,this._resolve&&this._resolve(t)}},{key:"toPromise",value:function(){return this._promise}}]),t}(),Yn=function(){function t(e){f(this,t),this._elementDefinitionIsRunning=!1,this._internals=e,this._whenDefinedDeferred=new Map,this._flushCallback=function(t){return t()},this._flushPending=!1,this._unflushedLocalNames=[],this._documentConstructionObserver=new Xn(e,document)}return p(t,[{key:"define",value:function(t,e){var n=this;if(!(e instanceof Function))throw new TypeError("Custom element constructors must be functions.");if(!o(t))throw new SyntaxError("The element name '"+t+"' is not valid.");if(this._internals.localNameToDefinition(t))throw new Error("A custom element with name '"+t+"' has already been defined.");if(this._elementDefinitionIsRunning)throw new Error("A custom element is already being defined.");this._elementDefinitionIsRunning=!0;var i=void 0,r=void 0,a=void 0,s=void 0,u=void 0;try{var l=function(t){var e=c[t];if(void 0!==e&&!(e instanceof Function))throw new Error("The '"+t+"' callback must be a function.");return e},c=e.prototype;if(!(c instanceof Object))throw new TypeError("The custom element constructor's prototype is not an object.");i=l("connectedCallback"),r=l("disconnectedCallback"),a=l("adoptedCallback"),s=l("attributeChangedCallback"),u=e.observedAttributes||[]}catch(t){return}finally{this._elementDefinitionIsRunning=!1}var h={localName:t,constructor:e,connectedCallback:i,disconnectedCallback:r,adoptedCallback:a,attributeChangedCallback:s,observedAttributes:u,constructionStack:[]};this._internals.setDefinition(t,h),this._unflushedLocalNames.push(t),this._flushPending||(this._flushPending=!0,this._flushCallback(function(){return n._flush()}))}},{key:"_flush",value:function(){if(!1!==this._flushPending)for(this._flushPending=!1,this._internals.patchAndUpgradeTree(document);this._unflushedLocalNames.length>0;){var t=this._unflushedLocalNames.shift(),e=this._whenDefinedDeferred.get(t);e&&e.resolve(void 0)}}},{key:"get",value:function(t){var e=this._internals.localNameToDefinition(t);if(e)return e.constructor}},{key:"whenDefined",value:function(t){if(!o(t))return Promise.reject(new SyntaxError("'"+t+"' is not a valid custom element name."));var e=this._whenDefinedDeferred.get(t);if(e)return e.toPromise();var n=new Un;this._whenDefinedDeferred.set(t,n);return this._internals.localNameToDefinition(t)&&-1===this._unflushedLocalNames.indexOf(t)&&n.resolve(void 0),n.toPromise()}},{key:"polyfillWrapFlushCallback",value:function(t){this._documentConstructionObserver.disconnect();var e=this._flushCallback;this._flushCallback=function(n){return t(function(){return e(n)})}}}]),t}();window.CustomElementRegistry=Yn,Yn.prototype.define=Yn.prototype.define,Yn.prototype.get=Yn.prototype.get,Yn.prototype.whenDefined=Yn.prototype.whenDefined,Yn.prototype.polyfillWrapFlushCallback=Yn.prototype.polyfillWrapFlushCallback;var Gn={Document_createElement:window.Document.prototype.createElement,Document_createElementNS:window.Document.prototype.createElementNS,Document_importNode:window.Document.prototype.importNode,Document_prepend:window.Document.prototype.prepend,Document_append:window.Document.prototype.append,Node_cloneNode:window.Node.prototype.cloneNode,Node_appendChild:window.Node.prototype.appendChild,Node_insertBefore:window.Node.prototype.insertBefore,Node_removeChild:window.Node.prototype.removeChild,Node_replaceChild:window.Node.prototype.replaceChild,Node_textContent:Object.getOwnPropertyDescriptor(window.Node.prototype,"textContent"),Element_attachShadow:window.Element.prototype.attachShadow,Element_innerHTML:Object.getOwnPropertyDescriptor(window.Element.prototype,"innerHTML"),Element_getAttribute:window.Element.prototype.getAttribute,Element_setAttribute:window.Element.prototype.setAttribute,Element_removeAttribute:window.Element.prototype.removeAttribute,Element_getAttributeNS:window.Element.prototype.getAttributeNS,Element_setAttributeNS:window.Element.prototype.setAttributeNS,Element_removeAttributeNS:window.Element.prototype.removeAttributeNS,Element_insertAdjacentElement:window.Element.prototype.insertAdjacentElement,Element_prepend:window.Element.prototype.prepend,Element_append:window.Element.prototype.append,Element_before:window.Element.prototype.before,Element_after:window.Element.prototype.after,Element_replaceWith:window.Element.prototype.replaceWith,Element_remove:window.Element.prototype.remove,HTMLElement:window.HTMLElement,HTMLElement_innerHTML:Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML"),HTMLElement_insertAdjacentElement:window.HTMLElement.prototype.insertAdjacentElement},$n=new function t(){f(this,t)},Kn=function(t,e,n){e.prepend=function(){for(var e=arguments.length,i=Array(e),r=0;r<e;r++)i[r]=arguments[r];var o=i.filter(function(t){return t instanceof Node&&a(t)});n.prepend.apply(this,i);for(var s=0;s<o.length;s++)t.disconnectTree(o[s]);if(a(this))for(var u=0;u<i.length;u++){var l=i[u];l instanceof Element&&t.connectTree(l)}},e.append=function(){for(var e=arguments.length,i=Array(e),r=0;r<e;r++)i[r]=arguments[r];var o=i.filter(function(t){return t instanceof Node&&a(t)});n.append.apply(this,i);for(var s=0;s<o.length;s++)t.disconnectTree(o[s]);if(a(this))for(var u=0;u<i.length;u++){var l=i[u];l instanceof Element&&t.connectTree(l)}}},Qn=window.customElements;if(!Qn||Qn.forcePolyfill||"function"!=typeof Qn.define||"function"!=typeof Qn.get){var Jn=new Wn;!function(t){window.HTMLElement=function(){function e(){var e=this.constructor,n=t.constructorToDefinition(e);if(!n)throw new Error("The custom element being constructed was not registered with `customElements`.");var i=n.constructionStack;if(0===i.length){var r=Gn.Document_createElement.call(document,n.localName);return Object.setPrototypeOf(r,e.prototype),r.__CE_state=Vn.custom,r.__CE_definition=n,t.patch(r),r}var o=i.length-1,a=i[o];if(a===$n)throw new Error("The HTMLElement constructor was either called reentrantly for this constructor or called multiple times.");return i[o]=$n,Object.setPrototypeOf(a,e.prototype),t.patch(a),a}return e.prototype=Gn.HTMLElement.prototype,e}()}(Jn),function(t){l(Document.prototype,"createElement",function(e){if(this.__CE_hasRegistry){var n=t.localNameToDefinition(e);if(n)return new n.constructor}var i=Gn.Document_createElement.call(this,e);return t.patch(i),i}),l(Document.prototype,"importNode",function(e,n){var i=Gn.Document_importNode.call(this,e,n);return this.__CE_hasRegistry?t.patchAndUpgradeTree(i):t.patchTree(i),i});l(Document.prototype,"createElementNS",function(e,n){if(this.__CE_hasRegistry&&(null===e||"http://www.w3.org/1999/xhtml"===e)){var i=t.localNameToDefinition(n);if(i)return new i.constructor}var r=Gn.Document_createElementNS.call(this,e,n);return t.patch(r),r}),Kn(t,Document.prototype,{prepend:Gn.Document_prepend,append:Gn.Document_append})}(Jn),function(t){function e(e,n){Object.defineProperty(e,"textContent",{enumerable:n.enumerable,configurable:!0,get:n.get,set:function(e){if(this.nodeType!==Node.TEXT_NODE){var i=void 0;if(this.firstChild){var r=this.childNodes,o=r.length;if(o>0&&a(this)){i=new Array(o);for(var s=0;s<o;s++)i[s]=r[s]}}if(n.set.call(this,e),i)for(var u=0;u<i.length;u++)t.disconnectTree(i[u])}else n.set.call(this,e)}})}l(Node.prototype,"insertBefore",function(e,n){if(e instanceof DocumentFragment){var i=Array.prototype.slice.apply(e.childNodes),r=Gn.Node_insertBefore.call(this,e,n);if(a(this))for(var o=0;o<i.length;o++)t.connectTree(i[o]);return r}var s=a(e),u=Gn.Node_insertBefore.call(this,e,n);return s&&t.disconnectTree(e),a(this)&&t.connectTree(e),u}),l(Node.prototype,"appendChild",function(e){if(e instanceof DocumentFragment){var n=Array.prototype.slice.apply(e.childNodes),i=Gn.Node_appendChild.call(this,e);if(a(this))for(var r=0;r<n.length;r++)t.connectTree(n[r]);return i}var o=a(e),s=Gn.Node_appendChild.call(this,e);return o&&t.disconnectTree(e),a(this)&&t.connectTree(e),s}),l(Node.prototype,"cloneNode",function(e){var n=Gn.Node_cloneNode.call(this,e);return this.ownerDocument.__CE_hasRegistry?t.patchAndUpgradeTree(n):t.patchTree(n),n}),l(Node.prototype,"removeChild",function(e){var n=a(e),i=Gn.Node_removeChild.call(this,e);return n&&t.disconnectTree(e),i}),l(Node.prototype,"replaceChild",function(e,n){if(e instanceof DocumentFragment){var i=Array.prototype.slice.apply(e.childNodes),r=Gn.Node_replaceChild.call(this,e,n);if(a(this)){t.disconnectTree(n);for(var o=0;o<i.length;o++)t.connectTree(i[o])}return r}var s=a(e),u=Gn.Node_replaceChild.call(this,e,n),l=a(this);return l&&t.disconnectTree(n),s&&t.disconnectTree(e),l&&t.connectTree(e),u}),Gn.Node_textContent&&Gn.Node_textContent.get?e(Node.prototype,Gn.Node_textContent):t.addPatch(function(t){e(t,{enumerable:!0,configurable:!0,get:function(){for(var t=[],e=0;e<this.childNodes.length;e++)t.push(this.childNodes[e].textContent);return t.join("")},set:function(t){for(;this.firstChild;)Gn.Node_removeChild.call(this,this.firstChild);Gn.Node_appendChild.call(this,document.createTextNode(t))}})})}(Jn),function(t){function e(e,n){Object.defineProperty(e,"innerHTML",{enumerable:n.enumerable,configurable:!0,get:n.get,set:function(e){var i=this,r=void 0;if(a(this)&&(r=[],u(this,function(t){t!==i&&r.push(t)})),n.set.call(this,e),r)for(var o=0;o<r.length;o++){var s=r[o];s.__CE_state===Vn.custom&&t.disconnectedCallback(s)}return this.ownerDocument.__CE_hasRegistry?t.patchAndUpgradeTree(this):t.patchTree(this),e}})}function n(e,n){l(e,"insertAdjacentElement",function(e,i){var r=a(i),o=n.call(this,e,i);return r&&t.disconnectTree(i),a(o)&&t.connectTree(i),o})}if(Gn.Element_attachShadow?l(Element.prototype,"attachShadow",function(t){var e=Gn.Element_attachShadow.call(this,t);return this.__CE_shadowRoot=e,e}):console.warn("Custom Elements: `Element#attachShadow` was not patched."),Gn.Element_innerHTML&&Gn.Element_innerHTML.get)e(Element.prototype,Gn.Element_innerHTML);else if(Gn.HTMLElement_innerHTML&&Gn.HTMLElement_innerHTML.get)e(HTMLElement.prototype,Gn.HTMLElement_innerHTML);else{var i=Gn.Document_createElement.call(document,"div");t.addPatch(function(t){e(t,{enumerable:!0,configurable:!0,get:function(){return Gn.Node_cloneNode.call(this,!0).innerHTML},set:function(t){var e="template"===this.localName?this.content:this;for(i.innerHTML=t;e.childNodes.length>0;)Gn.Node_removeChild.call(e,e.childNodes[0]);for(;i.childNodes.length>0;)Gn.Node_appendChild.call(e,i.childNodes[0])}})})}l(Element.prototype,"setAttribute",function(e,n){if(this.__CE_state!==Vn.custom)return Gn.Element_setAttribute.call(this,e,n);var i=Gn.Element_getAttribute.call(this,e);Gn.Element_setAttribute.call(this,e,n),n=Gn.Element_getAttribute.call(this,e),t.attributeChangedCallback(this,e,i,n,null)}),l(Element.prototype,"setAttributeNS",function(e,n,i){if(this.__CE_state!==Vn.custom)return Gn.Element_setAttributeNS.call(this,e,n,i);var r=Gn.Element_getAttributeNS.call(this,e,n);Gn.Element_setAttributeNS.call(this,e,n,i),i=Gn.Element_getAttributeNS.call(this,e,n),t.attributeChangedCallback(this,n,r,i,e)}),l(Element.prototype,"removeAttribute",function(e){if(this.__CE_state!==Vn.custom)return Gn.Element_removeAttribute.call(this,e);var n=Gn.Element_getAttribute.call(this,e);Gn.Element_removeAttribute.call(this,e),null!==n&&t.attributeChangedCallback(this,e,n,null,null)}),l(Element.prototype,"removeAttributeNS",function(e,n){if(this.__CE_state!==Vn.custom)return Gn.Element_removeAttributeNS.call(this,e,n);var i=Gn.Element_getAttributeNS.call(this,e,n);Gn.Element_removeAttributeNS.call(this,e,n);var r=Gn.Element_getAttributeNS.call(this,e,n);i!==r&&t.attributeChangedCallback(this,n,i,r,e)}),Gn.HTMLElement_insertAdjacentElement?n(HTMLElement.prototype,Gn.HTMLElement_insertAdjacentElement):Gn.Element_insertAdjacentElement?n(Element.prototype,Gn.Element_insertAdjacentElement):console.warn("Custom Elements: `Element#insertAdjacentElement` was not patched."),Kn(t,Element.prototype,{prepend:Gn.Element_prepend,append:Gn.Element_append}),function(t,e,n){e.before=function(){for(var e=arguments.length,i=Array(e),r=0;r<e;r++)i[r]=arguments[r];var o=i.filter(function(t){return t instanceof Node&&a(t)});n.before.apply(this,i);for(var s=0;s<o.length;s++)t.disconnectTree(o[s]);if(a(this))for(var u=0;u<i.length;u++){var l=i[u];l instanceof Element&&t.connectTree(l)}},e.after=function(){for(var e=arguments.length,i=Array(e),r=0;r<e;r++)i[r]=arguments[r];var o=i.filter(function(t){return t instanceof Node&&a(t)});n.after.apply(this,i);for(var s=0;s<o.length;s++)t.disconnectTree(o[s]);if(a(this))for(var u=0;u<i.length;u++){var l=i[u];l instanceof Element&&t.connectTree(l)}},e.replaceWith=function(){for(var e=arguments.length,i=Array(e),r=0;r<e;r++)i[r]=arguments[r];var o=i.filter(function(t){return t instanceof Node&&a(t)}),s=a(this);n.replaceWith.apply(this,i);for(var u=0;u<o.length;u++)t.disconnectTree(o[u]);if(s){t.disconnectTree(this);for(var l=0;l<i.length;l++){var c=i[l];c instanceof Element&&t.connectTree(c)}}},e.remove=function(){var e=a(this);n.remove.call(this),e&&t.disconnectTree(this)}}(t,Element.prototype,{before:Gn.Element_before,after:Gn.Element_after,replaceWith:Gn.Element_replaceWith,remove:Gn.Element_remove})}(Jn),document.__CE_hasRegistry=!0;var Zn=new Yn(Jn);Object.defineProperty(window,"customElements",{configurable:!0,enumerable:!0,value:Zn})}"undefined"==typeof WeakMap&&function(){var t=Object.defineProperty,e=Date.now()%1e9,n=function(){this.name="__st"+(1e9*Math.random()>>>0)+e+++"__"};n.prototype={set:function(e,n){var i=e[this.name];return i&&i[0]===e?i[1]=n:t(e,this.name,{value:[e,n],writable:!0}),this},get:function(t){var e;return(e=t[this.name])&&e[0]===t?e[1]:void 0},delete:function(t){var e=t[this.name];return!(!e||e[0]!==t)&&(e[0]=e[1]=void 0,!0)},has:function(t){var e=t[this.name];return!!e&&e[0]===t}},window.WeakMap=n}(),function(t){function e(){d=!1;var t=f;f=[],t.sort(function(t,e){return t.uid_-e.uid_});var n=!1;t.forEach(function(t){var e=t.takeRecords();!function(t){t.nodes_.forEach(function(e){var n=l.get(e);n&&n.forEach(function(e){e.observer===t&&e.removeTransientObservers()})})}(t),e.length&&(t.callback_(e,t),n=!0)}),n&&e()}function n(t,e){for(var n=t;n;n=n.parentNode){var i=l.get(n);if(i)for(var r=0;r<i.length;r++){var o=i[r],a=o.options;if(n===t||a.subtree){var s=e(a);s&&o.enqueue(s)}}}}function i(t){this.callback_=t,this.nodes_=[],this.records_=[],this.uid_=++p}function r(t,e){this.type=t,this.target=e,this.addedNodes=[],this.removedNodes=[],this.previousSibling=null,this.nextSibling=null,this.attributeName=null,this.attributeNamespace=null,this.oldValue=null}function o(t,e){return m=new r(t,e)}function a(t){return g||(g=function(t){var e=new r(t.type,t.target);return e.addedNodes=t.addedNodes.slice(),e.removedNodes=t.removedNodes.slice(),e.previousSibling=t.previousSibling,e.nextSibling=t.nextSibling,e.attributeName=t.attributeName,e.attributeNamespace=t.attributeNamespace,e.oldValue=t.oldValue,e}(m),g.oldValue=t,g)}function s(t,e,n){this.observer=t,this.target=e,this.options=n,this.transientObservedNodes=[]}if(!t.JsMutationObserver){var u,l=new WeakMap;if(/Trident|Edge/.test(navigator.userAgent))u=setTimeout;else if(window.setImmediate)u=window.setImmediate;else{var c=[],h=String(Math.random());window.addEventListener("message",function(t){if(t.data===h){var e=c;c=[],e.forEach(function(t){t()})}}),u=function(t){c.push(t),window.postMessage(h,"*")}}var d=!1,f=[],p=0;i.prototype={observe:function(t,e){if(t=function(t){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(t)||t}(t),!e.childList&&!e.attributes&&!e.characterData||e.attributeOldValue&&!e.attributes||e.attributeFilter&&e.attributeFilter.length&&!e.attributes||e.characterDataOldValue&&!e.characterData)throw new SyntaxError;var n=l.get(t);n||l.set(t,n=[]);for(var i,r=0;r<n.length;r++)if(n[r].observer===this){(i=n[r]).removeListeners(),i.options=e;break}i||(i=new s(this,t,e),n.push(i),this.nodes_.push(t)),i.addListeners()},disconnect:function(){this.nodes_.forEach(function(t){for(var e=l.get(t),n=0;n<e.length;n++){var i=e[n];if(i.observer===this){i.removeListeners(),e.splice(n,1);break}}},this),this.records_=[]},takeRecords:function(){var t=this.records_;return this.records_=[],t}};var m,g;s.prototype={enqueue:function(t){var n=this.observer.records_,i=n.length;if(n.length>0){var r=function(t,e){return t===e?t:g&&function(t){return t===g||t===m}(t)?g:null}(n[i-1],t);if(r)return void(n[i-1]=r)}else!function(t){f.push(t),d||(d=!0,u(e))}(this.observer);n[i]=t},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(t){var e=this.options;e.attributes&&t.addEventListener("DOMAttrModified",this,!0),e.characterData&&t.addEventListener("DOMCharacterDataModified",this,!0),e.childList&&t.addEventListener("DOMNodeInserted",this,!0),(e.childList||e.subtree)&&t.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(t){var e=this.options;e.attributes&&t.removeEventListener("DOMAttrModified",this,!0),e.characterData&&t.removeEventListener("DOMCharacterDataModified",this,!0),e.childList&&t.removeEventListener("DOMNodeInserted",this,!0),(e.childList||e.subtree)&&t.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(t){if(t!==this.target){this.addListeners_(t),this.transientObservedNodes.push(t);var e=l.get(t);e||l.set(t,e=[]),e.push(this)}},removeTransientObservers:function(){var t=this.transientObservedNodes;this.transientObservedNodes=[],t.forEach(function(t){this.removeListeners_(t);for(var e=l.get(t),n=0;n<e.length;n++)if(e[n]===this){e.splice(n,1);break}},this)},handleEvent:function(t){switch(t.stopImmediatePropagation(),t.type){case"DOMAttrModified":var e=t.attrName,i=t.relatedNode.namespaceURI,r=t.target;(s=new o("attributes",r)).attributeName=e,s.attributeNamespace=i;u=t.attrChange===MutationEvent.ADDITION?null:t.prevValue;n(r,function(t){if(t.attributes&&(!t.attributeFilter||!t.attributeFilter.length||-1!==t.attributeFilter.indexOf(e)||-1!==t.attributeFilter.indexOf(i)))return t.attributeOldValue?a(u):s});break;case"DOMCharacterDataModified":var s=o("characterData",r=t.target),u=t.prevValue;n(r,function(t){if(t.characterData)return t.characterDataOldValue?a(u):s});break;case"DOMNodeRemoved":this.addTransientObserver(t.target);case"DOMNodeInserted":var l,c,h=t.target;"DOMNodeInserted"===t.type?(l=[h],c=[]):(l=[],c=[h]);var d=h.previousSibling,f=h.nextSibling;(s=o("childList",t.target.parentNode)).addedNodes=l,s.removedNodes=c,s.previousSibling=d,s.nextSibling=f,n(t.relatedNode,function(t){if(t.childList)return s})}m=g=void 0}},t.JsMutationObserver=i,t.MutationObserver||(t.MutationObserver=i,i._isPolyfilled=!0)}}(self),function(t,e){function n(t){return u[s]=i.apply(e,t),s++}function i(t){var n=[].slice.call(arguments,1);return function(){"function"==typeof t?t.apply(e,n):new Function(""+t)()}}function r(t){if(l)setTimeout(i(r,t),0);else{var e=u[t];if(e){l=!0;try{e()}finally{o(t),l=!1}}}}function o(t){delete u[t]}if(!t.setImmediate){var a,s=1,u={},l=!1,c=t.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(t);h=h&&h.setTimeout?h:t,"[object process]"==={}.toString.call(t.process)?a=function(){var t=n(arguments);return process.nextTick(i(r,t)),t}:function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?function(){var e="setImmediate$"+Math.random()+"$",i=function(n){n.source===t&&"string"==typeof n.data&&0===n.data.indexOf(e)&&r(+n.data.slice(e.length))};t.addEventListener?t.addEventListener("message",i,!1):t.attachEvent("onmessage",i),a=function(){var i=n(arguments);return t.postMessage(e+i,"*"),i}}():t.MessageChannel?function(){var t=new MessageChannel;t.port1.onmessage=function(t){r(t.data)},a=function(){var e=n(arguments);return t.port2.postMessage(e),e}}():c&&"onreadystatechange"in c.createElement("script")?function(){var t=c.documentElement;a=function(){var e=n(arguments),i=c.createElement("script");return i.onreadystatechange=function(){r(e),i.onreadystatechange=null,t.removeChild(i),i=null},t.appendChild(i),e}}():a=function(){var t=n(arguments);return setTimeout(i(r,t),0),t},h.setImmediate=a,h.clearImmediate=o}}(self),function(){function t(e,i){var r;if(i=i||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=i.touchBoundary||10,this.layer=e,this.tapDelay=i.tapDelay||200,this.tapTimeout=i.tapTimeout||700,!t.notNeeded(e)){for(var o=["onMouse","onClick","onTouchStart","onTouchMove","onTouchEnd","onTouchCancel"],a=0,s=o.length;a<s;a++)this[o[a]]=function(t,e){return function(){return t.apply(e,arguments)}}(this[o[a]],this);n&&(e.addEventListener("mouseover",this.onMouse,!0),e.addEventListener("mousedown",this.onMouse,!0),e.addEventListener("mouseup",this.onMouse,!0)),e.addEventListener("click",this.onClick,!0),e.addEventListener("touchstart",this.onTouchStart,!1),e.addEventListener("touchmove",this.onTouchMove,!1),e.addEventListener("touchend",this.onTouchEnd,!1),e.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(e.removeEventListener=function(t,n,i){var r=Node.prototype.removeEventListener;"click"===t?r.call(e,t,n.hijacked||n,i):r.call(e,t,n,i)},e.addEventListener=function(t,n,i){var r=Node.prototype.addEventListener;"click"===t?r.call(e,t,n.hijacked||(n.hijacked=function(t){t.propagationStopped||n(t)}),i):r.call(e,t,n,i)}),"function"==typeof e.onclick&&(r=e.onclick,e.addEventListener("click",function(t){r(t)},!1),e.onclick=null)}}var e=navigator.userAgent.indexOf("Windows Phone")>=0,n=navigator.userAgent.indexOf("Android")>0&&!e,i=/iP(ad|hone|od)/.test(navigator.userAgent)&&!e,r=i&&/OS 4_\d(_\d)?/.test(navigator.userAgent),o=i&&/OS [6-7]_\d/.test(navigator.userAgent),a=navigator.userAgent.indexOf("BB10")>0;t.prototype.needsClick=function(t){switch(t.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(t.disabled)return!0;break;case"input":if(i&&"file"===t.type||t.disabled)return!0;break;case"label":case"iframe":case"video":return!0}return/\bneedsclick\b/.test(t.className)},t.prototype.needsFocus=function(t){switch(t.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!n;case"input":switch(t.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!t.disabled&&!t.readOnly;default:return/\bneedsfocus\b/.test(t.className)}},t.prototype.sendClick=function(t,e){var n,i;document.activeElement&&document.activeElement!==t&&document.activeElement.blur(),i=e.changedTouches[0],(n=document.createEvent("MouseEvents")).initMouseEvent(this.determineEventType(t),!0,!0,window,1,i.screenX,i.screenY,i.clientX,i.clientY,!1,!1,!1,!1,0,null),n.forwardedTouchEvent=!0,t.dispatchEvent(n)},t.prototype.determineEventType=function(t){return n&&"select"===t.tagName.toLowerCase()?"mousedown":"click"},t.prototype.focus=function(t){var e;i&&t.setSelectionRange&&0!==t.type.indexOf("date")&&"time"!==t.type&&"month"!==t.type?(e=t.value.length,t.setSelectionRange(e,e)):t.focus()},t.prototype.updateScrollParent=function(t){var e,n;if(!(e=t.fastClickScrollParent)||!e.contains(t)){n=t;do{if(n.scrollHeight>n.offsetHeight){e=n,t.fastClickScrollParent=n;break}n=n.parentElement}while(n)}e&&(e.fastClickLastScrollTop=e.scrollTop)},t.prototype.getTargetElementFromEventTarget=function(t){return t.nodeType===Node.TEXT_NODE?t.parentNode:t},t.prototype.onTouchStart=function(t){var e,n,o;if(t.targetTouches.length>1)return!0;if(e=this.getTargetElementFromEventTarget(t.target),n=t.targetTouches[0],e.isContentEditable)return!0;if(i){if((o=window.getSelection()).rangeCount&&!o.isCollapsed)return!0;if(!r){if(n.identifier&&n.identifier===this.lastTouchIdentifier)return t.preventDefault(),!1;this.lastTouchIdentifier=n.identifier,this.updateScrollParent(e)}}return this.trackingClick=!0,this.trackingClickStart=t.timeStamp,this.targetElement=e,this.touchStartX=n.pageX,this.touchStartY=n.pageY,t.timeStamp-this.lastClickTime<this.tapDelay&&t.timeStamp-this.lastClickTime>-1&&t.preventDefault(),!0},t.prototype.touchHasMoved=function(t){var e=t.changedTouches[0],n=this.touchBoundary;return Math.abs(e.pageX-this.touchStartX)>n||Math.abs(e.pageY-this.touchStartY)>n},t.prototype.onTouchMove=function(t){return!this.trackingClick||((this.targetElement!==this.getTargetElementFromEventTarget(t.target)||this.touchHasMoved(t))&&(this.trackingClick=!1,this.targetElement=null),!0)},t.prototype.findControl=function(t){return void 0!==t.control?t.control:t.htmlFor?document.getElementById(t.htmlFor):t.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},t.prototype.onTouchEnd=function(t){var e,a,s,u,l,c=this.targetElement;if(!this.trackingClick)return!0;if(t.timeStamp-this.lastClickTime<this.tapDelay&&t.timeStamp-this.lastClickTime>-1)return this.cancelNextClick=!0,!0;if(t.timeStamp-this.trackingClickStart>this.tapTimeout)return!0;if(this.cancelNextClick=!1,this.lastClickTime=t.timeStamp,a=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,o&&(l=t.changedTouches[0],(c=document.elementFromPoint(l.pageX-window.pageXOffset,l.pageY-window.pageYOffset)||c).fastClickScrollParent=this.targetElement.fastClickScrollParent),"label"===(s=c.tagName.toLowerCase())){if(e=this.findControl(c)){if(this.focus(c),n)return!1;c=e}}else if(this.needsFocus(c))return t.timeStamp-a>100||i&&window.top!==window&&"input"===s?(this.targetElement=null,!1):(this.focus(c),this.sendClick(c,t),i&&"select"===s||(this.targetElement=null,t.preventDefault()),!1);return!(!i||r||!(u=c.fastClickScrollParent)||u.fastClickLastScrollTop===u.scrollTop)||(this.needsClick(c)||(t.preventDefault(),this.sendClick(c,t)),!1)},t.prototype.onTouchCancel=function(){this.trackingClick=!1,this.targetElement=null},t.prototype.onMouse=function(t){return!this.targetElement||(!!t.forwardedTouchEvent||(!t.cancelable||(!(!this.needsClick(this.targetElement)||this.cancelNextClick)||(t.stopImmediatePropagation?t.stopImmediatePropagation():t.propagationStopped=!0,t.stopPropagation(),t.preventDefault(),!1))))},t.prototype.onClick=function(t){var e;return this.trackingClick?(this.targetElement=null,this.trackingClick=!1,!0):"submit"===t.target.type&&0===t.detail||((e=this.onMouse(t))||(this.targetElement=null),e)},t.prototype.destroy=function(){var t=this.layer;n&&(t.removeEventListener("mouseover",this.onMouse,!0),t.removeEventListener("mousedown",this.onMouse,!0),t.removeEventListener("mouseup",this.onMouse,!0)),t.removeEventListener("click",this.onClick,!0),t.removeEventListener("touchstart",this.onTouchStart,!1),t.removeEventListener("touchmove",this.onTouchMove,!1),t.removeEventListener("touchend",this.onTouchEnd,!1),t.removeEventListener("touchcancel",this.onTouchCancel,!1)},t.notNeeded=function(t){var e,i,r;if(void 0===window.ontouchstart)return!0;if(i=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!n)return!0;if(e=document.querySelector("meta[name=viewport]")){if(-1!==e.content.indexOf("user-scalable=no"))return!0;if(i>31&&document.documentElement.scrollWidth<=window.outerWidth)return!0}}if(a&&(r=navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/))[1]>=10&&r[2]>=3&&(e=document.querySelector("meta[name=viewport]"))){if(-1!==e.content.indexOf("user-scalable=no"))return!0;if(document.documentElement.scrollWidth<=window.outerWidth)return!0}return"none"===t.style.msTouchAction||"manipulation"===t.style.touchAction||(!!(+(/Firefox\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]>=27&&(e=document.querySelector("meta[name=viewport]"))&&(-1!==e.content.indexOf("user-scalable=no")||document.documentElement.scrollWidth<=window.outerWidth))||"none"===t.style.touchAction||"manipulation"===t.style.touchAction)},t.attach=function(e,n){return new t(e,n)},window.FastClick=t}(),function(){var t={ensureViewportElement:function(){var t=document.querySelector("meta[name=viewport]");return t||((t=document.createElement("meta")).name="viewport",document.head.appendChild(t)),t},setup:function(){var e=t.ensureViewportElement();e&&(e.hasAttribute("content")||e.setAttribute("content","width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"))}};window.Viewport=t}();var ti=function(t){function e(){return f(this,e),b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this))}return _(e,t),e}(function(){if("function"!=typeof HTMLElement){var t=function(){};return t.prototype=document.createElement("div"),t}return HTMLElement}()),ei=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));for(t.template=t.innerHTML;t.firstChild;)t.removeChild(t.firstChild);return t}return _(e,ti),p(e,[{key:"connectedCallback",value:function(){this.parentNode&&this.parentNode!==document.body&&G.warn("ons-template (id = "+this.getAttribute("id")+") must be located just under document.body"+(this.parentNode.outerHTML?":\n\n"+this.parentNode.outerHTML:"."));var t=new CustomEvent("_templateloaded",{bubbles:!0,cancelable:!0});t.template=this.template,t.templateId=this.getAttribute("id"),this.dispatchEvent(t)}}]),e}();Mt.elements.Template=ei,customElements.define("ons-template",ei);var ni=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n(t,function(){if(null!==w._getSelectedPlatform())t._platformUpdate();else if(!t._isAllowedPlatform()){for(;t.childNodes[0];)t.childNodes[0].remove();t._platformUpdate()}}),t._onOrientationChange(),t}return _(e,ti),p(e,[{key:"connectedCallback",value:function(){wt.on("change",this._onOrientationChange.bind(this))}},{key:"attributeChangedCallback",value:function(t){"orientation"===t&&this._onOrientationChange()}},{key:"disconnectedCallback",value:function(){wt.off("change",this._onOrientationChange)}},{key:"_platformUpdate",value:function(){this.style.display=this._isAllowedPlatform()?"":"none"}},{key:"_isAllowedPlatform",value:function(){return!this.getAttribute("platform")||this.getAttribute("platform").split(/\s+/).indexOf(w.getMobileOS())>=0}},{key:"_onOrientationChange",value:function(){if(this.hasAttribute("orientation")&&this._isAllowedPlatform()){var t=this.getAttribute("orientation").toLowerCase(),e=wt.isPortrait()?"portrait":"landscape";this.style.display=t===e?"":"none"}}}],[{key:"observedAttributes",get:function(){return["orientation"]}}]),e}();Mt.elements.If=ni,customElements.define("ons-if",ni);var ii=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};f(this,t),this.timing=e.timing||"linear",this.duration=e.duration||0,this.delay=e.delay||0}return p(t,null,[{key:"extend",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this,n=function(){e.apply(this,arguments),G.extend(this,t)};return n.prototype=this.prototype,n}}]),t}(),ri=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.timing,i=void 0===n?"linear":n,r=t.delay,o=void 0===r?0:r,a=t.duration,s=void 0===a?.2:a;return f(this,e),b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,{timing:i,delay:o,duration:s}))}return _(e,ii),p(e,[{key:"show",value:function(t,e){e()}},{key:"hide",value:function(t,e){e()}}]),e}(),oi=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.timing,i=void 0===n?"ease":n,r=t.delay,o=void 0===r?0:r,a=t.duration,s=void 0===a?.4:a;f(this,e);var u=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,{timing:i,delay:o,duration:s}));return u.maskTiming="linear",u.maskDuration=.2,u}return _(e,ri),p(e,[{key:"show",value:function(t,e){K.runAll(K(t._mask).queue({opacity:0}).wait(this.delay).queue({opacity:1},{duration:this.maskDuration,timing:this.maskTiming}),K(t._sheet).saveStyle().queue({css:{transform:"translate3d(0, 80%, 0)",opacity:0},duration:0}).wait(this.delay).queue({css:{transform:"translate3d(0, 0, 0)",opacity:1},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(t){e&&e(),t()}))}},{key:"hide",value:function(t,e){K.runAll(K(t._mask).queue({opacity:1}).wait(this.delay).queue({opacity:0},{duration:this.maskDuration,timing:this.maskTiming}),K(t._sheet).saveStyle().queue({css:{transform:"translate3d(0, 0, 0)",opacity:1},duration:0}).wait(this.delay).queue({css:{transform:"translate3d(0, 80%, 0)",opacity:0},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(t){e&&e(),t()}))}}]),e}(),ai=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.timing,i=void 0===n?"ease":n,r=t.delay,o=void 0===r?0:r,a=t.duration,s=void 0===a?.3:a;f(this,e);var u=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,{timing:i,delay:o,duration:s}));return u.maskTiming="linear",u.maskDuration=.2,u.bodyHeight=document.body.clientHeight,u}return _(e,ri),p(e,[{key:"show",value:function(t,e){K.runAll(K(t._mask).queue({opacity:0}).wait(this.delay).queue({opacity:1},{duration:this.maskDuration,timing:this.maskTiming}),K(t._sheet).saveStyle().queue({css:{transform:"translate3d(0, "+(this.bodyHeight/2-1)+"px, 0)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3d(0, 0, 0)"},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(t){e&&e(),t()}))}},{key:"hide",value:function(t,e){K.runAll(K(t._mask).queue({opacity:1}).wait(this.delay).queue({opacity:0},{duration:this.maskDuration,timing:this.maskTiming}),K(t._sheet).saveStyle().queue({css:{transform:"translate3d(0, 0, 0)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3d(0, 100%, 0)"},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(t){e&&e(),t()}))}}]),e}(),si=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t._visible=!1,t._doorLock=new xt,t._cancel=t._cancel.bind(t),t._selfCamelName=G.camelize(t.tagName.slice(4)),t._defaultDBB=function(e){return t.cancelable?t._cancel():e.callParentHandler()},t._animatorFactory=t._updateAnimatorFactory(),t}return _(e,ti),p(e,[{key:"_updateAnimatorFactory",value:function(){throw new Error("_updateAnimatorFactory method must be implemented.")}},{key:"_toggleStyle",value:function(t){this.style.display=t?"block":"none"}},{key:"_scheme",get:function(){throw new Error("_scheme getter must be implemented.")}}]),p(e,[{key:"_cancel",value:function(){var t=this;this.cancelable&&!this._running&&(this._running=!0,this.hide().then(function(){t._running=!1,G.triggerElementEvent(t,"dialog-cancel")},function(){return t._running=!1}))}},{key:"_preventScroll",value:function(t){t.cancelable&&t.preventDefault()}},{key:"show",value:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._setVisible.apply(this,[!0].concat(e))}},{key:"hide",value:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._setVisible.apply(this,[!1].concat(e))}},{key:"toggle",value:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._setVisible.apply(this,[!this.visible].concat(e))}},{key:"_setVisible",value:function(t){var e,i=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=t?"show":"hide";(r=g({},r)).animationOptions=G.extend(r.animationOptions||{},A.parseAnimationOptionsString(this.getAttribute("animation-options")));var a=!1;return G.triggerElementEvent(this,"pre"+o,(e={},m(e,this._selfCamelName,this),m(e,"cancel",function(){return a=!0}),e)),a?Promise.reject("Canceled in pre"+o+" event."):new Promise(function(e){i._doorLock.waitUnlock(function(){var a=i._doorLock.lock(),s=i._animatorFactory.newAnimator(r);t&&i._toggleStyle(!0,r),n(i,function(){s[o](i,function(){!t&&i._toggleStyle(!1,r),i._visible=t,a(),G.propagateAction(i,"_"+o),G.triggerElementEvent(i,"post"+o,m({},i._selfCamelName,i)),r.callback instanceof Function&&r.callback(i),e(i)})})})})}},{key:"_updateMask",value:function(){var t=this;n(this,function(){t._mask&&t.getAttribute("mask-color")&&(t._mask.style.backgroundColor=t.getAttribute("mask-color"))})}},{key:"connectedCallback",value:function(){var t=this;this.onDeviceBackButton=this._defaultDBB.bind(this),n(this,function(){t._mask&&(t._mask.addEventListener("click",t._cancel,!1),t._mask.addEventListener("touchmove",t._preventScroll,!1))})}},{key:"disconnectedCallback",value:function(){this._backButtonHandler.destroy(),this._backButtonHandler=null,this._mask&&(this._mask.removeEventListener("click",this._cancel,!1),this._mask.removeEventListener("touchmove",this._preventScroll,!1))}},{key:"attributeChangedCallback",value:function(t,e,n){switch(t){case"modifier":M.onModifierChanged(e,n,this,this._scheme);break;case"animation":this._animatorFactory=this._updateAnimatorFactory();break;case"mask-color":this._updateMask()}}},{key:"onDeviceBackButton",get:function(){return this._backButtonHandler},set:function(t){this._backButtonHandler&&this._backButtonHandler.destroy(),this._backButtonHandler=q.createHandler(this,t)}},{key:"visible",get:function(){return this._visible}},{key:"disabled",set:function(t){return G.toggleAttribute(this,"disabled",t)},get:function(){return this.hasAttribute("disabled")}},{key:"cancelable",set:function(t){return G.toggleAttribute(this,"cancelable",t)},get:function(){return this.hasAttribute("cancelable")}}],[{key:"observedAttributes",get:function(){return["modifier","animation","mask-color"]}},{key:"events",get:function(){return["preshow","postshow","prehide","posthide","dialog-cancel"]}}]),e}(),ui={".action-sheet":"action-sheet--*",".action-sheet-mask":"action-sheet-mask--*",".action-sheet-title":"action-sheet-title--*"},li={default:function(){return w.isAndroid()?oi:ai},none:ri},ci=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n(t,function(){return t._compile()}),t}return _(e,si),p(e,[{key:"_updateAnimatorFactory",value:function(){return new A({animators:li,baseClass:ri,baseClassName:"ActionSheetAnimator",defaultAnimation:this.getAttribute("animation")})}},{key:"_compile",value:function(){if(D.prepare(this),this.style.display="none",this.style.zIndex=10001,!this._sheet){var t=document.createElement("div");for(t.classList.add("action-sheet");this.firstChild;)t.appendChild(this.firstChild);this.appendChild(t)}if(!this._title&&this.hasAttribute("title")){var e=document.createElement("div");e.innerHTML=this.getAttribute("title"),e.classList.add("action-sheet-title"),this._sheet.insertBefore(e,this._sheet.firstChild)}if(!this._mask){var n=document.createElement("div");n.classList.add("action-sheet-mask"),this.insertBefore(n,this.firstChild)}this._sheet.style.zIndex=20001,this._mask.style.zIndex=2e4,M.initModifier(this,this._scheme)}},{key:"_updateTitle",value:function(){this._title&&(this._title.innerHTML=this.getAttribute("title"))}},{key:"attributeChangedCallback",value:function(t,n,i){"title"===t?this._updateTitle():v(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"attributeChangedCallback",this).call(this,t,n,i)}},{key:"_scheme",get:function(){return ui}},{key:"_mask",get:function(){return G.findChild(this,".action-sheet-mask")}},{key:"_sheet",get:function(){return G.findChild(this,".action-sheet")}},{key:"_title",get:function(){return this.querySelector(".action-sheet-title")}}],[{key:"registerAnimator",value:function(t,e){if(!(e.prototype instanceof ri))throw new Error('"Animator" param must inherit OnsActionSheetElement.ActionSheetAnimator');li[t]=e}},{key:"observedAttributes",get:function(){return[].concat(y(v(e.__proto__||Object.getPrototypeOf(e),"observedAttributes",this)),["title"])}},{key:"animators",get:function(){return li}},{key:"ActionSheetAnimator",get:function(){return ri}}]),e}();Mt.elements.ActionSheet=ci,customElements.define("ons-action-sheet",ci);var hi={"":"action-sheet-button--*",".action-sheet-icon":"action-sheet-icon--*"},di=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n(t,function(){return t._compile()}),t}return _(e,ti),p(e,[{key:"_compile",value:function(){if(D.prepare(this),this.classList.add("action-sheet-button"),!this._icon&&this.hasAttribute("icon")){var t=G.createElement('<ons-icon icon="'+this.getAttribute("icon")+'"></ons-icon>');t.classList.add("action-sheet-icon"),this.insertBefore(t,this.firstChild)}M.initModifier(this,hi)}},{key:"_updateIcon",value:function(){this._icon&&this._icon.setAttribute("icon",this.getAttribute("icon"))}},{key:"attributeChangedCallback",value:function(t,e,n){switch(t){case"class":G.restoreClass(this,"action-sheet-button",hi);break;case"modifier":M.onModifierChanged(e,n,this,hi);break;case"icon":this._updateIcon()}}},{key:"_icon",get:function(){return G.findChild(this,".action-sheet-icon")}}],[{key:"observedAttributes",get:function(){return["modifier","class","icon"]}}]),e}();Mt.elements.ActionSheetButton=di,customElements.define("ons-action-sheet-button",di);var fi=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.timing,i=void 0===n?"linear":n,r=t.delay,o=void 0===r?0:r,a=t.duration,s=void 0===a?.2:a;return f(this,e),b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,{timing:i,delay:o,duration:s}))}return _(e,ii),p(e,[{key:"show",value:function(t,e){e()}},{key:"hide",value:function(t,e){e()}}]),e}(),pi=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.timing,i=void 0===n?"cubic-bezier(.1, .7, .4, 1)":n,r=t.duration,o=void 0===r?.2:r,a=t.delay,s=void 0===a?0:a;return f(this,e),b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,{duration:o,timing:i,delay:s}))}return _(e,fi),p(e,[{key:"show",value:function(t,e){e=e||function(){},K.runAll(K(t._mask).queue({opacity:0}).wait(this.delay).queue({opacity:1},{duration:this.duration,timing:this.timing}),K(t._dialog).saveStyle().queue({css:{transform:"translate3d(-50%, -50%, 0) scale3d(0.9, 0.9, 1.0)",opacity:0},duration:0}).wait(this.delay).queue({css:{transform:"translate3d(-50%, -50%, 0) scale3d(1.0, 1.0, 1.0)",opacity:1},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(t){e(),t()}))}},{key:"hide",value:function(t,e){e=e||function(){},K.runAll(K(t._mask).queue({opacity:1}).wait(this.delay).queue({opacity:0},{duration:this.duration,timing:this.timing}),K(t._dialog).saveStyle().queue({css:{transform:"translate3d(-50%, -50%, 0) scale3d(1.0, 1.0, 1.0)",opacity:1},duration:0}).wait(this.delay).queue({css:{transform:"translate3d(-50%, -50%, 0) scale3d(0.9, 0.9, 1.0)",opacity:0},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(t){e(),t()}))}}]),e}(),mi=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.timing,i=void 0===n?"cubic-bezier(.1, .7, .4, 1)":n,r=t.duration,o=void 0===r?.2:r,a=t.delay,s=void 0===a?0:a;return f(this,e),b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,{duration:o,timing:i,delay:s}))}return _(e,fi),p(e,[{key:"show",value:function(t,e){e=e||function(){},K.runAll(K(t._mask).queue({opacity:0}).wait(this.delay).queue({opacity:1},{duration:this.duration,timing:this.timing}),K(t._dialog).saveStyle().queue({css:{transform:"translate3d(-50%, -50%, 0) scale3d(1.3, 1.3, 1.0)",opacity:0},duration:0}).wait(this.delay).queue({css:{transform:"translate3d(-50%, -50%, 0) scale3d(1.0, 1.0, 1.0)",opacity:1},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(t){e(),t()}))}},{key:"hide",value:function(t,e){e=e||function(){},K.runAll(K(t._mask).queue({opacity:1}).wait(this.delay).queue({opacity:0},{duration:this.duration,timing:this.timing}),K(t._dialog).saveStyle().queue({css:{opacity:1},duration:0}).wait(this.delay).queue({css:{opacity:0},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(t){e(),t()}))}}]),e}(),gi={".alert-dialog":"alert-dialog--*",".alert-dialog-container":"alert-dialog-container--*",".alert-dialog-title":"alert-dialog-title--*",".alert-dialog-content":"alert-dialog-content--*",".alert-dialog-footer":"alert-dialog-footer--*",".alert-dialog-footer--rowfooter":"alert-dialog-footer--rowfooter--*",".alert-dialog-button--rowfooter":"alert-dialog-button--rowfooter--*",".alert-dialog-button--primal":"alert-dialog-button--primal--*",".alert-dialog-button":"alert-dialog-button--*","ons-alert-dialog-button":"alert-dialog-button--*",".alert-dialog-mask":"alert-dialog-mask--*",".text-input":"text-input--*"},vi={none:fi,default:function(){return w.isAndroid()?pi:mi},fade:function(){return w.isAndroid()?pi:mi}},_i=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n(t,function(){return t._compile()}),t}return _(e,si),p(e,[{key:"_updateAnimatorFactory",value:function(){return new A({animators:vi,baseClass:fi,baseClassName:"AlertDialogAnimator",defaultAnimation:this.getAttribute("animation")})}},{key:"_compile",value:function(){D.prepare(this),this.style.display="none",this.style.zIndex=10001;var t=document.createDocumentFragment();if(!this._mask&&!this._dialog)for(;this.firstChild;)t.appendChild(this.firstChild);if(!this._mask){var e=document.createElement("div");e.classList.add("alert-dialog-mask"),this.insertBefore(e,this.children[0])}if(!this._dialog){var n=document.createElement("div");n.classList.add("alert-dialog"),this.insertBefore(n,null)}if(!G.findChild(this._dialog,".alert-dialog-container")){var i=document.createElement("div");i.classList.add("alert-dialog-container"),this._dialog.appendChild(i)}this._dialog.children[0].appendChild(t),this._dialog.style.zIndex=20001,this._mask.style.zIndex=2e4,M.initModifier(this,this._scheme)}},{key:"_scheme",get:function(){return gi}},{key:"_mask",get:function(){return G.findChild(this,".alert-dialog-mask")}},{key:"_dialog",get:function(){return G.findChild(this,".alert-dialog")}},{key:"_titleElement",get:function(){return G.findChild(this._dialog.children[0],".alert-dialog-title")}},{key:"_contentElement",get:function(){return G.findChild(this._dialog.children[0],".alert-dialog-content")}}],[{key:"registerAnimator",value:function(t,e){if(!(e.prototype instanceof fi))throw new Error('"Animator" param must inherit OnsAlertDialogElement.AlertDialogAnimator');vi[t]=e}},{key:"animators",get:function(){return vi}},{key:"AlertDialogAnimator",get:function(){return fi}}]),e}();Mt.elements.AlertDialog=_i,customElements.define("ons-alert-dialog",_i);var bi={"":"alert-dialog-button--*"},yi=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t._compile(),t}return _(e,ti),p(e,[{key:"_compile",value:function(){D.prepare(this),this.classList.add("alert-dialog-button"),G.updateRipple(this,void 0,{modifier:"light-gray"}),M.initModifier(this,bi)}},{key:"attributeChangedCallback",value:function(t,e,n){switch(t){case"class":G.restoreClass(this,"alert-dialog-button",bi);break;case"modifier":M.onModifierChanged(e,n,this,bi)}}},{key:"disabled",set:function(t){return G.toggleAttribute(this,"disabled",t)},get:function(){return this.hasAttribute("disabled")}}],[{key:"observedAttributes",get:function(){return["modifier","class"]}}]),e}();Mt.elements.AlertDialogButton=yi,customElements.define("ons-alert-dialog-button",yi);var ki={"":"back-button--*",".back-button__icon":"back-button--*__icon",".back-button__label":"back-button--*__label"},wi=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n(t,function(){t._compile()}),t._options={},t._boundOnClick=t._onClick.bind(t),t}return _(e,ti),p(e,[{key:"_updateIcon",value:function(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:G.findChild(this,".back-button__icon")).innerHTML="android"===D.getPlatform(this)||G.hasModifier(this,"material")?'<?xml version="1.0" encoding="UTF-8"?>\n<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n    <title>md-back-button-icon</title>\n    <desc>Created with Sketch.</desc>\n    <defs></defs>\n    <g id="toolbar-back-button" stroke="none" stroke-width="1" fill-rule="evenodd">\n        <g id="android" transform="translate(-32.000000, -32.000000)" fill-rule="nonzero">\n            <polygon id="md-back-button-icon" points="48 39 35.83 39 41.42 33.41 40 32 32 40 40 48 41.41 46.59 35.83 41 48 41"></polygon>\n        </g>\n    </g>\n</svg>\n':'<?xml version="1.0" encoding="UTF-8"?>\n<svg width="13px" height="21px" viewBox="0 0 13 21" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n    <title>ios-back-button-icon</title>\n    <desc>Created with Sketch.</desc>\n    <defs></defs>\n    <g id="toolbar-back-button" stroke="none" stroke-width="1" fill-rule="evenodd">\n        <g id="ios" transform="translate(-34.000000, -30.000000)">\n            <polygon id="ios-back-button-icon" points="34 40.5 44.5 30 46.5 32 38 40.5 46.5 49 44.5 51"></polygon>\n        </g>\n    </g>\n</svg>\n'}},{key:"_compile",value:function(){if(D.prepare(this),this.classList.add("back-button"),!G.findChild(this,".back-button__label")){for(var t=G.create("span.back-button__label");this.childNodes[0];)t.appendChild(this.childNodes[0]);this.appendChild(t)}if(!G.findChild(this,".back-button__icon")){var e=G.create("span.back-button__icon");this._updateIcon(e),this.insertBefore(e,this.children[0])}G.updateRipple(this,void 0,{center:"",size:"contain",background:"transparent"}),M.initModifier(this,ki)}},{key:"_onClick",value:function(){if(this.onClick)this.onClick.apply(this);else{var t=G.findParent(this,"ons-navigator");t&&t.popPage(this.options)}}},{key:"connectedCallback",value:function(){this.addEventListener("click",this._boundOnClick,!1)}},{key:"attributeChangedCallback",value:function(t,e,n){switch(t){case"class":G.restoreClass(this,"back-button",ki);break;case"modifier":M.onModifierChanged(e,n,this,ki)&&this._updateIcon()}}},{key:"disconnectedCallback",value:function(){this.removeEventListener("click",this._boundOnClick,!1)}},{key:"show",value:function(){this.style.display="inline-block"}},{key:"hide",value:function(){this.style.display="none"}},{key:"options",get:function(){return this._options},set:function(t){this._options=t}}],[{key:"observedAttributes",get:function(){return["modifier","class"]}}]),e}();Mt.elements.BackButton=wi,customElements.define("ons-back-button",wi);var Ei="bottom-bar",Ci={"":"bottom-bar--*"},Ai=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.classList.add(Ei),M.initModifier(t,Ci),t}return _(e,ti),p(e,[{key:"connectedCallback",value:function(){G.match(this.parentNode,"ons-page")&&this.parentNode.classList.add("page-with-bottom-toolbar")}},{key:"attributeChangedCallback",value:function(t,e,n){switch(t){case"class":G.restoreClass(this,Ei,Ci);break;case"modifier":M.onModifierChanged(e,n,this,Ci)}}}],[{key:"observedAttributes",get:function(){return["modifier","class"]}}]),e}();Mt.elements.BottomToolbar=Ai,customElements.define("ons-bottom-toolbar",Ai);var Si={"":"button--*"},Oi=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t._compile(),t}return _(e,ti),p(e,[{key:"attributeChangedCallback",value:function(t,e,n){switch(t){case"class":G.restoreClass(this,"button",Si);break;case"modifier":M.onModifierChanged(e,n,this,Si);break;case"ripple":this._updateRipple()}}},{key:"_compile",value:function(){D.prepare(this),this.classList.add("button"),this._updateRipple(),M.initModifier(this,Si)}},{key:"_updateRipple",value:function(){G.updateRipple(this)}},{key:"disabled",set:function(t){return G.toggleAttribute(this,"disabled",t)},get:function(){return this.hasAttribute("disabled")}}],[{key:"observedAttributes",get:function(){return["modifier","ripple","class"]}}]),e}();Mt.elements.Button=Oi,customElements.define("ons-button",Oi);var Pi={"":"card--*",".card__title":"card--*__title",".card__content":"card--*__content"},xi=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n(t,function(){t._compile()}),t}return _(e,ti),p(e,[{key:"_compile",value:function(){for(var t=0;t<this.children.length;t++){var e=this.children[t];e.classList.contains("title")?e.classList.add("card__title"):e.classList.contains("content")&&e.classList.add("card__content")}D.prepare(this),this.classList.add("card"),M.initModifier(this,Pi)}},{key:"attributeChangedCallback",value:function(t,e,n){switch(t){case"class":G.restoreClass(this,"card",Pi);break;case"modifier":M.onModifierChanged(e,n,this,Pi)}}}],[{key:"observedAttributes",get:function(){return["modifier","class"]}}]),e}();Mt.elements.Card=xi,customElements.define("ons-card",xi);var Ti={"":"carousel-item--*"},Li=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.style.width="100%",M.initModifier(t,Ti),t}return _(e,ti),p(e,[{key:"attributeChangedCallback",value:function(t,e,n){if("modifier"===t)return M.onModifierChanged(e,n,this,Ti)}}],[{key:"observedAttributes",get:function(){return["modifier"]}}]),e}();Mt.elements.CarouselItem=Li,customElements.define("ons-carousel-item",Li);var Di={vertical:{axis:"Y",size:"Height",dir:["up","down"],t3d:["0px, ","px, 0px"]},horizontal:{axis:"X",size:"Width",dir:["left","right"],t3d:["","px, 0px, 0px"]}},Mi=function(){function t(e){var n=this;f(this,t);"getInitialIndex getBubbleWidth isVertical isOverScrollable isCentered\n    isAutoScrollable refreshHook preChangeHook postChangeHook overScrollHook".split(/\s+/).forEach(function(t){return n[t]=e[t]||function(){return!1}}),this.getElement=e.getElement,this.scrollHook=e.scrollHook,this.itemSize=e.itemSize||"100%",this.getAutoScrollRatio=function(){var t=e.getAutoScrollRatio&&e.getAutoScrollRatio.apply(e,arguments);if((t="number"==typeof t&&t==t?t:.5)<0||t>1)throw new Error("Invalid auto-scroll-ratio "+t+". Must be between 0 and 1");return t},this.onDragStart=this.onDragStart.bind(this),this.onDrag=this.onDrag.bind(this),this.onDragEnd=this.onDragEnd.bind(this),this.onResize=this.onResize.bind(this)}return p(t,[{key:"init",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.swipeable,i=e.autoRefresh;if(this.initialized=!0,this.target=this.getElement().children[0],this.blocker=this.getElement().children[1],!this.target||!this.blocker)throw new Error('Expected "target" and "blocker" elements to exist before initializing Swiper.');this.getElement().classList.add("ons-swiper"),this.target.classList.add("ons-swiper-target"),this.blocker.classList.add("ons-swiper-blocker"),this._gestureDetector=new et(this.getElement(),{dragMinDistance:1,dragLockToAxis:!0}),this._mutationObserver=new MutationObserver(function(){return t.refresh()}),this.updateSwipeable(n),this.updateAutoRefresh(i),this._scroll=this._offset=this._lastActiveIndex=0,this._updateLayout(),this._setupInitialIndex(),setImmediate(function(){return t.initialized&&t._setupInitialIndex()}),0===this.offsetHeight&&setImmediate(function(){return t.refresh()})}},{key:"dispose",value:function(){this.initialized=!1,this.updateSwipeable(!1),this.updateAutoRefresh(!1),this._gestureDetector&&this._gestureDetector.dispose(),this.target=this.blocker=this._gestureDetector=this._mutationObserver=null,this.setupResize(!1)}},{key:"onResize",value:function(){var t=this._scroll/this.targetSize;this._reset(),this.setActiveIndex(t),this.refresh()}},{key:"_calculateItemSize",value:function(){var t=this.itemSize.match(/^(\d+)(px|%)/);if(!t)throw new Error("Invalid state: swiper's size unit must be '%' or 'px'");var e=parseInt(t[1],10);return"%"===t[2]?Math.round(e/100*this.targetSize):e}},{key:"_setupInitialIndex",value:function(){this._reset(),this._lastActiveIndex=Math.max(Math.min(Number(this.getInitialIndex()),this.itemCount),0),this._scroll=this._offset+this.itemNumSize*this._lastActiveIndex,this._scrollTo(this._scroll)}},{key:"setActiveIndex",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=Math.max(0,Math.min(t,this.itemCount-1));var i=Math.max(0,Math.min(this.maxScroll,this._offset+this.itemNumSize*t));if(w.isUIWebView()){var r=function(t){return Array.prototype.concat.apply([],t)}(G.arrayFrom(this.target.children).map(function(t){return G.arrayFrom(t.children).filter(function(t){return t.classList.contains("page__content")})})),o=new Map;return new Promise(function(t){r.forEach(function(t){o.set(t,t.getAttribute("class")),t.classList.add("page__content--suppress-layer-creation")}),requestAnimationFrame(t)}).then(function(){return e._changeTo(i,n)}).then(function(){return new Promise(function(t){r.forEach(function(t){t.setAttribute("class",o.get(t))}),requestAnimationFrame(t)})})}return this._changeTo(i,n)}},{key:"getActiveIndex",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._scroll;t-=this._offset;var e=this.itemCount,n=this.itemNumSize;if(t<=0)return 0;for(var i=0;i<e;i++)if(n*i<=t&&n*(i+1)>t)return i;return e-1}},{key:"setupResize",value:function(t){window[(t?"add":"remove")+"EventListener"]("resize",this.onResize,!0)}},{key:"show",value:function(){this.setupResize(!0),this.onResize()}},{key:"hide",value:function(){this.setupResize(!1)}},{key:"updateSwipeable",value:function(t){if(this._gestureDetector){var e=t?"on":"off";this._gestureDetector[e]("drag",this.onDrag),this._gestureDetector[e]("dragstart",this.onDragStart),this._gestureDetector[e]("dragend",this.onDragEnd)}}},{key:"updateAutoRefresh",value:function(t){this._mutationObserver&&(t?this._mutationObserver.observe(this.target,{childList:!0}):this._mutationObserver.disconnect())}},{key:"updateItemSize",value:function(t){this.itemSize=t||"100%",this.refresh()}},{key:"toggleBlocker",value:function(t){this.blocker.style.pointerEvents=t?"auto":"none"}},{key:"_canConsumeGesture",value:function(t){var e=t.direction,n=0===this._scroll&&!this.isOverScrollable(),i=this._scroll===this.maxScroll&&!this.isOverScrollable();return this.isVertical()?"down"===e&&!n||"up"===e&&!i:"right"===e&&!n||"left"===e&&!i}},{key:"onDragStart",value:function(t){var e=this;if(this._ignoreDrag=t.consumed||!G.isValidGesture(t),!this._ignoreDrag){var n=t.consume;if(t.consume=function(){n&&n(),e._ignoreDrag=!0},this._canConsumeGesture(t.gesture)){var i=t.gesture.center&&t.gesture.center.clientX||0,r=this.getBubbleWidth()||0,o=function(){n&&n(),t.consumed=!0,e._started=!0,e.toggleBlocker(!0),G.preventScroll(e._gestureDetector)};i<r||i>this.targetSize-r?setImmediate(function(){return!e._ignoreDrag&&o()}):o()}}}},{key:"onDrag",value:function(t){t.gesture&&!this._ignoreDrag&&this._started&&(this._continued=!0,t.stopPropagation(),this._scrollTo(this._scroll-this._getDelta(t),{throttle:!0}))}},{key:"onDragEnd",value:function(t){if(this._started=!1,t.gesture&&!this._ignoreDrag&&this._continued){this._continued=!1,t.stopPropagation();var e=this._scroll-this._getDelta(t),n=this._normalizeScroll(e);e===n?this._startMomentumScroll(e,t):this._killOverScroll(n),this.toggleBlocker(!1)}else this._ignoreDrag=!0}},{key:"_startMomentumScroll",value:function(t,e){var n=this._getVelocity(e),i=e.gesture.interimDirection===this.dM.dir[this._getDelta(e)<0?0:1],r=this._getAutoScroll(t,n,i),o=Math.abs(r-t)/(n+.01)/1e3;o=Math.min(.25,Math.max(.1,o)),this._changeTo(r,{swipe:!0,animationOptions:{duration:o,timing:"cubic-bezier(.4, .7, .5, 1)"}})}},{key:"_killOverScroll",value:function(t){var e=this;this._scroll=t;var n=this.dM.dir[Number(t>0)],i=function(){return e._changeTo(t,{animationOptions:{duration:.4,timing:"cubic-bezier(.1, .4, .1, 1)"}})};this.overScrollHook({direction:n,killOverScroll:i})||i()}},{key:"_changeTo",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i={activeIndex:this.getActiveIndex(t),lastActiveIndex:this._lastActiveIndex,swipe:n.swipe||!1},r=i.activeIndex!==i.lastActiveIndex,o=!!r&&this.preChangeHook(i);return this._scroll=o?this._offset+i.lastActiveIndex*this.itemNumSize:t,this._lastActiveIndex=o?i.lastActiveIndex:i.activeIndex,this._scrollTo(this._scroll,n).then(function(){if(t!==e._scroll||o){if(n.reject)return Promise.reject("Canceled")}else r&&e.postChangeHook(i)})}},{key:"_scrollTo",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(n.throttle){if(t<0)t=this.isOverScrollable()?Math.round(.35*t):0;else{var i=this.maxScroll;i<t&&(t=this.isOverScrollable()?i+Math.round(.35*(t-i)):i)}}var r="none"===n.animation?{}:n.animationOptions;return this.scrollHook&&this.itemNumSize>0&&this.scrollHook((t/this.itemNumSize).toFixed(2),n.animationOptions||{}),new Promise(function(n){return K(e.target).queue({transform:e._getTransform(t)},r).play(n)})}},{key:"_getAutoScroll",value:function(t,e,n){var i=this.maxScroll,r=this._offset,o=this.itemNumSize;if(!this.isAutoScrollable())return Math.max(0,Math.min(i,t));for(var a=[],s=r;s<i;s+=o)a.push(s);a.push(i);var u=(a=a.sort(function(e,n){return Math.abs(e-t)-Math.abs(n-t)}).filter(function(t,e){return!e||t!==a[e-1]}))[0],l=this._lastActiveIndex*o+r,c=Math.abs(t-l)/o;return c<=this.getAutoScrollRatio(n,e,o)?u=l:c<1&&a[0]===l&&a.length>1&&(u=a[1]),Math.max(0,Math.min(i,u))}},{key:"_reset",value:function(){this._targetSize=this._itemNumSize=void 0}},{key:"_normalizeScroll",value:function(t){return Math.max(Math.min(t,this.maxScroll),0)}},{key:"refresh",value:function(){this._reset(),this._updateLayout();var t=this._normalizeScroll(this._scroll);t!==this._scroll?this._killOverScroll(t):this._changeTo(t),this.refreshHook()}},{key:"_getDelta",value:function(t){return t.gesture["delta"+this.dM.axis]}},{key:"_getVelocity",value:function(t){return t.gesture["velocity"+this.dM.axis]}},{key:"_getTransform",value:function(t){return"translate3d("+this.dM.t3d[0]+-t+this.dM.t3d[1]+")"}},{key:"_updateLayout",value:function(){this.dM=Di[this.isVertical()?"vertical":"horizontal"],this.target.classList.toggle("ons-swiper-target--vertical",this.isVertical());for(var t=this.target.children[0];t;t=t.nextElementSibling)t.style[this.dM.size.toLowerCase()]=this.itemSize;this.isCentered()&&(this._offset=(this.targetSize-this.itemNumSize)/-2||0)}},{key:"itemCount",get:function(){return this.target.children.length}},{key:"itemNumSize",get:function(){return"number"==typeof this._itemNumSize&&this._itemNumSize==this._itemNumSize||(this._itemNumSize=this._calculateItemSize()),this._itemNumSize}},{key:"maxScroll",get:function(){var t=this.itemCount*this.itemNumSize-this.targetSize;return Math.ceil(t<0?0:t)}},{key:"targetSize",get:function(){return this._targetSize||(this._targetSize=this.target["offset"+this.dM.size]),this._targetSize}}]),t}(),Ii=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n(t,function(){return t._compile()}),t}return _(e,ti),p(e,[{key:"_compile",value:function(){var t=this.children[0]&&"ONS-CAROUSEL-ITEM"!==this.children[0].tagName&&this.children[0]||document.createElement("div");if(!t.parentNode){for(;this.firstChild;)t.appendChild(this.firstChild);this.appendChild(t)}!this.children[1]&&this.appendChild(document.createElement("div")),this.appendChild=this.appendChild.bind(t),this.insertBefore=this.insertBefore.bind(t)}},{key:"connectedCallback",value:function(){var t=this;this._swiper||(this._swiper=new Mi({getElement:function(){return t},getInitialIndex:function(){return t.getAttribute("initial-index")},getAutoScrollRatio:function(){return t.autoScrollRatio},isVertical:function(){return t.vertical},isOverScrollable:function(){return t.overscrollable},isCentered:function(){return t.centered},isAutoScrollable:function(){return t.autoScroll},itemSize:this.itemSize,overScrollHook:this._onOverScroll.bind(this),preChangeHook:this._onChange.bind(this,"prechange"),postChangeHook:this._onChange.bind(this,"postchange"),refreshHook:this._onRefresh.bind(this),scrollHook:this._onSwipe}),n(this,function(){return t._swiper.init({swipeable:t.hasAttribute("swipeable"),autoRefresh:t.hasAttribute("auto-refresh")})}))}},{key:"disconnectedCallback",value:function(){this._swiper&&this._swiper.initialized&&(this._swiper.dispose(),this._swiper=null)}},{key:"attributeChangedCallback",value:function(t,e,n){if(this._swiper)switch(t){case"swipeable":this._swiper.updateSwipeable(this.hasAttribute("swipeable"));break;case"auto-refresh":this._swiper.updateAutoRefresh(this.hasAttribute("auto-refresh"));break;case"item-height":this.vertical&&this._swiper.updateItemSize(this.itemSize);break;case"item-width":this.vertical||this._swiper.updateItemSize(this.itemSize);break;case"direction":this._swiper.refresh()}}},{key:"_show",value:function(){this._swiper.show()}},{key:"_hide",value:function(){this._swiper.hide()}},{key:"_onOverScroll",value:function(t){var e=t.direction,n=t.killOverScroll,i=!1;return G.triggerElementEvent(this,"overscroll",{carousel:this,activeIndex:this.getActiveIndex(),direction:e,waitToReturn:function(t){i=!0,t.then(n)}}),i}},{key:"_onChange",value:function(t,e){var n=e.activeIndex,i=e.lastActiveIndex;G.triggerElementEvent(this,t,{carousel:this,activeIndex:n,lastActiveIndex:i})}},{key:"_onRefresh",value:function(){G.triggerElementEvent(this,"refresh",{carousel:this})}},{key:"setActiveIndex",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(n&&"object"!=(void 0===n?"undefined":d(n)))throw new Error("options must be an object. You supplied "+n);return n.animation=n.animation||this.getAttribute("animation"),n.animationOptions=G.extend({duration:.3,timing:"cubic-bezier(.4, .7, .5, 1)"},n.animationOptions||{},this.hasAttribute("animation-options")?G.animationOptionsParse(this.getAttribute("animation-options")):{}),this._swiper.setActiveIndex(t,n).then(function(){return n.callback instanceof Function&&n.callback(e),Promise.resolve(e)})}},{key:"getActiveIndex",value:function(){return this._swiper.getActiveIndex()}},{key:"next",value:function(t){return this.setActiveIndex(this.getActiveIndex()+1,t)}},{key:"prev",value:function(t){return this.setActiveIndex(this.getActiveIndex()-1,t)}},{key:"first",value:function(t){return this.setActiveIndex(0,t)}},{key:"last",value:function(t){this.setActiveIndex(Math.max(this.itemCount-1,0),t)}},{key:"refresh",value:function(){this._swiper.refresh()}},{key:"itemCount",get:function(){return this._swiper.itemCount}},{key:"swipeable",get:function(){return this.hasAttribute("swipeable")},set:function(t){return G.toggleAttribute(this,"swipeable",t)}},{key:"onSwipe",get:function(){return this._onSwipe},set:function(t){if(t&&!(t instanceof Function))throw new Error("'onSwipe' must be a function.");this._onSwipe=t}},{key:"autoScroll",get:function(){return this.hasAttribute("auto-scroll")},set:function(t){return G.toggleAttribute(this,"auto-scroll",t)}},{key:"vertical",get:function(){return"vertical"===this.getAttribute("direction")}},{key:"itemSize",get:function(){var t=(this.getAttribute("item-"+(this.vertical?"height":"width"))||"").trim();return t.match(/^\d+(px|%)$/)?t:"100%"}},{key:"autoScrollRatio",get:function(){return parseFloat(this.getAttribute("auto-scroll-ratio"))},set:function(t){this.setAttribute("auto-scroll-ratio",t)}},{key:"disabled",get:function(){return this.hasAttribute("disabled")},set:function(t){return G.toggleAttribute(this,"disabled",t)}},{key:"overscrollable",get:function(){return this.hasAttribute("overscrollable")},set:function(t){return G.toggleAttribute(this,"overscrollable",t)}},{key:"centered",get:function(){return this.hasAttribute("centered")},set:function(t){return G.toggleAttribute(this,"centered",t)}}],[{key:"observedAttributes",get:function(){return["swipeable","auto-refresh","direction","item-height","item-width"]}},{key:"events",get:function(){return["postchange","refresh","overscroll"]}}]),e}();Mt.elements.Carousel=Ii,customElements.define("ons-carousel",Ii);var Ni=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.getAttribute("width")&&t._updateWidth(),t}return _(e,ti),p(e,[{key:"attributeChangedCallback",value:function(t,e,n){"width"===t&&this._updateWidth()}},{key:"_updateWidth",value:function(){var t=this.getAttribute("width");t?(t=t.trim().match(/^\d+$/)?t+"%":t,h(this,{flex:"0 0 "+t,maxWidth:t})):h.clear(this,"flex maxWidth")}}],[{key:"observedAttributes",get:function(){return["width"]}}]),e}();Mt.elements.Col=Ni,customElements.define("ons-col",Ni);var qi=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.timing,i=void 0===n?"linear":n,r=t.delay,o=void 0===r?0:r,a=t.duration,s=void 0===a?.2:a;return f(this,e),b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,{timing:i,delay:o,duration:s}))}return _(e,ii),p(e,[{key:"show",value:function(t,e){e()}},{key:"hide",value:function(t,e){e()}}]),e}(),Bi=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.timing,i=void 0===n?"ease-in-out":n,r=t.delay,o=void 0===r?0:r,a=t.duration,s=void 0===a?.3:a;return f(this,e),b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,{timing:i,delay:o,duration:s}))}return _(e,qi),p(e,[{key:"show",value:function(t,e){e=e||function(){},K.runAll(K(t._mask).queue({opacity:0}).wait(this.delay).queue({opacity:1},{duration:this.duration,timing:this.timing}),K(t._dialog).saveStyle().queue({css:{transform:"translate3d(-50%, -60%, 0)",opacity:0},duration:0}).wait(this.delay).queue({css:{transform:"translate3d(-50%, -50%, 0)",opacity:1},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(t){e(),t()}))}},{key:"hide",value:function(t,e){e=e||function(){},K.runAll(K(t._mask).queue({opacity:1}).wait(this.delay).queue({opacity:0},{duration:this.duration,timing:this.timing}),K(t._dialog).saveStyle().queue({css:{transform:"translate3d(-50%, -50%, 0)",opacity:1},duration:0}).wait(this.delay).queue({css:{transform:"translate3d(-50%, -60%, 0)",opacity:0},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(t){e(),t()}))}}]),e}(),ji=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.timing,i=void 0===n?"ease-in-out":n,r=t.delay,o=void 0===r?0:r,a=t.duration,s=void 0===a?.2:a;f(this,e);var u=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,{timing:i,delay:o,duration:s}));return u.bodyHeight=document.body.clientHeight,u}return _(e,qi),p(e,[{key:"show",value:function(t,e){e=e||function(){},K.runAll(K(t._mask).queue({opacity:0}).wait(this.delay).queue({opacity:1},{duration:this.duration,timing:this.timing}),K(t._dialog).saveStyle().queue({css:{transform:"translate3d(-50%, "+(this.bodyHeight/2-1)+"px, 0)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3d(-50%, -50%, 0)"},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(t){e(),t()}))}},{key:"hide",value:function(t,e){e=e||function(){},K.runAll(K(t._mask).queue({opacity:1}).wait(this.delay).queue({opacity:0},{duration:this.duration,timing:this.timing}),K(t._dialog).saveStyle().queue({css:{transform:"translate3d(-50%, -50%, 0)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3d(-50%, "+(this.bodyHeight/2-1)+"px, 0)"},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(t){e(),t()}))}}]),e}(),Hi={".dialog":"dialog--*",".dialog-container":"dialog-container--*",".dialog-mask":"dialog-mask--*"},Ri={default:function(){return w.isAndroid()?Bi:ji},slide:function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.timing,i=void 0===n?"cubic-bezier(.1, .7, .4, 1)":n,r=t.delay,o=void 0===r?0:r,a=t.duration,s=void 0===a?.2:a;f(this,e);var u=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,{timing:i,delay:o,duration:s}));return u.bodyHeight=document.body.clientHeight,u}return _(e,qi),p(e,[{key:"show",value:function(t,e){e=e||function(){},K.runAll(K(t._mask).queue({opacity:0}).wait(this.delay).queue({opacity:1},{duration:this.duration,timing:this.timing}),K(t._dialog).saveStyle().queue({css:{transform:"translate3d(-50%, "+(-this.bodyHeight/2+1-t._dialog.clientHeight)+"px, 0)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(-50%, -50%, 0)"},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(t){e(),t()}))}},{key:"hide",value:function(t,e){e=e||function(){},K.runAll(K(t._mask).queue({opacity:1}).wait(this.delay).queue({opacity:0},{duration:this.duration,timing:this.timing}),K(t._dialog).saveStyle().queue({css:{transform:"translate3D(-50%, -50%, 0)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3d(-50%, "+(-this.bodyHeight/2+1-t._dialog.clientHeight)+"px, 0)"},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(t){e(),t()}))}}]),e}(),none:qi},zi=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n(t,function(){return t._compile()}),t}return _(e,si),p(e,[{key:"_updateAnimatorFactory",value:function(){return new A({animators:Ri,baseClass:qi,baseClassName:"DialogAnimator",defaultAnimation:this.getAttribute("animation")})}},{key:"_compile",value:function(){if(D.prepare(this),this.style.display="none",this.style.zIndex=10001,!this._dialog){var t=document.createElement("div");t.classList.add("dialog");var e=document.createElement("div");for(e.classList.add("dialog-container");this.firstChild;)e.appendChild(this.firstChild);t.appendChild(e),this.appendChild(t)}if(!this._mask){var n=document.createElement("div");n.classList.add("dialog-mask"),this.insertBefore(n,this.firstChild)}this._dialog.style.zIndex=20001,this._mask.style.zIndex=2e4,this.setAttribute("status-bar-fill",""),M.initModifier(this,this._scheme)}},{key:"_scheme",get:function(){return Hi}},{key:"_mask",get:function(){return G.findChild(this,".dialog-mask")}},{key:"_dialog",get:function(){return G.findChild(this,".dialog")}}],[{key:"registerAnimator",value:function(t,e){if(!(e.prototype instanceof qi))throw new Error('"Animator" param must inherit OnsDialogElement.DialogAnimator');Ri[t]=e}},{key:"animators",get:function(){return Ri}},{key:"DialogAnimator",get:function(){return qi}}]),e}();Mt.elements.Dialog=zi,customElements.define("ons-dialog",zi);var Fi="fab",Vi={"":"fab--*",".fab__icon":"fab--*__icon"},Wi=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.hide(),t.classList.add(Fi),n(t,function(){t._compile()}),t}return _(e,ti),p(e,[{key:"_compile",value:function(){if(D.prepare(this),!G.findChild(this,".fab__icon")){var t=document.createElement("span");t.classList.add("fab__icon"),G.arrayFrom(this.childNodes).forEach(function(e){e.tagName&&"ons-ripple"===e.tagName.toLowerCase()||t.appendChild(e)}),this.appendChild(t)}this._updateRipple(),M.initModifier(this,Vi),this._updatePosition()}},{key:"connectedCallback",value:function(){var t=this;setImmediate(function(){return t.show()})}},{key:"attributeChangedCallback",value:function(t,e,n){switch(t){case"class":G.restoreClass(this,Fi,Vi);break;case"modifier":M.onModifierChanged(e,n,this,Vi);break;case"ripple":this._updateRipple();break;case"position":this._updatePosition()}}},{key:"_show",value:function(){this.show()}},{key:"_hide",value:function(){var t=this;setImmediate(function(){return t.hide()})}},{key:"_updateRipple",value:function(){G.updateRipple(this)}},{key:"_updatePosition",value:function(){var t=this.getAttribute("position");switch(this.classList.remove("fab--top__left","fab--bottom__right","fab--bottom__left","fab--top__right","fab--top__center","fab--bottom__center"),t){case"top right":case"right top":this.classList.add("fab--top__right");break;case"top left":case"left top":this.classList.add("fab--top__left");break;case"bottom right":case"right bottom":this.classList.add("fab--bottom__right");break;case"bottom left":case"left bottom":this.classList.add("fab--bottom__left");break;case"center top":case"top center":this.classList.add("fab--top__center");break;case"center bottom":case"bottom center":this.classList.add("fab--bottom__center")}}},{key:"show",value:function(){this.toggle(!0)}},{key:"hide",value:function(){this.toggle(!1)}},{key:"toggle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:!this.visible,e=(this.getAttribute("position")||"").indexOf("bottom")>=0?"translate3d(0px, -"+(G.globals.fabOffset||0)+"px, 0px)":"";h(this,{transform:e+" scale("+Number(t)+")"})}},{key:"disabled",set:function(t){return G.toggleAttribute(this,"disabled",t)},get:function(){return this.hasAttribute("disabled")}},{key:"visible",get:function(){return-1===this.style.transform.indexOf("scale(0)")&&"none"!==this.style.display}}],[{key:"observedAttributes",get:function(){return["modifier","ripple","position","class"]}}]),e}();Mt.elements.Fab=Wi,customElements.define("ons-fab",Wi);var Xi=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t._gestureDetector=new et(t),t}return _(e,ti),e}();Mt.elements.GestureDetector=Xi,customElements.define("ons-gesture-detector",Xi);var Ui="fa",Yi=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t._compile(),t}return _(e,ti),p(e,[{key:"attributeChangedCallback",value:function(t,e,n){this._cleanClassAttribute("icon"===t?e:this.getAttribute("icon"),"modifier"===t?e:void 0),this._update()}},{key:"_compile",value:function(){D.prepare(this),this._update()}},{key:"_update",value:function(){var t=this,e=this._buildClassAndStyle(this._parseAttr("icon"),this._parseAttr("size")),n=e.classList,i=e.style;G.extend(this.style,i),n.forEach(function(e){return t.classList.add(e)})}},{key:"_parseAttr",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getAttribute("modifier")||"",n=(this.getAttribute(t)||t||"").split(/\s*,\s*/),i=n[0],r=n[1];return r=(r||"").split(/\s*:\s*/),(e&&RegExp("(^|\\s+)"+r[0]+"($|\\s+)","i").test(e)?r[1]:i)||""}},{key:"_cleanClassAttribute",value:function(t,e){var n=this,i=this._prefixIcon(this._parseAttr(t,e)),r=i.className,o=i.prefix,a=r!==o?"|"+o+"$|"+o+"-":"|"+r+"$"||"",s=new RegExp("^(fa$|fa-|ion-|zmdi$|zmdi-|ons-icon--"+a+")");G.arrayFrom(this.classList).filter(function(t){return s.test(t)}).forEach(function(t){return n.classList.remove(t)})}},{key:"_prefixIcon",value:function(t){var e=Ui+(Ui?"-":"")+t;return{className:e,prefix:e.split("-")[0]}}},{key:"_buildClassAndStyle",value:function(t,e){var n=["ons-icon"],i={};if(0===t.indexOf("ion-"))n.push(t),n.push("ons-icon--ion");else if(0===t.indexOf("fa-"))n.push(t),n.push("fa");else if(0===t.indexOf("md-"))n.push("zmdi"),n.push("zmdi-"+t.split(/-(.+)?/)[1]);else{var r=this._prefixIcon(t),o=r.className,a=r.prefix;a&&n.push(a),o&&n.push(o)}return e.match(/^[1-5]x|lg$/)?(n.push("ons-icon--"+e),this.style.removeProperty("font-size")):i.fontSize=e,{classList:n,style:i}}}],[{key:"setAutoPrefix",value:function(t){Ui=t?"string"==typeof t&&t||"fa":""}},{key:"observedAttributes",get:function(){return["icon","size","modifier","class"]}}]),e}();Mt.elements.Icon=Yi,customElements.define("ons-icon",Yi);var Gi=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(f(this,t),"object"!==(void 0===e?"undefined":d(e))||null===e)throw Error('"delegate" parameter must be an object.');if(this._userDelegate=e,!(n instanceof Element)&&null!==n)throw Error('"templateElement" parameter must be an instance of Element or null.');this._templateElement=n}return p(t,[{key:"hasRenderFunction",value:function(){return this._userDelegate._render instanceof Function}},{key:"_render",value:function(){this._userDelegate._render.apply(this._userDelegate,arguments)}},{key:"loadItemElement",value:function(t,e){if(this._userDelegate.loadItemElement instanceof Function)this._userDelegate.loadItemElement(t,e);else{var n=this._userDelegate.createItemContent(t,this._templateElement);if(!(n instanceof Element))throw Error("createItemContent() must return an instance of Element.");e({element:n})}}},{key:"countItems",value:function(){var t=this._userDelegate.countItems();if("number"!=typeof t)throw Error("countItems() must return a number.");return t}},{key:"updateItem",value:function(t,e){this._userDelegate.updateItemContent instanceof Function&&this._userDelegate.updateItemContent(t,e)}},{key:"calculateItemHeight",value:function(t){if(this._userDelegate.calculateItemHeight instanceof Function){var e=this._userDelegate.calculateItemHeight(t);if("number"!=typeof e)throw Error("calculateItemHeight() must return a number.");return e}return 0}},{key:"destroyItem",value:function(t,e){this._userDelegate.destroyItem instanceof Function&&this._userDelegate.destroyItem(t,e)}},{key:"destroy",value:function(){this._userDelegate.destroy instanceof Function&&this._userDelegate.destroy(),this._userDelegate=this._templateElement=null}},{key:"itemHeight",get:function(){return this._userDelegate.itemHeight}}]),t}(),$i=function(){function t(e,n){if(f(this,t),!(n instanceof Gi))throw Error('"delegate" parameter must be an instance of LazyRepeatDelegate.');if(this._wrapperElement=e,this._delegate=n,this._insertIndex=this._wrapperElement.children[0]&&"ONS-LAZY-REPEAT"===this._wrapperElement.children[0].tagName?1:0,"ons-list"===e.tagName.toLowerCase()&&e.classList.add("lazy-list"),this._pageContent=this._findPageContentElement(e),!this._pageContent)throw new Error("ons-lazy-repeat must be a descendant of an <ons-page> or an element.");this.lastScrollTop=this._pageContent.scrollTop,this.padding=0,this._topPositions=[0],this._renderedItems={},this._delegate.itemHeight||this._delegate.calculateItemHeight(0)||(this._unknownItemHeight=!0),this._addEventListeners(),this._onChange()}return p(t,[{key:"_findPageContentElement",value:function(t){var e=G.findParent(t,".page__content");if(e)return e;var n=G.findParent(t,"ons-page");if(n){var i=G.findChild(n,".content");if(i)return i}return null}},{key:"_checkItemHeight",value:function(t){var e=this;this._delegate.loadItemElement(0,function(n){if(!e._unknownItemHeight)throw Error("Invalid state");e._wrapperElement.appendChild(n.element);var i=function(){e._delegate.destroyItem(0,n),n.element&&n.element.remove(),delete e._unknownItemHeight,t()};e._itemHeight=n.element.offsetHeight,e._itemHeight>0?i():(e._wrapperElement.style.visibility="hidden",n.element.style.visibility="hidden",setImmediate(function(){if(e._itemHeight=n.element.offsetHeight,0==e._itemHeight)throw Error("Invalid state: this._itemHeight must be greater than zero.");e._wrapperElement.style.visibility="",i()}))})}},{key:"_countItems",value:function(){return this._delegate.countItems()}},{key:"_getItemHeight",value:function(t){return this._renderedItems.hasOwnProperty(t)?(this._renderedItems[t].hasOwnProperty("height")||(this._renderedItems[t].height=this._renderedItems[t].element.offsetHeight),this._renderedItems[t].height):this._topPositions[t+1]&&this._topPositions[t]?this._topPositions[t+1]-this._topPositions[t]:this.staticItemHeight||this._delegate.calculateItemHeight(t)}},{key:"_calculateRenderedHeight",value:function(){var t=this;return Object.keys(this._renderedItems).reduce(function(e,n){return e+t._getItemHeight(+n)},0)}},{key:"_onChange",value:function(){this._render()}},{key:"_lastItemRendered",value:function(){return Math.max.apply(Math,y(Object.keys(this._renderedItems)))}},{key:"_firstItemRendered",value:function(){return Math.min.apply(Math,y(Object.keys(this._renderedItems)))}},{key:"refresh",value:function(){var t={forceScrollDown:!0},e=Math.min(this._lastItemRendered(),this._countItems()-1),n=this._firstItemRendered();G.isInteger(e)&&(t.forceLastIndex=e),G.isInteger(n)&&(this._wrapperElement.style.height=this._topPositions[n]+this._calculateRenderedHeight()+"px",this.padding=this._topPositions[n],t.forceFirstIndex=n),this._removeAllElements(),this._render(t),this._wrapperElement.style.height="inherit"}},{key:"_render",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.forceScrollDown,i=void 0!==n&&n,r=e.forceFirstIndex,o=e.forceLastIndex;if(this._unknownItemHeight)return this._checkItemHeight(this._render.bind(this,arguments[0]));var a=!i&&this.lastScrollTop>this._pageContent.scrollTop;this.lastScrollTop=this._pageContent.scrollTop;for(var s={},u=this._wrapperElement.getBoundingClientRect().top,l=4*window.innerHeight-u,c=this._countItems(),h=r||Math.max(0,this._calculateStartIndex(u)-30),d=h,f=this._topPositions[d];d<c&&f<l;d++)d>=this._topPositions.length&&(this._topPositions.length+=100),this._topPositions[d]=f,f+=this._getItemHeight(d);if(this._delegate.hasRenderFunction&&this._delegate.hasRenderFunction())return this._delegate._render(h,d,function(){t.padding=t._topPositions[h]});if(a)for(var p=d-1;p>=h;p--)s[p]=!0,this._renderElement(p,a);else for(var m=o||Math.max.apply(Math,[d-1].concat(y(Object.keys(this._renderedItems)))),g=h;g<=m;g++)s[g]=!0,this._renderElement(g,a);Object.keys(this._renderedItems).forEach(function(e){return s[e]||t._removeElement(e,a)})}},{key:"_renderElement",value:function(t,e){var n=this,i=this._renderedItems[t];i?this._delegate.updateItem(t,i):this._delegate.loadItemElement(t,function(i){e?(n._wrapperElement.insertBefore(i.element,n._wrapperElement.children[n._insertIndex]),n.padding=n._topPositions[t],i.height=n._topPositions[t+1]-n._topPositions[t]):n._wrapperElement.appendChild(i.element),n._renderedItems[t]=i})}},{key:"_removeElement",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t=+t;var n=this._renderedItems[t];this._delegate.destroyItem(t,n),e?this._topPositions[t+1]=void 0:this.padding=this.padding+this._getItemHeight(t),n.element.parentElement&&n.element.parentElement.removeChild(n.element),delete this._renderedItems[t]}},{key:"_removeAllElements",value:function(){var t=this;Object.keys(this._renderedItems).forEach(function(e){return t._removeElement(e)})}},{key:"_recalculateTopPositions",value:function(t,e){for(var n=t;n<=e;n++)this._topPositions[n+1]=this._topPositions[n]+this._getItemHeight(n)}},{key:"_calculateStartIndex",value:function(t){var e=this._firstItemRendered(),n=this._lastItemRendered();this._recalculateTopPositions(e,n);for(var i=0,r=this._countItems()-1;;){var o=Math.floor((i+r)/2),a=t+this._topPositions[o];if(r<i)return 0;if(a<=0&&a+this._getItemHeight(o)>0)return o;isNaN(a)||a>=0?r=o-1:i=o+1}}},{key:"_debounce",value:function(t,e,n){var i=void 0;return function(){var r=this,o=arguments,a=n&&!i;clearTimeout(i),a?t.apply(this,arguments):i=setTimeout(function(){i=null,t.apply(r,o)},e)}}},{key:"_doubleFireOnTouchend",value:function(){this._render(),this._debounce(this._render.bind(this),100)}},{key:"_addEventListeners",value:function(){G.bindListeners(this,["_onChange","_doubleFireOnTouchend"]),w.isIOS()&&(this._boundOnChange=this._debounce(this._boundOnChange,30)),this._pageContent.addEventListener("scroll",this._boundOnChange,!0),w.isIOS()&&(this._pageContent.addEventListener("touchmove",this._boundOnChange,!0),this._pageContent.addEventListener("touchend",this._boundDoubleFireOnTouchend,!0)),window.document.addEventListener("resize",this._boundOnChange,!0)}},{key:"_removeEventListeners",value:function(){this._pageContent.removeEventListener("scroll",this._boundOnChange,!0),w.isIOS()&&(this._pageContent.removeEventListener("touchmove",this._boundOnChange,!0),this._pageContent.removeEventListener("touchend",this._boundDoubleFireOnTouchend,!0)),window.document.removeEventListener("resize",this._boundOnChange,!0)}},{key:"destroy",value:function(){this._removeAllElements(),this._delegate.destroy(),this._parentElement=this._delegate=this._renderedItems=null,this._removeEventListeners()}},{key:"padding",get:function(){return parseInt(this._wrapperElement.style.paddingTop,10)},set:function(t){this._wrapperElement.style.paddingTop=t+"px"}},{key:"staticItemHeight",get:function(){return this._delegate.itemHeight||this._itemHeight}}]),t}(),Ki=function(t){function e(){return f(this,e),b(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return _(e,ti),p(e,[{key:"connectedCallback",value:function(){this.hasAttribute("delegate")&&(this.delegate=window[this.getAttribute("delegate")])}},{key:"refresh",value:function(){this._lazyRepeatProvider&&this._lazyRepeatProvider.refresh()}},{key:"attributeChangedCallback",value:function(t,e,n){}},{key:"disconnectedCallback",value:function(){this._lazyRepeatProvider&&(this._lazyRepeatProvider.destroy(),this._lazyRepeatProvider=null)}},{key:"delegate",set:function(t){this._lazyRepeatProvider&&this._lazyRepeatProvider.destroy(),!this._templateElement&&this.children[0]&&(this._templateElement=this.removeChild(this.children[0]));var e=new Gi(t,this._templateElement||null);this._lazyRepeatProvider=new $i(this.parentElement,e)},get:function(){throw new Error("This property can only be used to set the delegate object.")}}]),e}();C.LazyRepeatDelegate=Gi,C.LazyRepeatProvider=$i,Mt.elements.LazyRepeat=Ki,customElements.define("ons-lazy-repeat",Ki);var Qi={"":"list-header--*"},Ji=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t._compile(),t}return _(e,ti),p(e,[{key:"_compile",value:function(){D.prepare(this),this.classList.add("list-header"),M.initModifier(this,Qi)}},{key:"attributeChangedCallback",value:function(t,e,n){switch(t){case"class":G.restoreClass(this,"list-header",Qi);break;case"modifier":M.onModifierChanged(e,n,this,Qi)}}}],[{key:"observedAttributes",get:function(){return["modifier","class"]}}]),e}();Mt.elements.ListHeader=Ji,customElements.define("ons-list-header",Ji);var Zi={"":"list-title--*"},tr=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t._compile(),t}return _(e,ti),p(e,[{key:"_compile",value:function(){D.prepare(this),this.classList.add("list-title"),M.initModifier(this,Zi)}},{key:"attributeChangedCallback",value:function(t,e,n){switch(t){case"class":G.restoreClass(this,"list-title",Zi);break;case"modifier":M.onModifierChanged(e,n,this,Zi)}}}],[{key:"observedAttributes",get:function(){return["modifier","class"]}}]),e}();Mt.elements.ListTitle=tr,customElements.define("ons-list-title",tr);var er={".list-item":"list-item--*",".list-item__left":"list-item--*__left",".list-item__center":"list-item--*__center",".list-item__right":"list-item--*__right",".list-item__label":"list-item--*__label",".list-item__title":"list-item--*__title",".list-item__subtitle":"list-item--*__subtitle",".list-item__thumbnail":"list-item--*__thumbnail",".list-item__icon":"list-item--*__icon"},nr=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n(t,function(){t._compile()}),t}return _(e,ti),p(e,[{key:"_compile",value:function(){D.prepare(this),this.classList.add("list-item");for(var t=void 0,e=void 0,n=void 0,i=0;i<this.children.length;i++){var r=this.children[i];r.classList.contains("left")?(r.classList.add("list-item__left"),t=r):r.classList.contains("center")?e=r:r.classList.contains("right")&&(r.classList.add("list-item__right"),n=r)}if(!e){if(e=document.createElement("div"),t||n)for(var o=this.childNodes.length-1;o>=0;o--){var a=this.childNodes[o];a!==t&&a!==n&&e.insertBefore(a,e.firstChild)}else for(;this.childNodes[0];)e.appendChild(this.childNodes[0]);this.insertBefore(e,n||null)}e.classList.add("center"),e.classList.add("list-item__center"),G.updateRipple(this),M.initModifier(this,er)}},{key:"attributeChangedCallback",value:function(t,e,n){switch(t){case"class":G.restoreClass(this,"list-item",er);break;case"modifier":M.onModifierChanged(e,n,this,er);break;case"ripple":G.updateRipple(this)}}},{key:"connectedCallback",value:function(){this._setupListeners(!0),this._originalBackgroundColor=this.style.backgroundColor,this.tapped=!1}},{key:"disconnectedCallback",value:function(){this._setupListeners(!1)}},{key:"_setupListeners",value:function(t){var e=(t?"add":"remove")+"EventListener";this[e]("drag",this._onDrag),this[e]("touchstart",this._onTouch),this[e]("mousedown",this._onTouch),this[e]("touchend",this._onRelease),this[e]("touchmove",this._onRelease),this[e]("touchcancel",this._onRelease),this[e]("mouseup",this._onRelease),this[e]("mouseout",this._onRelease),this[e]("touchleave",this._onRelease)}},{key:"_onDrag",value:function(t){var e=t.gesture;this.hasAttribute("lock-on-drag")&&["left","right"].indexOf(e.direction)>-1&&e.preventDefault()}},{key:"_onTouch",value:function(){if(!this.tapped){this.tapped=!0;var t={transition:"background-color 0.0s linear 0.02s, box-shadow 0.0s linear 0.02s"};this.hasAttribute("tappable")&&(this.style.backgroundColor&&(this._originalBackgroundColor=this.style.backgroundColor),t.backgroundColor=this.getAttribute("tap-background-color")||"#d9d9d9",t.boxShadow="0px -1px 0px 0px "+t.backgroundColor),h(this,t)}}},{key:"_onRelease",value:function(){this.tapped=!1,this.style.backgroundColor=this._originalBackgroundColor||"",h.clear(this,"transition boxShadow")}}],[{key:"observedAttributes",get:function(){return["modifier","class","ripple"]}}]),e}();Mt.elements.ListItem=nr,customElements.define("ons-list-item",nr);var ir={"":"list--*"},rr=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t._compile(),t}return _(e,ti),p(e,[{key:"_compile",value:function(){D.prepare(this),this.classList.add("list"),M.initModifier(this,ir)}},{key:"attributeChangedCallback",value:function(t,e,n){switch(t){case"class":G.restoreClass(this,"list",ir);break;case"modifier":M.onModifierChanged(e,n,this,ir)}}}],[{key:"observedAttributes",get:function(){return["modifier","class"]}}]),e}();Mt.elements.List=rr,customElements.define("ons-list",rr);var or=["autocapitalize","autocomplete","autocorrect","autofocus","disabled","inputmode","max","maxlength","min","minlength","name","pattern","placeholder","readonly","required","size","step","validator","value"],ar=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n(t,function(){return t._compile()}),t._boundDelegateEvent=t._delegateEvent.bind(t),t}return _(e,ti),p(e,[{key:"_update",value:function(){}},{key:"_scheme",get:function(){throw new Error("_scheme getter must be implemented.")}},{key:"_template",get:function(){throw new Error("_template getter must be implemented.")}},{key:"type",get:function(){throw new Error("type getter must be implemented.")}}]),p(e,[{key:"_compile",value:function(){D.prepare(this),this._defaultClassName&&this.classList.add(this._defaultClassName),0===this.children.length&&(this.appendChild(G.createFragment(this._template)),this._setInputId(),this._updateBoundAttributes(),M.initModifier(this,this._scheme))}},{key:"_updateBoundAttributes",value:function(){var t=this;or.forEach(function(e){t.hasAttribute(e)?t._input.setAttribute(e,t.getAttribute(e)):t._input.removeAttribute(e)}),this._update()}},{key:"_delegateEvent",value:function(t){var e=new CustomEvent(t.type,{bubbles:!1,cancelable:!0});return this.dispatchEvent(e)}},{key:"_setInputId",value:function(){this.hasAttribute("input-id")&&(this._input.id=this.getAttribute("input-id"))}},{key:"connectedCallback",value:function(){var t=this;n(this,function(){t._input.addEventListener("focus",t._boundDelegateEvent),t._input.addEventListener("blur",t._boundDelegateEvent)})}},{key:"disconnectedCallback",value:function(){var t=this;n(this,function(){t._input.removeEventListener("focus",t._boundDelegateEvent),t._input.removeEventListener("blur",t._boundDelegateEvent)})}},{key:"attributeChangedCallback",value:function(t,e,i){var r=this;switch(t){case"modifier":n(this,function(){return M.onModifierChanged(e,i,r,r._scheme)});break;case"input-id":n(this,function(){return r._setInputId()});break;case"class":G.restoreClass(this,this._defaultClassName,this._scheme)}or.indexOf(t)>=0&&n(this,function(){return r._updateBoundAttributes()})}},{key:"_defaultClassName",get:function(){return""}},{key:"_input",get:function(){return this.querySelector("input")}},{key:"value",get:function(){return null===this._input?this.getAttribute("value"):this._input.value},set:function(t){var e=this;n(this,function(){t instanceof Date&&(t=t.toISOString().substring(0,10)),e._input.value=t,e._update()})}},{key:"disabled",set:function(t){return G.toggleAttribute(this,"disabled",t)},get:function(){return this.hasAttribute("disabled")}}],[{key:"observedAttributes",get:function(){return["modifier","input-id","class"].concat(or)}}]),e}(),sr={".text-input":"text-input--*",".text-input__label":"text-input--*__label"},ur=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t._boundOnInput=t._update.bind(t),t._boundOnFocusin=t._update.bind(t),t}return _(e,ar),p(e,[{key:"_update",value:function(){this._updateLabel(),this._updateLabelClass()}},{key:"_updateLabel",value:function(){var t=this.getAttribute("placeholder")||"";void 0!==this._helper.textContent?this._helper.textContent=t:this._helper.innerText=t}},{key:"_updateLabelClass",value:function(){""===this.value?this._helper.classList.remove("text-input--material__label--active"):this._helper.classList.add("text-input--material__label--active")}},{key:"connectedCallback",value:function(){var t=this;v(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"connectedCallback",this).call(this),n(this,function(){t._input.addEventListener("input",t._boundOnInput),t._input.addEventListener("focusin",t._boundOnFocusin)});var i=this.getAttribute("type");["checkbox","radio"].indexOf(i)>=0&&G.warn('Warn: <ons-input type="'+i+'"> is deprecated since v2.4.0. Use <ons-'+i+"> instead.")}},{key:"disconnectedCallback",value:function(){var t=this;v(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"disconnectedCallback",this).call(this),n(this,function(){t._input.removeEventListener("input",t._boundOnInput),t._input.removeEventListener("focusin",t._boundOnFocusin)})}},{key:"attributeChangedCallback",value:function(t,i,r){var o=this;switch(t){case"type":n(this,function(){return o._input.setAttribute("type",o.type)});break;default:v(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"attributeChangedCallback",this).call(this,t,i,r)}}},{key:"_scheme",get:function(){return sr}},{key:"_template",get:function(){return'\n      <input type="'+this.type+'" class="text-input">\n      <span class="text-input__label"></span>\n    '}},{key:"type",get:function(){var t=this.getAttribute("type");return["checkbox","radio"].indexOf(t)<0&&t||"text"}},{key:"_helper",get:function(){return this.querySelector("span")}}],[{key:"observedAttributes",get:function(){return[].concat(y(v(e.__proto__||Object.getPrototypeOf(e),"observedAttributes",this)),["type"])}}]),e}();Mt.elements.Input=ur,customElements.define("ons-input",ur);var lr=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n(t,function(){t.attributeChangedCallback("checked",null,t.getAttribute("checked"))}),t}return _(e,ar),p(e,[{key:"attributeChangedCallback",value:function(t,n,i){switch(t){case"checked":this.checked=null!==i;break;default:v(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"attributeChangedCallback",this).call(this,t,n,i)}}},{key:"_template",get:function(){return'\n      <input type="'+this.type+'" class="'+this._defaultClassName+'__input">\n      <span class="'+this._defaultClassName+'__checkmark"></span>\n    '}},{key:"_helper",get:function(){return this.querySelector("span")}},{key:"checked",get:function(){return this._input.checked},set:function(t){var e=this;n(this,function(){e._input.checked=t})}}],[{key:"observedAttributes",get:function(){return[].concat(y(v(e.__proto__||Object.getPrototypeOf(e),"observedAttributes",this)),["checked"])}}]),e}(),cr={".checkbox":"checkbox--*",".checkbox__input":"checkbox--*__input",".checkbox__checkmark":"checkbox--*__checkmark"},hr=function(t){function e(){return f(this,e),b(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return _(e,lr),p(e,[{key:"_scheme",get:function(){return cr}},{key:"_defaultClassName",get:function(){return"checkbox"}},{key:"type",get:function(){return"checkbox"}}]),e}();Mt.elements.Checkbox=hr,customElements.define("ons-checkbox",hr);var dr={".radio-button":"radio-button--*",".radio-button__input":"radio-button--*__input",".radio-button__checkmark":"radio-button--*__checkmark"},fr=function(t){function e(){return f(this,e),b(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return _(e,lr),p(e,[{key:"_scheme",get:function(){return dr}},{key:"_defaultClassName",get:function(){return"radio-button"}},{key:"type",get:function(){return"radio"}}]),e}();Mt.elements.Radio=fr,customElements.define("ons-radio",fr);var pr={".search-input":"search-input--*"},mr=function(t){function e(){return f(this,e),b(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return _(e,ar),p(e,[{key:"_scheme",get:function(){return pr}},{key:"_template",get:function(){return'\n      <input type="'+this.type+'" class="search-input">\n    '}},{key:"type",get:function(){return"search"}}]),e}();Mt.elements.SearchInput=mr,customElements.define("ons-search-input",mr);var gr=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.timing,i=void 0===n?"linear":n,r=t.delay,o=void 0===r?0:r,a=t.duration,s=void 0===a?.2:a;return f(this,e),b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,{timing:i,delay:o,duration:s}))}return _(e,ii),p(e,[{key:"show",value:function(t,e){e()}},{key:"hide",value:function(t,e){e()}}]),e}(),vr=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.timing,i=void 0===n?"linear":n,r=t.delay,o=void 0===r?0:r,a=t.duration,s=void 0===a?.3:a;return f(this,e),b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,{timing:i,delay:o,duration:s}))}return _(e,gr),p(e,[{key:"show",value:function(t,e){e=e||function(){},K(t).queue({opacity:0}).wait(this.delay).queue({opacity:1},{duration:this.duration,timing:this.timing}).queue(function(t){e(),t()}).play()}},{key:"hide",value:function(t,e){e=e||function(){},K(t).queue({opacity:1}).wait(this.delay).queue({opacity:0},{duration:this.duration,timing:this.timing}).queue(function(t){e(),t()}).play()}}]),e}(),_r=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.timing,i=void 0===n?"cubic-bezier( .1, .7, .1, 1)":n,r=t.delay,o=void 0===r?0:r,a=t.duration,s=void 0===a?.4:a;return f(this,e),b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,{timing:i,delay:o,duration:s}))}return _(e,gr),p(e,[{key:"show",value:function(t,e){e=e||function(){},K(t).saveStyle().queue({css:{transform:"translate3D(0, 100%, 0)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0, 0, 0)"},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(t){e(),t()}).play()}},{key:"hide",value:function(t,e){e=e||function(){},K(t).saveStyle().queue({css:{transform:"translate3D(0, 0, 0)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0, 100%, 0)"},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(t){e(),t()}).play()}}]),e}(),br={"":"modal--*",modal__content:"modal--*__content"},yr={default:gr,fade:vr,lift:_r,none:gr},kr=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t._defaultDBB=function(){},n(t,function(){return t._compile()}),t}return _(e,si),p(e,[{key:"_updateAnimatorFactory",value:function(){return new A({animators:yr,baseClass:gr,baseClassName:"ModalAnimator",defaultAnimation:this.getAttribute("animation")})}},{key:"_compile",value:function(){if(this.style.display="none",this.style.zIndex=10001,this.classList.add("modal"),!G.findChild(this,".modal__content")){var t=document.createElement("div");for(t.classList.add("modal__content");this.childNodes[0];){var e=this.childNodes[0];this.removeChild(e),t.insertBefore(e,null)}this.appendChild(t)}M.initModifier(this,this._scheme)}},{key:"_toggleStyle",value:function(t){this.style.display=t?"table":"none"}},{key:"connectedCallback",value:function(){v(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"connectedCallback",this).call(this),this.addEventListener("touchmove",v(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_preventScroll",this),!1)}},{key:"disconnectedCallback",value:function(){v(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("touchmove",v(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_preventScroll",this),!1)}},{key:"attributeChangedCallback",value:function(t,n,i){"class"===t?G.restoreClass(this,"modal",br):v(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"attributeChangedCallback",this).call(this,t,n,i)}},{key:"_scheme",get:function(){return br}}],[{key:"registerAnimator",value:function(t,e){if(!(e.prototype instanceof gr))throw new Error('"Animator" param must inherit OnsModalElement.ModalAnimator');yr[t]=e}},{key:"observedAttributes",get:function(){return[].concat(y(v(e.__proto__||Object.getPrototypeOf(e),"observedAttributes",this)),["class"])}},{key:"animators",get:function(){return yr}},{key:"ModalAnimator",get:function(){return gr}}]),e}();Mt.elements.Modal=kr,customElements.define("ons-modal",kr);var wr=function(){function t(e){var n=this;f(this,t),"element ignoreSwipe isInitialState onDragCallback swipeMax swipeMin swipeMid".split(/\s+/).forEach(function(t){return n[t]=e[t]}),this.elementHandler=e.elementHandler||e.element,this.getThreshold=e.getThreshold||function(){return.5},this.getSide=e.getSide||function(){return"left"},this.handleGesture=this.handleGesture.bind(this)}return p(t,[{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.element.hasAttribute("swipeable");this.gestureDetector||(this.gestureDetector=new et(this.elementHandler,{dragMinDistance:1}));var e=t?"on":"off";this.gestureDetector[e]("drag dragstart dragend",this.handleGesture)}},{key:"handleGesture",value:function(t){t.gesture&&("dragstart"===t.type?this.onDragStart(t):this._ignoreDrag||("dragend"===t.type?this.onDragEnd(t):this.onDrag(t)))}},{key:"onDragStart",value:function(t){var e=this;this._ignoreDrag=t.consumed||!G.isValidGesture(t)||this.ignoreSwipe(t,"left"===e.getSide()?t.gesture.center.clientX:window.innerWidth-t.gesture.center.clientX),this._ignoreDrag||(t.consume&&t.consume(),t.consumed=!0,this._width=function(t){var e=[parseInt(t,10),/px/.test(t)],n=e[0];return e[1]?n:Math.round(document.body.offsetWidth*n/100)}(this.element.style.width||"100%"),this._startDistance=this._distance=this.isInitialState instanceof Function&&!this.isInitialState()?this._width:0,G.preventScroll(this.gestureDetector))}},{key:"onDrag",value:function(t){t.stopPropagation(),t.gesture.preventDefault();var e="left"===this.getSide()?t.gesture.deltaX:-t.gesture.deltaX,n=Math.max(0,Math.min(this._width,this._startDistance+e));n!==this._distance&&(this._distance=n,this.swipeMid(this._distance,this._width))}},{key:"onDragEnd",value:function(t){t.stopPropagation();var e=t.gesture.interimDirection;this.getSide()!==e&&this._distance>this._width*this.getThreshold()?this.swipeMax():this.swipeMin()}},{key:"dispose",value:function(){this.gestureDetector&&this.gestureDetector.dispose(),this.gestureDetector=this.element=this.elementHandler=null}}]),t}(),Er=function(t){function e(t){return f(this,e),t=G.extend({timing:"linear",duration:"0.4",delay:"0"},t||{}),b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t))}return _(e,ii),p(e,[{key:"push",value:function(t,e,n){n()}},{key:"pop",value:function(t,e,n){n()}},{key:"block",value:function(t){var e=G.createElement('\n      <div style="position: absolute; background-color: transparent; width: 100%; height: 100%; z-index: 100000"></div>\n    ');return t.parentNode.appendChild(e),function(){return e.remove()}}}]),e}(),Cr=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.timing,i=void 0===n?"cubic-bezier(0.3, .4, 0, .9)":n,r=t.delay,o=void 0===r?0:r,a=t.duration,s=void 0===a?.4:a;f(this,e);var u=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,{timing:i,delay:o,duration:s}));return u.backgroundMask=G.createElement('\n      <div style="position: absolute; width: 100%; height: 100%;\n        background-color: black; z-index: 2"></div>\n    '),u}return _(e,Er),p(e,[{key:"_decompose",value:function(t){var e=t._getToolbarElement(),n=e._getToolbarLeftItemsElement(),i=e._getToolbarRightItemsElement(),r=function(t){for(var e=[],n=0;n<t.length;n++)"ons-back-button"!==t[n].nodeName.toLowerCase()&&e.push(t[n]);return e},o=[].concat(0===n.children.length?n:r(n.children)).concat(0===i.children.length?i:r(i.children));return{toolbarCenter:e._getToolbarCenterItemsElement(),backButtonIcon:e._getToolbarBackButtonIconElement(),backButtonLabel:e._getToolbarBackButtonLabelElement(),other:o,content:t._getContentElement(),background:t._getBackgroundElement(),toolbar:e,bottomToolbar:t._getBottomToolbarElement()}}},{key:"_shouldAnimateToolbar",value:function(t,e){var n=t._getToolbarElement(),i=e._getToolbarElement(),r=t._canAnimateToolbar()&&e._canAnimateToolbar(),o=G.hasModifier(n,"material")||G.hasModifier(i,"material"),a=G.hasModifier(n,"transparent")||G.hasModifier(i,"transparent");return r&&!o&&!a}},{key:"_calculateDelta",value:function(t,e){var n=void 0,i=void 0,r=t.getBoundingClientRect();if(e.backButtonLabel.classList.contains("back-button__label")){var o=e.backButtonLabel.getBoundingClientRect();n=Math.round(r.width/2-o.width/2-o.left)}else n=Math.round(r.width/2*.6);return e.backButtonIcon.classList.contains("back-button__icon")&&(i=e.backButtonIcon.getBoundingClientRect().right-2),{title:n,label:i}}},{key:"push",value:function(t,i,r){var o=this;this.backgroundMask.remove(),i.parentNode.insertBefore(this.backgroundMask,i);var a=v(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"block",this).call(this,t);n(t,function(){var e=G.findToolbarPage(t)||t,n=G.findToolbarPage(i)||i,s=o._decompose(e),u=o._decompose(n),l=o._calculateDelta(i,s);o._shouldAnimateToolbar(e,n)?K.runAll(K([s.content,s.bottomToolbar,s.background]).saveStyle().queue({css:{transform:"translate3D(100%, 0px, 0px)"},duration:0}).wait(o.delay).queue({css:{transform:"translate3D(0px, 0px, 0px)"},duration:o.duration,timing:o.timing}).restoreStyle(),K(s.toolbar).saveStyle().queue({css:{opacity:0},duration:0}).queue({css:{opacity:1},duration:o.duration,timing:o.timing}).restoreStyle(),K(s.toolbarCenter).saveStyle().queue({css:{transform:"translate3d(125%, 0, 0)",opacity:1},duration:0}).wait(o.delay).queue({css:{transform:"translate3d(0, 0, 0)",opacity:1},duration:o.duration,timing:o.timing}).restoreStyle(),K(s.backButtonLabel).saveStyle().queue({css:{transform:"translate3d("+l.title+"px, 0, 0)",opacity:0},duration:0}).wait(o.delay).queue({css:{transform:"translate3d(0, 0, 0)",opacity:1,transition:"opacity "+o.duration+"s linear, transform "+o.duration+"s "+o.timing},duration:o.duration}).restoreStyle(),K(s.other).saveStyle().queue({css:{opacity:0},duration:0}).wait(o.delay).queue({css:{opacity:1},duration:o.duration,timing:"linear"}).restoreStyle(),K([u.content,u.bottomToolbar,u.background]).saveStyle().queue({css:{transform:"translate3D(0, 0, 0)",opacity:1},duration:0}).wait(o.delay).queue({css:{transform:"translate3D(-25%, 0px, 0px)",opacity:.9},duration:o.duration,timing:o.timing}).restoreStyle().queue(function(t){o.backgroundMask.remove(),a(),r(),t()}),K(u.toolbarCenter).saveStyle().queue({css:{transform:"translate3d(0, 0, 0)",opacity:1},duration:0}).wait(o.delay).queue({css:{transform:"translate3d(-"+l.title+"px, 0, 0)",opacity:0,transition:"opacity "+o.duration+"s linear, transform "+o.duration+"s "+o.timing},duration:o.duration}).restoreStyle(),K(u.backButtonLabel).saveStyle().queue({css:{transform:"translate3d(0, 0, 0)",opacity:1},duration:0}).wait(o.delay).queue({css:{transform:"translate3d(-"+l.label+"px, 0, 0)",opacity:0},duration:o.duration,timing:o.timing}).restoreStyle(),K(u.other).saveStyle().queue({css:{opacity:1},duration:0}).wait(o.delay).queue({css:{opacity:0},duration:o.duration,timing:"linear"}).restoreStyle()):K.runAll(K(t).saveStyle().queue({css:{transform:"translate3D(100%, 0px, 0px)"},duration:0}).wait(o.delay).queue({css:{transform:"translate3D(0px, 0px, 0px)"},duration:o.duration,timing:o.timing}).restoreStyle(),K(i).saveStyle().queue({css:{transform:"translate3D(0, 0, 0)",opacity:1},duration:0}).wait(o.delay).queue({css:{transform:"translate3D(-25%, 0px, 0px)",opacity:.9},duration:o.duration,timing:o.timing}).restoreStyle().queue(function(t){o.backgroundMask.remove(),a(),r(),t()}))})}},{key:"pop",value:function(t,n,i){var r=this;this.backgroundMask.remove(),t.parentNode.insertBefore(this.backgroundMask,t);var o=v(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"block",this).call(this,t),a=G.findToolbarPage(t)||t,s=G.findToolbarPage(n)||n,u=this._decompose(a),l=this._decompose(s),c=this._calculateDelta(n,l);this._shouldAnimateToolbar(a,s)?K.runAll(K([u.content,u.bottomToolbar,u.background]).saveStyle().queue({css:{transform:"translate3D(-25%, 0px, 0px)",opacity:.9},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0px, 0px, 0px)",opacity:1},duration:this.duration,timing:this.timing}).restoreStyle(),K(u.toolbarCenter).saveStyle().queue({css:{transform:"translate3d(-"+c.title+"px, 0, 0)",opacity:0},duration:0}).wait(this.delay).queue({css:{transform:"translate3d(0, 0, 0)",opacity:1,transition:"opacity "+this.duration+"s linear, transform "+this.duration+"s "+this.timing},duration:this.duration}).restoreStyle(),K(u.backButtonLabel).saveStyle().queue({css:{transform:"translate3d(-"+c.label+"px, 0, 0)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3d(0, 0, 0)"},duration:this.duration,timing:this.timing}).restoreStyle(),K(u.other).saveStyle().queue({css:{opacity:0},duration:0}).wait(this.delay).queue({css:{opacity:1},duration:this.duration,timing:"linear"}).restoreStyle(),K([l.content,l.bottomToolbar,l.background]).queue({css:{transform:"translate3D(0px, 0px, 0px)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(100%, 0px, 0px)"},duration:this.duration,timing:this.timing}).wait(0).queue(function(t){r.backgroundMask.remove(),o(),i(),t()}),K(l.toolbar).queue({css:{opacity:1},duration:0}).queue({css:{opacity:0},duration:this.duration,timing:this.timing}),K(l.toolbarCenter).queue({css:{transform:"translate3d(0, 0, 0)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3d(125%, 0, 0)"},duration:this.duration,timing:this.timing}),K(l.backButtonLabel).queue({css:{transform:"translate3d(0, 0, 0)",opacity:1},duration:0}).wait(this.delay).queue({css:{transform:"translate3d("+c.title+"px, 0, 0)",opacity:0,transition:"opacity "+this.duration+"s linear, transform "+this.duration+"s "+this.timing},duration:this.duration})):K.runAll(K(t).saveStyle().queue({css:{transform:"translate3D(-25%, 0px, 0px)",opacity:.9},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0px, 0px, 0px)",opacity:1},duration:this.duration,timing:this.timing}).restoreStyle(),K(n).queue({css:{transform:"translate3D(0px, 0px, 0px)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(100%, 0px, 0px)"},duration:this.duration,timing:this.timing}).queue(function(t){r.backgroundMask.remove(),o(),i(),t()}))}}]),e}(),Ar=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.duration,i=void 0===n?.15:n,r=t.timing,o=void 0===r?"linear":r,a=t.delay,s=void 0===a?0:a;f(this,e);var u=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,{duration:i,timing:o,delay:s}));return u.durationRestore=.1,u.swipeShadow=G.createElement('\n      <div style="position: absolute; height: 100%; width: 12px; right: 100%; top: 0; bottom: 0; z-index: -1;\n        background: linear-gradient(to right, transparent 0, rgba(0,0,0,.04) 40%, rgba(0,0,0,.12) 80%, rgba(0,0,0,.16) 100%);"></div>\n    '),u.isDragStart=!0,u}return _(e,Cr),p(e,[{key:"_dragStartSetup",value:function(t,n){this.isDragStart=!1,this.unblock=v(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"block",this).call(this,n),t.parentElement.insertBefore(this.backgroundMask,t),this.target={enter:G.findToolbarPage(t)||t,leave:G.findToolbarPage(n)||n},this.decomp={enter:this._decompose(this.target.enter),leave:this._decompose(this.target.leave)},this.delta=this._calculateDelta(n,this.decomp.leave),this.shouldAnimateToolbar=this._shouldAnimateToolbar(this.target.enter,this.target.leave),this.shouldAnimateToolbar?(this.swipeShadow.style.top=this.decomp.leave.toolbar.offsetHeight+"px",this.target.leave.appendChild(this.swipeShadow),this._saveStyle(this.target.enter,this.target.leave)):(n.appendChild(this.swipeShadow),this._saveStyle(t,n)),n.classList.add("overflow-visible"),this.overflowElement=n,this.decomp.leave.content.classList.add("content-swiping")}},{key:"translate",value:function(t,e,n,i){this.isDragStart&&(this.maxWidth=e,this._dragStartSetup(n,i));var r=(t-e)/e;this.shouldAnimateToolbar?K.runAll(K([this.decomp.enter.content,this.decomp.enter.bottomToolbar,this.decomp.enter.background]).queue({transform:"translate3d("+25*r+"%, 0, 0)",opacity:1+10*r/100}),K(this.decomp.enter.toolbarCenter).queue({transform:"translate3d("+this.delta.title*r+"px, 0, 0)",opacity:1+r}),K(this.decomp.enter.backButtonLabel).queue({opacity:1+10*r/100,transform:"translate3d("+this.delta.label*r+"px, 0, 0)"}),K(this.decomp.enter.other).queue({opacity:1+r}),K([this.decomp.leave.content,this.decomp.leave.bottomToolbar,this.decomp.leave.background,this.swipeShadow]).queue({transform:"translate3d("+t+"px, 0px, 0px)"}),K(this.decomp.leave.toolbar).queue({opacity:-1*r}),K(this.decomp.leave.toolbarCenter).queue({transform:"translate3d("+125*(1+r)+"%, 0, 0)"}),K(this.decomp.leave.backButtonLabel).queue({opacity:-1*r,transform:"translate3d("+this.delta.title*(1+r)+"px, 0, 0)"}),K(this.swipeShadow).queue({opacity:-1*r})):K.runAll(K(i).queue({transform:"translate3d("+t+"px, 0px, 0px)"}),K(n).queue({transform:"translate3d("+25*r+"%, 0, 0)",opacity:1+10*r/100}),K(this.swipeShadow).queue({opacity:-1*r}))}},{key:"restore",value:function(t,e,n){var i=this;this.isDragStart||(this.shouldAnimateToolbar?K.runAll(K([this.decomp.enter.content,this.decomp.enter.bottomToolbar,this.decomp.enter.background]).queue({transform:"translate3d(-25%, 0, 0)",opacity:.9},{timing:this.timing,duration:this.durationRestore}),K(this.decomp.enter.toolbarCenter).queue({transform:"translate3d(-"+this.delta.title+"px, 0, 0)",transition:"opacity "+this.durationRestore+"s linear, transform "+this.durationRestore+"s "+this.timing,opacity:0}),K(this.decomp.enter.backButtonLabel).queue({transform:"translate3d(-"+this.delta.label+"px, 0, 0)"},{timing:this.timing,duration:this.durationRestore}),K(this.decomp.enter.other).queue({opacity:0},{timing:this.timing,duration:this.durationRestore}),K([this.decomp.leave.content,this.decomp.leave.bottomToolbar,this.decomp.leave.background,this.swipeShadow]).queue({transform:"translate3d(0, 0px, 0px)"},{timing:this.timing,duration:this.durationRestore}),K(this.decomp.leave.toolbar).queue({opacity:1},{timing:this.timing,duration:this.durationRestore}),K(this.decomp.leave.toolbarCenter).queue({transform:"translate3d(0, 0, 0)"},{timing:this.timing,duration:this.durationRestore}),K(this.decomp.leave.backButtonLabel).queue({opacity:1,transform:"translate3d(0, 0, 0)",transition:"opacity "+this.durationRestore+"s linear, transform "+this.durationRestore+"s "+this.timing}),K(this.swipeShadow).queue({opacity:0},{timing:this.timing,duration:this.durationRestore}).queue(function(t){i._reset(i.target.enter,i.target.leave),n&&n(),t()})):K.runAll(K(t).queue({css:{transform:"translate3D(-25%, 0px, 0px)",opacity:.9},timing:this.timing,duration:this.durationRestore}),K(e).queue({css:{transform:"translate3D(0px, 0px, 0px)"},timing:this.timing,duration:this.durationRestore}).queue(function(r){i._reset(t,e),n&&n(),r()})))}},{key:"pop",value:function(t,e,n){var i=this;this.isDragStart||(this.shouldAnimateToolbar?K.runAll(K([this.decomp.enter.content,this.decomp.enter.bottomToolbar,this.decomp.enter.background]).queue({transform:"translate3d(0, 0, 0)",opacity:1},{timing:this.timing,duration:this.duration}),K(this.decomp.enter.toolbarCenter).queue({transform:"translate3d(0, 0, 0)",transition:"opacity "+this.duration+"s linear, transform "+this.duration+"s "+this.timing,opacity:1}),K(this.decomp.enter.backButtonLabel).queue({transform:"translate3d(0, 0, 0)"},{timing:this.timing,duration:this.duration}),K(this.decomp.enter.other).queue({opacity:1},{timing:this.timing,duration:this.duration}),K([this.decomp.leave.content,this.decomp.leave.bottomToolbar,this.decomp.leave.background]).queue({transform:"translate3d(100%, 0px, 0px)"},{timing:this.timing,duration:this.duration}),K(this.decomp.leave.toolbar).queue({opacity:0},{timing:this.timing,duration:this.duration}),K(this.decomp.leave.toolbarCenter).queue({transform:"translate3d(125%, 0, 0)"},{timing:this.timing,duration:this.duration}),K(this.decomp.leave.backButtonLabel).queue({opacity:0,transform:"translate3d("+this.delta.title+"px, 0, 0)",transition:"opacity "+this.duration+"s linear, transform "+this.duration+"s "+this.timing}),K(this.swipeShadow).queue({opacity:0,transform:"translate3d("+this.maxWidth+"px, 0px, 0px)"},{timing:this.timing,duration:this.duration}).queue(function(t){i._reset(i.target.enter,i.target.leave),n&&n(),t()})):K.runAll(K(t).queue({css:{transform:"translate3D(0px, 0px, 0px)",opacity:1},duration:this.duration,timing:this.timing}),K(e).queue({css:{transform:"translate3D(100%, 0px, 0px)"},duration:this.duration,timing:this.timing}).queue(function(r){i._reset(t,e),n&&n(),r()})))}},{key:"_saveStyle",value:function(){var t=this;this._savedStyle=new WeakMap;for(var e=function(e){return t._savedStyle.set(e,e.getAttribute("style"))},n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];i.forEach(e),Object.keys(this.decomp).forEach(function(n){Object.keys(t.decomp[n]).forEach(function(i){(t.decomp[n][i]instanceof Array?t.decomp[n][i]:[t.decomp[n][i]]).forEach(e)})})}},{key:"_restoreStyle",value:function(){for(var t=this,e=function(e){null===t._savedStyle.get(e)?e.removeAttribute("style"):e.setAttribute("style",t._savedStyle.get(e)),t._savedStyle.delete(e)},n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];i.forEach(e),Object.keys(this.decomp).forEach(function(n){Object.keys(t.decomp[n]).forEach(function(i){(t.decomp[n][i]instanceof Array?t.decomp[n][i]:[t.decomp[n][i]]).forEach(e)})})}},{key:"_reset",value:function(){this._savedStyle&&this._restoreStyle.apply(this,arguments),this.unblock&&this.unblock(),this.swipeShadow.remove(),this.backgroundMask.remove(),this.overflowElement.classList.remove("overflow-visible"),this.decomp.leave.content.classList.remove("content-swiping"),this.decomp=this.target=this.overflowElement=this._savedStyle=null,this.isDragStart=!0}}]),e}(),Sr=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.timing,i=void 0===n?"cubic-bezier(.1, .7, .1, 1)":n,r=t.delay,o=void 0===r?0:r,a=t.duration,s=void 0===a?.4:a;f(this,e);var u=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,{timing:i,delay:o,duration:s}));return u.backgroundMask=G.createElement('\n      <div style="position: absolute; width: 100%; height: 100%;\n        background: linear-gradient(black, white);"></div>\n    '),u}return _(e,Er),p(e,[{key:"push",value:function(t,n,i){var r=this;this.backgroundMask.remove(),n.parentNode.insertBefore(this.backgroundMask,n);var o=v(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"block",this).call(this,t);K.runAll(K(t).saveStyle().queue({css:{transform:"translate3D(0, 100%, 0)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0, 0, 0)"},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(t){r.backgroundMask.remove(),o(),i(),t()}),K(n).saveStyle().queue({css:{transform:"translate3D(0, 0, 0)",opacity:1},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0, -10%, 0)",opacity:.9},duration:this.duration,timing:this.timing}).restoreStyle())}},{key:"pop",value:function(t,n,i){var r=this;this.backgroundMask.remove(),t.parentNode.insertBefore(this.backgroundMask,t);var o=v(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"block",this).call(this,t);K.runAll(K(t).saveStyle().queue({css:{transform:"translate3D(0, -43px, 0)",opacity:.9},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0, 0, 0)",opacity:1},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(t){r.backgroundMask.remove(),o(),i(),t()}),K(n).saveStyle().queue({css:{transform:"translate3D(0, 0, 0)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0, 100%, 0)"},duration:this.duration,timing:this.timing}).restoreStyle())}}]),e}(),Or=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.timing,i=void 0===n?"linear":n,r=t.delay,o=void 0===r?0:r,a=t.duration,s=void 0===a?.4:a;return f(this,e),b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,{timing:i,delay:o,duration:s}))}return _(e,Er),p(e,[{key:"push",value:function(t,n,i){var r=v(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"block",this).call(this,t);K.runAll(K([t._getContentElement(),t._getBackgroundElement()]).saveStyle().queue({css:{transform:"translate3D(0, 0, 0)",opacity:0},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0, 0, 0)",opacity:1},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(t){r(),i(),t()}),K(t._getToolbarElement()).saveStyle().queue({css:{transform:"translate3D(0, 0, 0)",opacity:0},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0, 0, 0)",opacity:1},duration:this.duration,timing:this.timing}).restoreStyle())}},{key:"pop",value:function(t,n,i){var r=v(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"block",this).call(this,t);K.runAll(K([n._getContentElement(),n._getBackgroundElement()]).queue({css:{transform:"translate3D(0, 0, 0)",opacity:1},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0, 0, 0)",opacity:0},duration:this.duration,timing:this.timing}).queue(function(t){r(),i(),t()}),K(n._getToolbarElement()).queue({css:{transform:"translate3D(0, 0, 0)",opacity:1},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0, 0, 0)",opacity:0},duration:this.duration,timing:this.timing}))}}]),e}(),Pr=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.timing,i=void 0===n?"cubic-bezier(.1, .7, .4, 1)":n,r=t.delay,o=void 0===r?0:r,a=t.duration,s=void 0===a?.3:a;f(this,e);var u=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,{timing:i,delay:o,duration:s}));return u.backgroundMask=G.createElement('\n      <div style="position: absolute; width: 100%; height: 100%; z-index: 2;\n        background-color: black; opacity: 0;"></div>\n    '),u.blackMaskOpacity=.4,u}return _(e,Er),p(e,[{key:"push",value:function(t,n,i){var r=this;this.backgroundMask.remove(),n.parentElement.insertBefore(this.backgroundMask,n.nextSibling);var o=v(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"block",this).call(this,t);K.runAll(K(this.backgroundMask).saveStyle().queue({opacity:0,transform:"translate3d(0, 0, 0)"}).wait(this.delay).queue({opacity:this.blackMaskOpacity},{duration:this.duration,timing:this.timing}).restoreStyle().queue(function(t){r.backgroundMask.remove(),t()}),K(t).saveStyle().queue({css:{transform:"translate3D(100%, 0, 0)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0, 0, 0)"},duration:this.duration,timing:this.timing}).restoreStyle(),K(n).saveStyle().queue({css:{transform:"translate3D(0, 0, 0)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(-45%, 0px, 0px)"},duration:this.duration,timing:this.timing}).restoreStyle().wait(.2).queue(function(t){o(),i(),t()}))}},{key:"pop",value:function(t,n,i){var r=this;this.backgroundMask.remove(),t.parentNode.insertBefore(this.backgroundMask,t.nextSibling);var o=v(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"block",this).call(this,t);K.runAll(K(this.backgroundMask).saveStyle().queue({opacity:this.blackMaskOpacity,transform:"translate3d(0, 0, 0)"}).wait(this.delay).queue({opacity:0},{duration:this.duration,timing:this.timing}).restoreStyle().queue(function(t){r.backgroundMask.remove(),t()}),K(t).saveStyle().queue({css:{transform:"translate3D(-45%, 0px, 0px)",opacity:.9},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0px, 0px, 0px)",opacity:1},duration:this.duration,timing:this.timing}).restoreStyle(),K(n).queue({css:{transform:"translate3D(0px, 0px, 0px)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(100%, 0px, 0px)"},duration:this.duration,timing:this.timing}).wait(.2).queue(function(t){o(),i(),t()}))}}]),e}(),xr=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.timing,i=void 0===n?"cubic-bezier(.1, .7, .1, 1)":n,r=t.delay,o=void 0===r?.05:r,a=t.duration,s=void 0===a?.4:a;f(this,e);var u=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,{timing:i,delay:o,duration:s}));return u.backgroundMask=G.createElement('\n      <div style="position: absolute; width: 100%; height: 100%;\n        background-color: black;"></div>\n    '),u}return _(e,Er),p(e,[{key:"push",value:function(t,n,i){var r=this;this.backgroundMask.remove(),n.parentNode.insertBefore(this.backgroundMask,n);var o=v(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"block",this).call(this,t),a=K(this.backgroundMask).wait(this.delay+this.duration).queue(function(t){r.backgroundMask.remove(),t()});K.runAll(a,K(t).saveStyle().queue({css:{transform:"translate3D(0, 100%, 0)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0, 0, 0)"},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(t){o(),i(),t()}),K(n).queue({css:{opacity:1},duration:0}).queue({css:{opacity:.4},duration:this.duration,timing:this.timing}))}},{key:"pop",value:function(t,n,i){var r=this;this.backgroundMask.remove(),t.parentNode.insertBefore(this.backgroundMask,t);var o=v(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"block",this).call(this,t);K.runAll(K(this.backgroundMask).wait(this.delay+this.duration).queue(function(t){r.backgroundMask.remove(),t()}),K(t).queue({css:{transform:"translate3D(0, 0, 0)",opacity:.4},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0, 0, 0)",opacity:1},duration:this.duration,timing:this.timing}).queue(function(t){o(),i(),t()}),K(n).queue({css:{transform:"translate3D(0, 0, 0)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0, 100%, 0)"},duration:this.duration,timing:this.timing}))}}]),e}(),Tr=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.timing,i=void 0===n?"cubic-bezier(0.4, 0.0, 0.2, 1)":n,r=t.timingOnPop,o=void 0===r?"cubic-bezier(0.4, 0.0, 1, 1)":r,a=t.delay,s=void 0===a?0:a,u=t.duration,l=void 0===u?.2:u;f(this,e);var c=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,{timing:i,delay:s,duration:l}));return c.timingOnPop=o,c}return _(e,Er),p(e,[{key:"push",value:function(t,n,i){var r=v(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"block",this).call(this,t);K.runAll(K(t).saveStyle().queue({css:{transform:"translate3D(0, 42px, 0)",opacity:0},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0, 0, 0)",opacity:1},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(t){r(),i(),t()}))}},{key:"pop",value:function(t,n,i){var r=v(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"block",this).call(this,t);K.runAll(K(n).queue({css:{transform:"translate3D(0, 0, 0)",opacity:1},duration:0}).wait(.15).queue({css:{transform:"translate3D(0, 38px, 0)",opacity:0},duration:this.duration,timing:this.timingOnPop}).queue(function(t){r(),i(),t()}))}}]),e}(),Lr=function(t){function e(t){return f(this,e),b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t))}return _(e,Er),p(e,[{key:"push",value:function(t,e,n){n()}},{key:"pop",value:function(t,e,n){n()}}]),e}(),Dr={default:function(){return w.isAndroid()?Tr:Cr},slide:function(){return w.isAndroid()?Pr:Cr},lift:function(){return w.isAndroid()?xr:Sr},fade:function(){return w.isAndroid()?Tr:Or},"slide-ios":Cr,"slide-md":Pr,"lift-ios":Sr,"lift-md":xr,"fade-ios":Or,"fade-md":Tr,none:Lr},Mr={ready:function(t,e){e()}},Ir=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t._isRunning=!1,t._initialized=!1,t._pageLoader=Lt,t._pageMap=new WeakMap,t._updateAnimatorFactory(),t}return _(e,ti),p(e,[{key:"animatorFactory",get:function(){return this._animatorFactory}}]),p(e,[{key:"_getPageTarget",value:function(){return this._page||this.getAttribute("page")}},{key:"connectedCallback",value:function(){var t=this;if(this.onDeviceBackButton=this._onDeviceBackButton.bind(this),w.isAndroid()&&"force"!==this.getAttribute("swipeable")||(this._swipeAnimator=new Ar,this._swipe=new wr({element:this,swipeMax:function(){return t[t.swipeMax?"swipeMax":"popPage"]({animator:t._swipeAnimator})},swipeMid:function(e,n){return t._swipeAnimator.translate(e,n,t.topPage.previousElementSibling,t.topPage)},swipeMin:function(){return t._swipeAnimator.restore(t.topPage.previousElementSibling,t.topPage)},getThreshold:function(){return Math.max(.2,parseFloat(t.getAttribute("swipe-threshold"))||0)},ignoreSwipe:function(e,n){if(/ons-back-button/i.test(e.target.tagName)||G.findParent(e.target,"ons-back-button",function(t){return/ons-page/i.test(t.tagName)}))return!0;var i=parseInt(t.getAttribute("swipe-target-width")||25,10);return"right"!==e.gesture.direction||i<=n||t._isRunning||t.children.length<=1}}),this.attributeChangedCallback("swipeable")),!this._initialized){this._initialized=!0;var e=G.defer();this.loaded=e.promise,Mr.ready(this,function(){var i=!G.hasAnyComponentAsParent(t),r={animation:"none",show:i};if(0===t.pages.length&&t._getPageTarget())t.pushPage(t._getPageTarget(),r).then(function(){return e.resolve()});else if(t.pages.length>0){for(var o=0;o<t.pages.length;o++)if("ONS-PAGE"!==t.pages[o].nodeName)throw new Error("The children of <ons-navigator> need to be of type <ons-page>");t.topPage&&n(t.topPage,function(){return setTimeout(function(){e.resolve(),i&&t.topPage._show(),t._updateLastPageBackButton()},0)})}else n(t,function(){0===t.pages.length&&t._getPageTarget()?t.pushPage(t._getPageTarget(),r).then(function(){return e.resolve()}):e.resolve()})})}}},{key:"_updateAnimatorFactory",value:function(){this._animatorFactory=new A({animators:Dr,baseClass:Er,baseClassName:"NavigatorAnimator",defaultAnimation:this.getAttribute("animation")})}},{key:"disconnectedCallback",value:function(){this._backButtonHandler.destroy(),this._backButtonHandler=null,this._swipe&&this._swipe.dispose(),this._swipe=this._swipeAnimator=null}},{key:"attributeChangedCallback",value:function(t,e,n){switch(t){case"animation":this._updateAnimatorFactory();break;case"swipeable":this._swipe&&this._swipe.update()}}},{key:"popPage",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e=this._preparePageAndOptions(null,e).options;return this._popPage(e,function(){return new Promise(function(e){t._pageLoader.unload(t.pages[t.pages.length-1]),e()})})}},{key:"_popPage",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return Promise.resolve()};if(this._isRunning)return Promise.reject("popPage is already running.");if(this.pages.length<=1)return Promise.reject("ons-navigator's page stack is empty.");if(this._emitPrePopEvent())return Promise.reject("Canceled in prepop event.");var i=this.pages.length;return this._isRunning=!0,this.pages[i-2].updateBackButton(i-2>0),new Promise(function(r){var o=e.pages[i-1],a=e.pages[i-2];t.animation=t.animation||(o.pushedOptions?o.pushedOptions.animation:void 0),t.animationOptions=G.extend({},o.pushedOptions?o.pushedOptions.animationOptions:{},t.animationOptions||{}),t.data&&(a.data=G.extend({},a.data||{},t.data||{}));o._hide();(t.animator||e._animatorFactory.newAnimator(t)).pop(e.pages[i-2],e.pages[i-1],function(){n().then(function(){e._isRunning=!1,a._show(),G.triggerElementEvent(e,"postpop",{leavePage:o,enterPage:a,navigator:e}),"function"==typeof t.callback&&t.callback(),r(a)})})}).catch(function(){return e._isRunning=!1})}},{key:"pushPage",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this._preparePageAndOptions(t,n);t=i.page;var r=function(i){e._verifyPageElement(i),e._pageMap.set(i,t),(i=G.extend(i,{data:n.data})).style.visibility="hidden"};return(n=i.options).pageHTML?this._pushPage(n,function(){return new Promise(function(t){Dt.load({page:n.pageHTML,parent:e,params:n.data},function(e){r(e),t()})})}):this._pushPage(n,function(){return new Promise(function(i){e._pageLoader.load({page:t,parent:e,params:n.data},function(t){r(t),i()})})})}},{key:"_pushPage",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return Promise.resolve()};if(this._isRunning)return Promise.reject("pushPage is already running.");if(this._emitPrePushEvent())return Promise.reject("Canceled in prepush event.");this._isRunning=!0;var i=A.parseAnimationOptionsString(this.getAttribute("animation-options"));e=G.extend({},this.options||{},{animationOptions:i},e);var r=this._animatorFactory.newAnimator(e);return n().then(function(){var n=t.pages.length,i=t.pages[n-1],o=e.leavePage||t.pages[n-2];if("ONS-PAGE"!==i.nodeName)throw new Error("Only elements of type <ons-page> can be pushed to the navigator");return i.updateBackButton(n>(e._replacePage?2:1)),i.pushedOptions=G.extend({},i.pushedOptions||{},e||{}),i.data=G.extend({},i.data||{},e.data||{}),i.unload=i.unload||e.unload,new Promise(function(n){var a=function(){t._isRunning=!1,!1!==e.show&&setImmediate(function(){return i._show()}),G.triggerElementEvent(t,"postpush",{leavePage:o,enterPage:i,navigator:t}),"function"==typeof e.callback&&e.callback(),n(i)};i.style.visibility="",o?(o._hide(),r.push(i,o,a)):a()})}).catch(function(e){throw t._isRunning=!1,e})}},{key:"replacePage",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.pushPage(t,n).then(function(t){return e.pages.length>1&&e._pageLoader.unload(e.pages[e.pages.length-2]),e._updateLastPageBackButton(),Promise.resolve(t)})}},{key:"insertPage",value:function(t,e){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this._preparePageAndOptions(e,i);if(e=r.page,i=r.options,(t=this._normalizeIndex(t))>=this.pages.length)return this.pushPage(e,i);e="string"==typeof i.pageHTML?i.pageHTML:e;var o="string"==typeof i.pageHTML?Dt:this._pageLoader;return new Promise(function(r){o.load({page:e,parent:n},function(o){n._verifyPageElement(o),n._pageMap.set(o,e),o=G.extend(o,{data:i.data,pushedOptions:i}),i.animationOptions=G.extend({},A.parseAnimationOptionsString(n.getAttribute("animation-options")),i.animationOptions||{}),n.insertBefore(o,n.pages[t]),n.topPage.updateBackButton(!0),setTimeout(function(){o=null,r(n.pages[t])},1e3/60)})})}},{key:"removePage",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(t=this._normalizeIndex(t))<this.pages.length-1?new Promise(function(n){var i=e.pages[t],r=e.topPage;e._pageMap.delete(i),e._pageLoader.unload(i),1===e.pages.length&&e.topPage.updateBackButton(!1),n(r)}):this.popPage(n)}},{key:"resetToPage",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this._preparePageAndOptions(t,n);t=i.page,(n=i.options).animator||n.animation||(n.animation="none");var r=n.callback;return n.callback=function(){for(;e.pages.length>1;)e._pageLoader.unload(e.pages[0]);e.pages[0].updateBackButton(!1),r&&r()},n.page||n.pageHTML||!this._getPageTarget()||(t=n.page=this._getPageTarget()),this.pushPage(t,n)}},{key:"bringPageTop",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(-1===["number","string"].indexOf(void 0===t?"undefined":d(t)))throw new Error("First argument must be a page name or the index of an existing page. You supplied "+t);var n="number"==typeof t?this._normalizeIndex(t):this._lastIndexOfPage(t),i=this.pages[n];if(n<0)return this.pushPage(t,e);if(e=this._preparePageAndOptions(i,e).options,n===this.pages.length-1)return Promise.resolve(i);if(!i)throw new Error("Failed to find item "+t);return this._isRunning?Promise.reject("pushPage is already running."):this._emitPrePushEvent()?Promise.reject("Canceled in prepush event."):(i.style.visibility="hidden",i.parentNode.appendChild(i),this._pushPage(e))}},{key:"_preparePageAndOptions",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"!=(void 0===e?"undefined":d(e)))throw new Error("options must be an object. You supplied "+e);return null!==t&&void 0!==t||!e.page||(t=e.page),e=G.extend({},this.options||{},e,{page:t}),{page:t,options:e}}},{key:"_updateLastPageBackButton",value:function(){var t=this.pages.length-1;t>=0&&this.pages[t].updateBackButton(t>0)}},{key:"_normalizeIndex",value:function(t){return t>=0?t:Math.abs(this.pages.length+t)%this.pages.length}},{key:"_onDeviceBackButton",value:function(t){this.pages.length>1?this.popPage():t.callParentHandler()}},{key:"_lastIndexOfPage",value:function(t){var e=void 0;for(e=this.pages.length-1;e>=0;e--){if(!this._pageMap.has(this.pages[e]))throw Error("This is bug.");if(t===this._pageMap.get(this.pages[e]))break}return e}},{key:"_emitPreEvent",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!1;return G.triggerElementEvent(this,"pre"+t,G.extend({navigator:this,currentPage:this.pages[this.pages.length-1],cancel:function(){return n=!0}},e)),n}},{key:"_emitPrePushEvent",value:function(){return this._emitPreEvent("push")}},{key:"_emitPrePopEvent",value:function(){var t=this.pages.length;return this._emitPreEvent("pop",{leavePage:this.pages[t-1],enterPage:this.pages[t-2]})}},{key:"_createPageElement",value:function(t){var e=G.createElement(C.normalizePageHTML(t));return this._verifyPageElement(e),e}},{key:"_verifyPageElement",value:function(t){if("ons-page"!==t.nodeName.toLowerCase())throw new Error('You must supply an "ons-page" element to "ons-navigator".')}},{key:"_show",value:function(){var t=this;this.loaded.then(function(){return t.topPage&&t.topPage._show()})}},{key:"_hide",value:function(){this.topPage&&this.topPage._hide()}},{key:"_destroy",value:function(){for(var t=this.pages.length-1;t>=0;t--)this._pageLoader.unload(this.pages[t]);this.remove()}},{key:"pageLoader",get:function(){return this._pageLoader},set:function(t){if(!(t instanceof Tt))throw Error("First parameter must be an instance of PageLoader.");this._pageLoader=t}},{key:"page",get:function(){return this._page},set:function(t){this._page=t}},{key:"onDeviceBackButton",get:function(){return this._backButtonHandler},set:function(t){this._backButtonHandler&&this._backButtonHandler.destroy(),this._backButtonHandler=q.createHandler(this,t)}},{key:"topPage",get:function(){for(var t=this.lastElementChild;t&&"ONS-PAGE"!==t.tagName;)t=t.previousElementSibling;return t}},{key:"pages",get:function(){return G.arrayFrom(this.children).filter(function(t){return"ONS-PAGE"===t.tagName})}},{key:"options",get:function(){return this._options},set:function(t){this._options=t}},{key:"_isRunning",set:function(t){this.setAttribute("_is-running",t?"true":"false")},get:function(){return JSON.parse(this.getAttribute("_is-running"))}}],[{key:"registerAnimator",value:function(t,e){if(!(e.prototype instanceof Er))throw new Error('"Animator" param must inherit NavigatorElement.NavigatorAnimator');Dr[t]=e}},{key:"observedAttributes",get:function(){return["animation","swipeable"]}},{key:"animators",get:function(){return Dr}},{key:"NavigatorAnimator",get:function(){return Er}},{key:"events",get:function(){return["prepush","postpush","prepop","postpop"]}},{key:"rewritables",get:function(){return Mr}}]),e}();Mt.elements.Navigator=Ir,customElements.define("ons-navigator",Ir);var Nr={"":"toolbar--*",".toolbar__left":"toolbar--*__left",".toolbar__center":"toolbar--*__center",".toolbar__right":"toolbar--*__right"},qr=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n(t,function(){t._compile()}),t}return _(e,ti),p(e,[{key:"attributeChangedCallback",value:function(t,e,n){switch(t){case"class":G.restoreClass(this,"toolbar",Nr);break;case"modifier":M.onModifierChanged(e,n,this,Nr)}}},{key:"_getToolbarLeftItemsElement",value:function(){return this.querySelector(".left")||C.nullElement}},{key:"_getToolbarCenterItemsElement",value:function(){return this.querySelector(".center")||C.nullElement}},{key:"_getToolbarRightItemsElement",value:function(){return this.querySelector(".right")||C.nullElement}},{key:"_getToolbarBackButtonLabelElement",value:function(){return this.querySelector("ons-back-button .back-button__label")||C.nullElement}},{key:"_getToolbarBackButtonIconElement",value:function(){return this.querySelector("ons-back-button .back-button__icon")||C.nullElement}},{key:"_compile",value:function(){D.prepare(this),this.classList.add("toolbar"),this._ensureToolbarItemElements(),M.initModifier(this,Nr)}},{key:"_ensureToolbarItemElements",value:function(){for(var t=this.childNodes.length-1;t>=0;t--)1!=this.childNodes[t].nodeType&&this.removeChild(this.childNodes[t]);var e=this._ensureToolbarElement("center");if(e.classList.add("toolbar__title"),1!==this.children.length||!this.children[0].classList.contains("center")){var n=this._ensureToolbarElement("left"),i=this._ensureToolbarElement("right");this.children[0]===n&&this.children[1]===e&&this.children[2]===i||(this.appendChild(n),this.appendChild(e),this.appendChild(i))}}},{key:"_ensureToolbarElement",value:function(t){if(G.findChild(this,".toolbar__"+t)){var e=G.findChild(this,".toolbar__"+t);return e.classList.add(t),e}var n=G.findChild(this,"."+t)||G.create("."+t);return n.classList.add("toolbar__"+t),n}}],[{key:"observedAttributes",get:function(){return["modifier","class"]}}]),e}();Mt.elements.Toolbar=qr,customElements.define("ons-toolbar",qr);var Br="page",jr={"":"page--*",".page__content":"page--*__content",".page__background":"page--*__background"},Hr=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t._deriveHooks(),t.classList.add(Br),t._initialized=!1,t._contentObserver=new MutationObserver(function(){t._tryToSuppressLayerCreation()}),n(t,function(){t._compile(),t._isShown=!1,t._contentElement=t._getContentElement(),t._backgroundElement=t._getBackgroundElement(),t._contentObserver.observe(t._contentElement,{childList:!0}),t._tryToSuppressLayerCreation()}),t}return _(e,ti),p(e,[{key:"_tryToSuppressLayerCreation",value:function(){if(this._contentElement){var t=this._contentElement,e=new Set(["ons-navigator","ons-page","ons-tabbar","ons-splitter"]);1===t.children.length&&e.has(t.children[0].nodeName.toLowerCase())?t.classList.add("page__content--suppress-layer-creation"):t.classList.remove("page__content--suppress-layer-creation")}}},{key:"_compile",value:function(){var t=this;D.prepare(this);var e=G.findChild(this,"ons-toolbar"),n=G.findChild(this,".page__background")||G.findChild(this,".background")||document.createElement("div");n.classList.add("page__background"),this.insertBefore(n,!e&&this.firstChild||e&&e.nextSibling);var i=G.findChild(this,".page__content")||G.findChild(this,".content")||document.createElement("div");i.classList.add("page__content"),i.parentElement||G.arrayFrom(this.childNodes).forEach(function(e){(1!==e.nodeType||t._elementShouldBeMoved(e))&&i.appendChild(e)}),this._tryToFillStatusBar(i),this.insertBefore(i,n.nextSibling),n.style.backgroundColor||e&&G.hasModifier(e,"transparent")||1!==i.children.length||!G.isPageControl(i.children[0])||(n.style.backgroundColor="transparent"),M.initModifier(this,jr)}},{key:"_elementShouldBeMoved",value:function(t){if(t.classList.contains("page__background"))return!1;var e=t.tagName.toLowerCase();if("ons-fab"===e)return!t.hasAttribute("position");return t.hasAttribute("inline")||-1===["script","ons-toolbar","ons-bottom-toolbar","ons-modal","ons-speed-dial","ons-dialog","ons-alert-dialog","ons-popover","ons-action-sheet"].indexOf(e)}},{key:"_tryToFillStatusBar",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._contentElement;C.autoStatusBarFill(function(){G.toggleAttribute(t,"status-bar-fill",!G.findParent(t,function(t){return t.hasAttribute("status-bar-fill")})&&(t._canAnimateToolbar(e)||!G.findChild(e,G.isPageControl)))})}},{key:"_canAnimateToolbar",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._contentElement;return!!G.findChild(this,"ons-toolbar")||!!G.findChild(t,function(t){return G.match(t,"ons-toolbar")&&!t.hasAttribute("inline")})}},{key:"connectedCallback",value:function(){var t=this;G.isAttached(this)&&n(this,function(){t._tryToFillStatusBar(),t.hasAttribute("on-infinite-scroll")&&t.attributeChangedCallback("on-infinite-scroll",null,t.getAttribute("on-infinite-scroll")),t._initialized||(t._initialized=!0,setImmediate(function(){t.onInit&&t.onInit(),G.triggerElementEvent(t,"init")}),G.hasAnyComponentAsParent(t)||setImmediate(function(){return t._show()}))})}},{key:"updateBackButton",value:function(t){this.backButton&&(t?this.backButton.show():this.backButton.hide())}},{key:"_onScroll",value:function(){var t=this,e=this._contentElement,n=(e.scrollTop+e.clientHeight)/e.scrollHeight>=this._infiniteScrollLimit;this._onInfiniteScroll&&!this._loadingContent&&n&&(this._loadingContent=!0,this._onInfiniteScroll(function(){return t._loadingContent=!1}))}},{key:"_getContentElement",value:function(){var t=G.findChild(this,".page__content");if(t)return t;throw Error('fail to get ".page__content" element.')}},{key:"_getBackgroundElement",value:function(){var t=G.findChild(this,".page__background");if(t)return t;throw Error('fail to get ".page__background" element.')}},{key:"_getBottomToolbarElement",value:function(){return G.findChild(this,"ons-bottom-toolbar")||C.nullElement}},{key:"_getToolbarElement",value:function(){return G.findChild(this,"ons-toolbar")||document.createElement("ons-toolbar")}},{key:"attributeChangedCallback",value:function(t,e,n){var i=this;switch(t){case"class":G.restoreClass(this,Br,jr);break;case"modifier":M.onModifierChanged(e,n,this,jr);break;case"on-infinite-scroll":this.onInfiniteScroll=null===n?null:function(t){var e=G.findFromPath(n);i.onInfiniteScroll=e,e(t)}}}},{key:"_show",value:function(){!this._isShown&&G.isAttached(this)&&(this._isShown=!0,this.onShow&&this.onShow(),G.triggerElementEvent(this,"show"),G.propagateAction(this,"_show"))}},{key:"_hide",value:function(){this._isShown&&(this._isShown=!1,this.onHide&&this.onHide(),G.triggerElementEvent(this,"hide"),G.propagateAction(this,"_hide"))}},{key:"_destroy",value:function(){this._hide(),this.onDestroy&&this.onDestroy(),G.triggerElementEvent(this,"destroy"),this.onDeviceBackButton&&this.onDeviceBackButton.destroy(),G.propagateAction(this,"_destroy"),this.remove()}},{key:"_deriveHooks",value:function(){var t=this;this.constructor.events.forEach(function(e){var n="on"+e.charAt(0).toUpperCase()+e.slice(1);Object.defineProperty(t,n,{enumerable:!0,get:function(){return t["_"+n]},set:function(e){if(!(e instanceof Function))throw new Error(n+" hook must be a function");t["_"+n]=e.bind(t)}})})}},{key:"name",set:function(t){this.setAttribute("name",t)},get:function(){return this.getAttribute("name")}},{key:"backButton",get:function(){return this.querySelector("ons-back-button")}},{key:"onInfiniteScroll",set:function(t){var e=this;if(t&&!(t instanceof Function))throw new Error("onInfiniteScroll must be a function or null");n(this,function(){t?e._onInfiniteScroll||(e._infiniteScrollLimit=.9,e._boundOnScroll=e._onScroll.bind(e),setImmediate(function(){return e._contentElement.addEventListener("scroll",e._boundOnScroll)})):e._contentElement.removeEventListener("scroll",e._boundOnScroll),e._onInfiniteScroll=t})},get:function(){return this._onInfiniteScroll}},{key:"onDeviceBackButton",get:function(){return this._backButtonHandler},set:function(t){this._backButtonHandler&&this._backButtonHandler.destroy(),this._backButtonHandler=q.createHandler(this,t)}},{key:"scrollTop",get:function(){return this._contentElement.scrollTop},set:function(t){this._contentElement.scrollTop=t}}],[{key:"observedAttributes",get:function(){return["modifier","on-infinite-scroll","class"]}},{key:"events",get:function(){return["init","show","hide","destroy"]}}]),e}();Mt.elements.Page=Hr,customElements.define("ons-page",Hr);var Rr=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.timing,i=void 0===n?"cubic-bezier(.1, .7, .4, 1)":n,r=t.delay,o=void 0===r?0:r,a=t.duration,s=void 0===a?.2:a;return f(this,e),b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,{timing:i,delay:o,duration:s}))}return _(e,ii),p(e,[{key:"show",value:function(t,e){e()}},{key:"hide",value:function(t,e){e()}},{key:"_animate",value:function(t,e){var n=e.from,i=e.to,r=e.options,o=e.callback,a=e.restore,s=void 0!==a&&a,u=e.animation;return r=G.extend({},this.options,r),u&&(n=u.from,i=u.to),u=K(t),s&&(u=u.saveStyle()),u=u.queue(n).wait(this.delay).queue({css:i,duration:this.duration,timing:this.timing}),s&&(u=u.restoreStyle()),o&&(u=u.queue(function(t){o(),t()})),u}},{key:"_animateAll",value:function(t,e){var n=this;Object.keys(e).forEach(function(i){return n._animate(t[i],e[i]).play()})}}]),e}(),zr={out:{from:{opacity:1},to:{opacity:0}},in:{from:{opacity:0},to:{opacity:1}}},Fr=function(t){function e(){return f(this,e),b(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return _(e,Rr),p(e,[{key:"show",value:function(t,e){this._animateAll(t,{_mask:zr.in,_popover:{animation:zr.in,restore:!0,callback:e}})}},{key:"hide",value:function(t,e){this._animateAll(t,{_mask:zr.out,_popover:{animation:zr.out,restore:!0,callback:e}})}}]),e}(),Vr=function(t){function e(){return f(this,e),b(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return _(e,Fr),p(e,[{key:"show",value:function(t,e){this._animateAll(t,{_mask:zr.in,_popover:{from:{transform:"scale3d(1.3, 1.3, 1.0)",opacity:0},to:{transform:"scale3d(1.0, 1.0,  1.0)",opacity:1},restore:!0,callback:e}})}}]),e}(),Wr={};Wr.isIPhoneXPortraitPatchActive=function(){return null!=document.documentElement.getAttribute("onsflag-iphonex-portrait")&&window.innerWidth<window.innerHeight},Wr.isIPhoneXLandscapePatchActive=function(){return null!=document.documentElement.getAttribute("onsflag-iphonex-landscape")&&window.innerWidth>=window.innerHeight},Wr.getSafeAreaLengths=function(){return Wr.isIPhoneXPortraitPatchActive()?{top:44,right:0,bottom:34,left:0}:Wr.isIPhoneXLandscapePatchActive()?{top:0,right:44,bottom:21,left:44}:{top:0,right:0,bottom:0,left:0}},Wr.getSafeAreaDOMRect=function(){var t=void 0;return t=Wr.isIPhoneXPortraitPatchActive()?{x:0,y:44,width:window.innerWidth,height:window.innerHeight-78}:Wr.isIPhoneXLandscapePatchActive()?{x:44,y:0,width:window.innerWidth-88,height:window.innerHeight-21}:{x:0,y:0,width:window.innerWidth,height:window.innerHeight},g({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})};var Xr={".popover":"popover--*",".popover-mask":"popover-mask--*",".popover__content":"popover--*__content",".popover__arrow":"popover--*__arrow"},Ur={default:function(){return w.isAndroid()?Fr:Vr},none:Rr,"fade-ios":Vr,"fade-md":Fr},Yr={up:"bottom",left:"right",down:"top",right:"left"},Gr=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t._boundOnChange=t._onChange.bind(t),n(t,function(){t._compile(),t.style.display="none"}),t}return _(e,si),p(e,[{key:"_updateAnimatorFactory",value:function(){return new A({animators:Ur,baseClass:Rr,baseClassName:"PopoverAnimator",defaultAnimation:this.getAttribute("animation")||"default"})}},{key:"_toggleStyle",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t?(this.style.display="block",this._currentTarget=e.target,this._positionPopover(e.target)):(this.style.display="none",this._clearStyles())}},{key:"_positionPopover",value:function(t){var e=this._radius,n=this._content,i=this._margin,r=Wr.getSafeAreaLengths(),o=Wr.getSafeAreaDOMRect(),a=t.getBoundingClientRect(),s=G.hasModifier(this,"material"),u=s&&this.hasAttribute("cover-target"),l={top:a.top-(o.top+i),left:a.left-(o.left+i),bottom:o.bottom-i-a.bottom,right:o.right-i-a.right},c={top:a.top+Math.round(a.height/2)-(o.top+i),left:a.left+Math.round(a.width/2)-(o.left+i),bottom:o.bottom-i-a.bottom+Math.round(a.height/2),right:o.right-i-a.right+Math.round(a.width/2)},h=this._calculateDirections(l),d=h.vertical,f=h.primary,p=h.secondary;this._currentDirection=f,G.addModifier(this,f);var m=d?"width":"height",g=function(t){return{width:parseInt(t.getPropertyValue("width"),10),height:parseInt(t.getPropertyValue("height"),10)}}(window.getComputedStyle(n)),v=u?0:(d?a.height:a.width)+(s?0:14),_=Math.max(r[f]+i,r[f]+i+l[f]+v),b=Math.max(r[p]+i,r[p]+i+c[p]-g[m]/2);this._popover.style[f]=_+"px",this._popover.style[p]=b+"px",this._arrow.style[p]=Math.max(e,r[p]+i+c[p]-b)+"px"}},{key:"_calculateDirections",value:function(t){var e=(this.getAttribute("direction")||"up down left right").split(/\s+/).map(function(t){return Yr[t]}).sort(function(e,n){return t[e]-t[n]})[0],n="top"==e||"bottom"==e,i=void 0;return i=n?t.left<t.right?"left":"right":t.top<t.bottom?"top":"bottom",{vertical:n,primary:e,secondary:i}}},{key:"_clearStyles",value:function(){var t=this;this._currentDirection=null,["top","bottom","left","right"].forEach(function(e){t._arrow.style[e]=t._content.style[e]=t._popover.style[e]="",G.removeModifier(t,e)})}},{key:"_onChange",value:function(){var t=this;setImmediate(function(){t._currentTarget&&t._positionPopover(t._currentTarget)})}},{key:"_compile",value:function(){if(D.prepare(this),!this._popover||!this._mask){if(this._popover&&this._content){if(!this._mask){var t=document.createElement("div");t.classList.add("popover-mask"),this.insertBefore(t,this.firstChild)}if(!this._arrow){var e=document.createElement("div");e.classList.add("popover__arrow"),this._popover.appendChild(e)}}else{for(var n=G.createFragment('\n        <div class="popover-mask"></div>\n        <div class="popover">\n          <div class="popover__content"></div>\n          <div class="popover__arrow"></div>\n        </div>\n      '),i=n.querySelector(".popover__content");this.childNodes[0];)i.appendChild(this.childNodes[0]);this.appendChild(n)}this.hasAttribute("style")&&(this._popover.setAttribute("style",this.getAttribute("style")),this.removeAttribute("style")),M.initModifier(this,this._scheme)}}},{key:"show",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"==typeof(n=!t||"object"!==(void 0===t?"undefined":d(t))||t instanceof Event||t instanceof HTMLElement?g({},n,{target:t}):g({},t)).target?n.target=document.querySelector(n.target):n.target instanceof Event&&(n.target=n.target.target),void 0===n.target)throw new Error("A target or options.target argument must be defined for the popover.");if(!(n.target instanceof HTMLElement))throw new Error("Invalid target for popover.");return v(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"show",this).call(this,n)}},{key:"connectedCallback",value:function(){var t=this;v(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"connectedCallback",this).call(this),window.addEventListener("resize",this._boundOnChange,!1),this._margin=this._margin||parseInt(window.getComputedStyle(this).getPropertyValue("top")),this._margin=this._margin||6,n(this,function(){t._radius=parseInt(window.getComputedStyle(t._content).getPropertyValue("border-top-left-radius"))})}},{key:"disconnectedCallback",value:function(){v(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"disconnectedCallback",this).call(this),window.removeEventListener("resize",this._boundOnChange,!1)}},{key:"attributeChangedCallback",value:function(t,n,i){if("direction"===t)return this._boundOnChange();"modifier"===t&&this._currentDirection&&G.addModifier(this,this._currentDirection),v(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"attributeChangedCallback",this).call(this,t,n,i)}},{key:"_scheme",get:function(){return Xr}},{key:"_mask",get:function(){return G.findChild(this,".popover-mask")}},{key:"_popover",get:function(){return G.findChild(this,".popover")}},{key:"_content",get:function(){return G.findChild(this._popover,".popover__content")}},{key:"_arrow",get:function(){return G.findChild(this._popover,".popover__arrow")}}],[{key:"registerAnimator",value:function(t,e){if(!(e.prototype instanceof Rr))throw new Error('"Animator" param must inherit PopoverAnimator');Ur[t]=e}},{key:"observedAttributes",get:function(){return[].concat(y(v(e.__proto__||Object.getPrototypeOf(e),"observedAttributes",this)),["direction"])}},{key:"animators",get:function(){return Ur}},{key:"PopoverAnimator",get:function(){return Rr}}]),e}();Mt.elements.Popover=Gr,customElements.define("ons-popover",Gr);var $r={".progress-bar":"progress-bar--*",".progress-bar__primary":"progress-bar--*__primary",".progress-bar__secondary":"progress-bar--*__secondary"},Kr=G.createElement('\n  <div class="progress-bar">\n    <div class="progress-bar__secondary"></div>\n    <div class="progress-bar__primary"></div>\n  </div>\n'),Qr="indeterminate",Jr=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n(t,function(){return t._compile()}),t}return _(e,ti),p(e,[{key:"_compile",value:function(){this._isCompiled()?this._template=G.findChild(this,".progress-bar"):this._template=Kr.cloneNode(!0),this._primary=G.findChild(this._template,".progress-bar__primary"),this._secondary=G.findChild(this._template,".progress-bar__secondary"),this._updateDeterminate(),this._updateValue(),this.appendChild(this._template),D.prepare(this),M.initModifier(this,$r)}},{key:"_isCompiled",value:function(){if(!G.findChild(this,".progress-bar"))return!1;var t=G.findChild(this,".progress-bar");return!!G.findChild(t,".progress-bar__secondary")&&!!G.findChild(t,".progress-bar__primary")}},{key:"attributeChangedCallback",value:function(t,e,n){"modifier"===t?(M.onModifierChanged(e,n,this,$r),this.hasAttribute(Qr)&&this._updateDeterminate()):"value"===t||"secondary-value"===t?this._updateValue():t===Qr&&this._updateDeterminate()}},{key:"_updateDeterminate",value:function(){var t=this;n(this,function(){return G.toggleModifier(t,Qr,{force:t.hasAttribute(Qr)})})}},{key:"_updateValue",value:function(){var t=this;n(this,function(){t._primary.style.width=t.hasAttribute("value")?t.getAttribute("value")+"%":"0%",t._secondary.style.width=t.hasAttribute("secondary-value")?t.getAttribute("secondary-value")+"%":"0%"})}},{key:"value",set:function(t){if("number"!=typeof t||t<0||t>100)throw new Error("Invalid value");this.setAttribute("value",Math.floor(t))},get:function(){return parseInt(this.getAttribute("value")||"0")}},{key:"secondaryValue",set:function(t){if("number"!=typeof t||t<0||t>100)throw new Error("Invalid value");this.setAttribute("secondary-value",Math.floor(t))},get:function(){return parseInt(this.getAttribute("secondary-value")||"0")}},{key:"indeterminate",set:function(t){t?this.setAttribute(Qr,""):this.removeAttribute(Qr)},get:function(){return this.hasAttribute(Qr)}}],[{key:"observedAttributes",get:function(){return["modifier","value","secondary-value",Qr]}}]),e}();Mt.elements.ProgressBar=Jr,customElements.define("ons-progress-bar",Jr);var Zr={".progress-circular":"progress-circular--*",".progress-circular__background":"progress-circular--*__background",".progress-circular__primary":"progress-circular--*__primary",".progress-circular__secondary":"progress-circular--*__secondary"},to=G.createElement('\n  <svg class="progress-circular">\n    <circle class="progress-circular__background" />\n    <circle class="progress-circular__secondary" />\n    <circle class="progress-circular__primary" />\n  </svg>\n'),eo="indeterminate",no=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n(t,function(){return t._compile()}),t}return _(e,ti),p(e,[{key:"attributeChangedCallback",value:function(t,e,n){"modifier"===t?(M.onModifierChanged(e,n,this,Zr),this.hasAttribute(eo)&&this._updateDeterminate()):"value"===t||"secondary-value"===t?this._updateValue():t===eo&&this._updateDeterminate()}},{key:"_updateDeterminate",value:function(){var t=this;n(this,function(){return G.toggleModifier(t,eo,{force:t.hasAttribute(eo)})})}},{key:"_updateValue",value:function(){var t=this;this.hasAttribute("value")&&n(this,function(){var e=Math.ceil(251.32*t.getAttribute("value")*.01);t._primary.style["stroke-dasharray"]=e+"%, 251.32%"}),this.hasAttribute("secondary-value")?n(this,function(){var e=Math.ceil(251.32*t.getAttribute("secondary-value")*.01);t._secondary.style.display=null,t._secondary.style["stroke-dasharray"]=e+"%, 251.32%"}):n(this,function(){t._secondary.style.display="none"})}},{key:"_compile",value:function(){this._isCompiled()?this._template=G.findChild(this,".progress-circular"):this._template=to.cloneNode(!0),this._primary=G.findChild(this._template,".progress-circular__primary"),this._secondary=G.findChild(this._template,".progress-circular__secondary"),this._updateDeterminate(),this._updateValue(),this.appendChild(this._template),D.prepare(this),M.initModifier(this,Zr)}},{key:"_isCompiled",value:function(){if(!G.findChild(this,".progress-circular"))return!1;var t=G.findChild(this,".progress-circular");return!!G.findChild(t,".progress-circular__secondary")&&!!G.findChild(t,".progress-circular__primary")}},{key:"value",set:function(t){if("number"!=typeof t||t<0||t>100)throw new Error("Invalid value");this.setAttribute("value",Math.floor(t))},get:function(){return parseInt(this.getAttribute("value")||"0")}},{key:"secondaryValue",set:function(t){if("number"!=typeof t||t<0||t>100)throw new Error("Invalid value");this.setAttribute("secondary-value",Math.floor(t))},get:function(){return parseInt(this.getAttribute("secondary-value")||"0")}},{key:"indeterminate",set:function(t){t?this.setAttribute(eo,""):this.removeAttribute(eo)},get:function(){return this.hasAttribute(eo)}}],[{key:"observedAttributes",get:function(){return["modifier","value","secondary-value",eo]}}]),e}();Mt.elements.ProgressCircular=no,customElements.define("ons-progress-circular",no);var io="initial",ro=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t._onDrag=t._onDrag.bind(t),t._onDragStart=t._onDragStart.bind(t),t._onDragEnd=t._onDragEnd.bind(t),t._onScroll=t._onScroll.bind(t),t._preventScroll=t._preventScroll.bind(t),t._setState(io,!0),t._hide(),t}return _(e,ti),p(e,[{key:"_setStyle",value:function(){var t=this.height+"px";h(this,{height:t,lineHeight:t}),""===this.style.display&&this._show()}},{key:"_onScroll",value:function(t){var e=this._pageElement;e.scrollTop<0&&(e.scrollTop=0)}},{key:"_canConsumeGesture",value:function(t){return"up"===t.direction||"down"===t.direction}},{key:"_onDragStart",value:function(t){var e=this;if(t.gesture&&!this.disabled){if(this._ignoreDrag=t.consumed,!this._ignoreDrag){var n=t.consume;t.consume=function(){n&&n(),e._ignoreDrag=!0,e._hide()},this._canConsumeGesture(t.gesture)&&(n&&n(),t.consumed=!0,this._show())}this._startScroll=this._pageElement.scrollTop}}},{key:"_onDrag",value:function(t){var e=this;if(t.gesture&&!this.disabled&&!this._ignoreDrag&&this._canConsumeGesture(t.gesture)){"none"===this.style.display&&this._show(),t.stopPropagation(),this._pageElement.scrollTop=this._startScroll-t.gesture.deltaY,this._pageElement.scrollTop<window.innerHeight&&"up"!==t.gesture.direction&&t.gesture.preventDefault();var n=Math.max(t.gesture.deltaY-this._startScroll,0);n!==this._currentTranslation&&(this._thresholdHeightEnabled()&&n>=this.thresholdHeight?(t.gesture.stopDetect(),setImmediate(function(){return e._finish()})):n>=this.height?this._setState("preaction"):this._setState(io),this._pulling=!0,this._translateTo(n))}}},{key:"_onDragEnd",value:function(t){if(this._pulling=!1,t.gesture&&!this.disabled&&!this._ignoreDrag&&(t.stopPropagation(),this._currentTranslation>0)){this._currentTranslation>this.height?this._finish():this._translateTo(0,{animate:!0})}}},{key:"_preventScroll",value:function(t){this._pulling&&t.cancelable&&t.preventDefault()}},{key:"_finish",value:function(){var t=this;this._setState("action"),this._translateTo(this.height,{animate:!0});(this.onAction||function(t){return t()})(function(){t._translateTo(0,{animate:!0}),t._setState(io)})}},{key:"_thresholdHeightEnabled",value:function(){var t=this.thresholdHeight;return t>0&&t>=this.height}},{key:"_setState",value:function(t,e){var n=this.state;this.setAttribute("state",t),e||n===this.state||G.triggerElementEvent(this,"changestate",{pullHook:this,state:t,lastState:n})}},{key:"_show",value:function(){var t=this;setImmediate(function(){t.style.display="",t._pageElement&&(t._pageElement.style.marginTop="-"+t.height+"px")})}},{key:"_hide",value:function(){this.style.display="none",this._pageElement&&(this._pageElement.style.marginTop="")}},{key:"_translateTo",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(0!=this._currentTranslation||0!=t){this._currentTranslation=t;var n=e.animate?{duration:.3,timing:"cubic-bezier(.1, .7, .1, 1)"}:{};this._onPull&&this._onPull((t/this.height).toFixed(2),n);var i=this.hasAttribute("fixed-content")?this:this._pageElement;K(i).queue({transform:"translate3d(0px, "+t+"px, 0px)"},n).play(function(){0===t&&h.clear(i,"transition transform"),e.callback instanceof Function&&e.callback()})}}},{key:"_disableDragLock",value:function(){this._dragLockDisabled=!0,this._setupListeners(!0)}},{key:"_setupListeners",value:function(t){var e=this,n=function(t){return e._pageElement[t+"EventListener"]("scroll",e._onScroll,!1)},i=function(t){e._gestureDetector[t]("drag",e._onDrag),e._gestureDetector[t]("dragstart",e._onDragStart),e._gestureDetector[t]("dragend",e._onDragEnd),e._gestureDetector[t]("touchmove",e._preventScroll)};this._gestureDetector&&(i("off"),this._gestureDetector.dispose(),this._gestureDetector=null),n("remove"),t&&(this._gestureDetector=new et(this._pageElement,{dragMinDistance:1,dragDistanceCorrection:!1,dragLockToAxis:!this._dragLockDisabled}),i("on"),n("add"))}},{key:"connectedCallback",value:function(){this._currentTranslation=0,this._pageElement=this.parentNode,this._setupListeners(!0),this._setStyle()}},{key:"disconnectedCallback",value:function(){this._hide(),this._setupListeners(!1)}},{key:"attributeChangedCallback",value:function(t,e,n){"height"===t&&this._pageElement&&this._setStyle()}},{key:"onAction",get:function(){return this._onAction},set:function(t){if(t&&!(t instanceof Function))throw new Error("'onAction' must be a function or null");this._onAction=t}},{key:"onPull",get:function(){return this._onPull},set:function(t){if(t&&!(t instanceof Function))throw new Error("'onPull' must be a function or null.");this._onPull=t}},{key:"height",set:function(t){if(!G.isInteger(t))throw new Error("The height must be an integer");this.setAttribute("height",t+"px")},get:function(){return parseInt(this.getAttribute("height")||"64",10)}},{key:"thresholdHeight",set:function(t){if(!G.isInteger(t))throw new Error("The threshold height must be an integer");this.setAttribute("threshold-height",t+"px")},get:function(){return parseInt(this.getAttribute("threshold-height")||"96",10)}},{key:"state",get:function(){return this.getAttribute("state")}},{key:"pullDistance",get:function(){return this._currentTranslation}},{key:"disabled",set:function(t){return G.toggleAttribute(this,"disabled",t)},get:function(){return this.hasAttribute("disabled")}}],[{key:"observedAttributes",get:function(){return["height"]}},{key:"events",get:function(){return["changestate"]}}]),e}();Mt.elements.PullHook=ro,customElements.define("ons-pull-hook",ro);var oo={"":"range--*",".range__input":"range--*__input",".range__focus-ring":"range--*__focus-ring"},ao=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t._boundOnMouseDown=t._onMouseDown.bind(t),t._boundOnMouseUp=t._onMouseUp.bind(t),t._boundOnTouchStart=t._onTouchStart.bind(t),t._boundOnTouchEnd=t._onTouchEnd.bind(t),t._boundOnInput=t._update.bind(t),t._boundOnDragstart=t._onDragstart.bind(t),t._boundOnDragend=t._onDragend.bind(t),t}return _(e,ar),p(e,[{key:"_compile",value:function(){v(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_compile",this).call(this),this._updateDisabled(this.hasAttribute("disabled"))}},{key:"_update",value:function(){var t=this._input,e=this._focusRing;t.style.backgroundSize=100*this._ratio+"% 2px",e.value=this.value,""===t.min&&"0"===t.value||t.min===t.value?t.setAttribute("_zero",""):t.removeAttribute("_zero"),["min","max"].forEach(function(n){return e[n]=t[n]})}},{key:"_onMouseDown",value:function(t){var e=this;this._input.classList.add("range__input--active"),setImmediate(function(){return e._input.focus()})}},{key:"_onTouchStart",value:function(t){this._onMouseDown()}},{key:"_onMouseUp",value:function(t){this._input.classList.remove("range__input--active")}},{key:"_onTouchEnd",value:function(t){this._onMouseUp(t)}},{key:"_onDragstart",value:function(t){t.consumed=!0,t.gesture.stopPropagation(),this._input.classList.add("range__input--active"),this.addEventListener("drag",this._onDrag)}},{key:"_onDrag",value:function(t){t.stopPropagation()}},{key:"_onDragend",value:function(t){this._input.classList.remove("range__input--active"),this.removeEventListener("drag",this._onDrag)}},{key:"attributeChangedCallback",value:function(t,n,i){"disabled"===t&&this._updateDisabled(i),v(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"attributeChangedCallback",this).call(this,t,n,i)}},{key:"_updateDisabled",value:function(t){t?this.classList.add("range--disabled"):this.classList.remove("range--disabled")}},{key:"connectedCallback",value:function(){this.addEventListener("mousedown",this._boundOnMouseDown),this.addEventListener("mouseup",this._boundOnMouseUp),this.addEventListener("touchstart",this._boundOnTouchStart),this.addEventListener("touchend",this._boundOnTouchEnd),this.addEventListener("dragstart",this._boundOnDragstart),this.addEventListener("dragend",this._boundOnDragend),this.addEventListener("input",this._boundOnInput)}},{key:"disconnectedCallback",value:function(){this.removeEventListener("mousedown",this._boundOnMouseDown),this.removeEventListener("mouseup",this._boundOnMouseUp),this.removeEventListener("touchstart",this._boundOnTouchStart),this.removeEventListener("touchend",this._boundOnTouchEnd),this.removeEventListener("dragstart",this._boundOnDragstart),this.removeEventListener("dragend",this._boundOnDragend),this.removeEventListener("input",this._boundOnInput)}},{key:"_scheme",get:function(){return oo}},{key:"_template",get:function(){return'\n      <input type="'+this.type+'" class="'+this._defaultClassName+'__input">\n      <input type="range" class="range__focus-ring" tabIndex="-1">\n    '}},{key:"_defaultClassName",get:function(){return"range"}},{key:"type",get:function(){return"range"}},{key:"_focusRing",get:function(){return this.children[1]}},{key:"_ratio",get:function(){var t=""===this._input.min?0:parseInt(this._input.min),e=""===this._input.max?100:parseInt(this._input.max);return(this.value-t)/(e-t)}}],[{key:"observedAttributes",get:function(){return["disabled"].concat(y(ar.observedAttributes))}}]),e}();Mt.elements.Range=ao,customElements.define("ons-range",ao);var so=function(){function t(){f(this,t),this._queue=[],this._index=0}return p(t,[{key:"animate",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,i=(new Date).getTime(),r={},o=!1,a=!1,s=!1,u=Object.keys(e),l={stop:function(){var c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s&&clearTimeout(s);var h=Math.min(1,((new Date).getTime()-i)/n);return u.forEach(function(n){t.style[n]=(1-h)*r[n]+h*e[n]+("opacity"==n?"":"px")}),t.style.transitionDuration="0s",c.stopNext?a=!1:o||(o=!0,a&&a()),l},then:function(t){return a=t,o&&a&&a(),l},speed:function(a){if(C.config.animationsDisabled&&(a=0),!o){s&&clearTimeout(s);var c=((new Date).getTime()-i)/n,h=a*(1-c);u.forEach(function(n){t.style[n]=(1-c)*r[n]+c*e[n]+("opacity"==n?"":"px")}),function(){var e=window.getComputedStyle(t);u.forEach(e.getPropertyValue.bind(e)),e=t.offsetHeight}(),i=t.speedUpTime,n=h,t.style.transitionDuration=n/1e3+"s",u.forEach(function(n){t.style[n]=e[n]+("opacity"==n?"":"px")}),s=setTimeout(l.stop,h)}return l},finish:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,e=((new Date).getTime()-i)/n;return l.speed(t/(1-e)),l}};if(t.hasAttribute("disabled")||o||C.config.animationsDisabled)return l;var c=window.getComputedStyle(t);return u.forEach(function(t){var e=parseFloat(c.getPropertyValue(t));r[t]=isNaN(e)?0:e}),o||(t.style.transitionProperty=u.join(","),t.style.transitionDuration=n/1e3+"s",u.forEach(function(n){t.style[n]=e[n]+("opacity"==n?"":"px")})),s=setTimeout(l.stop,n),this._onStopAnimations(t,l.stop),l}}]),p(t,[{key:"_onStopAnimations",value:function(t,e){var n=this._queue,i=this._index++;n[t]=n[t]||[],n[t][i]=function(r){return delete n[t][i],n[t]&&0==n[t].length&&delete n[t],e(r)}}},{key:"stopAnimations",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Array.isArray(t))return t.forEach(function(t){e.stopAnimations(t,n)});(this._queue[t]||[]).forEach(function(t){t(n||{})})}},{key:"stopAll",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.stopAnimations(Object.keys(this._queue),t)}},{key:"fade",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200;return this.animate(t,{opacity:0},e)}}]),t}(),uo={"":"ripple--*",".ripple__wave":"ripple--*__wave",".ripple__background":"ripple--*__background"},lo=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n(t,function(){return t._compile()}),t._animator=new so,["color","center","start-radius","background","modifier"].forEach(function(e){t.attributeChangedCallback(e,null,t.getAttribute(e))}),t}return _(e,ti),p(e,[{key:"_compile",value:function(){this.classList.add("ripple"),this._wave=this.getElementsByClassName("ripple__wave")[0],this._background=this.getElementsByClassName("ripple__background")[0],this._background&&this._wave||(this._wave=G.create(".ripple__wave"),this._background=G.create(".ripple__background"),this.appendChild(this._wave),this.appendChild(this._background)),M.initModifier(this,uo)}},{key:"_getEffectSize",value:function(){if(this.hasAttribute("size")){var t=this.getAttribute("size");if(-1!==["cover","contain"].indexOf(t))return t}return"cover"}},{key:"_calculateCoords",value:function(t){var e=void 0,n=void 0,i=void 0,r=void 0,o=void 0,a=this.getBoundingClientRect(),s=this._getEffectSize();if(this._center)if(e=a.width/2,n=a.height/2,"cover"===s)o=Math.sqrt(e*e+n*n);else{if("contain"!==s)throw Error("Invalid state. If this errors is shown, leport to GitHub issues.");o=Math.min(e,n)}else if(e=("number"==typeof t.clientX?t.clientX:t.changedTouches[0].clientX)-a.left,n=("number"==typeof t.clientY?t.clientY:t.changedTouches[0].clientY)-a.top,i=Math.max(n,a.height-n),r=Math.max(e,a.width-e),"cover"===s)o=Math.sqrt(i*i+r*r);else{if("contain"!==s)throw Error("Invalid state. If this errors is shown, leport to GitHub issues.");o=Math.min(Math.round(i/2),Math.round(r/2))}return{x:e,y:n,r:o}}},{key:"_rippleAnimation",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300,n=this._animator,i=this._wave,r=this._background,o=this._minR,a=this._calculateCoords(t),s=a.x,u=a.y,l=a.r;return n.stopAll({stopNext:1}),n.animate(r,{opacity:1},e),G.extend(i.style,{opacity:1,top:u-o+"px",left:s-o+"px",width:2*o+"px",height:2*o+"px"}),n.animate(i,{top:u-l,left:s-l,height:2*l,width:2*l},e)}},{key:"_updateParent",value:function(){if(!this._parentUpdated&&this.parentNode){"static"===window.getComputedStyle(this.parentNode).getPropertyValue("position")&&(this.parentNode.style.position="relative"),this._parentUpdated=!0}}},{key:"_onTap",value:function(t){var e=this;this.disabled||(this._updateParent(),this._rippleAnimation(t.gesture.srcEvent).then(function(){e._animator.fade(e._wave),e._animator.fade(e._background)}))}},{key:"_onHold",value:function(t){this.disabled||(this._updateParent(),this._holding=this._rippleAnimation(t.gesture.srcEvent,2e3),document.addEventListener("release",this._boundOnRelease))}},{key:"_onRelease",value:function(t){var e=this;this._holding&&(this._holding.speed(300).then(function(){e._animator.stopAll({stopNext:!0}),e._animator.fade(e._wave),e._animator.fade(e._background)}),this._holding=!1),document.removeEventListener("release",this._boundOnRelease)}},{key:"_onDragStart",value:function(t){if(this._holding)return this._onRelease(t);-1!=["left","right"].indexOf(t.gesture.direction)&&this._onTap(t)}},{key:"connectedCallback",value:function(){this._parentNode=this.parentNode,this._boundOnTap=this._onTap.bind(this),this._boundOnHold=this._onHold.bind(this),this._boundOnDragStart=this._onDragStart.bind(this),this._boundOnRelease=this._onRelease.bind(this),C.config.animationsDisabled?this.disabled=!0:(this._parentNode.addEventListener("tap",this._boundOnTap),this._parentNode.addEventListener("hold",this._boundOnHold),this._parentNode.addEventListener("dragstart",this._boundOnDragStart))}},{key:"disconnectedCallback",value:function(){var t=this._parentNode||this.parentNode;t.removeEventListener("tap",this._boundOnTap),t.removeEventListener("hold",this._boundOnHold),t.removeEventListener("dragstart",this._boundOnDragStart)}},{key:"attributeChangedCallback",value:function(t,e,i){var r=this;switch(t){case"class":G.restoreClass(this,"ripple",uo);break;case"modifier":M.onModifierChanged(e,i,this,uo);break;case"start-radius":this._minR=Math.max(0,parseFloat(i)||0);break;case"color":i&&n(this,function(){r._wave.style.background=i,r.hasAttribute("background")||(r._background.style.background=i)});break;case"background":(i||e)&&("none"===i?n(this,function(){r._background.setAttribute("disabled","disabled"),r._background.style.background="transparent"}):n(this,function(){r._background.hasAttribute("disabled")&&r._background.removeAttribute("disabled"),r._background.style.background=i}));break;case"center":"center"===t&&(this._center=null!=i&&"false"!=i)}}},{key:"disabled",set:function(t){return G.toggleAttribute(this,"disabled",t)},get:function(){return this.hasAttribute("disabled")}}],[{key:"observedAttributes",get:function(){return["start-radius","color","background","center","class","modifier"]}}]),e}();Mt.elements.Ripple=lo,customElements.define("ons-ripple",lo);var co=function(t){function e(){return f(this,e),b(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return _(e,ti),e}();Mt.elements.Row=co,customElements.define("ons-row",co);var ho={"":"segment--*",".segment__item":"segment--*__item",".segment__input":"segment--*__input",".segment__button":"segment--*__button"},fo=function(){var t=0;return function(){return"ons-segment-gen-"+t++}}(),po=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t._segmentId=fo(),t._tabbar=null,t._onChange=t._onChange.bind(t),t._onTabbarPreChange=t._onTabbarPreChange.bind(t),n(t,function(){t._compile(),setImmediate(function(){return t._lastActiveIndex=t._tabbar?t._tabbar.getActiveTabIndex():t.getActiveButtonIndex()})}),t}return _(e,ti),p(e,[{key:"_compile",value:function(){D.prepare(this),this.classList.add("segment");for(var t=this.children.length-1;t>=0;t--){var e=this.children[t];e.classList.add("segment__item");var n=G.findChild(e,".segment__input")||G.create("input.segment__input");n.type="radio",n.value=t,n.name=n.name||this._segmentId,n.checked=!this.hasAttribute("tabbar-id")&&t===(parseInt(this.getAttribute("active-index"))||0);var i=G.findChild(e,".segment__button")||G.create(".segment__button");if(i.parentElement!==e)for(;e.firstChild;)i.appendChild(e.firstChild);e.appendChild(n),e.appendChild(i)}M.initModifier(this,ho)}},{key:"connectedCallback",value:function(){var t=this;this.hasAttribute("tabbar-id")&&n(this,function(){var e=G.findParent(t,"ons-page");if(t._tabbar=e&&e.querySelector("#"+t.getAttribute("tabbar-id")),!t._tabbar||"ONS-TABBAR"!==t._tabbar.tagName)throw new Error("<ons-segment> error: no tabbar with id "+t.getAttribute("tabbar-id")+" was found.");t._tabbar.setAttribute("hide-tabs",""),setImmediate(function(){return t._setChecked(t._tabbar.getActiveTabIndex())}),t._tabbar.addEventListener("prechange",t._onTabbarPreChange)}),this.addEventListener("change",this._onChange)}},{key:"disconnectedCallback",value:function(){var t=this;n(this,function(){t._tabbar&&(t._tabbar.removeEventListener("prechange",t._onTabbarPreChange),t._tabbar=null)}),this.removeEventListener("change",this._onChange)}},{key:"_setChecked",value:function(t){this.children[t].firstElementChild.checked=!0}},{key:"setActiveButton",value:function(t,e){return this._tabbar?this._tabbar.setActiveTab(t,e):(this._setChecked(t),this._postChange(t),Promise.resolve(t))}},{key:"getActiveButtonIndex",value:function(){for(var t=this.children.length-1;t>=0;t--)if(this.children[t].firstElementChild.checked)return t;return-1}},{key:"_onChange",value:function(t){t.stopPropagation(),this._tabbar?this._tabbar.setActiveTab(this.getActiveButtonIndex(),{reject:!1}):this._postChange(this.getActiveButtonIndex())}},{key:"_onTabbarPreChange",value:function(t){var e=this;setImmediate(function(){t.detail.canceled||(e._setChecked(t.index),e._postChange(t.index))})}},{key:"_postChange",value:function(t){G.triggerElementEvent(this,"postchange",{index:t,activeIndex:t,lastActiveIndex:this._lastActiveIndex,segmentItem:this.children[t]}),this._lastActiveIndex=t}},{key:"attributeChangedCallback",value:function(t,e,n){switch(t){case"class":G.restoreClass(this,"segment",ho);break;case"modifier":M.onModifierChanged(e,n,this,ho)}}},{key:"disabled",set:function(t){return G.toggleAttribute(this,"disabled",t)},get:function(){return this.hasAttribute("disabled")}}],[{key:"observedAttributes",get:function(){return["class","modifier"]}},{key:"events",get:function(){return["postchange"]}}]),e}();Mt.elements.Segment=po,customElements.define("ons-segment",po);var mo={"":"select-*",".select-input":"select-input--*"},go=["autofocus","disabled","form","multiple","name","required","size"],vo=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n(t,function(){return t._compile()}),t._deriveGetters(),t}return _(e,ti),p(e,[{key:"attributeChangedCallback",value:function(t,e,i){var r=this;switch(t){case"class":G.restoreClass(this,"select",mo);break;case"modifier":M.onModifierChanged(e,i,this,mo)}go.indexOf(t)>=0&&n(this,function(){return r._updateBoundAttributes()})}},{key:"_updateBoundAttributes",value:function(){var t=this;go.forEach(function(e){t.hasAttribute(e)?t._select.setAttribute(e,t.getAttribute(e)):t._select.removeAttribute(e)})}},{key:"_compile",value:function(){D.prepare(this),this.classList.add("select");var t=this._select||document.createElement("select");!t.id&&this.hasAttribute("select-id")&&(t.id=this.getAttribute("select-id")),t.classList.add("select-input"),this._select||(G.arrayFrom(this.childNodes).forEach(function(e){return t.appendChild(e)}),this.appendChild(t)),M.initModifier(this,mo)}},{key:"_deriveGetters",value:function(){var t=this;["disabled","length","multiple","name","options","selectedIndex","size","value","form","type"].forEach(function(e){Object.defineProperty(t,e,{enumerable:!0,get:function(){return t._select[e]},set:-1===["form","type"].indexOf(e)?function(n){return t._select[e]=n}:void 0})})}},{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this._select.add(t,e)}},{key:"remove",value:function(t){this._select.remove(t)}},{key:"_select",get:function(){return this.querySelector("select")}}],[{key:"observedAttributes",get:function(){return["modifier","class"].concat(go)}}]),e}();Mt.elements.Select=vo,customElements.define("ons-select",vo);var _o={"":"fab--* speed-dial__item--*"},bo=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t._compile(),t._boundOnClick=t._onClick.bind(t),t}return _(e,ti),p(e,[{key:"attributeChangedCallback",value:function(t,e,n){switch(t){case"class":G.restoreClass(this,"fab fab--mini speed-dial__item",_o);break;case"modifier":M.onModifierChanged(e,n,this,_o),G.addModifier(this,"mini");break;case"ripple":this._updateRipple()}}},{key:"connectedCallback",value:function(){this.addEventListener("click",this._boundOnClick,!1)}},{key:"disconnectedCallback",value:function(){this.removeEventListener("click",this._boundOnClick,!1)}},{key:"_updateRipple",value:function(){G.updateRipple(this)}},{key:"_onClick",value:function(t){t.stopPropagation()}},{key:"_compile",value:function(){var t=this;D.prepare(this),"fab fab--mini speed-dial__item".split(/\s+/).forEach(function(e){return t.classList.add(e)}),G.addModifier(this,"mini"),this._updateRipple(),M.initModifier(this,_o)}}],[{key:"observedAttributes",get:function(){return["modifier","ripple","class"]}}]),e}();Mt.elements.SpeedDialItem=bo,customElements.define("ons-speed-dial-item",bo);var yo={"":"speed-dial--*"},ko=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n(t,function(){t._compile()}),t._itemShown=!1,t._boundOnClick=t._onClick.bind(t),t}return _(e,ti),p(e,[{key:"_compile",value:function(){this.classList.add("speed-dial"),D.prepare(this),this._updateRipple(),M.initModifier(this,yo),this.hasAttribute("direction")?this._updateDirection(this.getAttribute("direction")):this._updateDirection("up"),this._updatePosition()}},{key:"attributeChangedCallback",value:function(t,e,i){var r=this;switch(t){case"class":G.restoreClass(this,"speed-dial",yo);break;case"modifier":M.onModifierChanged(e,i,this,yo);break;case"ripple":n(this,function(){return r._updateRipple()});break;case"direction":n(this,function(){return r._updateDirection(i)});break;case"position":n(this,function(){return r._updatePosition()})}}},{key:"connectedCallback",value:function(){this.addEventListener("click",this._boundOnClick,!1)}},{key:"disconnectedCallback",value:function(){this.removeEventListener("click",this._boundOnClick,!1)}},{key:"_onClick",value:function(t){return this.onClick?(this.onClick.apply(this),Promise.resolve()):!this.disabled&&this.visible?this.toggleItems():void 0}},{key:"_show",value:function(){return this.inline?Promise.resolve():this.show()}},{key:"_hide",value:function(){var t=this;return new Promise(function(e){t.inline?e():setImmediate(function(){return t.hide().then(e)})})}},{key:"_updateRipple",value:function(){this._fab&&(this.hasAttribute("ripple")?this._fab.setAttribute("ripple",""):this._fab.removeAttribute("ripple"))}},{key:"_updateDirection",value:function(t){for(var e=this.items,n=0;n<e.length;n++)h(e[n],{transitionDelay:25*n+"ms",bottom:"auto",right:"auto",top:"auto",left:"auto"});switch(t){case"up":for(var i=0;i<e.length;i++)e[i].style.bottom=72+56*i+"px",e[i].style.right="8px";break;case"down":for(var r=0;r<e.length;r++)e[r].style.top=72+56*r+"px",e[r].style.left="8px";break;case"left":for(var o=0;o<e.length;o++)e[o].style.top="8px",e[o].style.right=72+56*o+"px";break;case"right":for(var a=0;a<e.length;a++)e[a].style.top="8px",e[a].style.left=72+56*a+"px";break;default:throw new Error("Argument must be one of up, down, left or right.")}}},{key:"_updatePosition",value:function(){var t=this.getAttribute("position");switch(this.classList.remove("fab--top__left","fab--bottom__right","fab--bottom__left","fab--top__right","fab--top__center","fab--bottom__center"),t){case"top right":case"right top":this.classList.add("fab--top__right");break;case"top left":case"left top":this.classList.add("fab--top__left");break;case"bottom right":case"right bottom":this.classList.add("fab--bottom__right");break;case"bottom left":case"left bottom":this.classList.add("fab--bottom__left");break;case"center top":case"top center":this.classList.add("fab--top__center");break;case"center bottom":case"bottom center":this.classList.add("fab--bottom__center")}}},{key:"_getTranslate",value:function(){return(this.getAttribute("position")||"").indexOf("bottom")>=0?"translate3d(0px, -"+(G.globals.fabOffset||0)+"px, 0px) ":""}},{key:"show",value:function(){return this._fab.show(),h(this,{transform:this._getTranslate}),Promise.resolve()}},{key:"hide",value:function(){var t=this;return this.hideItems().then(function(){return t._fab.hide()})}},{key:"showItems",value:function(){this.hasAttribute("direction")?this._updateDirection(this.getAttribute("direction")):this._updateDirection("up");var t=0;if(!this._itemShown){for(var e=this.items,n=0;n<e.length;n++){var i=25*n;t+=i,h(e[n],{transform:"scale(1)",transitionDelay:i+"ms"})}t+=50,this._itemShown=!0,G.triggerElementEvent(this,"open")}var r=G.defer();return setTimeout(r.resolve,t),r.promise}},{key:"hideItems",value:function(){var t=0;if(this._itemShown){for(var e=this.items,n=0;n<e.length;n++){var i=25*(e.length-n);t+=i,h(e[n],{transform:"scale(0)",transitionDelay:i+"ms"})}t+=50,this._itemShown=!1,G.triggerElementEvent(this,"close")}var r=G.defer();return setTimeout(r.resolve,t),r.promise}},{key:"isOpen",value:function(){return this._itemShown}},{key:"toggle",value:function(){return this.visible?this.hide():this.show()}},{key:"toggleItems",value:function(){return this.isOpen()?this.hideItems():this.showItems()}},{key:"items",get:function(){return G.arrayFrom(this.querySelectorAll("ons-speed-dial-item"))}},{key:"_fab",get:function(){return G.findChild(this,"ons-fab")}},{key:"disabled",set:function(t){return t&&this.hideItems(),G.arrayFrom(this.children).forEach(function(e){G.match(e,".fab")&&G.toggleAttribute(e,"disabled",t)}),G.toggleAttribute(this,"disabled",t)},get:function(){return this.hasAttribute("disabled")}},{key:"inline",get:function(){return this.hasAttribute("inline")}},{key:"visible",get:function(){return this._fab.visible&&"none"!==this.style.display}}],[{key:"observedAttributes",get:function(){return["class","modifier","ripple","direction","position"]}},{key:"events",get:function(){return["open","close"]}}]),e}();Mt.elements.SpeedDial=ko,customElements.define("ons-speed-dial",ko);var wo={ready:function(t,e){setImmediate(e)}},Eo=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t._page=null,t._pageLoader=Lt,n(t,function(){wo.ready(t,function(){var e=t._getPageTarget();e&&t.load(e)})}),t}return _(e,ti),p(e,[{key:"connectedCallback",value:function(){if(!G.match(this.parentNode,"ons-splitter"))throw new Error('"ons-splitter-content" must have "ons-splitter" as parentNode.')}},{key:"_getPageTarget",value:function(){return this._page||this.getAttribute("page")}},{key:"disconnectedCallback",value:function(){}},{key:"attributeChangedCallback",value:function(t,e,n){}},{key:"load",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._page=t;var i=n.callback||function(){};return new Promise(function(n){var r=e._content||null;e._pageLoader.load({page:t,parent:e},function(t){r&&(e._pageLoader.unload(r),r=null),setImmediate(function(){return e._show()}),i(t),n(t)})})}},{key:"_show",value:function(){this._content&&this._content._show()}},{key:"_hide",value:function(){this._content&&this._content._hide()}},{key:"_destroy",value:function(){this._content&&this._pageLoader.unload(this._content),this.remove()}},{key:"page",get:function(){return this._page},set:function(t){this._page=t}},{key:"_content",get:function(){return this.children[0]}},{key:"pageLoader",get:function(){return this._pageLoader},set:function(t){if(!(t instanceof Tt))throw Error("First parameter must be an instance of PageLoader");this._pageLoader=t}}],[{key:"observedAttributes",get:function(){return[]}},{key:"rewritables",get:function(){return wo}}]),e}();Mt.elements.SplitterContent=Eo,customElements.define("ons-splitter-content",Eo);var Co=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t._boundOnClick=t._onClick.bind(t),n(t,function(){t.parentNode._sides.every(function(t){return"split"===t.mode})&&t.setAttribute("style","display: none !important")}),t}return _(e,ti),p(e,[{key:"_onClick",value:function(t){this.onClick instanceof Function?this.onClick():G.match(this.parentNode,"ons-splitter")&&this.parentNode._sides.forEach(function(t){return t.close("left").catch(function(){})}),t.stopPropagation()}},{key:"_preventScroll",value:function(t){t.cancelable&&t.preventDefault()}},{key:"attributeChangedCallback",value:function(t,e,n){}},{key:"connectedCallback",value:function(){this.addEventListener("click",this._boundOnClick),this.addEventListener("touchmove",this._preventScroll)}},{key:"disconnectedCallback",value:function(){this.removeEventListener("click",this._boundOnClick),this.removeEventListener("touchmove",this._preventScroll)}}],[{key:"observedAttributes",get:function(){return[]}}]),e}();Mt.elements.SplitterMask=Co,customElements.define("ons-splitter-mask",Co);var Ao=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.timing,i=void 0===n?"cubic-bezier(.1, .7, .1, 1)":n,r=t.duration,o=void 0===r?.3:r,a=t.delay,s=void 0===a?0:a;return f(this,e),b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,{timing:i,duration:o,delay:s}))}return _(e,ii),p(e,[{key:"updateOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};G.extend(this,{timing:this.timing,duration:this.duration,delay:this.delay},t)}},{key:"activate",value:function(t){var e=this,i=t.parentNode;n(i,function(){e._side=t,e._oppositeSide=i.right!==t&&i.right||i.left!==t&&i.left,e._content=i.content,e._mask=i.mask})}},{key:"deactivate",value:function(){this.clearTransition(),this._mask&&this.clearMask(),this._content=this._side=this._oppositeSide=this._mask=null}},{key:"clearTransition",value:function(){var t=this;"side mask content".split(/\s+/).forEach(function(e){return t["_"+e]&&h.clear(t["_"+e],"transform transition")})}},{key:"clearMask",value:function(){this._oppositeSide&&"split"!==this._oppositeSide.mode&&this._oppositeSide.isOpen||(this._mask.style.opacity="",this._mask.style.display="none")}},{key:"translate",value:function(t){}},{key:"open",value:function(t){t()}},{key:"close",value:function(t){t()}},{key:"minus",get:function(){return"right"===this._side.side?"-":""}}]),e}(),So=function(t){function e(){return f(this,e),b(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return _(e,Ao),p(e,[{key:"translate",value:function(t){this._mask.style.display="block",K(this._side).queue({transform:"translate3d("+(this.minus+t)+"px, 0px, 0px)"}).play()}},{key:"open",value:function(t){K.runAll(K(this._side).wait(this.delay).queue({transform:"translate3d("+this.minus+"100%, 0px, 0px)"},{duration:this.duration,timing:this.timing}).queue(function(e){e(),t&&t()}),K(this._mask).wait(this.delay).queue({display:"block"}).queue({opacity:"1"},{duration:this.duration,timing:"linear"}))}},{key:"close",value:function(t){K.runAll(K(this._side).wait(this.delay).queue({transform:"translate3d(0px, 0px, 0px)"},{duration:this.duration,timing:this.timing}).queue(function(e){t&&t(),e()}),K(this._mask).wait(this.delay).queue({opacity:"0"},{duration:this.duration,timing:"linear"}).queue({display:"none"}))}}]),e}(),Oo={default:So,overlay:So,push:function(t){function e(){return f(this,e),b(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return _(e,Ao),p(e,[{key:"_getSlidingElements",value:function(){var t=[this._side,this._content];return this._oppositeSide&&"split"===this._oppositeSide.mode&&t.push(this._oppositeSide),t}},{key:"translate",value:function(t){this._slidingElements||(this._slidingElements=this._getSlidingElements()),this._mask.style.display="block",K(this._slidingElements).queue({transform:"translate3d("+(this.minus+t)+"px, 0px, 0px)"}).play()}},{key:"open",value:function(t){var e=this,n=this._side.offsetWidth;this._slidingElements=this._getSlidingElements(),K.runAll(K(this._slidingElements).wait(this.delay).queue({transform:"translate3d("+(this.minus+n)+"px, 0px, 0px)"},{duration:this.duration,timing:this.timing}).queue(function(n){e._slidingElements=null,n(),t&&t()}),K(this._mask).wait(this.delay).queue({display:"block"}))}},{key:"close",value:function(t){var n=this;this._slidingElements=this._getSlidingElements(),K.runAll(K(this._slidingElements).wait(this.delay).queue({transform:"translate3d(0px, 0px, 0px)"},{duration:this.duration,timing:this.timing}).queue(function(i){n._slidingElements=null,v(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"clearTransition",n).call(n),t&&t(),i()}),K(this._mask).wait(this.delay).queue({display:"none"}))}}]),e}(),reveal:function(t){function e(){return f(this,e),b(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return _(e,Ao),p(e,[{key:"_getSlidingElements",value:function(){var t=[this._content,this._mask];return this._oppositeSide&&"split"===this._oppositeSide.mode&&t.push(this._oppositeSide),t}},{key:"activate",value:function(t){v(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"activate",this).call(this,t),this.maxWidth=this._getMaxWidth(),"collapse"===t.mode&&this._setStyles(t)}},{key:"deactivate",value:function(){this._side&&this._unsetStyles(this._side),v(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"deactivate",this).call(this)}},{key:"_setStyles",value:function(t){h(t,{left:"right"===t.side?"auto":0,right:"right"===t.side?0:"auto",zIndex:0,backgroundColor:"black",transform:this._generateBehindPageStyle(0).container.transform,display:"none"});var e=t.parentElement;n(e,function(){return e.content&&h(e.content,{boxShadow:"0 0 12px 0 rgba(0, 0, 0, 0.2)"})})}},{key:"_unsetStyles",value:function(t){h.clear(t,"left right zIndex backgroundColor display"),t._content&&(t._content.style.opacity=""),this._oppositeSide&&"split"!==this._oppositeSide.mode||t.parentElement.content&&h.clear(t.parentElement.content,"boxShadow")}},{key:"_generateBehindPageStyle",value:function(t){var e=this.maxWidth,n=(t-e)/e*10;return{content:{opacity:1+(n=isNaN(n)?0:Math.max(Math.min(n,0),-10))/100},container:{transform:"translate3d("+(this.minus?-1:1)*n+"%, 0, 0)"}}}},{key:"translate",value:function(t){this._side.style.display="",this._side.style.zIndex=1,this.maxWidth=this.maxWidth||this._getMaxWidth();var e=this._generateBehindPageStyle(Math.min(t,this.maxWidth));this._slidingElements||(this._slidingElements=this._getSlidingElements()),this._mask.style.display="block",K.runAll(K(this._slidingElements).queue({transform:"translate3d("+(this.minus+t)+"px, 0px, 0px)"}),K(this._side._content).queue(e.content),K(this._side).queue(e.container))}},{key:"open",value:function(t){var e=this;this._side.style.display="",this._side.style.zIndex=1,this.maxWidth=this.maxWidth||this._getMaxWidth();var n=this._generateBehindPageStyle(this.maxWidth);this._slidingElements=this._getSlidingElements(),setTimeout(function(){K.runAll(K(e._slidingElements).wait(e.delay).queue({transform:"translate3d("+(e.minus+e.maxWidth)+"px, 0px, 0px)"},{duration:e.duration,timing:e.timing}),K(e._mask).wait(e.delay).queue({display:"block"}),K(e._side._content).wait(e.delay).queue(n.content,{duration:e.duration,timing:e.timing}),K(e._side).wait(e.delay).queue(n.container,{duration:e.duration,timing:e.timing}).queue(function(n){e._slidingElements=null,n(),t&&t()}))},0)}},{key:"close",value:function(t){var e=this,n=this._generateBehindPageStyle(0);this._slidingElements=this._getSlidingElements(),K.runAll(K(this._slidingElements).wait(this.delay).queue({transform:"translate3d(0px, 0px, 0px)"},{duration:this.duration,timing:this.timing}),K(this._mask).wait(this.delay).queue({display:"none"}),K(this._side._content).wait(this.delay).queue(n.content,{duration:this.duration,timing:this.timing}),K(this._side).wait(this.delay).queue(n.container,{duration:this.duration,timing:this.timing}).queue(function(n){e._slidingElements=null,e._side.style.zIndex=0,e._side.style.display="none",e._side._content.style.opacity="",t&&t(),n()}))}},{key:"_getMaxWidth",value:function(){return this._side.offsetWidth}}]),e}()},Po=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t._onModeChange=t._onModeChange.bind(t),n(t,function(){!t.mask&&t.appendChild(document.createElement("ons-splitter-mask")),t._layout()}),t}return _(e,ti),p(e,[{key:"_getSide",value:function(t){return G.findChild(this,function(e){return G.match(e,"ons-splitter-side")&&e.getAttribute("side")===t})}},{key:"_onDeviceBackButton",value:function(t){this._sides.some(function(t){return!!t.isOpen&&t.close()})||t.callParentHandler()}},{key:"_onModeChange",value:function(t){var e=this;t.target.parentNode&&n(this,function(){e._layout()})}},{key:"_layout",value:function(){var t=this;this._sides.forEach(function(e){t.content&&(t.content.style[e.side]="split"===e.mode?e.style.width:0)})}},{key:"left",get:function(){return this._getSide("left")}},{key:"right",get:function(){return this._getSide("right")}},{key:"side",get:function(){return G.findChild(this,"ons-splitter-side")}},{key:"_sides",get:function(){return[this.left,this.right].filter(function(t){return t})}},{key:"content",get:function(){return G.findChild(this,"ons-splitter-content")}},{key:"topPage",get:function(){return this.content._content}},{key:"mask",get:function(){return G.findChild(this,"ons-splitter-mask")}},{key:"onDeviceBackButton",get:function(){return this._backButtonHandler},set:function(t){this._backButtonHandler&&this._backButtonHandler.destroy(),this._backButtonHandler=q.createHandler(this,t)}}]),p(e,[{key:"connectedCallback",value:function(){this.onDeviceBackButton=this._onDeviceBackButton.bind(this),this.addEventListener("modechange",this._onModeChange,!1)}},{key:"disconnectedCallback",value:function(){this._backButtonHandler.destroy(),this._backButtonHandler=null,this.removeEventListener("modechange",this._onModeChange,!1)}},{key:"attributeChangedCallback",value:function(t,e,n){}},{key:"_show",value:function(){G.propagateAction(this,"_show")}},{key:"_hide",value:function(){G.propagateAction(this,"_hide")}},{key:"_destroy",value:function(){G.propagateAction(this,"_destroy"),this.remove()}}],[{key:"registerAnimator",value:function(t,e){if(!(e instanceof SplitterAnimator))throw new Error("Animator parameter must be an instance of SplitterAnimator.");Oo[t]=e}},{key:"SplitterAnimator",get:function(){return SplitterAnimator}},{key:"animators",get:function(){return Oo}}]),e}();Mt.elements.Splitter=Po,customElements.define("ons-splitter",Po);var xo="closed",To={ready:function(t,e){setImmediate(e)}},Lo=function(){function t(e,n){f(this,t),this._element=e,this._onChange=this._onChange.bind(this),n&&this.changeTarget(n)}return p(t,[{key:"changeTarget",value:function(t){this.disable(),this._target=t,t&&(this._orientation=-1!==["portrait","landscape"].indexOf(t),this.activate())}},{key:"_match",value:function(t){return this._orientation?this._target===(t.isPortrait?"portrait":"landscape"):t.matches}},{key:"_onChange",value:function(t){this._element._updateMode(this._match(t)?"collapse":"split")}},{key:"activate",value:function(){this._orientation?(wt.on("change",this._onChange),this._onChange({isPortrait:wt.isPortrait()})):(this._queryResult=window.matchMedia(this._target),this._queryResult.addListener(this._onChange),this._onChange(this._queryResult))}},{key:"disable",value:function(){this._orientation?wt.off("change",this._onChange):this._queryResult&&(this._queryResult.removeListener(this._onChange),this._queryResult=null)}}]),t}(),Do=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t._page=null,t._state=xo,t._lock=new xt,t._pageLoader=Lt,t._collapseDetection=new Lo(t),t._animatorFactory=new A({animators:Po.animators,baseClass:Ao,baseClassName:"SplitterAnimator",defaultAnimation:t.getAttribute("animation")}),n(t,function(){t.attributeChangedCallback("width"),t.hasAttribute("side")||t.setAttribute("side","left"),To.ready(t,function(){var e=t._page||t.getAttribute("page");e&&t.load(e)})}),t}return _(e,ti),p(e,[{key:"connectedCallback",value:function(){var t=this;if(!G.match(this.parentNode,"ons-splitter"))throw new Error("Parent must be an ons-splitter element.");this._swipe=new wr({element:this,elementHandler:this.parentElement,swipeMax:this.open.bind(this),swipeMid:function(e){return t._animator.translate(e)},swipeMin:this.close.bind(this),getThreshold:function(){return Math.max(0,Math.min(1,parseFloat(t.getAttribute("open-threshold"))||.3))},getSide:function(){return t.side},isInitialState:function(){var e=t._state===xo;return t._state="changing",e},ignoreSwipe:function(e,n){var i=t.isOpen,r=Math.max(0,parseInt(t.getAttribute("swipe-target-width"),10)||0);return"split"===t._mode||t._lock.isLocked()||t._isOtherSideOpen()||!function(e){return"left"===t.side?"left"===e&&i||"right"===e&&!i:"left"===e&&!i||"right"===e&&i}(e.gesture.direction)||!i&&0!==r&&n>r}}),this.attributeChangedCallback("swipeable"),n(this,function(){t.constructor.observedAttributes.forEach(function(e){return t.attributeChangedCallback(e,null,t.getAttribute(e))})})}},{key:"disconnectedCallback",value:function(){this._swipe&&this._swipe.dispose(),this._animator=this._swipe=null}},{key:"attributeChangedCallback",value:function(t,e,n){switch(t){case"swipeable":this._swipe&&this._swipe.update();break;case"width":this.style.width=/^\d+(px|%)$/.test(n)?n:"80%";break;default:this[G.camelize("_update-"+t)](n)}}},{key:"_emitEvent",value:function(t){if("pre"!==t.slice(0,3))return G.triggerElementEvent(this,t,{side:this});var e=!1;return G.triggerElementEvent(this,t,{side:this,cancel:function(){return e=!0}}),e}},{key:"_isOtherSideOpen",value:function(){var t=this;return!!G.findChild(this.parentElement,function(e){return e instanceof t.constructor&&e!==t&&"collapse"===e._mode&&e.isOpen})}},{key:"_updateCollapse",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getAttribute("collapse");return null===t||"split"===t?(this._collapseDetection.disable(),this._updateMode("split")):""===t||"collapse"===t?(this._collapseDetection.disable(),this._updateMode("collapse")):void this._collapseDetection.changeTarget(t)}},{key:"_updateMode",value:function(t){t!==this._mode&&(this._mode=t,this.setAttribute("mode",t),"split"===t?(this._animator&&this._animator.deactivate(),this._state=xo):(this._animator&&this._animator.activate(this),"open"===this._state&&this._animator.open()),G.triggerElementEvent(this,"modechange",{side:this,mode:t}))}},{key:"_updateAnimation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getAttribute("animation");this._animator&&this._animator.deactivate(),this._animator=this._animatorFactory.newAnimator({animation:t}),this._animator.activate(this)}},{key:"_updateAnimationOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getAttribute("animation-options");this._animator.updateOptions(A.parseAnimationOptionsString(t))}},{key:"open",value:function(t){return this.toggle(t,!0)}},{key:"close",value:function(t){return this.toggle(t,!1)}},{key:"toggle",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments[1],i="boolean"==typeof n?n:!this.isOpen,r=i?"open":"close",o=i?"open":xo;if("split"===this._mode)return Promise.resolve(!1);if(this._state===o)return Promise.resolve(this);if(this._lock.isLocked())return Promise.reject("Another splitter-side action is already running.");if(i&&this._isOtherSideOpen())return Promise.reject("Another menu is already open.");if(this._emitEvent("pre"+r))return Promise.reject("Canceled in pre"+r+" event.");var a=this._lock.lock();return this._state="changing",new Promise(function(n){t._animator[r](function(){t._state=o,a(),t._emitEvent("post"+r),e.callback instanceof Function&&e.callback(t),n(t)})})}},{key:"load",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._page=t;var i=n.callback||function(){};return new Promise(function(n){var r=e._content||null;e._pageLoader.load({page:t,parent:e},function(t){r&&(e._pageLoader.unload(r),r=null),setImmediate(function(){return e._show()}),i(t),n(t)})})}},{key:"_show",value:function(){this._content&&this._content._show()}},{key:"_hide",value:function(){this._content&&this._content._hide()}},{key:"_destroy",value:function(){this._content&&this._pageLoader.unload(this._content),this.remove()}},{key:"side",get:function(){return"right"===this.getAttribute("side")?"right":"left"}},{key:"page",get:function(){return this._page},set:function(t){this._page=t}},{key:"_content",get:function(){return this.children[0]}},{key:"pageLoader",get:function(){return this._pageLoader},set:function(t){if(!(t instanceof Tt))throw Error("First parameter must be an instance of PageLoader.");this._pageLoader=t}},{key:"mode",get:function(){return this._mode}},{key:"isOpen",get:function(){return"collapse"===this._mode&&this._state!==xo}}],[{key:"observedAttributes",get:function(){return["animation","width","collapse","swipeable","animation-options"]}},{key:"events",get:function(){return["preopen","postopen","preclose","postclose","modechange"]}},{key:"rewritables",get:function(){return To}}]),e}();Mt.elements.SplitterSide=Do,customElements.define("ons-splitter-side",Do);var Mo={"":"switch--*",".switch__input":"switch--*__input",".switch__handle":"switch--*__handle",".switch__toggle":"switch--*__toggle"},Io={ios:[1,21],material:[0,16]},No=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n(t,function(){t.attributeChangedCallback("modifier",null,t.getAttribute("modifier"))}),t._boundOnChange=t._onChange.bind(t),t._boundOnRelease=t._onRelease.bind(t),t}return _(e,lr),p(e,[{key:"_getPosition",value:function(t){var e=this._locations;return Math.min(e[1],Math.max(e[0],this._startX+t.gesture.deltaX))}},{key:"_emitChangeEvent",value:function(){G.triggerElementEvent(this,"change",{value:this.checked,switch:this,isInteractive:!0})}},{key:"_onChange",value:function(t){t&&t.stopPropagation&&t.stopPropagation(),this._emitChangeEvent()}},{key:"_onClick",value:function(t){t.target.classList.contains(this.defaultElementClass+"__touch")&&t.preventDefault()}},{key:"_onHold",value:function(t){this.disabled||(M.addModifier(this,"active"),document.addEventListener("release",this._boundOnRelease))}},{key:"_onDragStart",value:function(t){this.disabled||-1===["left","right"].indexOf(t.gesture.direction)?M.removeModifier(this,"active"):(t.consumed=!0,M.addModifier(this,"active"),this._startX=this._locations[this.checked?1:0],this.addEventListener("drag",this._onDrag),document.addEventListener("release",this._boundOnRelease))}},{key:"_onDrag",value:function(t){t.stopPropagation(),t.gesture.preventDefault(),this._handle.style.left=this._getPosition(t)+"px"}},{key:"_onRelease",value:function(t){var e=this._locations,n=this._getPosition(t),i=this.checked;this.checked=n>=(e[0]+e[1])/2,this.checked!==i&&this._emitChangeEvent(),this.removeEventListener("drag",this._onDrag),document.removeEventListener("release",this._boundOnRelease),this._handle.style.left="",M.removeModifier(this,"active")}},{key:"click",value:function(){this.disabled||(this.checked=!this.checked,this._emitChangeEvent())}},{key:"connectedCallback",value:function(){var t=this;n(this,function(){t._input.addEventListener("change",t._boundOnChange)}),this.addEventListener("dragstart",this._onDragStart),this.addEventListener("hold",this._onHold),this.addEventListener("tap",this.click),this.addEventListener("click",this._onClick),this._gestureDetector=new et(this,{dragMinDistance:1,holdTimeout:251})}},{key:"disconnectedCallback",value:function(){var t=this;n(this,function(){t._input.removeEventListener("change",t._boundOnChange)}),this.removeEventListener("dragstart",this._onDragStart),this.removeEventListener("hold",this._onHold),this.removeEventListener("tap",this.click),this.removeEventListener("click",this._onClick),this._gestureDetector&&this._gestureDetector.dispose()}},{key:"attributeChangedCallback",value:function(t,n,i){if("modifier"===t){var r=-1!==(i||"").indexOf("material");this._locations=Io[r?"material":"ios"]}v(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"attributeChangedCallback",this).call(this,t,n,i)}},{key:"_scheme",get:function(){return Mo}},{key:"_defaultClassName",get:function(){return"switch"}},{key:"_template",get:function(){return'\n      <input type="'+this.type+'" class="'+this._defaultClassName+'__input">\n      <div class="'+this._defaultClassName+'__toggle">\n        <div class="'+this._defaultClassName+'__handle">\n          <div class="'+this._defaultClassName+'__touch"></div>\n        </div>\n      </div>\n    '}},{key:"type",get:function(){return"checkbox"}},{key:"_handle",get:function(){return this.querySelector("."+this._defaultClassName+"__handle")}},{key:"checkbox",get:function(){return this._input}}],[{key:"observedAttributes",get:function(){return[].concat(y(v(e.__proto__||Object.getPrototypeOf(e),"observedAttributes",this)),["modifier"])}}]),e}();Mt.elements.Switch=No,customElements.define("ons-switch",No);var qo={".tabbar__content":"tabbar--*__content",".tabbar__border":"tabbar--*__border",".tabbar":"tabbar--*"},Bo={ready:function(t,e){e()}},jo=function(t,e,n){return(1-n)*t+n*e},Ho=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n(t,function(){return t._compile()}),t}return _(e,ti),p(e,[{key:"connectedCallback",value:function(){var t=this;this._swiper||(this._swiper=new Mi({getElement:function(){return t._contentElement},getInitialIndex:function(){return t.getAttribute("activeIndex")||t.getAttribute("active-index")},getAutoScrollRatio:this._getAutoScrollRatio.bind(this),getBubbleWidth:function(){return parseInt(t.getAttribute("ignore-edge-width")||25,10)},isAutoScrollable:function(){return!0},preChangeHook:this._onPreChange.bind(this),postChangeHook:this._onPostChange.bind(this),refreshHook:this._onRefresh.bind(this),scrollHook:this._onScroll.bind(this)}),n(this,function(){t._tabbarBorder=G.findChild(t._tabbarElement,".tabbar__border"),t._swiper.init({swipeable:t.hasAttribute("swipeable")})})),n(this,function(){return t._updatePosition()})}},{key:"disconnectedCallback",value:function(){this._swiper&&this._swiper.initialized&&(this._swiper.dispose(),this._swiper=null,this._tabbarBorder=null,this._tabsRect=null)}},{key:"_normalizeEvent",value:function(t){return g({},t,{index:t.activeIndex,tabItem:this.tabs[t.activeIndex]})}},{key:"_onPostChange",value:function(t){t=this._normalizeEvent(t),G.triggerElementEvent(this,"postchange",t);var e=t.tabItem.pageElement;e&&e._show()}},{key:"_onPreChange",value:function(t){if(t=this._normalizeEvent(t),t.cancel=function(){return t.canceled=!0},G.triggerElementEvent(this,"prechange",t),!t.canceled){var e=t,n=e.activeIndex,i=e.lastActiveIndex,r=this.tabs;if(r[n].setActive(!0),i>=0){var o=r[i];o.setActive(!1),o.pageElement&&o.pageElement._hide()}}return t.canceled}},{key:"_onScroll",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._tabbarBorder)if(this._tabbarBorder.style.transition="all "+(e.duration||0)+"s "+(e.timing||""),this._autogrow&&this._tabsRect.length>0){var n=Math.floor(t),i=Math.ceil(t),r=t%1;this._tabbarBorder.style.width=jo(this._tabsRect[n].width,this._tabsRect[i].width,r)+"px",this._tabbarBorder.style.transform="translate3d("+jo(this._tabsRect[n].left,this._tabsRect[i].left,r)+"px, 0, 0)"}else this._tabbarBorder.style.transform="translate3d("+100*t+"%, 0, 0)";this._onSwipe&&this._onSwipe(t,e)}},{key:"_onRefresh",value:function(){if(this._autogrow=G.hasModifier(this,"autogrow"),this._tabsRect=this.tabs.map(function(t){return t.getBoundingClientRect()}),this._tabbarBorder){this._tabbarBorder.style.display=this.hasAttribute("tab-border")||w.isAndroid()?"block":"none";var t=this.getActiveTabIndex();this._tabsRect.length>0&&t>=0&&(this._tabbarBorder.style.width=this._tabsRect[t].width+"px")}}},{key:"_getAutoScrollRatio",value:function(t,e,n){var i=n/300*(t?-1:1);return Math.min(1,Math.max(0,.6+e*i))}},{key:"_compile",value:function(){D.prepare(this);var t=this._contentElement||G.create(".tabbar__content");t.classList.add("ons-tabbar__content");var e=this._tabbarElement||G.create(".tabbar");if(e.classList.add("ons-tabbar__footer"),!e.parentNode)for(;this.firstChild;)e.appendChild(this.firstChild);var n=Number(this.getAttribute("activeIndex"));e.children.length>n&&!G.findChild(e,"[active]")&&e.children[n].setAttribute("active",""),this._tabbarBorder=G.findChild(e,".tabbar__border")||G.create(".tabbar__border"),e.appendChild(this._tabbarBorder),e.classList.add("ons-swiper-tabbar"),!t.children[0]&&t.appendChild(document.createElement("div")),!t.children[1]&&t.appendChild(document.createElement("div")),t.appendChild=t.appendChild.bind(t.children[0]),t.insertBefore=t.insertBefore.bind(t.children[0]),this.appendChild(t),this.appendChild(e),M.initModifier(this,qo)}},{key:"_updatePosition",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getAttribute("position"),i=this._top="top"===e||"auto"===e&&w.isAndroid(),r=i?G.addModifier:G.removeModifier;r(this,"top");var o=G.findParent(this,"ons-page");o&&n(o,function(){var e=0;o.children[0]&&G.match(o.children[0],"ons-toolbar")&&(r(o.children[0],"noshadow"),e=1);var n=o._getContentElement(),a=window.getComputedStyle(o._getContentElement(),null);t.style.top=i?parseInt(a.getPropertyValue("padding-top"),10)-e+"px":"",n.style.top=a.top,n.style.top=""}),C.autoStatusBarFill(function(){var e=G.findParent(t,function(t){return t.hasAttribute("status-bar-fill")});G.toggleAttribute(t,"status-bar-fill",i&&!e)})}},{key:"setActiveTab",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.getActiveTabIndex(),r=this.tabs[i],o=this.tabs[t];if(!o)return Promise.reject("Specified index does not match any tab.");if(t===i)return G.triggerElementEvent(this,"reactive",{index:t,activeIndex:t,tabItem:o}),Promise.resolve(o.pageElement);var a=o.pageElement;return(a?Promise.resolve(a):o.loaded).then(function(i){return e._swiper.setActiveIndex(t,g({reject:!0},n,{animation:r&&i?n.animation||e.getAttribute("animation"):"none",animationOptions:G.extend({duration:.3,timing:"cubic-bezier(.4, .7, .5, 1)"},e.hasAttribute("animation-options")?G.animationOptionsParse(e.getAttribute("animation-options")):{},n.animationOptions||{})})).then(function(){return n.callback instanceof Function&&n.callback(i),i})})}},{key:"setTabbarVisibility",value:function(t){var e=this;n(this,function(){e._contentElement.style[e._top?"top":"bottom"]=t?"":"0px",e._tabbarElement.style.display=t?"":"none"})}},{key:"show",value:function(){this.setTabbarVisibility(!0)}},{key:"hide",value:function(){this.setTabbarVisibility(!1)}},{key:"getActiveTabIndex",value:function(){for(var t=this.tabs,e=0;e<t.length;e++)if(t[e]&&"ONS-TAB"===t[e].tagName&&t[e].isActive())return e;return-1}},{key:"_show",value:function(){var t=this;this._swiper.show(),setImmediate(function(){return t.tabs.length>0&&t.tabs[t.getActiveTabIndex()].loaded.then(function(t){return t&&setImmediate(function(){return t._show()})})})}},{key:"_hide",value:function(){this._swiper.hide();var t=this.topPage;t&&t._hide()}},{key:"_destroy",value:function(){this.tabs.forEach(function(t){return t.remove()}),this.remove()}},{key:"attributeChangedCallback",value:function(t,e,n){if("modifier"===t){M.onModifierChanged(e,n,this,qo);var i=function(t){return/(^|\s+)top($|\s+)/i.test(t)};i(e)!==i(n)&&this._updatePosition()}else"position"===t?G.isAttached(this)&&this._updatePosition():"swipeable"===t?this._swiper&&this._swiper.updateSwipeable(this.hasAttribute("swipeable")):"hide-tabs"===t&&this.setTabbarVisibility(!this.hasAttribute("hide-tabs")||"false"===n)}},{key:"_tabbarElement",get:function(){return G.findChild(this,".tabbar")}},{key:"_contentElement",get:function(){return G.findChild(this,".tabbar__content")}},{key:"_targetElement",get:function(){var t=this._contentElement;return t&&t.children[0]||null}},{key:"topPage",get:function(){var t=this.tabs,e=this.getActiveTabIndex();return t[e]?t[e].pageElement||this.pages[0]||null:null}},{key:"pages",get:function(){return G.arrayFrom(this._targetElement.children)}},{key:"tabs",get:function(){return Array.prototype.filter.call(this._tabbarElement.children,function(t){return"ONS-TAB"===t.tagName})}},{key:"visible",get:function(){return"none"!==this._tabbarElement.style.display}},{key:"swipeable",get:function(){return this.hasAttribute("swipeable")},set:function(t){return G.toggleAttribute(this,"swipeable",t)}},{key:"onSwipe",get:function(){return this._onSwipe},set:function(t){if(t&&!(t instanceof Function))throw new Error("'onSwipe' must be a function.");this._onSwipe=t}}],[{key:"observedAttributes",get:function(){return["modifier","position","swipeable","tab-border","hide-tabs"]}},{key:"rewritables",get:function(){return Bo}},{key:"events",get:function(){return["prechange","postchange","reactive"]}}]),e}();Mt.elements.Tabbar=Ho,customElements.define("ons-tabbar",Ho);var Ro={"":"tabbar--*__item",".tabbar__button":"tabbar--*__button"},zo=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return["label","icon","badge"].some(t.hasAttribute.bind(t))?t._compile():n(t,function(){return t._compile()}),t._pageLoader=Lt,t._boundOnClick=t._onClick.bind(t),t}return _(e,ti),p(e,[{key:"_compile",value:function(){if(D.prepare(this),this.classList.add("tabbar__item"),!this._button){for(var t=G.create("button.tabbar__button");this.childNodes[0];)t.appendChild(this.childNodes[0]);var e=G.create("input",{display:"none"});e.type="radio",this.appendChild(e),this.appendChild(t),this._updateButtonContent(),M.initModifier(this,Ro),this._updateRipple()}}},{key:"_updateRipple",value:function(){this._button&&G.updateRipple(this._button,this.hasAttribute("ripple"))}},{key:"_updateButtonContent",value:function(){var t=this,e=this._button,n=this._icon;if(this.hasAttribute("icon")){var i=(n=n||G.createElement('<div class="tabbar__icon"><ons-icon></ons-icon></div>')).children[0],r=function(e){return function(){return i.attributeChangedCallback("icon",e,t.getAttribute("icon"))}}(i.getAttribute("icon"));i.setAttribute("icon",this.getAttribute("icon")),n.parentElement!==e&&e.insertBefore(n,e.firstChild),i.attributeChangedCallback instanceof Function?r():setImmediate(function(){return i.attributeChangedCallback instanceof Function&&r()})}else n&&n.remove();["label","badge"].forEach(function(n,i){var r=t.querySelector(".tabbar__"+n);t.hasAttribute(n)?((r=r||G.create(".tabbar__"+n+("badge"===n?" notification":""))).textContent=t.getAttribute(n),r.parentElement!==e&&e.appendChild(r)):r&&r.remove()})}},{key:"_onClick",value:function(){this.onClick instanceof Function?this.onClick():this._tabbar.setActiveTab(this.index,{reject:!1})}},{key:"setActive",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._input.checked=t,this.classList.toggle("active",t),G.toggleAttribute(this,"active",t),this.hasAttribute("icon")&&this.hasAttribute("active-icon")&&this._icon.children[0].setAttribute("icon",this.getAttribute(t?"active-icon":"icon"))}},{key:"_loadPageElement",value:function(t,e){var n=this;return this._hasLoaded=!0,new Promise(function(i){n._pageLoader.load({parent:t,page:e},function(e){t.replaceChild(e,t.children[n.index]),n._loadedPage=e,i(e)})})}},{key:"isActive",value:function(){return this.classList.contains("active")}},{key:"disconnectedCallback",value:function(){this.loaded=null,this.removeEventListener("click",this._boundOnClick,!1),this._loadedPage&&(this._pageLoader.unload(this._loadedPage),this._loadedPage=null,this._hasLoaded=!1)}},{key:"connectedCallback",value:function(){var t=this;if(G.isAttached(this)&&!this.loaded){var e=G.defer();this.loaded=e.promise,n(this,function(){var n=t.index,i=t._tabbar;if(!i)throw new Error("This ons-tab element must be child of ons-tabbar element.");i.hasAttribute("modifier")&&G.addModifier(t,i.getAttribute("modifier")),t._hasLoaded||(t.hasAttribute("active")&&(t.setActive(!0),i.setAttribute("activeIndex",n)),n===i.tabs.length-1&&(i._onRefresh(),setImmediate(function(){return i._onRefresh()})),Ho.rewritables.ready(i,function(){var r=t.page||t.getAttribute("page");if(!t.pageElement&&r){var o=i._targetElement,a=G.create("div",{height:"100%",width:"100%",backgroundColor:"transparent"});return o.insertBefore(a,o.children[n]),t._loadPageElement(o,r).then(e.resolve)}return e.resolve(t.pageElement)})),t.addEventListener("click",t._boundOnClick,!1)})}}},{key:"attributeChangedCallback",value:function(t,e,i){var r=this;switch(t){case"class":G.restoreClass(this,"tabbar__item",Ro);break;case"modifier":n(this,function(){return M.onModifierChanged(e,i,r,Ro)});break;case"ripple":n(this,function(){return r._updateRipple()});break;case"icon":case"label":case"badge":n(this,function(){return r._updateButtonContent()});break;case"page":this.page=i||""}}},{key:"pageLoader",set:function(t){if(!(t instanceof Tt))throw Error("First parameter must be an instance of PageLoader.");this._pageLoader=t},get:function(){return this._pageLoader}},{key:"_input",get:function(){return G.findChild(this,"input")}},{key:"_button",get:function(){return G.findChild(this,".tabbar__button")}},{key:"_icon",get:function(){return this.querySelector(".tabbar__icon")}},{key:"_tabbar",get:function(){return G.findParent(this,"ons-tabbar")}},{key:"index",get:function(){return Array.prototype.indexOf.call(this.parentElement.children,this)}},{key:"pageElement",get:function(){if(this._loadedPage)return this._loadedPage;var t=this._tabbar;return t.pages.length===t.tabs.length?t.pages[this.index]:null}}],[{key:"observedAttributes",get:function(){return["modifier","ripple","icon","label","page","badge","class"]}}]),e}();Mt.elements.Tab=zo,customElements.define("ons-tab",zo);var Fo=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.timing,i=void 0===n?"linear":n,r=t.delay,o=void 0===r?0:r,a=t.duration,s=void 0===a?.2:a;return f(this,e),b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,{timing:i,delay:o,duration:s}))}return _(e,ii),p(e,[{key:"show",value:function(t,e){e()}},{key:"hide",value:function(t,e){e()}}]),e}(),Vo=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.timing,i=void 0===n?"linear":n,r=t.delay,o=void 0===r?0:r,a=t.duration,s=void 0===a?.3:a;return f(this,e),b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,{timing:i,delay:o,duration:s}))}return _(e,Fo),p(e,[{key:"show",value:function(t,e){e=e||function(){},K(t).saveStyle().queue({opacity:0}).wait(this.delay).queue({opacity:1},{duration:this.duration,timing:this.timing}).restoreStyle().queue(function(t){e(),t()}).play()}},{key:"hide",value:function(t,e){e=e||function(){},K(t).saveStyle().queue({opacity:1}).wait(this.delay).queue({opacity:0},{duration:this.duration,timing:this.timing}).restoreStyle().queue(function(t){e(),t()}).play()}}]),e}(),Wo=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.timing,i=void 0===n?"ease":n,r=t.delay,o=void 0===r?0:r,a=t.duration,s=void 0===a?.25:a;f(this,e);var u=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,{timing:i,delay:o,duration:s}));return u.messageDelay=.4*u.duration+u.delay,w.isAndroid()?u.ascension=48:Wr.isIPhoneXPortraitPatchActive()?u.ascension=98:Wr.isIPhoneXLandscapePatchActive()?u.ascension=85:u.ascension=64,u}return _(e,Fo),p(e,[{key:"show",value:function(t,e){t=t._toast,G.globals.fabOffset=this.ascension,K.runAll(K(t).saveStyle().queue({transform:"translate3d(0, "+this.ascension+"px, 0)"}).wait(this.delay).queue({transform:"translate3d(0, 0, 0)"},{duration:this.duration,timing:this.timing}).restoreStyle().queue(function(t){e&&e(),t()}),K(this._getFabs()).wait(this.delay).queue({transform:"translate3d(0, -"+this.ascension+"px, 0) scale(1)"},{duration:this.duration,timing:this.timing}),K(G.arrayFrom(t.children)).saveStyle().queue({opacity:0}).wait(this.messageDelay).queue({opacity:1},{duration:this.duration,timing:this.timing}).restoreStyle())}},{key:"hide",value:function(t,e){t=t._toast,G.globals.fabOffset=0,K.runAll(K(t).saveStyle().queue({transform:"translate3d(0, 0, 0)"}).wait(this.delay).queue({transform:"translate3d(0, "+this.ascension+"px, 0)"},{duration:this.duration,timing:this.timing}).restoreStyle().queue(function(t){e&&e(),t()}),K(this._getFabs()).wait(this.delay).queue({transform:"translate3d(0, 0, 0) scale(1)"},{duration:this.duration,timing:this.timing}),K(G.arrayFrom(t.children)).saveStyle().queue({opacity:1}).wait(this.delay).queue({opacity:0},{duration:this.duration,timing:this.timing}).restoreStyle())}},{key:"_getFabs",value:function(){return G.arrayFrom(document.querySelectorAll("ons-fab[position~=bottom], ons-speed-dial[position~=bottom]")).filter(function(t){return t.visible})}}]),e}(),Xo=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.timing,i=void 0===n?"ease":n,r=t.delay,o=void 0===r?0:r,a=t.duration,s=void 0===a?.35:a;f(this,e);var u=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,{timing:i,delay:o,duration:s}));return u.bodyHeight=document.body.clientHeight,Wr.isIPhoneXPortraitPatchActive()?u.liftAmount="calc(100% + 34px)":Wr.isIPhoneXLandscapePatchActive()?u.liftAmount="calc(100% + 21px)":u.liftAmount="100%",u}return _(e,Fo),p(e,[{key:"show",value:function(t,e){t=t._toast,K.runAll(K(t).saveStyle().queue({transform:"translate3d(0, "+this.liftAmount+", 0)",opacity:0}).wait(this.delay).queue({transform:"translate3d(0, 0, 0)",opacity:1},{duration:this.duration,timing:this.timing}).restoreStyle().queue(function(t){e&&e(),t()}))}},{key:"hide",value:function(t,e){t=t._toast,K.runAll(K(t).saveStyle().queue({transform:"translate3d(0, 0, 0)",opacity:1}).wait(this.delay).queue({transform:"translate3d(0, "+this.liftAmount+", 0)",opacity:0},{duration:this.duration,timing:this.timing}).restoreStyle().queue(function(t){e&&e(),t()}))}},{key:"_updatePosition",value:function(t){0===parseInt(t.style.top,10)&&(t.style.top=t.style.bottom="")}}]),e}(),Uo=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.timing,i=void 0===n?"ease":n,r=t.delay,o=void 0===r?0:r,a=t.duration,s=void 0===a?.35:a;f(this,e);var u=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,{timing:i,delay:o,duration:s}));return Wr.isIPhoneXPortraitPatchActive()?u.fallAmount="calc(-100% - 44px)":u.fallAmount="-100%",u}return _(e,Fo),p(e,[{key:"show",value:function(t,e){t=t._toast,this._updatePosition(t),K.runAll(K(t).saveStyle().queue({transform:"translate3d(0, "+this.fallAmount+", 0)",opacity:0}).wait(this.delay).queue({transform:"translate3d(0, 0, 0)",opacity:1},{duration:this.duration,timing:this.timing}).restoreStyle().queue(function(t){e&&e(),t()}))}},{key:"hide",value:function(t,e){var n=this;t=t._toast,this._updatePosition(t),K.runAll(K(t).saveStyle().queue({transform:"translate3d(0, 0, 0)",opacity:1}).wait(this.delay).queue({transform:"translate3d(0, "+this.fallAmount+", 0)",opacity:0},{duration:this.duration,timing:this.timing}).restoreStyle().queue(function(i){n._updatePosition(t,!0),e&&e(),i()}))}},{key:"_updatePosition",value:function(t,e){var n=void 0;n=Wr.isIPhoneXPortraitPatchActive()?"44px":"0",t.style.top!==n&&(t.style.top=n,t.style.bottom="initial")}}]),e}(),Yo={".toast":"toast--*",".toast__message":"toast--*__message",".toast__button":"toast--*__button"},Go={default:w.isAndroid()?Wo:Xo,fade:Vo,ascend:Wo,lift:Xo,fall:Uo,none:Fo},$o=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t._defaultDBB=function(t){return t.callParentHandler()},n(t,function(){return t._compile()}),t}return _(e,si),p(e,[{key:"_updateAnimatorFactory",value:function(){return this._toast&&(this._toast.style.top=this._toast.style.bottom=""),new A({animators:Go,baseClass:Fo,baseClassName:"ToastAnimator",defaultAnimation:this.getAttribute("animation")})}},{key:"_compile",value:function(){D.prepare(this),this.style.display="none",this.style.zIndex=1e4;var t=G.findChild(this,".toast");if(!t)for((t=document.createElement("div")).classList.add("toast");this.childNodes[0];)t.appendChild(this.childNodes[0]);var e=G.findChild(t,".toast__button");if(e||(e=G.findChild(t,function(t){return G.match(t,".button")||G.match(t,"button")}))&&(e.classList.remove("button"),e.classList.add("toast__button"),t.appendChild(e)),!G.findChild(t,".toast__message")){var n=G.findChild(t,".message");if(!n){n=document.createElement("div");for(var i=t.childNodes.length-1;i>=0;i--)t.childNodes[i]!==e&&n.insertBefore(t.childNodes[i],n.firstChild)}n.classList.add("toast__message"),t.insertBefore(n,t.firstChild)}t.parentNode!==this&&this.appendChild(t),M.initModifier(this,this._scheme)}},{key:"_scheme",get:function(){return Yo}},{key:"_toast",get:function(){return G.findChild(this,".toast")}}],[{key:"registerAnimator",value:function(t,e){if(!(e.prototype instanceof Fo))throw new Error('"Animator" param must inherit OnsToastElement.ToastAnimator');Go[t]=e}},{key:"animators",get:function(){return Go}},{key:"ToastAnimator",get:function(){return Fo}}]),e}();Mt.elements.Toast=$o,customElements.define("ons-toast",$o);var Ko={"":"toolbar-button--*"},Qo=function(t){function e(){f(this,e);var t=b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t._compile(),t}return _(e,ti),p(e,[{key:"_compile",value:function(){D.prepare(this),this.classList.add("toolbar-button"),G.updateRipple(this,void 0,{center:"",size:"contain",background:"transparent"}),M.initModifier(this,Ko)}},{key:"attributeChangedCallback",value:function(t,e,n){switch(t){case"class":G.restoreClass(this,"toolbar-button",Ko);break;case"modifier":M.onModifierChanged(e,n,this,Ko)}}},{key:"disabled",set:function(t){return G.toggleAttribute(this,"disabled",t)},get:function(){return this.hasAttribute("disabled")}}],[{key:"observedAttributes",get:function(){return["modifier","class"]}}]),e}();return Mt.elements.ToolbarButton=Qo,customElements.define("ons-toolbar-button",Qo),function(t){window.ons&&t._util.warn("Onsen UI is loaded more than once."),window.addEventListener("load",function(){t.fastClick=FastClick.attach(document.body);var e="touch-action"in document.body.style;t.platform._runOnActualPlatform(function(){t.platform.isAndroid()?t.fastClick.destroy():t.platform.isIOS()&&e&&(t.platform.isIOSSafari()||t.platform.isWKWebView())&&t.fastClick.destroy()})},!1),t.ready(function(){t.enableDeviceBackButtonHandler(),t._defaultDeviceBackButtonHandler=t._internal.dbbDispatcher.createHandler(window.document.body,function(){Object.hasOwnProperty.call(navigator,"app")?navigator.app.exitApp():console.warn("Could not close the app. Is 'cordova.js' included?\nError: 'window.navigator.app' is undefined.")}),document.body._gestureDetector=new t.GestureDetector(document.body),t.platform.isWebView()||document.body.addEventListener("keydown",function(e){27===e.keyCode&&t.fireDeviceBackButtonEvent()}),t._setupLoadingPlaceHolders()}),Viewport.setup()}(Mt),window._superSecretOns=Mt,Mt});