"undefined"==typeof zon&&(zon=!1),"undefined"==typeof zns&&(zns=!1);var zog=console.log.bind(console);function zid(e){return z_d("1"),document.getElementById(e)}function zss(e){if(z_d("2"),document.getElementById(e))return document.getElementById(e).style;zon&&zog("zim wrap - zss(): id not found")}function zgo(e,t,o,n,i,r){if(z_d("3"),!(zot(t)&&""!=t||"_self"==t)){var a="";return o&&(a+="width="+o+","),n&&(a+="height="+n+","),i&&(a+="fullscreen=yes,"),r&&(a+="modal=yes,alwaysRaised=yes"),window.open(e,t,a)}window.location.href=e}function zum(e){if(z_d("4"),!zot(e))return Number(String(e).replace(/[^\d\.\-]/g,""))}function zot(e){return null==e}function zop(e){z_d("5"),zot(e)||(e.stopImmediatePropagation&&e.stopImmediatePropagation(),window.event&&(window.event.cancelBubble=!0))}function zil(){z_d("6");var e=function(e){e||(e=event),e.keyCode&&e.keyCode>=32&&e.keyCode<=40&&e.preventDefault()},t=function(e){e||(e=event),e.preventDefault()},o=t;return window.addEventListener("keydown",e),window.addEventListener("wheel",t),window.addEventListener("DOMMouseScroll",o),[e,t,o]}function zet(e){return z_d("6.1"),new function(){var t=this;this.on=function(o,n){if(!(zot(e)||zot(o)||zot(n)))for(var i=t.tags,r=0;r=0)&&-1==e.indexOf(n)&&(window[n]=zim[n])}var zim=function(e){return e.Wonder=function(t,o,n,i,r){var a;if(a=zob(e.Wonder,arguments,"wid, client, app, notes, server",this))return a;if(z_d("82"),zot(t))zog("zim.Wonder() - please provide Wonder ID (see http://zimjs.com/wonder/)");else{zot(r)&&(r="http://54.237.229.197:3001/wonder");var s=this;zot(e.wonderSession)&&(e.wonderSession="W"+e.rand(1e5,999999));var l,d=[],c=setInterval(m,1e3),u=0,h=setInterval(function(){u>28&&(d.push({id:t,c:o,a:n,n:i,k:l,t:"e",v:"frequency max - terminated",s:e.wonderSession}),zog("zim.Wonder() - frequency max - terminated"),s.dispose()),u=0},3e4);this.countsOff={},this.timesOff={},this.ordersOff={},this.count=function(r){g(r,"count")&&(l=r,d.push({id:t,c:o,a:n,n:i,k:r,t:"c",v:1,s:e.wonderSession}))};var f={};this.timeStart=function(e){g(e,"time")&&(s.timeEnd(e),l=e,f[e]=(new Date).getTime())};var p={};this.timePause=function(e){g(e,"time")&&(p[e]||(p[e]=(new Date).getTime()))},this.timeUnpause=function(e){if(g(e,"time")&&p[e]){var t=(new Date).getTime()-p[e];f[e]&&(f[e]+=t),delete p[e]}},this.timeEnd=function(r){if(g(r,"time")&&f[r]){var a=p[r]?p[r]:(new Date).getTime(),s=Math.round((a-f[r])/1e3);delete p[r],delete f[r],d.push({id:t,c:o,a:n,n:i,k:r,t:"t",v:s,s:e.wonderSession})}},this.order=function(r,a){g(r,"order")&&(l=r,zot(a)?zog("zim.Wonder order() - please provide an item"):d.push({id:t,c:o,a:n,n:i,k:r,t:"o",v:a,s:e.wonderSession}))},this.countOff=function(e){s.countsOff[e]=1},this.countOn=function(e){delete s.countOff[e]},this.timeOff=function(e){s.timesOff[e]=1},this.timeOn=function(e){delete s.timesOff[e]},this.orderOff=function(e){s.ordersOff[e]=1},this.orderOn=function(e){delete s.ordersOff[e]},this.dispose=function(){return m(),clearInterval(c),clearInterval(h),!0}}function m(){d.length>0&&(e.async(r+"?wonder="+JSON.stringify(d)),d=[],u++)}function g(e,t){return zot(e)?(zog("zim.Wonder "+t+" - please provide a keyword"),!1):!s[t+"sOff"][e]}},e}((zim=function(e){if(e.shuffle=function(e){if(z_d("8"),!zot(e)){var t,o,n=e.length;if(0==n)return e;for(;--n;)t=Math.floor(Math.random()*(n+1)),o=e[n],e[n]=e[t],e[t]=o;return e}},e.rand=function(e,t,o,n){return z_d("9"),zot(e)&&zot(t)?Math.random():((zot(e)||isNaN(e))&&(e=0),(zot(t)||isNaN(t))&&(t=0),e%1==0&&t%1==0||(o=!1),zot(o)&&(o=!0),n&&Math.random()>.5&&(e*=-1,t*=-1),o&&(e>t?e++:t>e&&t++),0==e&&0==t?0:(i=0==t?Math.random()*e:Math.min(e,t)+Math.random()*(Math.max(e,t)-Math.min(e,t)),o?Math.floor(i):i));var i},e.loop=function(t,o,n,i,r,a){var s;if(s=zob(e.loop,arguments,"obj, call, reverse, step, start, end"))return s;if(z_d("9.5"),!zot(t)&&!zot(o)){zot(n)&&(n=!1),(zot(i)||i<=0)&&(i=1);var l="number"==typeof t?"number":t.constructor===Array?"array":t.constructor==={}.constructor?"object":"invalid";if("invalid"!=l)if("number"==l||"array"==l){if(0==(u=p((h="number"==l?t:t.length)-1)))return;if(n)for(var d=r;d>=a;d-=i){if("number"==l)var c=o(d,u,r,a,t);else c=o(t[d],d,u,r,a,t);if(void 0!==c)return c}else for(d=r;d<=a;d+=i){if("number"==l)c=o(d,u,r,a,t);else c=o(t[d],d,u,r,a,t);if(void 0!==c)return c}}else if("object"==l){var u,h=0,f=[];for(var d in t)h++,f.push(d);if(0==(u=p(h-1)))return;if(n)for(d=r;d>=a;d-=i){if(void 0!==(c=o(f[d],t[f[d]],d,u,r,a,t)))return c}else for(d=r;d<=a;d+=i){if(void 0!==(c=o(f[d],t[f[d]],d,u,r,a,t)))return c}}}function p(e){return zot(r)&&(r=n?e:0),zot(a)&&(a=n?0:e),n&&a>r||!n&&r>a?0:(r<0&&a)<0||r>e&&a>e?0:(r=Math.max(0,Math.min(r,e)),a=Math.max(0,Math.min(a,e)),Math.floor((n?r-a:a-r)/i)+1)}},e.timeout=function(e,t){if(z_d("9.7"),!zot(t)&&"function"==typeof t){zot(e)&&(e=1e3),e=zik(e);var o={startTime:Date.now(),time:0,paused:!1,done:!1},n=o.startTime;return o.pause=function(e){zot(e)&&(e=!0),e?cancelAnimationFrame(o.rid):(n=Date.now(),i()),o.paused=e},o.clear=function(){for(var e in o&&cancelAnimationFrame(o.rid),o)delete o[e];o.pause=function(){},o.clear=function(){}},i(),o}function i(){var r=Date.now();if(o.time+=r-n,n=r,o.time>=e)return o.done=!0,t(o),void o.clear();o.rid=requestAnimationFrame(i)}},e.interval=function(e,t,o,n){if(z_d("9.8"),!zot(t)&&"function"==typeof t&&(zot(e)&&(e=1e3),zot(n)&&(n=!1),zot(o)||!(isNaN(o)||o<=0))){zot(o)&&(o=-1);var i,r={count:0,total:o,paused:!1,time:e,active:!0};return n&&setTimeout(function(){t(r),s()},10),r.pause=function(e,o){zot(e)&&(e=!0),e?(clearTimeout(i),clearTimeout(r.id),cancelAnimationFrame(r.rid),r.pauseTimeLeft=r.interval-(Date.now()-r.startTime)):(i=setTimeout(function(){r.count++,t(r),a(),s()},o?0:r.pauseTimeLeft),r.pauseTimeLeft=null),r.paused=e},r.clear=function(){r.active=!1,clearTimeout(i),cancelAnimationFrame(r.rid),clearTimeout(r.id);var e=r.count;for(var t in r)delete r[t];r.active=!1,r.count=e,r.pause=function(){},r.clear=function(){}},a(),r}function a(){r.startTime=Date.now(),r.interval=zik(r.time),r.id=setTimeout(function(){r.paused||r.active&&(r.rid=requestAnimationFrame(a),r.count++,t(r),s())},r.interval)}function s(){-1!=o&&r.count>=(n?r.total-1:r.total)&&r.clear()}},e.copy=function(t,o){if(z_d("10"),zot(o)&&(o=!1),null==t||!(t instanceof Array||t.constructor=={}.constructor))return o&&t.clone?t.clone():t;if(t instanceof Array){for(var n=[],i=0;i0){var c=String(l).indexOf("."),u=String(l).length;c<0&&(c=u++,l+=".");for(var h=0;h0){-1==d&&(l=l.substr(1,l.length-1));c=String(l).indexOf("."),u=String(l).length;var f=c<0?u:c;for(h=0;h0&&!r&&0==Number(l)&&(l=0),a&&(l=String(l).replace(".",":")),e.zut(s)?l:null},e.sign=function(e){return z_d("13.1"),e?e<0?-1:1:0},e.constrain=function(e,t,o,n){if(z_d("13.2"),!zot(e))return zot(t)&&(t=0),zot(o)&&(o=Number.MAX_VALUE),o.5?a.toUpperCase&&(a=a.toUpperCase()):a.toLowerCase&&(a=a.toLowerCase()),l+=String(a);return l},e.smoothStep=function(t,o,n){z_d("13.7");var i=e.constrain((t-o)/(n-o),0,1);return i*i*i*(i*(6*i-15)+10)},e.Noise=function(e){"use strict";z_d("13.9"),zot(e)&&(e=1e6*Math.random());var t=e;this.seed=e;var o=this,n={};function i(e){var t=new Uint32Array(1);return t[0]=1664525*e[0]+1013904223,t}function r(e,t,o){this.dx=-t-e*n.SQUISH_2D,this.dy=-o-e*n.SQUISH_2D,this.xsb=t,this.ysb=o}function a(e,t,o,i){this.dx=-t-e*n.SQUISH_3D,this.dy=-o-e*n.SQUISH_3D,this.dz=-i-e*n.SQUISH_3D,this.xsb=t,this.ysb=o,this.zsb=i}function s(e,t,o,i,r){this.dx=-t-e*n.SQUISH_4D,this.dy=-o-e*n.SQUISH_4D,this.dz=-i-e*n.SQUISH_4D,this.dw=-r-e*n.SQUISH_4D,this.xsb=t,this.ysb=o,this.zsb=i,this.wsb=r}n.NORM_2D=1/47,n.NORM_3D=1/103,n.NORM_4D=1/30,n.SQUISH_2D=(Math.sqrt(3)-1)/2,n.SQUISH_3D=(Math.sqrt(4)-1)/3,n.SQUISH_4D=(Math.sqrt(5)-1)/4,n.STRETCH_2D=(1/Math.sqrt(3)-1)/2,n.STRETCH_3D=(1/Math.sqrt(4)-1)/3,n.STRETCH_4D=(1/Math.sqrt(5)-1)/4,n.base2D=[[1,1,0,1,0,1,0,0,0],[1,1,0,1,0,1,2,1,1]],n.base3D=[[0,0,0,0,1,1,0,0,1,0,1,0,1,0,0,1],[2,1,1,0,2,1,0,1,2,0,1,1,3,1,1,1],[1,1,0,0,1,0,1,0,1,0,0,1,2,1,1,0,2,1,0,1,2,0,1,1]],n.base4D=[[0,0,0,0,0,1,1,0,0,0,1,0,1,0,0,1,0,0,1,0,1,0,0,0,1],[3,1,1,1,0,3,1,1,0,1,3,1,0,1,1,3,0,1,1,1,4,1,1,1,1],[1,1,0,0,0,1,0,1,0,0,1,0,0,1,0,1,0,0,0,1,2,1,1,0,0,2,1,0,1,0,2,1,0,0,1,2,0,1,1,0,2,0,1,0,1,2,0,0,1,1],[3,1,1,1,0,3,1,1,0,1,3,1,0,1,1,3,0,1,1,1,2,1,1,0,0,2,1,0,1,0,2,1,0,0,1,2,0,1,1,0,2,0,1,0,1,2,0,0,1,1]],n.gradients2D=[5,2,2,5,-5,2,-2,5,5,-2,2,-5,-5,-2,-2,-5],n.gradients3D=[-11,4,4,-4,11,4,-4,4,11,11,4,4,4,11,4,4,4,11,-11,-4,4,-4,-11,4,-4,-4,11,11,-4,4,4,-11,4,4,-4,11,-11,4,-4,-4,11,-4,-4,4,-11,11,4,-4,4,11,-4,4,4,-11,-11,-4,-4,-4,-11,-4,-4,-4,-11,11,-4,-4,4,-11,-4,4,-4,-11],n.gradients4D=[3,1,1,1,1,3,1,1,1,1,3,1,1,1,1,3,-3,1,1,1,-1,3,1,1,-1,1,3,1,-1,1,1,3,3,-1,1,1,1,-3,1,1,1,-1,3,1,1,-1,1,3,-3,-1,1,1,-1,-3,1,1,-1,-1,3,1,-1,-1,1,3,3,1,-1,1,1,3,-1,1,1,1,-3,1,1,1,-1,3,-3,1,-1,1,-1,3,-1,1,-1,1,-3,1,-1,1,-1,3,3,-1,-1,1,1,-3,-1,1,1,-1,-3,1,1,-1,-1,3,-3,-1,-1,1,-1,-3,-1,1,-1,-1,-3,1,-1,-1,-1,3,3,1,1,-1,1,3,1,-1,1,1,3,-1,1,1,1,-3,-3,1,1,-1,-1,3,1,-1,-1,1,3,-1,-1,1,1,-3,3,-1,1,-1,1,-3,1,-1,1,-1,3,-1,1,-1,1,-3,-3,-1,1,-1,-1,-3,1,-1,-1,-1,3,-1,-1,-1,1,-3,3,1,-1,-1,1,3,-1,-1,1,1,-3,-1,1,1,-1,-3,-3,1,-1,-1,-1,3,-1,-1,-1,1,-3,-1,-1,1,-1,-3,3,-1,-1,-1,1,-3,-1,-1,1,-1,-3,-1,1,-1,-1,-3,-3,-1,-1,-1,-1,-3,-1,-1,-1,-1,-3,-1,-1,-1,-1,-3],n.lookupPairs2D=[0,1,1,0,4,1,17,0,20,2,21,2,22,5,23,5,26,4,39,3,42,4,43,3],n.lookupPairs3D=[0,2,1,1,2,2,5,1,6,0,7,0,32,2,34,2,129,1,133,1,160,5,161,5,518,0,519,0,546,4,550,4,645,3,647,3,672,5,673,5,674,4,677,3,678,4,679,3,680,13,681,13,682,12,685,14,686,12,687,14,712,20,714,18,809,21,813,23,840,20,841,21,1198,19,1199,22,1226,18,1230,19,1325,23,1327,22,1352,15,1353,17,1354,15,1357,17,1358,16,1359,16,1360,11,1361,10,1362,11,1365,10,1366,9,1367,9,1392,11,1394,11,1489,10,1493,10,1520,8,1521,8,1878,9,1879,9,1906,7,1910,7,2005,6,2007,6,2032,8,2033,8,2034,7,2037,6,2038,7,2039,6],n.lookupPairs4D=[0,3,1,2,2,3,5,2,6,1,7,1,8,3,9,2,10,3,13,2,16,3,18,3,22,1,23,1,24,3,26,3,33,2,37,2,38,1,39,1,41,2,45,2,54,1,55,1,56,0,57,0,58,0,59,0,60,0,61,0,62,0,63,0,256,3,258,3,264,3,266,3,272,3,274,3,280,3,282,3,2049,2,2053,2,2057,2,2061,2,2081,2,2085,2,2089,2,2093,2,2304,9,2305,9,2312,9,2313,9,16390,1,16391,1,16406,1,16407,1,16422,1,16423,1,16438,1,16439,1,16642,8,16646,8,16658,8,16662,8,18437,6,18439,6,18469,6,18471,6,18688,9,18689,9,18690,8,18693,6,18694,8,18695,6,18696,9,18697,9,18706,8,18710,8,18725,6,18727,6,131128,0,131129,0,131130,0,131131,0,131132,0,131133,0,131134,0,131135,0,131352,7,131354,7,131384,7,131386,7,133161,5,133165,5,133177,5,133181,5,133376,9,133377,9,133384,9,133385,9,133400,7,133402,7,133417,5,133421,5,133432,7,133433,5,133434,7,133437,5,147510,4,147511,4,147518,4,147519,4,147714,8,147718,8,147730,8,147734,8,147736,7,147738,7,147766,4,147767,4,147768,7,147770,7,147774,4,147775,4,149509,6,149511,6,149541,6,149543,6,149545,5,149549,5,149558,4,149559,4,149561,5,149565,5,149566,4,149567,4,149760,9,149761,9,149762,8,149765,6,149766,8,149767,6,149768,9,149769,9,149778,8,149782,8,149784,7,149786,7,149797,6,149799,6,149801,5,149805,5,149814,4,149815,4,149816,7,149817,5,149818,7,149821,5,149822,4,149823,4,149824,37,149825,37,149826,36,149829,34,149830,36,149831,34,149832,37,149833,37,149842,36,149846,36,149848,35,149850,35,149861,34,149863,34,149865,33,149869,33,149878,32,149879,32,149880,35,149881,33,149882,35,149885,33,149886,32,149887,32,150080,49,150082,48,150088,49,150098,48,150104,47,150106,47,151873,46,151877,45,151881,46,151909,45,151913,44,151917,44,152128,49,152129,46,152136,49,152137,46,166214,43,166215,42,166230,43,166247,42,166262,41,166263,41,166466,48,166470,43,166482,48,166486,43,168261,45,168263,42,168293,45,168295,42,168512,31,168513,28,168514,31,168517,28,168518,25,168519,25,280952,40,280953,39,280954,40,280957,39,280958,38,280959,38,281176,47,281178,47,281208,40,281210,40,282985,44,282989,44,283001,39,283005,39,283208,30,283209,27,283224,30,283241,27,283256,22,283257,22,297334,41,297335,41,297342,38,297343,38,297554,29,297558,24,297562,29,297590,24,297594,21,297598,21,299365,26,299367,23,299373,26,299383,23,299389,20,299391,20,299584,31,299585,28,299586,31,299589,28,299590,25,299591,25,299592,30,299593,27,299602,29,299606,24,299608,30,299610,29,299621,26,299623,23,299625,27,299629,26,299638,24,299639,23,299640,22,299641,22,299642,21,299645,20,299646,21,299647,20,299648,61,299649,60,299650,61,299653,60,299654,59,299655,59,299656,58,299657,57,299666,55,299670,54,299672,58,299674,55,299685,52,299687,51,299689,57,299693,52,299702,54,299703,51,299704,56,299705,56,299706,53,299709,50,299710,53,299711,50,299904,61,299906,61,299912,58,299922,55,299928,58,299930,55,301697,60,301701,60,301705,57,301733,52,301737,57,301741,52,301952,79,301953,79,301960,76,301961,76,316038,59,316039,59,316054,54,316071,51,316086,54,316087,51,316290,78,316294,78,316306,73,316310,73,318085,77,318087,77,318117,70,318119,70,318336,79,318337,79,318338,78,318341,77,318342,78,318343,77,430776,56,430777,56,430778,53,430781,50,430782,53,430783,50,431e3,75,431002,72,431032,75,431034,72,432809,74,432813,69,432825,74,432829,69,433032,76,433033,76,433048,75,433065,74,433080,75,433081,74,447158,71,447159,68,447166,71,447167,68,447378,73,447382,73,447386,72,447414,71,447418,72,447422,71,449189,70,449191,70,449197,69,449207,68,449213,69,449215,68,449408,67,449409,67,449410,66,449413,64,449414,66,449415,64,449416,67,449417,67,449426,66,449430,66,449432,65,449434,65,449445,64,449447,64,449449,63,449453,63,449462,62,449463,62,449464,65,449465,63,449466,65,449469,63,449470,62,449471,62,449472,19,449473,19,449474,18,449477,16,449478,18,449479,16,449480,19,449481,19,449490,18,449494,18,449496,17,449498,17,449509,16,449511,16,449513,15,449517,15,449526,14,449527,14,449528,17,449529,15,449530,17,449533,15,449534,14,449535,14,449728,19,449729,19,449730,18,449734,18,449736,19,449737,19,449746,18,449750,18,449752,17,449754,17,449784,17,449786,17,451520,19,451521,19,451525,16,451527,16,451528,19,451529,19,451557,16,451559,16,451561,15,451565,15,451577,15,451581,15,451776,19,451777,19,451784,19,451785,19,465858,18,465861,16,465862,18,465863,16,465874,18,465878,18,465893,16,465895,16,465910,14,465911,14,465918,14,465919,14,466114,18,466118,18,466130,18,466134,18,467909,16,467911,16,467941,16,467943,16,468160,13,468161,13,468162,13,468163,13,468164,13,468165,13,468166,13,468167,13,580568,17,580570,17,580585,15,580589,15,580598,14,580599,14,580600,17,580601,15,580602,17,580605,15,580606,14,580607,14,580824,17,580826,17,580856,17,580858,17,582633,15,582637,15,582649,15,582653,15,582856,12,582857,12,582872,12,582873,12,582888,12,582889,12,582904,12,582905,12,596982,14,596983,14,596990,14,596991,14,597202,11,597206,11,597210,11,597214,11,597234,11,597238,11,597242,11,597246,11,599013,10,599015,10,599021,10,599023,10,599029,10,599031,10,599037,10,599039,10,599232,13,599233,13,599234,13,599235,13,599236,13,599237,13,599238,13,599239,13,599240,12,599241,12,599250,11,599254,11,599256,12,599257,12,599258,11,599262,11,599269,10,599271,10,599272,12,599273,12,599277,10,599279,10,599282,11,599285,10,599286,11,599287,10,599288,12,599289,12,599290,11,599293,10,599294,11,599295,10],n.p2D=[0,0,1,-1,0,0,-1,1,0,2,1,1,1,2,2,0,1,2,0,2,1,0,0,0],n.p3D=[0,0,1,-1,0,0,1,0,-1,0,0,-1,1,0,0,0,1,-1,0,0,-1,0,1,0,0,-1,1,0,2,1,1,0,1,1,1,-1,0,2,1,0,1,1,1,-1,1,0,2,0,1,1,1,-1,1,1,1,3,2,1,0,3,1,2,0,1,3,2,0,1,3,1,0,2,1,3,0,2,1,3,0,1,2,1,1,1,0,0,2,2,0,0,1,1,0,1,0,2,0,2,0,1,1,0,0,1,2,0,0,2,2,0,0,0,0,1,1,-1,1,2,0,0,0,0,1,-1,1,1,2,0,0,0,0,1,1,1,-1,2,3,1,1,1,2,0,0,2,2,3,1,1,1,2,2,0,0,2,3,1,1,1,2,0,2,0,2,1,1,-1,1,2,0,0,2,2,1,1,-1,1,2,2,0,0,2,1,-1,1,1,2,0,0,2,2,1,-1,1,1,2,0,2,0,2,1,1,1,-1,2,2,0,0,2,1,1,1,-1,2,0,2,0],n.p4D=[0,0,1,-1,0,0,0,1,0,-1,0,0,1,0,0,-1,0,0,-1,1,0,0,0,0,1,-1,0,0,0,1,0,-1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,-1,0,0,-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,2,1,1,0,0,1,1,1,-1,0,1,1,1,0,-1,0,2,1,0,1,0,1,1,-1,1,0,1,1,0,1,-1,0,2,0,1,1,0,1,-1,1,1,0,1,0,1,1,-1,0,2,1,0,0,1,1,1,-1,0,1,1,1,0,-1,1,0,2,0,1,0,1,1,-1,1,0,1,1,0,1,-1,1,0,2,0,0,1,1,1,-1,0,1,1,1,0,-1,1,1,1,4,2,1,1,0,4,1,2,1,0,4,1,1,2,0,1,4,2,1,0,1,4,1,2,0,1,4,1,1,0,2,1,4,2,0,1,1,4,1,0,2,1,4,1,0,1,2,1,4,0,2,1,1,4,0,1,2,1,4,0,1,1,2,1,2,1,1,0,0,3,2,1,0,0,3,1,2,0,0,1,2,1,0,1,0,3,2,0,1,0,3,1,0,2,0,1,2,0,1,1,0,3,0,2,1,0,3,0,1,2,0,1,2,1,0,0,1,3,2,0,0,1,3,1,0,0,2,1,2,0,1,0,1,3,0,2,0,1,3,0,1,0,2,1,2,0,0,1,1,3,0,0,2,1,3,0,0,1,2,2,3,1,1,1,0,2,1,1,1,-1,2,2,0,0,0,2,3,1,1,0,1,2,1,1,-1,1,2,2,0,0,0,2,3,1,0,1,1,2,1,-1,1,1,2,2,0,0,0,2,3,1,1,1,0,2,1,1,1,-1,2,0,2,0,0,2,3,1,1,0,1,2,1,1,-1,1,2,0,2,0,0,2,3,0,1,1,1,2,-1,1,1,1,2,0,2,0,0,2,3,1,1,1,0,2,1,1,1,-1,2,0,0,2,0,2,3,1,0,1,1,2,1,-1,1,1,2,0,0,2,0,2,3,0,1,1,1,2,-1,1,1,1,2,0,0,2,0,2,3,1,1,0,1,2,1,1,-1,1,2,0,0,0,2,2,3,1,0,1,1,2,1,-1,1,1,2,0,0,0,2,2,3,0,1,1,1,2,-1,1,1,1,2,0,0,0,2,2,1,1,1,-1,0,1,1,1,0,-1,0,0,0,0,0,2,1,1,-1,1,0,1,1,0,1,-1,0,0,0,0,0,2,1,-1,1,1,0,1,0,1,1,-1,0,0,0,0,0,2,1,1,-1,0,1,1,1,0,-1,1,0,0,0,0,0,2,1,-1,1,0,1,1,0,1,-1,1,0,0,0,0,0,2,1,-1,0,1,1,1,0,-1,1,1,0,0,0,0,0,2,1,1,1,-1,0,1,1,1,0,-1,2,2,0,0,0,2,1,1,-1,1,0,1,1,0,1,-1,2,2,0,0,0,2,1,1,-1,0,1,1,1,0,-1,1,2,2,0,0,0,2,1,1,1,-1,0,1,1,1,0,-1,2,0,2,0,0,2,1,-1,1,1,0,1,0,1,1,-1,2,0,2,0,0,2,1,-1,1,0,1,1,0,1,-1,1,2,0,2,0,0,2,1,1,-1,1,0,1,1,0,1,-1,2,0,0,2,0,2,1,-1,1,1,0,1,0,1,1,-1,2,0,0,2,0,2,1,-1,0,1,1,1,0,-1,1,1,2,0,0,2,0,2,1,1,-1,0,1,1,1,0,-1,1,2,0,0,0,2,2,1,-1,1,0,1,1,0,1,-1,1,2,0,0,0,2,2,1,-1,0,1,1,1,0,-1,1,1,2,0,0,0,2,3,1,1,0,0,0,2,2,0,0,0,2,1,1,1,-1,3,1,0,1,0,0,2,0,2,0,0,2,1,1,1,-1,3,1,0,0,1,0,2,0,0,2,0,2,1,1,1,-1,3,1,1,0,0,0,2,2,0,0,0,2,1,1,-1,1,3,1,0,1,0,0,2,0,2,0,0,2,1,1,-1,1,3,1,0,0,0,1,2,0,0,0,2,2,1,1,-1,1,3,1,1,0,0,0,2,2,0,0,0,2,1,-1,1,1,3,1,0,0,1,0,2,0,0,2,0,2,1,-1,1,1,3,1,0,0,0,1,2,0,0,0,2,2,1,-1,1,1,3,1,0,1,0,0,2,0,2,0,0,2,-1,1,1,1,3,1,0,0,1,0,2,0,0,2,0,2,-1,1,1,1,3,1,0,0,0,1,2,0,0,0,2,2,-1,1,1,1,3,3,2,1,0,0,3,1,2,0,0,4,1,1,1,1,3,3,2,0,1,0,3,1,0,2,0,4,1,1,1,1,3,3,0,2,1,0,3,0,1,2,0,4,1,1,1,1,3,3,2,0,0,1,3,1,0,0,2,4,1,1,1,1,3,3,0,2,0,1,3,0,1,0,2,4,1,1,1,1,3,3,0,0,2,1,3,0,0,1,2,4,1,1,1,1,3,3,2,1,0,0,3,1,2,0,0,2,1,1,1,-1,3,3,2,0,1,0,3,1,0,2,0,2,1,1,1,-1,3,3,0,2,1,0,3,0,1,2,0,2,1,1,1,-1,3,3,2,1,0,0,3,1,2,0,0,2,1,1,-1,1,3,3,2,0,0,1,3,1,0,0,2,2,1,1,-1,1,3,3,0,2,0,1,3,0,1,0,2,2,1,1,-1,1,3,3,2,0,1,0,3,1,0,2,0,2,1,-1,1,1,3,3,2,0,0,1,3,1,0,0,2,2,1,-1,1,1,3,3,0,0,2,1,3,0,0,1,2,2,1,-1,1,1,3,3,0,2,1,0,3,0,1,2,0,2,-1,1,1,1,3,3,0,2,0,1,3,0,1,0,2,2,-1,1,1,1,3,3,0,0,2,1,3,0,0,1,2,2,-1,1,1,1];for(var l=[],d=0;d=0;d--){e=i(e);var z=new Uint32Array(1);z[0]=(e[0]+31)%(d+1),z[0]<0&&(z[0]+=d+1),this.perm[d]=g[z[0]],this.perm2D[d]=14&this.perm[d],this.perm3D[d]=this.perm[d]%24*3,this.perm4D[d]=252&this.perm[d],g[z[0]]=g[d]}this.simplex1D=function(e){return o.simplex2D(e,1)},this.simplex2D=function(e,t){var i=(e+t)*n.STRETCH_2D,r=[e+i,t+i],a=r[0],s=r[1],l=[Math.floor(a),Math.floor(s)],d=l[0],c=l[1],u=(d+c)*n.SQUISH_2D,h=[e-(d+u),t-(c+u)],f=h[0],p=h[1],m=[a-d,s-c],g=m[0],z=m[1],v=g+z,b=new Uint32Array(4);b[0]=g-z+1,b[1]=v,b[2]=v+z,b[3]=v+g;for(var y=b[0]|b[1]<<1|b[2]<<2|b[3]<<4,w=o.lookup2D[y],x=0;void 0!==w;){var C=[f+w.dx,p+w.dy],T=C[0],k=C[1],E=2-T*T-k*k;if(E>0){var M=[d+w.xsb,c+w.ysb],j=M[0],S=M[1],A=o.perm2D[o.perm[255&j]+S&255];x+=(E*=E)*E*(n.gradients2D[A]*T+n.gradients2D[A+1]*k)}w=w.next}return x*n.NORM_2D},this.simplex3D=function(e,t,i){var r=(e+t+i)*n.STRETCH_3D,a=[e+r,t+r,i+r],s=a[0],l=a[1],d=a[2],c=[Math.floor(s),Math.floor(l),Math.floor(d)],u=c[0],h=c[1],f=c[2],p=(u+h+f)*n.SQUISH_3D,m=[e-(u+p),t-(h+p),i-(f+p)],g=m[0],z=m[1],v=m[2],b=[s-u,l-h,d-f],y=b[0],w=b[1],x=b[2],C=y+w+x,T=new Uint32Array(7);T[0]=w-x+1,T[1]=y-w+1,T[2]=y-x+1,T[3]=C,T[4]=C+x,T[5]=C+w,T[6]=C+y;for(var k=T[0]|T[1]<<1|T[2]<<2|T[3]<<3|T[4]<<5|T[5]<<7|T[6]<<9,E=o.lookup3D[k],M=0;void 0!==E;){var j=[g+E.dx,z+E.dy,v+E.dz],S=j[0],A=j[1],P=j[2],O=2-S*S-A*A-P*P;if(O>0){var I=[u+E.xsb,h+E.ysb,f+E.zsb],D=I[0],B=I[1],L=I[2],X=o.perm3D[o.perm[o.perm[255&D]+B&255]+L&255];M+=(O*=O)*O*(n.gradients3D[X]*S+n.gradients3D[X+1]*A+n.gradients3D[X+2]*P)}E=E.next}return M*n.NORM_3D},this.simplex4D=function(e,t,i,r){var a=(e+t+i+r)*n.STRETCH_4D,s=[e+a,t+a,i+a,r+a],l=s[0],d=s[1],c=s[2],u=s[3],h=[Math.floor(l),Math.floor(d),Math.floor(c),Math.floor(u)],f=h[0],p=h[1],m=h[2],g=h[3],z=(f+p+m+g)*n.SQUISH_4D,v=e-(f+z),b=t-(p+z),y=i-(m+z),w=r-(g+z),x=[l-f,d-p,c-m,u-g],C=x[0],T=x[1],k=x[2],E=x[3],M=C+T+k+E,j=new Uint32Array(11);j[0]=k-E+1,j[1]=T-k+1,j[2]=T-E+1,j[3]=C-T+1,j[4]=C-k+1,j[5]=C-E+1,j[6]=M<<6,j[7]=M+E,j[8]=M+k,j[9]=M+T,j[10]=M+C;for(var S=j[0]|j[1]<<1|j[2]<<2|j[3]<<3|j[4]<<4|j[5]<<5|j[6]<<6|j[7]<<8|j[8]<<11|j[9]<<14|j[10]<<17,A=o.lookup4D[S],P=0;void 0!==A;){var O=[v+A.dx,b+A.dy,y+A.dz,w+A.dw],I=O[0],D=O[1],B=O[2],L=O[3],X=2-I*I-D*D-B*B-L*L;if(X>0){var Y=[f+A.xsb,p+A.ysb,m+A.zsb,g+A.wsb],_=Y[0],R=Y[1],W=Y[2],N=Y[3],F=o.perm4D[o.perm[o.perm[o.perm[255&_]+R&255]+W&255]+N&255];P+=(X*=X)*X*(n.gradients4D[F]*I+n.gradients4D[F+1]*D+n.gradients4D[F+2]*B+n.gradients4D[F+3]*L)}A=A.next}return P*n.NORM_4D}},e.Damp=function(t,o){z_d("14");var n;if(n=zob(e.Damp,arguments,"startValue, damp",this))return n;this.lastValue=zot(t)?0:t,this.damp=zot(o)?.1:o},e.Damp.prototype.convert=function(e){return this.lastValue=this.lastValue+(e-this.lastValue)*this.damp},e.Damp.prototype.immediate=function(e){return this.lastValue=e,this},e.Proportion=function(t,o,n,i,r,a){var s,l,d;if(s=zob(e.Proportion,arguments,"baseMin, baseMax, targetMin, targetMax, factor, targetRound",this))return s;z_d("15"),zot(n)&&(n=0),zot(i)&&(i=1),zot(r)&&(r=1),zot(a)&&(a=!1),this.convert=function(e){if(!isNaN(e))return e=Math.max(e,t),e=Math.min(e,o),l=(e-t)/(o-t),d=r>0?n+(i-n)*l:i-(i-n)*l,a&&(d=Math.round(d)),d}},e.ProportionDamp=function(t,o,n,i,r,a,s){var l;if(l=zob(e.ProportionDamp,arguments,"baseMin, baseMax, targetMin, targetMax, damp, factor, targetRound",this))return l;z_d("16"),zot(n)&&(n=0),zot(i)&&(i=1),zot(r)&&(r=.1),zot(a)&&(a=1),zot(s)&&(s=!1),this.damp=r;var d,c,u,h,f=this,p=0;d=t,p=n;var m=setInterval(g,20);function g(){isNaN(d)||(d=Math.max(d,t),d=Math.min(d,o),c=(d-t)/(o-t),u=i-n,p+=((h=a>0?n+u*c:i-u*c)-p)*f.damp)}this.immediate=function(e){return f.convert(e),g(),p=h,s&&(p=Math.round(p)),f},this.convert=function(e){return d=e,s?Math.round(p):p},this.dispose=function(){return clearInterval(m),!0}},e.Dictionary=function(e){z_d("17"),this.length=0,this.unique=e;var t=this.objects=[],o=this.values=[];this.add=function(e,n){zot(e)||(zot(n)&&(n=!0),this.unique&&this.remove(e),t.push(e),o.push(n),this.length++)},this.at=function(e){if(!zot(e)){var n=t.indexOf(e);return n>-1?o[n]:null}},this.remove=function(e){if(zot(e))return!1;var n=t.indexOf(e);return n>-1&&(t.splice(n,1),o.splice(n,1),this.length--,!0)},this.dispose=function(){return t=null,o=null,this.length=null,!0}},e.swapProperties=function(e,t,o){if(z_d("17.1"),zot(t)||zot(o)||zot(t[e])||zot(o[e]))return!1;var n=o[e];return o[e]=t[e],t[e]=n,!0},e.swapHTML=function(t,o){return z_d("17.2"),e.swapProperties("innerHTML",zid(t),zid(o))},e.scrollX=function(t,o){return z_d("18"),e.abstractScroll("X","Left",t,o)},e.scrollY=function(t,o){return z_d("19"),e.abstractScroll("Y","Top",t,o)},e.abstractScroll=function(t,o,n,i){z_d("20");var r="X"==t?"Y":"X";if(zot(n)){var a=navigator.applicationName;if(-1!=navigator.userAgent.indexOf("Safari")||"Safari"==a);return document.documentElement&&document.documentElement["scroll"+o]||document.body["scroll"+o]}if(zot(i))window.scrollTo(e["scroll"+r](),n);else{i<50&&(i=50);var s=i/50,l=e["scroll"+t](),d=(n-l)/s,c=0,u=setInterval(function(){c++,l+=d,window.scrollTo(e["scroll"+r](),l),c>=s&&(window.scrollTo(e["scroll"+r](),n),clearInterval(u))},50)}return n},e.windowWidth=function(){return z_d("21"),isNaN(window.innerWidth)?window.clientWidth:window.innerWidth},e.windowHeight=function(){return z_d("22"),isNaN(window.innerHeight)?window.clientHeight:window.innerHeight},e.getQueryString=function(e){if(z_d("22.5"),zot(e)&&(e=location.search.replace("?","")),""!=e){for(var t=e.split("&"),o={},n=0;n= 4.3.0 requires createjs namespace to be loaded (import createjs before zim)"),e;function t(e,t){t?(e.mouseChildren=!0,e.mouseEnabled=!0,e._enabled=!0):(e.mouseChildren=!1,e.mouseEnabled=!1,e._enabled=!1)}e.Stage=function(t){z_d("50.44"),this.cjsStage_constructor(t),this.type="Stage",this.cache=function(e,t,o,n,i,r){if(zot(o)||zot(t)||zot(o)||zot())if(zot(e)){var a=this.getBounds();if(!zot(a)){var s=this.borderWidth>0?this.borderWidth/2:0;e=a.x-s,t=a.y-s,o=a.width+2*s,n=a.height+2*s}}else o=e,n=t,e=0,t=0;return this.cjsStage_cache(e,t,o,n,i,r),this},this.loop=function(t,o,n,i,r){return e.loop(this,t,o,n,i,r)},this.clone=function(){return this.cloneChildren(this.cloneProps(new e.Stage(t)))}},e.extend(e.Stage,createjs.Stage,["cache","clone"],"cjsStage",!1),e.StageGL=function(t,o){z_d("50.45"),this.cjsStageGL_constructor(t,o),this.type="StageGL",this.cache=function(e,t,o,n,i,r){if(zot(o)||zot(t)||zot(o)||zot())if(zot(e)){var a=this.getBounds();if(!zot(a)){var s=this.borderWidth>0?this.borderWidth/2:0;e=a.x-s,t=a.y-s,o=a.width+2*s,n=a.height+2*s}}else o=e,n=t,e=0,t=0;return this.cjsStageGL_cache(e,t,o,n,i,r),this},this.loop=function(t,o,n,i,r){return e.loop(this,t,o,n,i,r)},this.clone=function(){return this.cloneChildren(this.cloneProps(new e.StageGL(t)))}},e.extend(e.StageGL,createjs.StageGL,["cache","clone"],"cjsStageGL",!1),e.Container=function(t,o,n,i){if(z_d("50.5"),this.cjsContainer_constructor(),this.type="Container",zot(n))r=0,a=t,s=0,l=o;else var r=t,a=n,s=o,l=i;zot(l)&&(l=a),zot(t)||this.setBounds(r,s,a,l),this.cache=function(e,t,o,n,i,r){if(zot(o))if(zot(e)){var a=this.getBounds();if(!zot(a)){var s=this.borderWidth>0?this.borderWidth/2:0;e=a.x-s,t=a.y-s,o=a.width+2*s,n=a.height+2*s}}else o=e,n=t,e=0,t=0;return this.cjsContainer_cache(e,t,o,n,i,r),this},this.clone=function(){return this.cloneChildren(this.cloneProps(new e.Container(r,s,a,l)))}},zimify(e.Container.prototype),e.extend(e.Container,createjs.Container,["cache","clone"],"cjsContainer",!1),e.Shape=function(t,o,n,i,r){z_d("50.6"),this.cjsShape_constructor(r),this.type="Shape";var a=this;if(zot(n))s=0,l=t,d=0,c=o;else var s=t,l=n,d=o,c=i;zot(c)&&(c=l),zot(t)||this.setBounds(s,d,l,c),this.cache=function(e,t,o,n,i,r){if(zot(o))if(zot(e)){var a=this.getBounds();if(!zot(a)){var s=this.borderWidth>0?this.borderWidth/2:0;e=a.x-s,t=a.y-s,o=a.width+2*s,n=a.height+2*s}}else o=e,n=t,e=0,t=0;return this.cjsShape_cache(e,t,o,n,i,r),this},this.clone=function(t){zot(t)&&(t=!0);var o=a.cloneProps(new e.Shape(l,c,s,d,r));return o.graphics=t?a.graphics.clone():a.graphics,o}},e.extend(e.Shape,createjs.Shape,["cache","clone"],"cjsShape",!1),zimify(e.Shape.prototype),e.Bitmap=function(t,o,n,i){z_d("50.7"),this.cjsBitmap_constructor(t);var r=this;this.type="Bitmap",this.id=this.fileID=i,zot(o)||zot(n)||r.setBounds(0,0,o,n),zot(o)&&(o=100),zot(n)&&(n=100),zimDefaultFrame&&(this.imageData=zimDefaultFrame.canvas.getContext("2d").createImageData(o,n),this.drawImageData=function(e,i,a,s,l,d){if(zot(e)&&(e=0),zot(i)&&(i=0),zot(a)&&(a=0),zot(s)&&(s=0),zot(l)&&(l=o),zot(d)&&(d=n),!r.proxyCanvas){var c=r.proxyCanvas=document.createElement("canvas");c.setAttribute("width",o),c.setAttribute("height",n),r.proxyContext=c.getContext("2d"),t=r.image=c}r.proxyContext&&r.proxyContext.putImageData(r.imageData,e,i,a,s,l,d)},zot(t)&&r.drawImageData()),this.clone=function(){return this.cloneProps(new e.Bitmap(t,o,n,r.fileID))}},e.extend(e.Bitmap,createjs.Bitmap,"clone","cjsBitmap",!1),zimify(e.Bitmap.prototype),e.Sprite=function(t,o,n,i,r,a,s,l,d,c,u,h,f,p,m){var g;if(g=zob(e.Sprite,arguments,"image, cols, rows, count, offsetX, offsetY, spacingX, spacingY, width, height, animations, json, id, globalControl, spriteSheet",this))return g;this.type="Sprite",z_d("50.8");var z,v=this;if(zot(h)&&!zot(t)){zot(o)&&(o=1),zot(n)&&(n=1),zot(i)&&(i=o*n),zot(r)&&(r=0),zot(a)&&(a=0),zot(s)&&(s=0),zot(l)&&(l=0),zot(d)&&(d=t.width),zot(c)&&(c=t.height);var b=(d-r+s)/o-s,y=(c-a+l)/n-l,w=[],x=0;e:for(var C=0;Ci)break e;w.push([r+T*(b+s),a+C*(y+l),b,y])}var k={images:[t.image],frames:w,animations:u};z=new createjs.SpriteSheet(k)}else m?u=(z=m).animations:(u=h.animations,z=new createjs.SpriteSheet(h));this.animations=u,this.cjsSprite_constructor(z),zot(f)&&(f=e.makeID()),this.id=f,zot(p)&&(p=!0),v.globalControl=p;var E,M=0;this.parseFrames=function(t,o,n,i){var r=[],a=Number.MAX_VALUE,s=0;if(zot(t))zot(o)&&(o=0),zot(n)&&(n=v.totalFrames-1),d(o,n);else{if(zot(v.animations)||zot(v.animations[t]))return[];l(v.animations[t])}function l(e){var t;Array.isArray(e)?(d((t=e)[0],t[1],t[3]),t[2]&&!zot(v.animations[t[2]])&&l(v.animations[t[2]])):e.constructor=={}.constructor?function(e){if(zot(e.frames))return;zot(e.speed)&&(e.speed=1);for(var t=0;ts&&(s=e.speed),r.push({f:e.frames[t],s:e.speed});e.next&&!zot(v.animations[e.next])&&l(v.animations[e.next])}(e):isNaN(e)||r.push({f:Math.floor(e),s:1})}function d(e,t,o){if(zot(o)&&(o=1),t>e)for(var n=e;n<=t;n++)i(n);else for(n=t;n<=e;n++)i(e-n);function i(e){os&&(s=o),r.push({f:e,s:o})}}if(i)return r;a=e.constrain(e.decimals(a),.1),s=e.constrain(e.decimals(s),.1);for(var c,u=[],h=a!=s,f=0;f0&&(D=L/(C-x)/2)}if(0==A.length)return this;1==A.length?(t=A[0].time,o=O,X()):v.gotoAndStop(I)}else X();function X(){E=v.parseFrames(o,x,C),M=0,v.gotoAndStop(E[M]),x=C=null,A={normalizedFrame:E.length-1}}if(zot(t)&&(t=1e3),v.running&&v.stopAnimate(v.id),v.running=!0,!Array.isArray(A)){D=0;C-x>0&&(D=t/Math.abs(C-x)/2),E&&E.length>0&&(D=t/E.length/2),zot(c)&&(c=D*T),zot(g)&&(g=D*T)}return e.animate({target:v,obj:A,time:t,ease:"linear",call:function(){n&&"function"==typeof n&&n(i),v.running=!1},params:i,wait:r,waitedCall:a,waitedParams:s,loop:l,loopCount:d,loopWait:c,loopCall:u,loopParams:h,loopWaitCall:f,loopWaitParams:p,rewind:m,rewindWait:g,rewindCall:z,rewindParams:b,rewindWaitCall:y,rewindWaitParams:w,override:!1,id:v.id}),v.runPaused=!1,v},this.runPaused=!0,this.pauseRun=function(t){return zot(t)&&(t=!0),v.runPaused=t,v.globalControl?e.pauseAnimate(t,v.id):v.pauseAnimate(t,v.id),v},this.stopRun=function(){return v.runPaused=!0,v.running=!1,v.globalControl?e.stopAnimate(v.id):v.stopAnimate(v.id),v},Object.defineProperty(this,"frame",{get:function(){return this.currentFrame},set:function(e){e=Math.round(e),this.paused?this.gotoAndStop(e):this.gotoAndPlay(e)}}),Object.defineProperty(this,"normalizedFrame",{get:function(){return M},set:function(e){M=Math.round(e),this.gotoAndStop(E[M])}}),Object.defineProperty(this,"normalizedFrames",{get:function(){return E},set:function(e){E=e}}),Object.defineProperty(this,"totalFrames",{get:function(){return z.getNumFrames()},set:function(e){zog("zim.Sprite - totalFrames is read only")}}),this.clone=function(){return this.cloneProps(new e.Sprite(t,o,n,i,r,a,s,l,d,c,u,h,null,p,m))}},e.extend(e.Sprite,createjs.Sprite,"clone","cjsSprite",!1),zimify(e.Sprite.prototype),e.MovieClip=function(t,o,n,i){var r;if(r=zob(e.MovieClip,arguments,"mode, startPosition, loop, labels",this))return r;this.type="MovieClip",z_d("50.9"),this.cjsMovieClip_constructor(t,o,n,i),this.clone=function(){return this.cloneProps(new e.MovieClip(t,o,n,i))}},e.extend(e.MovieClip,createjs.MovieClip,"clone","cjsMovieClip",!1),zimify(e.MovieClip.prototype),e.Circle=function(t,o,n,i,r){var a;if(a=zob(e.Circle,arguments,"radius, color, borderColor, borderWidth, dashed",this))return a;z_d("51"),this.zimContainer_constructor(),this.type="Circle",zot(t)&&(t=50),zot(r)&&(r=!1),!zot(n)&&zot(i)?i=1:!zot(i)&&zot(n)&&(n="black"),zot(o)&&(o=i>0?"rgba(0,0,0,0)":"black");var s=this,l=t,d=o,c=n,u=i;this.mouseChildren=!1;var h=this.shape=new createjs.Shape;this.addChild(h);var f,p,m,g,z=h.graphics;function v(){z.c(),s.colorCommand=f=z.f(d).command,(zot(u)||u>0)&&(zot(c)&&zot(u)||(zot(c)&&(c="black"),s.borderColorCommand=p=z.s(c).command,s.borderWidthCommand=m=z.ss(u).command,r&&(s.borderDashedCommand=g=z.sd([10,10],5).command))),z.dc(0,0,l),s.setBounds(-l,-l,2*l,2*l)}v(),Object.defineProperty(s,"color",{get:function(){return d},set:function(e){zot(e)&&(e="black"),d=e,f.style=d}}),Object.defineProperty(s,"borderColor",{get:function(){return c},set:function(e){c=e,p?p.style=c:v()}}),Object.defineProperty(s,"borderWidth",{get:function(){return u},set:function(e){e>0||(e=0),u=e,m&&0!=u?(m.width=u,r&&(g.segments=[20,10],g.offset=5)):v()}}),Object.defineProperty(s,"radius",{get:function(){return l},set:function(e){l=e,v()}}),this.clone=function(){return s.cloneProps(new e.Circle(s.radius,s.color,s.borderColor,s.borderWidth,r))}},e.extend(e.Circle,e.Container,"clone","zimContainer",!1),e.Rectangle=function(t,o,n,i,r,a,s,l){var d;if(d=zob(e.Rectangle,arguments,"width, height, color, borderColor, borderWidth, corner, flatBottom, dashed",this))return d;z_d("52"),this.zimContainer_constructor(),this.type="Rectangle",zot(t)&&(t=100),zot(o)&&(o=100),zot(a)&&(a=0),zot(s)&&(s=!1),zot(l)&&(l=!1),!zot(i)&&zot(r)?r=1:!zot(r)&&zot(i)&&(i="black"),zot(n)&&(n=r>0?"rgba(0,0,0,0)":"black");var c=this,u=n,h=i,f=r;this.mouseChildren=!1;var p=this.shape=new createjs.Shape;this.addChild(p);var m,g,z,v=p.graphics;function b(){v.c(),c.colorCommand=m=v.f(u).command,(zot(f)||f>0)&&(zot(h)&&zot(f)||(zot(h)&&(h="black"),c.borderColorCommand=g=v.s(h).command,c.borderWidthCommand=z=v.ss(f).command,l&&(c.borderDashedCommand=borderDashedObj=v.sd([10,10],5).command))),s?v.rc(0,0,t,o,a,a,0,0):a>0?v.rr(0,0,t,o,a):v.r(0,0,t,o),c.setBounds(0,0,t,o)}b(),Object.defineProperty(c,"color",{get:function(){return u},set:function(e){zot(e)&&(e="black"),u=e,m.style=u}}),Object.defineProperty(c,"borderColor",{get:function(){return h},set:function(e){h=e,g?g.style=h:b()}}),Object.defineProperty(c,"borderWidth",{get:function(){return f},set:function(e){e>0||(e=0),f=e,z&&0!=f?(z.width=f,l&&(borderDashedObj.segments=[20,10],borderDashedObj.offset=5)):b()}}),this.clone=function(){return c.cloneProps(new e.Rectangle(t,o,c.color,c.borderColor,c.borderWidth,a,s,l))}},e.extend(e.Rectangle,e.Container,"clone","zimContainer",!1),e.Triangle=function(t,o,n,i,r,a,s,l,d){var c;if(c=zob(e.Triangle,arguments,"a, b, c, color, borderColor, borderWidth, center, adjust, dashed",this))return c;z_d("53"),this.zimContainer_constructor(),this.type="Triangle",zot(t)&&(t=100),zot(o)&&(o=t),zot(n)&&(n=o),-1==n&&(n=Math.sqrt(Math.pow(t,2)+Math.pow(o,2))),zot(s)&&(s=!0),zot(l)&&(l=0),!zot(r)&&zot(a)?a=1:!zot(a)&&zot(r)&&(r="black"),zot(i)&&(i=a>0?"rgba(0,0,0,0)":"black");var u=this,h=i,f=r,p=a;this.mouseChildren=!1;var m=[t,o,n];m.sort(function(e,t){return t-e}),aa=m[0],bb=m[1],cc=m[2];var g=[m.indexOf(t),m.indexOf(o),m.indexOf(n)];if(aa>bb+cc)zog("zim display - Triangle(): invalid triangle lengths");else{var z=this.shape=new createjs.Shape;this.addChild(z);var v,b,y,w=z.graphics;x(),Object.defineProperty(u,"color",{get:function(){return h},set:function(e){zot(e)&&(e="black"),h=e,v.style=h}}),Object.defineProperty(u,"borderColor",{get:function(){return f},set:function(e){f=e,b?b.style=f:x()}}),Object.defineProperty(u,"borderWidth",{get:function(){return p},set:function(e){e>0||(e=0),p=e,y&&0!=p?(y.width=p,d&&(borderDashedObj.segments=[20,10],borderDashedObj.offset=5)):x()}}),this.clone=function(){return u.cloneProps(new e.Triangle(t,o,n,u.color,u.borderColor,u.borderWidth,s,l,d))}}function x(){w.c(),u.colorCommand=v=w.f(h).command,(zot(p)||p>0)&&(zot(f)&&zot(p)||(zot(f)&&(f="black"),u.borderColorCommand=b=w.s(f).command,u.borderWidthCommand=y=w.ss(p).command,d&&(u.borderDashedCommand=borderDashedObj=w.sd([10,10],5).command))),w.mt(0,0),u.one={x:0,y:0},w.lt(t,0),u.two={x:t,y:0};var e=180*Math.acos((Math.pow(bb,2)+Math.pow(cc,2)-Math.pow(aa,2))/(2*bb*cc))/Math.PI,n=180*Math.asin(bb*Math.sin(e*Math.PI/180)/aa)/Math.PI,i=[e,n,180-e-n];u.angles=[i[g[1]],i[g[2]],i[g[0]]];var r=u.angles[1],a=Math.cos(r*Math.PI/180)*o,c=Math.sin(r*Math.PI/180)*o,m=Math.max(t,t-a),x=c;u.setBounds(0,0,m,x),z.y=x,w.lt(t-a,0-c),u.three={x:t-a,y:0-c},w.cp(),s&&(u.regX=m/2,u.regY=x/2),l&&(u.shape.y+=l)}},e.extend(e.Triangle,e.Container,"clone","zimContainer"),e.Squiggle=function(t,o,n,i,r,a,s,l,d,c,u,h,f,p,m){var g;if(g=zob(e.Squiggle,arguments,"color, thickness, points, length, controlLength, controlType, lockControlType, showControls, lockControls, handleSize, toggle, move, ctrlclick, dashed, onTop",this))return g;z_d("53.2"),zot(o)&&(o=6),zot(i)&&(i=300),zot(n)&&(n=5);var z="number"==typeof n?n:n.length;if(0!=z){zot(r)&&(r=i/z),this.zimContainer_constructor(i,r),this.type="Squiggle",zot(p)&&(p=!1),zot(t)&&(t=frame.blue),t.style&&(this.colorCommand=t,t="black"),zot(a)&&(a="mirror"),zot(s)&&(s=!1),zot(l)&&(l=!0);var v=l;zot(d)&&(d=!1),zot(c)&&(c=e.mobile()?20:10),zot(u)&&(u=!0),zot(h)&&(h=!0),zot(f)&&(f=!1),this.toggle=u,this.move=h,this.lockControlType=s,this.ctrlclick=f,this.num=z,zot(m)&&(m=!0);var b,y,w,x,C,T,k,E,M,j=this,S=(this.types=["mirror","straight","free","none"],t),A=o,P=j.move;I(),Object.defineProperty(j,"move",{get:function(){return h},set:function(e){h!=e&&(h=e,e?D():B())}}),Object.defineProperty(j,"toggle",{get:function(){return u},set:function(e){u!=e&&((u=e)?j.move&&D():!v&&j.move&&B())}});var O=d;Object.defineProperty(j,"lockControls",{get:function(){return O},set:function(e){O=e,e?(j.controls.mouseChildren=!1,j.controls.mouseEnabled=!1):(j.controls.mouseChildren=!0,j.controls.mouseEnabled=!0)}}),j.lockControls=O,Object.defineProperty(j,"controlsVisible",{get:function(){return v},set:function(e){v=e,e?j.showControls():j.hideControls()}}),Object.defineProperty(j,"color",{get:function(){return S},set:function(e){zot(e)&&(e="black"),S=e,y.style=S}}),Object.defineProperty(j,"thickness",{get:function(){return A},set:function(e){e>0||(e=0),A=e,w&&0!=A?(w.width=A,p&&(x.segments=[20,10],x.offset=5)):drawShape()}}),Object.defineProperty(j,"points",{get:function(){for(var t,o,n=[],i=0;i0?"rgba(0,0,0,0)":frame.green),t.style&&(this.colorCommand=t,t="black"),o&&o.style&&(this.borderColorCommand=o,o="black"),zot(i)&&(i=4);var v="number"==typeof i?i:i.length;zot(a)&&(a=4*r/v),zot(s)&&(s="straight"),zot(l)&&(l=!1),zot(d)&&(d=!0);var b=d;zot(c)&&(c=!1),zot(u)&&(u=e.mobile()?20:10),zot(h)&&(h=!0),zot(f)&&(f=!0),zot(p)&&(p=!1),this.toggle=h,this.move=f,this.lockControlType=l,this.ctrlclick=p,this.num=v,zot(g)&&(g=!0);var y,w,x,C,T,k,E,M,j,S,A=this,P=(this.types=["mirror","straight","free","none"],t),O=o,I=n,D=A.move;function B(){if(!((v="number"==typeof i?i:i.length)<=0)){a=4*r/v,E=A.shape=(new e.Shape).addTo(A);var t=A.sticks=(new e.Shape).addTo(A),o=E.graphics;o.c();var n=t.graphics;n.c();var h,p,z,D,B,Y,_,R,W=u/10*8,N=u,F=e.mobile(),V=A.controls=(new e.Container).addTo(A).drag({onTop:!F});y=[],k=[];for(var H=0;H0)&&(zot(O)&&zot(I)||(zot(O)&&(O="black"),A.borderColorCommand||(A.borderColorCommand=x=o.s(O).command),A.borderWidthCommand||(A.borderWidthCommand=C=o.ss(I).command),m&&(A.borderDashedCommand||(A.borderDashedCommand=T=o.sd([10,10],5).command))));var e=(a=y[0][0]).localToLocal(y[0][1].x,y[0][1].y,E);o.mt(e.x,e.y),n.c().s(frame.darker).ss(1);for(var t=0;t0||(e=0),I=e,C&&0!=I?(C.width=I,m&&(T.segments=[20,10],T.offset=5)):drawShape()}}),Object.defineProperty(A,"points",{get:function(){for(var t,o,n=[],i=0;i0){var S=this.outlineLabel=j.clone();S.color=m,S.outline=g,this.addChild(S)}function A(){var t,o=j.getBounds();if("top"==c?(j.y=n-n/6,S&&(S.y=n-n/6),t=0):"center"==c||"middle"==c?(t=-o.height/2,j.y=.3*n,S&&(S.y=.3*n)):t=-o.height,p){var i=p.getBounds();M.setBounds(i.x,i.y,i.width,i.height)}else zot(z)?(M.setBounds(o.x,t,o.width,o.height),P.graphics.c().f("black").r(M.getBounds().x,M.getBounds().y,M.getBounds().width,M.getBounds().height)):(M.setBounds(o.x,t,o.width,o.height),M.removeChild(M.background),M.background=new e.Rectangle(M.getBounds().width+2*C,M.getBounds().height+2*T,z,v,b,y,null,w),e.center(M.background,M,0));e.center(j,M),j.y+=n/32,S&&(e.center(S,M,0),S.y+=n/32)}if(-1!=s&&l>0&&(j.shadow=new createjs.Shadow(s,3,3,l)),this.addChild(j),zot(p)&&zot(z)){var P=new createjs.Shape;M.hitArea=P}A(),zot(p)||(this.backing=p,e.center(p,this,0)),Object.defineProperty(M,"text",{get:function(){return" "==j.text&&E?"":j.text},set:function(e){E=!1,""===e&&(e=" ",E=!0),j.text=String(e),S&&(S.text=String(e)),A()}}),Object.defineProperty(M,"color",{get:function(){return r},set:function(t){a==r&&(a=t),r=t,j.color=r,e.OPTIMIZE||!zns&&OPTIMIZE||!M.stage||M.stage.update()}}),Object.defineProperty(M,"outlineColor",{get:function(){return m},set:function(t){m=t,S&&(S.color=m),e.OPTIMIZE||!zns&&OPTIMIZE||!M.stage||M.stage.update()}}),Object.defineProperty(M,"rollColor",{get:function(){return a},set:function(e){a=e}}),this._enabled=!0,Object.defineProperty(M,"enabled",{get:function(){return M._enabled},set:function(o){t(M,o),j.color=r,M.mouseChildren=!1,e.OPTIMIZE||!zns&&OPTIMIZE||!M.stage||M.stage.update()}}),this.showRollColor=function(e){return zot(e)&&(e=!0),j.color=e?a:r,M.stage&&M.stage.update(),M},this.on("mouseover",function(e){M.showRollColor()}),this.on("mouseout",function(e){M.showRollColor(!1)}),this.clone=function(){return M.cloneProps(new e.Label(M.text,n,i,r,a,s,l,d,c,u,h,f,zot(p)?null:p.clone(),m,g,z,v,b,y,w,x,C,T))},this.dispose=function(){return M.removeAllEventListeners(),!0}},e.extend(e.Label,e.Container,"clone","zimContainer"),e.Button=function(o,n,i,r,a,s,l,d,c,u,h,f,p,m,g,z,v,b,y,w,x,C,T,k,E,M,j,S,A,P,O,I){var D;if(D=zob(e.Button,arguments,"width, height, label, color, rollColor, borderColor, borderRollColor, borderWidth, corner, shadowColor, shadowBlur, hitPadding, gradient, gloss, flatBottom, dashed, backing, rollBacking, rollPersist, icon, rollIcon, toggle, rollToggle, toggleEvent, wait, waitTime, waitColor, rollWaitColor, waitTextColor, rollWaitTextColor, waitModal, waitEnabled",this))return D;z_d("55"),this.zimContainer_constructor(),this.type="Button",zot(o)&&(o=200),zot(n)&&(n=60),zot(r)&&(r="#C60"),zot(a)&&(a="#F93"),zot(j)&&(j=r),zot(S)&&(S=a),zot(s)&&(s=null),zot(l)&&(l=zot(s)?null:s),zot(d)&&(d=null),zot(c)&&(c=20),zot(u)&&(u="rgba(0,0,0,.3)"),zot(h)&&(h=14),zot(f)&&(f=0),zot(p)&&(p=0),zot(m)&&(m=0),zot(g)&&(g=!1),zot(i)&&(i=zot(w)?"PRESS":""),!zot(C)&&zot(k)&&(k=e.mobile()?"mousedown":"click"),"string"!=typeof i&&"number"!=typeof i||(i=new e.Label(i,36,"arial","white",null,null,null,"center","middle")),zot(y)&&(y=!1),this.rollPersist=y,zot(z)&&(z=!1),zot(C)||"Label"!=C.type||zon&&zog("ZIM Button() - do not pass Label to toggle parameter - just pass a String");var B,L=this;this.mouseChildren=!1,this.cursor="pointer",L.focus=!1,zot(v)?B=new e.Rectangle(o,n,r,s,d,c,g,z):((B=v).x=o/2,B.y=n/2,zot(b)||(b.x=o/2,b.y=n/2,this.rollBacking=b)),this.addChild(B),this.backing=B,zot(w)||(this.addChild(w),w.x=o/2,w.y=n/2,this.icon=w),zot(x)||(this.rollIcon=x,x.x=o/2,x.y=n/2);var X,Y,_=g?0:c;if(p>0&&zot(v)){var R=new createjs.Shape;R.graphics.lf(["rgba(255,255,255,"+p+")","rgba(0,0,0,"+p+")"],[0,1],0,0,0,n-d),R.graphics.rc(d/2,d/2,o-d,n-d,c,c,_,_),B.addChild(R)}if(m>0&&zot(v)){var W=new createjs.Shape;W.graphics.f("rgba(255,255,255,"+m+")"),W.graphics.rc(d/2,d/2,o-d,(n-d)/2,c,c,0,0),W.graphics.f("rgba(0,0,0,"+m+")"),W.graphics.rc(d/2,n/2,o-d,(n-d)/2,0,0,_,_),B.addChild(W)}function N(){(Y=new createjs.Shape).graphics.f("#000").r(-f,-f,o+2*f,n+2*f),L.hitArea=X=Y}f>0&&N(),-1!=u&&h>0&&(B.shadow=new createjs.Shadow(u,3,3,h),zot(b)||(b.shadow=new createjs.Shadow(u,3,3,h))),this.setBounds(0,0,o,n),this.addChild(i),i.center(this),i.y+=1,this.label=i;var F=!1;L.waiting=!1;var V,H,G,U,Z,q=!1,K=L.label.color,Q=L.label.rollColor;this.on("mousedown",function(){F=!0,zot(E)||L.waiting||(q=!0,zot(I)&&(I=!0),O&&(Z=stage.on("stagemousedown",function(e){L.hitTestPoint(stage.mouseX,stage.mouseY)||L.clearWait()},null,!0)),setTimeout(function(){L.waiting=!0},50),H=i.text,G=r,zot(A)||(L.label.color=A),zot(P)||(L.label.rollColor=P),U=L.enabled,!I&&L.enabled&&(L.enabled=!1),L.text=E,B.color=j,zot(M)&&(M=3e4),V&&V.clear(),V=timeout(M,function(){L.enabled||(L.enabled=U),L.clearWait(),L.dispatchEvent("waited")}),L.stage&&L.stage.update())}),this.clearWait=function(){return V?(Z&&stage.off("stagemousedown",Z),V.clear(),L.text=H,B.color=G,L.label.color=K,L.label.rollColor=Q,setTimeout(function(){L.waiting=!1},55),q=!1,L.stage&&L.stage.update(),L):L},this.removeWait=function(){return L.clearWait(),E=null,L},this.on("pressup",function(){F=!1,L.rollPersist&&!J&&$()});var J=!1;function $(){zot(v)?(B.color=q?j:r,B.borderColor=s):zot(b)||(zot(w)&&L.toggled?(L.removeChild(T),L.addChildAt(C,0)):(L.removeChild(b),L.addChildAt(v,0))),zot(x)||(L.toggled?(L.removeChild(T),L.addChild(C)):(L.removeChild(x),L.addChild(w))),L.label.showRollColor(!1),L.stage&&L.stage.update()}this.on("mouseover",function(e){J=!0,zot(v)?(B.color=q?S:a,B.borderColor=l):zot(b)||(zot(w)&&L.toggled?(L.removeChild(C),L.addChildAt(T,0)):(L.removeChild(v),L.addChildAt(b,0)));zot(x)||(L.toggled?(L.removeChild(C),L.addChild(T)):(L.removeChild(w),L.addChild(x)));L.label.showRollColor(),L.stage&&L.stage.update()}),this.on("mouseout",function e(t){J=!1;L.off("mouseout",e);L.rollPersist&&F||$()}),this.toggled=!1,this.toggleObj=C,this.rollToggle=T;var ee=i.text;function te(){"string"==typeof C?(L.text=L.toggled?C:ee,e.OPTIMIZE||!zns&&OPTIMIZE||!L.stage||L.stage.update()):zot(w)?L.setBackings(L.toggled?C:v,L.toggled?T:b):L.setIcons(L.toggled?C:w,L.toggled?T:x)}function oe(t,i,r,a,s){L.contains(L[t])?(L.removeChild(L[t]),L.addChildAt(r,s)):L.contains(L[i])&&(L.removeChild(L[i]),L.addChildAt(a,s)),L[t]=r,L[i]=a,L[t]&&(L[t].x=o/2,L[t].y=n/2),L[i]&&(L[i].x=o/2,L[i].y=n/2),e.OPTIMIZE||!zns&&OPTIMIZE||!L.stage||L.stage.update()}zot(C)||this.on(k,function(){q||(L.toggled=!L.toggled,te(L.toggled))}),Object.defineProperty(L,"text",{get:function(){return" "==i.text?"":i.text},set:function(e){i.text=e,i.center(this),i.y+=1}}),Object.defineProperty(L,"color",{get:function(){return r},set:function(t){r=t,B.color?B.color=r:zon&&zog("zim.Button - backing has no color property"),e.OPTIMIZE||!zns&&OPTIMIZE||!L.stage||L.stage.update()}}),Object.defineProperty(L,"rollColor",{get:function(){return a},set:function(e){a=e}}),Object.defineProperty(L,"borderColor",{get:function(){return s},set:function(e){s=e,B.borderColor&&(B.borderColor=e)}}),Object.defineProperty(L,"borderRollColor",{get:function(){return l},set:function(e){l=e}}),Object.defineProperty(L,"hitPadding",{get:function(){return f},set:function(e){0==(f=e)?X&&(this.hitArea=null):N()}}),this._enabled=!0,Object.defineProperty(L,"enabled",{get:function(){return L._enabled},set:function(o){t(L,o),L.mouseChildren=!1,i.color=i.color,e.OPTIMIZE||!zns&&OPTIMIZE||!L.stage||L.stage.update()}}),this.setBackings=function(e,t){return oe("backing","rollBacking",e,t,0),L},this.setIcons=function(e,t){return oe("icon","rollIcon",e,t,L.numChildren-1),L},this.toggle=function(e){return zot(e)?L.toggled=!L.toggled:L.toggled=e,te(),L},this.clone=function(){var t=new e.Button(o,n,i.clone(),r,a,s,l,d,c,u,h,f,p,m,g,z,zot(v)?null:v.clone(),zot(b)?null:b.clone(),y,zot(w)?null:w.clone(),zot(x)?null:x.clone(),zot(C)?null:"string"==typeof C?C:C.clone(),zot(T)?null:T.clone(),k,E,M,j,S,A,P,O,I);return L.cloneProps(t)},this.dispose=function(){return L.removeAllEventListeners(),L.removeChild(B),L.removeChild(b),L.removeChild(w),L.removeChild(L.label),L.label&&L.label.dispose(),B=null,b=null,w=null,L.label=null,!0}},e.extend(e.Button,e.Container,"clone","zimContainer",!1),e.CheckBox=function(o,n,i,r,a,s){var l;if(l=zob(e.CheckBox,arguments,"size, label, startChecked, color, margin, indicatorType",this))return l;z_d("56"),this.zimContainer_constructor(),this.type="CheckBox",zot(o)&&(o=60),zot(n)&&(n=null),"string"!=typeof n&&"number"!=typeof n||(n=new e.Label(n,5*o/6,"arial",r));var d=!zot(i)&&i;zot(r)&&(r="#111"),zot(a)&&(a=10),"box"!=s&&"square"!=s&&"x"!=s&&(s="check"),this.setBounds(-a,-a,o+2*a,o+2*a);var c=this;this.cursor="pointer";var u=new e.Shape,h=u.graphics;h.f("rgba(255,255,255,.5)").r(0,0,o,o),h.s(r).ss(o/10).r(o/7,o/7,o-o/7*2,o-o/7*2),this.addChild(u);var f=o;n&&(this.addChild(n),n.x=1.3*o+a,n.y=o/8,this.label=n,this.setBounds(-a,-a,o+3*a+n.getBounds().width,Math.max(o+2*a,n.getBounds().height)),f=n.x+n.width);var p=new e.Shape;(h=p.graphics).f("rgba(0,0,0,.01)").r(this.getBounds().x,this.getBounds().y,f+2*a,this.getBounds().height),this.hitArea=p;var m=new e.Shape,g=m.graphics,z="#000";"check"==s?g.f(z).p("AnQAdICBiaIEEDZIF8nfICfB4In/KPg"):"box"==s||"square"==s?g.f(z).dr(-35,-35,70,70):g.f(z).p("AmJEVIEUkTIkXkWIB4h5IEWEYIETkTIB4B3IkTESIEQERIh4B4IkRkRIkSEVg");m.setBounds(-47.5,-47.5,95,95);var v=o/161;m.scaleX=m.scaleY=v,m.alpha=.9,m.x=o/2,m.y=o/2,d&&this.addChild(m),this.on("mousedown"!=e.ACTIONEVENT||!window.zns&&"mousedown"!=ACTIONEVENT?"click":"mousedown",function(e){d=!d,c.setChecked(d),c.dispatchEvent("change")}),Object.defineProperty(c,"checked",{get:function(){return d},set:function(e){c.setChecked(e)}}),Object.defineProperty(c,"text",{get:function(){if(n)return n.text},set:function(t){n&&(n.text=t,e.OPTIMIZE||!zns&&OPTIMIZE||!c.stage||c.stage.update())}}),Object.defineProperty(m,"color",{get:function(){return z},set:function(t){d&&c.removeChild(m),m=new createjs.Shape,g=m.graphics,z=t,g.f(z).p("AnQAdICBiaIEEDZIF8nfICfB4In/KPg"),m.scaleX=m.scaleY=v,m.alpha=.9,m.x=o/2,m.y=o/2,d&&c.addChild(m),e.OPTIMIZE||!zns&&OPTIMIZE||!c.stage||c.stage.update()}}),Object.defineProperty(c,"check",{get:function(){return m},set:function(e){zog("ZIM CheckBox - check is read only")}}),this._enabled=!0,Object.defineProperty(c,"enabled",{get:function(){return c._enabled},set:function(e){t(c,e)}}),this.setChecked=function(t){return zot(t)&&(t=!0),(d=t)?c.addChild(m):c.removeChild(m),e.OPTIMIZE||!zns&&OPTIMIZE||!c.stage||c.stage.update(),c},this.clone=function(){return c.cloneProps(new e.CheckBox(o,n.clone(),i,r,a,s))},this.dispose=function(){return c.removeAllEventListeners(),!0}},e.extend(e.CheckBox,e.Container,"clone","zimContainer",!1),e.RadioButtons=function(o,n,i,r,a,s,l){var d;if(d=zob(e.RadioButtons,arguments,"size, buttons, vertical, color, spacing, margin, always",this))return d;z_d("57"),this.zimContainer_constructor(),this.type="RadioButtons",zot(o)&&(o=60),o=Math.max(5,o),zot(n)&&(n=["A","B","C"]),zot(i)&&(i=!0),zot(r)&&(r="#111"),zot(a)&&(a=i?.2*o:o),zot(s)&&(s=o/5);var c,u=this;if(this.cursor="pointer",this.labels=[],this.dots=[],"string"==typeof n){var h=n;n=[];for(var f=0;f=0;d--)(t=n[d]).selected&&!0===t.selected&&(l?t.selected="false":(l=!0,u.id=t.id));p.removeAllChildren(),u.buttons=[];for(var h=0,d=0;d=0){o=p.getChildAt(t);var i=-2;c&&(i=c.index),c=o.obj}return-1==t||i==c.index?(c=null,u.id=null,u.label=null,u.text=""):(o.addChild(o.check),u.id=c.id,u.label=c.label,u.label&&(u.text=u.label.text)),e.OPTIMIZE||!zns&&OPTIMIZE||!u.stage||u.stage.update(),u}},Object.defineProperty(u,"selected",{get:function(){return c},set:function(e){zog("ZIM RadioButton - selected is read only")}}),Object.defineProperty(u,"selectedIndex",{get:function(){return c?c.index:-1},set:function(e){var t=e;l&&u.selectedIndex==t||u.setSelected(t)}}),this._enabled=!0,Object.defineProperty(u,"enabled",{get:function(){return u._enabled},set:function(e){t(u,e)}}),this.clone=function(){for(var t=e.copy(n),d=0;d0&&(S.shadow=new createjs.Shadow(u,8,8,h)),S.on("click",function(e){e.stopImmediatePropagation()}),this.resetX,this.resetY,a)&&(S.cursor="pointer",S.on("mousedown",function(e){isNaN(j.resetX)&&(j.resetX=j.x),isNaN(j.resetY)&&(j.resetY=j.y),A=e.stageX-j.x,P=e.stageY-j.y,S.cursor="pointer"}),S.on("pressmove",function(t){var i,r,a,s=(i=t.stageX-A,r=t.stageY-P,i=Math.max(o/2,Math.min(v.getBounds().width-o/2,i)),r=Math.max(n/2,Math.min(v.getBounds().height-n/2,r)),{x:i,y:r});j.x=s.x,j.y=s.y;for(var l=0;l=0;o--)(t=j.getChildAt(o)).constructor!=e.TextArea&&t.constructor!=e.Loader||j.removeChild(t);if(e.OPTIMIZE||!zns&&OPTIMIZE||v.stage.update(),s&&(isNaN(j.resetX)||(j.x=j.resetX),isNaN(j.resetY)||(j.y=j.resetY)),j.zimAccessibility){var i=j.zimAccessibility;i.resize(j),O?O.focus():j.zimTabTag.nextSibling.focus(),setTimeout(function(){i.talk("Pane has been closed.")},50)}}z>0?j.animate({obj:{alpha:0},time:z,call:t}):t()}Object.defineProperty(j,"text",{get:function(){return" "==i.text?"":i.text},set:function(e){i.text=e}}),this._enabled=!0,Object.defineProperty(j,"enabled",{get:function(){return j._enabled},set:function(e){t(j,e)}}),this.hide=function(){return B(),j},this.show=function(){f&&isNaN(j.resetX)&&(j.x=v.getBounds().width/2,j.y=v.getBounds().height/2),v.addChild(j);for(var e=0;e0?(j.alpha=0,j.animate({alpha:1},z)):v.stage&&v.stage.update(),j.zimAccessibility){var t=j.zimAccessibility;setTimeout(function(){t.activatedObject&&(O=t.activatedObject.zimTabTag)},50),t.resize(j),t.tabIndex=j.zimTabIndex}return j},this.toggle=function(){return v.contains(j)?j.hide():j.show(),j},this.clone=function(){var t=i.x,T=i.y,k=j.cloneProps(new e.Pane(o,n,i.clone(),r,a,s,l,d,c,u,h,f,p,m,zot(g)?g.clone():null,z,v,b,y,w,x,C));return k.label.x=t,k.label.y=T,k},this.dispose=function(){return S.removeAllEventListeners(),x&&x.removeAllEventListeners(),j.removeChild(S),S=null,!0}},e.extend(e.Pane,e.Container,"clone","zimContainer",!1),e.Window=function(t,o,n,i,r,a,s,l,d,c,u,h,f,p,m,g,z,v,b,y,w,x,C){var T;if(T=zob(e.Window,arguments,"width, height, color, borderColor, borderWidth, padding, corner, swipe, indicatorActive, indicatorDrag, indicatorColor, indicatorAlpha, indicatorFade, slide, slideDamp, slideSnap, interactive, shadowColor, shadowBlur, paddingHorizontal, paddingVertical, scrollWheel, damp",this))return T;z_d("58.1"),this.zimContainer_constructor(),this.type="Window",zot(t)&&(t=300),zot(o)&&(o=200),zot(n)&&(n="#333"),zot(i)&&(i="#999"),zot(r)&&(r=1),zot(a)&&(a=10),zot(s)&&(s=0),zot(l)&&(l=!0),zot(d)&&(d=!0),zot(c)&&(c=!1),zot(u)&&(u=i),zot(h)&&(h=.3),zot(f)&&(f=!0),c&&(f=!1),zot(p)&&(p=!0),zot(m)&&(m=.6),zot(g)&&(g="vertical"),zot(z)&&(z=!0),zot(v)&&(v="rgba(0,0,0,.3)"),zot(b)&&(b=20),zot(w)&&(w=a),zot(y)&&(y=a),zot(x)&&(x=!0);var k=this;this.scrollX=this.scrollY=this.scrollXMax=this.scrollYMax=0;var E=this.backing=new e.Shape;this.addChild(E);var M=new createjs.Shape,j=M.graphics;this.addChild(M);var S=this.content=new e.Container;if(this.addChild(S),S.mask=M,!z)var A=new createjs.Shape;if(r>0){var P=new createjs.Shape;this.addChild(P)}function O(){k.setBounds(0,0,t,o),E.graphics.c().f(n).rr(0,0,t,o,s),-1!=v&&b>0&&(E.shadow=new createjs.Shadow(v,8,8,b)),r>0&&P.graphics.c().s(i).ss(r).rr(0,0,t,o,s)}O();var I,D,B,L,X,Y,_,R,W,N,F=this.indicator={};if(F.size=6,F.minSize=2*F.size,F.spacing=3.5+r/2,F.margin=0,F.corner=F.size/2,F.showTime=500,F.fadeTime=3e3,d){var V=this.hIndicator=new e.Shape,H=V.graphics;V.alpha=h,this.addChild(V),c&&V.drag({localBounds:!0});var G=this.vIndicator=new e.Shape,U=G.graphics;G.alpha=h,this.addChild(G),c&&G.drag({localBounds:!0})}function Z(){e.dragRect(S,new createjs.Rectangle(0,0,B?-k.scrollXMax:0,L?-k.scrollYMax:0))}this.update=function(){d&&(H.clear(),U.clear()),X=d?F.size+2*F.spacing:0,Y=S.getBounds().width,_=S.getBounds().height,B=Y>t-y&&(!0===l||"auto"==l||"horizontal"==l),L=_>o-w&&(!0===l||"auto"==l||"vertical"==l),k.scrollXMax=Y+2*y-t+(L?X+F.margin:0),k.scrollYMax=_+2*w-o+(B?X+F.margin:0),j.clear();var n=r/2,i=r/2,a=t-(L&&d?F.size+2*F.spacing:0)-(L?0:r),h=o-(B&&d?F.size+2*F.spacing:0)-(B?0:r);j.f("rgba(0,0,0,.01)").rr(n,i,a,h,s),z||(A.graphics.c().f("red").dr(n,i,a,h),S.hitArea=A);var f=Math.max(s,Math.min(F.corner,F.spacing)),p=f+r/2,m=f+(L?X:0)+r/2,g=f+r/2,v=f+(B?X:0)+r/2;if(B&&d&&(indicatorLength=Math.max(F.minSize,(t-p-m)*(t-p-m)/(Y+y+F.margin)),H.f(u).rr(0,0,indicatorLength,F.size,F.corner),V.x=p,V.y=o-F.size-F.spacing,I=new e.Proportion(-k.scrollXMax,0,p,t-indicatorLength-m,-1),c)){V.setBounds(0,0,indicatorLength,F.size);var b=new createjs.Rectangle(p,V.y,t-indicatorLength-p-m,0);V.dragRect(b),V.proportion=new e.Proportion(b.x,b.x+b.width,0,-k.scrollXMax),V.off("pressmove",R),R=V.on("pressmove",function(){S.x=V.proportion.convert(V.x)})}if(L&&d&&(indicatorLength=Math.max(F.minSize,(o-g-v)*(o-g-v)/(_+w+F.margin)),U.f(u).rr(0,0,F.size,indicatorLength,F.corner),G.x=t-F.size-F.spacing,G.y=g,D=new e.Proportion(-k.scrollYMax,0,g,o-indicatorLength-v,-1),c)){G.setBounds(0,0,F.size,indicatorLength);b=new createjs.Rectangle(G.x,g,0,o-indicatorLength-g-v);G.dragRect(b),G.proportion=new e.Proportion(b.y,b.y+b.height,0,-k.scrollYMax),G.off("pressmove",W),W=G.on("pressmove",function(){fe=S.y=G.proportion.convert(G.y)})}ee(),clearTimeout(N),N=setTimeout(function(){Z()},300)},this.resize=function(e,n){return zot(e)&&(e=t),zot(n)&&(n=o),t=e,o=n,O(),k.update(),fe=S.y,C&&me.immediate(fe),k},this.add=function(e){if(ze(e),e.getBounds())return S.addChild(e),0==e.x&&(e.x=y),0==e.y&&(e.y=w),k.update(),k;zog("SwipeBox.add() - please add content with bounds set")},this.remove=function(e){return S.removeChild(e),k.update(),k};var q,K,Q,J=!1;function $(){fe=S.y,C&&me.immediate(fe),d&&ee()}function ee(){A&&(A.x=-S.x,A.y=-S.y),B&&d&&(V.x=I.convert(S.x)),L&&d&&(G.y=D.convert(S.y))}function te(t){e.Ticker.remove($),J=!1,B&&f&&e.animate(V,{alpha:0},F.fadeTime),L&&f&&e.animate(G,{alpha:0},F.fadeTime)}if(l&&S.on("mousedown",function(){J||e.Ticker.add($,S.stage),J=!0,B&&d&&f&&e.animate(V,{alpha:h},F.showTime),L&&d&&f&&e.animate(G,{alpha:h},F.showTime)}),this.on("added",function(){if(ze(k),!l)return;e.drag({obj:S,currentTarget:!0,localBounds:!0,slide:p,slideDamp:m,slideSnap:(!0===l||"auto"==l||"vertical"==l)&&g}),S.getBounds()&&S.getBounds().width>0&&setTimeout(function(){Z()},300)},null,!0),p?S.on("slidestop",te):S.on("mousedown",function(){S.stage.on("stagemouseup",te,null,!0)}),z){var oe,ne,ie;S.on("mousedown",function(){oe=S.stage.mouseX,ne=Date.now()}),S.on("click",function(){Date.now()-ne<600&&Math.abs(S.stage.mouseX-oe)<5&&(k.contentMouse=S.globalToLocal(S.stage.mouseX,S.stage.mouseY),k.dispatchEvent("select"))}),S.on("mouseover",function(){ie=Date.now(),e.Ticker.add(he,S.stage)}),S.on("mouseout",function(){ue||(k.dispatchEvent("hoverout"),ue=!0);e.Ticker.remove(he)});var re=0,ae=0,se=0,le=0,de=300,ce=2,ue=!1;function he(){if(!S.stage)return ue||(k.dispatchEvent("hoverout"),ue=!0),void e.Ticker.remove(he);Math.abs(re-S.stage.mouseX)>ce||Math.abs(ae-S.stage.mouseY)>ce?(ue||(k.dispatchEvent("hoverout"),ue=!0),ie=Date.now(),re=S.stage.mouseX,ae=S.stage.mouseY):Date.now()-ie>de&&((Math.abs(se-S.stage.mouseX)>ce||Math.abs(le-S.stage.mouseY)>ce)&&(k.contentMouse=S.globalToLocal(S.stage.mouseX,S.stage.mouseY),k.dispatchEvent("hoverover"),se=S.stage.mouseX,le=S.stage.mouseY,ue=!1),ie=Date.now())}}var fe=k.scrollY;if(x){function pe(e){if(L&&k.stage&&k.hitTestPoint(k.stage.mouseX,k.stage.mouseY)){zot(e)&&(e=event);var t=e.detail?-19*e.detail:e.wheelDelta;zot(t)&&(t=-19*e.deltaY),fe+=t,fe=Math.max(-k.scrollYMax,Math.min(0,fe)),C||(k.scrollY=fe,S.stage.update())}}q=window.addEventListener("mousewheel",pe),K=window.addEventListener("wheel",pe),Q=window.addEventListener("DOMMouseScroll",pe)}var me,ge=!1;function ze(t){C&&!ge&&t.stage&&(ge=!0,me=new e.Damp(k.scrollY,C),e.Ticker.add(function(){J||zot(fe)||(k.scrollY=me.convert(fe))},t.stage))}Object.defineProperty(k,"scrollX",{get:function(){return S.x},set:function(e){S.x=e,ee()}}),Object.defineProperty(k,"scrollY",{get:function(){return S.y},set:function(e){S.y=e,ee()}}),this.clone=function(x){zot(x)&&(x=!0);var C=k.cloneProps(new e.Window(t,o,n,i,r,a,s,l,d,c,u,h,f,p,m,g,z,v,b,y,w));return x&&(k.content.cloneChildren(C.content),C.update()),C},this.dispose=function(){return x&&(window.removeEventListener("mousewheel",q),window.removeEventListener("wheel",K),window.removeEventListener("DOMMouseScroll",Q)),k.removeAllEventListeners(),V.off("pressmove",R),G.off("pressmove",W),S.removeAllEventListeners(),e.Ticker.remove(he),e.Ticker.remove($),e.noDrag(S),!0}},e.extend(e.Window,e.Container,"clone","zimContainer",!1),e.Waiter=function(t,o,n,i,r,a,s,l){var d;if(d=zob(e.Waiter,arguments,"container, speed, color, circleColor, corner, shadowColor, shadowBlur, fadeTime",this))return d;z_d("59"),this.zimContainer_constructor(),this.type="Waiter";var c="zim display - Waiter(): Please pass in a reference to a container with bounds set as first parameter";if(zot(t)){if(!zimDefaultFrame)return void zog(c);t=zimDefaultFrame.stage}else{if(!t.getBounds)return void zog(c);if(zot(t.stage))return void zog("zim display - Waiter(): The container must have a stage property")}zot(o)&&(o=600),zot(n)&&(n="orange"),zot(i)&&(i="white"),zot(r)&&(r=16),zot(a)&&(a="rgba(0,0,0,.3)"),zot(s)&&(s=14),zot(l)&&(l=0);this.setBounds(-52,-20,104,40);var u=this,h=this.display=new e.Shape;this.addChild(h),h.setBounds(0,0,104,40),h.regX=52,h.regY=20;var f=h.graphics;f.f(n),f.rr(0,0,104,40,r),-1!=a&&s>0&&(h.shadow=new createjs.Shadow(a,3,3,s)),h.on("click",function(e){e.stopImmediatePropagation()});var p,m,g,z=new e.Container;this.addChild(z);for(var v=0;v<3;v++)(p=new createjs.Shape).graphics.f(i).dc(0,0,12),p.x=32*(v-1),z.addChild(p),p.cache(-12,-12,24,24),p.alpha=0;this.hide=function(){function e(){if(u.parent&&u.parent.removeChild(u),t.stage.update(),u.zimAccessibility){var e=u.zimAccessibility;e.resize(u),m?m.focus():u.zimTabTag.nextSibling.focus(),setTimeout(function(){e.talk("Waiter has finished.")},50)}}return l>0?u.animate({obj:{alpha:0},time:l,call:e}):e(),u},this.show=function(){for(var e,n=0,i=0;i0&&(u.alpha=0,u.animate({alpha:1},l)),u.zimAccessibility){var r=u.zimAccessibility;setTimeout(function(){r.activatedObject&&(m=r.activatedObject.zimTabTag)},50),r.resize(u),r.talk(u.zimTabTag.getAttribute("aria-label"))}return u},this.clone=function(){return u.cloneProps(new e.Waiter(t,o,n,i,r,a,s,l))},this.dispose=function(){return u.ticker&&createjs.Ticker.off("tick",u.ticker),clearInterval(g),h.removeAllEventListeners(),u.removeChild(h),u.removeChild(z),h=null,z=null,!0}},e.extend(e.Waiter,e.Container,"clone","zimContainer",!1),e.Indicator=function(o,n,i,r,a,s,l,d,c,u,h,f,p,m){var g;if(g=zob(e.Indicator,arguments,"width, height, num, color, offColor, borderColor, backingColor, indicatorType, fill, scale, lightScale, press, shadowColor, shadowBlur",this))return g;z_d("60"),this.zimContainer_constructor(),this.type="Indicator",zot(o)&&(o=300),zot(n)&&(n=50),zot(i)&&(i=6),zot(r)&&(r="#f58e25"),zot(a)&&(a="#666"),a<0&&(a="rgba(0,0,0,.01)"),s<0&&(s=null),zot(l)&&(l=-1),zot(d)&&(d="dot"),zot(c)&&(c=!1),zot(u)&&(u=1),zot(h)&&(h=1),zot(f)&&(f=!1),zot(p)&&(p="rgba(0,0,0,.3)"),zot(m)&&(m=5);var z,v="mousedown"!=e.ACTIONEVENT||!window.zns&&"mousedown"!=ACTIONEVENT?"click":"mousedown",b=this;this.lights=[];new e.Container;if(-1!=l){var y=new e.Rectangle(o,n,l);this.addChild(y),this.backing=y}var w,x=this.lightsContainer=new e.Container;this.addChild(x);var C=.5*n,T=o/(i+1),k=new createjs.Shape;"square"==d||"box"==d?k.graphics.f("black").dr(-T/2/h+C/2,-n/2+C/2,T/h,n):k.graphics.f("black").dr(-T/2/h,-n/2,T/h,n);for(var E=0;E0&&(x.shadow=new createjs.Shadow(p,2,2,m)),f){x.cursor="pointer";x.on(v,function(e){z!=e.target.znum&&(M(z=e.target.znum),b.dispatchEvent("change"))})}function M(t){var o;t>=i&&(t=-1);for(var n=0;nx&&00&&(K.shadow=new createjs.Shadow(c,3,3,u)),K.addChild(Q),K.cursor="pointer",K.on("mousedown",function(e){if(!X.zimAccessibility||!X.zimAccessibility.aria){_=T;var t=s?P?1:-1:A?-1:1;he(t),ce(t)}}),m&&K.on("pressup",ue),s?(K.rotation=180,K.x=n/2,K.y=f?K.height+25+Y+K.height/2+25:2*K.height):(K.rotation=-90,K.x=K.height/2,K.y=K.width/2)),f){var le,de=this.textBox=new e.Shape;de.cursor="pointer",this.addChild(de),de.setBounds(0,0,n,Y),null!=r&&de.graphics.s(r).ss(1.5),de.graphics.f(i).rr(0,0,n,Y,d),-1!=c&&u>0&&(de.shadow=new createjs.Shadow(c,3,3,u)),l&&(s?l&&(de.y=Q.height+25):l&&(de.x=Q.height+25)),this.addChild(a),o.length>0&&(I=0,a.text=o[I]),a.x=50+de.x+de.getBounds().width/2,a.y=de.y+(de.getBounds().height-a.getBounds().height)/2,de.on("mousedown",function(e){X.zimAccessibility&&X.zimAccessibility.aria||(le=X.currentValue,p&&he(1),ce(1,!0),"number"==w&&(clearTimeout(q),ae=!0,q=setTimeout(function(){ae=!1},200)))}),de.on("pressup",function(){X.zimAccessibility&&X.zimAccessibility.aria||ae&&(fe(D=Math.round(D),D),X.currentValue!=le&&X.dispatchEvent("change"),le=X.currentValue)})}else o.length>0&&(I=0);function ce(t,o,n){if(m){ie=X.stage.mouseX,holdY=X.stage.mouseY,0==ie&&(ie=1),0==holdY&&(holdY=1),v||(b=1),re=new e.Proportion(0,y,z,z*b);var i=z;U=setTimeout(function(){!0,function e(){Z=setTimeout(function(){var r=t;if(v){var a=Math.abs(H-ie),l=Math.abs(G-holdY);s?(o||n||(a=0),n&&(l=0)):(o||n||(l=0),n&&(a=0)),(a>=10||l>=10)&&(a>l?(_=s?k:T,r=H-ie>0?1:-1,i=re.convert(Math.abs(ie-H))):(_=s?T:k,r=G-holdY>0?1:-1,"number"!=w&&P||(r*=-1),i=re.convert(Math.abs(holdY-G))))}he(r),e()},i)}()},g)}}function ue(){X.zimAccessibility&&X.zimAccessibility.aria||(!1,clearTimeout(U),clearTimeout(Z))}function he(t){var n;if("number"==w){var i=D;D+=_*t*R,D=e.decimals(D,B),h?D>X.max?D=X.min:DX.max?(D=1==T?X.max:i,f&&(de.cursor="default")):f&&(de.cursor="pointer"),Do.length-1&&(n=0),n<0&&(n=o.length-1);else{if(n>o.length-1)return void(f&&(de.cursor="default"));if(f&&(de.cursor="pointer"),n<0)return}I=n}fe("number"==w?D:o[I],"number"==w?D:I),X.currentValue!=le&&X.dispatchEvent("change"),le=X.currentValue}function fe(t,n){I=n,f&&("number"==w&&0!=t&&B>0&&(t=e.decimals(t,B,!0)),a.text=t,a.x=de.x+de.getBounds().width/2,a.y=de.y+(de.getBounds().height-a.getBounds().height)/2),l&&(K.alpha=1,Q.color=i,K.cursor="pointer",J.alpha=1,$.color=i,J.cursor="pointer",h||("number"==w?(I==X.min&&(R>0?pe():me()),I==X.max&&(R>0?me():pe())):(0==I&&(s?me():pe()),I==o.length-1&&(s?pe():me())))),!J||e.OPTIMIZE||!zns&&OPTIMIZE||!J.stage?!a||e.OPTIMIZE||!zns&&OPTIMIZE||!a.stage||a.stage.update():J.stage.update(),X.zimAccessibility&&X.zimAccessibility.changeTitle(X,null,!0)}function pe(){l&&(K.alpha=.8,Q.color="#aaa",K.cursor="default")}function me(){l&&(J.alpha=.8,$.color="#aaa",J.cursor="default")}l&&(J=this.containerNext=new e.Container,this.addChild(J),J.hitArea=se.clone(),$=this.arrowNext=new e.Triangle(Y,80,80,i),-1!=c&&u>0&&(J.shadow=new createjs.Shadow(c,3,3,u)),J.addChild($),J.cursor="pointer",J.on("mousedown",function(e){if(!X.zimAccessibility||!X.zimAccessibility.aria){_=T;var t=s?P?-1:1:A?1:-1;he(t),ce(t)}}),m&&J.on("pressup",ue),s?(J.rotation=0,J.x=n/2,J.y=J.getBounds().height/2):(J.rotation=90,J.x=f?de.x+de.getBounds().width+J.getBounds().height/2+25:K.x+K.getBounds().width,J.y=J.getBounds().width/2)),m&&f&&de.on("pressup",ue),E&&((ee=this.prev2=new e.Container).hitArea=se.clone(),te=this.arrowPrev2=new e.Triangle(Y,80,80,"rgba(0,0,0,.2)",i,2),ee.addChild(te),ee.cursor="pointer",ee.sca(M),ee.alpha=.5,ee.on("mousedown",function(e){if(!X.zimAccessibility||!X.zimAccessibility.aria){_=k;var t=s?A?-1:1:P?1:-1;he(t),ce(t,null,!0)}}),m&&ee.on("pressup",ue),(oe=this.next2=new e.Container).hitArea=se.clone(),ne=this.arrowNext2=new e.Triangle(Y,80,80,"rgba(0,0,0,.2)",i,2),oe.addChild(ne),oe.cursor="pointer",oe.sca(M),oe.alpha=.5,oe.on("mousedown",function(e){if(!X.zimAccessibility||!X.zimAccessibility.aria){_=k;var t=s?A?1:-1:P?-1:1;he(t),ce(t,null,!0)}}),m&&oe.on("pressup",ue),s?(ee.y=this.height/2,ee.x=-ee.width/2-25*Math.max(.2,Math.min(1,M)),ee.rotation=270,oe.y=this.height/2,oe.x=this.width+oe.width/2+25*Math.max(.2,Math.min(1,M)),oe.rotation=90):(oe.x=this.width/2,oe.y=-oe.height/2-25*Math.max(.2,Math.min(1,M)),oe.rotation=0,ee.x=this.width/2,ee.y=this.height+ee.height/2+25*Math.max(.2,Math.min(1,M)),ee.rotation=180),this.addChild(ee,oe)),Object.defineProperty(this,"stepperArray",{get:function(){if("number"==w){o=[];for(var e=X.min;e<=X.max;e+=Math.min(T,k))o.push(e)}return o},set:function(e){o=e,X.selectedIndex=X.selectedIndex}}),fe("number"==w?D:o[I],"number"==w?D:I),Object.defineProperty(this,"selectedIndex",{get:function(){return"number"==w?X.stepperArray.indexOf(X.currentValue):I},set:function(e){zot(e)||("number"==w?(I=Math.min(X.stepperArray.length-1,Math.max(0,e)),fe(D=X.stepperArray[I],D)):(e=Math.min(o.length-1,Math.max(0,e)),fe(o[I=e],I)))}}),Object.defineProperty(this,"currentValue",{get:function(){return"number"==w?D:o[I]},set:function(e){if(!zot(e))if("number"==w){if(e=Number(e),X.max>X.min){if(e>X.max||eX.min)return;if(newIndex=X.stepperArray.indexOf(e),newIndex<0)return;I=newIndex,fe(D=X.stepperArray[I],D)}else{if(!(o.indexOf(e)>-1))return;if((e=o.indexOf(e))==X.selectedIndex)return;fe(o[I=e],I)}}}),Object.defineProperty(this,"currentValueEvent",{get:function(){return X.currentValue},set:function(e){String(e)!=String(X.currentValue)&&(X.currentValue=e,X.dispatchEvent("change"))}}),Object.defineProperty(this,"continuous",{get:function(){return h},set:function(e){h=e,"number"==w?fe(D,D):fe(o[X.selectedIndex],X.selectedIndex)}}),this._enabled=!0,Object.defineProperty(X,"enabled",{get:function(){return X._enabled},set:function(n){t(X,n),n?("number"==w?fe(D,D):fe(o[X.selectedIndex],X.selectedIndex),window.addEventListener("keydown",X.keyDownEvent)):(pe(),me(),window.removeEventListener("keydown",X.keyDownEvent),f&&(a.mouseChildren=!1),f&&(a.mouseEnabled=!1)),!J||e.OPTIMIZE||!zns&&OPTIMIZE||!J.stage?!a||e.OPTIMIZE||!zns&&OPTIMIZE||!a.stage||a.stage.update():J.stage.update()}});var ge=!1,ze=!1,ve=!1;this.on("mousedown",function(){X.zimAccessibility&&X.zimAccessibility.aria||(X.focus=!0,ge=!0,ze=!1,ve=!1)}),this.keyDownEvent=function(e){if(X.focus){e||(e=event);var t,o=e.keyCode;if(S&&o>=37&&o<=40){var n=P?40:38,i=A?39:37,r=P?38:40,l=A?37:39;o==n||o==i?(_=s&&o==n||!s&&o==i?T:k,he(1)):o!=r&&o!=l||(_=s&&o==r||!s&&o==l?T:k,he(-1))}if(j)if("number"==w)!e.shiftKey&&o>=48&&o<=57?t=o-48:o>=96&&o<=105?t=o-96:190==o?ze=!0:173==o||189==o?(X.currentValue=-1*X.currentValue,X.currentValue!=le&&X.dispatchEvent("change"),le=X.currentValue,ve=!ve):46==o&&(ge=!0,ze=!1),ge&&!zot(t)?(ze&&(t/=10),ve&&(t*=-1),X.currentValue=t,ge=!1,X.currentValue!=le&&X.dispatchEvent("change"),le=X.currentValue):zot(t)||(ze&&(t=String(t/10).substr(1)),X.currentValue=Number(Math.floor(Number(a.text))+String(t)),X.currentValue!=le&&X.dispatchEvent("change"),le=X.currentValue);else X.currentValue=String.fromCharCode(e.keyCode),X.currentValue!=le&&X.dispatchEvent("change"),le=X.currentValue}},window.addEventListener("keydown",this.keyDownEvent),this.next=function(){he(1)},this.prev=function(){he(-1)},this.clone=function(){return X.cloneProps(new e.Stepper(o,n,i,r,a.clone(),s,l,d,c,u,h,f,p,m,g,z,v,b,y,w,x,C,T,k,E,M,j,S,A,P))},this.dispose=function(){return X.removeAllEventListeners(),window.removeEventListener("keydown",X.keyDownEvent),X.stage&&X.stage.off(L),!0}},e.zut=function(t){if(zot(t)||!t.key)return!0;e.async("http://zimjs.com/gamdata.php?id="+t.key+"&player="+t.player+"&score="+t.score+"&reverse="+t.info.reverse+"&total="+t.info.total+"&allowZero="+t.info.allowZero,t.info.type)},e.extend(e.Stepper,e.Container,"clone","zimContainer",!1),e.Slider=function(o,n,i,r,a,s,l,d,c,u,h,f,p,m){var g;if(g=zob(e.Slider,arguments,"min, max, step, button, barLength, barWidth, barColor, vertical, useTicks, inside, keyArrows, keyArrowsStep, keyArrowsH, keyArrowsV",this))return g;if(z_d("62"),this.zimContainer_constructor(),this.type="Slider",zot(o)&&(o=0),zot(n)&&(n=10),n-o!=0){if(zot(i)&&(i=0),zot(a)&&(a=300),zot(s)&&(s=3),zot(l)&&(l="#666"),zot(d)&&(d=!1),zot(c)&&(c=!1),zot(u)&&(u=!1),zot(h)&&(h=!0),zot(p)&&(p=!0),zot(m)&&(m=!0),zot(f)&&(f=(n-o)/100),zot(r)){var z=30,v=40;d&&(z=50,v=40),r=new e.Button(z,v,"","#fff","#ddd","#666",null,1,0,null,null,30)}var b,y;r.rollPersist=!0,d?(b=r.width,u?(y=a,this.setBounds(0,0,b,y)):(y=a+r.height,this.setBounds(-r.width/2,-r.height/2,b,y))):(y=r.height,u?(b=a,this.setBounds(0,0,b,y)):(b=a+r.width,this.setBounds(-r.width/2,-r.height/2,b,y)));var w,x,C,T,k,E,M,j=this,S=o,A=0;if(this.button=r,this.cursor="pointer",c&&0!=i){T=this.ticks=new e.Shape,this.addChild(T),(k=T.graphics).ss(1).s(l);var P=Math.round((n-o)/i),O=(n-o)/P;if(O!=i&&zon&&zog("zim.Slider() : non-divisible step ("+i+") adjusted"),i=O,u)var I=(a-(d?r.height:r.width))/Math.abs(P);else I=a/Math.abs(P)}if(d){var D=u?r.height/2:0;if(c&&0!=i){for(var B=0;B<=Math.abs(P);B++)k.mt(0,D+I*B).lt(20,D+I*B);T.x=10}(w=this.bar=new e.Rectangle(s,a,l)).expand(20,0),this.addChild(w),e.centerReg(r),this.addChild(r),C=w.getBounds(),x=new createjs.Rectangle(C.width/2,C.y+D,0,C.height-2*D)}else{D=u?r.width/2:0;if(c&&0!=i){for(B=0;B<=Math.abs(P);B++)k.mt(D+I*B,0).lt(D+I*B,-20);T.y=-10}(w=this.bar=new e.Rectangle(a,s,l)).expand(0,20),this.addChild(w),e.centerReg(r),this.addChild(r),C=w.getBounds(),x=new createjs.Rectangle(C.x+D,C.height/2,C.width-2*D,0)}r.x=x.x,r.y=x.y,r.on("mousedown",function(e){j.focus=!0;var t=j.globalToLocal(e.stageX,e.stageY);E=t.x-r.x,M=t.y-r.y,j.stage&&(j.stage.mouseMoveOutside=!0)}),r.on("pressmove",function(e){W(e)}),w.on("mousedown",function(e){E=0,M=0,j.zimAccessibility&&j.zimAccessibility.aria||W(e)}),Object.defineProperty(this,"currentValue",{get:function(){return S},set:function(t){zot(t)||(on&&(t=n)):(t>o&&(t=o),t0?1:-1}function F(){j.zimAccessibility&&j.zimAccessibility.changeTitle(j,null,!0)}function V(){(L||X)&&(j.currentValueEvent-=i>0?i*N(n-o):f*N(n-o)),(Y||_)&&(j.currentValueEvent+=i>0?i*N(n-o):f*N(n-o))}},e.extend(e.Slider,e.Container,"clone","zimContainer",!1),e.Dial=function(o,n,i,r,a,s,l,d,c,u,h,f,p,m,g,z,v,b,y,w,x){var C;if(C=zob(e.Dial,arguments,"min, max, step, width, color, indicatorColor, indicatorScale, indicatorType, innerCircle, innerScale, useTicks, innerTicks, tickColor, limit, keyArrows, keyArrowsStep, keyArrowsH, keyArrowsV, continuous, continuousMin, continuousMax",this))return C;if(z_d("63"),this.zimContainer_constructor(),this.type="Dial",zot(o)&&(o=0),zot(n)&&(n=10),n-o!=0){zot(i)&&(i=1),zot(r)&&(r=100),zot(a)&&(a="#666"),zot(s)&&(s="#222"),zot(l)&&(l=1),zot(d)&&(d="arrow"),zot(c)&&(c=!0),zot(u)&&(u=.5),zot(h)&&(h=!0),zot(f)&&(f=!1),zot(p)&&(p=s),zot(m)&&(m=!0),zot(g)&&(g=!0),zot(z)&&(z=(n-o)/100),zot(v)&&(v=!0),zot(b)&&(b=!0),zot(y)&&(y=!1),y&&(m=!1);var T=this;this.cursor="pointer";var k=r/2,E=o,M=0,j=this.backing=new e.Circle(k,a);if(this.addChild(j),c){var S=f?"rgba(0,0,0,.2)":"rgba(0,0,0,.1)";"black"!=a&&"#000"!=a&&"#000000"!=a&&"#111"!=a&&"#111111"!=a||(S="#222");var A=this.inner=new e.Circle(k*u,S);if(this.addChild(A),!f){var P=this.inner2=new e.Circle(k*(u-.1),"rgba(0,0,0,.1)");this.addChild(P)}}var O,I,D,B,L=Math.abs(n-o)/i;if(h&&0!=i){ticks=this.ticks=new e.Container,this.addChild(ticks);for(var X=0;X<(y?L:L+1);X++){var Y;(Y=new e.Rectangle(1,.2*k,p)).regY=k*(f?u-.05:1.28),Y.regX=.5,Y.rotation=360/(y?L:L+1)*X,ticks.addChild(Y)}}if(this.setBounds(-k,-k,r,r),"dot"==d||"circle"==d){var _=this.indicator=new e.Container,R=this.indicatorShape=new e.Circle(.19*k,s);_.addChild(R),e.sca(_,l),_.regY=k-_.getBounds().width*l/2-.07*k}else if("line"==d||"rectangle"==d){_=this.indicator=new e.Container,R=this.indicatorShape=new e.Rectangle(.1*k,.3*k,s);_.addChild(R),e.sca(_,l),_.regY=k-_.getBounds().width*l/2-.07*k,_.regX=.05*k}else{_=this.indicator=new e.Container,R=this.indicatorShape=new e.Triangle(.4*k,.4*k,.4*k,s);_.addChild(R),e.sca(_,l),_.regY=k-_.getBounds().height*l*(f?.85:.75),f&&(R.rotation=180)}_.regY/=l,this.addChild(_);var W=0;if(y)var N=0,F=0,V=0,H=!1,G=!1,U=!0;else o;this.on("mousedown",function(e){if(!T.zimAccessibility||!T.zimAccessibility.aria){O=_.rotation;var t=T.parent.globalToLocal(e.stageX,e.stageY),o=t.x-T.x,n=T.y-t.y;I=180*Math.atan2(o,n)/Math.PI;var i=(new Date).getTime();D=T.on("pressmove",function(e){if(H){var t=T.parent.globalToLocal(e.stageX,e.stageY),o=t.x-T.x,n=T.y-t.y;I=180*Math.atan2(o,n)/Math.PI,O=_.rotation}o=(t=T.parent.globalToLocal(e.stageX,e.stageY)).x-T.x,n=T.y-t.y;var i=180*Math.atan2(o,n)/Math.PI,r=O+i-I;r=(r+36e5)%360,m&&Math.abs(r-W)>180||(te(r),W=r)}),B=this.on("pressup",function(e){(new Date).getTime()-i<200&&(t=T.parent.globalToLocal(e.stageX,e.stageY),o=t.x-T.x,n=T.y-t.y,te(180*Math.atan2(o,n)/Math.PI));O=_.rotation,T.off("pressmove",D),T.off("pressup",B)})}}),Object.defineProperty(this,"currentValue",{get:function(){return E},set:function(t){zot(t)||(y?(H=!1,zot(w)||zot(x)?zot(w)?zot(x)||t>x&&(t=x,H=!0):tx&&(t=x,H=!0)):(t>w&&(t=w,H=!0),tn&&(t=m?n:o)):(t>o&&(t=m?o:n),tx&&(T.currentValue=x)}}),Object.defineProperty(this,"step",{get:function(){return i},set:function(e){zon&&zog("step is read only")}}),Object.defineProperty(this,"keyArrowsH",{get:function(){return v},set:function(e){v=e}}),Object.defineProperty(this,"keyArrowsV",{get:function(){return b},set:function(e){b=e}});var Z=!1,q=!1,K=!1,Q=!1;this.keyDownEvent=function(e){(T.focus||!T.zimAccessibility&&g)&&(37==e.keyCode&&v?Z=!0:40==e.keyCode&&b?q=!0:39==e.keyCode&&v?K=!0:38==e.keyCode&&b&&(Q=!0),null==T.keyInterval&&(Z||q||K||Q)&&(oe(),T.keyTimeout=setTimeout(function(){null==T.keyInterval&&(Z||q||K||Q)&&(T.keyInterval=setInterval(oe,40))},140)))},window.addEventListener("keydown",this.keyDownEvent),T.keyUpEvent=function(e){37==e.keyCode?Z=!1:40==e.keyCode?q=!1:39==e.keyCode?K=!1:38==e.keyCode&&(Q=!1),null==T.keyInterval||Z||q||K||Q||(clearInterval(T.keyInterval),T.keyInterval=null)},window.addEventListener("keyup",this.keyUpEvent),this._enabled=!0,Object.defineProperty(T,"enabled",{get:function(){return T._enabled},set:function(e){t(T,e),e?(T.keyDownEvent=window.addEventListener("keydown",T.keyDownEvent),T.keyUpEvent=window.addEventListener("keyup",T.keyUpEvent)):(window.removeEventListener("keydown",T.keyDownEvent),window.removeEventListener("keyup",T.keyUpEvent))}}),this.clone=function(){return T.cloneProps(new e.Dial(o,n,i,r,a,s,l,d,c,u,h,f,p,m,g,v,b,z,y,w,x))},this.dispose=function(){return T.removeAllEventListeners(),window.removeEventListener("keydown",T.keyDownEvent),window.removeEventListener("keyup",T.keyUpEvent),!0}}else zog("ZIM Dial range must not be 0");function J(e){return 0==i?e:Math.round(e/i)*i}function $(e){return e>0?1:-1}function ee(){T.zimAccessibility&&T.zimAccessibility.changeTitle(T,null,!0)}function te(t){if(y)return G&&(N=t,G=!1),t>N+180?V-=360:t0?i*$(n-o):z*$(n-o)),(K||Q)&&(T.currentValueEvent+=i>0?i*$(n-o):z*$(n-o))}},e.extend(e.Dial,e.Container,"clone","zimContainer",!1),e.Tabs=function(o,n,i,r,a,s,l,d,c,u,h,f,p,m,g,z,v,b,y,w,x,C,T){var k;if(k=zob(e.Tabs,arguments,"width, height, tabs, color, rollColor, offColor, spacing, currentEnabled, corner, labelColor, flatBottom, keyEnabled, gradient, gloss, wait, waitTime, waitColor, rollWaitColor, waitTextColor, rollWaitTextColor, waitModal, waitEnabled, backingColor",this))return k;z_d("65"),this.zimContainer_constructor(),this.type="Tabs",zot(o)&&(o=240),zot(n)&&(n=60),(zot(i)||i.length<=0)&&(i=[{label:1},{label:2},{label:3},{label:4}]),zot(r)&&(r="#333"),zot(a)&&(a="#555"),zot(s)&&(s="#777"),zot(d)&&(d=!1),zot(l)&&(l=1),zot(c)&&(c=0),zot(u)&&(u="white"),zot(h)&&(h=!0),zot(f)&&(f=!0);var E=this;this.keyEnabled=f;var M,j=0,S=[],A=[],P=i.length,O=(o-l*(P-1))/P;if(!zot(T)){var I=this.backing=new e.Rectangle(o,n,T);this.addChildAt(I)}if("number"==typeof i[0]||"string"==typeof i[0])for(var D=0;Do-l*(P-1))for(D=0;D0)for(L=(P*O-(X-Y*O))/Y,D=0;Di.length-1?0:o),E.dispatchEvent("change"),e.OPTIMIZE||!zns&&OPTIMIZE||!E.stage||E.stage.update(),t.preventDefault()}}),Object.defineProperty(this,"selected",{get:function(){return A[j]},set:function(e){zon&&zog("selected is read only - try selectedIndex")}}),Object.defineProperty(this,"selectedIndex",{get:function(){return j},set:function(t){W(t),e.OPTIMIZE||!zns&&OPTIMIZE||!E.stage||E.stage.update()}}),Object.defineProperty(this,"tabs",{get:function(){return j},set:function(t){W(Math.min(Math.max(t,0),i.length-1)),e.OPTIMIZE||!zns&&OPTIMIZE||!E.stage||E.stage.update()}}),Object.defineProperty(this,"color",{get:function(){return r},set:function(t){zog("tabs color property "+t),r=t,zot(i[j].color)&&(A[j].color=r,e.OPTIMIZE||!zns&&OPTIMIZE||!E.stage||E.stage.update())}}),Object.defineProperty(this,"rollColor",{get:function(){return a},set:function(e){a=e;for(var t=0;t=0&&o=18?1:0))+(Y-6*S*3)]=C[A];n=18,E=[b,v]}else T=(t-i)/n-i;var I=Math.ceil(o.length/n),D=String(o[o.length-1]);zot(s)||(D=String(s));var B=b;function L(e){return(e=Math.floor(e).toString(16))+""+e}var X,Y,_,R,W=x.graphics;S=0;for(A=0;A0&&(le.shadow=new createjs.Shadow(d,8,8,c)),l)&&(le.on("mousedown",function(e){ae=e.stageX-z.x,se=e.stageY-z.y,le.cursor="move"}),le.on("pressmove",function(e){z.x=e.stageX-ae,z.y=e.stageY-se,z.stage&&z.stage.update()}),le.on("pressup",function(e){le.cursor="default",z.stage&&z.stage.update()}));var ce=n*(T+i),ue=I*(T+i);if(r)var he=V*(T+i),fe=H*(T+i);function pe(){z.zimAccessibility&&z.zimAccessibility.changeTitle(z,null,!0)}function me(e){return Math.round(e*Math.pow(10,2))/Math.pow(10,2)}x.on("mousedown"!=e.ACTIONEVENT||!window.zns&&"mousedown"!=ACTIONEVENT?"click":"mousedown",function(){var t=e.hitTestGrid(x,ce,ue,n,I,z.stage.mouseX,z.stage.mouseY,0,0,i,i);zot(t)||(D=o[t],u?(ie.color=D,$.text=String(o[t]).toUpperCase().substr(0,7),e.centerReg($),D!=B&&z.dispatchEvent("set")):de()),r&&(t=null,zot(t=e.hitTestGrid(x,he,fe,V,H,z.stage.mouseX,z.stage.mouseY,0,ue,i,i))||(D=E[t],u?(ie.color=D,$.text=E[t].toUpperCase(),e.centerReg($),D!=B&&z.dispatchEvent("set")):de())),f&&G(o.indexOf(D)),u?z.stage&&z.stage.update():f&&z.stage&&z.stage.update(),pe()}),Object.defineProperty(this,"selectedColor",{get:function(){return D},set:function(t){B=D=t,u&&(ie.color=D,$.text=D,e.centerReg($),z.stage&&z.stage.update()),f&&G(o.indexOf(D)),pe()}}),Object.defineProperty(this,"currentValue",{get:function(){return D},set:function(e){z.selectedColor=e}}),Object.defineProperty(this,"currentValueEvent",{get:function(){return D},set:function(e){e!=z.selectedColor&&(z.selectedColor=e,z.dispatchEvent("change"))}}),Object.defineProperty(this,"selectedIndex",{get:function(){return o.indexOf(D)},set:function(t){B=D=o[t],u&&(ie.color=D,$.text=D,e.centerReg($),z.stage&&z.stage.update()),f&&G(o.indexOf(D)),pe()}}),Object.defineProperty(this,"selectedAlpha",{get:function(){return a?me(K.currentValue):1},set:function(e){a&&(y=K.currentValue=e,ie&&(ie.alpha=y),Q&&(Q.text="Alpha: "+me(K.currentValue)),z.stage&&z.stage.update())}}),Object.defineProperty(this,"colors",{get:function(){return r?o.concat(E):o},set:function(e){zon&&zog("Display - ColorPicker() colors is read only - make a new ColorPicker to change")}}),this.keyDownEvent=function(e){if(z.focus||!z.zimAccessibility&&m){var t=z.selectedIndex;function o(){t<0&&(t=z.colors.length-1),t>z.colors.length-1&&(t=0),z.selectedIndex=t,z.dispatchEvent("change"),z.stage&&z.stage.update()}37==e.keyCode||40==e.keyCode?(t--,o()):38!=e.keyCode&&39!=e.keyCode||(t++,o())}},window.addEventListener("keydown",this.keyDownEvent),this.clone=function(){return z.cloneProps(new e.ColorPicker(t,k?null:o,n,i,r,a,s,l,d,c,u,h,f,p,m))},this.dispose=function(){return window.removeEventListener("keydown",z.keyDownEvent),K.dispose(),x.removeAllEventListeners(),le.removeAllEventListeners(),te.removeAllEventListeners(),ie.removeAllEventListeners(),oe.removeAllEventListeners(),!0}},e.extend(e.ColorPicker,e.Container,"clone","zimContainer",!1),e.Loader=function(t,o,n,i,r,a,s,l,d,c,u,h,f,p,m,g,z,v,b,y,w,x,C,T,k){var E;if(E=zob(e.Loader,arguments,"width, height, label, color, rollColor, borderColor, borderRollColor, borderWidth, corner, shadowColor, shadowBlur, hitPadding, gradient, gloss, flatBottom, dashed, backing, rollBacking, rollPersist, icon, rollIcon, toggle, rollToggle, toggleEvent, frame",this))return E;if(z_d("67.5"),zot(t)&&(t=250),zot(o)&&(o=70),zot(i)&&(i="rgba(0,0,0,.05)"),zot(r)&&(r="rgba(0,0,0,.1)"),zot(a)&&(a="rgba(0,0,0,.3)"),zot(l)&&(l=1),zot(g)&&(g=!0),zot(d)&&(d=0),zot(n)&&(n=new e.Label({text:"UPLOAD PIC",color:"rgba(0,0,0,.4)",valign:"center",align:"center"})),zot(k)){if(!zimDefaultFrame)return void(zon&&zog("zim.Loader - please provide a reference to zim Frame"));k=zimDefaultFrame}this.zimButton_constructor(t,o,n,i,r,a,s,l,d,c,u,h,f,p,m,g,z,v,b,y,w,x,C,T),this.type="Loader";var M=this,j=k.stage;n=M.label;var S=M.tag=document.createElement("input");document.body.appendChild(S),S.setAttribute("type","file"),S.setAttribute("multiple","multiple"),S.setAttribute("aria-hidden",!0),S.hidden=!0,S.style.cssText="border:thin solid grey; z-index:2; width:"+t+"px; height:"+o+"px; overflow:hidden; outline:none;position:absolute; left:0px; top:0px; display:none; cursor:pointer; opacity: 0; filter: alpha(opacity=0);",this.addEventListener("mousedown",function(){S.click()}),S.addEventListener("change",P);var A=new createjs.DOMElement(S);function P(t){var o;o=t.dataTransfer&&t.dataTransfer.files&&t.dataTransfer.files.length>0?t.dataTransfer.files:t.target.files;for(var n,i,r,a=[],s=0;ssaved"),p.document.close()}else{var m=document.createElement("a");m.setAttribute("download",o),m.setAttribute("href",t.cacheCanvas.toDataURL("image/"+d)),m.setAttribute("target","_blank"),document.body.appendChild(m),m.click(),document.body.removeChild(m)}return s?l&&t.cache(cashedBound.x,cashedBound.y,cashedBound.width,cashedBound.height):t.uncache(),M},this.clone=function(){var s=new e.Loader(t,o,zot(n)?null:n.clone(),i,r,a,l,d,c,u,h,f,p,m,zot(z)?null:z.clone(),zot(v)?null:v.clone(),b,zot(y)?null:y.clone(),zot(w)?null:w.clone(),zot(x)?null:"string"==typeof x?x:x.clone(),zot(C)?null:C.clone(),T,g,k);return M.cloneProps(s)},this.dispose=function(){return M.zimButton_dispose(),M.removeAllEventListeners(),M.removeChild(A),document.body.removeChild(S),!0}},e.extend(e.Loader,e.Button,["clone","dispose"],"zimButton",!1),e.TextArea=function(t,o,n,i,r,a,s,l,d,c,u,h,f,p,m,g,z){var v;if(v=zob(e.TextArea,arguments,"width, height, size, padding, color, backingColor, borderColor, borderWidth, corner, shadowColor, shadowBlur, dashed, id, placeholder, readOnly, spellCheck, frame",this))return v;if(z_d("67.6"),zot(t)&&(t=250),zot(o)&&(o=70),zot(n)&&(n=20),zot(i)&&(i=5),zot(r)&&(r="#666"),zot(a)&&(a="rgba(256,256,256,.1)"),zot(s)&&(s="rgba(0,0,0,.1)"),zot(d)&&(d=0),!zot(u)&&zot(c)&&(c="rgba(0,0,0,.3)"),!zot(c)&&zot(u)&&(u=10),zot(z)){if(!zimDefaultFrame)return void(zon&&zog("zim.TextArea - please provide a reference to zim Frame"));z=zimDefaultFrame}this.zimContainer_constructor(t,o),this.type="TextArea";var b=this,y=z.stage,w=this.backing=new e.Rectangle(t,o,a,s,l,d,null,h);-1!=c&&u>0&&(w.shadow=new createjs.Shadow(c,3,3,u)),b.addChild(w);var x=b.tag=document.createElement("textarea");document.body.appendChild(x),zot(f)||(x.setAttribute("id",f),x.setAttribute("name",f)),m&&(x.readonly=!0),g||(x.spellcheck=!1),zot(p)||x.setAttribute("placeholder",p),x.style.cssText="background-color:rgba(0,0,0,.01); color:"+r+"; resize:none; z-index:3; width:"+(t-2*i)+"px; height:"+(o-2*i)+"px; overflow:hidden; outline:none;font-size:"+n+"px; font-family:verdana; border:none; position:absolute; left:0px; top:0px; display:none;",x.addEventListener("change",function(){b.dispatchEvent("change")}),x.addEventListener("input",function(){b.dispatchEvent("input")}),x.addEventListener("focus",function(){z.zil&&window.removeEventListener("keydown",z.zil[0]),b.dispatchEvent("focus")}),x.addEventListener("blur",function(){z.zil&&window.addEventListener("keydown",z.zil[0]),b.dispatchEvent("blur")});var C=new createjs.DOMElement(x);C.alpha=0,this.on("mousedown",function(){setTimeout(function(){x.focus()},100)}),this.setFocus=function(e){return zot(e)&&(e=!0),e?x.focus():x.blur(),b},this.resize=function(){return setTimeout(function(){var t=b.localToGlobal(i,i);C.x=z.x+t.x*z.scale,C.y=z.y+t.y*z.scale,e.sca(C,z.scale*b.scaleX,z.scale*b.scaleY),C.alpha=1,b.stage&&y.update()},50),b},this.resize(),b.added(function e(){y.addChild(C);setTimeout(function(){x.style.display="block"},50);b.resize();b.on("added",e,null,!0)}),b.on("removed",function(){y.removeChild(C),x.style.display="none"}),z.on("resize",b.resize),Object.defineProperty(this,"currentValue",{get:function(){return x.value},set:function(e){x.value=e}}),Object.defineProperty(this,"text",{get:function(){return x.value},set:function(e){x.value=e}}),Object.defineProperty(this,"focus",{get:function(){return document.activeElement==x},set:function(e){b.setFocus(e)}}),Object.defineProperty(this,"readOnly",{get:function(){return x.readOnly},set:function(e){x.readOnly=e}}),this.clone=function(){var v=new e.Loader(t,o,n,i,r,a,s,l,d,c,u,h,f,p,m,g,z);return b.cloneProps(v)},this.dispose=function(){return b.removeAllEventListeners(),b.removeChild(C),document.body.removeChild(x),!0}},e.extend(e.TextArea,e.Container,["clone","dispose"],"zimContainer",!1),e.drag=function(t,o,n,i,r,a,s,l,d,c,u,h,f,p,m){var g;if(g=zob(e.drag,arguments,"obj, rect, overCursor, dragCursor, currentTarget, swipe, localBounds, onTop, surround, slide, slideDamp, slideSnap, reg, removeTweens, startBounds"))return g;if(z_d("31"),!zot(t)&&t.on){t.zimDown&&t.noDrag(),t.cursor=zot(n)?"pointer":n,zot(r)&&(r=!1),zot(a)&&(a=!1),zot(s)&&(s=!1),zot(l)&&(l=!0),zot(d)&&(d=!1),zot(c)&&(c=!1),zot(u)&&(u=.3),zot(h)&&(h=!0);!0!==h&&["horizontal","vertical","auto"].indexOf(h)<0&&(h=!1),zot(f)&&(f=!1),zot(p)&&(p=!0),zot(m)&&(m=!0),e.setSwipe(t,a),t.zimDragRect=o,t.zimLocalBounds=s;var z,v,b,y,w,x,C=!1;if(t.zimAdded=t.on("added",Y,null,!0),t.zimRemoved=t.on("removed",function(){t.zimDragTicker&&e.Ticker.remove(t.zimDragTicker)},null,!0),t.parent&&Y(),c)var T=new e.Damp(t.x,u),k=new e.Damp(t.y,u),E=3,M=0,j=[],S=[],A=t.x,P=t.y,O=t.x,I=t.y,D=t.x,B=t.y,L=-1e4,X=-1e4;return t.pointers={},t.zimDown=t.on("mousedown",function(o){if(t.stage){var n="id"+Math.abs(o.pointerID+1);if(t.pointers[n]=!0,x=r?o.currentTarget:o.target,!t.zimDragRect||x.getBounds()){C=!0,t.stage.mouseMoveOutside=!0,c||(t.zimDragTicker&&e.Ticker.remove(t.zimDragTicker),t.zimDragTicker=e.Ticker.add(function(){},t.stage)),p&&createjs.Tween.removeTweens(x),l&&x.parent.setChildIndex(x,x.parent.numChildren-1);var a=x.parent.globalToLocal(o.stageX,o.stageY);f&&(x.x=a.x,x.y=a.y),z=a.x-x.x,v=a.y-x.y,t.zimDragRect&&(s?(y=e.boundsToGlobal(x.parent,t.zimDragRect),d&&(w=t.zimDragRect)):(y=t.zimDragRect,d&&(w=e.boundsToGlobal(x.parent,t.zimDragRect,!0)))),t.cursor=zot(i)?"pointer":i,c&&(M=0,j=[a.x],S=[a.y],L=-1e4,X=-1e4,t.zimDragMoving=!0)}else zog("zim.drag() - drag object needs bounds set")}},!0),t.zimMove=t.on("pressmove",function(e){C&&_(x,e.stageX,e.stageY)},!0),t.zimPosition=_,t.zimUp=t.on("pressup",function(o){var i="id"+Math.abs(o.pointerID+1);if(delete t.pointers[i],C){if(t.cursor=zot(n)?"pointer":n,c){var r=x.parent.globalToLocal(o.stageX,o.stageY);C=!1,A=r.x,P=r.y,O=x.x,I=x.y,T.immediate(x.x),k.immediate(x.y)}else{var a=0;for(var s in t.pointers)a++;0==a&&e.Ticker.remove(t.zimDragTicker)}t.stage&&t.stage.update()}},!0),t}function Y(){z=0,v=0,t.zimDragRect&&(s?(y=e.boundsToGlobal(t.parent,t.zimDragRect),d&&(w=t.zimDragRect)):(y=t.zimDragRect,d&&(w=e.boundsToGlobal(t.parent,t.zimDragRect,!0)))),y&&m&&(b=t.parent.localToGlobal(t.x,t.y),_(t,b.x,b.y)),c&&(t.zimDragMoving=!0,function(){var o=t.stage;function n(e,o,n,i,r){Math.abs(e.x-L)<.1&&Math.abs(e.y-X)<.1?(t.zimDragMoving=!1,e.x=i,e.y=r,e.dispatchEvent("slidestop")):(L=o,X=n)}t.zimDragTicker=function(){if(x||(x=t),C){var e=x.parent.globalToLocal(o.mouseX,o.mouseY);M++,j.push(e.x),S.push(e.y),M>=E?(D=j.shift(),B=S.shift()):(D=j[0],B=S[0])}else{if(!t.zimDragMoving)return;var i=O+A-D,r=I+P-B;if(y){var a=R(x,i,r);i=a.x,r=a.y}if(h)x.x=T.convert(i),x.y=k.convert(r),n(x,x.x,x.y,i,r);else{var a=R(x,T.convert(i),k.convert(r));x.x=a.x,x.y=a.y,n(x,x.x,x.y,x.x,x.y)}}},e.Ticker.add(t.zimDragTicker,o)}()),zot(t.zimMaskDynamic)||t.zimMaskApply()}function _(o,n,i){if(zot(o)&&(o=x||t),o.parent&&o.stage){if(zot(n)||zot(i)){var r=o.parent.localToGlobal(o.x,o.y);z=v=0,t.zimDragRect&&(s?(y=e.boundsToGlobal(o.parent,t.zimDragRect),d&&(w=o.zimDragRect)):(y=t.zimDragRect,d&&(w=e.boundsToGlobal(o.parent,t.zimDragRect,!0)))),n=r.x,i=r.y,c&&(O=o.x,I=o.y,x=o,T.immediate(O),k.immediate(I))}var a,l=o.parent.globalToLocal(n,i);c&&h?"vertical"==h?(a=R(o,l.x-z,l.y-v),o.x=a.x,o.y=l.y-v):"horizontal"==h?(a=R(o,l.x-z,l.y-v),o.x=l.x-z,o.y=a.y):(o.x=l.x-z,o.y=l.y-v):(a=R(o,l.x-z,l.y-v),o.x=a.x,o.y=a.y)}}function R(e,t,o){if(y)if(d){var n=e.getBounds().width,i=e.getBounds().height,r=e.getBounds().x,a=e.getBounds().y;nw.x&&(t=w.x+(e.regX-r)),t-(e.regX-r)+nw.y&&(o=w.y+(e.regY-a)),o-(e.regY-a)+iCe?(o.target.x-ke)/(ve-ke):(o.target.y-Ee)/(be-Ee):xe>Ce?(o.target.x-o.target.op.x)/(ve-o.target.op.x):(o.target.y-o.target.op.y)/(be-o.target.op.y),"corner"==o.target.controlType?(t.scaleX=n*startSX,t.scaleY=n*startSY):(t.scaleX="e-resize"==o.target.cu?n*startSX:startSX,t.scaleY="n-resize"==o.target.cu?n*startSY:startSY),he(),Le.pos(k.mouseX,k.mouseY),v&&Xe.pos(k.mouseX,k.mouseY),!frame.ctrlKey||"side"==o.target.controlType){var i=o.target.op.x,r=o.target.op.y;t.x-=(i-Te.x)*e.sign(Y)*e.sign(t.scaleX),t.y-=(r-Te.y)*e.sign(_)*e.sign(t.scaleY)}he()}function Re(e,o){ue();var n=e?e.target.controlType:"move";o&&(n="reset"),v&&Xe.removeFrom(k);var i=!1;Oe=null,"move"==n?(t.x==He.x&&t.y==He.y||((Oe=new createjs.Event("transformed")).transformType="move"),i=fe.hitTestPoint(k.mouseX,k.mouseY)):"corner"==n?(t.scaleX==He.scaleX&&t.scaleY==He.scaleY||((Oe=new createjs.Event("transformed")).transformType="size"),i=G.hitTestPoint(k.mouseX,k.mouseY)):"side"==n?(t.scaleX==He.scaleX&&t.scaleY==He.scaleY||((Oe=new createjs.Event("transformed")).transformType="stretch"),i=U.hitTestPoint(k.mouseX,k.mouseY)||Z.hitTestPoint(k.mouseX,k.mouseY)):"rotate"==n?(t.rotation!=He.rotation&&((Oe=new createjs.Event("transformed")).transformType="rotate"),i=q.hitTestPoint(k.mouseX,k.mouseY)):"reg"==n?t.regX==He.regX&&t.regY==He.regY||((Oe=new createjs.Event("transformed")).transformType="reg"):(Oe=new createjs.Event("transformed")).transformType="reset"==n?"reset":"unknown",i||(Le.removeFrom(k),frame.canvas.style.cursor="default",t.cursor=Be),k.update(),Oe&&t.dispatchEvent(Oe)}function We(o){De||(Le.addTo(k),Xe.addTo(k,1),Le.pos(k.mouseX,k.mouseY),Xe.pos(k.mouseX,k.mouseY),Q.rotation=t.rotation*e.sign(Y*_)*e.sign(t.scaleX*t.scaleY)+$[o.target.cu],"side"!=o.target.controlType&&Y*_<0&&(Q.rotation+=90),k.update(),Ae&&k.off("stagemousemove",Ae),Ae=k.on("stagemousemove",function(e){Le.pos(k.mouseX,k.mouseY),k.update()}))}function Ne(e){k.off("stagemousemove",Ae),De||(t.cursor=Be,Le.removeFrom(k),Xe.removeFrom(k),k.update())}function Fe(){d&&(t.parent.setChildIndex(t,t.parent.numChildren-1),k.addChild(H))}G.on("mousedown",Ye),G.on("pressmove",_e),G.on("pressup",Re),U.on("mousedown",Ye),U.on("pressmove",_e),U.on("pressup",Re),Z.on("mousedown",Ye),Z.on("pressmove",_e),Z.on("pressup",Re),q.on("mousedown",Ye),q.on("pressmove",function(o){var n=180*Math.atan2(k.mouseY-je,k.mouseX-Me)/Math.PI;frame.shiftKey?t.rot(45*Math.round((ye+(n-we)*e.sign(Y)*e.sign(t.scaleX))/45)):t.rot(ye+(n-we)*e.sign(Y)*e.sign(t.scaleX));he(),Le.pos(k.mouseX,k.mouseY),v&&(Q.rotation=t.rotation*e.sign(Y*_)*e.sign(t.scaleX*t.scaleY)+$[o.target.cu],"side"!=o.target.controlType&&Y*_<0&&(Q.rotation+=90),Xe.pos(k.mouseX,k.mouseY));he()}),q.on("pressup",Re),S.drag(),S.on("mousedown",Fe),S.on("pressup",function(o){if(!frame.ctrlKey){for(var n=0;n1&&(t.rotation=Math.round(t.rotation/x)*x,he()),pe(),fe.mouseEnabled=!0,Ie=!1,k.update()});function Ue(){He={x:t.x,y:t.y,rotation:t.rotation,regX:t.regX,regY:t.regY,scaleX:t.scaleX,scaleY:t.scaleY}}Ue();var Ze,qe=t.on("mousedown",Ue);H.on("mousedown",Ue);H.addChild(j),o&&H.addChild(fe),r&&H.addChild(G),n&&H.addChild(U),i&&H.addChild(Z),a&&H.addChild(q),H.addChild(S),o&&(t.drag({overCursor:"pointer",dragCursor:"pointer",onTop:!1,removeTweens:!1}),Ze=t.on("pressmove",function(){he(),pe(),ue()}));var Ke=s;return t.transformControls={visible:l,show:function(){return d&&t.parent.setChildIndex(t,t.parent.numChildren-1),k.addChild(H),t.transformControls.visible=!0,k.update(),t},hide:function(){return k.removeChild(H),t.transformControls.visible=!1,v&&(Ae&&k.off("stagemousemove",Ae),Pe&&k.off("stagemousemove",Pe),De=!1,Le.removeFrom(k),Xe.removeFrom(k)),o||(t.cursor=Be),k.update(),t},remove:function(){t.transformControls.hide(),s=!1,o&&(t.noDrag(),t.off("pressmove",Ze))},add:function(){t.transformControls.show(),s=Ke,o&&(t.drag({overCursor:"pointer",dragCursor:"pointer",onTop:!1,removeTweens:!1}),Ze=t.on("pressmove",Ze))},toggleOn:function(){s=Ke=!0,me=H.on("mousedown",me),ge=t.on("mousedown",ge),Se=k.on("stagemousedown",Se)},toggleOff:function(){s=Ke=!1,H.off("mousedown",me),t.off("mousedown",ge),k.off("stagemousedown",Se)},disable:function(){H.mouseChildren=!1,H.mouseEnabled=!1,o&&(t.noDrag(),t.off("pressmove",Ze))},enable:function(){H.mouseChildren=!0,H.mouseEnabled=!0,o&&(t.drag({overCursor:"pointer",dragCursor:"pointer",onTop:!1,removeTweens:!1}),Ze=t.on("pressmove",Ze))},recordData:function(e){var o={type:t.type,index:N.getChildIndex(t),x:t.x,y:t.y,scaleX:t.scaleX,scaleY:t.scaleY,rotation:t.rotation,skewX:t.skewX,skewY:t.skewY,regX:t.regX,regY:t.regY,controls:t.transformControls.visible};return e?JSON.stringify(o):o},setData:function(e,o){if(!zot(e)){o&&(e=JSON.parse(e));var n=e.controls;delete e.controls;var i=e.index;for(var r in zot(i)&&(i=0),delete e.index,e)t[r]=e[r];return he(),pe(),ue(),N.setChildIndex(t,i),n?t.transformControls.show():t.transformControls.hide(),t}},resize:function(){return N=t.parent,he(),pe(),ue(),l&&t.transformControls.show(),t},dispose:function(){t.transformControls.hide(),s=!1,o&&(zog("here"),t.noDrag(),t.off("pressmove",Ze)),H.removeAllEventListeners(),ge&&t.off("mousedown",ge),me&&t.off("mousedown",me),Se&&k.off("stagemousedown",Se),Ae&&k.off("stagemousemove",Ae),Pe&&k.off("stagemousemove",Pe),Ge&&k.off("stagemouseup",Ge),qe&&t.off("mousedown",qe),Ze&&t.off("pressmove",Ze)},scaleControls:G,stretchXControls:U,stretchYControls:Z,rotateControls:q},l&&t.transformControls.show(),t},e.setSwipe=function(e,t){if(z_d("34"),!zot(e)&&e.on)return e.zimNoSwipe=!t||null,e instanceof createjs.Container&&function t(o){var n=o.numChildren;var i;for(var r=0;rs;(O||I)&&(O?E>1?(p.scaleY=a,p.scaleX=a*E):(p.scaleX=a,p.scaleY=a/E):I&&(E>1?(p.scaleX=s,p.scaleY=s/E):(p.scaleY=s,p.scaleX=s*E)),T.immediate(p.scaleX),k.immediate(p.scaleY))}if(t.zimTouch.rotate){var D=Math.atan2(C.startY-M.startY,C.startX-M.startX)*(180/Math.PI),B=Math.atan2(C.y-M.y,C.x-M.x)*(180/Math.PI)-D;p.rotation=t.zimTouch.startR+B}if(h)t.scaleX=p.scaleX,t.scaleY=p.scaleY,t.rotation=p.rotation,t.x=p.x,t.y=p.y;else{t.reg(0,0);var L=t.parent.localToGlobal(u,f);u=L.x,f=L.y;var X=zot(x)?t.globalToLocal(u,f):t.globalToLocal(x.x,x.y);g.clone().translate(X.x,X.y).rotate(p.rotation-b).scale(p.scaleX/z,p.scaleY/v).translate(-X.x,-X.y).decompose(t),t.x+=r,t.y+=l,x=t.localToGlobal(X.x,X.y),t.reg(y,w)}t.zimTouch.scale&&t.dispatchEvent("scale"),t.zimTouch.rotate&&t.dispatchEvent("rotate"),t.zimTouch.move&&t.dispatchEvent("move")}else t.x=p.x,t.y=p.y,t.zimTouch.move&&t.dispatchEvent("move");t.getStage&&t.stage&&t.stage.update()});function j(){t.zimTouch.pair=[],e.loop(t.zimTouch.pointers,function(e,o,n){o.startX=o.x,o.startY=o.y,n<=1&&t.zimTouch.pair.push(o)}),t.zimTouch.startX=t.x,t.zimTouch.startY=t.y,t.zimTouch.startSX=t.scaleX,t.zimTouch.startSY=t.scaleY,t.zimTouch.startR=t.rotation}t.on("mousedown",function(){var e=1;t.stage.on("stagemousedown",function(){e++}),t.stage.on("stagemouseup",function(){0==--e&&setTimeout(function(){t.zimTouch&&(t.zimTouch.total=0),t.zimTouch&&(t.zimTouch.pointers={}),C=null},50)})},null,!0),t.zimTouch.pressup=t.on("pressup",function(e){var o="id"+Math.abs(e.pointerID+1);if(delete t.zimTouch.pointers[o],(t.zimTouch.move||t.zimTouch.rotate)&&t.zimTouch.total--,i&&!zot(l)&&0==t.zimTouch.total&&(l>0?t.rotation=Math.round(t.rotation/l)*l:0==l&&(t.rotation=Math.round(t.rotation))),c&&0==t.zimTouch.total&&1==C){t.zimTouch.slideInterval.pause();var n=p[(m+1)%p.length],r=p[m%p.length],a=t.x+(n[0]-r[0])*u,s=t.y+(n[1]-r[1])*u,d=t.zimTouch.checkBounds(a,s),h=slideTotal*slideSlice*u*Math.min((t.x-d.x)/(t.x-a)||1,(t.y-d.y)/(t.y-s)||1);t.animate({x:d.x,y:d.y},h,"quadOut",function(){t.dispatchEvent("slidestop")})}0==t.zimTouch.total&&(C=null),t.getStage&&t.stage&&t.stage.update(),j()})}return t}},e.noGesture=function(t,o,n,i){var r;return(r=zob(e.noGesture,arguments,"obj, move, scale, rotate"))?r:(z_d("34.6"),!zot(t)&&t.on&&t.zimTouch?(zot(o)&&(o=!0),zot(n)&&(n=!0),zot(i)&&(i=!0),t.zimTouch.move=!o,t.zimTouch.scale=!n,t.zimTouch.rotate=!i,t.zimTouch.move||t.zimTouch.scale||t.zimTouch.rotate||(t.off("mousedown",t.zimTouch.mousedown),t.off("pressmove",t.zimTouch.pressmove),t.off("pressup",t.zimTouch.pressup),delete t.zimTouch),t):void 0)},e.gestureRect=function(e,t){if(z_d("34.7"),!zot(e)&&e.on&&!zot(t)&&e.zimTouch){e.zimTouch.rect=t;var o=e.zimTouch.checkBounds(e.x,e.y);return e.x=o.x,e.y=o.y,e}},e.hitTestPoint=function(e,t,o,n){if(z_d("35"),!e.stage)return!1;if(!zot(e)&&e.globalToLocal){zot(n)&&(n=!0);var i=e.globalToLocal(t,o),r=e.getBounds();if(n&&r){if(i.x>r.x+r.width||i.xr.y+r.height||i.yi.x+i.width||n.xi.y+i.height||n.y=d-o}zog("zim methods - hitTestCircles():\n please setBounds() on both objects")}},e.hitTestBounds=function(t,o,n,i){if(z_d("39"),t.stage&&o.stage&&!zot(t)&&!zot(o)&&t.getBounds&&o.getBounds){var r=!1;i&&i.graphics&&(r=!0);var a=t.getBounds(),s=o.getBounds();if(a&&s){zot(n)&&(n=0);var l,d,c=e.boundsToGlobal(t),u=e.boundsToGlobal(o);if(r){var h=i.graphics;h.c(),h.ss(1).s("blue"),h.r(c.x,c.y,c.width,c.height),h.s("green"),h.r(u.x,u.y,u.width,u.height),i.stage.update()}return d=u,!((l=c).x>=d.x+d.width+n||l.x+l.width+n<=d.x||l.y>=d.y+d.height+n||l.y+l.height+n<=d.y)}zog("zim methods - hitTestBounds():\n please setBounds() on both objects")}},e.boundsToGlobal=function(e,t,o){if(z_d("40"),!zot(e)&&e.getBounds){zot(o)&&(o=!1);var n=e.getBounds();if(n||!zot(t)){if(t&&(n=t),o)var i=e.globalToLocal(n.x,n.y),r=e.globalToLocal(n.x+n.width,n.y),a=e.globalToLocal(n.x+n.width,n.y+n.height),s=e.globalToLocal(n.x,n.y+n.height);else i=e.localToGlobal(n.x,n.y),r=e.localToGlobal(n.x+n.width,n.y),a=e.localToGlobal(n.x+n.width,n.y+n.height),s=e.localToGlobal(n.x,n.y+n.height);var l=Math.min(i.x,r.x,a.x,s.x),d=Math.min(i.y,r.y,a.y,s.y),c=Math.max(i.x,r.x,a.x,s.x),u=Math.max(i.y,r.y,a.y,s.y);return new createjs.Rectangle(l,d,c-l,u-d)}zog("zim methods - boundsToGlobal():\n please setBounds() on object (or a rectangle)")}},e.hitTestGrid=function(e,t,o,n,i,r,a,s,l,d,c,u,h){if(z_d("41"),!e.stage)return!1;if(!zot(e)&&!u){var f=e.globalToLocal(r,a);r=f.x,a=f.y}zot(s)&&(s=0),zot(l)&&(l=0),zot(d)&&(d=0),zot(c)&&(c=0);var p=t/n,m=o/i,g=Math.min(n-1,Math.max(0,Math.floor((r-s)/p))),z=Math.min(i-1,Math.max(0,Math.floor((a-l)/m)));if(!(r-s>p*(g+1)-d||r-sm*(z+1)-c||a-l0&&t.addChild){for(var _=[],R=0;R0?N=t.zimTweens[D]=t.zimTween=createjs.Tween.get(t,{override:j.override}).wait(s).call(function(){l&&"function"==typeof l&&l(zot(d)?t:d),pe()}):pe()}else{function me(){t.set&&!O&&t.set(I),N=t.zimTweens[D]=t.zimTween=createjs.Tween.get(t,j).to(o,H,createjs.Ease[i]).call(we).wait(te).call(be),Ce()}s>0?N=t.zimTweens[D]=t.zimTween=createjs.Tween.get(t,{override:j.override}).wait(s).call(function(){l&&"function"==typeof l&&l(zot(d)?t:d),me()}):me()}!S&&M&&(ie=B&&!zot(L)&&L.dispatchEvent?e.Ticker.add(function(){L.dispatchEvent("animation")},K):B&&t.dispatchEvent?e.Ticker.add(function(){t.dispatchEvent("animation")},K):e.Ticker.add(function(){},K)),zot(t.zimMaskDynamic)||t.zimMaskApply();var ge=!1;return Ce(),t.stopAnimate&&t.stopAnimate.real||(t.stopAnimate=function(o,n){if(zot(n)&&(n=!0),zot(o)){if(!n)return t;for(var i in t.zimBusy=null,createjs.Tween.removeTweens(t),t.zimTweens)ke(i);t.zimTweens=null,t.zimIdSets=null,e.idSets&&e.idSets[F||i]&&(delete e.idSets[F||i],e.isEmpty(e.idSets)&&delete e.idSets),e.animatedObjects.remove(t)}else{Array.isArray(o)||(o=[o]);var r=Me(o);for(var i in t.zimTweens)n&&r.indexOf(i)>=0&&Te(i),!n&&r.indexOf(i)<0&&Te(i)}return t},t.stopAnimate.real=!0,t.pauseAnimate=function(e,o,n){if(zot(e)&&(e=!0),zot(n)&&(n=!0),zot(o)&&!n)return t;if(zot(o))for(var i in t.zimTweens)Ee(i,e);else{Array.isArray(o)||(o=[o]);var r=Me(o);for(var i in t.zimTweens)n&&r.indexOf(i)>=0&&Ee(i,e),!n&&r.indexOf(i)<0&&Ee(i,e)}return t}),t}function ze(){zot(D)?D=e.makeID(10):(D=String(D),V=D),zot(t.zimIdSets)&&(t.zimIdSets={}),zot(t.zimIdSets[D])?zot(t.zimTweens[D])||(F=D,D=e.makeID(10),t.zimIdSets[F]=[F],t.zimTweens[F].zimIdSet=F,t.zimIdSets[F].push(D)):(F=D,D=e.makeID(10),t.zimIdSets[F].push(D))}function ve(e,t,o,n){var i={};for(R in t)o&&!zot(o[R])?i[R]=o[R]:i[R]=e[R],n&&(e[R]=t[R]);return i}function be(){ee&&"function"==typeof ee&&ee(ne)}function ye(){oe&&"function"==typeof oe&&oe(re)}function we(){if(j.loop){if(!($>0))return void ye();if(U<$)return ye(),void U++;z?t.set&&t.set(xe()):t.set&&t.set(o)}Te(D),r&&"function"==typeof r&&r(a)}function xe(){var e={};for(var n in o)S?zot(I[n])||O?e[n]=t.style[n]:e[n]=I[n]:zot(I[n])||O?e[n]=t[n]:e[n]=I[n];return e}function Ce(){N.zimObj=o,N.zimTicker=ie,N.zimPaused=ge,F&&(N.zimIdSet=F),V&&(zot(e.idSets)&&(e.idSets={}),zot(e.idSets[V])?e.idSets[V]=[t]:e.idSets[V].indexOf(t)<0&&e.idSets[V].push(t)),e.animatedObjects||(e.animatedObjects=new e.Dictionary(!0)),e.animatedObjects.add(t,!0)}function Te(o){if(!zot(t.zimTweens)&&!zot(t.zimTweens[o])){!function(o){if(t.zimBusy){for(var n in o)delete t.zimBusy[n];e.isEmpty(t.zimBusy)&&(t.zimBusy=null)}}(t.zimTweens[o].zimObj),t.zimTweens[o].paused=!0,ke(o);var n=t.zimTweens[o].zimIdSet;if(!zot(n)&&t.zimIdSets){var i=t.zimIdSets[n];i&&i.splice(i.indexOf(o),1),i&&0==i.length&&(delete t.zimIdSets[n],e.isEmpty(t.zimIdSets)&&delete t.zimIdSets)}if(delete t.zimTweens[o],e.isEmpty(t.zimTweens)&&t.stopAnimate(),t.zimTweens&&t.zimTweens[o]||t.zimIdSets&&t.zimIdSets[n||o]);else if(e.idSets&&e.idSets[n||o]){e.idSets[n||o];var r=e.idSets[n||o].indexOf(t);r>=0&&e.idSets[n||o].splice(r,1),e.idSets[n||o].length<=0&&(delete e.idSets[n||o],e.isEmpty(e.idSets)&&delete e.idSets)}}}function ke(o){var n;n=t.zimTweens[o].zimTicker,setTimeout(function(){n&&e.Ticker.remove(n),n=null},200)}function Ee(o,n){var i=t.zimTweens[o];i.paused=n,n!=i.zimPaused&&(i.zimPaused=n,n?i.zimTicker&&(i.zimAnimateTimeout=setTimeout(function(){e.Ticker.remove(i.zimTicker)},200)):(clearTimeout(i.zimAnimateTimeout),i.zimTicker&&(i.zimTicker=e.Ticker.add(i.zimTicker,K))))}function Me(e){for(var o=[],n=0;n=0;o--)e.animatedObjects.objects[o].stopAnimate()}else if(Array.isArray(t)||(t=[t]),e.idSets)for(var n=0;n=0;o--)e.idSets[i][o].stopAnimate(i)}},e.stopZimAnimate=function(t){z_d("45.1"),e.stopAnimate(t)},e.pauseAnimate=function(t,o){if(z_d("45.22"),zot(t)&&(t=!0),zot(o)){if(e.animatedObjects)for(var n=e.animatedObjects.length-1;n>=0;n--)e.animatedObjects.objects[n].pauseAnimate(t)}else if(Array.isArray(o)||(o=[o]),e.idSets)for(var i=0;i=0;n--)e.idSets[r][n].pauseAnimate(t,r)}},e.pauseZimAnimate=function(t,o){z_d("45.2"),e.pauseAnimate(t,o)},e.wiggle=function(t,o,n,i,r,a,s,l,d,c,u,h,f){var p;if(p=zob(e.wiggle,arguments,"target, property, baseAmount, minAmount, maxAmount, minTime, maxTime, totalTime, type, ease, integer, id, startType"))return p;if(z_d("45.25"),zot(t)||zot(n)||zot(i))return t;zot(r)&&(r=i),zot(a)&&(a=1e3),zot(s)&&(s=a),zot(c)&&(c="quadInOut"),zot(u)&&(u=!1),zot(h)&&(h=e.makeID()),zot(d)&&(d="both"),zot(f)&&(f="both"),zot(l)||(t.wiggleTimeout=setTimeout(function(){t.stopAnimate(h)},l));var m,g=0;return function l(){var p=e.rand(a,s),z={},v={};if(v[o]=n,"negative"==d||0==g&&"negative"==f)var b=-e.rand(i,r,u);else b="positive"==d||0==g&&"positive"==f?e.rand(i,r,u):0==g?e.rand(i,r,u,!0):e.rand(i,r,u)*e.sign(m)*-1;z[o]=n+b,0==g&&(p/=2),m=b,g++,"negative"==d||"positive"==d?e.animate({target:t,obj:z,set:v,ease:c,time:2*p,rewind:!0,override:!1,call:l,id:h,ticker:!!t.stage}):e.animate({target:t,obj:z,ease:c,time:p,override:!1,call:l,id:h,ticker:!!t.stage})}(),t},e.loop=function(t,o,n,i,r,a){var s;if(s=zob(e.loop,arguments,"obj, call, reverse, step, start, end"))return s;if(z_d("45.3"),!zot(t)&&!zot(o)){zot(n)&&(n=!1),(zot(i)||i<=0)&&(i=1);var l="number"==typeof t?"number":t.constructor===Array?"array":t.constructor==={}.constructor?"object":"container";if("container"!=l||t.addChild)if("number"==l||"array"==l){if(0==(f=p((u="number"==l?t:t.length)-1)))return;if(n)for(var d=r;d>=a;d-=i){if("number"==l)var c=o(d,f,r,a,t);else c=o(t[d],d,f,r,a,t);if(void 0!==c)return c}else for(d=r;d<=a;d+=i){if("number"==l)c=o(d,f,r,a,t);else c=o(t[d],d,f,r,a,t);if(void 0!==c)return c}}else if("object"==l){var u=0,h=[];for(var d in t)u++,h.push(d);if(0==(f=p(u-1)))return;if(n)for(d=r;d>=a;d-=i){if(void 0!==(c=o(h[d],t[h[d]],d,f,r,a,t)))return c}else for(d=r;d<=a;d+=i){if(void 0!==(c=o(h[d],t[h[d]],d,f,r,a,t)))return c}}else{var f;if(0==(f=p(t.numChildren-1)))return;if(n)for(d=r;d>=a;d-=i){if(void 0!==(c=o(t.getChildAt(d),d,f,r,a,t)))return c}else for(d=r;d<=a;d+=i){if(void 0!==(c=o(t.getChildAt(d),d,f,r,a,t)))return c}}}function p(e){return zot(r)&&(r=n?e:0),zot(a)&&(a=n?0:e),n&&a>r||!n&&r>a?0:(r<0&&a)<0||r>e&&a>e?0:(r=Math.max(0,Math.min(r,e)),a=Math.max(0,Math.min(a,e)),Math.floor((n?r-a:a-r)/i)+1)}},e.copyMatrix=function(e,t){return z_d("45.5"),e.x=t.x,e.y=t.y,e.scaleX=t.scaleX,e.scaleY=t.scaleY,e.regX=t.regX,e.regY=t.regY,e.rotation=t.rotation,e.skewX=t.skewX,e.skewY=t.skewY,e},e.cur=function(e,t){return z_d("41.1"),zot(e)?(zog("zim methods - cur(): please provide object"),e):(zot(t)&&(t="pointer"),e.cursor=t,e)},e.sha=function(e,t,o,n,i){return z_d("41.2"),zot(e)?(zog("zim methods - sha(): please provide object"),e):(zot(t)&&(t="rgba(0,0,0,.3)"),t.blur?(e.shadow=t,e):(zot(o)&&(o=e.width?.08*e.width:5),zot(n)&&(n=e.height?.08*e.height:5),zot(i)&&(i=e.width?.16*e.width:10),e.shadow=new createjs.Shadow(t,o,n,i),e))},e.pos=function(e,t,o,n,i){if(z_d("41.5"),!zot(e))return zot(t)||(e.x=t),zot(o)||(e.y=o),zot(i)&&(i=!0),!zot(n)&&i&&e.addTo(n),e},e.mov=function(e,t,o){if(z_d("41.6"),!zot(e))return zot(t)||(e.x+=t),zot(o)||(e.y+=o),e},e.dep=function(e,t){if(z_d("41.65"),!zot(e))return zot(t)&&(t=0),e.depth=t,e},e.alp=function(e,t){if(z_d("41.7"),!zot(e))return zot(t)||(e.alpha=t),e},e.rot=function(e,t){if(z_d("41.8"),!zot(e))return zot(t)||(e.rotation=t),e},e.siz=function(e,t,o,n){if(z_d("41.85"),!zot(e))return zot(n)&&(n=!1),zot(t)||zot(o)?zot(t)?zot(o)||(n?e.heightOnly=o:e.height=o):n?e.widthOnly=t:e.width=t:(e.widthOnly=t,e.heightOnly=o),e},e.ske=function(e,t,o){if(z_d("41.9"),!zot(e))return zot(t)||(e.skewX=t),zot(o)||(e.skewY=o),e},e.reg=function(e,t,o){if(z_d("41.95"),!zot(e))return zot(t)||(e.regX=t),zot(o)||(e.regY=o),e},e.sca=function(e,t,o){if(z_d("41.97"),!zot(e)&&!zot(e.scaleX))return zot(t)&&(t=e.scaleX),zot(o)&&(o=t),e.scaleX=t,e.scaleY=o,e},e.scaleTo=function(t,o,n,i,r,a){var s;if(s=zob(e.scaleTo,arguments,"obj, boundObj, percentX, percentY, type, boundsOnly"))return s;if(z_d("43"),!zot(t)&&t.getBounds&&t.getBounds()){if(!zot(o)&&o.getBounds&&o.getBounds()){zot(n)&&(n=-1),zot(i)&&(i=-1),-1==n&&-1==i&&(n=i=100),zot(r)&&(r="smallest"),zot(a)&&(a=!1);var l=o.getBounds().width*n/100*(a?1:o.scaleX),d=o.getBounds().height*i/100*(a?1:o.scaleY);if((-1==n||-1==i)&&"both"!=r&&"stretch"!=r)return-1==n?e.sca(t,d/t.getBounds().height):e.sca(t,l/t.getBounds().width),t;if("both"==r||"stretch"==r)return t.scaleX=-1!=n?l/t.getBounds().width:t.scaleX,t.scaleY=-1!=i?d/t.getBounds().height:t.scaleY,t;if("biggest"==r||"largest"==r||"outside"==r)var c=Math.max(l/t.getBounds().width,d/t.getBounds().height);else c=Math.min(l/t.getBounds().width,d/t.getBounds().height);return e.sca(t,c),t}zog("zim methods - scaleTo(): please provide a boundObject (with setBounds) to scale to")}else zog("zim methods - scaleTo(): please provide an object (with setBounds) to scale")},e.fit=function(t,o,n,i,r,a){var s;if(s=zob(e.fit,arguments,"obj, left, top, width, height, inside"))return s;if(z_d("46"),!zot(t)&&t.getBounds){if(t.getBounds()){if(zot(o)){if(!t.stage)return void zog("zim methods - fit(): please add boundary dimensions or add obj to stage first");if(!t.stage.getBounds())return void zog("zim methods - fit(): please add boundary dimensions or add obj with bounds to stage first");o=0,n=0,i=t.stage.getBounds().width,r=t.stage.getBounds().height}zot(a)&&(a=!0),t.scaleX=t.scaleY=1;var l,d=i,c=r,u=t.getBounds().width,h=t.getBounds().height;l=a?d/c>=u/h?c/h:d/u:d/c>=u/h?d/u:c/h,t.scaleX=t.scaleY=l;var f=u*l,p=h*l;return t.x=(t.regX-t.getBounds().x)*l+o+(d-f)/2,t.y=(t.regY-t.getBounds().y)*l+n+(c-p)/2,{x:t.x,y:t.y,width:f,height:p,scale:l,bX:o,bY:n,bWidth:i,bHeight:r}}zog("zim methods - fit(): please setBounds() on object")}},e.outline=function(t,o,n){var i;if(i=zob(e.outline,arguments,"obj, color, size"))return i;if(z_d("47"),zot(t)||!t.getBounds)return zog("zim methods - outline(): please provide object with bounds set"),t;if(!t.getBounds())return zog("zim methods - outline(): please setBounds() on object"),t;if(!t.parent)return zog("zim methods - outline(): object should be on stage first"),t;zot(o)&&(o="brown"),zot(n)&&(n=2);var r=t.getBounds(),a=new createjs.Shape,s=new createjs.Shape,l=t.parent,d=t.localToLocal(r.x,r.y,l),c=t.localToLocal(r.x+r.width,r.y,l),u=t.localToLocal(r.x+r.width,r.y+r.height,l),h=t.localToLocal(r.x,r.y+r.height,l),f=t.localToLocal(0,0,l),p=a.graphics,m=s.graphics;p.s(o).ss(n).mt(d.x,d.y).lt(c.x,c.y).lt(u.x,u.y).lt(h.x,h.y).lt(d.x,d.y).cp();return m.s("white").ss(n+2),m.mt(-11,0).lt(11,0),m.mt(0,-11).lt(0,11),m.s(o).ss(n),m.mt(-10,0).lt(10,0),m.mt(0,-10).lt(0,10),s.x=f.x,s.y=f.y,s.rotation=t.rotation,p.s("white").ss(n+2).dc(t.x,t.y,16),p.s(o).ss(n).dc(t.x,t.y,16),t.parent.addChild(a),t.parent.addChild(s),a.mouseEnabled=!1,s.mouseEnabled=!1,t.stage&&t.stage.update(),t},e.addTo=function(e,t,o){if(z_d("47.5"),!zot(e)){if(zot(t)){if(!zimDefaultFrame)return void zog("zim methods - addTo(): please provide container");t=zimDefaultFrame.stage}return zot(o)||isNaN(o)?t.addChild(e):t.addChildAt(e,o),e}zog("zim methods - addTo(): please provide object")},e.removeFrom=function(e,t){if(z_d("47.6"),!zot(e))return zot(t)?e.parent.removeChild(e):t.removeChild(e),e;zog("zim methods - removeFrom(): please provide object")},e.added=function(e,t,o,n){if(z_d("47.7"),!zot(e)&&!zot(t)&&"function"==typeof t){if(zot(o)&&(o=100),!e.stage){var i=Date.now(),r=0,a=setInterval(function(){r>5?clearInterval(a):(r++,e.stage&&(t(e.stage,e),clearInterval(a),clearInterval(s)))},10),s=setInterval(function(){n>0&&i-Date.now()>n&&clearInterval(s),e.stage&&(t(e.stage,e),clearInterval(s))},o);return s}t(e.stage,e)}},e.centerReg=function(t,o,n,i){var r;if(r=zob(e.centerReg,arguments,"obj, container, index, add"))return r;if(z_d("48"),zot(t)||!t.getBounds||!t.getBounds())return zog("zim methods - centerReg(): please provide object with bounds set"),t;zot(i)&&(i=!0);var a=t.getBounds();return t.regX=a.x+a.width/2,t.regY=a.y+a.height/2,zot(o)&&t.parent?t:i?e.center(t,o,n):t},e.center=function(t,o,n,i){var r;if(r=zob(e.center,arguments,"obj, container, index, add"))return r;if(z_d("48.1"),!zot(t)&&t.getBounds){if(zot(o)&&zimDefaultFrame&&(o=zimDefaultFrame.stage),!zot(o)&&o.getBounds){var a=t.getBounds(),s=o.getBounds();if(zot(i)&&(i=!0),i&&o.addChild&&(zot(n)||"number"==typeof n&&isNaN(n)?o.addChild(t):o.addChildAt(t,n)),zot(s))return t;if(zot(a))return t.x=o.getBounds().width/2,t.y=o.getBounds().height/2,t;var l=t.localToLocal(t.regX,t.regY,o),d=e.boundsToGlobal(t),c=e.boundsToGlobal(o,d,!0);if(t.x=s.x+s.width/2-c.width/2+(l.x-c.x),t.y=s.y+s.height/2-c.height/2+(l.y-c.y),!i&&o.getStage&&o.stage&&t.parent){var u=o.localToLocal(t.x,t.y,t.parent);t.x=u.x,t.y=u.y}return t}zog("zim.center(): please provide container with bounds")}else zog("zim.center(): please provide object with bounds")},e.place=function(t,o){if(z_d("49"),!zot(t))return zot(o)&&(o="obj"),e.drag({obj:t,currentTarget:!0,dragCursor:"crosshair"}),zog("place "+o+" - to get new position"),t.on("click",function(){zog(o+".x = "+Math.round(t.x)+"; "+o+".y = "+Math.round(t.y)+";"),zog(o+".pos("+Math.round(t.x)+", "+Math.round(t.y)+");")}),t},e.placeReg=function(t,o){if(z_d("49.5"),!zot(t)){var n=t.stage;if(zot(n))zog("zim.placeReg() - add object to stage before calling placeReg()");else{zot(o)&&(o="obj");var i=t.parent.localToGlobal(t.x,t.y),r=new e.Shape(-25,-25,50,50).addTo(n).pos(i.x,i.y);r.graphics.s("white").mt(-25,0).lt(25,0).mt(0,-25).lt(0,20),r.compositeOperation="difference",r.expand(0),e.drag({obj:r}),zog("place cursor to get new registration point location"),n.on("stagemouseup",function(){var e=t.globalToLocal(r.x,r.y);zog(o+".regX = "+Math.round(e.x)+"; "+o+".regY = "+Math.round(e.y)+";"),zog(o+".reg("+Math.round(e.x)+", "+Math.round(e.y)+");")})}}},e.expand=function(e,t,o){if(z_d("50"),zot(e)||!e.getBounds||!e.getBounds())return zog("zim methods - expand(): please provide object with bounds set"),e;zot(t)&&(t=20),zot(o)&&(o=t);var n=e.getBounds(),i=new createjs.Shape;return i.graphics.f("0").r(n.x-t,n.y-o,n.width+2*t,n.height+2*o),e.hitArea=i,e},e.setMask=function(t,o,n){if(z_d("50.1"),zot(t)&&zog("zim methods - setMask(): please provide obj"),zot(o))return i(),t;function i(){t.zimMask&&t.zimMask.parent&&t.zimMask.parent.removeChild(t.zimMask),t.zimMask=null,t.zimMaskTicker&&Ticker.remove(t.zimMaskTicker),t.mask=null}var r;function a(){if(n&&(!t.stage||!o.stage))return t;delete r,t.zimMask=o.zimMask=r=o.shape.clone(),e.copyMatrix(r,o),r.regX=o.regX,r.regY=o.regY,o.addChildAt(r,0),r.alpha=0,r.x=o.x+o.shape.x,r.y=o.y+o.shape.y,t.mask=r}return t.zimMaskOriginal&&t.zimMaskOriginal!=o&&i(),zot(n)&&(n=!("Blob"!=o.type&&zot(o.zimDown)&&zot(o.transformControls)&&zot(o.zimTouch)&&zot(o.zimTweens)),o.zimMaskDynamic=n),t.zimMaskOriginal=o,o.zimMaskApply=function(){t.zimMaskTicker&&Ticker.remove(t.zimMaskTicker),t.zimMaskTicker=Ticker.add(a)},o&&o.shape?(a(),n&&o.zimMaskApply()):(r=o,t.mask=r),t},e.ANIMATE=!0,e.OPTIMIZE=!1,e.ACTIONEVENT="mousedown",e.Ticker={stages:null,myUpdate:null,alwaysList:new e.Dictionary,list:new e.Dictionary,setFPS:function(t,o){zot(t)&&zot(o)?(t=30,o=60):zot(t)?t=30:zot(o)&&(o=t),e.Ticker.framerate=createjs.Ticker.framerate=e.mobile()?t:o},setTimingMode:function(e){createjs.Ticker.timingMode=createjs.Ticker.RAF,"synched"==e&&(createjs.Ticker.timingMode=createjs.Ticker.RAF_SYNCHED),"timeout"==e&&(createjs.Ticker.timingMode=createjs.Ticker.TIMEOUT)},add:function(t,o){z_d("30");var n=e.Ticker;return n.has(t,o)?t:(n.framerate||n.setFPS(),!zot(o)&&o.update||(o=zimDefaultFrame.stage),zot(t)||"function"!=typeof t?void zog("zim.Ticker.add() - only add functions"):(n.ticker||(n.ticker=createjs.Ticker.on("tick",n.call)),n.list.at(o)?n.list.at(o).push(t):n.list.add(o,[t]),t))},rawID:{},raw:function(t){z_d("30");var o=e.makeID(7,"letters");return function n(){t(),e.Ticker.rawID[o]=requestAnimationFrame(n)}(),o},removeRaw:function(t){cancelAnimationFrame(e.Ticker.rawID[t]),delete e.Ticker.rawID[t]},call:function(t){for(var o,n,i=e.Ticker,r=0;r0&&(!zot(i.update)||e.OPTIMIZE||!zns&&OPTIMIZE?i.update&&o.update():o.update())}for(r=0;r-1&&o.list.values[i].splice(r,1),n+=o.list.values[i].length}o.alwaysList.length>0||0==n&&(createjs.Ticker.off("tick",o.ticker),o.ticker=null)}},removeAll:function(t){for(var o,n=e.Ticker,i=0,r=0;r0||0==i&&(createjs.Ticker.off("tick",n.ticker),n.ticker=null)},has:function(t,o){return!zot(o)&&o.update||(o=zimDefaultFrame.stage),e.Ticker.list&&e.Ticker.list.at(o)&&e.Ticker.list.at(o).indexOf(t)>=0},dispose:function(t){for(var o,n=e.Ticker,i=0,r=n.list.length-1;r>=0;r--)o=n.list.objects[r],zot(t)||t===o?(n.list.remove(t),n.alwaysList.remove(t)):i+=n.list.values[r].length;if(!(n.alwaysList.length>0))return 0==i&&(createjs.Ticker.off("tick",n.ticker),n.ticker=null),!0}},Object.defineProperty(e.Ticker,"update",{get:function(){return e.Ticker.myUpdate},set:function(t){var o=e.Ticker;"boolean"!=typeof t&&(t=null),o.myUpdate=t,!1===o.myUpdate&&(cancelAnimationFrame(o.ticker),o.alwaysList=new e.Dictionary)}}),e.Accessibility=function(t,o,n,i,r,a,s,l,d,c,u,h,f,p){var m;if(m=zob(e.Accessibility,arguments,"appName, tabOrder, tabIndex, cycle, decimals, frame, alwaysHighlight, AHTime, AHColor, AHBorderWidth, AHBorderPadding, AHAlpha, AHObject, AHObjectScale",this))return m;if(z_d("30.5"),this.cjsEventDispatcher_constructor(),zot(t)&&(t="application"),zot(i)&&(i=!1),zot(r)&&(r=2),zot(a)&&(a=zimDefaultFrame),zot(s)&&(s=!1),zot(l)&&(l=700),zot(d)&&(d="brown"),zot(c)&&(c=3),zot(u)&&(u=5),zot(h)&&(h=.8),zot(p)&&(p=.8),zot(f)){var g=new e.Shape;g.mouseEnabled=!1}else f.mouseEnabled&&(f.mouseEnabled=!1);var z=this;z.cycle=i,z.decimals=r,z.alwaysHighlight=s,z.AHTime=l,z.AHColor=d,z.AHBorderWidth=c,z.AHBorderPadding=u,z.AHAlpha=h,z.AHObjectScale=p;var v,b,y,w,x,C,T,k,E=-1,M=-1,j=[],S=[],A={RadioButtons:"option",Tabs:"tab",Pad:"key"},P=a.canvas.id,O=e.mobile(),I=!1,D=null,B=[];function L(e){var t=e.currentTarget.boundsToGlobal(),o=t.x+t.width/2,n=t.y+t.height/2;e.stageXo+5||e.stageYn+5?_():Y()}function X(){w&&(w.innerHTML="")}function Y(){var t,o;D=!0,F(),w&&w.setAttribute("aria-hidden",!1),e.ACTIONEVENT="click",a.stage.removeChild(v),z.alwaysHighlight=!1,a.stage.update();for(var n=0;n=0?"at "+(o.selectedIndex+1)+" of "+o.num:"not indicating")),t.title+="."}function U(e,t,o,n,i){var r;if(n&&(h=n.obj),n&&("TextArea"==h.type||"Loader"==h.type))return(r=h.tag).setAttribute("aria-label",t),h&&r.setAttribute("aria-hidden",!h.stage),"before"==i?o.parentNode.insertBefore(r,o):o.parentNode.insertBefore(r,o.nextSibling),r.style.zIndex=-5,r.zimObject=h,n.obj.zimTabTag=r,j.push(r),r;if(!n||"Dial"!=h.type&&"Slider"!=h.type&&"Stepper"!=h.type&&"ColorPicker"!=h.type)r=document.createElement("div"),h&&(r.zimObject=h),r.innerHTML="tag",r.setAttribute("role","button");else{var s,l,d=[];if("Dial"==h.type||"Slider"==h.type)for(var c=h.step<=0?(h.max-h.min)/20:h.step,u=h.min;u=E.length)h();else{t!=M&&u();var o=E[t].obj;if(o.stage){if(M=t,o.focus=!0,q=!0,K=!1,z.changeTitle(o),o.zimTabTag.focus(),setTimeout(function(){o.zimTabTag.focus();var e=new createjs.Event("change");e.title=o.zimTabTag.getAttribute("aria-label"),z.dispatchEvent(e)},150),z.alwaysHighlight&&!D){if(z.AHObject){v=z.AHObject;var n=e.boundsToGlobal(o);z.AHObject.alp(z.AHAlpha).addTo(a.stage),z.AHObject.fit(n.x,n.y,n.width,n.height),z.AHObject.sca(z.AHObject.scaleX*z.AHObjectScale),z.AHTime>0&&(Z=setTimeout(function(){a.stage.removeChild(z.AHObject),a.stage.update()},z.AHTime))}else{v=g;var i=o.getBounds(),r=o.localToGlobal(i.x-5,i.y-5),s=o.localToGlobal(i.x+i.width+5,i.y-5),l=o.localToGlobal(i.x+i.width+5,i.y+i.height+5),d=o.localToGlobal(i.x-5,i.y+i.height+5),c=g.graphics;c.clear(),c.s(z.AHColor).ss(z.AHBorderWidth).mt(r.x,r.y).lt(s.x,s.y).lt(l.x,l.y).lt(d.x,d.y).lt(r.x,r.y).cp(),g.alpha=z.AHAlpha,z.AHTime>0&&(Z=setTimeout(function(){a.stage.removeChild(g),a.stage.update()},z.AHTime))}a.stage.addChild(v),a.stage.update()}}else h()}function u(){if(M&&M>-1)E[M].obj.focus=!1;else for(var e=0;e0&&(E[0].obj.focus=!0),K=!0,q=!0,J(t)):(E.length>0&&(E[E.length-1].obj.focus=!0),K=!0,q=!0,J(t)))),q&&E.length>0&&z.tabIndex>=0&&13==e.keyCode){var o=E[z.tabIndex],n=o.obj;if(o&&n.stage){var i=new createjs.Event("mousedown"),r=new createjs.Event("click");i.fromEnter=r.fromEnter=!0,"Pane"==n.type?(n.backdrop.dispatchEvent(i),n.backdrop.dispatchEvent(r)):(n.dispatchEvent(i),n.dispatchEvent(r))}}});function J(e){e.ctrlKey?$(e.shiftKey?-1:1):(e.shiftKey?z.tab(-1):z.tab(1),e.preventDefault())}function $(e){q=!1,zid(P+(1==e?"SuffixTab":"PrefixTab")).focus(),a.stage.removeChild(f),a.stage.update(),z.tabIndex=-1}this.tab=function(e){if(clearTimeout(Z),v&&a.stage.removeChild(v),zot(e)&&(e=1),0!=E.length)for(var t=0;tMath.abs(l-a)?(s-r>u.distance&&(e.swipeX=1,u.direction="right"),r-s>u.distance&&(e.swipeX=-1,u.direction="left")):(l-a>u.distance&&(e.swipeY=1,u.direction="down"),a-l>u.distance&&(e.swipeY=-1,u.direction="up")),u.dispatchEvent(e)}u.active&&!e.target.zimNoSwipe&&(u.obj=e.target,s=r=e.stageX,l=a=e.stageY,d=!0,u.dispatchEvent("swipedown"),clearTimeout(c),c=setTimeout(function(){d&&(o(),d=!1)},u.duration),t.on("pressmove",function(e){s=e.stageX,l=e.stageY}),t.on("pressup",function(e){d&&(o(),d=!1,clearTimeout(c))}))}),this.disable=function(){u.active=!1},this.enable=function(){u.active=!0}}else zog("zim controls - Swipe():\nPlease pass in object")},e.extend(e.Swipe,createjs.EventDispatcher,null,"cjsEventDispatcher",!1),e.Pages=function(t,o,n,i,r){var a;if(a=zob(e.Pages,arguments,"pages, transition, speed, transitionTable, holder",this))return a;if(z_d("71"),this.zimContainer_constructor(),this.type="Pages",zot(t)&&(t=[]),this.pages=t,zot(o)&&(o="none"),zot(n)&&(n=200),zot(i)&&(i=[]),this.transitionTable=i,zot(r)&&zimDefaultFrame&&(r=zimDefaultFrame.stage),r.getBounds&&r.getBounds()){this.speed=n,this.active=!0;var s=this;s.transitioning=!1;var l,d,c=r.getBounds().width,u=r.getBounds().height;"none"==o&&i==[]||w();for(var h,f,p=["left","right","up","down"],m=0;m0&&setTimeout(function(){s.settle()},e)},this.settle=function(){s.removeAllChildren(),s.addChild(z),s.dispatchEvent("puffed")},this.disable=function(){s.active=!1},this.enable=function(){s.active=!0},this.dispose=function(){return s.swipe.off("swipe",b),s.removeAllChildren(),t=null,!0}}else zog("zim controls - Pages():\nholder object must have bounds set");function w(){(l=new createjs.Shape).graphics.f("black").r(0,0,c,u+1),(d=new createjs.Shape).graphics.f("white").r(0,0,c,u+1)}},e.extend(e.Pages,e.Container,"clone","zimContainer",!1),zot(e.ACTIONEVENT)&&(e.ACTIONEVENT="mousedown"),e.HotSpots=function(t,o,n){var i;if(i=zob(e.HotSpots,arguments,"spots, local, mouseDowns",this))return i;if(z_d("72"),this.zimContainer_constructor(),this.type="HotSpots",!zot(t)&&Array.isArray(t)){zot(o)&&(o=!0),zot(n)&&(n=!1);for(var r,a,s="mousedown"!=e.ACTIONEVENT||!window.zns&&"mousedown"!=ACTIONEVENT?"click":"mousedown",l=[],d=0;d=0;d--)r=t[d],a=l[d],i&&!Array.isArray(i)&&(i=[i.x,i.y,i.getBounds().width,i.getBounds().height]),(zot(o)&&zot(i)||zot(i)&&o==r.page||zot(o)&&e.arraysEqual(i,r.rect)||o==r.page&&e.arraysEqual(i,r.rect))&&(t.splice(d,1),a.button&&(a.button.off(s,a.button.zimHSEvent),a.button.zimHSEvent=null,n||(a.button.off("mousedown",a.button.zimHSMDEvent),a.button.zimHSMDEvent=null)),a.off(s,u),a.dispose(),l.splice(d,1))},this.dispose=function(){for(var e=0;e=0;e--)t.items[e].dispose();return t.items=[],t=null,!0}},e.ResizeManager=function(){z_d("75.5"),e.Manager.call(this,"ResizeManager")},e.ResizeManager.prototype=new e.Manager,e.ResizeManager.prototype.constructor=e.ResizeManager,e.TransformManager=function(e,t){z_d("75.7");var n=this;function i(){localStorage&&n.savePersist()}this.items=[],this.add=function(e){var t,o=[];o=Array.isArray(e)?e:[e];for(var i=!1,r=0;r100)zog("zim controls - Layout(): cannot fit regions into 100% bounds");else{var w=100-p;x(),this.resize=function(){if(f.active){c=s.getBounds(),t.setBounds(0,0,c.width,c.height),h.graphics.clear(),""!=i&&h.graphics.f(i).r(0,0,c.width,c.height);for(var l=0;l0&&0==u.maxGiven&&(A=u.object.getBounds()[g],(P=u.object.getBounds()[z])/A*(u.given*c[g]/100)>(y=u[b]*c[z]/100)?(u.maxGiven=A/P*y*100/c[g],u.given-u.maxGiven,T-=u.maxGiven):d=!1);if(d)break;totalPrimaries=0;for(l=0;l0?u.maxGiven0&&u.given0?u.maxGiven0&&u.given100?void zog("zim display - Layout(): cannot fit regions into 100% bounds"):(w=100-p,x(),void f.resize())}var E=!0,M=0,j=0;for(l=0;l0?j+=u[g]:u.maxGiven>0?j+=u.maxGiven:u.given>0&&(j+=u.given),0==u[g]&&(E=!1);if(E||d){var S=100-j-(M+=n);if(M-=n+o[0][v],0!=S&&0!=M)for(l=0;l0?B+=u.marginGiven*c[g]/100:B+=u[v]*c[g]/100,A=(A=u[g]>0?u[g]:u.maxGiven>0?u.maxGiven:u.given>0?u.given:0)*c[g]/100,P=u[b]*c[z]/100,L=(c[z]-P)/2,O=r?e.fit(u.object,L,B,P,A):e.fit(u.object,B,L,A,P),"top"==u.valign?u.object.y=O.bY:"bottom"==u.valign&&(u.object.y=O.bY+O.bHeight-O.height),"left"==u.align?u.object.x=O.bX:"right"==u.align&&(u.object.x=O.bX+O.bWidth-O.width),a&&a.graphics&&(X.s("white").ss(2).r(O.bX,O.bY,O.bWidth,O.bHeight),X.s("#ff8203").sd([20,20]).r(O.bX,O.bY,O.bWidth,O.bHeight).sd()),D=I=0,0!=B&&B+A!=c[g]||(r?D=1:I=1),P==c[z]&&(r?I=1:D=1),""!=u.backgroundColor&&h.graphics.f(u.backgroundColor).r(O.bX,O.bY,O.bWidth+I,O.bHeight+D),B+=A}},this.resize(),a&&t.addChild(a),t.addChildAt(h,0),window.addEventListener("keydown",C),this.disable=function(){f.active=!1,window.removeEventListener("keydown",C),a&&(a.alpha=0)},this.enable=function(){f.active=!0,window.addEventListener("keydown",C),f.resize(),a&&(a.alpha=1)},this.removeShape=function(){a&&(a.graphics.clear(),t.removeChild(a),a=null,a=!1),window.removeEventListener("keydown",C)},this.addShape=function(e,o){f.removeShape(),a=e,window.addEventListener("keydown",C),t.addChild(a),f.resize()},this.dispose=function(){return f.removeShape(),!0}}}else zog("zim controls - Layout(): holder must have bounds set or provide a scalingObject with bounds");else zog("zim controls - Layout(): please provide an object with bounds set that holds the objects being laid out");function x(){for(var e=0,t=0;ti)break e;var b=(u=zik(t).clone()).width,y=u.height;y>h&&(h=y),u.snapToPixel=d,this.addChild(u),s&&v%2==1?(u.scaleX=-u.scaleX,u.x=m+b-2*u.getBounds().x*u.scaleX):u.x=m,l&&z%2==1?(u.scaleY=-u.scaleY,u.y=g+y-2*u.getBounds().y*u.scaleY):u.y=g,m+=b+r}g+=h+a}this.clone=function(){return f.cloneProps(new e.Tile(t,o,n,i,r,a,s,l,d))}},e.extend(e.Tile,e.Container,"clone","zimContainer",!1),e.Parallax=function(t,o,n,i){var r;if(r=zob(e.Parallax,arguments,"layers, damp, auto, stage",this))return r;if(z_d("68"),zot(i))if(t&&t[0]&&t[0].obj&&t[0].obj.stage)i=t[0].obj.stage;else{if(!zimDefaultFrame)return;i=zimDefaultFrame.stage}n=!!zot(n);var a=i.getBounds().width,s=i.getBounds().height,l=this,d=zot(o)?.1:o;this.addLayer=function(t){if(!(zot(t.obj)||zot(t.prop)||zot(t.propChange))){var o={obj:t.obj,prop:t.prop};o[o.prop]=t.propChange,zot(t.input)&&(t.input="mouseX"),o.input=t.input,o.split=zot(t.split)?!("mouseX"!=t.input||!n):t.split;var i=zot(t.inMin)?0:t.inMin,r=zot(t.inMax)?"mouseX"==t.input||"scrollX"==t.input?a:s:t.inMax,l=zot(t.factor)?1:t.factor,u=!zot(t.integer)&&t.integer;return o["p_"+o.prop]=new e.ProportionDamp(i,r,0,o[o.prop],d,l,u),"scale"==o.prop?o["s_"+o.prop]=o.obj.scaleX:"frame"==o.prop?o["s_"+o.prop]=o.obj.currentFrame:o["s_"+o.prop]=o.obj[o.prop],zot(t.immediate)||o["p_"+o.prop].immediate(t.immediate),c.push(o),c.length-1}},this.removeLayer=function(e){if(!zot(e)){var t=c[e];t["p_"+t.prop].dispose(),c.splice(e,1)}},this.immediate=function(e){for(var t,o=0;o0?c.x<0&&d.xp&&c.x>d.x?c.x=d.x-g:d.x>p&&d.x>c.x&&(d.x=c.x-g)):(d.y-=u.speed*u.direction,d.y0?c.y<0&&d.ym&&c.y>d.y?c.y=d.y-z:d.y>m&&d.y>c.y&&(d.y=c.y-z))},a);this.paused=!1,this.pause=function(t,o){return zot(t)&&(t=!0),zot(o)&&(o=0),t?(h=u.speed,o>0?(v=!0,e.animate({target:u,obj:{pausingSpeed:0},ticker:!1,time:o,call:function(){u.speed=0,u.paused=!0,v=!1,u.dispatchEvent("pause")}})):(v=!1,u.speed=0,u.paused=!0,setTimeout(function(){u.dispatchEvent("pause")},10))):(v=!1,o>0?e.animate({target:u,obj:{pausingSpeed:h},ticker:!1,time:o,call:function(){u.speed=h,u.paused=!1,v=!1}}):(u.speed=h,u.paused=!1)),u},Object.defineProperty(u,"percentSpeed",{get:function(){return 0==u.baseSpeed?NaN:u.speed/u.baseSpeed*100},set:function(e){v||u.paused||(u.speed=u.baseSpeed*e/100)}}),Object.defineProperty(u,"pausingSpeed",{get:function(){return 0==u.baseSpeed?NaN:u.speed/u.baseSpeed*100},set:function(e){u.speed=u.baseSpeed*e/100}}),this.dispose=function(){return zon&&zog("bye from Scroller"),e.Ticker.remove(b),!0}}else zog("zim display - Scroller(): please setBounds() on container or stage if no container");else zog("zim display - Scroller(): please add object to container or stage before adding to Scroller");else zog("zim display - Scroller(): please pass in stage parameter or add backing objects to stage to start");else zog("zim display - Scroller(): please setBounds() on backing objects")}},e.extend(e.Scroller,createjs.EventDispatcher,null,"cjsEventDispatcher"),e.Dynamo=function(t,o,n,i,r,a,s,l,d){var c;if(c=zob(e.Dynamo,arguments,"sprite, speed, label, startFrame, endFrame, update, reversible, flip, flipVertical",this))return c;z_d("69.2"),this.cjsEventDispatcher_constructor();var u=this.frames=t.parseFrames(n,i,r,!0);if(0!=u.length){this.totalFrames=u.length;var h=0;zot(o)&&(o=30),zot(s)&&(s=!0);var f=this.baseSpeed=this.speed=o;zot(a)&&(a=!1),zot(l)&&0==s&&(l=!0);var p,m,g,z,v,b=this,y=Date.now(),w=!1;b.scaleX=t.scaleX,b.scaleY=t.scaleY,function e(){if(p=requestAnimationFrame(e),m=u[h].s,0!=b.speed&&0!=m&&(z=1e3/Math.abs(b.speed)*m,(g=Date.now())-y>z)){y=g;var o=b.frame+(b.speed>0||!s?1:-1),n=!1;o>=u.length&&(n=!0,o=0),o<0&&(n=!0,o=u.length-1),b.frame=o,l&&(b.speed<0?t.scaleX=-b.scaleX:t.scaleX=b.scaleX),d&&(b.speed<0?t.scaleY=-b.scaleY:t.scaleY=b.scaleY),n&&b.dispatchEvent("loop"),b.dispatchEvent("change"),a&&t.stage&&t.stage.update(),zot(v)||v!=b.frame||(w=!1,b.speed=0,b.paused=!0,b.dispatchEvent("pause"))}}(),this.paused=!1,this.pause=function(t,o,n){return zot(t)&&(t=!0),zot(o)&&(o=0),t?(f=b.speed,zot(n)?o>0?(w=!0,e.animate({target:b,obj:{pausingSpeed:0},ticker:!1,time:o,call:function(){w=!1,b.speed=0,b.paused=!0,b.dispatchEvent("pause")}})):(w=!1,b.speed=0,b.paused=!0,setTimeout(function(){b.dispatchEvent("pause")},10)):(w=!0,v=n)):(v=null,o>0?(w=!0,e.animate({target:b,obj:{pausingSpeed:f},ticker:!1,time:o,call:function(){w=!1,b.speed=f,b.paused=!1}})):(w=!1,b.speed=f,b.paused=!1)),b},Object.defineProperty(b,"frame",{get:function(){return h},set:function(e){h=Math.round(e)%u.length;var o=u[h];zot(o)||(t.frame=o.f)}}),Object.defineProperty(b,"percentSpeed",{get:function(){return 0==b.baseSpeed?NaN:b.speed/b.baseSpeed*100},set:function(e){w||b.paused||(b.speed=b.baseSpeed*e/100)}}),Object.defineProperty(b,"pausingSpeed",{get:function(){return 0==b.baseSpeed?NaN:b.speed/b.baseSpeed*100},set:function(e){b.speed=b.baseSpeed*e/100}}),this.dispose=function(){cancelAnimationFrame(p)}}},e.extend(e.Dynamo,createjs.EventDispatcher,null,"cjsEventDispatcher"),e.Accelerator=function(e){z_d("69.3"),this.cjsEventDispatcher_constructor();var t=this;this.paused=!1,this.items=[],this.paused=!1,this._percentSpeed=100,this.add=function(e){var o;o=Array.isArray(e)?e:[e];for(var n=0;n=0&&t.items.splice(n,1);return t},this.pause=function(e,o,n){zot(e)&&(e=!0);var i=[];if(e){zot(n)||(o=null);for(var r=!1,a=0;a0&&(v.swiperMoving=!0),y=f-e*i*c,zot(a)||(y=Math.max(y,a)),zot(s)||(y=Math.min(y,s)),v.desiredValue=y,v.dispatchEvent("swipemove")}function E(){b.off("mousedown",m),b.off("pressmove",g),b.off("pressup",z)}function M(){b.canvas?(b.off("stagemousedown",m),b.off("stagemousemove",g),b.off("stagemouseup",z)):E(),e.Ticker.remove(v.target.swiperTicker)}},e.extend(e.Swiper,createjs.EventDispatcher,null,"cjsEventDispatcher",!1),e.MotionController=function(t,o,n,i,r,a,s,l,d,c,u,h,f,p,m,g,z){var v;if(v=zob(e.MotionController,arguments,"container, target, type, speed, axis, rect, map, diagonal, damp, flip, rotate, constant, firstPerson, turnSpeed, moveThreshold, stickThreshold, localBounds",this))return v;if(z_d("69.7"),this.cjsEventDispatcher_constructor(),!zot(t)&&t.getStage)if(zot(t.stage))zog("zim Controller(): The Container must be on the stage");else{var b=t.stage;zot(o)&&(o=new e.Container(1,1)),zot(i)&&(i=7),(zot(n)||"mousemove"!=n&&"keydown"!=n&&"gamebutton"!=n&&"gamestick"!=n&&"swipe"!=n&&"manual"!=n)&&(n="mousedown"),zot(r)&&(r="both"),"keydown"==n&&zot(s)&&(s=[[65,37],[68,39],[87,38],[83,40]]),"gamebutton"==n&&zot(s)&&(s=f?[14,15,e.GamePad.RT,e.GamePad.LT]:[14,15,12,13]),"gamestick"==n&&zot(s)&&(s=f?[[0,2],[0,2],[1],[1]]:[0,0,1,1]),"gamestick"==n&&zot(s)&&(s=[0,0,1,1]),zot(l)&&(l=!0),"horizontal"!=r&&"vertical"!=r||(l=!1),zot(d)&&(d="keydown"==n||"gamebutton"==n?1:.1),zot(f)&&(f=!1),zot(p)&&(p=.4*i),zot(m)&&(m=4),zot(g)&&(g=.2);var y=this;this.dirX=0,this.dirY=0,this.speed=i,this.turnSpeed=p,this.axis=r,this.target=o,this.moveThreshold=m,this.stickThreshold=g;var w=y.speed,x=y.speed,C=0;y.rotation=0,y.x=this.target.x,y.y=this.target.y;var T=y.scaleX=o.scaleX;y.scaleY=o.scaleY;if("keydown"==n||"gamebutton"==n){for(var k=0;k<4;k++)Array.isArray(s[k])||(s[k]=[s[k]]);var E=[0,0,0,0],M=[],j=["X","X","Y","Y"],S=[-1,1,-1,1],A={dirX:0,dirY:0};if("keydown"==n)var P=frame.on("keydown",I);else var O=(_=y.gamepad=new e.GamePad).on("buttondown",I);function I(e){var t,o="keydown"==n?e.keyCode:e.buttonCode;for(k=0;k<4;k++)if(s[k].indexOf(o)>-1){if(l||"both"!=y.axis||(A.dirX=A.dirY=0),A["dir"+j[k]]=S[k],E[k]=1,0==(t=M.indexOf(k)))return;return t>0&&M.splice(t,1),void M.unshift(k)}}if(zot(h))if("keydown"==n)var D=frame.on("keyup",L);else var B=_.on("buttonup",L);function L(e){var t,o="keydown"==n?e.keyCode:e.buttonCode;for(k=0;k<4;k++)if(s[k].indexOf(o)>-1){if(E[k]=0,(t=M.indexOf(k))>=0&&M.splice(t,1),"both"!=y.axis||l)A["dir"+j[k]]=-E[2*Math.floor(k/2)]+E[2*Math.floor(k/2)+1];else if(M.length>0){A["dir"+j[k]]=0;var i=M[0];A["dir"+j[i]]=S[i]}else A.dirX=A.dirY=0;return}}var X={rotation:0,speedX:y.speed,speedY:y.speed},Y=e.Ticker.add(function(){if(f)K(A);else{var e=y.speed,t=y.speed;if("both"==y.axis&&0!=A.dirX&&0!=A.dirY){var o=$(A.dirX,A.dirY);e=o.speedX,t=o.speedY}"horizontal"!=y.axis&&"both"!=y.axis||(y.x+=e*A.dirX),"vertical"!=y.axis&&"both"!=y.axis||(y.y+=t*A.dirY),Q()}},b)}else if("mousedown"==n||"mousemove"==n)mouseEvent=b.on("stage"+n,function(){var e=t.globalToLocal(b.mouseX,b.mouseY);y.x=e.x,y.y=e.y,Q()});else if("gamestick"==n){var _=this.gamepad=new e.GamePad;for(k=0;k<4;k++)Array.isArray(s[k])||(s[k]=[s[k]]);X={rotation:0,speedX:y.speed,speedY:y.speed};var R=_.on("data",function(e){for(var t={dirX:0,dirY:0},o=0;oy.stickThreshold){t.dirX=n;break}}for(o=0;oy.stickThreshold){t.dirY=n;break}}f?K(t):(y.x+=y.speed*t.dirX,y.y+=y.speed*t.dirY,Q())})}else if("swipe"==n)var W=new e.Swiper(b,y,"x",.8),N=new e.Swiper(b,y,"y",.8,!1),F=W.on("swipemove",function(){Q()});var V=this.x=this.target.x,H=this.y=this.target.y;this.dampX=new e.Damp(V,d),this.dampY=new e.Damp(H,d),this.dampR=new e.Damp(this.target.rotation,d);var G=0,U=0,Z=e.Ticker.add(function(){if(a&&(y.x=e.constrain(y.x,a.x,a.x+a.width),y.y=e.constrain(y.y,a.y,a.y+a.height)),"horizontal"!=y.axis&&"both"!=y.axis||(y.dirX=e.sign(y.x-V),Math.abs(y.x-V)y.moveThreshold,y.movingY=Math.abs(H-y.target.y)>y.moveThreshold,y.moving=y.movingX||y.movingY,u&&!zot(y.rotation)&&(y.target.rotation=y.dampR.convert(y.rotation))},b);this.immediate=function(e,t,o){!zot(e)&&y.dampX&&(y.dampX.immediate(e),y.x=y.target.x=V=e,W&&W.immediate(e)),!zot(t)&&y.dampY&&(y.dampY.immediate(t),y.y=y.target.y=H=t,N&&N.immediate(t)),!zot(o)&&y.dampR&&(y.dampR.immediate(o),y.rotation=y.target.rotation=o)},this.convert=function(e,t){zot(e)||(y.x=e),zot(t)||(y.y=t),Q()};var q=!0;Object.defineProperty(y,"enabled",{get:function(){return q},set:function(t){q!=t&&(t?function(){"keydown"==n?(P=frame.on("keydown",P),D=frame.on("keyup",D),Y=e.Ticker.add(Y,b)):"gamebutton"==n?(O=_.on("buttondown",O),B=_.on("buttonup",B),Y=e.Ticker.add(Y,b)):"gamestick"==n?R=_.on("data",R):"swipe"==n?(W.enabled=!0,N.enabled=!0,F=W.on("swipemove",F)):"mousedown"!=n&&"mousemove"!=n||(mouseEvent=b.on("stage"+n,mouseEvent));Z=e.Ticker.add(Z,b)}():ee(),q=Boolean(t))}}),this.dispose=function(){ee(),_&&_.dispose(),W&&W.dispose(),N&&W.dispose()}}else zog("zim Controller(): Please pass in a reference to a container as first parameter");function K(e){X.rotation+=e.dirX*y.turnSpeed,y.rotation=X.rotation,X.speedX=Math.sin(X.rotation*Math.PI/180)*y.speed*-e.dirY,X.speedY=-Math.cos(X.rotation*Math.PI/180)*y.speed*-e.dirY,y.x+=X.speedX,y.y+=X.speedY}function Q(){var e=$(y.x-y.target.x,y.y-y.target.y);if(w=e.speedX,x=e.speedY,u)if(y.rotation=e.angle,zot(y.rotation))y.rotation=y.target.rotation;else{y.rotation+=C;var t=J(y.rotation),o=y.target.rotation=J(y.target.rotation);Math.abs(t-o)>180&&(o>t?o-=360:t-=360),y.dampR.immediate(o),y.target.rotation=o,y.rotation=t}}function J(e){return(e%360+360)%360}function $(e,t){var o,n=y.speed,i=y.speed,r=Math.sqrt(Math.pow(e,2)+Math.pow(t,2));return r>0&&(n=Math.abs(e)/r*y.speed,i=Math.abs(t)/r*y.speed,o=90-180*Math.atan2(e,t)/Math.PI),{speedX:n,speedY:i,angle:o}}function ee(){"keydown"==n?(frame.off("keydown",P),frame.off("keyup",D),e.Ticker.remove(Y)):"gamebutton"==n?(_.off("buttondown",O),_.off("buttonup",B),e.Ticker.remove(Y)):"gamestick"==n?_.off("data",R):"swipe"==n?(W.enabled=!1,N.enabled=!1,W.off("swipemove",F)):"mousedown"!=n&&"mousemove"!=n||b.off("stage"+n,mouseEvent),e.Ticker.remove(Z)}},e.extend(e.MotionController,createjs.EventDispatcher,"enabled","cjsEventDispatcher"),e.GamePad=function(){if(z_d("69.8"),this.cjsEventDispatcher_constructor(),!navigator.getGamepads)return this.error=!0,void(zon&&zog("zim.GamePad() - no browswer support"));var e;window.addEventListener("gamepadconnected",o),this.currentIndex=0;var t=this;function o(o){var i,r,a;t.connected=!0,i="gamepadconnected",r=o,(a=new createjs.Event(i)).index=r.gamepad.index,a.id=r.gamepad.id,a.buttons=r.gamepad.buttons,a.axes=r.gamepad.axes,t.dispatchEvent(a);var s=navigator.getGamepads()[t.currentIndex];t.lastData=[];for(var l=0;l0){var a={};O.shrink&&(a.scale=0),O.fade&&(a.alpha=0)}if(O.pool&&B.length>0&&X>=Math.max(O.poolMin,(O.life/i+5)*r)){var s=B[L++%B.length];s.visible=!0;var l=s.trace?s.getChildAt(0):s;if(l.emitShape){var d=l.template;l.graphics.c().s(d.s?zik(d.s):null).ss(d.ss?zik(d.ss):null).sd(d.sd?zik(d.sd):null,d.offset?zik(d.offset):null)}s.trace&&s.updateCache(),"top"==O.layers?l.emitShape?s.addTo(O):s.centerReg(O):l.emitShape?s.addTo(O,!0,"bottom"==O.layers?0:e.rand(O.numChildren)):s.centerReg(O,"bottom"==O.layers?0:e.rand(O.numChildren)),s.alpha=1,s.scaleX=1,s.scaleY=1,l.alpha=l.originalAlpha,l.scaleX=l.originalScaleX,l.scaleY=l.originalScaleY,l.endSpurt=!1}else{X++,O.trace&&((s=new e.Container(o,n)).trace=!0);var c=zik(e.shuffle(t)[0]);if("shape"==c.type){var d=c,l=new e.Shape(1,1);l.emitShape=!0,l.template=d,l.graphics.s(d.s?zik(d.s):null).ss(d.ss?zik(d.ss):null).sd(d.sd?zik(d.sd):null,d.offset?zik(d.offset):null),O.trace?l.addTo(s):"top"==O.layers?l.addTo(O):l.addTo(O,"bottom"==O.layers?0:e.rand(O.numChildren))}else{var l=c.clone();l.centerReg||zimify(l),O.trace?l.centerReg(s).pos(-1e3,-1e3):"top"==O.layers?l.centerReg(O):l.centerReg(O,"bottom"==O.layers?0:e.rand(O.numChildren))}O.trace&&("top"==O.layers?s.addTo(O):s.addTo(O,"bottom"==O.layers?0:e.rand(O.numChildren)),s.cache(f,p,o,n)),O.trace||(s=l),s.particle=l,l.originalAlpha=l.alpha,l.originalScaleX=l.scaleX,l.originalScaleY=l.scaleY}O.currentParticle=l,O.particlesEmitted++,s.particleNormal=!0,s.particleDecaying=!1,s.particleFizzing=!1;var u=zik(O.angle),h=zik(O.force),m=h*Math.cos(u*Math.PI/180),g=h*Math.sin(u*Math.PI/180);l.info={position:{x:o/2,y:n/2},velocity:{x:m,y:g}},O.horizontal&&(l.info.position={x:e.rand(0,o),y:O.vertical?n/2:0}),O.vertical&&(l.info.position={x:O.horizontal?o/2:0,y:e.rand(0,n)}),l.emitShape?l.graphics.mt(l.info.position.x,l.info.position.y):l.pos(l.info.position.x,l.info.position.y),O.random&&e.loop(O.random,function(e,t){val=zik(t),"scale"==e?l.sca(val):("x"==e?l.info.position.x=O.horizontal||O.vertical?val:val+o/2:"y"==e&&(l.info.position.y=O.horizontal||O.vertical?val:val+n/2),l[e]=val,l.emitShape&&l.pos(0,0))}),E&&!l.emitShape&&l.cache(l.getBounds().x-10,l.getBounds().y-10,l.getBounds().width+20,l.getBounds().height+20);var z,v=!l.emitShape&&O.shrink;if(O.decayTime>0&&(O.fade||v||O.trace&&O.traceFadeTime>0)){if(O.trace&&O.traceFadeTime>0&&s.animate({obj:{alpha:0},time:O.traceFadeTime,wait:O.life-O.traceFadeTime,waitedCall:function(e){e.particleNormal=!1,e.particleFizzing=!0},call:Y,override:!1,id:"decay"}),O.fade||v){var b={};O.fade&&(b.alpha=0),v&&(b.scaleX=0,b.scaleY=0),l.animate({obj:b,time:O.decayTime,wait:zot(O.decayStart)?O.life-O.decayTime:O.decayStart,waitedCall:function(e){e.parent!=O&&(e=e.parent),e.particleNormal=!1,e.particleDecaying=!0},call:function(t){var o;O.events&&_("decayed",t),t.endSpurt&&_("spurtDecayed",t),O.trace&&O.traceFadeTime>0||(zot(O.decayStart)||O.decayStart+O.decayTime>O.life?Y(t.parent.trace?t.parent:t):(o=s,e.timeout(O.life-(O.decayStart+O.decayTime),function(){Y(o)})))},override:!1,id:"decay"})}}else O.life>0&&((z=s).timeOut=e.timeout(O.life,function(){Y(z)}));if(O.events&&_("emitted",s),function(e){if(zot(O.spurtCount)&&zot(O.spurtNum))return;O.spurtCount++,O.spurtCount>=O.spurtNum&&R(e)}(l),O.animation){var y=zik(O.animation);zot(y.override)&&(y.override=!1),l.animate(e.copy(y))}}));function a(e,t){return e-t}},null,!0);I=O.emitterTicker=e.Ticker.add(function(){e.loop(O,function(t){if(t.trace){var o=t;t=t.getChildAt(0)}var n=t.info,i=0,r=0;if(!zot(O.sink)){var a=O.localToGlobal(n.position.x,n.position.y);if(O.sink.parent&&O.sink.parent.localToGlobal)var s=O.sink.parent.localToGlobal(O.sink.x,O.sink.y);else s=new createjs.Point(zik(O.sink.x),zik(O.sink.y));var l=e.angle(a.x,a.y,s.x,s.y),i=O.sinkForce*Math.cos(l*Math.PI/180),r=O.sinkForce*Math.sin(l*Math.PI/180)}var d=O.wind+i,c=O.gravity+r;n.velocity.x+=d*frameRate,n.velocity.y+=c*frameRate,n.position.x+=n.velocity.x*frameRate*100,n.position.y+=n.velocity.y*frameRate*100,t.emitShape?t.graphics.lt(n.position.x,n.position.y):(t.x=n.position.x,t.y=n.position.y),O.trace&&o&&o.updateCache(t.emitShape?null:"source-over")})},D),frameRate=1/e.Ticker.framerate}}),Object.defineProperty(O,"interval",{get:function(){return i},set:function(e){i=e,O.zimInterval&&(O.zimInterval.time=i)}}),this.spurting=!1,this.spurt=function(t,o,n){var i;if(i=zob(O.spurt,arguments,"num, time, restart"))return i;zot(o)||(e.timeout(zik(o),function(){R(O.currentParticle)}),O.spurting=!0),zot(t)||(O.spurtNum=zik(t),O.spurtCount=0,O.spurting=!0),O.pause(!1,n,null,!0)},this.clearPool=function(){e.loop(O,function(e){e.pooled="end",e.visible||O.removeChild(e)},!0),X=0,L=0,B=[]},O.startPaused||(this.paused=!1),this.pause=function(t,o,n,i){if(O.startPaused=null,zot(t)&&(t=!0),zot(o)&&(o=!1),zot(n)&&(n=!1),t){if(O.paused)return O;n&&(I&&e.Ticker.remove(I),e.loop(O,function(e){e.pauseAnimate(),e.trace&&e.getChildAt(0).pauseAnimate(),e.timeOut&&e.timeOut.pause()})),O.zimInterval.pause(),O.paused=!0}else{if(!O.paused)return O;o&&(e.loop(O,function(e){e.stopAnimate(),e.timeOut&&e.timeOut.clear(),e.trace&&e.getChildAt(0).pauseAnimate()}),O.removeAllChildren()),D&&I&&!e.Ticker.has(D,I)&&(e.Ticker.add(I,D),e.loop(O,function(e){e.pauseAnimate(!1),e.timeOut&&e.timeOut.pause(!1),e.trace&&e.getChildAt(0).pauseAnimate(!1)})),O.zimInterval.pause(!1,i),O.paused=!1}return O},this.resize=function(e,t){zot(e)||(o=e),zot(t)||(n=t),O.setBounds(0,0,o,n),x||C||O.centerReg(),O.clearPool()},this.clone=function(){var t;return t=Array.isArray(O.obj)||O.obj.constructor=={}.constructor?e.copy(O.obj):O.obj.clone?O.obj.clone():O.obj,O.cloneProps(new e.Emitter(t,o,n,O.interval,O.num,O.life,O.fade,O.shrink,O.decayTime,O.decayStart,O.trace,O.traceFadeTime,O.traceShiftX,O.traceShiftY,O.angle,O.force,O.gravity,O.wind,O.layers,O.animation,e.copy(O.random),O.horizontal,O.vertical,O.sink,O.sinkForce,E,O.events,j,O.pool,O.poolMin))},this.dispose=function(){return I&&e.Ticker.remove(I),e.loop(O,function(e){e.stopAnimate()}),O.zimInterval.clear(),!0}},e.extend(e.Emitter,e.Container,"clone","zimContainer",!1),e.SoundWave=function(t,o,n,i,r,a,s,l,d,c){var u;if(u=zob(e.SoundWave,arguments,"num, input, include, smoothing, min, max, operation, baseline, magnify, reduce",this))return u;z_d("69.95"),zot(t)&&(t=120),zot(o)&&(o="mic"),zot(n)&&(n=.1171875),zot(i)&&(i=.85),zot(r)&&(r="mic"==o?-80:-100),zot(a)&&(a="mic"==o?-40:-10),zot(s)&&(s=function(t,o){return t*(.5+1*o/Math.pow(e.SoundWave.bufferLength,.95))}),zot(l)&&(l="mic"==o?0:30),zot(d)&&(d="mic"==o?1:10),zot(c)&&(c=0),e.SoundWave.bufferLength=1024,_num=t;var h=this;h.baseline=l,h.magnify=d,h.reduce=c;var f=new(window.AudioContext||window.webkitAudioContext),p=h.analyser=f.createAnalyser();if(p.minDecibels=r,p.maxDecibels=a,p.smoothingTimeConstant=i,Object.defineProperty(this,"smoothing",{get:function(){return p.smoothingTimeConstant},set:function(e){p.smoothingTimeConstant=e}}),Object.defineProperty(this,"num",{get:function(){return _num},set:function(t){_num=t,(z=Math.floor(n*e.SoundWave.bufferLength/_num))<1&&zog("ZIM SoundWave: num is too big")}}),"mic"==o)return navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia,void(navigator.getUserMedia?navigator.getUserMedia({audio:!0},function(e){v(h.source=f.createMediaStreamSource(e))},function(e){zog("ZIM SoundWave: Error occured: "+e)}):zog("ZIM SoundWave: Sorry, mic not supported"));if(o.type&&"sound"==o.type)zog("ZIM SoundWave: pass in the result of a zim.asset('somesound').play() for the input");else{if(o.playbackResource)var m=o.playbackResource,g=f.createMediaElementSource(m);else m=o,g=f.createMediaElementSource(m);var z;v(g)}function v(t){if(t.connect(p),"mic"!=o&&p.connect(f.destination),p.fftSize=2*e.SoundWave.bufferLength,(z=Math.floor(n*e.SoundWave.bufferLength/_num))<1)zog("ZIM SoundWave: include param is too small or num param is too big");else{var i=p.frequencyBinCount,r=new Uint8Array(i);h.calculate=function(){p.getByteFrequencyData(r);var t=r.map(s);if(1==z)return t;for(var i=[],a=0,l=0;l<=n*e.SoundWave.bufferLength;l++)a+=t[l],0!=l&&l%z==0&&(i.push(Math.max(0,(a/z-h.baseline)*h.magnify-h.reduce)),a=0);return"mic"!=o&&(i[0]*=.75,i[1]*=.85,i[2]*=.9,i[i.length-2]*=.8,i[i.length-1]*=.75),i[i.length-1]*=1.3,i[i.length-2]*=1.2,i[i.length-3]*=1.1,i},setTimeout(function(){h.dispatchEvent("ready")},50)}}},e.extend(e.SoundWave,createjs.EventDispatcher,null,"cjsEventDispatcher",!1),e.Portal=function(t,o){var n;if(n=zob(e.Portal,arguments,"obj, lands",this))return n;if(z_d("69.96"),!zot(t)&&t.stage){var i=this,r=o&&o.numChildren&&o.numChildren>0;if(r){var a=o.getChildAt(o.numChildren-1),s=o.getChildAt(o.numChildren-2);o.setChildIndex(s,o.numChildren-1),s.setMask(t)}t.on(mobile()?"mousedown":"mouseover",function(){i._enabled&&(r&&l(),i.dispatchEvent("enter"))}),t.on(mobile()?"pressup":"mouseout",function(){i._enabled&&i.dispatchEvent("exit")}),Object.defineProperty(this,"portal",{get:function(){return t},set:function(e){!zot(e)&&e.stage||!zon?s.setMask(t):zog("zim.Portal() - please provide a Display Object to act as the portal")}}),Object.defineProperty(this,"currentLand",{get:function(){return a},set:function(e){if(o.contains(e))for(;e!=a;)l()}}),Object.defineProperty(this,"nextLand",{get:function(){return s},set:function(e){zon&&zog("zim.Portal() - nextLand is read only - remake Portal to change")}}),this._enabled=!0,Object.defineProperty(i,"enabled",{get:function(){return i._enabled},set:function(e){i._enabled=e}}),this.dispose=function(){}}function l(){o.setChildIndex(a,0),a=s,s=o.getChildAt(o.numChildren-2),o.setChildIndex(s,o.numChildren-1),a.setMask(null),s.setMask(t),t.stage.update()}},e.extend(e.Portal,createjs.EventDispatcher,null,"cjsEventDispatcher",!1),e.VR=function(t,o,n,i,r,a,s,l,d,c,u,h){var f;if(f=zob(e.VR,arguments,"content, angle, distance, parallax, parallaxAngle, damp, parallaxDamp, startAngle, negativeParallax, boundaryMarkers, swiper, holder",this))return f;if(z_d("69.98"),this.type="VR",zimDefaultFrame){var p=zimDefaultFrame;if(zot(h)||!h.getBounds||!h.getBounds().width)h=p.stage;zot(o)&&(o=0),zot(n)&&(n=100),zot(a)&&(a=.5),zot(i)&&(i=0),zot(r)&&(r=60),zot(s)&&(s=.1),zot(l)&&(l=0),zot(d)&&(d=!1),zot(c)&&(c=!0),zot(u)&&(u=!0),this.angle=o,this.currentAngle=l,e.mobile()&&(u=!1);var m=this,g=h.width,z=h.height;m.zimContainer_constructor();var v=m.left=new e.Container(g/2,z),b=new e.Rectangle(g/2,z,"rgba(0,0,0,.01)");v.addChild(b);var y=m.right=v.clone();m.addChild(v,y),y.x=g/2;var w=m.contentLeft=m.content=t,x=m.contentRight=t.clone();if(0!=l)var C=setTimeout(G,100);else G();var T=[],k=[];if(U(w,x),Z(T,"left"),Z(k,"right"),0!=o&&0!=n){var E=new e.Damp(180+l,a);E.immediate(180+l);var M=!1,j=!1;function S(e){m.currentAngle=e;var t=-m.currentAngle*n/o;if(m.contentLeft.x=t,m.contentRight.x=t,Math.round(m.currentAngle)<=-o/2&&!M)(i=new createjs.Event("boundaryout")).boundary="left",M=!0,m.dispatchEvent(i);else if(Math.round(m.currentAngle)>=o/2&&!j){(i=new createjs.Event("boundaryout")).boundary="right",j=!0,m.dispatchEvent(i)}else if(Math.round(m.currentAngle)>-o/2&&Math.round(m.currentAngle)180?-180:180)+e.rotation.z+l)-180)}),e.Ticker.always()}if(0!=i&&0!=n){var P=new ProportionDamp(180-r/2,180+r/2,-r/2,r/2,s);if(P.immediate(180),0==o)function O(e,t){e.vrParallaxDistance=e.depth<=0&&!d?0:t,e.dep(e.depth)}function I(e){0!=o&&0!=n?(loop(T,A),loop(k,A)):(loop(T,function(t){O(t,e)}),loop(k,function(t){O(t,e)}))}p.on("deviceorientation",function(e){var t=0;0==o&&0!=i&&0!=n&&(t=P.convert((e.rotation.z>180?-180:180)+e.rotation.z)),I(t)}),e.Ticker.always()}!u||0==n||0==o&&0==i||m.added(function(){var t={swipeAngle:0};m.swiper=new e.Swiper({swipeOn:m,target:t,property:"swipeAngle",sensitivity:.2,damp:.05,factor:-1,min:-330,max:330});Ticker.add(function(){0!=o&&0!=n&&S(t.swipeAngle),0!=i&&0!=n&&I(P.convert(t.swipeAngle+180))})});var D=localStorage&&localStorage.zimEyeAdjust?Number(localStorage.zimEyeAdjust):0,B=D,L=!1;w.startRegX=w.regX,x.startRegX=x.regX;var X=this.adjuster=new e.Container(800,300),Y=(b=X.backing=new e.Rectangle(X.width,X.height,p.lighter).center(X).alp(1).sha("rgba(0,0,0,.2)",0,0,30),X.strip=new e.Rectangle(X.width,X.height/3,p.white).center(X).alp(1),X.label=new e.Label({text:"slide to adjust center of left and right",size:28,color:p.dark,align:"center",valign:"center"}).center(X).pos(null,50),X.close=new e.Rectangle(50,50,p.light).addTo(X).mov(X.width-70,26)),_=new e.Shape(-40,-40,80,80);_.graphics.f(p.dark).p("AmJEVIEUkTIkXkWIB4h5IEWEYIETkTIB4B3IkTESIEQERIh4B4IkRkRIkSEVg"),_.center(Y).sca(.3),Y.cursor="pointer",Y.on("mousedown"!=e.ACTIONEVENT||!window.zns&&"mousedown"!=ACTIONEVENT?"click":"mousedown",function(){m.hideAdjuster(),N.currentValue=(N.max-N.min)/2+B,m.dispatchEvent("closed")});var R=new e.Circle(30,p.dark).center(X).pos(X.width/4);R.shape.alpha=.2,new e.Circle(12,p.dark).center(R);var W=new e.Circle(30,p.dark).center(X).pos(X.width/4*3);W.shape.alpha=.2,new e.Circle(12,p.dark).center(W);var N=X.slider=new e.Slider({min:0,max:30,step:1,useTicks:!0}).centerReg(X).pos(null,X.height-40);N.currentValue=(N.max-N.min)/2+D;var F=new e.Proportion(N.min,N.max,R.x-X.width/4,R.x+X.width/4,-1),V=new e.Proportion(N.min,N.max,W.x-X.width/4,W.x+X.width/4);N.on("change",function(){R.x=F.convert(N.currentValue),W.x=V.convert(N.currentValue)}),new e.Label("closer",24,null,p.silver).centerReg(X).pos(N.x-220,N.y),new e.Label("farther",24,null,p.silver).centerReg(X).pos(N.x+220,N.y),(m.ok=new e.Button({label:"OK",width:90,height:60,corner:0,color:p.blue,rollColor:p.green,shadowColor:-1}).centerReg(X).sca(.8).pos(X.width-58,N.y)).on("mousedown"!=e.ACTIONEVENT||!window.zns&&"mousedown"!=ACTIONEVENT?"click":"mousedown",function(){localStorage&&(localStorage.zimEyeAdjust=N.currentValue-(N.max-N.min)/2),q(),m.hideAdjuster(),m.dispatchEvent("saved"),m.dispatchEvent("closed")}),(m.zero=new e.Button({label:">|<",width:90,height:60,corner:0,color:p.yellow,rollColor:p.green,shadowColor:-1}).centerReg(X).sca(.8).pos(58,N.y)).on("mousedown"!=e.ACTIONEVENT||!window.zns&&"mousedown"!=ACTIONEVENT?"click":"mousedown",function(){N.currentValue=(N.max-N.min)/2,R.x=F.convert(N.currentValue),W.x=V.convert(N.currentValue)});var H=new Proportion(0,30,-h.width/4,h.width/4);q(),this.showAdjuster=function(){if(L)return m;L=!0,R.x=F.convert(N.currentValue),W.x=V.convert(N.currentValue),B=N.currentValue-(N.max-N.min)/2,X.scaleTo(h).center(this),h.stage.update()},this.hideAdjuster=function(){if(!L)return m;L=!1,X.removeFrom(this),h.stage.update()},this.position=function(e,t,o){function n(e){e.vrStartX=t,e.vrParallaxDamp&&e.vrParallaxDamp.immediate(t),e.mov(t,o)}return n(e),n(e.vrMatch),e},this.register=function(e){if(!e.parent||!e.parent.vrMatch)return zon&&zog("ZIM VR() - please only register objects already inside content container"),e;var t=[],o=[];return U(e,e.clone().addTo(e.parent.vrMatch),t,o),Z(t,"left"),Z(o,"right"),e},0!=o&&0!=n&&c&&(m.boundaryRight=new Container,new Circle(24,p.light).addTo(m.boundaryRight).dep(-2),new Triangle(16,16,16,p.yellow,p.grey,null,null,-3).rot(-90).center(m.boundaryRight).dep(-6),m.boundaryRight.center(t).mov(n/2+24),m.boundaryLeft=new Container,new Circle(24,p.light).addTo(m.boundaryLeft).dep(-2),new Triangle(16,16,16,p.yellow,p.grey,null,null,-3).rot(90).center(m.boundaryLeft).dep(-6),m.boundaryLeft.center(t).mov(-n/2-24),m.register(m.boundaryRight),m.register(m.boundaryLeft)),this.remove=function(e){return loop(arguments,function(e,o){t.contains(o)&&(!function e(t){var o=T.indexOf(t);T.indexOf(t)>=0&&(T.splice(o,1),k.splice(o,1)),loop(t,function(t){e(t)})}(o),o.parent.removeChild(o),o.vrMatch.parent.removeChild(o.vrMatch))}),m},this.resize=function(){g=h.width,z=h.height,v.getChildAt(0).widthOnly=y.getChildAt(0).widthOnly=g/2,v.getChildAt(0).heightOnly=y.getChildAt(0).heightOnly=z,y.x=g/2,v.setBounds(0,0,g/2,z),y.setBounds(0,0,g/2,z),0!=l?(clearTimeout(C),C=setTimeout(G,100)):G(),X.scaleTo(h).center(this,null,!1)}}else zon&&zog("zim.VR() - please use ZIM Frame");function G(){w.addTo(v).setMask(v.getChildAt(0)).pos(null,(h.height-w.height)/2),x.addTo(y).setMask(y.getChildAt(0)).pos(null,(h.height-w.height)/2)}function U(e,t,o,n){e.vrMatch=t,t.vrMatch=e,e.cacheCanvas&&t.cache(),e.dep&&!zot(e.depth)&&(T.push(e),k.push(t),zot(o)||o.push(e),zot(n)||n.push(t),t.dep(e.depth)),loop(e,function(e,i){U(e,t.getChildAt(i),o,n)})}function Z(t,r){loop(t,function(t){t.vrChannel=r,t.vrStartX=t.x,0!=o&&0!=n&&(t.vrAngle=o,t.vrDistance=n),0!=i&&0!=n&&(t.vrParallax=i/100,t.vrParallaxDistance=0,0!=o&&(t.vrParallaxDamp=new e.Damp(0,s))),t.dep(t.depth)})}function q(){var e=H.convert(N.currentValue);w.regX=w.startRegX+e,x.regX=x.startRegX-e}},e.extend(e.VR,e.Container,"clone","zimContainer",!1),zon&&zog("ZIM FRAME"),e.Frame=function(t,o,n,i,r,a,s,l,d,c,u,h,f,p,m,g,z,v,b,y){var w;if(w=zob(e.Frame,arguments,"scaling, width, height, color, rollover, touch, scrollTop, align, valign, canvasID, rollPerSecond, delay, canvasCheck, gpu, gpuObj, nextFrame, nextStage, allowDefault, outerColor, loadFailObj",this))return w;z_d("83"),this.cjsEventDispatcher_constructor();var x=this;if("undefined"==typeof zimDefaultFrame&&(zimDefaultFrame=this),zot(f)&&(f=!0),!!window.HTMLCanvasElement||!f){var C=e.mobile();zot(t)&&(t="full"),zot(r)&&(r=!C),zot(a)&&(a=!0),zot(s)&&(s=!0),zot(l)&&(l="center"),zot(d)&&(d="center");var T="";zot(c)&&(zimDefaultFrame!=this?(T=e.makeID(5),c="myCanvas"+T):c="myCanvas"),zot(u)&&(u=20),zot(h)&&(h=0),zot(p)&&(p=!1),zot(v)&&(v=!1),zot(y)&&(y="circles"),this.loadFailObj=y;var k,E=["fit","outside","full"];this.scale=1,this.x=0,this.y=0;var M,j,S,A,P,O=o,I=n,D=!1,B=!1;"interactive"===document.readyState||"complete"===document.readyState?setTimeout(function(){F()},200):document.addEventListener("DOMContentLoaded",F);var L,X=!1,Y="full"==t&&"undefined"!=typeof InstallTrigger;window.addEventListener("resize",function(){Y?X||(X=!0,P=e.Ticker.update,e.Ticker.update=!1,setTimeout(function(){X=!1,k==zimDefaultFrame.stage&&(e.Ticker.update=P)},40),setTimeout(function(){G(),Z()},20)):(G(),Z(),h>0&&C&&setTimeout(function(){G(),Z()},h))}),this.loadAssetsCount=0,this.assets={},this.loadAssets=function(t,o,n,i,r,a,s,l){if(zot(t.src)){var d;if(d=zob(x.loadAssets,arguments,"assets, path, xhr, time, loadTimeout, outputAudioSprite, crossOrigin, fileType"))return d}if(!zot(t)&&(zot(n)&&(n=!1),Array.isArray(t)||(t=[t]),0!=t.length)){zot(i)&&(i=0),zot(r)&&(r=8e3),zot(a)&&(a=!1),zot(s)&&(s="anonymous");var c,u,h,f=!1,p=[],m=/\.([^.]+)$/i,g=[],z=[],v=0,b=!0;for(P=0;P0){for(var j,S,A=[],P=0;P0){var O;for(P=0;P0){M.loadAssetsCount++;var B=M.preload=x.preload=new createjs.LoadQueue(n,o,s);f&&B.installPlugin(createjs.Sound),B.on("progress",function(e){M.dispatchEvent(e),x.dispatchEvent(e)}),B.on("error",function(e){M.dispatchEvent(e),x.dispatchEvent(e)}),B.on("fileload",function(t){var n,i=t.item,r=t.item.type;i.id.match(m);if(r&&"sound"==r){var a=[];if(i.data&&i.data.audioSprite)for(var s=0;s=0&&(f=!0)}function X(){M.loadAssetsCount--,0==M.loadAssetsCount&&Y()}function Y(){var e=Date.now();i=Math.max(0,i-(e-I)),setTimeout(function(){x.loadAssetsCount--,x.loadAssetsCount<=0&&(x.isLoading=!1),M.isLoading=!1,M.dispatchEvent(D),x.dispatchEvent(D)},i)}},this.asset=function(e){if(!zot(e)){if(x.assets[e])return x.assets[e];if("circles"==x.loadFailObj)var t=frame.makeCircles(14);else t=x.loadFailObj;return t&&(t.type="EmptyAsset",t.id=e,t.play=function(){if(zon)return zog("zim.Frame - asset("+e+") not found"),{}}),t}},Object.defineProperty(x,"stage",{get:function(){return k},set:function(e){zog("zim.Frame(): stage is read only - see remakeCanvas(), perhaps")}}),Object.defineProperty(x,"width",{get:function(){return O},set:function(e){zog("zim.Frame(): width is read only - see remakeCanvas(), perhaps")}}),Object.defineProperty(x,"height",{get:function(){return I},set:function(e){zog("zim.Frame(): height is read only - see remakeCanvas(), perhaps")}}),Object.defineProperty(this,"color",{get:function(){return i},set:function(t){i=t,zot(t)?zid(c).style.backgroundColor="default":(zid(c).style.backgroundColor=i,!zot(i)&&p&&k.setClearColor(e.convertColor(i)))}}),Object.defineProperty(this,"outerColor",{get:function(){return L},set:function(e){L=e,zet("body").css({backgroundColor:L})}});var _=v;Object.defineProperty(x,"allowDefault",{get:function(){return _},set:function(e){e?(k.preventSelection=!1,document.body.style.overflow="visible",x.zil&&(window.removeEventListener("keydown",x.zil[0]),window.removeEventListener("wheel",x.zil[1]),window.removeEventListener("DOMMouseScroll",x.zil[2]),x.zil=null)):(k.preventSelection=!0,document.body.style.overflow="hidden",zot(x.zil)&&(x.zil=zil())),_=e}});var R=new createjs.Event("keydown");if(this.eventRemove=R.remove,window.addEventListener("keydown",function(e){e.remove=x.eventRemove,x.altKey=e.altKey,x.ctrlKey=e.ctrlKey,x.metaKey=e.metaKey,x.shiftKey=e.shiftKey,x.dispatchEvent(e)}),window.addEventListener("keyup",function(e){x.altKey=e.altKey,x.ctrlKey=e.ctrlKey,x.metaKey=e.metaKey,x.shiftKey=e.shiftKey,e.remove=x.eventRemove,x.dispatchEvent(e)}),window.DeviceMotionEvent&&window.addEventListener("devicemotion",function(e){e.remove=x.eventRemove,x.dispatchEvent(e)}),window.DeviceOrientationEvent){var W=0,N=0;window.addEventListener("deviceorientation",function(e){e.remove=x.eventRemove;var t=360-e.alpha;Math.abs(t-W)>135&&Math.abs(t-W)<225&&(N=0==N?180:0),W=t,e.rotation={x:e.beta,y:e.gamma,z:(t+N)%360},x.dispatchEvent(e)})}this.remakeCanvas=function(e,o){"full"!=t&&(zot(e)&&(e=O),zot(o)&&(o=I),zid(c)&&zid(c).parentNode.removeChild(zid(c)),O=e,I=o,V(),H())},this.dispose=function(){return window.removeEventListener("resize",G),k.removeAllChildren(),k.removeAllEventListeners(),zid(c)&&zid(c).parentNode.removeChild(zid(c)),k=null,x=null,!0},this.orange="#f58e25",this.green="#acd241",this.pink="#e472c4",this.blue="#50c4b7",this.brown="#d1a170",this.yellow="#ebcb35",this.purple="#993399",this.red="#fb4758",this.silver="#999999",this.tin="#777777",this.grey="#555555",this.gray="#555555",this.lighter="#eeeeee",this.light="#cccccc",this.dark="#333333",this.darker="#111111",this.black="#000000",this.white="#FFFFFF",this.clear="rgba(0,0,0,0)",this.faint="rgba(0,0,0,.01)",this.makeCircles=function(t,o){zot(t)&&(t=100);var n=[x.orange,x.green,x.pink,x.blue,x.brown,x.dark];if(o){(r=new e.Container).radius=t;for(var i=0;i100&&setTimeout(function(){G(),Z()},h)):(x.dispatchEvent("ready"),D=!0,Z())}}function V(){var o=x.canvas=document.createElement("canvas");o.setAttribute("id",c),o.setAttribute("tabindex",0),"full"==t||"tag"==t?(o.setAttribute("width",e.windowWidth()),o.setAttribute("height",e.windowHeight())):(o.setAttribute("width",O),o.setAttribute("height",I)),"tag"==t||"inline"==t?A.appendChild(o):document.body.appendChild(o),zot(i)||(o.style.backgroundColor=i),"full"!=t&&"fit"!=t&&"outside"!=t||(o.style.position="absolute",v||(document.body.style.overflow="hidden"))}function H(){G(),-1==E.indexOf(t)||v||(x.zil=zil()),k=p?new e.StageGL(c,m):new e.Stage(c),!zot(i)&&p&&k.setClearColor(e.convertColor(i)),k.setBounds(0,0,O,I),k.width=O,k.height=I,r&&k.enableMouseOver(10),a&&createjs.Touch.enable(k,!1,v),v&&(k.preventSelection=!1),g&&(k.nextStage=g.stage),z&&(k.nextStage=z)}function G(){var o,n,i=zid(c),r=e.windowWidth(),a=e.windowHeight();if((M=x.orientation=r>a?"horizontal":"vertical")!=j&&(j=M,x.dispatchEvent("orientation")),C&&s&&setTimeout(function(){window.scrollTo(0,0)},100),i){if("fit"==t)x.scale=r/a>=O/I?a/I:r/O;else if("outside"==t)x.scale=r/a>=O/I?r/O:a/I;else{if("full"==t)return i.style.left=i.style.top="0px",i.width=O=r,i.height=I=a,k&&(k.setBounds(0,0,O,I),k.width=O,k.height=I,p&&k.updateViewport(O,I)),void U();if("tag"==t)return O=""==A.style.width?A.getAttribute("width")||A.offsetWidth:A.style.width,I=""==A.style.height?A.getAttribute("height")||A.offsetHeight:A.style.height,k&&(k.setBounds(0,0,O,I),k.width=O,k.height=I,p&&k.updateViewport(O,I)),A.style.overflow="hidden",i.width=O,i.height=I,i.style.left=i.style.top="0px",void U();if("inline"==t)return k&&(k.setBounds(0,0,O,I),k.width=O,k.height=I,p&&k.updateViewport(O,I)),i.style.left=i.style.top="0px",void U()}n=I*x.scale,o=O*x.scale,i.style.width=o+"px",i.style.height=n+"px",x.x="left"==l?0:"right"==l?r-o:(r-o)/2,x.y="top"==d?0:"bottom"==d?a-n:(a-n)/2,i.style.left=x.x+"px",i.style.top=x.y+"px",U()}}function U(){if("outside"==t){var e=(zum(frame.canvas.style.width)-windowWidth())/2;"left"==l?(x.visibleLeft=0,x.visibleRight=windowWidth()/(windowWidth()+2*e)*O):"right"==l?(x.visibleLeft=2*e/(windowWidth()+2*e)*O,x.visibleRight=O):(x.visibleLeft=e/(windowWidth()+2*e)*O,x.visibleRight=(windowWidth()+e)/(windowWidth()+2*e)*O);var o=(zum(frame.canvas.style.height)-windowHeight())/2;"top"==d?(x.visibleTop=0,x.visibleBottom=windowHeight()/(windowHeight()+2*o)*I):"bottom"==d?(x.visibleTop=2*o/(windowHeight()+2*o)*I,x.visibleBottom=I):(x.visibleTop=o/(windowHeight()+2*o)*I,x.visibleBottom=(windowHeight()+o)/(windowHeight()+2*o)*I)}else x.visibleLeft=x.visibleTop=0,x.visibleRight=O,x.visibleBottom=I}function Z(){D&&(x.dispatchEvent("resize"),e.OPTIMIZE||!zns&&OPTIMIZE||!k||"full"!=t&&"tag"!=t||k.update())}},e.extend(e.Frame,createjs.EventDispatcher,null,"cjsEventDispatcher",!1),e.Queue=function(){this.cjsEventDispatcher_constructor(),this.isLoading=!0},e.extend(e.Queue,createjs.EventDispatcher,null,"cjsEventDispatcher"),DISTILL=!1,e.distillery=[],e.distill=function(){!window.zns&&e&&(e.DISTILL||window.DISTILL)&&e.distillery.push("83.3","83.35"),zog("zim.distill() - go to http://zimjs.com/distill and enter the following:"),zog(e.distillery.length>0?e.distillery.join(" "):"must set zim.DISTILL = true;")},e.parseAudioSprite=function(e,t){if(z_d("83.25"),!(zot(e)||zot(e.resources)||zot(e.spritemap))){var o,n=e.resources[0],r=e.spritemap,a=[],s={src:n,data:{}};for(i in r)o=r[i],a.push({id:i,startTime:Math.round(1e3*o.start),duration:Math.round(1e3*(o.end-o.start))});return s.data.audioSprite=a,t&&zog(JSON.stringify(s)),s}},e.previewAudioSprite=function(t,o,n){if(z_d("83.26"),!zot(t)){if(zot(o)&&(o=3),zot(n)){if(zot(zimDefaultFrame))return;n=zimDefaultFrame,stage=n.stage}var i=t,r=[],a=[];if(i.constructor=={}.constructor){i.resources&&(i=e.parseAudioSprite(i)),i.audioSprite?loop(i.audioSprite,function(e){r.push(e[0].substr(0,o)),a.push(e[0])}):i.data&&i.data.audioSprite&&loop(i.data.audioSprite,function(e){r.push(e.id.substr(0,o)),a.push(e.id)});var s=new Tabs({tabs:r,width:stageW,currentEnabled:!0}).addTo(stage);return s.on("change",function(){n.asset(a[s.selectedIndex]).play()}),s}}},e}(zim||{}))||{});window.zns||zimplify();