").append(fe.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){a.each(r,o||[e.responseText,t,e])}),this},fe.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){fe.fn[t]=function(e){return this.on(t,e)}}),fe.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Lt,type:"GET",isLocal:Ft.test(Rt[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Qt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":fe.parseJSON,"text xml":fe.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?R(R(e,fe.ajaxSettings),t):R(fe.ajaxSettings,e)},ajaxPrefilter:q($t),ajaxTransport:q(Xt),ajax:function(e,n){function r(e,n,r,i){var o,p,v,x,w,S=n;2!==b&&(b=2,u&&clearTimeout(u),l=t,a=i||"",k.readyState=e>0?4:0,o=e>=200&&300>e||304===e,r&&(x=L(d,k,r)),x=O(d,x,k,o),o?(d.ifModified&&(w=k.getResponseHeader("Last-Modified"),w&&(fe.lastModified[s]=w),w=k.getResponseHeader("etag"),w&&(fe.etag[s]=w)),204===e||"HEAD"===d.type?S="nocontent":304===e?S="notmodified":(S=x.state,p=x.data,v=x.error,o=!v)):(v=S,(e||!S)&&(S="error",0>e&&(e=0))),k.status=e,k.statusText=(n||S)+"",o?m.resolveWith(f,[p,S,k]):m.rejectWith(f,[k,S,v]),k.statusCode(y),y=t,c&&h.trigger(o?"ajaxSuccess":"ajaxError",[k,d,o?p:v]),g.fireWith(f,[k,S]),c&&(h.trigger("ajaxComplete",[k,d]),--fe.active||fe.event.trigger("ajaxStop")))}"object"==typeof e&&(n=e,e=t),n=n||{};var i,o,s,a,u,c,l,p,d=fe.ajaxSetup({},n),f=d.context||d,h=d.context&&(f.nodeType||f.jquery)?fe(f):fe.event,m=fe.Deferred(),g=fe.Callbacks("once memory"),y=d.statusCode||{},v={},x={},b=0,w="canceled",k={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!p)for(p={};t=Bt.exec(a);)p[t[1].toLowerCase()]=t[2];t=p[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=x[n]=x[n]||e,v[e]=t),this},overrideMimeType:function(e){return b||(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)y[t]=[y[t],e[t]];else k.always(e[k.status]);return this},abort:function(e){var t=e||w;return l&&l.abort(t),r(0,t),this}};if(m.promise(k).complete=g.add,k.success=k.done,k.error=k.fail,d.url=((e||d.url||Lt)+"").replace(Pt,"").replace(Wt,Rt[1]+"//"),d.type=n.method||n.type||d.method||d.type,d.dataTypes=fe.trim(d.dataType||"*").toLowerCase().match(me)||[""],null==d.crossDomain&&(i=Ut.exec(d.url.toLowerCase()),d.crossDomain=!(!i||i[1]===Rt[1]&&i[2]===Rt[2]&&(i[3]||("http:"===i[1]?"80":"443"))===(Rt[3]||("http:"===Rt[1]?"80":"443")))),d.data&&d.processData&&"string"!=typeof d.data&&(d.data=fe.param(d.data,d.traditional)),D($t,d,n,k),2===b)return k;c=d.global,c&&0===fe.active++&&fe.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!It.test(d.type),s=d.url,d.hasContent||(d.data&&(s=d.url+=(Mt.test(s)?"&":"?")+d.data,delete d.data),d.cache===!1&&(d.url=Ht.test(s)?s.replace(Ht,"$1_="+Ot++):s+(Mt.test(s)?"&":"?")+"_="+Ot++)),d.ifModified&&(fe.lastModified[s]&&k.setRequestHeader("If-Modified-Since",fe.lastModified[s]),fe.etag[s]&&k.setRequestHeader("If-None-Match",fe.etag[s])),(d.data&&d.hasContent&&d.contentType!==!1||n.contentType)&&k.setRequestHeader("Content-Type",d.contentType),k.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Qt+"; q=0.01":""):d.accepts["*"]);for(o in d.headers)k.setRequestHeader(o,d.headers[o]);if(d.beforeSend&&(d.beforeSend.call(f,k,d)===!1||2===b))return k.abort();w="abort";for(o in{success:1,error:1,complete:1})k[o](d[o]);if(l=D(Xt,d,n,k)){k.readyState=1,c&&h.trigger("ajaxSend",[k,d]),d.async&&d.timeout>0&&(u=setTimeout(function(){k.abort("timeout")},d.timeout));try{b=1,l.send(v,r)}catch(S){if(!(2>b))throw S;r(-1,S)}}else r(-1,"No Transport");return k},getJSON:function(e,t,n){return fe.get(e,t,n,"json")},getScript:function(e,n){return fe.get(e,t,n,"script")}}),fe.each(["get","post"],function(e,n){fe[n]=function(e,r,i,o){return fe.isFunction(r)&&(o=o||i,i=r,r=t),fe.ajax({url:e,type:n,dataType:o,data:r,success:i})}}),fe.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return fe.globalEval(e),e}}}),fe.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),fe.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=Z.head||fe("head")[0]||Z.documentElement;return{send:function(t,i){n=Z.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=/e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var Vt=[],Yt=/(=)\?(?=&|$)|\?\?/;fe.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Vt.pop()||fe.expando+"_"+Ot++;return this[e]=!0,e}}),fe.ajaxPrefilter("json jsonp",function(n,r,i){var o,s,a,u=n.jsonp!==!1&&(Yt.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(n.data)&&"data");return u||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=fe.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,u?n[u]=n[u].replace(Yt,"$1"+o):n.jsonp!==!1&&(n.url+=(Mt.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return a||fe.error(o+" was not called"),a[0]},n.dataTypes[0]="json",s=e[o],e[o]=function(){a=arguments},i.always(function(){e[o]=s,n[o]&&(n.jsonpCallback=r.jsonpCallback,Vt.push(o)),a&&fe.isFunction(s)&&s(a[0]),a=s=t}),"script"):void 0});var Jt,Gt,Kt=0,Zt=e.ActiveXObject&&function(){var e;for(e in Jt)Jt[e](t,!0)};fe.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&M()||P()}:M,Gt=fe.ajaxSettings.xhr(),fe.support.cors=!!Gt&&"withCredentials"in Gt,Gt=fe.support.ajax=!!Gt,Gt&&fe.ajaxTransport(function(n){if(!n.crossDomain||fe.support.cors){var r;return{send:function(i,o){var s,a,u=n.xhr();if(n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async),n.xhrFields)for(a in n.xhrFields)u[a]=n.xhrFields[a];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(a in i)u.setRequestHeader(a,i[a])}catch(c){}u.send(n.hasContent&&n.data||null),r=function(e,i){var a,c,l,p;try{if(r&&(i||4===u.readyState))if(r=t,s&&(u.onreadystatechange=fe.noop,Zt&&delete Jt[s]),i)4!==u.readyState&&u.abort();else{p={},a=u.status,c=u.getAllResponseHeaders(),"string"==typeof u.responseText&&(p.text=u.responseText);try{l=u.statusText}catch(d){l=""}a||!n.isLocal||n.crossDomain?1223===a&&(a=204):a=p.text?200:404}}catch(f){i||o(-1,f)}p&&o(a,l,p,c)},n.async?4===u.readyState?setTimeout(r):(s=++Kt,Zt&&(Jt||(Jt={},fe(e).unload(Zt)),Jt[s]=r),u.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var en,tn,nn=/^(?:toggle|show|hide)$/,rn=new RegExp("^(?:([+-])=|)("+he+")([a-z%]*)$","i"),on=/queueHooks$/,sn=[W],an={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=rn.exec(t),o=i&&i[3]||(fe.cssNumber[e]?"":"px"),s=(fe.cssNumber[e]||"px"!==o&&+r)&&rn.exec(fe.css(n.elem,e)),a=1,u=20;if(s&&s[3]!==o){o=o||s[3],i=i||[],s=+r||1;do a=a||".5",s/=a,fe.style(n.elem,e,s+o);while(a!==(a=n.cur()/r)&&1!==a&&--u)}return i&&(s=n.start=+s||+r||0,n.unit=o,n.end=i[1]?s+(i[1]+1)*i[2]:+i[2]),n}]};fe.Animation=fe.extend(F,{tweener:function(e,t){fe.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,i=e.length;i>r;r++)n=e[r],an[n]=an[n]||[],an[n].unshift(t)},prefilter:function(e,t){t?sn.unshift(e):sn.push(e)}}),fe.Tween=U,U.prototype={constructor:U,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(fe.cssNumber[n]?"":"px")},cur:function(){var e=U.propHooks[this.prop];return e&&e.get?e.get(this):U.propHooks._default.get(this)},run:function(e){var t,n=U.propHooks[this.prop];return this.options.duration?this.pos=t=fe.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):U.propHooks._default.set(this),this}},U.prototype.init.prototype=U.prototype,U.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=fe.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){fe.fx.step[e.prop]?fe.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[fe.cssProps[e.prop]]||fe.cssHooks[e.prop])?fe.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},U.propHooks.scrollTop=U.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},fe.each(["toggle","show","hide"],function(e,t){var n=fe.fn[t];fe.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(z(t,!0),e,r,i)}}),fe.fn.extend({fadeTo:function(e,t,n,r){return this.filter(S).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=fe.isEmptyObject(e),o=fe.speed(t,n,r),s=function(){var t=F(this,fe.extend({},e),o);(i||fe._data(this,"finish"))&&t.stop(!0)};return s.finish=s,i||o.queue===!1?this.each(s):this.queue(o.queue,s)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=fe.timers,s=fe._data(this);if(n)s[n]&&s[n].stop&&i(s[n]);else for(n in s)s[n]&&s[n].stop&&on.test(n)&&i(s[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&fe.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=fe._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=fe.timers,s=r?r.length:0;for(n.finish=!0,fe.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;s>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),fe.each({slideDown:z("show"),slideUp:z("hide"),slideToggle:z("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){fe.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),fe.speed=function(e,t,n){var r=e&&"object"==typeof e?fe.extend({},e):{complete:n||!n&&t||fe.isFunction(e)&&e,duration:e,easing:n&&t||t&&!fe.isFunction(t)&&t};return r.duration=fe.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in fe.fx.speeds?fe.fx.speeds[r.duration]:fe.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){fe.isFunction(r.old)&&r.old.call(this),r.queue&&fe.dequeue(this,r.queue)},r},fe.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},fe.timers=[],fe.fx=U.prototype.init,fe.fx.tick=function(){var e,n=fe.timers,r=0;for(en=fe.now();r
-1,c={},l={},p,d;u?(l=i.position(),p=l.top,d=l.left):(p=parseFloat(s)||0,d=parseFloat(a)||0),fe.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(c.top=t.top-o.top+p),null!=t.left&&(c.left=t.left-o.left+d),"using"in t?t.using.call(e,c):i.css(c)}},fe.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===fe.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),fe.nodeName(e[0],"html")||(n=e.offset()),n.top+=fe.css(e[0],"borderTopWidth",!0),n.left+=fe.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-fe.css(r,"marginTop",!0),left:t.left-n.left-fe.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||ee;e&&!fe.nodeName(e,"html")&&"static"===fe.css(e,"position");)e=e.offsetParent;return e||ee})}}),fe.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);fe.fn[e]=function(i){return fe.access(this,function(e,i,o){var s=$(e);return o===t?s?n in s?s[n]:s.document.documentElement[i]:e[i]:void(s?s.scrollTo(r?fe(s).scrollLeft():o,r?o:fe(s).scrollTop()):e[i]=o)},e,i,arguments.length,null)}}),fe.each({Height:"height",Width:"width"},function(e,n){fe.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){fe.fn[i]=function(i,o){var s=arguments.length&&(r||"boolean"!=typeof i),a=r||(i===!0||o===!0?"margin":"border");return fe.access(this,function(n,r,i){var o;return fe.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?fe.css(n,r,a):fe.style(n,r,i,a)},n,s?i:t,s,null)}})}),fe.fn.size=function(){return this.length},fe.fn.andSelf=fe.fn.addBack,"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=fe:"function"==typeof sumo.define&&sumo.define.amd&&sumo.define("jquery",[],function(){return fe})}(window),function(){var e,t,n,r,i,o,s,a,u,c,l,p,d=[].slice;s=/function[^(]*\(([^)]*)\)/,r=/([^\s,]+)/g,a=function(e){var t;return((null!=e&&null!=(t=e.toString().match(s))?t[1]:void 0)||"").match(r)||[]},u=function(e,t,n){var r,i,o,s,a,u,c,l,p;if(null==e&&(e=[]),null==t&&(t=function(){}),r=e.length,a=[],0===r)return t(null,a);for(i=[],o=!1,p=[],s=c=0,l=e.length;l>c;s=++c)u=e[s],p.push(function(e,s){var u,c;c=function(){var e,u;if(e=arguments[0],u=2<=arguments.length?d.call(arguments,1):[],e){if(i[s]=e,o=!0,!n)return t(i,a)}else a[s]=u.length<2?u[0]:u;return--r<=0?o?t(i,a):t(null,a):void 0};try{return e(c)}catch(l){return u=l,c(u)}}(u,s));return p},c=function(e,t,n){var r,i,o,s,a,u;return null==e&&(e=[]),null==t&&(t=function(){}),s=-1,r=e.length,u=[],0===r?t(null,u):(i=[],o=!1,(a=function(){var c,l,p;if(l=arguments[0],p=2<=arguments.length?d.call(arguments,1):[],l){if(i[s]=l,o=!0,!n)return t(i,u)}else s>-1&&(u[s]=p.length<2?p[0]:p);if(++s>=r)return o?t(i,u):t(null,u);try{return e[s](a)}catch(f){return c=f,a(c)}})())},l=function(e,t){var n,r;return n=-1,0===e.length?t():(r=function(){var i,o;return i=arguments[0],o=2<=arguments.length?d.call(arguments,1):[],null!=i?t(i):++n>=e.length?t.apply(null,[null].concat(d.call(o))):e[n].apply(e,d.call(o).concat([r]))})()},o=function(e,t,n,r){var i,o;return null==e&&(e=[]),o=function(){var n,r,o;for(o=[],n=0,r=e.length;r>n;n++)i=e[n],o.push(function(e){return function(n){return t(e,n)}}(i));return o}(),p.runParallel(o,n,r)},p={doForAll:o,runParallel:u,runSeries:c,runWaterfall:l,getArgumentNames:a,hasArgument:function(e,t){return null==t&&(t=1),p.getArgumentNames(e).length>=t}},t=function(){function e(e,t){this.cascadeChannels=null!=t?t:!1,this.channels={},e instanceof Object?this.installTo(e):e===!0&&(this.cascadeChannels=!0)}return e.prototype.on=function(t,n,r){var i,o,s,a,u,c,l,p,d,f;if(null==r&&(r=this),null==(c=this.channels)[t]&&(c[t]=[]),a=this,t instanceof Array){for(d=[],l=0,p=t.length;p>l;l++)i=t[l],d.push(this.on(i,n,r));return d}if("object"==typeof t){f=[];for(o in t)u=t[o],f.push(this.on(o,u,n));return f}return"function"!=typeof n?!1:"string"!=typeof t?!1:(s={context:r,callback:n},{attach:function(){return a.channels[t].push(s),this},detach:function(){return e._rm(a,t,s.callback),this}}.attach())},e.prototype.off=function(t,n){var r;switch(typeof t){case"string":"function"==typeof n&&e._rm(this,t,n),"undefined"==typeof n&&e._rm(this,t);break;case"function":for(r in this.channels)e._rm(this,r,t);break;case"undefined":for(r in this.channels)e._rm(this,r);break;case"object":for(r in this.channels)e._rm(this,r,null,t)}return this},e.prototype.emit=function(e,t,n){var r,i,o,s;return null==n&&(n=function(){}),"function"==typeof t&&(n=t,t=void 0),"string"!=typeof e?!1:(o=this.channels[e]||[],s=function(){var n,r,s;for(s=[],n=0,r=o.length;r>n;n++)i=o[n],s.push(function(n){return function(r){var i;try{return p.hasArgument(n.callback,3)?n.callback.apply(n.context,[t,e,r]):r(null,n.callback.apply(n.context,[t,e]))}catch(o){return i=o,r(i)}}}(i));return s}(),p.runSeries(s,function(e,t){var r,i;return e&&(r=new Error(function(){var t,n,r;for(r=[],t=0,n=e.length;n>t;t++)i=e[t],null!=i&&r.push(i.message);return r}().join("; "))),n(r)},!0),this.cascadeChannels&&(r=e.split("/")).length>1&&this.emit(r.slice(0,-1).join("/"),t,n),this)},e.prototype.installTo=function(e){var t,n;if("object"==typeof e)for(t in this)n=this[t],null==e[t]&&(e[t]=n);return this},e._rm=function(e,t,n,r){var i;if(null!=e.channels[t])return e.channels[t]=function(){var o,s,a,u;for(a=e.channels[t],u=[],o=0,s=a.length;s>o;o++)i=a[o],(null!=n?i.callback!==n:null!=r?i.context!==r:i.context!==e)&&u.push(i);return u}()},e}(),i=function(e,t,n){return typeof t!==e?""+n+" has to be a "+e:void 0},e=function(){function e(e){this.Sandbox=e,this._modules={},this._plugins=[],this._instances={},this._sandboxes={},this._running={},this._mediator=new t(this),this.Mediator=t,null==this.Sandbox&&(this.Sandbox=function(e,t,n,r){return this.instanceId=t,this.options=null!=n?n:{},this.moduleId=r,e._mediator.installTo(this),this})}return e.prototype.log={error:function(){},log:function(){},info:function(){},warn:function(){},enable:function(){}},e.prototype.register=function(e,t,n){var r;return null==n&&(n={}),(r=i("string",e,"module ID")||i("function",t,"creator")||i("object",n,"option parameter"))?(this.log.error("could not register module '"+e+"': "+r),this):e in this._modules?(this.log.warn("module "+e+" was already registered"),this):(this._modules[e]={creator:t,options:n,id:e},this)},e.prototype.start=function(e,t,n){var r,o,s,a=this;return null==t&&(t={}),null==n&&(n=function(){}),0===arguments.length?this._startAll():e instanceof Array?this._startAll(e,t):"function"==typeof e?this._startAll(null,e):("function"==typeof t&&(n=t,t={}),(r=i("string",e,"module ID")||i("object",t,"second parameter")||(this._modules[e]?void 0:"module doesn't exist"))?this._startFail(r,n):(o=t.instanceId||e,this._running[o]===!0?this._startFail(new Error("module was already started"),n):(s=function(e,t,i){if(e)return a._startFail(e,n);try{return p.hasArgument(t.init,2)?t.init(i,function(e){return e||(a._running[o]=!0),n(e)}):(t.init(i),a._running[o]=!0,n())}catch(s){return r=s,a._startFail(r,n)}},this.boot(function(r){return r?a._startFail(r,n):a._createInstance(e,t,s)}))))},e.prototype._startFail=function(e,t){return this.log.error(e),t(new Error("could not start module: "+e.message)),this},e.prototype._createInstance=function(e,t,n){var r,i,o,s,a,u,c,l,p,d,f,h,m=this;if(o=t.instanceId||e,c=t.options,a=this._modules[e],this._instances[o])return n(this._instances[o]);for(i={},h=[a.options,c],d=0,f=h.length;f>d;d++)if(u=h[d])for(s in u)p=u[s],null==i[s]&&(i[s]=p);return r="function"==typeof t.sandbox?t.sandbox:this.Sandbox,l=new r(this,o,i,e),this._runSandboxPlugins("init",l,function(e){var t;return t=new a.creator(l),"function"!=typeof t.init?n(new Error("module has no 'init' method")):(m._instances[o]=t,m._sandboxes[o]=l,n(null,t,i))})},e.prototype._runSandboxPlugins=function(e,t,n){var r,i;return i=function(){var n,i,o,s,a;for(o=this._plugins,a=[],n=0,i=o.length;i>n;n++)r=o[n],"function"==typeof(null!=(s=r.plugin)?s[e]:void 0)&&a.push(function(n){var r;return r=n.plugin[e],function(e){return p.hasArgument(r,3)?r(t,n.options,e):(r(t,n.options),e())}}(r));return a}.call(this),p.runSeries(i,n,!0)},e.prototype._startAll=function(e,t){var n,r,i,o=this;return null==e&&(e=function(){var e;e=[];for(r in this._modules)e.push(r);return e}.call(this)),i=function(e,t){return o.start(e,o._modules[e].options,t)},n=function(n){var r,i,o,s;return(null!=n?n.length:void 0)>0&&(o=function(){var t,r,o;for(o=[],i=t=0,r=n.length;r>t;i=++t)s=n[i],null!=s&&o.push("'"+e[i]+"'");return o}(),r=new Error("errors occoured in the following modules: "+o)),"function"==typeof t?t(r):void 0},p.doForAll(e,i,n,!0),this},e.prototype.stop=function(e,t){var n,r,i=this;return null==t&&(t=function(){}),0===arguments.length||"function"==typeof e?p.doForAll(function(){var e;e=[];for(r in this._instances)e.push(r);return e}.call(this),function(){return i.stop.apply(i,arguments)},e,!0):(n=this._instances[e])&&(delete this._instances[e],this._mediator.off(n),this._runSandboxPlugins("destroy",this._sandboxes[e],function(r){return p.hasArgument(n.destroy)?n.destroy(function(n){return delete i._running[e],t(r||n)}):("function"==typeof n.destroy&&n.destroy(),delete i._running[e],t(r))})),this},e.prototype.use=function(e,t){var n,r,i;if(e instanceof Array)for(r=0,i=e.length;i>r;r++)switch(n=e[r],typeof n){case"function":this.use(n);break;case"object":this.use(n.plugin,n.options)}else{if("function"!=typeof e)return this;this._plugins.push({creator:e,options:t})}return this},e.prototype.boot=function(e){var t,n,r;return t=this,r=function(){var e,r,i,o;for(i=this._plugins,o=[],e=0,r=i.length;r>e;e++)n=i[e],n.booted!==!0&&o.push(function(e){return p.hasArgument(e.creator,3)?function(n){var r;return r=e.creator(t,e.options,function(t){return t||(e.booted=!0,e.plugin=r),n()})}:function(n){return e.plugin=e.creator(t,e.options),e.booted=!0,n()}}(n));return o}.call(this),p.runSeries(r,e,!0),this},e}(),n={VERSION:"0.4.2",util:p,Mediator:t,Core:e,plugins:{},modules:{}},null!=("undefined"!=typeof sumo.define&&null!==sumo.define?sumo.define.amd:void 0)?sumo.define("scaleApp",[],function(){return n}):"undefined"!=typeof window&&null!==window?null==window.scaleApp&&(window.scaleApp=n):null!=("undefined"!=typeof module&&null!==module?module.exports:void 0)&&(module.exports=n)}.call(this),function(e){"function"==typeof sumo.define&&sumo.define.amd?sumo.define("jquery.cookie",["jquery"],e):e(jQuery)}(function(e){function t(e){return a.raw?e:encodeURIComponent(e)}function n(e){return a.raw?e:decodeURIComponent(e)}function r(e){return t(a.json?JSON.stringify(e):String(e))}function i(e){0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{e=decodeURIComponent(e.replace(s," "))}catch(t){return}try{return a.json?JSON.parse(e):e}catch(t){}}function o(t,n){var r=a.raw?t:i(t);return e.isFunction(n)?n(r):r}var s=/\+/g,a=e.cookie=function(i,s,u){if(void 0!==s&&!e.isFunction(s)){if(u=e.extend({},a.defaults,u),"number"==typeof u.expires){var c=u.expires,l=u.expires=new Date;l.setDate(l.getDate()+c)}return document.cookie=[t(i),"=",r(s),u.expires?"; expires="+u.expires.toUTCString():"",u.path?"; path="+u.path:"",u.domain?"; domain="+u.domain:"",u.secure?"; secure":""].join("")}for(var p=i?void 0:{},d=document.cookie?document.cookie.split("; "):[],f=0,h=d.length;h>f;f++){var m=d[f].split("="),g=n(m.shift()),y=m.join("=");
if(i&&i===g){p=o(y,s);break}i||void 0===(y=o(y))||(p[g]=y)}return p};a.defaults={},e.removeCookie=function(t,n){return void 0!==e.cookie(t)?(e.cookie(t,"",e.extend({},n,{expires:-1})),!0):!1}}),sumo.define("path",["jquery"],function(e){var t={version:"0.8.4",map:function(e){return t.routes.defined.hasOwnProperty(e)?t.routes.defined[e]:new t.core.route(e)},root:function(e){t.routes.root=e},rescue:function(e){t.routes.rescue=e},history:{initial:{},pushState:function(e,n,r){t.history.supported?t.dispatch(r)&&history.pushState(e,n,r):t.history.fallback&&(window.location.hash="#"+r)},popState:function(e){var n=!t.history.initial.popped&&location.href==t.history.initial.URL;t.history.initial.popped=!0,n||t.dispatch(document.location.pathname)},listen:function(e){if(t.history.supported=!(!window.history||!window.history.pushState),t.history.fallback=e,t.history.supported)t.history.initial.popped="state"in window.history,t.history.initial.URL=location.href,window.onpopstate=t.history.popState;else if(t.history.fallback){for(route in t.routes.defined)"#"!=route.charAt(0)&&(t.routes.defined["#"+route]=t.routes.defined[route],t.routes.defined["#"+route].path="#"+route);t.listen()}}},match:function(e,n){var r={},i=null,o,s,a,u,c;for(i in t.routes.defined)if(null!==i&&void 0!==i)for(i=t.routes.defined[i],o=i.partition(),u=0;u0)for(a=0;a=8)?window.onhashchange=e:setInterval(e,50),""!==location.hash&&t.dispatch(location.hash)},core:{route:function(e){this.path=e,this.action=null,this.do_enter=[],this.do_exit=null,this.params={},t.routes.defined[e]=this}},routes:{current:null,root:null,rescue:null,previous:null,defined:{}}};t.core.route.prototype={to:function(e){return this.action=e,this},enter:function(e){return e instanceof Array?this.do_enter=this.do_enter.concat(e):this.do_enter.push(e),this},exit:function(e){return this.do_exit=e,this},partition:function(){for(var e=[],t=[],n=/\(([^}]+?)\)/g,r,i;r=n.exec(this.path);)e.push(r[1]);for(t.push(this.path.split("(")[0]),i=0;i0)for(n=0;ne?e/t:t/e},t.fn.largest=function(){var e=null,n=0;return t(this).each(function(){var r=t(this).aspect(),i=t(this).area()*r;i>n&&(n=i,e=t(this))}),e},t.Path.map("#/sumome/~/:page").to(function(){var e=this.params.page||"index",n=t("body").children(":visible").largest();n.html(""+e+"
")}).enter(e),t.Path.map("#/sumome/app/:app_id").to(function(){var e=this.params.app_id||"control";"login"===e?T.user?_.emit("startApp","launcher"):(t(".sumome-badge-hint").remove(),_.emit("startApp","login")):"register"===e?T.user?_.emit("startApp","launcher"):(t(".sumome-badge-hint").remove(),_.emit("startApp",{app:"login",opts:{view:"register"}})):"apps"in T&&T.apps.indexOf(e)>=0?_.emit("startApp",e):_.emit("startApp","app_store")}),t.Path.map("#/sumome/app/:app_id/:path(/:query)").to(function(){var e=this.params.app_id||"control",n=this.params.path||null,r=this.params.query||null,i=null;if(n&&n.indexOf("pid")>=0){var o=n.split("pid");n=o[0].length?o[0]:null,i=o[1]}"login"===e?T.user?_.emit("startApp","launcher"):(t(".sumome-badge-hint").remove(),_.emit("startApp",{app:"login",opts:{view:n,query:r?decodeURIComponent(r):null}})):"apps"in T&&T.apps.indexOf(e)>=0||["control","app_store"].indexOf(e)>=0?(_.on(e+"/app/started",function(t){_.off(e+"/app/started"),_.emit(e+"/app/route",n)}),_.emit("startApp",e)):(i&&_.on("app_store/app/started",function(e){_.off("app_store/app/started"),_.emit("app_store/app/route",i)}),_.emit("startApp","app_store"))}),t(window).on("resize",function(e){_.emit("resize")}),window.addEventListener&&window.addEventListener("sumome",function(e){e&&"detail"in e&&e.detail&&"type"in e.detail&&e.detail.type&&"launch"===e.detail.type&&(m?(v=!0,m.triggerHandler("click")):_.emit("startApp","launcher"))}),t("body").keydown(function(e){var t=[83,85,77,79,77,69,38];e.which===t[x.length]?(x.push(e.which),x.length===t.length&&(x=[],m?(v=!0,m.triggerHandler("click")):_.emit("startApp","launcher"))):x=[]}),t("#sumome-jquery-iframe").hide(),t("#sumome-jquery-iframe").on("show",function(){this.hide()}),"location"in window&&"search"in window.location&&window.location.search.indexOf("smdebug")>=0&&(window.__smDebug=!0,window.__sm$=t),t.support.cors=!0;var n={href:window.location.href||null,ref:document.referrer||null};if(c)n.site_id=c;else{var r=t("script[data-weebly-site-id]").data("weebly-site-id");r&&(n.weebly_id=r)}l&&(n.mode=l),f&&(n.platform=f),t.ajax({type:"POST",dataType:"json",beforeSend:function(e){var n=t.cookie("__smToken");n&&e.setRequestHeader("X-Sumo-Auth",n);var r=A("sumotoken");r&&e.setRequestHeader("X-Sumo-Token",r)},xhrFields:{withCredentials:!0},crossDomain:!0,url:sumoUrl+"/api/load/",data:n,error:function(e){_.emit("removeCookie","__smUser")},success:function(e){var n=!1;if("hint"in e&&(n=e.hint),"siteId"in e&&e.siteId&&(c=e.siteId,T.siteId=c,t("script[data-weebly-site-id]").attr("data-sumo-site-id",c)),"siteCreated"in e&&e.siteCreated&&t("body").append(t('')),"siteRegistered"in e&&(T.siteRegistered=e.siteRegistered),"badgeLocation"in e&&(T.badgeLocation=e.badgeLocation),"sortKey"in e&&(T.sortKey=e.sortKey),"unreadNotificationCount"in e&&(T.unreadNotificationCount=e.unreadNotificationCount),"hasSumoMePro"in e&&(T.hasSumoMePro=e.hasSumoMePro),T.tierProductIds="tierProductIds"in e?e.tierProductIds:[],"access"in e&&(T.access=e.access),"geoLocation"in e&&(T.geoLocation=e.geoLocation),"views"in e&&(T.views=parseInt(e.views)),"tours"in e&&(T.tours=e.tours),e.success){e&&"token"in e&&e.token&&(T.sessionId=e.token,t.cookie("__smToken",e.token,{expires:36500,path:"/"})),e&&"user"in e&&e.user?(T.user=e.user,t.cookie("__smUser",e.user,{expires:36500,path:"/"}),"manage"===l||"login"in e&&e.login||e.unreadNotificationCount>0?(_.emit("login"),_.emit("startApp","manage"===l?"launcher":"control")):(y=!0,E())):(_.emit("removeCookie","__smUser"),E()),e&&"apps"in e&&(T.apps=e.apps);var r;for(r=0;r=j&&document.body)return o()}catch(n){}setTimeout(s,10)}}try{"CSS1Compat"!==document.compatMode&&(t.fn.oldHeightFunction=t.fn.height,t.fn.height=function(){return this.is(t(window))?this.oldHeightFunction()SumoMe'),T.badgeLocation){case"tl":m.css({top:"40px",left:"-40px",WebkitBorderRadius:"0 3px 3px 0",MozBorderRadius:"0 3px 3px 0",msBorderRadius:"0 3px 3px 0",OBorderRadius:"0 3px 3px 0",borderRadius:"0 3px 3px 0"}),m.find("span").css({marginLeft:"0",marginRight:"4px",WebkitBorderRadius:"0 3px 3px 0",MozBorderRadius:"0 3px 3px 0",msBorderRadius:"0 3px 3px 0",OBorderRadius:"0 3px 3px 0",borderRadius:"0 3px 3px 0"});break;case"tr":m.css({top:"40px",right:"-40px",WebkitBorderRadius:"3px 0 0 3px",MozBorderRadius:"3px 0 0 3px",msBorderRadius:"3px 0 0 3px",OBorderRadius:"3px 0 0 3px",borderRadius:"3px 0 0 3px"}),m.find("span").css({marginLeft:"4px",marginRight:"0",WebkitBorderRadius:"3px 0 0 3px",MozBorderRadius:"3px 0 0 3px",msBorderRadius:"3px 0 0 3px",OBorderRadius:"3px 0 0 3px",borderRadius:"3px 0 0 3px"});break;case"bl":m.css({bottom:"40px",left:"-40px",WebkitBorderRadius:"0 3px 3px 0",MozBorderRadius:"0 3px 3px 0",msBorderRadius:"0 3px 3px 0",OBorderRadius:"0 3px 3px 0",borderRadius:"0 3px 3px 0"}),m.find("span").css({marginLeft:"0",marginRight:"4px",WebkitBorderRadius:"0 3px 3px 0",MozBorderRadius:"0 3px 3px 0",msBorderRadius:"0 3px 3px 0",OBorderRadius:"0 3px 3px 0",borderRadius:"0 3px 3px 0"});break;case"br":m.css({bottom:"40px",right:"-40px",WebkitBorderRadius:"3px 0 0 3px",MozBorderRadius:"3px 0 0 3px",msBorderRadius:"3px 0 0 3px",OBorderRadius:"3px 0 0 3px",borderRadius:"3px 0 0 3px"}),m.find("span").css({marginLeft:"4px",marginRight:"0",WebkitBorderRadius:"3px 0 0 3px",MozBorderRadius:"3px 0 0 3px",msBorderRadius:"3px 0 0 3px",OBorderRadius:"3px 0 0 3px",borderRadius:"3px 0 0 3px"});break;case"hidden":y?(m.css({top:"40px",right:"-40px"}),m.find("span").css({marginLeft:"4px",marginRight:"0"})):m.style("display","none","important")}t("body").append(m),e&&m.append('
'),m.click(function(e){if(v)if("login"===h)_.emit("stop",h+"/app",function(){_.emit("startApp","login")});else if(y){t.ajax({type:"POST",dataType:"json",beforeSend:function(e){var n=t.cookie("__smToken");n&&e.setRequestHeader("X-Sumo-Auth",n)},xhrFields:{withCredentials:!1},crossDomain:!0,url:sumoUrl+"/api/softlogin",data:{site_id:c},success:t.proxy(function(e){},this)}),_.emit("login"),_.emit("startApp","launcher");for(var n=0;n0){var r=b.shift();_.emit("startApp",r)}})})}),_.on("setProperties",function(e){for(var t in e)T[t]=e[t]}),_.on("removeCookie",function(e){t.removeCookie(e,{path:"/"})}),_.on("event",function(e){var n=t.param({site_id:c,app_id:e.appId,event:e.event,href:e.href||window.location.href||null,ref:document.referrer||null,cache:Math.random()}),r=sumoUrl+"/api/event/?"+n,i=t("
").attr("src",r).attr("alt","").hide();t(document.body).append(i)}),_.on("restartApp",function(e){h===e.split("/")[0]&&(h=null),_.stop(e+"/app",function(t){t||("control"===e&&(w=!1),_.emit("startApp",e))})}),_.on("stop",function(e){h===e.split("/")[0]&&(h=null),_.stop(e,function(t){t||(_.emit(e+"/stopped",e),"control/app"===e&&(w=!1))})}),_.on("purchase",function(e){var n=e.iSrc||t.cookie("__smIRef")||null,r=e.src||t.cookie("__smSrc")||null;if(T.tierProductIds&&T.tierProductIds.length&&T.tierProductIds.indexOf(e.productId)<0&&"e75122b4-7cde-4828-9512-2dc2a32c1d81"!==e.productId)_.emit("startApp",{app:"app_store",src:r,iSrc:n});else{var i=e.cartId,o=e.productId,s=e.collectionId||null,a=e.expiresAt||null,u=e.done,c=e.onWindowClose,l=400,p=550,d=void 0!==window.screenLeft?window.screenLeft:screen.left,f=void 0!==window.screenTop?window.screenTop:screen.top,h=!1,m=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,g=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,y=m/2-l/2+d,v=g/2-p/2+f,x=window.open(T.secureSumoUrl+"/preparecart/"+i,"_blank","width="+l+", height="+p+", top="+v+", left="+y);if(window.focus&&x.focus(),c){var b,w;b=window.setInterval(function(){x.closed===!1||h?h&&(window.clearInterval(b),window.clearInterval(w)):(h=!0,window.clearInterval(b),window.clearInterval(w),c({cartId:i,productId:o,expiresAt:a}))},500),w=window.setInterval(function(){t.ajax({type:"POST",dataType:"json",beforeSend:function(e){e.setRequestHeader("X-Sumo-Auth",t.cookie("__smToken"))},xhrFields:{withCredentials:!1},crossDomain:!0,url:T.sumoUrl+"/api/cart/checkcart",data:{site_id:T.siteId,cart_id:i},success:t.proxy(function(e){e.done&&!h?(h=!0,window.clearInterval(b),window.clearInterval(w),c({cartId:i,productId:o})):h&&(window.clearInterval(b),window.clearInterval(w))},this)})},2e4),setTimeout(function(){window.clearInterval(b),window.clearInterval(w)},12e5)}t.ajax({type:"POST",dataType:"json",beforeSend:function(e){e.setRequestHeader("X-Sumo-Auth",t.cookie("__smToken"))},xhrFields:{withCredentials:!1},crossDomain:!0,url:T.secureSumoUrl+"/api/app_store/purchase",data:{site_id:T.siteId,cart_id:i,product_id:o,src:r,i_src:n,collection_id:s},success:t.proxy(function(e){u&&u(e)},this)})}}),_.on("login",function(){m&&(m.style("display","none","important"),m.off("click"),m.remove(),m=null)}),_.on("logout",function(e){e!==!1&&(e=!0),h&&_.emit("stop",h+"/app"),_.emit("stop","control/app"),y=e,t.ajax({type:"POST",dataType:"json",beforeSend:function(e){var n=t.cookie("__smToken");n&&e.setRequestHeader("X-Sumo-Auth",n)},xhrFields:{withCredentials:!1},data:{site_id:c,soft:e},crossDomain:!0,url:sumoUrl+"/api/logout"}),e||(_.emit("removeCookie","__smToken"),_.emit("removeCookie","__smUser"),_.emit("setProperties",{user:null,sessionId:null,access:null})),E()});var N=new Date,j=3e3;t(document).ready(function(){u||o()}),s()}),sumo.define("sumome",function(){}),sumo.require.config({baseUrl:baseUrl+"js",skipDataMain:!0,waitSeconds:30,paths:{scaleApp:"sumome","control/app":"sumome-control","app_store/app":"sumome-appstore","login/app":"sumome-control"}}),sumo.requirejs.onError=function(e){if("timeout"!==e.requireType)throw e},sumo.require(["sumome"])}(void 0,void 0);