(function(){'use strict';function g(a){var b=0;return function(){return b=window.innerWidth?1:2;if(A!=a){A=a;switch(a){case 1:var b="rotatetoportrait";break;case 2:b="rotatetolandscape"}a=document.createEvent("CustomEvent");a.initCustomEvent(b||"",!0,!0,null);document.body.dispatchEvent(a)}} m("gwd.actions.pageLayout.initialize",function(){A=window.innerHeight>=window.innerWidth?1:2;window.addEventListener("resize",B,!0)});m("gwd.actions.tilt.EVENT_TILT","tilt");var C=NaN,D=NaN,E=NaN; function F(a){function b(k){return!k&&0!=k}if(!(b(a.alpha)||b(a.beta)||b(a.gamma))){var c,d=null!=(c=a.alpha)?c:0,e;c=null!=(e=a.beta)?e:0;var f;a=null!=(f=a.gamma)?f:0;isNaN(C)?(C=d,D=c,E=a):1225>(C-d)*(C-d)+(D-c)*(D-c)+(E-a)*(E-a)||(C=d,D=c,E=a,f=document.createEvent("CustomEvent"),f.initCustomEvent("tilt",!0,!0,{alpha:d,beta:c,gamma:a}),document.body.dispatchEvent(f))}}m("gwd.actions.tilt.initialize",function(){window.addEventListener("deviceorientation",F,!0)});var G; m("gwd.actions.deviceShake.initialize",function(){G||(G=new H,window.addEventListener("devicemotion",G.s,!1))});m("gwd.actions.deviceShake.dispose",function(){G&&window.removeEventListener("devicemotion",G.s,!1)});function H(){this.o=this.l=this.i=this.m=this.j=this.h=NaN;this.g=!1;this.s=this.v.bind(this)} H.prototype.v=function(a){a=a.accelerationIncludingGravity;var b;this.i=null!=(b=a.x)?b:0;var c;this.l=null!=(c=a.y)?c:0;var d;this.o=null!=(d=a.z)?d:0;this.g||window.setTimeout(this.A.bind(this),200);this.g=!0};H.prototype.A=function(){var a=Math.abs(this.i-this.h),b=Math.abs(this.l-this.j),c=Math.abs(this.o-this.m);this.h=this.i;this.j=this.l;this.m=this.o;18