Wasu4

Q: How to remove webkit point in the optimized.Js

Hi i created a sketchpad using iAD Producer. it works well in iBooks Author. but theres a software called Kotobee author which will help you to create books for android as well. i put the widget inside kotobee but it is not working. so i asked they said because of apple are using something called webkit point you have to remove it and replace with another code. i dont have a good knowledge in Javascripting. Is there anyone who can help me out to solve this issue here i am copying the Optimized Java sciprt. "uncaught reference error"

 

 

 

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

var iAd={};iAd.VERSION="1.8";

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Utils={};iAd.Utils.copyPropertiesFromSourceToTarget=function(b,c){for(var a in b){c[a]=b[a]}};iAd.Utils.objectIsFunction=function(a){return(typeof a=="function")};iAd.Utils.objectIsString=function(a){return(typeof a=="string"||a instanceof String)};iAd.Utils.objectIsArray=function(a){return(a instanceof Array)};iAd.Utils.objectIsPrimitive=function(a){return(a==null||typeof a=="number"||typeof a=="boolean"||this.objectIsString(a))};iAd.Utils.objectIsBoolean=function(a){re turn(typeof a==="boolean")};iAd.Utils.objectIsNumber=function(a){return(typeof a=="number")};iAd.Utils.objectIsInteger=function(a){return iAd.Utils.objectIsNumber(a)&&isFinite(a)&&a%1==0};iAd.Utils.objectIsFiniteNumbe r=function(a){return iAd.Utils.objectIsNumber(a)&&isFinite(a)&&!isNaN(a)};iAd.Utils.objectIsDefined= function(a){return a!==undefined};iAd.Utils.objectIsDefinedAndNotNull=function(a){return a!=null};iAd.Utils.objectHasMethod=function(b,a){return(b!=null&&b[a]!==undefin ed&&this.objectIsFunction(b[a]))};iAd.Utils.objectIsInstanceOfClass=function(a,b ){return(b!=null)&&(a instanceof b)};iAd.Utils.classInheritsFrom=function(c,a){var b=iAd.Utils.objectIsFunction(c)&&iAd.Utils.objectIsFunction(a);if(!b){throw"Arg uments must be constructors"}while(!!c){if(c===a){return true}else{if(iAd.Utils.objectIsFunction(c.superclass)){c=c.superclass}else{c=nu ll}}}return false};iAd.Utils.resolveObjectPathFrom=function(d,h,f){if(!h||h[0]=="."){return undefined}var c=h.split(".");var a,b;for(var e=0,g=c.length;d!=null&&e<g;e++){b=c[e];a=d[b];if(f&&a==null){a=d[b]={}}d=a}ret urn d};iAd.Utils.resolveObjectPath=function(b,a){return iAd.Utils.resolveObjectPathFrom(window,b,a)};iAd.Utils.setupDisplayNames=functi on(b,a){a=a||b.displayName||b.name;b.displayName=b.displayName||a;var c;for(c in b){if(b.__lookupGetter__(c)){continue}var e=b[c];if(iAd.Utils.objectIsFunction(e)){e.displayName=iAd.Utils.createDisplayN ame(a,c)}}for(c in b.prototype){if(b.prototype.__lookupGetter__(c)){continue}var d=Object.getOwnPropertyDescriptor(b.prototype,c);if(d&&iAd.Utils.objectIsFuncti on(d.value)){b.prototype[c].displayName=iAd.Utils.createDisplayName(a,c,true)}}b .callOriginal=function(){var f=b.callOriginal.caller;if(f._originalMethod){return f._originalMethod.apply(this,arguments)}}};iAd.Utils.createDisplayName=function (c,a,b){return c+(b?".":"#")+a+"()"};iAd.Utils.setupDisplayNames(iAd.Utils,"iAd.Utils");

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

var iAP={};iAP.supportsNewCSSBrightnessFilter=(function(){var a=navigator.userAgent.match(/WebKit\/([0-9]+)/);if(!a){return true}return a[1]>=537})();iAP.Context={};(function(){var a=window.navigator.platform;iAP.Context.IS_IOS_SIMULATOR=navigator.platform=="i Phone Simulator"||navigator.platform=="iPad Simulator";iAP.Context.IS_IOS=iAP.Context.IS_IOS_SIMULATOR||["iPhone","iPod","i Pod touch","iPad"].indexOf(a)!=-1;iAP.Context.IS_OSX=a.indexOf("Mac")!=-1;iAP.Conte xt.IS_WINDOWS=a.indexOf("Win")!=-1;iAP.Context.IS_DESKTOP=iAP.Context.IS_OSX||iA P.Context.IS_WINDOWS;iAP.Context.IS_IAD=!!window.ad;iAP.Context.IS_IAD_PRODUCER= !!window.editorProxy;iAP.Context.IS_QUICK_PREVIEW=!!window.iAPDebug&&!!window.iA PDebug.requestToClosePreview;iAP.Context.IS_ITUNES=!!window.iTunes;iAP.Context.I S_IBOOKS=!!window.widget;iAP.Context.IS_SAFARI=!iAP.Context.IS_IAD_PRODUCER&&!iA P.Context.IS_IAD&&!iAP.Context.IS_ITUNES&&!iAP.Context.IS_IBOOKS;var b=Object.keys(iAP.Context);window.addEventListener("DOMContentLoaded",function( ){b.forEach(function(c){if(iAP.Context[c]){document.body.addClassName("iap-conte xt-"+c)}})},true)})();iAP.Context.projectIsOfType=function(a){return document.body.hasClassName("iap-"+a)};iAP.Context.projectSupportsDevice=functio n(a){return document.body.hasClassName("iap-supported-device-"+a)};iAd.Utils.replaceMethod= function(b,a,d){try{if(b.hasOwnProperty("processed")){iAd.Class.processMethod(b, a);b=b.prototype}d._originalMethod=b[a];b[a]=d}catch(c){console.error("Could not replace method",a,"on",b)}};iAd.Utils.isRunningInAdContext=window.hasOwnProperty("ad"); iAd.Utils.unique=(function(){var a={};function b(d){var c=a[d];if(!c){c=a[d]={count:0}}return c}return function(d,e){var f,c;f=e||"IAD_UTILS_SHARED_UNIQUE";c=b(f);c.count+=1;if(!d){return c.count}if(typeof d==="function"){return d(c.count)}return d+c.count}}());(function(){var a=window.webkitConvertPointFromPageToNode;window.webkitConvertPointFromPageToNo de=function(d,f){var e=a.apply(window,arguments);if(iAd.Utils.pageZoomElement()==d||iAd.Utils.pageZo omElement().contains(d)){var c=iAd.Utils.pageZoom();if(c!=1){e.x/=c;e.y/=c}}return e};var b=window.webkitConvertPointFromNodeToPage;window.webkitConvertPointFromNodeToPa ge=function(d,e){if(iAd.Utils.pageZoomElement()==d||iAd.Utils.pageZoomElement(). contains(d)){var c=iAd.Utils.pageZoom();if(c!=1){e.x*=c;e.y*=c}}return b.call(window,d,e)}})();iAd.Utils.pageZoomElement=function(){return document.body};iAd.Utils.pageZoom=function(){return parseFloat((window._getComputedStyle||window.getComputedStyle)(iAd.Utils.pageZo omElement()).zoom)||1};iAd.Utils.didHandleUnsupportedAction=function(a,b){if(win dow.iAPDebug!=null&&window.iAPDebug.willHandleUnsupportedContent){window.iAPDebu g.willHandleUnsupportedContent(a,b);return true}else{if(iAP.Context.IS_SAFARI||(iAP.Context.IS_IOS_SIMULATOR&&b=="Device") ||(!iAP.Context.IS_ITUNES&&b=="iTunes")){alert(a);return true}}return false};iAd.Utils.openAdUnit=function(){if(window.iTunes&&iTunes.openAdWindow){i Tunes.openAdWindow({id:"AdUnit",url:"../../../AdUnit/index.html"})}else{iAd.Cons ole.warn("iAd.Utils: openAdWindow is only supported for desktop iTunes iAd")}};iAd.Utils.close=function(){if(window.iTunes&&iTunes.window&&iTunes.wind ow.close){iTunes.window.close()}else{iAd.Console.warn("iAd.Utils: closeAd is only supported for desktop iTunes iAd")}};iAd.Utils.ITMS_URL_REGEX=/^https?(:\/\/(phobos|itunes)\.apple\.com\/)/i ;iAd.Utils.ITMS_APP_URL_REGEX=/^https?(:\/\/(phobos|itunes)\.apple\.com\/([a-z]+ \/)?app\/)/i;iAd.Utils.ITMS_BOOK_URL_REGEX=/^https?(:\/\/(phobos|itunes)\.apple\ .com\/([a-z]+\/)?book\/)/i;iAd.Utils.ITMS_RADIO_URL_REGEX=/^https?(:\/\/(phobos| itunes)\.apple\.com\/.*\/(station\/|viewRadioStation))/i;iAd.Utils.openURL=funct ion(d){if(window.iTunes&&iTunes.openURLInBrowser){iTunes.openURLInBrowser(d);ret urn}var f=document.createElement("a");if(iAP.Context.IS_SAFARI){f.target="_blank"}if(iA P.Context.IS_IOS){if(iAP.Context.IS_IAD&&!iAd.Device.iOSVersionLessThan("6.0")){ d=d.replace(iAd.Utils.ITMS_APP_URL_REGEX,"itms-apps$1");d=d.replace(iAd.Utils.IT MS_RADIO_URL_REGEX,"itunesradio$1");d=d.replace(iAd.Utils.ITMS_URL_REGEX,"itms$1 ")}}else{if(!d.match(iAd.Utils.ITMS_APP_URL_REGEX)&&!d.match(iAd.Utils.ITMS_BOOK _URL_REGEX)){if(d.match(iAd.Utils.ITMS_RADIO_URL_REGEX)&&!d.match("cmd=AddStatio n")){var c=d.indexOf("?")===-1?"?":"&";d+=c+"cmd=AddStation";d=d.replace(iAd.Utils.ITMS_ RADIO_URL_REGEX,"itunesradio$1")}d=d.replace(iAd.Utils.ITMS_URL_REGEX,"itms$1")} }f.href=d;var e=document.createEvent("Event");e.initEvent("click",true,false);f.dispatchEvent (e);if(iAP.Context.IS_SAFARI&&!iAP.Context.IS_QUICK_PREVIEW){var b;var a=function(){window.removeEventListener("blur",a);clearTimeout(b)};window.addEv entListener("blur",a);var g=function(){window.removeEventListener("blur",a);window.location=d};b=setTimeo ut(g,1000)}iAd.RootViewController.sharedRootViewController.beginIgnoringInteract ionEvents();setTimeout(function(){iAd.RootViewController.sharedRootViewControlle r.endIgnoringInteractionEvents()},0)};iAd.Utils.urlHasValidProtocol=function(a){ return a&&a.match(/^[a-z0-9-]+:/i)};iAd.Utils.archiveOriginalValue=function(b,a){if(!b ._originalValues){b._originalValues={}}if(b._originalValues[a]!==undefined){retu rn}b._originalValues[a]=b[a]};iAd.Utils.restoreOriginalValue=function(b,a){if(!b ._originalValues||b._originalValues[a]===undefined){b[a]=b[a];return}b[a]=b._ori ginalValues[a]};iAd.Utils.getOriginalValue=function(b,a){if(!b._originalValues|| b._originalValues[a]===undefined){return b[a]}return b._originalValues[a]};iAd.Utils.updateOriginalValue=function(b,a){if(!b._origin alValues||b._originalValues[a]===undefined){return}b._originalValues[a]=b[a]};iA d.Utils.humanRandomIndex=function(b){if(!b.length){return -1}b.humanRandomIndexPreviousIndices=b.humanRandomIndexPreviousIndices||[];b.hu manRandomIndexI=b.humanRandomIndexI||0;var a;do{a=Math.floor(Math.random()*b.length)}while(b.length>1&&b.humanRandomIndexP reviousIndices.indexOf(a)!=-1);b.humanRandomIndexPreviousIndices[b.humanRandomIn dexI]=a;b.humanRandomIndexI=(b.humanRandomIndexI+1)%Math.ceil(b.length/5);return a};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class=function(b){if(typeof b==="string"){b={name:b}}b=b||{};b.symbol=b.symbol===undefined?b.name:b.symbol; b.name=b.name||"AnonymousClass";if(!b.superclass){if("superclass" in b){throw new ReferenceError("An undefined superclass was provided for "+b.name)}else{if(iAd.Object){b.superclass=iAd.Object}}}var e=function(){if(!e.processed){iAd.Class.processAllClasses()}e.prototype.init.ap ply(this,arguments)};e.processed=false;iAd.Class.unprocessedClasses.push(e);e.di splayName=e._name=b.name;iAd.Utils.copyPropertiesFromSourceToTarget(b,e);if(b.sy mbol&&typeof b.symbol==="string"){var d=b.symbol.split("."),c=d.pop(),a=d.length?iAd.Utils.resolveObjectPath(d.join(" ."),true):window;if(a){a[c]=e}}return e};iAd.Class.unprocessedClasses=[];iAd.Class.processAllClasses=function(){var c;for(var a=0,b=iAd.Class.unprocessedClasses.length;a<b;a++){c=iAd.Class.unprocessedClass es[a];if(!c.processed){iAd.Class.processClassAndHierarchy(c)}}iAd.Class.unproces sedClasses=[]};iAd.Class.processClassAndHierarchy=function(f){var e=[f];var b=f;while(b=b.superclass){e.push(b)}var a;for(var c=e.length-1;c>=0;c--){a=e[c];if(!a.processed){iAd.Class.processClass(a)}}var d;for(var c=e.length-1;c>=0;c--){d=e[c];if(iAd.Utils.objectHasMethod(d,"initialize")){d.i nitialize.apply(f)}}};iAd.Class.processClass=function(e){if(e.mixins){iAd.Class. mixin(e.prototype,e.mixins)}var b=e.synthesizedProperties||[];for(var a=0,c=b.length;a<c;a++){iAd.Class.synthesizeProperty(e.prototype,b[a])}for(var d in e.prototype){iAd.Class.processMethod(e,d)}for(d in e){if(e.hasOwnProperty(d)){iAd.Class.processClassMethod(e,d)}}if(e!==iAd.Object ){e.prototype.__proto__=e.superclass.prototype}e.processed=true};iAd.Class.synth esizeProperty=function(c,b){var h=b.charAt(0).toUpperCase()+b.substr(1);var e="get"+h;var a="set"+h;var d="_"+b;if(!iAd.Utils.objectHasMethod(c,a)){c[a]=function(i){this[d]=i}}var g=function(i){this[a](i);this.notifyPropertyChange(b)};g.displayName="Setter for ."+b+" on "+c.constructor.displayName;if(!iAd.Utils.objectHasMethod(c,e)){c[e]=function() {return this[d]}}var f=function(){return this[e]()};f.displayName="Getter for ."+b+" on "+c.constructor.displayName;Object.defineProperty(c,b,{get:f,set:g})};iAd.Class .processMethod=function(c,a){var b=Object.getOwnPropertyDescriptor(c.prototype,a).value;if(iAd.Utils.objectIsFun ction(b)){b._class=c;b._name=a;if(b.displayName==null){b.displayName=iAd.Utils.c reateDisplayName(c.displayName,a)}}};iAd.Class.processClassMethod=function(c,a){ var b=Object.getOwnPropertyDescriptor(c,a).value;if(iAd.Utils.objectIsFunction(b)&& b.displayName==null){b.displayName=iAd.Utils.createDisplayName(c.displayName,a,t rue)}};iAd.Class.mixin=function(e,a){var b;for(var c=0,d=a.length;c<d;c++){b=a[c];for(var f in b){if(!e.hasOwnProperty(f)){e[f]=b[f]}}}};iAd.Class.synthesizeProperties=functi on(d,a){iAd.Class.processClassAndHierarchy(d);for(var b=0,c=a.length;b<c;b++){iAd.Class.synthesizeProperty(d.prototype,a[b])}};iAd.Cl ass.processMethods=function(d,c){iAd.Class.processClassAndHierarchy(d);for(var a=0,b=c.length;a<b;a++){iAd.Class.processMethod(d,c[a])}};iAd.Utils.setupDispla yNames(iAd.Class,"iAd.Class");

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.Object",archivedProperties:["delegate","dataSource"]});iAd. Object.PROPERTY_CHANGED="handlePropertyChange";iAd.Object.prototype.init=functio n(){this.observedProperties={}};iAd.Object.DELEGATE_REG_EXP=/delegate/i;iAd.Obje ct.DATA_SOURCE_REG_EXP=/dataSource/i;iAd.Object.prototype.archiveProperty=functi on(b){var a=this[b];if(iAd.Object.DELEGATE_REG_EXP.test(b)||iAd.Object.DATA_SOURCE_REG_EX P.test(b)){if(iAd.Utils.objectIsInstanceOfClass(a,iAd.ViewController)){return a.id}return a?iAd.Archiver.referenceForObject(a):null}return a};iAd.Object.prototype.restoreProperty=function(b,a){if(iAd.Object.DELEGATE_RE G_EXP.test(b)||iAd.Object.DATA_SOURCE_REG_EXP.test(b)){if(iAd.ViewController&&iA d.ViewController.instances[a]){a=iAd.ViewController.instances[a]}else{a=iAd.Arch iver.objectForReference(a)}}this[b]=a};iAd.Object.prototype.callSuper=function() {var a=iAd.Object.prototype.callSuper.caller;if(iAd.Utils.objectHasMethod(a,"supercl ass")){a.superclass.apply(this,arguments)}else{var c=a._class.superclass.prototype;var b=a._name;if(iAd.Utils.objectHasMethod(c,b)){return c[b].apply(this,arguments)}}};iAd.Object.prototype.isPropertyObserved=function( a){return(this.observedProperties[a]!==undefined)};iAd.Object.prototype.addPrope rtyObserver=function(c,b,a){var d=this.observedProperties[c];if(!this.isPropertyObserved(c)){d=this.observedPro perties[c]={targets:[],methodNames:[]}}else{if(d.targets.indexOf(b)>-1){return}} var a=a||iAd.Object.PROPERTY_CHANGED;if(iAd.Utils.objectHasMethod(b,a)){d.targets.p ush(b);d.methodNames.push(a)}};iAd.Object.prototype.removePropertyObserver=funct ion(c,b){if(!this.isPropertyObserved(c)){return false}var e=this.observedProperties[c];var d=e.targets.indexOf(b);var a=d>-1;if(a){e.targets.splice(d,1);e.methodNames.splice(d,1);if(e.targets.lengt h==0){delete this.observedProperties[c]}}return a};iAd.Object.prototype.notifyPropertyChange=function(b){if(!this.isPropertyObs erved(b)){return}var f=this.observedProperties[b];var a=f.targets.slice();var e=f.methodNames.slice();for(var c=0,d=a.length;c<d;c++){a[c][e[c]](this,b)}};iAd.Object.prototype.callMethodNam eAfterDelay=function(a,d){var e=this;var c=Array.prototype.slice.call(arguments,2);var b=function(){e[a].apply(e,c)};b.displayName=iAd.Utils.createDisplayName(this.co nstructor.displayName||this.constructor.name,a);return setTimeout(b,d*1000)};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Event={};iAd.Event.notificationEvents={};iAd.Event.registerForNotificationEv ent=function(a){iAd.Event.notificationEvents[a]=true};iAd.Event.SUPPORTS_TOUCHES =("createTouch" in document);iAd.Event.START_EVENT=iAd.Event.SUPPORTS_TOUCHES?"touchstart":"moused own";iAd.Event.MOVE_EVENT=iAd.Event.SUPPORTS_TOUCHES?"touchmove":"mousemove";iAd .Event.END_EVENT=iAd.Event.SUPPORTS_TOUCHES?"touchend":"mouseup";iAd.Event.CANCE L_EVENT="touchcancel";iAd.Event.createUIEvent=function(a,b){return iAd.Event.SUPPORTS_TOUCHES?this.createEventWithTouch(a,b):this.createEventWithM ouse(a,b)};iAd.Event.createEventWithTouch=function(b,a){var c=document.createEvent("TouchEvent");c.initTouchEvent(b,a.bubbles,a.cancelable, window,a.detail,a.screenX,a.screenY,a.clientX,a.clientY,a.ctrlKey,a.altKey,a.shi ftKey,a.metaKey,a.touches,a.targetTouches,a.changedTouches,a.scale,a.rotation);r eturn c};iAd.Event.createEventWithMouse=function(a,c){var b=document.createEvent("MouseEvent");b.initMouseEvent(a,c.bubbles,c.cancelable, document.defaultView,c.detail,c.screenX,c.screenY,c.clientX,c.clientY,c.ctrlKey, c.altKey,c.shiftKey,c.metaKey,c.metaKey,c.button,c.relatedTarget);return b};iAd.Event.preventDefault=function(a){a.preventDefault()};iAd.Event.eventHand lerForString=function(a){var b=new Function(a);return function(c){b.call(null,c)}};iAd.Event.KEYBOARD_BACKSPACE=8;iAd.Event.KEYBOARD_ LEFT=37;iAd.Event.KEYBOARD_RIGHT=39;iAd.Event.KEYBOARD_UP=38;iAd.Event.KEYBOARD_ DOWN=40;iAd.Event.KEYBOARD_RETURN=13;iAd.Utils.setupDisplayNames(iAd.Event,"iAd. Event");

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.EventTarget={};iAd.EventTarget.addEventListener=function(b,c,a){if(!this.eve ntTarget){iAd.Console.warn("iAd.EventTarget.addEventListener: cannot add event listener since no eventTarget was specified by the mixing object.");return}iAd.Event.registerForNotificationEvent(b);this.eventTarget.add EventListener(b,c,a)};iAd.EventTarget.removeEventListener=function(b,c,a){if(!th is.eventTarget){iAd.Console.warn("iAd.EventTarget.removeEventListener: cannot remove event listener since no eventTarget was specified by the mixing object.");return}this.eventTarget.removeEventListener(b,c,a)};iAd.EventTarget.d ispatchEvent=function(b){if(!this.eventTarget){iAd.Console.warn("iAd.EventTarget .dispatchEvent: cannot dispatch event since no eventTarget was specified by the mixing object.");return}this.eventTarget.dispatchEvent(b);var a=b.ad||{};this._createAndDispatchEventAnalyticsObject(b.type,this,a)};iAd.Even tTarget.dispatchNotification=function(b,a,c){this.notifyDelegate(b,a,c);this.cre ateAndDispatchEvent(b,c)};iAd.EventTarget.notifyDelegate=function(c,b,d){if(iAd. Utils.objectHasMethod(b,c)){var a=[this];if(d){a=a.concat(d.map(function(e){return e[1]}))}b[c].apply(b,a)}};iAd.EventTarget.createEvent=function(a,c){var b=document.createEvent("Event");b.initEvent(a,true,false);if(!b.ad){b.ad={}}b.a d.sender=this;if(c){this._addParamtersToEventObject(c,b.ad)}return b};iAd.EventTarget.createAndDispatchEvent=function(b,c){if(!iAd.Event.notificat ionEvents[b]){var a=this._addParamtersToEventObject(c,{});this._createAndDispatchEventAnalyticsOb ject(b,this,a);return}this.dispatchEvent(this.createEvent(b,c))};iAd.EventTarget ._addParamtersToEventObject=function(b,a){var d=a||{};if(b){for(var c=0,e=b.length;c<e;c++){d[b[c][0]]=b[c][1]}}return d};iAd.EventTarget._createAndDispatchEventAnalyticsObject=function(c,b,a){if(!i Ad.Analytics){return}var d={type:c,sender:b,eventParameters:a};iAd.Analytics._routeEventToHandler(d)};iA d.Utils.setupDisplayNames(iAd.EventTarget,"iAd.EventTarget");

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.String={};iAd.String.dashedStringToCamelCase=function(a){var b=a.split("-");return b.shift()+b.map(iAd.String.capitalizeString).join("")};iAd.String.capitalizeStr ing=function(a){return a.charAt(0).toUpperCase()+a.substr(1)};iAd.String.camelCaseStringToDashed=funct ion(a){return a.replace(/([A-Z])/g,function(b){return"-"+b.toLowerCase()})};iAd.String.REPLAC EMENT_SENTINEL="%@";iAd.String.REPLACEMENT_SENTINEL_LENGTH=iAd.String.REPLACEMEN T_SENTINEL.length;iAd.String.format=function(){var g=arguments.length;if(!g){return""}var c=arguments[0];var a="";var f=0;var e=0;var d;for(d=1;d<g&&(e=c.indexOf(iAd.String.REPLACEMENT_SENTINEL,f))>=0;++d){a+=c.sl ice(f,e);a+=arguments[d];f=e+iAd.String.REPLACEMENT_SENTINEL_LENGTH}var b=c.slice(f);a+=b;if(d<g){iAd.Console.warn("String.format - More arguments than specifiers")}if(b.indexOf(iAd.String.REPLACEMENT_SENTINEL)!==-1){iAd.Console.wa rn("String.format - More specifiers than arguments")}return a};iAd.Utils.setupDisplayNames(iAd.String,"iAd.String");

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Content={};iAd.Content._optionsForParameter={};iAd.Content._valueForParamete r={};iAd.Content._content={};iAd.Content.eventTarget=document;iAd.Content.CONTEN T_DID_CHANGE="contentDidChange";iAd.Content.defineParameter=function(b,a){if(thi s._optionsForParameter[b]){iAd.Content.clearValueForParameter(b)}this._optionsFo rParameter[b]=a};iAd.Content.valueForParameter=function(a){return this._valueForParameter[a]};iAd.Content.setValueForParameter=function(a,b){this ._validateParameterAndOption(b,a);if(this._valueForParameter[b]===a){return}this ._valueForParameter[b]=a;this.createAndDispatchEvent(iAd.Content.CONTENT_DID_CHA NGE)};iAd.Content.clearValueForParameter=function(a){if(!this._valueForParameter .hasOwnProperty(a)){return}delete this._valueForParameter[a];this.createAndDispatchEvent(iAd.Content.CONTENT_DID_ CHANGE)};iAd.Content.defineContent=function(l,f){for(var h in l){if(!l.hasOwnProperty(h)){continue}var c=l[h];this._validateParameterAndOption(h,c)}for(var k in f){var j=f[k];var g=false;var a=this._content[k];if(a){for(var b=0,d=a.length;b<d;b++){var e=a[b];if(this._parametersMatch(e.parameters,l)){e.value=j;g=true;break}}}else{ a=this._content[k]=[]}if(g){continue}var m={};iAd.Utils.copyPropertiesFromSourceToTarget(l,m);a.push({parameters:m,value :j})}this.createAndDispatchEvent(iAd.Content.CONTENT_DID_CHANGE)};iAd.Content.co ntentForKey=function(c){var a=this._content[c];if(!a){iAd.Console.warn(iAd.String.format('%@: Key "%@" not defined.',this.displayName,c));return c}var b=this._bestMatchingVersionForParameters(a,this._valueForParameter);if(!b){iAd. Console.warn(iAd.String.format('%@: Key "%@" not defined in the current context.',this.displayName,c));return c}return b.value};iAd.Content._validateParameterAndOption=function(c,b){if(!this._option sForParameter.hasOwnProperty(c)){throw iAd.String.format('%@: Parameter "%@" is not defined.',this.displayName,c)}var a=this._optionsForParameter[c];if(a.indexOf(b)==-1){iAd.Console.warn(iAd.String .format('%@: Value "%@" is not a valid for parameter "%@".',this.displayName,b,c))}};iAd.Content._bestMatchingVersionForParameters=f unction(a,f){var d=[];for(var c=0,e=a.length;c<e;c++){var b=a[c];if(this._allParametersInAMatchParametersInB(b.parameters,f)){d.push(b)}} d.sort(function(h,g){var i=Object.keys(h.parameters).length;var j=Object.keys(g.parameters).length;if(i>j){return 1}if(i<j){return -1}return 0});return d[d.length-1]};iAd.Content._parametersMatch=function(b,a){if(Object.keys(b).len gth!==Object.keys(a).length){return false}return this._allParametersInAMatchParametersInB(b,a)};iAd.Content._allParametersInAMat chParametersInB=function(c,b){for(var a in c){if(!c.hasOwnProperty(a)){continue}if(!b.hasOwnProperty(a)||b[a]!==c[a]){retu rn false}}return true};iAd.Utils.setupDisplayNames(iAd.Content,"iAd.Content");iAd.Class.mixin(iA d.Content,[iAd.EventTarget]);

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Console={};iAd.Console.log=function(){if(window.console&&console.log){consol e.log.apply(console,arguments)}};iAd.Console._fallbackLog=function(b,a){a.unshif t(b.toUpperCase()+":");iAd.Console.log.apply(iAd.Console,a)};iAd.Console._log=fu nction(b,a){if(window.console&&console[b]){console[b].apply(console,a);return}iA d.Console._fallbackLog(b,Array.prototype.slice.call(a))};iAd.Console.warn=functi on(){iAd.Console._log("warn",arguments)};iAd.Console.error=function(){iAd.Consol e._log("error",arguments)};iAd.Console.debug=function(){iAd.Console._log("debug" ,arguments)};iAd.Console.assert=function(){if(window.console&&console.assert){co nsole.assert.apply(console,arguments);return}if(!arguments[0]){iAd.Console._fall backLog("assert",[arguments[1]||""])}};iAd.Console.info=function(){iAd.Console._ log("info",arguments)};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.CSS={};iAd.CSS.t=function(b,a){return iAd.CSS.t3d(b,a,0)};iAd.CSS.t3d=function(b,a,c){iAd.CSS.sanitizeNumberArguments (arguments);return"translate3d("+b+"px, "+a+"px, "+c+"px)"};iAd.CSS.r3d=function(a,d,c,b){iAd.CSS.sanitizeNumberArguments(argume nts);return"rotate3d("+a+", "+d+", "+c+", "+b+"rad)"};iAd.CSS.roundedPxValue=function(b){var a=window.devicePixelRatio;return((b*a)|0)/a};iAd.CSS.tm=function(b,a){iAd.CSS.s anitizeNumberArguments(arguments);return"matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, "+b+", "+a+", 0, 1)"};iAd.CSS.matrixFromString=function(a){var b="";if(a.length>0&&a!="none"){b=a.replace(/([^(]*)\(([^)]*)\)/g,function(d,f,e ){var c=e.replace(/(\-?[0-9.]+(?:e\-?[0-9]+)?)([^,]*)/g,function(h,i,g){i=parseFloat( i);return i.toFixed(6)+g});return f+"("+c+")"})}return new WebKitCSSMatrix(b)};iAd.CSS.concatenateTransforms=function(){var d=[];for(var b=0,c=arguments.length;b<c;b++){var a=arguments[b];if(a&&a!="none"){d.push(a)}}return d.join(" ")};iAd.CSS.isClassNameValid=function(a){return a!=null&&a!=""&&a===String(a).replace(/\s/g,"")};iAd.CSS.matrixEqualsToMatrix=f unction(c,a){for(var e=1;e<=4;e++){for(var b=1;b<=4;b++){var d="m"+e+b;if(c[d]!==a[d]){return false}}}return true};iAd.CSS.widthForTextAndFont=function(b,a){if(!this.textMeasuringCanvasCon text){this.textMeasuringCanvasContext=document.createElement("canvas").getContex t("2d")}if(a){this.textMeasuringCanvasContext.font=a}return this.textMeasuringCanvasContext.measureText(b).width};iAd.CSS.isStyleSheetLoade d=function(a){return(iAd.CSS.elementForStyleSheet(a)!=null)};iAd.CSS.elementForS tyleSheet=function(a){var c,e=document.styleSheets;for(var b=0,d=e.length;b<d;b++){c=e[b];if(c.href==a){return c}}return null};iAd.CSS.flushPendingUpdates=function(){var a=document.body.offsetWidth};iAd.CSS.sanitizeNumberArguments=function(a){for(va r b=0,c=a.length;b<c;b++){if(typeof a[b]=="number"){a[b]=a[b].toFixed(20)}}};iAd.Utils.setupDisplayNames(iAd.CSS,"i Ad.CSS");

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.CSS.widthForTextAndFont=function(d,c){if(!this.textMeasuringCanvasContext){t his.textMeasuringCanvasContext=document.createElement("canvas").getContext("2d") }var a=this.textMeasuringCanvasContext.font;if(c){this.textMeasuringCanvasContext.fo nt=c}var b=0;d.split("\n").forEach(function(e){b=Math.max(b,this.textMeasuringCanvasCont ext.measureText(e).width)},this);this.textMeasuringCanvasContext.font=a;return b};iAd.CSS.setLayerBackgroundImageIfDifferent=function(b,c){var a=c.resolvedURL;if(iAP.Context.IS_IOS){if(b.style.backgroundImage&&b._iap_cache dBackgroundImage==a){return}b._iap_cachedBackgroundImage=a}b.style.backgroundIma ge="url("+a+")"};(function(){if(iAP.Context.IS_ITUNES){var b=iAd.CSS.concatenateTransforms;var a=/(matrix3d|translate3d|translateZ|rotate3d|rotateZ|scale3d|scaleZ)/i;iAd.CSS. concatenateTransforms=function(){var e=b.apply(this,arguments),d=new WebKitCSSMatrix(e),c="";if(e.match(a)){var f=[d.m11,d.m12,d.m13,d.m14,d.m21,d.m22,d.m23,d.m24,d.m31,d.m32,d.m33,d.m34,d.m4 1,d.m42,d.m43,d.m44];c="matrix3d("+f.join(", ")+")"}else{c=d.toString()}return c}}})();

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Element={};iAd.Element.HTML5_CUSTOM_ATTRIBUTE_PREFIX="data-";iAd.Element.ATT RIBUTE_PREFIX="ad-";iAd.Element.elementFromString=function(d){var a=document.createRange();a.selectNode(document.body);var b=a.createContextualFragment(d);var c=b.firstChild;while(c.nodeType!=Node.ELEMENT_NODE&&c.nextSibling){c=c.nextSibl ing}return c};iAd.Element.hasCustomAttribute=function(b,a){return b.hasAttribute(iAd.Element.HTML5_CUSTOM_ATTRIBUTE_PREFIX+a)||b.hasAttribute(a)} ;iAd.Element.getCustomAttribute=function(c,a){var b=c.getAttribute(iAd.Element.HTML5_CUSTOM_ATTRIBUTE_PREFIX+a);return iAd.Utils.objectIsString(b)?b:c.getAttribute(a)};iAd.Element.SUPPORTS_CLASS_LIS T=("classList" in document.documentElement);Element.prototype.hasClassName=iAd.Element.SUPPORTS_C LASS_LIST?function(a){return iAd.CSS.isClassNameValid(a)&&this.classList.contains(a)}:function(a){return new RegExp("(?:^|\\s+)"+a+"(?:\\s+|$)").test(this.className)};Element.prototype.add ClassName=iAd.Element.SUPPORTS_CLASS_LIST?function(a){if(!iAd.CSS.isClassNameVal id(a)||this.classList.contains(a)){return false}this.classList.add(a);return true}:function(a){if(!this.hasClassName(a)){this.className=[this.className,a].j oin(" ");return true}else{return false}};Element.prototype.removeClassName=iAd.Element.SUPPORTS_CLASS_LIST?funct ion(a){if(iAd.CSS.isClassNameValid(a)&&this.classList.contains(a)){this.classLis t.remove(a);return true}return false}:function(b){if(this.hasClassName(b)){var a=this.className;this.className=a.replace(new RegExp("(?:^|\\s+)"+b+"(?:\\s+|$)","g")," ");return true}return false};Element.prototype.toggleClassName=iAd.Element.SUPPORTS_CLASS_LIST?functi on(a,b){if(iAd.CSS.isClassNameValid(a)){if(b==null){b=!this.classList.contains(a )}this.classList[b?"add":"remove"](a)}}:function(a,b){if(b==null){b=!this.hasCla ssName(a)}this[b?"addClassName":"removeClassName"](a)};iAd.Utils.setupDisplayNam es(iAd.Element,"iAd.Element");

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Element.getCustomAttribute=function(d,a){var c=iAP.PageState.pageStateForCurrentDevice;while(c){var b=(c.parentState?(a+"-for-"+c.name):a);var e=d.getAttribute(b);if(iAd.Utils.objectIsString(e)){return e}c=c.parentState}return null};iAd.Element.getChildMatchingSelector=function(d,a){var c=d.children;for(var b=0,e=c.length;b<e;b++){if(c[b].webkitMatchesSelector(a)){return c[b]}}return null};iAd.Element.getChildrenMatchingSelector=function(d,a){var c=d.children;var f=[];for(var b=0,e=c.length;b<e;b++){if(c[b].webkitMatchesSelector(a)){f.push(c[b])}}return f};iAd.Element.getEditedContentAndNormalize=function(b){var a=b.style.whiteSpace;b.style.whiteSpace="pre";var c=b.innerText;b.style.whiteSpace=a;c=c.replace(/^\s+$/g,"");return c};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Device={};iAd.Device.iOS_VERSION=navigator.userAgent.match(/OS ([0-9_]+)/);iAd.Device.iOS_VERSION=iAd.Device.iOS_VERSION?iAd.Device.iOS_VERSIO N[1].replace(/_/g,"."):null;iAd.Device.IS_IPAD=(navigator.platform.indexOf("iPad ")>-1);iAd.Device.HAS_HIDPI_DISPLAY=(window.devicePixelRatio>=2);iAd.Device.PIXE L_RATIO=window.devicePixelRatio;iAd.Device.iOSVersionLessThan=function(a){if(iAd .Device.iOS_VERSION==null){iAd.Console.warn("iAd.Device.iOS_VERSION is null.");return false}return iAd.Device.compareiOSVersions(iAd.Device.iOS_VERSION,a)==-1};iAd.Device.compare iOSVersions=function(e,d){var h=e.split(".");var g=d.split(".");for(var c=0,f=Math.max(h.length,g.length);c<f;c++){var b=parseInt(h[c]||"0",10),a=parseInt(g[c]||"0",10);if(a>b){return -1}else{if(b>a){return 1}}}return 0};iAd.Device.ORIENTATION_PORTRAIT_CSS="ad-device-portrait";iAd.Device.ORIENTAT ION_LANDSCAPE_CSS="ad-device-landscape";iAd.Device.ORIENTATION_PORTRAIT=0;iAd.De vice.ORIENTATION_PORTRAIT_UPSIDE_DOWN=180;iAd.Device.ORIENTATION_LANDSCAPE_LEFT= 90;iAd.Device.ORIENTATION_LANDSCAPE_RIGHT=-90;iAd.Device.init=function(){if(iAd. Device.iOS_VERSION){window.addEventListener("orientationchange",iAd.Device.inter faceOrientationDidChange,true)}iAd.Device.setInterfaceOrientation(window.orienta tion||iAd.Device.ORIENTATION_PORTRAIT)};iAd.Device.interfaceOrientationDidChange =function(a){iAd.Device.setInterfaceOrientation(window.orientation)};iAd.Device. setInterfaceOrientation=function(c){var d=this.interfaceOrientation;this.interfaceOrientation=c;var b=(Math.abs(c)==90);var a=document.body;var e=a.addClassName(b?iAd.Device.ORIENTATION_LANDSCAPE_CSS:iAd.Device.ORIENTATION_ PORTRAIT_CSS);if(e){a.removeClassName(b?iAd.Device.ORIENTATION_PORTRAIT_CSS:iAd. Device.ORIENTATION_LANDSCAPE_CSS)}if(d!=null&&iAd.ViewController){iAd.ViewContro ller.orientationDidChange(d)}};window.addEventListener("DOMContentLoaded",iAd.De vice.init,true);iAd.Utils.setupDisplayNames(iAd.Device,"iAd.Device");

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

(function(){iAd.Content.defineParameter("device",["iPhone","iPad"]);var b=iAd.Device.IS_IPAD?"iPad":"iPhone";iAd.Content.setValueForParameter(b,"device ");iAd.Content.defineParameter("devicePixelRatio",[1,2,3]);iAd.Content.setValueF orParameter(iAd.Device.PIXEL_RATIO,"devicePixelRatio");iAd.Content.defineParamet er("language",["ar","bn","ca","cs","da","de","el","en","es","fi","fr","hi","hu", "id","it","ja","kn","ko","ml","mr","ms","nb","nl","pl","pt","ro","ru","sv","ta", "te","th","tr","vi","zh"]);var a=window.navigator.language.split("-");iAd.Content.setValueForParameter(a[0],"l anguage");iAd.Content.defineParameter("region",["ar","at","au","be","bg","bo","b r","ca","cl","cn","co","cz","de","dk","ec","eg","es","fi","fr","gb","gf","gr","g y","hk","hu","id","ie","in","it","jo","jp","kr","ma","mx","my","nl","no","nz","p e","ph","pl","py","ro","ru","sa","se","sg","sr","th","tr","us","uy","ve","vn","z a"]);iAd.Content.setValueForParameter(a[a.length-1],"region")})();

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Path={};iAd.Path.IPAD_SUFFIX="~ipad";iAd.Path.OPTIONAL_HIDPI_AND_EXTENSION_R EGEXP=/((%40|@)([0-9]+(\.[0-9]+)?)x)?(\.[^./]+)?$/;iAd.Path.IPAD_SUFFIX_REGEXP=/ ~ipad(\.[^./]+)?$/;iAd.Path.OPTIONAL_IPAD_SUFFIX_AND_EXTENSION_REGEXP=/(~ipad)?( \.[^./]+)?$/;iAd.Path.HIDPI_SUFFIX_REGEXP=/(%40|@)([0-9]+(\.[0-9]+)?)x(~ipad)?(\ .[^./]+)?$/;iAd.Path.appendHiDPISuffix=function(b,c){c=c||iAd.Device.PIXEL_RATIO ;if(c==1){return b}if(iAd.Path.HIDPI_SUFFIX_REGEXP.test(b)){return b}var a="@"+c+"x";return b.replace(iAd.Path.OPTIONAL_IPAD_SUFFIX_AND_EXTENSION_REGEXP,function(d){return a+d})};iAd.Path.appendiPadSuffix=function(a){if(iAd.Path.IPAD_SUFFIX_REGEXP.tes t(a)){return a}return a.replace(iAd.Path.OPTIONAL_HIDPI_AND_EXTENSION_REGEXP,function(d,f,c,e,b,g){re turn(f||"")+iAd.Path.IPAD_SUFFIX+(g||"")})};iAd.Path.pixelRatioForPath=function( a){var b=1;a.replace(iAd.Path.HIDPI_SUFFIX_REGEXP,function(d,c,e){b=parseFloat(e,10)}) ;return b};iAd.Path.HREF_PROXY=null;iAd.Path.resolveAbsolutePath=function(b){if(!iAd.Pa th.HREF_PROXY){iAd.Path.HREF_PROXY=document.createElement("a")}var a=iAd.Path.HREF_PROXY;a.href=b;return a.href};iAd.Path.objectToQueryString=function(a,b){return iAd.Path.objectToQueryStringForKey(a,b,null)};iAd.Path.objectToQueryStringForKe y=function(a,h,d){h=h||"&";d=d||"";if(iAd.Utils.objectIsPrimitive(a)){var c=a?encodeURIComponent(a):"";if(d&&c){return encodeURIComponent(d)+"="+c}return c}var f=[],g=d;if(iAd.Utils.objectIsArray(a)){if(g){g+="[]"}for(var b=0,e=a.length;b<e;b++){f.push(iAd.Path.objectToQueryStringForKey(a[b],h,g))}}e lse{if(typeof(a)=="object"){for(var d in a){f.push(iAd.Path.objectToQueryStringForKey(a[d],h,g?g+"["+d+"]":d))}}}return f.join(h)};iAd.Path.basename=function(f,e){if(f=="/"){return f}var c=/([^\/]*)\/*$/;var a=f.match(c);var d=a[1];if(!e){return d}var b=d.lastIndexOf(e);if(b==-1||b!=d.length-e.length){return d}return d.substring(0,b)};Object.defineProperty(iAd.Path,"assetsPath",{get:function(){i f(this._assetsPath){return this._assetsPath}var a=/\/?iAd(-\w+)?\.cssz?(\?.*)?$/;var c,d,f;for(var b=0,e=document.styleSheets.length;b<e;b++){c=document.styleSheets[b];if(c.href) {d=c.href.split("/");f=d.pop();if(a.test(f)){d.push("assets/");this._assetsPath= d.join("/");return this._assetsPath}}}},set:function(a){this._assetsPath=a}});iAd.Utils.setupDispl ayNames(iAd.Path,"iAd.Path");

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Path.assetsPath="plugins/com.apple.iAdProducer.iAdJS/assets/";iAd.Path.lastP athComponent=function(a){if(!a){return a}var b=a.split("/");return decodeURIComponent(b.slice(b.length-1).join())};iAd.Path.appendHiDPISuffixIfAva ilable=function(a){return window.imageAssetInfo&&window.imageAssetInfo[a]?iAd.Path.appendHiDPISuffix(a):a };

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.Image",synthesizedProperties:["width","height","loaded"],ar chivedProperties:["url","hasHiDPIVersion","hasiPadVersion"]});iAd.Image.prototyp e.init=function(c,b,a){this.callSuper();this.url=c;this.resolvedURL=iAd.Image.re solveURL(c,b,a);this.hasHiDPIVersion=b;this.hasiPadVersion=a;this._loaded=false; this.scaleFactor=1/iAd.Path.pixelRatioForPath(this.resolvedURL);this.element=new Image();this.load();iAd.Image.imageWasCreated(this)};iAd.Image.prototype.getWid th=function(){return this.element.width*this.scaleFactor};iAd.Image.prototype.getHeight=function(){r eturn this.element.height*this.scaleFactor};iAd.Image.prototype.handleEvent=function( a){if(a.type==="load"&&(a.target===this.element)){this.loaded=true;this.element. removeEventListener("load",this,false);this.runCompletion(false)}};iAd.Image.pro totype.load=function(){this.element.src=this.resolvedURL;if(this.element.complet e){this.loaded=true}else{this.element.addEventListener("load",this,false)}};iAd. Image.prototype.whenLoaded=function(b,a){this.whenLoadedArguments={completion:b, methodName:a};if(this._loaded){this.runCompletion(true)}};iAd.Image.prototype.ru nCompletion=function(a){var b=this.whenLoadedArguments;if(!b){return}if(iAd.Utils.objectIsFunction(b.comple tion)){b.completion(this,a)}else{if(iAd.Utils.objectHasMethod(b.completion,b.met hodName)){b.completion[b.methodName](this,a)}}delete this.whenLoadedArguments};iAd.Image.imageForURL=function(c,b,a){if(!c){return null}var d=iAd.Image.resolveURL(c,b,a);if(this.instances&&this.instances[d]){return this.instances[d]}return new iAd.Image(c,b,a)};iAd.Image.imageForContentKey=function(b){if(!b){return null}var a=iAd.Content.contentForKey(b);return iAd.Image.imageForURL(a)};iAd.Image.restoreFromArchive=function(a){return this.imageForURL(a.url,a.hasHiDPIVersion,a.hasiPadVersion)};iAd.Image.resolveUR L=function(c,b,a){if(b&&iAd.Device.HAS_HIDPI_DISPLAY){c=iAd.Path.appendHiDPISuff ix(c)}if(a&&iAd.Device.IS_IPAD){c=iAd.Path.appendiPadSuffix(c)}return c};iAd.Image.imageWasCreated=function(a){if(!this.instances){this.instances={}; window.setTimeout(iAd.Image.runLoopDidStart,0)}this.instances[a.resolvedURL]=a}; iAd.Image.runLoopDidStart=function(){delete iAd.Image.instances};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Image.isEqual=function(d,c){if(iAP.Context.IS_IAD_PRODUCER){return d==c}return d&&c&&d.resolvedURL==c.resolvedURL&&d.hasHiDPIVersion==c.hasHiDPIVersion};iAd.I mage._imageSets={};iAd.Image.registerImageSets=function(c){var d;var a=function(f,e){if(f==e){return 0}return f<e?-1:1};for(var b in c){if(c.hasOwnProperty(b)){d=c[b];if(!d[1]){d[1]=b}d._resolutions=Object.keys(d ).map(parseFloat).sort(a);iAd.Image._imageSets[b]=c[b]}}};iAd.Image.resolvedInfo ForURL=function(a){var h=1;var k=a;var f=iAd.Image._imageSets[a];if(f){var j=window.devicePixelRatio||1;var c=f._resolutions;var b=c[0];k=f[b];if(b<j){var g;for(var d=1,e=c.length;d<e;d++){g=c[d];if(b<j){k=f[g];b=g}else{break}}}h=1/b}return{sca leFactor:h,resolvedURL:k}};iAd.Image.imageForURL=function(b){if(!b){return null}var e=iAd.Image.resolvedInfoForURL(b);var a=e.resolvedURL;var c=e.scaleFactor;var d;if(this.instances&&this.instances[a]){d=this.instances[a]}else{d=new iAd.Image(a)}d._originalURL=b;d.scaleFactor=c;return d};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.Point",archivedProperties:["x","y"]});iAd.Point.prototype.i nit=function(a,b){this.callSuper();this.x=(a!=null&&!isNaN(a))?a:0;this.y=(b!=nu ll&&!isNaN(b))?b:0};iAd.Point.fromEvent=function(a){var a=(a.touches&&a.touches.length>0)?a.touches[0]:a;return new iAd.Point(a.pageX,a.pageY)};iAd.Point.fromEventInElement=function(c,b){var c=(c.touches&&c.touches.length>0)?c.touches[0]:c;var a=window.webkitConvertPointFromPageToNode(b,new WebKitPoint(c.pageX,c.pageY));return new iAd.Point(a.x,a.y)};iAd.Point.prototype.toString=function(){return"iAd.Point["+ this.x+","+this.y+"]"};iAd.Point.prototype.copy=function(){return new iAd.Point(this.x,this.y)};iAd.Point.prototype.equals=function(a){return(this.x= =a.x&&this.y==a.y)};iAd.Class({name:"iAd.Size",archivedProperties:["width","heig ht"]});iAd.Size.prototype.init=function(b,a){this.callSuper();this.width=(b!=nul l&&!isNaN(b))?b:0;this.height=(a!=null&&!isNaN(a))?a:0};iAd.Size.ZERO_SIZE=new iAd.Size(0,0);iAd.Size.prototype.toString=function(){return"iAd.Size["+this.wid th+","+this.height+"]"};iAd.Size.prototype.copy=function(){return new iAd.Size(this.width,this.height)};iAd.Size.prototype.equals=function(a){return( this.width==a.width&&this.height==a.height)};iAd.Class({name:"iAd.Rect",archived Properties:["origin","size"]});iAd.Rect.prototype.init=function(b,d,c,a){this.ca llSuper();this.origin=new iAd.Point(b||0,d||0);this.size=new iAd.Size(c||0,a||0)};iAd.Rect.ZERO_RECT=new iAd.Rect(0,0,0,0);iAd.Rect.prototype.toString=function(){return"iAd.Rect["+[thi s.origin.x,this.origin.y,this.size.width,this.size.height].join(", ")+"]"};iAd.Rect.prototype.copy=function(){return new iAd.Rect(this.origin.x,this.origin.y,this.size.width,this.size.height)};iAd.Rec t.prototype.equals=function(a){return(this.origin.equals(a.origin)&&this.size.eq uals(a.size))};iAd.Rect.prototype.inset=function(a){return new iAd.Rect(this.origin.x+a.left,this.origin.y+a.top,this.size.width-a.left-a.righ t,this.size.height-a.top-a.bottom)};iAd.Rect.prototype.minX=function(){return this.origin.x};iAd.Rect.prototype.minY=function(){return this.origin.y};iAd.Rect.prototype.midX=function(){return this.origin.x+(this.size.width/2)};iAd.Rect.prototype.midY=function(){return this.origin.y+(this.size.height/2)};iAd.Rect.prototype.maxX=function(){return this.origin.x+this.size.width};iAd.Rect.prototype.maxY=function(){return this.origin.y+this.size.height};iAd.Rect.prototype.intersectionWithRect=functio n(e){var f=new iAd.Rect();var b=Math.max(this.minX(),e.minX());var a=Math.min(this.maxX(),e.maxX());if(b>a){return iAd.Rect.ZERO_RECT}f.origin.x=b;f.size.width=a-b;var d=Math.max(this.minY(),e.minY());var c=Math.min(this.maxY(),e.maxY());if(d>c){return iAd.Rect.ZERO_RECT}f.origin.y=d;f.size.height=c-d;return f};iAd.Class({name:"iAd.EdgeInsets",archivedProperties:["top","right","bottom", "left"]});iAd.EdgeInsets.prototype.init=function(d,b,a,c){this.top=d;this.right= b;this.bottom=a;this.left=c};iAd.EdgeInsets.prototype.equals=function(a){return( this.top==a.top&&this.right==a.right&&this.bottom==a.bottom&&this.left==a.left)} ;iAd.EdgeInsets.prototype.copy=function(){return new iAd.EdgeInsets(this.top,this.right,this.bottom,this.left)};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Array={};iAd.Array.removeObjectFromArray=function(b,c){var a=c.indexOf(b);if(a==-1){return false}c.splice(a,1);return true};iAd.Utils.setupDisplayNames(iAd.Array,"iAd.Array");

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.Transition",mixins:[iAd.EventTarget]});iAd.Transition.DID_C OMPLETE_DELEGATE="transitionDidComplete";iAd.Transition.DEFAULTS={duration:0.5,d elay:0,removesTargetUponCompletion:false,revertsToOriginalValues:false};iAd.Tran sition.STYLES=["-webkit-transition-property","-webkit-transition-duration","-web kit-transition-timing-function","-webkit-transition-delay","-webkit-transition"] ;iAd.Transition.NORMALIZE_ZERO_REG_EXP=/([^\d+-]|^)[+-]?0[a-z%]*/g;iAd.Transitio n.HARDWARE_LAYER_BACKING_PROPERTIES=["position"];iAd.Transition.prototype.init=f unction(a,b){this.target=null;this.properties=null;this.base=null;this.duration= null;this.delay=null;this.from=null;this.to=null;this.timingFunction=null;this.d elegate=null;this.removesTargetUponCompletion=null;this.revertsToOriginalValues= null;this.defaultsApplied=false;this.archivedStyles=null;this.archivedValues=[]; this.archivedBaseValues=[];this.definition=a;this.reversed=!!b};iAd.Transition.p rototype.applyDefaults=function(){if(this.defaultsApplied){return}for(var a in iAd.Transition.DEFAULTS){if(this[a]==null){this[a]=iAd.Transition.DEFAULTS[a]}} this.defaultsApplied=true};iAd.Transition.prototype.archiveTransitionStyles=func tion(){if(this.archivedStyles!=null){return}var b=iAd.Utils.objectIsInstanceOfClass(this.target,iAd.View)?this.target.layer:thi s.target;this.archivedStyles=[];for(var a=0,c=iAd.Transition.STYLES.length;a<c;a++){this.archivedStyles.push(b.style.ge tPropertyValue(iAd.Transition.STYLES[a]))}};iAd.Transition.prototype.restoreTran sitionStyles=function(){for(var a=0,b=iAd.Transition.STYLES.length;a<b;a++){this.element.style.setProperty(iAd. Transition.STYLES[a],this.archivedStyles[a],"")}this.archivedStyles=null};iAd.Tr ansition.prototype.archiveBaseValues=function(){if(!this.revertsToOriginalValues ){return}if(iAd.Utils.objectIsInstanceOfClass(this.target,iAd.View)){for(var a=0,b=this.properties.length;a<b;a++){this.archivedValues[a]=this.target[this.p roperties[a]]}if(this.base){for(var a=0,b=this.base.length;a<b;a+=2){this.archivedBaseValues[a]=this.target[this.ba se[a]]}}}else{for(var a=0,b=this.properties.length;a<b;a++){this.archivedValues[a]=this.target.style. getPropertyValue(this.properties[a])}if(this.base){for(var a=0,b=this.base.length;a<b;a+=2){this.archivedBaseValues[a]=this.target.style.g etPropertyValue(this.base[a])}}}};iAd.Transition.prototype.restoreBaseValues=fun ction(){if(iAd.Utils.objectIsInstanceOfClass(this.target,iAd.View)){for(var a=0,b=this.properties.length;a<b;a++){this.target[this.properties[a]]=this.arch ivedValues[a]}if(this.base){for(var a=0,b=this.base.length;a<b;a+=2){this.target[this.base[a]]=this.archivedBaseVal ues[a]}}}else{for(var a=0,b=this.properties.length;a<b;a++){this.target.style.setProperty(this.proper ties[a],this.archivedValues[a],null)}if(this.base){for(var a=0,b=this.base.length;a<b;a+=2){this.target.style.setProperty(this.base[a],thi s.archivedBaseValues[a],null)}}}};iAd.Transition.prototype.start=function(){if(i Ad.Transaction.openTransactions>0){iAd.Transaction.addTransition(this)}else{this .applyFromState();iAd.CSS.flushPendingUpdates();this.callMethodNameAfterDelay("a pplyToState",0)}return this};iAd.Transition.prototype.applyFromState=function(){this.processDefinition ();this.applyDefaults();this.archiveTransitionStyles();this.archiveBaseValues(); this.enforceHardwareLayerBacking();if(this.from==null){return}if(iAd.Utils.objec tIsInstanceOfClass(this.target,iAd.View)){this.target.layer.style.webkitTransiti onDuration=0;if(this.base){for(var a=0,b=this.base.length;a<b;a+=2){this.target[this.base[a]]=this.base[a+1]}}for( var a=0,b=this.properties.length;a<b;a++){this.target[this.properties[a]]=this.from [a]}}else{this.target.style.webkitTransitionDuration=0;if(this.base){for(var a=0,b=this.base.length;a<b;a+=2){this.target.style.setProperty(this.base[a],thi s.base[a+1],null)}}for(var a=0,b=this.properties.length;a<b;a++){this.target.style.setProperty(this.proper ties[a],this.from[a],null)}}};iAd.Transition.prototype.processDefinition=functio n(){if(!this.definition){return}var a=this.definition;if(iAd.Utils.objectIsFunction(a)){if(this.target!=null&&iAd.U tils.objectIsInstanceOfClass(this.target,iAd.View)){a=a(this.target)}else{return }}iAd.Utils.copyPropertiesFromSourceToTarget(a,this);if(this.reversed){var b=this.from;this.from=this.to;this.to=b}};iAd.Transition.prototype.enforceHardw areLayerBacking=function(){if(iAd.Utils.objectIsInstanceOfClass(this.target,iAd. View)){for(var a=0,b=this.properties.length;a<b;a++){if(iAd.Transition.HARDWARE_LAYER_BACKING_ PROPERTIES.indexOf(this.properties[a])!=-1){this.target.wantsHardwareLayerBackin g=true;return}}}};iAd.Transition.prototype.applyToState=function(){var e=iAd.Utils.objectIsInstanceOfClass(this.target,iAd.View);this.cssProperties=[] ;var h=[];for(var b=0,d=this.properties.length;b<d;b++){var f=(e)?this.target.cssPropertyNameForJSProperty(this.properties[b]):this.propert ies[b];if(this.cssProperties.indexOf(f)>-1){continue}var g=(iAd.Utils.objectIsArray(this.duration))?this.duration[b]:this.duration;var c=(iAd.Utils.objectIsArray(this.timingFunction))?this.timingFunction[b]:this.ti mingFunction;var a=(iAd.Utils.objectIsArray(this.delay))?this.delay[b]:this.delay;h.push([f,g+"s ",c,a+"s"].join(" "));if(!this.propertyStatesAreEqualForIndex(b)){this.cssProperties.push(f)}}thi s.element=e?this.target.layer:this.target;this.eventTarget=this.element;if(g!==0 ){this.element.addEventListener("webkitTransitionEnd",this,false)}this.completed Transitions=0;this.element.style.webkitTransition=h.join(", ");if(e){for(var b=0,d=this.properties.length;b<d;b++){this.target[this.properties[b]]=this.to[b ]}}else{for(var b=0,d=this.properties.length;b<d;b++){this.target.style.setProperty(this.proper ties[b],this.to[b],"")}}if(!this.cssProperties.length){this.callMethodNameAfterD elay("handleTransitionComplete",0)}};iAd.Transition.prototype.propertyStatesAreE qualForIndex=function(a){var c=this.from==null?this.target[this.properties[a]]:this.from[a];var b=this.to[a];if((c instanceof iAd.Point&&b instanceof iAd.Point)||(c instanceof iAd.Size&&b instanceof iAd.Size)){return c.equals(b)}else{if(iAd.Utils.objectIsString(c)&&iAd.Utils.objectIsString(b)){c =c.replace(iAd.Transition.NORMALIZE_ZERO_REG_EXP,"$10");b=b.replace(iAd.Transiti on.NORMALIZE_ZERO_REG_EXP,"$10")}return c===b}};iAd.Transition.prototype.handleEvent=function(a){if(a.target!==this.ele ment){return}this.completedTransitions++;if(this.completedTransitions!=this.cssP roperties.length){return}this.handleTransitionComplete()};iAd.Transition.prototy pe.handleTransitionComplete=function(){this.dispatchNotification(iAd.Transition. DID_COMPLETE_DELEGATE,this.delegate);this.element.removeEventListener("webkitTra nsitionEnd",this,false);if(this.removesTargetUponCompletion){var a=this.target;if(iAd.Utils.objectIsInstanceOfClass(this.target,iAd.View)){a.rem oveFromSuperview()}else{a.parentNode.removeChild(a)}}else{this.restoreTransition Styles()}if(this.revertsToOriginalValues){this.restoreBaseValues()}};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.View",superclass:iAd.Object,mixins:[iAd.EventTarget],synthe sizedProperties:["id","position","size","frame","transform","anchorPoint","ancho rPointZ","doubleSided","zIndex","opacity","clipsToBounds","hidden","wantsHardwar eLayerBacking","transitionsEnabled","transitionsDuration","hostingLayer","userIn teractionEnabled","declarativeLayerWasInitialized","eventTarget","layerIsInDocum ent","touchLayer","tracking","navigable","focused"],archivedProperties:["id","po sition","size","autoresizingMask","transform","anchorPoint","anchorPointZ","doub leSided","zIndex","opacity","clipsToBounds","hidden","wantsHardwareLayerBacking" ,"transitionsEnabled","transitionsDuration","subviews","userInteractionEnabled", "navigable","focused","analyticsId"],cssClassName:"ad-view",collectionAccessor:" views"});iAd.View.prototype.init=function(a){this.callSuper();if(iAd.Utils.objec tIsString(a)){a=document.querySelector(a)}this.layer=a;this.superview=null;this. subviews=[];this.tracksAllTouchesOnceTouchesBegan=true;this.autoresizesSubviews= true;this.autoresizingMask=iAd.View.AUTORESIZING_NONE;this._layerIsInDocument=fa lse;this._position=new iAd.Point();this._size=new iAd.Size();this._anchorPoint=new iAd.Point(0.5,0.5);this._anchorPointZ=0;this._doubleSided=true;this._zIndex=0;t his._opacity=1;this._transform="none";this._clipsToBounds=false;this._hidden=fal se;this._wantsHardwareLayerBacking=false;this._transitionsEnabled=false;this._tr ansitionsDuration=0.5;this._hostingLayer=null;this._userInteractionEnabled=false ;this._touchLayer=null;this._navigable=false;this._focused=false;this._tracking= false;this.touchInside=false;this.mouseInside=false;this.gestureRecognizers=[];t his.usesDeclarativeBacking=!!(a&&a.nodeType==Node.ELEMENT_NODE);this._declarativ eLayerWasInitialized=false;if(this.usesDeclarativeBacking){if(document.body.cont ains(this.layer)){this._layerIsInDocument=true;this.initWithDeclarativeBacking() ;this.layerWasInsertedIntoDocument()}}else{this.createLayer();this.setupCSSClass es();this.layerWasCreated()}this.layer._view=this};iAd.View.MANAGED_BY_VIEW_CONT ROLLER_ATTR="ad-managed-by-view-controller";iAd.View.AUTORESIZING_NONE=0;iAd.Vie w.AUTORESIZING_FLEXIBLE_LEFT_MARGIN=1<<0;iAd.View.AUTORESIZING_FLEXIBLE_WIDTH=1< <1;iAd.View.AUTORESIZING_FLEXIBLE_RIGHT_MARGIN=1<<2;iAd.View.AUTORESIZING_FLEXIB LE_TOP_MARGIN=1<<3;iAd.View.AUTORESIZING_FLEXIBLE_HEIGHT=1<<4;iAd.View.AUTORESIZ ING_FLEXIBLE_BOTTOM_MARGIN=1<<5;iAd.View.PROPERTY_MAPPING={opacity:"opacity",tra nsform:"-webkit-transform",position:"-webkit-transform",anchorPoint:"-webkit-tra nsform-origin",doubleSided:"-webkit-backface-visibility",zIndex:"z-index"};iAd.V iew.EVENT_ATTRIBUTE_PREFIX=iAd.Element.ATTRIBUTE_PREFIX+"on";iAd.View.LAYER_STYL E_DID_CHANGE_EVENT="viewLayerStyleDidChange";iAd.View.INSIDE_PADDING=(iAd.Device .IS_IPAD?25:70);iAd.View.TOUCH_DOWN_EVENT="viewTouchDown";iAd.View.TOUCH_DRAG_IN SIDE_EVENT="viewTouchDragInside";iAd.View.TOUCH_DRAG_OUTSIDE_EVENT="viewTouchDra gOutside";iAd.View.TOUCH_DRAG_ENTER_EVENT="viewTouchDragEnter";iAd.View.TOUCH_DR AG_EXIT_EVENT="viewTouchDragExit";iAd.View.TOUCH_UP_INSIDE_EVENT="viewTouchUpIns ide";iAd.View.TOUCH_UP_OUTSIDE_EVENT="viewTouchUpOutside";iAd.View.TOUCH_CANCEL_ EVENT="viewTouchCancel";iAd.View.TOUCH_STATE_CHANGE_EVENT="viewTouchStateChange" ;iAd.View.FOCUS_IN_EVENT="viewFocusIn";iAd.View.FOCUS_OUT_EVENT="viewFocusOut";i Ad.View.ACTIVATE_EVENT="viewActivate";iAd.View.synthesizedEvents=[iAd.View.TOUCH _DOWN_EVENT,iAd.View.TOUCH_DRAG_INSIDE_EVENT,iAd.View.TOUCH_DRAG_OUTSIDE_EVENT,i Ad.View.TOUCH_DRAG_ENTER_EVENT,iAd.View.TOUCH_DRAG_EXIT_EVENT,iAd.View.TOUCH_UP_ INSIDE_EVENT,iAd.View.TOUCH_UP_OUTSIDE_EVENT,iAd.View.TOUCH_CANCEL_EVENT,iAd.Vie w.TOUCH_STATE_CHANGE_EVENT];iAd.View.dispatchesStyleChangeEvents=false;iAd.View. FOCUSED_CSS_CLASS="ad-focused";iAd.View.prototype.createLayer=function(){this.la yer=document.createElement("div")};iAd.View.prototype.initWithDeclarativeBacking =function(){this.setupLayer();this.layerWasCreated();this.setupCSSClasses();this .readPropertiesFromLayerComputedStyle(window.getComputedStyle(this.layer));this. readPropertiesFromLayerAttributes(this.getCustomLayerAttributes());this.declarat iveLayerWasInitialized=true};iAd.View.prototype.setupLayer=function(){this.looku pViewLayersInLayer(this.hostingLayer);var a=["button","checkbox","link","menuitem","menuitemcheckbox","menuitemradio","op tion","radio","slider","spinbutton","tab","textbox","treeitem"];if(this.layer.ha sClassName(iAd.SpatialNavigationManager.NAVIGABLE_CSS_CLASS)||a.indexOf(this.lay er.getAttribute("role"))!=-1){this.navigable=true}};iAd.View.prototype.lookupVie wLayersInLayer=function(c){var d=c.firstElementChild;while(d){if(!d.hasOwnProperty("_view")){var b=iAd.View.viewClassForLayer(d);if(b){var a=new b(d);a._indexInSuperviewSubviews=this.subviews.push(a)-1;a.willMoveToSuperview( this);a.superview=this;a.didMoveToSuperview()}else{this.lookupViewLayersInLayer( d)}}d=d.nextElementSibling}};iAd.View.prototype.setupCSSClasses=function(){var a=this.constructor,b;while(a.superclass){b=a.cssClassName;if(b){this.layer.addC lassName(b)}if(a===iAd.View){break}a=a.superclass}};iAd.View.prototype.readPrope rtiesFromLayerComputedStyle=function(b){this._size.width=parseInt(b.width,10)||0 ;this._size.height=parseInt(b.height,10)||0;this._position.x=parseInt(b.left,10) ||0;this._position.y=parseInt(b.top,10)||0;this._zIndex=parseInt(b.zIndex,10)||0 ;this._clipsToBounds=(b.overflow=="hidden");this._doubleSided=(b.webkitBackfaceV isibility=="visible");this._transform=b.webkitTransform;this._hidden=(b.visibili ty=="hidden");this._opacity=parseFloat(b.opacity);var a=iAd.CSS.matrixFromString(this._transform);var c=new WebKitCSSMatrix();if(!iAd.CSS.matrixEqualsToMatrix(a,c)){this._position.x+=a.m4 1;this._position.y+=a.m42;a=a.translate(a.m41*-1,a.m42*-1,0);this._transform=a.t oString()}if(this._transform!="none"){this._wantsHardwareLayerBacking=true}};iAd .View.prototype.readPropertiesFromLayerAttributes=function(b){if(iAd.ViewControl ler!=null&&b.hasOwnProperty(iAd.View.MANAGED_BY_VIEW_CONTROLLER_ATTR)){this.crea teManagingViewController()}var c,e,d;var a=this.constructor.synthesizedEventMap;for(c in b){d=b[c];e=a[c.toLowerCase()];if(e){this.addEventListener(e,iAd.Event.eventHan dlerForString(d),false)}else{this.setValueForAttribute(d,c)}}};iAd.View.prototyp e.createManagingViewController=function(){new iAd.ViewController({id:this.layer.hasAttribute("id")?this.layer.getAttribute("i d"):"",properties:{view:this}})};iAd.View.prototype.setValueForAttribute=functio n(c,b){var a=this.propertyNameForAttribute(b);switch(typeof(this[a])){case"string":this[a] =c;break;case"number":this[a]=parseFloat(c);break;case"boolean":this[a]=!(c=="fa lse");break;default:this[a]=c}};iAd.View.prototype.propertyNameForAttribute=func tion(a){return iAd.String.dashedStringToCamelCase(a.substr(iAd.Element.ATTRIBUTE_PREFIX.length ))};iAd.View.prototype.attributeNameForProperty=function(a){return iAd.Element.ATTRIBUTE_PREFIX+iAd.String.camelCaseStringToDashed(a)};iAd.View.pr ototype.getCustomLayerAttributes=function(){var a={};var d=iAd.Element.HTML5_CUSTOM_ATTRIBUTE_PREFIX+iAd.Element.ATTRIBUTE_PREFIX;var g=this.layer.attributes;var f,b;for(var c=0,e=g.length;c<e;c++){f=g.item(c);b=f.name;if(b.indexOf(d)==0){a[b.substr(iAd .Element.HTML5_CUSTOM_ATTRIBUTE_PREFIX.length)]=f.value}else{if(b.indexOf(iAd.El ement.ATTRIBUTE_PREFIX)==0){a[b]=f.value}}}this.customLayerAttributes=a;return a};iAd.View.prototype.layerHasCustomAttribute=function(a){if(this.customLayerAt tributes){return this.customLayerAttributes.hasOwnProperty(a)}return iAd.Element.hasCustomAttribute(this.layer,a)};iAd.View.prototype.getLayerCustom AttributeValue=function(a){if(this.customLayerAttributes){return this.customLayerAttributes[a]||null}else{return iAd.Element.getCustomAttribute(this.layer,a)}};iAd.View.prototype.setLayerStyle =function(a){for(var b in a){this.layer.style.setProperty(b,a[b])}if(iAd.View.dispatchesStyleChangeEvents ){this.createAndDispatchEvent(iAd.View.LAYER_STYLE_DID_CHANGE_EVENT,[["changedPr operties",a]])}};iAd.View.prototype.toString=function(){return[this.constructor. displayName,"[",this._size.width,"x",this._size.height,"@",this._position.x,",", this._position.y,"]"].join("")};iAd.View.prototype.getId=function(){return this.layer.id};iAd.View.prototype.setId=function(a){this.layer.id=a};iAd.View.p rototype.setPosition=function(a){if(!a||this._position.equals(a)){return}this._p osition=a;this.updatePositionAndTransform()};iAd.View.prototype.setSize=function (a,c){if((!a||this._size.equals(a))&&!c){return}var b=this._size.copy();this._size=a;this.setLayerStyle({width:a.width+"px",height: a.height+"px"});if(this.autoresizesSubviews){this.resizeSubviewsWithOldSize(b)}} ;iAd.View.prototype.getFrame=function(){return new iAd.Rect(this.position.x,this.position.y,this.size.width,this.size.height)};iAd .View.prototype.setFrame=function(a){this.position=a.origin;this.size=a.size};iA d.View.prototype.setTransform=function(a){this._transform=a;this.updatePositionA ndTransform()};iAd.View.prototype.setAnchorPoint=function(a){if(!a){return}this. _anchorPoint=a;this.updateLayerTransformOrigin()};iAd.View.prototype.setAnchorPo intZ=function(a){this._anchorPointZ=a;this.updateLayerTransformOrigin()};iAd.Vie w.prototype.updateLayerTransformOrigin=function(){this.setLayerStyle({"-webkit-t ransform-origin":Math.round(this._anchorPoint.x*100)+"% "+Math.round(this._anchorPoint.y*100)+"% "+this._anchorPointZ+"px"})};iAd.View.prototype.setDoubleSided=function(a){this ._doubleSided=a;this.setLayerStyle({"-webkit-backface-visibility":a?"visible":"h idden"})};iAd.View.prototype.setZIndex=function(a){this._zIndex=a;this.setLayerS tyle({"z-index":a})};iAd.View.prototype.setHidden=function(a){this._hidden=a;thi s.setLayerStyle({visibility:(a?"hidden":"visible")})};iAd.View.prototype.updateP ositionAndTransform=function(){if(this._wantsHardwareLayerBacking||this._transit ionsEnabled){this.setLayerStyle({left:"0",top:"0","-webkit-transform":iAd.CSS.co ncatenateTransforms(iAd.CSS.tm(iAd.CSS.roundedPxValue(this._position.x),iAd.CSS. roundedPxValue(this._position.y)),this._transform)})}else{this.setLayerStyle({le ft:this._position.x+"px",top:this._position.y+"px","-webkit-transform":this._tra nsform})}};iAd.View.prototype.setOpacity=function(a){this._opacity=a;this.setLay erStyle({opacity:a})};iAd.View.prototype.setTransitionsEnabled=function(a){this. setLayerStyle({"-webkit-transition-duration":a?this._transitionsDuration+"s":"0s "});this._transitionsEnabled=a;this.updatePositionAndTransform()};iAd.View.proto type.setWantsHardwareLayerBacking=function(a){if(this._wantsHardwareLayerBacking ==a){return}this._wantsHardwareLayerBacking=a;this.updatePositionAndTransform()} ;iAd.View.prototype.setTransitionsDuration=function(a){this.setLayerStyle({"-web kit-transition-duration":a+"s"});this._transitionsDuration=a};iAd.View.prototype .setClipsToBounds=function(a){this._clipsToBounds=a;this.setLayerStyle({overflow :a?"hidden":"visible"})};iAd.View.prototype.getTouchLayer=function(){return this._touchLayer||this.layer};iAd.View.prototype.getHostingLayer=function(){ret urn(this._hostingLayer!=null)?this._hostingLayer:this.layer};iAd.View.prototype. addSubview=function(a){return this.insertSubviewAtIndex(a,this.subviews.length)};iAd.View.prototype.removeFro mSuperview=function(){if(this.superview==null){return}this.willMoveToSuperview(n ull);this.superview.removeSubview(this);this.layer.parentNode.removeChild(this.l ayer);this.superview=null;this.didMoveToSuperview();this.dispatchNotificationOfL ayerRemovalFromDocument()};iAd.View.prototype.removeSubview=function(e){if(e.sup erview!=this){return}this.willRemoveSubview(e);var d=this.subviews;var a=e._indexInSuperviewSubviews;d.splice(a,1);for(var b=a,c=d.length;b<c;b++){d[b]._indexInSuperviewSubviews=b}};iAd.View.prototype.i nsertSubviewAtIndex=function(h,g){var k=this.subviews;if(g>k.length){return}var b=h.superview;var a;if(b==this){a=h._indexInSuperviewSubviews;if(g===a){return}k.splice(a,1);if(g >a){g--}}else{if(b){b.removeSubview(h)}h.willMoveToSuperview(this)}k.splice(g,0, h);h._indexInSuperviewSubviews=g;var j=(a!=null&&a<g)?a:g+1;for(var d=j,f=k.length;d<f;d++){k[d]._indexInSuperviewSubviews=d}var c=k[g+1];if(c){var e=c.layer;while(e.hasClassName("iap-wrapped")){e=e.parentNode}this.hostingLayer .insertBefore(h.layer,e)}else{this.hostingLayer.appendChild(h.layer)}if(b!=this) {h.superview=this;h.didMoveToSuperview()}this.didAddSubview(h);if(this._layerIsI nDocument&&!h._layerIsInDocument){h.dispatchNotificationOfLayerInsertionIntoDocu ment()}return h};iAd.View.prototype.insertSubviewAfterSubview=function(b,a){if(a.superview!== this){return}var c=a._indexInSuperviewSubviews+1;if(c<this.subviews.length){this.insertSubviewAt Index(b,c)}else{this.addSubview(b)}return b};iAd.View.prototype.insertSubviewBeforeSubview=function(b,a){if(a.superview!= =this){return}return this.insertSubviewAtIndex(b,a._indexInSuperviewSubviews)};iAd.View.prototype.ex changeSubviewsAtIndices=function(b,a){if(b>=this.subviews.length||a>=this.subvie ws.length){return}var d=this.subviews[b];var g=this.subviews[a];this.subviews[b]=g;this.subviews[a]=d;d._indexInSuperviewSub views=a;g._indexInSuperviewSubviews=b;var h=d.layer;var f=g.layer;var i=this.hostingLayer;var e=h.nextSibling;var c=f.nextSibling;if(e!=null){i.insertBefore(f,e)}else{i.appendChild(f)}if(c!=nul l){i.insertBefore(h,c)}else{i.appendChild(h)}};iAd.View.prototype.isDescendantOf View=function(b){var c=false;var a=this;while(a.superview!=null){if(a.superview===b){c=true;break}a=a.superview} return c};iAd.View.prototype.layerWasCreated=function(){};iAd.View.prototype.willMoveT oSuperview=function(a){};iAd.View.prototype.didMoveToSuperview=function(){};iAd. View.prototype.didAddSubview=function(a){};iAd.View.prototype.willRemoveSubview= function(a){};iAd.View.prototype.layerWasInsertedIntoDocument=function(){if(this .usesDeclarativeBacking){if(!this.declarativeLayerWasInitialized){this.initWithD eclarativeBacking()}else{var a=window.getComputedStyle(this.layer);if(isNaN(this._size.width)){this._size.wi dth=parseInt(a.width,10);this._size.height=parseInt(a.height,10)}if(isNaN(this._ position.x)){this._position.x=parseInt(a.left,10);this._position.y=parseInt(a.to p,10)}}}this.layerIsInDocument=true};iAd.View.prototype.layerWasRemovedFromDocum ent=function(){this.layerIsInDocument=false};iAd.View.prototype.dispatchNotifica tionOfLayerInsertionIntoDocument=function(){var c=this.subviews;for(var a=0,b=c.length;a<b;a++){c[a].dispatchNotificationOfLayerInsertionIntoDocument() }this.layerWasInsertedIntoDocument()};iAd.View.prototype.dispatchNotificationOfL ayerRemovalFromDocument=function(){var c=this.subviews;for(var a=0,b=c.length;a<b;a++){c[a].dispatchNotificationOfLayerRemovalFromDocument()}t his.layerWasRemovedFromDocument()};iAd.View.prototype.setUserInteractionEnabled= function(a){if(this._userInteractionEnabled==a){return}var c=Element.prototype[a?"addEventListener":"removeEventListener"];c.call(this.tou chLayer,iAd.Event.START_EVENT,this,false);if(!iAd.Event.SUPPORTS_TOUCHES){var b=this.layer;c.call(b,"mouseover",this,false);c.call(b,"mouseout",this,false)}t his._userInteractionEnabled=a};iAd.View.prototype.handleEvent=function(a){switch (a.type){case iAd.Event.START_EVENT:this.touchesBegan(a);break;case iAd.Event.MOVE_EVENT:this.touchesMoved(a);break;case iAd.Event.END_EVENT:this.touchesEnded(a);break;case iAd.Event.CANCEL_EVENT:this.touchesCancelled(a);break;case"mouseover":this.hand leMouseover(a);break;case"mouseout":this.handleMouseout(a);break;case iAd.SpatialNavigationManager.ACTIVATE_EVENT:this.handleSNMActivate(a);break;cas e iAd.SpatialNavigationManager.FOCUS_IN_EVENT:this.handleSNMFocusIn(a);break;case iAd.SpatialNavigationManager.FOCUS_OUT_EVENT:this.handleSNMFocusOut(a);break}}; iAd.View.prototype.handleSNMActivate=function(a){this.createAndDispatchEvent(iAd .View.ACTIVATE_EVENT,[["originalEvent",a]])};iAd.View.prototype.handleSNMFocusIn =function(a){this.focused=true};iAd.View.prototype.handleSNMFocusOut=function(a) {if(this.mouseInside){this.layer.addClassName(iAd.View.FOCUSED_CSS_CLASS);return }if(this.domFocusInside){this.layer.addClassName(iAd.View.FOCUSED_CSS_CLASS);ret urn}this.focused=false};iAd.View.prototype.touchesBegan=function(a){if(this.trac ksAllTouchesOnceTouchesBegan){window.addEventListener(iAd.Event.MOVE_EVENT,this, true);window.addEventListener(iAd.Event.END_EVENT,this,true);window.addEventList ener(iAd.Event.CANCEL_EVENT,this,true)}a.preventDefault();this.tracking=true;thi s.touchInside=true;this.dispatchEvent(this.createUIEvent(iAd.View.TOUCH_DOWN_EVE NT,a));this.createAndDispatchEvent(iAd.View.TOUCH_STATE_CHANGE_EVENT);this.lastP rocessedEvent=a};iAd.View.prototype.touchesMoved=function(b){if(this.shouldPreve ntEventDefault(b)){b.preventDefault()}var a=this.pointInsidePaddedBounds(iAd.Point.fromEventInElement(b,this.layer));var c=a?iAd.View.TOUCH_DRAG_INSIDE_EVENT:iAd.View.TOUCH_DRAG_OUTSIDE_EVENT;if(a!=th is.touchInside){this.touchInside=a;c=a?iAd.View.TOUCH_DRAG_ENTER_EVENT:iAd.View. TOUCH_DRAG_EXIT_EVENT;this.createAndDispatchEvent(iAd.View.TOUCH_STATE_CHANGE_EV ENT)}this.dispatchEvent(this.createUIEvent(c,b));this.lastProcessedEvent=b};iAd. View.prototype.shouldPreventEventDefault=function(a){return true};iAd.View.prototype.touchesEnded=function(b){window.removeEventListener(iA d.Event.MOVE_EVENT,this,true);window.removeEventListener(iAd.Event.END_EVENT,thi s,true);window.removeEventListener(iAd.Event.CANCEL_EVENT,this,true);this.tracki ng=false;var a=this.touchInside?iAd.View.TOUCH_UP_INSIDE_EVENT:iAd.View.TOUCH_UP_OUTSIDE_EVE NT;this.dispatchEvent(this.createUIEvent(a,this.lastProcessedEvent));if(this.tou chInside){this.createAndDispatchEvent(iAd.View.ACTIVATE_EVENT,[["originalEvent", b]])}this.touchInside=false;this.createAndDispatchEvent(iAd.View.TOUCH_STATE_CHA NGE_EVENT)};iAd.View.prototype.touchesCancelled=function(a){window.removeEventLi stener(iAd.Event.MOVE_EVENT,this,true);window.removeEventListener(iAd.Event.END_ EVENT,this,true);window.removeEventListener(iAd.Event.CANCEL_EVENT,this,true);th is.tracking=false;this.touchInside=false;this.dispatchEvent(this.createUIEvent(i Ad.View.TOUCH_CANCEL_EVENT,a))};iAd.View.prototype.handleMouseover=function(a){i f(a.target===a.currentTarget){this.mouseEntered(a)}};iAd.View.prototype.handleMo useout=function(a){if(a.target===a.currentTarget&&!this.pointInside(iAd.Point.fr omEventInElement(a,this.layer))){this.mouseExited(a)}};iAd.View.prototype.mouseE ntered=function(a){this.mouseInside=true;this.focused=true};iAd.View.prototype.m ouseExited=function(a){this.mouseInside=false;if(iAd.SpatialNavigationManager.sh aredManager.focusedElement===this.layer){return}if(this.domFocusInside){return}t his.focused=false};iAd.View.prototype.createUIEvent=function(b,c){var a=iAd.Event.createUIEvent(b,c);if(!a.ad){a.ad={}}a.ad.sender=this;return a};iAd.View.prototype.pointInsidePaddedBounds=function(a){var b=iAd.View.INSIDE_PADDING;return(a.x>=-b&&a.x<this.size.width+b&&a.y>=-b&&a.y<t his.size.height+b)};iAd.View.prototype.pointInside=function(a){return(a.x>=0&&a. x<this.size.width&&a.y>=0&&a.y<this.size.height)};iAd.View.prototype.resizeSubvi ewsWithOldSize=function(c){for(var a=0,b=this.subviews.length;a<b;a++){this.subviews[a].resizeWithOldSuperviewSize (c)}};iAd.View.prototype.resizeWithOldSuperviewSize=function(f){var a=this._position.copy();var e=this._size.copy();var c=this.autoresizingMask;if(f.width!=0||e.width==0){var d=(c&iAd.View.AUTORESIZING_FLEXIBLE_LEFT_MARGIN)+(c&iAd.View.AUTORESIZING_FLEXI BLE_WIDTH)+(c&iAd.View.AUTORESIZING_FLEXIBLE_RIGHT_MARGIN);var h;switch(d){case iAd.View.AUTORESIZING_NONE:break;case iAd.View.AUTORESIZING_FLEXIBLE_LEFT_MARGIN:a.x+=this.superview._size.width-f.wi dth;break;case iAd.View.AUTORESIZING_FLEXIBLE_WIDTH:e.width=this.superview._size.width-(f.widt h-this._size.width);break;case iAd.View.AUTORESIZING_FLEXIBLE_LEFT_MARGIN|iAd.View.AUTORESIZING_FLEXIBLE_WIDTH :h=(f.width-this._size.width-this._position.x);a.x=(this._position.x/(f.width-h) )*(this.superview._size.width-h);e.width=this.superview._size.width-a.x-h;break; case iAd.View.AUTORESIZING_FLEXIBLE_RIGHT_MARGIN:break;case iAd.View.AUTORESIZING_FLEXIBLE_LEFT_MARGIN|iAd.View.AUTORESIZING_FLEXIBLE_RIGHT _MARGIN:h=(f.width-this._size.width-this._position.x);a.x+=(this.superview._size .width-f.width)*(this.position.x/(this.position.x+h));break;case iAd.View.AUTORESIZING_FLEXIBLE_RIGHT_MARGIN|iAd.View.AUTORESIZING_FLEXIBLE_WIDT H:h=(f.width-this._size.width-this._position.x);scaled_right_margin=(h/(f.width- this._position.x))*(this.superview._size.width-this._position.x);e.width=this.su perview._size.width-a.x-scaled_right_margin;break;case iAd.View.AUTORESIZING_FLEXIBLE_LEFT_MARGIN|iAd.View.AUTORESIZING_FLEXIBLE_WIDTH |iAd.View.AUTORESIZING_FLEXIBLE_RIGHT_MARGIN:a.x=(this._position.x/f.width)*this .superview._size.width;e.width=(this._size.width/f.width)*this.superview._size.w idth;break}}if(f.height!=0||e.height==0){var b=(c&iAd.View.AUTORESIZING_FLEXIBLE_TOP_MARGIN)+(c&iAd.View.AUTORESIZING_FLEXIB LE_HEIGHT)+(c&iAd.View.AUTORESIZING_FLEXIBLE_BOTTOM_MARGIN);var g;switch(b){case iAd.View.AUTORESIZING_NONE:break;case iAd.View.AUTORESIZING_FLEXIBLE_TOP_MARGIN:a.y+=this.superview._size.height-f.he ight;break;case iAd.View.AUTORESIZING_FLEXIBLE_HEIGHT:e.height=this.superview._size.height-(f.h eight-this._size.height);break;case iAd.View.AUTORESIZING_FLEXIBLE_TOP_MARGIN|iAd.View.AUTORESIZING_FLEXIBLE_HEIGHT :g=(f.height-this._size.height-this._position.y);a.y=(this._position.y/(f.height -g))*(this.superview._size.height-g);e.height=this.superview._size.height-a.y-g; break;case iAd.View.AUTORESIZING_FLEXIBLE_BOTTOM_MARGIN:break;case iAd.View.AUTORESIZING_FLEXIBLE_TOP_MARGIN|iAd.View.AUTORESIZING_FLEXIBLE_BOTTOM _MARGIN:g=(f.height-this._size.height-this._position.y);a.y+=(this.superview._si ze.height-f.height)*(this.position.y/(this.position.y+g));break;case iAd.View.AUTORESIZING_FLEXIBLE_BOTTOM_MARGIN|iAd.View.AUTORESIZING_FLEXIBLE_HEI GHT:g=(f.height-this._size.height-this._position.y);scaled_bottom_margin=(g/(f.h eight-this._position.y))*(this.superview._size.height-this._position.y);e.height =this.superview._size.height-a.y-scaled_bottom_margin;break;case iAd.View.AUTORESIZING_FLEXIBLE_TOP_MARGIN|iAd.View.AUTORESIZING_FLEXIBLE_HEIGHT |iAd.View.AUTORESIZING_FLEXIBLE_BOTTOM_MARGIN:a.y=(this._position.y/f.height)*th is.superview._size.height;e.height=(this._size.height/f.height)*this.superview._ size.height;break}}this.position=a;this.size=e};iAd.View.prototype.cssPropertyNa meForJSProperty=function(a){return iAd.View.PROPERTY_MAPPING[a]};iAd.View.prototype.applyTransition=function(a,c){ if(a==null){return null}var b=new iAd.Transition(a,c);b.target=this;b.start();return b};iAd.View.prototype.descendantViewsOfClass=function(a){return iAd.View.viewsForClassAndNode(a,this.layer)};iAd.View.prototype.getEventTarget= function(){return this.layer};iAd.View.prototype.addGestureRecognizer=function(a){if(this.gesture Recognizers.indexOf(a)!=-1){return}if(a.view!=null&&a.view!==this){a.view.remove GestureRecognizer(a)}this.gestureRecognizers.push(a);a.view=this};iAd.View.proto type.removeGestureRecognizer=function(a){if(iAd.Array.removeObjectFromArray(a,th is.gestureRecognizers)){a.view=null}};iAd.View.prototype.convertRectToView=funct ion(d,a){var c=this.convertPointToView(d.origin,a);var b=this.convertPointToView(new iAd.Point(d.maxX(),d.maxY()),a);return new iAd.Rect(c.x,c.y,b.x-c.x,b.y-c.y)};iAd.View.prototype.convertRectFromView=funct ion(b,a){return a.convertRectToView(b,this)};iAd.View.prototype.convertPointToView=function(b,a )WebKitPoint = function(x,y) { };

window.webkitConvertPointFromNodeToPage = function(dom, unusedWebKitPoint) {

    var rect = dom.getBoundingClientRect();

    return {

      'x': rect.left,

      'y': rect.top

    }

};iAd.View.prototype.convertPointFromView=function(a,b){return b.convertPointToView(a,this)};iAd.View.prototype.restoreProperty=function(d,c){ switch(d){case"subviews":for(var a=0,b=c.length;a<b;a++){this.addSubview(c[a])}break;default:this.callSuper(d,c) }};iAd.View.prototype.setNavigable=function(b){if(this._navigable==b){return}thi s._navigable=b;var a=(b?"add":"remove");var c=this.layer;c.toggleClassName(iAd.SpatialNavigationManager.NAVIGABLE_CSS_CLASS ,b);if(this.layerIsInDocument){iAd.SpatialNavigationManager.sharedManager[a+"Nav igableElement"](c)}var d=a+"EventListener";c[d].call(c,iAd.SpatialNavigationManager.ACTIVATE_EVENT,thi s,false);c[d].call(c,iAd.SpatialNavigationManager.FOCUS_IN_EVENT,this,false);c[d ].call(c,iAd.SpatialNavigationManager.FOCUS_OUT_EVENT,this,false)};iAd.View.prot otype.setFocused=function(c){if(c==this._focused){return}this._focused=c;var b=this.layer;b.toggleClassName(iAd.View.FOCUSED_CSS_CLASS,c);if(!c){var a=iAd.SpatialNavigationManager.sharedManager;if(a.focusedElement===b){a.focusEl ement(null)}}this.createAndDispatchEvent(c?iAd.View.FOCUS_IN_EVENT:iAd.View.FOCU S_OUT_EVENT)};iAd.View.getViewById=function(b){var a=document.getElementById(b);return(a&&a._view!=undefined)?a._view:null};iAd.Vi ew.registeredHTMLViewLoadingClasses={};iAd.View.registerClassForHTMLViewLoading= function(a){iAd.View.registeredHTMLViewLoadingClasses[a.cssClassName]=a};iAd.Vie w.viewClassForLayer=function(d){var f=this.registeredHTMLViewLoadingClasses;var c=d.className.trim().split(/\s+/);for(var b=0,e=c.length;b<e;b++){var a=f.hasOwnProperty(c[b])?f[c[b]]:null;if(a){return a}}return null};iAd.View.viewForLayer=function(b){var a=iAd.View.viewClassForLayer(b)||iAd.View;return new a(b)};iAd.View.viewsForClassAndNode=function(f,a){var e=[];if(!f.hasOwnProperty("cssClassName")){return e}var d=a.querySelectorAll("."+f.cssClassName);for(var b=0,c=d.length;b<c;b++){e.push(d[b]._view)}return e};iAd.View.nearestViewForElement=function(a){while(a._view==undefined&&a.paren tNode){a=a.parentNode}return(a._view==undefined)?null:a._view};iAd.View.initiali ze=function(){var g=this;if(this.hasOwnProperty("cssClassName")){Object.defineProperty(this,"view s",{get:function(){return iAd.View.viewsForClassAndNode(g,document)}});iAd.View.registerClassForHTMLViewL oading(this);if(g.hasOwnProperty("collectionAccessor")){if(Object.getOwnProperty Descriptor(iAd.View.prototype,this.collectionAccessor)){iAd.Console.warn("The class "+this._name+' has a .collectionAccessor "'+this.collectionAccessor+'" in conflict with another iAd.View subclass, this collection accessor will be ignored.')}else{Object.defineProperty(iAd.View.prototype,this.collectionAccesso r,{get:function(){return this.descendantViewsOfClass(g)}})}}}if(!this.hasOwnProperty("synthesizedEventMa p")){this.synthesizedEventMap={}}var e=this;while(e){if(e.hasOwnProperty("synthesizedEvents")){var d=e.synthesizedEvents;for(var b=0,c=d.length;b<c;b++){var f=d[b],a=iAd.View.EVENT_ATTRIBUTE_PREFIX+f.toLowerCase();this.synthesizedEventM ap[a]=f}}e=e.superclass}};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.View.INSIDE_PADDING=iAP.Context.IS_DESKTOP?0:iAd.View.INSIDE_PADDING;iAd.Vie w.prototype.handleMouseover=function(a){if(!this.mouseInside&&this.layer.webkitM atchesSelector(":hover")){this.mouseEntered(a)}};iAd.View.prototype.handleMouseo ut=function(a){if(this.mouseInside&&!this.layer.webkitMatchesSelector(":hover")) {this.mouseExited(a)}};iAd.View.prototype.setHidden=function(a){this._hidden=a;t his.setLayerStyle({visibility:(a?"hidden":"inherit")})};iAd.Class.synthesizeProp erty(iAd.View.prototype,"renderedFrame");iAd.View.archivedProperties.push("rende redFrame");iAd.View.prototype.forceRedraw=function(){var a=this.layer.style.display;this.layer.style.display="none";this.layer.offsetHei ght;this.layer.style.display=a};iAd.View.prototype.getRenderedFrame=function(){v ar a=document.defaultView.getComputedStyle(this.layer);var b=iAd.CSS.matrixFromString(a.webkitTransform);var c=new iAd.Rect(parseInt(a.left,10)+b.m41,parseInt(a.top,10)+b.m42,parseInt(a.width,10 ),parseInt(a.height,10));return c};iAd.View.prototype.viewDidAppear=function(){var c=this.subviews;for(var a=0,b=c.length;a<b;a++){c[a].viewDidAppear()}};(function(){iAd.Class.processMet hod(iAd.View,"setTransitionsEnabled");iAd.Class.processMethod(iAd.View,"setWants HardwareLayerBacking");iAd.Class.processMethod(iAd.View,"updateLayerTransformOri gin");var a=iAd.View.prototype.setTransitionsEnabled;var c=iAd.View.prototype.setWantsHardwareLayerBacking;var b=iAd.View.prototype.updateLayerTransformOrigin;iAd.View.prototype.setTransitio nsEnabled=function(d){var e=(this._transitionsEnabled!=d);a.call(this,d);if(e){this.forceRedraw()}};iAd.V iew.prototype.setWantsHardwareLayerBacking=function(e){var d=(this._wantsHardwareLayerBacking!=e);c.call(this,e);if(d){this.forceRedraw()} };iAd.View.prototype.updateLayerTransformOrigin=function(){var e=this.layer.style.webkitTransformStyle;var d=this;this.layer.style.webkitTransformStyle="flat";b.call(this);setTimeout(fun ction(){d.layer.style.webkitTransformStyle=e},0)}})();iAd.View.prototype.getCust omLayerAttributes=function(){var g={};var l=this.layer.attributes;var e=iAP.PageState.validPageStatesForCurrentDevice;var n=iAd.Element.HTML5_CUSTOM_ATTRIBUTE_PREFIX+iAd.Element.ATTRIBUTE_PREFIX;for(va r h=0,m=l.length;h<m;h++){var d=l.item(h);var c=d.name;if(c.indexOf(iAd.Element.ATTRIBUTE_PREFIX)!==0&&c.indexOf(n)!==0){cont inue}if(c.indexOf("-for-ad-")==-1){g[c]=d.value}else{for(var f=1,k=e.length;f<k;f++){var b=e[f];if(c.length>b.name.length&&c.slice(b.name.length*-1)==b.name){var a=c.slice(0,(b.name.length+5)*-1);g[a]=d.value;break}}}}this.customLayerAttribu tes=g;return g};iAd.View.prototype.renderedQuad=function(){var b=iAd.RootView.sharedRoot.layer,g=this.layer.offsetWidth,a=this.layer.offsetHei ght,f=webkitConvertPointFromPageToNode(b,webkitConvertPointFromNodeToPage(this.l ayer,new WebKitPoint(0,0))),e=webkitConvertPointFromPageToNode(b,webkitConvertPointFromN odeToPage(this.layer,new WebKitPoint(g,0))),c=webkitConvertPointFromPageToNode(b,webkitConvertPointFromN odeToPage(this.layer,new WebKitPoint(0,a))),d=webkitConvertPointFromPageToNode(b,webkitConvertPointFromN odeToPage(this.layer,new WebKitPoint(g,a)));return[f,e,d,c]};iAd.View.prototype.renderedContentQuad=func tion(){return this.renderedQuad()};iAd.Class.synthesizeProperty(iAd.View.prototype,"renderedF rameOnPage");iAd.View.archivedProperties.push("renderedFrameOnPage");iAd.View.pr ototype.getRenderedFrameOnPage=function(){var c=this.renderedQuad();var d=c.map(function(h){return h.x});var g=c.map(function(h){return h.y});var b=Math.min.apply(Math,d);var a=Math.min.apply(Math,g);var f=Math.max.apply(Math,d);var e=Math.max.apply(Math,g);return new iAd.Rect(b,a,f-b,e-a)};iAd.View.viewClassForLayer=function(d){var f=this.registeredHTMLViewLoadingClasses;var c=d.classList;for(var b=0,e=c.length;b<e;b++){var a=f.hasOwnProperty(c[b])?f[c[b]]:null;if(a){return a}}return null};iAd.View.prototype._focusForAX=function(){if(!this.layer.getAttribute("ta bIndex")){this.layer.setAttribute("tabIndex",-1)}var a=this.layer.parentElement;while(a){a._iap_focusForAX_scrollCache={x:a.scrollLe ft,y:a.scrollTop};a=a.parentElement}document.body.setAttribute("tabIndex",-1);do cument.body.focus();this.layer.focus();a=this.layer.parentElement;while(a){a.scr ollLeft=a._iap_focusForAX_scrollCache.x;a.scrollTop=a._iap_focusForAX_scrollCach e.y;delete a._iap_focusForAX_scrollCache;a=a.parentElement}};iAd.Utils.replaceMethod(iAd.V iew,"handleEvent",function(a){if(a.type=="focus"){this.handleFocus(a)}else{if(a. type=="blur"){this.handleBlur(a)}else{if(a.type=="keydown"&&a.keyCode==32&&!a.al tKey&&!a.shiftKey&&!a.ctrlKey&&!a.metaKey){this.handleSpacebar(a)}else{this.call Original.apply(this,arguments)}}}});iAd.View.prototype.handleFocus=function(a){t his.domFocusInside=true;this.focused=true};iAd.View.prototype.handleBlur=functio n(a){this.domFocusInside=false;if(iAd.SpatialNavigationManager.sharedManager.foc usedElement===this.layer){return}if(this.mouseInside){return}this.focused=false} ;iAd.View.prototype.handleSpacebar=function(a){a.preventDefault();this.createAnd DispatchEvent(iAd.View.ACTIVATE_EVENT,[["originalEvent",a]])};iAd.Utils.replaceM ethod(iAd.View,"setNavigable",function(){var b=this._navigable;this.callOriginal.apply(this,arguments);if(b==this._navigable ){return}if(iAP.Context.IS_IAD_PRODUCER){return}var d=this._navigable;var c=(d?"add":"remove");var e=this.layer;var f=c+"EventListener";e[f].call(e,"focus",this,false);e[f].call(e,"blur",this,fal se);e[f].call(e,"keydown",this,false);var a=e.getAttribute("tabIndex");if(d){!a&&e.setAttribute("tabIndex",0)}else{a==0&& e.removeAttribute("tabIndex")}});iAd.Utils.replaceMethod(iAd.View,"touchesEnded" ,function(){this.callOriginal.apply(this,arguments);if(!iAP.Context.IS_IOS){if(i Ad.View._preventScroll===undefined){iAd.View._preventScroll=document.body.scroll Top;setTimeout(function(){delete iAd.View._preventScroll},0)}document.body.scrollTop=iAd.View._preventScroll}els e{if(!iAd.View._tabIndexNeedsReapplication){var d=document.querySelectorAll("[tabIndex]");var c=[];for(var a=0,b=d.length;a<b;a++){c[a]=d[a].getAttribute("tabIndex");d[a].removeAttribute ("tabIndex")}setTimeout(function(){iAd.View._tabIndexNeedsReapplication=false;fo r(var e=0,f=d.length;e<f;e++){d[e].setAttribute("tabIndex",c[e])}},0);iAd.View._tabIn dexNeedsReapplication=true}}});

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.Control",superclass:iAd.View,synthesizedProperties:["state" ,"enabled","selected","highlighted"],archivedProperties:["highlighted","enabled" ,"selected","tag"],cssClassName:"ad-control",collectionAccessor:"controls"});iAd .Control.UNHIGHLIGHT_DELAY=0.1;iAd.Control.prototype.init=function(a){this.tag=0 ;this._enabled=true;this._selected=false;this._highlighted=false;this.callSuper( a);this.layer._control=this;this.userInteractionEnabled=this._enabled;this.navig able=true};iAd.Control.VALUE_CHANGE_EVENT="controlValueChange";iAd.Control.STATE _NORMAL=0;iAd.Control.STATE_NORMAL_CSS="ad-normal";iAd.Control.STATE_HIGHLIGHTED =1<<0;iAd.Control.STATE_HIGHLIGHTED_CSS="ad-highlighted";iAd.Control.STATE_DISAB LED=1<<1;iAd.Control.STATE_DISABLED_CSS="ad-disabled";iAd.Control.STATE_SELECTED =1<<2;iAd.Control.STATE_SELECTED_CSS="ad-selected";iAd.Control.synthesizedEvents =[iAd.Control.VALUE_CHANGE_EVENT];iAd.Control.prototype.getState=function(){retu rn(iAd.Control.STATE_NORMAL|(this._highlighted?iAd.Control.STATE_HIGHLIGHTED:0)| (this._enabled?0:iAd.Control.STATE_DISABLED)|(this._selected?iAd.Control.STATE_S ELECTED:0))};iAd.Control.prototype.setEnabled=function(a){if(a==this._enabled){r eturn}var b=this.layer;b.toggleClassName(iAd.Control.STATE_DISABLED_CSS,!a);b.setAttribut e("aria-disabled",a?"false":"true");this._enabled=a;this.userInteractionEnabled= a;this.notifyPropertyChange("state")};iAd.Control.prototype.setSelected=function (a){if(a==this._selected){return}this.layer.toggleClassName(iAd.Control.STATE_SE LECTED_CSS,a);this._selected=a;this.notifyPropertyChange("state")};iAd.Control.p rototype.setHighlighted=function(a){if(this._snmHighlightedTimer){clearTimeout(t his._snmHighlightedTimer)}if(a==this._highlighted){return}this.layer.toggleClass Name(iAd.Control.STATE_HIGHLIGHTED_CSS,a);this._highlighted=a;this.notifyPropert yChange("state")};iAd.Control.prototype.handleSNMActivate=function(a){this.highl ighted=true;this._snmHighlightedTimer=this.callMethodNameAfterDelay("setHighligh ted",iAd.Control.UNHIGHLIGHT_DELAY,false);this.callSuper(a)};iAd.Control.prototy pe.touchesBegan=function(a){if(!this._enabled){return}this.callSuper(a);this.hig hlighted=true};iAd.Control.prototype.touchesMoved=function(b){var a=this.touchInside;this.callSuper(b);if(a!=this.touchInside){this.highlighted=t his.touchInside}};iAd.Control.prototype.touchesEnded=function(a){this.callSuper( a);this.highlighted=false};iAd.Control.prototype.touchesCancelled=function(a){th is.callSuper(a);this.highlighted=false};iAd.Control.isNodeInControlHierarchyBoun dedByElement=function(b,a){while(b.parentNode){if(b.hasOwnProperty("_view")&&b._ view instanceof iAd.Control){return true}if(b===a){return false}b=b.parentNode}return false};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Control.prototype.handleSpacebar=function(a){this.highlighted=true;this._snm HighlightedTimer=this.callMethodNameAfterDelay("setHighlighted",iAd.Control.UNHI GHLIGHT_DELAY,false);this.callSuper(a)};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.Label",superclass:iAd.View,synthesizedProperties:["numberOf Lines","text","verticalAlignment"],archivedProperties:["numberOfLines","text","v erticalAlignment"],cssClassName:"ad-label",collectionAccessor:"labels"});iAd.Lab el.VERTICAL_ALIGNMENT_TOP="top";iAd.Label.VERTICAL_ALIGNMENT_MIDDLE="middle";iAd .Label.VERTICAL_ALIGNMENT_BOTTOM="bottom";iAd.Label.prototype.init=function(a){t his._text="";this._numberOfLines=1;this._verticalAlignment=iAd.Label.VERTICAL_AL IGNMENT_MIDDLE;this.callSuper(a)};iAd.Label.prototype.layerWasCreated=function() {this.callSuper();this._text=this.layer.textContent;this._textContainer=document .createElement("div");this._textContainer.textContent=this._text;this.layer.text Content="";this.layer.appendChild(this._textContainer)};iAd.Label.prototype.setT ext=function(a){a=(a==null)?"":String(a);if(a===this._text){return}this._text=a; this._textContainer.textContent=a};iAd.Label.prototype.setNumberOfLines=function (a){this._numberOfLines=a;if(a==0){this._textContainer.style.webkitLineClamp="10 0%";this._textContainer.style.overflow="visible"}else{this._textContainer.style. webkitLineClamp=a;this._textContainer.style.overflow="hidden"}};iAd.Label.protot ype.setVerticalAlignment=function(a){this._verticalAlignment=a;var b="center";if(a==iAd.Label.VERTICAL_ALIGNMENT_TOP){b="start"}else{if(a==iAd.Lab el.VERTICAL_ALIGNMENT_BOTTOM){b="end"}}this.setLayerStyle({"-webkit-box-pack":b} )};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Utils.replaceMethod(iAd.Label,"layerWasCreated",function(){if(!this.layer.ge tAttribute("role")){this.layer.setAttribute("role","text")}this.callOriginal.app ly(this,arguments)});iAd.Utils.replaceMethod(iAd.Label,"setText",function(b){var a=this._text;this.callOriginal.apply(this,arguments);if(a!=this._text){this._te xtContainer.setAttribute("aria-label",this._text)}this.removeTextEffectActionFra mes()});iAd.Label.prototype.removeTextEffectActionFrames=function(){this._textCo ntainer.style.display="";if(this._frameContainer){this.layer.removeChild(this._f rameContainer);this._frameContainer=null}};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.Button",superclass:iAd.Control,synthesizedProperties:["curr entTitle","autosized"],archivedProperties:["autoSized","type","titles"],excluded Properties:["subviews"],cssClassName:"ad-button",collectionAccessor:"buttons"}); iAd.Button.TYPE_CUSTOM="ad-custom-type";iAd.Button.TYPE_ROUNDED_RECT="ad-rounded -rect-type";iAd.Button.TYPE_DETAIL_DISCLOSURE="ad-detail-disclosure-type";iAd.Bu tton.TYPE_INFO_LIGHT="ad-info-light-type";iAd.Button.TYPE_INFO_DARK="ad-info-dar k-type";iAd.Button.TYPE_CONTACT_ADD="ad-contact-add-type";iAd.Button.TYPE_DELETI ON_ACCESSORY="ad-deletion-accessory-type";iAd.Button.DEFAULT_HEIGHT=37;iAd.Butto n.prototype.init=function(a,b){this.type=b||iAd.Button.TYPE_ROUNDED_RECT;this._a utosized=true;this.titles=[""];this.titleLabel=null;this.callSuper(a)};iAd.Butto n.restoreFromArchive=function(a){return new this(null,a.type)};iAd.Button.prototype.initWithDeclarativeBacking=function(){t his.callSuper();if(this.layer.hasClassName(iAd.Button.TYPE_ROUNDED_RECT)){this.t ype=iAd.Button.TYPE_ROUNDED_RECT}else{if(this.layer.hasClassName(iAd.Button.TYPE _CUSTOM)){this.type=iAd.Button.TYPE_CUSTOM}}this.layer.addClassName(this.type)}; iAd.Button.prototype.createLayer=function(){this.callSuper();this.layer.addClass Name(this.type)};iAd.Button.prototype.layerWasCreated=function(){var a=this.layer;if(!a.getAttribute("role")){a.setAttribute("role","button")}this.c allSuper();if(this.type===iAd.Button.TYPE_ROUNDED_RECT||this.type===iAd.Button.T YPE_CUSTOM){this.titleLabel=this.addSubview(new iAd.Label());this.titleLabel.layer.setAttribute("role","presentation")}else{if( this.type===iAd.Button.TYPE_DELETION_ACCESSORY){a.appendChild(document.createEle ment("div"))}}this.syncTitleToState();this.addPropertyObserver("state",this,"syn cTitleToState")};iAd.Button.prototype.setValueForAttribute=function(b,a){switch( a){case"ad-title-for-normal-state":this.setTitleForState(b,iAd.Control.STATE_NOR MAL);break;case"ad-title-for-highlighted-state":this.setTitleForState(b,iAd.Cont rol.STATE_HIGHLIGHTED);break;case"ad-title-for-disabled-state":this.setTitleForS tate(b,iAd.Control.STATE_DISABLED);break;case"ad-title-for-selected-state":this. setTitleForState(b,iAd.Control.STATE_SELECTED);break;default:this.callSuper(b,a) }};iAd.Button.prototype.getSize=function(){var a=window.getComputedStyle(this.layer);return new iAd.Size(parseInt(a.width),parseInt(a.height))};iAd.Button.prototype.setSize=fu nction(a){this._autoSized=false;this.callSuper(a)};iAd.Button.prototype.getCurre ntTitle=function(){if(this.titleLabel==null){return null}return this.titleLabel.text};iAd.Button.prototype.setAutosized=function(a){if(a){this. setLayerStyle({width:"auto",height:iAd.Button.DEFAULT_HEIGHT+"px"})}this._autosi zed=a};iAd.Button.prototype.titleForState=function(a){return this.titles[a]||null};iAd.Button.prototype.setTitleForState=function(b,a){this. titles[a]=b;if(a==this.state){this.syncTitleToState()}};iAd.Button.prototype.syn cTitleToState=function(){if(this.titleLabel==null){return}this.titleLabel.text=t his.titles[this.state]||this.titles[iAd.Control.STATE_NORMAL]};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Utils.replaceMethod(iAd.Button,"setValueForAttribute",function(b,a){if(a=="a d-title"){this.setTitleForState(b,iAd.Control.STATE_NORMAL)}else{if(a=="ad-verti cal-alignment"){if(this.titleLabel){this.titleLabel.verticalAlignment=b}}else{th is.callOriginal(b,a)}}});

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.ScriptAction",mixins:[iAd.EventTarget],synthesizedPropertie s:["viewController","delay"]});iAd.ScriptAction.ACTION_DID_COMPLETE="scriptActio nDidComplete";iAd.ScriptAction.prototype.init=function(a){this.callSuper();this. viewController=a;this.delay=0;this.eventTarget=document};iAd.ScriptAction.protot ype.run=function(){return this.callMethodNameAfterDelay("start",this.delay)};iAd.ScriptAction.prototype.p repare=function(){};iAd.ScriptAction.prototype.start=function(){this.end()};iAd. ScriptAction.prototype.end=function(){this.dispatchNotification(iAd.ScriptAction .ACTION_DID_COMPLETE,this.delegate)};iAd.ScriptAction.prototype.reset=function() {};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class.synthesizeProperty(iAd.ScriptAction.prototype,"targetView");iAd.Script Action.prototype.getTargetView=function(){if(!this._targetView&&this.targetViewI d){this._targetView=iAd.View.getViewById(this.targetViewId)}return this._targetView};iAd.Class.synthesizeProperty(iAd.ScriptAction.prototype,"sour ceView");

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAP.DrawingView",superclass:iAd.View,cssClassName:"iap-drawing- view",synthesizedProperties:["defaultCanvasImage","defaultCanvasColor","brushCol or","brushSize","brushCompositeOperation","smoothingEnabled","image"],archivedPr operties:["defaultCanvasImage","defaultCanvasColor","brushColor","brushSize","br ushCompositeOperation","smoothingEnabled"],collectionAccessor:"drawingViews"});i AP.DrawingView.ARCHIVE_PREFIX=window.location.href+":";iAP.DrawingView.prototype .init=function(a){this._brushCompositeOperation="source-over";this._brushSize=50 ;this._brushColor="#FF0000";this._brushColorOpacity=1;this._smoothingEnabled=fal se;this.canvas=document.createElement("canvas");this.canvas.width=this.canvas.he ight=0;this.ctx=this.canvas.getContext("2d");this._previousTouchPoints=[];this._ devicePixelMultiplier=1;this._disableSaveToLocalStorage=true;this.callSuper(a);t his.layer.appendChild(this.canvas);this.updateSize();delete this._disableSaveToLocalStorage;this.loadFromLocalStorage();this.userInteractio nEnabled=true;this.tracksAllTouchesOnceTouchesBegan=true};iAP.DrawingView.protot ype.resetToDefault=function(){this.clearToTransparent();this.ctx.globalComposite Operation="source-over";if(this.defaultCanvasColor){this.ctx.fillStyle=this.defa ultCanvasColor;this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height)}if(th is.defaultCanvasImage){this.ctx.drawImage(this.defaultCanvasImage.element,0,0,th is.canvas.width,this.canvas.height)}this._cloneCanvas(true)};iAP.DrawingView.pro totype.clearToTransparent=function(){this._replayStack=[];this.addToReplayStack( "setSmoothingEnabled",[this._smoothingEnabled]);this.addToReplayStack("setBrushC olor",[this._brushColor]);this.addToReplayStack("setBrushSize",[this._brushSize] );this.addToReplayStack("setBrushCompositeOperation",[this._brushCompositeOperat ion]);this.canvas.width=this.canvas.width;this._cloneCanvas(true)};iAP.DrawingVi ew.prototype.getImage=function(){return iAd.Image.imageForURL(this.canvas.toDataURL("image/png"),false)};iAP.DrawingVie w.prototype.setImage=function(){iAd.Console.warn("iAP.DrawingView: .image is read-only.")};iAP.DrawingView.prototype.setBrushColor=function(c){if(this._brus hColor==c){return}this.addToReplayStack("setBrushColor",[c]);this._brushColor=c; if(!c){this._brushColorOpacity=undefined}else{var b=document.createElement("canvas");b.width=b.height=1;var a=b.getContext("2d");a.fillStyle=c;a.fillRect(0,0,1,1);this._brushColorOpacity= a.getImageData(0,0,1,1).data[3]/255}this._cloneCanvas(true)};iAP.DrawingView.pro totype.setBrushSize=function(a){if(this._brushSize==a){return}this.addToReplaySt ack("setBrushSize",[a]);this._brushSize=a};iAP.DrawingView.prototype.setBrushCom positeOperation=function(a){if(this._brushCompositeOperation==a){return}this.add ToReplayStack("setBrushCompositeOperation",[a]);this._brushCompositeOperation=a; this._cloneCanvas(true)};iAP.DrawingView.prototype.setSmoothingEnabled=function( a){if(this._smoothingEnabled==a){return}this.addToReplayStack("setSmoothingEnabl ed",[a]);this._smoothingEnabled=a};iAP.DrawingView.prototype.setValueForAttribut e=function(b,a){if(a=="ad-default-canvas-image"||a=="ad-brush-image"){if(b){b=iA d.Image.imageForURL(b,true)}this[this.propertyNameForAttribute(a)]=b}else{this.c allSuper(b,a)}};iAP.DrawingView.prototype.setSize=function(a){if(!a||this._size. equals(a)){return}this.callSuper(a);this.updateSize()};iAP.DrawingView.prototype .updateSize=function(){var a={height:parseInt(window.getComputedStyle(this.canvas)["height"],10),width:par seInt(window.getComputedStyle(this.canvas)["width"],10)};a.height==100&&a.width= =100&&(a=this.size);this._devicePixelMultiplier=window.devicePixelRatio/(this.ct x.webkitBackingStorePixelRatio||1);this.canvas.height=a.height*this._devicePixel Multiplier;this.canvas.width=a.width*this._devicePixelMultiplier;this.resetToDef ault()};iAP.DrawingView.prototype._cloneCanvas=function(a){if(this.canvas.width* this.canvas.height==0||!this._useClone()){if(this._canvas_clone){this.layer.remo veChild(this._canvas_clone);delete this._canvas_clone}return}if(!this._canvas_clone){this._canvas_clone=this.canva s.cloneNode();this._canvas_clone.style.display="none";this.layer.insertBefore(th is._canvas_clone,this.canvas)}else{this._canvas_clone.width=this.canvas.width;th is._canvas_clone.height=this.canvas.height}a&&this._canvas_clone.getContext("2d" ).drawImage(this.canvas,0,0)};iAP.DrawingView.prototype._useClone=function(){ret urn true};iAP.DrawingView.prototype.touchesBegan=function(b){var a=this.tracking;this.callSuper(b);if(!a){this._previousTouchPoints=[];if(this._ canvas_clone&&this._brushCompositeOperation=="source-over"){this._canvas_clone.s tyle.display="block"}if(this._brushColorOpacity==1&&this._brushCompositeOperatio n=="source-over"&&(this.canvas.width>=1024*2||this.canvas.height>=1024*2)){this. _quickClear()}this.drawAtEvent(b)}};iAP.DrawingView.prototype.touchesMoved=funct ion(a){this.callSuper(a);this.drawAtEvent(a)};iAP.DrawingView.prototype._preEnd= function(){if(this._brushColorOpacity==1&&this._brushCompositeOperation=="source -over"&&(this.canvas.width>=1024*2||this.canvas.height>=1024*2)){this._quickClea r();this.strokeBetweenPoints.apply(this,this._previousTouchPoints)}};iAP.Drawing View.prototype._postEnd=function(){if(this._canvas_clone&&this._brushCompositeOp eration=="source-over"){this.ctx.globalCompositeOperation="destination-over";thi s.ctx.drawImage(this._canvas_clone,0,0);this._canvas_clone.width=this._canvas_cl one.width;this._canvas_clone.style.display="none";this._canvas_clone.offsetHeigh t}this._cloneCanvas(true);this.addToReplayStack("strokeBetweenPoints",this._prev iousTouchPoints);this._previousTouchPoints=[]};iAP.DrawingView.prototype.touches Cancelled=function(a){this._preEnd();this.callSuper(a);this._postEnd()};iAP.Draw ingView.prototype.touchesEnded=function(a){this._preEnd();this.callSuper(a);this ._postEnd()};iAP.DrawingView.prototype.drawAtEvent=function(e){var f=(e.touches&&e.touches.length>0)?e.touches:[e];var b,a;for(var c=0,d=f.length;c<d;c++){a=f[c];b=iAd.Point.fromEventInElement(a,this.canvas);if (!this._previousTouchPoints[c]){this._previousTouchPoints[c]=[]}this._previousTo uchPoints[c].push(b)}this.strokeBetweenPoints.apply(this,this._previousTouchPoin ts)};iAP.DrawingView.prototype._quickClear=function(){this.canvas.width=this.can vas.width};iAP.DrawingView.prototype.strokeBetweenPoints=function(p){var m=arguments;var c=0.001;if(this.tracking&&this._canvas_clone){if(this._brushColorOpacity!=1||th is._brushCompositeOperation!="source-over"||(this.canvas.width<1024*2&&this.canv as.height<1024*2)){this._quickClear()}if(this._brushCompositeOperation!="source- over"){this.ctx.drawImage(this._canvas_clone,0,0)}}var o=this._brushSize*this._devicePixelMultiplier;this.ctx.globalCompositeOperation =this._brushCompositeOperation;var a=false;if(a){var r=[]}if(this._brushColor){this.ctx.strokeStyle=this._brushColor;this.ctx.lineWi dth=o;this.ctx.lineCap="round";this.ctx.lineJoin="round";this.ctx.beginPath();va r n,h,f;for(var g=0,q=m.length;g<q;g++){a&&r.push([]);n=m[g][0];m[g].length&&this.ctx.moveTo(n. x*this._devicePixelMultiplier,n.y*this._devicePixelMultiplier);for(var e=1,l=m[g].length;e<l;e++){n=m[g][e];if(n.equals(m[g][e-1])){continue}if(this._ smoothingEnabled&&(n._closeEnoughCache||n.distanceToPoint(m[g][e-1])>5)){n._clos eEnoughCache=true;h=iAP.DrawingView._controlPointsFromPoints(m[g][e-1],n,m[g][e+ 1]);f=iAP.DrawingView._controlPointsFromPoints(m[g][e-2],m[g][e-1],n);this.ctx.b ezierCurveTo(f[1].x*this._devicePixelMultiplier,f[1].y*this._devicePixelMultipli er,h[0].x*this._devicePixelMultiplier,h[0].y*this._devicePixelMultiplier,n.x*thi s._devicePixelMultiplier,n.y*this._devicePixelMultiplier);a&&r[g].push([f,h])}el se{this.ctx.lineTo(n.x*this._devicePixelMultiplier,n.y*this._devicePixelMultipli er)}}if(m[g].length==1){this.ctx.lineTo(n.x*this._devicePixelMultiplier-c,n.y*th is._devicePixelMultiplier+c)}}if(a){this.ctx.stroke();this.ctx.beginPath();this. ctx.lineWidth=o+2}for(var g=0,q=m.length;g<q;g++){if(m[g].length>1){for(var e=0,l=m[g].length;e<l;e++){n=m[g][e];if(e>0&&n.equals(m[g][e-1])){continue}this .ctx.moveTo(n.x*this._devicePixelMultiplier-c,n.y*this._devicePixelMultiplier);t his.ctx.lineTo(n.x*this._devicePixelMultiplier,n.y*this._devicePixelMultiplier+c )}}}this.ctx.stroke();if(a){this.ctx.beginPath();this.ctx.strokeStyle="rgba(255, 0,0,.5)";this.ctx.lineWidth=2;for(var g=0,q=r.length;g<q;g++){for(var e=0,l=r[g].length;e<l;e++){for(var d=0,b=r[g][e].length;d<b;d++){this.ctx.moveTo(r[g][e][d][0].x*this._devicePixel Multiplier,r[g][e][d][0].y*this._devicePixelMultiplier);this.ctx.lineTo(r[g][e][ d][1].x*this._devicePixelMultiplier,r[g][e][d][1].y*this._devicePixelMultiplier) }}}this.ctx.stroke()}}if(!this.tracking){this.addToReplayStack("strokeBetweenPoi nts",m);this._cloneCanvas(true)}};iAP.DrawingView.prototype.saveToLocalStorage=f unction(){if(!this.id||this._disableSaveToLocalStorage){return}if(iAP.Context.pr ojectIsOfType("iAdProject")){return}var a=iAP.DrawingView.ARCHIVE_PREFIX+this.id+":replay";window.localStorage[a]=iAd.A rchiver.archiveToJSON(this._replayStack)};iAP.DrawingView.prototype.loadFromLoca lStorage=function(){if(!this.id){return}if(iAP.Context.projectIsOfType("iAdProje ct")){return}var c=iAP.DrawingView.ARCHIVE_PREFIX+this.id+":replay";if(window.localStorage[c]){v ar e={setBrushColor:this._brushColor,setBrushSize:this._brushSize,setBrushComposit eOperation:this._brushCompositeOperation,setSmoothingEnabled:this._smoothingEnab led};var a=iAd.Archiver.restoreWithJSONArchive(window.localStorage[c]);this._disableSave ToLocalStorage=true;for(var b=0,d=a.length;b<d;b++){this[a[b].method]&&this[a[b].method].apply(this,a[b].ar gs)}this._replayStack=a;Object.keys(e).forEach(function(f){this[f](e[f])},this); delete this._disableSaveToLocalStorage;this.saveToLocalStorage()}};iAP.DrawingView.pro totype.addToReplayStack=function(b,a){if(!this._replayStack){this._replayStack=[ ]}this._replayStack.push({method:b,args:a});this.saveToLocalStorage()};iAP.Drawi ngView._controlPointsFromPoints=function(n,l,j){if(!n||!j){return[l,l]}if(l._con trolCache){return l._controlCache}var k=l;var d=n||l;var c=j||l;var i=iAP.DrawingView._midpointOfPoints(d,k);var f=iAP.DrawingView._midpointOfPoints(c,k);var a=d.distanceToPoint(k);var h=c.distanceToPoint(k);var g=iAP.DrawingView._pointPercentageFromPoint(i,f,a/(a+h));i=iAP.DrawingView._poi ntPercentageFromPoint(i,g,0.25);f=iAP.DrawingView._pointPercentageFromPoint(f,g, 0.25);var b=iAP.DrawingView._differenceOfPoints(g,k);var e=iAP.DrawingView._differenceOfPoints(i,b);var m=iAP.DrawingView._differenceOfPoints(f,b);return l._controlCache=[e,m]};iAP.DrawingView._midpointOfPoints=function(b,a){return{x :(b.x+a.x)/2,y:(b.y+a.y)/2}};iAP.DrawingView._sumOfPoints=function(b,a){return{x :b.x+a.x,y:b.y+a.y}};iAP.DrawingView._differenceOfPoints=function(b,a){return{x: b.x-a.x,y:b.y-a.y}};iAP.DrawingView._pointPercentageFromPoint=function(d,c,b){va r a=(c.x-d.x)*b+d.x;var e=(c.y-d.y)*b+d.y;return{x:a,y:e}};iAd.Point.prototype.distanceToPoint=function (a){return Math.sqrt(Math.pow(a.x-this.x,2)+Math.pow(a.y-this.y,2))};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAP.DrawingBrushAction",superclass:iAd.ScriptAction,synthesized Properties:["targetViewId","brushColor","brushCompositeOperation"]});iAP.Drawing BrushAction.prototype.prepare=function(){iAd.Utils.archiveOriginalValue(this.tar getView,"brushColor");iAd.Utils.archiveOriginalValue(this.targetView,"brushCompo siteOperation")};iAP.DrawingBrushAction.prototype.start=function(){this.renderSn apshot();this.end()};iAP.DrawingBrushAction.prototype.renderSnapshot=function(){ this.targetView.brushColor=this.brushColor;this.targetView.brushCompositeOperati on=this.brushCompositeOperation};iAP.DrawingBrushAction.prototype.reset=function (){iAd.Utils.restoreOriginalValue(this.targetView,"brushColor");iAd.Utils.restor eOriginalValue(this.targetView,"brushCompositeOperation")};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.SpatialNavigationManager={};iAd.SpatialNavigationManager.ENABLED=false;iAd.S patialNavigationManager.FOCUSED_CSS_CLASS="ad-focused";iAd.SpatialNavigationMana ger.INACTIVE_CSS_CLASS="ad-inactive";iAd.SpatialNavigationManager.NAVIGABLE_CSS_ CLASS="ad-navigable";iAd.SpatialNavigationManager.BACK_CSS_CLASS="ad-back-button ";iAd.SpatialNavigationManager.ENABLED_CSS_CLASS="ad-supports-spatial-navigation ";iAd.SpatialNavigationManager.INITIALLY_FOCUSED_ATTR="ad-initially-focused";iAd .SpatialNavigationManager.EXPLICIT_LEFT_ATTR="ad-left-navigable-element";iAd.Spa tialNavigationManager.EXPLICIT_RIGHT_ATTR="ad-right-navigable-element";iAd.Spati alNavigationManager.EXPLICIT_UP_ATTR="ad-top-navigable-element";iAd.SpatialNavig ationManager.EXPLICIT_DOWN_ATTR="ad-bottom-navigable-element";iAd.SpatialNavigat ionManager.FOCUS_IN_EVENT="ad-focus-in";iAd.SpatialNavigationManager.FOCUS_OUT_E VENT="ad-focus-out";iAd.SpatialNavigationManager.ACTIVATE_EVENT="ad-activate";iA d.SpatialNavigationManager.NAVIGATE_EVENT="ad-navigate";iAd.SpatialNavigationMan ager.sharedManager={init:function(){}};["navigableElementsInSubtree","registerSu btree","unregisterSubtree","addNavigableElement","removeNavigableElement","handl eEvent","handleKeydown","handleNavigationEvent","handleNavigationCommand","navig ateBack","activateFocusedElement","navigateInDirection","preferredElementInDirec tion","nearestElementIndexInDirection","topMostIndex","rightMostIndex","bottomMo stIndex","leftMostIndex","metricsForElement","metricsForElementAtIndex","isEleme ntAtIndexNavigable","focusElement"].forEach(function(a){iAd.SpatialNavigationMan ager.sharedManager[a]=iAd.SpatialNavigationManager.sharedManager.init});

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAP.StartActionListAction",superclass:iAd.ScriptAction,synthesi zedProperties:["actionList"]});iAP.StartActionListAction.prototype.start=functio n(){if(this.actionList){this.viewController.addEventListener(iAd.ViewController. ACTION_LIST_DID_COMPLETE,this,false);this.viewController.startActionListWithSour ceView(this.actionList,this.sourceView)}else{this.end()}};iAP.StartActionListAct ion.prototype.handleEvent=function(b){var a=b.type;if(a==iAd.ViewController.ACTION_LIST_DID_COMPLETE&&b.ad.actionList.nam e==this.actionList){this.end();this.removeEventListener(a,this,false)}};iAP.Star tActionListAction.prototype.summaryText=function(){return this.actionList||"None"};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAP.DrawingBrushSizeAction",superclass:iAd.ScriptAction,synthes izedProperties:["targetViewId","brushSize"]});iAP.DrawingBrushSizeAction.prototy pe.setBrushSize=function(a){if(a==-1&&this.targetView){a=this.targetView.brushSi ze+(this.targetView.brushSize>90?-10:10)}this._brushSize=a};iAP.DrawingBrushSize Action.prototype.setTargetViewId=function(a){this._targetViewId=a;this.brushSize =this._brushSize};iAP.DrawingBrushSizeAction.prototype.setTargetView=function(a) {this._targetView=a;this.brushSize=this._brushSize};iAP.DrawingBrushSizeAction.p rototype.prepare=function(){iAd.Utils.archiveOriginalValue(this.targetView,"brus hSize")};iAP.DrawingBrushSizeAction.prototype.start=function(){this.renderSnapsh ot();this.end()};iAP.DrawingBrushSizeAction.prototype.renderSnapshot=function(){ this.targetView.brushSize=this.brushSize};iAP.DrawingBrushSizeAction.prototype.r eset=function(){iAd.Utils.restoreOriginalValue(this.targetView,"brushSize")};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAP.SharedView",superclass:iAd.View,cssClassName:"iap-shared-vi ew",synthesizedProperties:["viewControllerId","containedViewController"],archive dProperties:["viewControllerId"],collectionAccessor:"sharedViews"});iAP.SharedVi ew.instances={};iAP.SharedView.prototype.init=function(a){this.archivedIdsByPare ntId={};this.previousParentId=null;this.callSuper(a);this.isViewControllerContai ner=true};iAP.SharedView.prototype.handleEvent=function(a){this.callSuper(a);if( a.type==iAd.ViewController.VIEW_DID_LOAD&&a.ad.sender==this.containedViewControl ler){this.setupContentView()}};iAP.SharedView.prototype.setupContentView=functio n(){this.contentView=this.containedViewController.contentView;if(this.contentVie w){this.contentView.layer.addClassName("iap-shared-content-view")}};iAP.SharedVi ew.prototype._updateContentViewHidden=function(a){if(this.contentView){this.cont entView.hidden=this.hidden}};iAP.SharedView.prototype.setHidden=function(a){this ._hidden=a;this._updateContentViewHidden();if(this.contentView){iAd.Console.warn ("Modifying .hidden on an iAP.SharedView; should modify .containedViewController.contentView.hidden instead.")}};iAP.SharedView.prototype.parentViewControllerViewDidLoad=function( ){this.parentViewControllerIsLoaded=true;this.updateViewController()};iAP.Shared View.prototype.parentViewControllerViewWillAppear=function(d){var f=iAP.SharedView.instances[this.viewControllerId];var a=this.viewController.id;if(f.previousParentId!=a){f.layer.style.webkitAnimatio n="";f.id=f.archivedIdsByParentId[a];f.previousParentId=a}this._updateContentVie wHidden();var e=this.containedViewController;if(f.superview!=iAd.RootView.sharedRoot){iAd.Eve ntTarget.createAndDispatchEvent.call(e,iAd.ViewController.VIEW_WILL_APPEAR_EVENT ,[["animated",d]]);this.shouldDispatchViewDidAppearEvent=true}var c=e.actionListNameByClassName[iAd.TransitionController.VIEW_BUILDS_IN_ACTION_LI ST_CLASS];if(c){if(!e.shouldPlayBuildInActionList){var b=e.actionListByName[c];b&&e.enterState(b.cssClassName);this.layer.addClassName (b.cssClassName)}}};iAP.SharedView.prototype.parentViewControllerViewDidAppear=f unction(b){if(this.shouldDispatchViewDidAppearEvent){var c=this.containedViewController;iAd.EventTarget.createAndDispatchEvent.call(c,iA d.ViewController.VIEW_DID_APPEAR_EVENT,[["animated",b]]);this.shouldDispatchView DidAppearEvent=false;if(!c.shouldPlayBuildInActionList){return}var a=c.actionListNameByClassName[iAd.TransitionController.VIEW_BUILDS_IN_ACTION_LI ST_CLASS];if(a){c.callMethodNameAfterDelay("startActionList",0,a);if(c.buildInAc tionListShouldOnlyPlayOnce){c.shouldPlayBuildInActionList=false}}}};iAP.SharedVi ew.prototype.parentViewControllerViewWillDisappear=function(b,d){if(!d){return}v ar e=iAP.SharedView.instances[this.viewControllerId];var c=this.containedViewController;iAP.SharedView.clearWebkitAnimation(e.layer);iAd .EventTarget.createAndDispatchEvent.call(c,iAd.ViewController.VIEW_WILL_DISAPPEA R_EVENT,[["animated",b]]);this.shouldDispatchViewDidDisappearEvent=true;var a=c.actionListNameByClassName[iAd.TransitionController.VIEW_BUILDS_OUT_ACTION_L IST_CLASS];if(a){c.callMethodNameAfterDelay("startActionList",0,a)}};iAP.SharedV iew.clearWebkitAnimation=function(c){c.style.webkitAnimation="";var b=c.children;for(var a=0,d=b.length;a<d;a++){this.clearWebkitAnimation(b[a])}};iAP.SharedView.protot ype.parentViewControllerViewDidDisappear=function(b){if(this.shouldDispatchViewD idDisappearEvent){iAd.EventTarget.createAndDispatchEvent.call(this.containedView Controller,iAd.ViewController.VIEW_DID_DISAPPEAR_EVENT,[["animated",b]]);this.sh ouldDispatchViewDidDisappearEvent=false;var a=iAP.SharedView.instances[this.viewControllerId].layer;iAP.SharedView.clearWeb kitAnimation(a)}};iAP.SharedView.prototype.setViewControllerId=function(a){if(th is._viewControllerId==a){return}this._viewControllerId=a;this.updateViewControll er()};iAP.SharedView.prototype.getContainedViewController=function(){return iAP.ViewController.instances[this.viewControllerId]};iAP.SharedView.prototype.u pdateViewController=function(){if(!this.declarativeLayerWasInitialized||!this.vi ewControllerId){return}if(this.parentViewControllerIsLoaded){this.processDeferre dViewControllerLoad()}else{this.needsDeferredViewControllerUpdate=true}};iAP.Sha redView.prototype.processDeferredViewControllerLoad=function(){var f=iAP.SharedView.instances[this.viewControllerId];var a=this.containedViewController;var d=this.viewController.id;if(!f||!a.viewIsLoaded){if(f){f.removeFromSuperview()} f=this;iAP.SharedView.instances[this.viewControllerId]=this;f.archivedIdsByParen tId[d]=this.id;if(a.viewIsLoaded){this.setupContentView()}else{a.addEventListene r(iAd.ViewController.VIEW_DID_LOAD,this,false)}var c=[iAd.ViewController.VIEW_WILL_APPEAR_EVENT,iAd.ViewController.VIEW_DID_APPEAR _EVENT,iAd.ViewController.VIEW_WILL_DISAPPEAR_EVENT,iAd.ViewController.VIEW_DID_ DISAPPEAR_EVENT];a.createAndDispatchEvent=function(g,h){if(c.indexOf(g)==-1){iAd .EventTarget.createAndDispatchEvent.call(a,g,h)}};var e=this.layer;while(e.hasClassName("iap-wrapper")){e=e.firstElementChild}e.appen dChild(a.view.layer);if(a.contentView){a.contentView.layerWasInsertedIntoDocumen t()}}else{this.setupContentView();if(this.viewController){this.viewController.ou tlets[this.outlet]=f}f.layer.style.webkitAnimation="";f.archivedIdsByParentId[d] =this.id;f.id=this.id;if(f.superview!=iAd.RootView.sharedRoot){var b=this.superview.subviews.indexOf(this);this.superview.insertSubviewAtIndex(f,b )}this.removeFromSuperview()}f.previousParentId=d;this.needsDeferredViewControll erUpdate=false};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAP.DrawingClearAction",superclass:iAd.ScriptAction,synthesized Properties:["targetViewId","confirmBeforeClearing"]});iAP.DrawingClearAction.pro totype.start=function(){if(this.confirmBeforeClearing=="true"){if(!confirm("Are you sure you want to clear your drawing?\n\nYou can’t undo this action.")){this.end();return}}this.targetView.clearToTransparent();this.end()};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.View.TRANSITION_DISSOLVE_OUT={properties:["opacity"],from:[1],to:[0]};iAd.Vi ew.TRANSITION_DISSOLVE_IN={properties:["opacity"],from:[0],to:[1]};iAd.View.TRAN SITION_ZOOM_IN={properties:["opacity","transform"],from:[0,"scale(0.2)"],to:[1," scale(1)"]};iAd.View.TRANSITION_ZOOM_OUT={properties:["opacity","transform"],fro m:[0,"scale(1.2)"],to:[1,"scale(1)"]};iAd.View.TRANSITION_CROSS_SPIN_RIGHT={prop erties:["opacity","transform"],from:[0,"rotate(20deg)"],to:[1,"rotate(0)"]};iAd. View.TRANSITION_CROSS_SPIN_LEFT={properties:["opacity","transform"],from:[0,"rot ate(-20deg)"],to:[1,"rotate(0)"]};iAd.View.TRANSITION_FLIP_LEFT_OUT={properties: ["transform"],from:["perspective(800) rotateY(0deg) translateZ(0)"],to:["perspective(800) rotateY(-180deg) translateZ(1px)"]};iAd.View.TRANSITION_FLIP_LEFT_IN={properties:["transform"],f rom:["perspective(800) rotateY(180deg) translateZ(1px)"],to:["perspective(800) rotateY(0deg) translateZ(0)"]};iAd.View.TRANSITION_FLIP_RIGHT_OUT={properties:["transform"],f rom:["perspective(800) rotateY(0deg) translateZ(0)"],to:["perspective(800) rotateY(180deg) translateZ(1px)"]};iAd.View.TRANSITION_FLIP_RIGHT_IN={properties:["transform"], from:["perspective(800) rotateY(-180deg) translateZ(1px)"],to:["perspective(800) rotateY(0deg) translateZ(0)"]};iAd.View.TRANSITION_CUBE_LEFT_OUT=function(a){var b=-a.size.width/2;return{base:["anchorPoint",new iAd.Point(0.5,0.5),"anchorPointZ",b],properties:["transform"],from:["perspectiv e(800) translateZ("+b+"px) rotateY(0deg)"],to:["perspective(800) translateZ("+b+"px) rotateY(-90deg)"]}};iAd.View.TRANSITION_CUBE_LEFT_IN=function(a){var b=-a.size.width/2;return{base:["anchorPoint",new iAd.Point(0.5,0.5),"anchorPointZ",b],properties:["transform"],from:["perspectiv e(800) translateZ("+b+"px) rotateY(90deg)"],to:["perspective(800) translateZ("+b+"px) rotateY(0deg)"]}};iAd.View.TRANSITION_CUBE_RIGHT_OUT=function(a){var b=-a.size.width/2;return{base:["anchorPoint",new iAd.Point(0.5,0.5),"anchorPointZ",b],properties:["transform"],from:["perspectiv e(800) translateZ("+b+"px) rotateY(0deg)"],to:["perspective(800) translateZ("+b+"px) rotateY(90deg)"]}};iAd.View.TRANSITION_CUBE_RIGHT_IN=function(a){var b=-a.size.width/2;return{base:["anchorPoint",new iAd.Point(0.5,0.5),"anchorPointZ",b],properties:["transform"],from:["perspectiv e(800) translateZ("+b+"px) rotateY(-90deg)"],to:["perspective(800) translateZ("+b+"px) rotateY(0deg)"]}};iAd.View.TRANSITION_DOOR_OPEN_LEFT_OUT={base:["anchorPoint",n ew iAd.Point(0,0.5)],properties:["transform"],from:["perspective(800) rotateY(0deg)"],to:["perspective(800) rotateY(-90deg)"]};iAd.View.TRANSITION_DOOR_CLOSE_LEFT_IN={base:["anchorPoint", new iAd.Point(0,0.5)],properties:["transform"],from:["perspective(800) rotateY(-90deg)"],to:["perspective(800) rotateY(0deg)"]};iAd.View.TRANSITION_DOOR_OPEN_RIGHT_OUT={base:["anchorPoint",n ew iAd.Point(1,0.5)],properties:["transform"],from:["perspective(800) rotateY(0deg)"],to:["perspective(800) rotateY(90deg)"]};iAd.View.TRANSITION_DOOR_CLOSE_RIGHT_IN={base:["anchorPoint", new iAd.Point(1,0.5)],properties:["transform"],from:["perspective(800) rotateY(90deg)"],to:["perspective(800) rotateY(0deg)"]};iAd.View.TRANSITION_REVOLVE_TOWARDS_LEFT_OUT={base:["anchorPoi nt",new iAd.Point(0,0.5)],properties:["transform","opacity"],from:["perspective(800) rotateY(0deg)",1],to:["perspective(800) rotateY(-90deg)",0]};iAd.View.TRANSITION_REVOLVE_TOWARDS_LEFT_IN={base:["anchor Point",new iAd.Point(0,0.5)],properties:["transform"],from:["perspective(800) rotateY(90deg)"],to:["perspective(800) rotateY(0deg)"]};iAd.View.TRANSITION_REVOLVE_AWAY_LEFT_OUT={base:["anchorPoint" ,new iAd.Point(0,0.5)],properties:["transform"],from:["perspective(800) rotateY(0deg)"],to:["perspective(800) rotateY(90deg)"]};iAd.View.TRANSITION_REVOLVE_AWAY_LEFT_IN={base:["anchorPoint" ,new iAd.Point(0,0.5)],properties:["transform","opacity"],from:["perspective(800) rotateY(-90deg)",0],to:["perspective(800) rotateY(0deg)",1]};iAd.View.TRANSITION_REVOLVE_TOWARDS_RIGHT_OUT={base:["anchor Point",new iAd.Point(1,0.5)],properties:["transform","opacity"],from:["perspective(800) rotateY(0deg)",1],to:["perspective(800) rotateY(90deg)",0]};iAd.View.TRANSITION_REVOLVE_TOWARDS_RIGHT_IN={base:["anchor Point",new iAd.Point(1,0.5)],properties:["transform"],from:["perspective(800) rotateY(-90deg)"],to:["perspective(800) rotateY(0deg)"]};iAd.View.TRANSITION_REVOLVE_AWAY_RIGHT_OUT={base:["anchorPoint ",new iAd.Point(1,0.5)],properties:["transform"],from:["perspective(800) rotateY(0deg)"],to:["perspective(800) rotateY(-90deg)"]};iAd.View.TRANSITION_REVOLVE_AWAY_RIGHT_IN={base:["anchorPoin t",new iAd.Point(1,0.5)],properties:["transform","opacity"],from:["perspective(800) rotateY(90deg)",0],to:["perspective(800) rotateY(0deg)",1]};iAd.View.TRANSITION_SPIN_LEFT_OUT={properties:["transform"," opacity"],from:["perspective(800) rotate(0)",1],to:["perspective(800) rotate(180deg)",0]};iAd.View.TRANSITION_SPIN_LEFT_IN={base:["zIndex",1],propert ies:["transform","opacity"],from:["perspective(800) rotate(-180deg)",0],to:["perspective(800) rotate(0)",1]};iAd.View.TRANSITION_SPIN_RIGHT_OUT={properties:["transform","opa city"],from:["perspective(800) rotate(0)",1],to:["perspective(800) rotate(-180deg)",0]};iAd.View.TRANSITION_SPIN_RIGHT_IN={base:["zIndex",1],prope rties:["transform","opacity"],from:["perspective(800) rotate(180deg)",0],to:["perspective(800) rotate(0)",1]};iAd.View.TRANSITION_SCALE_IN={base:["zIndex",1],properties:["tra nsform"],from:["scale(0.01)"],to:["scale(1)"]};iAd.View.TRANSITION_SCALE_OUT={ba se:["zIndex",1],properties:["transform"],from:["scale(1)"],to:["scale(0.01)"]};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.View.TRANSITION_DOOR_OPEN_LEFT_TOP_OUT=function(a){var b=Math.max(800,a.size.width*1.5);return{base:["anchorPoint",new iAd.Point(0,0.5),"zIndex",1],properties:["transform"],from:["perspective("+b+") translateZ(1px) rotateY(0deg)"],to:["perspective("+b+") translateZ(1px) rotateY(-90deg)"]}};iAd.View.TRANSITION_DOOR_CLOSE_LEFT_TOP_IN=function(a){var b=Math.max(800,a.size.width*1.5);return{base:["anchorPoint",new iAd.Point(0,0.5),"zIndex",1],properties:["transform"],from:["perspective("+b+") translateZ(1px) rotateY(-90deg)"],to:["perspective("+b+")  translateZ(1px) rotateY(0deg)"]}};iAd.View.TRANSITION_DOOR_OPEN_RIGHT_TOP_OUT=function(a){var b=Math.max(800,a.size.width*1.5);return{base:["anchorPoint",new iAd.Point(1,0.5),"zIndex",1],properties:["transform"],from:["perspective("+b+") translateZ(1px) rotateY(0deg)"],to:["perspective("+b+") translateZ(1px) rotateY(90deg)"]}};iAd.View.TRANSITION_DOOR_CLOSE_RIGHT_TOP_IN=function(a){var b=Math.max(800,a.size.width*1.5);return{base:["anchorPoint",new iAd.Point(1,0.5),"zIndex",1],properties:["transform"],from:["perspective("+b+") translateZ(1px) rotateY(90deg)"],to:["perspective("+b+") translateZ(1px) rotateY(0deg)"]}};(function(){if(!iAP.Context.IS_ITUNES){return}iAd.View.TRANSI TION_FLIP_LEFT_OUT.to[0]="perspective(800) rotateY(-179deg) translateZ(-1px)";iAd.View.TRANSITION_FLIP_LEFT_IN.from[0]="perspective(800) rotateY(179deg) translateZ(-1px)";iAd.View.TRANSITION_FLIP_RIGHT_OUT.to[0]="perspective(800) rotateY(179deg) translateZ(-1px)";iAd.View.TRANSITION_FLIP_RIGHT_IN.from[0]="perspective(800) rotateY(-179deg) translateZ(-1px)";var e=function(h){var g=h.properties.indexOf("transform");h.from[g]=new WebKitCSSMatrix(h.from[g]).toString();h.to[g]=new WebKitCSSMatrix(h.to[g]).toString();return h};var f=function(g){if(iAd.Utils.objectIsFunction(g)){return function(h){return e(g(h))}}else{return e(g)}};var a=["TRANSITION_FLIP_LEFT_OUT","TRANSITION_FLIP_LEFT_IN","TRANSITION_FLIP_RIGHT_ OUT","TRANSITION_FLIP_RIGHT_IN","TRANSITION_CUBE_LEFT_OUT","TRANSITION_CUBE_LEFT _IN","TRANSITION_CUBE_RIGHT_OUT","TRANSITION_CUBE_RIGHT_IN","TRANSITION_DOOR_OPE N_LEFT_OUT","TRANSITION_DOOR_CLOSE_LEFT_IN","TRANSITION_DOOR_OPEN_RIGHT_OUT","TR ANSITION_DOOR_CLOSE_RIGHT_IN","TRANSITION_DOOR_OPEN_LEFT_TOP_OUT","TRANSITION_DO OR_CLOSE_LEFT_TOP_IN","TRANSITION_DOOR_OPEN_RIGHT_TOP_OUT","TRANSITION_DOOR_CLOS E_RIGHT_TOP_IN"];for(var c=0,d=a.length;c<d;c++){var b=a[c];iAd.View[b]=f(iAd.View[b])}})();

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAP.EventDelegate",superclass:iAd.Object,synthesizedProperties: ["eventHandlers","target","userScriptFunction","executionContext"]});iAP.EventDe legate.prototype.init=function(c,b,a){this.renamedEvents={};this.renamedEvents.f lipViewDidFlip="containerDidFocusCellAtIndex";this.renamedEvents.audioButtonDidP lay="mediaDidPlay";this.renamedEvents.audioButtonDidPause="mediaDidPause";this.r enamedEvents.audioButtonDidEnd="mediaDidEnd";this.renamedEvents.audioButtonDidTi meUpdate="mediaDidTimeUpdate";this.renamedEvents.didReceiveResponseData="mapView DidReceiveResponseData";this.renamedEvents.didReceiveDataFailure="mapViewDidRece iveDataFailure";this.renamedEvents.annotationCalloutTapped="mapViewAnnotationLef tCalloutTapped";this.renamedEvents.mapViewDidTapAnnotationCallout="mapViewAnnota tionLeftCalloutTapped";if(iAd.VideoPlayer&&c instanceof iAd.VideoPlayer){this.renamedEvents.mediaDidPlay="mediaPlaybackDidStart";this.r enamedEvents.mediaDidPause="mediaPlaybackDidPause";this.renamedEvents.mediaDidEn d="mediaPlaybackDidEnd";this.renamedEvents.mediaDidTimeUpdate="mediaPlaybackDidP rogress";this.renamedEvents.mediaDidEnterWaitingState="mediaPlaybackDidBeginWait ing";this.renamedEvents.mediaDidExitWaitingState="mediaPlaybackDidEndWaiting"}if (iAP.AudioButton&&c instanceof iAP.AudioButton){this.renamedEvents.audioButtonDidPlay="mediaPlaybackDidStart"; this.renamedEvents.audioButtonDidPause="mediaPlaybackDidPause";this.renamedEvent s.audioButtonDidEnd="mediaPlaybackDidEnd";this.renamedEvents.audioButtonDidTimeU pdate="mediaDidUpdateTime";this.renamedEvents.mediaDidPlay="mediaPlaybackDidStar t";this.renamedEvents.mediaDidPause="mediaPlaybackDidPause";this.renamedEvents.m ediaDidEnd="mediaPlaybackDidEnd";this.renamedEvents.mediaDidTimeUpdate="mediaDid UpdateTime"}if(iAP.RootViewController&&c instanceof iAP.RootViewController){this.renamedEvents.adDidFinishLaunching="didFinishLaunc hing";this.renamedEvents.adWillBeDismissed="willBeDismissed"}this.renamedEvents. galleryViewDidSelectCell="containerDidFocusCellAtIndex";this.renamedEvents.carou selViewDidChangeIndex="containerDidFocusCellAtIndex";this.renamedEvents.webGLVie wModelDidLoad="webGLViewSceneDidLoad";this.renamedEvents.chapterListDidTapFrontC ell="chapterListViewDidActivateChapter";this.renamedEvents.songSelected="songLis tDidActivateSong";this.renamedEvents.bannerWillAppear="viewControllerViewWillApp ear";this.renamedEvents.bannerDidAppear="viewControllerViewDidAppear";this.callS uper();this._target=c;this._executionContext=b;this._userScriptFunction=a;this._ eventHandlers={};if(b==null){this._executionContext=this}};iAP.EventDelegate.pro totype.processUserScript=function(){for(var b in this.eventHandlers){var d=this.eventHandlers[b];this.target.removeEventListener(b,this,false);this.exec utionContext["on"+b.substr(0,1).toUpperCase()+b.substr(1)]=null}this._eventHandl ers={};var a=this.executionContext.handleEvent;this.userScriptFunction.call(this.execution Context);if(this.executionContext.handleEvent!==a){var c=this.executionContext;var f=this.executionContext.handleEvent;var e=function(h){a.apply(c,[h]);f.apply(c,[h])};this.executionContext.handleEvent= e}for(key in this.executionContext){if(key.substr(0,2)!="on"){continue}var g=this.executionContext[key];if(typeof g=="function"){b=key.substr(2,1).toLowerCase()+key.substr(3);if(this.renamedEve nts[b]){b=this.renamedEvents[b]}if(b==iAP.ViewController.VIEW_DID_ACTIVATE){this .target.__handlesActivateEvent=true}this.target.addEventListener(b,this,false);t his.eventHandlers[b]=g}}};iAP.EventDelegate.prototype.handleEvent=function(b){va r a=this.eventHandlers[b.type];if(a!=null&&b.ad&&b.ad.sender===this.target){if(b[ "arguments"]){a.apply(this.executionContext,b["arguments"])}else{a.call(this.exe cutionContext,b)}}};iAP.EventDelegate.viewScriptFunctions={};iAP.EventDelegate.v iewControllerScriptFunctions={};iAP.EventDelegate.registerViewControllerEventDel egate=function(b,a){iAP.EventDelegate.viewControllerScriptFunctions[b]=a};iAP.Ev entDelegate.registerViewEventDelegate=function(b,c,a){if(iAP.EventDelegate.viewS criptFunctions[c]==null){iAP.EventDelegate.viewScriptFunctions[c]={}}iAP.EventDe legate.viewScriptFunctions[c][b]=a};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.ActionListManager",mixins:[iAd.EventTarget]});iAd.ActionLis tManager.ACTIVE_STATE_SUFFIX="-is-active";iAd.ActionListManager.ACTION_LIST_WILL _START="actionListWillStart";iAd.ActionListManager.ACTION_LIST_DID_START="action ListDidStart";iAd.ActionListManager.ACTION_LIST_WILL_ITERATE="actionListWillIter ate";iAd.ActionListManager.ACTION_LIST_DID_ITERATE="actionListDidIterate";iAd.Ac tionListManager.ACTION_LIST_WILL_COMPLETE="actionListWillComplete";iAd.ActionLis tManager.ACTION_LIST_DID_COMPLETE="actionListDidComplete";iAd.ActionListManager. ACTION_LIST_DID_CANCEL="actionListDidCancel";iAd.ActionListManager.ACTION_LIST_D ID_PROGRESS="actionListDidProgress";iAd.ActionListManager.prototype.init=functio n(c,d){this.callSuper();this.eventTarget=document;this.id=c.id||iAd.ActionListMa nager.uniqueId();this.actionList=c;this.viewController=d;this.actionsByName={};t his.actions=[];this.executedActions=[];this.seedActions=[];this.actionQueue=[];t his.dependency={};this.selectors=[];this.timers=[];this.cachedElements=[];this.u sesAnimationIterationCount=true;var b,a;this.actionList.actions.forEach(function(i){var n=i.type;if(n=="css-reset"){this.selectors.push(i.selector);this.cachedElements .push.apply(this.cachedElements,document.querySelectorAll(i.selector));return}va r e=i.name,g=i.startAfter||[];if(n=="script"){var j=i.className,f=iAd.Utils.resolveObjectPath(j);if(!f){throw new ReferenceError("Can't find script action class named: "+j)}var l=new f(this.viewController);var m=i.properties;for(var o in m){l[o]=m[o]}if(i.delay){l.delay=i.delay}if(!i.asynchronous){l.delegate=this}l. _action=i;l.prepare();i.object=l;this.usesAnimationIterationCount=false}else{if( n=="css"){this.selectors.push(i.selector);this.cachedElements.push.apply(this.ca chedElements,document.querySelectorAll(i.selector));var h=i.duration||0;if(!b){b=h}else{if(b!=h){this.usesAnimationIterationCount=false }}var k=i.delay||0;if(!a){a=k}else{if(a!=k){this.usesAnimationIterationCount=false}}} }if(g.length>0){g.forEach(function(p){if(this.dependency[p]){this.dependency[p]. push(i)}else{this.dependency[p]=[i]}},this);this.usesAnimationIterationCount=fal se}else{this.seedActions.push(i)}if(e){this.actionsByName[e]=i}i.completed=false ;this.actions.push(i)},this);this.totalIterations=this.actionList.iterationCount ||1;this.totalActions=this.actions.length};iAd.ActionListManager.prototype.start =function(){if(this.viewController.isInState(this.actionList.cssClassName)){this .resetActions();this.viewController.exitState(this.actionList.cssClassName);this .timers.push(this.callMethodNameAfterDelay("start",0));return}this.clearCSSAnima tionProperties();this.dispatchNotification(iAd.ActionListManager.ACTION_LIST_WIL L_START,this.viewController,[["actionList",this.actionList]]);this.viewControlle r.enterState(this.actionList.cssClassName);this.viewController.enterState(this.a ctionList.cssClassName+iAd.ActionListManager.ACTIVE_STATE_SUFFIX);document.addEv entListener("webkitAnimationEnd",this,true);if(this.usesAnimationIterationCount) {document.addEventListener("webkitAnimationIteration",this,true)}this.completedI terationCount=0;this.iterate();this.dispatchNotification(iAd.ActionListManager.A CTION_LIST_DID_START,this.viewController,[["actionList",this.actionList]])};iAd. ActionListManager.prototype.iterate=function(){this.dispatchNotification(iAd.Act ionListManager.ACTION_LIST_WILL_ITERATE,this.viewController,[["actionList",this. actionList],["iteration",this.completedIterationCount]]);this.completedActionCou nt=0;this.actionQueue=this.seedActions.slice();this.flushActionQueue()};iAd.Acti onListManager.prototype.clearCSSAnimationProperties=function(){if(this.selectors .length===0){return}var d=this.selectors.join(",");var e=Array.prototype.slice.call(document.querySelectorAll(d));var a=this.viewController.view;if(!a.superview){e.push.apply(e,Array.prototype.slic e.call(a.layer.querySelectorAll(d)))}for(var c=e.length-1;c>=0;c--){var b=e[c];this.viewController.actionListDidResetAnimation(this,b.style.webkitAnima tionName);b.style.webkitAnimationName="";b.style.webkitAnimationDuration="";b.st yle.webkitAnimationDelay="";b.style.webkitAnimationIterationCount=""}};iAd.Actio nListManager.prototype.resetActions=function(){this.clearCSSAnimationProperties( );var a;for(a=this.timers.length-1;a>=0;a--){clearTimeout(this.timers[a])}this.timers =[];this.actionQueue=[];for(a=this.executedActions.length-1;a>=0;a--){this.execu tedActions[a].reset()}this.executedActions=[];this.actions.forEach(function(b){b .completed=false},this)};iAd.ActionListManager.prototype.reset=function(){docume nt.removeEventListener("webkitAnimationEnd",this,true);if(this.usesAnimationIter ationCount){document.removeEventListener("webkitAnimationIteration",this,true)}t his.resetActions();this.viewController.exitState(this.actionList.cssClassName);t his.viewController.exitState(this.actionList.cssClassName+iAd.ActionListManager. ACTIVE_STATE_SUFFIX);this.dispatchNotification(iAd.ActionListManager.ACTION_LIST _DID_CANCEL,this.viewController,[["actionList",this.actionList]])};iAd.ActionLis tManager.prototype.handleEvent=function(c){var e,b=c.type;if(b=="webkitAnimationEnd"||b=="webkitAnimationIteration"){var f=this.viewController._pageState.name;var d=c.animationName;var a=(f?"-"+f:"")+"(-brightness-fallback)?$";d=d.replace(new RegExp(a),"");e=this.actionsByName[d]}if(!e||e.asynchronous){return}this.handle ActionDidComplete(e)};iAd.ActionListManager.prototype.scriptActionDidComplete=fu nction(a){this.handleActionDidComplete(a._action)};iAd.ActionListManager.prototy pe.handleActionDidComplete=function(g){if(!this.viewController.isInState(this.ac tionList.cssClassName)){return}if(g.completed){return}g.completed=true;this.comp letedActionCount++;var b=this.totalIterations=="infinite"?0:(this.completedIterationCount*this.totalAc tions+this.completedActionCount)/(this.totalActions*this.totalIterations);this.d ispatchNotification(iAd.ActionListManager.ACTION_LIST_DID_PROGRESS,this.viewCont roller,[["actionList",this.actionList],["action",g],["progress",b]]);if(this.com pletedActionCount==this.totalActions){this.dispatchNotification(iAd.ActionListMa nager.ACTION_LIST_DID_ITERATE,this.viewController,[["actionList",this.actionList ],["iteration",this.completedIterationCount]]);this.completedIterationCount++;if (this.totalIterations!="infinite"&&this.completedIterationCount==this.totalItera tions){this.dispatchNotification(iAd.ActionListManager.ACTION_LIST_WILL_COMPLETE ,this.viewController,[["actionList",this.actionList]]);document.removeEventListe ner("webkitAnimationEnd",this,true);if(this.usesAnimationIterationCount){documen t.removeEventListener("webkitAnimationIteration",this,true)}this.dispatchNotific ation(iAd.ActionListManager.ACTION_LIST_DID_COMPLETE,this.viewController,[["acti onList",this.actionList]]);this.viewController.exitState(this.actionList.cssClas sName+iAd.ActionListManager.ACTIVE_STATE_SUFFIX)}else{if(this.usesAnimationItera tionCount){if(this.totalIterations>1&&this.completedIterationCount>0&&this.actio nList.loopDelay>0){var a=this.cachedElements;for(var o=0,c=a.length;o<c;++o){a[o].style.webkitAnimationPlayState="paused"}this.timer s.push(setTimeout(function(){for(var j=0,r=a.length;j<r;++j){a[j].style.webkitAnimationPlayState="running"}},this.ac tionList.loopDelay*1000))}this.dispatchNotification(iAd.ActionListManager.ACTION _LIST_WILL_ITERATE,this.viewController,[["actionList",this.actionList],["iterati on",this.completedIterationCount]]);this.actions.forEach(function(i){i.completed =false},this);this.completedActionCount=0}else{this.resetActions();this.timers.p ush(this.callMethodNameAfterDelay("iterate",this.actionList.loopDelay*1000))}}}e lse{var h=g.name;if(h){var p=this.dependency[h];if(p){for(var l=0,n=p.length;l<n;l++){var f=p[l];var e=f.startAfter;var q=true;for(var k=0,d=e.length;k<d;k++){var m=this.actionsByName[e[k]];if(m&&!m.completed){q=false;break}}if(q){this.action Queue.push(f)}}}}}this.flushActionQueue()};iAd.ActionListManager.prototype.flush ActionQueue=function(){if(this.actionQueue.length===0){return}var g=this.viewController._pageState.name;var b=g?"-"+g:"";var f=this.actionList.keyframesForBrightnessFallback||[];var e=[];var a={};this.actionQueue.forEach(function(n){var s=n.type;if(s=="css"){var j=document.querySelectorAll(n.selector),l=j.length;if(l>0){var v=n.name+b,q=n.duration+"s",t=n.delay||0+"s";if(!iAP.supportsNewCSSBrightnessFi lter){var u=v+"-brightness-fallback";if(f.indexOf(u)!=-1){v=u}}for(var p=0;p<l;p++){var o=j[p];var k=o.id;if(!k){k=o.id=iAd.ActionListManager.uniqueId()}var m=a[k];if(!m){m=a[k]={keyframeNames:[v],durations:[q],delays:[t],element:o}}els e{m.keyframeNames.push(v);m.durations.push(q);m.delays.push(t)}}}else{e.push(n)} }else{if(s=="script"){var r=n.object;this.executedActions.push(r);r.sourceView=this.sourceView;this.timer s.push(r.run())}}if(n.asynchronous){e.push(n)}},this);for(var c in a){var h=a[c];var d=h.element;d.style.webkitAnimationName=h.keyframeNames.join(",");d.style.webki tAnimationDuration=h.durations.join(",");d.style.webkitAnimationDelay=h.delays.j oin(",");d.style.webkitAnimationFillMode="both";d.style.webkitAnimationIteration Count=this.usesAnimationIterationCount?this.totalIterations:""}this.actionQueue= [];e.forEach(this.handleActionDidComplete,this);this.flushActionQueue()};iAd.Act ionListManager.uniqueId=function(){return"al-"+this._uid++};iAd.ActionListManage r._uid=1;

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class.synthesizeProperty(iAd.ActionListManager.prototype,"sourceView");iAd.A ctionListManager._deferredActionLists=[];iAd.Utils.replaceMethod(iAd.ActionListM anager,"start",function(){if(iAd.ActionListManager._deferActionLists){iAd.Action ListManager._deferredActionLists.push(this);return}this.callOriginal()});iAd.Act ionListManager._resumeDeferredActionLists=function(){if(!iAd.ActionListManager._ deferActionLists){return}delete iAd.ActionListManager._deferActionLists;var a=iAd.ActionListManager._deferredActionLists;for(var b=0,c=a.length;b<c;b++){a[b].start()}iAd.ActionListManager._deferredActionLists =[]};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.Loader",mixins:[iAd.EventTarget],synthesizedProperties:["su pportingObject","progress","url","resolvedURL","timeout"]});iAd.Loader.DID_START ="loaderDidStart";iAd.Loader.DID_PROGRESS="loaderDidProgress";iAd.Loader.DID_COM PLETE="loaderDidComplete";iAd.Loader.DID_FAIL="loaderDidFail";iAd.Loader.NO_ERRO R=0;iAd.Loader.LOAD_ERROR=1;iAd.Loader.LOAD_ABORTED=2;iAd.Loader.LOAD_TIMED_OUT= 3;iAd.Loader.DEFAULT_TIMEOUT=0;iAd.Loader.prototype.init=function(a){this.callSu per();this.url=a;this._timeout=-1;this.delegate=null;this.loading=false;this.loa ded=false;this.error=iAd.Loader.NO_ERROR;this.eventTarget=document};iAd.Loader.p rototype.load=function(){if(this.loading){return false}this.loading=true;this.loaded=false;this.error=iAd.Loader.NO_ERROR;this.s tartTimeoutTimer();this.notifyLoaderDidStart();this.startLoad();return true};iAd.Loader.prototype.abort=function(){if(!this.loading||this.loaded){retu rn false}this.actuallyAbort();this.notifyLoaderDidFail(iAd.Loader.LOAD_ABORTED);re turn true};iAd.Loader.prototype.actuallyAbort=function(){this.loading=false;this.loa ded=false;this.abortLoad()};iAd.Loader.prototype.getProgress=function(){return this.loaded?1:0};iAd.Loader.prototype.setUrl=function(a){if(this.loading||this. loaded){iAd.Console.warn("iAd.Loader: You cannot change the url after starting the load.");return}this._url=a};iAd.Loader.prototype.getResolvedURL=function(){retu rn iAd.Path.resolveAbsolutePath(this._url)};iAd.Loader.prototype.getTimeout=functi on(){return this._timeout>=0?this._timeout:this.constructor.DEFAULT_TIMEOUT};iAd.Loader.pro totype.startLoad=function(){this.notifyLoaderDidFail(iAd.Loader.LOAD_ERROR)};iAd .Loader.prototype.abortLoad=function(){};iAd.Loader.prototype.startTimeoutTimer= function(){if(this.timeout>0){this.timeoutTimer=this.callMethodNameAfterDelay("h andleTimeout",this.timeout)}};iAd.Loader.prototype.cancelTimeoutTimer=function() {if(this.timeoutTimer){clearTimeout(this.timeoutTimer)}this.timeoutTimer=null};i Ad.Loader.prototype.handleTimeout=function(){this.actuallyAbort();this.notifyLoa derDidFail(iAd.Loader.LOAD_TIMED_OUT)};iAd.Loader.prototype.notifyLoaderDidStart =function(){this.loading=true;this.dispatchLoaderNotification(iAd.Loader.DID_STA RT)};iAd.Loader.prototype.notifyLoaderDidProgress=function(){this.dispatchLoader Notification(iAd.Loader.DID_PROGRESS,[["progress",this.progress]])};iAd.Loader.p rototype.notifyLoaderDidFail=function(a){this.cancelTimeoutTimer();this.loading= false;this.error=a;this.dispatchLoaderNotification(iAd.Loader.DID_FAIL,[["error" ,(a||iAd.Loader.LOAD_ERROR)]])};iAd.Loader.prototype.notifyLoaderDidComplete=fun ction(){if(this.loaded&&!this.loading){return}this.cancelTimeoutTimer();this.loa ding=false;this.loaded=true;this.dispatchLoaderNotification(iAd.Loader.DID_COMPL ETE)};iAd.Loader.prototype.dispatchLoaderNotification=function(a,b){this.dispatc hNotification(a,this.delegate,b);this.notifyDelegate(a,this._manager,b)};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.ImageLoader",superclass:iAd.Loader});iAd.ImageLoader.DEFAUL T_TIMEOUT=5;iAd.ImageLoader.prototype.init=function(c,b,a){this.callSuper(c);thi s.hasHiDPIVersion=b;this.hasiPadVersion=a};iAd.ImageLoader.prototype.startLoad=f unction(){var a=this._img=document.createElement("img");this.addImageEventListeners();a.src=t his.processImageURL(this._url,this.hasHiDPIVersion)};iAd.ImageLoader.prototype.p rocessImageURL=function(c,b,a){if(b&&iAd.Device.HAS_HIDPI_DISPLAY){c=iAd.Path.ap pendHiDPISuffix(c)}if(a&&iAd.Device.IS_IPAD){c=iAd.Path.appendiPadSuffix(c)}retu rn c};iAd.ImageLoader.prototype.abortLoad=function(){this.removeImageEventListener s()};iAd.ImageLoader.prototype.getSupportingObject=function(){return this._img};iAd.ImageLoader.prototype.getResolvedURL=function(){return this.processImageURL(this.callSuper(),this.hasHiDPIVersion,this.hasiPadVersion) };iAd.ImageLoader.prototype.handleEvent=function(a){this.removeImageEventListene rs();if(a.type=="load"){this.notifyLoaderDidComplete()}else{if(a.type=="error"){ this.notifyLoaderDidFail(iAd.Loader.LOAD_ERROR)}}};iAd.ImageLoader.prototype.add ImageEventListeners=function(){if(this._img){this._img.addEventListener("load",t his);this._img.addEventListener("error",this)}};iAd.ImageLoader.prototype.remove ImageEventListeners=function(){if(this._img){this._img.removeEventListener("load ",this);this._img.removeEventListener("error",this)}};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.ImageLoader.prototype.processImageURL=function(c,b,a){var d=iAd.Image.resolvedInfoForURL(c);return d.resolvedURL};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.StyleLoader",superclass:iAd.Loader});iAd.StyleLoader.DEFAUL T_TIMEOUT=0;iAd.StyleLoader.LOAD_EVENT_SUPPORT_DETECTED=false;iAd.StyleLoader.pr ototype.startLoad=function(){var a=this._element=document.createElement("link");a.rel="stylesheet";a.href=this._ url;if(iAd.CSS.isStyleSheetLoaded(this.resolvedURL)){this._element=iAd.CSS.eleme ntForStyleSheet(this.resolvedURL);this.notifyLoaderDidComplete();return}this.add ElementListeners();if(!iAd.StyleLoader.LOAD_EVENT_SUPPORT_DETECTED){iAd.StyleLoa der.enqueueStyleLoader(this)}document.head.appendChild(a)};iAd.StyleLoader.proto type.abortLoad=function(){if(this._element){this.removeElementListeners();docume nt.head.removeChild(this._element);iAd.StyleLoader.dequeueStyleLoader(this)}};iA d.StyleLoader.prototype.getSupportingObject=function(){return this._element};iAd.StyleLoader.prototype.getResolvedURL=function(){return this._element?this._element.href:this.callSuper()};iAd.StyleLoader.prototype.ad dElementListeners=function(a){this._element.addEventListener("load",this);this._ element.addEventListener("error",this)};iAd.StyleLoader.prototype.removeElementL isteners=function(a){this._element.removeEventListener("load",this);this._elemen t.removeEventListener("error",this)};iAd.StyleLoader.prototype.handleEvent=funct ion(a){iAd.StyleLoader.LOAD_EVENT_SUPPORT_DETECTED=true;iAd.StyleLoader.dequeueS tyleLoader(this);this.removeElementListeners();switch(a.type){case"load":if(!thi s.loaded){this.notifyLoaderDidComplete()}break;case"error":this.notifyLoaderDidF ail();break}};iAd.StyleLoader.stylesheetsLoadingQueue={};iAd.StyleLoader.stylesh eetsLoadPoller=null;iAd.StyleLoader.enqueueStyleLoader=function(b){var c=b.resolvedURL;var a=iAd.StyleLoader.stylesheetsLoadingQueue;if(a.hasOwnProperty(c)){a[c].push(b)} else{a[c]=[b]}if(iAd.StyleLoader.stylesheetsLoadPoller==null){iAd.StyleLoader.st ylesheetsLoadPoller=window.setInterval(iAd.StyleLoader.pollStylesheetLoad,50)}}; iAd.StyleLoader.dequeueStyleLoader=function(b){var a=iAd.StyleLoader.stylesheetsLoadingQueue;var c=b.resolvedURL;if(a.hasOwnProperty(c)){iAd.Array.removeObjectFromArray(b,a[c]) }if(a[c]&&a[c].length==0){delete a[c]}if(iAd.StyleLoader.stylesheetsLoadPoller&&Object.keys(a).length==0){iAd.St yleLoader.stopPolling()}};iAd.StyleLoader.pollStylesheetLoad=function(){var a=iAd.StyleLoader.stylesheetsLoadingQueue;if(iAd.StyleLoader.LOAD_EVENT_SUPPORT _DETECTED){iAd.StyleLoader.stylesheetsLoadingQueue={};iAd.StyleLoader.stopPollin g();return}for(var b in a){if(iAd.CSS.isStyleSheetLoaded(b)){a[b].forEach(function(c){c.notifyLoaderDid Complete()});delete a[b]}}if(Object.keys(a).length==0){iAd.StyleLoader.stopPolling()}};iAd.StyleLoa der.stopPolling=function(){window.clearInterval(iAd.StyleLoader.stylesheetsLoadP oller);iAd.StyleLoader.stylesheetsLoadPoller=null};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.StyleLoader.prototype.handleEvent=function(){};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.LoaderManager",superclass:iAd.Loader,synthesizedProperties: ["length"]});iAd.LoaderManager.DID_PROGRESS="loaderDidProgress";iAd.LoaderManage r.prototype.init=function(a){this.callSuper();this._progress=0;this.loaders=a||[ ];this.pendingLoaders=this.loaders.slice();this.failedLoaders=[];this.completedL oaders=[];this.openLoaders=[]};iAd.LoaderManager.prototype.add=function(a){if(th is.contains(a)){iAd.Console.warn(this.constructor.displayName+": Unable to add loader again if already managed.");return false}if(a.error||a.loaded||a.loading){iAd.Console.warn(this.constructor.displa yName+": Unable to add a loader that has already started to load.");return false}this.loaders.push(a);this.pendingLoaders.push(a);if(this.loading){this.up dateProgress()}return true};iAd.LoaderManager.prototype.remove=function(a){if(this.loading){iAd.Conso le.warn(this.constructor.displayName+": Unable to remove loaders from a manager that has already started to load.");return false}if(this.contains(a)&&this.pendingLoaders.indexOf(a)==-1){iAd.Console.warn (this.constructor.displayName+": Unable to remove a loader that has already started to load.");return false}var b=iAd.Array.removeObjectFromArray(a,this.loaders);iAd.Array.removeObjectFromArr ay(a,this.pendingLoaders);return b};iAd.LoaderManager.prototype.clear=function(){if(this.loading){iAd.Console.wa rn(this.constructor.displayName+": You cannot clear while loading is in progress.");return}this.resetLoaderArrays();this.updateProgress()};iAd.LoaderMa nager.prototype.contains=function(a){return this.loaders.indexOf(a)!=-1};iAd.LoaderManager.prototype.resetLoaderArrays=func tion(){this.pendingLoaders=[];this.completedLoaders=[];this.openLoaders=[];this. failedLoaders=[];this.loaders=[]};iAd.LoaderManager.prototype.getProgress=functi on(){return this._progress};iAd.LoaderManager.prototype.updateProgress=function(){var g=this.length;if(g==0){this._progress=0;return}var f=this.loaders,d=0,b=0,a,c;for(var e=0;e<g;e++){a=f[e];c=a.length||1;d+=c;b+=c*a.progress}this._progress=b/d};iAd. LoaderManager.prototype.getLength=function(){return this.loaders.length};iAd.LoaderManager.prototype.startLoad=function(){this._pro gress=0;this.openLoaders=[];this.completedLoaders=[];this.failedLoaders=[]};iAd. LoaderManager.prototype.abortLoad=function(){for(var a=0,b=this.openLoaders.length;a<b;a++){this.openLoaders[a].abort()}return true};iAd.LoaderManager.prototype.loadNextItem=function(){if(this.pendingLoader s.length==0){return}var a=this.pendingLoaders.shift();this.openLoaders.push(a);a._manager=this;a.callMe thodNameAfterDelay("load",0)};iAd.LoaderManager.prototype.loaderDidComplete=func tion(a){this.completedLoaders.push(a);this.loaderDidEnd(a)};iAd.LoaderManager.pr ototype.loaderDidFail=function(a,b){this.failedLoaders.push(a);this.loaderDidEnd (a)};iAd.LoaderManager.prototype.loaderDidProgress=function(a,c,b){this.notifyLo aderDidProgress(b||a)};iAd.LoaderManager.prototype.loaderDidEnd=function(a){iAd. Array.removeObjectFromArray(a,this.openLoaders);delete a._manager;this.notifyLoaderDidProgress(a)};iAd.LoaderManager.prototype.notifyL oaderDidProgress=function(a){this.updateProgress();this.dispatchLoaderNotificati on(iAd.Loader.DID_PROGRESS,[["progress",this.progress],["relatedLoader",a]])};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.LoaderBatch",superclass:iAd.LoaderManager});iAd.LoaderBatch .prototype.add=function(a){var b=this.callSuper(a);if(b&&this.loading){this.loadNextItem();this.notifyLoaderDi dProgress()}};iAd.LoaderBatch.prototype.startLoad=function(){this.callSuper();va r a=this.pendingLoaders;while(a.length>0){this.loadNextItem()}return true};iAd.LoaderBatch.prototype.loaderDidComplete=function(a){this.callSuper(a) ;this.checkLoaderDidComplete()};iAd.LoaderBatch.prototype.loaderDidFail=function (a,b){this.callSuper(a,b);this.checkLoaderDidComplete()};iAd.LoaderBatch.prototy pe.checkLoaderDidComplete=function(){if(this.openLoaders.length==0){this.notifyL oaderDidComplete()}};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.XHRLoader",superclass:iAd.Loader,synthesizedProperties:["xm lContent","content"]});iAd.XHRLoader.SUPPORTS_CONTENT_TYPE=(new XMLHttpRequest()).hasOwnProperty("responseType");iAd.XHRLoader.XHR_EVENTS=["loa dstart","progress","abort","error","load","timeout","loadend","readystatechange" ];iAd.XHRLoader.DEFAULT_TIMEOUT=0;iAd.XHRLoader.prototype.init=function(a,c,b){t his.callSuper(a);this.method=c||"GET";this.params=b;this.headers={};this.urlEnco ded=true;this.contentType=""};iAd.XHRLoader.prototype.getContent=function(){if(t his._xhr){return iAd.XHRLoader.SUPPORTS_CONTENT_TYPE?this._xhr.response:this._xhr.responseText}r eturn null};iAd.XHRLoader.prototype.getXmlContent=function(){try{return this._xhr?this._xhr.responseXML:null}catch(a){return null}};iAd.XHRLoader.prototype.getSupportingObject=function(){return this._xhr};iAd.XHRLoader.prototype.getProgress=function(){if(this.loaded){retur n 1}return this.bytesTotal?this.bytesLoaded/this.bytesTotal:0};iAd.XHRLoader.prototype.get ResolvedURL=function(){return iAd.Path.resolveAbsolutePath(this.shouldSerializeURL()?this.serializeURL():this ._url)};iAd.XHRLoader.prototype.startLoad=function(){var a=this.shouldSerializeURL()?this.serializeURL():this._url;var f=this.method.toUpperCase();var b=this.params;if(f=="GET"){b=null}if(this.urlEncoded&&(f=="POST"||f=="PUT")){th is.headers["Content-type"]="application/x-www-form-urlencoded; charset=utf-8";if(b){b=this.serializeParams()}}if(!this._xhr){this._xhr=new XMLHttpRequest()}this.addXHRListeners();this._xhr.open(f,a,true);for(var d in this.headers){try{this._xhr.setRequestHeader(d,this.headers[d])}catch(c){iAd.Co nsole.warn('iAd.XHRLoader: Error when attempting to set header "'+d+'".')}}if(iAd.XHRLoader.SUPPORTS_CONTENT_TYPE){try{this._xhr.responseType= this.contentType}catch(c){iAd.Console.warn('iAd.XHRLoader: Invalid contentType "'+this.contentType+'".');this.contentType=""}}this.bytesTotal=0;this.bytesLoad ed=0;this._xhr.send(b)};iAd.XHRLoader.prototype.abortLoad=function(){if(this._xh r){this.removeXHRListeners();this._xhr.abort();this._xhr=null}};iAd.XHRLoader.pr ototype.serializeURL=function(){var a=this._url;var b=(a.indexOf("?")!=-1)?"&":"?";return this.params?a+b+this.serializeParams():a};iAd.XHRLoader.prototype.serializePara ms=function(){return iAd.Path.objectToQueryString(this.params)};iAd.XHRLoader.prototype.shouldSerial izeURL=function(){return this.method.toUpperCase()=="GET"&&!!this.params};iAd.XHRLoader.prototype.addXHR Listeners=function(){var b=iAd.XHRLoader.XHR_EVENTS;for(var a=0,c=b.length;a<c;a++){this._xhr.addEventListener(b[a],this)}};iAd.XHRLoader.p rototype.removeXHRListeners=function(){var b=iAd.XHRLoader.XHR_EVENTS;for(var a=0,c=b.length;a<c;a++){this._xhr.removeEventListener(b[a],this)}};iAd.XHRLoade r.prototype.handleEvent=function(a){switch(a.type){case"load":this.handleLoadEve nt(a);break;case"progress":this.handleProgressEvent(a);break;case"abort":this.ha ndleAbortEvent(a);break;case"error":this.handleErrorEvent(a);break}};iAd.XHRLoad er.prototype.handleLoadEvent=function(a){this.notifyLoaderDidComplete()};iAd.XHR Loader.prototype.handleProgressEvent=function(a){if(a.lengthComputable){this.byt esLoaded=a.loaded;this.bytesTotal=a.total}this.notifyLoaderDidProgress()};iAd.XH RLoader.prototype.handleAbortEvent=function(a){this.notifyLoaderDidFail(iAd.Load er.LOAD_ABORTED)};iAd.XHRLoader.prototype.handleErrorEvent=function(a){this.noti fyLoaderDidFail(iAd.Loader.LOAD_ERROR)};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.VideoLoader",superclass:iAd.Loader});iAd.VideoLoader.DEFAUL T_TIMEOUT=5;iAd.VideoLoader.prototype.startLoad=function(){this.video=iAd.Video. videoForURL(this._url);this.video.delegate=this;if(this.video.loadReady){this.no tifyLoaderDidComplete()}else{this.video.load()}};iAd.VideoLoader.prototype.notif yLoaderDidComplete=function(){iAd.Media.preloadedMedia=this.video;this.callSuper ()};iAd.VideoLoader.prototype.getSupportingObject=function(){return this.video};iAd.VideoLoader.prototype.getResolvedURL=function(){return this.video.resolvedURL};iAd.VideoLoader.prototype.mediaLoadIsReady=function(a){ this.notifyLoaderDidComplete()};iAd.VideoLoader.prototype.mediaLoadDidFail=funct ion(b,a){this.notifyLoaderDidFail(iAd.Loader.LOAD_ERROR)};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.ScriptLoader",superclass:iAd.Loader});iAd.ScriptLoader.DEFA ULT_TIMEOUT=0;iAd.ScriptLoader.prototype.startLoad=function(){var b=this._element=document.createElement("script");b.type="text/javascript";b.src =this._url;var a=iAd.ScriptLoader.elementForScript(b.src);if(a){this._element=a;this.notifyLoa derDidComplete();return}this.addElementListeners();document.head.appendChild(b)} ;iAd.ScriptLoader.prototype.abortLoad=function(){if(this._element){this.removeEl ementListeners();document.head.removeChild(this._element)}};iAd.ScriptLoader.pro totype.getSupportingObject=function(){return this._element};iAd.ScriptLoader.prototype.getResolvedURL=function(){return this._element?this._element.src:this.callSuper()};iAd.ScriptLoader.prototype.ad dElementListeners=function(){if(this._element){this._element.addEventListener("l oad",this,false);this._element.addEventListener("error",this,false)}};iAd.Script Loader.prototype.removeElementListeners=function(){if(this._element){this._eleme nt.removeEventListener("load",this,false);this._element.removeEventListener("err or",this,false)}};iAd.ScriptLoader.prototype.handleEvent=function(a){this.remove ElementListeners();if(a.type=="load"){this.notifyLoaderDidComplete()}else{if(a.t ype=="error"){this.notifyLoaderDidFail(iAd.Loader.LOAD_ERROR)}}};iAd.ScriptLoade r.elementForScript=function(c){var b,a=document.scripts;for(var d=0,e=a.length;d<e;d++){b=a[d];if(b.href==c){return b}}return null};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.ViewControllerRequiredFilesLoader",superclass:iAd.LoaderBat ch,synthesizedProperties:["contentViewMarkup"]});iAd.ViewControllerRequiredFiles Loader.LOADER_CLASSES={stylesheets:iAd.StyleLoader,scripts:iAd.ScriptLoader,imag es:iAd.ImageLoader,video:iAd.VideoLoader,contentView:iAd.XHRLoader};iAd.ViewCont rollerRequiredFilesLoader.prototype.init=function(a){this.callSuper();this.viewC ontroller=a;var b=a.configuration;if(b.requiredFileURIs){this.processFiles(b.requiredFileURIs)} };iAd.ViewControllerRequiredFilesLoader.prototype.getContentViewMarkup=function( ){return this.contentViewLoader.content};iAd.ViewControllerRequiredFilesLoader.prototype .processFiles=function(b){for(var c in b){if(b.hasOwnProperty(c)){switch(c){case"contentView":var a=this.addFilesOfType([b[c]],c);this.contentViewLoader=a[0];break;case"styleshe ets":this.addFilesOfType(b[c],c);break;case"scripts":this.addFilesOfType(b[c],c) ;break;case"images":this.addFilesOfType(b[c],c);break;case"video":this.addFilesO fType([b[c]],c);break;default:iAd.Console.warn('iAd.ViewController # loadRequiredFiles : unknown key "'+c+'" in configuration.requiredFileURIs');break}}}};iAd.ViewControllerRequiredFilesLoade r.prototype.addFilesOfType=function(a,j){var h=iAd.ViewControllerRequiredFilesLoader.LOADER_CLASSES[j];if(!h){iAd.Console.wa rn('iAd.ViewController #loadRequiredFiles : No known loader for type "'+j+'"');return}var f=[];for(var e=0,g=a.length;e<g;e++){var b=a[e];var l;if(h==iAd.ImageLoader){var c=this.viewController.configuration;var k=c.hasHiDPIVersion==null||c.hasHiDPIVersion;var d=c.hasiPadVersion==null||c.hasiPadVersion;l=new h(b,k,d)}else{l=new h(b)}this.add(l);f.push(l)}return f};iAd.ViewControllerRequiredFilesLoader.prototype.notifyLoaderDidProgress=func tion(a){this.callSuper(a);this.viewController.requiredFilesLoaderDidProgress(thi s,this.progress,a)};iAd.ViewControllerRequiredFilesLoader.prototype.notifyLoader DidFail=function(a){this.callSuper(a);this.viewController.requiredFilesLoaderDid Fail(this,a)};iAd.ViewControllerRequiredFilesLoader.prototype.notifyLoaderDidCom plete=function(){this.callSuper();this.viewController.requiredFilesLoaderDidComp lete(this)};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Utils.replaceMethod(iAd.ViewControllerRequiredFilesLoader,"init",function(e) {this.callOriginal.apply(this,arguments);var d=[];d.push.apply(d,e.topAnchoredSharedViewIDs);d.push.apply(d,e.bottomAnchored SharedViewIDs);var c;for(var a=0,b=d.length;a<b;a++){c=iAd.ViewController.instances[d[a]];if(!c.loadedAllReq uiredFiles){if(!c.requiredFilesLoader){c.requiredFilesLoader=new iAd.ViewControllerRequiredFilesLoader(c)}else{if(c.requiredFilesLoader.loading) {continue}}this.add(c.requiredFilesLoader);c.loadRequiredFiles()}}});

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Archiver={};iAd.Archiver._uid=1;iAd.Archiver.WILL_ENCODE_OBJECT="willEncodeO bjectToArchive";iAd.Archiver.DID_ENCODE_OBJECT="didEncodeObjectToArchive";iAd.Ar chiver.WILL_RESTORE_OBJECT="willRestoreFromArchive";iAd.Archiver.DID_RESTORE_OBJ ECT="didRestoreFromArchive";iAd.Archiver.archive=function(c,a){if(!a){a={};retur n{__root:this.archive(c,a),__objects:a}}if(iAd.Utils.objectIsPrimitive(c)){retur n c}else{if(iAd.Utils.objectIsArray(c)){return c.map(function(h){return this.archive(h,a)},this)}}var f=c._uid||(c._uid=this._uid++);if(!a[f]){var e=a[f]={};if(iAd.Utils.objectIsInstanceOfClass(c,iAd.Object)){var d=c.constructor;e.__className=d._name;var b=this.archivePropertiesForClass(d);if(iAd.Utils.objectHasMethod(c,iAd.Archiver .WILL_ENCODE_OBJECT)){c[iAd.Archiver.WILL_ENCODE_OBJECT](e)}for(var g in b){e[g]=this.archive(c.archiveProperty(g),a)}if(iAd.Utils.objectHasMethod(c,iAd .Archiver.DID_ENCODE_OBJECT)){c[iAd.Archiver.DID_ENCODE_OBJECT](e)}}else{for(var g in c){if(g!="_uid"){e[g]=this.archive(c[g],a)}}}}return{_uid:f}};iAd.Archiver.arch iveToJSON=function(a){return JSON.stringify(this.archive(a))};iAd.Archiver.archivePropertiesForClass=functio n(g){var d=g._archivePropertyMap;if(d){return d}d=g._archivePropertyMap={};var f=g.superclass;if(f){iAd.Utils.copyPropertiesFromSourceToTarget(this.archivePro pertiesForClass(f),d)}var e=g.archivedProperties||[];for(var a=0,c=e.length;a<c;a++){d[e[a]]=true}var b=g.excludedProperties||[];for(a=0,c=b.length;a<c;a++){delete d[b[a]]}return d};iAd.Archiver.restoreFromArchive=function(b,a,j){if(iAd.Utils.objectIsPrimiti ve(b)){return b}else{if(b.__root){return this.restoreFromArchive(b.__root,b.__objects,{})}else{if(b._uid){var f=b._uid;return j[f]||(j[f]=this.restoreFromArchive(a[f],a,j))}else{if(iAd.Utils.objectIsArray( b)){return b.map(function(k){return this.restoreFromArchive(k,a,j)},this)}else{var g={};for(var i in b){if(i!="__className"){g[i]=this.restoreFromArchive(b[i],a,j)}}if(b.__classNam e){var d=iAd.Utils.resolveObjectPath(b.__className);var c=d;var e;do{e=c.restoreFromArchive}while(!e&&(c=c.superclass));var h=e?e.call(d,g):new d();if(iAd.Utils.objectHasMethod(h,iAd.Archiver.WILL_RESTORE_OBJECT)){h[iAd.Arc hiver.WILL_RESTORE_OBJECT](b)}for(var i in g){h.restoreProperty(i,g[i])}if(iAd.Utils.objectHasMethod(h,iAd.Archiver.DID_RE STORE_OBJECT)){h[iAd.Archiver.DID_RESTORE_OBJECT](b)}return h}else{return g}}}}}};iAd.Archiver.restoreWithJSONArchive=function(a){return a?this.restoreFromArchive(JSON.parse(a)):null};iAd.Archiver.objectReferences={} ;iAd.Archiver.referenceForObject=function(b){var a=this.objectReferences,c;if(b.__archiveReference){c=b.__archiveReference;a[c]. count++;return c}c=++this._uid;a[c]={object:b,count:1};b.__archiveReference=c;return c};iAd.Archiver.objectForReference=function(c){var a=this.objectReferences;var d=a[c];if(!d){return null}var b=d.object;d.count--;if(d.count<=0){delete a[c];delete b.__archiveReference}return b};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.ViewController",superclass:iAd.Object,mixins:[iAd.EventTarg et],synthesizedProperties:["view","title","loadingRequiredFiles","loadedAllRequi redFiles","viewWasProcessed","contentView","interfaceOrientation","contentSizeFo rViewInPopover"],archivedProperties:["configuration","viewWasArchived","title"," toolbarItems","requiredFilesLoadDelegate","stateChangeDelegate","actionListDeleg ate","wasBackItemTransition","becomesBackItemTransition","wasTopItemTransition", "becomesTopItemTransition","becomesHiddenTransition","becomesVisibleTransition", "buildInActionListShouldOccurAfterTransition","buildOutActionListShouldDelayTran sition","disableLoadingViewController","viewLoadingDelaysTransition","contentSiz eForViewInPopover","modalInPopover"]});iAd.ViewController.__minimalViewLoadingTi me=0;iAd.ViewController.prototype.init=function(d){this.requiredFilesLoadDelegat e=null;this.stateChangeDelegate=null;this.actionListDelegate=null;this.callSuper ();this.configuration={};this.shouldSetUpContentViewUponLoad=false;this.shouldPr ocessViewUponRequestsCompleted=false;this.viewIsLoaded=false;this.viewWasArchive d=false;this.shouldArchiveView=true;if(iAd.Utils.objectIsString(d)){this.configu ration={id:d}}else{if(d!==undefined&&d!==null){this.configuration=d}}this.id=thi s.configuration.id||iAd.ViewController.uniqueId();this._view=null;this._contentV iew=null;this._title="";this._tabBarItem=null;this._navigationItem=null;this._to olbarItems=[];this._viewWasProcessed=false;this.outlets={};this.eventTarget=docu ment;this.modalViewController=null;this.parentViewController=null;this.viewAppea rancePropagationProperty=null;this.modalTransitionStyle=null;this.searchDisplayC ontroller=null;this.wasBackItemTransition=iAd.ViewController.TRANSITION_IN_FROM_ LEFT;this.becomesBackItemTransition=iAd.ViewController.TRANSITION_OUT_TO_LEFT;th is.wasTopItemTransition=iAd.ViewController.TRANSITION_OUT_TO_RIGHT;this.becomesT opItemTransition=iAd.ViewController.TRANSITION_IN_FROM_RIGHT;this.becomesHiddenT ransition=iAd.ViewController.TRANSITION_DISSOLVE_OUT;this.becomesVisibleTransiti on=iAd.ViewController.TRANSITION_DISSOLVE_IN;this.buildInActionListShouldOccurAf terTransition=false;this.buildOutActionListShouldDelayTransition=false;this.disa bleLoadingViewController=false;this.viewLoadingDelaysTransition=true;this.__mini malViewLoadingTime=iAd.ViewController.__minimalViewLoadingTime;this.contentSizeF orViewInPopover=new iAd.Size(320,1100);this.modalInPopover=false;iAd.ViewController.instances[this. id]=this;iAd.Utils.copyPropertiesFromSourceToTarget(this.configuration.propertie s,this);this.actionListManagersByName={};this.actionListByName={};this.actionLis tNameByClassName={};var a=this.configuration.actionLists;if(a){for(var b=0,c=a.length;b<c;b++){this.loadActionList(a[b])}}};iAd.ViewController.restore FromArchive=function(a){return new this(a.configuration)};iAd.ViewController.instances={};iAd.ViewController.viewP rocessors=[];iAd.ViewController.WILL_LOAD_REQUIRED_FILES="viewControllerWillLoad RequiredFiles";iAd.ViewController.PROGRESS_LOADING_REQUIRED_FILES="viewControlle rProgressLoadingRequiredFiles";iAd.ViewController.DID_LOAD_REQUIRED_FILES="viewC ontrollerDidLoadRequiredFiles";iAd.ViewController.DID_ABORT_LOAD_REQUIRED_FILES= "viewControllerDidAbortLoadRequiredFiles";iAd.ViewController.DID_ENTER_STATE="vi ewControllerDidEnterState";iAd.ViewController.DID_EXIT_STATE="viewControllerDidE xitState";iAd.ViewController.ACTION_LIST_WILL_START="viewControllerActionListWil lStart";iAd.ViewController.ACTION_LIST_DID_START="viewControllerActionListDidSta rt";iAd.ViewController.ACTION_LIST_WILL_ITERATE="viewControllerActionListWillIte rate";iAd.ViewController.ACTION_LIST_DID_ITERATE="viewControllerActionListDidIte rate";iAd.ViewController.ACTION_LIST_WILL_COMPLETE="viewControllerActionListWill Complete";iAd.ViewController.ACTION_LIST_DID_COMPLETE="viewControllerActionListD idComplete";iAd.ViewController.ACTION_LIST_DID_CANCEL="viewControllerActionListD idCancel";iAd.ViewController.ACTION_LIST_DID_PROGRESS="viewControllerActionListD idProgress";iAd.ViewController.VIEW_WILL_APPEAR_STATE="ad-view-will-appear";iAd. ViewController.VIEW_DID_APPEAR_STATE="ad-view-did-appear";iAd.ViewController.VIE W_WILL_DISAPPEAR_STATE="ad-view-will-disappear";iAd.ViewController.VIEW_DID_DISA PPEAR_STATE="ad-view-did-disappear";iAd.ViewController.APPEARANCE_STATES=[iAd.Vi ewController.VIEW_WILL_APPEAR_STATE,iAd.ViewController.VIEW_DID_APPEAR_STATE,iAd .ViewController.VIEW_WILL_DISAPPEAR_STATE,iAd.ViewController.VIEW_DID_DISAPPEAR_ STATE];iAd.ViewController.VIEW_WILL_APPEAR_EVENT="viewControllerViewWillAppear"; iAd.ViewController.VIEW_DID_APPEAR_EVENT="viewControllerViewDidAppear";iAd.ViewC ontroller.VIEW_WILL_DISAPPEAR_EVENT="viewControllerViewWillDisappear";iAd.ViewCo ntroller.VIEW_DID_DISAPPEAR_EVENT="viewControllerViewDidDisappear";iAd.ViewContr oller.VIEW_DID_LOAD="viewControllerViewDidLoad";iAd.ViewController.VIEW_DID_UNLO AD="viewControllerViewDidUnload";iAd.ViewController.TRANSITION_IN_FROM_RIGHT={pr operties:["transform"],from:["translateX(100%)"],to:["translateX(0)"]};iAd.ViewC ontroller.TRANSITION_IN_FROM_LEFT={properties:["transform"],from:["translateX(-1 00%)"],to:["translateX(0)"]};iAd.ViewController.TRANSITION_OUT_TO_RIGHT={propert ies:["transform"],from:["translateX(0)"],to:["translateX(100%)"]};iAd.ViewContro ller.TRANSITION_OUT_TO_LEFT={properties:["transform"],from:["translateX(0)"],to: ["translateX(-100%)"]};iAd.ViewController.TRANSITION_DISSOLVE_OUT={properties:[" opacity"],from:[1],to:[0]};iAd.ViewController.TRANSITION_DISSOLVE_IN={properties :["opacity"],from:[0],to:[1]};iAd.ViewController.DECLARATIVE_MIME_TYPE="applicat ion/vnd.apple.iadjs; type=view-controllers";iAd.ViewController.ARCHIVE_PREFIX=window.location.href+" :";iAd.ViewController.VIEW_ARCHIVE_PREFIX=window.location.href+"-view:";iAd.View Controller.prototype.getView=function(){if(this._view){return this._view}if(this.viewWasArchived){var b=iAd.ViewController.VIEW_ARCHIVE_PREFIX+this.id;var a=window.localStorage[b];delete window.localStorage[b];this.viewWasArchived=false;this.view=iAd.Archiver.restor eWithJSONArchive(a)}if(this._view==null){this.loadView()}return this._view};iAd.ViewController.prototype.setView=function(b){if(this._view instanceof iAd.View){delete this._view._viewController}if(b==null){var a=this.shouldArchiveView;this.shouldArchiveView=false;this.unloadView();this.sh ouldArchiveView=a;return}if(this.__minimalViewLoadingTime>0){this.__loadViewStar tTime=new Date()}b._viewController=this;this._view=b;var c=this.configuration;if(b.usesDeclarativeBacking&&b.layerHasCustomAttribute("ad -content-view")){if(!c.requiredFileURIs){c.requiredFileURIs={}}c.requiredFileURI s.contentView=b.getLayerCustomAttributeValue("ad-content-view")}if(c.requiredFil eURIs&&c.requiredFileURIs.contentView){this.loadContentView()}else{if(c.required FileURIs&&!this.loadedAllRequiredFiles){this.shouldProcessViewUponRequestsComple ted=true;if(!this.loadingRequiredFiles){this.loadRequiredFiles()}}else{this.proc essView()}}};iAd.ViewController.prototype.setContentView=function(a){a.autoresiz ingMask=iAd.View.AUTORESIZING_FLEXIBLE_WIDTH|iAd.View.AUTORESIZING_FLEXIBLE_HEIG HT;this._contentView=a};iAd.ViewController.prototype.loadView=function(){this.vi ew=new iAd.View()};iAd.ViewController.prototype.loadContentView=function(){if(this.loa dingRequiredFiles){this.shouldSetUpContentViewUponLoad=true}else{if(this.loadedA llRequiredFiles){this.setupContentViewFromLayer()}else{this.shouldSetUpContentVi ewUponLoad=true;this.loadRequiredFiles()}}};iAd.ViewController.prototype.unloadV iew=function(){if(this._view==null||!this.isViewLoaded()){return}this.archiveVie w();this._contentView=null;this._view.removeFromSuperview();this.cleanViewProces sors();this._view=null;this.viewIsLoaded=false;this.viewDidUnload()};iAd.ViewCon troller.prototype.archiveView=function(){if(!this.shouldArchiveView||!this._view ||this._contentView){return}window.localStorage[iAd.ViewController.VIEW_ARCHIVE_ PREFIX+this.id]=iAd.Archiver.archiveToJSON(this._view);this.viewWasArchived=true };iAd.ViewController.prototype.willEncodeObjectToArchive=function(a){this.archiv eView();this.callSuper(a)};iAd.ViewController.prototype.archiveProperty=function (b){var a=this.callSuper(b);if(b=="configuration"){a.id=this.id}return a};iAd.ViewController.prototype.isViewLoading=function(){return(this.loadingReq uiredFiles||(this.loadedAllRequiredFiles&&!this.viewIsLoaded))};iAd.ViewControll er.prototype.isViewLoaded=function(){return this.viewIsLoaded};iAd.ViewController.prototype.viewDidLoad=function(){this.cre ateAndDispatchEvent(iAd.ViewController.VIEW_DID_LOAD)};iAd.ViewController.protot ype.viewDidUnload=function(){this.createAndDispatchEvent(iAd.ViewController.VIEW _DID_UNLOAD)};iAd.ViewController.prototype.didReceiveMemoryWarning=function(){if (this.parentViewController==null&&this.isViewLoaded()&&!document.body.contains(t his.view.layer)){this.unloadView()}};iAd.ViewController.prototype.setTitle=funct ion(b){this._title=b;var a=this.parentViewController;if(a==null){return}else{if(iAd.Utils.objectIsInstan ceOfClass(a,iAd.TabBarController)){this.tabBarItem.title=b}else{if(iAd.Utils.obj ectIsInstanceOfClass(a,iAd.NavigationController)){this.navigationItem.title=b}}} };iAd.ViewController.prototype.isInState=function(a){return this.view.layer.hasClassName(a)};iAd.ViewController.prototype.enterState=functi on(b){var a=this.view.layer.addClassName(b);if(a){this.dispatchNotification(iAd.ViewContr oller.DID_ENTER_STATE,this.stateChangeDelegate,[["state",b]])}return a};iAd.ViewController.prototype.exitState=function(a){var b=this.view.layer.removeClassName(a);if(b){this.dispatchNotification(iAd.ViewCo ntroller.DID_EXIT_STATE,this.stateChangeDelegate,[["state",a]])}return b};iAd.ViewController.prototype.toggleState=function(a,b){if(b==null){b=!this.i sInState(a)}this[b?"enterState":"exitState"](a)};iAd.ViewController.prototype.en terExclusiveAppearanceState=function(d){var a;for(var b=0,c=iAd.ViewController.APPEARANCE_STATES.length;b<c;b++){a=iAd.ViewController .APPEARANCE_STATES[b];this[(a===d)?"enterState":"exitState"](a)}};iAd.ViewContro ller.prototype.propagateViewAppearanceIfNotInState=function(e,a,d){var c=this.viewAppearancePropagationProperty;var b=c?this[c]:null;if(b&&!b.isInState(d)){b[e](a)}};iAd.ViewController.prototype. viewWillAppear=function(a){this.createAndDispatchEvent(iAd.ViewController.VIEW_W ILL_APPEAR_EVENT,[["animated",a]]);this.enterExclusiveAppearanceState(iAd.ViewCo ntroller.VIEW_WILL_APPEAR_STATE);this.propagateViewAppearanceIfNotInState("viewW illAppear",a,iAd.ViewController.VIEW_DID_APPEAR_STATE)};iAd.ViewController.proto type.viewDidAppear=function(a){this.enterExclusiveAppearanceState(iAd.ViewContro ller.VIEW_DID_APPEAR_STATE);this.createAndDispatchEvent(iAd.ViewController.VIEW_ DID_APPEAR_EVENT,[["animated",a]]);this.propagateViewAppearanceIfNotInState("vie wDidAppear",a,iAd.ViewController.VIEW_DID_APPEAR_STATE)};iAd.ViewController.prot otype.viewWillDisappear=function(a){this.createAndDispatchEvent(iAd.ViewControll er.VIEW_WILL_DISAPPEAR_EVENT,[["animated",a]]);this.enterExclusiveAppearanceStat e(iAd.ViewController.VIEW_WILL_DISAPPEAR_STATE);this.propagateViewAppearanceIfNo tInState("viewWillDisappear",a,iAd.ViewController.VIEW_DID_DISAPPEAR_STATE)};iAd .ViewController.prototype.viewDidDisappear=function(a){this.enterExclusiveAppear anceState(iAd.ViewController.VIEW_DID_DISAPPEAR_STATE);this.createAndDispatchEve nt(iAd.ViewController.VIEW_DID_DISAPPEAR_EVENT,[["animated",a]]);this.propagateV iewAppearanceIfNotInState("viewDidDisappear",a,iAd.ViewController.VIEW_DID_DISAP PEAR_STATE);this.resetAllActionLists()};iAd.ViewController.prototype.presentModa lViewControllerAnimated=function(b,a){this.modalViewController=b};iAd.ViewContro ller.prototype.dismissModalViewControllerAnimated=function(a){this.modalViewCont roller=null};iAd.ViewController.prototype.parentControllerOfKind=function(b){var a=this;while((a=a.parentViewController)){if(iAd.Utils.objectIsInstanceOfClass(a ,b)){return a}}return null};iAd.ViewController.prototype.getLoadingRequiredFiles=function(){return(th is.requiredFilesLoader&&this.requiredFilesLoader.loading)};iAd.ViewController.pr ototype.getLoadedAllRequiredFiles=function(){var a=this.requiredFilesLoader;return(a&&(a.loaded||a.length==0))};iAd.ViewControll er.prototype.loadRequiredFiles=function(){if(this.loadedAllRequiredFiles){return }if(!this.requiredFilesLoader){this.requiredFilesLoader=new iAd.ViewControllerRequiredFilesLoader(this)}this.dispatchNotification(iAd.ViewC ontroller.WILL_LOAD_REQUIRED_FILES,this.requiredFilesLoadDelegate);var a=this.requiredFilesLoader;if(a.length>0){a.load();this.notifyPropertyChange("l oadingRequiredFiles")}else{this.dispatchNotification(iAd.ViewController.DID_LOAD _REQUIRED_FILES,this.requiredFilesLoadDelegate)}};iAd.ViewController.prototype.a bortLoadRequiredFiles=function(){if(this.requiredFilesLoader.loading){this.requi redFilesLoader.abort()}};iAd.ViewController.prototype.handleEvent=function(a){}; iAd.ViewController.prototype.setupContentViewFromLayer=function(){var a=iAd.Element.elementFromString(this.requiredFilesLoader.contentViewMarkup);thi s._view.hostingLayer.appendChild(a);if(!a.hasAttribute("id")){a.id=this.id}var b=iAd.View.viewForLayer(a);b.superview=this._view;b._indexInSuperviewSubviews=t his._view.subviews.push(b)-1;this.contentView=b;if(b.declarativeLayerWasInitiali zed){this.processView()}else{b.addPropertyObserver("declarativeLayerWasInitializ ed",this,"processView")}};iAd.ViewController.prototype.requiredFilesLoaderDidPro gress=function(a,c,b){if(b.loaded){this.dispatchNotification(iAd.ViewController. PROGRESS_LOADING_REQUIRED_FILES,this.requiredFilesLoadDelegate,[["progress",c],[ "url",b.url]])}else{if(b.error){iAd.Console.warn("iAd.ViewController — could not load required file with URI "+b.url)}}};iAd.ViewController.prototype.requiredFilesLoaderDidComplete=functio n(a){this.dispatchNotification(iAd.ViewController.DID_LOAD_REQUIRED_FILES,this.r equiredFilesLoadDelegate);this.notifyPropertyChange("loadingRequiredFiles");if(t his.shouldSetUpContentViewUponLoad){this.setupContentViewFromLayer()}else{if(thi s.shouldProcessViewUponRequestsCompleted){this.processView()}}};iAd.ViewControll er.prototype.requiredFilesLoaderDidFail=function(a,b){if(b!=iAd.Loader.LOAD_ABOR TED){return}var e=[];var f=this.requiredFilesLoader.openLoaders;for(var c=0,d=f.length;c<d;c++){e.push(f[c].url)}this.notifyPropertyChange("loadingRequ iredFiles");this.dispatchNotification(iAd.ViewController.DID_ABORT_LOAD_REQUIRED _FILES,this.requiredFilesLoadDelegate,[["uris",e]])};iAd.ViewController.prototyp e.processView=function(){if(!this._view.layer.hasAttribute("id")){this._view.id= this.id+((this.configuration.hasOwnProperty("requiredFileURIs")&&this.configurat ion.requiredFileURIs.hasOwnProperty("contentView"))?"-container":"")}this.viewPr ocessors=[];var d;for(var b=0,c=iAd.ViewController.viewProcessors.length;b<c;b++){d=new iAd.ViewController.viewProcessors[b](this);d.processView(this._view);this.viewP rocessors.push(d)}if(this.__minimalViewLoadingTime>0){var a=(Date.now()-this.__loadViewStartTime)/1000;if(a<this.__minimalViewLoadingTime ){this.callMethodNameAfterDelay("viewProcessingDidComplete",this.__minimalViewLo adingTime-a);return}}this.viewProcessingDidComplete()};iAd.ViewController.protot ype.viewProcessingDidComplete=function(){if(!this.viewIsLoaded){this.viewIsLoade d=true;this.viewDidLoad()}this.viewWasProcessed=true};iAd.ViewController.prototy pe.cleanViewProcessors=function(){while(this.viewProcessors.length){this.viewPro cessors.pop().cleanUp()}this.viewWasProcessed=false};iAd.ViewController.uniqueId =function(){return"vc-"+Math.floor(Math.random()*10000000000)};iAd.ViewControlle r.addViewProcessor=function(a){iAd.ViewController.viewProcessors.push(a)};iAd.Vi ewController.init=function(){iAd.Class.processAllClasses();var c=document.scripts;var a;for(var b=0,d=c.length;b<d;b++){a=c[b];if(a.type==iAd.ViewController.DECLARATIVE_MIME_T YPE){iAd.ViewController.handleScriptElementForDeclarativeViewControllers(a)}}win dow.addEventListener("ADMemoryLevelWarning",iAd.ViewController.handleMemoryWarni ng,true);window.addEventListener("ADMemoryLevelUrgent",iAd.ViewController.handle MemoryWarning,true)};iAd.ViewController.handleScriptElementForDeclarativeViewCon trollers=function(c){if(c.src!=""){var b=new XMLHttpRequest();b._url=c.src;b.addEventListener("load",this.handleEventProxy,f alse);b.addEventListener("error",this.handleEventProxy,false);b.open("GET",b._ur l,true);b.send()}else{var a=Function("undefined","return ("+c.textContent+");")();setTimeout(function(){iAd.ViewController.handleDeclara tiveViewControllerDefinitions(a)},0)}};iAd.ViewController.handleEventProxy=funct ion(a){iAd.ViewController.handleEvent(a)};iAd.ViewController.handleEvent=functio n(c){var b=c.target;switch(c.type){case"load":var a=Function("undefined","return ("+b.responseText+");")();iAd.ViewController.handleDeclarativeViewControllerDef initions(a);break;case"error":iAd.Console.error("Failed to read content from JSON file "+b._url);break}};iAd.ViewController.handleDeclarativeViewControllerDefinitions =function(b){if(iAd.Utils.objectIsArray(b)){for(var a=0,c=b.length;a<c;a++){iAd.ViewController.viewControllerWithConfiguration(b[a] )}}else{iAd.ViewController.viewControllerWithConfiguration(b)}};iAd.ViewControll er.viewControllerWithConfiguration=function(a){if(iAd.ViewController.instances.h asOwnProperty(a.id)){return}return new (iAd.ViewController.constructorMap[a.type]||iAd.ViewController)(a)};iAd.ViewCon troller.constructorMap={};iAd.ViewController.handleMemoryWarning=function(b){var c=iAd.ViewController.instances;for(var a in c){c[a].didReceiveMemoryWarning()}};iAd.ViewController.prototype.startAction=fu nction(c){var d=iAd.Utils.resolveObjectPath(c.className);if(!d){throw iAd.ActionListManager.INVALID_CLASS_NAME_EXCEPTION}var e=new d(this);var b=c.properties;for(var a in b){e[a]=b[a]}if(c.delay){e.delay=c.delay}e.prepare();e.run()};iAd.ViewControlle r.prototype.loadActionList=function(c){var a=c.name,b=c.cssClassName;if(!a){return}if(this.actionListManagersByName[a]){if (c.reset){this.cancelActionList(a)}delete this.actionListManagersByName[a]}if(c.actions.length>0){this.actionListByName[a ]=c;if(b==null){c.cssClassName=b=a.replace(/\s+/g,"-").toLowerCase()}this.action ListNameByClassName[b]=a}};iAd.ViewController.prototype.startActionList=function (a){var b=this.actionListByName[a];if(!b){return}var c=this.actionListManagersByName[a];if(!c){this.actionListManagersByName[a]=c=ne w iAd.ActionListManager(b,this)}c.callMethodNameAfterDelay("start",0)};iAd.ViewCo ntroller.prototype.cancelActionList=function(a){var b=this.actionListManagersByName[a];if(!b){return}b.reset()};iAd.ViewController. prototype.resetAllActionLists=function(){for(var a in this.actionListManagersByName){this.actionListManagersByName[a].reset()}};iAd.V iewController.prototype.hasActionList=function(a){return !!this.actionListByName[a]};iAd.ViewController.prototype.dispatchActionListNoti fication=function(a,b){this.notifyDelegate(a,this.transitionController,b);this.d ispatchNotification(a,this.actionListDelegate,b)};iAd.ViewController.prototype.a ctionListWillStart=function(b,a){this.dispatchActionListNotification(iAd.ViewCon troller.ACTION_LIST_WILL_START,[["actionList",a]])};iAd.ViewController.prototype .actionListDidStart=function(b,a){this.dispatchActionListNotification(iAd.ViewCo ntroller.ACTION_LIST_DID_START,[["actionList",a]])};iAd.ViewController.prototype .actionListWillIterate=function(c,a,b){this.dispatchActionListNotification(iAd.V iewController.ACTION_LIST_WILL_ITERATE,[["actionList",a],["iteration",b]])};iAd. ViewController.prototype.actionListDidIterate=function(c,a,b){this.dispatchActio nListNotification(iAd.ViewController.ACTION_LIST_DID_ITERATE,[["actionList",a],[ "iteration",b]])};iAd.ViewController.prototype.actionListWillComplete=function(b ,a){this.dispatchActionListNotification(iAd.ViewController.ACTION_LIST_WILL_COMP LETE,[["actionList",a]])};iAd.ViewController.prototype.actionListDidComplete=fun ction(b,a){this.dispatchActionListNotification(iAd.ViewController.ACTION_LIST_DI D_COMPLETE,[["actionList",a]])};iAd.ViewController.prototype.actionListDidCancel =function(b,a){this.dispatchActionListNotification(iAd.ViewController.ACTION_LIS T_DID_CANCEL,[["actionList",a]])};iAd.ViewController.prototype.actionListDidProg ress=function(d,b,c,a){this.dispatchActionListNotification(iAd.ViewController.AC TION_LIST_DID_PROGRESS,[["actionList",b],["action",c],["progress",a]])};iAd.View Controller.orientationDidChange=function(a){var b=this.instances;for(var c in b){b[c].didRotateFromInterfaceOrientation(a)}};iAd.ViewController.prototype.get InterfaceOrientation=function(){return iAd.Device.interfaceOrientation};iAd.ViewController.prototype.didRotateFromInte rfaceOrientation=function(a){};iAd.ViewController.prototype.archive=function(){v ar a=iAd.ViewController.ARCHIVE_PREFIX+this.id;window.localStorage[a]=iAd.Archiver .archiveToJSON(this)};iAd.ViewController.restore=function(c){var b=iAd.ViewController.ARCHIVE_PREFIX+c;var a=window.localStorage[b];return a?iAd.Archiver.restoreWithJSONArchive(a):null};iAd.ViewController.clearArchives =function(){for(var a in window.localStorage){if(a.indexOf(iAd.ViewController.ARCHIVE_PREFIX)==0||a.inde xOf(iAd.ViewController.VIEW_ARCHIVE_PREFIX)==0){delete window.localStorage[a]}}};iAd.ViewController.initialize=function(){iAd.ViewCont roller.constructorMap[this.displayName]=this};iAd.View.prototype.containingViewC ontroller=function(){var a=this;while(a){if(a._viewController){return a._viewController}a=a.superview}};iAd.Class.processMethods(iAd.View,["containin gViewController"]);window.addEventListener("DOMContentLoaded",iAd.ViewController .init,true);

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.ViewController.prototype.startActionListWithSourceView=function(b,a){var c=this.actionListByName[b];if(!c){return}var d=this.actionListManagersByName[b];if(!d){this.actionListManagersByName[b]=d=ne w iAd.ActionListManager(c,this)}d.sourceView=a;d.callMethodNameAfterDelay("start" ,0)};iAd.ViewController.prototype.startActionList=function(a){this.startActionLi stWithSourceView(a,undefined)};iAd.ViewController.prototype.startActionWithSourc eView=function(d,a){var e=iAd.Utils.resolveObjectPath(d.className);if(!e){throw iAd.ActionListManager.INVALID_CLASS_NAME_EXCEPTION}var f=new e(this);var c=d.properties;for(var b in c){f[b]=c[b]}if(d.delay){f.delay=d.delay}f.prepare();f.sourceView=a;f.run()};iA d.ViewController.prototype.actionListDidResetAnimation=function(f,h){var k=h.split(","),m=k.length;if(m==0){return}var g,d,l=[];for(var c in this.actionListManagersByName){d=this.actionListManagersByName[c];if(d!=f){l.pu sh(d)}}var b=l.length;if(b==0){return}var e,a={type:"webkitAnimationEnd",animationName:""};for(g=0;g<m;g++){a.animationNa me=k[g];for(e=0;e<b;e++){l[e].handleEvent(a)}}};(function(){var a=iAd.ViewController.handleDeclarativeViewControllerDefinitions;iAd.ViewControl ler.handleDeclarativeViewControllerDefinitions=function(e){var d=iAd.RootViewController.sharedRootViewController;var b=iAd.RootViewController.sharedRootViewController.initialViewControllerID;if(iA P.Context.IS_IBOOKS){if(!iAd.Utils.objectIsArray(e)){e=[e]}var f={id:iAP.iBooksLoadingViewController.VIEW_CONTROLLER_ID,actionLists:[],hasHiDP IVersion:true,properties:{nextViewControllerID:b},requiredFileURIs:{images:["Def ault.png"]},type:"iAP.iBooksLoadingViewController"};e.push(f);b=d.initialViewCon trollerID=iAP.iBooksLoadingViewController.VIEW_CONTROLLER_ID}a(e);var c=iAd.ViewController.instances[b];if(window.editorProxy||d.navigationController ==null){d.transitionController.setVisibleViewControllerAnimated(c,true)}else{d.n avigationController.pushViewControllerAnimated(c,true);d.navigationController.au toReversesTransitions=true}}})();

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.EventTriage={};iAd.EventTriage.handleEvent=function(c){if(iAd.Utils.objectIs InstanceOfClass(this,iAd.Object)){this.callSuper(c)}var b=c.type;var a="handle"+b.charAt(0).toUpperCase()+b.substr(1);if(iAd.Utils.objectHasMethod(t his,a)){this[a](c)}};iAd.Utils.setupDisplayNames(iAd.EventTriage,"iAd.EventTriag e");

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Analytics={};iAd.Analytics._TRACKABLE_VIEW_DID_APPEAR="trackableViewDidAppea r";iAd.Analytics._TRACKABLE_VIEW_DID_DISAPPEAR="trackableViewDidDisappear";iAd.A nalytics._DEFAULT_VIEW_STATE_ID="default";iAd.Analytics.enabled=true;iAd.Analyti cs.logsToConsole=false;iAd.Analytics._OBJECT_ID_HIERARCHY=["analyticsId","id","o utlet"];iAd.Analytics._NAME_TO_SYMBOL_MAP={analyticsObjectId:"as",analyticsName: "an",analyticsType:"at",analyticsSectionId:"k"};iAd.Analytics._analyticsSectionI d="root";iAd.Analytics._sectionTimeStamp=null;iAd.Analytics._rootTransitionContr oller=null;iAd.Analytics._trackableViews=[];iAd.Analytics._visibleViewController sForAnalyticsId={};iAd.Class.mixin(iAd.Analytics,[iAd.EventTriage]);Object.defin eProperty(iAd.Analytics,"bannerImpressionId",{get:function(){if(iAd.Analytics._b annerImpressionId){return iAd.Analytics._bannerImpressionId}if(!window.hasOwnProperty("ad")){return false}var a=window.ad.bannerParameters;if(a.hasOwnProperty("bannerImpressionId")){return iAd.Analytics._bannerImpressionId=a.bannerImpressionId}return false}});Object.defineProperty(iAd.Analytics,"viewStateIdentifiers",{get:functi on(){var a=[];Object.keys(iAd.Analytics._visibleViewControllersForAnalyticsId).forEach(f unction(b){var c=iAd.Analytics._visibleViewControllersForAnalyticsId[b];a=a.concat(c._analytic sHandler.trackingIdsForViewControllersTrackableViews())});return !a.length?[iAd.Analytics._DEFAULT_VIEW_STATE_ID]:a}});iAd.Analytics.registerHan dlerForClass=function(a,c,b){iAd.Console.assert(a,"[iAd.Analytics.registerHandle rForClass]: Missing analyticsEventHandler.");iAd.Console.assert(c,"[iAd.Analytics.registerHandlerFo rClass]: Missing iAd.Class object to associate the handler with.");if("_analyticsHandler" in c){iAd.Console.error("[iAd.Analytics]: "+c.displayName+" already has a registered analytics event handler.");return}Object.defineProperty(c.prototype,"_analyticsHandler",{get:fu nction(){if(this.__analyticsHandler){return this.__analyticsHandler}this.__analyticsHandler=new a(this);return this.__analyticsHandler}});if(b){iAd.Analytics._addTrackableView(c)}};iAd.Analy tics._addTrackableView=function(b){var a=b;while(a&&a.displayName!=="iAd.View"){a=a.superclass}if(a){iAd.Analytics._tr ackableViews.push(b)}else{iAd.Console.error("[iAd.Analytics]: "+b.displayName+" is not a valid trackable view. Trackable views must inherit from iAd.View")}};iAd.Analytics._viewControllerViewDidAppear=function(a){if(!iAd.Ana lytics._rootTransitionController){iAd.Analytics._rootTransitionController=iAd.An alytics._rootTransitionControllerForViewController(a)}if(a.transitionController= ==iAd.Analytics._rootTransitionController){iAd.Analytics._sectionTimeStamp=Date. now();iAd.Analytics._analyticsSectionId=a.analyticsId}iAd.Analytics._visibleView ControllersForAnalyticsId[a.analyticsId]=a};iAd.Analytics._viewControllerViewDid Disappear=function(a){delete iAd.Analytics._visibleViewControllersForAnalyticsId[a.analyticsId]};iAd.Analyti cs._rootTransitionControllerForViewController=function(a){if(iAd.RootViewControl ler.sharedRootViewController.hasOwnProperty("_navigationController")){return iAd.RootViewController.sharedRootViewController.navigationController.backingTra nsitionController}return iAd.RootViewController.sharedRootViewController.transitionController};iAd.Analy tics._routeEventToHandler=function(a){var d=a.sender;var e="_analyticsHandler" in d;if(!e){return}var b="handle"+iAd.String.capitalizeString(a.type);var c=d._analyticsHandler;if(!iAd.Utils.objectHasMethod(c,b)){return}if(!d.hasOwnPr operty("analyticsId")&&!d.hasOwnProperty("_analyticsId")){d.analyticsId=iAd.Anal ytics.objectIdForSender(d)}c[b](a)};iAd.Analytics.objectIdForSender=function(b){ if(iAd.Utils.objectIsInstanceOfClass(b,iAd.ViewController)){return b.configuration.analyticsId||b.id}var a=iAd.Utils.objectIsInstanceOfClass(b,iAd.View)?b:iAd.View.nearestViewForElemen t(b);if(a){return iAd.Analytics._objectIdForView(a)}return null};iAd.Analytics._objectIdForView=function(c){var b=c[iAd.Analytics._OBJECT_ID_HIERARCHY[0]]||c.layer.getAttribute("data-ad-analy tics-id");if(b){return b}for(var d=1,e=this._OBJECT_ID_HIERARCHY.length;d<e;d++){var a=c[iAd.Analytics._OBJECT_ID_HIERARCHY[d]];if(a){return a}}iAd.Analytics._warnIfTrackableViewIsMissingAnalyticsId(c);if(c.superview){re turn iAd.Analytics._objectIdForView(c.superview)}if(c==iAd.RootView.sharedRoot){retu rn"root"}return null};iAd.Analytics._warnIfTrackableViewIsMissingAnalyticsId=function(a){for(va r b=0,c=iAd.Analytics._trackableViews.length;b<c;b++){var d=iAd.Analytics._trackableViews[b];if(iAd.Utils.objectIsInstanceOfClass(a,d)){i Ad.Console.warn("[iAd.Analytics]: Consider adding an analyticsId to the "+d.displayName);return}}};iAd.Analytics.addViewState=function(c,b,a){iAd.Conso le.assert(c,"[iAd.Analytics.addViewState]: A view controller is required.");iAd.Console.assert(b,"[iAd.Analytics.addViewState]: A view is required.");c._analyticsHandler.addViewState(b,a)};iAd.Analytics.removeViewStat e=function(c,b,a){iAd.Console.assert(c,"[iAd.Analytics.removeViewState]: A view controller is required.");iAd.Console.assert(b,"[iAd.Analytics.removeViewState]: A view is required.");c._analyticsHandler.removeViewState(b,a)};iAd.Analytics.composeAndL ogMessage=function(a,c,d,b){iAd.Console.assert(a,"[iAd.Analytics.composeAndLogMe ssage]: Missing analyticsObjectId.");iAd.Console.assert(c,"[iAd.Analytics.composeAndLogMessage] : Missing analyticsName.");iAd.Console.assert(d,"[iAd.Analytics.composeAndLogMessage]: Missing analyticsType.");var h=b!==undefined;var g;if(h&&b.hasOwnProperty("viewController")){g=b.viewController}var f=iAd.Analytics._messageForEvent(a,c,d,g);var e=!h?f:this._attachAdditionalArgumentsToMessage(b,f);iAd.Analytics._log(e)};iAd .Analytics._messageForEvent=function(a,b,c){return Object.create(null,{analyticsObjectId:{value:a,enumerable:true},analyticsSectio nId:{value:iAd.Analytics._analyticsSectionId,enumerable:true},analyticsType:{val ue:c,enumerable:true},analyticsName:{value:b,enumerable:true}})};iAd.Analytics._ attachAdditionalArgumentsToMessage=function(a,c){for(var b in a){if(!a.hasOwnProperty(b)){continue}c[b]=a[b]}return c};iAd.Analytics._log=function(e){if(e==null){iAd.Console.warn("iAd.Analytics.l og requires a valid parameter.");return}var a={};var b={};for(var d in e){if(d in iAd.Analytics._NAME_TO_SYMBOL_MAP){a[iAd.Analytics._NAME_TO_SYMBOL_MAP[d]]=e[d] }else{b[d]=e[d]}}var c=iAd.Analytics.bannerImpressionId;if(c){b.bannerImpressionId=c}if(Object.keys( b).length>0){a.a=b}var f={v:iAd.VERSION};f[Date.now()]=a;iAd.Analytics._composeMessage(f)};iAd.Analyti cs._composeMessage=function(b){if(!iAd.Analytics.enabled){return}var a=JSON.stringify(b);if(window.hasOwnProperty("ad")){window.ad.reportClickEvent( a)}if(iAd.Analytics.logsToConsole){iAd.Console.log("[ANALYTICS]: "+a)}};iAd.Analytics.logMessageWithId=function(c,a,b){iAd.Console.warn("iAd.Ana lytics.logMessageWithId is deprecated and will not log an analytics detail message. Please use iAd.Analytics.composeAndLogMessage instead.")};iAd.Analytics.updateMessageWithId=function(){iAd.Console.warn("iAd. Analytics.updateMessageWithId is deprecated and will not log an analytics detail message. Please use iAd.Analytics.composeAndLogMessage instead.")};iAd.Utils.setupDisplayNames(iAd.Analytics,"iAd.Analytics");

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.AnalyticsEventHandler"});iAd.AnalyticsEventHandler.ANALYTIC S_TYPE_VIEW="view";iAd.AnalyticsEventHandler.ANALYTICS_TYPE_DEBUG="debug";iAd.An alyticsEventHandler.ANALYTICS_TYPE_CONVERSION="conversion";iAd.AnalyticsEventHan dler.ANALYTICS_NAME_SCREEN_UPDATE="screen update";iAd.AnalyticsEventHandler.ANALYTICS_NAME_COMPLETION="completion";iAd.An alyticsEventHandler.ANALYTICS_NAME_CANCEL="cancel";iAd.AnalyticsEventHandler.ANA LYTICS_NAME_ERROR="error";iAd.AnalyticsEventHandler.ANALYTICS_OBJECT_ID_ACTION_S AVE="Save";iAd.AnalyticsEventHandler.ANALYTICS_OBJECT_ID_ACTION_COMPLETE="Comple te";iAd.AnalyticsEventHandler.ANALYTICS_OBJECT_ID_ACTION_CONVERSION="Conversion" ;iAd.AnalyticsEventHandler.ANALYTICS_OBJECT_ID_ACTION_SENT="Sent";iAd.AnalyticsE ventHandler.ANALYTICS_OBJECT_ID_ACTION_PRESENT="Present";iAd.AnalyticsEventHandl er.ANALYTICS_OBJECT_ID_ACTION_CANCEL="Cancel";iAd.AnalyticsEventHandler.ANALYTIC S_OBJECT_ID_ACTION_FAIL="Fail";iAd.AnalyticsEventHandler.ANALYTICS_OBJECT_ID_ACT ION_SHARE="Share";iAd.AnalyticsEventHandler.ANALYTICS_OBJECT_ID_ACTION_GO_TO_STO RE="GoToStore";iAd.AnalyticsEventHandler.ANALYTICS_ADDITIONAL_ARGUMENTS_URI="uri ";iAd.AnalyticsEventHandler.ANALYTICS_ADDITIONAL_ARGUMENTS_ADAM_ID="adamId";iAd. AnalyticsEventHandler.STRING_SEPARATOR="-";iAd.AnalyticsEventHandler.prototype.i nit=function(a){this.callSuper();iAd.Console.assert(a,"[iAd.AnalyticsEventHandle r]: The instance of the object must be passed in the constructor.");this._instance=a};iAd.AnalyticsEventHandler.prototype.composeAnd LogMessage=function(a,d,e,c){if(!a){var b=this.concatenatedStringForArray(["UNKNOWN",e]);iAd.Analytics.composeAndLogMes sage(b,d,iAd.AnalyticsEventHandler.ANALYTICS_TYPE_DEBUG,c);return}iAd.Analytics. composeAndLogMessage(a,d,e,c)};iAd.AnalyticsEventHandler.prototype.concatenatedS tringForArray=function(a){if(!a||!iAd.Utils.objectIsArray(a)){throw new Error("[iAd.AnalyticsEventHandler]: The concatenatedStringForArray method must be passed an array as an argument.")}return a.join(iAd.AnalyticsEventHandler.STRING_SEPARATOR)};iAd.Utils.setupDisplayNames (iAd.AnalyticsEventHandler,"iAd.AnalyticsEventHandler");

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.ViewControllerAnalyticsEventHandler",superclass:iAd.Analyti csEventHandler});iAd.ViewControllerAnalyticsEventHandler.ANALYTICS_NAME_START="s tart";iAd.ViewControllerAnalyticsEventHandler.ANALYTICS_TYPE_PAGE="page";iAd.Vie wControllerAnalyticsEventHandler._hasFiredFirstViewControllerDebugEvent=true;iAd .ViewControllerAnalyticsEventHandler.prototype.init=function(a){this._trackableV iews={};this._isViewControllerAnalyticsIdEqualToSectionId=iAd.Utils.objectIsInst anceOfClass(a,iAd.RootViewController);if(this._isViewControllerAnalyticsIdEqualT oSectionId){iAd.RootViewController.sharedRootViewController.analyticsId="root"}t his.callSuper(a)};iAd.ViewControllerAnalyticsEventHandler.prototype.handleViewCo ntrollerViewDidAppear=function(c){var b=this._instance;if(b.disablesAnalytics){return}iAd.Analytics._viewControllerVi ewDidAppear(b);if(iAd.ViewControllerAnalyticsEventHandler._hasFiredFirstViewCont rollerDebugEvent){this.composeAndLogMessage(b.analyticsId,iAd.ViewControllerAnal yticsEventHandler.ANALYTICS_NAME_START,iAd.AnalyticsEventHandler.ANALYTICS_TYPE_ DEBUG);iAd.ViewControllerAnalyticsEventHandler._hasFiredFirstViewControllerDebug Event=false}this._isViewControllerAnalyticsIdEqualToSectionId=this._instance.ana lyticsId===iAd.Analytics._analyticsSectionId;var a=this._isViewControllerAnalyticsIdEqualToSectionId?iAd.ViewControllerAnalytics EventHandler.ANALYTICS_TYPE_PAGE:iAd.AnalyticsEventHandler.ANALYTICS_TYPE_VIEW;t his.composeAndLogMessage(c.sender.analyticsId,iAd.AnalyticsEventHandler.ANALYTIC S_NAME_SCREEN_UPDATE,a);this._findTrackableViewsInViewController(b)};iAd.ViewCon trollerAnalyticsEventHandler.prototype.handleViewControllerViewDidDisappear=func tion(a){iAd.Analytics._viewControllerViewDidDisappear(this._instance);this._isVi ewControllerAnalyticsIdEqualToSectionId=false;if(!Object.keys(this._trackableVie ws).length){return}Object.keys(this._trackableViews).forEach(function(b){var c=this._trackableViews[b];c.view.dispatchNotification(iAd.Analytics._TRACKABLE_ VIEW_DID_DISAPPEAR,null,[["viewController",this._instance]]);delete this._trackableViews[b]},this)};iAd.ViewControllerAnalyticsEventHandler.prototy pe.addViewState=function(c,b){var a=this._createViewStateTrackingId(c,b);this._updateTrackingId(c,a)};iAd.ViewCon trollerAnalyticsEventHandler.prototype.removeViewState=function(c,b){var a=this._createViewStateTrackingId(c,b);this._updateTrackingId(c,a,true)};iAd.Vi ewControllerAnalyticsEventHandler.prototype.trackingIdsForViewControllersTrackab leViews=function(a){var b=Object.keys(this._trackableViews).map(function(c){return this._trackableViews[c].trackingId},this);if(!this._isViewControllerAnalyticsId EqualToSectionId){b.unshift(this._instance.analyticsId)}return b};iAd.ViewControllerAnalyticsEventHandler.prototype._findTrackableViewsInViewC ontroller=function(e){var b=e.view;for(var c=0,d=iAd.Analytics._trackableViews.length;c<d;c++){var a=iAd.View.viewsForClassAndNode(iAd.Analytics._trackableViews[c],b.layer);if(a. length){this._dispatchTrackableViewDidAppearEvent(a,e)}}};iAd.ViewControllerAnal yticsEventHandler.prototype._dispatchTrackableViewDidAppearEvent=function(b,e){f or(var c=0,d=b.length;c<d;c++){var a=b[c];a.dispatchNotification(iAd.Analytics._TRACKABLE_VIEW_DID_APPEAR,null,[[" viewController",e]])}};iAd.ViewControllerAnalyticsEventHandler.prototype._update TrackingId=function(c,b,a){var d=c.analyticsId||iAd.Analytics.objectIdForSender(c);this._trackableViews[d]={vi ew:c,trackingId:!a?b:null}};iAd.ViewControllerAnalyticsEventHandler.prototype._c reateViewStateTrackingId=function(b,a){var c=b.hasOwnProperty("analyticsId")?b.analyticsId:iAd.Analytics.objectIdForSender (b);var d=a===undefined?c:this.concatenatedStringForArray([c,a]);return this._isViewControllerAnalyticsIdEqualToSectionId?d:this.concatenatedStringForA rray([this._instance.analyticsId,d])};iAd.Analytics.registerHandlerForClass(iAd. ViewControllerAnalyticsEventHandler,iAd.ViewController);iAd.Utils.setupDisplayNa mes(iAd.ViewControllerAnalyticsEventHandler,"iAd.ViewControllerAnalyticsEventHan dler");

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.RootView",superclass:iAd.View,synthesizedProperties:["disab lesDefaultScrolling","scrollsHorizontally","scrollsVertically"],archivedProperti es:["disablesDefaultScrolling","scrollsHorizontally","scrollsVertically"],cssCla ssName:"ad-root-view"});iAd.RootView.prototype.init=function(a){this.callSuper(a );if(this.layer===document.body){this.layerIsInDocument=true;this._size=new iAd.Size(window.innerWidth,window.innerHeight);this.layer.removeClassName("ad-v iew");window.addEventListener(iAd.Device.iOS_VERSION?"orientationchange":"resize ",this,true)}this._scrollsHorizontally=false;this._scrollsVertically=true;this.d isablesDefaultScrolling=true;iAd.RootView.sharedRoot=this};iAd.RootView.prototyp e.createLayer=function(){this.layer=document.body};iAd.RootView.prototype.setDis ablesDefaultScrolling=function(a){this._disablesDefaultScrolling=a;this.updateSi ze();if(!iAd.HostScrollView){this.layer[a?"addEventListener":"removeEventListene r"](iAd.Event.MOVE_EVENT,iAd.Event.preventDefault,false)}};iAd.RootView.prototyp e.handleEvent=function(a){this.callSuper(a);if(a.type=="resize"||a.type=="orient ationchange"){this.updateSize();if(this._disablesDefaultScrolling){window.scroll To(0,0)}}};iAd.RootView.prototype.updateSize=function(){if(this.layer!==document .body){return}if(this._disablesDefaultScrolling){this.size=new iAd.Size(window.innerWidth,window.innerHeight)}else{this._size=new iAd.Size(document.body.offsetWidth,document.body.offsetHeight);this.notifyPrope rtyChange("size")}};iAd.RootView._sharedRoot=null;Object.defineProperty(iAd.Root View,"sharedRoot",{get:function(){if(iAd.RootView._sharedRoot==null){iAd.RootVie w._sharedRoot=new iAd.RootView()}return iAd.RootView._sharedRoot},set:function(a){iAd.RootView._sharedRoot=a}});iAd.Roo tView.init=function(){document.body.addClassName("ad-"+window.devicePixelRatio+" x");document.body.addClassName(iAd.Device.HAS_HIDPI_DISPLAY?"ad-HiDPI":"ad-LoDPI ");if(iAd.Device.IS_IPAD){document.body.addClassName("ad-iPad")}if(iAd.RootView. _sharedRoot==null){var a=document.querySelector("."+iAd.RootView.cssClassName);if(a!=null){iAd.RootVie w._sharedRoot=new iAd.RootView(a)}}};window.addEventListener("DOMContentLoaded",iAd.RootView.init ,true);

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

(function(){iAd.Class.processMethod(iAd.RootView,"init");var b=iAd.RootView.prototype.init;iAd.RootView.prototype.init=function(f){b.apply(t his,arguments);if(!iAP.supportsNewCSSBrightnessFilter){document.body.addClassNam e("iap-brightness-fallback")}var e=iAd.RootViewController.sharedRootViewController.rootViewSize;if(e){this._size =new iAd.Size(e.width,e.height)}else{if(iAP.Context.IS_SAFARI){this._size=new iAd.Size(document.body.offsetWidth,document.body.offsetHeight)}}if(iAP.Context. IS_IAD_PRODUCER||iAP.Context.IS_SAFARI){window.removeEventListener("resize",this ,true)}};iAd.Class.processMethod(iAd.RootView,"updateSize");var c=iAd.RootView.prototype.updateSize;var a=768;var d=414;iAd.RootView.prototype.updateSize=function(){if(iAP.Context.IS_IOS){var i=iAd.Device.supportedOrientations;var h=i.indexOf(iAd.Device.ORIENTATION_PORTRAIT)!==-1;var g=iAd.Device.IS_IPAD?a:d;var f=window.innerWidth;var j=window.innerHeight;if(h&&f>g||!h&&j>g){this.size=new iAd.Size(j,f)}else{c.apply(this)}}else{var e=this;setTimeout(function(){if(iAP.Context.IS_SAFARI){e._size=new iAd.Size(document.body.offsetWidth,document.body.offsetHeight);e.notifyProperty Change("size")}else{c.apply(e)}},0)}};iAd.RootView.prototype.setIsLandscape=func tion(h){if(iAP.Context.projectIsOfType("radio-audio-banner")){return}if(document .body.hasClassName("iap-custom-page-size")){return}var g=this.size.width,e=this.size.height,f=g>e;if(f!=h){this.size=new iAd.Size(e,g)}}})();

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.RootViewController",superclass:iAd.ViewController,archivedP roperties:["navigationController"]});iAd.RootViewController.ID="root";iAd.RootVi ewController.prototype.init=function(b){b=b||{};b.id=iAd.RootViewController.ID;i f(b.requiredFileURIs){delete b.requiredFileURIs.contentView}this.callSuper(b);this.openBeginIgnoringInteract ionEventsCalls=0;this.shouldArchiveView=false;iAd.RootViewController.sharedRootV iewController=this;var a=this.view};iAd.RootViewController.prototype.loadView=function(){this.view=iAd .RootView.sharedRoot};iAd.RootViewController.prototype.archiveProperty=function( a){if(a=="navigationController"){return this._navigationController}else{return this.callSuper(a)}};iAd.RootViewController.prototype.beginIgnoringInteractionEv ents=function(){this.openBeginIgnoringInteractionEventsCalls++;if(this.openBegin IgnoringInteractionEventsCalls==1){this.view.layer.style.pointerEvents="none"}}; iAd.RootViewController.prototype.endIgnoringInteractionEvents=function(){if(this .openBeginIgnoringInteractionEventsCalls==0){return}this.openBeginIgnoringIntera ctionEventsCalls--;if(this.openBeginIgnoringInteractionEventsCalls==0){this.view .layer.style.pointerEvents="auto"}};iAd.RootViewController.prototype.isIgnoringI nteractionEvents=function(){return(this.openBeginIgnoringInteractionEventsCalls> 0)};Object.defineProperty(iAd.RootViewController,"sharedRootViewController",{get :function(){if(!iAd.RootViewController.hasOwnProperty("_sharedRootViewController ")){var a=new iAd.RootViewController()}return iAd.RootViewController._sharedRootViewController},set:function(a){iAd.RootViewC ontroller._sharedRootViewController=a}});

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class("iAd.ViewProcessor");iAd.ViewProcessor.prototype.init=function(a){this .callSuper();this.viewController=a};iAd.ViewProcessor.prototype.processView=func tion(a){};iAd.ViewProcessor.prototype.cleanUp=function(){};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.ViewControllerReferencingViewProcessor",superclass:iAd.View Processor});iAd.ViewControllerReferencingViewProcessor.prototype.init=function(a ){this.callSuper(a);this.anchors=[]};iAd.ViewControllerReferencingViewProcessor. prototype.processView=function(b){var f=this.constructor.PROCESSED_KEY;var a=this.constructor.ATTR_NAME;var e=iAd.Element.HTML5_CUSTOM_ATTRIBUTE_PREFIX+a;var c;var h=b.layer.querySelectorAll("["+e+"],["+a+"]");for(var d=0,g=h.length;d<g;d++){c=h[d];if(c.hasOwnProperty(f)){continue}if(c._view){c._ view.userInteractionEnabled=true}iAd.Event.registerForNotificationEvent(iAd.View .ACTIVATE_EVENT);c.addEventListener(iAd.View.ACTIVATE_EVENT,this,false);c.addEve ntListener("click",this,false);iAd.SpatialNavigationManager.sharedManager.addNav igableElement(c);c.addEventListener(iAd.SpatialNavigationManager.ACTIVATE_EVENT, this,false);c[f]=true;this.anchors.push(c)}};iAd.ViewControllerReferencingViewPr ocessor.prototype.cleanUp=function(){var b=this.constructor.PROCESSED_KEY;var a;while(this.anchors.length){a=this.anchors.pop();a.removeEventListener(iAd.Vie w.ACTIVATE_EVENT,this,false);a.removeEventListener("click",this,false);a.removeE ventListener(iAd.SpatialNavigationManager.ACTIVATE_EVENT,this,false);iAd.Spatial NavigationManager.sharedManager.removeNavigableElement(a);delete a[b]}};iAd.ViewControllerReferencingViewProcessor.prototype.shouldHandleEvent=f unction(b){var a=b.currentTarget;if(!iAd.Element.hasCustomAttribute(a,this.constructor.ATTR_NA ME)){return false}if(b.type=="click"&&iAd.Control.isNodeInControlHierarchyBoundedByElement( b.target,a)){return false}return true};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Transaction={transitions:[],openTransactions:0,defaults:{},defaultsStates:[] };iAd.Transaction.begin=function(){if(this.openTransactions==0){this.transitions =[];this.defaults={}}else{var a={};iAd.Utils.copyPropertiesFromSourceToTarget(this.defaults,a);this.defaultsS tates.push(a)}this.openTransactions++};iAd.Transaction.addTransition=function(b) {for(var a in this.defaults){if(b[a]==null){b[a]=this.defaults[a]}}this.transitions.push(b)}; iAd.Transaction.commit=function(){if(this.openTransactions==0){return}this.openT ransactions--;if(this.openTransactions!=0){this.defaults=this.defaultsStates.pop ();return}var c=this.transitions;for(var a=0,b=c.length;a<b;a++){c[a].applyFromState()}iAd.CSS.flushPendingUpdates();set Timeout(function(){while(c.length){c.pop().applyToState()}},0)};iAd.Utils.setupD isplayNames(iAd.Transaction,"iAd.Transaction");

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.TransitionController",superclass:iAd.ViewController,synthes izedProperties:["visibleViewController","cachedViewControllers","loadingViewCont roller"],archivedProperties:["visibleViewController","previouslyVisibleViewContr oller","loadingViewController","loadingViewControllerMinimumDisplayTime"]});iAd. TransitionController.WILL_MAKE_VIEW_CONTROLLER_VISIBLE="transitionControllerWill MakeViewControllerVisibleAnimated";iAd.TransitionController.DID_MAKE_VIEW_CONTRO LLER_VISIBLE="transitionControllerDidMakeViewControllerVisibleAnimated";iAd.Tran sitionController.VIEW_IS_VISIBLE_STATE="ad-transition-controller-visible";iAd.Tr ansitionController.VIEW_IS_HIDDEN_STATE="ad-transition-controller-hidden";iAd.Tr ansitionController.VIEW_BUILDS_IN_STATE="ad-view-builds-in";iAd.TransitionContro ller.VIEW_BUILDS_OUT_STATE="ad-view-builds-out";iAd.TransitionController.VIEW_BU ILDS_IN_ACTION_LIST_CLASS="ad-view-builds-in-action-list";iAd.TransitionControll er.VIEW_BUILDS_OUT_ACTION_LIST_CLASS="ad-view-builds-out-action-list";iAd.Transi tionController.VIEW_IDLE_STATE="ad-view-is-idle";iAd.TransitionController.DEFAUL T_TRANSITION_DURATION=0.35;iAd.TransitionController.WAITING_ON_DISPLAY_CSS_CLASS ="ad-waiting-on-display";iAd.TransitionController.prototype.init=function(b,a){t his.callSuper(b);this._cachedViewControllers=[];this._visibleViewController=null ;this._loadingViewController=null;this.loadingViewControllerMinimumDisplayTime=0 ;this.loadingViewControllerVisible=false;this.delegate=null;this.hidesLoadingVie wControllerWithTransition=true;this.previouslyVisibleViewController=null;this.bu sy=false;if(a!=undefined){this.visibleViewController=a}};iAd.TransitionControlle r.prototype.loadView=function(){this.view=new iAd.TransitionControllerView()};iAd.TransitionController.prototype.setCachedVie wControllers=function(c){var a;var e=this._cachedViewControllers;for(var b=0,d=e.length;b<d;b++){a=e[b];if(a!==this._visibleViewController&&c.indexOf(a) ==-1){a.view.removeFromSuperview()}}for(b=0,d=c.length;b<d;b++){a=c[b];if(a!==th is._visibleViewController&&e.indexOf(a)==-1){this.attachViewController(a)}}this. _cachedViewControllers=c.slice()};iAd.TransitionController.prototype.attachViewC ontroller=function(b){var a=b.view;a.layer.addClassName(iAd.TransitionController.WAITING_ON_DISPLAY_CSS_C LASS);if(a.superview!==this._view){this._view.addSubview(a)}};iAd.TransitionCont roller.prototype.setVisibleViewController=function(a){this.setVisibleViewControl lerAnimated(a,false)};iAd.TransitionController.prototype.setVisibleViewControlle rAnimated=function(b,a){if(this.busy||this._visibleViewController===b){return}iA d.RootViewController.sharedRootViewController.beginIgnoringInteractionEvents();t his.transitionIsDelayedByPreviouslyVisibleViewController=false;this.previouslyVi sibleViewController=this._visibleViewController;this._visibleViewController=b;if (b){b._transitionController=this}if(this.previouslyVisibleViewController!=null){ this.previouslyVisibleViewController.viewWillDisappear(a);this.transitionIsDelay edByPreviouslyVisibleViewController=this.prepareToHideViewController(this.previo uslyVisibleViewController);iAd.SpatialNavigationManager.sharedManager.unregister Subtree(this.previouslyVisibleViewController.view.layer)}if(b==null){this.perfor mTransitionToViewController(b,a);return}this.attachViewController(b);this.nextVi sibleViewController=b;this.willUseAnimationToTransitionToNextVisibleViewControll er=a;if(!this.transitionIsDelayedByPreviouslyVisibleViewController){this.previou sViewControllerDidUnblockTransitions()}if(!b.isViewLoaded()){b.addPropertyObserv er("viewWasProcessed",this,"viewControllerFinishedProcessingView")}};iAd.Transit ionController.prototype.performTransitionToViewController=function(c,b){if(c!=nu ll){c.viewWillAppear(b)}this.dispatchNotification(iAd.TransitionController.WILL_ MAKE_VIEW_CONTROLLER_VISIBLE,this.delegate,[["newlyVisibleViewController",c],["p reviouslyVisibleViewController",this.previouslyVisibleViewController],["animated ",b]]);if(c!=null){this.prepareToShowViewController(c)}iAd.Transaction.begin();v ar d,a=null;this.busy=b;iAd.Transaction.begin();iAd.Transaction.defaults.duration= b?iAd.TransitionController.DEFAULT_TRANSITION_DURATION:0;if(this.previouslyVisib leViewController!=null){d=b?this.previouslyVisibleViewController.becomesHiddenTr ansition:null;if(d!=null){d=this.viewForTransition(this.previouslyVisibleViewCon troller).applyTransition(d,false)}}if(c!=null){a=b?c.becomesVisibleTransition:nu ll;if(a!=null){a=this.viewForTransition(c).applyTransition(a,false)}}if(a instanceof iAd.Transition){a.delegate=this}else{if(d instanceof iAd.Transition){d.delegate=this}else{b=false}}iAd.Transaction.commit();if(c!=nu ll){if(a){setTimeout(function(){c.view.layer.removeClassName(iAd.TransitionContr oller.WAITING_ON_DISPLAY_CSS_CLASS)},0)}else{c.view.layer.removeClassName(iAd.Tr ansitionController.WAITING_ON_DISPLAY_CSS_CLASS)}iAd.SpatialNavigationManager.sh aredManager.registerSubtree(c.view.layer)}if(this.hidesLoadingViewControllerWith Transition){this.hideLoadingViewController()}iAd.Transaction.commit();if(!b){thi s.transitionDidComplete()}};iAd.TransitionController.prototype.performBuildInToV iewController=function(b){if(!b.shouldPlayBuildInActionList){return}var a=b.actionListNameByClassName[iAd.TransitionController.VIEW_BUILDS_IN_ACTION_LI ST_CLASS];if(a){b.enterState(iAd.TransitionController.VIEW_BUILDS_IN_STATE);b.ca llMethodNameAfterDelay("startActionList",0,a);if(b.buildInActionListShouldOnlyPl ayOnce){b.shouldPlayBuildInActionList=false}}};iAd.TransitionController.prototyp e.performBuildOutToViewController=function(b){if(!b.shouldPlayBuildOutActionList ){return false}var a=b.actionListNameByClassName[iAd.TransitionController.VIEW_BUILDS_OUT_ACTION_L IST_CLASS];if(a){b.enterState(iAd.TransitionController.VIEW_BUILDS_OUT_STATE);b. startActionList(a);if(b.buildOutActionListShouldOnlyPlayOnce){b.shouldPlayBuildO utActionList=false}if(b.buildOutActionListShouldDelayTransition){return true}}return false};iAd.TransitionController.prototype.prepareToHideViewController=function( a){var b=false;a.exitState(iAd.TransitionController.VIEW_IS_VISIBLE_STATE);a.enterStat e(iAd.TransitionController.VIEW_IS_HIDDEN_STATE);a.exitState(iAd.TransitionContr oller.VIEW_IDLE_STATE);b=this.performBuildOutToViewController(a);return b};iAd.TransitionController.prototype.prepareToShowViewController=function(a){a .exitState(iAd.TransitionController.VIEW_BUILDS_OUT_STATE);a.exitState(iAd.Trans itionController.VIEW_IS_HIDDEN_STATE);a.enterState(iAd.TransitionController.VIEW _IS_VISIBLE_STATE);a.exitState(iAd.TransitionController.VIEW_IDLE_STATE);if(!a.b uildInActionListShouldOccurAfterTransition){this.performBuildInToViewController( a)}};iAd.TransitionController.prototype.viewControllerActionListDidComplete=func tion(d,a){if(!d.isInState(iAd.TransitionController.VIEW_BUILDS_IN_STATE)&&!d.isI nState(iAd.TransitionController.VIEW_BUILDS_OUT_STATE)){return}var c=a.cssClassName;if(c===iAd.TransitionController.VIEW_BUILDS_OUT_ACTION_LIST_CL ASS){d.exitState(iAd.TransitionController.VIEW_BUILDS_OUT_STATE);if(this.transit ionIsDelayedByPreviouslyVisibleViewController){this.transitionIsDelayedByPreviou slyVisibleViewController=false;this.previousViewControllerDidUnblockTransitions( )}else{if(d===this._loadingViewController){var b=(d.becomesHiddenTransition!=null);this.detachLoadingViewControllerAnimated(b) ;if(d.buildOutActionListShouldDelayTransition){this.showNextViewControllerIfRead y()}}}}else{if(c===iAd.TransitionController.VIEW_BUILDS_IN_ACTION_LIST_CLASS){d. exitState(iAd.TransitionController.VIEW_BUILDS_IN_STATE);if(!this.busy){d.enterS tate(iAd.TransitionController.VIEW_IDLE_STATE);if(d===this._loadingViewControlle r){this.showNextViewControllerIfReady()}}}}};iAd.TransitionController.prototype. viewControllerFinishedProcessingView=function(b,a){b.removePropertyObserver("vie wWasProcessed",this);this.showNextViewControllerIfReady()};iAd.TransitionControl ler.prototype.previousViewControllerDidUnblockTransitions=function(){var a=this.nextVisibleViewController;var b=a.viewLoadingDelaysTransition&&!a.isViewLoaded();if(!a.disableLoadingViewCont roller&&this._loadingViewController&&b){this.showLoadingViewController();return} if(!b){this.performTransitionToViewController(a,this.willUseAnimationToTransitio nToNextVisibleViewController)}};iAd.TransitionController.prototype.viewForTransi tion=function(b){var a=b.view;if(a.size.equals(iAd.Size.ZERO_SIZE)&&b.contentView!=null){a=b.content View}return a};iAd.TransitionController.prototype.viewControllerViewDidAppear=function(b,a) {if(b.buildInActionListShouldOccurAfterTransition){this.performBuildInToViewCont roller(b)}b.viewDidAppear(a)};iAd.TransitionController.prototype.viewControllerV iewDidDisappear=function(b,a){b.viewDidDisappear(a)};iAd.TransitionController.pr ototype.contentTransitionDidComplete=function(b){iAd.RootViewController.sharedRo otViewController.endIgnoringInteractionEvents();var a=this._wasAnimatedTransition=this.busy;if(this.previouslyVisibleViewController !=null){if(this._cachedViewControllers.indexOf(this.previouslyVisibleViewControl ler)==-1){this.previouslyVisibleViewController.view.removeFromSuperview()}else{t his.previouslyVisibleViewController.view.layer.addClassName(iAd.TransitionContro ller.WAITING_ON_DISPLAY_CSS_CLASS)}this.viewControllerViewDidDisappear(this.prev iouslyVisibleViewController,a)}if(this._visibleViewController!=null){if(this.loa dingViewControllerVisible&&!this.hidesLoadingViewControllerWithTransition){this. hideLoadingViewController()}else{this.notifyVisibleViewControllerDidAppear()}}th is.busy=false;this.dispatchNotification(iAd.TransitionController.DID_MAKE_VIEW_C ONTROLLER_VISIBLE,this.delegate,[["newlyVisibleViewController",this._visibleView Controller],["previouslyVisibleViewController",this.previouslyVisibleViewControl ler],["animated",a]])};iAd.TransitionController.prototype.notifyVisibleViewContr ollerDidAppear=function(){var a=this._visibleViewController;if(a.isInState(iAd.ViewController.VIEW_DID_APPEAR _STATE)&&!iAd.TransitionController.__forceNotifyVisibleViewControllerDidAppear){ return}this.viewControllerViewDidAppear(a,this._wasAnimatedTransition);this._was AnimatedTransition=false;var b=a.actionListNameByClassName[iAd.TransitionController.VIEW_BUILDS_IN_ACTION_LI ST_CLASS];if(!b||!a.isInState(iAd.TransitionController.VIEW_BUILDS_IN_STATE)){a. enterState(iAd.TransitionController.VIEW_IDLE_STATE)}};iAd.TransitionController. prototype.setLoadingViewController=function(a){if(this.loadingViewControllerVisi ble){return}if(a&&!a.isViewLoading()&&!a.isViewLoaded()){this.attachViewControll er(a)}this._loadingViewController=a;if(a){a._transitionController=this}};iAd.Tra nsitionController.prototype.showLoadingViewController=function(){if(this.loading ViewControllerVisible||this._loadingViewController==null){return}var c=this._loadingViewController;var b=c.view;var a=(c.becomesVisibleTransition!=null);c.view.layer.removeClassName(iAd.Transitio nController.WAITING_ON_DISPLAY_CSS_CLASS);c.viewWillAppear(a);this.prepareToShow ViewController(this._loadingViewController);if(a){b.size=this._view.size.copy(); b.autoresizingMask=iAd.View.AUTORESIZING_FLEXIBLE_WIDTH|iAd.View.AUTORESIZING_FL EXIBLE_HEIGHT;var d=b.applyTransition(c.becomesVisibleTransition,false);d.delegate=this;this._loa dingViewControllerBecomesVisibleTransition=d}this._view.addSubview(b);this.loadi ngViewControllerVisible=true;if(this.loadingViewControllerMinimumDisplayTime>0){ this.loadingViewDisplayTime=new Date();this.callMethodNameAfterDelay("showNextViewControllerIfReady",this.loadi ngViewControllerMinimumDisplayTime)}if(!a){this.viewControllerViewDidAppear(c,fa lse);this.showNextViewControllerIfReady()}};iAd.TransitionController.prototype.h ideLoadingViewController=function(){if(!this.loadingViewControllerVisible){retur n}var b=this._loadingViewController;if(b.isInState(iAd.ViewController.VIEW_WILL_DISAP PEAR_STATE)){return}var a=(b.becomesHiddenTransition!=null);b.viewWillDisappear(a);this.prepareToHideVi ewController(b);var c=b.actionListNameByClassName[iAd.TransitionController.VIEW_BUILDS_OUT_ACTION_L IST_CLASS];if(!c){this.detachLoadingViewControllerAnimated(a)}};iAd.TransitionCo ntroller.prototype.detachLoadingViewControllerAnimated=function(b){var a=this._loadingViewController;if(b){var c=a.view.applyTransition(a.becomesHiddenTransition,false);c.delegate=this}else{ a.view.removeFromSuperview();this.viewControllerViewDidDisappear(a,false)}this.l oadingViewControllerVisible=false};iAd.TransitionController.prototype.loadingVie wControllerTransitionDidComplete=function(a){if(this.loadingViewControllerVisibl e){this.viewControllerViewDidAppear(this._loadingViewController,true);this.showN extViewControllerIfReady()}else{this._loadingViewController.view.removeFromSuper view();this.viewControllerViewDidDisappear(this._loadingViewController,true);if( !this.hidesLoadingViewControllerWithTransition){this.notifyVisibleViewController DidAppear()}}};iAd.TransitionController.prototype.showNextViewControllerIfReady= function(){if(this.transitionIsDelayedByPreviouslyVisibleViewController){return} if(this.loadingViewControllerVisible){var c=this._loadingViewController;if(c.isInState(iAd.TransitionController.VIEW_BUIL DS_IN_STATE)||c.isInState(iAd.ViewController.VIEW_WILL_APPEAR_STATE)){return}if( this.loadingViewControllerMinimumDisplayTime>0){var a=(Date.now()-this.loadingViewDisplayTime)/1000;if(a<this.loadingViewController MinimumDisplayTime){return}}if(this.hidesLoadingViewControllerWithTransition){va r d=c.actionListNameByClassName[iAd.TransitionController.VIEW_BUILDS_OUT_ACTION_L IST_CLASS];if(d&&c.buildOutActionListShouldDelayTransition){this.hideLoadingView Controller();return}}}var b=this.nextVisibleViewController;if(b&&b.viewLoadingDelaysTransition&&!b.isView Loaded()){return}if(b.isInState(iAd.ViewController.VIEW_WILL_APPEAR_STATE)||b.is InState(iAd.ViewController.VIEW_DID_APPEAR_STATE)){return}this.performTransition ToViewController(b,this.willUseAnimationToTransitionToNextVisibleViewController) };iAd.TransitionController.prototype.transitionDidComplete=function(a){if(a&&thi s._loadingViewController!=null&&a.target===this._loadingViewController.view){thi s.loadingViewControllerTransitionDidComplete(a)}else{this.contentTransitionDidCo mplete(a)}};iAd.Class({name:"iAd.TransitionControllerView",superclass:iAd.View,c ssClassName:"ad-transition-controller-view"});iAd.TransitionControllerView.proto type.init=function(a){this.callSuper(a);this.autoresizingMask=iAd.View.AUTORESIZ ING_FLEXIBLE_WIDTH|iAd.View.AUTORESIZING_FLEXIBLE_HEIGHT};iAd.TransitionControll erView.prototype.willMoveToSuperview=function(a){this.callSuper(a);if(a!=null&&t his._size.equals(iAd.Size.ZERO_SIZE)){this.size=a.size.copy()}};iAd.ViewControll er.prototype.getTransitionController=function(){return this._transitionController||this.parentControllerOfKind(iAd.TransitionControlle r)};iAd.Class.synthesizeProperties(iAd.ViewController,["transitionController"]); iAd.RootViewController.prototype.getTransitionController=function(){if(!this.has OwnProperty("_transitionController")){var b=iAd.RootView.sharedRoot;var a=new iAd.TransitionController();a.view.size=b.size.copy();a.delegate=this;b.addSubvi ew(a.view,0);this._transitionController=a}return this._transitionController};iAd.Class.synthesizeProperties(iAd.RootViewControll er,["transitionController"]);

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.TransitionController.prototype.setLoadingViewController=function(a){if(this. loadingViewControllerVisible){return}this._loadingViewController=a;if(a){a._tran sitionController=this}};iAd.TransitionController.prototype.transitionDidComplete =function(a){if(a&&this._loadingViewController!=null&&a.target===this._loadingVi ewController._view){clearTimeout(this._loadingViewTransitionFallbackTimeout);thi s.loadingViewControllerTransitionDidComplete(a)}else{this.contentTransitionDidCo mplete(a)}};iAd.Utils.replaceMethod(iAd.TransitionController,"showLoadingViewCon troller",function(){this._loadingViewControllerBecomesVisibleTransition=null;thi s.callOriginal.apply(this,arguments);if(this._loadingViewControllerBecomesVisibl eTransition){var b=this;var e=this._loadingViewControllerBecomesVisibleTransition;var a=100;var d=(iAd.Utils.objectIsArray(e.duration))?Math.max.apply(Math.max,e.duration):e.d uration;var c=(iAd.Utils.objectIsArray(e.delay))?Math.max.apply(Math.max,e.delay):e.delay;t his._loadingViewTransitionFallbackTimeout=setTimeout(function(){e.delegate=null; b.transitionDidComplete.call(b,e);this._loadingViewControllerBecomesVisibleTrans ition=null},(c+d)*1000+a)}});

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.NavigationController",superclass:iAd.ViewController,synthes izedProperties:["viewControllers","topViewController","visibleViewController","n avigationBarHidden","toolbar","navigationBar","toolbarHidden"],archivedPropertie s:["viewControllers","navigationBarHidden","toolbarHidden","autoReversesTransiti ons"]});iAd.NavigationController.WILL_SHOW_VIEW_CONTROLLER="navigationController WillShowViewControllerAnimated";iAd.NavigationController.DID_SHOW_VIEW_CONTROLLE R="navigationControllerDidShowViewControllerAnimated";iAd.NavigationController.H IDE_SHOW_BAR_DURATION=0.2;iAd.NavigationController.POPOVER_OFFSET=6;iAd.Navigati onController.prototype.init=function(b,a){this.callSuper(b);this.delegate=null;t his._viewControllers=[];this.autoReversesTransitions=false;this.shouldAnimateIni tialViewController=false;this.previousController=null;this.viewAppearancePropaga tionProperty="visibleViewController";this.shouldArchiveView=false;this.delayedSe tOperationArguments=null;this.backingTransitionController=new iAd.TransitionController();this.backingTransitionController.delegate=this;this. _navigationBarHidden=false;this._toolbarHidden=true;this._navigationBar=null;thi s._toolbar=null;this.requiresDeferredHostViewSizeUpdate=false;if(a!=null){this.v iewControllers=[a]}};iAd.NavigationController.prototype.loadView=function(){var a=new iAd.NavigationView(this);this.view=a;a.layer.addClassName("ad-navigation-contro ller-view");a.size=new iAd.Size(window.innerWidth,window.innerHeight);a.autoresizingMask=iAd.View.AUTO RESIZING_FLEXIBLE_WIDTH|iAd.View.AUTORESIZING_FLEXIBLE_HEIGHT;a.clipsToBounds=tr ue;if(!this._navigationBarHidden&&this.navigationBar){a.addSubview(this.navigati onBar)}this.hostView=a.addSubview(this.backingTransitionController.view);this.ho stView.layer.addClassName("ad-navigation-controller-host-view");if(!this._toolba rHidden&&this.toolbar){a.addSubview(this.toolbar)}a.addPropertyObserver("size",t his,"sizeChanged");this.sizeChanged();this.performDelayedSetOperation();var b=this.topViewController?this.topViewController.view:null;if(b&&b.superview!=th is.hostView){b.size=this.hostView.size.copy();b.autoresizingMask=iAd.View.AUTORE SIZING_FLEXIBLE_WIDTH|iAd.View.AUTORESIZING_FLEXIBLE_HEIGHT;this.hostView.addSub view(b)}a.layer.addEventListener(iAd.SpatialNavigationManager.NAVIGATE_EVENT,thi s,false)};iAd.NavigationController.prototype.viewMovedToNewSuperview=function(){ var a=this._navigationBar;if(!a){return}var b=a.topItem;if(b!=null){b.updateLayoutIfTopItem()}};iAd.NavigationController.pr ototype.unloadView=function(){if(this.hostView){this.hostView.removeFromSupervie w();this.hostView=null}if(this._toolbar){this._toolbar.removeFromSuperview();thi s._toolbar=null}if(this._navigationBar){this._navigationBar.removeFromSuperview( );this._navigationBar=null}this.callSuper()};iAd.NavigationController.prototype. didReceiveMemoryWarning=function(){this.callSuper();var b=this._viewControllers.length-(this._view?2:0);for(var a=0;a<b;a++){this._viewControllers[a].unloadView()}};iAd.NavigationController.p rototype.handleEvent=function(a){if(iAd.SpatialNavigationManager&&a.type==iAd.Sp atialNavigationManager.NAVIGATE_EVENT){if(a.ad.command==iAd.Event.KEYBOARD_BACKS PACE){this.popViewControllerAnimated(true);a.preventDefault()}}else{this.callSup er(a)}};iAd.NavigationController.prototype.getNavigationBar=function(){var a=this._navigationBar;if(!a){if(!iAd.NavigationBar){iAd.Console.warn("iAd.Navig ationController: Attempting to create a navigation bar but iAd.NavigationBar is undefined; navigationBarHidden will be set to true. You must explicitly require iAd.NavigationBar in your project.");this._navigationBarHidden=true;return null}var a=this._navigationBar=new iAd.NavigationBar();a.autoresizingMask=iAd.View.AUTORESIZING_FLEXIBLE_WIDTH;if( this.isViewLoaded()){a.size=new iAd.Size(this.view.size.width,iAd.NavigationBar.DEFAULT_HEIGHT)}}return a};iAd.NavigationController.prototype.getToolbar=function(){var a=this._toolbar;if(!a){if(!iAd.Toolbar){iAd.Console.warn("iAd.NavigationControl ler: Attempting to create a toolbar but iAd.Toolbar is undefined; toolbarHidden will be set to true. You must explicitly require iAd.Toolbar in your project.");this._toolbarHidden=true;return null}var a=this._toolbar=new iAd.Toolbar();a.autoresizingMask=iAd.View.AUTORESIZING_FLEXIBLE_WIDTH;if(this.i sViewLoaded()){a.size=new iAd.Size(this.view.size.width,iAd.Toolbar.DEFAULT_HEIGHT)}}return a};iAd.NavigationController.prototype.getTopViewController=function(){return(th is.viewControllers.length>0)?this.viewControllers[this.viewControllers.length-1] :null};iAd.NavigationController.prototype.getVisibleViewController=function(){va r a=this.topViewController;return a.modalViewController||a};iAd.NavigationController.prototype.getViewControllers =function(){return(this.delayedSetOperationArguments!=null)?this.delayedSetOpera tionArguments[0]:this._viewControllers};iAd.NavigationController.prototype.setVi ewControllers=function(a){this.setViewControllersAnimated(a,false)};iAd.Navigati onController.prototype.setViewControllersAnimated=function(g,e){if(g.length==0){ return}if(this.shouldDelaySetOperation()){this.delayedSetOperationArguments=argu ments;return}iAd.Transaction.begin();var f=(this._viewControllers.length>0)?this._viewControllers[this._viewControllers. length-1]:null;var a=g[g.length-1];var h=(this._viewControllers.indexOf(a)!=-1);var c=(!f&&e)?this.shouldAnimateInitialViewController:e;this.dispatchWillShowNotifi cation(a,c);for(var b=0,d=this._viewControllers.length;b<d;b++){this._viewControllers[b].parentView Controller=null}for(var b=0,d=g.length;b<d;b++){g[b].parentViewController=this}this._viewControllers=g; this.prepareViewControllersForTransition(f,a,h);this.backingTransitionController .setVisibleViewControllerAnimated(a,c);iAd.Transaction.commit()};iAd.NavigationC ontroller.prototype.prepareViewControllersForTransition=function(b,c,a){if(b==nu ll){c.becomesVisibleTransition=c.becomesTopItemTransition}else{if(b!==c){if(this .autoReversesTransitions){b.becomesHiddenTransition=a?b.wasTopItemTransition:c.b ecomesBackItemTransition;c.becomesVisibleTransition=a?b.wasBackItemTransition:c. becomesTopItemTransition}else{b.becomesHiddenTransition=a?b.wasTopItemTransition :b.becomesBackItemTransition;c.becomesVisibleTransition=a?c.wasBackItemTransitio n:c.becomesTopItemTransition}}}c.view.size=this.hostView.size.copy();c.view.auto resizingMask=iAd.View.AUTORESIZING_FLEXIBLE_WIDTH|iAd.View.AUTORESIZING_FLEXIBLE _HEIGHT};iAd.NavigationController.prototype.shouldDelaySetOperation=function(){r eturn !this.isViewLoaded()||this.backingTransitionController.busy||(!this.navigationB arHidden&&this.navigationBar.busy)};iAd.NavigationController.prototype.pushViewC ontrollerAnimated=function(a,b){if(this.viewControllers.indexOf(a)!=-1){iAd.Cons ole.warn("iAd.NavigationController.prototype.pushViewControllerAnimated: attempt to push a view controller already in the stack");return}this.setViewControllersAnimated(this.viewControllers.concat([a]) ,b)};iAd.NavigationController.prototype.popViewControllerAnimated=function(b){if (this.viewControllers.length>1){var a=this.topViewController;this.setViewControllersAnimated(this.viewControllers.s lice(0,this.viewControllers.length-1),b);return a}return null};iAd.NavigationController.prototype.popToRootViewControllerAnimated=functi on(a){return this.popToViewControllerAnimated(this.viewControllers[0],a)};iAd.NavigationCont roller.prototype.popToViewControllerAnimated=function(a,c){var d=this.viewControllers.indexOf(a);if(d<0||d>=this.viewControllers.length-1){ret urn[]}var b=this.viewControllers.slice(d+1);this.setViewControllersAnimated(this.viewCont rollers.slice(0,d+1),c);return b};iAd.NavigationController.prototype.transitionControllerWillMakeViewControlle rVisibleAnimated=function(d,b,c,e){var a=this._navigationBar;if(a){var h=[];for(var f=0,g=this._viewControllers.length;f<g;f++){h.push(this._viewControllers[f].nav igationItem)}a.setItemsAnimated(h,this.navigationBarHidden?false:e)}var j=this._toolbar;if(j){j.setItemsAnimated(b.toolbarItems,e)}};iAd.NavigationCont roller.prototype.transitionControllerDidMakeViewControllerVisibleAnimated=functi on(b,d,a,c){this.dispatchDidShowNotification(d,c);this.callMethodNameAfterDelay( "performDelayedSetOperation",0)};iAd.NavigationController.prototype.dispatchDidS howNotification=function(b,a){this.dispatchNotification(iAd.NavigationController .DID_SHOW_VIEW_CONTROLLER,this.delegate,[["viewController",b],["animated",a]])}; iAd.NavigationController.prototype.dispatchWillShowNotification=function(b,a){th is.dispatchNotification(iAd.NavigationController.WILL_SHOW_VIEW_CONTROLLER,this. delegate,[["viewController",b],["animated",a]])};iAd.NavigationController.protot ype.performDelayedSetOperation=function(){if(this.delayedSetOperationArguments== null){return}if(this._navigationBar&&this.navigationBar.busy){this.navigationBar .addPropertyObserver("busy",this,"navigationBarBusyStateChanged")}else{this.setV iewControllersAnimated(this.delayedSetOperationArguments[0],this.delayedSetOpera tionArguments[1]);this.delayedSetOperationArguments=null}};iAd.NavigationControl ler.prototype.navigationBarBusyStateChanged=function(){if(this._navigationBar&&t his.navigationBar.busy){return}this.navigationBar.removePropertyObserver("busy", this,"navigationBarBusyStateChanged");this.performDelayedSetOperation()};iAd.Nav igationController.prototype.sizeChanged=function(){var d=this.hostedInPopoverController();var c=iAd.NavigationBar?-iAd.NavigationBar.DEFAULT_HEIGHT:0;var b=0;var f=this._view.size.height;if(!this._navigationBarHidden){c=d?-iAd.NavigationCont roller.POPOVER_OFFSET:0;b+=iAd.NavigationBar.DEFAULT_HEIGHT-(d?iAd.NavigationCon troller.POPOVER_OFFSET:0)}if(!this._toolbarHidden){f-=iAd.Toolbar.DEFAULT_HEIGHT -(d?iAd.NavigationController.POPOVER_OFFSET+1:0)}this.hostView.position=new iAd.Point(0,b);var a=this._navigationBar;if(a){a.position=new iAd.Point(0,c)}var e=this._toolbar;if(e){this.toolbar.position=new iAd.Point(0,f)}this.updateHostViewSize()};iAd.NavigationController.prototype.up dateHostViewSize=function(){var a=this._view.size.height;var b=this.hostedInPopoverController();if(!this._navigationBarHidden){a-=iAd.Naviga tionBar.DEFAULT_HEIGHT-(b?iAd.NavigationController.POPOVER_OFFSET:0)}if(!this._t oolbarHidden){a-=iAd.Toolbar.DEFAULT_HEIGHT-(b?iAd.NavigationController.POPOVER_ OFFSET:0)}this.hostView.size=new iAd.Size(this._view.size.width,a)};iAd.NavigationController.prototype.hostedInP opoverController=function(){return iAd.Utils.objectIsInstanceOfClass(this.parentViewController,iAd.PopoverControll er)};iAd.NavigationController.prototype.setNavigationBarHidden=function(a){this. setNavigationBarHiddenAnimated(a,false)};iAd.NavigationController.prototype.setN avigationBarHiddenAnimated=function(f,e){if(this._navigationBarHidden==f){return }this._navigationBarHidden=f;if(!this.isViewLoaded()){return}var a=this._navigationBar;if(!a&&f){return}var c=this.hostedInPopoverController();var b=new iAd.Point(0,f?-iAd.NavigationBar.DEFAULT_HEIGHT:(c?-iAd.NavigationController.PO POVER_OFFSET:0));var d=new iAd.Point(0,f?0:iAd.NavigationBar.DEFAULT_HEIGHT-(c?iAd.NavigationController.PO POVER_OFFSET:0));if(!f){this.view.addSubview(this.navigationBar)}if(!e){a.positi on=b;this.hostView.position=d;this.updateHostViewSize();if(f){a.removeFromSuperv iew()}return}iAd.Transaction.begin();iAd.Transaction.defaults.duration=e?iAd.Nav igationController.HIDE_SHOW_BAR_DURATION:0;iAd.Transaction.defaults.properties=[ "position"];a.applyTransition({to:[b],removesTargetUponCompletion:f});this.hostV iew.applyTransition({to:[d],delegate:this});iAd.Transaction.commit();if(f){this. updateHostViewSize()}else{this.requiresDeferredHostViewSizeUpdate=true}};iAd.Nav igationController.prototype.transitionDidComplete=function(a){if(this.requiresDe ferredHostViewSizeUpdate){this.requiresDeferredHostViewSizeUpdate=false;this.upd ateHostViewSize()}};iAd.NavigationController.prototype.setToolbarHidden=function (a){this.setToolbarHiddenAnimated(a,false)};iAd.NavigationController.prototype.s etToolbarHiddenAnimated=function(b,a){if(this._toolbarHidden==b){return}this._to olbarHidden=b;if(!this.isViewLoaded()){return}if(!this._toolbar&&b){return}var c=new iAd.Point(0,this._view.size.height-(b?0:iAd.Toolbar.DEFAULT_HEIGHT));if(this.ho stedInPopoverController()){c.y+=iAd.NavigationController.POPOVER_OFFSET}if(!b){t his.view.addSubview(this.toolbar)}if(!a){this.toolbar.position=c;this.updateHost ViewSize();if(b){this.toolbar.removeFromSuperview()}return}new iAd.Transition({target:this.toolbar,properties:["position"],to:[c],duration:a?i Ad.NavigationController.HIDE_SHOW_BAR_DURATION:0,delegate:this,removesTargetUpon Completion:b}).start();if(b){this.updateHostViewSize()}else{this.requiresDeferre dHostViewSizeUpdate=true}this.notifyPropertyChange("toolbarHidden")};iAd.Class({ name:"iAd.NavigationView",superclass:iAd.View});iAd.NavigationView.prototype.ini t=function(a){this.callSuper();this.viewController=a};iAd.NavigationView.prototy pe.didMoveToSuperview=function(a){this.callSuper(a);if(a!=null){this.viewControl ler.viewMovedToNewSuperview()}};iAd.ViewController.prototype.getNavigationContro ller=function(){return this.parentControllerOfKind(iAd.NavigationController)};iAd.ViewController.proto type.getNavigationItem=function(){if(this._navigationItem==null){this._navigatio nItem=new iAd.NavigationItem(this.title);this._navigationItem.viewController=this}return this._navigationItem};iAd.ViewController.prototype.setToolbarItems=function(a){ this.setToolbarItemsAnimated(a,false)};iAd.ViewController.prototype.setToolbarIt emsAnimated=function(b,c){if(!b){return}this._toolbarItems=b;var a=this.parentViewController;if(a!=null&&a instanceof iAd.NavigationController){a.toolbar.setItemsAnimated(b,c)}};iAd.Class.synthesiz eProperties(iAd.ViewController,["navigationController","navigationItem","toolbar Items"]);iAd.Class.processMethods(iAd.ViewController,["setToolbarItemsAnimated"] );iAd.RootViewController.prototype.getNavigationController=function(){if(!this.h asOwnProperty("_navigationController")){this.navigationController=new iAd.NavigationController()}return this._navigationController};iAd.RootViewController.prototype.setNavigationContr oller=function(b){b.navigationBarHidden=true;b.shouldAnimateInitialViewControlle r=true;b.delegate=this;var a=this.view;b.view.size=a._size.copy();a.addSubview(b.view);this._navigationCon troller=b};iAd.Class.synthesizeProperties(iAd.RootViewController,["navigationCon troller"]);

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Utils.replaceMethod(iAd.NavigationView,"init",function(){this.callOriginal.a pply(this,arguments);if(iAP.Context.IS_SAFARI){this.autoresizesSubviews=false}}) ;

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.NavigationViewProcessor",superclass:iAd.ViewControllerRefer encingViewProcessor});iAd.NavigationViewProcessor.PREVIOUS_ITEM_ID="{previous-it em}";iAd.NavigationViewProcessor.ATTR_NAME="ad-navigates-to";iAd.NavigationViewP rocessor.PROCESSED_KEY="_adProcessedNavigatesTo";iAd.NavigationViewProcessor.pro totype.handleEvent=function(e){if(!this.shouldHandleEvent(e)){return}var d=e.currentTarget;var f=iAd.Element.getCustomAttribute(d,iAd.NavigationViewProcessor.ATTR_NAME);var b=iAd.RootViewController.sharedRootViewController.navigationController;if(f==iA d.NavigationViewProcessor.PREVIOUS_ITEM_ID){b.popViewControllerAnimated(true)}el se{var a=iAd.ViewController.instances[f];if(a){var c=(b.viewControllers.indexOf(a)!=-1);if(c){b.popToViewControllerAnimated(a,true )}else{b.pushViewControllerAnimated(a,true)}}}};iAd.ViewController.addViewProces sor(iAd.NavigationViewProcessor);

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.OutletsViewProcessor",superclass:iAd.ViewProcessor});iAd.Ou tletsViewProcessor.prototype.init=function(a){this.callSuper(a);this.outlets=[]} ;iAd.OutletsViewProcessor.prototype.processView=function(b){var a="ad-outlet";var d=iAd.Element.HTML5_CUSTOM_ATTRIBUTE_PREFIX+a;var g;var f=b.layer.querySelectorAll("["+d+"],["+a+"]");for(var c=0,e=f.length;c<e;c++){g=f[c];this.viewController.outlets[iAd.Element.getCusto mAttribute(g,a)]=(g.hasOwnProperty("_view"))?g._view:g}};iAd.OutletsViewProcesso r.prototype.cleanUp=function(){for(var a in this.viewController.outlets){delete this.viewController.outlets[a]}};iAd.ViewController.addViewProcessor(iAd.Outlet sViewProcessor);

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Bindings={};iAd.Bindings.SHIMS_ENABLED=false;iAd.BindingUtils={};iAd.Binding Utils.BINDING_UNAVAILABLE_ERROR="This binding is unavailable.";iAd.BindingUtils.initializeBindingObject=function(b,a){var c=a?b:b.constructor;b._binding=c.BINDING_OBJECT;if(!iAd.Bindings.SHIMS_ENABLED& &b._binding.shim){b._binding=null}b._bindingClass=c.BINDING_CLASS;b._bindingProt ocol=c.BINDING_PROTOCOL};iAd.BindingUtils.registerBindingClass=function(a){Objec t.defineProperty(a,"available",{get:function(){if(this.hasOwnProperty("getAvaila ble")){return this.getAvailable()}else{return iAd.BindingUtils.isBindingClassAvailable(this)}}})};iAd.BindingUtils.isBindingC lassAvailable=function(a){return !!(a.BINDING_OBJECT&&(iAd.Bindings.SHIMS_ENABLED||!a.BINDING_OBJECT.shim))};iAd .BindingUtils.isErrorFromModalActivity=function(a){var b=this.sanitizeMessageFromError(a);return(b&&b.indexOf("modal activity is in progress")!==-1)};iAd.BindingUtils.sanitizeMessageFromError=function(a){if(!a){ return""}if(a.hasOwnProperty("message")){return a.message}return a.toString()};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

window._ad={shim:true};if(!window.ADAd){window._ADAd={ADInterfaceOrientationLand scapeLeft:4,ADInterfaceOrientationLandscapeRight:8,ADInterfaceOrientationPortrai t:1,ADInterfaceOrientationPortraitUpsideDown:2,kInvalidOrCorruptImageError:4,kIn validURL:100,kURLInvalidSchemeViolation:105,kURLRelativePathViolation:103,kURLSa meOriginPolicyViolation:104}}if(!window.ADNetworkTypeListener){window._ADNetwork TypeListener={kADNetworkTypeListenerNetworkType3G:3,kADNetworkTypeListenerNetwor kTypeEDGE:2,kADNetworkTypeListenerNetworkTypeGPRS:1,kADNetworkTypeListenerNetwor kTypeUnknown:0,kADNetworkTypeListenerNetworkTypeWiFi:4};window._ad.networkType=w indow._ADNetworkTypeListener.kADNetworkTypeListenerNetworkTypeUnknown}if(!window .ad||!window.ad.hasOwnProperty("currentSupportedInterfaceOrientations")){window. _ad.currentSupportedInterfaceOrientations=0}if(!window.ad||!window.ad.hasOwnProp erty("locationServicesEnabled")){window._ad.locationServicesEnabled=false}if(!wi ndow.ad){Object.defineProperty(window._ad,"deviceOrientationListener",{set:funct ion(a){if(iAd.Bindings.SHIMS_ENABLED){a.deviceOrientationDidChange(0)}}})}if(!wi ndow.ad||!window.ad.hasOwnProperty("canOpenURL")){window._ad.canOpenURL=function (){return false}}if(!window.ad||!window.ad.hasOwnProperty("isTargetApplicationInstalled") ){window._ad.isTargetApplicationInstalled=function(){return false}};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

if(!Function.prototype.hasOwnProperty("bind")){Function.prototype.bind=function( b){if(typeof this!=="function"){throw new TypeError("Function.prototype.bind - cannot bind something that is not callable")}var e=Array.prototype.slice.call(arguments,1),d=this,c=function(){},a=function(){va r f=(this instanceof c)?this:(b||window);return d.apply(f,e.concat(Array.prototype.slice.call(arguments)))};c.prototype=this.pr ototype;a.prototype=new c();return a}};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Device._binding=window.ad||window._ad;iAd.Device._bindingProtocol=window._AD Ad||window.ADAd;iAd.Device._bindingNetworkProtocol=window._ADNetworkTypeListener ||window.ADNetworkTypeListener;iAd.Device.SHAKE_EVENT="deviceShakeDidOccur";iAd. Device.NETWORK_TYPE_CHANGE_EVENT="deviceNetworkTypeDidChange";iAd.Device.ORIENTA TION_DID_CHANGE_EVENT="deviceOrientationDidChange";iAd.Device.NETWORK_TYPE_UNKNO WN=iAd.Device._bindingNetworkProtocol.kADNetworkTypeListenerNetworkTypeUnknown;i Ad.Device.NETWORK_TYPE_GPRS=iAd.Device._bindingNetworkProtocol.kADNetworkTypeLis tenerNetworkTypeGPRS;iAd.Device.NETWORK_TYPE_EDGE=iAd.Device._bindingNetworkProt ocol.kADNetworkTypeListenerNetworkTypeEDGE;iAd.Device.NETWORK_TYPE_3G=iAd.Device ._bindingNetworkProtocol.kADNetworkTypeListenerNetworkType3G;iAd.Device.NETWORK_ TYPE_WIFI=iAd.Device._bindingNetworkProtocol.kADNetworkTypeListenerNetworkTypeWi Fi;iAd.Device.ORIENTATION_UNKNOWN=-1;iAd.Device.ORIENTATION_FACE_UP=5;iAd.Device .ORIENTATION_FACE_DOWN=6;iAd.Device.BINDING_DEVICE_ORIENTATION_UNKNOWN=0;iAd.Dev ice.BINDING_DEVICE_ORIENTATION_PORTRAIT=1;iAd.Device.BINDING_DEVICE_ORIENTATION_ PORTRAIT_UPSIDE_DOWN=2;iAd.Device.BINDING_DEVICE_ORIENTATION_LANDSCAPE_LEFT=3;iA d.Device.BINDING_DEVICE_ORIENTATION_LANDSCAPE_RIGHT=4;iAd.Device.BINDING_DEVICE_ ORIENTATION_FACE_UP=5;iAd.Device.BINDING_DEVICE_ORIENTATION_FACE_DOWN=6;iAd.Devi ce.orientationForBindingDeviceOrientation=function(a){switch(a){case iAd.Device.BINDING_DEVICE_ORIENTATION_PORTRAIT:return iAd.Device.ORIENTATION_PORTRAIT;case iAd.Device.BINDING_DEVICE_ORIENTATION_PORTRAIT_UPSIDE_DOWN:return iAd.Device.ORIENTATION_PORTRAIT_UPSIDE_DOWN;case iAd.Device.BINDING_DEVICE_ORIENTATION_LANDSCAPE_LEFT:return iAd.Device.ORIENTATION_LANDSCAPE_LEFT;case iAd.Device.BINDING_DEVICE_ORIENTATION_LANDSCAPE_RIGHT:return iAd.Device.ORIENTATION_LANDSCAPE_RIGHT;case iAd.Device.BINDING_DEVICE_ORIENTATION_FACE_UP:return iAd.Device.ORIENTATION_FACE_UP;case iAd.Device.BINDING_DEVICE_ORIENTATION_FACE_DOWN:return iAd.Device.ORIENTATION_FACE_DOWN;default:return iAd.Device.ORIENTATION_UNKNOWN}};iAd.Device.BINDING_ORIENTATION_UNKNOWN=0;iAd.D evice.BINDING_ORIENTATION_PORTRAIT=iAd.Device._bindingProtocol.ADInterfaceOrient ationPortrait;iAd.Device.BINDING_ORIENTATION_PORTRAIT_UPSIDE_DOWN=iAd.Device._bi ndingProtocol.ADInterfaceOrientationPortraitUpsideDown;iAd.Device.BINDING_ORIENT ATION_LANDSCAPE_LEFT=iAd.Device._bindingProtocol.ADInterfaceOrientationLandscape Left;iAd.Device.BINDING_ORIENTATION_LANDSCAPE_RIGHT=iAd.Device._bindingProtocol. ADInterfaceOrientationLandscapeRight;iAd.Device.BINDING_ORIENTATIONS=[iAd.Device .BINDING_ORIENTATION_PORTRAIT,iAd.Device.BINDING_ORIENTATION_PORTRAIT_UPSIDE_DOW N,iAd.Device.BINDING_ORIENTATION_LANDSCAPE_LEFT,iAd.Device.BINDING_ORIENTATION_L ANDSCAPE_RIGHT];iAd.Device.orientationForBindingOrientation=function(a){switch(a ){case iAd.Device.BINDING_ORIENTATION_PORTRAIT:return iAd.Device.ORIENTATION_PORTRAIT;case iAd.Device.BINDING_ORIENTATION_PORTRAIT_UPSIDE_DOWN:return iAd.Device.ORIENTATION_PORTRAIT_UPSIDE_DOWN;case iAd.Device.BINDING_ORIENTATION_LANDSCAPE_LEFT:return iAd.Device.ORIENTATION_LANDSCAPE_LEFT;case iAd.Device.BINDING_ORIENTATION_LANDSCAPE_RIGHT:return iAd.Device.ORIENTATION_LANDSCAPE_RIGHT;default:return null}};iAd.Device.bindingOrientationForOrientation=function(a){switch(a){case iAd.Device.ORIENTATION_PORTRAIT:return iAd.Device.BINDING_ORIENTATION_PORTRAIT;case iAd.Device.ORIENTATION_PORTRAIT_UPSIDE_DOWN:return iAd.Device.BINDING_ORIENTATION_PORTRAIT_UPSIDE_DOWN;case iAd.Device.ORIENTATION_LANDSCAPE_LEFT:return iAd.Device.BINDING_ORIENTATION_LANDSCAPE_LEFT;case iAd.Device.ORIENTATION_LANDSCAPE_RIGHT:return iAd.Device.BINDING_ORIENTATION_LANDSCAPE_RIGHT;default:return null}};iAd.Device.eventTarget=document;iAd.Device.setupBindings=function(){iAd. Utils.copyPropertiesFromSourceToTarget(iAd.EventTarget,this);var a=iAd.Device._binding;a.networkTypeListener=this;a.shakeEventsListener=this;a.d eviceOrientationListener=this};iAd.Device.shakeEventDidOccur=function(){this.cre ateAndDispatchEvent(iAd.Device.SHAKE_EVENT)};iAd.Device.networkTypeDidChange=fun ction(a){this.createAndDispatchEvent(iAd.Device.NETWORK_TYPE_CHANGE_EVENT,[["net workType",a]])};iAd.Device.deviceOrientationDidChange=function(a){this.orientati on=iAd.Device.orientationForBindingDeviceOrientation(a);this.createAndDispatchEv ent(iAd.Device.ORIENTATION_DID_CHANGE_EVENT,[["orientation",this.orientation]])} ;iAd.Device.getSupportedOrientations=function(){var b=iAd.Device._binding.currentSupportedInterfaceOrientations,e=[],a;for(var c=0,d=iAd.Device.BINDING_ORIENTATIONS.length;c<d;c++){a=iAd.Device.BINDING_ORIE NTATIONS[c];if(b&a){e.push(iAd.Device.orientationForBindingOrientation(a))}}retu rn e};iAd.Device.setSupportedOrientations=function(d){var a;for(var b=0,c=d.length;b<c;b++){a|=iAd.Device.bindingOrientationForOrientation(d[b])}tr y{iAd.Device._binding.currentSupportedInterfaceOrientations=a}catch(f){iAd.Conso le.warn("iAd.Device: There was an error setting .supportedOrientations")}};Object.defineProperty(iAd.Device,"supportedOrientati ons",{get:iAd.Device.getSupportedOrientations,set:iAd.Device.setSupportedOrienta tions});iAd.Device.getNetworkType=function(){return this._binding.networkType};Object.defineProperty(iAd.Device,"networkType",{get: iAd.Device.getNetworkType});iAd.Device.getLocationServicesEnabled=function(){ret urn this._binding.locationServicesEnabled};Object.defineProperty(iAd.Device,"locati onServicesEnabled",{get:iAd.Device.getLocationServicesEnabled});iAd.Device.canOp enURL=function(a){return !!(this._binding.canOpenURL&&this._binding.canOpenURL(a))};iAd.Device.isTargetA pplicationInstalled=function(){return !!(this._binding.isTargetApplicationInstalled&&this._binding.isTargetApplicatio nInstalled())};window.addEventListener("DOMContentLoaded",iAd.Device.setupBindin gs.bind(iAd.Device),true);

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAP.ViewController",superclass:iAd.ViewController,synthesizedPr operties:["readyToTransition","nextViewController","autoAdvanceToNextViewControl ler","autoAdvanceCondition","minimumDelayBeforeTransition"],archivedProperties:[ "readyToTransition","nextViewController","autoAdvanceToNextViewController","auto AdvanceCondition","minimumDelayBeforeTransition"]});iAP.ViewController.ORIENTATI ON_UNKNOWN=0;iAP.ViewController.ORIENTATION_PORTRAIT=1;iAP.ViewController.ORIENT ATION_PORTRAIT_UPSIDE_DOWN=2;iAP.ViewController.ORIENTATION_LANDSCAPE_LEFT=3;iAP .ViewController.ORIENTATION_LANDSCAPE_RIGHT=4;iAP.ViewController.VIEW_DID_SHAKE= "viewControllerViewDidShake";iAP.ViewController.VIEW_DID_ACTIVATE="viewControlle rViewDidActivate";iAd.ViewController.TRANSITION_IN_FROM_RIGHT=function(b){var a=b.size.width;return{properties:["transform"],from:["translateX("+a+"px)"],to: ["translateX(0)"]}};iAd.ViewController.TRANSITION_IN_FROM_LEFT=function(b){var a=-b.size.width;return{properties:["transform"],from:["translateX("+a+"px)"],to :["translateX(0)"]}};iAd.ViewController.TRANSITION_OUT_TO_RIGHT=function(b){var a=b.size.width;return{properties:["transform"],from:["translateX(0)"],to:["tran slateX("+a+"px)"]}};iAd.ViewController.TRANSITION_OUT_TO_LEFT=function(b){var a=-b.size.width;return{properties:["transform"],from:["translateX(0)"],to:["tra nslateX("+a+"px)"]}};iAP.ViewController.prototype.init=function(a){this.shouldPl ayBuildOutActionList=true;this.shouldPlayBuildInActionList=true;this.buildInActi onListShouldOnlyPlayOnce=false;this.buildOutActionListShouldOnlyPlayOnce=false;t his.buildInActionListShouldDelayTransition=true;this.nextViewControllerID=null;t his._autoAdvanceToNextViewController=false;this._autoAdvanceCondition="no-activi ty";this._minimumDelayBeforeTransition=0;this._loadingTimeoutDuration=3;this._au toAdvanceToNextViewControllerOnTimeout=false;this.callSuper(a);if(!this.configur ation.properties){this.configuration.properties={}}var l=this;Object.defineProperty(this.configuration.properties,"autoAdvanceToNextVi ewController",{get:function(){iAd.Console.warn('Checking "viewController.configuration.properties.autoAdvanceToNextViewController" is no longer supported. Use "viewController.autoAdvanceToNextViewController" instead.');return l.autoAdvanceToNextViewController},set:function(i){iAd.Console.warn('Setting "viewController.configuration.properties.autoAdvanceToNextViewController" is no longer supported. Use "viewController.autoAdvanceToNextViewController" instead.');l.autoAdvanceToNextViewController=i;return l.autoAdvanceToNextViewController}});this._readyToTransition=false;this._should PreloadNextViewControllers=true;this._orientationCode=iAP.ViewController.ORIENTA TION_UNKNOWN;this._additionalImages=[];this.becomesReadyToTransitionWhenViewsAre Loaded=true;this.viewControllerContainers=[];if(a.isBackgroundLayer){this.view.a utoresizingMask=iAd.View.AUTORESIZING_FLEXIBLE_WIDTH|iAd.View.AUTORESIZING_FLEXI BLE_HEIGHT;this.view.resizeWithOldSuperviewSize(this.view.size)}if(a.disablesAna lytics){this.disablesAnalytics=a.disablesAnalytics}if(a.analyticsId){this.analyt icsID=a.analyticsId}var j=iAP.EventDelegate.viewControllerScriptFunctions[a.id];if(j){var d=new iAP.EventDelegate(this,this,j);d.processUserScript()}var k=null;if(this.transitionDuration){k=parseFloat(this.transitionDuration)}var b=["wasBackItemTransition","becomesBackItemTransition","wasTopItemTransition"," becomesTopItemTransition","becomesHiddenTransition"];for(var c=0,f=b.length;c<f;c++){var e=b[c];var g=this[e];if(g){if(k>0){if(iAd.Utils.objectIsFunction(g)){this[e]=(function(i){ return function(m){var n=i(m);n.revertsToOriginalValues=true;n.duration=k;return n}})(g)}else{var h={};iAd.Utils.copyPropertiesFromSourceToTarget(g,h);this[e]=g=h;g.revertsToOri ginalValues=true;g.duration=k}}else{this[e]=null}}}if(iAP.Context.IS_IOS){docume nt.addEventListener("focus",this,true);document.addEventListener("blur",this,tru e)}};iAP.ViewController.prototype.loadView=function(){if(this.configuration.isBa ckgroundLayer){this.view=iAd.View.getViewById(this.id);this.__visible=false}else {this.callSuper()}};iAP.ViewController.prototype.setContentView=function(a){if(t his._contentView==a){return}if(a&&this.__handlesActivateEvent){a.userInteraction Enabled=true;a.addEventListener(iAd.View.ACTIVATE_EVENT,this,false)}this.callSup er.apply(this,arguments);if(!this.view.size.equals(iAd.Size.ZERO_SIZE)){a.size=t his.view.size}};iAP.ViewController.prototype.clearScrollToTopTimer=function(){if (this._scrollToTopTimer){clearTimeout(this._scrollToTopTimer);this._scrollToTopT imer=null}};iAP.ViewController.prototype.clearAutoAdvanceTimer=function(){if(thi s._autoAdvanceTimer){clearTimeout(this._autoAdvanceTimer);this._autoAdvanceTimer =null}};iAP.ViewController.prototype.handleEvent=function(b){var a=b.type;if(a==iAd.Device.SHAKE_EVENT){this.createAndDispatchEvent(iAP.ViewCont roller.VIEW_DID_SHAKE)}else{if(a==iAd.View.ACTIVATE_EVENT&&this.contentView&&thi s.contentView.layer==b.ad.originalEvent.target){this.createAndDispatchEvent(iAP. ViewController.VIEW_DID_ACTIVATE)}else{if(a=="orientationchange"&&this.orientati on==iAP.ViewController.ORIENTATION_UNKNOWN){if(window.orientation==0){this.setOr ientation(iAP.ViewController.ORIENTATION_PORTRAIT)}else{if(window.orientation==- 90){this.setOrientation(iAP.ViewController.ORIENTATION_LANDSCAPE_RIGHT)}else{if( window.orientation==180){this.setOrientation(iAP.ViewController.ORIENTATION_PORT RAIT_UPSIDE_DOWN)}else{if(window.orientation==90){this.setOrientation(iAP.ViewCo ntroller.ORIENTATION_LANDSCAPE_LEFT)}}}}}else{if(this.contentView&&["TEXTAREA"," INPUT"].indexOf(b.target.nodeName)!=-1){if(a=="focus"){this.contentView.layer.st yle.overflow="hidden";this.clearScrollToTopTimer()}else{if(a=="blur"){this.conte ntView.layer.style.overflow="visible";if(!iAd.Device.iOSVersionLessThan("5.0")){ this.clearScrollToTopTimer();this._scrollToTopTimer=setTimeout(function(){window .scrollTo(0,0)},100)}}}}}}}if(this._autoAdvanceToNextViewController){if(a==iAd.E vent.START_EVENT){this.clearAutoAdvanceTimer();window.addEventListener(iAd.Event .END_EVENT,this,true)}else{if(a==iAd.Event.END_EVENT){this._idleStartTime=Date.n ow();this._autoAdvanceTimer=this.callMethodNameAfterDelay("transitionToNextViewC ontroller",this._minimumDelayBeforeTransition);window.removeEventListener(iAd.Ev ent.END_EVENT,this,true)}}}this.callSuper(b)};iAP.ViewController.prototype.getNe xtViewController=function(){return this.nextViewControllerID?iAd.ViewController.instances[this.nextViewControllerI D]:null};iAP.ViewController.prototype.setNextViewController=function(a){this.nex tViewControllerID=a.id};iAP.ViewController.prototype.isInitialViewController=fun ction(){return this.id==iAd.RootViewController.sharedRootViewController.initialViewControllerI D};iAP.ViewController.prototype.preloadNextViewController=function(){if(!this.ne xtViewController){return}if(this.nextViewController.readyToTransition){this.next ViewControllerIsReadyToTransition(this.nextViewController)}else{this.nextViewCon troller.addPropertyObserver("readyToTransition",this,"nextViewControllerIsReadyT oTransition")}this.nextViewController.loadRequiredFiles()};iAP.ViewController.pr ototype.preloadViewControllers=function(){var d=this.nextViewController;if(d){if(d._autoAdvanceToNextViewControllerOnTimeout) {this.callMethodNameAfterDelay("skipNextViewController",d.loadingTimeoutDuration )}this.preloadNextViewController()}if(this.viewControllerIDsToPreload){for(var a=0,c=this.viewControllerIDsToPreload.length;a<c;a++){var b=iAd.ViewController.instances[this.viewControllerIDsToPreload[a]];b.loadRequir edFiles()}}};iAP.ViewController.prototype.skipNextViewController=function(){var a=this.nextViewController;if(a.readyToTransition){return}if(!a._autoAdvanceToNe xtViewController){return}if(!a.nextViewController){return}a.removePropertyObserv er("readyToTransition",this);this.nextViewController=a.nextViewController;this.p reloadNextViewController()};iAP.ViewController.prototype.transitionToViewControl lerWithID=function(a){this.transitionToViewControllerWithIDAnimated(a,true)};iAP .ViewController.prototype.transitionToViewControllerWithIDAnimated=function(e,b) {var c=iAd.ViewController.instances[e];if(c==null){iAd.Console.warn("Attempted to transition to a view controller with an invalid id: "+e);return}var a=iAd.RootViewController.sharedRootViewController.navigationController;var d=(a.viewControllers.indexOf(c)!=-1);if(d){a.popToViewControllerAnimated(c,b)}e lse{a.pushViewControllerAnimated(c,b)}};iAP.ViewController.prototype.nextViewCon trollerIsReadyToTransition=function(a){if(!a.readyToTransition){return}a.removeP ropertyObserver("readyToTransition",this);if(a.configuration.id!=this.nextViewCo ntroller.id){return}if(this._autoAdvanceToNextViewController){this.transitionToN extViewController()}};iAP.ViewController.prototype.transitionToNextViewControlle r=function(){var d=this.nextViewController;if(!d){return}if(!d.readyToTransition){return}if(this .buildInActionListShouldDelayTransition&&this.isInState(iAd.TransitionController .VIEW_BUILDS_IN_STATE)){return}if(this._autoAdvanceToNextViewController){var c=this._idleStartTime;if(c==null){return}var b=this._minimumDelayBeforeTransition;var a=(Date.now()-c)/1000;if(a<b){this.clearAutoAdvanceTimer();this._autoAdvanceTim er=this.callMethodNameAfterDelay("transitionToNextViewController",b-a);return}}t his.transitionToViewControllerWithID(d.configuration.id)};iAP.ViewController.pro totype.setPageState=function(b){if(iAd.Utils.objectIsString(b)){b=iAP.PageState. pageStateNamed(b)}if(this._pageState==b){return}var f=iAP.PageState.supportedPageStates;for(var a=0,c=f.length;a<c;a++){this.exitState(f[a].name)}var d=[];var e=b;while(e){d.unshift(e);e=e.parentState}for(var a=0,c=d.length;a<c;a++){this.enterState(d[a].name)}this._pageState=b};iAP.ViewC ontroller.prototype.enterState=function(e){this.callSuper(e);var a,d,c;for(a=0,d=this.topAnchoredSharedViewIDs.length;a<d;a++){c=iAP.SharedView. instances[this.topAnchoredSharedViewIDs[a]];c.layer.addClassName(e)}for(a=0,d=th is.bottomAnchoredSharedViewIDs.length;a<d;a++){c=iAP.SharedView.instances[this.b ottomAnchoredSharedViewIDs[a]];c.layer.addClassName(e)}if(this.backgroundLayerVi sible&&e!="ad-view-builds-in-action-list"&&e!="ad-view-builds-in-action-list-is- active"){var b=iAd.ViewController.instances.Background;if(b){b.view.layer.addClassName(e)}}} ;iAP.ViewController.prototype.exitState=function(e){var f=this.callSuper(e);var a,d,c;for(a=0,d=this.topAnchoredSharedViewIDs.length;a<d;a++){c=iAP.SharedView. instances[this.topAnchoredSharedViewIDs[a]];c.layer.removeClassName(e)}for(a=0,d =this.bottomAnchoredSharedViewIDs.length;a<d;a++){c=iAP.SharedView.instances[thi s.bottomAnchoredSharedViewIDs[a]];c.layer.removeClassName(e)}if(this.backgroundL ayerVisible&&e!="ad-view-builds-in-action-list"&&e!="ad-view-builds-in-action-li st-is-active"){var b=iAd.ViewController.instances.Background;if(b){b.view.layer.removeClassName(e) }}if(e==iAd.TransitionController.VIEW_BUILDS_IN_STATE){if(this.buildInActionList ShouldDelayTransition){this.transitionToNextViewController()}}return f};iAP.ViewController.prototype.viewDidLoad=function(){var h,m;for(m in this.outlets){h=this.outlets[m];h.viewController=this;if(h.isViewControllerCont ainer){this.viewControllerContainers.push(h);h.parentViewControllerViewDidLoad() }}var k=iAP.EventDelegate.viewScriptFunctions[this.configuration.id];for(m in k){h=this.outlets[m];var f=new iAP.EventDelegate(h,h,k[m]);h.userInteractionEnabled=true;f.processUserScript() }if(iAP.Context.IS_DESKTOP){for(m in this.outlets){h=this.outlets[m];if(!h.userInteractionEnabled){h.layer.addClassN ame(iAd.View.FOCUSED_CSS_CLASS);stylesheet_loop:for(var c=0,n=document.styleSheets.length;c<n;c++){var l=document.styleSheets[c].cssRules;for(var b=0,d=l.length;b<d;b++){try{if(h.layer.webkitMatchesSelector(l[b].selectorText) &&l[b].selectorText.indexOf(iAd.View.FOCUSED_CSS_CLASS)!=-1){h.userInteractionEn abled=true;break stylesheet_loop}}catch(g){}}}h.layer.removeClassName(iAd.View.FOCUSED_CSS_CLASS )}}}this.callSuper();if(this.isInitialViewController()){var a=iAd.ViewController.instances.Background;if(a){a.createAndDispatchEvent(iAd.Vi ewController.VIEW_DID_LOAD,[["animated",false]])}}this.setPageState(iAP.PageStat e.pageStateForCurrentDevice)};iAP.ViewController.prototype.viewWillAppear=functi on(c){var k=this;var h=this.orientation;var a=this.actionListNameByClassName[iAd.TransitionController.VIEW_BUILDS_IN_ACTION _LIST_CLASS];if(a){if(!this.shouldPlayBuildInActionList){var b=this.actionListByName[a];b&&this.enterState(b.cssClassName)}}if(window.iAPDeb ug!=null){window.iAPDebug.transitioningToViewController(this.configuration.id);i f(h!=null&&!iAd.Utils.objectIsInstanceOfClass(this,iAP.LoadingViewController)){v ar e=iAd.Transaction.defaults.duration/2;setTimeout(function(){window.iAPDebug.rot ateToOrientation(h)},e*1000)}}if(this.backgroundLayerVisible){var f=iAd.ViewController.instances.Background;if(f&&!f.__visible){iAd.EventTarget.c reateAndDispatchEvent.call(f,iAd.ViewController.VIEW_WILL_APPEAR_EVENT,[["animat ed",false]]);var j=f.view.layer;this.showBackgroundBuildInActionList=true;f.__visible=true;j.sty le.display="block"}}this.setOrientation(h);window.addEventListener("orientationc hange",this,false);for(var d=0,g=this.viewControllerContainers.length;d<g;d++){this.viewControllerContaine rs[d].parentViewControllerViewWillAppear(c)}this.callSuper(c)};iAP.ViewControlle r.prototype.viewDidAppear=function(e){var m=this;this.callSuper(e);if(this._autoAdvanceToNextViewController){this._idleSt artTime=Date.now();if(this._autoAdvanceCondition=="no-activity"){window.addEvent Listener(iAd.Event.START_EVENT,this,true)}}if(this._shouldPreloadNextViewControl lers&&(this.nextViewController||this.viewControllerIDsToPreload)){this.preloadVi ewControllers()}iAd.Device.addEventListener(iAd.Device.SHAKE_EVENT,this,false);t his.loadAdditionalFiles();var k=iAd.RootView.sharedRoot;var l=iAd.RootViewController.sharedRootViewController.navigationController.view;var f,h,c;var j=1;for(f=0,h=this.bottomAnchoredSharedViewIDs.length;f<h;f++){c=iAP.SharedView .instances[this.bottomAnchoredSharedViewIDs[f]];k.insertSubviewAtIndex(c,j++)}k. insertSubviewAtIndex(l,j++);for(f=0,h=this.topAnchoredSharedViewIDs.length;f<h;f ++){c=iAP.SharedView.instances[this.topAnchoredSharedViewIDs[f]];k.insertSubview AtIndex(c,j++)}for(f=0,h=this.viewControllerContainers.length;f<h;f++){this.view ControllerContainers[f].parentViewControllerViewDidAppear(e)}var g=iAd.ViewController.instances.Background;if(g&&this.showBackgroundBuildInActio nList){iAd.EventTarget.createAndDispatchEvent.call(g,iAd.ViewController.VIEW_DID _APPEAR_EVENT,[["animated",false]]);var b=g.actionListNameByClassName[iAd.TransitionController.VIEW_BUILDS_IN_ACTION_LI ST_CLASS];if(b){g.callMethodNameAfterDelay("startActionList",0,b)}this.showBackg roundBuildInActionList=false}if(this.contentView){this.contentView.viewDidAppear ()}if(!iAP.Context.IS_IAD_PRODUCER){var d=this.contentView||this.view;var a=iAd.RootView.sharedRoot;a.layer.setAttribute("role","region");a.layer.setAttr ibute("aria-label",d.layer.getAttribute("ad-name"));a._focusForAX()}};iAP.ViewCo ntroller.prototype.viewWillDisappear=function(e){var n=this;this.callSuper(e);if(this._autoAdvanceToNextViewController){this.clearAu toAdvanceTimer();window.removeEventListener(iAd.Event.START_EVENT,this,true)}iAd .Device.removeEventListener(iAd.Device.SHAKE_EVENT,this,false);var l=iAd.RootView.sharedRoot;var d=this.transitionController&&this.transitionController.visibleViewController;va r f,h,j,c,k={};for(f=0,h=this.topAnchoredSharedViewIDs.length;f<h;f++){j=this.top AnchoredSharedViewIDs[f];if(!d||d.topAnchoredSharedViewIDs.indexOf(j)==-1&&d.bot tomAnchoredSharedViewIDs.indexOf(j)==-1){c=iAP.SharedView.instances[j];this.cont entView.addSubview(c);k[j]=true}}for(f=this.bottomAnchoredSharedViewIDs.length-1 ;f>=0;f--){j=this.bottomAnchoredSharedViewIDs[f];if(!d||d.bottomAnchoredSharedVi ewIDs.indexOf(j)==-1&&d.topAnchoredSharedViewIDs.indexOf(j)==-1){c=iAP.SharedVie w.instances[j];this.contentView.insertSubviewAtIndex(c,0);k[j]=true}}if(d){var g=iAd.ViewController.instances.Background;if(g&&g.__visible&&d.backgroundLayerV isible==false){iAd.EventTarget.createAndDispatchEvent.call(g,iAd.ViewController. VIEW_WILL_DISAPPEAR_EVENT,[["animated",false]]);var m=g.actionListNameByClassName[iAd.TransitionController.VIEW_BUILDS_OUT_ACTION_L IST_CLASS];if(m){g.callMethodNameAfterDelay("startActionList",0,m)}g.__visible=f alse;this.hideBackground=true}}for(f=0,h=this.viewControllerContainers.length;f< h;f++){var b=this.viewControllerContainers[f];b.parentViewControllerViewWillDisappear(e,!! k[b.viewControllerId])}if(iAP.AudioButton){var a=iAP.AudioButton.views;for(f=0,h=a.length;f<h;f++){a[f].stop()}}};iAP.ViewCont roller.prototype.viewDidDisappear=function(d){this.view.views.forEach(function(e ){e.mouseExited()});this.callSuper(d);for(var a=0,c=this.viewControllerContainers.length;a<c;a++){this.viewControllerContaine rs[a].parentViewControllerViewDidDisappear(d)}var b=iAd.ViewController.instances.Background;if(b&&this.hideBackground){b.view.lay er.style.display="";b.resetAllActionLists();this.hideBackground=false;iAd.EventT arget.createAndDispatchEvent.call(b,iAd.ViewController.VIEW_DID_DISAPPEAR_EVENT, [["animated",false]])}};iAP.ViewController.prototype.actionListDidComplete=funct ion(g,e){this.callSuper.apply(this,arguments);if(iAd.ScrollView){var d,b,a=iAd.ScrollView.views;for(var c=0,f=a.length;c<f;c++){b=a[c];if(b.usesNativeScrolling){d=b.layer;while(d){if( d.style.webkitAnimationName!=""){b.usesNativeScrolling=false}d=d.parentElement}} }}};iAP.ViewController.prototype.loadRequiredFiles=function(){if(window.iAPDebug !=null){var a=this.configuration.requiredFileURIs;var b=a.stylesheets.concat(a.scripts,a.images);b.push(a.contentView)}this.callSuper ()};iAP.ViewController.prototype.requiredFilesLoaderDidComplete=function(a){this .callSuper(a);if(this.loadedAllRequiredFiles&&this.becomesReadyToTransitionWhenV iewsAreLoaded){this.readyToTransition=true}if(window.editorProxy){editorProxy.di dInitializeContentView()}};iAP.ViewController.prototype.loadAdditionalFiles=func tion(){if(this._didLoadAdditionalFiles||!this.configuration.additionalFileURIs|| !this.configuration.additionalFileURIs.images){return}var d=this.configuration.additionalFileURIs.images;for(var b=0,c=d.length;b<c;b++){var a=document.createElement("img");a.src=iAd.Device.HAS_HIDPI_DISPLAY?iAd.Path.app endHiDPISuffixIfAvailable(d[b]):d[b];document.head.appendChild(a)}this._didLoadA dditionalFiles=true};iAP.ViewController.prototype.setOrientation=function(b){var c=false;if(b==iAP.ViewController.ORIENTATION_LANDSCAPE_LEFT||b==iAP.ViewControl ler.ORIENTATION_LANDSCAPE_RIGHT){c=true;this.enterState("ad-landscape")}else{thi s.exitState("ad-landscape")}if(iAP.Context.IS_SAFARI){iAd.RootView.sharedRoot.se tIsLandscape(c)}if(window.ad!=null&&b!=null){if(window.ad.hasOwnProperty("curren tSupportedInterfaceOrientations")){var a=ADAd.ADInterfaceOrientationPortrait|ADAd.ADInterfaceOrientationPortraitUpside Down|ADAd.ADInterfaceOrientationLandscapeLeft|ADAd.ADInterfaceOrientationLandsca peRight;var d=0;switch(b){case iAP.ViewController.ORIENTATION_PORTRAIT:d=ADAd.ADInterfaceOrientationPortrait;c ase iAP.ViewController.ORIENTATION_PORTRAIT_UPSIDE_DOWN:d=d||ADAd.ADInterfaceOrient ationPortraitUpsideDown;if(iAd.Device.IS_IPAD){a=ADAd.ADInterfaceOrientationPort rait|ADAd.ADInterfaceOrientationPortraitUpsideDown}else{a=ADAd.ADInterfaceOrient ationPortrait}break;case iAP.ViewController.ORIENTATION_LANDSCAPE_LEFT:d=ADAd.ADInterfaceOrientationLand scapeRight;case iAP.ViewController.ORIENTATION_LANDSCAPE_RIGHT:d=d||ADAd.ADInterfaceOrientation LandscapeLeft;a=ADAd.ADInterfaceOrientationLandscapeLeft|ADAd.ADInterfaceOrienta tionLandscapeRight;break}if(window.iAPDebug&&a!=d){window.ad.currentSupportedInt erfaceOrientations=d;setTimeout(function(){window.ad.currentSupportedInterfaceOr ientations=a},0)}else{window.ad.currentSupportedInterfaceOrientations=a}}}};iAP. ViewController.instances=iAd.ViewController.instances;

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAP.iBooksLoadingViewController",superclass:iAP.ViewController} );iAP.iBooksLoadingViewController.VIEW_CONTROLLER_ID="iAP_iBooksLoading";iAP.iBo oksLoadingViewController.prototype.init=function(b){var a={becomesBackItemTransition:null,becomesTopItemTransition:null,becomesVisibleT ransition:null,bottomAnchoredSharedViewIDs:[],disableLoadingViewController:true, minimumDelayBeforeTransition:0.5,topAnchoredSharedViewIDs:[],transitionDuration: 0.5,wasBackItemTransition:null,wasTopItemTransition:null};iAd.Utils.copyProperti esFromSourceToTarget(a,b.properties);this.callSuper(b)};iAP.iBooksLoadingViewCon troller.prototype.loadView=function(){this.view=new iAd.View();var b=this;var a=iAd.Image.imageForURL("Default.png",true);a.whenLoaded(function(){b.backgroun dLoaded(a)})};iAP.iBooksLoadingViewController.prototype.backgroundLoaded=functio n(b){var a=document.createElement("div");a.addClassName("iap-ibooks-default-loading-imag e");a.setAttribute("aria-hidden",true);a.appendChild(b.element);this._view.layer .appendChild(a);var d=window.getComputedStyle(document.body);var c=Math.min(parseInt(d.width,10)/b.width,parseInt(d.height,10)/b.height);b.eleme nt.style.width=(b.width*c)+"px";b.element.style.height=(b.height*c)+"px"};iAP.iB ooksLoadingViewController.prototype.viewDidAppear=function(){this.callSuper();th is.transitionController.showLoadingViewController();this.transitionToViewControl lerWithID(this.nextViewControllerID);setTimeout(function(){widget.notifyContentI sReady()},0)};iAP.iBooksLoadingViewController.prototype.viewWillDisappear=functi on(){this.callSuper()};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.ImageView",superclass:iAd.View,synthesizedProperties:["auto Sized","image","highlightedImage","highlighted","imageContentKey","highlightedIm ageContentKey"],archivedProperties:["autoSized","image","highlightedImage","high lighted"],cssClassName:"ad-image-view",collectionAccessor:"imageViews"});iAd.Ima geView.prototype.init=function(a){this._autoSized=true;this._highlighted=false;t his._image=null;this._highlightedImage=null;this._imageContentKey=null;this._hig hlightedImageContentKey=null;this.callSuper(a);this.addEventListener(iAd.View.TO UCH_DOWN_EVENT,this,false);this.addEventListener(iAd.View.TOUCH_DRAG_ENTER_EVENT ,this,false);this.addEventListener(iAd.View.TOUCH_DRAG_EXIT_EVENT,this,false);th is.addEventListener(iAd.View.ACTIVATE_EVENT,this,false);this.addEventListener(iA d.View.TOUCH_CANCEL_EVENT,this,false)};iAd.ImageView.prototype.layerWasCreated=f unction(){this._img=this.layer.appendChild(document.createElement("img"))};iAd.I mageView.prototype.setValueForAttribute=function(d,c){switch(c){case"ad-image":c ase"ad-highlighted-image":var b=this.getLayerCustomAttributeValue("ad-has-hidpi-version");b=b==null||b=="true ";var a=this.getLayerCustomAttributeValue("ad-has-ipad-version");a=a=="true";var e=iAd.Image.imageForURL(d,b,a);if(c=="ad-image"){this.image=e}else{this.highlig htedImage=e}break;default:this.callSuper(d,c)}};iAd.ImageView.prototype.layerWas InsertedIntoDocument=function(){this.callSuper();this.syncImageToCurrentState()} ;iAd.ImageView.prototype.setImage=function(a){this._image=a;this.syncImageToCurr entState()};iAd.ImageView.prototype.setHighlightedImage=function(a){this.userInt eractionEnabled=(a!=null);this._highlightedImage=a;this.syncImageToCurrentState( )};iAd.ImageView.prototype.setImageContentKey=function(a){this._imageContentKey= a;this._updateImageFromContentKey();this._eventListenersForContentChange()};iAd. ImageView.prototype.setHighlightedImageContentKey=function(a){this._higlightedIm ageContentKey=a;this._updateHighlightedImageFromContentKey();this._eventListener sForContentChange()};iAd.ImageView.prototype.setHighlighted=function(a){if(a==th is._highlighted){return}this._highlighted=a;this.syncImageToCurrentState()};iAd. ImageView.prototype.setAutoSized=function(a){if(this._autoSized==a){return}this. _autoSized=a;this.syncImageToCurrentState()};iAd.ImageView.prototype._eventListe nersForContentChange=function(){if(this._imageContentKey||this._higlightedImageC ontentKey){iAd.Content.addEventListener(iAd.Content.CONTENT_DID_CHANGE,this)}els e{iAd.Content.removeEventListener(iAd.Content.CONTENT_DID_CHANGE,this)}};iAd.Ima geView.prototype._updateImageFromContentKey=function(){if(this._imageContentKey) {this.image=iAd.Image.imageForContentKey(this._imageContentKey)}};iAd.ImageView. prototype._updateHighlightedImageFromContentKey=function(){if(this._higlightedIm ageContentKey){this.highlightedImage=iAd.Image.imageForContentKey(this._higlight edImageContentKey)}};iAd.ImageView.prototype.syncImageToCurrentState=function(){ var a=(this.highlighted&&this.highlightedImage)?this.highlightedImage:this.image;if (!a){this._img.src="";this._img.style.removeProperty("visibility");return}if(!a. loaded){a.addPropertyObserver("loaded",this,"syncImageToCurrentState");return}th is._img.style.visibility="visible";this._img.src=a.element.src;if(this._autoSize d){this.size=new iAd.Size(a.width,a.height)}if(iAd.ImageEffects&&this._effect){this._effect.inpu tImage=this._img;this._effect.render()}};iAd.ImageView.prototype.handleEvent=fun ction(a){if(a.type==iAd.Content.CONTENT_DID_CHANGE){this._updateImageFromContent Key();this._updateHighlightedImageFromContentKey();return}this.callSuper(a);swit ch(a.type){case iAd.View.TOUCH_DOWN_EVENT:case iAd.View.TOUCH_DRAG_ENTER_EVENT:this.highlighted=true;break;case iAd.View.TOUCH_DRAG_EXIT_EVENT:case iAd.View.ACTIVATE_EVENT:case iAd.View.TOUCH_CANCEL_EVENT:this.highlighted=false;break}};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Utils.replaceMethod(iAd.ImageView,"init",function(){this._usesBackgroundImag e=false;this._imageRepeat="no-repeat";this._imagePosition="left top";this._imageSize="100% 100%";this.callOriginal.apply(this,arguments)});iAd.ImageView.prototype.setHidd en=function(a){this.callSuper(a);this.syncImageToCurrentState()};iAd.ImageView.p rototype.layerWasInsertedIntoDocument=function(){this.callSuper();if(this.usesBa ckgroundImage||iAd.ImageView.usesBackgroundImage){return}this.callMethodNameAfte rDelay("syncImageToCurrentState",0)};iAd.Utils.replaceMethod(iAd.ImageView,"laye rWasCreated",function(){if(!this.layer.getAttribute("role")){this.layer.setAttri bute("role","img")}this.callOriginal.apply(this,arguments);this._img.setAttribut e("aria-hidden",true)});(function(){iAd.ImageView.prototype.setUsesBackgroundIma ge=function(b){if(this._usesBackgroundImage==b){return}this._usesBackgroundImage =b;this.syncImageToCurrentState()};iAd.ImageView.prototype.setImagePosition=func tion(b){if(this._imagePosition==b){return}this._imagePosition=b;this.syncImageTo CurrentState()};iAd.ImageView.prototype.setImageSize=function(b){if(this._imageS ize==b){return}this._imageSize=b;this.syncImageToCurrentState()};iAd.ImageView.p rototype.setImageRepeat=function(b){if(this._imageRepeat==b){return}this._imageR epeat=b;this.syncImageToCurrentState()};iAd.ImageView.prototype.setSize=function (b){if(this._size.equals(b)){return}this.callSuper(b);if(!this._usingFallback){t his.syncImageToCurrentState()}};iAd.ImageView.prototype.clearBackgroundPropertie s=function(){this.layer.style.backgroundImage="";this.layer.style.backgroundPosi tion="";this.layer.style.backgroundRepeat="";this.layer.style.backgroundSize=""; this._backgroundImageSrc=null};iAd.Class.processMethod(iAd.ImageView,"syncImageT oCurrentState");var a=iAd.ImageView.prototype.syncImageToCurrentState;iAd.ImageView.prototype.syncI mageToCurrentState=function(){a.apply(this,arguments);var n=(this.highlighted&&this.highlightedImage)?this.highlightedImage:this.image;if (!n){this.clearBackgroundProperties();this.layer.addClassName("ad-placeholder-ba ckground");this._img.style.display="none";return}else{if(n.loaded){this._img.sty le.visibility="inherit"}}this.layer.removeClassName("ad-placeholder-background") ;if(this.needsToFallback()){this._img.style.display="none";this.layer.style.over flow="visible";this.layer.style.backgroundImage="url("+n.element.src+")";this._b ackgroundImageSrc=n.element.src;this.layer.style.backgroundSize=this._imageSize; this.layer.style.backgroundPosition=this._imagePosition;this.layer.style.backgro undRepeat=this._imageRepeat;this._usingFallback=true}else{if(this._img.style.dis play=="none"){this._img.style.display="block";this.layer.style.overflow="hidden" ;this.clearBackgroundProperties()}var i=this._imageSize,g=this._img;if(i=="contain"||i=="cover"){var c=window.getComputedStyle(this.layer),k=this.widthFromComputedStyle(c),o=this.h eightFromComputedStyle(c),p=n.width,b=n.height,d=k/p,j=o/b,f=(i=="contain"?Math. min(d,j):Math.max(d,j)),e=Math.max(1,p*f),l=Math.max(1,b*f);g.style.width=e+"px" ;g.style.height=l+"px"}else{var h=i.split(" ");if(h.length>=1){g.style.width=h[0];g.style.height=h[1]||h[0]}}var m=this._imagePosition.split(" ");if(m[0]=="left"||m[0]=="center"||m[0]=="right"||m[1]=="top"||m[1]=="center"| |m[1]=="bottom"){this.layer.addClassName("ad-uses-flex-box");if(!this._positionM ap){this._positionMap={left:"start",right:"end",top:"start",bottom:"end",center: "center"}}this.layer.style.webkitBoxPack=this._positionMap[m[0]];this.layer.styl e.webkitBoxAlign=this._positionMap[m[1]]}else{this.layer.removeClassName("ad-use s-flex-box");g.style.left=m[0];g.style.top=m[1]}this._usingFallback=false}};iAd. ImageView.needsToFallbackMatch=/(center|right|bottom)/;iAd.ImageView.prototype.n eedsToFallback=function(){if(this.usesBackgroundImage||iAd.ImageView.usesBackgro undImage){return true}if(iAP.Context.IS_WINDOWS){return true}if(this._imageRepeat!="no-repeat"){return true}var b=this._imageSize;if(b=="contain"||b=="100% 100%"){return false}if(this._imagePosition.match(iAd.ImageView.needsToFallbackMatch)){var c=this.getSizeData();if(b=="cover"){if(Math.abs(c.viewWidth/c.viewHeight-c.imag eWidth/c.imageHeight)>0.01){return true}}else{if(c.imageWidth>c.viewWidth||c.imageHeight>c.viewHeight){return true}}}return false};iAd.ImageView.prototype.getSizeData=function(){var c=(this.highlighted&&this.highlightedImage)?this.highlightedImage:this.image,b= window.getComputedStyle(this.layer);return{imageWidth:c.width,imageHeight:c.heig ht,viewWidth:this.widthFromComputedStyle(b),viewHeight:this.heightFromComputedSt yle(b)}};iAd.ImageView.prototype.widthFromComputedStyle=function(b){var c;if(b.width.indexOf("%")!=-1){var d=0;if(this.superview){d=this.superview.size.width}else{if(this.layer.parentNod e){d=this.layer.parentNode.offsetWidth}}c=parseFloat(b.width)/100*d}else{c=parse Int(b.width,10)}return c};iAd.ImageView.prototype.heightFromComputedStyle=function(b){var d;if(b.height.indexOf("%")!=-1){var c=0;if(this.superview){c=this.superview.size.height}else{if(this.layer.parentNo de){c=this.layer.parentNode.offsetHeight}}d=parseFloat(b.height)/100*c}else{d=pa rseInt(b.height,10)}return d};iAd.Class.synthesizeProperty(iAd.ImageView.prototype,"usesBackgroundImage"); iAd.Class.synthesizeProperty(iAd.ImageView.prototype,"imagePosition");iAd.Class. synthesizeProperty(iAd.ImageView.prototype,"imageSize");iAd.Class.synthesizeProp erty(iAd.ImageView.prototype,"imageRepeat");iAd.ImageView.archivedProperties.pus h("usesBackgroundImage");iAd.ImageView.archivedProperties.push("imagePosition"); iAd.ImageView.archivedProperties.push("imageSize");iAd.ImageView.archivedPropert ies.push("imageRepeat")}());iAd.Utils.replaceMethod(iAd.ImageView,"setImage",fun ction(){var a=this.layer.getAttribute("aria-label");var b=this._image?iAd.Path.lastPathComponent(this._image.url):"";this.callOriginal. apply(this,arguments);if(!a||a==b){if(this._image){this.layer.setAttribute("aria -label",iAd.Path.lastPathComponent(this._image.url))}else{this.layer.removeAttri bute("aria-label")}}});

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAP.MediaAction",superclass:iAd.ScriptAction,synthesizedPropert ies:["url"]});iAP.MediaAction.prototype.init=function(){this.callSuper.apply(thi s,arguments);this.analyticsDetails={file:this.getFilename}};iAP.MediaAction.prot otype.reset=function(){this.media&&this.media.stop()};iAP.MediaAction.prototype. getFilename=function(){return this.media?this.media.getFilename():""};iAP.MediaAction.prototype.summaryText=f unction(){if(this.url){return iAd.Path.lastPathComponent(this.url)}else{return"None"}};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.Media",mixins:[iAd.EventTarget,iAd.EventTriage],synthesized Properties:["url","element","time","duration","percentLoaded","bufferedStartTime ","bufferedEndTime","canPlay","canPlayThrough","seeking","renderable","loop","er ror","playbackState","loadState","loadReady"],archivedProperties:["url"]});iAd.M edia.PLAYBACK_WILL_START="mediaPlaybackWillStart";iAd.Media.PLAYBACK_DID_START=" mediaPlaybackDidStart";iAd.Media.PLAYBACK_DID_PAUSE="mediaPlaybackDidPause";iAd. Media.PLAYBACK_DID_BEGIN_WAITING="mediaPlaybackDidBeginWaiting";iAd.Media.PLAYBA CK_DID_END_WAITING="mediaPlaybackDidEndWaiting";iAd.Media.PLAYBACK_DID_END="medi aPlaybackDidEnd";iAd.Media.WILL_SEEK="mediaWillSeek";iAd.Media.DID_SEEK="mediaDi dSeek";iAd.Media.DID_UPDATE_TIME="mediaDidUpdateTime";iAd.Media.LOAD_WILL_START= "mediaLoadWillStart";iAd.Media.LOAD_DID_START="mediaLoadDidStart";iAd.Media.LOAD _DID_PROGRESS="mediaLoadDidProgress";iAd.Media.LOAD_DATA_AVAILABLE="mediaLoadDat aAvailable";iAd.Media.LOAD_DID_STALL="mediaLoadDidStall";iAd.Media.LOAD_DID_SUSP END="mediaLoadDidSuspend";iAd.Media.LOAD_DID_RESUME="mediaLoadDidResume";iAd.Med ia.LOAD_DID_FAIL="mediaLoadDidFail";iAd.Media.LOAD_IS_READY="mediaLoadIsReady";i Ad.Media.LOAD_CAN_PLAY="mediaLoadCanPlay";iAd.Media.LOAD_CAN_PLAY_THROUGH="media LoadCanPlayThrough";iAd.Media.WILL_UNLOAD="mediaWillUnload";iAd.Media.DID_UNLOAD ="mediaDidUnload";iAd.Media.PLAYBACK_STATE_DID_UPDATE="mediaPlaybackStateDidUpda te";iAd.Media.PLAYBACK_STATE_NONE=0;iAd.Media.PLAYBACK_STATE_WAITING=1;iAd.Media .PLAYBACK_STATE_PLAYING=2;iAd.Media.PLAYBACK_STATE_PAUSED=3;iAd.Media.PLAYBACK_S TATE_ENDED=4;iAd.Media.LOAD_STATE_DID_UPDATE="mediaLoadStateDidUpdate";iAd.Media .LOAD_STATE_NONE=0;iAd.Media.LOAD_STATE_LOADING=1;iAd.Media.LOAD_STATE_STALLED=2 ;iAd.Media.LOAD_STATE_SUSPENDED=3;iAd.Media.LOAD_STATE_FAILED=4;iAd.Media.READY_ STATE_NOTHING=0;iAd.Media.READY_STATE_METADATA=1;iAd.Media.READY_STATE_CURRENT_D ATA=2;iAd.Media.READY_STATE_FUTURE_DATA=3;iAd.Media.READY_STATE_ENOUGH_DATA=4;iA d.Media.HTML_MEDIA_EVENTS=["emptied","loadstart","durationchange","loadedmetadat a","loadeddata","canplay","canplaythrough","progress","play","waiting","playing" ,"timeupdate","pause","seeking","seeked","stalled","suspend","ended","abort","er ror"];iAd.Media.prototype.init=function(a){this.callSuper();this._playbackState= iAd.Media.PLAYBACK_STATE_NONE;this._loadState=iAd.Media.LOAD_STATE_NONE;this.res et();if(!this._loadReadyStrategy){this._loadReadyStrategy=iAd.Media.defaultLoadR eadyStrategy}this.eventTarget=document;this._url=a;this.resolvedURL=this.urlStra tegy(a)};iAd.Media.prototype.getDuration=function(){return this._element?this._element.duration:NaN};iAd.Media.prototype.getBufferedStartT ime=function(){var a=this.closestBufferedIndex();return(a>=0)?this._element.buffered.start(a):0};i Ad.Media.prototype.getBufferedEndTime=function(){var a=this.closestBufferedIndex();return(a>=0)?this._element.buffered.end(a):0};iAd .Media.prototype.getPercentLoaded=function(){return this.duration?(this.bufferedEndTime-this.bufferedStartTime)/this.duration:0};iA d.Media.prototype.closestBufferedIndex=function(){if(!this._element){return -1}var e=this.time,d=-1,b=this.element.buffered;for(var a=0,c=b.length;a<c;a++){if(b.start(a)<=e&&b.end(a)>=e){return a}}return d};iAd.Media.prototype.setLoop=function(a){this._loop=a;if(this._element){this. _element.loop=a}};iAd.Media.prototype.getCanPlay=function(){if(!this._element){r eturn false}return(this._element.readyState>=iAd.Media.READY_STATE_FUTURE_DATA)};iAd. Media.prototype.getCanPlayThrough=function(){if(!this._element){return false}return(this._element.readyState>=iAd.Media.READY_STATE_ENOUGH_DATA)};iAd. Media.prototype.getSeeking=function(){return(this._element&&this._element.seekin g)};iAd.Media.prototype.getError=function(){var a=this._element;return(a&&a.error)?a.error.code:null};iAd.Media.prototype.getRe nderable=function(){if(!this._element){return false}return(this._element.readyState>=iAd.Media.READY_STATE_CURRENT_DATA)};iAd .Media.prototype.setUrl=function(a){};iAd.Media.prototype.setElement=function(a) {};iAd.Media.prototype.setPlaybackState=function(a){};iAd.Media.prototype.setLoa dState=function(a){};iAd.Media.prototype.setLoadReady=function(a){};iAd.Media.pr ototype.setTime=function(a){};iAd.Media.prototype.load=function(){if((this._load State!=iAd.Media.LOAD_STATE_NONE&&this._loadState!=iAd.Media.LOAD_STATE_FAILED)| |this._attemptingLoad){return false}this.element.setAttribute("src",this.resolvedURL);this.element.loop=this. _loop;this.addMediaEventListeners();this.dispatchMediaNotification(iAd.Media.LOA D_WILL_START);this._attemptingLoad=true;this.loadElement();if(iAd.Media.preloade dMedia&&iAd.Media.preloadedMedia.url!=this.url){iAd.Media.preloadedMedia=null}re turn true};iAd.Media.prototype.unload=function(){if(this._loadState==iAd.Media.LOAD_ STATE_NONE){return}this.dispatchMediaNotification(iAd.Media.WILL_UNLOAD);this.re moveMediaEventListeners();this.reset();this.unloadElement();this.dispatchMediaNo tification(iAd.Media.DID_UNLOAD)};iAd.Media.prototype.play=function(){if(this._p laybackState==iAd.Media.PLAYBACK_STATE_PLAYING||this._playbackState==iAd.Media.P LAYBACK_STATE_WAITING){if(this._targetPlaybackState!=iAd.Media.PLAYBACK_STATE_PA USED){return false}}if(this._loadState==iAd.Media.LOAD_STATE_NONE||this._loadState==iAd.Medi a.LOAD_STATE_FAILED){this.load()}if(this._playbackState!=iAd.Media.PLAYBACK_STAT E_PLAYING&&this._targetPlaybackState!=iAd.Media.PLAYBACK_STATE_PLAYING){this.dis patchMediaNotification(iAd.Media.PLAYBACK_WILL_START)}this.playElement();return true};iAd.Media.prototype.pause=function(){if(this._playbackState==iAd.Media.PL AYBACK_STATE_PAUSED){return false}this.pauseElement();return true};iAd.Media.prototype.stop=function(){if(this._playbackState==iAd.Media.PLA YBACK_STATE_PAUSED&&this.time==0){return false}this.pause();this.seekToTime(0);return true};iAd.Media.prototype.seekToTime=function(a){if(!this.canSeekToTime(a)){ret urn false}this.seekElement(a);if(this.playbackState==iAd.Media.PLAYBACK_STATE_ENDED ){this.enterPlaybackState(iAd.Media.PLAYBACK_STATE_PAUSED)}return true};iAd.Media.prototype.canSeekToTime=function(d){if(!this._element){return false}var c=this._element.seekable;for(var a=0,b=c.length;a<b;a++){if(c.start(a)<=d&&c.end(a)>=d){return true}}return false};iAd.Media.prototype.isTimeInBufferedRange=function(a){return(this.buffer edStartTime<=a&&this.bufferedEndTime>=a)};iAd.Media.prototype.loadElement=functi on(){this.element.load()};iAd.Media.prototype.unloadElement=function(){this.elem ent.setAttribute("src","null")};iAd.Media.prototype.playElement=function(){this. _targetPlaybackState=iAd.Media.PLAYBACK_STATE_PLAYING;this.element.play()};iAd.M edia.prototype.pauseElement=function(){this._targetPlaybackState=iAd.Media.PLAYB ACK_STATE_PAUSED;this.element.pause()};iAd.Media.prototype.seekElement=function( a){this.element.currentTime=a};iAd.Media.prototype.reset=function(){this.enterPl aybackState(iAd.Media.PLAYBACK_STATE_NONE);this.enterLoadState(iAd.Media.LOAD_ST ATE_NONE);this._loadReady=false;this._attemptingLoad=false;this._time=0};iAd.Med ia.prototype.executeLoadReadyStrategy=function(a){if(!this._loadReady&&this.load ReadyStrategy(this,a)){this._loadReady=true;this.dispatchMediaNotification(iAd.M edia.LOAD_IS_READY)}};iAd.Media.prototype.prepareForCompetition=function(){};iAd .Media.prototype.enterPlaybackState=function(b){if(b==iAd.Media.PLAYBACK_STATE_P LAYING||b==iAd.Media.PLAYBACK_STATE_PAUSED){delete this._targetPlaybackState}if(this._playbackState==b){return}var a=this._playbackState;this._playbackState=b;this.dispatchMediaNotification(iAd. Media.PLAYBACK_STATE_DID_UPDATE);if(a==iAd.Media.PLAYBACK_STATE_WAITING){this.di spatchMediaNotification(iAd.Media.PLAYBACK_DID_END_WAITING)}switch(b){case iAd.Media.PLAYBACK_STATE_PLAYING:this.dispatchMediaNotification(iAd.Media.PLAYB ACK_DID_START);break;case iAd.Media.PLAYBACK_STATE_PAUSED:this.dispatchMediaNotification(iAd.Media.PLAYBA CK_DID_PAUSE);break;case iAd.Media.PLAYBACK_STATE_WAITING:this.dispatchMediaNotification(iAd.Media.PLAYB ACK_DID_BEGIN_WAITING);break;case iAd.Media.PLAYBACK_STATE_ENDED:this.dispatchMediaNotification(iAd.Media.PLAYBAC K_DID_END);break}};iAd.Media.prototype.enterLoadState=function(b){if(this._loadS tate==b){return}this.clearLoadStateTimeout();this.clearTimeupdateWatchdogTimeout ();var a=this._loadState;this._loadState=b;this.dispatchMediaNotification(iAd.Media.LO AD_STATE_DID_UPDATE);this._attemptingLoad=false;switch(b){case iAd.Media.LOAD_STATE_LOADING:this.dispatchMediaNotification(a?iAd.Media.LOAD_DI D_RESUME:iAd.Media.LOAD_DID_START);break;case iAd.Media.LOAD_STATE_STALLED:this.dispatchMediaNotification(iAd.Media.LOAD_DID_ STALL);if(this._playbackState==iAd.Media.PLAYBACK_STATE_PLAYING){this.beginTimeu pdateWatchdogTimeout()}break;case iAd.Media.LOAD_STATE_SUSPENDED:this.dispatchMediaNotification(iAd.Media.LOAD_DI D_SUSPEND);break;case iAd.Media.LOAD_STATE_FAILED:this.dispatchMediaNotification(iAd.Media.LOAD_DID_F AIL,[["errorCode",this.error]]);break}};iAd.Media.prototype.elementWasRemovedFro mDocument=function(){};iAd.Media.prototype.elementWasInsertedIntoDocument=functi on(){};iAd.Media.prototype.addMediaEventListeners=function(){var c=iAd.Media.HTML_MEDIA_EVENTS,b=this.element;for(var a=0,d=c.length;a<d;a++){b.addEventListener(c[a],this)}};iAd.Media.prototype.rem oveMediaEventListeners=function(){var c=iAd.Media.HTML_MEDIA_EVENTS,b=this.element;for(var a=0,d=c.length;a<d;a++){b.removeEventListener(c[a],this)}};iAd.Media.prototype. dispatchMediaNotification=function(a,b){this.notifyDelegate(a,iAd.Media,b);this. notifyDelegate(a,this._mediaPlayer,b);this.dispatchNotification(a,this.delegate, b)};iAd.Media.prototype.processDelegateArguments=function(b){var a=[this];if(b){a=a.concat(b.map(function(c){return c[1]}))}return a};iAd.Media.prototype.handlePlay=function(a){if(this._targetPlaybackState!=iAd .Media.PLAYBACK_STATE_PLAYING){this._targetPlaybackState=iAd.Media.PLAYBACK_STAT E_PLAYING;this.dispatchMediaNotification(iAd.Media.PLAYBACK_WILL_START)}};iAd.Me dia.prototype.handlePlaying=function(a){this.enterPlaybackState(iAd.Media.PLAYBA CK_STATE_PLAYING)};iAd.Media.prototype.handlePause=function(a){if(this.playbackS tate!=iAd.Media.PLAYBACK_STATE_ENDED&&!this._element.ended){this.enterPlaybackSt ate(iAd.Media.PLAYBACK_STATE_PAUSED)}};iAd.Media.prototype.handleWaiting=functio n(a){this.enterPlaybackState(iAd.Media.PLAYBACK_STATE_WAITING)};iAd.Media.protot ype.handleSeeking=function(a){this.dispatchMediaNotification(iAd.Media.WILL_SEEK )};iAd.Media.prototype.handleSeeked=function(a){this.dispatchMediaNotification(i Ad.Media.DID_SEEK)};iAd.Media.prototype.handleEnded=function(a){this.pauseElemen t();this.enterPlaybackState(iAd.Media.PLAYBACK_STATE_ENDED)};iAd.Media.prototype .handleTimeupdate=function(b){var a=this._element.currentTime;this.clearTimeupdateWatchdogTimeout();if(this._time ==a){return}this._time=a;this.dispatchMediaNotification(iAd.Media.DID_UPDATE_TIM E,[["time",this._time]])};iAd.Media.prototype.handleDurationchange=function(a){t his.notifyPropertyChange("duration");this.enterLoadState(iAd.Media.LOAD_STATE_LO ADING)};iAd.Media.prototype.handleLoadstart=function(a){this.enterLoadState(iAd. Media.LOAD_STATE_LOADING)};iAd.Media.prototype.handleLoadedmetadata=function(a){ this.enterLoadState(iAd.Media.LOAD_STATE_LOADING)};iAd.Media.prototype.handleLoa deddata=function(a){this.dispatchMediaNotification(iAd.Media.LOAD_DATA_AVAILABLE );this.enterLoadState(iAd.Media.LOAD_STATE_LOADING);this.notifyPropertyChange("r enderable")};iAd.Media.prototype.handleProgress=function(a){this.enterLoadState( iAd.Media.LOAD_STATE_LOADING);this.dispatchMediaNotification(iAd.Media.LOAD_DID_ PROGRESS,[["percentLoaded",this.percentLoaded]]);this.executeLoadReadyStrategy(a )};iAd.Media.prototype.handleSuspend=function(a){this.beginLoadStateTimeout(iAd. Media.LOAD_STATE_SUSPENDED)};iAd.Media.prototype.handleStalled=function(a){this. beginLoadStateTimeout(iAd.Media.LOAD_STATE_STALLED)};iAd.Media.prototype.handleE rror=function(a){this.enterLoadState(iAd.Media.LOAD_STATE_FAILED)};iAd.Media.pro totype.handleCanplay=function(a){this.dispatchMediaNotification(iAd.Media.LOAD_C AN_PLAY);this.executeLoadReadyStrategy(a)};iAd.Media.prototype.handleCanplaythro ugh=function(a){this.dispatchMediaNotification(iAd.Media.LOAD_CAN_PLAY_THROUGH); this.executeLoadReadyStrategy(a)};iAd.Media.prototype.handleAbort=function(a){if (this._loadState!=iAd.Media.LOAD_STATE_NONE){this.enterLoadState(iAd.Media.LOAD_ STATE_FAILED)}};iAd.Media.prototype.handleEmptied=function(a){this.notifyPropert yChange("renderable");if(this._loadState!=iAd.Media.LOAD_STATE_NONE){this.handle UnloadEvent()}};iAd.Media.prototype.handleUnloadEvent=function(a){this.removeMed iaEventListeners();this.reset();this.dispatchMediaNotification(iAd.Media.DID_UNL OAD)};iAd.Media.prototype.beginLoadStateTimeout=function(a){this.clearLoadStateT imeout();this.loadStateTimeout=this.callMethodNameAfterDelay("enterLoadState",0. 05,a)};iAd.Media.prototype.clearLoadStateTimeout=function(){if(this.loadStateTim eout){clearTimeout(this.loadStateTimeout);this.loadStateTimeout=null}};iAd.Media .TIMEUPDATE_WATCHDOG_DELAY=0.5;iAd.Media.prototype.beginTimeupdateWatchdogTimeou t=function(){this.clearTimeupdateWatchdogTimeout();this.timeupdateWatchdogTimeou t=this.callMethodNameAfterDelay("timeupdateWatchdogDidTimeout",iAd.Media.TIMEUPD ATE_WATCHDOG_DELAY)};iAd.Media.prototype.clearTimeupdateWatchdogTimeout=function (){if(this.timeupdateWatchdogTimeout){clearTimeout(this.timeupdateWatchdogTimeou t);delete this.timeupdateWatchdogTimeout}};iAd.Media.prototype.timeupdateWatchdogDidTimeo ut=function(){if(this._loadState==iAd.Media.LOAD_STATE_STALLED){delete this.timeupdateWatchdogTimeout;this.pause()}};iAd.Media.defaultLoadReadyStrateg y=function(a){return a.canPlayThrough||(!iAd.Device.iOS_VERSION&&a.percentLoaded==1)};iAd.Media.defa ultUrlStrategy=function(a){return a};iAd.Media.loadReadyStrategy=iAd.Media.defaultLoadReadyStrategy;iAd.Media.url Strategy=iAd.Media.defaultUrlStrategy;iAd.Media.prototype.loadReadyStrategy=func tion(b,a){return iAd.Media.loadReadyStrategy(b,a)};iAd.Media.prototype.urlStrategy=function(a){r eturn iAd.Media.urlStrategy?iAd.Media.urlStrategy(a):a};iAd.Media.mediaTypeForURL=fun ction(d,a){if(iAd.Media.preloadedMedia&&a==iAd.Media.preloadedMedia.url){return iAd.Media.preloadedMedia}var b=this.resolveMediaClass(d);var c=new b(a);return c};iAd.Media.resolveMediaClass=function(a){return a};iAd.Media.activeMedia=[];iAd.Media.mediaPlaybackWillStart=function(a){this.r egisterActiveMedia(a)};iAd.Media.mediaLoadWillStart=function(a){this.registerAct iveMedia(a)};iAd.Media.mediaDidUnload=function(a){this.unregisterActiveMedia(a)} ;iAd.Media.registerActiveMedia=function(b){var a=this.activeMedia[0];this.unregisterActiveMedia(b);this.activeMedia.unshift(b) ;if(a&&a!=b){a.prepareForCompetition()}};iAd.Media.unregisterActiveMedia=functio n(a){iAd.Array.removeObjectFromArray(a,this.activeMedia)};iAd.Media.preloadedMed ia=null;

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Media.prototype.getFilename=function(a){return this.url?decodeURIComponent(this.url).replace(/^.*\/|\.[^.]*$/g,""):""};(functi on(){if(window.widget){widget._pausedMedia=[];var b=widget.pauseAudioVisual;widget.pauseAudioVisual=function(){b.apply(this,argum ents);var f,d=iAd.Media.activeMedia;for(var c=0,e=d.length;c<e;c++){f=d[c];if(f.playbackState==iAd.Media.PLAYBACK_STATE_PLA YING){f.pause();widget._pausedMedia.push(f)}}};var a=widget.didEnterWidgetMode;widget.didEnterWidgetMode=function(f){a.apply(this, arguments);if(f=="fullscreen"){var g,c=widget._pausedMedia;for(var d=0,e=c.length;d<e;d++){c[d].play()}widget._pausedMedia=[]}}}})();

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Media.resolveMediaClass=function(a){return this._adapterByClassType[a.displayName]||a};iAd.Media._adapterByClassType={};iA d.Media.registerMediaAdapter=function(d,e){var c=d.displayName;if(!iAd.Device.iOS_VERSION){if(window.iTunes&&e.context=="iTune s"){this._adapterByClassType[c]=e;return true}else{return false}}var a=e.iOSVersion;if(!a||iAd.Device.iOSVersionLessThan(a)){return false}var b=this._adapterByClassType[c];if(!b||iAd.Device.compareiOSVersions(a,b.iOSVersi on)>=0){this._adapterByClassType[c]=e;return true}return false};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

 

 

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.Audio",superclass:iAd.Media});iAd.Audio.prototype.getElemen t=function(){if(!this._element){this._element=document.createElement("audio")}re turn this.callSuper()};iAd.Audio.prototype.play=function(){if(iAd.Audio.playEnabled) {return this.callSuper()}return false};iAd.Audio.updatePlayEnabled=function(){if(this._playEnabled){return}var c,d=iAd.Media.activeMedia;for(var a=0,b=d.length;a<b;a++){c=d[a];if(c instanceof iAd.Audio&&c.playbackState==iAd.Media.PLAYBACK_STATE_PLAYING){c.pause()}}};Obje ct.defineProperty(iAd.Audio,"playEnabled",{get:function(){return iAd.Audio._playEnabled},set:function(a){if(iAd.Audio._playEnabled==a){return}iA d.Audio._playEnabled=a;iAd.Audio.updatePlayEnabled()}});iAd.Audio.playEnabled=tr ue;iAd.Audio.audioForURL=function(a){return iAd.Media.mediaTypeForURL(iAd.Audio,a)};iAd.Audio.restoreFromArchive=function(a ){return this.audioForURL(a.url)};iAd.Audio.prototype.urlStrategy=function(a){return iAd.Audio.urlStrategy?iAd.Audio.urlStrategy(a):this.callSuper(a)};iAd.Audio.pro totype.loadReadyStrategy=function(b,a){return iAd.Audio.loadReadyStrategy?iAd.Audio.loadReadyStrategy(b,a):this.callSuper(b,a )};iAd.Audio.loadReadyStrategy=null;iAd.Audio.urlStrategy=null;

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.VideoDOMReconstruct={};iAd.VideoDOMReconstruct.elementWasRemovedFromDocument =function(){this.unload(false);this._element=null};iAd.VideoTouchEvents={};iAd.V ideoTouchEvents.updateElementAttributes=function(){this.callSuper();if(this._ele ment){this._element.style.webkitTransform=this._showsControls?"none":iAd.CSS.t(0 ,0)}};iAd.VideoFullscreen={};iAd.VideoFullscreen.enterFullscreen=function(){try{ return this.callSuper()}catch(a){iAd.Console.warn("Fullscreen playback is not supported without user interaction.");return false}};iAd.VideoFullscreen.setPlaysInline=function(a){if(!a&&iAd.Device.IS_IPA D){iAd.Console.warn("Fullscreen playback is not supported on iPad.");a=true}this.callSuper(a)};iAd.VideoFullscreenLaunch={};iAd.VideoFullscr eenLaunch.handlePlaying=function(){this.callSuper();if(!this.playsInline&&iAd.De vice.IS_IPAD){this.enterFullscreen()}};iAd.VideoFullscreenOrientation={};iAd.Vid eoFullscreenOrientation.handleWebkitbeginfullscreen=function(){this._orientation BeforeEnterFullscreen=iAd.Device.getSupportedOrientations();iAd.Device.setSuppor tedOrientations([iAd.Device.ORIENTATION_PORTRAIT,iAd.Device.ORIENTATION_PORTRAIT _UPSIDE_DOWN,iAd.Device.ORIENTATION_LANDSCAPE_LEFT,iAd.Device.ORIENTATION_LANDSC APE_RIGHT]);this.callSuper()};iAd.VideoFullscreenOrientation.handleWebkitendfull screen=function(){iAd.Device.setSupportedOrientations(this._orientationBeforeEnt erFullscreen);this.callSuper()};iAd.MediaResetTimeOnPlaybackDidEnd={};iAd.MediaR esetTimeOnPlaybackDidEnd.handleEnded=function(){this.callSuper();if(iAd.Device.i OSVersionLessThan("9.0")){this.seekElement(0)}};iAd.VideoInlineLock={};iAd.Video InlineLock.setPlaysInline=function(a){if(this.playsInline==a){return}if(this._lo adState!=iAd.Media.LOAD_STATE_NONE){iAd.Console.warn('iAd.Video: Adjusting "playsInline" after loading is not supported on this iOS version.');return}this.callSuper(a)};iAd.MediaCompetitionPause={};iAd.MediaComp etitionPause.prepareForCompetition=function(){this.pause();this.callMethodNameAf terDelay("setPausedForCompetition",0)};iAd.MediaCompetitionPause.setPausedForCom petition=function(){this._pausedForCompetition=true};iAd.MediaCompetitionUnload= {};iAd.MediaCompetitionUnload.prepareForCompetition=function(){this.unload(true) };iAd.MediaUnloadTearDown={};iAd.MediaUnloadTearDown.unloadElement=function(){th is.callSuper();this.tearDownElement()};iAd.MediaUnloadTearDown.handleUnloadEvent =function(){this.callSuper();this.tearDownElement()};iAd.MediaUnloadTearDown.tea rDownElement=function(){var a=this.element;if(a.parentNode){a.parentNode.removeChild(a)}this._element=null} ;iAd.MediaUnloadAndRestoreTime={};iAd.MediaUnloadAndRestoreTime.unload=function( a){if(a&&this._loadState!=iAd.Media.LOAD_STATE_NONE){this._timeWhenUnloaded=this ._time}this.callSuper()};iAd.MediaUnloadAndRestoreTime.enterPlaybackState=functi on(a){delete this.seekTargetTime;this.callSuper(a)};iAd.MediaUnloadAndRestoreTime.handleEmpt ied=function(a){if(this._loadState!=iAd.Media.LOAD_STATE_NONE){this._timeWhenUnl oaded=this._time}var b=(this._targetPlaybackState==iAd.Media.PLAYBACK_STATE_PLAYING);this.callSuper( a);if(b){this.play()}};iAd.MediaUnloadAndRestoreTime.handleProgress=function(a){ if(this._timeWhenUnloaded){this.seekToTime(this._timeWhenUnloaded,true)}if(this. seekTargetTime){this.evaluateSeekTime()}this.callSuper(a)};iAd.MediaUnloadAndRes toreTime.seekToTime=function(c,b){if(!b){delete this._timeWhenUnloaded}var a=this.callSuper(c);if(a){this.awaitingSeekedEvent=true;this.seekTargetTime=c}r eturn a};iAd.MediaUnloadAndRestoreTime.getRenderable=function(){return this._timeWhenUnloaded?false:this.callSuper()};iAd.MediaUnloadAndRestoreTime.ge tTime=function(){return this._timeWhenUnloaded||this.callSuper()};iAd.MediaUnloadAndRestoreTime.handleS eeked=function(a){this.awaitingSeekedEvent=false;if(this._timeWhenUnloaded){this ._restoredUnloadedTime=this._timeWhenUnloaded;delete this._timeWhenUnloaded}var b=this._time;if(this.seekTargetTime){this.callMethodNameAfterDelay("evaluateSee kTime",0)}else{this.callSuper(a)}};iAd.MediaUnloadAndRestoreTime.handleTimeupdat e=function(a){if(this.seekTargetTime){if(iAd.Media.activeMedia[0]!=this){this.no tifyDidSeek()}else{if(!this._element.seeking){this.callMethodNameAfterDelay("eva luateSeekTime",0)}}}var b=this._pausedForCompetition;if(b){delete this._pausedForCompetition}if(b&&this._element.currentTime==0){return}if(!this. _timeWhenUnloaded){this.callSuper(a)}if(this._time>=this._restoredUnloadedTime){ delete this._restoredUnloadedTime;this.callMethodNameAfterDelay("notifyPropertyChange" ,0,"renderable")}};iAd.MediaUnloadAndRestoreTime.evaluateSeekTime=function(){if( !this.seeking||this.awaitingSeekedEvent){return}var a=this.isTimeInBufferedRange(this._time);if(this.isTimeInBufferedRange(this._ti me)){this.notifyDidSeek()}};iAd.MediaUnloadAndRestoreTime.getSeeking=function(){ return(this.seekTargetTime!=undefined)};iAd.MediaUnloadAndRestoreTime.notifyDidS eek=function(){if(!this.seeking){return}delete this.seekTargetTime;this.dispatchMediaNotification(iAd.Media.DID_SEEK)};iAd.Med iaForceLoad={};iAd.MediaForceLoad.loadElement=function(){var a=this.element;a.load();this.ignorePlayEvent=true;this.ignorePauseEvent=true;a. play();a.pause()};iAd.MediaForceLoad.handlePlay=function(a){if(this.ignorePlayEv ent){this.ignorePlayEvent=false;return}this.callSuper(a)};iAd.MediaForceLoad.han dlePause=function(a){if(this.ignorePauseEvent){this.ignorePauseEvent=false;retur n}this.callSuper(a)};iAd.MediaForceLoad.handleWaiting=function(a){if(this.ignore PlayEvent||this.ignorePauseEvent){return}this.callSuper(a)};iAd.MediaLoop={};iAd .MediaLoop.handleEnded=function(a){if(this._adapterLoop){this.playElement();retu rn}this.callSuper(a)};iAd.MediaLoop.setLoop=function(a){this._adapterLoop=a};iAd .MediaLoop.getLoop=function(){return this._adapterLoop};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.Audio_7_0",superclass:iAd.Audio,iOSVersion:"7.0"});iAd.Medi a.registerMediaAdapter(iAd.Audio,iAd.Audio_7_0);iAd.Class({name:"iAd.Audio_5_0", superclass:iAd.Audio,iOSVersion:"5.0",mixins:[iAd.MediaCompetitionPause]});iAd.M edia.registerMediaAdapter(iAd.Audio,iAd.Audio_5_0);iAd.Class({name:"iAd.Audio_4_ 3",superclass:iAd.Audio,iOSVersion:"4.3",mixins:[iAd.MediaCompetitionUnload,iAd. MediaLoop]});iAd.Media.registerMediaAdapter(iAd.Audio,iAd.Audio_4_3);iAd.Class({ name:"iAd.Audio_4_2",superclass:iAd.Audio,iOSVersion:"4.2",mixins:[iAd.MediaComp etitionUnload,iAd.MediaForceLoad,iAd.MediaLoop]});iAd.Media.registerMediaAdapter (iAd.Audio,iAd.Audio_4_2);

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAP.AudioAction",superclass:iAP.MediaAction,synthesizedProperti es:["playsInLCD"]});iAP.AudioAction.prototype.setPlaysInLCD=function(a){if(typeo f a==="string"&&a.toLowerCase()==="false"){this._playsInLCD=false}else{this._play sInLCD=!!a}};iAP.AudioAction.prototype.start=function(){if(this.url){var a=this.media=iAd.Audio.audioForURL(this.url);a.delegate=this;a.playsInLCD=this. playsInLCD;a.play()}else{this.end()}};iAP.AudioAction.prototype.mediaPlaybackDid End=function(a){this.callSuper(a);this.end()};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAd.ActivityIndicatorView",superclass:iAd.View,synthesizedPrope rties:["activityIndicatorViewStyle","hidesWhenStopped","animating","animationSty le","customIndicatorImage","autoSized"],archivedProperties:["activityIndicatorVi ewStyle","hidesWhenStopped","animating","animationStyle","customIndicatorImage", "autoSized"],cssClassName:"ad-activity-indicator-view"});iAd.ActivityIndicatorVi ew.collectionAccessor="activityIndicatorViews";iAd.ActivityIndicatorView.STYLE_W HITE="ad-white";iAd.ActivityIndicatorView.STYLE_GRAY="ad-gray";iAd.ActivityIndic atorView.STYLE_CUSTOM="ad-custom";iAd.ActivityIndicatorView.ANIMATING_CSS="ad-an imating";iAd.ActivityIndicatorView.SEGMENTS_CONTAINER_CSS="ad-segments-container ";iAd.ActivityIndicatorView.ANIMATION_STYLE_STEPPED="ad-animation-stepped";iAd.A ctivityIndicatorView.ANIMATION_STYLE_SMOOTH="ad-animation-smooth";iAd.ActivityIn dicatorView.NUMBER_OF_SEGMENTS=12;iAd.ActivityIndicatorView.OPTIMAL_DIMENSION=74 ;iAd.ActivityIndicatorView.prototype.init=function(b,a){this._activityIndicatorV iewStyle=a||iAd.ActivityIndicatorView.STYLE_WHITE;this._hidesWhenStopped=true;th is._autoSized=true;this.segmentsContainer=null;this._animating=false;this._anima tionStyle="";this.segments=[];this.callSuper(b);this.updateVisibility();this.ani mationStyle=this._animationStyle||iAd.ActivityIndicatorView.ANIMATION_STYLE_STEP PED;this.updateSegments()};iAd.ActivityIndicatorView.prototype.setupLayer=functi on(){this.callSuper();if(this.layer.hasClassName(iAd.ActivityIndicatorView.STYLE _WHITE)){this._activityIndicatorViewStyle=iAd.ActivityIndicatorView.STYLE_WHITE} else{if(this.layer.hasClassName(iAd.ActivityIndicatorView.STYLE_GRAY)){this._act ivityIndicatorViewStyle=iAd.ActivityIndicatorView.STYLE_GRAY}else{if(this.layer. hasClassName(iAd.ActivityIndicatorView.STYLE_CUSTOM)){this._activityIndicatorVie wStyle=iAd.ActivityIndicatorView.STYLE_CUSTOM}}}};iAd.ActivityIndicatorView.prot otype.layerWasCreated=function(){this.callSuper();this.activityIndicatorViewStyl e=this._activityIndicatorViewStyle;this.scaleContainer=document.createElement("d iv");this.scaleContainer.className="ad-scale-container";this.segmentsContainer=d ocument.createElement("div");this.segmentsContainer.className=iAd.ActivityIndica torView.SEGMENTS_CONTAINER_CSS;this.scaleContainer.appendChild(this.segmentsCont ainer);if(this._size.equals(iAd.Size.ZERO_SIZE)){this._size=new iAd.Size(37,37)}if(this._activityIndicatorViewStyle!==iAd.ActivityIndicatorView .STYLE_CUSTOM){this.createSegments()}this.layer.appendChild(this.scaleContainer) };iAd.ActivityIndicatorView.prototype.setSize=function(a){if(a.width!=a.height){ a.width=a.height}this.callSuper(a);this.updateSegments()};iAd.ActivityIndicatorV iew.prototype.setValueForAttribute=function(b,a){switch(a){case"ad-custom-indica tor-image":this.customIndicatorImage=iAd.Image.imageForURL(b,this.layerHasCustom Attribute("ad-has-hidpi-version"));break;default:this.callSuper(b,a)}};iAd.Activ ityIndicatorView.prototype.setHidesWhenStopped=function(a){this._hidesWhenStoppe d=a;this.updateVisibility()};iAd.ActivityIndicatorView.prototype.setActivityIndi catorViewStyle=function(a){if(this.layer){this.layer.removeClassName(this._activ ityIndicatorViewStyle);this.layer.addClassName(a)}this._activityIndicatorViewSty le=a};iAd.ActivityIndicatorView.prototype.setAnimating=function(a){if(this._anim ating==a){return}this._animating=a;this.layer.toggleClassName(iAd.ActivityIndica torView.ANIMATING_CSS,a);this.updateVisibility()};iAd.ActivityIndicatorView.prot otype.setAnimationStyle=function(a){if(a==this._animationStyle){return}this.laye r.removeClassName(this._animationStyle);this.layer.addClassName(a);this._animati onStyle=a};iAd.ActivityIndicatorView.prototype.setCustomIndicatorImage=function( a){if(a==null||a.url==null){this._customIndicatorImage=null;this.layer.removeCla ssName(iAd.ActivityIndicatorView.STYLE_CUSTOM);this.segmentsContainer.style.back groundImage="";if(!this.segments.length){this.createSegments()}this.updateSegmen ts();return}this._customIndicatorImage=a;if(a.loaded){this.renderImage()}else{a. addPropertyObserver("loaded",this)}};iAd.ActivityIndicatorView.prototype.setAuto Sized=function(a){if(a==this._autoSized){return}this._autoSized=a;if(a){this.aut oSize()}};iAd.ActivityIndicatorView.prototype.handlePropertyChange=function(b,a) {if(a=="loaded"){this.renderImage();this.removePropertyObserver("loaded",this)}} ;iAd.ActivityIndicatorView.prototype.renderImage=function(){if(this._autoSized){ this.autoSize()}this.layer.addClassName(iAd.ActivityIndicatorView.STYLE_CUSTOM); this.segmentsContainer.style.backgroundImage="url("+this._customIndicatorImage.r esolvedURL+")";this.segmentsContainer.style.webkitTransformOrigin="";this.scaleC ontainer.style.webkitTransform="scale(1)"};iAd.ActivityIndicatorView.prototype.a utoSize=function(){if(this._customIndicatorImage&&this._customIndicatorImage.loa ded){this.size=new iAd.Size(this._customIndicatorImage.width,this._customIndicatorImage.height)}}; iAd.ActivityIndicatorView.prototype.updateVisibility=function(){this.hidden=(thi s._hidesWhenStopped&&!this._animating)};iAd.ActivityIndicatorView.prototype.crea teSegments=function(){var c=[];var b=iAd.ActivityIndicatorView.NUMBER_OF_SEGMENTS;var a=this.segmentsContainer;while(b--){var d=document.createElement("div");d.style.opacity=Math.max(1-b/10,0.3);a.appendCh ild(d);c.push(d)}this.segments=c};iAd.ActivityIndicatorView.prototype.updateSegm ents=function(){if(!this.segments.length||this.layer.hasClassName(iAd.ActivityIn dicatorView.STYLE_CUSTOM)){return}var d=this._size.width/iAd.ActivityIndicatorView.OPTIMAL_DIMENSION,l=d<1?iAd.Activi tyIndicatorView.OPTIMAL_DIMENSION:this._size.width,m=Math.floor(l/2),h=l/74,b=Ma th.floor(3*h)*2,k=Math.floor(10*h)*2,c=Math.floor((l-b)/2),j=Math.floor((l-k)/2) ,e=Math.floor(3*h),a=this.segments.length;angle_increment=360/a;var g;for(var f=0;f<a;f++){g=this.segments[f];g.style.left=c+"px";g.style.top=j+"px";g.style. width=b+"px";g.style.height=k+"px";g.style.webkitBorderRadius=e+"px";g.style.web kitTransform="rotate("+angle_increment*f+"deg) translateY(-"+j+"px)"}this.segmentsContainer.style.webkitTransformOrigin=m+"px "+m+"px";this.scaleContainer.style.webkitTransform=d<1?"scale("+d+")":""};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Utils.replaceMethod(iAd.ActivityIndicatorView,"setSize",function(a){var b=Math.min(a.width,a.height);this.callOriginal(new iAd.Size(b,b))});

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAP.PageState",superclass:iAd.Object,synthesizedProperties:["na me","size","parentState"]});iAP.PageState.prototype.init=function(){this.callSup er()};iAP.PageState.prototype.isChildOfPageState=function(a){if(!this.parentStat e){return false}else{return(this.parentState==a||this.parentState.isChildOfPageState(a))} };Object.defineProperty(iAP.PageState,"supportedPageStates",{configurable:true,g et:function(){if(!this._supportedPageStates){this._initializePageStates()}return this._supportedPageStates}});Object.defineProperty(iAP.PageState,"pageStateForC urrentDevice",{configurable:true,get:function(){if(!this._pageStateForCurrentDev ice){var c,e;if(iAP.Context.IS_SAFARI){c=new iAd.Size(document.body.offsetWidth,document.body.offsetHeight);e=iAd.Size.ZERO_ SIZE}else{c=new iAd.Size(window.innerWidth,window.innerHeight);e=new iAd.Size(window.innerHeight,window.innerWidth)}for(var b=0,d=this.supportedPageStates.length;b<d;b++){var a=this.supportedPageStates[b];if(a.size.equals(c)||a.size.equals(e)){this._page StateForCurrentDevice=a;break}}if(!this._pageStateForCurrentDevice){this._pageSt ateForCurrentDevice=this.supportedPageStates[0]}}return this._pageStateForCurrentDevice}});Object.defineProperty(iAP.PageState,"validPa geStatesForCurrentDevice",{configurable:true,get:function(){if(!this._validPageS tatesForCurrentDevice){this._validPageStatesForCurrentDevice=[];var a=this.pageStateForCurrentDevice;while(a){this._validPageStatesForCurrentDevice .unshift(a);a=a.parentState}}return this._validPageStatesForCurrentDevice}});Object.defineProperty(iAP.PageState,"_ pageStateInitializationValues",{configurable:true,get:function(){return iAd.RootViewController.sharedRootViewController.configuration.pageStates}});iAP .PageState.pageStateNamed=function(a){if(!this._pageStatesByName){this._initiali zePageStates()}return this._pageStatesByName[a]};iAP.PageState._initializePageStates=function(){var b=[];var a={};var c=this._pageStateInitializationValues;c.forEach(function(e){var d=new iAP.PageState();d.name=e.name;d.size=new iAd.Size(e.size.width,e.size.height);d.parentState=a[e.parentStateName];a[d.nam e]=d;b.push(d)});this._supportedPageStates=b;this._pageStatesByName=a};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAP.RootViewController",superclass:iAd.RootViewController,mixin s:[iAd.EventTarget]});iAP.RootViewController.DID_FINISH_LAUNCHING_EVENT="didFini shLaunching";iAP.RootViewController.WILL_PAUSE_EVENT="adWillPause";iAP.RootViewC ontroller.DID_RESUME_EVENT="adDidResume";iAP.RootViewController.WILL_BE_DISMISSE D_EVENT="willBeDismissed";iAP.RootViewController.DID_HIDE_EVENT="didHide";iAP.Ro otViewController.DID_SHOW_EVENT="didShow";iAP.RootViewController.prototype.init= function(a){this.callSuper(a);this.eventTarget=document;if(!iAP.Context.IS_IAD&& this.targetDevice){if(this.targetDevice==="iPad"){iAd.Device.IS_IPAD=true;docume nt.body.addClassName("ad-iPad")}}if(!iAP.Context.IS_IAD_PRODUCER){iAP.PageState. validPageStatesForCurrentDevice.forEach(function(b){document.body.addClassName(b .name)})}this.navigationController.view.clipsToBounds=false;if(window.ad){window .ad.listener=this;this.registerItemsForPurchase(this.iTunesStoreIds)}if(a.videoW ifiToCellularMapping){iAd.VideoWifiToCellularMapping=a.videoWifiToCellularMappin g}};iAP.RootViewController.prototype.loadView=function(){if(!iAP.Context.IS_IAD_ PRODUCER){iAd.RootView.sharedRoot=new iAd.RootView("#root")}this.callSuper();if(iAd.AnalyticsGestureRecognizer){iAd.A nalyticsGestureRecognizer.sharedRecognizer.enabled=true}};iAP.RootViewController .prototype.registerItemsForPurchase=function(c){var a,b;if(c&&typeof(c.map)==="function"&&c.length>0){this.iTunesStoreIds=a=c}else{ this.purchaseItemsWereRegistered=false;return false}b=a.map(function(e){var d=parseInt(e,10);return isNaN(d)?1:d});iAd.Store.registerItemsForPurchase(b);this.purchaseItemsWereRegi stered=true;return true};iAP.RootViewController.prototype.getNavigationController=function(){var a=this.callSuper();a.backingTransitionController.hidesLoadingViewControllerWith Transition=false;return a};iAP.RootViewController.createRootViewController=function(a){window.addEventL istener("DOMContentLoaded",function(){var b=new iAP.RootViewController(a);b.setupEventDelegate();b.createAndDispatchEvent(iAP.R ootViewController.DID_FINISH_LAUNCHING_EVENT)});window.addEventListener("booklet closing",function(){iAd.RootViewController.sharedRootViewController.createAndDis patchEvent(iAP.RootViewController.WILL_BE_DISMISSED_EVENT)});window.addEventList ener("hidden",function(){iAd.RootViewController.sharedRootViewController.createA ndDispatchEvent(iAP.RootViewController.DID_HIDE_EVENT)});window.addEventListener ("shown",function(){iAd.RootViewController.sharedRootViewController.createAndDis patchEvent(iAP.RootViewController.DID_SHOW_EVENT)});iAP.RootViewController.confi gureViewport()};iAP.RootViewController.prototype.setupEventDelegate=function(){v ar b=iAP.EventDelegate.viewControllerScriptFunctions[this.configuration.id];if(b){ var a=new iAP.EventDelegate(this,this,b);a.processUserScript()}};iAP.RootViewController.p rototype.adWillBeDismissed=function(){this.createAndDispatchEvent(iAP.RootViewCo ntroller.WILL_BE_DISMISSED_EVENT)};iAP.RootViewController.configureViewport=func tion(){viewportOptions=["width=device-width","minimum-scale=1.0","maximum-scale= 1.0","user-scalable=no"];if(!iAP.Context.IS_DESKTOP){viewportOptions.push("shrin k-to-fit=no")}var a=document.createElement("meta");a.setAttribute("name","viewport");a.setAttribu te("content",viewportOptions.join(","));document.head.appendChild(a);if(!iAP.Con text.IS_IAD&&iAP.Context.IS_IOS){var b=document.createElement("meta");b.setAttribute("name","apple-mobile-web-app-ca pable");b.setAttribute("content","yes");document.head.appendChild(b)}};

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAP.DrawingEraserAction",superclass:iAP.DrawingBrushAction});

/**

*

* Copyright © 2009-2016 Apple Inc.  All rights reserved.

*

**/

 

 

iAd.Class({name:"iAP.LoadingViewController",superclass:iAP.ViewController,synthe sizedProperties:["minimumDisplayTime"],archivedProperties:["minimumDisplayTime"] });iAP.LoadingViewController.prototype.init=function(a){this._minimumDisplayTime =0;this.callSuper(a);iAP.LoadingViewController.sharedTransitionController.loadin gViewController=this};iAP.LoadingViewController.prototype.setMinimumDisplayTime= function(a){if(a==this._minimumDisplayTime){return}this._minimumDisplayTime=a;iA P.LoadingViewController.sharedTransitionController.loadingViewControllerMinimumD isplayTime=a};iAP.LoadingViewController.prototype.viewWillAppear=function(b){var a=iAP.LoadingViewController.sharedTransitionController.previouslyVisibleViewCon troller;if(a){this.view.size=a.view.size;this.orientation=a.orientation}this.cal lSuper(b)};iAP.LoadingViewController.prototype.viewDidLoad=function(){this.callS uper();var c=this.contentView.subviews;for(var a=0,b=c.length;a<b;a++){c[a].autoresizingMask=iAd.View.AUTORESIZING_FLEXIBLE_LE FT_MARGIN|iAd.View.AUTORESIZING_FLEXIBLE_RIGHT_MARGIN|iAd.View.AUTORESIZING_FLEX IBLE_TOP_MARGIN|iAd.View.AUTORESIZING_FLEXIBLE_BOTTOM_MARGIN}};Object.defineProp erty(iAP.LoadingViewController,"sharedTransitionController",{get:function(){if(! iAP.LoadingViewController.hasOwnProperty("_sharedTransitionController")){iAP.Loa dingViewController.sharedTransitionController=iAd.RootViewController.sharedRootV iewController.navigationController.backingTransitionController}return iAP.LoadingViewController._sharedTransitionController},set:function(a){iAP.Load ingViewController._sharedTransitionController=a}});;

iAP.EventDelegate.registerViewControllerEventDelegate("Scratchpad",function(){}) ,iAP.EventDelegate.registerViewEventDelegate("drawing","Scratchpad",function(){} ),iAP.EventDelegate.registerViewEventDelegate("clearButton","Scratchpad",functio n(){this.onViewActivate=function(a){this.viewController.startActionWithSourceVie w({className:"iAP.DrawingClearAction",delay:0,properties:{confirmBeforeClearing: "false",duration:1e-4,targetViewId:"Scratchpad-drawing"}},this)}}),iAP.EventDele gate.registerViewEventDelegate("object1467355820_flat_icons-graficheria.it-08"," Scratchpad",function(){this.onViewActivate=function(a){this.viewController.start ActionWithSourceView({className:"iAP.DrawingEraserAction",delay:0,properties:{br ushColor:"#000000",brushCompositeOperation:"destination-out",duration:1e-4,targe tViewId:"Scratchpad-drawing"}},this)}}),iAP.EventDelegate.registerViewEventDeleg ate("button","Scratchpad",function(){this.onViewActivate=function(a){this.viewCo ntroller.startActionWithSourceView({className:"iAP.DrawingBrushAction",delay:0,p roperties:{brushColor:"#fef30a",brushCompositeOperation:"source-over",duration:1 e-4,targetViewId:"Scratchpad-drawing"}},this)}}),iAP.EventDelegate.registerViewE ventDelegate("button-1","Scratchpad",function(){this.onViewActivate=function(a){ this.viewController.startActionWithSourceView({className:"iAP.DrawingBrushAction ",delay:0,properties:{brushColor:"#71ba32",brushCompositeOperation:"source-over" ,duration:1e-4,targetViewId:"Scratchpad-drawing"}},this)}}),iAP.EventDelegate.re gisterViewEventDelegate("button-2","Scratchpad",function(){this.onViewActivate=f unction(a){this.viewController.startActionWithSourceView({className:"iAP.Drawing BrushAction",delay:0,properties:{brushColor:"#50c0ed",brushCompositeOperation:"s ource-over",duration:1e-4,targetViewId:"Scratchpad-drawing"}},this)}}),iAP.Event Delegate.registerViewEventDelegate("button-3","Scratchpad",function(){this.onVie wActivate=function(a){this.viewController.startActionWithSourceView({className:" iAP.DrawingBrushAction",delay:0,properties:{brushColor:"#f06d1a",brushCompositeO peration:"source-over",duration:1e-4,targetViewId:"Scratchpad-drawing"}},this)}} ),iAP.EventDelegate.registerViewEventDelegate("button-4","Scratchpad",function() {this.onViewActivate=function(a){this.viewController.startActionWithSourceView({ className:"iAP.DrawingBrushAction",delay:0,properties:{brushColor:"#fb0005",brus hCompositeOperation:"source-over",duration:1e-4,targetViewId:"Scratchpad-drawing "}},this)}}),iAP.EventDelegate.registerViewEventDelegate("button-5","Scratchpad" ,function(){this.onViewActivate=function(a){this.viewController.startActionWithS ourceView({className:"iAP.DrawingBrushAction",delay:0,properties:{brushColor:"#8 1511e",brushCompositeOperation:"source-over",duration:1e-4,targetViewId:"Scratch pad-drawing"}},this)}}),iAP.EventDelegate.registerViewEventDelegate("button-6"," Scratchpad",function(){this.onViewActivate=function(a){this.viewController.start ActionWithSourceView({className:"iAP.DrawingBrushAction",delay:0,properties:{bru shColor:"#892f89",brushCompositeOperation:"source-over",duration:1e-4,targetView Id:"Scratchpad-drawing"}},this)}}),iAP.EventDelegate.registerViewEventDelegate(" button-7","Scratchpad",function(){this.onViewActivate=function(a){}}),iAP.EventD elegate.registerViewEventDelegate("brush","Scratchpad",function(){this.onViewAct ivate=function(a){this.viewController.startActionWithSourceView({className:"iAP. DrawingBrushSizeAction",delay:0,properties:{brushSize:"1.87",duration:1e-4,targe tViewId:"Scratchpad-drawing"}},this)}}),iAP.EventDelegate.registerViewEventDeleg ate("brush-1","Scratchpad",function(){this.onViewActivate=function(a){this.viewC ontroller.startActionWithSourceView({className:"iAP.DrawingBrushSizeAction",dela y:0,properties:{brushSize:"9.91",duration:1e-4,targetViewId:"Scratchpad-drawing" }},this)}}),iAP.EventDelegate.registerViewEventDelegate("brush-2","Scratchpad",f unction(){this.onViewActivate=function(a){this.viewController.startActionWithSou rceView({className:"iAP.DrawingBrushSizeAction",delay:0,properties:{brushSize:"2 0.28",duration:1e-4,targetViewId:"Scratchpad-drawing"}},this)}}),iAP.EventDelega te.registerViewEventDelegate("object1467355762_OFFice-74","Scratchpad",function( ){this.onViewActivate=function(a){this.viewController.startActionWithSourceView( {className:"iAP.DrawingBrushAction",delay:0,properties:{brushColor:"#FFFFFF",bru shCompositeOperation:"source-over",duration:1e-4,targetViewId:"Scratchpad-drawin g"}},this)}});

iBook, OS X Yosemite (10.10.1)

Posted on Aug 2, 2016 6:06 PM