/*************************************************************************
Copyright (c) 2011. Adobe Systems Incorporated. All rights reserved.

You may distribute this file in source code or object code, solely in
unmodified form, and in all cases only as incorporated into your own
application created with the Adobe software.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

**************************************************************************/
/*************************************************************************
 AdobePatentID="B1316"
 AdobePatentID="B1318"
 edge.authoring.0.0.1.min.js - version 0.1.1
**************************************************************************/
(function(h,i){function o(){for(A=[];e.length>0;)e.shift().call()}var t=i.triggerDict={element:function(a,g,b){a&&h(g).bind(b,a)},timeline:function(a,g,b){if(a&&g){var d=this.getTimelineData(g),c=d.toState,d=d.fromState;if(!this.tlProxy)this.tlProxy={};this.tlProxy[b]=a;this._getTimeline(g,c,d).addObserver(this.tlProxy)}}},l=i.Symbol=function(a,g){i.Notifier.call(this);this.widgetEventPrefix="edgeSym_";this.element=null;this.options={data:null,initialState:null};this.states={};this.timelines={};this.timelineCache=
{};this.timelineStateMap={};this.defaultBaseState="Base State";this.baseState=null;this._init(a,g)};i.symbol=l;var r=i.PropertyTween,s=r.substituteParameters;l._substituteParameters=s;var n,p=i.symbolDefns={};i.baseDataName="edgeBaseData";h.extend(l.prototype,i.Notifier.prototype,{constructor:l,_init:function(a,g){if(g&&(h.extend(this.options,g),h.isArray(g.observers)&&g.observers.length))for(var b=g.observers.length,d=0;d<b;d++)this.addObserver(g.observers[d]);if(!this.options.data)return null;this.element=
a;d=this._createEvent();this.notifyObservers("onPreSymbolInit",d);b=this._createEvent();if(d.performDefaultAction){d=h(a);d.data("edgeSymbol",this);if(!d.get(0).id)d.get(0).id=l._makeUniqueID();var c=this.options.data;this.parameterValues=this._makeDefaultParameters();h.extend(this.parameterValues,this.options.parameters);c.content&&this._injectMarkup();c.actions&&this._addActionsFromData(c.actions);c.timelines&&this._createTimelineSetFromData(c.timelines,c.states);c.bindings&&c.bindings.length&&
this._addBindingsFromData(c.bindings);var e=d[0].nodeName=="BODY";c.content&&c.content.dom&&!e&&(c=d.css("position"),c!="absolute"&&c!="relative"&&d.css("position","relative"));this._goToInitialState();if(d[0].style&&(typeof d[0].style.webkitTransform=="undefined"||d[0].style.webkitTransform===""||d[0].style.webkitTransform=="none"))d[0].style.webkitTransform="translateZ(0)";this.notifyObservers("onPostSymbolInit",b);return this}else this.notifyObservers("onPostSymbolInit",b)},_createEvent:function(a){var g=
{Symbol:this,element:this.element,performDefaultAction:!0};h.extend(g,a);return g},_makeDefaultParameters:function(){var a={},g=this.options.data.parameters;if(g)for(var b in g)if(g.hasOwnProperty(b))a[b]=g[b].defaultValue;h.extend(a,this._getSymbolParams());return a},_injectMarkup:function(a){var g=a,b=this._createEvent({markup:g});this.notifyObservers("onPreInjectMarkup",b);g=b.markup;a=this._createEvent({markup:g});if(b.performDefaultAction){var d,b=this.parameterValues;d=this.options.data.content;
if(!g&&d)if(d.ref)g="",h(d.ref).each(function(a,b){g+=h(b).html()});else if(d.markup)g=d.markup;else if(d.dom){var c=i.DeclareMarkup;if(c){var e=d.dom,f=d.symbolInstances;if(this.options.opts&&this.options.opts.regenerateID===!0){JSON.parse(JSON.stringify(d.dom));f=[];d.symbolInstances&&(f=JSON.parse(JSON.stringify(d.symbolInstances)));var B=e.length;for(d=0;d<B;d++)this._reIdDOMElements(e[d],f)}c.renderDOM(e,h(this.element).get(0),b,this.getSymbolTypeName(),f);f&&f.length>0&&this._processNestedSymbolInstances(f)}}if(g){if((c=
this._getParentSymbol())&&c.options.data.actors&&c.options.data.actors.instance_parameters){e=c.options.data.actors.instance_parameters;f=e.length;for(d=0;d<f;d++)B=r.substituteParameters(e[d].selector,c._getSymbolParams()),h(B).filter(h(this.element)).length&&h.extend(b,e[d].parameters)}g=s(g,b);h(g).appendTo(this.element)}}this.notifyObservers("onPostInjectMarkup",a)},_processNestedSymbolInstances:function(a){if(a)for(var g=a.length,b=0;b<g;b++){var d="#"+a[b].id;h(d).get(0)&&i.convertElementToSymbolInstance(d,
a[b].symbolName)}},_reIdDOMElements:function(a,g){var b=h(this.element).get(0).id,d=a.id;if(!d||d==="")d=l._makeUniqueID();for(var b=b+"_"+d,d=g.length,c=0;c<d;c++)if(g[c].id==a.id)g[c].id=b;a.id=b;if(a.c){b=a.c.length;for(d=0;d<b;d++)this._reIdDOMElements(a.c[d],g)}},_getParentSymbol:function(){for(var a=h(this.element).parents(),g=a.length,b=0;b<g;b++){var d=l.get(a[b]);if(d)return d}return null},_createTimelineSetFromData:function(a,g){this.states=g;this.timelines=a;this.baseState=this.options.data.baseState;
if(!this.baseState)this.baseState="Base State";return this},_addBindingsFromData:function(a){for(var g=a.length,b=0;b<g;b++){var d=a[b],c=d[0];if(c[0]=="element"){var e=s(c[1],this._getSymbolParams());e!=c[1]&&(c=i.cloneJSONObject(c),c[1]=e)}if(e=t[c[0]])(d=this._getActionCallbackFunc(c[0],c[1],d.slice(1)))&&e.apply(this,[d].concat(c.slice(1)))}},_getActionCallbackFunc:function(a,g,b){var d=this[b[0]],c=this;if(typeof d=="function")if(b.slice(1),a=="element")return function(){try{var a=Array.prototype.slice.call(arguments);
return d.apply(c,a)}catch(b){}};else if(a=="timeline")return function(){try{var b=Array.prototype.slice.call(arguments),e=h.Event(a);b.splice(0,0,e,g);return d.apply(c,b)}catch(f){}};return null},_addActionsFromData:function(a){h.extend(this,a)},_getSymbolParams:function(){return{symbolSelector:"#"+h(this.element).get(0).id}},_flushCache:function(){var a=this.timelines,g;for(g in a)a.hasOwnProperty(g)&&this._dirtyTimeline(g)},_goToInitialState:function(){var a={parameters:this.parameterValues},g=
this.options.data.initialState;if(!g)g=this.options.data.baseState;l.useCSSAnimation||(g?this._applyRules(this._buildStateForCache(null,g,a)):(this.options.data.autoPlay||this.getTimelineData("Default Timeline"))&&this.seek("Default Timeline",0))},_preNotify:function(a,g,b){var d={};h.extend(d,b);b=this._createEvent({tlName:g,tlOptions:d});this.notifyObservers(a,b);if(b.performDefaultAction)return b.tlOptions;else d=b.tlOptions,g={Symbol:this,timelineName:g,tlOptions:d,performDefaultAction:!0},a=
a.replace(/onPre/,"onPost"),this.notifyObservers(a,g)},play:function(a,g){var b=this._preNotify("onPreSymbolPlay",a,g);if(typeof b!==void 0){if(typeof a==="string"){this._rememberBaseStateForTimeline(a);var d={parameters:this.parameterValues};h.extend(d,b);this.timelines&&(this._seek(a,0,d),this._play(a,d))}this.notifyObservers("onPostSymbolPlay",this._createEvent({timeline:a,tlOptions:b}));return this}},playContinue:function(a,g){var b=this._preNotify("onPreSymbolPlayContinue",a,g);if(typeof b!==
void 0){if(typeof a==="string"){this._rememberBaseStateForTimeline(a);var d={parameters:this.parameterValues};h.extend(d,b);this.timelines&&this._play(a,d)}this.notifyObservers("onPostSymbolPlayContinue",this._createEvent({timeline:a,tlOptions:b}));return this}},seek:function(a,g,b){b=this._preNotify("onPreSymbolSeek",a,b);if(typeof b===void 0)return null;if(typeof a==="string"){this._rememberBaseStateForTimeline(a);var d={parameters:this.parameterValues};h.extend(d,b);this.timelines&&this._seek(a,
g,d)}this.notifyObservers("onPostSymbolSeek",this._createEvent({timeline:a,tlOptions:b}));return null},getSymbolTypeName:function(){return this.options.data.typeName},getParameter:function(a){return this.parameterValues[a]},setParameter:function(a,g){this.parameterValues[a]=g},destroy:function(){h(this.ele).removeData("edgeSymbol");return this},_addState:function(a,g){this.states[a]=g},_addTimelineData:function(a,g){this.timelines[a]=g;if(g.fromState&&g.toState)this.timelineStateMap={}},_getTimelineFromStates:function(a,
g){if(typeof this.timelineStateMap[a+"//"+g]=="undefined"){for(var b in this.timelines)if(this.timelines.hasOwnProperty(b)){var d=this.timelines[b];this.timelineStateMap[d.fromState+"//"+d.toState]=b}typeof this.timelineStateMap[a+"//"+g]=="undefined"&&(this.timelineStateMap[a+"//"+g]=null);return this.timelineStateMap[a+"//"+g]}},_setTimelineData:function(a,g){var b=this.timelines[a],d=this._getTimeline(a,b.toState,b.fromState),c=d.observers.slice(0);this._dirtyTimeline(a);if(b&&b.fromState&&b.toState)this.timelineStateMap=
{};this._addTimelineData(a,g);var e=c.length;if(e){d=this._getTimeline(a,b.toState,b.fromState);for(b=0;b<e;b++)d.addObserver(c[b])}},_saveObservers:function(a){var g=this.timelines[a],g=this._getTimeline(a,g.toState,g.fromState);if(!this.timelineObservers)this.timelineObservers={};this.timelineObservers[a]=g.observers.slice(0)},_restoreObservers:function(a,g){if(this.timelineObservers&&this.timelineObservers[a]){var b=this.timelineObservers[a];if(b){var d,c=b.length;for(d=0;d<c;d++)g.addObserver(b[d])}}},
_dirtyTimeline:function(a){this._saveObservers(a);this.timelineCache[this._makeTimelineKey(a)]=null;this.timelineStateMap={};this.toStateCache=this.fromStateCache=null},_isCacheDIrty:function(a){return this.timelineCache[this._makeTimelineKey(a)]===null},_getStateData:function(a){return this.states[a]},getTimelineData:function(a){return this.timelines[a]},_makeTimelineKey:function(a,g,b){var d=null;if(!g||!b)d=this.getTimelineData(a);if(!g)g=d.toState;if(!b)b=d.fromState;return a+"-"+(g?g:"")+"-"+
(b?b:"")},_getBaseStateData:function(){if(this.baseState)return this._getStateData(this.baseState);else for(var a in this.states)if(this.states[a].baseState)return this.baseState=a,this._getStateData(this.baseState);return this._getStateData(this.defaultBaseState)},_mergeBaseState:function(a){var g=i.cloneJSONObject(this._getBaseStateData()),b;for(b in a)a.hasOwnProperty(b)&&(g[b]||(g[b]=[]),g[b]=g[b].concat(a[b]));return g},_getTimeline:function(a,g,b){var d=this._makeTimelineKey(a,g,b);if(this.timelineCache[d])return this.timelineCache[d];
var c=this.getTimelineData(a).timeline;if(g||b)c=i.cloneJSONObject(c);for(var e=c.length,f={},h={},j,k,m=0;m<e;m++)k=c[m],k.tween&&(j=k.tween[1],f[j]||(f[j]=[]),f[j].push(k),j=k.tween[0]+":"+k.tween[1]+":"+k.tween[2],h[j]||(h[j]=[]),h[j].push(k));k=function(a,b){return a.position-b.position};for(j in h)h.hasOwnProperty(j)&&h[j].sort(k);var l,n,o,p,r,s,t,v;if(g)for(l in g=this._mergeBaseState(this._getStateData(g)),g)if(g.hasOwnProperty(j)){m=g[l];n=f[l];o=m.length;for(t=0;t<o;t++){k=m[t];p=k[0];r=
k[1];s=k[2];var q=null,w=-1,e=n.length;for(v=0;n&&v<e;v++)if(k=n[v],j=k.tween,j[0]==p&&j[2]==r&&(w==-1||k.position+k.duration>w))q=k,w=k.position+k.duration;q&&q.tween.length>4&&q.tween[4]&&q.tween[4].copyToState&&(q.tween[3]=s)}}g={};if(b)for(l in b=this._getStateData(b),b)if(b.hasOwnProperty(l)){m=b[l];n=f[l];o=m.length;for(t=0;t<o;t++){k=m[t];p=k[0];r=k[1];s=k[2];g[p+":"+l+":"+r]=s;q=null;w=-1;if(n)e=n.length;for(v=0;n&&v<e;v++)if(k=n[v],j=k.tween,j[0]==p&&j[2]==r&&(w==-1||k.position<w))q=k,w=
k.position;if(q&&(k=q.tween.length>4&&q.tween[4]&&q.tween[4].copyFromState,q.tween.length<4||!q.tween[4]||typeof q.tween[4].fromValue=="undefined"||k))q.tween[4]||(q.tween[4]={}),q.tween[4].fromValue=s}}if(b)for(j in h)if(h.hasOwnProperty(j)&&h[j][0].position>0&&(b=g[j],b!==void 0))k=i.cloneJSONObject(h[j][0]),k.tween[3]=k.tween[4].fromValue=b,b=k.position,k.position=0,k.duration=b,c.push(k);c=this._createTimelineFromData(c);this._restoreObservers(a,c);return this.timelineCache[d]=c},_createTimelineFromData:function(a){for(var g=
jQuery.Edge.Timeline.createTimeline(),b=a.length,d=0;d<b;d++){var c=a[d],e=null;c.timeline?e=l.prototype._createTimelineFromData(c.timeline):c.tween?e=i.Timeline.createTween.apply(null,c.tween):c.trigger&&(e=c.trigger.slice(0,2),e.push(this),e=i.Timeline.createTrigger.apply(null,e));e&&g.add(e,c.position,c.duration,c.easing)}return g},playReverse:function(a,g){if(!(typeof a!="string"||a.length===0)){var b=this._preNotify("onPreSymbolPlayReverse",a,g);if(typeof b!==void 0){this._rememberBaseStateForTimeline(a);
var d=this.getTimelineData(a).fromState,c=this.getTimelineData(a).toState,e={};h.extend(e,b,this.opts,{playDirection:"reverse"},{parameters:this.parameterValues});e.continueFromCurrentPos||this._ensureToState(a,e);if(d=this._getTimeline(a,c,d)){if(!this.tlPlayHandler){var f=this;this.tlPlayHandler={};this.tlPlayHandler.onComplete=function(){f._ensureFromState(this.timelineName,this.opts);this.tl.removeObserver(f.tlPlayHandler)}}h.extend(this.tlPlayHandler,{tl:d,timelineName:a,opts:e});d.addObserver(this.tlPlayHandler);
e.continueFromCurrentPos||d.seek(d.getDuration());d.play(e)}this.notifyObservers("onPostSymbolPlayReverse",this._createEvent({timeline:a,tlOptions:b}));return this}}},playReverseContinue:function(a,g){var b=this._preNotify("onPreSymbolPlayReverseContinue",a,g);if(typeof b!==void 0){this._rememberBaseStateForTimeline(a);if(typeof a==="string"){var d={};h.extend(d,b,{continueFromCurrentPos:!0},{parameters:this.parameterValues});this.playReverse(a,d)}this.notifyObservers("onPostSymbolPlayReverseContinue",
this._createEvent({timeline:a,tlOptions:b}));return this}},_buildStateForCache:function(a,g){var b={};if(g){var d=this.states[g];if(d){var c={},e,f,i;if(a){var j=this.getTimelineData(a).timeline,k=j.length;for(e=0;e<k;e++)i=j[e],i.tween&&(f=s(i.tween[1],this.parameterValues),f=i.tween[0]+":"+f+":"+i.tween[2],c[f]||(c[f]=[]),c[f].push(i))}for(var m in d)if(m!=="prototype"){c=d[m];for(e=0;e<c.length;e++)if(j=c[e],f=s(m,this.parameterValues),j[0]=="style"||j[0]=="transform"||j[0]=="color"){b[f]||(b[f]=
[]);i=j[2];if(j[3]&&j[3].valueTemplate)if(k=r.prototype.parseTemplate.call(null,j[3].valueTemplate)){var n=k.length,l=[],o=j[2];h.isArray(o)||(o=[o]);for(var p=0;p<n;p++)i=k[p],i.isPlaceholder?l.push(o[i.value]):l.push(i.value);i=l.join("")}else i=j[2].join("");b[f].push({decl:j,value:i})}}return b}}},_ensureState:function(a,g,b){var d=g+"Cache";this[d]||(this[d]={});var c=null;this[d][a]?c=this[d][a]:(g=this.getTimelineData(a)[g],c=this._buildStateForCache(a,g,b),!this._isParameterizedActorTL(a)&&
!this._isParameterizedActorState(g)&&(this[d][a]=c));this._applyRules(c,b)},_applyRules:function(a,c){var b=this,d,e=function(){var a=h(this),e={},f=h.data(this,"edgeBaseData");f||(b._rememberBaseState(a),f=h.data(this,"edgeBaseData"));h.extend(e,f.transformData,d);h.data(this,i.TransformTween.dataName,e);f=!1;if(c)f=c.dontForceZ;i.TransformTween.applyTransform(a,e,void 0,{dontForceZ:f});(e=h.data(this,"ui_visibility"))&&a.css("visibility",e)},f;for(f in a)if(a.hasOwnProperty(f)){var u=a[f],l=u.length;
d=null;for(var j=0;j<l;j++){var k=u[j].decl,m=k[1];k[0]=="transform"?(d||(d={}),d[m]=u[j].value):(k=u[j].decl,k=u[j].value,h(f).css(m,k))}d&&i.TransformTween&&h(f).each(e)}},_ensureFromState:function(a,c){this._ensureState(a,"fromState",c)},_ensureToState:function(a,c){this._ensureState(a,"toState",c)},_isParameterizedActorTL:function(a){for(var a=this.getTimelineData(a).timeline,c=a.length,b=0;b<c;b++){var d=a[b];if(d.tween&&typeof d.tween[1]=="string"&&d.tween[1].search(/\$\{/)!=-1)return!0}return!1},
_isParameterizedActorState:function(a){if(!a)return!1;a=this.states[a];if(!a)return!1;for(var c in a)if(c.search(/\$\{/)!=-1)return!0;return!1},_isReverse:function(a){return typeof a=="object"&&typeof a.playDirection=="string"&&a.playDirection=="reverse"},_play:function(a,c){var b=this.getTimelineData(a);if(b){var d=b.toState;if(a&&(b=this._getTimeline(a,d,b.fromState))){if(d&&!this._isReverse(c)){if(!this.tlPlayHandler){var e=this;this.tlPlayHandler={};this.tlPlayHandler.onComplete=function(){e._ensureToState(this.timelineName,
this.opts);this.tl.removeObserver(e.tlPlayHandler)}}h.extend(this.tlPlayHandler,{tl:b,timelineName:a,opts:c});b.addObserver(this.tlPlayHandler)}b.play(c)}}},_seek:function(a,c,b){var d=this._isCacheDIrty(a),e=this.getTimelineData(a);if(e){var f=e.toState,e=e.fromState;b||(b={});!d&&b.skipFromState?b.assumeStateUnchanged=!0:(this._ensureFromState(a,b),b.assumeStateUnchanged=!1);d=0;if(a&&(f=this._getTimeline(a,f,e)))d=f.getDuration(),f.seek(c,b);c>=d&&this._ensureToState(a,b)}},_rememberBaseStateForTimeline:function(a){if(a&&
(a=this.getTimelineData(a)))for(var a=a.timeline,c=a.length,b=0;b<c;b++){var d=a[b];d.tween&&this._rememberBaseState(s(d.tween[1],this.parameterValues))}},_rememberBaseState:function(a){h(a).each(function(){var a=h(this),b=h.data(this,"edgeBaseData");if(!b)b={},h.data(this,"edgeBaseData",b),b.inlineValue=a.attr("style"),b.transformData=i.TransformTween.prototype.buildTransformData.call(null,this)})},compute:function(a,c,b,d,e){var f;if(a){var h=this.getTimelineData(a);(a=this._getTimeline(a,h.toState,
h.fromState))&&(f=a.compute(c,b,d,e))}return f},findNext:function(a,c,b,d,e,f,h){if(a){var i=this.getTimelineData(a),d=d.toString();if(a=this._getTimeline(a,i.toState,i.fromState)){var j,i=a.getDuration()+10,d=parseFloat(d.replace(/[a-zA-Z%]+$/,"")),k=f+10;j=a.compute(c,b,f,h);for(var m=j[e],m=parseFloat(m.replace(/[a-zA-Z%]+$/,"")),k=f;k<=i;k+=10)if((j=a.compute(c,b,k,h))&&j.length){f=j[e];f=parseFloat(f.replace(/[a-zA-Z%]+$/,""));if(d>=Math.min(m,f)&&d<=Math.max(m,f))return k;m=f}}}return-1},remove:function(){var a=
this._createEvent({});this.notifyObservers("onPreRemove",a);if(a.performDefaultAction){h(this.element).removeData("edgeSymbol");if(n)for(var c=n.length;c>=0;c--)n[c]==this&&n.splice(c,1);this.element=null;this.notifyObservers("onPostRemove",a)}}});l.get=function(a){return h(a).data("edgeSymbol")};l.getDefaultEasing=function(){return i.TimelineObject.defaultEasing};var z=(new Date).getTime(),x=function(){for(var a="eid_"+z++;h("#"+a).length>0;)a="eid_"+z++;return a};l._makeUniqueID=x;var y=0,A=[],
e=[];$loadCalled=!1;i.requestImage=function(a){y++;var c=new Image;A.push(c);h(c).load(function(){y--;y<=0&&$loadCalled&&setTimeout(o,0)});c.src=a};i.ready=function(a){e.push(a)};h(window).load(function(){$loadCalled=!0;y<=0&&o()});i.compositions=i.compositions||{};i.compositionDefns=i.compositionDefns||{};i.registerCompositionDefn=function(a,c){i.compositionDefns[a]||(i.compositionDefns[a]=c)};var c=i.Composition=function(a,c,b){b=b||{};if(!window.edge_authoring_mode||b._tool||window.edge_remote_authoring){i.Notifier.call(this);
var d,e,n=this,u=this.symbolDefns=i.compositionDefns[a];this.symbolInstances=[];this.compId=a;f(p);for(d in c)a=h(c[d]),a.each(function(){e=new l(this,{data:u[d],comp:n});n.symbolInstances.push(e)})}};h.extend(c.prototype,i.Notifier.prototype,{play:function(a){if(!window.edge_authoring_mode||a)if(typeof i.autoPlay=="undefined"||i.autoPlay)for(var a=this.symbolInstances.length,c=0;c<a;c++){var b=this.symbolInstances[c],d=b.options.data.autoPlay;typeof d=="string"&&d!="true"?b.play(d):(typeof d=="undefined"||
d===!0||d=="true")&&b.play("Default Timeline")}}});var f;i.initialize=function(a,c,b){if(!window.edge_authoring_mode||b||window.edge_remote_authoring){if(typeof n=="undefined")n=i.symbolInstances=[];h.extend(p,a);f(p);var a=n,d;for(d in p)if(p.hasOwnProperty(d)){p[d].typeName=d;var b=[],b=".symbol_"+d,b=c?h(c).find("*").andSelf().filter(b):h(b),e=b.size(),o;for(o=0;b&&o<e;o++){var u=new l(h(b.get(o)),{data:p[d]});n.push(u);if(d=="stage")i.stage=u}}if(a.length===0||!i.stage)i.stage=new l(h("body"),
{data:p.stage}),n.push(i.stage);window.runtimeReady&&window.runtimeReady()}};i.convertElementToSymbolInstance=function(a,c){if(a&&h(a)&&n&&p[c]){var b=new l(h(a),{data:p[c],opts:{regenerateID:!0}});n.push(b)}};i.getSymbolInstances=function(a){var c=[];if(!n)return c;for(var b=n.length,d=0;d<b;d++)for(a in p)p.hasOwnProperty(a)&&n[d].getSymbolTypeName()==a&&c.push(n[d]);return c};i.removeSymbolInstance=function(a){n&&(a=l.get(a))&&a.remove()};f=function(a){for(var c in a)if(a.hasOwnProperty(c)&&a[c].timelines)for(var b in a[c].timelines)if(a[c].timelines.hasOwnProperty(b))for(var d=
a[c].timelines[b].timeline,e=d.length,f=0;f<e;f++){var h=d[f];if(!h.id)h.id=x()}};i.play=function(a){if(!window.edge_authoring_mode||a)if(typeof i.autoPlay=="undefined"||i.autoPlay)for(var a=this.symbolInstances.length,c=0;c<a;c++){var b=n[c],d=b.options.data.autoPlay;typeof d=="string"&&d!="true"?b.play(d):(typeof d=="undefined"||d===!0||d=="true")&&b.play("Default Timeline")}};i.logDebug=function(){};i.logInfo=function(){};i.logWarn=function(){};i.logError=function(){};i.logFatal=function(){};h.extend(i.TimelineObject.prototype,
{compute:function(a,c,b,d){if(!this.dDuration){var e=this.duration,f=null;this.animation&&this.animation.getDuration&&(f=this.animation.getDuration());this.dScale=e!=-1&&e!==0?f/e:1;this.dDuration=e!=-1?e:f}e=this.dDuration;e=e===0?1:e;b>=e&&(b=e);b<=0&&(b=0);if(this.animation)return e=h.easing[this.easing](b/e,b,0,1,e),this.animation.compute(a,c,b*this.dScale,e,d)}});h.extend(i.Timeline.prototype,{compute:function(a,c,b,d){for(var e=this.objects,f=e.length,i=[],l={obj:null,end:0},j={obj:null,start:this.getDuration()},
k=0;k<f;k++){var m=e[k];if(!m.animation.isTrigger&&c==m.animation.property&&a==m.animation.elements)if(b>=m.position&&b<=m.position+m.duration){if(m=m.compute(a,c,b-m.position,d))h.isArray(m)||(m=[m]),i=m}else if(b<m.position){if(m.position<=j.start)j.start=m.position,j.obj=m}else if(b>m.position+m.duration&&m.position+m.duration>=l.end)l.end=m.position,l.obj=m}if(!i||h.isArray(i)&&i.length===0)if(l.obj&&l.obj.animation.toValue)i=l.obj.animation.toValue;else if(j.obj&&j.obj.animation.fromValue)i=
j.obj.animation.fromValue;h.isArray(i)||(i=[i]);return i}});h.extend(r.prototype,{compute:function(a,c,b,d){b=this.property;if(a!=this.elements||c!=b)return null;for(var a=this.fromValues,c=this.toValues,b=this.filter,e=a.length,f=[],i=0;i<e;i++){var h=a[i],j=c[i];h+=(j.value-h)*d;b&&b[i]&&(h=b[i](h));f.push(h+j.unit)}return f}});h.extend(i.TransformTween.prototype,{compute:r.prototype.compute})})(jQuery,jQuery.Edge);(function(h,i){if(typeof i.DeclareMarkup=="undefined"){var o=function(){function h(e,c,f,a,g){var b=document.createElement(e);b.id=c;b.style.position="absolute";$eleNew=$(b);$eleNew.addClass(c+"_id");if(f.className)b.className=f.className;$(b).css("left",f.rect[0]+"px");$(b).css("top",f.rect[1]+"px");f.rect[2]>0&&$(b).css("width",f.rect[2]+"px");f.rect[3]>0&&$(b).css("height",f.rect[3]+"px");f.overflow&&($(b).css("overflow",f.overflow),(f.overflow=="hidden"||f.overflow=="scroll")&&$(b).css("text-overflow",
"clip"));f.br&&(f.br.length==1?$(b).css("border-radius",f.br[0]+"px"):($(b).css("border-top-left-radius",f.br[0]),$(b).css("border-top-right-radius",f.br[1]),$(b).css("border-bottom-right-radius",f.br[2]),$(b).css("border-bottom-left-radius",f.br[3])));if(f.tf){for(var c=[],d=[[3,0],[3,0],[2,0],[3,1],[2,"50%"]],l=0;l<d.length;l++){c[l]=[];f.tf[l]||(f.tf[l]=[]);for(var n=0;n<d[l][0];n++)f.tf[l][n]||(f.tf[l][n]=d[l][1]),c[l][n]=f.tf[l][n]}d=typeof c[4][0]=="string"?c[4][0]+" "+c[4][1]:c[4][0]+"px "+
c[4][1]+"px";$(b).css("-webkit-transform-origin",d);$(b).css("-moz-transform-origin",d);$(b).css("-ms-transform-origin",d);$(b).css("-o-transform-origin",d);"webkitAppearance"in document.documentElement.style?$(b).css("-webkit-transform","translate3d("+c[0][0]+"px,"+c[0][1]+"px,"+c[0][2]+"px) rotateZ("+c[1][0]+"deg) rotateX("+c[1][1]+"deg) rotateY("+c[1][2]+"deg) skew("+c[2][0]+"deg,"+c[2][1]+"deg) scale3d("+c[3][0]+","+c[3][1]+","+c[3][2]+")"):(d="translate("+c[0][0]+"px,"+c[0][1]+"px) rotate("+
c[1][0]+"deg)  skewX("+c[2][0]+"deg) skewY("+c[2][1]+"deg) scale("+c[3][0]+","+f.tf[3][1]+")",$(b).css("-moz-transform",d),$(b).css("-ms-transform",d),$(b).css("-o-transform",d))}else b.style.webkitTransform="translateZ(0)";f.opacity&&$(b).css("opacity",f.opacity);f.stroke&&((c=f.stroke[0])||(c=0),(d=f.stroke[1])?typeof d=="string"&&(d=[d]):d=["rgba(0,0,0,0)"],(l=f.stroke[2])||(l="none"),$(b).css("border",""+c+"px "+l+" "+d[0]));if(f.fill&&(c=f.fill[0],typeof c=="string"&&(c=[c]),(d=f.fill[1])||(d=
"solid"),d=="solid"&&c&&$(b).css("background-color",c[0]),f.fill[1])){c=f.fill[1];typeof c=="string"?c=[c]:typeof c=="object"&&((d=c[window.EdgeScreenProfile.name])||(d=c["default"]),c=d);if(c[0]){$(b).css("background-image","url("+c[0]+")");if(c[1]||c[2])c[1]||(c[1]="0px"),c[2]||(c[2]="0px"),$(b).css("background-position",c[1]+" "+c[2]);i.requestImage(c[0])}c[3]||$(b).css("background-repeat","no-repeat");c[4]&&c[4]!="scroll"&&$(b).css("background-attachment",c[4])}f.source&&(b.setAttribute("src",
f.source),e=="video"&&b.setAttribute("controls","controls"),e=="audio"&&b.setAttribute("autoplay","autoplay"));if(a){if(!a.appendChild)return b;a.firstChild&&g>=0&&a.children&&g<a.children.length?a.insertBefore(b,a.children[g]):a.appendChild(b)}return b}function l(e,c,f,a,g){var j;x(c,a);var b=null;f&&f.nodeName&&f.nodeName.toLowerCase()=="canvas"&&(j=b=o.stageLookup[f.id],f=j);var d=null,b="div";if(c.tag)b=c.tag;switch(c.t){case "def":break;case "rect":case "elipse":case "group":d=h(b,e,c,f,g);break;
case "image":d=h(b,e,c,f,g);if(b=="img")c=$(d).css("background-image"),c.indexOf("url(")==0&&(c=c.substring(4,c.length-1)),d.src=c,$(d).css("background-image","");break;case "video":d=h("video",e,c,f,g);break;case "audio":d=h("audio",e,c,f,g);break;case "text":d=h(b,e,c,f,g);c.font&&(c.font[0]&&c.font[0]!==""&&$(d).css("font-family",c.font[0]),typeof c.font[1]!="object"&&(c.font[1]=[c.font[1]]),c.font[1][1]||(c.font[1][1]="px"),c.font[1][0]&&c.font[1][0]!==""&&$(d).css("font-size",c.font[1][0]+c.font[1][1]),
c.font[2]&&c.font[2]!==""&&$(d).css("color",c.font[2]),c.font[3]&&c.font[3]!==""&&$(d).css("font-weight",c.font[3]),c.font[4]&&c.font[4]!==""&&$(d).css("text-decoration",c.font[4]),c.font[5]&&c.font[5]!==""&&$(d).css("font-style",c.font[5]));c.align&&$(d).css("text-align",c.align);if(c.position)d.style.position=c.position;d.appendChild(document.createTextNode(c.text));break;case "canvas":d=h("canvas",e,c,f,g);b={def:c,params:a,stage:new y(d),children:{}};b.obj=b.stage;b.obj.width=c.rect[2];b.obj.height=
c.rect[3];o.stageLookup[e]=b;break;case "line":break;case "shape":if(!f)break;d={def:c,params:a,obj:new A,stage:f.stage,children:{}};d.obj.x=c.rect[0];d.obj.y=c.rect[1];d.obj.width=c.rect[2];d.obj.height=c.rect[3];f.children[c.id]=d;f.obj.addChild(d.obj);break;default:alert("unhandled type == "+c.t)}return d}function r(e,c,f,a,g,b){b||(b=0);if(f=l(e,c,a,g,b)){o.DOMNodeStarted(f,a,c,o.nodeSymbolInstanceLookup[e]);if(c.c)for(e=0;e<c.c.length;e++)a=c.c[e],r(a.id,a,c,f,g);o.DOMNodeCompleted(f)}return f}
function s(e,c){var f=e,a;if(e.base){if(typeof e.base=="string")e.base=[e.base];if(e.base.length>0){f={};for(a=0;a<e.base.length;a++){var g=o.nodeLookup[e.base[a]];g&&$.extend(!0,f,g)}$.extend(!0,f,e)}}f.base=null;for(a=0;f.c&&a<f.c.length;a++)f.c[a]=s(f.c[a],c);return f}function n(e,c){if(e)if(x(e,c),!e.id||e.id==="")alert("elements without ids are not yet supported");else{o.nodeLookup[e.id]=e;for(var f=0;e.children&&f<e.children.length;f++)n(e.children[f])}}function p(e,c){if(!e)return c;if(typeof c==
"string"){var f=c.search(/\$\{/);if(f>=0){var a=c.search(/\}/);if(a>f)return f=c.slice(f+2,a),e[f]}}return c}function z(e,c){var f=e.obj.graphics,a=e.params;f.clear();var g="rgba(0,0,0,0)";e.def.fill&&typeof e.def.fill=="object"&&(g=e.def.fill[0]);f.beginFill(g).drawRect(0,0,p(a,e.def.rect[2]),p(a,e.def.rect[3]));for(var b in e.children)e.children.hasOwnProperty(b)&&z(c.children[b])}var x,y,A;x=function(e,c){if(e.type)e.t=e.type;if(e.t)e.t=e.t.toLowerCase();e.type=e.t;e.children?e.c=e.children:e.children=
e.c;e.rect?e.r=e.rect:e.rect=e.r;if(!e.rect)e.rect=[];for(;e.rect.length<4;)e.rect[e.rect.length]=0;e.borderRadius?e.br=e.borderRadius:e.borderRadius=e.br;e.shape?e.sh=e.shape:e.shape=e.sh;e.transform?e.tf=e.transform:e.transform=e.tf;if(e.tf){for(;e.tf.length<5;)e.tf[e.tf.length]=0;for(;e.transform.length<8;)e.tf[e.tf.length]=1}e.opacity?e.o=e.opacity:e.opacity=e.o;if(e.stroke)e.s=e.stroke;e.stroke=e.s;if(e.fill)e.f=e.fill;if(e.f&&c){var f=c[e.f];if(f)e.f=f}e.fill=e.f};return{stageLookup:{},nodeLookup:{},
nodeSymbolInstanceLookup:{},DOMNodeSeek:function(){},DOMNodeReset:function(){},DOMNodeStarted:function(){},DOMNodeCompleted:function(){},renderDOM:function(e,c,f,a,g){window.EdgeScreenProfile={name:"detected",dim:[screen.width,screen.height]};o.nodeLookup={};var b;for(b=0;b<e.length;b++)n(e[b],f);for(b=0;b<e.length;b++)e[b]&&(e[b]=s(e[b],f));o.nodeSymbolInstanceLookup={};if(g)for(b=0;b<g.length;b++)o.nodeSymbolInstanceLookup[g[b].id]=g[b].symbolName;o.DOMNodeSeek(c,a);for(b=0;b<e.length;b++)e[b]&&
(a=e[b],(a=r(a.id,a,null,null,f))&&c.appendChild(a));o.DOMNodeReset()},buildSceneGraphNode:r,drawSceneGraph:function(){for(var e in o.stageLookup)if(o.stageLookup.hasOwnProperty(e)){var c=o.stageLookup[e],f;for(f in c.children)c.children.hasOwnProperty(f)&&z(c.children[f],c);c.stage.update()}},createElement:l}}();i.DeclareMarkup=o}})(jQuery,jQuery.Edge);

