forked from Dynatrace/ufo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphonon-core.min.js
1 lines (1 loc) · 20.9 KB
/
phonon-core.min.js
1
"use strict";!function(e,n){var t={},a=[];t.onReady=function(e){a.push(e)},t.dispatchGlobalReady=function(){for(var e=a.length-1;e>=0;e--)a[e]();a=[],t.dispatchGlobalReady=n},function(){function t(e,t){t=t||{bubbles:!1,cancelable:!1,detail:n};var a=document.createEvent("CustomEvent");return a.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),a}t.prototype=e.Event.prototype,e.CustomEvent=t}(),t.device=function(){var e=navigator.appVersion,n=navigator.userAgent,t="-",a=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Windows Vista",r:/Windows NT 6.0/},{s:"Windows Server 2003",r:/Windows NT 5.2/},{s:"Windows XP",r:/(Windows NT 5.1|Windows XP)/},{s:"Windows 2000",r:/(Windows NT 5.0|Windows 2000)/},{s:"Windows ME",r:/(Win 9x 4.90|Windows ME)/},{s:"Windows 98",r:/(Windows 98|Win98)/},{s:"Windows 95",r:/(Windows 95|Win95|Windows_95)/},{s:"Windows NT 4.0",r:/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/},{s:"Windows CE",r:/Windows CE/},{s:"Windows 3.11",r:/Win16/},{s:"Android",r:/Android/},{s:"Open BSD",r:/OpenBSD/},{s:"Sun OS",r:/SunOS/},{s:"Linux",r:/(Linux|X11)/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},{s:"QNX",r:/QNX/},{s:"UNIX",r:/UNIX/},{s:"BeOS",r:/BeOS/},{s:"OS/2",r:/OS\/2/},{s:"Search Bot",r:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/}];for(var o in a){var i=a[o];if(i.r.test(n)){t=i.s;break}}var r="-";switch(/Windows/.test(t)&&(r=/Windows (.*)/.exec(t)[1],t="Windows"),t){case"Mac OS X":r=/Mac OS X (10[\.\_\d]+)/.exec(n)[1];break;case"Android":r=/Android ([\.\_\d]+)/.exec(n)[1];break;case"iOS":r=/OS (\d+)_(\d+)_?(\d+)?/.exec(e),r=r[1]+"."+r[2]+"."+(0|r[3])}return{os:t,osVersion:r}}(),t.browser=function(){var e,n,t,a=navigator.userAgent,o=navigator.appName,i=""+parseFloat(navigator.appVersion),r=parseInt(navigator.appVersion,10);return-1!=(n=a.indexOf("Opera"))&&(o="Opera",i=a.substring(n+6),-1!=(n=a.indexOf("Version"))&&(i=a.substring(n+8))),-1!=(n=a.indexOf("OPR"))?(o="Opera",i=a.substring(n+4)):-1!=(n=a.indexOf("MSIE"))?(o="Microsoft Internet Explorer",i=a.substring(n+5)):-1!=(n=a.indexOf("Chrome"))?(o="Chrome",i=a.substring(n+7)):-1!=(n=a.indexOf("Safari"))?(o="Safari",i=a.substring(n+7),-1!=(n=a.indexOf("Version"))&&(i=a.substring(n+8))):-1!=(n=a.indexOf("Firefox"))?(o="Firefox",i=a.substring(n+8)):-1!=a.indexOf("Trident/")?(o="Microsoft Internet Explorer",i=a.substring(a.indexOf("rv:")+3)):(e=a.lastIndexOf(" ")+1)<(n=a.lastIndexOf("/"))&&(o=a.substring(e,n),i=a.substring(n+1),o.toLowerCase()==o.toUpperCase()&&(o=navigator.appName)),-1!=(t=i.indexOf(";"))&&(i=i.substring(0,t)),-1!=(t=i.indexOf(" "))&&(i=i.substring(0,t)),-1!=(t=i.indexOf(")"))&&(i=i.substring(0,t)),r=parseInt(""+i,10),isNaN(r)&&(i=""+parseFloat(navigator.appVersion),r=parseInt(navigator.appVersion,10)),{name:o,version:i}}(),t.ajax=function(){var n=function(e){var n=null;try{n=new XMLHttpRequest,"withCredentials"in n&&e&&(n.withCredentials=!0)}catch(t){console.error(t)}return n},t=function(e){var n=null;try{n=JSON.parse(e)}catch(t){n=null}return n},a=function(e){var n,t="";for(n in e)t+=n+"="+e[n]+"&";var a=t.lastIndexOf("&");return-1!==a&&(e=t.substring(0,a)),t};return function(o){var i=o.method,r=o.url,s="boolean"==typeof o.crossDomain?o.crossDomain:!1,c=o.contentType,l=o.dataType,f=o.data,u=o.timeout,d=o.success,p=o.error,h=o.headers;if("string"!=typeof i)throw new TypeError("method must be a string");if("string"!=typeof r)throw new TypeError("url must be a string");if("object"==typeof f&&(f="application/json"===c?JSON.stringify(f):a(f)),"function"!=typeof d)throw new TypeError("success must be a function");var v=n(s),g="NO_INTERNET_ACCESS";if(v){if(v.open(i,r,!0),"string"==typeof c&&v.setRequestHeader("Content-type",c),"xml"===l&&v.overrideMimeType&&v.overrideMimeType("application/xml; charset=utf-8"),"object"==typeof h){var m;for(m in h)v.setRequestHeader(m,h[m])}v.onreadystatechange=function(n){if(4===v.readyState){var a=null;"json"===l?(a=t(v.responseText),null===a&&(g="JSON_MALFORMED")):a="xml"===l?v.responseXML:v.responseText;var o=v.status.toString();"2"===o[0]?d(a,v):"function"==typeof p&&e.setTimeout(function(){p(a,g,v)},1),v=null}},"number"==typeof u&&(v.timeout=u,v.ontimeout=function(){g="TIMEOUT_EXCEEDED"}),v.send(f)}else"function"==typeof p&&(g="XMLHTTPREQUEST_UNAVAILABLE",p(g));return{cancel:function(){g="REQUEST_CANCELED",v&&v.abort()}}}}(),t.event=function(){var a=["mousedown","mousemove","mouseup"],o=!1;("ontouchstart"in e||e.DocumentTouch&&document instanceof DocumentTouch)&&(o=!0,a=["touchstart","touchmove","touchend","touchcancel"]),e.navigator.pointerEnabled?a=["pointerdown","pointermove","pointerup","pointercancel"]:e.navigator.msPointerEnabled&&(a=["MSPointerDown","MSPointerMove","MSPointerUp","MSPointerCancel"]);var i={};i.hasTouch=o,i.start=a[0],i.move=a[1],i.end=a[2],i.cancel="undefined"==typeof a[3]?null:a[3],i.tap="tap";var r=document.createElement("div"),s=[{name:"transition",end:"transitionend"},{name:"MozTransition",end:"transitionend"},{name:"msTransition",end:"msTransitionEnd"},{name:"WebkitTransition",end:"webkitTransitionEnd"}],c=[{name:"animation",end:"animationend"},{name:"MozAnimation",end:"animationend"},{name:"msAnimation",end:"msAnimationEnd"},{name:"WebkitAnimation",end:"webkitAnimationEnd"}],l=null,f=null,u=s.length-1;for(u in s)if(r.style[s[u].name]!==n){l=s[u].end;break}var d=c.length-1;for(d in c)if(r.style[c[d].name]!==n){f=c[d].end;break}var p=t.device.osVersion;p.length>2&&(p=t.device.osVersion.substring(0,3)),"android"===t.device.os.toLowerCase()&&"4.1"===p&&(l="webkitTransitionEnd",f="webkitAnimationEnd"),i.transitionEnd=l,i.animationEnd=f;var h=[],v=function(){function e(e,n){this.el=e,this.callback=n,this.moved=!1,this.startX=0,this.startY=0,this.el.addEventListener(i.start,this,!1)}return e.prototype.start=function(e){this.el.addEventListener(i.move,this,!1),this.el.addEventListener(i.end,this,!1),this.moved=!1,this.startX=e.clientX||e.touches[0].clientX,this.startY=e.clientY||e.touches[0].clientY},e.prototype.move=function(e){var n=e.clientX||e.touches[0].clientX,t=e.clientY||e.touches[0].clientY;(Math.abs(n-this.startX)>10||Math.abs(t-this.startY)>10)&&(this.moved=!0)},e.prototype.end=function(e){this.el.removeEventListener(i.move,this,!1),this.el.removeEventListener(i.end,this,!1),null!==i.cancel&&this.el.removeEventListener(i.cancel,this,!1),this.moved||this.callback(e)},e.prototype.cancel=function(){this.moved=!1,this.startX=0,this.startY=0},e.prototype.off=function(){this.el.removeEventListener(i.start,this,!1),this.el.removeEventListener(i.move,this,!1),this.el.removeEventListener(i.end,this,!1),null!==i.cancel&&this.el.removeEventListener(i.cancel,this,!1)},e.prototype.handleEvent=function(e){switch(e.type){case i.start:this.start(e);break;case i.move:this.move(e);break;case i.end:this.end(e);break;case i.cancel:this.cancel(e)}},e}();return t.on=function(e,n,t,a){if(n===i.tap){var o=new v(e,t);return void h.push(o)}e.addEventListener?e.addEventListener(n,t,a):e.attachEvent&&e.attachEvent("on"+n,t,a)},e.on=document.on=HTMLElement.prototype.on=function(e,n,a){t.on(this,e,n,a)},t.off=function(e,n,t,a){if(n!==i.tap)e.removeEventListener?e.removeEventListener(n,t,a):e.attachEvent&&e.detachEvent("on"+n,t,a);else for(var o=h.length-1;o>=0;o--)if(h[o].el===e){h[o].off(),h.splice(o,1);break}},e.off=document.off=HTMLElement.prototype.off=function(e,n,a){t.off(this,e,n,a)},i}(),t.tagManager=function(){if("undefined"!=typeof riot){var e=[],n=function(n,t){n[0].tagName=t,e.push(n[0])},t=function(){return e},a=function(n,t,a){for(var o=[],i=e.length-1;i>=0;i--)if(e[i].tagName===n){o.push(t);var r=o.concat(a);e[i].trigger.apply(this,r);break}};return{addTag:n,getAll:t,trigger:a}}}(),t.options=function(e){var n=!1;"object"==typeof e.i18n&&null!==e.i18n&&(t.i18n(e.i18n),n=!0),e.navigator.useI18n=n,t.navigator(e.navigator)},t.alert=function(e,n,a,o){return t.dialog().alert(e,n,a,o)},t.confirm=function(e,n,a,o,i){return t.dialog().confirm(e,n,a,o,i)},t.prompt=function(e,n,a,o,i){return t.dialog().prompt(e,n,a,o,i)},t.indicator=function(e,n){return t.dialog().indicator(e,n)},t.updateLocale=function(e){var n="undefined"!=typeof riot;t.i18n().setPreference(e).getAll(function(e){if(n){for(var a=t.tagManager.getAll(),o=a.length-1;o>=0;o--)a[o].i18n=e;riot.update()}else t.i18n().bind()})},e.phonon=t,"object"==typeof exports?module.exports=t:"function"==typeof define&&define.amd&&define(function(){return e.phonon=t})}("undefined"!=typeof window?window:this),function(e,n){function t(e){if(f.initCalled)throw new Error("The i18n module has already been instantiated");"string"==typeof e.directory&&(e.directory=-1!==e.directory.indexOf("/",e.directory.length-"/".length)?e.directory:e.directory+"/");var n;for(n in e)f[n]=e[n];f.initCalled=!0}function a(e){if(!f.initCalled)throw new Error("Please, initialize The i18n module using the init method");if("function"!=typeof e)throw new Error("callback must be a function");if(null!==l)return void e(l);var n=new XMLHttpRequest,t=f.localePreferred?f.localePreferred:f.localeFallback;n.open("GET",f.directory+t+".json",!0),n.overrideMimeType&&n.overrideMimeType("application/json; charset=utf-8"),n.onreadystatechange=function(){if(4===n.readyState)if(200===n.status)l=JSON.parse(n.responseText),e(JSON.parse(n.responseText));else{if(!f.localePreferred)throw new Error("The default locale ["+f.directory+f.localeFallback+".json] file is not found");f.localePreferred=null,console.log("The language ["+t+"] is not available, loading "+f.localeFallback),a(function(n){l=n,e(n)})}},n.send("")}function o(e,n){if("string"!=typeof e&&!(e instanceof Array))throw new Error("key must be a string or an array");var t=e instanceof Array;if(null===l)a(function(a){if(t){for(var o=e.length,i=o-1,r={};i>=0;i--)r[e[i]]=a[e[i]];n(r)}else n(a[e])});else if(t){for(var o=e.length,i=o-1,r={};i>=0;i--)r[e[i]]=l[e[i]];n(r)}else n(l[e])}function i(e,t){var o=e||n,i=t;if(1===arguments.length&&"function"==typeof e&&(o=n,i=e),!u(o))throw new TypeError("Not valid element object "+o);var r=o.querySelectorAll("[data-i18n]");null===l?a(function(e){v(r,e),"function"==typeof i&&i()}):(v(r,l),"function"==typeof i&&i())}function r(e){if("string"!=typeof e)throw new Error("The language must be a string");return f.localePreferred=e,l=null,g}function s(){return f.localePreferred}function c(){return e.navigator.userLanguage||e.navigator.language}var l=null,f={localeFallback:null,localePreferred:e.navigator.userLanguage||e.navigator.language,directory:"./",initCalled:!1},u=function(e){return"object"==typeof Node?e instanceof Node:e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},d=function(e,n){"textContent"in e?e.textContent=n:e.innerText=n},p=function(e,n){e.value=n},h=function(e,n){e.setAttribute("placeholder",n)},v=function(e,n){for(var t=e.length-1;t>=0;t--)for(var a,o=e[t],i=o.getAttribute("data-i18n").trim(),r=/(?:\s|^)(\w+):\s*(.*?)(?=\s+\w+:|$)/g;a=r.exec(i);){var s=a[1].trim(),c=a[2].trim().replace(",","");if(void 0!==n[c])if("text"===s)d(o,n[c]);else if("value"===s)p(o,n[c]);else{if("placeholder"!==s)throw new Error("The property: "+s+" is unknown");h(o,n[c])}else console.error("The value: "+c+" does not exist in the JSON file")}},g={};g.init=t,g.getAll=a,g.get=o,g.bind=i,g.setPreference=r,g.getPreference=s,g.getLocale=c,phonon.i18n=function(e){return"object"==typeof e&&t(e),{getAll:function(e){return a(e),this},get:function(e,n){return o(e,n),this},bind:function(e,n){return i(e,n),this},setPreference:function(e){return r(e),this},getPreference:function(){return s()},getLocale:function(){return c()}}}}(window,document),function(e,n,t){function a(e){var n=document.createElement("script");n.text=e,document.head.appendChild(n).parentNode.removeChild(n)}function o(){if(X.animatePages){var e=this;e.classList.remove("page-sliding"),e.classList.remove("left"),e.off(t.event.animationEnd,o,!1),e.classList.remove("app-active")}l(W),f(A),N=!1}function i(){if(X.animatePages){var e=this;e.classList.remove("page-sliding"),e.classList.remove("right"),e.off(t.event.animationEnd,i,!1),e.classList.remove("app-active")}l(W),f(A),N=!1}function r(n,t,a){var o={detail:{page:t},bubbles:!0,cancelable:!0};"undefined"!=typeof a&&(o.detail.req=a);var i=new e.CustomEvent(n,o);document.dispatchEvent(i)}function s(e){R&&t.tagManager.trigger(e,"create"),r("pagecreated",e);var n=I(e);n.activity instanceof j&&"function"==typeof n.activity.onCreateCallback&&n.activity.onCreateCallback()}function c(n){var a=I(n);e.setTimeout(function(){R&&t.tagManager.trigger(n,"ready"),r("pageopened",n),a.activity instanceof j&&"function"==typeof a.activity.onReadyCallback&&a.activity.onReadyCallback()},a.readyDelay)}function l(e){R&&t.tagManager.trigger(e,"transitionend"),r("pagetransitionend",e);var n=I(e);n.activity instanceof j&&"function"==typeof n.activity.onTransitionEndCallback&&n.activity.onTransitionEndCallback()}function f(e){R&&t.tagManager.trigger(e,"hidden"),r("pagehidden",e);var n=I(e);n.activity instanceof j&&"function"==typeof n.activity.onHiddenCallback&&n.activity.onHiddenCallback()}function u(e,n){R&&t.tagManager.trigger(e,"tabchanged",n),r("pagetabchanged",e);var a=I(e);a.activity instanceof j&&"function"==typeof a.activity.onTabChangedCallback&&a.activity.onTabChangedCallback(n)}function d(n,a,o){function i(){r("pageclosed",n);var t=e.location.hash.split("#")[1];t!==o&&X.useHash?e.location.hash=o:P(o)}if(!b()){var s=I(n);if(!s.async)return void i(!0);var c={close:i};if(R&&t.tagManager.trigger(n,"close",c),s.activity instanceof j&&"function"==typeof s.activity.onCloseCallback)s.activity.onCloseCallback(c);else if(!R)throw new Error("The page "+s.name+" prevents close, but its callback (onClose) is undefined")}}function p(e,n){if("undefined"!=typeof n){R&&t.tagManager.trigger(e,"hashchanged",n),r("pagehash",e,n);var a=I(e);a.activity instanceof j&&"function"==typeof a.activity.onHashChangedCallback&&a.activity.onHashChangedCallback(n)}}function h(e,n){"tabchanged"===e&&u(n.page,n.tabNumber)}function v(e,o){if(R&&n.compile(function(){X.useI18n?t.i18n().getAll(function(a){t.tagManager.addTag(n.mount(e,{i18n:a}),e),o()}):(t.tagManager.addTag(n.mount(e,{i18n:null}),e),o())}),!R){var i=I(e);null!==i.content?g(i.content,function(n){var r=B(e),s=document.createElement("div");s.innerHTML=n;var c=s.querySelector(e);if(null===c)throw new Error("Error with "+i.content+" : the template for "+e+" must start with the parent node <"+e+' class="app-page">');for(var l=c.attributes,f=l.length-1;f>=0;f--){var u=l.item(f);"class"!==u.nodeName&&"app-page"!==u.nodeValue&&r.setAttribute(u.nodeName,u.nodeValue)}var d=function(e){for(var n=e.getElementsByTagName("script"),t=0;t<n.length;t++)a(n[t].innerHTML)};X.useI18n?t.i18n().bind(c,function(){r.innerHTML=c.innerHTML,d(s),o()}):(r.innerHTML=c.innerHTML,d(s),o())}):o()}}function g(e,n){var t=new XMLHttpRequest;t.overrideMimeType&&t.overrideMimeType("text/html; charset=utf-8"),t.onreadystatechange=function(){4===t.readyState&&(200===t.status||!t.status&&t.responseText.length)&&n(t.responseText,X,e)},t.open("GET",X.templateRootDirectory+e,!0),t.send("")}function m(e,n){n="object"==typeof n?n:{};var t,a={name:e,mounted:!1,async:!1,activity:null,content:null,readyDelay:1};for(t in n)a[t]=n[t];return a}function y(e,n){n="object"==typeof n?n:{};var t=I(e);if(null===t)return M.push(m(e,n));var a;for(a in n)t[a]=n[a];return!0}function b(){return"undefined"!=typeof t.dialog&&t.dialog().closeActive()?!0:"undefined"!=typeof t.popover&&t.popover().closeActive()?!0:"undefined"!=typeof t.panel&&t.panel().closeActive()?!0:!("undefined"==typeof t.sidePanel||!t.sidePanel().closeActive())}function w(){var e={page:X.defaultPage,params:""};if(O.length>0){for(var n=-1,t=O.length-1;t>=0;t--)if(O[t].page===W){n=t-1;break}n>-1&&(e=O[n],O.slice(n,1))}return e}function E(e){H=!0;for(var n=e.target,t=null,a=!1,o="";n&&n!==document;n=n.parentNode){var i=n.getAttribute("data-navigation");if("undefined"!=typeof n.href&&-1!==n.href.indexOf("#!")){a=!0;break}if(i){t=i;break}}if((!a||!X.useHash)&&(null!==t||a)){var r=X.defaultPage;if(null!==t)if("$previous-page"===t){var s=w();r=s.page,o=s.params}else r=t;else{var c=n.href.match("/#"+X.hashPrefix+"([A-Za-z0-9-.]+)?(.*)/");c&&(r=c[1],o=c[2])}var l=X.hashPrefix+r;""!==o&&(l=l+"/"+o,l=l.replace("//","/")),d(W,r,l)}}function T(e,n){var a=B(e),r=B(n);r.classList.add("app-active"),X.animatePages?(a.classList.add("page-sliding"),D?(a.classList.add("left"),a.on(t.event.animationEnd,o,!1)):(a.classList.add("right"),a.on(t.event.animationEnd,i,!1))):(a.classList.remove("app-active"),D?o():i());for(var s=r.querySelectorAll(".content"),c=s.length-1;c>=0;c--){var l=s[c];null!==l&&0!==l.scrollTop&&(l.scrollTop=0)}n===X.defaultPage&&(O=[])}function C(e,n){if(N&&"function"==typeof n)return n();var a=I(e);S&&(N=!0,A=W,W=e),a.mounted?(c(e),T(A,e),"function"==typeof n&&n()):v(a.name,function(){if(a.mounted=!0,s(e),c(e),S||t.dispatchGlobalReady(),S&&T(A,e),!S){S=!0;var o=B(e);o.classList.contains("app-active")||o.classList.add("app-active")}"function"==typeof n&&n()})}function x(e){"string"==typeof e.templateRootDirectory&&""!==e.templateRootDirectory&&(e.templateRootDirectory=-1!==e.templateRootDirectory.indexOf("/",e.templateRootDirectory.length-"/".length)?e.templateRootDirectory:e.templateRootDirectory+"/"),"object"==typeof e.hashPrefix&&(e.hashPrefix="");var n;for(n in e)X[n]=e[n];X.enableBrowserBackButton&&(H=!0);for(var t=document.querySelectorAll("[data-page]"),a=t.length-1;a>=0;a--){var o=t[a];o.classList.contains("app-page")||o.classList.add("app-page"),y(o.tagName.toLowerCase())}}function k(){if(S)throw new Error("The app has been already started");var e=t.device.os.toLowerCase(),n="web";"android"===e?n="android":"ios"===e&&(n="ios"),document.body.classList.contains(n)||document.body.classList.add(n),P()}function L(n,t){var a=I(W),o=I(n);if(!o)throw new Error("The following page: "+n+" does not exists");var i="string"==typeof t?X.hashPrefix+o.name+"/"+t:X.hashPrefix+o.name;if(a.async)d(W,o.name,i);else{var r=e.location.hash.split("/");-1===r[0].indexOf(o.name)&&X.useHash&&(e.location.hash=i)}}function P(n){var t,a="string"==typeof n?n:e.location.href.split("#")[1]||"",o=a.split("/"),i=o.slice(1,o.length),r=o[0],s=X.hashPrefix.indexOf("/");-1!==s?(r="undefined"==typeof o[1]?"":o[1],i=o.slice(2,o.length),t=r.substring(s+1,r.length)):t=r.substring(X.hashPrefix.length,r.length);var c=I(t);if(S||c)!S&&c&&(W=c.name);else if(W=X.defaultPage,c=I(X.defaultPage),X.useHash)return void(e.location.hash=X.hashPrefix+X.defaultPage);if(c){if(b(),c.name===W&&S)return void p(c.name,i);if(S&&!H)return;for(var l=!1,f=O.length-1;f>=0;f--)if(O[f].page===c.name){l=!0;break}if(O.length>0?c.name===X.defaultPage&&(D=!1):D=!0,O.length>1&&O[O.length-2].page===c.name&&(D=!1),!l){var u=i.join("/");O.push({page:c.name,params:u})}"function"!=typeof c.callback||c.mounted||c.callback(c.activity),c.mounted?(C(c.name),p(c.name,i)):C(c.name,function(){p(c.name,i)}),X.enableBrowserBackButton||(H=!1)}}var M=[],O=[],S=!1,N=!1,W=null,A=null,D=!0,H=!1,R=void 0!==n,X={defaultPage:null,hashPrefix:"!",animatePages:!0,templateRootDirectory:"",useI18n:!0,enableBrowserBackButton:!1,useHash:!0},j=function(){function e(e){if("object"==typeof e){var n;for(n in e)void 0!==this[n]&&"constructor"!==this[n]&&(this[n+"Callback"]=e[n])}}return e.prototype.onCreate=function(e){this.onCreateCallback=e},e.prototype.onReady=function(e){this.onReadyCallback=e},e.prototype.onClose=function(e){this.onCloseCallback=function(n){e(n)}},e.prototype.onHidden=function(e){this.onHiddenCallback=e},e.prototype.onTransitionEnd=function(e){this.onTransitionEndCallback=e},e.prototype.onHashChanged=function(e){this.onHashChangedCallback=function(n){e.apply(this,n)}},e.prototype.onTabChanged=function(e){this.onTabChangedCallback=function(n){e(n)}},e}(),I=function(e){for(var n=M.length-1;n>=0;n--)if(M[n].name===e)return M[n];return null},B=function(e){for(var n=document.querySelectorAll("[data-page]"),t=n.length-1,a=null;t>=0;t--)if(n[t].tagName.toLowerCase()===e){a=n[t];break}return a};document.on("tap",E),X.useHash&&e.on("hashchange",P),document.on("backbutton",function(){var e=w();d(W,e.page,X.hashPrefix+e.page+"/"+e.params)}),t.navigator=function(n){return"object"==typeof n&&x(n),{currentPage:W,previousPage:A,start:k,changePage:function(n,t){H=!0;var a=b()?400:1;e.setTimeout(function(){L(n,t)},a)},on:function(e,n){if("string"!=typeof e.page)throw new Error("Page name must be a string");if("undefined"!=typeof e.preventClose&&"boolean"!=typeof e.preventClose)throw new Error("preventClose option must be a boolean");if("undefined"!=typeof e.readyDelay&&"number"!=typeof e.readyDelay)throw new Error("readyDelay option must be a number");var t=I(e.page),a=null!==t;a||(t=m(e.page)),"function"==typeof n||"object"==typeof n?t.activity=new j(n):t.activity=null,t.callback=n,t.async="boolean"==typeof e.preventClose?e.preventClose:!1,t.content="string"==typeof e.content?e.content:null,t.readyDelay="number"==typeof e.readyDelay?e.readyDelay:1,y(e.page.toLowerCase(),t)},callCallback:h}}}("undefined"!=typeof window?window:this,"undefined"!=typeof riot?riot:void 0,phonon);