var CV,dd,ClickView;!function(n,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=n.document?t(n,!0):function(n){if(!n.document)throw new Error("jQuery requires a window with a document");return t(n)}:t(n)}("undefined"!=typeof window?window:this,function(n,t){function ri(n){var t=n.length,r=i.type(n);return"function"===r||i.isWindow(n)?!1:1===n.nodeType&&t?!0:"array"===r||0===t||"number"==typeof t&&t>0&&t-1 in n}function ui(n,t,r){if(i.isFunction(t))return i.grep(n,function(n,i){return!!t.call(n,i,n)!==r});if(t.nodeType)return i.grep(n,function(n){return n===t!==r});if("string"==typeof t){if(re.test(t))return i.filter(t,n,r);t=i.filter(t,n)}return i.grep(n,function(n){return i.inArray(n,t)>=0!==r})}function hr(n,t){do n=n[t];while(n&&1!==n.nodeType);return n}function ee(n){var t=fi[n]={};return i.each(n.match(h)||[],function(n,i){t[i]=!0}),t}function cr(){u.addEventListener?(u.removeEventListener("DOMContentLoaded",a,!1),n.removeEventListener("load",a,!1)):(u.detachEvent("onreadystatechange",a),n.detachEvent("onload",a))}function a(){(u.addEventListener||"load"===event.type||"complete"===u.readyState)&&(cr(),i.ready())}function yr(n,t,r){if(void 0===r&&1===n.nodeType){var u="data-"+t.replace(vr,"-$1").toLowerCase();if(r=n.getAttribute(u),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:ar.test(r)?i.parseJSON(r):r}catch(f){}i.data(n,t,r)}else r=void 0}return r}function ei(n){for(var t in n)if(("data"!==t||!i.isEmptyObject(n[t]))&&"toJSON"!==t)return!1;return!0}function pr(n,t,r,u){if(i.acceptData(n)){var s,e,h=i.expando,l=n.nodeType,o=l?i.cache:n,f=l?n[h]:n[h]&&h;if(f&&o[f]&&(u||o[f].data)||void 0!==r||"string"!=typeof t)return f||(f=l?n[h]=c.pop()||i.guid++:h),o[f]||(o[f]=l?{}:{toJSON:i.noop}),("object"==typeof t||"function"==typeof t)&&(u?o[f]=i.extend(o[f],t):o[f].data=i.extend(o[f].data,t)),e=o[f],u||(e.data||(e.data={}),e=e.data),void 0!==r&&(e[i.camelCase(t)]=r),"string"==typeof t?(s=e[t],null==s&&(s=e[i.camelCase(t)])):s=e,s}}function wr(n,t,u){if(i.acceptData(n)){var o,s,h=n.nodeType,f=h?i.cache:n,e=h?n[i.expando]:i.expando;if(f[e]){if(t&&(o=u?f[e]:f[e].data)){for(i.isArray(t)?t=t.concat(i.map(t,i.camelCase)):(t in o)?t=[t]:(t=i.camelCase(t),t=(t in o)?[t]:t.split(" ")),s=t.length;s--;)delete o[t[s]];if(u?!ei(o):!i.isEmptyObject(o))return}(u||(delete f[e].data,ei(f[e])))&&(h?i.cleanData([n],!0):r.deleteExpando||f!=f.window?delete f[e]:f[e]=null)}}}function vt(){return!0}function it(){return!1}function dr(){try{return u.activeElement}catch(n){}}function gr(n){var i=nu.split("|"),t=n.createDocumentFragment();if(t.createElement)while(i.length)t.createElement(i.pop());return t}function f(n,t){var e,u,s=0,r=typeof n.getElementsByTagName!==o?n.getElementsByTagName(t||"*"):typeof n.querySelectorAll!==o?n.querySelectorAll(t||"*"):void 0;if(!r)for(r=[],e=n.childNodes||n;null!=(u=e[s]);s++)!t||i.nodeName(u,t)?r.push(u):i.merge(r,f(u,t));return void 0===t||t&&i.nodeName(n,t)?i.merge([n],r):r}function we(n){oi.test(n.type)&&(n.defaultChecked=n.checked)}function eu(n,t){return i.nodeName(n,"table")&&i.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?n.getElementsByTagName("tbody")[0]||n.appendChild(n.ownerDocument.createElement("tbody")):n}function ou(n){return n.type=(null!==i.find.attr(n,"type"))+"/"+n.type,n}function su(n){var t=ve.exec(n.type);return t?n.type=t[1]:n.removeAttribute("type"),n}function li(n,t){for(var u,r=0;null!=(u=n[r]);r++)i._data(u,"globalEval",!t||i._data(t[r],"globalEval"))}function hu(n,t){if(1===t.nodeType&&i.hasData(n)){var u,f,o,s=i._data(n),r=i._data(t,s),e=s.events;if(e){delete r.handle;r.events={};for(u in e)for(f=0,o=e[u].length;o>f;f++)i.event.add(t,u,e[u][f])}r.data&&(r.data=i.extend({},r.data))}}function be(n,t){var u,e,f;if(1===t.nodeType){if(u=t.nodeName.toLowerCase(),!r.noCloneEvent&&t[i.expando]){f=i._data(t);for(e in f.events)i.removeEvent(t,e,f.handle);t.removeAttribute(i.expando)}"script"===u&&t.text!==n.text?(ou(t).text=n.text,su(t)):"object"===u?(t.parentNode&&(t.outerHTML=n.outerHTML),r.html5Clone&&n.innerHTML&&!i.trim(t.innerHTML)&&(t.innerHTML=n.innerHTML)):"input"===u&&oi.test(n.type)?(t.defaultChecked=t.checked=n.checked,t.value!==n.value&&(t.value=n.value)):"option"===u?t.defaultSelected=t.selected=n.defaultSelected:("input"===u||"textarea"===u)&&(t.defaultValue=n.defaultValue)}}function cu(t,r){var f,u=i(r.createElement(t)).appendTo(r.body),e=n.getDefaultComputedStyle&&(f=n.getDefaultComputedStyle(u[0]))?f.display:i.css(u[0],"display");return u.detach(),e}function yt(n){var r=u,t=ai[n];return t||(t=cu(n,r),"none"!==t&&t||(ot=(ot||i("<iframe frameborder='0' width='0' height='0'/>")).appendTo(r.documentElement),r=(ot[0].contentWindow||ot[0].contentDocument).document,r.write(),r.close(),t=cu(n,r),ot.detach()),ai[n]=t),t}function au(n,t){return{get:function(){var i=n();if(null!=i)return i?void delete this.get:(this.get=t).apply(this,arguments)}}}function pu(n,t){if(t in n)return t;for(var r=t.charAt(0).toUpperCase()+t.slice(1),u=t,i=yu.length;i--;)if(t=yu[i]+r,t in n)return t;return u}function wu(n,t){for(var f,r,o,e=[],u=0,s=n.length;s>u;u++)r=n[u],r.style&&(e[u]=i._data(r,"olddisplay"),f=r.style.display,t?(e[u]||"none"!==f||(r.style.display=""),""===r.style.display&&et(r)&&(e[u]=i._data(r,"olddisplay",yt(r.nodeName)))):(o=et(r),(f&&"none"!==f||!o)&&i._data(r,"olddisplay",o?f:i.css(r,"display"))));for(u=0;s>u;u++)r=n[u],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?e[u]||"":"none"));return n}function bu(n,t,i){var r=no.exec(t);return r?Math.max(0,r[1]-(i||0))+(r[2]||"px"):t}function ku(n,t,r,u,f){for(var e=r===(u?"border":"content")?4:"width"===t?1:0,o=0;4>e;e+=2)"margin"===r&&(o+=i.css(n,r+w[e],!0,f)),u?("content"===r&&(o-=i.css(n,"padding"+w[e],!0,f)),"margin"!==r&&(o-=i.css(n,"border"+w[e]+"Width",!0,f))):(o+=i.css(n,"padding"+w[e],!0,f),"padding"!==r&&(o+=i.css(n,"border"+w[e]+"Width",!0,f)));return o}function du(n,t,u){var o=!0,f="width"===t?n.offsetWidth:n.offsetHeight,e=k(n),s=r.boxSizing&&"border-box"===i.css(n,"boxSizing",!1,e);if(0>=f||null==f){if(f=d(n,t,e),(0>f||null==f)&&(f=n.style[t]),pt.test(f))return f;o=s&&(r.boxSizingReliable()||f===n.style[t]);f=parseFloat(f)||0}return f+ku(n,t,u||(s?"border":"content"),o,e)+"px"}function e(n,t,i,r,u){return new e.prototype.init(n,t,i,r,u)}function nf(){return setTimeout(function(){rt=void 0}),rt=i.now()}function kt(n,t){var r,i={height:n},u=0;for(t=t?1:0;4>u;u+=2-t)r=w[u],i["margin"+r]=i["padding"+r]=n;return t&&(i.opacity=i.width=n),i}function tf(n,t,i){for(var u,f=(st[t]||[]).concat(st["*"]),r=0,e=f.length;e>r;r++)if(u=f[r].call(i,t,n))return u}function fo(n,t,u){var f,a,p,v,s,w,h,b,l=this,y={},o=n.style,c=n.nodeType&&et(n),e=i._data(n,"fxshow");u.queue||(s=i._queueHooks(n,"fx"),null==s.unqueued&&(s.unqueued=0,w=s.empty.fire,s.empty.fire=function(){s.unqueued||w()}),s.unqueued++,l.always(function(){l.always(function(){s.unqueued--;i.queue(n,"fx").length||s.empty.fire()})}));1===n.nodeType&&("height"in t||"width"in t)&&(u.overflow=[o.overflow,o.overflowX,o.overflowY],h=i.css(n,"display"),b="none"===h?i._data(n,"olddisplay")||yt(n.nodeName):h,"inline"===b&&"none"===i.css(n,"float")&&(r.inlineBlockNeedsLayout&&"inline"!==yt(n.nodeName)?o.zoom=1:o.display="inline-block"));u.overflow&&(o.overflow="hidden",r.shrinkWrapBlocks()||l.always(function(){o.overflow=u.overflow[0];o.overflowX=u.overflow[1];o.overflowY=u.overflow[2]}));for(f in t)if(a=t[f],ro.exec(a)){if(delete t[f],p=p||"toggle"===a,a===(c?"hide":"show")){if("show"!==a||!e||void 0===e[f])continue;c=!0}y[f]=e&&e[f]||i.style(n,f)}else h=void 0;if(i.isEmptyObject(y))"inline"===("none"===h?yt(n.nodeName):h)&&(o.display=h);else{e?"hidden"in e&&(c=e.hidden):e=i._data(n,"fxshow",{});p&&(e.hidden=!c);c?i(n).show():l.done(function(){i(n).hide()});l.done(function(){var t;i._removeData(n,"fxshow");for(t in y)i.style(n,t,y[t])});for(f in y)v=tf(c?e[f]:0,f,l),f in e||(e[f]=v.start,c&&(v.end=v.start,v.start="width"===f||"height"===f?1:0))}}function eo(n,t){var r,f,e,u,o;for(r in n)if(f=i.camelCase(r),e=t[f],u=n[r],i.isArray(u)&&(e=u[1],u=n[r]=u[0]),r!==f&&(n[f]=u,delete n[r]),o=i.cssHooks[f],o&&"expand"in o){u=o.expand(u);delete n[f];for(r in u)r in n||(n[r]=u[r],t[r]=e)}else t[f]=e}function rf(n,t,r){var h,e,o=0,l=bt.length,f=i.Deferred().always(function(){delete c.elem}),c=function(){if(e)return!1;for(var s=rt||nf(),t=Math.max(0,u.startTime+u.duration-s),h=t/u.duration||0,i=1-h,r=0,o=u.tweens.length;o>r;r++)u.tweens[r].run(i);return f.notifyWith(n,[u,i,t]),1>i&&o?t:(f.resolveWith(n,[u]),!1)},u=f.promise({elem:n,props:i.extend({},t),opts:i.extend(!0,{specialEasing:{}},r),originalProperties:t,originalOptions:r,startTime:rt||nf(),duration:r.duration,tweens:[],createTween:function(t,r){var f=i.Tween(n,u.opts,t,r,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(f),f},stop:function(t){var i=0,r=t?u.tweens.length:0;if(e)return this;for(e=!0;r>i;i++)u.tweens[i].run(1);return t?f.resolveWith(n,[u,t]):f.rejectWith(n,[u,t]),this}}),s=u.props;for(eo(s,u.opts.specialEasing);l>o;o++)if(h=bt[o].call(u,n,s,u.opts))return h;return i.map(s,tf,u),i.isFunction(u.opts.start)&&u.opts.start.call(n,u),i.fx.timer(i.extend(c,{elem:n,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function af(n){return function(t,r){"string"!=typeof t&&(r=t,t="*");var u,f=0,e=t.toLowerCase().match(h)||[];if(i.isFunction(r))while(u=e[f++])"+"===u.charAt(0)?(u=u.slice(1)||"*",(n[u]=n[u]||[]).unshift(r)):(n[u]=n[u]||[]).push(r)}}function vf(n,t,r,u){function e(s){var h;return f[s]=!0,i.each(n[s]||[],function(n,i){var s=i(t,r,u);return"string"!=typeof s||o||f[s]?o?!(h=s):void 0:(t.dataTypes.unshift(s),e(s),!1)}),h}var f={},o=n===bi;return e(t.dataTypes[0])||!f["*"]&&e("*")}function ki(n,t){var u,r,f=i.ajaxSettings.flatOptions||{};for(r in t)void 0!==t[r]&&((f[r]?n:u||(u={}))[r]=t[r]);return u&&i.extend(!0,n,u),n}function ao(n,t,i){for(var o,e,u,f,s=n.contents,r=n.dataTypes;"*"===r[0];)r.shift(),void 0===e&&(e=n.mimeType||t.getResponseHeader("Content-Type"));if(e)for(f in s)if(s[f]&&s[f].test(e)){r.unshift(f);break}if(r[0]in i)u=r[0];else{for(f in i){if(!r[0]||n.converters[f+" "+r[0]]){u=f;break}o||(o=f)}u=u||o}if(u)return(u!==r[0]&&r.unshift(u),i[u])}function vo(n,t,i,r){var h,u,f,s,e,o={},c=n.dataTypes.slice();if(c[1])for(f in n.converters)o[f.toLowerCase()]=n.converters[f];for(u=c.shift();u;)if(n.responseFields[u]&&(i[n.responseFields[u]]=t),!e&&r&&n.dataFilter&&(t=n.dataFilter(t,n.dataType)),e=u,u=c.shift())if("*"===u)u=e;else if("*"!==e&&e!==u){if(f=o[e+" "+u]||o["* "+u],!f)for(h in o)if(s=h.split(" "),s[1]===u&&(f=o[e+" "+s[0]]||o["* "+s[0]])){f===!0?f=o[h]:o[h]!==!0&&(u=s[0],c.unshift(s[1]));break}if(f!==!0)if(f&&n.throws)t=f(t);else try{t=f(t)}catch(l){return{state:"parsererror",error:f?l:"No conversion from "+e+" to "+u}}}return{state:"success",data:t}}function di(n,t,r,u){var f;if(i.isArray(t))i.each(t,function(t,i){r||po.test(n)?u(n,i):di(n+"["+("object"==typeof i?t:"")+"]",i,r,u)});else if(r||"object"!==i.type(t))u(n,t);else for(f in t)di(n+"["+f+"]",t[f],r,u)}function pf(){try{return new n.XMLHttpRequest}catch(t){}}function go(){try{return new n.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function wf(n){return i.isWindow(n)?n:9===n.nodeType?n.defaultView||n.parentWindow:!1}var c=[],l=c.slice,ir=c.concat,ii=c.push,rr=c.indexOf,ct={},df=ct.toString,tt=ct.hasOwnProperty,r={},ur="1.11.1",i=function(n,t){return new i.fn.init(n,t)},gf=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,ne=/^-ms-/,te=/-([\da-z])/gi,ie=function(n,t){return t.toUpperCase()},p,or,sr,h,fi,lt,o,lr,ar,vr,ot,ai,uf,ef,of,gt,gi,ti,nr,tr,bf,kf;i.fn=i.prototype={jquery:ur,constructor:i,selector:"",length:0,toArray:function(){return l.call(this)},get:function(n){return null!=n?0>n?this[n+this.length]:this[n]:l.call(this)},pushStack:function(n){var t=i.merge(this.constructor(),n);return t.prevObject=this,t.context=this.context,t},each:function(n,t){return i.each(this,n,t)},map:function(n){return this.pushStack(i.map(this,function(t,i){return n.call(t,i,t)}))},slice:function(){return this.pushStack(l.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(n){var i=this.length,t=+n+(0>n?i:0);return this.pushStack(t>=0&&i>t?[this[t]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:ii,sort:c.sort,splice:c.splice};i.extend=i.fn.extend=function(){var r,e,t,f,o,s,n=arguments[0]||{},u=1,c=arguments.length,h=!1;for("boolean"==typeof n&&(h=n,n=arguments[u]||{},u++),"object"==typeof n||i.isFunction(n)||(n={}),u===c&&(n=this,u--);c>u;u++)if(null!=(o=arguments[u]))for(f in o)r=n[f],t=o[f],n!==t&&(h&&t&&(i.isPlainObject(t)||(e=i.isArray(t)))?(e?(e=!1,s=r&&i.isArray(r)?r:[]):s=r&&i.isPlainObject(r)?r:{},n[f]=i.extend(h,s,t)):void 0!==t&&(n[f]=t));return n};i.extend({expando:"jQuery"+(ur+Math.random()).replace(/\D/g,""),isReady:!0,error:function(n){throw new Error(n);},noop:function(){},isFunction:function(n){return"function"===i.type(n)},isArray:Array.isArray||function(n){return"array"===i.type(n)},isWindow:function(n){return null!=n&&n==n.window},isNumeric:function(n){return!i.isArray(n)&&n-parseFloat(n)>=0},isEmptyObject:function(n){for(var t in n)return!1;return!0},isPlainObject:function(n){var t;if(!n||"object"!==i.type(n)||n.nodeType||i.isWindow(n))return!1;try{if(n.constructor&&!tt.call(n,"constructor")&&!tt.call(n.constructor.prototype,"isPrototypeOf"))return!1}catch(u){return!1}if(r.ownLast)for(t in n)return tt.call(n,t);for(t in n);return void 0===t||tt.call(n,t)},type:function(n){return null==n?n+"":"object"==typeof n||"function"==typeof n?ct[df.call(n)]||"object":typeof n},globalEval:function(t){t&&i.trim(t)&&(n.execScript||function(t){n.eval.call(n,t)})(t)},camelCase:function(n){return n.replace(ne,"ms-").replace(te,ie)},nodeName:function(n,t){return n.nodeName&&n.nodeName.toLowerCase()===t.toLowerCase()},each:function(n,t,i){var u,r=0,f=n.length,e=ri(n);if(i){if(e){for(;f>r;r++)if(u=t.apply(n[r],i),u===!1)break}else for(r in n)if(u=t.apply(n[r],i),u===!1)break}else if(e){for(;f>r;r++)if(u=t.call(n[r],r,n[r]),u===!1)break}else for(r in n)if(u=t.call(n[r],r,n[r]),u===!1)break;return n},trim:function(n){return null==n?"":(n+"").replace(gf,"")},makeArray:function(n,t){var r=t||[];return null!=n&&(ri(Object(n))?i.merge(r,"string"==typeof n?[n]:n):ii.call(r,n)),r},inArray:function(n,t,i){var r;if(t){if(rr)return rr.call(t,n,i);for(r=t.length,i=i?0>i?Math.max(0,r+i):i:0;r>i;i++)if(i in t&&t[i]===n)return i}return-1},merge:function(n,t){for(var r=+t.length,i=0,u=n.length;r>i;)n[u++]=t[i++];if(r!==r)while(void 0!==t[i])n[u++]=t[i++];return n.length=u,n},grep:function(n,t,i){for(var u,f=[],r=0,e=n.length,o=!i;e>r;r++)u=!t(n[r],r),u!==o&&f.push(n[r]);return f},map:function(n,t,i){var u,r=0,e=n.length,o=ri(n),f=[];if(o)for(;e>r;r++)u=t(n[r],r,i),null!=u&&f.push(u);else for(r in n)u=t(n[r],r,i),null!=u&&f.push(u);return ir.apply([],f)},guid:1,proxy:function(n,t){var u,r,f;return"string"==typeof t&&(f=n[t],t=n,n=f),i.isFunction(n)?(u=l.call(arguments,2),r=function(){return n.apply(t||this,u.concat(l.call(arguments)))},r.guid=n.guid=n.guid||i.guid++,r):void 0},now:function(){return+new Date},support:r});i.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(n,t){ct["[object "+t+"]"]=t.toLowerCase()});p=function(n){function r(n,t,i,r){var w,h,c,v,k,y,d,l,nt,g;if((t?t.ownerDocument||t:s)!==e&&p(t),t=t||e,i=i||[],!n||"string"!=typeof n)return i;if(1!==(v=t.nodeType)&&9!==v)return[];if(a&&!r){if(w=sr.exec(n))if(c=w[1]){if(9===v){if(h=t.getElementById(c),!h||!h.parentNode)return i;if(h.id===c)return i.push(h),i}else if(t.ownerDocument&&(h=t.ownerDocument.getElementById(c))&&ot(t,h)&&h.id===c)return i.push(h),i}else{if(w[2])return b.apply(i,t.getElementsByTagName(n)),i;if((c=w[3])&&u.getElementsByClassName&&t.getElementsByClassName)return b.apply(i,t.getElementsByClassName(c)),i}if(u.qsa&&(!o||!o.test(n))){if(l=d=f,nt=t,g=9===v&&n,1===v&&"object"!==t.nodeName.toLowerCase()){for(y=et(n),(d=t.getAttribute("id"))?l=d.replace(hr,"\\$&"):t.setAttribute("id",l),l="[id='"+l+"'] ",k=y.length;k--;)y[k]=l+yt(y[k]);nt=gt.test(n)&&ii(t.parentNode)||t;g=y.join(",")}if(g)try{return b.apply(i,nt.querySelectorAll(g)),i}catch(tt){}finally{d||t.removeAttribute("id")}}}return si(n.replace(at,"$1"),t,i,r)}function ni(){function n(r,u){return i.push(r+" ")>t.cacheLength&&delete n[i.shift()],n[r+" "]=u}var i=[];return n}function h(n){return n[f]=!0,n}function c(n){var t=e.createElement("div");try{return!!n(t)}catch(i){return!1}finally{t.parentNode&&t.parentNode.removeChild(t);t=null}}function ti(n,i){for(var u=n.split("|"),r=n.length;r--;)t.attrHandle[u[r]]=i}function wi(n,t){var i=t&&n,r=i&&1===n.nodeType&&1===t.nodeType&&(~t.sourceIndex||ai)-(~n.sourceIndex||ai);if(r)return r;if(i)while(i=i.nextSibling)if(i===t)return-1;return n?1:-1}function cr(n){return function(t){var i=t.nodeName.toLowerCase();return"input"===i&&t.type===n}}function lr(n){return function(t){var i=t.nodeName.toLowerCase();return("input"===i||"button"===i)&&t.type===n}}function tt(n){return h(function(t){return t=+t,h(function(i,r){for(var u,f=n([],i.length,t),e=f.length;e--;)i[u=f[e]]&&(i[u]=!(r[u]=i[u]))})})}function ii(n){return n&&typeof n.getElementsByTagName!==ut&&n}function bi(){}function yt(n){for(var t=0,r=n.length,i="";r>t;t++)i+=n[t].value;return i}function ri(n,t,i){var r=t.dir,u=i&&"parentNode"===r,e=ki++;return t.first?function(t,i,f){while(t=t[r])if(1===t.nodeType||u)return n(t,i,f)}:function(t,i,o){var s,h,c=[v,e];if(o){while(t=t[r])if((1===t.nodeType||u)&&n(t,i,o))return!0}else while(t=t[r])if(1===t.nodeType||u){if(h=t[f]||(t[f]={}),(s=h[r])&&s[0]===v&&s[1]===e)return c[2]=s[2];if(h[r]=c,c[2]=n(t,i,o))return!0}}}function ui(n){return n.length>1?function(t,i,r){for(var u=n.length;u--;)if(!n[u](t,i,r))return!1;return!0}:n[0]}function ar(n,t,i){for(var u=0,f=t.length;f>u;u++)r(n,t[u],i);return i}function pt(n,t,i,r,u){for(var e,o=[],f=0,s=n.length,h=null!=t;s>f;f++)(e=n[f])&&(!i||i(e,r,u))&&(o.push(e),h&&t.push(f));return o}function fi(n,t,i,r,u,e){return r&&!r[f]&&(r=fi(r)),u&&!u[f]&&(u=fi(u,e)),h(function(f,e,o,s){var l,c,a,p=[],y=[],w=e.length,k=f||ar(t||"*",o.nodeType?[o]:o,[]),v=!n||!f&&t?k:pt(k,p,n,o,s),h=i?u||(f?n:w||r)?[]:e:v;if(i&&i(v,h,o,s),r)for(l=pt(h,y),r(l,[],o,s),c=l.length;c--;)(a=l[c])&&(h[y[c]]=!(v[y[c]]=a));if(f){if(u||n){if(u){for(l=[],c=h.length;c--;)(a=h[c])&&l.push(v[c]=a);u(null,h=[],l,s)}for(c=h.length;c--;)(a=h[c])&&(l=u?nt.call(f,a):p[c])>-1&&(f[l]=!(e[l]=a))}}else h=pt(h===e?h.splice(w,h.length):h),u?u(null,e,h,s):b.apply(e,h)})}function ei(n){for(var s,u,r,o=n.length,h=t.relative[n[0].type],c=h||t.relative[" "],i=h?1:0,l=ri(function(n){return n===s},c,!0),a=ri(function(n){return nt.call(s,n)>-1},c,!0),e=[function(n,t,i){return!h&&(i||t!==ct)||((s=t).nodeType?l(n,t,i):a(n,t,i))}];o>i;i++)if(u=t.relative[n[i].type])e=[ri(ui(e),u)];else{if(u=t.filter[n[i].type].apply(null,n[i].matches),u[f]){for(r=++i;o>r;r++)if(t.relative[n[r].type])break;return fi(i>1&&ui(e),i>1&&yt(n.slice(0,i-1).concat({value:" "===n[i-2].type?"*":""})).replace(at,"$1"),u,r>i&&ei(n.slice(i,r)),o>r&&ei(n=n.slice(r)),o>r&&yt(n))}e.push(u)}return ui(e)}function vr(n,i){var u=i.length>0,f=n.length>0,o=function(o,s,h,c,l){var y,d,w,k=0,a="0",g=o&&[],p=[],nt=ct,tt=o||f&&t.find.TAG("*",l),it=v+=null==nt?1:Math.random()||.1,rt=tt.length;for(l&&(ct=s!==e&&s);a!==rt&&null!=(y=tt[a]);a++){if(f&&y){for(d=0;w=n[d++];)if(w(y,s,h)){c.push(y);break}l&&(v=it)}u&&((y=!w&&y)&&k--,o&&g.push(y))}if(k+=a,u&&a!==k){for(d=0;w=i[d++];)w(g,p,s,h);if(o){if(k>0)while(a--)g[a]||p[a]||(p[a]=gi.call(c));p=pt(p)}b.apply(c,p);l&&!o&&p.length>0&&k+i.length>1&&r.uniqueSort(c)}return l&&(v=it,ct=nt),g};return u?h(o):o}var it,u,t,ht,oi,et,wt,si,ct,y,rt,p,e,l,a,o,g,lt,ot,f="sizzle"+-new Date,s=n.document,v=0,ki=0,hi=ni(),ci=ni(),li=ni(),bt=function(n,t){return n===t&&(rt=!0),0},ut="undefined",ai=-2147483648,di={}.hasOwnProperty,w=[],gi=w.pop,nr=w.push,b=w.push,vi=w.slice,nt=w.indexOf||function(n){for(var t=0,i=this.length;i>t;t++)if(this[t]===n)return t;return-1},kt="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",i="[\\x20\\t\\r\\n\\f]",ft="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",yi=ft.replace("w","w#"),pi="\\["+i+"*("+ft+")(?:"+i+"*([*^$|!~]?=)"+i+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+yi+"))|)"+i+"*\\]",dt=":("+ft+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+pi+")*)|.*)\\)|)",at=new RegExp("^"+i+"+|((?:^|[^\\\\])(?:\\\\.)*)"+i+"+$","g"),tr=new RegExp("^"+i+"*,"+i+"*"),ir=new RegExp("^"+i+"*([>+~]|"+i+")"+i+"*"),rr=new RegExp("="+i+"*([^\\]'\"]*?)"+i+"*\\]","g"),ur=new RegExp(dt),fr=new RegExp("^"+yi+"$"),vt={ID:new RegExp("^#("+ft+")"),CLASS:new RegExp("^\\.("+ft+")"),TAG:new RegExp("^("+ft.replace("w","w*")+")"),ATTR:new RegExp("^"+pi),PSEUDO:new RegExp("^"+dt),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+i+"*(even|odd|(([+-]|)(\\d*)n|)"+i+"*(?:([+-]|)"+i+"*(\\d+)|))"+i+"*\\)|)","i"),bool:new RegExp("^(?:"+kt+")$","i"),needsContext:new RegExp("^"+i+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+i+"*((?:-\\d)?\\d*)"+i+"*\\)|)(?=[^-]|$)","i")},er=/^(?:input|select|textarea|button)$/i,or=/^h\d$/i,st=/^[^{]+\{\s*\[native \w/,sr=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,gt=/[+~]/,hr=/'|\\/g,k=new RegExp("\\\\([\\da-f]{1,6}"+i+"?|("+i+")|.)","ig"),d=function(n,t,i){var r="0x"+t-65536;return r!==r||i?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{b.apply(w=vi.call(s.childNodes),s.childNodes);w[s.childNodes.length].nodeType}catch(yr){b={apply:w.length?function(n,t){nr.apply(n,vi.call(t))}:function(n,t){for(var i=n.length,r=0;n[i++]=t[r++];);n.length=i-1}}}u=r.support={};oi=r.isXML=function(n){var t=n&&(n.ownerDocument||n).documentElement;return t?"HTML"!==t.nodeName:!1};p=r.setDocument=function(n){var v,r=n?n.ownerDocument||n:s,h=r.defaultView;return r!==e&&9===r.nodeType&&r.documentElement?(e=r,l=r.documentElement,a=!oi(r),h&&h!==h.top&&(h.addEventListener?h.addEventListener("unload",function(){p()},!1):h.attachEvent&&h.attachEvent("onunload",function(){p()})),u.attributes=c(function(n){return n.className="i",!n.getAttribute("className")}),u.getElementsByTagName=c(function(n){return n.appendChild(r.createComment("")),!n.getElementsByTagName("*").length}),u.getElementsByClassName=st.test(r.getElementsByClassName)&&c(function(n){return n.innerHTML="<div class='a'><\/div><div class='a i'><\/div>",n.firstChild.className="i",2===n.getElementsByClassName("i").length}),u.getById=c(function(n){return l.appendChild(n).id=f,!r.getElementsByName||!r.getElementsByName(f).length}),u.getById?(t.find.ID=function(n,t){if(typeof t.getElementById!==ut&&a){var i=t.getElementById(n);return i&&i.parentNode?[i]:[]}},t.filter.ID=function(n){var t=n.replace(k,d);return function(n){return n.getAttribute("id")===t}}):(delete t.find.ID,t.filter.ID=function(n){var t=n.replace(k,d);return function(n){var i=typeof n.getAttributeNode!==ut&&n.getAttributeNode("id");return i&&i.value===t}}),t.find.TAG=u.getElementsByTagName?function(n,t){if(typeof t.getElementsByTagName!==ut)return t.getElementsByTagName(n)}:function(n,t){var i,r=[],f=0,u=t.getElementsByTagName(n);if("*"===n){while(i=u[f++])1===i.nodeType&&r.push(i);return r}return u},t.find.CLASS=u.getElementsByClassName&&function(n,t){if(typeof t.getElementsByClassName!==ut&&a)return t.getElementsByClassName(n)},g=[],o=[],(u.qsa=st.test(r.querySelectorAll))&&(c(function(n){n.innerHTML="<select msallowclip=''><option selected=''><\/option><\/select>";n.querySelectorAll("[msallowclip^='']").length&&o.push("[*^$]="+i+"*(?:''|\"\")");n.querySelectorAll("[selected]").length||o.push("\\["+i+"*(?:value|"+kt+")");n.querySelectorAll(":checked").length||o.push(":checked")}),c(function(n){var t=r.createElement("input");t.setAttribute("type","hidden");n.appendChild(t).setAttribute("name","D");n.querySelectorAll("[name=d]").length&&o.push("name"+i+"*[*^$|!~]?=");n.querySelectorAll(":enabled").length||o.push(":enabled",":disabled");n.querySelectorAll("*,:x");o.push(",.*:")})),(u.matchesSelector=st.test(lt=l.matches||l.webkitMatchesSelector||l.mozMatchesSelector||l.oMatchesSelector||l.msMatchesSelector))&&c(function(n){u.disconnectedMatch=lt.call(n,"div");lt.call(n,"[s!='']:x");g.push("!=",dt)}),o=o.length&&new RegExp(o.join("|")),g=g.length&&new RegExp(g.join("|")),v=st.test(l.compareDocumentPosition),ot=v||st.test(l.contains)?function(n,t){var r=9===n.nodeType?n.documentElement:n,i=t&&t.parentNode;return n===i||!(!i||1!==i.nodeType||!(r.contains?r.contains(i):n.compareDocumentPosition&&16&n.compareDocumentPosition(i)))}:function(n,t){if(t)while(t=t.parentNode)if(t===n)return!0;return!1},bt=v?function(n,t){if(n===t)return rt=!0,0;var i=!n.compareDocumentPosition-!t.compareDocumentPosition;return i?i:(i=(n.ownerDocument||n)===(t.ownerDocument||t)?n.compareDocumentPosition(t):1,1&i||!u.sortDetached&&t.compareDocumentPosition(n)===i?n===r||n.ownerDocument===s&&ot(s,n)?-1:t===r||t.ownerDocument===s&&ot(s,t)?1:y?nt.call(y,n)-nt.call(y,t):0:4&i?-1:1)}:function(n,t){if(n===t)return rt=!0,0;var i,u=0,o=n.parentNode,h=t.parentNode,f=[n],e=[t];if(!o||!h)return n===r?-1:t===r?1:o?-1:h?1:y?nt.call(y,n)-nt.call(y,t):0;if(o===h)return wi(n,t);for(i=n;i=i.parentNode;)f.unshift(i);for(i=t;i=i.parentNode;)e.unshift(i);while(f[u]===e[u])u++;return u?wi(f[u],e[u]):f[u]===s?-1:e[u]===s?1:0},r):e};r.matches=function(n,t){return r(n,null,null,t)};r.matchesSelector=function(n,t){if((n.ownerDocument||n)!==e&&p(n),t=t.replace(rr,"='$1']"),!(!u.matchesSelector||!a||g&&g.test(t)||o&&o.test(t)))try{var i=lt.call(n,t);if(i||u.disconnectedMatch||n.document&&11!==n.document.nodeType)return i}catch(f){}return r(t,e,null,[n]).length>0};r.contains=function(n,t){return(n.ownerDocument||n)!==e&&p(n),ot(n,t)};r.attr=function(n,i){(n.ownerDocument||n)!==e&&p(n);var f=t.attrHandle[i.toLowerCase()],r=f&&di.call(t.attrHandle,i.toLowerCase())?f(n,i,!a):void 0;return void 0!==r?r:u.attributes||!a?n.getAttribute(i):(r=n.getAttributeNode(i))&&r.specified?r.value:null};r.error=function(n){throw new Error("Syntax error, unrecognized expression: "+n);};r.uniqueSort=function(n){var r,f=[],t=0,i=0;if(rt=!u.detectDuplicates,y=!u.sortStable&&n.slice(0),n.sort(bt),rt){while(r=n[i++])r===n[i]&&(t=f.push(i));while(t--)n.splice(f[t],1)}return y=null,n};ht=r.getText=function(n){var r,i="",u=0,t=n.nodeType;if(t){if(1===t||9===t||11===t){if("string"==typeof n.textContent)return n.textContent;for(n=n.firstChild;n;n=n.nextSibling)i+=ht(n)}else if(3===t||4===t)return n.nodeValue}else while(r=n[u++])i+=ht(r);return i};t=r.selectors={cacheLength:50,createPseudo:h,match:vt,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(n){return n[1]=n[1].replace(k,d),n[3]=(n[3]||n[4]||n[5]||"").replace(k,d),"~="===n[2]&&(n[3]=" "+n[3]+" "),n.slice(0,4)},CHILD:function(n){return n[1]=n[1].toLowerCase(),"nth"===n[1].slice(0,3)?(n[3]||r.error(n[0]),n[4]=+(n[4]?n[5]+(n[6]||1):2*("even"===n[3]||"odd"===n[3])),n[5]=+(n[7]+n[8]||"odd"===n[3])):n[3]&&r.error(n[0]),n},PSEUDO:function(n){var i,t=!n[6]&&n[2];return vt.CHILD.test(n[0])?null:(n[3]?n[2]=n[4]||n[5]||"":t&&ur.test(t)&&(i=et(t,!0))&&(i=t.indexOf(")",t.length-i)-t.length)&&(n[0]=n[0].slice(0,i),n[2]=t.slice(0,i)),n.slice(0,3))}},filter:{TAG:function(n){var t=n.replace(k,d).toLowerCase();return"*"===n?function(){return!0}:function(n){return n.nodeName&&n.nodeName.toLowerCase()===t}},CLASS:function(n){var t=hi[n+" "];return t||(t=new RegExp("(^|"+i+")"+n+"("+i+"|$)"))&&hi(n,function(n){return t.test("string"==typeof n.className&&n.className||typeof n.getAttribute!==ut&&n.getAttribute("class")||"")})},ATTR:function(n,t,i){return function(u){var f=r.attr(u,n);return null==f?"!="===t:t?(f+="","="===t?f===i:"!="===t?f!==i:"^="===t?i&&0===f.indexOf(i):"*="===t?i&&f.indexOf(i)>-1:"$="===t?i&&f.slice(-i.length)===i:"~="===t?(" "+f+" ").indexOf(i)>-1:"|="===t?f===i||f.slice(0,i.length+1)===i+"-":!1):!0}},CHILD:function(n,t,i,r,u){var s="nth"!==n.slice(0,3),o="last"!==n.slice(-4),e="of-type"===t;return 1===r&&0===u?function(n){return!!n.parentNode}:function(t,i,h){var a,k,c,l,y,w,b=s!==o?"nextSibling":"previousSibling",p=t.parentNode,g=e&&t.nodeName.toLowerCase(),d=!h&&!e;if(p){if(s){while(b){for(c=t;c=c[b];)if(e?c.nodeName.toLowerCase()===g:1===c.nodeType)return!1;w=b="only"===n&&!w&&"nextSibling"}return!0}if(w=[o?p.firstChild:p.lastChild],o&&d){for(k=p[f]||(p[f]={}),a=k[n]||[],y=a[0]===v&&a[1],l=a[0]===v&&a[2],c=y&&p.childNodes[y];c=++y&&c&&c[b]||(l=y=0)||w.pop();)if(1===c.nodeType&&++l&&c===t){k[n]=[v,y,l];break}}else if(d&&(a=(t[f]||(t[f]={}))[n])&&a[0]===v)l=a[1];else while(c=++y&&c&&c[b]||(l=y=0)||w.pop())if((e?c.nodeName.toLowerCase()===g:1===c.nodeType)&&++l&&(d&&((c[f]||(c[f]={}))[n]=[v,l]),c===t))break;return l-=u,l===r||l%r==0&&l/r>=0}}},PSEUDO:function(n,i){var e,u=t.pseudos[n]||t.setFilters[n.toLowerCase()]||r.error("unsupported pseudo: "+n);return u[f]?u(i):u.length>1?(e=[n,n,"",i],t.setFilters.hasOwnProperty(n.toLowerCase())?h(function(n,t){for(var r,f=u(n,i),e=f.length;e--;)r=nt.call(n,f[e]),n[r]=!(t[r]=f[e])}):function(n){return u(n,0,e)}):u}},pseudos:{not:h(function(n){var i=[],r=[],t=wt(n.replace(at,"$1"));return t[f]?h(function(n,i,r,u){for(var e,o=t(n,null,u,[]),f=n.length;f--;)(e=o[f])&&(n[f]=!(i[f]=e))}):function(n,u,f){return i[0]=n,t(i,null,f,r),!r.pop()}}),has:h(function(n){return function(t){return r(n,t).length>0}}),contains:h(function(n){return function(t){return(t.textContent||t.innerText||ht(t)).indexOf(n)>-1}}),lang:h(function(n){return fr.test(n||"")||r.error("unsupported lang: "+n),n=n.replace(k,d).toLowerCase(),function(t){var i;do if(i=a?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return i=i.toLowerCase(),i===n||0===i.indexOf(n+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var i=n.location&&n.location.hash;return i&&i.slice(1)===t.id},root:function(n){return n===l},focus:function(n){return n===e.activeElement&&(!e.hasFocus||e.hasFocus())&&!!(n.type||n.href||~n.tabIndex)},enabled:function(n){return n.disabled===!1},disabled:function(n){return n.disabled===!0},checked:function(n){var t=n.nodeName.toLowerCase();return"input"===t&&!!n.checked||"option"===t&&!!n.selected},selected:function(n){return n.parentNode&&n.parentNode.selectedIndex,n.selected===!0},empty:function(n){for(n=n.firstChild;n;n=n.nextSibling)if(n.nodeType<6)return!1;return!0},parent:function(n){return!t.pseudos.empty(n)},header:function(n){return or.test(n.nodeName)},input:function(n){return er.test(n.nodeName)},button:function(n){var t=n.nodeName.toLowerCase();return"input"===t&&"button"===n.type||"button"===t},text:function(n){var t;return"input"===n.nodeName.toLowerCase()&&"text"===n.type&&(null==(t=n.getAttribute("type"))||"text"===t.toLowerCase())},first:tt(function(){return[0]}),last:tt(function(n,t){return[t-1]}),eq:tt(function(n,t,i){return[0>i?i+t:i]}),even:tt(function(n,t){for(var i=0;t>i;i+=2)n.push(i);return n}),odd:tt(function(n,t){for(var i=1;t>i;i+=2)n.push(i);return n}),lt:tt(function(n,t,i){for(var r=0>i?i+t:i;--r>=0;)n.push(r);return n}),gt:tt(function(n,t,i){for(var r=0>i?i+t:i;++r<t;)n.push(r);return n})}};t.pseudos.nth=t.pseudos.eq;for(it in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})t.pseudos[it]=cr(it);for(it in{submit:!0,reset:!0})t.pseudos[it]=lr(it);return bi.prototype=t.filters=t.pseudos,t.setFilters=new bi,et=r.tokenize=function(n,i){var e,f,s,o,u,h,c,l=ci[n+" "];if(l)return i?0:l.slice(0);for(u=n,h=[],c=t.preFilter;u;){(!e||(f=tr.exec(u)))&&(f&&(u=u.slice(f[0].length)||u),h.push(s=[]));e=!1;(f=ir.exec(u))&&(e=f.shift(),s.push({value:e,type:f[0].replace(at," ")}),u=u.slice(e.length));for(o in t.filter)(f=vt[o].exec(u))&&(!c[o]||(f=c[o](f)))&&(e=f.shift(),s.push({value:e,type:o,matches:f}),u=u.slice(e.length));if(!e)break}return i?u.length:u?r.error(n):ci(n,h).slice(0)},wt=r.compile=function(n,t){var r,u=[],e=[],i=li[n+" "];if(!i){for(t||(t=et(n)),r=t.length;r--;)i=ei(t[r]),i[f]?u.push(i):e.push(i);i=li(n,vr(e,u));i.selector=n}return i},si=r.select=function(n,i,r,f){var s,e,o,l,v,c="function"==typeof n&&n,h=!f&&et(n=c.selector||n);if(r=r||[],1===h.length){if(e=h[0]=h[0].slice(0),e.length>2&&"ID"===(o=e[0]).type&&u.getById&&9===i.nodeType&&a&&t.relative[e[1].type]){if(i=(t.find.ID(o.matches[0].replace(k,d),i)||[])[0],!i)return r;c&&(i=i.parentNode);n=n.slice(e.shift().value.length)}for(s=vt.needsContext.test(n)?0:e.length;s--;){if(o=e[s],t.relative[l=o.type])break;if((v=t.find[l])&&(f=v(o.matches[0].replace(k,d),gt.test(e[0].type)&&ii(i.parentNode)||i))){if(e.splice(s,1),n=f.length&&yt(e),!n)return b.apply(r,f),r;break}}}return(c||wt(n,h))(f,i,!a,r,gt.test(n)&&ii(i.parentNode)||i),r},u.sortStable=f.split("").sort(bt).join("")===f,u.detectDuplicates=!!rt,p(),u.sortDetached=c(function(n){return 1&n.compareDocumentPosition(e.createElement("div"))}),c(function(n){return n.innerHTML="<a href='#'><\/a>","#"===n.firstChild.getAttribute("href")})||ti("type|href|height|width",function(n,t,i){if(!i)return n.getAttribute(t,"type"===t.toLowerCase()?1:2)}),u.attributes&&c(function(n){return n.innerHTML="<input/>",n.firstChild.setAttribute("value",""),""===n.firstChild.getAttribute("value")})||ti("value",function(n,t,i){if(!i&&"input"===n.nodeName.toLowerCase())return n.defaultValue}),c(function(n){return null==n.getAttribute("disabled")})||ti(kt,function(n,t,i){var r;if(!i)return n[t]===!0?t.toLowerCase():(r=n.getAttributeNode(t))&&r.specified?r.value:null}),r}(n);i.find=p;i.expr=p.selectors;i.expr[":"]=i.expr.pseudos;i.unique=p.uniqueSort;i.text=p.getText;i.isXMLDoc=p.isXML;i.contains=p.contains;var fr=i.expr.match.needsContext,er=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,re=/^.[^:#\[\.,]*$/;i.filter=function(n,t,r){var u=t[0];return r&&(n=":not("+n+")"),1===t.length&&1===u.nodeType?i.find.matchesSelector(u,n)?[u]:[]:i.find.matches(n,i.grep(t,function(n){return 1===n.nodeType}))};i.fn.extend({find:function(n){var t,r=[],u=this,f=u.length;if("string"!=typeof n)return this.pushStack(i(n).filter(function(){for(t=0;f>t;t++)if(i.contains(u[t],this))return!0}));for(t=0;f>t;t++)i.find(n,u[t],r);return r=this.pushStack(f>1?i.unique(r):r),r.selector=this.selector?this.selector+" "+n:n,r},filter:function(n){return this.pushStack(ui(this,n||[],!1))},not:function(n){return this.pushStack(ui(this,n||[],!0))},is:function(n){return!!ui(this,"string"==typeof n&&fr.test(n)?i(n):n||[],!1).length}});var ft,u=n.document,ue=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,fe=i.fn.init=function(n,t){var r,f;if(!n)return this;if("string"==typeof n){if(r="<"===n.charAt(0)&&">"===n.charAt(n.length-1)&&n.length>=3?[null,n,null]:ue.exec(n),!r||!r[1]&&t)return!t||t.jquery?(t||ft).find(n):this.constructor(t).find(n);if(r[1]){if(t=t instanceof i?t[0]:t,i.merge(this,i.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:u,!0)),er.test(r[1])&&i.isPlainObject(t))for(r in t)i.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}if(f=u.getElementById(r[2]),f&&f.parentNode){if(f.id!==r[2])return ft.find(n);this.length=1;this[0]=f}return this.context=u,this.selector=n,this}return n.nodeType?(this.context=this[0]=n,this.length=1,this):i.isFunction(n)?"undefined"!=typeof ft.ready?ft.ready(n):n(i):(void 0!==n.selector&&(this.selector=n.selector,this.context=n.context),i.makeArray(n,this))};fe.prototype=i.fn;ft=i(u);or=/^(?:parents|prev(?:Until|All))/;sr={children:!0,contents:!0,next:!0,prev:!0};i.extend({dir:function(n,t,r){for(var f=[],u=n[t];u&&9!==u.nodeType&&(void 0===r||1!==u.nodeType||!i(u).is(r));)1===u.nodeType&&f.push(u),u=u[t];return f},sibling:function(n,t){for(var i=[];n;n=n.nextSibling)1===n.nodeType&&n!==t&&i.push(n);return i}});i.fn.extend({has:function(n){var t,r=i(n,this),u=r.length;return this.filter(function(){for(t=0;u>t;t++)if(i.contains(this,r[t]))return!0})},closest:function(n,t){for(var r,f=0,o=this.length,u=[],e=fr.test(n)||"string"!=typeof n?i(n,t||this.context):0;o>f;f++)for(r=this[f];r&&r!==t;r=r.parentNode)if(r.nodeType<11&&(e?e.index(r)>-1:1===r.nodeType&&i.find.matchesSelector(r,n))){u.push(r);break}return this.pushStack(u.length>1?i.unique(u):u)},index:function(n){return n?"string"==typeof n?i.inArray(this[0],i(n)):i.inArray(n.jquery?n[0]:n,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(n,t){return this.pushStack(i.unique(i.merge(this.get(),i(n,t))))},addBack:function(n){return this.add(null==n?this.prevObject:this.prevObject.filter(n))}});i.each({parent:function(n){var t=n.parentNode;return t&&11!==t.nodeType?t:null},parents:function(n){return i.dir(n,"parentNode")},parentsUntil:function(n,t,r){return i.dir(n,"parentNode",r)},next:function(n){return hr(n,"nextSibling")},prev:function(n){return hr(n,"previousSibling")},nextAll:function(n){return i.dir(n,"nextSibling")},prevAll:function(n){return i.dir(n,"previousSibling")},nextUntil:function(n,t,r){return i.dir(n,"nextSibling",r)},prevUntil:function(n,t,r){return i.dir(n,"previousSibling",r)},siblings:function(n){return i.sibling((n.parentNode||{}).firstChild,n)},children:function(n){return i.sibling(n.firstChild)},contents:function(n){return i.nodeName(n,"iframe")?n.contentDocument||n.contentWindow.document:i.merge([],n.childNodes)}},function(n,t){i.fn[n]=function(r,u){var f=i.map(this,t,r);return"Until"!==n.slice(-5)&&(u=r),u&&"string"==typeof u&&(f=i.filter(u,f)),this.length>1&&(sr[n]||(f=i.unique(f)),or.test(n)&&(f=f.reverse())),this.pushStack(f)}});h=/\S+/g;fi={};i.Callbacks=function(n){n="string"==typeof n?fi[n]||ee(n):i.extend({},n);var o,u,h,f,e,c,t=[],r=!n.once&&[],l=function(i){for(u=n.memory&&i,h=!0,e=c||0,c=0,f=t.length,o=!0;t&&f>e;e++)if(t[e].apply(i[0],i[1])===!1&&n.stopOnFalse){u=!1;break}o=!1;t&&(r?r.length&&l(r.shift()):u?t=[]:s.disable())},s={add:function(){if(t){var r=t.length;!function e(r){i.each(r,function(r,u){var f=i.type(u);"function"===f?n.unique&&s.has(u)||t.push(u):u&&u.length&&"string"!==f&&e(u)})}(arguments);o?f=t.length:u&&(c=r,l(u))}return this},remove:function(){return t&&i.each(arguments,function(n,r){for(var u;(u=i.inArray(r,t,u))>-1;)t.splice(u,1),o&&(f>=u&&f--,e>=u&&e--)}),this},has:function(n){return n?i.inArray(n,t)>-1:!(!t||!t.length)},empty:function(){return t=[],f=0,this},disable:function(){return t=r=u=void 0,this},disabled:function(){return!t},lock:function(){return r=void 0,u||s.disable(),this},locked:function(){return!r},fireWith:function(n,i){return!t||h&&!r||(i=i||[],i=[n,i.slice?i.slice():i],o?r.push(i):l(i)),this},fire:function(){return s.fireWith(this,arguments),this},fired:function(){return!!h}};return s};i.extend({Deferred:function(n){var u=[["resolve","done",i.Callbacks("once memory"),"resolved"],["reject","fail",i.Callbacks("once memory"),"rejected"],["notify","progress",i.Callbacks("memory")]],f="pending",r={state:function(){return f},always:function(){return t.done(arguments).fail(arguments),this},then:function(){var n=arguments;return i.Deferred(function(f){i.each(u,function(u,e){var o=i.isFunction(n[u])&&n[u];t[e[1]](function(){var n=o&&o.apply(this,arguments);n&&i.isFunction(n.promise)?n.promise().done(f.resolve).fail(f.reject).progress(f.notify):f[e[0]+"With"](this===r?f.promise():this,o?[n]:arguments)})});n=null}).promise()},promise:function(n){return null!=n?i.extend(n,r):r}},t={};return r.pipe=r.then,i.each(u,function(n,i){var e=i[2],o=i[3];r[i[1]]=e.add;o&&e.add(function(){f=o},u[1^n][2].disable,u[2][2].lock);t[i[0]]=function(){return t[i[0]+"With"](this===t?r:this,arguments),this};t[i[0]+"With"]=e.fireWith}),r.promise(t),n&&n.call(t,t),t},when:function(n){var t=0,u=l.call(arguments),r=u.length,e=1!==r||n&&i.isFunction(n.promise)?r:0,f=1===e?n:i.Deferred(),h=function(n,t,i){return function(r){t[n]=this;i[n]=arguments.length>1?l.call(arguments):r;i===o?f.notifyWith(t,i):--e||f.resolveWith(t,i)}},o,c,s;if(r>1)for(o=new Array(r),c=new Array(r),s=new Array(r);r>t;t++)u[t]&&i.isFunction(u[t].promise)?u[t].promise().done(h(t,s,u)).fail(f.reject).progress(h(t,c,o)):--e;return e||f.resolveWith(s,u),f.promise()}});i.fn.ready=function(n){return i.ready.promise().done(n),this};i.extend({isReady:!1,readyWait:1,holdReady:function(n){n?i.readyWait++:i.ready(!0)},ready:function(n){if(n===!0?!--i.readyWait:!i.isReady){if(!u.body)return setTimeout(i.ready);i.isReady=!0;n!==!0&&--i.readyWait>0||(lt.resolveWith(u,[i]),i.fn.triggerHandler&&(i(u).triggerHandler("ready"),i(u).off("ready")))}}});i.ready.promise=function(t){if(!lt)if(lt=i.Deferred(),"complete"===u.readyState)setTimeout(i.ready);else if(u.addEventListener)u.addEventListener("DOMContentLoaded",a,!1),n.addEventListener("load",a,!1);else{u.attachEvent("onreadystatechange",a);n.attachEvent("onload",a);var r=!1;try{r=null==n.frameElement&&u.documentElement}catch(e){}r&&r.doScroll&&!function f(){if(!i.isReady){try{r.doScroll("left")}catch(n){return setTimeout(f,50)}cr();i.ready()}}()}return lt.promise(t)};o="undefined";for(lr in i(r))break;r.ownLast="0"!==lr;r.inlineBlockNeedsLayout=!1;i(function(){var f,t,n,i;n=u.getElementsByTagName("body")[0];n&&n.style&&(t=u.createElement("div"),i=u.createElement("div"),i.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(i).appendChild(t),typeof t.style.zoom!==o&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",r.inlineBlockNeedsLayout=f=3===t.offsetWidth,f&&(n.style.zoom=1)),n.removeChild(i))}),function(){var n=u.createElement("div");if(null==r.deleteExpando){r.deleteExpando=!0;try{delete n.test}catch(t){r.deleteExpando=!1}}n=null}();i.acceptData=function(n){var t=i.noData[(n.nodeName+" ").toLowerCase()],r=+n.nodeType||1;return 1!==r&&9!==r?!1:!t||t!==!0&&n.getAttribute("classid")===t};ar=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/;vr=/([A-Z])/g;i.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(n){return n=n.nodeType?i.cache[n[i.expando]]:n[i.expando],!!n&&!ei(n)},data:function(n,t,i){return pr(n,t,i)},removeData:function(n,t){return wr(n,t)},_data:function(n,t,i){return pr(n,t,i,!0)},_removeData:function(n,t){return wr(n,t,!0)}});i.fn.extend({data:function(n,t){var f,u,e,r=this[0],o=r&&r.attributes;if(void 0===n){if(this.length&&(e=i.data(r),1===r.nodeType&&!i._data(r,"parsedAttrs"))){for(f=o.length;f--;)o[f]&&(u=o[f].name,0===u.indexOf("data-")&&(u=i.camelCase(u.slice(5)),yr(r,u,e[u])));i._data(r,"parsedAttrs",!0)}return e}return"object"==typeof n?this.each(function(){i.data(this,n)}):arguments.length>1?this.each(function(){i.data(this,n,t)}):r?yr(r,n,i.data(r,n)):void 0},removeData:function(n){return this.each(function(){i.removeData(this,n)})}});i.extend({queue:function(n,t,r){var u;if(n)return(t=(t||"fx")+"queue",u=i._data(n,t),r&&(!u||i.isArray(r)?u=i._data(n,t,i.makeArray(r)):u.push(r)),u||[])},dequeue:function(n,t){t=t||"fx";var r=i.queue(n,t),e=r.length,u=r.shift(),f=i._queueHooks(n,t),o=function(){i.dequeue(n,t)};"inprogress"===u&&(u=r.shift(),e--);u&&("fx"===t&&r.unshift("inprogress"),delete f.stop,u.call(n,o,f));!e&&f&&f.empty.fire()},_queueHooks:function(n,t){var r=t+"queueHooks";return i._data(n,r)||i._data(n,r,{empty:i.Callbacks("once memory").add(function(){i._removeData(n,t+"queue");i._removeData(n,r)})})}});i.fn.extend({queue:function(n,t){var r=2;return"string"!=typeof n&&(t=n,n="fx",r--),arguments.length<r?i.queue(this[0],n):void 0===t?this:this.each(function(){var r=i.queue(this,n,t);i._queueHooks(this,n);"fx"===n&&"inprogress"!==r[0]&&i.dequeue(this,n)})},dequeue:function(n){return this.each(function(){i.dequeue(this,n)})},clearQueue:function(n){return this.queue(n||"fx",[])},promise:function(n,t){var r,f=1,e=i.Deferred(),u=this,o=this.length,s=function(){--f||e.resolveWith(u,[u])};for("string"!=typeof n&&(t=n,n=void 0),n=n||"fx";o--;)r=i._data(u[o],n+"queueHooks"),r&&r.empty&&(f++,r.empty.add(s));return s(),e.promise(t)}});var at=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=["Top","Right","Bottom","Left"],et=function(n,t){return n=t||n,"none"===i.css(n,"display")||!i.contains(n.ownerDocument,n)},b=i.access=function(n,t,r,u,f,e,o){var s=0,c=n.length,h=null==r;if("object"===i.type(r)){f=!0;for(s in r)i.access(n,t,s,r[s],!0,e,o)}else if(void 0!==u&&(f=!0,i.isFunction(u)||(o=!0),h&&(o?(t.call(n,u),t=null):(h=t,t=function(n,t,r){return h.call(i(n),r)})),t))for(;c>s;s++)t(n[s],r,o?u:u.call(n[s],s,t(n[s],r)));return f?n:h?t.call(n):c?t(n[0],r):e},oi=/^(?:checkbox|radio)$/i;!function(){var t=u.createElement("input"),n=u.createElement("div"),i=u.createDocumentFragment();if(n.innerHTML="  <link/><table><\/table><a href='/a'>a<\/a><input type='checkbox'/>",r.leadingWhitespace=3===n.firstChild.nodeType,r.tbody=!n.getElementsByTagName("tbody").length,r.htmlSerialize=!!n.getElementsByTagName("link").length,r.html5Clone="<:nav><\/:nav>"!==u.createElement("nav").cloneNode(!0).outerHTML,t.type="checkbox",t.checked=!0,i.appendChild(t),r.appendChecked=t.checked,n.innerHTML="<textarea>x<\/textarea>",r.noCloneChecked=!!n.cloneNode(!0).lastChild.defaultValue,i.appendChild(n),n.innerHTML="<input type='radio' checked='checked' name='t'/>",r.checkClone=n.cloneNode(!0).cloneNode(!0).lastChild.checked,r.noCloneEvent=!0,n.attachEvent&&(n.attachEvent("onclick",function(){r.noCloneEvent=!1}),n.cloneNode(!0).click()),null==r.deleteExpando){r.deleteExpando=!0;try{delete n.test}catch(f){r.deleteExpando=!1}}}(),function(){var t,i,f=u.createElement("div");for(t in{submit:!0,change:!0,focusin:!0})i="on"+t,(r[t+"Bubbles"]=i in n)||(f.setAttribute(i,"t"),r[t+"Bubbles"]=f.attributes[i].expando===!1);f=null}();var si=/^(?:input|select|textarea)$/i,oe=/^key/,se=/^(?:mouse|pointer|contextmenu)|click/,br=/^(?:focusinfocus|focusoutblur)$/,kr=/^([^.]*)(?:\.(.+)|)$/;i.event={global:{},add:function(n,t,r,u,f){var w,y,b,p,s,c,l,a,e,k,d,v=i._data(n);if(v){for(r.handler&&(p=r,r=p.handler,f=p.selector),r.guid||(r.guid=i.guid++),(y=v.events)||(y=v.events={}),(c=v.handle)||(c=v.handle=function(n){if(typeof i!==o&&(!n||i.event.triggered!==n.type))return i.event.dispatch.apply(c.elem,arguments)},c.elem=n),t=(t||"").match(h)||[""],b=t.length;b--;)w=kr.exec(t[b])||[],e=d=w[1],k=(w[2]||"").split(".").sort(),e&&(s=i.event.special[e]||{},e=(f?s.delegateType:s.bindType)||e,s=i.event.special[e]||{},l=i.extend({type:e,origType:d,data:u,handler:r,guid:r.guid,selector:f,needsContext:f&&i.expr.match.needsContext.test(f),namespace:k.join(".")},p),(a=y[e])||(a=y[e]=[],a.delegateCount=0,s.setup&&s.setup.call(n,u,k,c)!==!1||(n.addEventListener?n.addEventListener(e,c,!1):n.attachEvent&&n.attachEvent("on"+e,c))),s.add&&(s.add.call(n,l),l.handler.guid||(l.handler.guid=r.guid)),f?a.splice(a.delegateCount++,0,l):a.push(l),i.event.global[e]=!0);n=null}},remove:function(n,t,r,u,f){var y,o,s,b,p,a,c,l,e,w,k,v=i.hasData(n)&&i._data(n);if(v&&(a=v.events)){for(t=(t||"").match(h)||[""],p=t.length;p--;)if(s=kr.exec(t[p])||[],e=k=s[1],w=(s[2]||"").split(".").sort(),e){for(c=i.event.special[e]||{},e=(u?c.delegateType:c.bindType)||e,l=a[e]||[],s=s[2]&&new RegExp("(^|\\.)"+w.join("\\.(?:.*\\.|)")+"(\\.|$)"),b=y=l.length;y--;)o=l[y],!f&&k!==o.origType||r&&r.guid!==o.guid||s&&!s.test(o.namespace)||u&&u!==o.selector&&("**"!==u||!o.selector)||(l.splice(y,1),o.selector&&l.delegateCount--,c.remove&&c.remove.call(n,o));b&&!l.length&&(c.teardown&&c.teardown.call(n,w,v.handle)!==!1||i.removeEvent(n,e,v.handle),delete a[e])}else for(e in a)i.event.remove(n,e+t[p],r,u,!0);i.isEmptyObject(a)&&(delete v.handle,i._removeData(n,"events"))}},trigger:function(t,r,f,e){var l,a,o,p,c,h,w,y=[f||u],s=tt.call(t,"type")?t.type:t,v=tt.call(t,"namespace")?t.namespace.split("."):[];if(o=h=f=f||u,3!==f.nodeType&&8!==f.nodeType&&!br.test(s+i.event.triggered)&&(s.indexOf(".")>=0&&(v=s.split("."),s=v.shift(),v.sort()),a=s.indexOf(":")<0&&"on"+s,t=t[i.expando]?t:new i.Event(s,"object"==typeof t&&t),t.isTrigger=e?2:3,t.namespace=v.join("."),t.namespace_re=t.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=f),r=null==r?[t]:i.makeArray(r,[t]),c=i.event.special[s]||{},e||!c.trigger||c.trigger.apply(f,r)!==!1)){if(!e&&!c.noBubble&&!i.isWindow(f)){for(p=c.delegateType||s,br.test(p+s)||(o=o.parentNode);o;o=o.parentNode)y.push(o),h=o;h===(f.ownerDocument||u)&&y.push(h.defaultView||h.parentWindow||n)}for(w=0;(o=y[w++])&&!t.isPropagationStopped();)t.type=w>1?p:c.bindType||s,l=(i._data(o,"events")||{})[t.type]&&i._data(o,"handle"),l&&l.apply(o,r),l=a&&o[a],l&&l.apply&&i.acceptData(o)&&(t.result=l.apply(o,r),t.result===!1&&t.preventDefault());if(t.type=s,!e&&!t.isDefaultPrevented()&&(!c._default||c._default.apply(y.pop(),r)===!1)&&i.acceptData(f)&&a&&f[s]&&!i.isWindow(f)){h=f[a];h&&(f[a]=null);i.event.triggered=s;try{f[s]()}catch(b){}i.event.triggered=void 0;h&&(f[a]=h)}return t.result}},dispatch:function(n){n=i.event.fix(n);var e,f,t,r,o,s=[],h=l.call(arguments),c=(i._data(this,"events")||{})[n.type]||[],u=i.event.special[n.type]||{};if(h[0]=n,n.delegateTarget=this,!u.preDispatch||u.preDispatch.call(this,n)!==!1){for(s=i.event.handlers.call(this,n,c),e=0;(r=s[e++])&&!n.isPropagationStopped();)for(n.currentTarget=r.elem,o=0;(t=r.handlers[o++])&&!n.isImmediatePropagationStopped();)(!n.namespace_re||n.namespace_re.test(t.namespace))&&(n.handleObj=t,n.data=t.data,f=((i.event.special[t.origType]||{}).handle||t.handler).apply(r.elem,h),void 0!==f&&(n.result=f)===!1&&(n.preventDefault(),n.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,n),n.result}},handlers:function(n,t){var f,e,u,o,h=[],s=t.delegateCount,r=n.target;if(s&&r.nodeType&&(!n.button||"click"!==n.type))for(;r!=this;r=r.parentNode||this)if(1===r.nodeType&&(r.disabled!==!0||"click"!==n.type)){for(u=[],o=0;s>o;o++)e=t[o],f=e.selector+" ",void 0===u[f]&&(u[f]=e.needsContext?i(f,this).index(r)>=0:i.find(f,this,null,[r]).length),u[f]&&u.push(e);u.length&&h.push({elem:r,handlers:u})}return s<t.length&&h.push({elem:this,handlers:t.slice(s)}),h},fix:function(n){if(n[i.expando])return n;var e,o,s,r=n.type,f=n,t=this.fixHooks[r];for(t||(this.fixHooks[r]=t=se.test(r)?this.mouseHooks:oe.test(r)?this.keyHooks:{}),s=t.props?this.props.concat(t.props):this.props,n=new i.Event(f),e=s.length;e--;)o=s[e],n[o]=f[o];return n.target||(n.target=f.srcElement||u),3===n.target.nodeType&&(n.target=n.target.parentNode),n.metaKey=!!n.metaKey,t.filter?t.filter(n,f):n},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(n,t){return null==n.which&&(n.which=null!=t.charCode?t.charCode:t.keyCode),n}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(n,t){var i,e,r,f=t.button,o=t.fromElement;return null==n.pageX&&null!=t.clientX&&(e=n.target.ownerDocument||u,r=e.documentElement,i=e.body,n.pageX=t.clientX+(r&&r.scrollLeft||i&&i.scrollLeft||0)-(r&&r.clientLeft||i&&i.clientLeft||0),n.pageY=t.clientY+(r&&r.scrollTop||i&&i.scrollTop||0)-(r&&r.clientTop||i&&i.clientTop||0)),!n.relatedTarget&&o&&(n.relatedTarget=o===n.target?t.toElement:o),n.which||void 0===f||(n.which=1&f?1:2&f?3:4&f?2:0),n}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==dr()&&this.focus)try{return this.focus(),!1}catch(n){}},delegateType:"focusin"},blur:{trigger:function(){if(this===dr()&&this.blur)return(this.blur(),!1)},delegateType:"focusout"},click:{trigger:function(){if(i.nodeName(this,"input")&&"checkbox"===this.type&&this.click)return(this.click(),!1)},_default:function(n){return i.nodeName(n.target,"a")}},beforeunload:{postDispatch:function(n){void 0!==n.result&&n.originalEvent&&(n.originalEvent.returnValue=n.result)}}},simulate:function(n,t,r,u){var f=i.extend(new i.Event,r,{type:n,isSimulated:!0,originalEvent:{}});u?i.event.trigger(f,null,t):i.event.dispatch.call(t,f);f.isDefaultPrevented()&&r.preventDefault()}};i.removeEvent=u.removeEventListener?function(n,t,i){n.removeEventListener&&n.removeEventListener(t,i,!1)}:function(n,t,i){var r="on"+t;n.detachEvent&&(typeof n[r]===o&&(n[r]=null),n.detachEvent(r,i))};i.Event=function(n,t){return this instanceof i.Event?(n&&n.type?(this.originalEvent=n,this.type=n.type,this.isDefaultPrevented=n.defaultPrevented||void 0===n.defaultPrevented&&n.returnValue===!1?vt:it):this.type=n,t&&i.extend(this,t),this.timeStamp=n&&n.timeStamp||i.now(),void(this[i.expando]=!0)):new i.Event(n,t)};i.Event.prototype={isDefaultPrevented:it,isPropagationStopped:it,isImmediatePropagationStopped:it,preventDefault:function(){var n=this.originalEvent;this.isDefaultPrevented=vt;n&&(n.preventDefault?n.preventDefault():n.returnValue=!1)},stopPropagation:function(){var n=this.originalEvent;this.isPropagationStopped=vt;n&&(n.stopPropagation&&n.stopPropagation(),n.cancelBubble=!0)},stopImmediatePropagation:function(){var n=this.originalEvent;this.isImmediatePropagationStopped=vt;n&&n.stopImmediatePropagation&&n.stopImmediatePropagation();this.stopPropagation()}};i.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(n,t){i.event.special[n]={delegateType:t,bindType:t,handle:function(n){var u,f=this,r=n.relatedTarget,e=n.handleObj;return(!r||r!==f&&!i.contains(f,r))&&(n.type=e.origType,u=e.handler.apply(this,arguments),n.type=t),u}}});r.submitBubbles||(i.event.special.submit={setup:function(){return i.nodeName(this,"form")?!1:void i.event.add(this,"click._submit keypress._submit",function(n){var r=n.target,t=i.nodeName(r,"input")||i.nodeName(r,"button")?r.form:void 0;t&&!i._data(t,"submitBubbles")&&(i.event.add(t,"submit._submit",function(n){n._submit_bubble=!0}),i._data(t,"submitBubbles",!0))})},postDispatch:function(n){n._submit_bubble&&(delete n._submit_bubble,this.parentNode&&!n.isTrigger&&i.event.simulate("submit",this.parentNode,n,!0))},teardown:function(){return i.nodeName(this,"form")?!1:void i.event.remove(this,"._submit")}});r.changeBubbles||(i.event.special.change={setup:function(){return si.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(i.event.add(this,"propertychange._change",function(n){"checked"===n.originalEvent.propertyName&&(this._just_changed=!0)}),i.event.add(this,"click._change",function(n){this._just_changed&&!n.isTrigger&&(this._just_changed=!1);i.event.simulate("change",this,n,!0)})),!1):void i.event.add(this,"beforeactivate._change",function(n){var t=n.target;si.test(t.nodeName)&&!i._data(t,"changeBubbles")&&(i.event.add(t,"change._change",function(n){!this.parentNode||n.isSimulated||n.isTrigger||i.event.simulate("change",this.parentNode,n,!0)}),i._data(t,"changeBubbles",!0))})},handle:function(n){var t=n.target;if(this!==t||n.isSimulated||n.isTrigger||"radio"!==t.type&&"checkbox"!==t.type)return n.handleObj.handler.apply(this,arguments)},teardown:function(){return i.event.remove(this,"._change"),!si.test(this.nodeName)}});r.focusinBubbles||i.each({focus:"focusin",blur:"focusout"},function(n,t){var r=function(n){i.event.simulate(t,n.target,i.event.fix(n),!0)};i.event.special[t]={setup:function(){var u=this.ownerDocument||this,f=i._data(u,t);f||u.addEventListener(n,r,!0);i._data(u,t,(f||0)+1)},teardown:function(){var u=this.ownerDocument||this,f=i._data(u,t)-1;f?i._data(u,t,f):(u.removeEventListener(n,r,!0),i._removeData(u,t))}}});i.fn.extend({on:function(n,t,r,u,f){var o,e;if("object"==typeof n){"string"!=typeof t&&(r=r||t,t=void 0);for(o in n)this.on(o,t,r,n[o],f);return this}if(null==r&&null==u?(u=t,r=t=void 0):null==u&&("string"==typeof t?(u=r,r=void 0):(u=r,r=t,t=void 0)),u===!1)u=it;else if(!u)return this;return 1===f&&(e=u,u=function(n){return i().off(n),e.apply(this,arguments)},u.guid=e.guid||(e.guid=i.guid++)),this.each(function(){i.event.add(this,n,u,r,t)})},one:function(n,t,i,r){return this.on(n,t,i,r,1)},off:function(n,t,r){var u,f;if(n&&n.preventDefault&&n.handleObj)return u=n.handleObj,i(n.delegateTarget).off(u.namespace?u.origType+"."+u.namespace:u.origType,u.selector,u.handler),this;if("object"==typeof n){for(f in n)this.off(f,t,n[f]);return this}return(t===!1||"function"==typeof t)&&(r=t,t=void 0),r===!1&&(r=it),this.each(function(){i.event.remove(this,n,r,t)})},trigger:function(n,t){return this.each(function(){i.event.trigger(n,t,this)})},triggerHandler:function(n,t){var r=this[0];if(r)return i.event.trigger(n,t,r,!0)}});var nu="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",he=/ jQuery\d+="(?:null|\d+)"/g,tu=new RegExp("<(?:"+nu+")[\\s/>]","i"),hi=/^\s+/,iu=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ru=/<([\w:]+)/,uu=/<tbody/i,ce=/<|&#?\w+;/,le=/<(?:script|style|link)/i,ae=/checked\s*(?:[^=]|=\s*.checked.)/i,fu=/^$|\/(?:java|ecma)script/i,ve=/^true\/(.*)/,ye=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,s={option:[1,"<select multiple='multiple'>","<\/select>"],legend:[1,"<fieldset>","<\/fieldset>"],area:[1,"<map>","<\/map>"],param:[1,"<object>","<\/object>"],thead:[1,"<table>","<\/table>"],tr:[2,"<table><tbody>","<\/tbody><\/table>"],col:[2,"<table><tbody><\/tbody><colgroup>","<\/colgroup><\/table>"],td:[3,"<table><tbody><tr>","<\/tr><\/tbody><\/table>"],_default:r.htmlSerialize?[0,"",""]:[1,"X<div>","<\/div>"]},pe=gr(u),ci=pe.appendChild(u.createElement("div"));s.optgroup=s.option;s.tbody=s.tfoot=s.colgroup=s.caption=s.thead;s.th=s.td;i.extend({clone:function(n,t,u){var e,c,s,o,h,l=i.contains(n.ownerDocument,n);if(r.html5Clone||i.isXMLDoc(n)||!tu.test("<"+n.nodeName+">")?s=n.cloneNode(!0):(ci.innerHTML=n.outerHTML,ci.removeChild(s=ci.firstChild)),!(r.noCloneEvent&&r.noCloneChecked||1!==n.nodeType&&11!==n.nodeType||i.isXMLDoc(n)))for(e=f(s),h=f(n),o=0;null!=(c=h[o]);++o)e[o]&&be(c,e[o]);if(t)if(u)for(h=h||f(n),e=e||f(s),o=0;null!=(c=h[o]);o++)hu(c,e[o]);else hu(n,s);return e=f(s,"script"),e.length>0&&li(e,!l&&f(n,"script")),e=h=c=null,s},buildFragment:function(n,t,u,e){for(var c,o,b,h,p,w,a,k=n.length,v=gr(t),l=[],y=0;k>y;y++)if(o=n[y],o||0===o)if("object"===i.type(o))i.merge(l,o.nodeType?[o]:o);else if(ce.test(o)){for(h=h||v.appendChild(t.createElement("div")),p=(ru.exec(o)||["",""])[1].toLowerCase(),a=s[p]||s._default,h.innerHTML=a[1]+o.replace(iu,"<$1><\/$2>")+a[2],c=a[0];c--;)h=h.lastChild;if(!r.leadingWhitespace&&hi.test(o)&&l.push(t.createTextNode(hi.exec(o)[0])),!r.tbody)for(o="table"!==p||uu.test(o)?"<table>"!==a[1]||uu.test(o)?0:h:h.firstChild,c=o&&o.childNodes.length;c--;)i.nodeName(w=o.childNodes[c],"tbody")&&!w.childNodes.length&&o.removeChild(w);for(i.merge(l,h.childNodes),h.textContent="";h.firstChild;)h.removeChild(h.firstChild);h=v.lastChild}else l.push(t.createTextNode(o));for(h&&v.removeChild(h),r.appendChecked||i.grep(f(l,"input"),we),y=0;o=l[y++];)if((!e||-1===i.inArray(o,e))&&(b=i.contains(o.ownerDocument,o),h=f(v.appendChild(o),"script"),b&&li(h),u))for(c=0;o=h[c++];)fu.test(o.type||"")&&u.push(o);return h=null,v},cleanData:function(n,t){for(var u,e,f,s,a=0,h=i.expando,l=i.cache,v=r.deleteExpando,y=i.event.special;null!=(u=n[a]);a++)if((t||i.acceptData(u))&&(f=u[h],s=f&&l[f])){if(s.events)for(e in s.events)y[e]?i.event.remove(u,e):i.removeEvent(u,e,s.handle);l[f]&&(delete l[f],v?delete u[h]:typeof u.removeAttribute!==o?u.removeAttribute(h):u[h]=null,c.push(f))}}});i.fn.extend({text:function(n){return b(this,function(n){return void 0===n?i.text(this):this.empty().append((this[0]&&this[0].ownerDocument||u).createTextNode(n))},null,n,arguments.length)},append:function(){return this.domManip(arguments,function(n){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=eu(this,n);t.appendChild(n)}})},prepend:function(){return this.domManip(arguments,function(n){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=eu(this,n);t.insertBefore(n,t.firstChild)}})},before:function(){return this.domManip(arguments,function(n){this.parentNode&&this.parentNode.insertBefore(n,this)})},after:function(){return this.domManip(arguments,function(n){this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling)})},remove:function(n,t){for(var r,e=n?i.filter(n,this):this,u=0;null!=(r=e[u]);u++)t||1!==r.nodeType||i.cleanData(f(r)),r.parentNode&&(t&&i.contains(r.ownerDocument,r)&&li(f(r,"script")),r.parentNode.removeChild(r));return this},empty:function(){for(var n,t=0;null!=(n=this[t]);t++){for(1===n.nodeType&&i.cleanData(f(n,!1));n.firstChild;)n.removeChild(n.firstChild);n.options&&i.nodeName(n,"select")&&(n.options.length=0)}return this},clone:function(n,t){return n=null==n?!1:n,t=null==t?n:t,this.map(function(){return i.clone(this,n,t)})},html:function(n){return b(this,function(n){var t=this[0]||{},u=0,e=this.length;if(void 0===n)return 1===t.nodeType?t.innerHTML.replace(he,""):void 0;if(!("string"!=typeof n||le.test(n)||!r.htmlSerialize&&tu.test(n)||!r.leadingWhitespace&&hi.test(n)||s[(ru.exec(n)||["",""])[1].toLowerCase()])){n=n.replace(iu,"<$1><\/$2>");try{for(;e>u;u++)t=this[u]||{},1===t.nodeType&&(i.cleanData(f(t,!1)),t.innerHTML=n);t=0}catch(o){}}t&&this.empty().append(n)},null,n,arguments.length)},replaceWith:function(){var n=arguments[0];return this.domManip(arguments,function(t){n=this.parentNode;i.cleanData(f(this));n&&n.replaceChild(t,this)}),n&&(n.length||n.nodeType)?this:this.remove()},detach:function(n){return this.remove(n,!0)},domManip:function(n,t){n=ir.apply([],n);var h,u,c,o,v,s,e=0,l=this.length,p=this,w=l-1,a=n[0],y=i.isFunction(a);if(y||l>1&&"string"==typeof a&&!r.checkClone&&ae.test(a))return this.each(function(i){var r=p.eq(i);y&&(n[0]=a.call(this,i,r.html()));r.domManip(n,t)});if(l&&(s=i.buildFragment(n,this[0].ownerDocument,!1,this),h=s.firstChild,1===s.childNodes.length&&(s=h),h)){for(o=i.map(f(s,"script"),ou),c=o.length;l>e;e++)u=s,e!==w&&(u=i.clone(u,!0,!0),c&&i.merge(o,f(u,"script"))),t.call(this[e],u,e);if(c)for(v=o[o.length-1].ownerDocument,i.map(o,su),e=0;c>e;e++)u=o[e],fu.test(u.type||"")&&!i._data(u,"globalEval")&&i.contains(v,u)&&(u.src?i._evalUrl&&i._evalUrl(u.src):i.globalEval((u.text||u.textContent||u.innerHTML||"").replace(ye,"")));s=h=null}return this}});i.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(n,t){i.fn[n]=function(n){for(var u,r=0,f=[],e=i(n),o=e.length-1;o>=r;r++)u=r===o?this:this.clone(!0),i(e[r])[t](u),ii.apply(f,u.get());return this.pushStack(f)}});ai={};!function(){var n;r.shrinkWrapBlocks=function(){if(null!=n)return n;n=!1;var t,i,r;return i=u.getElementsByTagName("body")[0],i&&i.style?(t=u.createElement("div"),r=u.createElement("div"),r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",i.appendChild(r).appendChild(t),typeof t.style.zoom!==o&&(t.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",t.appendChild(u.createElement("div")).style.width="5px",n=3!==t.offsetWidth),i.removeChild(r),n):void 0}}();var lu=/^margin/,pt=new RegExp("^("+at+")(?!px)[a-z%]+$","i"),k,d,ke=/^(top|right|bottom|left)$/;n.getComputedStyle?(k=function(n){return n.ownerDocument.defaultView.getComputedStyle(n,null)},d=function(n,t,r){var e,o,s,u,f=n.style;return r=r||k(n),u=r?r.getPropertyValue(t)||r[t]:void 0,r&&(""!==u||i.contains(n.ownerDocument,n)||(u=i.style(n,t)),pt.test(u)&&lu.test(t)&&(e=f.width,o=f.minWidth,s=f.maxWidth,f.minWidth=f.maxWidth=f.width=u,u=r.width,f.width=e,f.minWidth=o,f.maxWidth=s)),void 0===u?u:u+""}):u.documentElement.currentStyle&&(k=function(n){return n.currentStyle},d=function(n,t,i){var o,f,e,r,u=n.style;return i=i||k(n),r=i?i[t]:void 0,null==r&&u&&u[t]&&(r=u[t]),pt.test(r)&&!ke.test(t)&&(o=u.left,f=n.runtimeStyle,e=f&&f.left,e&&(f.left=n.currentStyle.left),u.left="fontSize"===t?"1em":r,r=u.pixelLeft+"px",u.left=o,e&&(f.left=e)),void 0===r?r:r+""||"auto"});!function(){var f,t,l,o,s,e,h;if(f=u.createElement("div"),f.innerHTML="  <link/><table><\/table><a href='/a'>a<\/a><input type='checkbox'/>",l=f.getElementsByTagName("a")[0],t=l&&l.style){t.cssText="float:left;opacity:.5";r.opacity="0.5"===t.opacity;r.cssFloat=!!t.cssFloat;f.style.backgroundClip="content-box";f.cloneNode(!0).style.backgroundClip="";r.clearCloneStyle="content-box"===f.style.backgroundClip;r.boxSizing=""===t.boxSizing||""===t.MozBoxSizing||""===t.WebkitBoxSizing;i.extend(r,{reliableHiddenOffsets:function(){return null==e&&c(),e},boxSizingReliable:function(){return null==s&&c(),s},pixelPosition:function(){return null==o&&c(),o},reliableMarginRight:function(){return null==h&&c(),h}});function c(){var i,r,f,t;r=u.getElementsByTagName("body")[0];r&&r.style&&(i=u.createElement("div"),f=u.createElement("div"),f.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",r.appendChild(f).appendChild(i),i.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",o=s=!1,h=!0,n.getComputedStyle&&(o="1%"!==(n.getComputedStyle(i,null)||{}).top,s="4px"===(n.getComputedStyle(i,null)||{width:"4px"}).width,t=i.appendChild(u.createElement("div")),t.style.cssText=i.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",t.style.marginRight=t.style.width="0",i.style.width="1px",h=!parseFloat((n.getComputedStyle(t,null)||{}).marginRight)),i.innerHTML="<table><tr><td><\/td><td>t<\/td><\/tr><\/table>",t=i.getElementsByTagName("td"),t[0].style.cssText="margin:0;border:0;padding:0;display:none",e=0===t[0].offsetHeight,e&&(t[0].style.display="",t[1].style.display="none",e=0===t[0].offsetHeight),r.removeChild(f))}}}();i.swap=function(n,t,i,r){var f,u,e={};for(u in t)e[u]=n.style[u],n.style[u]=t[u];f=i.apply(n,r||[]);for(u in t)n.style[u]=e[u];return f};var vi=/alpha\([^)]*\)/i,de=/opacity\s*=\s*([^)]*)/,ge=/^(none|table(?!-c[ea]).+)/,no=new RegExp("^("+at+")(.*)$","i"),to=new RegExp("^([+-])=("+at+")","i"),io={position:"absolute",visibility:"hidden",display:"block"},vu={letterSpacing:"0",fontWeight:"400"},yu=["Webkit","O","Moz","ms"];i.extend({cssHooks:{opacity:{get:function(n,t){if(t){var i=d(n,"opacity");return""===i?"1":i}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:r.cssFloat?"cssFloat":"styleFloat"},style:function(n,t,u,f){if(n&&3!==n.nodeType&&8!==n.nodeType&&n.style){var o,h,e,s=i.camelCase(t),c=n.style;if(t=i.cssProps[s]||(i.cssProps[s]=pu(c,s)),e=i.cssHooks[t]||i.cssHooks[s],void 0===u)return e&&"get"in e&&void 0!==(o=e.get(n,!1,f))?o:c[t];if(h=typeof u,"string"===h&&(o=to.exec(u))&&(u=(o[1]+1)*o[2]+parseFloat(i.css(n,t)),h="number"),null!=u&&u===u&&("number"!==h||i.cssNumber[s]||(u+="px"),r.clearCloneStyle||""!==u||0!==t.indexOf("background")||(c[t]="inherit"),!(e&&"set"in e&&void 0===(u=e.set(n,u,f)))))try{c[t]=u}catch(l){}}},css:function(n,t,r,u){var s,f,e,o=i.camelCase(t);return t=i.cssProps[o]||(i.cssProps[o]=pu(n.style,o)),e=i.cssHooks[t]||i.cssHooks[o],e&&"get"in e&&(f=e.get(n,!0,r)),void 0===f&&(f=d(n,t,u)),"normal"===f&&t in vu&&(f=vu[t]),""===r||r?(s=parseFloat(f),r===!0||i.isNumeric(s)?s||0:f):f}});i.each(["height","width"],function(n,t){i.cssHooks[t]={get:function(n,r,u){if(r)return ge.test(i.css(n,"display"))&&0===n.offsetWidth?i.swap(n,io,function(){return du(n,t,u)}):du(n,t,u)},set:function(n,u,f){var e=f&&k(n);return bu(n,u,f?ku(n,t,f,r.boxSizing&&"border-box"===i.css(n,"boxSizing",!1,e),e):0)}}});r.opacity||(i.cssHooks.opacity={get:function(n,t){return de.test((t&&n.currentStyle?n.currentStyle.filter:n.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(n,t){var r=n.style,u=n.currentStyle,e=i.isNumeric(t)?"alpha(opacity="+100*t+")":"",f=u&&u.filter||r.filter||"";r.zoom=1;(t>=1||""===t)&&""===i.trim(f.replace(vi,""))&&r.removeAttribute&&(r.removeAttribute("filter"),""===t||u&&!u.filter)||(r.filter=vi.test(f)?f.replace(vi,e):f+" "+e)}});i.cssHooks.marginRight=au(r.reliableMarginRight,function(n,t){if(t)return i.swap(n,{display:"inline-block"},d,[n,"marginRight"])});i.each({margin:"",padding:"",border:"Width"},function(n,t){i.cssHooks[n+t]={expand:function(i){for(var r=0,f={},u="string"==typeof i?i.split(" "):[i];4>r;r++)f[n+w[r]+t]=u[r]||u[r-2]||u[0];return f}};lu.test(n)||(i.cssHooks[n+t].set=bu)});i.fn.extend({css:function(n,t){return b(this,function(n,t,r){var f,e,o={},u=0;if(i.isArray(t)){for(f=k(n),e=t.length;e>u;u++)o[t[u]]=i.css(n,t[u],!1,f);return o}return void 0!==r?i.style(n,t,r):i.css(n,t)},n,t,arguments.length>1)},show:function(){return wu(this,!0)},hide:function(){return wu(this)},toggle:function(n){return"boolean"==typeof n?n?this.show():this.hide():this.each(function(){et(this)?i(this).show():i(this).hide()})}});i.Tween=e;e.prototype={constructor:e,init:function(n,t,r,u,f,e){this.elem=n;this.prop=r;this.easing=f||"swing";this.options=t;this.start=this.now=this.cur();this.end=u;this.unit=e||(i.cssNumber[r]?"":"px")},cur:function(){var n=e.propHooks[this.prop];return n&&n.get?n.get(this):e.propHooks._default.get(this)},run:function(n){var r,t=e.propHooks[this.prop];return this.pos=r=this.options.duration?i.easing[this.easing](n,this.options.duration*n,0,1,this.options.duration):n,this.now=(this.end-this.start)*r+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),t&&t.set?t.set(this):e.propHooks._default.set(this),this}};e.prototype.init.prototype=e.prototype;e.propHooks={_default:{get:function(n){var t;return null==n.elem[n.prop]||n.elem.style&&null!=n.elem.style[n.prop]?(t=i.css(n.elem,n.prop,""),t&&"auto"!==t?t:0):n.elem[n.prop]},set:function(n){i.fx.step[n.prop]?i.fx.step[n.prop](n):n.elem.style&&(null!=n.elem.style[i.cssProps[n.prop]]||i.cssHooks[n.prop])?i.style(n.elem,n.prop,n.now+n.unit):n.elem[n.prop]=n.now}}};e.propHooks.scrollTop=e.propHooks.scrollLeft={set:function(n){n.elem.nodeType&&n.elem.parentNode&&(n.elem[n.prop]=n.now)}};i.easing={linear:function(n){return n},swing:function(n){return.5-Math.cos(n*Math.PI)/2}};i.fx=e.prototype.init;i.fx.step={};var rt,wt,ro=/^(?:toggle|show|hide)$/,gu=new RegExp("^(?:([+-])=|)("+at+")([a-z%]*)$","i"),uo=/queueHooks$/,bt=[fo],st={"*":[function(n,t){var f=this.createTween(n,t),s=f.cur(),r=gu.exec(t),e=r&&r[3]||(i.cssNumber[n]?"":"px"),u=(i.cssNumber[n]||"px"!==e&&+s)&&gu.exec(i.css(f.elem,n)),o=1,h=20;if(u&&u[3]!==e){e=e||u[3];r=r||[];u=+s||1;do o=o||".5",u/=o,i.style(f.elem,n,u+e);while(o!==(o=f.cur()/s)&&1!==o&&--h)}return r&&(u=f.start=+u||+s||0,f.unit=e,f.end=r[1]?u+(r[1]+1)*r[2]:+r[2]),f}]};i.Animation=i.extend(rf,{tweener:function(n,t){i.isFunction(n)?(t=n,n=["*"]):n=n.split(" ");for(var r,u=0,f=n.length;f>u;u++)r=n[u],st[r]=st[r]||[],st[r].unshift(t)},prefilter:function(n,t){t?bt.unshift(n):bt.push(n)}});i.speed=function(n,t,r){var u=n&&"object"==typeof n?i.extend({},n):{complete:r||!r&&t||i.isFunction(n)&&n,duration:n,easing:r&&t||t&&!i.isFunction(t)&&t};return u.duration=i.fx.off?0:"number"==typeof u.duration?u.duration:u.duration in i.fx.speeds?i.fx.speeds[u.duration]:i.fx.speeds._default,(null==u.queue||u.queue===!0)&&(u.queue="fx"),u.old=u.complete,u.complete=function(){i.isFunction(u.old)&&u.old.call(this);u.queue&&i.dequeue(this,u.queue)},u};i.fn.extend({fadeTo:function(n,t,i,r){return this.filter(et).css("opacity",0).show().end().animate({opacity:t},n,i,r)},animate:function(n,t,r,u){var o=i.isEmptyObject(n),e=i.speed(t,r,u),f=function(){var t=rf(this,i.extend({},n),e);(o||i._data(this,"finish"))&&t.stop(!0)};return f.finish=f,o||e.queue===!1?this.each(f):this.queue(e.queue,f)},stop:function(n,t,r){var u=function(n){var t=n.stop;delete n.stop;t(r)};return"string"!=typeof n&&(r=t,t=n,n=void 0),t&&n!==!1&&this.queue(n||"fx",[]),this.each(function(){var o=!0,t=null!=n&&n+"queueHooks",e=i.timers,f=i._data(this);if(t)f[t]&&f[t].stop&&u(f[t]);else for(t in f)f[t]&&f[t].stop&&uo.test(t)&&u(f[t]);for(t=e.length;t--;)e[t].elem!==this||null!=n&&e[t].queue!==n||(e[t].anim.stop(r),o=!1,e.splice(t,1));(o||!r)&&i.dequeue(this,n)})},finish:function(n){return n!==!1&&(n=n||"fx"),this.each(function(){var t,f=i._data(this),r=f[n+"queue"],e=f[n+"queueHooks"],u=i.timers,o=r?r.length:0;for(f.finish=!0,i.queue(this,n,[]),e&&e.stop&&e.stop.call(this,!0),t=u.length;t--;)u[t].elem===this&&u[t].queue===n&&(u[t].anim.stop(!0),u.splice(t,1));for(t=0;o>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete f.finish})}});i.each(["toggle","show","hide"],function(n,t){var r=i.fn[t];i.fn[t]=function(n,i,u){return null==n||"boolean"==typeof n?r.apply(this,arguments):this.animate(kt(t,!0),n,i,u)}});i.each({slideDown:kt("show"),slideUp:kt("hide"),slideToggle:kt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(n,t){i.fn[n]=function(n,i,r){return this.animate(t,n,i,r)}});i.timers=[];i.fx.tick=function(){var r,n=i.timers,t=0;for(rt=i.now();t<n.length;t++)r=n[t],r()||n[t]!==r||n.splice(t--,1);n.length||i.fx.stop();rt=void 0};i.fx.timer=function(n){i.timers.push(n);n()?i.fx.start():i.timers.pop()};i.fx.interval=13;i.fx.start=function(){wt||(wt=setInterval(i.fx.tick,i.fx.interval))};i.fx.stop=function(){clearInterval(wt);wt=null};i.fx.speeds={slow:600,fast:200,_default:400};i.fn.delay=function(n,t){return n=i.fx?i.fx.speeds[n]||n:n,t=t||"fx",this.queue(t,function(t,i){var r=setTimeout(t,n);i.stop=function(){clearTimeout(r)}})},function(){var n,t,f,i,e;t=u.createElement("div");t.setAttribute("className","t");t.innerHTML="  <link/><table><\/table><a href='/a'>a<\/a><input type='checkbox'/>";i=t.getElementsByTagName("a")[0];f=u.createElement("select");e=f.appendChild(u.createElement("option"));n=t.getElementsByTagName("input")[0];i.style.cssText="top:1px";r.getSetAttribute="t"!==t.className;r.style=/top/.test(i.getAttribute("style"));r.hrefNormalized="/a"===i.getAttribute("href");r.checkOn=!!n.value;r.optSelected=e.selected;r.enctype=!!u.createElement("form").enctype;f.disabled=!0;r.optDisabled=!e.disabled;n=u.createElement("input");n.setAttribute("value","");r.input=""===n.getAttribute("value");n.value="t";n.setAttribute("type","radio");r.radioValue="t"===n.value}();uf=/\r/g;i.fn.extend({val:function(n){var t,r,f,u=this[0];return arguments.length?(f=i.isFunction(n),this.each(function(r){var u;1===this.nodeType&&(u=f?n.call(this,r,i(this).val()):n,null==u?u="":"number"==typeof u?u+="":i.isArray(u)&&(u=i.map(u,function(n){return null==n?"":n+""})),t=i.valHooks[this.type]||i.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,u,"value")||(this.value=u))})):u?(t=i.valHooks[u.type]||i.valHooks[u.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(r=t.get(u,"value"))?r:(r=u.value,"string"==typeof r?r.replace(uf,""):null==r?"":r)):void 0}});i.extend({valHooks:{option:{get:function(n){var t=i.find.attr(n,"value");return null!=t?t:i.trim(i.text(n))}},select:{get:function(n){for(var o,t,s=n.options,u=n.selectedIndex,f="select-one"===n.type||0>u,h=f?null:[],c=f?u+1:s.length,e=0>u?c:f?u:0;c>e;e++)if(t=s[e],!(!t.selected&&e!==u||(r.optDisabled?t.disabled:null!==t.getAttribute("disabled"))||t.parentNode.disabled&&i.nodeName(t.parentNode,"optgroup"))){if(o=i(t).val(),f)return o;h.push(o)}return h},set:function(n,t){for(var f,r,u=n.options,o=i.makeArray(t),e=u.length;e--;)if(r=u[e],i.inArray(i.valHooks.option.get(r),o)>=0)try{r.selected=f=!0}catch(s){r.scrollHeight}else r.selected=!1;return f||(n.selectedIndex=-1),u}}}});i.each(["radio","checkbox"],function(){i.valHooks[this]={set:function(n,t){if(i.isArray(t))return n.checked=i.inArray(i(n).val(),t)>=0}};r.checkOn||(i.valHooks[this].get=function(n){return null===n.getAttribute("value")?"on":n.value})});var ut,ff,v=i.expr.attrHandle,yi=/^(?:checked|selected)$/i,g=r.getSetAttribute,dt=r.input;i.fn.extend({attr:function(n,t){return b(this,i.attr,n,t,arguments.length>1)},removeAttr:function(n){return this.each(function(){i.removeAttr(this,n)})}});i.extend({attr:function(n,t,r){var u,f,e=n.nodeType;if(n&&3!==e&&8!==e&&2!==e)return typeof n.getAttribute===o?i.prop(n,t,r):(1===e&&i.isXMLDoc(n)||(t=t.toLowerCase(),u=i.attrHooks[t]||(i.expr.match.bool.test(t)?ff:ut)),void 0===r?u&&"get"in u&&null!==(f=u.get(n,t))?f:(f=i.find.attr(n,t),null==f?void 0:f):null!==r?u&&"set"in u&&void 0!==(f=u.set(n,r,t))?f:(n.setAttribute(t,r+""),r):void i.removeAttr(n,t))},removeAttr:function(n,t){var r,u,e=0,f=t&&t.match(h);if(f&&1===n.nodeType)while(r=f[e++])u=i.propFix[r]||r,i.expr.match.bool.test(r)?dt&&g||!yi.test(r)?n[u]=!1:n[i.camelCase("default-"+r)]=n[u]=!1:i.attr(n,r,""),n.removeAttribute(g?r:u)},attrHooks:{type:{set:function(n,t){if(!r.radioValue&&"radio"===t&&i.nodeName(n,"input")){var u=n.value;return n.setAttribute("type",t),u&&(n.value=u),t}}}}});ff={set:function(n,t,r){return t===!1?i.removeAttr(n,r):dt&&g||!yi.test(r)?n.setAttribute(!g&&i.propFix[r]||r,r):n[i.camelCase("default-"+r)]=n[r]=!0,r}};i.each(i.expr.match.bool.source.match(/\w+/g),function(n,t){var r=v[t]||i.find.attr;v[t]=dt&&g||!yi.test(t)?function(n,t,i){var u,f;return i||(f=v[t],v[t]=u,u=null!=r(n,t,i)?t.toLowerCase():null,v[t]=f),u}:function(n,t,r){if(!r)return n[i.camelCase("default-"+t)]?t.toLowerCase():null}});dt&&g||(i.attrHooks.value={set:function(n,t,r){return i.nodeName(n,"input")?void(n.defaultValue=t):ut&&ut.set(n,t,r)}});g||(ut={set:function(n,t,i){var r=n.getAttributeNode(i);return r||n.setAttributeNode(r=n.ownerDocument.createAttribute(i)),r.value=t+="","value"===i||t===n.getAttribute(i)?t:void 0}},v.id=v.name=v.coords=function(n,t,i){var r;if(!i)return(r=n.getAttributeNode(t))&&""!==r.value?r.value:null},i.valHooks.button={get:function(n,t){var i=n.getAttributeNode(t);if(i&&i.specified)return i.value},set:ut.set},i.attrHooks.contenteditable={set:function(n,t,i){ut.set(n,""===t?!1:t,i)}},i.each(["width","height"],function(n,t){i.attrHooks[t]={set:function(n,i){if(""===i)return(n.setAttribute(t,"auto"),i)}}}));r.style||(i.attrHooks.style={get:function(n){return n.style.cssText||void 0},set:function(n,t){return n.style.cssText=t+""}});ef=/^(?:input|select|textarea|button|object)$/i;of=/^(?:a|area)$/i;i.fn.extend({prop:function(n,t){return b(this,i.prop,n,t,arguments.length>1)},removeProp:function(n){return n=i.propFix[n]||n,this.each(function(){try{this[n]=void 0;delete this[n]}catch(t){}})}});i.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(n,t,r){var f,u,o,e=n.nodeType;if(n&&3!==e&&8!==e&&2!==e)return o=1!==e||!i.isXMLDoc(n),o&&(t=i.propFix[t]||t,u=i.propHooks[t]),void 0!==r?u&&"set"in u&&void 0!==(f=u.set(n,r,t))?f:n[t]=r:u&&"get"in u&&null!==(f=u.get(n,t))?f:n[t]},propHooks:{tabIndex:{get:function(n){var t=i.find.attr(n,"tabindex");return t?parseInt(t,10):ef.test(n.nodeName)||of.test(n.nodeName)&&n.href?0:-1}}}});r.hrefNormalized||i.each(["href","src"],function(n,t){i.propHooks[t]={get:function(n){return n.getAttribute(t,4)}}});r.optSelected||(i.propHooks.selected={get:function(n){var t=n.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}});i.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){i.propFix[this.toLowerCase()]=this});r.enctype||(i.propFix.enctype="encoding");gt=/[\t\r\n\f]/g;i.fn.extend({addClass:function(n){var o,t,r,u,s,f,e=0,c=this.length,l="string"==typeof n&&n;if(i.isFunction(n))return this.each(function(t){i(this).addClass(n.call(this,t,this.className))});if(l)for(o=(n||"").match(h)||[];c>e;e++)if(t=this[e],r=1===t.nodeType&&(t.className?(" "+t.className+" ").replace(gt," "):" ")){for(s=0;u=o[s++];)r.indexOf(" "+u+" ")<0&&(r+=u+" ");f=i.trim(r);t.className!==f&&(t.className=f)}return this},removeClass:function(n){var o,t,r,u,s,f,e=0,c=this.length,l=0===arguments.length||"string"==typeof n&&n;if(i.isFunction(n))return this.each(function(t){i(this).removeClass(n.call(this,t,this.className))});if(l)for(o=(n||"").match(h)||[];c>e;e++)if(t=this[e],r=1===t.nodeType&&(t.className?(" "+t.className+" ").replace(gt," "):"")){for(s=0;u=o[s++];)while(r.indexOf(" "+u+" ")>=0)r=r.replace(" "+u+" "," ");f=n?i.trim(r):"";t.className!==f&&(t.className=f)}return this},toggleClass:function(n,t){var r=typeof n;return"boolean"==typeof t&&"string"===r?t?this.addClass(n):this.removeClass(n):this.each(i.isFunction(n)?function(r){i(this).toggleClass(n.call(this,r,this.className,t),t)}:function(){if("string"===r)for(var t,f=0,u=i(this),e=n.match(h)||[];t=e[f++];)u.hasClass(t)?u.removeClass(t):u.addClass(t);else(r===o||"boolean"===r)&&(this.className&&i._data(this,"__className__",this.className),this.className=this.className||n===!1?"":i._data(this,"__className__")||"")})},hasClass:function(n){for(var i=" "+n+" ",t=0,r=this.length;r>t;t++)if(1===this[t].nodeType&&(" "+this[t].className+" ").replace(gt," ").indexOf(i)>=0)return!0;return!1}});i.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(n,t){i.fn[t]=function(n,i){return arguments.length>0?this.on(t,null,n,i):this.trigger(t)}});i.fn.extend({hover:function(n,t){return this.mouseenter(n).mouseleave(t||n)},bind:function(n,t,i){return this.on(n,null,t,i)},unbind:function(n,t){return this.off(n,null,t)},delegate:function(n,t,i,r){return this.on(t,n,i,r)},undelegate:function(n,t,i){return 1===arguments.length?this.off(n,"**"):this.off(t,n||"**",i)}});var pi=i.now(),wi=/\?/,oo=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;i.parseJSON=function(t){if(n.JSON&&n.JSON.parse)return n.JSON.parse(t+"");var f,r=null,u=i.trim(t+"");return u&&!i.trim(u.replace(oo,function(n,t,i,u){return f&&t&&(r=0),0===r?n:(f=i||t,r+=!u-!i,"")}))?Function("return "+u)():i.error("Invalid JSON: "+t)};i.parseXML=function(t){var r,u;if(!t||"string"!=typeof t)return null;try{n.DOMParser?(u=new DOMParser,r=u.parseFromString(t,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(t))}catch(f){r=void 0}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||i.error("Invalid XML: "+t),r};var nt,y,so=/#.*$/,sf=/([?&])_=[^&]*/,ho=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,co=/^(?:GET|HEAD)$/,lo=/^\/\//,hf=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,cf={},bi={},lf="*/".concat("*");try{y=location.href}catch(ns){y=u.createElement("a");y.href="";y=y.href}nt=hf.exec(y.toLowerCase())||[];i.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:y,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(nt[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":lf,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":i.parseJSON,"text xml":i.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(n,t){return t?ki(ki(n,i.ajaxSettings),t):ki(i.ajaxSettings,n)},ajaxPrefilter:af(cf),ajaxTransport:af(bi),ajax:function(n,t){function w(n,t,s,h){var v,it,nt,y,w,c=t;2!==e&&(e=2,k&&clearTimeout(k),a=void 0,b=h||"",u.readyState=n>0?4:0,v=n>=200&&300>n||304===n,s&&(y=ao(r,u,s)),y=vo(r,y,u,v),v?(r.ifModified&&(w=u.getResponseHeader("Last-Modified"),w&&(i.lastModified[f]=w),w=u.getResponseHeader("etag"),w&&(i.etag[f]=w)),204===n||"HEAD"===r.type?c="nocontent":304===n?c="notmodified":(c=y.state,it=y.data,nt=y.error,v=!nt)):(nt=c,(n||!c)&&(c="error",0>n&&(n=0))),u.status=n,u.statusText=(t||c)+"",v?g.resolveWith(o,[it,c,u]):g.rejectWith(o,[u,c,nt]),u.statusCode(p),p=void 0,l&&d.trigger(v?"ajaxSuccess":"ajaxError",[u,r,v?it:nt]),tt.fireWith(o,[u,c]),l&&(d.trigger("ajaxComplete",[u,r]),--i.active||i.event.trigger("ajaxStop")))}"object"==typeof n&&(t=n,n=void 0);t=t||{};var s,c,f,b,k,l,a,v,r=i.ajaxSetup({},t),o=r.context||r,d=r.context&&(o.nodeType||o.jquery)?i(o):i.event,g=i.Deferred(),tt=i.Callbacks("once memory"),p=r.statusCode||{},it={},rt={},e=0,ut="canceled",u={readyState:0,getResponseHeader:function(n){var t;if(2===e){if(!v)for(v={};t=ho.exec(b);)v[t[1].toLowerCase()]=t[2];t=v[n.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===e?b:null},setRequestHeader:function(n,t){var i=n.toLowerCase();return e||(n=rt[i]=rt[i]||n,it[n]=t),this},overrideMimeType:function(n){return e||(r.mimeType=n),this},statusCode:function(n){var t;if(n)if(2>e)for(t in n)p[t]=[p[t],n[t]];else u.always(n[u.status]);return this},abort:function(n){var t=n||ut;return a&&a.abort(t),w(0,t),this}};if(g.promise(u).complete=tt.add,u.success=u.done,u.error=u.fail,r.url=((n||r.url||y)+"").replace(so,"").replace(lo,nt[1]+"//"),r.type=t.method||t.type||r.method||r.type,r.dataTypes=i.trim(r.dataType||"*").toLowerCase().match(h)||[""],null==r.crossDomain&&(s=hf.exec(r.url.toLowerCase()),r.crossDomain=!(!s||s[1]===nt[1]&&s[2]===nt[2]&&(s[3]||("http:"===s[1]?"80":"443"))===(nt[3]||("http:"===nt[1]?"80":"443")))),r.data&&r.processData&&"string"!=typeof r.data&&(r.data=i.param(r.data,r.traditional)),vf(cf,r,t,u),2===e)return u;l=r.global;l&&0==i.active++&&i.event.trigger("ajaxStart");r.type=r.type.toUpperCase();r.hasContent=!co.test(r.type);f=r.url;r.hasContent||(r.data&&(f=r.url+=(wi.test(f)?"&":"?")+r.data,delete r.data),r.cache===!1&&(r.url=sf.test(f)?f.replace(sf,"$1_="+pi++):f+(wi.test(f)?"&":"?")+"_="+pi++));r.ifModified&&(i.lastModified[f]&&u.setRequestHeader("If-Modified-Since",i.lastModified[f]),i.etag[f]&&u.setRequestHeader("If-None-Match",i.etag[f]));(r.data&&r.hasContent&&r.contentType!==!1||t.contentType)&&u.setRequestHeader("Content-Type",r.contentType);u.setRequestHeader("Accept",r.dataTypes[0]&&r.accepts[r.dataTypes[0]]?r.accepts[r.dataTypes[0]]+("*"!==r.dataTypes[0]?", "+lf+"; q=0.01":""):r.accepts["*"]);for(c in r.headers)u.setRequestHeader(c,r.headers[c]);if(r.beforeSend&&(r.beforeSend.call(o,u,r)===!1||2===e))return u.abort();ut="abort";for(c in{success:1,error:1,complete:1})u[c](r[c]);if(a=vf(bi,r,t,u)){u.readyState=1;l&&d.trigger("ajaxSend",[u,r]);r.async&&r.timeout>0&&(k=setTimeout(function(){u.abort("timeout")},r.timeout));try{e=1;a.send(it,w)}catch(ft){if(!(2>e))throw ft;w(-1,ft)}}else w(-1,"No Transport");return u},getJSON:function(n,t,r){return i.get(n,t,r,"json")},getScript:function(n,t){return i.get(n,void 0,t,"script")}});i.each(["get","post"],function(n,t){i[t]=function(n,r,u,f){return i.isFunction(r)&&(f=f||u,u=r,r=void 0),i.ajax({url:n,type:t,dataType:f,data:r,success:u})}});i.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(n,t){i.fn[t]=function(n){return this.on(t,n)}});i._evalUrl=function(n){return i.ajax({url:n,type:"GET",dataType:"script",async:!1,global:!1,throws:!0})};i.fn.extend({wrapAll:function(n){if(i.isFunction(n))return this.each(function(t){i(this).wrapAll(n.call(this,t))});if(this[0]){var t=i(n,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]);t.map(function(){for(var n=this;n.firstChild&&1===n.firstChild.nodeType;)n=n.firstChild;return n}).append(this)}return this},wrapInner:function(n){return this.each(i.isFunction(n)?function(t){i(this).wrapInner(n.call(this,t))}:function(){var t=i(this),r=t.contents();r.length?r.wrapAll(n):t.append(n)})},wrap:function(n){var t=i.isFunction(n);return this.each(function(r){i(this).wrapAll(t?n.call(this,r):n)})},unwrap:function(){return this.parent().each(function(){i.nodeName(this,"body")||i(this).replaceWith(this.childNodes)}).end()}});i.expr.filters.hidden=function(n){return n.offsetWidth<=0&&n.offsetHeight<=0||!r.reliableHiddenOffsets()&&"none"===(n.style&&n.style.display||i.css(n,"display"))};i.expr.filters.visible=function(n){return!i.expr.filters.hidden(n)};var yo=/%20/g,po=/\[\]$/,yf=/\r?\n/g,wo=/^(?:submit|button|image|reset|file)$/i,bo=/^(?:input|select|textarea|keygen)/i;i.param=function(n,t){var r,u=[],f=function(n,t){t=i.isFunction(t)?t():null==t?"":t;u[u.length]=encodeURIComponent(n)+"="+encodeURIComponent(t)};if(void 0===t&&(t=i.ajaxSettings&&i.ajaxSettings.traditional),i.isArray(n)||n.jquery&&!i.isPlainObject(n))i.each(n,function(){f(this.name,this.value)});else for(r in n)di(r,n[r],t,f);return u.join("&").replace(yo,"+")};i.fn.extend({serialize:function(){return i.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var n=i.prop(this,"elements");return n?i.makeArray(n):this}).filter(function(){var n=this.type;return this.name&&!i(this).is(":disabled")&&bo.test(this.nodeName)&&!wo.test(n)&&(this.checked||!oi.test(n))}).map(function(n,t){var r=i(this).val();return null==r?null:i.isArray(r)?i.map(r,function(n){return{name:t.name,value:n.replace(yf,"\r\n")}}):{name:t.name,value:r.replace(yf,"\r\n")}}).get()}});i.ajaxSettings.xhr=void 0!==n.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&pf()||go()}:pf;var ko=0,ni={},ht=i.ajaxSettings.xhr();return n.ActiveXObject&&i(n).on("unload",function(){for(var n in ni)ni[n](void 0,!0)}),r.cors=!!ht&&"withCredentials"in ht,ht=r.ajax=!!ht,ht&&i.ajaxTransport(function(n){if(!n.crossDomain||r.cors){var t;return{send:function(r,u){var e,f=n.xhr(),o=++ko;if(f.open(n.type,n.url,n.async,n.username,n.password),n.xhrFields)for(e in n.xhrFields)f[e]=n.xhrFields[e];n.mimeType&&f.overrideMimeType&&f.overrideMimeType(n.mimeType);n.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest");for(e in r)void 0!==r[e]&&f.setRequestHeader(e,r[e]+"");f.send(n.hasContent&&n.data||null);t=function(r,e){var s,c,h;if(t&&(e||4===f.readyState))if(delete ni[o],t=void 0,f.onreadystatechange=i.noop,e)4!==f.readyState&&f.abort();else{h={};s=f.status;"string"==typeof f.responseText&&(h.text=f.responseText);try{c=f.statusText}catch(l){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=h.text?200:404}h&&u(s,c,h,f.getAllResponseHeaders())};n.async?4===f.readyState?setTimeout(t):f.onreadystatechange=ni[o]=t:t()},abort:function(){t&&t(void 0,!0)}}}}),i.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(n){return i.globalEval(n),n}}}),i.ajaxPrefilter("script",function(n){void 0===n.cache&&(n.cache=!1);n.crossDomain&&(n.type="GET",n.global=!1)}),i.ajaxTransport("script",function(n){if(n.crossDomain){var t,r=u.head||i("head")[0]||u.documentElement;return{send:function(i,f){t=u.createElement("script");t.async=!0;n.scriptCharset&&(t.charset=n.scriptCharset);t.src=n.url;t.onload=t.onreadystatechange=function(n,i){(i||!t.readyState||/loaded|complete/.test(t.readyState))&&(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),t=null,i||f(200,"success"))};r.insertBefore(t,r.firstChild)},abort:function(){t&&t.onload(void 0,!0)}}}}),gi=[],ti=/(=)\?(?=&|$)|\?\?/,i.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var n=gi.pop()||i.expando+"_"+pi++;return this[n]=!0,n}}),i.ajaxPrefilter("json jsonp",function(t,r,u){var f,o,e,s=t.jsonp!==!1&&(ti.test(t.url)?"url":"string"==typeof t.data&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&ti.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return(f=t.jsonpCallback=i.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(ti,"$1"+f):t.jsonp!==!1&&(t.url+=(wi.test(t.url)?"&":"?")+t.jsonp+"="+f),t.converters["script json"]=function(){return e||i.error(f+" was not called"),e[0]},t.dataTypes[0]="json",o=n[f],n[f]=function(){e=arguments},u.always(function(){n[f]=o;t[f]&&(t.jsonpCallback=r.jsonpCallback,gi.push(f));e&&i.isFunction(o)&&o(e[0]);e=o=void 0}),"script")}),i.parseHTML=function(n,t,r){if(!n||"string"!=typeof n)return null;"boolean"==typeof t&&(r=t,t=!1);t=t||u;var f=er.exec(n),e=!r&&[];return f?[t.createElement(f[1])]:(f=i.buildFragment([n],t,e),e&&e.length&&i(e).remove(),i.merge([],f.childNodes))},nr=i.fn.load,i.fn.load=function(n,t,r){if("string"!=typeof n&&nr)return nr.apply(this,arguments);var u,o,s,f=this,e=n.indexOf(" ");return e>=0&&(u=i.trim(n.slice(e,n.length)),n=n.slice(0,e)),i.isFunction(t)?(r=t,t=void 0):t&&"object"==typeof t&&(s="POST"),f.length>0&&i.ajax({url:n,type:s,dataType:"html",data:t}).done(function(n){o=arguments;f.html(u?i("<div>").append(i.parseHTML(n)).find(u):n)}).complete(r&&function(n,t){f.each(r,o||[n.responseText,t,n])}),this},i.expr.filters.animated=function(n){return i.grep(i.timers,function(t){return n===t.elem}).length},tr=n.document.documentElement,i.offset={setOffset:function(n,t,r){var e,o,s,h,u,c,v,l=i.css(n,"position"),a=i(n),f={};"static"===l&&(n.style.position="relative");u=a.offset();s=i.css(n,"top");c=i.css(n,"left");v=("absolute"===l||"fixed"===l)&&i.inArray("auto",[s,c])>-1;v?(e=a.position(),h=e.top,o=e.left):(h=parseFloat(s)||0,o=parseFloat(c)||0);i.isFunction(t)&&(t=t.call(n,r,u));null!=t.top&&(f.top=t.top-u.top+h);null!=t.left&&(f.left=t.left-u.left+o);"using"in t?t.using.call(n,f):a.css(f)}},i.fn.extend({offset:function(n){if(arguments.length)return void 0===n?this:this.each(function(t){i.offset.setOffset(this,n,t)});var t,f,u={top:0,left:0},r=this[0],e=r&&r.ownerDocument;if(e)return t=e.documentElement,i.contains(t,r)?(typeof r.getBoundingClientRect!==o&&(u=r.getBoundingClientRect()),f=wf(e),{top:u.top+(f.pageYOffset||t.scrollTop)-(t.clientTop||0),left:u.left+(f.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}):u},position:function(){if(this[0]){var n,r,t={top:0,left:0},u=this[0];return"fixed"===i.css(u,"position")?r=u.getBoundingClientRect():(n=this.offsetParent(),r=this.offset(),i.nodeName(n[0],"html")||(t=n.offset()),t.top+=i.css(n[0],"borderTopWidth",!0),t.left+=i.css(n[0],"borderLeftWidth",!0)),{top:r.top-t.top-i.css(u,"marginTop",!0),left:r.left-t.left-i.css(u,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var n=this.offsetParent||tr;n&&!i.nodeName(n,"html")&&"static"===i.css(n,"position");)n=n.offsetParent;return n||tr})}}),i.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(n,t){var r=/Y/.test(t);i.fn[n]=function(u){return b(this,function(n,u,f){var e=wf(n);return void 0===f?e?t in e?e[t]:e.document.documentElement[u]:n[u]:void(e?e.scrollTo(r?i(e).scrollLeft():f,r?f:i(e).scrollTop()):n[u]=f)},n,u,arguments.length,null)}}),i.each(["top","left"],function(n,t){i.cssHooks[t]=au(r.pixelPosition,function(n,r){if(r)return(r=d(n,t),pt.test(r)?i(n).position()[t]+"px":r)})}),i.each({Height:"height",Width:"width"},function(n,t){i.each({padding:"inner"+n,content:t,"":"outer"+n},function(r,u){i.fn[u]=function(u,f){var e=arguments.length&&(r||"boolean"!=typeof u),o=r||(u===!0||f===!0?"margin":"border");return b(this,function(t,r,u){var f;return i.isWindow(t)?t.document.documentElement["client"+n]:9===t.nodeType?(f=t.documentElement,Math.max(t.body["scroll"+n],f["scroll"+n],t.body["offset"+n],f["offset"+n],f["client"+n])):void 0===u?i.css(t,r,o):i.style(t,r,u,o)},t,e?u:void 0,e,null)}})}),i.fn.size=function(){return this.length},i.fn.andSelf=i.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return i}),bf=n.jQuery,kf=n.$,i.noConflict=function(t){return n.$===i&&(n.$=kf),t&&n.jQuery===i&&(n.jQuery=bf),i},typeof t===o&&(n.jQuery=n.$=i),i}),function(){function nt(t){function r(n,i,r,u,f,e){for(;f>=0&&e>f;f+=t){var o=u?u[f]:f;r=i(r,n[o],o,n)}return r}return function(u,f,o,s){f=e(f,s,4);var h=!i(u)&&n.keys(u),l=(h||u).length,c=t>0?0:l-1;return arguments.length<3&&(o=u[h?h[c]:c],c+=t),r(u,f,o,h,c,l)}}function tt(n){return function(i,r,f){r=t(r,f);for(var o=u(i),e=n>0?0:o-1;e>=0&&o>e;e+=n)if(r(i[e],e,i))return e;return-1}}function it(t,i,f){return function(e,o,s){var c=0,h=u(e);if("number"==typeof s)t>0?c=s>=0?s:Math.max(s+h,c):h=s>=0?Math.min(s+1,h):s+h+1;else if(f&&s&&h)return s=f(e,o),e[s]===o?s:-1;if(o!==o)return s=i(r.call(e,c,h),n.isNaN),s>=0?s+c:-1;for(s=t>0?c:h-1;s>=0&&h>s;s+=t)if(e[s]===o)return s;return-1}}function rt(t,i){var u=d.length,f=t.constructor,e=n.isFunction(f)&&f.prototype||v,r="constructor";for(n.has(t,r)&&!n.contains(i,r)&&i.push(r);u--;)r=d[u],r in t&&t[r]!==e[r]&&!n.contains(i,r)&&i.push(r)}var a=this,lt=a._,s=Array.prototype,v=Object.prototype,at=Function.prototype,vt=s.push,r=s.slice,o=v.toString,yt=v.hasOwnProperty,pt=Array.isArray,ut=Object.keys,y=at.bind,ft=Object.create,p=function(){},n=function(t){return t instanceof n?t:this instanceof n?void(this._wrapped=t):new n(t)},e,t,h,f,b,k,d,c,ct,l;"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=n),exports._=n):a._=n;n.VERSION="1.8.3";e=function(n,t,i){if(t===void 0)return n;switch(null==i?3:i){case 1:return function(i){return n.call(t,i)};case 2:return function(i,r){return n.call(t,i,r)};case 3:return function(i,r,u){return n.call(t,i,r,u)};case 4:return function(i,r,u,f){return n.call(t,i,r,u,f)}}return function(){return n.apply(t,arguments)}};t=function(t,i,r){return null==t?n.identity:n.isFunction(t)?e(t,i,r):n.isObject(t)?n.matcher(t):n.property(t)};n.iteratee=function(n,i){return t(n,i,1/0)};var w=function(n,t){return function(i){var e=arguments.length,r,u;if(2>e||null==i)return i;for(r=1;e>r;r++)for(var o=arguments[r],s=n(o),h=s.length,f=0;h>f;f++)u=s[f],t&&i[u]!==void 0||(i[u]=o[u]);return i}},et=function(t){if(!n.isObject(t))return{};if(ft)return ft(t);p.prototype=t;var i=new p;return p.prototype=null,i},ot=function(n){return function(t){if(null!=t)return t[n]}},wt=Math.pow(2,53)-1,u=ot("length"),i=function(n){var t=u(n);return"number"==typeof t&&t>=0&&wt>=t};n.each=n.forEach=function(t,r,u){var f,o,s;if(r=e(r,u),i(t))for(f=0,o=t.length;o>f;f++)r(t[f],f,t);else for(s=n.keys(t),f=0,o=s.length;o>f;f++)r(t[s[f]],s[f],t);return t};n.map=n.collect=function(r,u,f){var s;u=t(u,f);for(var o=!i(r)&&n.keys(r),h=(o||r).length,c=Array(h),e=0;h>e;e++)s=o?o[e]:e,c[e]=u(r[s],s,r);return c};n.reduce=n.foldl=n.inject=nt(1);n.reduceRight=n.foldr=nt(-1);n.find=n.detect=function(t,r,u){var f;return f=i(t)?n.findIndex(t,r,u):n.findKey(t,r,u),f!==void 0&&f!==-1?t[f]:void 0};n.filter=n.select=function(i,r,u){var f=[];return r=t(r,u),n.each(i,function(n,t,i){r(n,t,i)&&f.push(n)}),f};n.reject=function(i,r,u){return n.filter(i,n.negate(t(r)),u)};n.every=n.all=function(r,u,f){var s;u=t(u,f);for(var o=!i(r)&&n.keys(r),h=(o||r).length,e=0;h>e;e++)if(s=o?o[e]:e,!u(r[s],s,r))return!1;return!0};n.some=n.any=function(r,u,f){var s;u=t(u,f);for(var o=!i(r)&&n.keys(r),h=(o||r).length,e=0;h>e;e++)if(s=o?o[e]:e,u(r[s],s,r))return!0;return!1};n.contains=n.includes=n.include=function(t,r,u,f){return i(t)||(t=n.values(t)),("number"!=typeof u||f)&&(u=0),n.indexOf(t,r,u)>=0};n.invoke=function(t,i){var u=r.call(arguments,2),f=n.isFunction(i);return n.map(t,function(n){var t=f?i:n[i];return null==t?t:t.apply(n,u)})};n.pluck=function(t,i){return n.map(t,n.property(i))};n.where=function(t,i){return n.filter(t,n.matcher(i))};n.findWhere=function(t,i){return n.find(t,n.matcher(i))};n.max=function(r,u,f){var h,o,e=-1/0,c=-1/0,s,l;if(null==u&&null!=r)for(r=i(r)?r:n.values(r),s=0,l=r.length;l>s;s++)h=r[s],h>e&&(e=h);else u=t(u,f),n.each(r,function(n,t,i){o=u(n,t,i);(o>c||o===-1/0&&e===-1/0)&&(e=n,c=o)});return e};n.min=function(r,u,f){var h,o,e=1/0,c=1/0,s,l;if(null==u&&null!=r)for(r=i(r)?r:n.values(r),s=0,l=r.length;l>s;s++)h=r[s],e>h&&(e=h);else u=t(u,f),n.each(r,function(n,t,i){o=u(n,t,i);(c>o||1/0===o&&1/0===e)&&(e=n,c=o)});return e};n.shuffle=function(t){for(var u,e=i(t)?t:n.values(t),o=e.length,f=Array(o),r=0;o>r;r++)u=n.random(0,r),u!==r&&(f[r]=f[u]),f[u]=e[r];return f};n.sample=function(t,r,u){return null==r||u?(i(t)||(t=n.values(t)),t[n.random(t.length-1)]):n.shuffle(t).slice(0,Math.max(0,r))};n.sortBy=function(i,r,u){return r=t(r,u),n.pluck(n.map(i,function(n,t,i){return{value:n,index:t,criteria:r(n,t,i)}}).sort(function(n,t){var i=n.criteria,r=t.criteria;if(i!==r){if(i>r||i===void 0)return 1;if(r>i||r===void 0)return-1}return n.index-t.index}),"value")};h=function(i){return function(r,u,f){var e={};return u=t(u,f),n.each(r,function(n,t){var f=u(n,t,r);i(e,n,f)}),e}};n.groupBy=h(function(t,i,r){n.has(t,r)?t[r].push(i):t[r]=[i]});n.indexBy=h(function(n,t,i){n[i]=t});n.countBy=h(function(t,i,r){n.has(t,r)?t[r]++:t[r]=1});n.toArray=function(t){return t?n.isArray(t)?r.call(t):i(t)?n.map(t,n.identity):n.values(t):[]};n.size=function(t){return null==t?0:i(t)?t.length:n.keys(t).length};n.partition=function(i,r,u){r=t(r,u);var f=[],e=[];return n.each(i,function(n,t,i){(r(n,t,i)?f:e).push(n)}),[f,e]};n.first=n.head=n.take=function(t,i,r){if(null!=t)return null==i||r?t[0]:n.initial(t,t.length-i)};n.initial=function(n,t,i){return r.call(n,0,Math.max(0,n.length-(null==t||i?1:t)))};n.last=function(t,i,r){if(null!=t)return null==i||r?t[t.length-1]:n.rest(t,Math.max(0,t.length-i))};n.rest=n.tail=n.drop=function(n,t,i){return r.call(n,null==t||i?1:t)};n.compact=function(t){return n.filter(t,n.identity)};f=function(t,r,e,o){for(var s,l,a,h=[],v=0,c=o||0,y=u(t);y>c;c++)if(s=t[c],i(s)&&(n.isArray(s)||n.isArguments(s)))for(r||(s=f(s,r,e)),l=0,a=s.length,h.length+=a;a>l;)h[v++]=s[l++];else e||(h[v++]=s);return h};n.flatten=function(n,t){return f(n,t,!1)};n.without=function(t){return n.difference(t,r.call(arguments,1))};n.uniq=n.unique=function(i,r,f,e){var o,c;n.isBoolean(r)||(e=f,f=r,r=!1);null!=f&&(f=t(f,e));for(var s=[],l=[],h=0,a=u(i);a>h;h++)o=i[h],c=f?f(o,h,i):o,r?(h&&l===c||s.push(o),l=c):f?n.contains(l,c)||(l.push(c),s.push(o)):n.contains(s,o)||s.push(o);return s};n.union=function(){return n.uniq(f(arguments,!0,!0))};n.intersection=function(t){for(var r,i,f=[],o=arguments.length,e=0,s=u(t);s>e;e++)if(r=t[e],!n.contains(f,r)){for(i=1;o>i&&n.contains(arguments[i],r);i++);i===o&&f.push(r)}return f};n.difference=function(t){var i=f(arguments,!0,!0,1);return n.filter(t,function(t){return!n.contains(i,t)})};n.zip=function(){return n.unzip(arguments)};n.unzip=function(t){for(var r=t&&n.max(t,u).length||0,f=Array(r),i=0;r>i;i++)f[i]=n.pluck(t,i);return f};n.object=function(n,t){for(var r={},i=0,f=u(n);f>i;i++)t?r[n[i]]=t[i]:r[n[i][0]]=n[i][1];return r};n.findIndex=tt(1);n.findLastIndex=tt(-1);n.sortedIndex=function(n,i,r,f){var o;r=t(r,f,1);for(var h=r(i),e=0,s=u(n);s>e;)o=Math.floor((e+s)/2),r(n[o])<h?e=o+1:s=o;return e};n.indexOf=it(1,n.findIndex,n.sortedIndex);n.lastIndexOf=it(-1,n.findLastIndex);n.range=function(n,t,i){null==t&&(t=n||0,n=0);i=i||1;for(var u=Math.max(Math.ceil((t-n)/i),0),f=Array(u),r=0;u>r;r++,n+=i)f[r]=n;return f};b=function(t,i,r,u,f){if(!(u instanceof i))return t.apply(r,f);var e=et(t.prototype),o=t.apply(e,f);return n.isObject(o)?o:e};n.bind=function(t,i){if(y&&t.bind===y)return y.apply(t,r.call(arguments,1));if(!n.isFunction(t))throw new TypeError("Bind must be called on a function");var f=r.call(arguments,2),u=function(){return b(t,u,i,this,f.concat(r.call(arguments)))};return u};n.partial=function(t){var i=r.call(arguments,1),u=function(){for(var f=0,o=i.length,e=Array(o),r=0;o>r;r++)e[r]=i[r]===n?arguments[f++]:i[r];for(;f<arguments.length;)e.push(arguments[f++]);return b(t,u,this,this,e)};return u};n.bindAll=function(t){var i,r,u=arguments.length;if(1>=u)throw new Error("bindAll must be passed function names");for(i=1;u>i;i++)r=arguments[i],t[r]=n.bind(t[r],t);return t};n.memoize=function(t,i){var r=function(u){var f=r.cache,e=""+(i?i.apply(this,arguments):u);return n.has(f,e)||(f[e]=t.apply(this,arguments)),f[e]};return r.cache={},r};n.delay=function(n,t){var i=r.call(arguments,2);return setTimeout(function(){return n.apply(null,i)},t)};n.defer=n.partial(n.delay,n,1);n.throttle=function(t,i,r){var f,e,s,u=null,o=0,h;return r||(r={}),h=function(){o=r.leading===!1?0:n.now();u=null;s=t.apply(f,e);u||(f=e=null)},function(){var l=n.now(),c;return o||r.leading!==!1||(o=l),c=i-(l-o),f=this,e=arguments,0>=c||c>i?(u&&(clearTimeout(u),u=null),o=l,s=t.apply(f,e),u||(f=e=null)):u||r.trailing===!1||(u=setTimeout(h,c)),s}};n.debounce=function(t,i,r){var u,f,e,s,o,h=function(){var c=n.now()-s;i>c&&c>=0?u=setTimeout(h,i-c):(u=null,r||(o=t.apply(e,f),u||(e=f=null)))};return function(){e=this;f=arguments;s=n.now();var c=r&&!u;return u||(u=setTimeout(h,i)),c&&(o=t.apply(e,f),e=f=null),o}};n.wrap=function(t,i){return n.partial(i,t)};n.negate=function(n){return function(){return!n.apply(this,arguments)}};n.compose=function(){var n=arguments,t=n.length-1;return function(){for(var r=t,i=n[t].apply(this,arguments);r--;)i=n[r].call(this,i);return i}};n.after=function(n,t){return function(){if(--n<1)return t.apply(this,arguments)}};n.before=function(n,t){var i;return function(){return--n>0&&(i=t.apply(this,arguments)),1>=n&&(t=null),i}};n.once=n.partial(n.before,2);k=!{toString:null}.propertyIsEnumerable("toString");d=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];n.keys=function(t){var i,r;if(!n.isObject(t))return[];if(ut)return ut(t);i=[];for(r in t)n.has(t,r)&&i.push(r);return k&&rt(t,i),i};n.allKeys=function(t){var i,r;if(!n.isObject(t))return[];i=[];for(r in t)i.push(r);return k&&rt(t,i),i};n.values=function(t){for(var r=n.keys(t),u=r.length,f=Array(u),i=0;u>i;i++)f[i]=t[r[i]];return f};n.mapObject=function(i,r,u){r=t(r,u);for(var f,o=n.keys(i),h=o.length,s={},e=0;h>e;e++)f=o[e],s[f]=r(i[f],f,i);return s};n.pairs=function(t){for(var r=n.keys(t),u=r.length,f=Array(u),i=0;u>i;i++)f[i]=[r[i],t[r[i]]];return f};n.invert=function(t){for(var u={},r=n.keys(t),i=0,f=r.length;f>i;i++)u[t[r[i]]]=r[i];return u};n.functions=n.methods=function(t){var i=[];for(var r in t)n.isFunction(t[r])&&i.push(r);return i.sort()};n.extend=w(n.allKeys);n.extendOwn=n.assign=w(n.keys);n.findKey=function(i,r,u){r=t(r,u);for(var f,o=n.keys(i),e=0,s=o.length;s>e;e++)if(f=o[e],r(i[f],f,i))return f};n.pick=function(t,i,r){var c,o,l={},u=t,s,v,h,a;if(null==u)return l;for(n.isFunction(i)?(o=n.allKeys(u),c=e(i,r)):(o=f(arguments,!1,!1,1),c=function(n,t,i){return t in i},u=Object(u)),s=0,v=o.length;v>s;s++)h=o[s],a=u[h],c(a,h,u)&&(l[h]=a);return l};n.omit=function(t,i,r){if(n.isFunction(i))i=n.negate(i);else{var u=n.map(f(arguments,!1,!1,1),String);i=function(t,i){return!n.contains(u,i)}}return n.pick(t,i,r)};n.defaults=w(n.allKeys,!0);n.create=function(t,i){var r=et(t);return i&&n.extendOwn(r,i),r};n.clone=function(t){return n.isObject(t)?n.isArray(t)?t.slice():n.extend({},t):t};n.tap=function(n,t){return t(n),n};n.isMatch=function(t,i){var e=n.keys(i),o=e.length,f,r,u;if(null==t)return!o;for(f=Object(t),r=0;o>r;r++)if(u=e[r],i[u]!==f[u]||!(u in f))return!1;return!0};c=function(t,i,r,u){var h,a,e,s,f,l,v;if(t===i)return 0!==t||1/t==1/i;if(null==t||null==i)return t===i;if(t instanceof n&&(t=t._wrapped),i instanceof n&&(i=i._wrapped),h=o.call(t),h!==o.call(i))return!1;switch(h){case"[object RegExp]":case"[object String]":return""+t==""+i;case"[object Number]":return+t!=+t?+i!=+i:0==+t?1/+t==1/i:+t==+i;case"[object Date]":case"[object Boolean]":return+t==+i}if(a="[object Array]"===h,!a&&("object"!=typeof t||"object"!=typeof i||(e=t.constructor,s=i.constructor,e!==s&&!(n.isFunction(e)&&e instanceof e&&n.isFunction(s)&&s instanceof s)&&"constructor"in t&&"constructor"in i)))return!1;for(r=r||[],u=u||[],f=r.length;f--;)if(r[f]===t)return u[f]===i;if(r.push(t),u.push(i),a){if(f=t.length,f!==i.length)return!1;for(;f--;)if(!c(t[f],i[f],r,u))return!1}else{if(v=n.keys(t),f=v.length,n.keys(i).length!==f)return!1;for(;f--;)if(l=v[f],!n.has(i,l)||!c(t[l],i[l],r,u))return!1}return r.pop(),u.pop(),!0};n.isEqual=function(n,t){return c(n,t)};n.isEmpty=function(t){return null==t?!0:i(t)&&(n.isArray(t)||n.isString(t)||n.isArguments(t))?0===t.length:0===n.keys(t).length};n.isElement=function(n){return!(!n||1!==n.nodeType)};n.isArray=pt||function(n){return"[object Array]"===o.call(n)};n.isObject=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n};n.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(t){n["is"+t]=function(n){return o.call(n)==="[object "+t+"]"}});n.isArguments(arguments)||(n.isArguments=function(t){return n.has(t,"callee")});"function"!=typeof/./&&"object"!=typeof Int8Array&&(n.isFunction=function(n){return"function"==typeof n||!1});n.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))};n.isNaN=function(t){return n.isNumber(t)&&t!==+t};n.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"===o.call(n)};n.isNull=function(n){return null===n};n.isUndefined=function(n){return n===void 0};n.has=function(n,t){return null!=n&&yt.call(n,t)};n.noConflict=function(){return a._=lt,this};n.identity=function(n){return n};n.constant=function(n){return function(){return n}};n.noop=function(){};n.property=ot;n.propertyOf=function(n){return null==n?function(){}:function(t){return n[t]}};n.matcher=n.matches=function(t){return t=n.extendOwn({},t),function(i){return n.isMatch(i,t)}};n.times=function(n,t,i){var u=Array(Math.max(0,n)),r;for(t=e(t,i,1),r=0;n>r;r++)u[r]=t(r);return u};n.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))};n.now=Date.now||function(){return(new Date).getTime()};var st={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},bt=n.invert(st),ht=function(t){var r=function(n){return t[n]},i="(?:"+n.keys(t).join("|")+")",u=RegExp(i),f=RegExp(i,"g");return function(n){return n=null==n?"":""+n,u.test(n)?n.replace(f,r):n}};n.escape=ht(st);n.unescape=ht(bt);n.result=function(t,i,r){var u=null==t?void 0:t[i];return u===void 0&&(u=r),n.isFunction(u)?u.call(t):u};ct=0;n.uniqueId=function(n){var t=++ct+"";return n?n+t:t};n.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var g=/(.)^/,kt={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},dt=/\\|'|\r|\n|\u2028|\u2029/g,gt=function(n){return"\\"+kt[n]};n.template=function(t,i,r){var o,f,h;!i&&r&&(i=r);i=n.defaults({},i,n.templateSettings);var c=RegExp([(i.escape||g).source,(i.interpolate||g).source,(i.evaluate||g).source].join("|")+"|$","g"),e=0,u="__p+='";t.replace(c,function(n,i,r,f,o){return u+=t.slice(e,o).replace(dt,gt),e=o+n.length,i?u+="'+\n((__t=("+i+"))==null?'':_.escape(__t))+\n'":r?u+="'+\n((__t=("+r+"))==null?'':__t)+\n'":f&&(u+="';\n"+f+"\n__p+='"),n});u+="';\n";i.variable||(u="with(obj||{}){\n"+u+"}\n");u="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+u+"return __p;\n";try{o=new Function(i.variable||"obj","_",u)}catch(s){throw s.source=u,s;}return f=function(t){return o.call(this,t,n)},h=i.variable||"obj",f.source="function("+h+"){\n"+u+"}",f};n.chain=function(t){var i=n(t);return i._chain=!0,i};l=function(t,i){return t._chain?n(i).chain():i};n.mixin=function(t){n.each(n.functions(t),function(i){var r=n[i]=t[i];n.prototype[i]=function(){var t=[this._wrapped];return vt.apply(t,arguments),l(this,r.apply(n,t))}})};n.mixin(n);n.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var i=s[t];n.prototype[t]=function(){var n=this._wrapped;return i.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],l(this,n)}});n.each(["concat","join","slice"],function(t){var i=s[t];n.prototype[t]=function(){return l(this,i.apply(this._wrapped,arguments))}});n.prototype.value=function(){return this._wrapped};n.prototype.valueOf=n.prototype.toJSON=n.prototype.value;n.prototype.toString=function(){return""+this._wrapped};"function"==typeof define&&define.amd&&define("underscore",[],function(){return n})}.call(this),function(n,t){typeof exports=="object"&&typeof module=="object"?module.exports=t():typeof define=="function"&&define.amd?define([],t):typeof exports=="object"?exports.Handlebars=t():n.Handlebars=t()}(this,function(){return function(n){function t(r){if(i[r])return i[r].exports;var u=i[r]={exports:{},id:r,loaded:!1};return n[r].call(u.exports,u,u.exports,t),u.loaded=!0,u.exports}var i={};return t.m=n,t.c=i,t.p="",t(0)}([function(n,t,i){"use strict";function o(){var n=k();return n.compile=function(t,i){return f.compile(t,i,n)},n.precompile=function(t,i){return f.precompile(t,i,n)},n.AST=l["default"],n.Compiler=f.Compiler,n.JavaScriptCompiler=v["default"],n.Parser=e.parser,n.parse=e.parse,n}var u=i(1)["default"],r;t.__esModule=!0;var s=i(2),h=u(s),c=i(35),l=u(c),e=i(36),f=i(41),a=i(42),v=u(a),y=i(39),p=u(y),w=i(34),b=u(w),k=h["default"].create;r=o();r.create=o;b["default"](r);r.Visitor=p["default"];r["default"]=r;t["default"]=r;n.exports=t["default"]},function(n,t){"use strict";t["default"]=function(n){return n&&n.__esModule?n:{"default":n}};t.__esModule=!0},function(n,t,i){"use strict";function h(){var n=new o.HandlebarsEnvironment;return e.extend(n,o),n.SafeString=a["default"],n.Exception=y["default"],n.Utils=e,n.escapeExpression=e.escapeExpression,n.VM=s,n.template=function(t){return s.template(t,n)},n}var u=i(3)["default"],f=i(1)["default"],r;t.__esModule=!0;var c=i(4),o=u(c),l=i(21),a=f(l),v=i(6),y=f(v),p=i(5),e=u(p),w=i(22),s=u(w),b=i(34),k=f(b);r=h();r.create=h;k["default"](r);r["default"]=r;t["default"]=r;n.exports=t["default"]},function(n,t){"use strict";t["default"]=function(n){var t,i;if(n&&n.__esModule)return n;if(t={},n!=null)for(i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t["default"]=n,t};t.__esModule=!0},function(n,t,i){"use strict";function o(n,t,i){this.helpers=n||{};this.partials=t||{};this.decorators=i||{};v.registerDefaultHelpers(this);y.registerDefaultDecorators(this)}var s=i(1)["default"],h,c,f,l;t.__esModule=!0;t.HandlebarsEnvironment=o;var r=i(5),a=i(6),e=s(a),v=i(10),y=i(18),p=i(20),u=s(p);t.VERSION="4.0.10";h=7;t.COMPILER_REVISION=h;c={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0"};t.REVISION_CHANGES=c;f="[object Object]";o.prototype={constructor:o,logger:u["default"],log:u["default"].log,registerHelper:function(n,t){if(r.toString.call(n)===f){if(t)throw new e["default"]("Arg not supported with multiple helpers");r.extend(this.helpers,n)}else this.helpers[n]=t},unregisterHelper:function(n){delete this.helpers[n]},registerPartial:function(n,t){if(r.toString.call(n)===f)r.extend(this.partials,n);else{if(typeof t=="undefined")throw new e["default"]('Attempting to register a partial called "'+n+'" as undefined');this.partials[n]=t}},unregisterPartial:function(n){delete this.partials[n]},registerDecorator:function(n,t){if(r.toString.call(n)===f){if(t)throw new e["default"]("Arg not supported with multiple decorators");r.extend(this.decorators,n)}else this.decorators[n]=t},unregisterDecorator:function(n){delete this.decorators[n]}};l=u["default"].log;t.log=l;t.createFrame=r.createFrame;t.logger=u["default"]},function(n,t){"use strict";function h(n){return e[n]}function f(n){for(var i,t=1;t<arguments.length;t++)for(i in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],i)&&(n[i]=arguments[t][i]);return n}function c(n,t){for(var i=0,r=n.length;i<r;i++)if(n[i]===t)return i;return-1}function l(n){if(typeof n!="string"){if(n&&n.toHTML)return n.toHTML();if(n==null)return"";if(!n)return n+"";n=""+n}return s.test(n)?n.replace(o,h):n}function a(n){return n||n===0?u(n)&&n.length===0?!0:!1:!0}function v(n){var t=f({},n);return t._parent=n,t}function y(n,t){return n.path=t,n}function p(n,t){return(n?n+".":"")+t}var i,r,u;t.__esModule=!0;t.extend=f;t.indexOf=c;t.escapeExpression=l;t.isEmpty=a;t.createFrame=v;t.blockParams=y;t.appendContextPath=p;var e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","=":"&#x3D;"},o=/[&<>"'`=]/g,s=/[&<>"'`=]/;i=Object.prototype.toString;t.toString=i;r=function(n){return typeof n=="function"};r(/x/)&&(t.isFunction=r=function(n){return typeof n=="function"&&i.call(n)==="[object Function]"});t.isFunction=r;u=Array.isArray||function(n){return n&&typeof n=="object"?i.call(n)==="[object Array]":!1};t.isArray=u},function(n,t,i){"use strict";function u(n,t){var e=t&&t.loc,s=undefined,o=undefined,h,i;for(e&&(s=e.start.line,o=e.start.column,n+=" - "+s+":"+o),h=Error.prototype.constructor.call(this,n),i=0;i<r.length;i++)this[r[i]]=h[r[i]];Error.captureStackTrace&&Error.captureStackTrace(this,u);try{e&&(this.lineNumber=s,f?Object.defineProperty(this,"column",{value:o,enumerable:!0}):this.column=o)}catch(c){}}var f=i(7)["default"],r;t.__esModule=!0;r=["description","fileName","lineNumber","message","name","number","stack"];u.prototype=new Error;t["default"]=u;n.exports=t["default"]},function(n,t,i){n.exports={"default":i(8),__esModule:!0}},function(n,t,i){var r=i(9);n.exports=function(n,t,i){return r.setDesc(n,t,i)}},function(n){var t=Object;n.exports={create:t.create,getProto:t.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:t.getOwnPropertyDescriptor,setDesc:t.defineProperty,setDescs:t.defineProperties,getKeys:t.keys,getNames:t.getOwnPropertyNames,getSymbols:t.getOwnPropertySymbols,each:[].forEach}},function(n,t,i){"use strict";function k(n){f["default"](n);o["default"](n);h["default"](n);l["default"](n);v["default"](n);p["default"](n);b["default"](n)}var r=i(1)["default"];t.__esModule=!0;t.registerDefaultHelpers=k;var u=i(11),f=r(u),e=i(12),o=r(e),s=i(13),h=r(s),c=i(14),l=r(c),a=i(15),v=r(a),y=i(16),p=r(y),w=i(17),b=r(w)},function(n,t,i){"use strict";t.__esModule=!0;var r=i(5);t["default"]=function(n){n.registerHelper("blockHelperMissing",function(t,i){var f=i.inverse,e=i.fn,u;return t===!0?e(this):t===!1||t==null?f(this):r.isArray(t)?t.length>0?(i.ids&&(i.ids=[i.name]),n.helpers.each(t,i)):f(this):(i.data&&i.ids&&(u=r.createFrame(i.data),u.contextPath=r.appendContextPath(i.data.contextPath,i.name),i={data:u}),e(t,i))})};n.exports=t["default"]},function(n,t,i){"use strict";var u=i(1)["default"];t.__esModule=!0;var r=i(5),f=i(6),e=u(f);t["default"]=function(n){n.registerHelper("each",function(n,t){function h(t,i,f){u&&(u.key=t,u.index=i,u.first=i===0,u.last=!!f,s&&(u.contextPath=s+t));o=o+a(n[t],{data:u,blockParams:r.blockParams([n[t],t],[s+t,null])})}var l,f,c;if(!t)throw new e["default"]("Must pass iterator to #each");var a=t.fn,v=t.inverse,i=0,o="",u=undefined,s=undefined;if(t.data&&t.ids&&(s=r.appendContextPath(t.data.contextPath,t.ids[0])+"."),r.isFunction(n)&&(n=n.call(this)),t.data&&(u=r.createFrame(t.data)),n&&typeof n=="object")if(r.isArray(n))for(l=n.length;i<l;i++)i in n&&h(i,i,i===n.length-1);else{f=undefined;for(c in n)n.hasOwnProperty(c)&&(f!==undefined&&h(f,i-1),f=c,i++);f!==undefined&&h(f,i-1,!0)}return i===0&&(o=v(this)),o})};n.exports=t["default"]},function(n,t,i){"use strict";var f=i(1)["default"],r,u;t.__esModule=!0;r=i(6);u=f(r);t["default"]=function(n){n.registerHelper("helperMissing",function(){if(arguments.length===1)return undefined;throw new u["default"]('Missing helper: "'+arguments[arguments.length-1].name+'"');})};n.exports=t["default"]},function(n,t,i){"use strict";t.__esModule=!0;var r=i(5);t["default"]=function(n){n.registerHelper("if",function(n,t){return r.isFunction(n)&&(n=n.call(this)),(t.hash.includeZero||n)&&!r.isEmpty(n)?t.fn(this):t.inverse(this)});n.registerHelper("unless",function(t,i){return n.helpers["if"].call(this,t,{fn:i.inverse,inverse:i.fn,hash:i.hash})})};n.exports=t["default"]},function(n,t){"use strict";t.__esModule=!0;t["default"]=function(n){n.registerHelper("log",function(){for(var i,r=[undefined],t=arguments[arguments.length-1],u=0;u<arguments.length-1;u++)r.push(arguments[u]);i=1;t.hash.level!=null?i=t.hash.level:t.data&&t.data.level!=null&&(i=t.data.level);r[0]=i;n.log.apply(n,r)})};n.exports=t["default"]},function(n,t){"use strict";t.__esModule=!0;t["default"]=function(n){n.registerHelper("lookup",function(n,t){return n&&n[t]})};n.exports=t["default"]},function(n,t,i){"use strict";t.__esModule=!0;var r=i(5);t["default"]=function(n){n.registerHelper("with",function(n,t){var u,i;return r.isFunction(n)&&(n=n.call(this)),u=t.fn,r.isEmpty(n)?t.inverse(this):(i=t.data,t.data&&t.ids&&(i=r.createFrame(t.data),i.contextPath=r.appendContextPath(t.data.contextPath,t.ids[0])),u(n,{data:i,blockParams:r.blockParams([n],[i&&i.contextPath])}))})};n.exports=t["default"]},function(n,t,i){"use strict";function e(n){u["default"](n)}var f=i(1)["default"],r,u;t.__esModule=!0;t.registerDefaultDecorators=e;r=i(19);u=f(r)},function(n,t,i){"use strict";t.__esModule=!0;var r=i(5);t["default"]=function(n){n.registerDecorator("inline",function(n,t,i,u){var f=n;return t.partials||(t.partials={},f=function(u,f){var e=i.partials,o;return i.partials=r.extend({},e,t.partials),o=n(u,f),i.partials=e,o}),t.partials[u.args[0]]=u.fn,f})};n.exports=t["default"]},function(n,t,i){"use strict";t.__esModule=!0;var u=i(5),r={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(n){if(typeof n=="string"){var t=u.indexOf(r.methodMap,n.toLowerCase());n=t>=0?t:parseInt(n,10)}return n},log:function(n){var t;if(n=r.lookupLevel(n),typeof console!="undefined"&&r.lookupLevel(r.level)<=n){t=r.methodMap[n];console[t]||(t="log");for(var u=arguments.length,f=Array(u>1?u-1:0),i=1;i<u;i++)f[i-1]=arguments[i];console[t].apply(console,f)}}};t["default"]=r;n.exports=t["default"]},function(n,t){"use strict";function i(n){this.string=n}t.__esModule=!0;i.prototype.toString=i.prototype.toHTML=function(){return""+this.string};t["default"]=i;n.exports=t["default"]},function(n,t,i){"use strict";function y(n){var t=n&&n[0]||1,i=u.COMPILER_REVISION,f,e;if(t!==i)if(t<i){f=u.REVISION_CHANGES[i];e=u.REVISION_CHANGES[t];throw new r["default"]("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+f+") or downgrade your runtime to an older version ("+e+").");}else throw new r["default"]("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+n[1]+").");}function p(n,t){function o(i,u,e){var o,h,s,c;if(e.hash&&(u=f.extend({},u,e.hash),e.ids&&(e.ids[0]=!0)),i=t.VM.resolvePartial.call(this,i,u,e),o=t.VM.invokePartial.call(this,i,u,e),o==null&&t.compile&&(e.partials[e.name]=t.compile(i,n.compilerOptions,t),o=e.partials[e.name](u,e)),o!=null){if(e.indent){for(h=o.split("\n"),s=0,c=h.length;s<c;s++){if(!h[s]&&s+1===c)break;h[s]=e.indent+h[s]}o=h.join("\n")}return o}throw new r["default"]("The partial "+e.name+" could not be compiled when running in runtime-only mode");}function u(t){function h(t){return""+n.main(i,t,i.helpers,i.partials,f,o,e)}var r=arguments.length<=1||arguments[1]===undefined?{}:arguments[1],f=r.data,e,o;return u._setup(r),!r.partial&&n.useData&&(f=k(t,f)),e=undefined,o=n.useBlockParams?[]:undefined,n.useDepths&&(e=r.depths?t!=r.depths[0]?[t].concat(r.depths):r.depths:[t]),h=s(n.main,h,i,r.depths||[],f,o),h(t,r)}if(!t)throw new r["default"]("No environment passed to template");if(!n||!n.main)throw new r["default"]("Unknown template object: "+typeof n);n.main.decorator=n.main_d;t.VM.checkRevision(n.compiler);var i={strict:function(n,t){if(!(t in n))throw new r["default"]('"'+t+'" not defined in '+n);return n[t]},lookup:function(n,t){for(var r=n.length,i=0;i<r;i++)if(n[i]&&n[i][t]!=null)return n[i][t]},lambda:function(n,t){return typeof n=="function"?n.call(t):n},escapeExpression:f.escapeExpression,invokePartial:o,fn:function(t){var i=n[t];return i.decorator=n[t+"_d"],i},programs:[],program:function(n,t,i,r,u){var f=this.programs[n],o=this.fn(n);return t||u||r||i?f=e(this,n,o,t,i,r,u):f||(f=this.programs[n]=e(this,n,o)),f},data:function(n,t){while(n&&t--)n=n._parent;return n},merge:function(n,t){var i=n||t;return n&&t&&n!==t&&(i=f.extend({},t,n)),i},nullContext:h({}),noop:t.VM.noop,compilerInfo:n.compiler};return u.isTop=!0,u._setup=function(r){r.partial?(i.helpers=r.helpers,i.partials=r.partials,i.decorators=r.decorators):(i.helpers=i.merge(r.helpers,t.helpers),n.usePartial&&(i.partials=i.merge(r.partials,t.partials)),(n.usePartial||n.useDecorators)&&(i.decorators=i.merge(r.decorators,t.decorators)))},u._child=function(t,u,f,o){if(n.useBlockParams&&!f)throw new r["default"]("must pass block params");if(n.useDepths&&!o)throw new r["default"]("must pass parent depths");return e(i,t,n[t],u,0,f,o)},u}function e(n,t,i,r,u,f,e){function o(t){var u=arguments.length<=1||arguments[1]===undefined?{}:arguments[1],o=e;return!e||t==e[0]||t===n.nullContext&&e[0]===null||(o=[t].concat(e)),i(n,t,n.helpers,n.partials,u.data||r,f&&[u.blockParams].concat(f),o)}return o=s(i,o,n,e,r,f),o.program=t,o.depth=e?e.length:0,o.blockParams=u||0,o}function w(n,t,i){return n?n.call||i.name||(i.name=n,n=i.partials[n]):n=i.name==="@partial-block"?i.data["partial-block"]:i.partials[i.name],n}function b(n,t,i){var s=i.data&&i.data["partial-block"],e;if(i.partial=!0,i.ids&&(i.data.contextPath=i.ids[0]||i.data.contextPath),e=undefined,i.fn&&i.fn!==o&&function(){i.data=u.createFrame(i.data);var n=i.fn;e=i.data["partial-block"]=function(t){var i=arguments.length<=1||arguments[1]===undefined?{}:arguments[1];return i.data=u.createFrame(i.data),i.data["partial-block"]=s,n(t,i)};n.partials&&(i.partials=f.extend({},i.partials,n.partials))}(),n===undefined&&e&&(n=e),n===undefined)throw new r["default"]("The partial "+i.name+" could not be found");else if(n instanceof Function)return n(t,i)}function o(){return""}function k(n,t){return t&&"root"in t||(t=t?u.createFrame(t):{},t.root=n),t}function s(n,t,i,r,u,e){if(n.decorator){var o={};t=n.decorator(t,o,i,r&&r[0],u,e,r);f.extend(t,o)}return t}var h=i(23)["default"],c=i(3)["default"],l=i(1)["default"];t.__esModule=!0;t.checkRevision=y;t.template=p;t.wrapProgram=e;t.resolvePartial=w;t.invokePartial=b;t.noop=o;var a=i(5),f=c(a),v=i(6),r=l(v),u=i(4)},function(n,t,i){n.exports={"default":i(24),__esModule:!0}},function(n,t,i){i(25);n.exports=i(30).Object.seal},function(n,t,i){var r=i(26);i(27)("seal",function(n){return function(t){return n&&r(t)?n(t):t}})},function(n){n.exports=function(n){return typeof n=="object"?n!==null:typeof n=="function"}},function(n,t,i){var r=i(28),u=i(30),f=i(33);n.exports=function(n,t){var i=(u.Object||{})[n]||Object[n],e={};e[n]=t(i);r(r.S+r.F*f(function(){i(1)}),"Object",e)}},function(n,t,i){var f=i(29),e=i(30),o=i(31),u="prototype",r=function(n,t,i){var p=n&r.F,l=n&r.G,w=n&r.S,y=n&r.P,b=n&r.B,k=n&r.W,a=l?e:e[t]||(e[t]={}),c=l?f:w?f[t]:(f[t]||{})[u],s,v,h;l&&(i=t);for(s in i)(v=!p&&c&&s in c,v&&s in a)||(h=v?c[s]:i[s],a[s]=l&&typeof c[s]!="function"?i[s]:b&&v?o(h,f):k&&c[s]==h?function(n){var t=function(t){return this instanceof n?new n(t):n(t)};return t[u]=n[u],t}(h):y&&typeof h=="function"?o(Function.call,h):h,y&&((a[u]||(a[u]={}))[s]=h))};r.F=1;r.G=2;r.S=4;r.P=8;r.B=16;r.W=32;n.exports=r},function(n){var t=n.exports=typeof window!="undefined"&&window.Math==Math?window:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=t)},function(n){var t=n.exports={version:"1.2.6"};typeof __e=="number"&&(__e=t)},function(n,t,i){var r=i(32);n.exports=function(n,t,i){if(r(n),t===undefined)return n;switch(i){case 1:return function(i){return n.call(t,i)};case 2:return function(i,r){return n.call(t,i,r)};case 3:return function(i,r,u){return n.call(t,i,r,u)}}return function(){return n.apply(t,arguments)}}},function(n){n.exports=function(n){if(typeof n!="function")throw TypeError(n+" is not a function!");return n}},function(n){n.exports=function(n){try{return!!n()}catch(t){return!0}}},function(n,t){(function(i){"use strict";t.__esModule=!0;t["default"]=function(n){var t=typeof i!="undefined"?i:window,r=t.Handlebars;n.noConflict=function(){return t.Handlebars===n&&(t.Handlebars=r),n}};n.exports=t["default"]}).call(t,function(){return this}())},function(n,t){"use strict";t.__esModule=!0;var i={helpers:{helperExpression:function(n){return n.type==="SubExpression"||(n.type==="MustacheStatement"||n.type==="BlockStatement")&&!!(n.params&&n.params.length||n.hash)},scopedId:function(n){return/^\.|this\b/.test(n.original)},simpleId:function(n){return n.parts.length===1&&!i.helpers.scopedId(n)&&!n.depth}}};t["default"]=i;n.exports=t["default"]},function(n,t,i){"use strict";function v(n,t){if(n.type==="Program")return n;u["default"].yy=r;r.locInfo=function(n){return new r.SourceLocation(t&&t.srcName,n)};var i=new h["default"](t);return i.accept(u["default"].parse(n))}var f=i(1)["default"],e=i(3)["default"],r;t.__esModule=!0;t.parse=v;var o=i(37),u=f(o),s=i(38),h=f(s),c=i(40),l=e(c),a=i(5);t.parser=u["default"];r={};a.extend(r,l)},function(n,t){"use strict";t.__esModule=!0;var i=function(){function t(){this.yy={}}var n={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition_plus0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,1],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(n,t,i,r,u,f){var e=f.length-1,s,o;switch(u){case 1:return f[e-1];case 2:this.$=r.prepareProgram(f[e]);break;case 3:this.$=f[e];break;case 4:this.$=f[e];break;case 5:this.$=f[e];break;case 6:this.$=f[e];break;case 7:this.$=f[e];break;case 8:this.$=f[e];break;case 9:this.$={type:"CommentStatement",value:r.stripComment(f[e]),strip:r.stripFlags(f[e],f[e]),loc:r.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:f[e],value:f[e],loc:r.locInfo(this._$)};break;case 11:this.$=r.prepareRawBlock(f[e-2],f[e-1],f[e],this._$);break;case 12:this.$={path:f[e-3],params:f[e-2],hash:f[e-1]};break;case 13:this.$=r.prepareBlock(f[e-3],f[e-2],f[e-1],f[e],!1,this._$);break;case 14:this.$=r.prepareBlock(f[e-3],f[e-2],f[e-1],f[e],!0,this._$);break;case 15:this.$={open:f[e-5],path:f[e-4],params:f[e-3],hash:f[e-2],blockParams:f[e-1],strip:r.stripFlags(f[e-5],f[e])};break;case 16:this.$={path:f[e-4],params:f[e-3],hash:f[e-2],blockParams:f[e-1],strip:r.stripFlags(f[e-5],f[e])};break;case 17:this.$={path:f[e-4],params:f[e-3],hash:f[e-2],blockParams:f[e-1],strip:r.stripFlags(f[e-5],f[e])};break;case 18:this.$={strip:r.stripFlags(f[e-1],f[e-1]),program:f[e]};break;case 19:s=r.prepareBlock(f[e-2],f[e-1],f[e],f[e],!1,this._$);o=r.prepareProgram([s],f[e-1].loc);o.chained=!0;this.$={strip:f[e-2].strip,program:o,chain:!0};break;case 20:this.$=f[e];break;case 21:this.$={path:f[e-1],strip:r.stripFlags(f[e-2],f[e])};break;case 22:this.$=r.prepareMustache(f[e-3],f[e-2],f[e-1],f[e-4],r.stripFlags(f[e-4],f[e]),this._$);break;case 23:this.$=r.prepareMustache(f[e-3],f[e-2],f[e-1],f[e-4],r.stripFlags(f[e-4],f[e]),this._$);break;case 24:this.$={type:"PartialStatement",name:f[e-3],params:f[e-2],hash:f[e-1],indent:"",strip:r.stripFlags(f[e-4],f[e]),loc:r.locInfo(this._$)};break;case 25:this.$=r.preparePartialBlock(f[e-2],f[e-1],f[e],this._$);break;case 26:this.$={path:f[e-3],params:f[e-2],hash:f[e-1],strip:r.stripFlags(f[e-4],f[e])};break;case 27:this.$=f[e];break;case 28:this.$=f[e];break;case 29:this.$={type:"SubExpression",path:f[e-3],params:f[e-2],hash:f[e-1],loc:r.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:f[e],loc:r.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:r.id(f[e-2]),value:f[e],loc:r.locInfo(this._$)};break;case 32:this.$=r.id(f[e-1]);break;case 33:this.$=f[e];break;case 34:this.$=f[e];break;case 35:this.$={type:"StringLiteral",value:f[e],original:f[e],loc:r.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(f[e]),original:Number(f[e]),loc:r.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:f[e]==="true",original:f[e]==="true",loc:r.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:undefined,value:undefined,loc:r.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:r.locInfo(this._$)};break;case 40:this.$=f[e];break;case 41:this.$=f[e];break;case 42:this.$=r.preparePath(!0,f[e],this._$);break;case 43:this.$=r.preparePath(!1,f[e],this._$);break;case 44:f[e-2].push({part:r.id(f[e]),original:f[e],separator:f[e-1]});this.$=f[e-2];break;case 45:this.$=[{part:r.id(f[e]),original:f[e]}];break;case 46:this.$=[];break;case 47:f[e-1].push(f[e]);break;case 48:this.$=[f[e]];break;case 49:f[e-1].push(f[e]);break;case 50:this.$=[];break;case 51:f[e-1].push(f[e]);break;case 58:this.$=[];break;case 59:f[e-1].push(f[e]);break;case 64:this.$=[];break;case 65:f[e-1].push(f[e]);break;case 70:this.$=[];break;case 71:f[e-1].push(f[e]);break;case 78:this.$=[];break;case 79:f[e-1].push(f[e]);break;case 82:this.$=[];break;case 83:f[e-1].push(f[e]);break;case 86:this.$=[];break;case 87:f[e-1].push(f[e]);break;case 90:this.$=[];break;case 91:f[e-1].push(f[e]);break;case 94:this.$=[];break;case 95:f[e-1].push(f[e]);break;case 98:this.$=[f[e]];break;case 99:f[e-1].push(f[e]);break;case 100:this.$=[f[e]];break;case 101:f[e-1].push(f[e])}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{13:40,15:[1,20],17:39},{20:42,56:41,64:43,65:[1,44],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:45,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:48,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:42,56:49,64:43,65:[1,44],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:50,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,51]},{72:[1,35],86:52},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:53,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:54,38:56,39:[1,58],43:57,44:[1,59],45:55,47:[2,54]},{28:60,43:61,44:[1,59],47:[2,56]},{13:63,15:[1,20],18:[1,62]},{15:[2,48],18:[2,48]},{33:[2,86],57:64,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:65,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:66,47:[1,67]},{30:68,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:69,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:70,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:71,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:75,33:[2,80],50:72,63:73,64:76,65:[1,44],69:74,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,80]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,51]},{20:75,53:81,54:[2,84],63:82,64:76,65:[1,44],69:83,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:84,47:[1,67]},{47:[2,55]},{4:85,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:86,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:87,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:88,47:[1,67]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:75,33:[2,88],58:89,63:90,64:76,65:[1,44],69:91,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:92,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:93,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:75,31:94,33:[2,60],63:95,64:76,65:[1,44],69:96,70:77,71:78,72:[1,79],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:75,33:[2,66],36:97,63:98,64:76,65:[1,44],69:99,70:77,71:78,72:[1,79],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:75,22:100,23:[2,52],63:101,64:76,65:[1,44],69:102,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:75,33:[2,92],62:103,63:104,64:76,65:[1,44],69:105,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,106]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:107,72:[1,108],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,109],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,110]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:56,39:[1,58],43:57,44:[1,59],45:112,46:111,47:[2,76]},{33:[2,70],40:113,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,114]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:75,63:116,64:76,65:[1,44],67:115,68:[2,96],69:117,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,118]},{32:119,33:[2,62],74:120,75:[1,121]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:122,74:123,75:[1,121]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,124]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,125]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,109]},{20:75,63:126,64:76,65:[1,44],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:75,33:[2,72],41:127,63:128,64:76,65:[1,44],69:129,70:77,71:78,72:[1,79],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,130]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,131]},{33:[2,63]},{72:[1,133],76:132},{33:[1,134]},{33:[2,69]},{15:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:135,74:136,75:[1,121]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,138],77:[1,137]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,139]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],55:[2,55],57:[2,20],61:[2,57],74:[2,81],83:[2,85],87:[2,18],91:[2,89],102:[2,53],105:[2,93],111:[2,19],112:[2,77],117:[2,97],120:[2,63],123:[2,69],124:[2,12],136:[2,75],137:[2,32]},parseError:function(n){throw new Error(n);},parse:function(n){function it(){var n;return n=k.lexer.lex()||1,typeof n!="number"&&(n=k.symbols_[n]||n),n}var k=this,r=[0],f=[null],t=[],h=this.table,d="",c=0,g=0,y=0,l,nt,i,p,o,u,w,s,a,e,tt,v,b;for(this.lexer.setInput(n),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc=="undefined"&&(this.lexer.yylloc={}),l=this.lexer.yylloc,t.push(l),nt=this.lexer.options&&this.lexer.options.ranges,typeof this.yy.parseError=="function"&&(this.parseError=this.yy.parseError),s={};;){if(o=r[r.length-1],this.defaultActions[o]?u=this.defaultActions[o]:((i===null||typeof i=="undefined")&&(i=it()),u=h[o]&&h[o][i]),(typeof u=="undefined"||!u.length||!u[0])&&(b="",!y)){v=[];for(a in h[o])this.terminals_[a]&&a>2&&v.push("'"+this.terminals_[a]+"'");b=this.lexer.showPosition?"Parse error on line "+(c+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[i]||i)+"'":"Parse error on line "+(c+1)+": Unexpected "+(i==1?"end of input":"'"+(this.terminals_[i]||i)+"'");this.parseError(b,{text:this.lexer.match,token:this.terminals_[i]||i,line:this.lexer.yylineno,loc:l,expected:v})}if(u[0]instanceof Array&&u.length>1)throw new Error("Parse Error: multiple actions possible at state: "+o+", token: "+i);switch(u[0]){case 1:r.push(i);f.push(this.lexer.yytext);t.push(this.lexer.yylloc);r.push(u[1]);i=null;p?(i=p,p=null):(g=this.lexer.yyleng,d=this.lexer.yytext,c=this.lexer.yylineno,l=this.lexer.yylloc,y>0&&y--);break;case 2:if(e=this.productions_[u[1]][1],s.$=f[f.length-e],s._$={first_line:t[t.length-(e||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(e||1)].first_column,last_column:t[t.length-1].last_column},nt&&(s._$.range=[t[t.length-(e||1)].range[0],t[t.length-1].range[1]]),w=this.performAction.call(s,d,g,c,this.yy,u[1],f,t),typeof w!="undefined")return w;e&&(r=r.slice(0,-2*e),f=f.slice(0,-1*e),t=t.slice(0,-1*e));r.push(this.productions_[u[1]][0]);f.push(s.$);t.push(s._$);tt=h[r[r.length-2]][r[r.length-1]];r.push(tt);break;case 3:return!0}}return!0}},i=function(){var n={EOF:1,parseError:function(n,t){if(this.yy.parser)this.yy.parser.parseError(n,t);else throw new Error(n);},setInput:function(n){return this._input=n,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var n=this._input[0],t;return this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n,t=n.match(/(?:\r\n?|\n).*/g),t?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},unput:function(n){var i=n.length,t=n.split(/(?:\r\n?|\n)/g),r,u;return this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i-1),this.offset-=i,r=this.match.split(/(?:\r\n?|\n)/g),this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),t.length-1&&(this.yylineno-=t.length-1),u=this.yylloc.range,this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:t?(t.length===r.length?this.yylloc.first_column:0)+r[r.length-t.length].length-t[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-i]),this},more:function(){return this._more=!0,this},less:function(n){this.unput(this.match.slice(n))},pastInput:function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var n=this.pastInput(),t=new Array(n.length+1).join("-");return n+this.upcomingInput()+"\n"+t+"^"},next:function(){var f,n,r,e,t,u,i;if(this.done)return this.EOF;for(this._input||(this.done=!0),this._more||(this.yytext="",this.match=""),u=this._currentRules(),i=0;i<u.length;i++)if(r=this._input.match(this.rules[u[i]]),r&&(!n||r[0].length>n[0].length)&&(n=r,e=i,!this.options.flex))break;return n?(t=n[0].match(/(?:\r\n?|\n).*/g),t&&(this.yylineno+=t.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:t?t[t.length-1].length-t[t.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+n[0].length},this.yytext+=n[0],this.match+=n[0],this.matches=n,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(n[0].length),this.matched+=n[0],f=this.performAction.call(this,this.yy,this,u[e],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),f)?f:void 0:this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var n=this.next();return typeof n!="undefined"?n:this.lex()},begin:function(n){this.conditionStack.push(n)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(n){this.begin(n)}};return n.options={},n.performAction=function(n,t,i,r){function u(n,i){return t.yytext=t.yytext.substr(n,t.yyleng-i)}var f=r;switch(i){case 0:if(t.yytext.slice(-2)==="\\\\"?(u(0,1),this.begin("mu")):t.yytext.slice(-1)==="\\"?(u(0,1),this.begin("emu")):this.begin("mu"),t.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),this.conditionStack[this.conditionStack.length-1]==="raw"?15:(t.yytext=t.yytext.substr(5,t.yyleng-9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(t.yytext);this.popState();this.begin("com");break;case 22:return this.popState(),14;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return t.yytext=u(1,2).replace(/\\"/g,'"'),80;case 32:return t.yytext=u(1,2).replace(/\\'/g,"'"),80;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return t.yytext=t.yytext.replace(/\\([\\\]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},n.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^\/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]*?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],n.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},n}();return n.lexer=i,t.prototype=n,n.Parser=t,new t}();t["default"]=i;n.exports=t["default"]},function(n,t,i){"use strict";function r(){var n=arguments.length<=0||arguments[0]===undefined?{}:arguments[0];this.options=n}function e(n,t,i){t===undefined&&(t=n.length);var r=n[t-1],u=n[t-2];return r?r.type==="ContentStatement"?(u||!i?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(r.original):void 0:i}function o(n,t,i){t===undefined&&(t=-1);var r=n[t+1],u=n[t+2];return r?r.type==="ContentStatement"?(u||!i?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(r.original):void 0:i}function f(n,t,i){var r=n[t==null?0:t+1],u;r&&r.type==="ContentStatement"&&(i||!r.rightStripped)&&(u=r.value,r.value=r.value.replace(i?/^\s+/:/^[ \t]*\r?\n?/,""),r.rightStripped=r.value!==u)}function u(n,t,i){var r=n[t==null?n.length-1:t-1],u;if(r&&r.type==="ContentStatement"&&(i||!r.leftStripped))return u=r.value,r.value=r.value.replace(i?/\s+$/:/[ \t]+$/,""),r.leftStripped=r.value!==u,r.leftStripped}var c=i(1)["default"],s,h;t.__esModule=!0;s=i(39);h=c(s);r.prototype=new h["default"];r.prototype.Program=function(n){var h=!this.options.ignoreStandalone,c=!this.isRootSeen,i,t,l,r,s;for(this.isRootSeen=!0,i=n.body,t=0,l=i.length;t<l;t++)if(r=i[t],s=this.accept(r),s){var a=e(i,t,c),v=o(i,t,c),y=s.openStandalone&&a,p=s.closeStandalone&&v,w=s.inlineStandalone&&a&&v;s.close&&f(i,t,!0);s.open&&u(i,t,!0);h&&w&&(f(i,t),u(i,t)&&r.type==="PartialStatement"&&(r.indent=/([ \t]+$)/.exec(i[t-1].original)[1]));h&&y&&(f((r.program||r.inverse).body),u(i,t));h&&p&&(f(i,t),u((r.inverse||r.program).body))}return n};r.prototype.BlockStatement=r.prototype.DecoratorBlock=r.prototype.PartialBlockStatement=function(n){var c,h;this.accept(n.program);this.accept(n.inverse);var t=n.program||n.inverse,i=n.program&&n.inverse,r=i,s=i;if(i&&i.chained)for(r=i.body[0].program;s.chained;)s=s.body[s.body.length-1].program;return c={open:n.openStrip.open,close:n.closeStrip.close,openStandalone:o(t.body),closeStandalone:e((r||t).body)},n.openStrip.close&&f(t.body,null,!0),i?(h=n.inverseStrip,h.open&&u(t.body,null,!0),h.close&&f(r.body,null,!0),n.closeStrip.open&&u(s.body,null,!0),!this.options.ignoreStandalone&&e(t.body)&&o(r.body)&&(u(t.body),f(r.body))):n.closeStrip.open&&u(t.body,null,!0),c};r.prototype.Decorator=r.prototype.MustacheStatement=function(n){return n.strip};r.prototype.PartialStatement=r.prototype.CommentStatement=function(n){var t=n.strip||{};return{inlineStandalone:!0,open:t.open,close:t.close}};t["default"]=r;n.exports=t["default"]},function(n,t,i){"use strict";function u(){this.parents=[]}function f(n){this.acceptRequired(n,"path");this.acceptArray(n.params);this.acceptKey(n,"hash")}function o(n){f.call(this,n);this.acceptKey(n,"program");this.acceptKey(n,"inverse")}function s(n){this.acceptRequired(n,"name");this.acceptArray(n.params);this.acceptKey(n,"hash")}var h=i(1)["default"],e,r;t.__esModule=!0;e=i(6);r=h(e);u.prototype={constructor:u,mutating:!1,acceptKey:function(n,t){var i=this.accept(n[t]);if(this.mutating){if(i&&!u.prototype[i.type])throw new r["default"]('Unexpected node type "'+i.type+'" found when accepting '+t+" on "+n.type);n[t]=i}},acceptRequired:function(n,t){if(this.acceptKey(n,t),!n[t])throw new r["default"](n.type+" requires "+t);},acceptArray:function(n){for(var t=0,i=n.length;t<i;t++)this.acceptKey(n,t),n[t]||(n.splice(t,1),t--,i--)},accept:function(n){if(n){if(!this[n.type])throw new r["default"]("Unknown type: "+n.type,n);this.current&&this.parents.unshift(this.current);this.current=n;var t=this[n.type](n);return(this.current=this.parents.shift(),!this.mutating||t)?t:t!==!1?n:void 0}},Program:function(n){this.acceptArray(n.body)},MustacheStatement:f,Decorator:f,BlockStatement:o,DecoratorBlock:o,PartialStatement:s,PartialBlockStatement:function(n){s.call(this,n);this.acceptKey(n,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:f,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(n){this.acceptArray(n.pairs)},HashPair:function(n){this.acceptRequired(n,"value")}};t["default"]=u;n.exports=t["default"]},function(n,t,i){"use strict";function u(n,t){if(t=t.path?t.path.original:t,n.path.original!==t){var i={loc:n.path.loc};throw new r["default"](n.path.original+" doesn't match "+t,i);}}function o(n,t){this.source=n;this.start={line:t.first_line,column:t.first_column};this.end={line:t.last_line,column:t.last_column}}function s(n){return/^\[.*\]$/.test(n)?n.substr(1,n.length-2):n}function h(n,t){return{open:n.charAt(2)==="~",close:t.charAt(t.length-3)==="~"}}function c(n){return n.replace(/^\{\{~?\!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function l(n,t,i){var f,h,u,c;i=this.locInfo(i);var e=n?"@":"",o=[],s=0,l="";for(f=0,h=t.length;f<h;f++)if(u=t[f].part,c=t[f].original!==u,e+=(t[f].separator||"")+u,c||u!==".."&&u!=="."&&u!=="this")o.push(u);else if(o.length>0)throw new r["default"]("Invalid path: "+e,{loc:i});else u===".."&&(s++,l+="../");return{type:"PathExpression",data:n,depth:s,parts:o,original:e,loc:i}}function a(n,t,i,r,u,f){var e=r.charAt(3)||r.charAt(2),o=e!=="{"&&e!=="&",s=/\*/.test(r);return{type:s?"Decorator":"MustacheStatement",path:n,params:t,hash:i,escaped:o,strip:u,loc:this.locInfo(f)}}function v(n,t,i,r){u(n,i);r=this.locInfo(r);var f={type:"Program",body:t,strip:{},loc:r};return{type:"BlockStatement",path:n.path,params:n.params,hash:n.hash,program:f,openStrip:{},inverseStrip:{},closeStrip:{},loc:r}}function y(n,t,i,f,e,o){var h,s,c;if(f&&f.path&&u(n,f),h=/\*/.test(n.open),t.blockParams=n.blockParams,s=undefined,c=undefined,i){if(h)throw new r["default"]("Unexpected inverse block on decorator",i);i.chain&&(i.program.body[0].closeStrip=f.strip);c=i.strip;s=i.program}return e&&(e=s,s=t,t=e),{type:h?"DecoratorBlock":"BlockStatement",path:n.path,params:n.params,hash:n.hash,program:t,inverse:s,openStrip:n.strip,inverseStrip:c,closeStrip:f&&f.strip,loc:this.locInfo(o)}}function p(n,t){if(!t&&n.length){var i=n[0].loc,r=n[n.length-1].loc;i&&r&&(t={source:i.source,start:{line:i.start.line,column:i.start.column},end:{line:r.end.line,column:r.end.column}})}return{type:"Program",body:n,strip:{},loc:t}}function w(n,t,i,r){return u(n,i),{type:"PartialBlockStatement",name:n.path,params:n.params,hash:n.hash,program:t,openStrip:n.strip,closeStrip:i&&i.strip,loc:this.locInfo(r)}}var e=i(1)["default"],f,r;t.__esModule=!0;t.SourceLocation=o;t.id=s;t.stripFlags=h;t.stripComment=c;t.preparePath=l;t.prepareMustache=a;t.prepareRawBlock=v;t.prepareBlock=y;t.prepareProgram=p;t.preparePartialBlock=w;f=i(6);r=e(f)},function(n,t,i){"use strict";function e(){}function v(n,t,i){if(n==null||typeof n!="string"&&n.type!=="Program")throw new r["default"]("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+n);t=t||{};"data"in t||(t.data=!0);t.compat&&(t.useDepths=!0);var u=i.parse(n,t),f=(new i.Compiler).compile(u,t);return(new i.JavaScriptCompiler).compile(f,t)}function y(n,t,i){function e(){var r=i.parse(n,t),u=(new i.Compiler).compile(r,t),f=(new i.JavaScriptCompiler).compile(u,t,undefined,!0);return i.template(f)}function o(n,t){return u||(u=e()),u.call(this,n,t)}if(t===undefined&&(t={}),n==null||typeof n!="string"&&n.type!=="Program")throw new r["default"]("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+n);t=f.extend({},t);"data"in t||(t.data=!0);t.compat&&(t.useDepths=!0);var u=undefined;return o._setup=function(n){return u||(u=e()),u._setup(n)},o._child=function(n,t,i,r){return u||(u=e()),u._child(n,t,i,r)},o}function s(n,t){if(n===t)return!0;if(f.isArray(n)&&f.isArray(t)&&n.length===t.length){for(var i=0;i<n.length;i++)if(!s(n[i],t[i]))return!1;return!0}}function h(n){if(!n.path.parts){var t=n.path;n.path={type:"PathExpression",data:!1,depth:0,parts:[t.original+""],original:t.original+"",loc:t.loc}}}var o=i(1)["default"];t.__esModule=!0;t.Compiler=e;t.precompile=v;t.compile=y;var c=i(6),r=o(c),f=i(5),l=i(35),u=o(l),a=[].slice;e.prototype={compiler:e,equals:function(n){var i=this.opcodes.length,r,u,t;if(n.opcodes.length!==i)return!1;for(t=0;t<i;t++)if(r=this.opcodes[t],u=n.opcodes[t],r.opcode!==u.opcode||!s(r.args,u.args))return!1;for(i=this.children.length,t=0;t<i;t++)if(!this.children[t].equals(n.children[t]))return!1;return!0},guid:0,compile:function(n,t){var i,r;if(this.sourceNode=[],this.opcodes=[],this.children=[],this.options=t,this.stringParams=t.stringParams,this.trackIds=t.trackIds,t.blockParams=t.blockParams||[],i=t.knownHelpers,t.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0,lookup:!0},i)for(r in i)r in i&&(this.options.knownHelpers[r]=i[r]);return this.accept(n)},compileProgram:function(n){var r=new this.compiler,t=r.compile(n,this.options),i=this.guid++;return this.usePartial=this.usePartial||t.usePartial,this.children[i]=t,this.useDepths=this.useDepths||t.useDepths,i},accept:function(n){if(!this[n.type])throw new r["default"]("Unknown type: "+n.type,n);this.sourceNode.unshift(n);var t=this[n.type](n);return this.sourceNode.shift(),t},Program:function(n){var i,r,t;for(this.options.blockParams.unshift(n.blockParams),i=n.body,r=i.length,t=0;t<r;t++)this.accept(i[t]);return this.options.blockParams.shift(),this.isSimple=r===1,this.blockParams=n.blockParams?n.blockParams.length:0,this},BlockStatement:function(n){var t,i,r;h(n);t=n.program;i=n.inverse;t=t&&this.compileProgram(t);i=i&&this.compileProgram(i);r=this.classifySexpr(n);r==="helper"?this.helperSexpr(n,t,i):r==="simple"?(this.simpleSexpr(n),this.opcode("pushProgram",t),this.opcode("pushProgram",i),this.opcode("emptyHash"),this.opcode("blockValue",n.path.original)):(this.ambiguousSexpr(n,t,i),this.opcode("pushProgram",t),this.opcode("pushProgram",i),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue"));this.opcode("append")},DecoratorBlock:function(n){var t=n.program&&this.compileProgram(n.program),i=this.setupFullMustacheParams(n,t,undefined),r=n.path;this.useDecorators=!0;this.opcode("registerDecorator",i.length,r.original)},PartialStatement:function(n){var u,t,e,f,i;if(this.usePartial=!0,u=n.program,u&&(u=this.compileProgram(n.program)),t=n.params,t.length>1)throw new r["default"]("Unsupported number of partial arguments: "+t.length,n);else t.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):t.push({type:"PathExpression",parts:[],depth:0}));e=n.name.original;f=n.name.type==="SubExpression";f&&this.accept(n.name);this.setupFullMustacheParams(n,u,undefined,!0);i=n.indent||"";this.options.preventIndent&&i&&(this.opcode("appendContent",i),i="");this.opcode("invokePartial",f,e,i);this.opcode("append")},PartialBlockStatement:function(n){this.PartialStatement(n)},MustacheStatement:function(n){this.SubExpression(n);n.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(n){this.DecoratorBlock(n)},ContentStatement:function(n){n.value&&this.opcode("appendContent",n.value)},CommentStatement:function(){},SubExpression:function(n){h(n);var t=this.classifySexpr(n);t==="simple"?this.simpleSexpr(n):t==="helper"?this.helperSexpr(n):this.ambiguousSexpr(n)},ambiguousSexpr:function(n,t,i){var r=n.path,u=r.parts[0],f=t!=null||i!=null;this.opcode("getContext",r.depth);this.opcode("pushProgram",t);this.opcode("pushProgram",i);r.strict=!0;this.accept(r);this.opcode("invokeAmbiguous",u,f)},simpleSexpr:function(n){var t=n.path;t.strict=!0;this.accept(t);this.opcode("resolvePossibleLambda")},helperSexpr:function(n,t,i){var o=this.setupFullMustacheParams(n,t,i),f=n.path,e=f.parts[0];if(this.options.knownHelpers[e])this.opcode("invokeKnownHelper",o.length,e);else if(this.options.knownHelpersOnly)throw new r["default"]("You specified knownHelpersOnly, but used the unknown helper "+e,n);else f.strict=!0,f.falsy=!0,this.accept(f),this.opcode("invokeHelper",o.length,f.original,u["default"].helpers.simpleId(f))},PathExpression:function(n){this.addDepth(n.depth);this.opcode("getContext",n.depth);var t=n.parts[0],i=u["default"].helpers.scopedId(n),r=!n.depth&&!i&&this.blockParamIndex(t);r?this.opcode("lookupBlockParam",r,n.parts):t?n.data?(this.options.data=!0,this.opcode("lookupData",n.depth,n.parts,n.strict)):this.opcode("lookupOnContext",n.parts,n.falsy,n.strict,i):this.opcode("pushContext")},StringLiteral:function(n){this.opcode("pushString",n.value)},NumberLiteral:function(n){this.opcode("pushLiteral",n.value)},BooleanLiteral:function(n){this.opcode("pushLiteral",n.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(n){var i=n.pairs,t=0,r=i.length;for(this.opcode("pushHash");t<r;t++)this.pushParam(i[t].value);while(t--)this.opcode("assignToHash",i[t].key);this.opcode("popHash")},opcode:function(n){this.opcodes.push({opcode:n,args:a.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(n){n&&(this.useDepths=!0)},classifySexpr:function(n){var f=u["default"].helpers.simpleId(n.path),e=f&&!!this.blockParamIndex(n.path.parts[0]),t=!e&&u["default"].helpers.helperExpression(n),i=!e&&(t||f),o,r;return i&&!t&&(o=n.path.parts[0],r=this.options,r.knownHelpers[o]?t=!0:r.knownHelpersOnly&&(i=!1)),t?"helper":i?"ambiguous":"simple"},pushParams:function(n){for(var t=0,i=n.length;t<i;t++)this.pushParam(n[t])},pushParam:function(n){var t=n.value!=null?n.value:n.original||"",i,r;this.stringParams?(t.replace&&(t=t.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".")),n.depth&&this.addDepth(n.depth),this.opcode("getContext",n.depth||0),this.opcode("pushStringParam",t,n.type),n.type==="SubExpression"&&this.accept(n)):(this.trackIds&&(i=undefined,!n.parts||u["default"].helpers.scopedId(n)||n.depth||(i=this.blockParamIndex(n.parts[0])),i?(r=n.parts.slice(1).join("."),this.opcode("pushId","BlockParam",i,r)):(t=n.original||t,t.replace&&(t=t.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"")),this.opcode("pushId",n.type,t))),this.accept(n))},setupFullMustacheParams:function(n,t,i,r){var u=n.params;return this.pushParams(u),this.opcode("pushProgram",t),this.opcode("pushProgram",i),n.hash?this.accept(n.hash):this.opcode("emptyHash",r),u},blockParamIndex:function(n){for(var i,r,t=0,u=this.options.blockParams.length;t<u;t++)if(i=this.options.blockParams[t],r=i&&f.indexOf(i,n),i&&r>=0)return[t,r]}}},function(n,t,i){"use strict";function u(n){this.value=n}function r(){}function a(n,t,i,r){var u=t.popStack(),f=0,e=i.length;for(n&&e--;f<e;f++)u=t.nameLookup(u,i[f],r);return n?[t.aliasable("container.strict"),"(",u,", ",t.quotedString(i[f]),")"]:u}var e=i(1)["default"];t.__esModule=!0;var o=i(4),h=i(6),f=e(h),c=i(5),l=i(43),s=e(l);r.prototype={nameLookup:function(n,t){return r.isValidJavaScriptVariableName(t)?[n,".",t]:[n,"[",JSON.stringify(t),"]"]},depthedLookup:function(n){return[this.aliasable("container.lookup"),'(depths, "',n,'")']},compilerInfo:function(){var n=o.COMPILER_REVISION,t=o.REVISION_CHANGES[n];return[n,t]},appendToBuffer:function(n,t,i){return c.isArray(n)||(n=[n]),n=this.source.wrap(n,t),this.environment.isSimple?["return ",n,";"]:i?["buffer += ",n,";"]:(n.appendToBuffer=!0,n)},initializeBuffer:function(){return this.quotedString("")},compile:function(n,t,i,r){var c,u;this.environment=n;this.options=t;this.stringParams=this.options.stringParams;this.trackIds=this.options.trackIds;this.precompile=!r;this.name=this.environment.name;this.isChild=!!i;this.context=i||{decorators:[],programs:[],environments:[]};this.preamble();this.stackSlot=0;this.stackVars=[];this.aliases={};this.registers={list:[]};this.hashes=[];this.compileStack=[];this.inlineStack=[];this.blockParams=[];this.compileChildren(n,t);this.useDepths=this.useDepths||n.useDepths||n.useDecorators||this.options.compat;this.useBlockParams=this.useBlockParams||n.useBlockParams;for(var a=n.opcodes,o=undefined,h=undefined,e=undefined,s=undefined,e=0,s=a.length;e<s;e++)o=a[e],this.source.currentLocation=o.loc,h=h||o.loc,this[o.opcode].apply(this,o.args);if(this.source.currentLocation=h,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new f["default"]("Compile completed with content left on stack");if(this.decorators.isEmpty()?this.decorators=undefined:(this.useDecorators=!0,this.decorators.prepend("var decorators = container.decorators;\n"),this.decorators.push("return fn;"),r?this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]):(this.decorators.prepend("function(fn, props, container, depth0, data, blockParams, depths) {\n"),this.decorators.push("}\n"),this.decorators=this.decorators.merge())),c=this.createFunctionContext(r),this.isChild)return c;u={compiler:this.compilerInfo(),main:c};this.decorators&&(u.main_d=this.decorators,u.useDecorators=!0);var v=this.context,l=v.programs,y=v.decorators;for(e=0,s=l.length;e<s;e++)l[e]&&(u[e]=l[e],y[e]&&(u[e+"_d"]=y[e],u.useDecorators=!0));return this.environment.usePartial&&(u.usePartial=!0),this.options.data&&(u.useData=!0),this.useDepths&&(u.useDepths=!0),this.useBlockParams&&(u.useBlockParams=!0),this.options.compat&&(u.compat=!0),r?u.compilerOptions=this.options:(u.compiler=JSON.stringify(u.compiler),this.source.currentLocation={start:{line:1,column:0}},u=this.objectLiteral(u),t.srcName?(u=u.toStringWithSourceMap({file:t.destName}),u.map=u.map&&u.map.toString()):u=u.toString()),u},preamble:function(){this.lastContext=0;this.source=new s["default"](this.options.srcName);this.decorators=new s["default"](this.options.srcName)},createFunctionContext:function(n){var u="",o=this.stackVars.concat(this.registers.list),f,i,r,t,e;o.length>0&&(u+=", "+o.join(", "));f=0;for(i in this.aliases)r=this.aliases[i],this.aliases.hasOwnProperty(i)&&r.children&&r.referenceCount>1&&(u+=", alias"+ ++f+"="+i,r.children[0]="alias"+f);return t=["container","depth0","helpers","partials","data"],(this.useBlockParams||this.useDepths)&&t.push("blockParams"),this.useDepths&&t.push("depths"),e=this.mergeSource(u),n?(t.push(e),Function.apply(this,t)):this.source.wrap(["function(",t.join(","),") {\n  ",e,"}"])},mergeSource:function(n){var e=this.environment.isSimple,f=!this.forceBuffer,r=undefined,u=undefined,t=undefined,i=undefined;return this.source.each(function(n){n.appendToBuffer?(t?n.prepend("  + "):t=n,i=n):(t&&(u?t.prepend("buffer += "):r=!0,i.add(";"),t=i=undefined),u=!0,e||(f=!1))}),f?t?(t.prepend("return "),i.add(";")):u||this.source.push('return "";'):(n+=", buffer = "+(r?"":this.initializeBuffer()),t?(t.prepend("return buffer + "),i.add(";")):this.source.push("return buffer;")),n&&this.source.prepend("var "+n.substring(2)+(r?"":";\n")),this.source.merge()},blockValue:function(n){var r=this.aliasable("helpers.blockHelperMissing"),t=[this.contextName(0)],i;this.setupHelperArgs(n,0,t);i=this.popStack();t.splice(1,0,i);this.push(this.source.functionCall(r,"call",t))},ambiguousBlockValue:function(){var i=this.aliasable("helpers.blockHelperMissing"),n=[this.contextName(0)],t;this.setupHelperArgs("",0,n,!0);this.flushInline();t=this.topStack();n.splice(1,0,t);this.pushSource(["if (!",this.lastHelper,") { ",t," = ",this.source.functionCall(i,"call",n),"}"])},appendContent:function(n){this.pendingContent?n=this.pendingContent+n:this.pendingLocation=this.source.currentLocation;this.pendingContent=n},append:function(){if(this.isInline())this.replaceStack(function(n){return[" != null ? ",n,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var n=this.popStack();this.pushSource(["if (",n," != null) { ",this.appendToBuffer(n,undefined,!0)," }"]);this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",undefined,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(n){this.lastContext=n},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(n,t,i,r){var u=0;r||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(n[u++]));this.resolvePath("context",n,u,t,i)},lookupBlockParam:function(n,t){this.useBlockParams=!0;this.push(["blockParams[",n[0],"][",n[1],"]"]);this.resolvePath("context",t,1)},lookupData:function(n,t,i){n?this.pushStackLiteral("container.data(data, "+n+")"):this.pushStackLiteral("data");this.resolvePath("data",t,0,!0,i)},resolvePath:function(n,t,i,r,u){var e=this,f;if(this.options.strict||this.options.assumeObjects){this.push(a(this.options.strict&&u,this,t,n));return}for(f=t.length;i<f;i++)this.replaceStack(function(u){var f=e.nameLookup(u,t[i],n);return r?[" && ",f]:[" != null ? ",f," : ",u]})},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(n,t){this.pushContext();this.pushString(t);t!=="SubExpression"&&(typeof n=="string"?this.pushString(n):this.pushStackLiteral(n))},emptyHash:function(n){this.trackIds&&this.push("{}");this.stringParams&&(this.push("{}"),this.push("{}"));this.pushStackLiteral(n?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash);this.hash={values:[],types:[],contexts:[],ids:[]}},popHash:function(){var n=this.hash;this.hash=this.hashes.pop();this.trackIds&&this.push(this.objectLiteral(n.ids));this.stringParams&&(this.push(this.objectLiteral(n.contexts)),this.push(this.objectLiteral(n.types)));this.push(this.objectLiteral(n.values))},pushString:function(n){this.pushStackLiteral(this.quotedString(n))},pushLiteral:function(n){this.pushStackLiteral(n)},pushProgram:function(n){n!=null?this.pushStackLiteral(this.programExpression(n)):this.pushStackLiteral(null)},registerDecorator:function(n,t){var i=this.nameLookup("decorators",t,"decorator"),r=this.setupHelperArgs(t,n);this.decorators.push(["fn = ",this.decorators.functionCall(i,"",["fn","props","container",r])," || fn;"])},invokeHelper:function(n,t,i){var f=this.popStack(),u=this.setupHelper(n,t),e=i?[u.name," || "]:"",r=["("].concat(e,f);this.options.strict||r.push(" || ",this.aliasable("helpers.helperMissing"));r.push(")");this.push(this.source.functionCall(r,"call",u.callParams))},invokeKnownHelper:function(n,t){var i=this.setupHelper(n,t);this.push(this.source.functionCall(i.name,"call",i.callParams))},invokeAmbiguous:function(n,t){var u;this.useRegister("helper");u=this.popStack();this.emptyHash();var i=this.setupHelper(0,n,t),f=this.lastHelper=this.nameLookup("helpers",n,"helper"),r=["(","(helper = ",f," || ",u,")"];this.options.strict||(r[0]="(helper = ",r.push(" != null ? helper : ",this.aliasable("helpers.helperMissing")));this.push(["(",r,i.paramsInit?["),(",i.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",i.callParams)," : helper))"])},invokePartial:function(n,t,i){var u=[],r=this.setupParams(t,1,u);n&&(t=this.popStack(),delete r.name);i&&(r.indent=JSON.stringify(i));r.helpers="helpers";r.partials="partials";r.decorators="container.decorators";n?u.unshift(t):u.unshift(this.nameLookup("partials",t,"partial"));this.options.compat&&(r.depths="depths");r=this.objectLiteral(r);u.push(r);this.push(this.source.functionCall("container.invokePartial","",u))},assignToHash:function(n){var f=this.popStack(),i=undefined,r=undefined,u=undefined,t;this.trackIds&&(u=this.popStack());this.stringParams&&(r=this.popStack(),i=this.popStack());t=this.hash;i&&(t.contexts[n]=i);r&&(t.types[n]=r);u&&(t.ids[n]=u);t.values[n]=f},pushId:function(n,t,i){n==="BlockParam"?this.pushStackLiteral("blockParams["+t[0]+"].path["+t[1]+"]"+(i?" + "+JSON.stringify("."+i):"")):n==="PathExpression"?this.pushString(t):n==="SubExpression"?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:r,compileChildren:function(n,t){for(var r,u,o=n.children,i=undefined,f=undefined,e=0,s=o.length;e<s;e++)i=o[e],f=new this.compiler,r=this.matchExistingProgram(i),r==null?(this.context.programs.push(""),u=this.context.programs.length,i.index=u,i.name="program"+u,this.context.programs[u]=f.compile(i,t,this.context,!this.precompile),this.context.decorators[u]=f.decorators,this.context.environments[u]=i,this.useDepths=this.useDepths||f.useDepths,this.useBlockParams=this.useBlockParams||f.useBlockParams,i.useDepths=this.useDepths,i.useBlockParams=this.useBlockParams):(i.index=r.index,i.name="program"+r.index,this.useDepths=this.useDepths||r.useDepths,this.useBlockParams=this.useBlockParams||r.useBlockParams)},matchExistingProgram:function(n){for(var i,t=0,r=this.context.environments.length;t<r;t++)if(i=this.context.environments[t],i&&i.equals(n))return i},programExpression:function(n){var i=this.environment.children[n],t=[i.index,"data",i.blockParams];return(this.useBlockParams||this.useDepths)&&t.push("blockParams"),this.useDepths&&t.push("depths"),"container.program("+t.join(", ")+")"},useRegister:function(n){this.registers[n]||(this.registers[n]=!0,this.registers.list.push(n))},push:function(n){return n instanceof u||(n=this.source.wrap(n)),this.inlineStack.push(n),n},pushStackLiteral:function(n){this.push(new u(n))},pushSource:function(n){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=undefined);n&&this.source.push(n)},replaceStack:function(n){var r=["("],t=undefined,e=undefined,o=undefined,i,s,h;if(!this.isInline())throw new f["default"]("replaceStack on non-inline");i=this.popStack(!0);i instanceof u?(t=[i.value],r=["(",t],o=!0):(e=!0,s=this.incrStack(),r=["((",this.push(s)," = ",i,")"],t=this.topStack());h=n.call(this,t);o||this.popStack();e&&this.stackSlot--;this.push(r.concat(h,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var r=this.inlineStack,n,f,t,i;for(this.inlineStack=[],n=0,f=r.length;n<f;n++)t=r[n],t instanceof u?this.compileStack.push(t):(i=this.incrStack(),this.pushSource([i," = ",t,";"]),this.compileStack.push(i))},isInline:function(){return this.inlineStack.length},popStack:function(n){var i=this.isInline(),t=(i?this.inlineStack:this.compileStack).pop();if(!n&&t instanceof u)return t.value;if(!i){if(!this.stackSlot)throw new f["default"]("Invalid stack pop");this.stackSlot--}return t},topStack:function(){var t=this.isInline()?this.inlineStack:this.compileStack,n=t[t.length-1];return n instanceof u?n.value:n},contextName:function(n){return this.useDepths&&n?"depths["+n+"]":"depth"+n},quotedString:function(n){return this.source.quotedString(n)},objectLiteral:function(n){return this.source.objectLiteral(n)},aliasable:function(n){var t=this.aliases[n];return t?(t.referenceCount++,t):(t=this.aliases[n]=this.source.wrap(n),t.aliasable=!0,t.referenceCount=1,t)},setupHelper:function(n,t,i){var r=[],u=this.setupHelperArgs(t,n,r,i),f=this.nameLookup("helpers",t,"helper"),e=this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})");return{params:r,paramsInit:u,name:f,callParams:[e].concat(r)}},setupParams:function(n,t,i){var r={},o=[],s=[],h=[],c=!i,l=undefined,f,e,u;for(c&&(i=[]),r.name=this.quotedString(n),r.hash=this.popStack(),this.trackIds&&(r.hashIds=this.popStack()),this.stringParams&&(r.hashTypes=this.popStack(),r.hashContexts=this.popStack()),f=this.popStack(),e=this.popStack(),(e||f)&&(r.fn=e||"container.noop",r.inverse=f||"container.noop"),u=t;u--;)l=this.popStack(),i[u]=l,this.trackIds&&(h[u]=this.popStack()),this.stringParams&&(s[u]=this.popStack(),o[u]=this.popStack());return c&&(r.args=this.source.generateArray(i)),this.trackIds&&(r.ids=this.source.generateArray(h)),this.stringParams&&(r.types=this.source.generateArray(s),r.contexts=this.source.generateArray(o)),this.options.data&&(r.data="data"),this.useBlockParams&&(r.blockParams="blockParams"),r},setupHelperArgs:function(n,t,i,r){var u=this.setupParams(n,t,i);return u=this.objectLiteral(u),r?(this.useRegister("options"),i.push("options"),["options=",u]):i?(i.push(u),""):u}},function(){for(var t="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),i=r.RESERVED_WORDS={},n=0,u=t.length;n<u;n++)i[t[n]]=!0}();r.isValidJavaScriptVariableName=function(n){return!r.RESERVED_WORDS[n]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(n)};t["default"]=r;n.exports=t["default"]},function(n,t,i){"use strict";function f(n,t,i){var f,r,e;if(u.isArray(n)){for(f=[],r=0,e=n.length;r<e;r++)f.push(t.wrap(n[r],i));return f}return typeof n=="boolean"||typeof n=="number"?n+"":n}function o(n){this.srcFile=n;this.source=[]}var u,r,e;t.__esModule=!0;u=i(5);r=undefined;try{!1&&(e=require("source-map"),r=e.SourceNode)}catch(s){}r||(r=function(n,t,i,r){this.src="";r&&this.add(r)},r.prototype={add:function(n){u.isArray(n)&&(n=n.join(""));this.src+=n},prepend:function(n){u.isArray(n)&&(n=n.join(""));this.src=n+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}});o.prototype={isEmpty:function(){return!this.source.length},prepend:function(n,t){this.source.unshift(this.wrap(n,t))},push:function(n,t){this.source.push(this.wrap(n,t))},merge:function(){var n=this.empty();return this.each(function(t){n.add(["  ",t,"\n"])}),n},each:function(n){for(var t=0,i=this.source.length;t<i;t++)n(this.source[t])},empty:function(){var n=this.currentLocation||{start:{}};return new r(n.start.line,n.start.column,this.srcFile)},wrap:function(n){var t=arguments.length<=1||arguments[1]===undefined?this.currentLocation||{start:{}}:arguments[1];return n instanceof r?n:(n=f(n,this,t),new r(t.start.line,t.start.column,this.srcFile,n))},functionCall:function(n,t,i){return i=this.generateList(i),this.wrap([n,t?"."+t+"(":"(",i,")"])},quotedString:function(n){return'"'+(n+"").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(n){var u=[],t,r,i;for(t in n)n.hasOwnProperty(t)&&(r=f(n[t],this),r!=="undefined"&&u.push([this.quotedString(t),":",r]));return i=this.generateList(u),i.prepend("{"),i.add("}"),i},generateList:function(n){for(var i=this.empty(),t=0,r=n.length;t<r;t++)t&&i.add(","),i.add(f(n[t],this));return i},generateArray:function(n){var t=this.generateList(n);return t.prepend("["),t.add("]"),t}};t["default"]=o;n.exports=t["default"]}])}),function(n,t){if(typeof define=="function"&&define.amd)define(["underscore","jquery","exports"],function(i,r,u){n.Backbone=t(n,u,i,r)});else if(typeof exports!="undefined"){var i=require("underscore");t(n,exports,i)}else n.Backbone=t(n,{},n._,n.jQuery||n.Zepto||n.ender||n.$)}(this,function(n,t,i,r){var rt=n.Backbone,l=[],wt=l.push,s=l.slice,bt=l.splice,e,p,w,b,d,g,it,a,o;t.VERSION="1.1.2";t.$=r;t.noConflict=function(){return n.Backbone=rt,this};t.emulateHTTP=!1;t.emulateJSON=!1;var u=t.Events={on:function(n,t,i){if(!h(this,"on",n,[t,i])||!t)return this;this._events||(this._events={});var r=this._events[n]||(this._events[n]=[]);return r.push({callback:t,context:i,ctx:i||this}),this},once:function(n,t,r){if(!h(this,"once",n,[t,r])||!t)return this;var f=this,u=i.once(function(){f.off(n,u);t.apply(this,arguments)});u._callback=t;return this.on(n,u,r)},off:function(n,t,r){var o,u,s,c,f,l,e,a;if(!this._events||!h(this,"off",n,[t,r]))return this;if(!n&&!t&&!r)return this._events=void 0,this;for(c=n?[n]:i.keys(this._events),f=0,l=c.length;f<l;f++)if(n=c[f],s=this._events[n]){if(this._events[n]=o=[],t||r)for(e=0,a=s.length;e<a;e++)u=s[e],(t&&t!==u.callback&&t!==u.callback._callback||r&&r!==u.context)&&o.push(u);o.length||delete this._events[n]}return this},trigger:function(n){var t,i,r;return this._events?(t=s.call(arguments,1),!h(this,"trigger",n,t))?this:(i=this._events[n],r=this._events.all,i&&y(i,t),r&&y(r,arguments),this):this},stopListening:function(n,t,r){var u=this._listeningTo,e,f;if(!u)return this;e=!t&&!r;r||typeof t!="object"||(r=this);n&&((u={})[n._listenId]=n);for(f in u)n=u[f],n.off(t,r,this),(e||i.isEmpty(n._events))&&delete this._listeningTo[f];return this}},v=/\s+/,h=function(n,t,i,r){var f,e,u,o;if(!i)return!0;if(typeof i=="object"){for(f in i)n[t].apply(n,[f,i[f]].concat(r));return!1}if(v.test(i)){for(e=i.split(v),u=0,o=e.length;u<o;u++)n[t].apply(n,[e[u]].concat(r));return!1}return!0},y=function(n,t){var i,r=-1,u=n.length,f=t[0],e=t[1],o=t[2];switch(t.length){case 0:while(++r<u)(i=n[r]).callback.call(i.ctx);return;case 1:while(++r<u)(i=n[r]).callback.call(i.ctx,f);return;case 2:while(++r<u)(i=n[r]).callback.call(i.ctx,f,e);return;case 3:while(++r<u)(i=n[r]).callback.call(i.ctx,f,e,o);return;default:while(++r<u)(i=n[r]).callback.apply(i.ctx,t);return}};i.each({listenTo:"on",listenToOnce:"once"},function(n,t){u[t]=function(t,r,u){var f=this._listeningTo||(this._listeningTo={}),e=t._listenId||(t._listenId=i.uniqueId("l"));return f[e]=t,u||typeof r!="object"||(u=this),t[n](r,u,this),this}});u.bind=u.on;u.unbind=u.off;i.extend(t,u);e=t.Model=function(n,t){var r=n||{};t||(t={});this.cid=i.uniqueId("c");this.attributes={};t.collection&&(this.collection=t.collection);t.parse&&(r=this.parse(r,t)||{});r=i.defaults({},r,i.result(this,"defaults"));this.set(r,t);this.changed={};this.initialize.apply(this,arguments)};i.extend(e.prototype,u,{changed:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(){return i.clone(this.attributes)},sync:function(){return t.sync.apply(this,arguments)},get:function(n){return this.attributes[n]},escape:function(n){return i.escape(this.get(n))},has:function(n){return this.get(n)!=null},set:function(n,t,r){var u,f,l,e,h,c,a,o,s,v;if(n==null)return this;if(typeof n=="object"?(f=n,r=t):(f={})[n]=t,r||(r={}),!this._validate(f,r))return!1;l=r.unset;h=r.silent;e=[];c=this._changing;this._changing=!0;c||(this._previousAttributes=i.clone(this.attributes),this.changed={});o=this.attributes;a=this._previousAttributes;this.idAttribute in f&&(this.id=f[this.idAttribute]);for(u in f)t=f[u],i.isEqual(o[u],t)||e.push(u),i.isEqual(a[u],t)?delete this.changed[u]:this.changed[u]=t,l?delete o[u]:o[u]=t;if(!h)for(e.length&&(this._pending=r),s=0,v=e.length;s<v;s++)this.trigger("change:"+e[s],this,o[e[s]],r);if(c)return this;if(!h)while(this._pending)r=this._pending,this._pending=!1,this.trigger("change",this,r);return this._pending=!1,this._changing=!1,this},unset:function(n,t){return this.set(n,void 0,i.extend({},t,{unset:!0}))},clear:function(n){var t={};for(var r in this.attributes)t[r]=void 0;return this.set(t,i.extend({},n,{unset:!0}))},hasChanged:function(n){return n==null?!i.isEmpty(this.changed):i.has(this.changed,n)},changedAttributes:function(n){var u,t,f,r;if(!n)return this.hasChanged()?i.clone(this.changed):!1;t=!1;f=this._changing?this._previousAttributes:this.attributes;for(r in n)i.isEqual(f[r],u=n[r])||((t||(t={}))[r]=u);return t},previous:function(n){return n==null||!this._previousAttributes?null:this._previousAttributes[n]},previousAttributes:function(){return i.clone(this._previousAttributes)},fetch:function(n){n=n?i.clone(n):{};n.parse===void 0&&(n.parse=!0);var t=this,r=n.success;return n.success=function(i){if(!t.set(t.parse(i,n),n))return!1;r&&r(t,i,n);t.trigger("sync",t,i,n)},o(this,n),this.sync("read",this,n)},save:function(n,t,r){var u,e,c,s=this.attributes,f,h;if(n==null||typeof n=="object"?(u=n,r=t):(u={})[n]=t,r=i.extend({validate:!0},r),u&&!r.wait){if(!this.set(u,r))return!1}else if(!this._validate(u,r))return!1;return u&&r.wait&&(this.attributes=i.extend({},s,u)),r.parse===void 0&&(r.parse=!0),f=this,h=r.success,r.success=function(n){f.attributes=s;var t=f.parse(n,r);if(r.wait&&(t=i.extend(u||{},t)),i.isObject(t)&&!f.set(t,r))return!1;h&&h(f,n,r);f.trigger("sync",f,n,r)},o(this,r),e=this.isNew()?"create":r.patch?"patch":"update",e==="patch"&&(r.attrs=u),c=this.sync(e,this,r),u&&r.wait&&(this.attributes=s),c},destroy:function(n){var f;n=n?i.clone(n):{};var t=this,r=n.success,u=function(){t.trigger("destroy",t,t.collection,n)};return(n.success=function(i){(n.wait||t.isNew())&&u();r&&r(t,i,n);t.isNew()||t.trigger("sync",t,i,n)},this.isNew())?(n.success(),!1):(o(this,n),f=this.sync("delete",this,n),n.wait||u(),f)},url:function(){var n=i.result(this,"urlRoot")||i.result(this.collection,"url")||a();return this.isNew()?n:n.replace(/([^\/])$/,"$1/")+encodeURIComponent(this.id)},parse:function(n){return n},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(n){return this._validate({},i.extend(n||{},{validate:!0}))},_validate:function(n,t){if(!t.validate||!this.validate)return!0;n=i.extend({},this.attributes,n);var r=this.validationError=this.validate(n,t)||null;return r?(this.trigger("invalid",this,r,i.extend(t,{validationError:r})),!1):!0}});p=["keys","values","pairs","invert","pick","omit"];i.each(p,function(n){e.prototype[n]=function(){var t=s.call(arguments);return t.unshift(this.attributes),i[n].apply(i,t)}});var c=t.Collection=function(n,t){t||(t={});t.model&&(this.model=t.model);t.comparator!==void 0&&(this.comparator=t.comparator);this._reset();this.initialize.apply(this,arguments);n&&this.reset(n,i.extend({silent:!0},t))},ut={add:!0,remove:!0,merge:!0},ft={add:!0,remove:!1};i.extend(c.prototype,u,{model:e,initialize:function(){},toJSON:function(n){return this.map(function(t){return t.toJSON(n)})},sync:function(){return t.sync.apply(this,arguments)},add:function(n,t){return this.set(n,i.extend({merge:!1},t,ft))},remove:function(n,t){var e=!i.isArray(n),u,o,f,r;for(n=e?[n]:i.clone(n),t||(t={}),u=0,o=n.length;u<o;u++)(r=n[u]=this.get(n[u]),r)&&(delete this._byId[r.id],delete this._byId[r.cid],f=this.indexOf(r),this.models.splice(f,1),this.length--,t.silent||(t.index=f,r.trigger("remove",r,this,t)),this._removeReference(r,t));return e?n[0]:n},set:function(n,t){var v,k;t=i.defaults({},t,ut);t.parse&&(n=this.parse(n,t));v=!i.isArray(n);n=v?n?[n]:[]:i.clone(n);for(var d,u,f,c,l,y=t.at,nt=this.model,p=this.comparator&&y==null&&t.sort!==!1,tt=i.isString(this.comparator)?this.comparator:null,s=[],w=[],a={},g=t.add,it=t.merge,b=t.remove,h=!p&&g&&b?[]:!1,r=0,o=n.length;r<o;r++){if(f=n[r]||{},d=f instanceof e?u=f:f[nt.prototype.idAttribute||"id"],c=this.get(d))b&&(a[c.cid]=!0),it&&(f=f===u?u.attributes:f,t.parse&&(f=c.parse(f,t)),c.set(f,t),p&&!l&&c.hasChanged(tt)&&(l=!0)),n[r]=c;else if(g){if(u=n[r]=this._prepareModel(f,t),!u)continue;s.push(u);this._addReference(u,t)}u=c||u;h&&(u.isNew()||!a[u.id])&&h.push(u);a[u.id]=!0}if(b){for(r=0,o=this.length;r<o;++r)a[(u=this.models[r]).cid]||w.push(u);w.length&&this.remove(w,t)}if(s.length||h&&h.length)if(p&&(l=!0),this.length+=s.length,y!=null)for(r=0,o=s.length;r<o;r++)this.models.splice(y+r,0,s[r]);else for(h&&(this.models.length=0),k=h||s,r=0,o=k.length;r<o;r++)this.models.push(k[r]);if(l&&this.sort({silent:!0}),!t.silent){for(r=0,o=s.length;r<o;r++)(u=s[r]).trigger("add",u,this,t);(l||h&&h.length)&&this.trigger("sort",this,t)}return v?n[0]:n},reset:function(n,t){t||(t={});for(var r=0,u=this.models.length;r<u;r++)this._removeReference(this.models[r],t);return t.previousModels=this.models,this._reset(),n=this.add(n,i.extend({silent:!0},t)),t.silent||this.trigger("reset",this,t),n},push:function(n,t){return this.add(n,i.extend({at:this.length},t))},pop:function(n){var t=this.at(this.length-1);return this.remove(t,n),t},unshift:function(n,t){return this.add(n,i.extend({at:0},t))},shift:function(n){var t=this.at(0);return this.remove(t,n),t},slice:function(){return s.apply(this.models,arguments)},get:function(n){if(n!=null)return this._byId[n]||this._byId[n.id]||this._byId[n.cid]},at:function(n){return this.models[n]},where:function(n,t){return i.isEmpty(n)?t?void 0:[]:this[t?"find":"filter"](function(t){for(var i in n)if(n[i]!==t.get(i))return!1;return!0})},findWhere:function(n){return this.where(n,!0)},sort:function(n){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");return n||(n={}),i.isString(this.comparator)||this.comparator.length===1?this.models=this.sortBy(this.comparator,this):this.models.sort(i.bind(this.comparator,this)),n.silent||this.trigger("sort",this,n),this},pluck:function(n){return i.invoke(this.models,"get",n)},fetch:function(n){n=n?i.clone(n):{};n.parse===void 0&&(n.parse=!0);var r=n.success,t=this;return n.success=function(i){var u=n.reset?"reset":"set";t[u](i,n);r&&r(t,i,n);t.trigger("sync",t,i,n)},o(this,n),this.sync("read",this,n)},create:function(n,t){if(t=t?i.clone(t):{},!(n=this._prepareModel(n,t)))return!1;t.wait||this.add(n,t);var u=this,r=t.success;return t.success=function(n,i){t.wait&&u.add(n,t);r&&r(n,i,t)},n.save(null,t),n},parse:function(n){return n},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0;this.models=[];this._byId={}},_prepareModel:function(n,t){if(n instanceof e)return n;t=t?i.clone(t):{};t.collection=this;var r=new this.model(n,t);return r.validationError?(this.trigger("invalid",this,r.validationError,t),!1):r},_addReference:function(n){this._byId[n.cid]=n;n.id!=null&&(this._byId[n.id]=n);n.collection||(n.collection=this);n.on("all",this._onModelEvent,this)},_removeReference:function(n){this===n.collection&&delete n.collection;n.off("all",this._onModelEvent,this)},_onModelEvent:function(n,t,i,r){(n!=="add"&&n!=="remove"||i===this)&&(n==="destroy"&&this.remove(t,r),t&&n==="change:"+t.idAttribute&&(delete this._byId[t.previous(t.idAttribute)],t.id!=null&&(this._byId[t.id]=t)),this.trigger.apply(this,arguments))}});w=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","difference","indexOf","shuffle","lastIndexOf","isEmpty","chain","sample"];i.each(w,function(n){c.prototype[n]=function(){var t=s.call(arguments);return t.unshift(this.models),i[n].apply(i,t)}});b=["groupBy","countBy","sortBy","indexBy"];i.each(b,function(n){c.prototype[n]=function(t,r){var u=i.isFunction(t)?t:function(n){return n.get(t)};return i[n](this.models,u,r)}});var k=t.View=function(n){this.cid=i.uniqueId("view");n||(n={});i.extend(this,i.pick(n,ot));this._ensureElement();this.initialize.apply(this,arguments);this.delegateEvents()},et=/^(\S+)\s*(.*)$/,ot=["model","collection","el","id","attributes","className","tagName","events"];i.extend(k.prototype,u,{tagName:"div",$:function(n){return this.$el.find(n)},initialize:function(){},render:function(){return this},remove:function(){return this.$el.remove(),this.stopListening(),this},setElement:function(n,i){return this.$el&&this.undelegateEvents(),this.$el=n instanceof t.$?n:t.$(n),this.el=this.$el[0],i!==!1&&this.delegateEvents(),this},delegateEvents:function(n){var r,t;if(!(n||(n=i.result(this,"events"))))return this;this.undelegateEvents();for(r in n)if(t=n[r],i.isFunction(t)||(t=this[n[r]]),t){var f=r.match(et),u=f[1],e=f[2];if(t=i.bind(t,this),u+=".delegateEvents"+this.cid,e==="")this.$el.on(u,t);else this.$el.on(u,e,t)}return this},undelegateEvents:function(){return this.$el.off(".delegateEvents"+this.cid),this},_ensureElement:function(){var n,r;this.el?this.setElement(i.result(this,"el"),!1):(n=i.extend({},i.result(this,"attributes")),this.id&&(n.id=i.result(this,"id")),this.className&&(n["class"]=i.result(this,"className")),r=t.$("<"+i.result(this,"tagName")+">").attr(n),this.setElement(r,!1))}});t.sync=function(n,r,u){var e=g[n],f,o,s;return i.defaults(u||(u={}),{emulateHTTP:t.emulateHTTP,emulateJSON:t.emulateJSON}),f={type:e,dataType:"json"},u.url||(f.url=i.result(r,"url")||a()),u.data==null&&r&&(n==="create"||n==="update"||n==="patch")&&(f.contentType="application/json",f.data=JSON.stringify(u.attrs||r.toJSON(u))),u.emulateJSON&&(f.contentType="application/x-www-form-urlencoded",f.data=f.data?{model:f.data}:{}),u.emulateHTTP&&(e==="PUT"||e==="DELETE"||e==="PATCH")&&(f.type="POST",u.emulateJSON&&(f.data._method=e),o=u.beforeSend,u.beforeSend=function(n){return n.setRequestHeader("X-HTTP-Method-Override",e),o?o.apply(this,arguments):void 0}),f.type==="GET"||u.emulateJSON||(f.processData=!1),f.type==="PATCH"&&d&&(f.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")}),s=u.xhr=t.ajax(i.extend(f,u)),r.trigger("request",r,s,u),s};d=typeof window!="undefined"&&!!window.ActiveXObject&&!(window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent);g={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};t.ajax=function(){return t.$.ajax.apply(t.$,arguments)};var nt=t.Router=function(n){n||(n={});n.routes&&(this.routes=n.routes);this._bindRoutes();this.initialize.apply(this,arguments)},st=/\((.*?)\)/g,ht=/(\(\?)?:\w+/g,ct=/\*\w+/g,lt=/[\-{}\[\]+?.,\\\^$|#\s]/g;i.extend(nt.prototype,u,{initialize:function(){},route:function(n,r,u){i.isRegExp(n)||(n=this._routeToRegExp(n));i.isFunction(r)&&(u=r,r="");u||(u=this[r]);var f=this;return t.history.route(n,function(i){var e=f._extractParameters(n,i);f.execute(u,e);f.trigger.apply(f,["route:"+r].concat(e));f.trigger("route",r,e);t.history.trigger("route",f,r,e)}),this},execute:function(n,t){n&&n.apply(this,t)},navigate:function(n,i){return t.history.navigate(n,i),this},_bindRoutes:function(){if(this.routes){this.routes=i.result(this,"routes");for(var n,t=i.keys(this.routes);(n=t.pop())!=null;)this.route(n,this.routes[n])}},_routeToRegExp:function(n){return n=n.replace(lt,"\\$&").replace(st,"(?:$1)?").replace(ht,function(n,t){return t?n:"([^/?]+)"}).replace(ct,"([^?]*?)"),new RegExp("^"+n+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(n,t){var r=n.exec(t).slice(1);return i.map(r,function(n,t){return t===r.length-1?n||null:n?decodeURIComponent(n):null})}});var f=t.History=function(){this.handlers=[];i.bindAll(this,"checkUrl");typeof window!="undefined"&&(this.location=window.location,this.history=window.history)},tt=/^[#\/]|\s+$/g,at=/^\/+|\/+$/g,vt=/msie [\w.]+/,yt=/\/$/,pt=/#.*$/;return f.started=!1,i.extend(f.prototype,u,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root},getHash:function(n){var t=(n||this).location.href.match(/#(.*)$/);return t?t[1]:""},getFragment:function(n,t){if(n==null)if(this._hasPushState||!this._wantsHashChange||t){n=decodeURI(this.location.pathname+this.location.search);var i=this.root.replace(yt,"");n.indexOf(i)||(n=n.slice(i.length))}else n=this.getHash();return n.replace(tt,"")},start:function(n){var o,s;if(f.started)throw new Error("Backbone.history has already been started");f.started=!0;this.options=i.extend({root:"/"},this.options,n);this.root=this.options.root;this._wantsHashChange=this.options.hashChange!==!1;this._wantsPushState=!!this.options.pushState;this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var r=this.getFragment(),u=document.documentMode,e=vt.exec(navigator.userAgent.toLowerCase())&&(!u||u<=7);if(this.root=("/"+this.root+"/").replace(at,"/"),e&&this._wantsHashChange&&(o=t.$('<iframe src="javascript:0" tabindex="-1">'),this.iframe=o.hide().appendTo("body")[0].contentWindow,this.navigate(r)),this._hasPushState)t.$(window).on("popstate",this.checkUrl);else if(this._wantsHashChange&&"onhashchange"in window&&!e)t.$(window).on("hashchange",this.checkUrl);else this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval));if(this.fragment=r,s=this.location,this._wantsHashChange&&this._wantsPushState)if(this._hasPushState||this.atRoot())this._hasPushState&&this.atRoot()&&s.hash&&(this.fragment=this.getHash().replace(tt,""),this.history.replaceState({},document.title,this.root+this.fragment));else return this.fragment=this.getFragment(null,!0),this.location.replace(this.root+"#"+this.fragment),!0;if(!this.options.silent)return this.loadUrl()},stop:function(){t.$(window).off("popstate",this.checkUrl).off("hashchange",this.checkUrl);this._checkUrlInterval&&clearInterval(this._checkUrlInterval);f.started=!1},route:function(n,t){this.handlers.unshift({route:n,callback:t})},checkUrl:function(){var n=this.getFragment();if(n===this.fragment&&this.iframe&&(n=this.getFragment(this.getHash(this.iframe))),n===this.fragment)return!1;this.iframe&&this.navigate(n);this.loadUrl()},loadUrl:function(n){return n=this.fragment=this.getFragment(n),i.any(this.handlers,function(t){if(t.route.test(n))return t.callback(n),!0})},navigate:function(n,t){if(!f.started)return!1;t&&t!==!0||(t={trigger:!!t});var i=this.root+(n=this.getFragment(n||""));if(n=n.replace(pt,""),this.fragment!==n){if(this.fragment=n,n===""&&i!=="/"&&(i=i.slice(0,-1)),this._hasPushState)this.history[t.replace?"replaceState":"pushState"]({},document.title,i);else if(this._wantsHashChange)this._updateHash(this.location,n,t.replace),this.iframe&&n!==this.getFragment(this.getHash(this.iframe))&&(t.replace||this.iframe.document.open().close(),this._updateHash(this.iframe.location,n,t.replace));else return this.location.assign(i);if(t.trigger)return this.loadUrl(n)}},_updateHash:function(n,t,i){if(i){var r=n.href.replace(/(javascript:|#).*$/,"");n.replace(r+"#"+t)}else n.hash="#"+t}}),t.history=new f,it=function(n,t){var u=this,r,f;return r=n&&i.has(n,"constructor")?n.constructor:function(){return u.apply(this,arguments)},i.extend(r,u,t),f=function(){this.constructor=r},f.prototype=u.prototype,r.prototype=new f,n&&i.extend(r.prototype,n),r.__super__=u.prototype,r},e.extend=c.extend=nt.extend=k.extend=f.extend=it,a=function(){throw new Error('A "url" property or function must be specified');},o=function(n,t){var i=t.error;t.error=function(r){i&&i(n,r,t);n.trigger("error",n,r,t)}},t});!function(n){function e(n,u){if(i=window,r=u,this._target=n,this._version=c,this._handlers=t,!this._target)throw new Error("No target specified");if(!this._target.postMessage)throw new Error("Target element is not supported");if(i.addEventListener)i.addEventListener("message",o,!1);else{if(!i.attachEvent)throw new Error("Cannot attach event listener");i.attachEvent("onmessage",o)}return this}var c="1.1.1",t={},l=1,i=null,r=null,u=function(n){return n&&"function"==typeof n},a=function(){return l++},f=function(n,t){var i,f,r;if("undefined"!=typeof n&&u(t))for(i=0;i<n.length;i++)if(f=n[i],r=t.apply(n,[f,i]),"undefined"!=typeof r)return r},v=function(n,t,i){t=t||"";i=i;var u={type:t,data:i};n.postMessage(JSON.stringify(u),r||"*")},o=function(n){var t,u,f;if(!r||r===n.origin){t={};try{t=JSON.parse(n.data)}catch(n){return}u=t.data||{};f=t.type||"";n.source!=i&&(h(f,u,n),h("message",u,n))}},s=function(n,i,r,e){if(t[n]||(t[n]=[]),u(i)){i.guid||(i.guid=a());var o=f(t[n],function(n){if(n.fn.guid===i.guid)return!0});o||t[n].push({fn:i,once:!!r,ctx:e})}},y=function(n,i){if(t&&n&&t[n]){if(!u(i))return void delete t[n];f(t[n],function(n,t){n.fn.guid===i.guid&&this.splice(t,1)});0===t[n].length&&delete t[n]}},h=function(n,i,r){t&&n&&t[n]&&f(t[n],function(n,t){if(u(n.fn)){var f=[r];n.fn.apply(n.ctx||null,f.concat(i))}n.once&&this.splice(t,1)})};e.prototype={on:function(n,t,i){s(n,t,!1,i)},one:function(n,t,i){s(n,t,!0,i)},off:function(n,t){y(n,t)},trigger:function(n){v(this._target,n,Array.prototype.slice.call(arguments,1))}};n.CVEventsApi=e}(this),function(n,t,i){"use strict";n.ClickView=n.ClickView||{};var r=n.ClickView;r.Utils=r.Utils||{};r.Services=r.Services||{};r.Utils.CreateNamespace=function(n,t,i){var r=t.split("."),u=n,f,e;for(r[0]==="ClickView"&&(r=r.slice(1)),f=0;f<r.length;f++)typeof u[r[f]]=="undefined"&&(u[r[f]]={}),u=u[r[f]];if(i)for(e=0;e<i.length;e++)typeof u[i[e]]=="undefined"&&(u[i[e]]={});return u};r.Utils.CreateNamespace(r,"Base",["Models","Views","Controllers","Templates","Collections"]);r.Utils.CreateNamespace(r,"Shared",["Models","Views","Controllers","Templates","Collections","Services","Helpers","Utils","Router"]);r.Utils.CreateNamespace(r,"Workspace",["Models","Views","Controllers","Templates","Collections","Utils"]);r.Utils.CreateNamespace(r,"Playlists",["Models","Views","Controllers","Templates","Collections","Utils"]);r.Utils.CreateNamespace(r,"ShareView",["Models","Views","Controllers","Templates","Collections","Utils"]);r.Utils.CreateNamespace(r,"ClickView",["Models","Views","Controllers","Templates","Collections","Utils"]);r.Utils.CreateNamespace(r,"Plugin",["Models","Views","Controllers","Templates","Collections","Utils"]);r.Utils.CreateNamespace(r,"UploadPopup",["Models","Views","Controllers","Templates","Collections","Utils"]);r.Utils.CreateNamespace(r,"Upload",["Models","Views","Controllers","Templates","Collections"]);r.Utils.CreateNamespace(r,"Manager",["Views","Templates"]);r.Utils.CreateNamespace(r,"Data",["User","Config"]);r.Utils.CreateNamespace(r,"UsageStats",["Models","Views","Controllers","Templates","Collections"]);r.Utils.CreateNamespace(r,"SignIn",["Models","Views","Templates","Collections"]);r.Utils.CreateNamespace(r,"SignIn2",["Models","Views","Templates","Collections","Controllers","Utils"]);r.Utils.CreateNamespace(r,"Search",["Models","Views","Controllers","Templates","Collections","Data"]);r.Utils.CreateNamespace(r,"Snippet",["Models","Views","Templates"]);r.Utils.CreateNamespace(r,"UserOptions",["Models","Views","Templates"]);r.Utils.CreateNamespace(r,"Interactive",["Models","Views","Controllers","Templates","Collections","Utils","Services"]);r.Utils.CreateNamespace(r,"InviteColleague",["Models","Views","Templates"]);r.Utils.CreateNamespace(r,"Subscriptions",["Models","Views","Templates"]);r.Utils.CreateNamespace(r,"InteractiveAnalytics",["Models","Views","Templates","Collections","Utils"]);r.Utils.CreateNamespace(r,"LiveStream",["Models","Views","Controllers","Templates","Collections"]);r.Utils.CreateNamespace(r,"FreeToAir",["Models","Views","Controllers","Templates","Collections","Utils","Services"]);r.Utils.CreateNamespace(r,"Manager",["Models","Views","Templates","Collections"]);r.Utils.CreateNamespace(r,"SignUp",["Models","Views","Templates"]);r.Utils.CreateNamespace(r,"Ttb",["Models","Views","Templates","Collections"]);r.Utils.CreateNamespace(r,"UserProfileSettings",["Models","Views","Templates","Collections"]);r.Utils.CreateNamespace(r,"Messaging",["Models","Views","Controllers","Templates","Collections","Utils","Services"]);r.Utils.CreateNamespace(r,"Notifications",["Models","Views","Templates","Collections","Services"]);r.Utils.CreateNamespace(r,"NewUpload",["Models","Views","Templates","Collections"]);r.Utils.CreateNamespace(r,"PushToDevice",["Models","Views","Templates","Collections","Utils","Services","Manager"]);r.Utils.CreateNamespace(r,"TwoFactorAuth",["Models","Views","Templates"]);r.Utils.CreateNamespace(r,"RecommendedVideo",["Models","Views","Templates","Collections"]);r.Utils.CreateNamespace(r,"OrderedCollections",["Models","Views","Templates","Collections","Controllers"]);r.Utils.CreateNamespace(r,"Dashboard",["Models","Views","Templates","Collections","Controllers","Utils","Runtime","Services"]);r.Utils.CreateNamespace(r,"Albert",["Models","Views","Templates","Collections","Controllers","Utils","Services","Runtime"]);r.Utils.CreateNamespace(r,"HostedLibraries",["Models","Views","Controllers","Templates","Collections","Utils","Services"]);r.Utils.CreateNamespace(r,"TermUpdates",["Models","Views","Controllers","Templates","Collections","Utils","Services"]);r.Utils.CreateNamespace(r,"Television",["Models","Views","Controllers","Templates","Collections","Utils","Services"]);r.Utils.CreateNamespace(r,"SearchApp",["Models","Views","Templates","Controllers","Collections","Utils","Services"]);r.Utils.CreateNamespace(r,"AdmMigrator",["Models","Views","Controllers","Templates","Collections","Utils","Services"]);i.mixin({extendNonNull:function(n){return i.each(i.rest(arguments,1),function(t){if(t)for(var r in t)i.isObject(t[r])&&i.isObject(n[r])?n[r]=i.extendNonNull(n[r],t[r]):i.isNull(t[r])||(n[r]=t[r])}),n},padLeft:function(n,t,i){n=n.toString();var r=t-n.length;return r<=0?n:new Array(r+1).join(i)+n}})}(this,jQuery,_,Backbone);!function(n,t){n.EasyMoney=t(n,{},n.Backbone,n._,n.jQuery||n.$)}(this,function(n,t,i,r,u){return t.VERSION="1.2.0",t.Events=i.Events,t.extend=i.Model.extend,t.template=function(n,t){return n.replace(/{{([^{}]*)}}/g,function(n,i){var r=t[i];return"string"==typeof r||"number"==typeof r?r:n})},t.triggerApply=function(n,t,i){n&&t&&(r.isFunction(n[t])&&n[t].apply(n,i||[]),r.isFunction(n.trigger)&&n.trigger(t,i),t.toLowerCase()!==t&&n.trigger(t.toLowerCase(),i))},t.triggerCall=function(n,t){if(n&&t){var i=Array.prototype.slice.call(arguments,2);return window.EasyMoney.triggerApply(n,t,i)}},t.isView=function(n){return n instanceof t.View},t.propMixin=function(n,t){if(t||(t={}),n){var i=r.result(t,"initProps",{}),u=r.omit(t,"initProps");if(r.isEmpty(i))return u;if(!r.isObject(i))throw Error("Error: initProps passed via constructor options must be an object.");return r.extend(n,i),u}},t.EasyEvents=function(n,i){var r=function(){this.options=Array.prototype.slice.apply(arguments).shift()||{};this.options.initProps&&(this.options=t.propMixin(this,this.options));this.name=this.options.name||"EasyEvents"};return n.extend(r.prototype,i.Events),r}(r,i),t.ViewsContainer=function(n,t){var i=function(){var n=this instanceof i?this:Object.create(i.prototype);return n.__private__={views:{},index:{name:{},custom:{}}},n._updateLength(),n},r;return n.extend(i.prototype,t.Events,{add:function(n,t){var i=n.cid;return this.__private__.views[i]=n,n.name&&(this.__private__.index.name[n.name]=i),t&&(this.__private__.index.custom[t]=i),this._addEventReference(n),this._updateLength(),this},remove:function(t){if(!t)return this;var i=t.cid;return i?(this._removeEventReference(t),t.name&&delete this.__private__.index.name[t.name],n.each(this.__private__.index.name,function(n,t){if(n==i)return delete this.__private__.index.custom[t],!0},this),delete this.__private__.views[i],this._updateLength(),this):this},flush:function(){return n.each(this.__private__.views,function(n){this._removeEventReference(n)},this),this.__private__.views={},n.each(this.__private__.index,function(n){n={}}),this._updateLength(),this},findById:function(n){return this.__private__.views[n]},findByName:function(n){var t=this.__private__.index.name[n];return this.findById(t)},findByCustom:function(n){var t=this.__private__.index.custom[n];return this.findById(t)},callEach:function(t){this.applyEach(t,n.tail(arguments))},applyEach:function(t,i){n.each(this._views,function(r){n.isFunction(r[t])&&r[t].apply(r,i||[])})},_addEventReference:function(n){n.on("all",this._onViewEvent,this)},_removeEventReference:function(n){n.off("all",this._onViewEvent,this)},_onViewEvent:function(n,t){"close"==n&&this.remove(t);this.trigger.apply(this,arguments)},_updateLength:function(){this.length=n.size(this.__private__.views)}}),r=["forEach","each","map","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","toArray","first","initial","rest","where","last","without","isEmpty","pluck"],n.each(r,function(t){i.prototype[t]=function(){var i=n.values(this.__private__.views),r=[i].concat(n.toArray(arguments));return n[t].apply(n,r)}}),i}(r,i),t.Collection=i.Collection.extend({_ajaxPool:[],singleAjaxCall:!0,constructor:function(n,u){u||(u={});u.initProps&&(u=t.propMixin(this,u));this.options=r.extend({},this.defaults,u);this._ajaxPool=[];this._hasFetched=!1;i.Collection.prototype.constructor.apply(this,arguments)},hasComparator:function(){return r.isString(this.comparator)||1===this.comparator.length},move:function(n,t,i){var u,f;if(i=r.extend({updateIndexes:!0,silentUpdateIndex:!1},i),u=-1,"number"==typeof t&&(u=t),!(u<0&&this.hasComparator()&&(u=n.get(this.comparator),"number"!=typeof u))){if(f=this.indexOf(n),f==-1)throw new Error("Cant move the model. Its not part of this collection");if(u<0||u>=this.models.length)throw new Error("Cant move the model. Index out of bounds");u!=f&&(this.models.splice(u,0,this.models.splice(f,1)[0]),this.hasComparator()&&i.updateIndexes&&this.updateIndexes(i),n.trigger("move",n,this,i))}},updateIndexes:function(n){n=r.extend({silentUpdateIndex:!1},n);this.each(function(t){this.updateIndex(t,n)},this)},updateIndex:function(n,t){if(n&&(t=r.extend({silentUpdateIndex:!1},t),this.hasComparator())){var u=n.get(this.comparator),i=this.indexOf(n);"number"==typeof u&&i!=-1&&n.set(this.comparator,i,{silent:t.silentUpdateIndex})}},sync:function(){this._hasFetched||(this._hasFetched=!0);this.singleAjaxCall&&this.cancel();var n=i.Collection.prototype.sync.apply(this,arguments);return this._ajaxPool.push(n),n.always(r.bind(function(){this._removeAjaxFromPool(n)},this)),n},cancel:function(){r.each(this._ajaxPool,function(n){n.readyState>0&&n.readyState<4&&n.abort()})},isFetching:function(){return this._ajaxPool.length>0},hasFetched:function(){return this._hasFetched},_cleanAjaxPool:function(){r.each(this._ajaxPool,function(n,t){4===n.readyState&&this._ajaxPool.splice(t,1)})},_removeAjaxFromPool:function(n){var t=this._ajaxPool.indexOf(n);t>-1&&this._ajaxPool.splice(t,1)}}),t.Controller=function(){this.__private__={routes:{}};this.options=Array.prototype.slice.apply(arguments).shift()||{};this.options.initProps&&(this.options=t.propMixin(this,this.options));this.name=this.name||"Controller";this.routes=this.routes||{};this.routePrefix=this.cleanPrefix(this.routePrefix||"");this.id=this.id||"";this.cid=r.uniqueId("controller");this.registerRoutes(this.routes);r.isFunction(this.initialize)&&this.initialize.apply(this,Array.prototype.slice.apply(arguments))},t.Controller.extend=i.Model.extend,r.extend(t.Controller.prototype,i.Events,{close:function(){this.stopListening();this.off()},cleanPrefix:function(n){return n=n||"",0===n.indexOf("/")&&(n=n.substr(1)),"/"===n[n.length]&&(n=n.substr(0,n.length-1)),n},registerRoutes:function(n){r.each(n,function(n,t){if("string"==typeof t&&n){var i=t;i=r.filter(i.split("/"),function(n){return 0!=n.length}).join("/");this.__private__.routes[i]=n}},this)},getRoutes:function(){return this.__private__.routes},onBeforeExecute:function(){},onBeforeRouteAction:function(){}}),t.Model=i.Model.extend({_ajaxPool:[],singleAjaxCall:!0,constructor:function(n,r){r||(r={});this._ajaxPool=[];r.initProps&&t.propMixin(this,r);i.Model.prototype.constructor.apply(this,arguments)},cancel:function(){r.each(this._ajaxPool,function(n){n.readyState>0&&n.readyState<4&&n.abort()})},increment:function(n,t){t=t||1;var i=this.get(n);r.isNumber(i)&&this.set(n,i+t)},decrement:function(n,t){t=t||1;var i=this.get(n);r.isNumber(i)&&this.set(n,i-t)},toggle:function(n){var t=this.get(n);this.set(n,!t)},sync:function(n,t,u){"delete"===n&&(u.data&&(u.data=JSON.stringify(u.data)),u.contentType="application/json");this.singleAjaxCall&&this.cancel();var f=i.Model.prototype.sync.apply(this,[n,t,u]);return this._ajaxPool.push(f),f.always(r.bind(function(){this._removeAjaxFromPool(f)},this)),f},isLast:function(){return!!this.collection&&this.collection.indexOf(this)==this.collection.length-1},_cleanAjaxPool:function(){r.each(this._ajaxPool,function(n,t){4===n.readyState&&this._ajaxPool.splice(t,1)})},_removeAjaxFromPool:function(n){var t=this._ajaxPool.indexOf(n);t>-1&&this._ajaxPool.splice(t,1)}}),t.Router=i.Router.extend({__private__:{currentUrl:null,controllers:{},currentRoute:"",currentController:null,currentViewObject:null,pendingViewObject:null},history:!0,container:null,constructor:function(){var n=Array.prototype.slice.apply(arguments).shift()||{};n.initProps&&t.propMixin(this,n);i.Router.prototype.constructor.apply(this,arguments);this.listenTo(t.Events,"navigate",this.navigateEvent);this.__private__=r.extend({},t.Router.prototype.__private__)},execute:function(n,i,u){var e,f;if(i){if(e=this.__private__.currentController,e.onBeforeRouteAction.call(e,n,u)===!1)return;if(f=i.apply(this,u),f===!1)return;if(!r.isObject(f))throw new Error("Is not an object");if(f=r.extend({view:!1,title:!1,cssClass:!1,removeAllClasses:!1},f),f.view&&t.isView(f.view))return this.isSameInstance(f.view)?void 0:(f=r.extend({},{swap:!0},f),e.onBeforeExecute.call(e,u,f.view,r.omit(f,"view"))===!1)?void 0:(this.pendingViewObject&&this.pendingViewObject.view&&this.pendingViewObject.view.close(),void(f.swap?this.showView(f):(this.pendingViewObject=f,this.listenToOnce(this.pendingViewObject.view,"swap",function(){this.showView(this.pendingViewObject);delete this.pendingViewObject},this))));if(t.isView(f))return this.isSameInstance(f)?void 0:e.onBeforeExecute.call(e,u,f)===!1?void 0:void this.showView({view:f});throw new Error("Action does not return a view");}},isSameInstance:function(n){return this.__private__.currentViewObject&&n===this.__private__.currentViewObject.view},start:function(){this.history&&this.startHistory();this.onStart(this,arguments)},onStart:function(){},startHistory:function(){i.history.start({pushState:"pushState"in window.history})},showView:function(n){var i,r;if(!this.container)throw new Error("No container specified");i=this.__private__.currentViewObject;i&&(r=i.view,i.cssClass&&u("body").removeClass(i.cssClass),r&&"function"==typeof r.close&&r.close());this.__private__.currentViewObject=n;this.container.html(n.view.render().el);n.view.trigger("rendered");n.removeAllClasses&&u("body").removeClass();u("body").addClass(n.cssClass);n.title&&(document.title=n.title);this.__private__.currentController.trigger("showView",n.view);t.triggerCall(this,"onSwap",n.view)},addController:function(n){var i,u,f,e;if(i=r.isFunction(n)?new n:n,!(i instanceof t.Controller))throw new Error("Controller is not a Controller");if(u=i.routePrefix,f=this.__private__.controllers,f[u])throw new Error("Route prefix "+u+" already defined");return this.__private__.controllers[u]=i,e=i.getRoutes(),this.addRoutes(i,e),this},addRoutes:function(n,t){return r.each(t,function(t,i){this.addRoute(n,i,t)},this),this},addRoute:function(n,t,i){var u=n[i];if(!u)throw new Error("Method "+i+" was not found on the controller");return this.controllerRoute(n,t,i,r.bind(u,n)),this},controllerRoute:function(n,t,u,f){if(t=this.buildUrl(n.routePrefix,t),r.isRegExp(t)||(t=this._routeToRegExp(t)),!r.isFunction(f))throw new Error("Callback is not a function");if(!r.isString(u))throw new Error("Route name is not a string");var e=this;return i.history.route(t,function(r){e.__private__.currentUrl=r;e.__private__.currentRoute=this;e.__private__.currentController=n;var o=e._extractParameters(t,r);e.execute(u,f,o);e.trigger.apply(e,["route:"+u].concat(o));e.trigger("route",u,o);i.history.trigger("route",e,u,o)}),this},back:function(){return i.history.history.length>1?(i.history.history.back(),this):void this.navigateEvent("/",{controllerAsRoot:!0})},getCurrentController:function(){return this.__private__.currentController},currentUrl:function(){return this.__private__.currentUrl},navigateEvent:function(n,t){t=r.extend({trigger:!0,controllerAsRoot:!1},t);var i="",u=this.getCurrentController();u&&(i=this.getCurrentController().routePrefix);0!==n.indexOf("/")?n=this.buildUrl(this.__private__.currentUrl,n):t.controllerAsRoot&&(n=this.buildUrl(i,n));this.navigate(n,t)},buildUrl:function(n,t){var f=Array.prototype.slice.call(arguments,0),i=t?f.join("/"):n,e=function(n){return 0!=n.length},u;return i=i.replace("/(/","(/"),u=i.split("?"),i=r.filter(u[0].split("/"),e).join("/"),u.length>1&&(u.shift(),i+="?"+u.join("?")),i},navigateToRoute:function(n,t){this.navigateEvent(n,t)}}),t.View=i.View.extend({__private__:{childViews:null,isRendered:!1,isClosed:!1,parent:null,uiSelectors:null},name:"BaseView",defaults:{},options:{},ui:{},template:null,constructor:function(){var n=Array.prototype.slice.apply(arguments);this.options=this.mergeOptions(n);this.options.initProps&&(this.options=t.propMixin(this,this.options));this.__private__=r.extend({},t.View.prototype.__private__,this.__private__);this.__private__.childViews=new t.ViewsContainer;i.View.prototype.constructor.apply(this,n);this.assignFunctionNames();this.listenTo(this,"rendered",this._onRendered)},mergeOptions:function(n){return r.extend({},this.defaults,n[0])},assignFunctionNames:function(){var n=null;if("function"==typeof Object.getPrototypeOf)n=Object.getPrototypeOf(this);else{if("object"!=typeof"test".__proto__)return;n=this.__proto}r.each(n,function(n,t){r.isFunction(n)&&t&&(n._name=t)})},base:function f(){if(f.caller){var t=this.constructor.__super__,n=f.caller._name;return n&&n in t?t[n].apply(this,arguments):void 0}},parent:function(){return this.__private__.parent},isClosed:function(){return this.__private__.isClosed},isRendered:function(){return this.__private__.isRendered},isInDOM:function(){return!!document.documentElement&&document.documentElement.contains(this.el)},close:function(){this.isClosed()||this.onBeforeClose.apply(this,arguments)!==!1&&(this.__private__.isClosed=!0,this.closeChildren(),this.trigger("close",this),t.triggerApply(this,"onClose",arguments),this.unbind(),this.clearUIElements(),this.remove())},closeChildren:function(){this.__private__.childViews.each(function(n){n.close()},this)},closeChildrenByIndex:function(n){var i=this.getChildByIndex(n);t.isView(i)&&i.close()},getChildByName:function(n){return this.__private__.childViews.findByName(n)},getChildById:function(n){return this.__private__.childViews.findById(n)},getChildByIndex:function(n){return this.__private__.childViews.findByCustom(n)},onClose:function(){},onBeforeClose:function(){},viewOptions:{},getModel:function(){var n={},t;return n=this.model?r.isFunction(this.model.toJSON)?this.model.toJSON():this.model:this.options,t=r.object(r.map(r.result(this,"viewOptions",{}),function(n,t){return r.isFunction(n)?[t,n.apply(this)]:[t,n]},this)),r.extend({},n,t)},renderTemplate:function(n,i){if("object"!=typeof i&&(i=this.getModel.apply(this,null)),"function"==typeof n)return n.call(this,i);if("string"==typeof n)return Handlebars&&r.isFunction(Handlebars.compile)?Handlebars.compile(n)(i):t.template(n,i);if(n===!1)return"";throw new Error("No template for view "+this.name);},render:function(){return this.onBeforeRender.apply(this,arguments)===!1?this:(this.isClosed(),this.closeChildren(),this.$el.html(this.renderTemplate(this.template,this.getModel.apply(this))),this.populateUIElements(),t.triggerApply(this,"onRender",arguments),this)},onRender:function(){},onBeforeRender:function(){},onRendered:function(){},_onRendered:function(){this.__private__.isRendered=!0;this.__private__.childViews.each(function(n){n.trigger("rendered",n)});t.triggerApply(this,"onRendered")},renderView:function(n,i,u){var u,f,e,o,s;if(!i)throw new Error("View is not defined");if(!t.isView(i))throw new Error("Object is not an instance of EasyMoney.View");if(!n)throw new Error("Cannot render view '"+i.name+"'. Element to render to is not set");if(!(n instanceof jQuery))throw new Error("Cannot render view '"+i.name+"'. $el must be a jQuery object");if(i.isClosed(),u=r.extend({empty:!0,prepend:!1,hidden:!1,replace:!1,childIndex:!1},u),this.__private__.childViews.add(i,u.childIndex),f=i.render(u),!f)throw new Error("The render method for "+i.name+" does not return this");return(i.__private__.parent=this,u.hidden&&i.hide(),u.empty)?n.html(f.el):"number"==typeof u.at?(e=u.at,o=n.children(),o.length<=e?n.append(f.el):(s=o.eq(e),s.before(f.el))):u.prepend?n.prepend(f.el):u.replace?n.replaceWith(f.el):n.append(f.el),this.isRendered()&&i.trigger("rendered"),i},hide:function(){return this.$el.hide(),t.triggerApply(this,"onHide",arguments),this},show:function(){return this.$el.show(),t.triggerApply(this,"onShow",arguments),this},onShow:function(){},onHide:function(){},populateUIElements:function(){if(this.ui){this.__private__.uiSelectors||(this.__private__.uiSelectors=r.extend({},this.ui));this.ui={};var n=this.__private__.uiSelectors;r.each(r.keys(n),function(t){var i=n[t];this.ui[t]=this.$(i)},this)}},clearUIElements:function(){this.ui&&this.__private__.uiSelectors&&(r.each(this.ui,function(n,t){delete this.ui[t]},this),this.ui=this.__private__.uiSelectors,this.__private__.uiSelectors=null)},addChildView:function(n){this.__private__.childViews.add(n)},listenToChild:function(n,t){this.listenTo(this.__private__.childViews,n,t)}}),t.ListView=t.View.extend({name:"Base ListView",tagName:"ul",template:!1,childView:null,constructor:function(){if(t.View.prototype.constructor.apply(this,arguments),this.childView=this.options.childView||this.childView,!this.childView)throw new Error("No child view defined for "+this.name);this.listenTo(this,"onRender",this.renderItems)},addOne:function(n){this.renderView(this.$el,this.buildChildView.call(this,n),{empty:!1})},buildChildView:function(n){var t=r.extend({},r.omit(this.options,["collection","model","id"]),{model:n});return new this.childView(t)},renderItems:function(){this.collection&&(this.collection instanceof t.Collection?this.collection.each(this.addOne,this):r.each(this.collection,this.addOne,this))}}),t});!function(n,t){var i=t(n,n.EasyMoney,n.Backbone,n._,n.jQuery||n.$);n.EasyMoney.Model=i.Model;n.EasyMoney.Collection=i.Collection}(this,function(n,t){t.Model.prototype;t.Collection.prototype;var i=function(){return{setLoaded:function(){this._loaded=!0},resetLoaded:function(){this._loaded=!1},isLoaded:function(){return!!this._loaded}}};return{Model:t.Model=t.Model.extend(i()),Collection:t.Collection=t.Collection.extend(i())}}),function(n,t){n.EasyMoney.PagedCollection=t(n,n.EasyMoney,n.Backbone,n._,n.jQuery||n.$)}(this,function(n,t,i,r,u){var f=t.Collection.prototype,e=t.PagedCollection;return e=t.Collection.extend({__private__:{pageSize:null,page:null,totalItems:null,totalPages:null,hasPageData:!0,firstPage:1,lastLoadedPage:null},_fullCollection:[],mode:"server",defaults:{page:null,pageSize:"auto",firstPage:1,totalPages:null,totalItems:null},dataProperties:{items:"data",pagination:"pagination"},queryParams:{page:"page",pageSize:"limit"},pageDataProperties:{totalPages:"totalPages",totalItems:"totalItems",page:"page",pageSize:"pageSize"},constructor:function(n,i){if(n instanceof t.PagedCollection&&(n=n.models),r.isArray(n))f.constructor.apply(this,arguments);else{var u=this.parseItems(n);this.updatePageData(n,u,i);f.constructor.call(this,u,i)}i=i||{};this.mode=i.mode||this.mode;this.__private__=r.extend({},t.PagedCollection.prototype.__private__);this.queryParams=r.extend({},this.queryParams,i.queryParams);this.resetPageData();this.__private__.lastLoadedPage=this.currentPage();this.mode!="server"&&(this.__private__.totalItems=n.length,this._fullCollection=this.set(n),this.reset(this._getFullCollectionPage(this.currentPage()),{silent:!0}))},clearPageData:function(){this.__private__.page=null;this.__private__.pageSize=null;this.__private__.totalItems=null;this.__private__.totalPages=null;this.__private__.lastLoadedPage=null},resetPageData:function(){this.clearPageData();this.__private__.page=this.options.page?this.options.page:this.firstPage();this.options.pageSize!="auto"&&(this.__private__.pageSize=this.options.pageSize);this.options.totalPages&&(this.__private__.totalPages=this.options.totalPages);this.options.totalItems&&(this.__private__.totalItems=this.options.totalItems);this.dataProperties.pagination||(this.__private__.hasPageData=!1)},resetAll:function(){this.reset();this.resetPageData()},setPageData:function(n){this.__private__=r.extend({},this.__private__,n)},firstPage:function(){return this.__private__.firstPage},lastPage:function(){var n=this.totalPages();return n==null?null:this.firstPage()==0?n-1:n==0?this.firstPage():n},nextPage:function(){return Math.min(this.lastPage(),this.currentPage()+1)},previousPage:function(){return Math.max(this.firstPage(),this.currentPage()-1)},currentPage:function(){return this.__private__.page},pageSize:function(){return this.__private__.pageSize},totalPages:function(){var t=this.__private__.totalPages,n;return t!=null?t:(n=this.__private__.totalItems,n!=null)?Math.ceil(n/this.pageSize()):this.__private__.hasPageData?null:this.firstPage()},totalItems:function(){return this.__private__.totalItems},hasPage:function(n){return this.__private__.hasPageData&&this.lastPage()==null?!0:n>=this.firstPage()&&n<=this.lastPage()},isFirstPage:function(){return this.firstPage()>=this.currentPage()},isLastPage:function(){return this.lastPage()<=this.currentPage()},pagedOptions:function(n){var t={};return r.each(this.queryParams,function(i,r){if(n[r]!=null)t[i]=n[r];else{var u=this.__private__[r];u!=null?t[i]=this.__private__[r]:t[r]=i}},this),t},reload:function(n){n=r.extend({},{silentPaging:!0,reload:!0},n);for(var t=this.currentPage();!this.hasPage(t)&&t>=this.firstPage();)t-=1;return this.getPage(t,n).done(u.proxy(function(){this.trigger("reload",t,this)},this))},getFirstPage:function(n){return this.getPage("first",n)},getPreviousPage:function(n){return this.getPage("prev",n)},getNextPage:function(n){return this.getPage("next",n)},getLastPage:function(n){return this.getPage("last",n)},getPage:function(n,t){var i=this.firstPage(),s,f,e,o;if(t=r.extend({},{add:!0,reset:!1,reload:!1,silentPaging:!1},t),n)switch(n){case"first":i=this.firstPage();break;case"last":i=this.lastPage();break;case"prev":i=this.previousPage();break;case"next":i=this.nextPage();break;default:i=n}if((s=this.currentPage(),t.reload!=!1||this.__private__.lastLoadedPage==null||this.__private__.lastLoadedPage!=i)&&this.hasPage(i)){if(this.mode=="server")return t.data=r.extend({},this.pagedOptions({page:i}),t.data),this.fetch(t,i);if(f=this._getFullCollectionPage(i),f&&f.length>0){e=this;t.reset||this.each(function(n){n.trigger("remove",n,e,t)});t.reset?this.reset(f,t):this.reset(f,r.extend({},t,{silent:!0}));t.reset||this.each(function(n){n.trigger("add",n,e,t)});this.__private__.page=i;this.onFetchSuccess(r.extend({},{page:i},t))}return o=u.Deferred(),o.resolve(),o}},_getFullCollectionPage:function(n){var t=Math.max(0,n-1)*this.pageSize(),i=Math.max(0,t-1)+this.pageSize();return this._fullCollection.slice(t,i)},fetch:function(n,t){if(n=n||{},n.data=n.data||{},t==null){var i=n.data[this.queryParams.page];n.page=i!=null?i:this.firstPage()}else n.page=t;return f.fetch.call(this,n).done(r.bind(function(t){this.onFetchSuccess(n,t)},this))},onFetchSuccess:function(n,t){var i=n.page,r;this.__private__.hasPageData&&t&&(r=t[this.dataProperties.pagination][this.pageDataProperties.page],r&&(i=r));n.silentPaging||this.trigger("getpage",i,this);(!n.silentPaging||n.reload)&&this.__private__.lastLoadedPage!=i&&this.__private__.lastLoadedPage!=null&&this.trigger("pagechanged",i,this);this.__private__.lastLoadedPage=i},parse:function(n,t){var i=this.parseItems(n);return this.updatePageData(n,i,t),i},parseItems:function(n){if(!n)return n;var t=this.dataProperties.items;if(t){if(!n[t])throw new Error("Response does not contain the items property");return n[t]}return n},updatePageData:function(n,t,i){if(r.isObject(n)||r.isArray(t)){var f=this.__private__.hasPageData,e=this.dataProperties.pagination,u=n[e];if(!f&&!u){this.__private__.page=i.page;(this.__private__.pageSize==null||this.__private__.pageSize<t.length)&&this.options.pageSize=="auto"&&(this.__private__.pageSize=t.length);this.options.totalItems||this.options.totalPages||t.length!=this.__private__.pageSize||(this.__private__.totalPages=this.__private__.page+1);return}if(!u)throw new Error("Response does not contain paging data");this.__private__.page=u[this.pageDataProperties.page];this.__private__.pageSize=u[this.pageDataProperties.pageSize];this.__private__.totalItems=u[this.pageDataProperties.totalItems]}},remove:function(n){var o=!r.isArray(n),t,u,i,e;if(n=o?[n]:r.clone(n),this.mode!="server")for(t=0,u=n.length;t<u;t++)(e=n[t],i=this._fullCollection.indexOf(e),i!=-1)&&(this._fullCollection.splice(i,1),this.__private__.totalItems--);return f.remove.apply(this,arguments)},add:function(n){var o=!r.isArray(n),t,u,e,i;if(n=o?[n]:r.clone(n),this.mode!="server")for(t=0,u=n.length;t<u;t++)(i=n[t],e=this._fullCollection.indexOf(i),e==-1)&&(this._fullCollection.push(i),this.__private__.totalItems==null?this.__private__.totalItems=1:this.__private__.totalItems++);return f.add.apply(this,arguments)}}),e.VERSION="0.0.3",e});!function(n,t){n.EasyMoney.NestedModel=t(n,n.EasyMoney,n.Backbone,n._,n.jQuery||n.$)}(this,function(n,t,i,r){var u=t.Model.prototype,f=t.NestedModel;return f=t.Model.extend({associations:{},set:function(n,t,i){var e,f;if(null==n)return this;if("object"==typeof n?(f=n,i=t):(f={})[n]=t,i||(i={}),!this._validate(f,i))return!1;for(e in f)r.has(this.associations,e)&&(f[e]=this.setAssociation(e,f[e],i));return u.set.apply(this,[f,i])},get:function(n){var i=n.indexOf("."),f,t,e;return i===-1?u.get.apply(this,arguments):(f=n.substr(0,i),t=this.attributes[f],!t||!r.isFunction(t.get))?u.get.apply(this,arguments):(e=n.substr(i+1),t.get(e))},setAssociation:function(n,i,u){var o=this.associations[n],f=this.attributes[n],e;return r.isFunction(o)?u.unset?(f&&delete f.parent,delete this[n],f):f?(f instanceof t.Model&&f.set(i,u),f instanceof t.Collection&&f.set(i,u),u.silent||this.trigger("change:"+n,this,i,u),f):(e=i instanceof t.Model?i:new o(i),e.parent=this,this[n]=e,e):i},toJSON:function(){var n=u.toJSON.apply(this,arguments);return r.each(this.associations,function(t,i){n[i]=r.has(n,i)&&r.isFunction(n[i].toJSON)?n[i].toJSON():(new t).toJSON()}),n}}),f.VERSION="0.0.3",f});EasyMoney.Service=function(n,t){var i=function(t){self.__private__={};t||(t={});t.initProps&&(t=EasyMoney.propMixin(this,t));this.options=n.extend({},n.result(this,"defaults"),t);this.initialize.apply(this,arguments)};return n.extend(i.prototype,t.Events,{initialize:function(){}}),i.extend=t.Model.extend,i}(_,Backbone),function(){EasyMoney.OnBoarding=EasyMoney.OnBoarding||{};EasyMoney.OnBoarding.events=Backbone.Events;EasyMoney.OnBoarding.ToolTipView=EasyMoney.View.extend({defaults:{position:"bottom"},className:function(){var n="display-"+this.options.position;return this.options.additionalClass&&(n+=" "+this.options.additionalClass),"onboarding-tooltip-hook "+n},template:'<div class="onboarding-tooltip"><div class="shadow-block"><div class="header"><span class="close">&times;<\/span><\/div><p class="caption">{{{caption}}}<\/p><div class="buttons"><a class="btn orange close-btn">{{buttonText}}<\/a><\/div><\/div><\/div>',ui:{close:".close",closeButton:".close-btn",tooltip:".onboarding-tooltip"},events:{"click .close":"closeClicked","click .close-btn":"nextClicked"},initialize:function(){this.listenTo(EasyMoney.OnBoarding.events,"close",this.close)},closeClicked:function(n){return n.stopPropagation(),this.close(),!1},nextClicked:function(n){return this.options.action?!0:(n.stopPropagation(),this.close(),EasyMoney.OnBoarding.events.trigger("next"),!1)},onRender:function(){if(this.options.buttonText||this.ui.closeButton.hide(),this.options.css&&this.ui.tooltip.css(this.options.css),this.options.offset&&this.$el.css(this.options.offset),typeof this.options.action=="function")this.ui.closeButton.one("click",_.bind(this.options.action,this));if(typeof this.options.closeAction=="function")this.ui.close.one("click",_.bind(this.options.closeAction,this))}});EasyMoney.OnBoarding.MaskView=EasyMoney.View.extend({template:!1,className:"cv-mask onboarding-mask",initialize:function(){this.$el.addClass(this.options.maskClass)}});EasyMoney.OnBoarding.start=function(n){var t=0;EasyMoney.OnBoarding.events.on("next",function(){if(typeof n[t].onBeforeOnBoardingTriggered=="function"){var i=n[t].onBeforeOnBoardingTriggered();if(i===!1){t++;EasyMoney.OnBoarding.events.trigger("next",n[t]);return}}n[t].viewless&&new(EasyMoney.View.extend({onBoarding:n[t].name,onOnBoardingClosed:function(){this.close()}}));EasyMoney.OnBoarding.events.trigger("onBoarding:"+n[t].name,n[t]);t++;t>=n.length&&EasyMoney.OnBoarding.events.off("next")});EasyMoney.OnBoarding.events.trigger("next",n[t])};EasyMoney.OnBoarding.stop=function(){EasyMoney.OnBoarding.events.trigger("close")};var n=function(n,t,i){var r=new EasyMoney.OnBoarding.MaskView({maskClass:i});n.after(r.render().el);this.listenTo(t,"close",function(){r.close()})},t=function(n,t,i){var e,o,s,f,u,r,h,c;typeof i!="object"&&(i={});e=n.css("position");i.backgroundColor&&(o=n.css("background-color"));s=n.css("z-index");n.css("z-index",1e4);n.css("position","relative");n.addClass("onboarding-element");i.boxShadow&&n.addClass("box-shadowed");i.backgroundColor&&n.css("background-color",i.backgroundColor);f=i.additionalProperties||{};u={};for(r in f)f.hasOwnProperty(r)&&(h=f[r],c=n.css(r),u[r]=c,n.css(r,h));this.listenTo(t,"close",function(){var t,r;n.css("position",e);i.boxShadow&&n.removeClass("box-shadowed");n.css("z-index",s);i.backgroundColor&&n.css("background-color",o);for(t in u)u.hasOwnProperty(t)&&(r=u[t],n.css(t,r))})},i=function(n){var u,r,s,h;if(n&&_.isFunction(n.position)&&(u=n.offset(),u)){var f=u.top,t=$(window).height(),i=$(window).scrollTop(),c=$(document).height(),e=.1,o={min:Math.max(0,i+t*e),max:i+t*.5};f>o.min&&f<o.max||(r=Math.min(Math.max(f-t*e,0),c-t),r!==i)&&(s=Math.abs(i-r),h=Math.max(500,s/t*800),$("html,body").animate({scrollTop:r},h,"easeInOutCubic"))}},r=EasyMoney.View,u=EasyMoney.View.prototype.constructor;EasyMoney.View=EasyMoney.View.extend({constructor:function(){var n,t;if(u.apply(this,arguments),this.onBoarding)if(n=this.onBoarding,typeof n=="function"&&(n=this.onBoarding()),n instanceof Array)for(t=0;t<n.length;t++)n[t]&&this.listenTo(EasyMoney.OnBoarding.events,"onBoarding:"+n[t],this._renderOnBoarding);else n&&this.listenTo(EasyMoney.OnBoarding.events,"onBoarding:"+n,this._renderOnBoarding)},_renderOnBoarding:function(r){var f,u,e;if(typeof this.onBeforeOnBoardingRendered=="function"&&this.onBeforeOnBoardingRendered.call(this,r),typeof r.onBeforeOnBoardingRendered=="function"&&r.onBeforeOnBoardingRendered.call(this,r),f=this.$el,r.selector&&!r.viewless&&(f=this.$el.find(r.selector)),r.viewless&&r.selector&&(f=$(r.selector)),u=new EasyMoney.OnBoarding.ToolTipView(r),typeof this.onOnBoardingClosed=="function"&&this.listenTo(u,"close",this.onOnBoardingClosed),typeof r.onOnBoardingClosed=="function"&&this.listenTo(u,"close",r.onOnBoardingClosed),r.before?f.before(u.render().el):r.after?f.after(u.render().el):this.renderView(f,u,{empty:!1}),r.windowClickClose)$("body").one("click",function(){u.close()});r.mask&&r.highlight&&(e=this.$el.find(r.highlight),t.call(this,e.length?e:this.$el,u,r),i.call(this,f));r.mask&&n.call(this,r.maskOnBody?$("body"):f,u,r.maskClass);typeof this.onOnBoardingRendered=="function"&&this.onOnBoardingRendered.call(this,r);typeof r.onOnBoardingRendered=="function"&&r.onOnBoardingRendered.call(this,r)}});EasyMoney.isView=function(n){return n instanceof r}}();!function(n,t){var i=t(n,n.EasyMoney,n.Backbone,n._,n.jQuery||n.$);n.EasyMoney.RadioChannel=i.RadioChannel;n.EasyMoney.Radio=i.Radio;n.EasyMoney.View=i.View;n.EasyMoney.ListView=i.ListView;n.EasyMoney.Service=i.Service;n.EasyMoney.Controller=i.Controller}(this,function(n,t,i,r){var h=t.Model.prototype,c=t.View.prototype,l=t.ListView.prototype,a=t.Service.prototype,v=t.Controller.prototype,u=function(n){return{radioChannels:null,constructor:function(t){t||(t={});n.constructor.apply(this,arguments);this.radioChannels&&this.initializeRadio(t)},initializeRadio:function(n){this.radio=this.getRadio(n);this.channels=this.getChannels(n)},getRadio:function(n){var i;return this.radio&&this.radio instanceof t.Radio?this.radio:n.radio&&(i=r.isFunction(n.radio)?n.radio.apply(this,arguments):n.radio,i instanceof t.Radio)?i:!i&&t.Global&&t.Global.radio instanceof t.Radio?t.Global.radio:(t.Global||(t.Global={}),i=t.Global.radio=new t.Radio({name:"globalRadio",channels:new t.Collection}))},getChannels:function(){var n,t,i;return r.isFunction(this.radioChannels)?n=this.radioChannels.apply(this,arguments):r.isObject(this.radioChannels)?n=this.radioChannels:r.isString(this.radioChannels)&&(n=this.radioChannels),n||(n=this.name+"Channel"),t=r.bind(this._delegateChannelEvents,this),i=r.bind(function(i){this._delegateEventHelper(n,i,t)},this),r.isArray(n)?void n.forEach(i):r.isObject(n)?void r.keys(n).forEach(i):void t(n)},getOrSetChannel:function(n){if(n||(n={}),!this.radio)throw Error("Radio must be instantiated before a channel can be retrieved.");return this.radio.getChannel(n)||this.radio.addChannel(n)},_delegateChannelEvents:function(n,t){var u,f,i;if(t||(t={}),u=t.events?t.events:r.result(this,n),!u||r.isEmpty(u))return void this.getOrSetChannel({channelName:n});this._undelegateChannelEvents(n);for(f in u)i=u[f],r.isFunction(i)||(i=this[i]),i&&this._delegateChannelEvent(n,f,r.bind(i,this));return this},_delegateChannelEvent:function(n,t,i){return this.listenTo(this.getOrSetChannel({channelName:n}),t,i),this},_undelegateChannelEvents:function(n){var t=this.radio.getChannel(n);return t?(this.stopListening(t),this):this},_delegateEventHelper:function(n,t,i){if(r.isObject(n[t]))return void i(t,{events:n[t]});if(r.isObject(t)){var u=t,f=u.name||u.channelName,e=u.events;return e&&t?void i(f,{events:e}):void(t&&i(f))}i(t)}}},o=t.View=t.View.extend(u(c)),s=t.ListView=t.ListView.extend(u(l)),y=t.Service=t.Service.extend(u(a)),p=t.Controller=t.Controller.extend(u(v)),e=t.RadioChannel=t.Model.extend({"default":{logging:!1,logFilter:null},setLogFilter:function(n){return this.set("logFilter",new RegExp(n)),this},_log:function(n,t){var i=this.get("logFilter");i&&!n.match(i)||console.log(n,t)},trigger:function(n,t){if(n)return this.get("logging")&&this._log(n,t),h.trigger.apply(this,arguments),this}}),f=t.Radio=function(n){this.__private__={channels:null};n||(n={});this.options=r.extend({},r.result(this,"defaults"),n);this.constructor.apply(this,arguments)};return r.extend(f.prototype,i.Events,{constructor:function(){this.initRadio.apply(this,arguments);this.initChannels.apply(this,arguments);this.initialize.apply(this,arguments)},initialize:function(){},initRadio:function(n){n||(n={});n.name&&(this.name=n.name)},initChannels:function(n){if(n||(n={}),!n.empty){var i=n.collection||n.channels;if(i){if(r.isArray(i)&&this.areRadioChannels(i))return void this.setChannels(new t.Collection(i));if(i instanceof t.Collection&&this.areRadioChannels(i.models))return void this.setChannels(i);throw Error("Channels collection must be an instance of an EasyMoney Collection or an array of channel models.");}}},getChannels:function(){if(this.__private__.channels&&this.__private__.channels instanceof t.Collection)return this.__private__.channels},setChannels:function(n){this.options.clearChannels&&this.getChannels()&&this.destroyChannels();r.each(n.models,r.bind(function(n){this.setChannelAccessors(n)},this));this.__private__.channels=n},setChannelAccessors:function(n){Object.getOwnPropertyDescriptor(this,n.get("name"))||Object.defineProperty(this,n.get("name"),{get:function(){return n},set:function(n){this.addChannel(n)}})},getChannel:function(n){if(n||(n={}),n&&r.isString(n)&&(n={channelName:n}),n.id)return this.getChannels().get(n.id);if(n.channelName||n.name){var t=this.getChannels();return!!t&&t.findWhere({name:n.channelName||n.name})}},addChannel:function(n){var r,i,u;if(n||(n={}),!n.channelName&&!n.channel)throw Error("channelName option required to create a new channel");if(r=n.channelName||this.getChannelName(n.channel),this.getChannel(r))throw Error("Radio already contains a channel with the name "+r);if(i=n.channel,i&&!(i instanceof t.RadioChannel))throw Error("Provided channel must be an instance of Channel");return i||(i=new t.RadioChannel({name:n.channelName}),this.setChannelAccessors(i)),u=this.getChannels(),u?u.add(i):this.initChannels({channels:[i]}),i},addChannels:function(n){if(r.isFunction(n)&&(n=n.apply(this,arguments)),n&&"object"==typeof n){if(r.isArray(n))return void this._handleChannelArray(n);if(r.isObject(n))return void this._handleChannelObject(n);n instanceof Channel&&this.addChannel({channel:n})}n&"string"==typeof n&&this.addChannel({channelName:n})},destroyChannels:function(){r.each(r.clone(this.models),function(n){n.destroy()})},destroyChannel:function(n){n||(n={});var t;n.id?t=this.getChannels().remove(n.id):(n.channelName||n.name)&&(t=this.getChannel(n.channelName||n.name));t&&t.destroy()},broadcast:function(n,t){t||(t={});r.each(this.collection,function(){model.trigger(n,t)})},getChannelName:function(n){if(!(n instanceof t.RadioChannel))throw Error("Channel must be an instance of an EasyMoney Model");return n.get("name")},set channels(n){this.initChannels({collection:n,clear:!0})},_handleChannelObject:function(n){var t,i,r;for(t in n)r=n[t],!this.getChannelName(t)&&n.hasOwnProperty(t)&&(i=t),this.addChannel({channelName:i,channel:r})},_handleChannelArray:function(n){n.forEach(r.bind(function(n){var t,i;"string"==typeof n&&(t=n);n instanceof Channel&&(i=n);this.addChannel({channelName:t,channel:i})},this))},logging:function(){options||(options={});r.each(this.collection,function(){options.logFilter&&model.setLogFilter(options.logFilter);model.set("logging",!0)})},areRadioChannels:function(n){if(!n.length)return!1;var i=r.filter(n,function(n){return!(n instanceof t.RadioChannel)});return!i.length}}),f.extend=e.extend=i.Model.extend,o.VERSION="0.0.1",s.VERSION="0.0.1",e.VERSION="0.0.1",f.VERSION="0.0.1",{View:o,ListView:s,Service:y,Controller:p,RadioChannel:e,Radio:f}}),function(){Object.getPrototypeOf||(Object.getPrototypeOf=function(n){var t=n.__proto__;return t||t===null?t:n.constructor?n.constructor.prototype:Object.prototype});String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")});Array.prototype.indexOf||(Array.prototype.indexOf=function(n,t){if(this===undefined||this===null)throw new TypeError('"this" is null or not defined');var i=this.length>>>0;for(t=+t||0,Math.abs(t)===Infinity&&(t=0),t<0&&(t+=i,t<0&&(t=0));t<i;t++)if(this[t]===n)return t;return-1});Date.prototype.toISOString||function(){function n(n){return n<10?"0"+n:n}Date.prototype.toISOString=function(){return this.getUTCFullYear()+"-"+n(this.getUTCMonth()+1)+"-"+n(this.getUTCDate())+"T"+n(this.getUTCHours())+":"+n(this.getUTCMinutes())+":"+n(this.getUTCSeconds())+"."+(this.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"}}();String.prototype.startsWith||(String.prototype.startsWith=function(n,t){return t=t||0,this.substr(t,n.length)===n});String.prototype.endsWith||(String.prototype.endsWith=function(n,t){return t<this.length?t|=0:t=this.length,this.substr(t-n.length,n.length)===n});String.prototype.slugify||(String.prototype.slugify=function(){return this.trim().toLowerCase().replace(/&/g,"and").replace(/[^\w ]+/g," ").replace(/ +/g,"-").substr(0,80)})}(),function(n,t){"use strict";t.Support={pushState:!!(window.history&&history.pushState),mp4:function(){var n=document.createElement("video");return n.canPlayType?n.canPlayType('video/mp4; codecs="avc1.42E01E')||n.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2'):!1}(),fsApi:function(){var n=document.createElement("div");return typeof(n.requestFullscreen||n.msRequestFullscreen||n.mozRequestFullScreen||n.webkitRequestFullscreen)=="function"}(),ieVersion:function(){var n=function(n){return navigator.appVersion.indexOf("MSIE "+n+".")>-1};return n(7)?7:n(8)?8:n(9)?9:n(10)?10:navigator.appVersion.indexOf("Trident/")>-1?11:-1}(),isMobile:function(){var n=!1;return function(t){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(n=!0)}(navigator.userAgent||navigator.vendor||window.opera),n}(),isTouch:function(){return"ontouchstart"in window||navigator.maxTouchPoints}(),isWin10:function(){return/Windows\s\w+\s10/i.test(navigator.userAgent)}()}}(jQuery,ClickView);$(function(){if(ClickView.Data.Config&&ClickView.Data.Config.urls&&ClickView.Data.Config.urls.browserSupport){var t=ClickView.Data.Config.urls.browserSupport,i=$('<div class="unsupported-browser-banner"><p class="message">We\'ve noticed that you are using an outdated browser, and as a result some features of ClickView may not work. Please consider upgrading your browser. For more information, <a target="_blank" href="'+t+'">visit our support site<\/a><\/p><\/div>'),n=ClickView.Support.ieVersion;(!ClickView.Support.pushState||n!==-1&&n<11)&&$("body").prepend(i)}}),function(n){typeof define=="function"&&define.amd?define(["underscore","backbone","exports"],n):typeof exports=="object"?n(require("underscore"),require("backbone"),exports):n(_,Backbone,{})}(function(n,t,i){i._handlers=[];i.addHandler=function(t){t=n.map(n.flatten([t]),function(t){return n.extend({updateModel:!0,updateView:!0,updateMethod:"text"},t)});this._handlers=this._handlers.concat(t)};i.ViewMixin={_modelBindings:null,unstickit:function(t,i){if(n.isObject(i)){n.each(n.keys(i),function(n){this.unstickit(t,n)},this);return}var r=[],u=[];n.each(this._modelBindings,function(n,f){t&&n.model!==t||i&&n.config.selector!=i||(u.push(n.config._destroy),n.model.off(n.event,n.fn),r.push(n.model),delete this._modelBindings[f])},this);n.invoke(n.uniq(r),"trigger","stickit:unstuck",this.cid);n.each(n.uniq(u),function(n){n.call(this)},this);this._modelBindings=n.compact(this._modelBindings);this.$el.off(".stickit"+(t?"."+t.cid:""),i)},stickit:function(t,i){var u=t||this.model,f=i||n.result(this,"bindings")||{},r;this._modelBindings||(this._modelBindings=[]);this.addBinding(u,f);r=this.remove;r.stickitWrapped||(this.remove=function(){var n=this;return this.unstickit(),r&&(n=r.apply(this,arguments)),n});this.remove.stickitWrapped=!0},addBinding:function(t,i,u){var p,g,w,o,b,y=t||this.model,tt=".stickit."+y.cid,k=u||{},nt=n.uniqueId(),d;if(n.isString(i))b=i;else{d=i;n.each(d,function(n,t){this.addBinding(y,t,d[t])},this);return}(p=b===":el"?this.$el:this.$(b),this.unstickit(y,b),p.length)&&(n.isString(k)&&(k={observe:k}),n.isFunction(k.observe)&&(k.observe=k.observe.call(this)),o=l(p,k),o.selector=b,w=o.observe,o.bindId=nt,o.view=this,g=n.extend({stickitChange:o},o.setOptions),o._destroy=function(){r(this,o.destroy,p,y,o)},a(this,p,o,y,w),v(this,p,o,y,w),w&&(n.each(o.events,function(t){var r=t+tt,i=function(t){var i=o.getVal.call(this,p,t,o,n.rest(arguments));s(this,o.updateModel,i,t,o)&&c(y,w,i,g,this,o)};if(i=n.bind(i,this),b===":el")this.$el.on(r,i);else this.$el.on(r,b,i)},this),n.each(n.flatten([w]),function(n){e(y,this,"change:"+n,o,function(n,t,i){var r=i&&i.stickitChange&&i.stickitChange.bindId||null;r!==nt&&h(this,p,o,f(n,w,o,this),n)})},this),h(this,p,o,f(y,w,o,this),y,!0)),r(this,o.initialize,p,y,o))}};n.extend(t.View.prototype,i.ViewMixin);var u=function(t,i){var u=(i||"").split("."),r=n.reduce(u,function(n,t){return n[t]},t);return r==null?t:r},r=function(t,i){if(i)return(n.isString(i)?u(t,i):i).apply(t,n.rest(arguments,2))},o=function(n){return n.find("option").not(function(){return!this.selected})},s=function(t,i){return n.isBoolean(i)?i:n.isFunction(i)||n.isString(i)?r.apply(this,arguments):!1},e=function(n,t,i,r,u){n.on(i,u,t);t._modelBindings.push({model:n,event:i,fn:u,config:r})},c=function(t,i,u,f,e,o){var s={};o.onSet&&(u=r(e,o.onSet,u,o));o.set?r(e,o.set,i,u,f,o):(s[i]=u,n.isArray(i)&&n.isArray(u)&&(s=n.reduce(i,function(t,i,r){return t[i]=n.has(u,r)?u[r]:null,t},{})),t.set(s,f))},f=function(t,i,u,f){var e,o=function(n){return t[u.escape?"escape":"get"](n)},s=function(n){return n==null?"":n};return e=n.isArray(i)?n.map(i,o):o(i),u.onGet&&(e=r(f,u.onGet,e,u)),n.isArray(e)?n.map(e,s):s(e)},l=i.getConfiguration=function(t,r){var f=[{updateModel:!1,updateMethod:"text",update:function(n,t,i,r){n[r.updateMethod]&&n[r.updateMethod](t)},getVal:function(n,t,i){return n[i.updateMethod]()}}],u;return f=f.concat(n.filter(i._handlers,function(n){return t.is(n.selector)})),f.push(r),u=n.extend.apply(n,f),u.visible&&!n.has(u,"updateView")?u.updateView=!1:n.has(u,"updateView")||(u.updateView=!0),u},a=function(t,i,r,u,o){var s=["autofocus","autoplay","async","checked","controls","defer","disabled","hidden","indeterminate","loop","multiple","open","readonly","required","scoped","selected"];n.each(r.attributes||[],function(h){var a="",c,l;h=n.clone(h);c=h.observe||(h.observe=o);l=function(){var e=n.indexOf(s,h.name,!0)>-1?"prop":"attr",r=f(u,c,h,t);h.name==="class"?(i.removeClass(a).addClass(r),a=r):i[e](h.name,r)};n.each(n.flatten([c]),function(n){e(u,t,"change:"+n,r,l)});l()})},v=function(t,i,u,o,s){if(u.visible!=null){var h=function(){var e=u.visible,c=u.visibleFn,l=f(o,s,u,t),h=!!l;(n.isFunction(e)||n.isString(e))&&(h=!!r(t,e,l,u));c?r(t,c,i,h,u):i.toggle(h)};n.each(n.flatten([s]),function(n){e(o,t,"change:"+n,u,h)});h()}},h=function(n,t,i,u,f,e){s(n,i.updateView,u,i)&&(r(n,i.update,t,u,f,i),e||r(n,i.afterUpdate,t,u,i))};return i.addHandler([{selector:'[contenteditable="true"]',updateMethod:"html",events:["input","change"]},{selector:"input",events:["propertychange","input","change"],update:function(n,t){n.val(t)},getVal:function(n){return n.val()}},{selector:"textarea",events:["propertychange","input","change"],update:function(n,t){n.val(t)},getVal:function(n){return n.val()}},{selector:'input[type="radio"]',events:["change"],update:function(n,t){n.filter('[value="'+t+'"]').prop("checked",!0)},getVal:function(n){return n.filter(":checked").val()}},{selector:'input[type="checkbox"]',events:["change"],update:function(i,r){if(i.length>1)r||(r=[]),i.each(function(i,u){var f=t.$(u),e=n.indexOf(r,f.val())>-1;f.prop("checked",e)});else{var u=n.isBoolean(r)?r:r===i.val();i.prop("checked",u)}},getVal:function(i){var r,u;return i.length>1?r=n.reduce(i,function(n,i){var r=t.$(i);return r.prop("checked")&&n.push(r.val()),n},[]):(r=i.prop("checked"),u=i.val(),u!=="on"&&u!=null&&(r=r?i.val():null)),r}},{selector:"select",events:["change"],update:function(i,f,e,o){var h,s=o.selectOptions,c=s&&s.collection||undefined,w=i.prop("multiple"),a,l,b,y,v,p;if(s||(s={},a=function(n){return n.map(function(){return{value:this.value,label:this.text}}).get()},i.find("optgroup").length?(c={opt_labels:[]},i.find("> option").length&&(c.opt_labels.push(undefined),n.each(i.find("> option"),function(n){c[undefined]=a(t.$(n))})),n.each(i.find("optgroup"),function(n){var i=t.$(n).attr("label");c.opt_labels.push(i);c[i]=a(t.$(n).find("option"))})):c=a(i.find("option"))),s.valuePath=s.valuePath||"value",s.labelPath=s.labelPath||"label",l=function(i,r,f){n.each(i,function(i){var o=t.$("<option/>"),e=i,h=function(t,i){o.text(t);e=i;o.data("stickit_bind_val",e);n.isArray(e)||n.isObject(e)||o.val(e)};i==="__default__"?h(s.defaultOption.label,s.defaultOption.value):h(u(i,s.labelPath),u(i,s.valuePath));!w&&e!=null&&f!=null&&e===f||n.isObject(f)&&n.isEqual(e,f)?o.prop("selected",!0):w&&n.isArray(f)&&n.each(f,function(t){n.isObject(t)&&(t=u(t,s.valuePath));(t===e||n.isObject(t)&&n.isEqual(e,t))&&o.prop("selected",!0)});r.append(o)})},i.find("*").remove(),b=function(n,t){var i=window;return t.indexOf("this.")===0&&(i=n),t=t.replace(/^[a-z]*\.(.+)$/,"$1"),u(i,t)},h=n.isString(c)?b(this,c):n.isFunction(c)?r(this,c,i,o):c,h instanceof t.Collection&&(h=h.toJSON()),s.defaultOption&&l(["__default__"],i),n.isArray(h))l(h,i,f);else if(h.opt_labels)n.each(h.opt_labels,function(n){var r=t.$("<optgroup/>").attr("label",n);l(h[n],r,f);i.append(r)});else{y=[];for(p in h)v={},v[s.valuePath]=p,v[s.labelPath]=h[p],y.push(v);l(n.sortBy(y,s.comparator||s.labelPath),i,f)}},getVal:function(n){return n.prop("multiple")?t.$(o(n).map(function(){return t.$(this).data("stickit_bind_val")})).get():o(n).data("stickit_bind_val")}}]),t.Stickit=i,t.Stickit});!function(n,t){"object"==typeof exports?module.exports=t():"function"==typeof define&&define.amd?define(t):n.Spinner=t()}(this,function(){"use strict";function i(n,t){var i,r=document.createElement(n||"div");for(i in t)r[i]=t[i];return r}function t(n){for(var t=1,i=arguments.length;i>t;t++)n.appendChild(arguments[t]);return n}function a(n,t,i,r){var f=["opacity",t,~~(100*n),i,r].join("-"),e=.01+i/r*100,s=Math.max(1-(1-n)/t*(100-e),n),h=u.substring(0,u.indexOf("Animation")).toLowerCase(),c=h&&"-"+h+"-"||"";return l[f]||(o.insertRule("@"+c+"keyframes "+f+"{0%{opacity:"+s+"}"+e+"%{opacity:"+n+"}"+(e+.01)+"%{opacity:1}"+(e+t)%100+"%{opacity:"+n+"}100%{opacity:"+s+"}}",o.cssRules.length),l[f]=1),f}function e(n,t){var r,i,u=n.style;for(t=t.charAt(0).toUpperCase()+t.slice(1),i=0;i<c.length;i++)if(r=c[i]+t,void 0!==u[r])return r;if(void 0!==u[t])return t}function n(n,t){for(var i in t)n.style[e(n,i)||i]=t[i];return n}function s(n){for(var r,i,t=1;t<arguments.length;t++){r=arguments[t];for(i in r)void 0===n[i]&&(n[i]=r[i])}return n}function h(n,t){return"string"==typeof n?n:n[t%n.length]}function r(n){this.opts=s(n||{},r.defaults,y)}function v(){function u(n,t){return i("<"+n+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',t)}o.addRule(".spin-vml","behavior:url(#default#VML)");r.prototype.lines=function(i,r){function s(){return n(u("group",{coordsize:o+" "+o,coordorigin:-e+" "+-e}),{width:o,height:o})}function c(i,f,o){t(a,t(n(s(),{rotation:360/r.lines*i+"deg",left:~~f}),t(n(u("roundrect",{arcsize:r.corners}),{width:e,height:r.width,left:r.radius,top:-r.width>>1,filter:o}),u("fill",{color:h(r.color,i),opacity:r.opacity}),u("stroke",{opacity:0}))))}var f,e=r.length+r.width,o=2*e,l=2*-(r.width+r.length)+"px",a=n(s(),{position:"absolute",top:l,left:l});if(r.shadow)for(f=1;f<=r.lines;f++)c(f,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(f=1;f<=r.lines;f++)c(f);return t(i,a)};r.prototype.opacity=function(n,t,i,r){var u=n.firstChild;r=r.shadow&&r.lines||0;u&&t+r<u.childNodes.length&&(u=u.childNodes[t+r],u=u&&u.firstChild,u=u&&u.firstChild,u&&(u.opacity=i))}}var u,c=["webkit","Moz","ms","O"],l={},o=function(){var n=i("style",{type:"text/css"});return t(document.getElementsByTagName("head")[0],n),n.sheet||n.styleSheet}(),y={lines:12,length:7,width:5,radius:10,rotate:0,corners:1,color:"#000",direction:1,speed:1,trail:100,opacity:.25,fps:20,zIndex:2e9,className:"spinner",top:"50%",left:"50%",position:"absolute"},f;return r.defaults={},s(r.prototype,{spin:function(t){this.stop();var f=this,r=f.opts,e=f.el=n(i(0,{className:r.className}),{position:r.position,width:0,zIndex:r.zIndex});if(r.radius+r.length+r.width,n(e,{left:r.left,top:r.top}),t&&t.insertBefore(e,t.firstChild||null),e.setAttribute("role","progressbar"),f.lines(e,f.opts),!u){var s,h=0,l=(r.lines-1)*(1-r.direction)/2,c=r.fps,o=c/r.speed,a=(1-r.opacity)/(o*r.trail/100),v=o/r.lines;!function y(){h++;for(var n=0;n<r.lines;n++)s=Math.max(1-(h+(r.lines-n)*v)%o*a,r.opacity),f.opacity(e,n*r.direction+l,s,r);f.timeout=f.el&&setTimeout(y,~~(1e3/c))}()}return f},stop:function(){var n=this.el;return n&&(clearTimeout(this.timeout),n.parentNode&&n.parentNode.removeChild(n),this.el=void 0),this},lines:function(r,f){function s(t,r){return n(i(),{position:"absolute",width:f.length+f.width+"px",height:f.width+"px",background:t,boxShadow:r,transformOrigin:"left",transform:"rotate("+~~(360/f.lines*e+f.rotate)+"deg) translate("+f.radius+"px,0)",borderRadius:(f.corners*f.width>>1)+"px"})}for(var o,e=0,c=(f.lines-1)*(1-f.direction)/2;e<f.lines;e++)o=n(i(),{position:"absolute",top:1+~(f.width/2)+"px",transform:f.hwaccel?"translate3d(0,0,0)":"",opacity:f.opacity,animation:u&&a(f.opacity,f.trail,c+e*f.direction,f.lines)+" "+1/f.speed+"s linear infinite"}),f.shadow&&t(o,n(s("#000","0 0 4px #000"),{top:"2px"})),t(r,t(o,s(h(f.color,e),"0 0 1px rgba(0,0,0,.1)")));return r},opacity:function(n,t,i){t<n.childNodes.length&&(n.childNodes[t].style.opacity=i)}}),f=n(i("group"),{behavior:"url(#default#VML)"}),!e(f,"transform")&&f.adj?v():u=e(f,"animation"),r});!function(n){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this;t.Clipboard=n()}}(function(){var n;return function n(t,i,r){function u(f,o){var h,c,s;if(!i[f]){if(!t[f]){if(h="function"==typeof require&&require,!o&&h)return h(f,!0);if(e)return e(f,!0);c=new Error("Cannot find module '"+f+"'");throw c.code="MODULE_NOT_FOUND",c;}s=i[f]={exports:{}};t[f][0].call(s.exports,function(n){var i=t[f][1][n];return u(i?i:n)},s,s.exports,n,t,i,r)}return i[f].exports}for(var e="function"==typeof require&&require,f=0;f<r.length;f++)u(r[f]);return u}({1:[function(n,t){var i=n("matches-selector");t.exports=function(n,t,r){for(var u=r?n:n.parentNode;u&&u!==document;){if(i(u,t))return u;u=u.parentNode}}},{"matches-selector":5}],2:[function(n,t){function i(n,t,i,u,f){var e=r.apply(this,arguments);return n.addEventListener(i,e,f),{destroy:function(){n.removeEventListener(i,e,f)}}}function r(n,t,i,r){return function(i){i.delegateTarget=u(i.target,t,!0);i.delegateTarget&&r.call(n,i)}}var u=n("closest");t.exports=i},{closest:1}],3:[function(n,t,i){i.node=function(n){return void 0!==n&&n instanceof HTMLElement&&1===n.nodeType};i.nodeList=function(n){var t=Object.prototype.toString.call(n);return void 0!==n&&("[object NodeList]"===t||"[object HTMLCollection]"===t)&&"length"in n&&(0===n.length||i.node(n[0]))};i.string=function(n){return"string"==typeof n||n instanceof String};i.fn=function(n){var t=Object.prototype.toString.call(n);return"[object Function]"===t}},{}],4:[function(n,t){function r(n,t,r){if(!n&&!t&&!r)throw new Error("Missing required arguments");if(!i.string(t))throw new TypeError("Second argument must be a String");if(!i.fn(r))throw new TypeError("Third argument must be a Function");if(i.node(n))return u(n,t,r);if(i.nodeList(n))return f(n,t,r);if(i.string(n))return e(n,t,r);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");}function u(n,t,i){return n.addEventListener(t,i),{destroy:function(){n.removeEventListener(t,i)}}}function f(n,t,i){return Array.prototype.forEach.call(n,function(n){n.addEventListener(t,i)}),{destroy:function(){Array.prototype.forEach.call(n,function(n){n.removeEventListener(t,i)})}}}function e(n,t,i){return o(document.body,n,t,i)}var i=n("./is"),o=n("delegate");t.exports=r},{"./is":3,delegate:2}],5:[function(n,t){function u(n,t){if(r)return r.call(n,t);for(var u=n.parentNode.querySelectorAll(t),i=0;i<u.length;++i)if(u[i]==n)return!0;return!1}var i=Element.prototype,r=i.matchesSelector||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector;t.exports=u},{}],6:[function(n,t){function i(n){var i,t,r;return"INPUT"===n.nodeName||"TEXTAREA"===n.nodeName?(n.focus(),n.setSelectionRange(0,n.value.length),i=n.value):(n.hasAttribute("contenteditable")&&n.focus(),t=window.getSelection(),r=document.createRange(),r.selectNodeContents(n),t.removeAllRanges(),t.addRange(r),i=t.toString()),i}t.exports=i},{}],7:[function(n,t){function i(){}i.prototype={on:function(n,t,i){var r=this.e||(this.e={});return(r[n]||(r[n]=[])).push({fn:t,ctx:i}),this},once:function(n,t,i){function r(){u.off(n,r);t.apply(i,arguments)}var u=this;return r._=t,this.on(n,r,i)},emit:function(n){var r=[].slice.call(arguments,1),i=((this.e||(this.e={}))[n]||[]).slice(),t=0,u=i.length;for(t;u>t;t++)i[t].fn.apply(i[t].ctx,r);return this},off:function(n,t){var u=this.e||(this.e={}),r=u[n],f=[],i,e;if(r&&t)for(i=0,e=r.length;e>i;i++)r[i].fn!==t&&r[i].fn._!==t&&f.push(r[i]);return f.length?u[n]=f:delete u[n],this}};t.exports=i},{}],8:[function(t,i,r){!function(u,f){if("function"==typeof n&&n.amd)n(["module","select"],f);else if("undefined"!=typeof r)f(i,t("select"));else{var e={exports:{}};f(e,u.select);u.clipboardAction=e.exports}}(this,function(n,t){"use strict";function r(n){return n&&n.__esModule?n:{"default":n}}function u(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}var i=r(t),f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol?"symbol":typeof n},e=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),o=function(){function n(t){u(this,n);this.resolveOptions(t);this.initSelection()}return n.prototype.resolveOptions=function(){var n=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.action=n.action;this.emitter=n.emitter;this.target=n.target;this.text=n.text;this.trigger=n.trigger;this.selectedText=""},n.prototype.initSelection=function(){this.text?this.selectFake():this.target&&this.selectTarget()},n.prototype.selectFake=function(){var n=this,t="rtl"==document.documentElement.getAttribute("dir");this.removeFake();this.fakeHandlerCallback=function(){return n.removeFake()};this.fakeHandler=document.body.addEventListener("click",this.fakeHandlerCallback)||!0;this.fakeElem=document.createElement("textarea");this.fakeElem.style.fontSize="12pt";this.fakeElem.style.border="0";this.fakeElem.style.padding="0";this.fakeElem.style.margin="0";this.fakeElem.style.position="absolute";this.fakeElem.style[t?"right":"left"]="-9999px";this.fakeElem.style.top=(window.pageYOffset||document.documentElement.scrollTop)+"px";this.fakeElem.setAttribute("readonly","");this.fakeElem.value=this.text;document.body.appendChild(this.fakeElem);this.selectedText=i.default(this.fakeElem);this.copyText()},n.prototype.removeFake=function(){this.fakeHandler&&(document.body.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null);this.fakeElem&&(document.body.removeChild(this.fakeElem),this.fakeElem=null)},n.prototype.selectTarget=function(){this.selectedText=i.default(this.target);this.copyText()},n.prototype.copyText=function(){var n=void 0;try{n=document.execCommand(this.action)}catch(t){n=!1}this.handleResult(n)},n.prototype.handleResult=function(n){n?this.emitter.emit("success",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)}):this.emitter.emit("error",{action:this.action,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})},n.prototype.clearSelection=function(){this.target&&this.target.blur();window.getSelection().removeAllRanges()},n.prototype.destroy=function(){this.removeFake()},e(n,[{key:"action",set:function(){var n=arguments.length<=0||void 0===arguments[0]?"copy":arguments[0];if(this._action=n,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"');},get:function(){return this._action}},{key:"target",set:function(n){if(void 0!==n){if(!n||"object"!==("undefined"==typeof n?"undefined":f(n))||1!==n.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&n.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(n.hasAttribute("readonly")||n.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=n}},get:function(){return this._target}}]),n}();n.exports=o})},{select:6}],9:[function(t,i,r){!function(u,f){if("function"==typeof n&&n.amd)n(["module","./clipboard-action","tiny-emitter","good-listener"],f);else if("undefined"!=typeof r)f(i,t("./clipboard-action"),t("tiny-emitter"),t("good-listener"));else{var e={exports:{}};f(e,u.clipboardAction,u.tinyEmitter,u.goodListener);u.clipboard=e.exports}}(this,function(n,t,i,r){"use strict";function u(n){return n&&n.__esModule?n:{"default":n}}function e(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function o(n,t){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?n:t}function s(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}});t&&(Object.setPrototypeOf?Object.setPrototypeOf(n,t):n.__proto__=t)}function f(n,t){var i="data-clipboard-"+n;if(t.hasAttribute(i))return t.getAttribute(i)}var h=u(t),c=u(i),l=u(r),a=function(n){function t(i,r){e(this,t);var u=o(this,n.call(this));return u.resolveOptions(r),u.listenClick(i),u}return s(t,n),t.prototype.resolveOptions=function(){var n=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.action="function"==typeof n.action?n.action:this.defaultAction;this.target="function"==typeof n.target?n.target:this.defaultTarget;this.text="function"==typeof n.text?n.text:this.defaultText},t.prototype.listenClick=function(n){var t=this;this.listener=l.default(n,"click",function(n){return t.onClick(n)})},t.prototype.onClick=function(n){var t=n.delegateTarget||n.currentTarget;this.clipboardAction&&(this.clipboardAction=null);this.clipboardAction=new h.default({action:this.action(t),target:this.target(t),text:this.text(t),trigger:t,emitter:this})},t.prototype.defaultAction=function(n){return f("action",n)},t.prototype.defaultTarget=function(n){var t=f("target",n);if(t)return document.querySelector(t)},t.prototype.defaultText=function(n){return f("text",n)},t.prototype.destroy=function(){this.listener.destroy();this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)},t}(c.default);n.exports=a})},{"./clipboard-action":8,"good-listener":4,"tiny-emitter":7}]},{},[9])(9)}),function(n){typeof define=="function"&&define.amd?define(["jquery"],n):n(jQuery)}(function(n){function u(){var r=e(this),u=t.settings;return isNaN(r.datetime)||(u.cutoff==0||Math.abs(f(r.datetime))<u.cutoff)&&n(this).text(i(r.datetime)),this}function e(i){if(i=n(i),!i.data("timeago")){i.data("timeago",{datetime:t.datetime(i)});var r=n.trim(i.text());t.settings.localeTitle?i.attr("title",i.data("timeago").datetime.toLocaleString()):r.length>0&&!(t.isTime(i)&&i.attr("title"))&&i.attr("title",r)}return i.data("timeago")}function i(n){return t.inWords(f(n))}function f(n){return(new Date).getTime()-n.getTime()}var t,r;n.timeago=function(t){return t instanceof Date?i(t):typeof t=="string"?i(n.timeago.parse(t)):typeof t=="number"?i(new Date(t)):i(n.timeago.datetime(t))};t=n.timeago;n.extend(n.timeago,{settings:{refreshMillis:6e4,allowPast:!0,allowFuture:!1,localeTitle:!1,cutoff:0,strings:{prefixAgo:null,prefixFromNow:null,suffixAgo:"ago",suffixFromNow:"from now",inPast:"any moment now",seconds:"less than a minute",minute:"about a minute",minutes:"%d minutes",hour:"about an hour",hours:"about %d hours",day:"a day",days:"%d days",month:"about a month",months:"%d months",year:"about a year",years:"%d years",wordSeparator:" ",numbers:[]}},inWords:function(t){function r(r,u){var f=n.isFunction(r)?r(u,t):r,e=i.numbers&&i.numbers[u]||u;return f.replace(/%d/i,e)}var a,s;if(!this.settings.allowPast&&!this.settings.allowFuture)throw"timeago allowPast and allowFuture settings can not both be set to false.";var i=this.settings.strings,h=i.prefixAgo,c=i.suffixAgo;if(this.settings.allowFuture&&t<0&&(h=i.prefixFromNow,c=i.suffixFromNow),!this.settings.allowPast&&t>=0)return this.settings.strings.inPast;var f=Math.abs(t)/1e3,e=f/60,o=e/60,u=o/24,l=u/365;return a=f<45&&r(i.seconds,Math.round(f))||f<90&&r(i.minute,1)||e<45&&r(i.minutes,Math.round(e))||e<90&&r(i.hour,1)||o<24&&r(i.hours,Math.round(o))||o<42&&r(i.day,1)||u<30&&r(i.days,Math.round(u))||u<45&&r(i.month,1)||u<365&&r(i.months,Math.round(u/30))||l<1.5&&r(i.year,1)||r(i.years,Math.round(l)),s=i.wordSeparator||"",i.wordSeparator===undefined&&(s=" "),n.trim([h,a,c].join(s))},parse:function(t){var i=n.trim(t);return i=i.replace(/\.\d+/,""),i=i.replace(/-/,"/").replace(/-/,"/"),i=i.replace(/T/," ").replace(/Z/," UTC"),i=i.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2"),i=i.replace(/([\+\-]\d\d)$/," $100"),new Date(i)},datetime:function(i){var r=t.isTime(i)?n(i).attr("datetime"):n(i).attr("title");return t.parse(r)},isTime:function(t){return n(t).get(0).tagName.toLowerCase()==="time"}});r={init:function(){var r=n.proxy(u,this),i;r();i=t.settings;i.refreshMillis>0&&(this._timeagoInterval=setInterval(r,i.refreshMillis))},update:function(i){var r=t.parse(i);n(this).data("timeago",{datetime:r});t.settings.localeTitle&&n(this).attr("title",r.toLocaleString());u.apply(this)},updateFromDOM:function(){n(this).data("timeago",{datetime:t.parse(t.isTime(this)?n(this).attr("datetime"):n(this).attr("title"))});u.apply(this)},dispose:function(){this._timeagoInterval&&(window.clearInterval(this._timeagoInterval),this._timeagoInterval=null)}};n.fn.timeago=function(n,t){var i=n?r[n]:r.init;if(!i)throw new Error("Unknown function name '"+n+"' for timeago");return this.each(function(){i.call(this,t)}),this};document.createElement("abbr");document.createElement("time")});!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):n.moment=t()}(this,function(){"use strict";function t(){return ke.apply(null,arguments)}function tt(n){return n instanceof Array||"[object Array]"===Object.prototype.toString.call(n)}function hi(n){return null!=n&&"[object Object]"===Object.prototype.toString.call(n)}function ns(n){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(n).length;for(var t in n)if(n.hasOwnProperty(t))return!1;return!0}function p(n){return void 0===n}function dt(n){return"number"==typeof n||"[object Number]"===Object.prototype.toString.call(n)}function di(n){return n instanceof Date||"[object Date]"===Object.prototype.toString.call(n)}function ef(n,t){for(var r=[],i=0;i<n.length;++i)r.push(t(n[i],i));return r}function l(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function vt(n,t){for(var i in t)l(t,i)&&(n[i]=t[i]);return l(t,"toString")&&(n.toString=t.toString),l(t,"valueOf")&&(n.valueOf=t.valueOf),n}function ft(n,t,i,r){return re(n,t,i,r,!0).utc()}function ts(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function u(n){return null==n._pf&&(n._pf=ts()),n._pf}function wr(n){if(null==n._isValid){var t=u(n),r=de.call(t.parsedDateParts,function(n){return null!=n}),i=!isNaN(n._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&r);if(n._strict&&(i=i&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(n))return i;n._isValid=i}return n._isValid}function gi(n){var t=ft(NaN);return null!=n?vt(u(t),n):u(t).userInvalidated=!0,t}function br(n,t){var i,r,f;if(p(t._isAMomentObject)||(n._isAMomentObject=t._isAMomentObject),p(t._i)||(n._i=t._i),p(t._f)||(n._f=t._f),p(t._l)||(n._l=t._l),p(t._strict)||(n._strict=t._strict),p(t._tzm)||(n._tzm=t._tzm),p(t._isUTC)||(n._isUTC=t._isUTC),p(t._offset)||(n._offset=t._offset),p(t._pf)||(n._pf=u(t)),p(t._locale)||(n._locale=t._locale),yu.length>0)for(i=0;i<yu.length;i++)p(f=t[r=yu[i]])||(n[r]=f);return n}function ci(n){br(this,n);this._d=new Date(null!=n._d?n._d.getTime():NaN);this.isValid()||(this._d=new Date(NaN));!1===pu&&(pu=!0,t.updateOffset(this),pu=!1)}function yt(n){return n instanceof ci||null!=n&&null!=n._isAMomentObject}function d(n){return n<0?Math.ceil(n)||0:Math.floor(n)}function f(n){var t=+n,i=0;return 0!==t&&isFinite(t)&&(i=d(t)),i}function of(n,t,i){for(var e=Math.min(n.length,t.length),o=Math.abs(n.length-t.length),u=0,r=0;r<e;r++)(i&&n[r]!==t[r]||!i&&f(n[r])!==f(t[r]))&&u++;return u+o}function sf(n){!1===t.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+n)}function g(n,i){var r=!0;return vt(function(){var u,e,f,o;if(null!=t.deprecationHandler&&t.deprecationHandler(null,n),r){for(e=[],f=0;f<arguments.length;f++){if(u="","object"==typeof arguments[f]){u+="\n["+f+"] ";for(o in arguments[0])u+=o+": "+arguments[0][o]+", ";u=u.slice(0,-2)}else u=arguments[f];e.push(u)}sf(n+"\nArguments: "+Array.prototype.slice.call(e).join("")+"\n"+(new Error).stack);r=!1}return i.apply(this,arguments)},i)}function hf(n,i){null!=t.deprecationHandler&&t.deprecationHandler(n,i);ge[n]||(sf(i),ge[n]=!0)}function et(n){return n instanceof Function||"[object Function]"===Object.prototype.toString.call(n)}function cf(n,t){var i,r=vt({},n);for(i in t)l(t,i)&&(hi(n[i])&&hi(t[i])?(r[i]={},vt(r[i],n[i]),vt(r[i],t[i])):null!=t[i]?r[i]=t[i]:delete r[i]);for(i in n)l(n,i)&&!l(t,i)&&hi(n[i])&&(r[i]=vt({},r[i]));return r}function kr(n){null!=n&&this.set(n)}function w(n,t){var i=n.toLowerCase();pi[i]=pi[i+"s"]=pi[t]=n}function nt(n){if("string"==typeof n)return pi[n]||pi[n.toLowerCase()]}function dr(n){var i,t,r={};for(t in n)l(n,t)&&(i=nt(t))&&(r[i]=n[t]);return r}function b(n,t){to[n]=t}function is(n){var t=[];for(var i in n)t.push({unit:i,priority:to[i]});return t.sort(function(n,t){return n.priority-t.priority}),t}function ht(n,t,i){var r=""+Math.abs(n),u=t-r.length;return(n>=0?i?"+":"":"-")+Math.pow(10,Math.max(0,u)).toString().substr(1)+r}function r(n,t,i,r){var u=r;"string"==typeof r&&(u=function(){return this[r]()});n&&(si[n]=u);t&&(si[t[0]]=function(){return ht(u.apply(this,arguments),t[1],t[2])});i&&(si[i]=function(){return this.localeData().ordinal(u.apply(this,arguments),n)})}function rs(n){return n.match(/\[[\s\S]/)?n.replace(/^\[|\]$/g,""):n.replace(/\\/g,"")}function us(n){for(var t=n.match(io),i=0,r=t.length;i<r;i++)t[i]=si[t[i]]?si[t[i]]:rs(t[i]);return function(i){for(var f="",u=0;u<r;u++)f+=et(t[u])?t[u].call(i,n):t[u];return f}}function gr(n,t){return n.isValid()?(t=lf(t,n.localeData()),wu[t]=wu[t]||us(t),wu[t](n)):n.localeData().invalidDate()}function lf(n,t){var i=5;for(sr.lastIndex=0;i>=0&&sr.test(n);)n=n.replace(sr,function(n){return t.longDateFormat(n)||n}),sr.lastIndex=0,i-=1;return n}function i(n,t,i){du[n]=et(t)?t:function(n){return n&&i?i:t}}function fs(n,t){return l(du,n)?du[n](t._strict,t._locale):new RegExp(es(n))}function es(n){return gt(n.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(n,t,i,r,u){return t||i||r||u}))}function gt(n){return n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function s(n,t){var i,r=t;for("string"==typeof n&&(n=[n]),dt(t)&&(r=function(n,i){i[t]=f(n)}),i=0;i<n.length;i++)gu[n[i]]=r}function li(n,t){s(n,function(n,i,r,u){r._w=r._w||{};t(n,r._w,r,u)})}function os(n,t,i){null!=t&&l(gu,n)&&gu[n](t,i._a,i,n)}function ai(n){return nr(n)?366:365}function nr(n){return n%4==0&&n%100!=0||n%400==0}function ui(n,i){return function(r){return null!=r?(af(this,n,r),t.updateOffset(this,i),this):tr(this,n)}}function tr(n,t){return n.isValid()?n._d["get"+(n._isUTC?"UTC":"")+t]():NaN}function af(n,t,i){n.isValid()&&!isNaN(i)&&("FullYear"===t&&nr(n.year())?n._d["set"+(n._isUTC?"UTC":"")+t](i,n.month(),ir(i,n.month())):n._d["set"+(n._isUTC?"UTC":"")+t](i))}function ss(n,t){return(n%t+t)%t}function ir(n,t){if(isNaN(n)||isNaN(t))return NaN;var i=ss(t,12);return n+=(t-i)/12,1===i?nr(n)?29:28:31-i%7%2}function hs(n,t,i){var u,r,e,f=n.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],u=0;u<12;++u)e=ft([2e3,u]),this._shortMonthsParse[u]=this.monthsShort(e,"").toLocaleLowerCase(),this._longMonthsParse[u]=this.months(e,"").toLocaleLowerCase();return i?"MMM"===t?-1!==(r=v.call(this._shortMonthsParse,f))?r:null:-1!==(r=v.call(this._longMonthsParse,f))?r:null:"MMM"===t?-1!==(r=v.call(this._shortMonthsParse,f))?r:-1!==(r=v.call(this._longMonthsParse,f))?r:null:-1!==(r=v.call(this._longMonthsParse,f))?r:-1!==(r=v.call(this._shortMonthsParse,f))?r:null}function vf(n,t){var i;if(!n.isValid())return n;if("string"==typeof t)if(/^\d+$/.test(t))t=f(t);else if(t=n.localeData().monthsParse(t),!dt(t))return n;return i=Math.min(n.date(),ir(n.year(),t)),n._d["set"+(n._isUTC?"UTC":"")+"Month"](t,i),n}function yf(n){return null!=n?(vf(this,n),t.updateOffset(this,!0),this):tr(this,"Month")}function pf(){function f(n,t){return t.length-n.length}for(var i,r=[],u=[],t=[],n=0;n<12;n++)i=ft([2e3,n]),r.push(this.monthsShort(i,"")),u.push(this.months(i,"")),t.push(this.months(i,"")),t.push(this.monthsShort(i,""));for(r.sort(f),u.sort(f),t.sort(f),n=0;n<12;n++)r[n]=gt(r[n]),u[n]=gt(u[n]);for(n=0;n<24;n++)t[n]=gt(t[n]);this._monthsRegex=new RegExp("^("+t.join("|")+")","i");this._monthsShortRegex=this._monthsRegex;this._monthsStrictRegex=new RegExp("^("+u.join("|")+")","i");this._monthsShortStrictRegex=new RegExp("^("+r.join("|")+")","i")}function cs(n,t,i,r,u,f,e){var o=new Date(n,t,i,r,u,f,e);return n<100&&n>=0&&isFinite(o.getFullYear())&&o.setFullYear(n),o}function vi(n){var t=new Date(Date.UTC.apply(null,arguments));return n<100&&n>=0&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(n),t}function rr(n,t,i){var r=7+t-i;return-((7+vi(n,0,r).getUTCDay()-t)%7)+r-1}function wf(n,t,i,r,u){var e,o,f=1+7*(t-1)+(7+i-r)%7+rr(n,r,u);return f<=0?o=ai(e=n-1)+f:f>ai(n)?(e=n+1,o=f-ai(n)):(e=n,o=f),{year:e,dayOfYear:o}}function yi(n,t,i){var u,f,e=rr(n.year(),t,i),r=Math.floor((n.dayOfYear()-e-1)/7)+1;return r<1?u=r+ni(f=n.year()-1,t,i):r>ni(n.year(),t,i)?(u=r-ni(n.year(),t,i),f=n.year()+1):(f=n.year(),u=r),{week:u,year:f}}function ni(n,t,i){var r=rr(n,t,i),u=rr(n+1,t,i);return(ai(n)-r+u)/7}function ls(n,t){return"string"!=typeof n?n:isNaN(n)?"number"==typeof(n=t.weekdaysParse(n))?n:null:parseInt(n,10)}function as(n,t){return"string"==typeof n?t.weekdaysParse(n)%7||7:isNaN(n)?null:n}function vs(n,t,i){var f,r,e,u=n.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],f=0;f<7;++f)e=ft([2e3,1]).day(f),this._minWeekdaysParse[f]=this.weekdaysMin(e,"").toLocaleLowerCase(),this._shortWeekdaysParse[f]=this.weekdaysShort(e,"").toLocaleLowerCase(),this._weekdaysParse[f]=this.weekdays(e,"").toLocaleLowerCase();return i?"dddd"===t?-1!==(r=v.call(this._weekdaysParse,u))?r:null:"ddd"===t?-1!==(r=v.call(this._shortWeekdaysParse,u))?r:null:-1!==(r=v.call(this._minWeekdaysParse,u))?r:null:"dddd"===t?-1!==(r=v.call(this._weekdaysParse,u))?r:-1!==(r=v.call(this._shortWeekdaysParse,u))?r:-1!==(r=v.call(this._minWeekdaysParse,u))?r:null:"ddd"===t?-1!==(r=v.call(this._shortWeekdaysParse,u))?r:-1!==(r=v.call(this._weekdaysParse,u))?r:-1!==(r=v.call(this._minWeekdaysParse,u))?r:null:-1!==(r=v.call(this._minWeekdaysParse,u))?r:-1!==(r=v.call(this._weekdaysParse,u))?r:-1!==(r=v.call(this._shortWeekdaysParse,u))?r:null}function nu(){function u(n,t){return t.length-n.length}for(var f,e,o,s,h=[],i=[],r=[],t=[],n=0;n<7;n++)f=ft([2e3,1]).day(n),e=this.weekdaysMin(f,""),o=this.weekdaysShort(f,""),s=this.weekdays(f,""),h.push(e),i.push(o),r.push(s),t.push(e),t.push(o),t.push(s);for(h.sort(u),i.sort(u),r.sort(u),t.sort(u),n=0;n<7;n++)i[n]=gt(i[n]),r[n]=gt(r[n]),t[n]=gt(t[n]);this._weekdaysRegex=new RegExp("^("+t.join("|")+")","i");this._weekdaysShortRegex=this._weekdaysRegex;this._weekdaysMinRegex=this._weekdaysRegex;this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i");this._weekdaysShortStrictRegex=new RegExp("^("+i.join("|")+")","i");this._weekdaysMinStrictRegex=new RegExp("^("+h.join("|")+")","i")}function tu(){return this.hours()%12||12}function bf(n,t){r(n,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function kf(n,t){return t._meridiemParse}function df(n){return n?n.toLowerCase().replace("_","-"):n}function ys(n){for(var t,i,f,u,r=0;r<n.length;){for(t=(u=df(n[r]).split("-")).length,i=(i=df(n[r+1]))?i.split("-"):null;t>0;){if(f=gf(u.slice(0,t).join("-")))return f;if(i&&i.length>=t&&of(u,i,!0)>=t-1)break;t--}r++}return null}function gf(n){var t=null;if(!a[n]&&"undefined"!=typeof module&&module&&module.exports)try{t=yr._abbr;require("./locale/"+n);fi(t)}catch(n){}return a[n]}function fi(n,t){var i;return n&&(i=p(t)?pt(n):iu(n,t))&&(yr=i),yr._abbr}function iu(n,t){if(null!==t){var i=lo;if(t.abbr=n,null!=a[n])hf("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=a[n]._config;else if(null!=t.parentLocale){if(null==a[t.parentLocale])return bi[t.parentLocale]||(bi[t.parentLocale]=[]),bi[t.parentLocale].push({name:n,config:t}),null;i=a[t.parentLocale]._config}return a[n]=new kr(cf(i,t)),bi[n]&&bi[n].forEach(function(n){iu(n.name,n.config)}),fi(n),a[n]}return delete a[n],null}function pt(n){var t;if(n&&n._locale&&n._locale._abbr&&(n=n._locale._abbr),!n)return yr;if(!tt(n)){if(t=gf(n))return t;n=[n]}return ys(n)}function ru(n){var i,t=n._a;return t&&-2===u(n).overflow&&(i=t[ct]<0||t[ct]>11?ct:t[ot]<1||t[ot]>ir(t[rt],t[ct])?ot:t[y]<0||t[y]>24||24===t[y]&&(0!==t[ut]||0!==t[lt]||0!==t[ri])?y:t[ut]<0||t[ut]>59?ut:t[lt]<0||t[lt]>59?lt:t[ri]<0||t[ri]>999?ri:-1,u(n)._overflowDayOfYear&&(i<rt||i>ot)&&(i=ot),u(n)._overflowWeeks&&-1===i&&(i=vh),u(n)._overflowWeekday&&-1===i&&(i=yh),u(n).overflow=i),n}function ei(n,t,i){return null!=n?n:null!=t?t:i}function ps(n){var i=new Date(t.now());return n._useUTC?[i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()]:[i.getFullYear(),i.getMonth(),i.getDate()]}function uu(n){var t,i,r,f,e=[];if(!n._d){for(r=ps(n),n._w&&null==n._a[ot]&&null==n._a[ct]&&ws(n),null!=n._dayOfYear&&(f=ei(n._a[rt],r[rt]),(n._dayOfYear>ai(f)||0===n._dayOfYear)&&(u(n)._overflowDayOfYear=!0),i=vi(f,0,n._dayOfYear),n._a[ct]=i.getUTCMonth(),n._a[ot]=i.getUTCDate()),t=0;t<3&&null==n._a[t];++t)n._a[t]=e[t]=r[t];for(;t<7;t++)n._a[t]=e[t]=null==n._a[t]?2===t?1:0:n._a[t];24===n._a[y]&&0===n._a[ut]&&0===n._a[lt]&&0===n._a[ri]&&(n._nextDay=!0,n._a[y]=0);n._d=(n._useUTC?vi:cs).apply(null,e);null!=n._tzm&&n._d.setUTCMinutes(n._d.getUTCMinutes()-n._tzm);n._nextDay&&(n._a[y]=24);n._w&&void 0!==n._w.d&&n._w.d!==n._d.getDay()&&(u(n).weekdayMismatch=!0)}}function ws(n){var t,o,f,i,r,e,h,s,l;null!=(t=n._w).GG||null!=t.W||null!=t.E?(r=1,e=4,o=ei(t.GG,n._a[rt],yi(c(),1,4).year),f=ei(t.W,1),((i=ei(t.E,1))<1||i>7)&&(s=!0)):(r=n._locale._week.dow,e=n._locale._week.doy,l=yi(c(),r,e),o=ei(t.gg,n._a[rt],l.year),f=ei(t.w,l.week),null!=t.d?((i=t.d)<0||i>6)&&(s=!0):null!=t.e?(i=t.e+r,(t.e<0||t.e>6)&&(s=!0)):i=r);f<1||f>ni(o,r,e)?u(n)._overflowWeeks=!0:null!=s?u(n)._overflowWeekday=!0:(h=wf(o,f,i,r,e),n._a[rt]=h.year,n._dayOfYear=h.dayOfYear)}function ne(n){var t,r,o,e,f,s,h=n._i,i=rc.exec(h)||uc.exec(h);if(i){for(u(n).iso=!0,t=0,r=pr.length;t<r;t++)if(pr[t][1].exec(i[1])){e=pr[t][0];o=!1!==pr[t][2];break}if(null==e)return void(n._isValid=!1);if(i[3]){for(t=0,r=tf.length;t<r;t++)if(tf[t][1].exec(i[3])){f=(i[2]||" ")+tf[t][0];break}if(null==f)return void(n._isValid=!1)}if(!o&&null!=f)return void(n._isValid=!1);if(i[4]){if(!fc.exec(i[4]))return void(n._isValid=!1);s="Z"}n._f=e+(f||"")+(s||"");fu(n)}else n._isValid=!1}function bs(n,t,i,r,u,f){var e=[ks(n),so.indexOf(t),parseInt(i,10),parseInt(r,10),parseInt(u,10)];return f&&e.push(parseInt(f,10)),e}function ks(n){var t=parseInt(n,10);return t<=49?2e3+t:t<=999?1900+t:t}function ds(n){return n.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}function gs(n,t,i){return!n||co.indexOf(n)===new Date(t[0],t[1],t[2]).getDay()||(u(i).weekdayMismatch=!0,i._isValid=!1,!1)}function nh(n,t,i){if(n)return sc[n];if(t)return 0;var r=parseInt(i,10),u=r%100;return 60*((r-u)/100)+u}function te(n){var t=oc.exec(ds(n._i)),i;if(t){if(i=bs(t[4],t[3],t[2],t[5],t[6],t[7]),!gs(t[1],i,n))return;n._a=i;n._tzm=nh(t[8],t[9],t[10]);n._d=vi.apply(null,n._a);n._d.setUTCMinutes(n._d.getUTCMinutes()-n._tzm);u(n).rfc2822=!0}else n._isValid=!1}function th(n){var i=ec.exec(n._i);null===i?(ne(n),!1===n._isValid&&(delete n._isValid,te(n),!1===n._isValid&&(delete n._isValid,t.createFromInputFallback(n)))):n._d=new Date(+i[1])}function fu(n){if(n._f!==t.ISO_8601)if(n._f!==t.RFC_2822){n._a=[];u(n).empty=!0;for(var r,f,s,i=""+n._i,c=i.length,h=0,o=lf(n._f,n._locale).match(io)||[],e=0;e<o.length;e++)f=o[e],(r=(i.match(fs(f,n))||[])[0])&&((s=i.substr(0,i.indexOf(r))).length>0&&u(n).unusedInput.push(s),i=i.slice(i.indexOf(r)+r.length),h+=r.length),si[f]?(r?u(n).empty=!1:u(n).unusedTokens.push(f),os(f,r,n)):n._strict&&!r&&u(n).unusedTokens.push(f);u(n).charsLeftOver=c-h;i.length>0&&u(n).unusedInput.push(i);n._a[y]<=12&&!0===u(n).bigHour&&n._a[y]>0&&(u(n).bigHour=void 0);u(n).parsedDateParts=n._a.slice(0);u(n).meridiem=n._meridiem;n._a[y]=ih(n._locale,n._a[y],n._meridiem);uu(n);ru(n)}else te(n);else ne(n)}function ih(n,t,i){var r;return null==i?t:null!=n.meridiemHour?n.meridiemHour(t,i):null!=n.isPM?((r=n.isPM(i))&&t<12&&(t+=12),r||12!==t||(t=0),t):t}function rh(n){var t,e,f,r,i;if(0===n._f.length)return u(n).invalidFormat=!0,void(n._d=new Date(NaN));for(r=0;r<n._f.length;r++)i=0,t=br({},n),null!=n._useUTC&&(t._useUTC=n._useUTC),t._f=n._f[r],fu(t),wr(t)&&(i+=u(t).charsLeftOver,i+=10*u(t).unusedTokens.length,u(t).score=i,(null==f||i<f)&&(f=i,e=t));vt(n,e||t)}function uh(n){if(!n._d){var t=dr(n._i);n._a=ef([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(n){return n&&parseInt(n,10)});uu(n)}}function fh(n){var t=new ci(ru(ie(n)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function ie(n){var t=n._i,i=n._f;return n._locale=n._locale||pt(n._l),null===t||void 0===i&&""===t?gi({nullInput:!0}):("string"==typeof t&&(n._i=t=n._locale.preparse(t)),yt(t)?new ci(ru(t)):(di(t)?n._d=t:tt(i)?rh(n):i?fu(n):eh(n),wr(n)||(n._d=null),n))}function eh(n){var i=n._i;p(i)?n._d=new Date(t.now()):di(i)?n._d=new Date(i.valueOf()):"string"==typeof i?th(n):tt(i)?(n._a=ef(i.slice(0),function(n){return parseInt(n,10)}),uu(n)):hi(i)?uh(n):dt(i)?n._d=new Date(i):t.createFromInputFallback(n)}function re(n,t,i,r,u){var f={};return!0!==i&&!1!==i||(r=i,i=void 0),(hi(n)&&ns(n)||tt(n)&&0===n.length)&&(n=void 0),f._isAMomentObject=!0,f._useUTC=f._isUTC=u,f._l=i,f._i=n,f._f=t,f._strict=r,fh(f)}function c(n,t,i,r){return re(n,t,i,r,!1)}function ue(n,t){var r,i;if(1===t.length&&tt(t[0])&&(t=t[0]),!t.length)return c();for(r=t[0],i=1;i<t.length;++i)t[i].isValid()&&!t[i][n](r)||(r=t[i]);return r}function oh(n){var i,r,t;for(i in n)if(-1===v.call(ki,i)||null!=n[i]&&isNaN(n[i]))return!1;for(r=!1,t=0;t<ki.length;++t)if(n[ki[t]]){if(r)return!1;parseFloat(n[ki[t]])!==f(n[ki[t]])&&(r=!0)}return!0}function ur(n){var t=dr(n),i=t.year||0,r=t.quarter||0,u=t.month||0,f=t.week||0,e=t.day||0,o=t.hour||0,s=t.minute||0,h=t.second||0,c=t.millisecond||0;this._isValid=oh(t);this._milliseconds=+c+1e3*h+6e4*s+36e5*o;this._days=+e+7*f;this._months=+u+3*r+12*i;this._data={};this._locale=pt();this._bubble()}function eu(n){return n instanceof ur}function ou(n){return n<0?-1*Math.round(-1*n):Math.round(n)}function fe(n,t){r(n,0,0,function(){var n=this.utcOffset(),i="+";return n<0&&(n=-n,i="-"),i+ht(~~(n/60),2)+t+ht(~~n%60,2)})}function su(n,t){var u=(t||"").match(n),i,r;return null===u?null:(i=((u[u.length-1]||[])+"").match(ao)||["-",0,0],r=60*i[1]+f(i[2]),0===r?0:"+"===i[0]?r:-r)}function hu(n,i){var r,u;return i._isUTC?(r=i.clone(),u=(yt(n)||di(n)?n.valueOf():c(n).valueOf())-r.valueOf(),r._d.setTime(r._d.valueOf()+u),t.updateOffset(r,!1),r):c(n).local()}function cu(n){return 15*-Math.round(n._d.getTimezoneOffset()/15)}function ee(){return!!this.isValid()&&this._isUTC&&0===this._offset}function it(n,t){var u,e,o,r=n,i=null;return eu(n)?r={ms:n._milliseconds,d:n._days,M:n._months}:dt(n)?(r={},t?r[t]=n:r.milliseconds=n):(i=vo.exec(n))?(u="-"===i[1]?-1:1,r={y:0,d:f(i[ot])*u,h:f(i[y])*u,m:f(i[ut])*u,s:f(i[lt])*u,ms:f(ou(1e3*i[ri]))*u}):(i=yo.exec(n))?(u="-"===i[1]?-1:(i[1],1),r={y:ti(i[2],u),M:ti(i[3],u),w:ti(i[4],u),d:ti(i[5],u),h:ti(i[6],u),m:ti(i[7],u),s:ti(i[8],u)}):null==r?r={}:"object"==typeof r&&("from"in r||"to"in r)&&(o=sh(c(r.from),c(r.to)),(r={}).ms=o.milliseconds,r.M=o.months),e=new ur(r),eu(n)&&l(n,"_locale")&&(e._locale=n._locale),e}function ti(n,t){var i=n&&parseFloat(n.replace(",","."));return(isNaN(i)?0:i)*t}function oe(n,t){var i={milliseconds:0,months:0};return i.months=t.month()-n.month()+12*(t.year()-n.year()),n.clone().add(i.months,"M").isAfter(t)&&--i.months,i.milliseconds=+t-+n.clone().add(i.months,"M"),i}function sh(n,t){var i;return n.isValid()&&t.isValid()?(t=hu(t,n),n.isBefore(t)?i=oe(n,t):((i=oe(t,n)).milliseconds=-i.milliseconds,i.months=-i.months),i):{milliseconds:0,months:0}}function se(n,t){return function(i,r){var u,f;return null===r||isNaN(+r)||(hf(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),f=i,i=r,r=f),i="string"==typeof i?+i:i,u=it(i,r),he(this,u,n),this}}function he(n,i,r,u){var o=i._milliseconds,f=ou(i._days),e=ou(i._months);n.isValid()&&(u=null==u||u,e&&vf(n,tr(n,"Month")+e*r),f&&af(n,"Date",tr(n,"Date")+f*r),o&&n._d.setTime(n._d.valueOf()+o*r),u&&t.updateOffset(n,f||e))}function lu(n,t){var u,r=12*(t.year()-n.year())+(t.month()-n.month()),i=n.clone().add(r,"months");return u=t-i<0?(t-i)/(i-n.clone().add(r-1,"months")):(t-i)/(n.clone().add(r+1,"months")-i),-(r+u)||0}function ce(n){var t;return void 0===n?this._locale._abbr:(null!=(t=pt(n))&&(this._locale=t),this)}function le(){return this._locale}function fr(n,t){r(0,[n,n.length],0,t)}function ae(n,t,i,r,u){var f;return null==n?yi(this,r,u).year:(f=ni(n,r,u),t>f&&(t=f),hh.call(this,n,t,i,r,u))}function hh(n,t,i,r,u){var e=wf(n,t,i,r,u),f=vi(e.year,0,e.dayOfYear);return this.year(f.getUTCFullYear()),this.month(f.getUTCMonth()),this.date(f.getUTCDate()),this}function ve(n){return n}function er(n,t,i,r){var u=pt(),f=ft().set(r,t);return u[i](f,n)}function ye(n,t,i){if(dt(n)&&(t=n,n=void 0),n=n||"",null!=t)return er(n,t,i,"month");for(var u=[],r=0;r<12;r++)u[r]=er(n,r,i,"month");return u}function au(n,t,i,r){var o,f,u,e;if("boolean"==typeof n?(dt(t)&&(i=t,t=void 0),t=t||""):(i=t=n,n=!1,dt(t)&&(i=t,t=void 0),t=t||""),o=pt(),f=n?o._week.dow:0,null!=i)return er(t,(i+f)%7,r,"day");for(e=[],u=0;u<7;u++)e[u]=er(t,(u+f)%7,r,"day");return e}function pe(n,t,i,r){var u=it(t,i);return n._milliseconds+=r*u._milliseconds,n._days+=r*u._days,n._months+=r*u._months,n._bubble()}function we(n){return n<0?Math.floor(n):Math.ceil(n)}function be(n){return 4800*n/146097}function vu(n){return 146097*n/4800}function wt(n){return function(){return this.as(n)}}function ii(n){return function(){return this.isValid()?this._data[n]:NaN}}function ch(n,t,i,r,u){return u.relativeTime(t||1,!!i,n,r)}function lh(n,t,i){var r=it(n).abs(),u=kt(r.as("s")),e=kt(r.as("m")),o=kt(r.as("h")),s=kt(r.as("d")),h=kt(r.as("M")),c=kt(r.as("y")),f=u<=st.ss&&["s",u]||u<st.s&&["ss",u]||e<=1&&["m"]||e<st.m&&["mm",e]||o<=1&&["h"]||o<st.h&&["hh",o]||s<=1&&["d"]||s<st.d&&["dd",s]||h<=1&&["M"]||h<st.M&&["MM",h]||c<=1&&["y"]||["yy",c];return f[2]=t,f[3]=+n>0,f[4]=i,ch.apply(null,f)}function oi(n){return(n>0)-(n<0)||+n}function or(){if(!this.isValid())return this.localeData().invalidDate();var i,o,v,t=ff(this._milliseconds)/1e3,y=ff(this._days),s=ff(this._months);o=d((i=d(t/60))/60);t%=60;i%=60;var h=v=d(s/12),c=s%=12,l=y,r=o,u=i,f=t?t.toFixed(3).replace(/\.?0+$/,""):"",n=this.asSeconds();if(!n)return"P0D";var p=n<0?"-":"",a=oi(this._months)!==oi(n)?"-":"",w=oi(this._days)!==oi(n)?"-":"",e=oi(this._milliseconds)!==oi(n)?"-":"";return p+"P"+(h?a+h+"Y":"")+(c?a+c+"M":"")+(l?w+l+"D":"")+(r||u||f?"T":"")+(r?e+r+"H":"")+(u?e+u+"M":"")+(f?e+f+"S":"")}var ke,de,no,v,nf,ho,ao,vo,yo,po,wo,rf,uf,bo,ko,bt,go,n,o;de=Array.prototype.some?Array.prototype.some:function(n){for(var i=Object(this),r=i.length>>>0,t=0;t<r;t++)if(t in i&&n.call(this,i[t],t,i))return!0;return!1};var yu=t.momentProperties=[],pu=!1,ge={};t.suppressDeprecationWarnings=!1;t.deprecationHandler=null;no=Object.keys?Object.keys:function(n){var t,i=[];for(t in n)l(n,t)&&i.push(t);return i};var pi={},to={},io=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,sr=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,wu={},si={},ro=/\d/,k=/\d\d/,uo=/\d{3}/,bu=/\d{4}/,hr=/[+-]?\d{6}/,h=/\d\d?/,fo=/\d\d\d\d?/,eo=/\d\d\d\d\d\d?/,cr=/\d{1,3}/,ku=/\d{1,4}/,lr=/[+-]?\d{1,6}/,ar=/[+-]?\d+/,ah=/Z|[+-]\d\d:?\d\d/gi,vr=/Z|[+-]\d\d(?::?\d\d)?/gi,wi=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,du={},gu={},rt=0,ct=1,ot=2,y=3,ut=4,lt=5,ri=6,vh=7,yh=8;r("Y",0,0,function(){var n=this.year();return n<=9999?""+n:"+"+n});r(0,["YY",2],0,function(){return this.year()%100});r(0,["YYYY",4],0,"year");r(0,["YYYYY",5],0,"year");r(0,["YYYYYY",6,!0],0,"year");w("year","y");b("year",1);i("Y",ar);i("YY",h,k);i("YYYY",ku,bu);i("YYYYY",lr,hr);i("YYYYYY",lr,hr);s(["YYYYY","YYYYYY"],rt);s("YYYY",function(n,i){i[rt]=2===n.length?t.parseTwoDigitYear(n):f(n)});s("YY",function(n,i){i[rt]=t.parseTwoDigitYear(n)});s("Y",function(n,t){t[rt]=parseInt(n,10)});t.parseTwoDigitYear=function(n){return f(n)+(f(n)>68?1900:2e3)};nf=ui("FullYear",!0);v=Array.prototype.indexOf?Array.prototype.indexOf:function(n){for(var t=0;t<this.length;++t)if(this[t]===n)return t;return-1};r("M",["MM",2],"Mo",function(){return this.month()+1});r("MMM",0,0,function(n){return this.localeData().monthsShort(this,n)});r("MMMM",0,0,function(n){return this.localeData().months(this,n)});w("month","M");b("month",8);i("M",h);i("MM",h,k);i("MMM",function(n,t){return t.monthsShortRegex(n)});i("MMMM",function(n,t){return t.monthsRegex(n)});s(["M","MM"],function(n,t){t[ct]=f(n)-1});s(["MMM","MMMM"],function(n,t,i,r){var f=i._locale.monthsParse(n,r,i._strict);null!=f?t[ct]=f:u(i).invalidMonth=n});var oo=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,ph="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),so="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),wh=wi,bh=wi;r("w",["ww",2],"wo","week");r("W",["WW",2],"Wo","isoWeek");w("week","w");w("isoWeek","W");b("week",5);b("isoWeek",5);i("w",h);i("ww",h,k);i("W",h);i("WW",h,k);li(["w","ww","W","WW"],function(n,t,i,r){t[r.substr(0,1)]=f(n)});ho={dow:0,doy:6};r("d",0,"do","day");r("dd",0,0,function(n){return this.localeData().weekdaysMin(this,n)});r("ddd",0,0,function(n){return this.localeData().weekdaysShort(this,n)});r("dddd",0,0,function(n){return this.localeData().weekdays(this,n)});r("e",0,0,"weekday");r("E",0,0,"isoWeekday");w("day","d");w("weekday","e");w("isoWeekday","E");b("day",11);b("weekday",11);b("isoWeekday",11);i("d",h);i("e",h);i("E",h);i("dd",function(n,t){return t.weekdaysMinRegex(n)});i("ddd",function(n,t){return t.weekdaysShortRegex(n)});i("dddd",function(n,t){return t.weekdaysRegex(n)});li(["dd","ddd","dddd"],function(n,t,i,r){var f=i._locale.weekdaysParse(n,r,i._strict);null!=f?t.d=f:u(i).invalidWeekday=n});li(["d","e","E"],function(n,t,i,r){t[r]=f(n)});var kh="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),co="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),dh="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),gh=wi,nc=wi,tc=wi;r("H",["HH",2],0,"hour");r("h",["hh",2],0,tu);r("k",["kk",2],0,function(){return this.hours()||24});r("hmm",0,0,function(){return""+tu.apply(this)+ht(this.minutes(),2)});r("hmmss",0,0,function(){return""+tu.apply(this)+ht(this.minutes(),2)+ht(this.seconds(),2)});r("Hmm",0,0,function(){return""+this.hours()+ht(this.minutes(),2)});r("Hmmss",0,0,function(){return""+this.hours()+ht(this.minutes(),2)+ht(this.seconds(),2)});bf("a",!0);bf("A",!1);w("hour","h");b("hour",13);i("a",kf);i("A",kf);i("H",h);i("h",h);i("k",h);i("HH",h,k);i("hh",h,k);i("kk",h,k);i("hmm",fo);i("hmmss",eo);i("Hmm",fo);i("Hmmss",eo);s(["H","HH"],y);s(["k","kk"],function(n,t){var i=f(n);t[y]=24===i?0:i});s(["a","A"],function(n,t,i){i._isPm=i._locale.isPM(n);i._meridiem=n});s(["h","hh"],function(n,t,i){t[y]=f(n);u(i).bigHour=!0});s("hmm",function(n,t,i){var r=n.length-2;t[y]=f(n.substr(0,r));t[ut]=f(n.substr(r));u(i).bigHour=!0});s("hmmss",function(n,t,i){var r=n.length-4,e=n.length-2;t[y]=f(n.substr(0,r));t[ut]=f(n.substr(r,2));t[lt]=f(n.substr(e));u(i).bigHour=!0});s("Hmm",function(n,t){var i=n.length-2;t[y]=f(n.substr(0,i));t[ut]=f(n.substr(i))});s("Hmmss",function(n,t){var i=n.length-4,r=n.length-2;t[y]=f(n.substr(0,i));t[ut]=f(n.substr(i,2));t[lt]=f(n.substr(r))});var yr,ic=ui("Hours",!0),lo={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:ph,monthsShort:so,week:ho,weekdays:kh,weekdaysMin:dh,weekdaysShort:co,meridiemParse:/[ap]\.?m?\.?/i},a={},bi={},rc=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,uc=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,fc=/Z|[+-]\d\d(?::?\d\d)?/,pr=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],tf=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],ec=/^\/?Date\((\-?\d+)/i,oc=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,sc={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};t.createFromInputFallback=g("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(n){n._d=new Date(n._i+(n._useUTC?" UTC":""))});t.ISO_8601=function(){};t.RFC_2822=function(){};var hc=g("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var n=c.apply(null,arguments);return this.isValid()&&n.isValid()?n<this?this:n:gi()}),cc=g("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var n=c.apply(null,arguments);return this.isValid()&&n.isValid()?n>this?this:n:gi()}),ki=["year","quarter","month","week","day","hour","minute","second","millisecond"];for(fe("Z",":"),fe("ZZ",""),i("Z",vr),i("ZZ",vr),s(["Z","ZZ"],function(n,t,i){i._useUTC=!0;i._tzm=su(vr,n)}),ao=/([\+\-]|\d\d)/gi,t.updateOffset=function(){},vo=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,yo=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,it.fn=ur.prototype,it.invalid=function(){return it(NaN)},po=se(1,"add"),wo=se(-1,"subtract"),t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",t.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]",rf=g("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(n){return void 0===n?this.localeData():this.locale(n)}),r(0,["gg",2],0,function(){return this.weekYear()%100}),r(0,["GG",2],0,function(){return this.isoWeekYear()%100}),fr("gggg","weekYear"),fr("ggggg","weekYear"),fr("GGGG","isoWeekYear"),fr("GGGGG","isoWeekYear"),w("weekYear","gg"),w("isoWeekYear","GG"),b("weekYear",1),b("isoWeekYear",1),i("G",ar),i("g",ar),i("GG",h,k),i("gg",h,k),i("GGGG",ku,bu),i("gggg",ku,bu),i("GGGGG",lr,hr),i("ggggg",lr,hr),li(["gggg","ggggg","GGGG","GGGGG"],function(n,t,i,r){t[r.substr(0,2)]=f(n)}),li(["gg","GG"],function(n,i,r,u){i[u]=t.parseTwoDigitYear(n)}),r("Q",0,"Qo","quarter"),w("quarter","Q"),b("quarter",7),i("Q",ro),s("Q",function(n,t){t[ct]=3*(f(n)-1)}),r("D",["DD",2],"Do","date"),w("date","D"),b("date",9),i("D",h),i("DD",h,k),i("Do",function(n,t){return n?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),s(["D","DD"],ot),s("Do",function(n,t){t[ot]=f(n.match(h)[0],10)}),uf=ui("Date",!0),r("DDD",["DDDD",3],"DDDo","dayOfYear"),w("dayOfYear","DDD"),b("dayOfYear",4),i("DDD",cr),i("DDDD",uo),s(["DDD","DDDD"],function(n,t,i){i._dayOfYear=f(n)}),r("m",["mm",2],0,"minute"),w("minute","m"),b("minute",14),i("m",h),i("mm",h,k),s(["m","mm"],ut),bo=ui("Minutes",!1),r("s",["ss",2],0,"second"),w("second","s"),b("second",15),i("s",h),i("ss",h,k),s(["s","ss"],lt),ko=ui("Seconds",!1),r("S",0,0,function(){return~~(this.millisecond()/100)}),r(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),r(0,["SSS",3],0,"millisecond"),r(0,["SSSS",4],0,function(){return 10*this.millisecond()}),r(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),r(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),r(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),r(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),r(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),w("millisecond","ms"),b("millisecond",16),i("S",cr,ro),i("SS",cr,k),i("SSS",cr,uo),bt="SSSS";bt.length<=9;bt+="S")i(bt,/\d+/);for(bt="S";bt.length<=9;bt+="S")s(bt,function(n,t){t[ri]=f(1e3*("0."+n))});go=ui("Milliseconds",!1);r("z",0,0,"zoneAbbr");r("zz",0,0,"zoneName");n=ci.prototype;n.add=po;n.calendar=function(n,i){var u=n||c(),f=hu(u,this).startOf("day"),r=t.calendarFormat(this,f)||"sameElse",e=i&&(et(i[r])?i[r].call(this,u):i[r]);return this.format(e||this.localeData().calendar(r,this,c(u)))};n.clone=function(){return new ci(this)};n.diff=function(n,t,i){var r,f,u;if(!this.isValid())return NaN;if(!(r=hu(n,this)).isValid())return NaN;switch(f=6e4*(r.utcOffset()-this.utcOffset()),t=nt(t)){case"year":u=lu(this,r)/12;break;case"month":u=lu(this,r);break;case"quarter":u=lu(this,r)/3;break;case"second":u=(this-r)/1e3;break;case"minute":u=(this-r)/6e4;break;case"hour":u=(this-r)/36e5;break;case"day":u=(this-r-f)/864e5;break;case"week":u=(this-r-f)/6048e5;break;default:u=this-r}return i?u:d(u)};n.endOf=function(n){return void 0===(n=nt(n))||"millisecond"===n?this:("date"===n&&(n="day"),this.startOf(n).add(1,"isoWeek"===n?"week":n).subtract(1,"ms"))};n.format=function(n){n||(n=this.isUtc()?t.defaultFormatUtc:t.defaultFormat);var i=gr(this,n);return this.localeData().postformat(i)};n.from=function(n,t){return this.isValid()&&(yt(n)&&n.isValid()||c(n).isValid())?it({to:this,from:n}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()};n.fromNow=function(n){return this.from(c(),n)};n.to=function(n,t){return this.isValid()&&(yt(n)&&n.isValid()||c(n).isValid())?it({from:this,to:n}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()};n.toNow=function(n){return this.to(c(),n)};n.get=function(n){return n=nt(n),et(this[n])?this[n]():this};n.invalidAt=function(){return u(this).overflow};n.isAfter=function(n,t){var i=yt(n)?n:c(n);return!(!this.isValid()||!i.isValid())&&("millisecond"===(t=nt(p(t)?"millisecond":t))?this.valueOf()>i.valueOf():i.valueOf()<this.clone().startOf(t).valueOf())};n.isBefore=function(n,t){var i=yt(n)?n:c(n);return!(!this.isValid()||!i.isValid())&&("millisecond"===(t=nt(p(t)?"millisecond":t))?this.valueOf()<i.valueOf():this.clone().endOf(t).valueOf()<i.valueOf())};n.isBetween=function(n,t,i,r){return("("===(r=r||"()")[0]?this.isAfter(n,i):!this.isBefore(n,i))&&(")"===r[1]?this.isBefore(t,i):!this.isAfter(t,i))};n.isSame=function(n,t){var i,r=yt(n)?n:c(n);return!(!this.isValid()||!r.isValid())&&("millisecond"===(t=nt(t||"millisecond"))?this.valueOf()===r.valueOf():(i=r.valueOf(),this.clone().startOf(t).valueOf()<=i&&i<=this.clone().endOf(t).valueOf()))};n.isSameOrAfter=function(n,t){return this.isSame(n,t)||this.isAfter(n,t)};n.isSameOrBefore=function(n,t){return this.isSame(n,t)||this.isBefore(n,t)};n.isValid=function(){return wr(this)};n.lang=rf;n.locale=ce;n.localeData=le;n.max=cc;n.min=hc;n.parsingFlags=function(){return vt({},u(this))};n.set=function(n,t){if("object"==typeof n)for(var r=is(n=dr(n)),i=0;i<r.length;i++)this[r[i].unit](n[r[i].unit]);else if(n=nt(n),et(this[n]))return this[n](t);return this};n.startOf=function(n){switch(n=nt(n)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===n&&this.weekday(0),"isoWeek"===n&&this.isoWeekday(1),"quarter"===n&&this.month(3*Math.floor(this.month()/3)),this};n.subtract=wo;n.toArray=function(){var n=this;return[n.year(),n.month(),n.date(),n.hour(),n.minute(),n.second(),n.millisecond()]};n.toObject=function(){var n=this;return{years:n.year(),months:n.month(),date:n.date(),hours:n.hours(),minutes:n.minutes(),seconds:n.seconds(),milliseconds:n.milliseconds()}};n.toDate=function(){return new Date(this.valueOf())};n.toISOString=function(){if(!this.isValid())return null;var n=this.clone().utc();return n.year()<0||n.year()>9999?gr(n,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):et(Date.prototype.toISOString)?this.toDate().toISOString():gr(n,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")};n.inspect=function(){var n,t;if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";n="moment";t="";this.isLocal()||(n=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var i="["+n+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",u=t+'[")]';return this.format(i+r+"-MM-DD[T]HH:mm:ss.SSS"+u)};n.toJSON=function(){return this.isValid()?this.toISOString():null};n.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")};n.unix=function(){return Math.floor(this.valueOf()/1e3)};n.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)};n.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}};n.year=nf;n.isLeapYear=function(){return nr(this.year())};n.weekYear=function(n){return ae.call(this,n,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)};n.isoWeekYear=function(n){return ae.call(this,n,this.isoWeek(),this.isoWeekday(),1,4)};n.quarter=n.quarters=function(n){return null==n?Math.ceil((this.month()+1)/3):this.month(3*(n-1)+this.month()%3)};n.month=yf;n.daysInMonth=function(){return ir(this.year(),this.month())};n.week=n.weeks=function(n){var t=this.localeData().week(this);return null==n?t:this.add(7*(n-t),"d")};n.isoWeek=n.isoWeeks=function(n){var t=yi(this,1,4).week;return null==n?t:this.add(7*(n-t),"d")};n.weeksInYear=function(){var n=this.localeData()._week;return ni(this.year(),n.dow,n.doy)};n.isoWeeksInYear=function(){return ni(this.year(),1,4)};n.date=uf;n.day=n.days=function(n){if(!this.isValid())return null!=n?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=n?(n=ls(n,this.localeData()),this.add(n-t,"d")):t};n.weekday=function(n){if(!this.isValid())return null!=n?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==n?t:this.add(n-t,"d")};n.isoWeekday=function(n){if(!this.isValid())return null!=n?this:NaN;if(null!=n){var t=as(n,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7};n.dayOfYear=function(n){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==n?t:this.add(n-t,"d")};n.hour=n.hours=ic;n.minute=n.minutes=bo;n.second=n.seconds=ko;n.millisecond=n.milliseconds=go;n.utcOffset=function(n,i,r){var u,f=this._offset||0;if(!this.isValid())return null!=n?this:NaN;if(null!=n){if("string"==typeof n){if(null===(n=su(vr,n)))return this}else Math.abs(n)<16&&!r&&(n*=60);return!this._isUTC&&i&&(u=cu(this)),this._offset=n,this._isUTC=!0,null!=u&&this.add(u,"m"),f!==n&&(!i||this._changeInProgress?he(this,it(n-f,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?f:cu(this)};n.utc=function(n){return this.utcOffset(0,n)};n.local=function(n){return this._isUTC&&(this.utcOffset(0,n),this._isUTC=!1,n&&this.subtract(cu(this),"m")),this};n.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var n=su(ah,this._i);null!=n?this.utcOffset(n):this.utcOffset(0,!0)}return this};n.hasAlignedHourOffset=function(n){return!!this.isValid()&&(n=n?c(n).utcOffset():0,(this.utcOffset()-n)%60==0)};n.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()};n.isLocal=function(){return!!this.isValid()&&!this._isUTC};n.isUtcOffset=function(){return!!this.isValid()&&this._isUTC};n.isUtc=ee;n.isUTC=ee;n.zoneAbbr=function(){return this._isUTC?"UTC":""};n.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""};n.dates=g("dates accessor is deprecated. Use date instead.",uf);n.months=g("months accessor is deprecated. Use month instead",yf);n.years=g("years accessor is deprecated. Use year instead",nf);n.zone=g("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(n,t){return null!=n?("string"!=typeof n&&(n=-n),this.utcOffset(n,t),this):-this.utcOffset()});n.isDSTShifted=g("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){var n,t;return p(this._isDSTShifted)?(n={},(br(n,this),(n=ie(n))._a)?(t=n._isUTC?ft(n._a):c(n._a),this._isDSTShifted=this.isValid()&&of(n._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted):this._isDSTShifted});o=kr.prototype;o.calendar=function(n,t,i){var r=this._calendar[n]||this._calendar.sameElse;return et(r)?r.call(t,i):r};o.longDateFormat=function(n){var t=this._longDateFormat[n],i=this._longDateFormat[n.toUpperCase()];return t||!i?t:(this._longDateFormat[n]=i.replace(/MMMM|MM|DD|dddd/g,function(n){return n.slice(1)}),this._longDateFormat[n])};o.invalidDate=function(){return this._invalidDate};o.ordinal=function(n){return this._ordinal.replace("%d",n)};o.preparse=ve;o.postformat=ve;o.relativeTime=function(n,t,i,r){var u=this._relativeTime[i];return et(u)?u(n,t,i,r):u.replace(/%d/i,n)};o.pastFuture=function(n,t){var i=this._relativeTime[n>0?"future":"past"];return et(i)?i(t):i.replace(/%s/i,t)};o.set=function(n){var t;for(var i in n)et(t=n[i])?this[i]=t:this["_"+i]=t;this._config=n;this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)};o.months=function(n,t){return n?tt(this._months)?this._months[n.month()]:this._months[(this._months.isFormat||oo).test(t)?"format":"standalone"][n.month()]:tt(this._months)?this._months:this._months.standalone};o.monthsShort=function(n,t){return n?tt(this._monthsShort)?this._monthsShort[n.month()]:this._monthsShort[oo.test(t)?"format":"standalone"][n.month()]:tt(this._monthsShort)?this._monthsShort:this._monthsShort.standalone};o.monthsParse=function(n,t,i){var r,u,f;if(this._monthsParseExact)return hs.call(this,n,t,i);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++)if((u=ft([2e3,r]),i&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(u,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(u,"").replace(".","")+"$","i")),i||this._monthsParse[r]||(f="^"+this.months(u,"")+"|^"+this.monthsShort(u,""),this._monthsParse[r]=new RegExp(f.replace(".",""),"i")),i&&"MMMM"===t&&this._longMonthsParse[r].test(n))||i&&"MMM"===t&&this._shortMonthsParse[r].test(n)||!i&&this._monthsParse[r].test(n))return r};o.monthsRegex=function(n){return this._monthsParseExact?(l(this,"_monthsRegex")||pf.call(this),n?this._monthsStrictRegex:this._monthsRegex):(l(this,"_monthsRegex")||(this._monthsRegex=bh),this._monthsStrictRegex&&n?this._monthsStrictRegex:this._monthsRegex)};o.monthsShortRegex=function(n){return this._monthsParseExact?(l(this,"_monthsRegex")||pf.call(this),n?this._monthsShortStrictRegex:this._monthsShortRegex):(l(this,"_monthsShortRegex")||(this._monthsShortRegex=wh),this._monthsShortStrictRegex&&n?this._monthsShortStrictRegex:this._monthsShortRegex)};o.week=function(n){return yi(n,this._week.dow,this._week.doy).week};o.firstDayOfYear=function(){return this._week.doy};o.firstDayOfWeek=function(){return this._week.dow};o.weekdays=function(n,t){return n?tt(this._weekdays)?this._weekdays[n.day()]:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"][n.day()]:tt(this._weekdays)?this._weekdays:this._weekdays.standalone};o.weekdaysMin=function(n){return n?this._weekdaysMin[n.day()]:this._weekdaysMin};o.weekdaysShort=function(n){return n?this._weekdaysShort[n.day()]:this._weekdaysShort};o.weekdaysParse=function(n,t,i){var r,u,f;if(this._weekdaysParseExact)return vs.call(this,n,t,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++)if((u=ft([2e3,1]).day(r),i&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(u,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(u,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(u,"").replace(".",".?")+"$","i")),this._weekdaysParse[r]||(f="^"+this.weekdays(u,"")+"|^"+this.weekdaysShort(u,"")+"|^"+this.weekdaysMin(u,""),this._weekdaysParse[r]=new RegExp(f.replace(".",""),"i")),i&&"dddd"===t&&this._fullWeekdaysParse[r].test(n))||i&&"ddd"===t&&this._shortWeekdaysParse[r].test(n)||i&&"dd"===t&&this._minWeekdaysParse[r].test(n)||!i&&this._weekdaysParse[r].test(n))return r};o.weekdaysRegex=function(n){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||nu.call(this),n?this._weekdaysStrictRegex:this._weekdaysRegex):(l(this,"_weekdaysRegex")||(this._weekdaysRegex=gh),this._weekdaysStrictRegex&&n?this._weekdaysStrictRegex:this._weekdaysRegex)};o.weekdaysShortRegex=function(n){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||nu.call(this),n?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(l(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=nc),this._weekdaysShortStrictRegex&&n?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)};o.weekdaysMinRegex=function(n){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||nu.call(this),n?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(l(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=tc),this._weekdaysMinStrictRegex&&n?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)};o.isPM=function(n){return"p"===(n+"").toLowerCase().charAt(0)};o.meridiem=function(n,t,i){return n>11?i?"pm":"PM":i?"am":"AM"};fi("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(n){var t=n%10;return n+(1===f(n%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}});t.lang=g("moment.lang is deprecated. Use moment.locale instead.",fi);t.langData=g("moment.langData is deprecated. Use moment.localeData instead.",pt);var at=Math.abs,lc=wt("ms"),ac=wt("s"),vc=wt("m"),yc=wt("h"),pc=wt("d"),wc=wt("w"),bc=wt("M"),kc=wt("y"),dc=ii("milliseconds"),gc=ii("seconds"),nl=ii("minutes"),tl=ii("hours"),il=ii("days"),rl=ii("months"),ul=ii("years"),kt=Math.round,st={ss:44,s:45,m:45,h:22,d:26,M:11},ff=Math.abs,e=ur.prototype;return e.isValid=function(){return this._isValid},e.abs=function(){var n=this._data;return this._milliseconds=at(this._milliseconds),this._days=at(this._days),this._months=at(this._months),n.milliseconds=at(n.milliseconds),n.seconds=at(n.seconds),n.minutes=at(n.minutes),n.hours=at(n.hours),n.months=at(n.months),n.years=at(n.years),this},e.add=function(n,t){return pe(this,n,t,1)},e.subtract=function(n,t){return pe(this,n,t,-1)},e.as=function(n){if(!this.isValid())return NaN;var t,r,i=this._milliseconds;if("month"===(n=nt(n))||"year"===n)return t=this._days+i/864e5,r=this._months+be(t),"month"===n?r:r/12;switch(t=this._days+Math.round(vu(this._months)),n){case"week":return t/7+i/6048e5;case"day":return t+i/864e5;case"hour":return 24*t+i/36e5;case"minute":return 1440*t+i/6e4;case"second":return 86400*t+i/1e3;case"millisecond":return Math.floor(864e5*t)+i;default:throw new Error("Unknown unit "+n);}},e.asMilliseconds=lc,e.asSeconds=ac,e.asMinutes=vc,e.asHours=yc,e.asDays=pc,e.asWeeks=wc,e.asMonths=bc,e.asYears=kc,e.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*f(this._months/12):NaN},e._bubble=function(){var u,f,e,s,o,r=this._milliseconds,n=this._days,t=this._months,i=this._data;return r>=0&&n>=0&&t>=0||r<=0&&n<=0&&t<=0||(r+=864e5*we(vu(t)+n),n=0,t=0),i.milliseconds=r%1e3,u=d(r/1e3),i.seconds=u%60,f=d(u/60),i.minutes=f%60,e=d(f/60),i.hours=e%24,n+=d(e/24),o=d(be(n)),t+=o,n-=we(vu(o)),s=d(t/12),t%=12,i.days=n,i.months=t,i.years=s,this},e.clone=function(){return it(this)},e.get=function(n){return n=nt(n),this.isValid()?this[n+"s"]():NaN},e.milliseconds=dc,e.seconds=gc,e.minutes=nl,e.hours=tl,e.days=il,e.weeks=function(){return d(this.days()/7)},e.months=rl,e.years=ul,e.humanize=function(n){if(!this.isValid())return this.localeData().invalidDate();var t=this.localeData(),i=lh(this,!n,t);return n&&(i=t.pastFuture(+this,i)),t.postformat(i)},e.toISOString=or,e.toString=or,e.toJSON=or,e.locale=ce,e.localeData=le,e.toIsoString=g("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",or),e.lang=rf,r("X",0,0,"unix"),r("x",0,0,"valueOf"),i("x",ar),i("X",/[+-]?\d+(\.\d{1,3})?/),s("X",function(n,t,i){i._d=new Date(1e3*parseFloat(n,10))}),s("x",function(n,t,i){i._d=new Date(f(n))}),t.version="2.19.1",function(n){ke=n}(c),t.fn=n,t.min=function(){return ue("isBefore",[].slice.call(arguments,0))},t.max=function(){return ue("isAfter",[].slice.call(arguments,0))},t.now=function(){return Date.now?Date.now():+new Date},t.utc=ft,t.unix=function(n){return c(1e3*n)},t.months=function(n,t){return ye(n,t,"months")},t.isDate=di,t.locale=fi,t.invalid=gi,t.duration=it,t.isMoment=yt,t.weekdays=function(n,t,i){return au(n,t,i,"weekdays")},t.parseZone=function(){return c.apply(null,arguments).parseZone()},t.localeData=pt,t.isDuration=eu,t.monthsShort=function(n,t){return ye(n,t,"monthsShort")},t.weekdaysMin=function(n,t,i){return au(n,t,i,"weekdaysMin")},t.defineLocale=iu,t.updateLocale=function(n,t){if(null!=t){var i,r=lo;null!=a[n]&&(r=a[n]._config);(i=new kr(t=cf(r,t))).parentLocale=a[n];a[n]=i;fi(n)}else null!=a[n]&&(null!=a[n].parentLocale?a[n]=a[n].parentLocale:null!=a[n]&&delete a[n]);return a[n]},t.locales=function(){return no(a)},t.weekdaysShort=function(n,t,i){return au(n,t,i,"weekdaysShort")},t.normalizeUnits=nt,t.relativeTimeRounding=function(n){return void 0===n?kt:"function"==typeof n&&(kt=n,!0)},t.relativeTimeThreshold=function(n,t){return void 0!==st[n]&&(void 0===t?st[n]:(st[n]=t,"s"===n&&(st.ss=t-1),!0))},t.calendarFormat=function(n,t){var i=n.diff(t,"days",!0);return i<-6?"sameElse":i<-1?"lastWeek":i<0?"lastDay":i<1?"sameDay":i<2?"nextDay":i<7?"nextWeek":"sameElse"},t.prototype=n,t}),function(n){"use strict";var t=function(t,i){this.$el=n(t);this.$mask=null;this.options=n.extend({},this.defaults,i);this.init.apply(this,arguments)};t.prototype={defaults:{show:!1,opacity:.7,bgColour:"#fafafa"},show:function(){this.$mask.show()},hide:function(){this.$mask.hide()},build:function(){this.$el.find(".cv-mask").length==0&&this.$el.append('<div class="cv-mask"><\/div>');this.$mask=this.$el.find(".cv-mask");this.style()},style:function(){this.$mask.css({"background-color":this.options.bgColour,opacity:this.options.opacity,height:"100%","z-index":9998,display:"none"})},init:function(){this.build();this.options.show&&this.show()},instance:function(){return this.$mask}};n.fn.mask=function(n){var i=new t(this,n);return i.instance()}}(jQuery);!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof exports?module.exports=n:n(jQuery)}(function(n){function u(r){var u=r||window.event,w=c.call(arguments,1),l=0,s=0,e=0,a=0,b=0,k=0,v,y,p;if(r=n.event.fix(u),r.type="mousewheel","detail"in u&&(e=-1*u.detail),"wheelDelta"in u&&(e=u.wheelDelta),"wheelDeltaY"in u&&(e=u.wheelDeltaY),"wheelDeltaX"in u&&(s=-1*u.wheelDeltaX),"axis"in u&&u.axis===u.HORIZONTAL_AXIS&&(s=-1*e,e=0),l=0===e?s:e,"deltaY"in u&&(e=-1*u.deltaY,l=e),"deltaX"in u&&(s=u.deltaX,0===e&&(l=-1*s)),0!==e||0!==s)return 1===u.deltaMode?(v=n.data(this,"mousewheel-line-height"),l*=v,e*=v,s*=v):2===u.deltaMode&&(y=n.data(this,"mousewheel-page-height"),l*=y,e*=y,s*=y),(a=Math.max(Math.abs(e),Math.abs(s)),(!t||t>a)&&(t=a,o(u,a)&&(t/=40)),o(u,a)&&(l/=40,s/=40,e/=40),l=Math[l>=1?"floor":"ceil"](l/t),s=Math[s>=1?"floor":"ceil"](s/t),e=Math[e>=1?"floor":"ceil"](e/t),i.settings.normalizeOffset&&this.getBoundingClientRect)&&(p=this.getBoundingClientRect(),b=r.clientX-p.left,k=r.clientY-p.top),r.deltaX=s,r.deltaY=e,r.deltaFactor=t,r.offsetX=b,r.offsetY=k,r.deltaMode=0,w.unshift(r,l,s,e),f&&clearTimeout(f),f=setTimeout(h,200),(n.event.dispatch||n.event.handle).apply(this,w)}function h(){t=null}function o(n,t){return i.settings.adjustOldDeltas&&"mousewheel"===n.type&&t%120==0}var f,t,s=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],r="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],c=Array.prototype.slice,e,i;if(n.event.fixHooks)for(e=s.length;e;)n.event.fixHooks[s[--e]]=n.event.mouseHooks;i=n.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var t=r.length;t;)this.addEventListener(r[--t],u,!1);else this.onmousewheel=u;n.data(this,"mousewheel-line-height",i.getLineHeight(this));n.data(this,"mousewheel-page-height",i.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var t=r.length;t;)this.removeEventListener(r[--t],u,!1);else this.onmousewheel=null;n.removeData(this,"mousewheel-line-height");n.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var r=n(t),i=r["offsetParent"in n.fn?"offsetParent":"parent"]();return i.length||(i=n("body")),parseInt(i.css("fontSize"),10)||parseInt(r.css("fontSize"),10)||16},getPageHeight:function(t){return n(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};n.fn.extend({mousewheel:function(n){return n?this.bind("mousewheel",n):this.trigger("mousewheel")},unmousewheel:function(n){return this.unbind("mousewheel",n)}})});!function(n){"undefined"!=typeof module&&module.exports?module.exports=n:n(jQuery,window,document)}(function(n){!function(t){var i="function"==typeof define&&define.amd,r="undefined"!=typeof module&&module.exports,u="https:"==document.location.protocol?"https:":"http:";i||(r?require("jquery-mousewheel")(n):n.event.special.mousewheel||n("head").append(decodeURI("%3Cscript src="+u+"//cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.12/jquery.mousewheel.min.js%3E%3C/script%3E")));t()}(function(){var h,c="mCustomScrollbar",t="mCS",tt=".mCustomScrollbar",et={setTop:0,setLeft:0,axis:"y",scrollbarPosition:"inside",scrollInertia:950,autoDraggerLength:!0,alwaysShowScrollbar:0,snapOffset:0,mouseWheel:{enable:!0,scrollAmount:"auto",axis:"y",deltaFactor:"auto",disableOver:["select","option","keygen","datalist","textarea"]},scrollButtons:{scrollType:"stepless",scrollAmount:"auto"},keyboard:{enable:!0,scrollType:"stepless",scrollAmount:"auto"},contentTouchScroll:25,advanced:{autoScrollOnFocus:"input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']",updateOnContentResize:!0,updateOnImageLoad:!0,autoUpdateTimeout:60},theme:"light",callbacks:{onTotalScrollOffset:0,onTotalScrollBackOffset:0,alwaysTriggerOffsets:!0}},vt=0,w={},y=window.attachEvent&&!window.addEventListener?1:0,f=!1,i=["mCSB_dragger_onDrag","mCSB_scrollTools_onDrag","mCS_img_loaded","mCS_disabled","mCS_destroyed","mCS_no_scrollbar","mCS-autoHide","mCS-dir-rtl","mCS_no_scrollbar_y","mCS_no_scrollbar_x","mCS_y_hidden","mCS_x_hidden","mCSB_draggerContainer","mCSB_buttonUp","mCSB_buttonDown","mCSB_buttonLeft","mCSB_buttonRight"],s={init:function(r){var r=n.extend(!0,{},et,r),e=a.call(this),u,f;if(r.live){if(u=r.liveSelector||this.selector||tt,f=n(u),"off"===r.live)return void b(u);w[u]=setTimeout(function(){f.mCustomScrollbar(r);"once"===r.live&&f.length&&b(u)},500)}else b(u);return r.setWidth=r.set_width?r.set_width:r.setWidth,r.setHeight=r.set_height?r.set_height:r.setHeight,r.axis=r.horizontalScroll?"x":yt(r.axis),r.scrollInertia=r.scrollInertia>0&&r.scrollInertia<17?17:r.scrollInertia,"object"!=typeof r.mouseWheel&&1==r.mouseWheel&&(r.mouseWheel={enable:!0,scrollAmount:"auto",axis:"y",preventDefault:!1,deltaFactor:"auto",normalizeDelta:!1,invert:!1}),r.mouseWheel.scrollAmount=r.mouseWheelPixels?r.mouseWheelPixels:r.mouseWheel.scrollAmount,r.mouseWheel.normalizeDelta=r.advanced.normalizeMouseWheelDelta?r.advanced.normalizeMouseWheelDelta:r.mouseWheel.normalizeDelta,r.scrollButtons.scrollType=pt(r.scrollButtons.scrollType),ot(r),n(e).each(function(){var u=n(this);if(!u.data(t)){u.data(t,{idx:++vt,opt:r,scrollRatio:{y:null,x:null},overflowed:null,contentReset:{y:null,x:null},bindEvents:!1,tweenRunning:!1,sequential:{},langDir:u.css("direction"),cbOffsets:null,trigger:null});var e=u.data(t),f=e.opt,o=u.data("mcs-axis"),h=u.data("mcs-scrollbar-position"),c=u.data("mcs-theme");o&&(f.axis=o);h&&(f.scrollbarPosition=h);c&&(f.theme=c,ot(f));wt.call(this);n("#mCSB_"+e.idx+"_container img:not(."+i[2]+")").addClass(i[2]);s.update.call(null,u)}})},update:function(r,f){var e=r||a.call(this);return n(e).each(function(){var s=n(this),c;if(s.data(t)){var e=s.data(t),r=e.opt,h=n("#mCSB_"+e.idx+"_container"),l=[n("#mCSB_"+e.idx+"_dragger_vertical"),n("#mCSB_"+e.idx+"_dragger_horizontal")];if(!h.length)return;e.tweenRunning&&o(s);s.hasClass(i[3])&&s.removeClass(i[3]);s.hasClass(i[4])&&s.removeClass(i[4]);dt.call(this);bt.call(this);"y"===r.axis||r.advanced.autoExpandHorizontalScroll||h.css("width",st(h.children()));e.overflowed=ti.call(this);ht.call(this);r.autoDraggerLength&&gt.call(this);ni.call(this);ii.call(this);c=[Math.abs(h[0].offsetTop),Math.abs(h[0].offsetLeft)];"x"!==r.axis&&(e.overflowed[0]?l[0].height()>l[0].parent().height()?v.call(this):(u(s,c[0].toString(),{dir:"y",dur:0,overwrite:"none"}),e.contentReset.y=null):(v.call(this),"y"===r.axis?d.call(this):"yx"===r.axis&&e.overflowed[1]&&u(s,c[1].toString(),{dir:"x",dur:0,overwrite:"none"})));"y"!==r.axis&&(e.overflowed[1]?l[1].width()>l[1].parent().width()?v.call(this):(u(s,c[1].toString(),{dir:"x",dur:0,overwrite:"none"}),e.contentReset.x=null):(v.call(this),"x"===r.axis?d.call(this):"yx"===r.axis&&e.overflowed[0]&&u(s,c[0].toString(),{dir:"y",dur:0,overwrite:"none"})));f&&e&&(2===f&&r.callbacks.onImageLoad&&"function"==typeof r.callbacks.onImageLoad?r.callbacks.onImageLoad.call(this):3===f&&r.callbacks.onSelectorChange&&"function"==typeof r.callbacks.onSelectorChange?r.callbacks.onSelectorChange.call(this):r.callbacks.onUpdate&&"function"==typeof r.callbacks.onUpdate&&r.callbacks.onUpdate.call(this));ft.call(this)}})},scrollTo:function(i,r){if("undefined"!=typeof i&&null!=i){var f=a.call(this);return n(f).each(function(){var s=n(this);if(s.data(t)){var o=s.data(t),h=o.opt,c={trigger:"external",scrollInertia:h.scrollInertia,scrollEasing:"mcsEaseInOut",moveDragger:!1,timeout:60,callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},f=n.extend(!0,{},c,r),e=ut.call(this,i),l=f.scrollInertia>0&&f.scrollInertia<17?17:f.scrollInertia;e[0]=ct.call(this,e[0],"y");e[1]=ct.call(this,e[1],"x");f.moveDragger&&(e[0]*=o.scrollRatio.y,e[1]*=o.scrollRatio.x);f.dur=l;setTimeout(function(){null!==e[0]&&"undefined"!=typeof e[0]&&"x"!==h.axis&&o.overflowed[0]&&(f.dir="y",f.overwrite="all",u(s,e[0].toString(),f));null!==e[1]&&"undefined"!=typeof e[1]&&"y"!==h.axis&&o.overflowed[1]&&(f.dir="x",f.overwrite="none",u(s,e[1].toString(),f))},f.timeout)}})}},stop:function(){var i=a.call(this);return n(i).each(function(){var i=n(this);i.data(t)&&o(i)})},disable:function(r){var u=a.call(this);return n(u).each(function(){var u=n(this);u.data(t)&&(u.data(t),ft.call(this,"remove"),d.call(this),r&&v.call(this),ht.call(this,!0),u.addClass(i[3]))})},destroy:function(){var r=a.call(this);return n(r).each(function(){var f=n(this);if(f.data(t)){var u=f.data(t),e=u.opt,s=n("#mCSB_"+u.idx),o=n("#mCSB_"+u.idx+"_container"),h=n(".mCSB_"+u.idx+"_scrollbar");e.live&&b(e.liveSelector||n(r).selector);ft.call(this,"remove");d.call(this);v.call(this);f.removeData(t);l(this,"mcs");h.remove();o.find("img."+i[2]).removeClass(i[2]);s.replaceWith(o.contents());f.removeClass(c+" _"+t+"_"+u.idx+" "+i[6]+" "+i[7]+" "+i[5]+" "+i[3]).addClass(i[4])}})}},a=function(){return"object"!=typeof n(this)||n(this).length<1?tt:this},ot=function(t){t.autoDraggerLength=n.inArray(t.theme,["rounded","rounded-dark","rounded-dots","rounded-dots-dark"])>-1?!1:t.autoDraggerLength;t.autoExpandScrollbar=n.inArray(t.theme,["rounded-dots","rounded-dots-dark","3d","3d-dark","3d-thick","3d-thick-dark","inset","inset-dark","inset-2","inset-2-dark","inset-3","inset-3-dark"])>-1?!1:t.autoExpandScrollbar;t.scrollButtons.enable=n.inArray(t.theme,["minimal","minimal-dark"])>-1?!1:t.scrollButtons.enable;t.autoHideScrollbar=n.inArray(t.theme,["minimal","minimal-dark"])>-1?!0:t.autoHideScrollbar;t.scrollbarPosition=n.inArray(t.theme,["minimal","minimal-dark"])>-1?"outside":t.scrollbarPosition},b=function(n){w[n]&&(clearTimeout(w[n]),l(w,n))},yt=function(n){return"yx"===n||"xy"===n||"auto"===n?"yx":"x"===n||"horizontal"===n?"x":"y"},pt=function(n){return"stepped"===n||"pixels"===n||"step"===n||"click"===n?"stepped":"stepless"},wt=function(){var f=n(this),u=f.data(t),r=u.opt,l=r.autoExpandScrollbar?" "+i[1]+"_expand":"",o=["<div id='mCSB_"+u.idx+"_scrollbar_vertical' class='mCSB_scrollTools mCSB_"+u.idx+"_scrollbar mCS-"+r.theme+" mCSB_scrollTools_vertical"+l+"'><div class='"+i[12]+"'><div id='mCSB_"+u.idx+"_dragger_vertical' class='mCSB_dragger' style='position:absolute;' oncontextmenu='return false;'><div class='mCSB_dragger_bar' /><\/div><div class='mCSB_draggerRail' /><\/div><\/div>","<div id='mCSB_"+u.idx+"_scrollbar_horizontal' class='mCSB_scrollTools mCSB_"+u.idx+"_scrollbar mCS-"+r.theme+" mCSB_scrollTools_horizontal"+l+"'><div class='"+i[12]+"'><div id='mCSB_"+u.idx+"_dragger_horizontal' class='mCSB_dragger' style='position:absolute;' oncontextmenu='return false;'><div class='mCSB_dragger_bar' /><\/div><div class='mCSB_draggerRail' /><\/div><\/div>"],v="yx"===r.axis?"mCSB_vertical_horizontal":"x"===r.axis?"mCSB_horizontal":"mCSB_vertical",a="yx"===r.axis?o[0]+o[1]:"x"===r.axis?o[1]:o[0],y="yx"===r.axis?"<div id='mCSB_"+u.idx+"_container_wrapper' class='mCSB_container_wrapper' />":"",p=r.autoHideScrollbar?" "+i[6]:"",w="x"!==r.axis&&"rtl"===u.langDir?" "+i[7]:"",h,s,e;r.setWidth&&f.css("width",r.setWidth);r.setHeight&&f.css("height",r.setHeight);r.setLeft="y"!==r.axis&&"rtl"===u.langDir?"989999px":r.setLeft;f.addClass(c+" _"+t+"_"+u.idx+p+w).wrapInner("<div id='mCSB_"+u.idx+"' class='mCustomScrollBox mCS-"+r.theme+" "+v+"'><div id='mCSB_"+u.idx+"_container' class='mCSB_container' style='position:relative; top:"+r.setTop+"; left:"+r.setLeft+";' dir="+u.langDir+" /><\/div>");h=n("#mCSB_"+u.idx);s=n("#mCSB_"+u.idx+"_container");"y"===r.axis||r.advanced.autoExpandHorizontalScroll||s.css("width",st(s.children()));"outside"===r.scrollbarPosition?("static"===f.css("position")&&f.css("position","relative"),f.css("overflow","visible"),h.addClass("mCSB_outside").after(a)):(h.addClass("mCSB_inside").append(a),s.wrap(y));kt.call(this);e=[n("#mCSB_"+u.idx+"_dragger_vertical"),n("#mCSB_"+u.idx+"_dragger_horizontal")];e[0].css("min-height",e[0].height());e[1].css("min-width",e[1].width())},st=function(t){return Math.max.apply(Math,t.map(function(){return n(this).outerWidth(!0)}).get())},bt=function(){var f=n(this),r=f.data(t),u=r.opt,i=n("#mCSB_"+r.idx+"_container");u.advanced.autoExpandHorizontalScroll&&"y"!==u.axis&&i.css({position:"absolute",width:"auto"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({width:Math.ceil(i[0].getBoundingClientRect().right+.4)-Math.floor(i[0].getBoundingClientRect().left),position:"relative"}).unwrap()},kt=function(){var s=n(this),o=s.data(t),u=o.opt,h=n(".mCSB_"+o.idx+"_scrollbar:first"),f=nt(u.scrollButtons.tabindex)?"tabindex='"+u.scrollButtons.tabindex+"'":"",r=["<a href='#' class='"+i[13]+"' oncontextmenu='return false;' "+f+" />","<a href='#' class='"+i[14]+"' oncontextmenu='return false;' "+f+" />","<a href='#' class='"+i[15]+"' oncontextmenu='return false;' "+f+" />","<a href='#' class='"+i[16]+"' oncontextmenu='return false;' "+f+" />"],e=["x"===u.axis?r[2]:r[0],"x"===u.axis?r[3]:r[1],r[2],r[3]];u.scrollButtons.enable&&h.prepend(e[0]).append(e[1]).next(".mCSB_scrollTools").prepend(e[2]).append(e[3])},dt=function(){var i=n(this),f=i.data(t),e=n("#mCSB_"+f.idx),r=i.css("max-height")||"none",o=-1!==r.indexOf("%"),s=i.css("box-sizing"),u;"none"!==r&&(u=o?i.parent().height()*parseInt(r)/100:parseInt(r),"border-box"===s&&(u-=i.innerHeight()-i.height()+(i.outerHeight()-i.innerHeight())),e.css("max-height",Math.round(u)))},gt=function(){var s=n(this),u=s.data(t),f=n("#mCSB_"+u.idx),e=n("#mCSB_"+u.idx+"_container"),r=[n("#mCSB_"+u.idx+"_dragger_vertical"),n("#mCSB_"+u.idx+"_dragger_horizontal")],o=[f.height()/e.outerHeight(!1),f.width()/e.outerWidth(!1)],i=[parseInt(r[0].css("min-height")),Math.round(o[0]*r[0].parent().height()),parseInt(r[1].css("min-width")),Math.round(o[1]*r[1].parent().width())],h=y&&i[1]<i[0]?i[0]:i[1],c=y&&i[3]<i[2]?i[2]:i[3];r[0].css({height:h,"max-height":r[0].parent().height()-10}).find(".mCSB_dragger_bar").css({"line-height":i[0]+"px"});r[1].css({width:c,"max-width":r[1].parent().width()-10})},ni=function(){var s=n(this),i=s.data(t),u=n("#mCSB_"+i.idx),f=n("#mCSB_"+i.idx+"_container"),r=[n("#mCSB_"+i.idx+"_dragger_vertical"),n("#mCSB_"+i.idx+"_dragger_horizontal")],e=[f.outerHeight(!1)-u.height(),f.outerWidth(!1)-u.width()],o=[e[0]/(r[0].parent().height()-r[0].height()),e[1]/(r[1].parent().width()-r[1].width())];i.scrollRatio={y:o[0],x:o[1]}},k=function(n,t,r){var f=r?i[0]+"_expanded":"",u=n.closest(".mCSB_scrollTools");"active"===t?(n.toggleClass(i[0]+" "+f),u.toggleClass(i[1]),n[0]._draggable=n[0]._draggable?0:1):n[0]._draggable||("hide"===t?(n.removeClass(i[0]),u.removeClass(i[1])):(n.addClass(i[0]),u.addClass(i[1])))},ti=function(){var f=n(this),i=f.data(t),u=n("#mCSB_"+i.idx),r=n("#mCSB_"+i.idx+"_container"),e=null==i.overflowed?r.height():r.outerHeight(!1),o=null==i.overflowed?r.width():r.outerWidth(!1);return[e>u.height(),o>u.width()]},v=function(){var r=n(this),i=r.data(t),f=i.opt,c=n("#mCSB_"+i.idx),s=n("#mCSB_"+i.idx+"_container"),h=[n("#mCSB_"+i.idx+"_dragger_vertical"),n("#mCSB_"+i.idx+"_dragger_horizontal")],e;(o(r),("x"!==f.axis&&!i.overflowed[0]||"y"===f.axis&&i.overflowed[0])&&(h[0].add(s).css("top",0),u(r,"_resetY")),"y"!==f.axis&&!i.overflowed[1]||"x"===f.axis&&i.overflowed[1])&&(e=dx=0,"rtl"===i.langDir&&(e=c.width()-s.outerWidth(!1),dx=Math.abs(e/i.scrollRatio.x)),s.css("left",e),h[1].css("left",dx),u(r,"_resetX"))},ii=function(){function u(){e=setTimeout(function(){n.event.special.mousewheel?(clearTimeout(e),ei.call(f[0])):u()},100)}var f=n(this),r=f.data(t),i=r.opt,e;r.bindEvents||((ri.call(this),i.contentTouchScroll&&ui.call(this),fi.call(this),i.mouseWheel.enable)&&u(),si.call(this),ci.call(this),i.advanced.autoScrollOnFocus&&hi.call(this),i.scrollButtons.enable&&li.call(this),i.keyboard.enable&&ai.call(this),r.bindEvents=!0)},d=function(){var u=n(this),r=u.data(t),f=r.opt,e=t+"_"+r.idx,o=".mCSB_"+r.idx+"_scrollbar",s=n("#mCSB_"+r.idx+",#mCSB_"+r.idx+"_container,#mCSB_"+r.idx+"_container_wrapper,"+o+" ."+i[12]+",#mCSB_"+r.idx+"_dragger_vertical,#mCSB_"+r.idx+"_dragger_horizontal,"+o+">a"),h=n("#mCSB_"+r.idx+"_container");f.advanced.releaseDraggableSelectors&&s.add(n(f.advanced.releaseDraggableSelectors));r.bindEvents&&(n(document).unbind("."+e),s.each(function(){n(this).unbind("."+e)}),clearTimeout(u[0]._focusTimeout),l(u[0],"_focusTimeout"),clearTimeout(r.sequential.step),l(r.sequential,"step"),clearTimeout(h[0].onCompleteTimeout),l(h[0],"onCompleteTimeout"),r.bindEvents=!1)},ht=function(r){var h=n(this),u=h.data(t),o=u.opt,c=n("#mCSB_"+u.idx+"_container_wrapper"),f=c.length?c:n("#mCSB_"+u.idx+"_container"),e=[n("#mCSB_"+u.idx+"_scrollbar_vertical"),n("#mCSB_"+u.idx+"_scrollbar_horizontal")],s=[e[0].find(".mCSB_dragger"),e[1].find(".mCSB_dragger")];"x"!==o.axis&&(u.overflowed[0]&&!r?(e[0].add(s[0]).add(e[0].children("a")).css("display","block"),f.removeClass(i[8]+" "+i[10])):(o.alwaysShowScrollbar?(2!==o.alwaysShowScrollbar&&s[0].css("display","none"),f.removeClass(i[10])):(e[0].css("display","none"),f.addClass(i[10])),f.addClass(i[8])));"y"!==o.axis&&(u.overflowed[1]&&!r?(e[1].add(s[1]).add(e[1].children("a")).css("display","block"),f.removeClass(i[9]+" "+i[11])):(o.alwaysShowScrollbar?(2!==o.alwaysShowScrollbar&&s[1].css("display","none"),f.removeClass(i[11])):(e[1].css("display","none"),f.addClass(i[11])),f.addClass(i[9])));u.overflowed[0]||u.overflowed[1]?h.removeClass(i[5]):h.addClass(i[5])},r=function(n){var r=n.type,t,i;switch(r){case"pointerdown":case"MSPointerDown":case"pointermove":case"MSPointerMove":case"pointerup":case"MSPointerUp":return n.target.ownerDocument!==document?[n.originalEvent.screenY,n.originalEvent.screenX,!1]:[n.originalEvent.pageY,n.originalEvent.pageX,!1];case"touchstart":case"touchmove":case"touchend":return t=n.originalEvent.touches[0]||n.originalEvent.changedTouches[0],i=n.originalEvent.touches.length||n.originalEvent.changedTouches.length,n.target.ownerDocument!==document?[t.screenY,t.screenX,i>1]:[t.pageY,t.pageX,i>1];default:return[n.pageY,n.pageX,!1]}},ri=function(){function w(n){var t=d.find("iframe"),i;t.length&&(i=n?"auto":"none",t.css("pointer-events",i))}function b(n,t,r,f){var e,o;(d[0].idleTimer=h.scrollInertia<233?250:0,i.attr("id")===v[1])?(e="x",o=(i[0].offsetLeft-t+f)*s.scrollRatio.x):(e="y",o=(i[0].offsetTop-n+r)*s.scrollRatio.y);u(a,o.toString(),{dir:e,drag:!0})}var i,c,l,a=n(this),s=a.data(t),h=s.opt,e=t+"_"+s.idx,v=["mCSB_"+s.idx+"_dragger_vertical","mCSB_"+s.idx+"_dragger_horizontal"],d=n("#mCSB_"+s.idx+"_container"),p=n("#"+v[0]+",#"+v[1]),g=h.advanced.releaseDraggableSelectors?p.add(n(h.advanced.releaseDraggableSelectors)):p;p.bind("mousedown."+e+" touchstart."+e+" pointerdown."+e+" MSPointerDown."+e,function(t){if(t.stopImmediatePropagation(),t.preventDefault(),at(t)){f=!0;y&&(document.onselectstart=function(){return!1});w(!1);o(a);i=n(this);var u=i.offset(),e=r(t)[0]-u.top,s=r(t)[1]-u.left,v=i.height()+u.top,p=i.width()+u.left;v>e&&e>0&&p>s&&s>0&&(c=e,l=s);k(i,"active",h.autoExpandScrollbar)}}).bind("touchmove."+e,function(n){n.stopImmediatePropagation();n.preventDefault();var t=i.offset(),u=r(n)[0]-t.top,f=r(n)[1]-t.left;b(c,l,u,f)});n(document).bind("mousemove."+e+" pointermove."+e+" MSPointerMove."+e,function(n){if(i){var t=i.offset(),u=r(n)[0]-t.top,f=r(n)[1]-t.left;if(c===u)return;b(c,l,u,f)}}).add(g).bind("mouseup."+e+" touchend."+e+" pointerup."+e+" MSPointerUp."+e,function(){i&&(k(i,"active",h.autoExpandScrollbar),i=null);f=!1;y&&(document.onselectstart=null);w(!0)})},ui=function(){function lt(n){if(!g(n)||f||r(n)[2])return void(h=0);h=1;tt=0;rt=0;d.removeClass("mCS_touch_action");var t=w.offset();b=r(n)[0]-t.top;k=r(n)[1]-t.left;a=[r(n)[0],r(n)[1]]}function at(n){var c,l,v,y;if(g(n)&&!f&&!r(n)[2]&&(n.stopImmediatePropagation(),!rt||tt)){dt=p();var o=ut.offset(),t=r(n)[0]-o.top,u=r(n)[1]-o.left,h="mcsLinearOut";(et.push(t),ot.push(u),a[2]=Math.abs(r(n)[0]-a[0]),a[3]=Math.abs(r(n)[1]-a[1]),i.overflowed[0])&&(c=ft[0].parent().height()-ft[0].height(),l=b-t>0&&t-b>-(c*i.scrollRatio.y)&&(2*a[3]<a[2]||"yx"===s.axis));i.overflowed[1]&&(v=ft[1].parent().width()-ft[1].width(),y=k-u>0&&u-k>-(v*i.scrollRatio.x)&&(2*a[2]<a[3]||"yx"===s.axis));l||y?(n.preventDefault(),tt=1):(rt=1,d.addClass("mCS_touch_action"));e="yx"===s.axis?[b-t,k-u]:"x"===s.axis?[null,k-u]:[b-t,null];w[0].idleTimer=250;i.overflowed[0]&&nt(e[0],gt,h,"y","all",!0);i.overflowed[1]&&nt(e[1],gt,h,"x",ct,!0)}}function vt(n){if(!g(n)||f||r(n)[2])return void(h=0);h=1;n.stopImmediatePropagation();o(d);kt=p();var t=ut.offset();wt=r(n)[0]-t.top;bt=r(n)[1]-t.left;et=[];ot=[]}function yt(n){var t,u,h;if(g(n)&&!f&&!r(n)[2]){n.stopImmediatePropagation();tt=0;rt=0;st=p();var l=ut.offset(),a=r(n)[0]-l.top,y=r(n)[1]-l.left;if(!(st-dt>30)){c=1e3/(st-kt);var b="mcsEaseOut",o=2.5>c,k=o?[et[et.length-2],ot[ot.length-2]]:[0,0];v=o?[a-k[0],y-k[1]]:[a-wt,y-bt];t=[Math.abs(v[0]),Math.abs(v[1])];c=o?[Math.abs(v[0]/4),Math.abs(v[1]/4)]:[c,c];u=[Math.abs(w[0].offsetTop)-v[0]*pt(t[0]/c[0],c[0]),Math.abs(w[0].offsetLeft)-v[1]*pt(t[1]/c[1],c[1])];e="yx"===s.axis?[u[0],u[1]]:"x"===s.axis?[null,u[1]]:[u[0],null];ht=[4*t[0]+s.scrollInertia,4*t[1]+s.scrollInertia];h=parseInt(s.contentTouchScroll)||0;e[0]=t[0]>h?e[0]:0;e[1]=t[1]>h?e[1]:0;i.overflowed[0]&&nt(e[0],ht[0],b,"y",ct,!1);i.overflowed[1]&&nt(e[1],ht[1],b,"x",ct,!1)}}}function pt(n,t){var i=[1.5*t,2*t,t/1.5,t/2];return n>90?t>4?i[0]:i[3]:n>60?t>3?i[3]:i[2]:n>30?t>8?i[1]:t>6?i[0]:t>4?t:i[2]:t>8?t:i[3]}function nt(n,t,i,r,f,e){n&&u(d,n.toString(),{dur:t,scrollEasing:i,dir:r,overwrite:f,drag:e})}var b,k,wt,bt,kt,dt,st,v,c,e,ht,tt,rt,d=n(this),i=d.data(t),s=i.opt,l=t+"_"+i.idx,ut=n("#mCSB_"+i.idx),w=n("#mCSB_"+i.idx+"_container"),ft=[n("#mCSB_"+i.idx+"_dragger_vertical"),n("#mCSB_"+i.idx+"_dragger_horizontal")],et=[],ot=[],gt=0,ct="yx"===s.axis?"none":"all",a=[],ni=w.find("iframe"),y=["touchstart."+l+" pointerdown."+l+" MSPointerDown."+l,"touchmove."+l+" pointermove."+l+" MSPointerMove."+l,"touchend."+l+" pointerup."+l+" MSPointerUp."+l];w.bind(y[0],function(n){lt(n)}).bind(y[1],function(n){at(n)});ut.bind(y[0],function(n){vt(n)}).bind(y[2],function(n){yt(n)});ni.length&&ni.each(function(){n(this).load(function(){it(this)&&n(this.contentDocument||this.contentWindow.document).bind(y[0],function(n){lt(n);vt(n)}).bind(y[1],function(n){at(n)}).bind(y[2],function(n){yt(n)})})})},fi=function(){function y(){return window.getSelection?window.getSelection().toString():document.selection&&"Control"!=document.selection.type?document.selection.createRange().text:0}function i(n,t,i){c.type=i&&u?"stepped":"stepless";c.scrollAmount=10;rt(a,n,t,"mcsLinearOut",i?60:null)}var u,a=n(this),e=a.data(t),v=e.opt,c=e.sequential,l=t+"_"+e.idx,o=n("#mCSB_"+e.idx+"_container"),s=o.parent();o.bind("mousedown."+l,function(){h||u||(u=1,f=!0)}).add(document).bind("mousemove."+l,function(n){if(!h&&u&&y()){var l=o.offset(),t=r(n)[0]-l.top+o[0].offsetTop,f=r(n)[1]-l.left+o[0].offsetLeft;t>0&&t<s.height()&&f>0&&f<s.width()?c.step&&i("off",null,"stepped"):("x"!==v.axis&&e.overflowed[0]&&(0>t?i("on",38):t>s.height()&&i("on",40)),"y"!==v.axis&&e.overflowed[1]&&(0>f?i("on",37):f>s.width()&&i("on",39)))}}).bind("mouseup."+l,function(){h||(u&&(u=0,i("off",null)),f=!1)})},ei=function(){function h(t,h){var a;if(o(s),!oi(s,t.target)){if(a="auto"!==r.mouseWheel.deltaFactor?parseInt(r.mouseWheel.deltaFactor):y&&t.deltaFactor<100?100:t.deltaFactor||100,"x"===r.axis||"x"===r.mouseWheel.axis)var v="x",l=[Math.round(a*i.scrollRatio.x),parseInt(r.mouseWheel.scrollAmount)],w="auto"!==r.mouseWheel.scrollAmount?l[1]:l[0]>=e.width()?.9*e.width():l[0],b=Math.abs(n("#mCSB_"+i.idx+"_container")[0].offsetLeft),p=f[1][0].offsetLeft,k=f[1].parent().width()-f[1].width(),c=t.deltaX||t.deltaY||h;else var v="y",l=[Math.round(a*i.scrollRatio.y),parseInt(r.mouseWheel.scrollAmount)],w="auto"!==r.mouseWheel.scrollAmount?l[1]:l[0]>=e.height()?.9*e.height():l[0],b=Math.abs(n("#mCSB_"+i.idx+"_container")[0].offsetTop),p=f[0][0].offsetTop,k=f[0].parent().height()-f[0].height(),c=t.deltaY||h;("y"!==v||i.overflowed[0])&&("x"!==v||i.overflowed[1])&&((r.mouseWheel.invert||t.webkitDirectionInvertedFromDevice)&&(c=-c),r.mouseWheel.normalizeDelta&&(c=0>c?-1:1),(c>0&&0!==p||0>c&&p!==k||r.mouseWheel.preventDefault)&&(t.stopImmediatePropagation(),t.preventDefault()),u(s,(b-c*w).toString(),{dir:v}))}}if(n(this).data(t)){var s=n(this),i=s.data(t),r=i.opt,c=t+"_"+i.idx,e=n("#mCSB_"+i.idx),f=[n("#mCSB_"+i.idx+"_dragger_vertical"),n("#mCSB_"+i.idx+"_dragger_horizontal")],l=n("#mCSB_"+i.idx+"_container").find("iframe");l.length&&l.each(function(){n(this).load(function(){it(this)&&n(this.contentDocument||this.contentWindow.document).bind("mousewheel."+c,function(n,t){h(n,t)})})});e.bind("mousewheel."+c,function(n,t){h(n,t)})}},it=function(n){var t=null,i;try{i=n.contentDocument||n.contentWindow.document;t=i.body.innerHTML}catch(r){}return null!==t},oi=function(i,r){var u=r.nodeName.toLowerCase(),f=i.data(t).opt.mouseWheel.disableOver;return n.inArray(u,f)>-1&&!(n.inArray(u,["select","textarea"])>-1&&!n(r).is(":focus"))},si=function(){var s=n(this),e=s.data(t),r=t+"_"+e.idx,h=n("#mCSB_"+e.idx+"_container"),c=h.parent(),l=n(".mCSB_"+e.idx+"_scrollbar ."+i[12]);l.bind("touchstart."+r+" pointerdown."+r+" MSPointerDown."+r,function(){f=!0}).bind("touchend."+r+" pointerup."+r+" MSPointerUp."+r,function(){f=!1}).bind("click."+r,function(t){var r,f;if(n(t.target).hasClass(i[12])||n(t.target).hasClass("mCSB_draggerRail")){if(o(s),r=n(this),f=r.find(".mCSB_dragger"),r.parent(".mCSB_scrollTools_horizontal").length>0){if(!e.overflowed[1])return;var a="x",l=t.pageX>f.offset().left?-1:1,v=Math.abs(h[0].offsetLeft)-.9*l*c.width()}else{if(!e.overflowed[0])return;var a="y",l=t.pageY>f.offset().top?-1:1,v=Math.abs(h[0].offsetTop)-.9*l*c.height()}u(s,v.toString(),{dir:a,scrollEasing:"mcsEaseInOut"})}})},hi=function(){var i=n(this),s=i.data(t),f=s.opt,c=t+"_"+s.idx,r=n("#mCSB_"+s.idx+"_container"),h=r.parent();r.bind("focusin."+c,function(){var t=n(document.activeElement),c=r.find(".mCustomScrollBox").length,s=0;t.is(f.advanced.autoScrollOnFocus)&&(o(i),clearTimeout(i[0]._focusTimeout),i[0]._focusTimer=c?(s+17)*c:0,i[0]._focusTimeout=setTimeout(function(){var n=[e(t)[0],e(t)[1]],o=[r[0].offsetTop,r[0].offsetLeft],c=[o[0]+n[0]>=0&&o[0]+n[0]<h.height()-t.outerHeight(!1),o[1]+n[1]>=0&&o[0]+n[1]<h.width()-t.outerWidth(!1)],l="yx"!==f.axis||c[0]||c[1]?"all":"none";"x"===f.axis||c[0]||u(i,n[0].toString(),{dir:"y",scrollEasing:"mcsEaseInOut",overwrite:l,dur:s});"y"===f.axis||c[1]||u(i,n[1].toString(),{dir:"x",scrollEasing:"mcsEaseInOut",overwrite:l,dur:s})},i[0]._focusTimer))})},ci=function(){var u=n(this),i=u.data(t),f=t+"_"+i.idx,r=n("#mCSB_"+i.idx+"_container").parent();r.bind("scroll."+f,function(){(0!==r.scrollTop()||0!==r.scrollLeft())&&n(".mCSB_"+i.idx+"_scrollbar").css("visibility","hidden")})},li=function(){var o=n(this),r=o.data(t),e=r.opt,u=r.sequential,i=t+"_"+r.idx,s=".mCSB_"+r.idx+"_scrollbar",h=n(s+">a");h.bind("mousedown."+i+" touchstart."+i+" pointerdown."+i+" MSPointerDown."+i+" mouseup."+i+" touchend."+i+" pointerup."+i+" MSPointerUp."+i+" mouseout."+i+" pointerout."+i+" MSPointerOut."+i+" click."+i,function(t){function i(n,t){u.scrollAmount=e.snapAmount||e.scrollButtons.scrollAmount;rt(o,n,t)}if(t.preventDefault(),at(t)){var s=n(this).attr("class");switch(u.type=e.scrollButtons.scrollType,t.type){case"mousedown":case"touchstart":case"pointerdown":case"MSPointerDown":if("stepped"===u.type)return;f=!0;r.tweenRunning=!1;i("on",s);break;case"mouseup":case"touchend":case"pointerup":case"MSPointerUp":case"mouseout":case"pointerout":case"MSPointerOut":if("stepped"===u.type)return;f=!1;u.dir&&i("off",s);break;case"click":if("stepped"!==u.type||r.tweenRunning)return;i("on",s)}}})},ai=function(){function l(t){function w(n,t){s.type=r.keyboard.scrollType;s.scrollAmount=r.snapAmount||r.keyboard.scrollAmount;"stepped"===s.type&&i.tweenRunning||rt(e,n,t)}var c,y,p,l,v;switch(t.type){case"blur":i.tweenRunning&&s.dir&&w("off",null);break;case"keydown":case"keyup":if(c=t.keyCode?t.keyCode:t.which,y="on","x"!==r.axis&&(38===c||40===c)||"y"!==r.axis&&(37===c||39===c)){if((38===c||40===c)&&!i.overflowed[0]||(37===c||39===c)&&!i.overflowed[1])return;"keyup"===t.type&&(y="off");n(document.activeElement).is(a)||(t.preventDefault(),t.stopImmediatePropagation(),w(y,c))}else 33===c||34===c?((i.overflowed[0]||i.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type)&&(o(e),p=34===c?-1:1,"x"===r.axis||"yx"===r.axis&&i.overflowed[1]&&!i.overflowed[0]?(l="x",v=Math.abs(f[0].offsetLeft)-.9*p*h.width()):(l="y",v=Math.abs(f[0].offsetTop)-.9*p*h.height()),u(e,v.toString(),{dir:l,scrollEasing:"mcsEaseInOut"})):35!==c&&36!==c||n(document.activeElement).is(a)||((i.overflowed[0]||i.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"!==t.type)||("x"===r.axis||"yx"===r.axis&&i.overflowed[1]&&!i.overflowed[0]?(l="x",v=35===c?Math.abs(h.width()-f.outerWidth(!1)):0):(l="y",v=35===c?Math.abs(h.height()-f.outerHeight(!1)):0),u(e,v.toString(),{dir:l,scrollEasing:"mcsEaseInOut"}))}}var e=n(this),i=e.data(t),r=i.opt,s=i.sequential,c=t+"_"+i.idx,p=n("#mCSB_"+i.idx),f=n("#mCSB_"+i.idx+"_container"),h=f.parent(),a="input,textarea,select,datalist,keygen,[contenteditable='true']",v=f.find("iframe"),y=["blur."+c+" keydown."+c+" keyup."+c];v.length&&v.each(function(){n(this).load(function(){it(this)&&n(this.contentDocument||this.contentWindow.document).bind(y[0],function(n){l(n)})})});p.attr("tabindex","0").bind(y[0],function(n){l(n)})},rt=function(r,f,e,s,h){function y(n){var i="stepped"!==c.type,f=h?h:n?i?k/1.5:d:1e3/60,e=n?i?7.5:40:2.5,t=[Math.abs(p[0].offsetTop),Math.abs(p[0].offsetLeft)],o=[a.scrollRatio.y>10?10:a.scrollRatio.y,a.scrollRatio.x>10?10:a.scrollRatio.x],v="x"===c.dir[0]?t[1]+c.dir[1]*o[1]*e:t[0]+c.dir[1]*o[0]*e,w="x"===c.dir[0]?t[1]+c.dir[1]*parseInt(c.scrollAmount):t[0]+c.dir[1]*parseInt(c.scrollAmount),l="auto"!==c.scrollAmount?w:v,b=s?s:n?i?"mcsLinearOut":"mcsEaseInOut":"mcsLinear",g=n?!0:!1;return n&&17>f&&(l="x"===c.dir[0]?t[1]:t[0]),u(r,l.toString(),{dir:c.dir[0],scrollEasing:b,dur:f,onComplete:g}),n?void(c.dir=!1):(clearTimeout(c.step),void(c.step=setTimeout(function(){y()},f)))}function b(){clearTimeout(c.step);l(c,"step");o(r)}var a=r.data(t),v=a.opt,c=a.sequential,p=n("#mCSB_"+a.idx+"_container"),w="stepped"===c.type?!0:!1,k=v.scrollInertia<26?26:v.scrollInertia,d=v.scrollInertia<1?17:v.scrollInertia;switch(f){case"on":if(c.dir=[e===i[16]||e===i[15]||39===e||37===e?"x":"y",e===i[13]||e===i[15]||38===e||37===e?-1:1],o(r),nt(e)&&"stepped"===c.type)return;y(w);break;case"off":b();(w||a.tweenRunning&&c.dir)&&y(!0)}},ut=function(i){var u=n(this).data(t).opt,r=[];return"function"==typeof i&&(i=i()),i instanceof Array?r=i.length>1?[i[0],i[1]]:"x"===u.axis?[null,i[0]]:[i[0],null]:(r[0]=i.y?i.y:i.x||"x"===u.axis?null:i,r[1]=i.x?i.x:i.y||"y"===u.axis?null:i),"function"==typeof r[0]&&(r[0]=r[0]()),"function"==typeof r[1]&&(r[1]=r[1]()),r},ct=function(i,r){var o,f;if(null!=i&&"undefined"!=typeof i){var h=n(this),c=h.data(t),v=c.opt,u=n("#mCSB_"+c.idx+"_container"),l=u.parent(),y=typeof i;r||(r="x"===v.axis?"x":"y");var p="x"===r?u.outerWidth(!1):u.outerHeight(!1),a="x"===r?u[0].offsetLeft:u[0].offsetTop,w="x"===r?"left":"top";switch(y){case"function":return i();case"object":return(f=i.jquery?i:n(i),!f.length)?void 0:"x"===r?e(f)[1]:e(f)[0];case"string":case"number":return nt(i)?Math.abs(i):-1!==i.indexOf("%")?Math.abs(p*parseInt(i)/100):-1!==i.indexOf("-=")?Math.abs(a-parseInt(i.split("-=")[1])):-1!==i.indexOf("+=")?(o=a+parseInt(i.split("+=")[1]),o>=0?0:Math.abs(o)):-1!==i.indexOf("px")&&nt(i.split("px")[0])?Math.abs(i.split("px")[0]):"top"===i||"left"===i?0:"bottom"===i?Math.abs(l.height()-u.outerHeight(!1)):"right"===i?Math.abs(l.width()-u.outerWidth(!1)):"first"===i||"last"===i?(f=u.find(":"+i),"x"===r?e(f)[1]:e(f)[0]):n(i).length?"x"===r?e(n(i))[1]:e(n(i))[0]:(u.css(w,i),void s.update.call(null,h[0]))}}},ft=function(r){function k(){return clearTimeout(u[0].autoUpdate),0===c.parents("html").length?void(c=null):void(u[0].autoUpdate=setTimeout(function(){return f.advanced.updateOnSelectorChange&&(w=g(),w!==nt)?(h(3),void(nt=w)):(f.advanced.updateOnContentResize&&(e=[u.outerHeight(!1),u.outerWidth(!1),v.height(),v.width(),p()[0],p()[1]],(e[0]!==o[0]||e[1]!==o[1]||e[2]!==o[2]||e[3]!==o[3]||e[4]!==o[4]||e[5]!==o[5])&&(h(e[0]!==o[0]||e[1]!==o[1]),o=e)),f.advanced.updateOnImageLoad&&(b=d(),b!==tt&&(u.find("img").each(function(){it(this)}),tt=b)),void((f.advanced.updateOnSelectorChange||f.advanced.updateOnContentResize||f.advanced.updateOnImageLoad)&&k()))},f.advanced.autoUpdateTimeout))}function d(){var n=0;return f.advanced.updateOnImageLoad&&(n=u.find("img").length),n}function it(t){function u(n,t){return function(){return t.apply(n,arguments)}}function f(){this.onload=null;n(t).addClass(i[2]);h(2)}if(n(t).hasClass(i[2]))return void h();var r=new Image;r.onload=u(r,f);r.src=t.src}function g(){f.advanced.updateOnSelectorChange===!0&&(f.advanced.updateOnSelectorChange="*");var t=0,i=u.find(f.advanced.updateOnSelectorChange);return f.advanced.updateOnSelectorChange&&i.length>0&&i.each(function(){t+=n(this).height()+n(this).width()}),t}function h(n){clearTimeout(u[0].autoUpdate);s.update.call(null,c[0],n)}var c=n(this),a=c.data(t),f=a.opt,u=n("#mCSB_"+a.idx+"_container");if(r)return clearTimeout(u[0].autoUpdate),void l(u[0],"autoUpdate");var w,e,b,v=u.parent(),y=[n("#mCSB_"+a.idx+"_scrollbar_vertical"),n("#mCSB_"+a.idx+"_scrollbar_horizontal")],p=function(){return[y[0].is(":visible")?y[0].outerHeight(!0):0,y[1].is(":visible")?y[1].outerWidth(!0):0]},nt=g(),o=[u.outerHeight(!1),u.outerWidth(!1),v.height(),v.width(),p()[0],p()[1]],tt=d();k()},vi=function(n,t,i){return Math.round(n/t)*t-i},o=function(i){var r=i.data(t),u=n("#mCSB_"+r.idx+"_container,#mCSB_"+r.idx+"_container_wrapper,#mCSB_"+r.idx+"_dragger_vertical,#mCSB_"+r.idx+"_dragger_horizontal");u.each(function(){yi.call(this)})},u=function(i,r,u){function h(n){return f&&e.callbacks[n]&&"function"==typeof e.callbacks[n]}function it(){return[e.callbacks.alwaysTriggerOffsets||w>=l[0]+v,e.callbacks.alwaysTriggerOffsets||-y>=w]}function a(){var n=[o[0].offsetTop,o[0].offsetLeft],t=[c[0].offsetTop,c[0].offsetLeft],r=[o.outerHeight(!1),o.outerWidth(!1)],f=[p.height(),p.width()];i[0].mcs={content:o,top:n[0],left:n[1],draggerTop:t[0],draggerLeft:t[1],topPct:Math.round(100*Math.abs(n[0])/(Math.abs(r[0])-f[0])),leftPct:Math.round(100*Math.abs(n[1])/(Math.abs(r[1])-f[1])),direction:u.dir}}var f=i.data(t),e=f.opt,rt={trigger:"internal",dir:"y",scrollEasing:"mcsEaseOut",drag:!1,dur:e.scrollInertia,overwrite:"all",callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},u=n.extend(rt,u),d=[u.dur,u.drag?0:u.dur],p=n("#mCSB_"+f.idx),o=n("#mCSB_"+f.idx+"_container"),b=o.parent(),g=e.callbacks.onTotalScrollOffset?ut.call(i,e.callbacks.onTotalScrollOffset):[0,0],nt=e.callbacks.onTotalScrollBackOffset?ut.call(i,e.callbacks.onTotalScrollBackOffset):[0,0];if(f.trigger=u.trigger,(0!==b.scrollTop()||0!==b.scrollLeft())&&(n(".mCSB_"+f.idx+"_scrollbar").css("visibility","visible"),b.scrollTop(0).scrollLeft(0)),"_resetY"!==r||f.contentReset.y||(h("onOverflowYNone")&&e.callbacks.onOverflowYNone.call(i[0]),f.contentReset.y=1),"_resetX"!==r||f.contentReset.x||(h("onOverflowXNone")&&e.callbacks.onOverflowXNone.call(i[0]),f.contentReset.x=1),"_resetY"!==r&&"_resetX"!==r){switch(!f.contentReset.y&&i[0].mcs||!f.overflowed[0]||(h("onOverflowY")&&e.callbacks.onOverflowY.call(i[0]),f.contentReset.x=null),!f.contentReset.x&&i[0].mcs||!f.overflowed[1]||(h("onOverflowX")&&e.callbacks.onOverflowX.call(i[0]),f.contentReset.x=null),e.snapAmount&&(r=vi(r,e.snapAmount,e.snapOffset)),u.dir){case"x":var c=n("#mCSB_"+f.idx+"_dragger_horizontal"),tt="left",w=o[0].offsetLeft,l=[p.width()-o.outerWidth(!1),c.parent().width()-c.width()],s=[r,0===r?0:r/f.scrollRatio.x],v=g[1],y=nt[1],ft=v>0?v/f.scrollRatio.x:0,et=y>0?y/f.scrollRatio.x:0;break;case"y":var c=n("#mCSB_"+f.idx+"_dragger_vertical"),tt="top",w=o[0].offsetTop,l=[p.height()-o.outerHeight(!1),c.parent().height()-c.height()],s=[r,0===r?0:r/f.scrollRatio.y],v=g[0],y=nt[0],ft=v>0?v/f.scrollRatio.y:0,et=y>0?y/f.scrollRatio.y:0}s[1]<0||0===s[0]&&0===s[1]?s=[0,0]:s[1]>=l[1]?s=[l[0],l[1]]:s[0]=-s[0];i[0].mcs||(a(),h("onInit")&&e.callbacks.onInit.call(i[0]));clearTimeout(o[0].onCompleteTimeout);(f.tweenRunning||!(0===w&&s[0]>=0||w===l[0]&&s[0]<=l[0]))&&(lt(c[0],tt,Math.round(s[1]),d[1],u.scrollEasing),lt(o[0],tt,Math.round(s[0]),d[0],u.scrollEasing,u.overwrite,{onStart:function(){u.callbacks&&u.onStart&&!f.tweenRunning&&(h("onScrollStart")&&(a(),e.callbacks.onScrollStart.call(i[0])),f.tweenRunning=!0,k(c),f.cbOffsets=it())},onUpdate:function(){u.callbacks&&u.onUpdate&&h("whileScrolling")&&(a(),e.callbacks.whileScrolling.call(i[0]))},onComplete:function(){if(u.callbacks&&u.onComplete){"yx"===e.axis&&clearTimeout(o[0].onCompleteTimeout);var n=o[0].idleTimer||0;o[0].onCompleteTimeout=setTimeout(function(){h("onScroll")&&(a(),e.callbacks.onScroll.call(i[0]));h("onTotalScroll")&&s[1]>=l[1]-ft&&f.cbOffsets[0]&&(a(),e.callbacks.onTotalScroll.call(i[0]));h("onTotalScrollBack")&&s[1]<=et&&f.cbOffsets[1]&&(a(),e.callbacks.onTotalScrollBack.call(i[0]));f.tweenRunning=!1;o[0].idleTimer=0;k(c,"hide")},n)}}}))}},lt=function(n,t,i,r,u,f,e){function a(){o.stop||(s||g.call(),s=p()-it,v(),s>=o.time&&(o.time=s>o.time?s+h-(s-o.time):s+h-1,o.time<s+1&&(o.time=s+1)),o.time<r?o.id=c(a):tt.call())}function v(){r>0?(o.currVal=d(o.time,l,w,r,u),y[t]=Math.round(o.currVal)+"px"):y[t]=i+"px";nt.call()}function b(){h=1e3/60;o.time=s+h;c=window.requestAnimationFrame?window.requestAnimationFrame:function(n){return v(),setTimeout(n,.01)};o.id=c(a)}function k(){null!=o.id&&(window.requestAnimationFrame?window.cancelAnimationFrame(o.id):clearTimeout(o.id),o.id=null)}function d(n,t,i,r,u){switch(u){case"linear":case"mcsLinear":return i*n/r+t;case"mcsLinearOut":return n/=r,n--,i*Math.sqrt(1-n*n)+t;case"easeInOutSmooth":return n/=r/2,1>n?i/2*n*n+t:(n--,-i/2*(n*(n-2)-1)+t);case"easeInOutStrong":return n/=r/2,1>n?i/2*Math.pow(2,10*(n-1))+t:(n--,i/2*(-Math.pow(2,-10*n)+2)+t);case"easeInOut":case"mcsEaseInOut":return n/=r/2,1>n?i/2*n*n*n+t:(n-=2,i/2*(n*n*n+2)+t);case"easeOutSmooth":return n/=r,n--,-i*(n*n*n*n-1)+t;case"easeOutStrong":return i*(-Math.pow(2,-10*n/r)+1)+t;case"easeOut":case"mcsEaseOut":default:var f=(n/=r)*n,e=f*n;return t+i*(.499999999999997*e*f+-2.5*f*f+5.5*e+-6.5*f+4*n)}}var w;n._mTween||(n._mTween={top:{},left:{}});var h,c,e=e||{},g=e.onStart||function(){},nt=e.onUpdate||function(){},tt=e.onComplete||function(){},it=p(),s=0,l=n.offsetTop,y=n.style,o=n._mTween[t];"left"===t&&(l=n.offsetLeft);w=i-l;o.stop=0;"none"!==f&&k();b()},p=function(){return window.performance&&window.performance.now?window.performance.now():window.performance&&window.performance.webkitNow?window.performance.webkitNow():Date.now?Date.now():(new Date).getTime()},yi=function(){var n=this,r,i,t;for(n._mTween||(n._mTween={top:{},left:{}}),r=["top","left"],i=0;i<r.length;i++)t=r[i],n._mTween[t].id&&(window.requestAnimationFrame?window.cancelAnimationFrame(n._mTween[t].id):clearTimeout(n._mTween[t].id),n._mTween[t].id=null,n._mTween[t].stop=1)},l=function(n,t){try{delete n[t]}catch(i){n[t]=null}},at=function(n){return!(n.which&&1!==n.which)},g=function(n){var t=n.originalEvent.pointerType;return!(t&&"touch"!==t&&2!==t)},nt=function(n){return!isNaN(parseFloat(n))&&isFinite(n)},e=function(n){var t=n.parents(".mCSB_container");return[n.offset().top-t.offset().top,n.offset().left-t.offset().left]};n.fn[c]=function(t){return s[t]?s[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void n.error("Method "+t+" does not exist"):s.init.apply(this,arguments)};n[c]=function(t){return s[t]?s[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void n.error("Method "+t+" does not exist"):s.init.apply(this,arguments)};n[c].defaults=et;window[c]=!0;n(window).load(function(){n(tt)[c]();n.extend(n.expr[":"],{mcsInView:n.expr[":"].mcsInView||function(t){var f,r,i=n(t),u=i.parents(".mCSB_container");if(u.length)return f=u.parent(),r=[u[0].offsetTop,u[0].offsetLeft],r[0]+e(i)[0]>=0&&r[0]+e(i)[0]<f.height()-i.outerHeight(!1)&&r[1]+e(i)[1]>=0&&r[1]+e(i)[1]<f.width()-i.outerWidth(!1)},mcsOverflow:n.expr[":"].mcsOverflow||function(i){var r=n(i).data(t);if(r)return r.overflowed[0]||r.overflowed[1]}})})})});jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(n,t,i,r,u){return jQuery.easing[jQuery.easing.def](n,t,i,r,u)},easeInQuad:function(n,t,i,r,u){return r*(t/=u)*t+i},easeOutQuad:function(n,t,i,r,u){return-r*(t/=u)*(t-2)+i},easeInOutQuad:function(n,t,i,r,u){return(t/=u/2)<1?r/2*t*t+i:-r/2*(--t*(t-2)-1)+i},easeInCubic:function(n,t,i,r,u){return r*(t/=u)*t*t+i},easeOutCubic:function(n,t,i,r,u){return r*((t=t/u-1)*t*t+1)+i},easeInOutCubic:function(n,t,i,r,u){return(t/=u/2)<1?r/2*t*t*t+i:r/2*((t-=2)*t*t+2)+i},easeInQuart:function(n,t,i,r,u){return r*(t/=u)*t*t*t+i},easeOutQuart:function(n,t,i,r,u){return-r*((t=t/u-1)*t*t*t-1)+i},easeInOutQuart:function(n,t,i,r,u){return(t/=u/2)<1?r/2*t*t*t*t+i:-r/2*((t-=2)*t*t*t-2)+i},easeInQuint:function(n,t,i,r,u){return r*(t/=u)*t*t*t*t+i},easeOutQuint:function(n,t,i,r,u){return r*((t=t/u-1)*t*t*t*t+1)+i},easeInOutQuint:function(n,t,i,r,u){return(t/=u/2)<1?r/2*t*t*t*t*t+i:r/2*((t-=2)*t*t*t*t+2)+i},easeInSine:function(n,t,i,r,u){return-r*Math.cos(t/u*(Math.PI/2))+r+i},easeOutSine:function(n,t,i,r,u){return r*Math.sin(t/u*(Math.PI/2))+i},easeInOutSine:function(n,t,i,r,u){return-r/2*(Math.cos(Math.PI*t/u)-1)+i},easeInExpo:function(n,t,i,r,u){return t==0?i:r*Math.pow(2,10*(t/u-1))+i},easeOutExpo:function(n,t,i,r,u){return t==u?i+r:r*(-Math.pow(2,-10*t/u)+1)+i},easeInOutExpo:function(n,t,i,r,u){return t==0?i:t==u?i+r:(t/=u/2)<1?r/2*Math.pow(2,10*(t-1))+i:r/2*(-Math.pow(2,-10*--t)+2)+i},easeInCirc:function(n,t,i,r,u){return-r*(Math.sqrt(1-(t/=u)*t)-1)+i},easeOutCirc:function(n,t,i,r,u){return r*Math.sqrt(1-(t=t/u-1)*t)+i},easeInOutCirc:function(n,t,i,r,u){return(t/=u/2)<1?-r/2*(Math.sqrt(1-t*t)-1)+i:r/2*(Math.sqrt(1-(t-=2)*t)+1)+i},easeInElastic:function(n,t,i,r,u){var o=1.70158,f=0,e=r;return t==0?i:(t/=u)==1?i+r:(f||(f=u*.3),e<Math.abs(r)?(e=r,o=f/4):o=f/(2*Math.PI)*Math.asin(r/e),-(e*Math.pow(2,10*(t-=1))*Math.sin((t*u-o)*2*Math.PI/f))+i)},easeOutElastic:function(n,t,i,r,u){var o=1.70158,f=0,e=r;return t==0?i:(t/=u)==1?i+r:(f||(f=u*.3),e<Math.abs(r)?(e=r,o=f/4):o=f/(2*Math.PI)*Math.asin(r/e),e*Math.pow(2,-10*t)*Math.sin((t*u-o)*2*Math.PI/f)+r+i)},easeInOutElastic:function(n,t,i,r,u){var o=1.70158,f=0,e=r;return t==0?i:(t/=u/2)==2?i+r:(f||(f=u*.3*1.5),e<Math.abs(r)?(e=r,o=f/4):o=f/(2*Math.PI)*Math.asin(r/e),t<1)?-.5*e*Math.pow(2,10*(t-=1))*Math.sin((t*u-o)*2*Math.PI/f)+i:e*Math.pow(2,-10*(t-=1))*Math.sin((t*u-o)*2*Math.PI/f)*.5+r+i},easeInBack:function(n,t,i,r,u,f){return f==undefined&&(f=1.70158),r*(t/=u)*t*((f+1)*t-f)+i},easeOutBack:function(n,t,i,r,u,f){return f==undefined&&(f=1.70158),r*((t=t/u-1)*t*((f+1)*t+f)+1)+i},easeInOutBack:function(n,t,i,r,u,f){return(f==undefined&&(f=1.70158),(t/=u/2)<1)?r/2*t*t*(((f*=1.525)+1)*t-f)+i:r/2*((t-=2)*t*(((f*=1.525)+1)*t+f)+2)+i},easeInBounce:function(n,t,i,r,u){return r-jQuery.easing.easeOutBounce(n,u-t,0,r,u)+i},easeOutBounce:function(n,t,i,r,u){return(t/=u)<1/2.75?r*7.5625*t*t+i:t<2/2.75?r*(7.5625*(t-=1.5/2.75)*t+.75)+i:t<2.5/2.75?r*(7.5625*(t-=2.25/2.75)*t+.9375)+i:r*(7.5625*(t-=2.625/2.75)*t+.984375)+i},easeInOutBounce:function(n,t,i,r,u){return t<u/2?jQuery.easing.easeInBounce(n,t*2,0,r,u)*.5+i:jQuery.easing.easeOutBounce(n,t*2-u,0,r,u)*.5+r*.5+i}}),function(n,t){typeof define=="function"&&define.amd?define([],t):typeof exports=="object"?module.exports=t():n.LazyLoad=t()}(this,function(){function f(){i||(t={elements_selector:"img",elements:null,container:window,threshold:300,throttle:150,data_src:"original",data_srcset:"original-set",class_loading:"loading",class_loaded:"loaded",skip_invisible:!0,callback_load:null,callback_error:null,callback_set:null,callback_processed:null},i=!0)}function e(n,t,i){function s(){return window.innerWidth||r.documentElement.clientWidth||document.body.clientWidth}function h(){return window.innerHeight||r.documentElement.clientHeight||document.body.clientHeight}function f(n){return n.getBoundingClientRect().top+u-r.documentElement.clientTop}function e(n){return n.getBoundingClientRect().left+o-r.documentElement.clientLeft}function c(){var r;return r=t===window?h()+u:f(t)+t.offsetHeight,r<=f(n)-i}function l(){var r;return r=t===window?s()+window.pageXOffset:e(t)+s(),r<=e(n)-i}function a(){var r;return r=t===window?u:f(t),r>=f(n)+i+n.offsetHeight}function v(){var r;return r=t===window?o:e(t),r>=e(n)+i+n.offsetWidth}var r,u,o;return r=n.ownerDocument,u=window.pageYOffset||r.body.scrollTop,o=window.pageXOffset||r.body.scrollLeft,!c()&&!a()&&!l()&&!v()}function r(){var n=new Date;return n.getTime()}function o(n,t){var r={};for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i]);for(i in t)t.hasOwnProperty(i)&&(r[i]=t[i]);return r}function s(n){return Array.prototype.slice.call(n)}function h(n,t){var u=n.parentElement,i,r,f;if(u.tagName==="PICTURE")for(i=0;i<u.children.length;i++)r=u.children[i],r.tagName==="SOURCE"&&(f=r.getAttribute("data-"+t),f&&r.setAttribute("srcset",f))}function c(n,t,i){var f=n.tagName,r=n.getAttribute("data-"+i),u;if(f==="IMG"){h(n,t);u=n.getAttribute("data-"+t);u&&n.setAttribute("srcset",u);r&&n.setAttribute("src",r);return}if(f==="IFRAME"){r&&n.setAttribute("src",r);return}r&&(n.style.backgroundImage="url("+r+")")}function u(n,t){return function(){return n.apply(t,arguments)}}function n(n){f();this._settings=o(t,n);this._queryOriginNode=this._settings.container===window?document:this._settings.container;this._previousLoopTime=0;this._loopTimeout=null;this._handleScrollFn=u(this.handleScroll,this);window.addEventListener("resize",this._handleScrollFn);this.update()}var t,i=!1;return n.prototype._showOnAppear=function(n){function r(){n.removeEventListener("load",i);n.classList.remove(t.class_loading);t.callback_error&&t.callback_error(n)}function i(){t!==null&&(t.callback_load&&t.callback_load(n),n.classList.remove(t.class_loading),n.classList.add(t.class_loaded),n.removeEventListener("load",i),n.removeEventListener("error",r))}var t=this._settings;(n.tagName==="IMG"||n.tagName==="IFRAME")&&(n.addEventListener("load",i),n.addEventListener("error",r),n.classList.add(t.class_loading));c(n,t.data_srcset,t.data_src);t.callback_set&&t.callback_set(n)},n.prototype._loopThroughElements=function(){for(var t,i=this._settings,r=this._elements,f=r?r.length:0,u=[],n=0;n<f;n++)(t=r[n],i.skip_invisible&&t.offsetParent===null)||e(t,i.container,i.threshold)&&(this._showOnAppear(t),u.push(n),t.wasProcessed=!0);while(u.length>0)r.splice(u.pop(),1),i.callback_processed&&i.callback_processed(r.length);f===0&&this._stopScrollHandler()},n.prototype._purgeElements=function(){for(var r,t=this._elements,u=t.length,i=[],n=0;n<u;n++)r=t[n],r.wasProcessed&&i.push(n);while(i.length>0)t.splice(i.pop(),1)},n.prototype._startScrollHandler=function(){this._isHandlingScroll||(this._isHandlingScroll=!0,this._settings.container.addEventListener("scroll",this._handleScrollFn))},n.prototype._stopScrollHandler=function(){this._isHandlingScroll&&(this._isHandlingScroll=!1,this._settings.container.removeEventListener("scroll",this._handleScrollFn))},n.prototype.handleScroll=function(){var n,i,t;this._settings&&(i=r(),t=this._settings.throttle,t!==0?(n=t-(i-this._previousLoopTime),n<=0||n>t?(this._loopTimeout&&(clearTimeout(this._loopTimeout),this._loopTimeout=null),this._previousLoopTime=i,this._loopThroughElements()):this._loopTimeout||(this._loopTimeout=setTimeout(u(function(){this._previousLoopTime=r();this._loopTimeout=null;this._loopThroughElements()},this),n))):this._loopThroughElements())},n.prototype.update=function(){this._elements=this._settings.elements?this._settings.elements:s(this._queryOriginNode.querySelectorAll(this._settings.elements_selector));this._purgeElements();this._loopThroughElements();this._startScrollHandler()},n.prototype.destroy=function(){window.removeEventListener("resize",this._handleScrollFn);this._loopTimeout&&(clearTimeout(this._loopTimeout),this._loopTimeout=null);this._stopScrollHandler();this._elements=null;this._queryOriginNode=null;this._settings=null},n}),function(n,t,i){function v(t,i){var u,f;if(n.isArray(t)){for(u=t.length-1;u>=0;u--)f=t[u],n.type(f)==="string"&&r.transports[f]||(i.log("Invalid transport: "+f+", removing it from the transports list."),t.splice(u,1));t.length===0&&(i.log("No transports remain within the specified transport array."),t=null)}else if(r.transports[t]||t==="auto"){if(t==="auto"&&r._.ieVersion<=8)return["longPolling"]}else i.log("Invalid transport: "+t.toString()+"."),t=null;return t}function y(n){return n==="http:"?80:n==="https:"?443:void 0}function h(n,t){return t.match(/:\d+$/)?t:t+":"+y(n)}function p(t,i){var u=this,r=[];u.tryBuffer=function(i){return t.state===n.signalR.connectionState.connecting?(r.push(i),!0):!1};u.drain=function(){if(t.state===n.signalR.connectionState.connected)while(r.length>0)i(r.shift())};u.clear=function(){r=[]}}var f={nojQuery:"jQuery was not found. Please ensure jQuery is referenced before the SignalR client JavaScript file.",noTransportOnInit:"No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization.",errorOnNegotiate:"Error during negotiation request.",stoppedWhileLoading:"The connection was stopped during page load.",stoppedWhileNegotiating:"The connection was stopped during the negotiate request.",errorParsingNegotiateResponse:"Error parsing negotiate response.",errorDuringStartRequest:"Error during start request. Stopping the connection.",stoppedDuringStartRequest:"The connection was stopped during the start request.",errorParsingStartResponse:"Error parsing start response: '{0}'. Stopping the connection.",invalidStartResponse:"Invalid start response: '{0}'. Stopping the connection.",protocolIncompatible:"You are using a version of the client that isn't compatible with the server. Client version {0}, server version {1}.",sendFailed:"Send failed.",parseFailed:"Failed at parsing response: {0}",longPollFailed:"Long polling request failed.",eventSourceFailedToConnect:"EventSource failed to connect.",eventSourceError:"Error raised by EventSource",webSocketClosed:"WebSocket closed.",pingServerFailedInvalidResponse:"Invalid ping response when pinging server: '{0}'.",pingServerFailed:"Failed to ping server.",pingServerFailedStatusCode:"Failed to ping server.  Server responded with status code {0}, stopping the connection.",pingServerFailedParse:"Failed to parse ping server response, stopping the connection.",noConnectionTransport:"Connection is in an invalid state, there is no transport active.",webSocketsInvalidState:"The Web Socket transport is in an invalid state, transitioning into reconnecting.",reconnectTimeout:"Couldn't reconnect within the configured timeout of {0} ms, disconnecting.",reconnectWindowTimeout:"The client has been inactive since {0} and it has exceeded the inactivity timeout of {1} ms. Stopping the connection."};if(typeof n!="function")throw new Error(f.nojQuery);var r,c,s=t.document.readyState==="complete",e=n(t),l="__Negotiate Aborted__",u={onStart:"onStart",onStarting:"onStarting",onReceived:"onReceived",onError:"onError",onConnectionSlow:"onConnectionSlow",onReconnecting:"onReconnecting",onReconnect:"onReconnect",onStateChanged:"onStateChanged",onDisconnect:"onDisconnect"},w=function(n,i){if(i!==!1){var r;typeof t.console!="undefined"&&(r="["+(new Date).toTimeString()+"] SignalR: "+n,t.console.debug?t.console.debug(r):t.console.log&&t.console.log(r))}},o=function(t,i,r){return i===t.state?(t.state=r,n(t).triggerHandler(u.onStateChanged,[{oldState:i,newState:r}]),!0):!1},b=function(n){return n.state===r.connectionState.disconnected},a=function(n){return n._.keepAliveData.activated&&n.transport.supportsKeepAlive(n)},k=function(i){var f,e;i._.configuredStopReconnectingTimeout||(e=function(t){var i=r._.format(r.resources.reconnectTimeout,t.disconnectTimeout);t.log(i);n(t).triggerHandler(u.onError,[r._.error(i,"TimeoutException")]);t.stop(!1,!1)},i.reconnecting(function(){var n=this;n.state===r.connectionState.reconnecting&&(f=t.setTimeout(function(){e(n)},n.disconnectTimeout))}),i.stateChanged(function(n){n.oldState===r.connectionState.reconnecting&&t.clearTimeout(f)}),i._.configuredStopReconnectingTimeout=!0)};r=function(n,t,i){return new r.fn.init(n,t,i)};r._={defaultContentType:"application/x-www-form-urlencoded; charset=UTF-8",ieVersion:function(){var i,n;return t.navigator.appName==="Microsoft Internet Explorer"&&(n=/MSIE ([0-9]+\.[0-9]+)/.exec(t.navigator.userAgent),n&&(i=t.parseFloat(n[1]))),i}(),error:function(n,t,i){var r=new Error(n);return r.source=t,typeof i!="undefined"&&(r.context=i),r},transportError:function(n,t,r,u){var f=this.error(n,r,u);return f.transport=t?t.name:i,f},format:function(){for(var t=arguments[0],n=0;n<arguments.length-1;n++)t=t.replace("{"+n+"}",arguments[n+1]);return t},firefoxMajorVersion:function(n){var t=n.match(/Firefox\/(\d+)/);return!t||!t.length||t.length<2?0:parseInt(t[1],10)},configurePingInterval:function(i){var f=i._.config,e=function(t){n(i).triggerHandler(u.onError,[t])};f&&!i._.pingIntervalId&&f.pingInterval&&(i._.pingIntervalId=t.setInterval(function(){r.transports._logic.pingServer(i).fail(e)},f.pingInterval))}};r.events=u;r.resources=f;r.ajaxDefaults={processData:!0,timeout:null,async:!0,global:!1,cache:!1};r.changeState=o;r.isDisconnecting=b;r.connectionState={connecting:0,connected:1,reconnecting:2,disconnected:4};r.hub={start:function(){throw new Error("SignalR: Error loading hubs. Ensure your hubs reference is correct, e.g. <script src='/signalr/js'><\/script>.");}};e.load(function(){s=!0});r.fn=r.prototype={init:function(t,i,r){var f=n(this);this.url=t;this.qs=i;this.lastError=null;this._={keepAliveData:{},connectingMessageBuffer:new p(this,function(n){f.triggerHandler(u.onReceived,[n])}),lastMessageAt:(new Date).getTime(),lastActiveAt:(new Date).getTime(),beatInterval:5e3,beatHandle:null,totalTransportConnectTimeout:0};typeof r=="boolean"&&(this.logging=r)},_parseResponse:function(n){var t=this;return n?typeof n=="string"?t.json.parse(n):n:n},_originalJson:t.JSON,json:t.JSON,isCrossDomain:function(i,r){var u;return(i=n.trim(i),r=r||t.location,i.indexOf("http")!==0)?!1:(u=t.document.createElement("a"),u.href=i,u.protocol+h(u.protocol,u.host)!==r.protocol+h(r.protocol,r.host))},ajaxDataType:"text",contentType:"application/json; charset=UTF-8",logging:!1,state:r.connectionState.disconnected,clientProtocol:"1.5",reconnectDelay:2e3,transportConnectTimeout:0,disconnectTimeout:3e4,reconnectWindow:3e4,keepAliveWarnAt:2/3,start:function(i,h){var c=this,y={pingInterval:3e5,waitForPageLoad:!0,transport:"auto",jsonp:!1},d,p=c._deferral||n.Deferred(),w=t.document.createElement("a"),b,g;if(c.lastError=null,c._deferral=p,!c.json)throw new Error("SignalR: No JSON parser found. Please ensure json2.js is referenced before the SignalR.js file if you need to support clients without native JSON parsing support, e.g. IE<8.");if(n.type(i)==="function"?h=i:n.type(i)==="object"&&(n.extend(y,i),n.type(y.callback)==="function"&&(h=y.callback)),y.transport=v(y.transport,c),!y.transport)throw new Error("SignalR: Invalid transport(s) specified, aborting start.");return(c._.config=y,!s&&y.waitForPageLoad===!0)?(c._.deferredStartHandler=function(){c.start(i,h)},e.bind("load",c._.deferredStartHandler),p.promise()):c.state===r.connectionState.connecting?p.promise():o(c,r.connectionState.disconnected,r.connectionState.connecting)===!1?(p.resolve(c),p.promise()):(k(c),w.href=c.url,w.protocol&&w.protocol!==":"?(c.protocol=w.protocol,c.host=w.host):(c.protocol=t.document.location.protocol,c.host=w.host||t.document.location.host),c.baseUrl=c.protocol+"//"+c.host,c.wsProtocol=c.protocol==="https:"?"wss://":"ws://",y.transport==="auto"&&y.jsonp===!0&&(y.transport="longPolling"),c.url.indexOf("//")===0&&(c.url=t.location.protocol+c.url,c.log("Protocol relative URL detected, normalizing it to '"+c.url+"'.")),this.isCrossDomain(c.url)&&(c.log("Auto detected cross domain url."),y.transport==="auto"&&(y.transport=["webSockets","serverSentEvents","longPolling"]),typeof y.withCredentials=="undefined"&&(y.withCredentials=!0),y.jsonp||(y.jsonp=!n.support.cors,y.jsonp&&c.log("Using jsonp because this browser doesn't support CORS.")),c.contentType=r._.defaultContentType),c.withCredentials=y.withCredentials,c.ajaxDataType=y.jsonp?"jsonp":"text",n(c).bind(u.onStart,function(){n.type(h)==="function"&&h.call(c);p.resolve(c)}),c._.initHandler=r.transports._logic.initHandler(c),d=function(i,s){var l=r._.error(f.noTransportOnInit);if(s=s||0,s>=i.length){s===0?c.log("No transports supported by the server were selected."):s===1?c.log("No fallback transports were selected."):c.log("Fallback transports exhausted.");n(c).triggerHandler(u.onError,[l]);p.reject(l);c.stop();return}if(c.state!==r.connectionState.disconnected){var y=i[s],h=r.transports[y],v=function(){d(i,s+1)};c.transport=h;try{c._.initHandler.start(h,function(){var i=r._.firefoxMajorVersion(t.navigator.userAgent)>=11,f=!!c.withCredentials&&i;c.log("The start request succeeded. Transitioning to the connected state.");a(c)&&r.transports._logic.monitorKeepAlive(c);r.transports._logic.startHeartbeat(c);r._.configurePingInterval(c);o(c,r.connectionState.connecting,r.connectionState.connected)||c.log("WARNING! The connection was not in the connecting state.");c._.connectingMessageBuffer.drain();n(c).triggerHandler(u.onStart);e.bind("unload",function(){c.log("Window unloading, stopping the connection.");c.stop(f)});i&&e.bind("beforeunload",function(){t.setTimeout(function(){c.stop(f)},0)})},v)}catch(w){c.log(h.name+" transport threw '"+w.message+"' when attempting to start.");v()}}},b=c.url+"/negotiate",g=function(t,i){var e=r._.error(f.errorOnNegotiate,t,i._.negotiateRequest);n(i).triggerHandler(u.onError,e);p.reject(e);i.stop()},n(c).triggerHandler(u.onStarting),b=r.transports._logic.prepareQueryString(c,b),c.log("Negotiating with '"+b+"'."),c._.negotiateRequest=r.transports._logic.ajax(c,{url:b,error:function(n,t){t!==l?g(n,c):p.reject(r._.error(f.stoppedWhileNegotiating,null,c._.negotiateRequest))},success:function(t){var i,e,h,o=[],s=[];try{i=c._parseResponse(t)}catch(l){g(r._.error(f.errorParsingNegotiateResponse,l),c);return}if(e=c._.keepAliveData,c.appRelativeUrl=i.Url,c.id=i.ConnectionId,c.token=i.ConnectionToken,c.webSocketServerUrl=i.WebSocketServerUrl,c._.pollTimeout=i.ConnectionTimeout*1e3+1e4,c.disconnectTimeout=i.DisconnectTimeout*1e3,c._.totalTransportConnectTimeout=c.transportConnectTimeout+i.TransportConnectTimeout*1e3,i.KeepAliveTimeout?(e.activated=!0,e.timeout=i.KeepAliveTimeout*1e3,e.timeoutWarning=e.timeout*c.keepAliveWarnAt,c._.beatInterval=(e.timeout-e.timeoutWarning)/3):e.activated=!1,c.reconnectWindow=c.disconnectTimeout+(e.timeout||0),!i.ProtocolVersion||i.ProtocolVersion!==c.clientProtocol){h=r._.error(r._.format(f.protocolIncompatible,c.clientProtocol,i.ProtocolVersion));n(c).triggerHandler(u.onError,[h]);p.reject(h);return}n.each(r.transports,function(n){if(n.indexOf("_")===0||n==="webSockets"&&!i.TryWebSockets)return!0;s.push(n)});n.isArray(y.transport)?n.each(y.transport,function(t,i){n.inArray(i,s)>=0&&o.push(i)}):y.transport==="auto"?o=s:n.inArray(y.transport,s)>=0&&o.push(y.transport);d(o)}}),p.promise())},starting:function(t){var i=this;return n(i).bind(u.onStarting,function(){t.call(i)}),i},send:function(n){var t=this;if(t.state===r.connectionState.disconnected)throw new Error("SignalR: Connection must be started before data can be sent. Call .start() before .send()");if(t.state===r.connectionState.connecting)throw new Error("SignalR: Connection has not been fully initialized. Use .start().done() or .start().fail() to run logic after the connection has started.");return t.transport.send(t,n),t},received:function(t){var i=this;return n(i).bind(u.onReceived,function(n,r){t.call(i,r)}),i},stateChanged:function(t){var i=this;return n(i).bind(u.onStateChanged,function(n,r){t.call(i,r)}),i},error:function(t){var i=this;return n(i).bind(u.onError,function(n,r,u){i.lastError=r;t.call(i,r,u)}),i},disconnected:function(t){var i=this;return n(i).bind(u.onDisconnect,function(){t.call(i)}),i},connectionSlow:function(t){var i=this;return n(i).bind(u.onConnectionSlow,function(){t.call(i)}),i},reconnecting:function(t){var i=this;return n(i).bind(u.onReconnecting,function(){t.call(i)}),i},reconnected:function(t){var i=this;return n(i).bind(u.onReconnect,function(){t.call(i)}),i},stop:function(i,h){var c=this,v=c._deferral;if(c._.deferredStartHandler&&e.unbind("load",c._.deferredStartHandler),delete c._.config,delete c._.deferredStartHandler,!s&&(!c._.config||c._.config.waitForPageLoad===!0)){c.log("Stopping connection prior to negotiate.");v&&v.reject(r._.error(f.stoppedWhileLoading));return}if(c.state!==r.connectionState.disconnected)return c.log("Stopping connection."),o(c,c.state,r.connectionState.disconnected),t.clearTimeout(c._.beatHandle),t.clearInterval(c._.pingIntervalId),c.transport&&(c.transport.stop(c),h!==!1&&c.transport.abort(c,i),a(c)&&r.transports._logic.stopMonitoringKeepAlive(c),c.transport=null),c._.negotiateRequest&&(c._.negotiateRequest.abort(l),delete c._.negotiateRequest),c._.initHandler&&c._.initHandler.stop(),n(c).triggerHandler(u.onDisconnect),delete c._deferral,delete c.messageId,delete c.groupsToken,delete c.id,delete c._.pingIntervalId,delete c._.lastMessageAt,delete c._.lastActiveAt,c._.connectingMessageBuffer.clear(),c},log:function(n){w(n,this.logging)}};r.fn.init.prototype=r.fn;r.noConflict=function(){return n.connection===r&&(n.connection=c),r};n.connection&&(c=n.connection);n.connection=n.signalR=r}(window.jQuery,window),function(n,t,i){function o(n){n._.keepAliveData.monitoring&&c(n);u.markActive(n)&&(n._.beatHandle=t.setTimeout(function(){o(n)},n._.beatInterval))}function c(t){var i=t._.keepAliveData,u;t.state===r.connectionState.connected&&(u=(new Date).getTime()-t._.lastMessageAt,u>=i.timeout?(t.log("Keep alive timed out.  Notifying transport that connection has been lost."),t.transport.lostConnection(t)):u>=i.timeoutWarning?i.userNotified||(t.log("Keep alive has been missed, connection may be dead/slow."),n(t).triggerHandler(f.onConnectionSlow),i.userNotified=!0):i.userNotified=!1)}function e(n,t){var i=n.url+t;return n.transport&&(i+="?transport="+n.transport.name),u.prepareQueryString(n,i)}function s(n){this.connection=n;this.startRequested=!1;this.startCompleted=!1;this.connectionStopped=!1}var r=n.signalR,f=n.signalR.events,l=n.signalR.changeState,h="__Start Aborted__",u;r.transports={};s.prototype={start:function(n,r,u){var f=this,e=f.connection,o=!1;if(f.startRequested||f.connectionStopped){e.log("WARNING! "+n.name+" transport cannot be started. Initialization ongoing or completed.");return}e.log(n.name+" transport starting.");f.transportTimeoutHandle=t.setTimeout(function(){o||(o=!0,e.log(n.name+" transport timed out when trying to connect."),f.transportFailed(n,i,u))},e._.totalTransportConnectTimeout);n.start(e,function(){o||f.initReceived(n,r)},function(t){return o||(o=!0,f.transportFailed(n,t,u)),!f.startCompleted||f.connectionStopped})},stop:function(){this.connectionStopped=!0;t.clearTimeout(this.transportTimeoutHandle);r.transports._logic.tryAbortStartRequest(this.connection)},initReceived:function(n,i){var u=this,f=u.connection;if(u.startRequested){f.log("WARNING! The client received multiple init messages.");return}u.connectionStopped||(u.startRequested=!0,t.clearTimeout(u.transportTimeoutHandle),f.log(n.name+" transport connected. Initiating start request."),r.transports._logic.ajaxStart(f,function(){u.startCompleted=!0;i()}))},transportFailed:function(i,u,e){var o=this.connection,h=o._deferral,s;this.connectionStopped||(t.clearTimeout(this.transportTimeoutHandle),this.startRequested?this.startCompleted||(s=r._.error(r.resources.errorDuringStartRequest,u),o.log(i.name+" transport failed during the start request. Stopping the connection."),n(o).triggerHandler(f.onError,[s]),h&&h.reject(s),o.stop()):(i.stop(o),o.log(i.name+" transport failed to connect. Attempting to fall back."),e()))}};u=r.transports._logic={ajax:function(t,i){return n.ajax(n.extend(!0,{},n.signalR.ajaxDefaults,{type:"GET",data:{},xhrFields:{withCredentials:t.withCredentials},contentType:t.contentType,dataType:t.ajaxDataType},i))},pingServer:function(t){var e,f,i=n.Deferred();return t.transport?(e=t.url+"/ping",e=u.addQs(e,t.qs),f=u.ajax(t,{url:e,success:function(n){var u;try{u=t._parseResponse(n)}catch(e){i.reject(r._.transportError(r.resources.pingServerFailedParse,t.transport,e,f));t.stop();return}u.Response==="pong"?i.resolve():i.reject(r._.transportError(r._.format(r.resources.pingServerFailedInvalidResponse,n),t.transport,null,f))},error:function(n){n.status===401||n.status===403?(i.reject(r._.transportError(r._.format(r.resources.pingServerFailedStatusCode,n.status),t.transport,n,f)),t.stop()):i.reject(r._.transportError(r.resources.pingServerFailed,t.transport,n,f))}})):i.reject(r._.transportError(r.resources.noConnectionTransport,t.transport)),i.promise()},prepareQueryString:function(n,i){var r;return r=u.addQs(i,"clientProtocol="+n.clientProtocol),r=u.addQs(r,n.qs),n.token&&(r+="&connectionToken="+t.encodeURIComponent(n.token)),n.data&&(r+="&connectionData="+t.encodeURIComponent(n.data)),r},addQs:function(t,i){var r=t.indexOf("?")!==-1?"&":"?",u;if(!i)return t;if(typeof i=="object")return t+r+n.param(i);if(typeof i=="string")return u=i.charAt(0),(u==="?"||u==="&")&&(r=""),t+r+i;throw new Error("Query string property must be either a string or object.");},getUrl:function(n,i,r,f,e){var h=i==="webSockets"?"":n.baseUrl,o=h+n.appRelativeUrl,s="transport="+i;return!e&&n.groupsToken&&(s+="&groupsToken="+t.encodeURIComponent(n.groupsToken)),r?(o+=f?"/poll":"/reconnect",!e&&n.messageId&&(s+="&messageId="+t.encodeURIComponent(n.messageId))):o+="/connect",o+="?"+s,o=u.prepareQueryString(n,o),e||(o+="&tid="+Math.floor(Math.random()*11)),o},maximizePersistentResponse:function(n){return{MessageId:n.C,Messages:n.M,Initialized:typeof n.S!="undefined"?!0:!1,ShouldReconnect:typeof n.T!="undefined"?!0:!1,LongPollDelay:n.L,GroupsToken:n.G}},updateGroups:function(n,t){t&&(n.groupsToken=t)},stringifySend:function(n,t){return typeof t=="string"||typeof t=="undefined"||t===null?t:n.json.stringify(t)},ajaxSend:function(t,i){var h=u.stringifySend(t,i),c=e(t,"/send"),o,s=function(t,u){n(u).triggerHandler(f.onError,[r._.transportError(r.resources.sendFailed,u.transport,t,o),i])};return o=u.ajax(t,{url:c,type:t.ajaxDataType==="jsonp"?"GET":"POST",contentType:r._.defaultContentType,data:{data:h},success:function(n){var i;if(n){try{i=t._parseResponse(n)}catch(r){s(r,t);t.stop();return}u.triggerReceived(t,i)}},error:function(n,i){i!=="abort"&&i!=="parsererror"&&s(n,t)}})},ajaxAbort:function(n,t){if(typeof n.transport!="undefined"){t=typeof t=="undefined"?!0:t;var i=e(n,"/abort");u.ajax(n,{url:i,async:t,timeout:1e3,type:"POST"});n.log("Fired ajax abort async = "+t+".")}},ajaxStart:function(t,i){var s=function(n){var i=t._deferral;i&&i.reject(n)},o=function(i){t.log("The start request failed. Stopping the connection.");n(t).triggerHandler(f.onError,[i]);s(i);t.stop()};t._.startRequest=u.ajax(t,{url:e(t,"/start"),success:function(n,u,f){var e;try{e=t._parseResponse(n)}catch(s){o(r._.error(r._.format(r.resources.errorParsingStartResponse,n),s,f));return}e.Response==="started"?i():o(r._.error(r._.format(r.resources.invalidStartResponse,n),null,f))},error:function(n,i,u){i!==h?o(r._.error(r.resources.errorDuringStartRequest,u,n)):(t.log("The start request aborted because connection.stop() was called."),s(r._.error(r.resources.stoppedDuringStartRequest,null,n)))}})},tryAbortStartRequest:function(n){n._.startRequest&&(n._.startRequest.abort(h),delete n._.startRequest)},tryInitialize:function(n,t){n.Initialized&&t()},triggerReceived:function(t,i){t._.connectingMessageBuffer.tryBuffer(i)||n(t).triggerHandler(f.onReceived,[i])},processMessages:function(t,i,r){var f;u.markLastMessage(t);i&&(f=u.maximizePersistentResponse(i),u.updateGroups(t,f.GroupsToken),f.MessageId&&(t.messageId=f.MessageId),f.Messages&&(n.each(f.Messages,function(n,i){u.triggerReceived(t,i)}),u.tryInitialize(f,r)))},monitorKeepAlive:function(t){var i=t._.keepAliveData;i.monitoring?t.log("Tried to monitor keep alive but it's already being monitored."):(i.monitoring=!0,u.markLastMessage(t),t._.keepAliveData.reconnectKeepAliveUpdate=function(){u.markLastMessage(t)},n(t).bind(f.onReconnect,t._.keepAliveData.reconnectKeepAliveUpdate),t.log("Now monitoring keep alive with a warning timeout of "+i.timeoutWarning+", keep alive timeout of "+i.timeout+" and disconnecting timeout of "+t.disconnectTimeout))},stopMonitoringKeepAlive:function(t){var i=t._.keepAliveData;i.monitoring&&(i.monitoring=!1,n(t).unbind(f.onReconnect,t._.keepAliveData.reconnectKeepAliveUpdate),t._.keepAliveData={},t.log("Stopping the monitoring of the keep alive."))},startHeartbeat:function(n){n._.lastActiveAt=(new Date).getTime();o(n)},markLastMessage:function(n){n._.lastMessageAt=(new Date).getTime()},markActive:function(n){return u.verifyLastActive(n)?(n._.lastActiveAt=(new Date).getTime(),!0):!1},isConnectedOrReconnecting:function(n){return n.state===r.connectionState.connected||n.state===r.connectionState.reconnecting},ensureReconnectingState:function(t){return l(t,r.connectionState.connected,r.connectionState.reconnecting)===!0&&n(t).triggerHandler(f.onReconnecting),t.state===r.connectionState.reconnecting},clearReconnectTimeout:function(n){n&&n._.reconnectTimeout&&(t.clearTimeout(n._.reconnectTimeout),delete n._.reconnectTimeout)},verifyLastActive:function(t){if((new Date).getTime()-t._.lastActiveAt>=t.reconnectWindow){var i=r._.format(r.resources.reconnectWindowTimeout,new Date(t._.lastActiveAt),t.reconnectWindow);return t.log(i),n(t).triggerHandler(f.onError,[r._.error(i,"TimeoutException")]),t.stop(!1,!1),!1}return!0},reconnect:function(n,i){var f=r.transports[i];if(u.isConnectedOrReconnecting(n)&&!n._.reconnectTimeout){if(!u.verifyLastActive(n))return;n._.reconnectTimeout=t.setTimeout(function(){u.verifyLastActive(n)&&(f.stop(n),u.ensureReconnectingState(n)&&(n.log(i+" reconnecting."),f.start(n)))},n.reconnectDelay)}},handleParseFailure:function(t,i,u,e,o){var s=r._.transportError(r._.format(r.resources.parseFailed,i),t.transport,u,o);e&&e(s)?t.log("Failed to parse server response while attempting to connect."):(n(t).triggerHandler(f.onError,[s]),t.stop())},initHandler:function(n){return new s(n)},foreverFrame:{count:0,connections:{}}}}(window.jQuery,window),function(n,t){var r=n.signalR,u=n.signalR.events,f=n.signalR.changeState,i=r.transports._logic;r.transports.webSockets={name:"webSockets",supportsKeepAlive:function(){return!0},send:function(t,f){var e=i.stringifySend(t,f);try{t.socket.send(e)}catch(o){n(t).triggerHandler(u.onError,[r._.transportError(r.resources.webSocketsInvalidState,t.transport,o,t.socket),f])}},start:function(e,o,s){var h,c=!1,l=this,a=!o,v=n(e);if(!t.WebSocket){s();return}e.socket||(h=e.webSocketServerUrl?e.webSocketServerUrl:e.wsProtocol+e.host,h+=i.getUrl(e,this.name,a),e.log("Connecting to websocket endpoint '"+h+"'."),e.socket=new t.WebSocket(h),e.socket.onopen=function(){c=!0;e.log("Websocket opened.");i.clearReconnectTimeout(e);f(e,r.connectionState.reconnecting,r.connectionState.connected)===!0&&v.triggerHandler(u.onReconnect)},e.socket.onclose=function(t){var i;this===e.socket&&(c&&typeof t.wasClean!="undefined"&&t.wasClean===!1?(i=r._.transportError(r.resources.webSocketClosed,e.transport,t),e.log("Unclean disconnect from websocket: "+(t.reason||"[no reason given]."))):e.log("Websocket closed."),s&&s(i)||(i&&n(e).triggerHandler(u.onError,[i]),l.reconnect(e)))},e.socket.onmessage=function(t){var r;try{r=e._parseResponse(t.data)}catch(u){i.handleParseFailure(e,t.data,u,s,t);return}r&&(n.isEmptyObject(r)||r.M?i.processMessages(e,r,o):i.triggerReceived(e,r))})},reconnect:function(n){i.reconnect(n,this.name)},lostConnection:function(n){this.reconnect(n)},stop:function(n){i.clearReconnectTimeout(n);n.socket&&(n.log("Closing the Websocket."),n.socket.close(),n.socket=null)},abort:function(n,t){i.ajaxAbort(n,t)}}}(window.jQuery,window),function(n,t){var i=n.signalR,u=n.signalR.events,e=n.signalR.changeState,r=i.transports._logic,f=function(n){t.clearTimeout(n._.reconnectAttemptTimeoutHandle);delete n._.reconnectAttemptTimeoutHandle};i.transports.serverSentEvents={name:"serverSentEvents",supportsKeepAlive:function(){return!0},timeOut:3e3,start:function(o,s,h){var c=this,l=!1,a=n(o),v=!s,y;if(o.eventSource&&(o.log("The connection already has an event source. Stopping it."),o.stop()),!t.EventSource){h&&(o.log("This browser doesn't support SSE."),h());return}y=r.getUrl(o,this.name,v);try{o.log("Attempting to connect to SSE endpoint '"+y+"'.");o.eventSource=new t.EventSource(y,{withCredentials:o.withCredentials})}catch(p){o.log("EventSource failed trying to connect with error "+p.Message+".");h?h():(a.triggerHandler(u.onError,[i._.transportError(i.resources.eventSourceFailedToConnect,o.transport,p)]),v&&c.reconnect(o));return}v&&(o._.reconnectAttemptTimeoutHandle=t.setTimeout(function(){l===!1&&o.eventSource.readyState!==t.EventSource.OPEN&&c.reconnect(o)},c.timeOut));o.eventSource.addEventListener("open",function(){o.log("EventSource connected.");f(o);r.clearReconnectTimeout(o);l===!1&&(l=!0,e(o,i.connectionState.reconnecting,i.connectionState.connected)===!0&&a.triggerHandler(u.onReconnect))},!1);o.eventSource.addEventListener("message",function(n){var t;if(n.data!=="initialized"){try{t=o._parseResponse(n.data)}catch(i){r.handleParseFailure(o,n.data,i,h,n);return}r.processMessages(o,t,s)}},!1);o.eventSource.addEventListener("error",function(n){var r=i._.transportError(i.resources.eventSourceError,o.transport,n);this===o.eventSource&&(h&&h(r)||(o.log("EventSource readyState: "+o.eventSource.readyState+"."),n.eventPhase===t.EventSource.CLOSED?(o.log("EventSource reconnecting due to the server connection ending."),c.reconnect(o)):(o.log("EventSource error."),a.triggerHandler(u.onError,[r]))))},!1)},reconnect:function(n){r.reconnect(n,this.name)},lostConnection:function(n){this.reconnect(n)},send:function(n,t){r.ajaxSend(n,t)},stop:function(n){f(n);r.clearReconnectTimeout(n);n&&n.eventSource&&(n.log("EventSource calling close()."),n.eventSource.close(),n.eventSource=null,delete n.eventSource)},abort:function(n,t){r.ajaxAbort(n,t)}}}(window.jQuery,window),function(n,t){var r=n.signalR,e=n.signalR.events,o=n.signalR.changeState,i=r.transports._logic,u=function(){var n=t.document.createElement("iframe");return n.setAttribute("style","position:absolute;top:0;left:0;width:0;height:0;visibility:hidden;"),n},f=function(){var i=null,f=1e3,n=0;return{prevent:function(){r._.ieVersion<=8&&(n===0&&(i=t.setInterval(function(){var n=u();t.document.body.appendChild(n);t.document.body.removeChild(n);n=null},f)),n++)},cancel:function(){n===1&&t.clearInterval(i);n>0&&n--}}}();r.transports.foreverFrame={name:"foreverFrame",supportsKeepAlive:function(){return!0},iframeClearThreshold:50,start:function(n,r,e){var l=this,s=i.foreverFrame.count+=1,h,o=u(),c=function(){n.log("Forever frame iframe finished loading and is no longer receiving messages.");e&&e()||l.reconnect(n)};if(t.EventSource){e&&(n.log("Forever Frame is not supported by SignalR on browsers with SSE support."),e());return}o.setAttribute("data-signalr-connection-id",n.id);f.prevent();h=i.getUrl(n,this.name);h+="&frameId="+s;t.document.documentElement.appendChild(o);n.log("Binding to iframe's load event.");o.addEventListener?o.addEventListener("load",c,!1):o.attachEvent&&o.attachEvent("onload",c);o.src=h;i.foreverFrame.connections[s]=n;n.frame=o;n.frameId=s;r&&(n.onSuccess=function(){n.log("Iframe transport started.");r()})},reconnect:function(n){var r=this;i.isConnectedOrReconnecting(n)&&i.verifyLastActive(n)&&t.setTimeout(function(){if(i.verifyLastActive(n)&&n.frame&&i.ensureReconnectingState(n)){var u=n.frame,t=i.getUrl(n,r.name,!0)+"&frameId="+n.frameId;n.log("Updating iframe src to '"+t+"'.");u.src=t}},n.reconnectDelay)},lostConnection:function(n){this.reconnect(n)},send:function(n,t){i.ajaxSend(n,t)},receive:function(t,u){var f,e,o;if(t.json!==t._originalJson&&(u=t._originalJson.stringify(u)),o=t._parseResponse(u),i.processMessages(t,o,t.onSuccess),t.state===n.signalR.connectionState.connected&&(t.frameMessageCount=(t.frameMessageCount||0)+1,t.frameMessageCount>r.transports.foreverFrame.iframeClearThreshold&&(t.frameMessageCount=0,f=t.frame.contentWindow||t.frame.contentDocument,f&&f.document&&f.document.body)))for(e=f.document.body;e.firstChild;)e.removeChild(e.firstChild)},stop:function(n){var r=null;if(f.cancel(),n.frame){if(n.frame.stop)n.frame.stop();else try{r=n.frame.contentWindow||n.frame.contentDocument;r.document&&r.document.execCommand&&r.document.execCommand("Stop")}catch(u){n.log("Error occured when stopping foreverFrame transport. Message = "+u.message+".")}n.frame.parentNode===t.document.body&&t.document.body.removeChild(n.frame);delete i.foreverFrame.connections[n.frameId];n.frame=null;n.frameId=null;delete n.frame;delete n.frameId;delete n.onSuccess;delete n.frameMessageCount;n.log("Stopping forever frame.")}},abort:function(n,t){i.ajaxAbort(n,t)},getConnection:function(n){return i.foreverFrame.connections[n]},started:function(t){o(t,r.connectionState.reconnecting,r.connectionState.connected)===!0&&n(t).triggerHandler(e.onReconnect)}}}(window.jQuery,window),function(n,t){var r=n.signalR,u=n.signalR.events,e=n.signalR.changeState,f=n.signalR.isDisconnecting,i=r.transports._logic;r.transports.longPolling={name:"longPolling",supportsKeepAlive:function(){return!1},reconnectDelay:3e3,start:function(o,s,h){var a=this,v=function(){v=n.noop;o.log("LongPolling connected.");s()},y=function(n){return h(n)?(o.log("LongPolling failed to connect."),!0):!1},c=o._,l=0,p=function(i){t.clearTimeout(c.reconnectTimeoutId);c.reconnectTimeoutId=null;e(i,r.connectionState.reconnecting,r.connectionState.connected)===!0&&(i.log("Raising the reconnect event"),n(i).triggerHandler(u.onReconnect))},w=36e5;o.pollXhr&&(o.log("Polling xhr requests already exists, aborting."),o.stop());o.messageId=null;c.reconnectTimeoutId=null;c.pollTimeoutId=t.setTimeout(function(){(function e(s,h){var g=s.messageId,nt=g===null,k=!nt,tt=!h,d=i.getUrl(s,a.name,k,tt,!0),b={};(s.messageId&&(b.messageId=s.messageId),s.groupsToken&&(b.groupsToken=s.groupsToken),f(s)!==!0)&&(o.log("Opening long polling request to '"+d+"'."),s.pollXhr=i.ajax(o,{xhrFields:{onprogress:function(){i.markLastMessage(o)}},url:d,type:"POST",contentType:r._.defaultContentType,data:b,timeout:o._.pollTimeout,success:function(r){var h,w=0,u,a;o.log("Long poll complete.");l=0;try{h=o._parseResponse(r)}catch(b){i.handleParseFailure(s,r,b,y,s.pollXhr);return}(c.reconnectTimeoutId!==null&&p(s),h&&(u=i.maximizePersistentResponse(h)),i.processMessages(s,h,v),u&&n.type(u.LongPollDelay)==="number"&&(w=u.LongPollDelay),f(s)!==!0)&&(a=u&&u.ShouldReconnect,!a||i.ensureReconnectingState(s))&&(w>0?c.pollTimeoutId=t.setTimeout(function(){e(s,a)},w):e(s,a))},error:function(f,h){var v=r._.transportError(r.resources.longPollFailed,o.transport,f,s.pollXhr);if(t.clearTimeout(c.reconnectTimeoutId),c.reconnectTimeoutId=null,h==="abort"){o.log("Aborted xhr request.");return}if(!y(v)){if(l++,o.state!==r.connectionState.reconnecting&&(o.log("An error occurred using longPolling. Status = "+h+".  Response = "+f.responseText+"."),n(s).triggerHandler(u.onError,[v])),(o.state===r.connectionState.connected||o.state===r.connectionState.reconnecting)&&!i.verifyLastActive(o))return;if(!i.ensureReconnectingState(s))return;c.pollTimeoutId=t.setTimeout(function(){e(s,!0)},a.reconnectDelay)}}}),k&&h===!0&&(c.reconnectTimeoutId=t.setTimeout(function(){p(s)},Math.min(1e3*(Math.pow(2,l)-1),w))))})(o)},250)},lostConnection:function(n){n.pollXhr&&n.pollXhr.abort("lostConnection")},send:function(n,t){i.ajaxSend(n,t)},stop:function(n){t.clearTimeout(n._.pollTimeoutId);t.clearTimeout(n._.reconnectTimeoutId);delete n._.pollTimeoutId;delete n._.reconnectTimeoutId;n.pollXhr&&(n.pollXhr.abort(),n.pollXhr=null,delete n.pollXhr)},abort:function(n,t){i.ajaxAbort(n,t)}}}(window.jQuery,window),function(n){function r(n){return n+s}function e(n,t,i){for(var f=n.length,u=[],r=0;r<f;r+=1)n.hasOwnProperty(r)&&(u[r]=t.call(i,n[r],r,n));return u}function o(t){return n.isFunction(t)?null:n.type(t)==="undefined"?null:t}function u(n){for(var t in n)if(n.hasOwnProperty(t))return!0;return!1}function f(n,t){var i=n._.invocationCallbacks,r,f;u(i)&&n.log("Clearing hub invocation callbacks with error: "+t+".");n._.invocationCallbackId=0;delete n._.invocationCallbacks;n._.invocationCallbacks={};for(f in i)r=i[f],r.method.call(r.scope,{E:t})}function i(n,t){return new i.fn.init(n,t)}function t(i,r){var u={qs:null,logging:!1,useDefaultPath:!0};return n.extend(u,r),(!i||u.useDefaultPath)&&(i=(i||"")+"/signalr"),new t.fn.init(i,u)}var s=".hubProxy",h=n.signalR;i.fn=i.prototype={init:function(n,t){this.state={};this.connection=n;this.hubName=t;this._={callbackMap:{}}},constructor:i,hasSubscriptions:function(){return u(this._.callbackMap)},on:function(t,i){var u=this,f=u._.callbackMap;return t=t.toLowerCase(),f[t]||(f[t]={}),f[t][i]=function(n,t){i.apply(u,t)},n(u).bind(r(t),f[t][i]),u},off:function(t,i){var e=this,o=e._.callbackMap,f;return t=t.toLowerCase(),f=o[t],f&&(f[i]?(n(e).unbind(r(t),f[i]),delete f[i],u(f)||delete o[t]):i||(n(e).unbind(r(t)),delete o[t])),e},invoke:function(t){var i=this,r=i.connection,s=n.makeArray(arguments).slice(1),c=e(s,o),f={H:i.hubName,M:t,A:c,I:r._.invocationCallbackId},u=n.Deferred(),l=function(f){var e=i._maximizeHubResponse(f),s,o;n.extend(i.state,e.State);e.Progress?u.notifyWith?u.notifyWith(i,[e.Progress.Data]):r._.progressjQueryVersionLogged||(r.log("A hub method invocation progress update was received but the version of jQuery in use ("+n.prototype.jquery+") does not support progress updates. Upgrade to jQuery 1.7+ to receive progress notifications."),r._.progressjQueryVersionLogged=!0):e.Error?(e.StackTrace&&r.log(e.Error+"\n"+e.StackTrace+"."),s=e.IsHubException?"HubException":"Exception",o=h._.error(e.Error,s),o.data=e.ErrorData,r.log(i.hubName+"."+t+" failed to execute. Error: "+o.message),u.rejectWith(i,[o])):(r.log("Invoked "+i.hubName+"."+t),u.resolveWith(i,[e.Result]))};return r._.invocationCallbacks[r._.invocationCallbackId.toString()]={scope:i,method:l},r._.invocationCallbackId+=1,n.isEmptyObject(i.state)||(f.S=i.state),r.log("Invoking "+i.hubName+"."+t),r.send(f),u.promise()},_maximizeHubResponse:function(n){return{State:n.S,Result:n.R,Progress:n.P?{Id:n.P.I,Data:n.P.D}:null,Id:n.I,IsHubException:n.H,Error:n.E,StackTrace:n.T,ErrorData:n.D}}};i.fn.init.prototype=i.fn;t.fn=t.prototype=n.connection();t.fn.init=function(t,i){var e={qs:null,logging:!1,useDefaultPath:!0},u=this;n.extend(e,i);n.signalR.fn.init.call(u,t,e.qs,e.logging);u.proxies={};u._.invocationCallbackId=0;u._.invocationCallbacks={};u.received(function(t){var f,o,e,i,s,h;t&&(typeof t.P!="undefined"?(e=t.P.I.toString(),i=u._.invocationCallbacks[e],i&&i.method.call(i.scope,t)):typeof t.I!="undefined"?(e=t.I.toString(),i=u._.invocationCallbacks[e],i&&(u._.invocationCallbacks[e]=null,delete u._.invocationCallbacks[e],i.method.call(i.scope,t))):(f=this._maximizeClientHubInvocation(t),u.log("Triggering client hub event '"+f.Method+"' on hub '"+f.Hub+"'."),s=f.Hub.toLowerCase(),h=f.Method.toLowerCase(),o=this.proxies[s],n.extend(o.state,f.State),n(o).triggerHandler(r(h),[f.Args])))});u.error(function(n,t){var i,r;t&&(i=t.I,r=u._.invocationCallbacks[i],r&&(u._.invocationCallbacks[i]=null,delete u._.invocationCallbacks[i],r.method.call(r.scope,{E:n})))});u.reconnecting(function(){u.transport&&u.transport.name==="webSockets"&&f(u,"Connection started reconnecting before invocation result was received.")});u.disconnected(function(){f(u,"Connection was disconnected before invocation result was received.")})};t.fn._maximizeClientHubInvocation=function(n){return{Hub:n.H,Method:n.M,Args:n.A,State:n.S}};t.fn._registerSubscribedHubs=function(){var t=this;t._subscribedToHubs||(t._subscribedToHubs=!0,t.starting(function(){var i=[];n.each(t.proxies,function(n){this.hasSubscriptions()&&(i.push({name:n}),t.log("Client subscribed to hub '"+n+"'."))});i.length===0&&t.log("No hubs have been subscribed to.  The client will not receive data from hubs.  To fix, declare at least one client side function prior to connection start for each hub you wish to subscribe to.");t.data=t.json.stringify(i)}))};t.fn.createHubProxy=function(n){n=n.toLowerCase();var t=this.proxies[n];return t||(t=i(this,n),this.proxies[n]=t),this._registerSubscribedHubs(),t};t.fn.init.prototype=t.fn;n.hubConnection=t}(window.jQuery,window),function(n){n.signalR.version="2.2.0"}(window.jQuery);!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):n("object"==typeof exports?require("jquery"):jQuery)}(function(n){"use strict";function i(n){return"number"==typeof n&&!isNaN(n)}function c(n){return"undefined"==typeof n}function tt(n,t){var r=[];return i(t)&&r.push(t),r.slice.apply(n,r)}function it(n,t){var i=tt(arguments,2);return function(){return n.apply(t,i.concat(tt(arguments)))}}function di(n){var t=n.match(/^(https?:)\/\/([^\:\/\?#]+):?(\d*)/i);return t&&(t[1]!==ut.protocol||t[2]!==ut.hostname||t[3]!==ut.port)}function gi(n){var t="timestamp="+(new Date).getTime();return n+(-1===n.indexOf("?")?"?":"&")+t}function wt(n){return n?' crossOrigin="'+n+'"':""}function nr(n,t){var i;return n.naturalWidth&&!pi?t(n.naturalWidth,n.naturalHeight):(i=document.createElement("img"),i.onload=function(){t(this.width,this.height)},void(i.src=n.src))}function rt(n){var t=[],r=n.rotate,u=n.scaleX,f=n.scaleY;return i(r)&&t.push("rotate("+r+"deg)"),i(u)&&i(f)&&t.push("scale("+u+","+f+")"),t.length?t.join(" "):"none"}function b(n,t){var i,r,u=h(n.degree)%180,s=(u>90?180-u:u)*Math.PI/180,f=wr(s),e=br(s),o=n.width,c=n.height,l=n.aspectRatio;return t?(i=o/(e+f/l),r=i/l):(i=o*e+c*f,r=o*f+c*e),{width:i,height:r}}function tr(t,r){var v,y,p,s=n("<canvas>")[0],u=s.getContext("2d"),nt=0,tt=0,w=r.naturalWidth,k=r.naturalHeight,c=r.rotate,l=r.scaleX,a=r.scaleY,d=i(l)&&i(a)&&(1!==l||1!==a),g=i(c)&&0!==c,it=g||d,e=w*h(l||1),o=k*h(a||1);return d&&(v=e/2,y=o/2),g&&(p=b({width:e,height:o,degree:c}),e=p.width,o=p.height,v=e/2,y=o/2),s.width=e,s.height=o,it&&(nt=-w/2,tt=-k/2,u.save(),u.translate(v,y)),g&&u.rotate(c*Math.PI/180),d&&u.scale(l,a),u.drawImage(t,f(nt),f(tt),f(w),f(k)),it&&u.restore(),s}function ir(t){var i=t.length,r=0,u=0;return i&&(n.each(t,function(n,t){r+=t.pageX;u+=t.pageY}),r/=i,u/=i),{pageX:r,pageY:u}}function rr(n,t,i){var r,u="";for(r=t,i+=t;i>r;r++)u+=ki(n.getUint8(r));return u}function ur(n){var l,a,u,s,r,h,f,e,i,o,t=new or(n),c=t.byteLength;if(255===t.getUint8(0)&&216===t.getUint8(1))for(i=2;c>i;){if(255===t.getUint8(i)&&225===t.getUint8(i+1)){f=i;break}i++}if(f&&(a=f+4,u=f+10,"Exif"===rr(t,a,4)&&(h=t.getUint16(u),r=18761===h,(r||19789===h)&&42===t.getUint16(u+2,r)&&(s=t.getUint32(u+4,r),s>=8&&(e=u+s)))),e)for(c=t.getUint16(e,r),o=0;c>o;o++)if(i=e+12*o+2,274===t.getUint16(i,r)){i+=8;l=t.getUint16(i,r);pi&&t.setUint16(i,1,r);break}return l}function fr(n){for(var f=n.replace(vr,""),i=atob(f),r=i.length,u=new dt(r),e=new gt(u),t=0;r>t;t++)e[t]=i.charCodeAt(t);return u}function er(n){for(var i=new gt(n),u=i.length,r="",t=0;u>t;t++)r+=ki(i[t]);return"data:image/jpeg;base64,"+sr(r)}function e(t,i){this.$element=n(t);this.options=n.extend({},e.DEFAULTS,n.isPlainObject(i)&&i);this.isLoaded=!1;this.isBuilt=!1;this.isCompleted=!1;this.isRotated=!1;this.isCropped=!1;this.isDisabled=!1;this.isReplaced=!1;this.isLimited=!1;this.wheeling=!1;this.isImg=!1;this.originalUrl="";this.canvas=null;this.cropBox=null;this.init()}var bt=n(window),kt=n(document),ut=window.location,ft=window.navigator,dt=window.ArrayBuffer,gt=window.Uint8Array,or=window.DataView,sr=window.btoa,o="cropper",l="cropper-modal",ni="cropper-hide",s="cropper-hidden",hr="cropper-invisible",et="cropper-move",ot="cropper-crop",ti="cropper-disabled",cr="cropper-bg",ii="mousedown touchstart pointerdown MSPointerDown",ri="mousemove touchmove pointermove MSPointerMove",ui="mouseup touchend touchcancel pointerup pointercancel MSPointerUp MSPointerCancel",fi="wheel mousewheel DOMMouseScroll",ei="dblclick",st="load."+o,oi="error."+o,si="resize."+o,hi="build."+o,ht="built."+o,ct="cropstart."+o,lt="cropmove."+o,at="cropend."+o,k="crop."+o,vt="zoom."+o,lr=/e|w|s|n|se|sw|ne|nw|all|crop|move|zoom/,ar=/^data\:/,vr=/^data\:([^\;]+)\;base64,/,yr=/^data\:image\/jpeg.*;base64,/,d="preview",a="action",ci="e",li="w",ai="s",vi="n",v="se",y="sw",p="ne",w="nw",yt="all",g="crop",nt="move",pt="zoom",pr="none",yi=n.isFunction(n("<canvas>")[0].getContext),pi=ft&&/safari/i.test(ft.userAgent)&&/apple computer/i.test(ft.vendor),u=Number,t=Math.min,r=Math.max,h=Math.abs,wr=Math.sin,br=Math.cos,wi=Math.sqrt,bi=Math.round,f=Math.floor,ki=String.fromCharCode;e.prototype={constructor:e,init:function(){var n,t=this.$element;if(t.is("img")){if(this.isImg=!0,this.originalUrl=n=t.attr("src"),!n)return;n=t.prop("src")}else t.is("canvas")&&yi&&(n=t[0].toDataURL());this.load(n)},trigger:function(t,i){var r=n.Event(t,i);return this.$element.trigger(r),r},load:function(t){var r,i,u=this.options,f=this.$element;if(t&&(f.one(hi,u.build),!this.trigger(hi).isDefaultPrevented())){if(this.url=t,this.image={},!u.checkOrientation||!dt)return this.clone();if(r=n.proxy(this.read,this),ar.test(t))return yr.test(t)?r(fr(t)):this.clone();i=new XMLHttpRequest;i.onerror=i.onabort=n.proxy(function(){this.clone()},this);i.onload=function(){r(this.response)};i.open("get",t);i.responseType="arraybuffer";i.send()}},read:function(n){var t,i,r,f=this.options,e=ur(n),u=this.image;if(e>1)switch(this.url=er(n),e){case 2:i=-1;break;case 3:t=-180;break;case 4:r=-1;break;case 5:t=90;r=-1;break;case 6:t=90;break;case 7:t=90;i=-1;break;case 8:t=-90}f.rotatable&&(u.rotate=t);f.scalable&&(u.scaleX=i,u.scaleY=r);this.clone()},clone:function(){var i,f,e=this.options,r=this.$element,u=this.url,t="";e.checkCrossOrigin&&di(u)&&(t=r.prop("crossOrigin"),t?i=u:(t="anonymous",i=gi(u)));this.crossOrigin=t;this.crossOriginUrl=i;this.$clone=f=n("<img"+wt(t)+' src="'+(i||u)+'">');this.isImg?r[0].complete?this.start():r.one(st,n.proxy(this.start,this)):f.one(st,n.proxy(this.start,this)).one(oi,n.proxy(this.stop,this)).addClass(ni).insertAfter(r)},start:function(){var t=this.$element,i=this.$clone;this.isImg||(i.off(oi,this.stop),t=i);nr(t[0],n.proxy(function(t,i){n.extend(this.image,{naturalWidth:t,naturalHeight:i,aspectRatio:t/i});this.isLoaded=!0;this.build()},this))},stop:function(){this.$clone.remove();this.$clone=null},build:function(){var u,f,o,i=this.options,h=this.$element,c=this.$clone;this.isLoaded&&(this.isBuilt&&this.unbuild(),this.$container=h.parent(),this.$cropper=u=n(e.TEMPLATE),this.$canvas=u.find(".cropper-canvas").append(c),this.$dragBox=u.find(".cropper-drag-box"),this.$cropBox=f=u.find(".cropper-crop-box"),this.$viewBox=u.find(".cropper-view-box"),this.$face=o=f.find(".cropper-face"),h.addClass(s).after(u),this.isImg||c.removeClass(ni),this.initPreview(),this.bind(),i.aspectRatio=r(0,i.aspectRatio)||NaN,i.viewMode=r(0,t(3,bi(i.viewMode)))||0,i.autoCrop?(this.isCropped=!0,i.modal&&this.$dragBox.addClass(l)):f.addClass(s),i.guides||f.find(".cropper-dashed").addClass(s),i.center||f.find(".cropper-center").addClass(s),i.cropBoxMovable&&o.addClass(et).data(a,yt),i.highlight||o.addClass(hr),i.background&&u.addClass(cr),i.cropBoxResizable||f.find(".cropper-line, .cropper-point").addClass(s),this.setDragMode(i.dragMode),this.render(),this.isBuilt=!0,this.setData(i.data),h.one(ht,i.built),setTimeout(n.proxy(function(){this.trigger(ht);this.isCompleted=!0},this),0))},unbuild:function(){this.isBuilt&&(this.isBuilt=!1,this.isCompleted=!1,this.initialImage=null,this.initialCanvas=null,this.initialCropBox=null,this.container=null,this.canvas=null,this.cropBox=null,this.unbind(),this.resetPreview(),this.$preview=null,this.$viewBox=null,this.$cropBox=null,this.$dragBox=null,this.$canvas=null,this.$container=null,this.$cropper.remove(),this.$cropper=null)},render:function(){this.initContainer();this.initCanvas();this.initCropBox();this.renderCanvas();this.isCropped&&this.renderCropBox()},initContainer:function(){var t=this.options,i=this.$element,f=this.$container,n=this.$cropper;n.addClass(s);i.removeClass(s);n.css(this.container={width:r(f.width(),u(t.minContainerWidth)||200),height:r(f.height(),u(t.minContainerHeight)||100)});i.addClass(s);n.removeClass(s)},initCanvas:function(){var t,f=this.options.viewMode,c=this.container,r=c.width,u=c.height,e=this.image,l=e.naturalWidth,a=e.naturalHeight,v=90===h(e.rotate),y=v?a:l,p=v?l:a,i=y/p,o=r,s=u;u*i>r?3===f?o=u*i:s=r/i:3===f?s=r/i:o=u*i;t={naturalWidth:y,naturalHeight:p,aspectRatio:i,width:o,height:s};t.oldLeft=t.left=(r-o)/2;t.oldTop=t.top=(u-s)/2;this.canvas=t;this.isLimited=1===f||2===f;this.limitCanvas(!0,!0);this.initialImage=n.extend({},e);this.initialCanvas=n.extend({},t)},limitCanvas:function(n,i){var e,o,c,l,w=this.options,a=w.viewMode,b=this.container,v=b.width,y=b.height,f=this.canvas,h=f.aspectRatio,s=this.cropBox,p=this.isCropped&&s;n&&(e=u(w.minCanvasWidth)||0,o=u(w.minCanvasHeight)||0,a&&(a>1?(e=r(e,v),o=r(o,y),3===a&&(o*h>e?e=o*h:o=e/h)):e?e=r(e,p?s.width:0):o?o=r(o,p?s.height:0):p&&(e=s.width,o=s.height,o*h>e?e=o*h:o=e/h)),e&&o?o*h>e?o=e/h:e=o*h:e?o=e/h:o&&(e=o*h),f.minWidth=e,f.minHeight=o,f.maxWidth=1/0,f.maxHeight=1/0);i&&(a?(c=v-f.width,l=y-f.height,f.minLeft=t(0,c),f.minTop=t(0,l),f.maxLeft=r(0,c),f.maxTop=r(0,l),p&&this.isLimited&&(f.minLeft=t(s.left,s.left+s.width-f.width),f.minTop=t(s.top,s.top+s.height-f.height),f.maxLeft=s.left,f.maxTop=s.top,2===a&&(f.width>=v&&(f.minLeft=t(0,c),f.maxLeft=r(0,c)),f.height>=y&&(f.minTop=t(0,l),f.maxTop=r(0,l))))):(f.minLeft=-f.width,f.minTop=-f.height,f.maxLeft=v,f.maxTop=y))},renderCanvas:function(n){var e,u,i=this.canvas,f=this.image,o=f.rotate,s=f.naturalWidth,h=f.naturalHeight;this.isRotated&&(this.isRotated=!1,u=b({width:f.width,height:f.height,degree:o}),e=u.width/u.height,e!==i.aspectRatio&&(i.left-=(u.width-i.width)/2,i.top-=(u.height-i.height)/2,i.width=u.width,i.height=u.height,i.aspectRatio=e,i.naturalWidth=s,i.naturalHeight=h,o%180&&(u=b({width:s,height:h,degree:o}),i.naturalWidth=u.width,i.naturalHeight=u.height),this.limitCanvas(!0,!1)));(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft);(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop);i.width=t(r(i.width,i.minWidth),i.maxWidth);i.height=t(r(i.height,i.minHeight),i.maxHeight);this.limitCanvas(!1,!0);i.oldLeft=i.left=t(r(i.left,i.minLeft),i.maxLeft);i.oldTop=i.top=t(r(i.top,i.minTop),i.maxTop);this.$canvas.css({width:i.width,height:i.height,left:i.left,top:i.top});this.renderImage();this.isCropped&&this.isLimited&&this.limitCropBox(!0,!0);n&&this.output()},renderImage:function(t){var r,u=this.canvas,i=this.image;i.rotate&&(r=b({width:u.width,height:u.height,degree:i.rotate,aspectRatio:i.aspectRatio},!0));n.extend(i,r?{width:r.width,height:r.height,left:(u.width-r.width)/2,top:(u.height-r.height)/2}:{width:u.width,height:u.height,left:0,top:0});this.$clone.css({width:i.width,height:i.height,marginLeft:i.left,marginTop:i.top,transform:rt(i)});t&&this.output()},initCropBox:function(){var o=this.options,f=this.canvas,e=o.aspectRatio,s=u(o.autoCropArea)||.8,i={width:f.width,height:f.height};e&&(f.height*e>f.width?i.height=i.width/e:i.width=i.height*e);this.cropBox=i;this.limitCropBox(!0,!0);i.width=t(r(i.width,i.minWidth),i.maxWidth);i.height=t(r(i.height,i.minHeight),i.maxHeight);i.width=r(i.minWidth,i.width*s);i.height=r(i.minHeight,i.height*s);i.oldLeft=i.left=f.left+(f.width-i.width)/2;i.oldTop=i.top=f.top+(f.height-i.height)/2;this.initialCropBox=n.extend({},i)},limitCropBox:function(n,i){var e,o,c,l,y=this.options,s=y.aspectRatio,w=this.container,a=w.width,v=w.height,h=this.canvas,f=this.cropBox,p=this.isLimited;n&&(e=u(y.minCropBoxWidth)||0,o=u(y.minCropBoxHeight)||0,e=t(e,a),o=t(o,v),c=t(a,p?h.width:a),l=t(v,p?h.height:v),s&&(e&&o?o*s>e?o=e/s:e=o*s:e?o=e/s:o&&(e=o*s),l*s>c?l=c/s:c=l*s),f.minWidth=t(e,c),f.minHeight=t(o,l),f.maxWidth=c,f.maxHeight=l);i&&(p?(f.minLeft=r(0,h.left),f.minTop=r(0,h.top),f.maxLeft=t(a,h.left+h.width)-f.width,f.maxTop=t(v,h.top+h.height)-f.height):(f.minLeft=0,f.minTop=0,f.maxLeft=a-f.width,f.maxTop=v-f.height))},renderCropBox:function(){var i=this.options,u=this.container,f=u.width,e=u.height,n=this.cropBox;(n.width>n.maxWidth||n.width<n.minWidth)&&(n.left=n.oldLeft);(n.height>n.maxHeight||n.height<n.minHeight)&&(n.top=n.oldTop);n.width=t(r(n.width,n.minWidth),n.maxWidth);n.height=t(r(n.height,n.minHeight),n.maxHeight);this.limitCropBox(!1,!0);n.oldLeft=n.left=t(r(n.left,n.minLeft),n.maxLeft);n.oldTop=n.top=t(r(n.top,n.minTop),n.maxTop);i.movable&&i.cropBoxMovable&&this.$face.data(a,n.width===f&&n.height===e?nt:yt);this.$cropBox.css({width:n.width,height:n.height,left:n.left,top:n.top});this.isCropped&&this.isLimited&&this.limitCanvas(!0,!0);this.isDisabled||this.output()},output:function(){this.preview();this.isCompleted?this.trigger(k,this.getData()):this.isBuilt||this.$element.one(ht,n.proxy(function(){this.trigger(k,this.getData())},this))},initPreview:function(){var i,t=wt(this.crossOrigin),r=t?this.crossOriginUrl:this.url;this.$preview=n(this.options.preview);this.$clone2=i=n("<img"+t+' src="'+r+'">');this.$viewBox.html(i);this.$preview.each(function(){var i=n(this);i.data(d,{width:i.width(),height:i.height(),html:i.html()});i.html("<img"+t+' src="'+r+'" style="display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;">')})},resetPreview:function(){this.$preview.each(function(){var i=n(this),t=i.data(d);i.css({width:t.width,height:t.height}).html(t.html).removeData(d)})},preview:function(){var t=this.image,f=this.canvas,i=this.cropBox,r=i.width,u=i.height,e=t.width,o=t.height,s=i.left-f.left-t.left,h=i.top-f.top-t.top;this.isCropped&&!this.isDisabled&&(this.$clone2.css({width:e,height:o,marginLeft:-s,marginTop:-h,transform:rt(t)}),this.$preview.each(function(){var l=n(this),a=l.data(d),v=a.width,f=a.height,y=v,c=f,i=1;r&&(i=v/r,c=u*i);u&&c>f&&(i=f/u,y=r*i,c=f);l.css({width:y,height:c}).find("img").css({width:e*i,height:o*i,marginLeft:-s*i,marginTop:-h*i,transform:rt(t)})}))},bind:function(){var t=this.options,i=this.$element,r=this.$cropper;n.isFunction(t.cropstart)&&i.on(ct,t.cropstart);n.isFunction(t.cropmove)&&i.on(lt,t.cropmove);n.isFunction(t.cropend)&&i.on(at,t.cropend);n.isFunction(t.crop)&&i.on(k,t.crop);n.isFunction(t.zoom)&&i.on(vt,t.zoom);r.on(ii,n.proxy(this.cropStart,this));t.zoomable&&t.zoomOnWheel&&r.on(fi,n.proxy(this.wheel,this));t.toggleDragModeOnDblclick&&r.on(ei,n.proxy(this.dblclick,this));kt.on(ri,this._cropMove=it(this.cropMove,this)).on(ui,this._cropEnd=it(this.cropEnd,this));t.responsive&&bt.on(si,this._resize=it(this.resize,this))},unbind:function(){var t=this.options,i=this.$element,r=this.$cropper;n.isFunction(t.cropstart)&&i.off(ct,t.cropstart);n.isFunction(t.cropmove)&&i.off(lt,t.cropmove);n.isFunction(t.cropend)&&i.off(at,t.cropend);n.isFunction(t.crop)&&i.off(k,t.crop);n.isFunction(t.zoom)&&i.off(vt,t.zoom);r.off(ii,this.cropStart);t.zoomable&&t.zoomOnWheel&&r.off(fi,this.wheel);t.toggleDragModeOnDblclick&&r.off(ei,this.dblclick);kt.off(ri,this._cropMove).off(ui,this._cropEnd);t.responsive&&bt.off(si,this._resize)},resize:function(){var i,r,t,f=this.options.restore,e=this.$container,u=this.container;!this.isDisabled&&u&&(t=e.width()/u.width,(1!==t||e.height()!==u.height)&&(f&&(i=this.getCanvasData(),r=this.getCropBoxData()),this.render(),f&&(this.setCanvasData(n.each(i,function(n,r){i[n]=r*t})),this.setCropBoxData(n.each(r,function(n,i){r[n]=i*t})))))},dblclick:function(){this.isDisabled||(this.$dragBox.hasClass(ot)?this.setDragMode(nt):this.setDragMode(g))},wheel:function(t){var i=t.originalEvent||t,f=u(this.options.wheelZoomRatio)||.1,r=1;this.isDisabled||(t.preventDefault(),this.wheeling||(this.wheeling=!0,setTimeout(n.proxy(function(){this.wheeling=!1},this),50),i.deltaY?r=i.deltaY>0?1:-1:i.wheelDelta?r=-i.wheelDelta/120:i.detail&&(r=i.detail>0?1:-1),this.zoom(-r*f,t)))},cropStart:function(t){var e,i,o=this.options,r=t.originalEvent,f=r&&r.touches,u=t;if(!this.isDisabled){if(f){if(e=f.length,e>1){if(!o.zoomable||!o.zoomOnTouch||2!==e)return;u=f[1];this.startX2=u.pageX;this.startY2=u.pageY;i=pt}u=f[0]}if(i=i||n(u.target).data(a),lr.test(i)){if(this.trigger(ct,{originalEvent:r,action:i}).isDefaultPrevented())return;t.preventDefault();this.action=i;this.cropping=!1;this.startX=u.pageX||r&&r.pageX;this.startY=u.pageY||r&&r.pageY;i===g&&(this.cropping=!0,this.$dragBox.addClass(l))}}},cropMove:function(n){var u,e=this.options,t=n.originalEvent,r=t&&t.touches,i=n,f=this.action;if(!this.isDisabled){if(r){if(u=r.length,u>1){if(!e.zoomable||!e.zoomOnTouch||2!==u)return;i=r[1];this.endX2=i.pageX;this.endY2=i.pageY}i=r[0]}if(f){if(this.trigger(lt,{originalEvent:t,action:f}).isDefaultPrevented())return;n.preventDefault();this.endX=i.pageX||t&&t.pageX;this.endY=i.pageY||t&&t.pageY;this.change(i.shiftKey,f===pt?n:null)}}},cropEnd:function(n){var i=n.originalEvent,t=this.action;this.isDisabled||t&&(n.preventDefault(),this.cropping&&(this.cropping=!1,this.$dragBox.toggleClass(l,this.isCropped&&this.options.modal)),this.action="",this.trigger(at,{originalEvent:i,action:t}))},change:function(n,i){var ot,r,st=this.options,e=st.aspectRatio,l=this.action,ft=this.container,et=this.canvas,b=this.cropBox,u=b.width,f=b.height,c=b.left,o=b.top,ut=c+u,tt=o+f,it=0,k=0,rt=ft.width,d=ft.height,a=!0;switch(!e&&n&&(e=u&&f?u/f:1),this.limited&&(it=b.minLeft,k=b.minTop,rt=it+t(ft.width,et.left+et.width),d=k+t(ft.height,et.top+et.height)),r={x:this.endX-this.startX,y:this.endY-this.startY},e&&(r.X=r.y*e,r.Y=r.x/e),l){case yt:c+=r.x;o+=r.y;break;case ci:if(r.x>=0&&(ut>=rt||e&&(k>=o||tt>=d))){a=!1;break}u+=r.x;e&&(f=u/e,o-=r.Y/2);0>u&&(l=li,u=0);break;case vi:if(r.y<=0&&(k>=o||e&&(it>=c||ut>=rt))){a=!1;break}f-=r.y;o+=r.y;e&&(u=f*e,c+=r.X/2);0>f&&(l=ai,f=0);break;case li:if(r.x<=0&&(it>=c||e&&(k>=o||tt>=d))){a=!1;break}u-=r.x;c+=r.x;e&&(f=u/e,o+=r.Y/2);0>u&&(l=ci,u=0);break;case ai:if(r.y>=0&&(tt>=d||e&&(it>=c||ut>=rt))){a=!1;break}f+=r.y;e&&(u=f*e,c-=r.X/2);0>f&&(l=vi,f=0);break;case p:if(e){if(r.y<=0&&(k>=o||ut>=rt)){a=!1;break}f-=r.y;o+=r.y;u=f*e}else r.x>=0?rt>ut?u+=r.x:r.y<=0&&k>=o&&(a=!1):u+=r.x,r.y<=0?o>k&&(f-=r.y,o+=r.y):(f-=r.y,o+=r.y);0>u&&0>f?(l=y,f=0,u=0):0>u?(l=w,u=0):0>f&&(l=v,f=0);break;case w:if(e){if(r.y<=0&&(k>=o||it>=c)){a=!1;break}f-=r.y;o+=r.y;u=f*e;c+=r.X}else r.x<=0?c>it?(u-=r.x,c+=r.x):r.y<=0&&k>=o&&(a=!1):(u-=r.x,c+=r.x),r.y<=0?o>k&&(f-=r.y,o+=r.y):(f-=r.y,o+=r.y);0>u&&0>f?(l=v,f=0,u=0):0>u?(l=p,u=0):0>f&&(l=y,f=0);break;case y:if(e){if(r.x<=0&&(it>=c||tt>=d)){a=!1;break}u-=r.x;c+=r.x;f=u/e}else r.x<=0?c>it?(u-=r.x,c+=r.x):r.y>=0&&tt>=d&&(a=!1):(u-=r.x,c+=r.x),r.y>=0?d>tt&&(f+=r.y):f+=r.y;0>u&&0>f?(l=p,f=0,u=0):0>u?(l=v,u=0):0>f&&(l=w,f=0);break;case v:if(e){if(r.x>=0&&(ut>=rt||tt>=d)){a=!1;break}u+=r.x;f=u/e}else r.x>=0?rt>ut?u+=r.x:r.y>=0&&tt>=d&&(a=!1):u+=r.x,r.y>=0?d>tt&&(f+=r.y):f+=r.y;0>u&&0>f?(l=w,f=0,u=0):0>u?(l=y,u=0):0>f&&(l=p,f=0);break;case nt:this.move(r.x,r.y);a=!1;break;case pt:this.zoom(function(n,t,i,r){var u=wi(n*n+t*t),f=wi(i*i+r*r);return(f-u)/u}(h(this.startX-this.startX2),h(this.startY-this.startY2),h(this.endX-this.endX2),h(this.endY-this.endY2)),i);this.startX2=this.endX2;this.startY2=this.endY2;a=!1;break;case g:if(!r.x||!r.y){a=!1;break}ot=this.$cropper.offset();c=this.startX-ot.left;o=this.startY-ot.top;u=b.minWidth;f=b.minHeight;r.x>0?l=r.y>0?v:p:r.x<0&&(c-=u,l=r.y>0?y:w);r.y<0&&(o-=f);this.isCropped||(this.$cropBox.removeClass(s),this.isCropped=!0,this.limited&&this.limitCropBox(!0,!0))}a&&(b.width=u,b.height=f,b.left=c,b.top=o,this.action=l,this.renderCropBox());this.startX=this.endX;this.startY=this.endY},crop:function(){this.isBuilt&&!this.isDisabled&&(this.isCropped||(this.isCropped=!0,this.limitCropBox(!0,!0),this.options.modal&&this.$dragBox.addClass(l),this.$cropBox.removeClass(s)),this.setCropBoxData(this.initialCropBox))},reset:function(){this.isBuilt&&!this.isDisabled&&(this.image=n.extend({},this.initialImage),this.canvas=n.extend({},this.initialCanvas),this.cropBox=n.extend({},this.initialCropBox),this.renderCanvas(),this.isCropped&&this.renderCropBox())},clear:function(){this.isCropped&&!this.isDisabled&&(n.extend(this.cropBox,{left:0,top:0,width:0,height:0}),this.isCropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),this.$dragBox.removeClass(l),this.$cropBox.addClass(s))},replace:function(n,t){!this.isDisabled&&n&&(this.isImg&&this.$element.attr("src",n),t?(this.url=n,this.$clone.attr("src",n),this.isBuilt&&this.$preview.find("img").add(this.$clone2).attr("src",n)):(this.isImg&&(this.isReplaced=!0),this.options.data=null,this.load(n)))},enable:function(){this.isBuilt&&(this.isDisabled=!1,this.$cropper.removeClass(ti))},disable:function(){this.isBuilt&&(this.isDisabled=!0,this.$cropper.addClass(ti))},destroy:function(){var n=this.$element;this.isLoaded?(this.isImg&&this.isReplaced&&n.attr("src",this.originalUrl),this.unbuild(),n.removeClass(s)):this.isImg?n.off(st,this.start):this.$clone&&this.$clone.remove();n.removeData(o)},move:function(n,t){var i=this.canvas;this.moveTo(c(n)?n:i.left+u(n),c(t)?t:i.top+u(t))},moveTo:function(n,t){var f=this.canvas,r=!1;c(t)&&(t=n);n=u(n);t=u(t);this.isBuilt&&!this.isDisabled&&this.options.movable&&(i(n)&&(f.left=n,r=!0),i(t)&&(f.top=t,r=!0),r&&this.renderCanvas(!0))},zoom:function(n,t){var i=this.canvas;n=u(n);n=0>n?1/(1-n):1+n;this.zoomTo(i.width*n/i.naturalWidth,t)},zoomTo:function(n,t){var r,f,e,s,h,a=this.options,i=this.canvas,o=i.width,c=i.height,l=i.naturalWidth,v=i.naturalHeight;if(n=u(n),n>=0&&this.isBuilt&&!this.isDisabled&&a.zoomable){if(f=l*n,e=v*n,t&&(r=t.originalEvent),this.trigger(vt,{originalEvent:r,oldRatio:o/l,ratio:f/l}).isDefaultPrevented())return;r?(s=this.$cropper.offset(),h=r.touches?ir(r.touches):{pageX:t.pageX||r.pageX||0,pageY:t.pageY||r.pageY||0},i.left-=(f-o)*((h.pageX-s.left-i.left)/o),i.top-=(e-c)*((h.pageY-s.top-i.top)/c)):(i.left-=(f-o)/2,i.top-=(e-c)/2);i.width=f;i.height=e;this.renderCanvas(!0)}},rotate:function(n){this.rotateTo((this.image.rotate||0)+u(n))},rotateTo:function(n){n=u(n);i(n)&&this.isBuilt&&!this.isDisabled&&this.options.rotatable&&(this.image.rotate=n%360,this.isRotated=!0,this.renderCanvas(!0))},scale:function(n,t){var f=this.image,r=!1;c(t)&&(t=n);n=u(n);t=u(t);this.isBuilt&&!this.isDisabled&&this.options.scalable&&(i(n)&&(f.scaleX=n,r=!0),i(t)&&(f.scaleY=t,r=!0),r&&this.renderImage(!0))},scaleX:function(n){var t=this.image.scaleY;this.scale(n,i(t)?t:1)},scaleY:function(n){var t=this.image.scaleX;this.scale(i(t)?t:1,n)},getData:function(t){var f,i,e=this.options,r=this.image,o=this.canvas,u=this.cropBox;return this.isBuilt&&this.isCropped?(i={x:u.left-o.left,y:u.top-o.top,width:u.width,height:u.height},f=r.width/r.naturalWidth,n.each(i,function(n,r){r/=f;i[n]=t?bi(r):r})):i={x:0,y:0,width:0,height:0},e.rotatable&&(i.rotate=r.rotate||0),e.scalable&&(i.scaleX=r.scaleX||1,i.scaleY=r.scaleY||1),i},setData:function(t){var o,e,u,s=this.options,r=this.image,h=this.canvas,f={};n.isFunction(t)&&(t=t.call(this.element));this.isBuilt&&!this.isDisabled&&n.isPlainObject(t)&&(s.rotatable&&i(t.rotate)&&t.rotate!==r.rotate&&(r.rotate=t.rotate,this.isRotated=o=!0),s.scalable&&(i(t.scaleX)&&t.scaleX!==r.scaleX&&(r.scaleX=t.scaleX,e=!0),i(t.scaleY)&&t.scaleY!==r.scaleY&&(r.scaleY=t.scaleY,e=!0)),o?this.renderCanvas():e&&this.renderImage(),u=r.width/r.naturalWidth,i(t.x)&&(f.left=t.x*u+h.left),i(t.y)&&(f.top=t.y*u+h.top),i(t.width)&&(f.width=t.width*u),i(t.height)&&(f.height=t.height*u),this.setCropBoxData(f))},getContainerData:function(){return this.isBuilt?this.container:{}},getImageData:function(){return this.isLoaded?this.image:{}},getCanvasData:function(){var i=this.canvas,t={};return this.isBuilt&&n.each(["left","top","width","height","naturalWidth","naturalHeight"],function(n,r){t[r]=i[r]}),t},setCanvasData:function(t){var r=this.canvas,u=r.aspectRatio;n.isFunction(t)&&(t=t.call(this.$element));this.isBuilt&&!this.isDisabled&&n.isPlainObject(t)&&(i(t.left)&&(r.left=t.left),i(t.top)&&(r.top=t.top),i(t.width)?(r.width=t.width,r.height=t.width/u):i(t.height)&&(r.height=t.height,r.width=t.height*u),this.renderCanvas(!0))},getCropBoxData:function(){var t,n=this.cropBox;return this.isBuilt&&this.isCropped&&(t={left:n.left,top:n.top,width:n.width,height:n.height}),t||{}},setCropBoxData:function(t){var f,e,r=this.cropBox,u=this.options.aspectRatio;n.isFunction(t)&&(t=t.call(this.$element));this.isBuilt&&this.isCropped&&!this.isDisabled&&n.isPlainObject(t)&&(i(t.left)&&(r.left=t.left),i(t.top)&&(r.top=t.top),i(t.width)&&(f=!0,r.width=t.width),i(t.height)&&(e=!0,r.height=t.height),u&&(f?r.height=r.width/u:e&&(r.width=r.height*u)),this.renderCropBox())},getCroppedCanvas:function(i){var r,u,v,y,s,c,e,p,l,a,o;if(this.isBuilt&&this.isCropped&&yi)return(n.isPlainObject(i)||(i={}),o=this.getData(),r=o.width,u=o.height,p=r/u,n.isPlainObject(i)&&(s=i.width,c=i.height,s?(c=s/p,e=s/r):c&&(s=c*p,e=c/u)),v=f(s||r),y=f(c||u),l=n("<canvas>")[0],l.width=v,l.height=y,a=l.getContext("2d"),i.fillColor&&(a.fillStyle=i.fillColor,a.fillRect(0,0,v,y)),a.drawImage.apply(a,function(){var l,y,a,v,s,c,b=tr(this.$clone[0],this.image),p=b.width,w=b.height,d=this.canvas,k=[b],n=o.x+d.naturalWidth*(h(o.scaleX||1)-1)/2,i=o.y+d.naturalHeight*(h(o.scaleY||1)-1)/2;return-r>=n||n>p?n=l=a=s=0:0>=n?(a=-n,n=0,l=s=t(p,r+n)):p>=n&&(a=0,l=s=t(r,p-n)),0>=l||-u>=i||i>w?i=y=v=c=0:0>=i?(v=-i,i=0,y=c=t(w,u+i)):w>=i&&(v=0,y=c=t(u,w-i)),k.push(f(n),f(i),f(l),f(y)),e&&(a*=e,v*=e,s*=e,c*=e),s>0&&c>0&&k.push(f(a),f(v),f(s),f(c)),k}.call(this)),l)},setAspectRatio:function(n){var t=this.options;this.isDisabled||c(n)||(t.aspectRatio=r(0,n)||NaN,this.isBuilt&&(this.initCropBox(),this.isCropped&&this.renderCropBox()))},setDragMode:function(n){var t,i,r=this.options;this.isLoaded&&!this.isDisabled&&(t=n===g,i=r.movable&&n===nt,n=t||i?n:pr,this.$dragBox.data(a,n).toggleClass(ot,t).toggleClass(et,i),r.cropBoxMovable||this.$face.data(a,n).toggleClass(ot,t).toggleClass(et,i))}};e.DEFAULTS={viewMode:0,dragMode:"crop",aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:200,minContainerHeight:100,build:null,built:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null};e.setDefaults=function(t){n.extend(e.DEFAULTS,t)};e.TEMPLATE='<div class="cropper-container"><div class="cropper-wrap-box"><div class="cropper-canvas"><\/div><\/div><div class="cropper-drag-box"><\/div><div class="cropper-crop-box"><span class="cropper-view-box"><\/span><span class="cropper-dashed dashed-h"><\/span><span class="cropper-dashed dashed-v"><\/span><span class="cropper-center"><\/span><span class="cropper-face"><\/span><span class="cropper-line line-e" data-action="e"><\/span><span class="cropper-line line-n" data-action="n"><\/span><span class="cropper-line line-w" data-action="w"><\/span><span class="cropper-line line-s" data-action="s"><\/span><span class="cropper-point point-e" data-action="e"><\/span><span class="cropper-point point-n" data-action="n"><\/span><span class="cropper-point point-w" data-action="w"><\/span><span class="cropper-point point-s" data-action="s"><\/span><span class="cropper-point point-ne" data-action="ne"><\/span><span class="cropper-point point-nw" data-action="nw"><\/span><span class="cropper-point point-sw" data-action="sw"><\/span><span class="cropper-point point-se" data-action="se"><\/span><\/div><\/div>';e.other=n.fn.cropper;n.fn.cropper=function(t){var i,r=tt(arguments,1);return this.each(function(){var s,h,f=n(this),u=f.data(o);if(!u){if(/destroy/.test(t))return;s=n.extend({},f.data(),n.isPlainObject(t)&&t);f.data(o,u=new e(this,s))}"string"==typeof t&&n.isFunction(h=u[t])&&(i=h.apply(u,r))}),c(i)?this:i};n.fn.cropper.Constructor=e;n.fn.cropper.setDefaults=e.setDefaults;n.fn.cropper.noConflict=function(){return n.fn.cropper=e.other,this}});!function(n,t){"function"==typeof define&&define.amd?define(["jquery"],function(n){return t(n)}):"object"==typeof exports?module.exports=t(require("jquery")):t(n.jQuery)}(this,function(n){var t=function(){"use strict";return{isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},isBlankString:function(n){return!n||/^\s*$/.test(n)},escapeRegExChars:function(n){return n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(n){return"string"==typeof n},isNumber:function(n){return"number"==typeof n},isArray:n.isArray,isFunction:n.isFunction,isObject:n.isPlainObject,isUndefined:function(n){return"undefined"==typeof n},isElement:function(n){return!(!n||1!==n.nodeType)},isJQuery:function(t){return t instanceof n},toStr:function(n){return t.isUndefined(n)||null===n?"":n+""},bind:n.proxy,each:function(t,i){function r(n,t){return i(t,n)}n.each(t,r)},map:n.map,filter:n.grep,every:function(t,i){var r=!0;return t?(n.each(t,function(n,u){if(!(r=i.call(null,u,n,t)))return!1}),!!r):r},some:function(t,i){var r=!1;return t?(n.each(t,function(n,u){if(r=i.call(null,u,n,t))return!1}),!!r):r},mixin:n.extend,identity:function(n){return n},clone:function(t){return n.extend(!0,{},t)},getIdGenerator:function(){var n=0;return function(){return n++}},templatify:function(t){function i(){return String(t)}return n.isFunction(t)?t:i},defer:function(n){setTimeout(n,0)},debounce:function(n,t,i){var r,u;return function(){var f,e,o=this,s=arguments;return f=function(){r=null;i||(u=n.apply(o,s))},e=i&&!r,clearTimeout(r),r=setTimeout(f,t),e&&(u=n.apply(o,s)),u}},throttle:function(n,t){var u,f,i,e,r,o;return r=0,o=function(){r=new Date;i=null;e=n.apply(u,f)},function(){var s=new Date,h=t-(s-r);return u=this,f=arguments,h<=0?(clearTimeout(i),i=null,r=s,e=n.apply(u,f)):i||(i=setTimeout(o,h)),e}},stringify:function(n){return t.isString(n)?n:JSON.stringify(n)},guid:function(){function n(n){var t=(Math.random().toString(16)+"000000000").substr(2,8);return n?"-"+t.substr(0,4)+"-"+t.substr(4,4):t}return"tt-"+n()+n(!0)+n(!0)+n()},noop:function(){}}}(),e=function(){"use strict";function n(n){var e,o;return o=t.mixin({},f,n),e={css:u(),classes:o,html:i(o),selectors:r(o)},{css:e.css,html:e.html,classes:e.classes,selectors:e.selectors,mixin:function(n){t.mixin(n,e)}}}function i(n){return{wrapper:'<span class="'+n.wrapper+'"><\/span>',menu:'<div role="listbox" class="'+n.menu+'"><\/div>'}}function r(n){var i={};return t.each(n,function(n,t){i[t]="."+n}),i}function u(){var n={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},menu:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};return t.isMsie()&&t.mixin(n.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),n}var f={wrapper:"twitter-typeahead",input:"tt-input",hint:"tt-hint",menu:"tt-menu",dataset:"tt-dataset",suggestion:"tt-suggestion",selectable:"tt-selectable",empty:"tt-empty",open:"tt-open",cursor:"tt-cursor",highlight:"tt-highlight"};return n}(),o=function(){"use strict";function i(t){t&&t.el||n.error("EventBus initialized without el");this.$el=n(t.el)}var r,u;return r="typeahead:",u={render:"rendered",cursorchange:"cursorchanged",select:"selected",autocomplete:"autocompleted"},t.mixin(i.prototype,{_trigger:function(t,i){var u=n.Event(r+t);return this.$el.trigger.call(this.$el,u,i||[]),u},before:function(n){var t,i;return t=[].slice.call(arguments,1),i=this._trigger("before"+n,t),i.isDefaultPrevented()},trigger:function(n){var t;this._trigger(n,[].slice.call(arguments,1));(t=u[n])&&this._trigger(t,[].slice.call(arguments,1))}}),i}(),r=function(){"use strict";function t(t,i,r,u){var f;if(!r)return this;for(i=i.split(n),r=u?s(r,u):r,this._callbacks=this._callbacks||{};f=i.shift();)this._callbacks[f]=this._callbacks[f]||{sync:[],async:[]},this._callbacks[f][t].push(r);return this}function r(n,i,r){return t.call(this,"async",n,i,r)}function u(n,i,r){return t.call(this,"sync",n,i,r)}function f(t){var i;if(!this._callbacks)return this;for(t=t.split(n);i=t.shift();)delete this._callbacks[i];return this}function e(t){var r,u,f,e,o;if(!this._callbacks)return this;for(t=t.split(n),f=[].slice.call(arguments,1);(r=t.shift())&&(u=this._callbacks[r]);)e=i(u.sync,this,[r].concat(f)),o=i(u.async,this,[r].concat(f)),e()&&h(o);return this}function i(n,t,i){function r(){for(var r,u=0,f=n.length;!r&&u<f;u+=1)r=n[u].apply(t,i)===!1;return!r}return r}function o(){return window.setImmediate?function(n){setImmediate(function(){n()})}:function(n){setTimeout(function(){n()},0)}}function s(n,t){return n.bind?n.bind(t):function(){n.apply(t,[].slice.call(arguments,0))}}var n=/\s+/,h=o();return{onSync:u,onAsync:r,off:f,trigger:e}}(),s=function(n){"use strict";function i(n){return f[n.toUpperCase()]||n}function r(n,r,u,f){for(var e,o,s=[],h=0,c=n.length;h<c;h++)e=t.escapeRegExChars(n[h]),f&&(e=e.replace(/\S/g,i)),s.push(e);return o=u?"\\b("+s.join("|")+")\\b":"("+s.join("|")+")",r?new RegExp(o):new RegExp(o,"i")}var u={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1,diacriticInsensitive:!1},f={A:"[AaªÀ-Åà-åĀ-ąǍǎȀ-ȃȦȧᴬᵃḀḁẚẠ-ảₐ℀℁℻⒜Ⓐⓐ㍱-㍴㎀-㎄㎈㎉㎩-㎯㏂㏊㏟㏿Ａａ]",B:"[BbᴮᵇḂ-ḇℬ⒝Ⓑⓑ㍴㎅-㎇㏃㏈㏔㏝Ｂｂ]",C:"[CcÇçĆ-čᶜ℀ℂ℃℅℆ℭⅭⅽ⒞Ⓒⓒ㍶㎈㎉㎝㎠㎤㏄-㏇Ｃｃ]",D:"[DdĎďǄ-ǆǱ-ǳᴰᵈḊ-ḓⅅⅆⅮⅾ⒟Ⓓⓓ㋏㍲㍷-㍹㎗㎭-㎯㏅㏈Ｄｄ]",E:"[EeÈ-Ëè-ëĒ-ěȄ-ȇȨȩᴱᵉḘ-ḛẸ-ẽₑ℡ℯℰⅇ⒠Ⓔⓔ㉐㋍㋎Ｅｅ]",F:"[FfᶠḞḟ℉ℱ℻⒡Ⓕⓕ㎊-㎌㎙ﬀ-ﬄＦｆ]",G:"[GgĜ-ģǦǧǴǵᴳᵍḠḡℊ⒢Ⓖⓖ㋌㋍㎇㎍-㎏㎓㎬㏆㏉㏒㏿Ｇｇ]",H:"[HhĤĥȞȟʰᴴḢ-ḫẖℋ-ℎ⒣Ⓗⓗ㋌㍱㎐-㎔㏊㏋㏗Ｈｈ]",I:"[IiÌ-Ïì-ïĨ-İĲĳǏǐȈ-ȋᴵᵢḬḭỈ-ịⁱℐℑℹⅈⅠ-ⅣⅥ-ⅨⅪⅫⅰ-ⅳⅵ-ⅸⅺⅻ⒤Ⓘⓘ㍺㏌㏕ﬁﬃＩｉ]",J:"[JjĲ-ĵǇ-ǌǰʲᴶⅉ⒥ⒿⓙⱼＪｊ]",K:"[KkĶķǨǩᴷᵏḰ-ḵK⒦Ⓚⓚ㎄㎅㎉㎏㎑㎘㎞㎢㎦㎪㎸㎾㏀㏆㏍-㏏Ｋｋ]",L:"[LlĹ-ŀǇ-ǉˡᴸḶḷḺ-ḽℒℓ℡Ⅼⅼ⒧Ⓛⓛ㋏㎈㎉㏐-㏓㏕㏖㏿ﬂﬄＬｌ]",M:"[MmᴹᵐḾ-ṃ℠™ℳⅯⅿ⒨Ⓜⓜ㍷-㍹㎃㎆㎎㎒㎖㎙-㎨㎫㎳㎷㎹㎽㎿㏁㏂㏎㏐㏔-㏖㏘㏙㏞㏟Ｍｍ]",N:"[NnÑñŃ-ŉǊ-ǌǸǹᴺṄ-ṋⁿℕ№⒩Ⓝⓝ㎁㎋㎚㎱㎵㎻㏌㏑Ｎｎ]",O:"[OoºÒ-Öò-öŌ-őƠơǑǒǪǫȌ-ȏȮȯᴼᵒỌ-ỏₒ℅№ℴ⒪Ⓞⓞ㍵㏇㏒㏖Ｏｏ]",P:"[PpᴾᵖṔ-ṗℙ⒫Ⓟⓟ㉐㍱㍶㎀㎊㎩-㎬㎰㎴㎺㏋㏗-㏚Ｐｐ]",Q:"[Qqℚ⒬Ⓠⓠ㏃Ｑｑ]",R:"[RrŔ-řȐ-ȓʳᴿᵣṘ-ṛṞṟ₨ℛ-ℝ⒭Ⓡⓡ㋍㍴㎭-㎯㏚㏛Ｒｒ]",S:"[SsŚ-šſȘșˢṠ-ṣ₨℁℠⒮Ⓢⓢ㎧㎨㎮-㎳㏛㏜ﬆＳｓ]",T:"[TtŢ-ťȚțᵀᵗṪ-ṱẗ℡™⒯Ⓣⓣ㉐㋏㎔㏏ﬅﬆＴｔ]",U:"[UuÙ-Üù-üŨ-ųƯưǓǔȔ-ȗᵁᵘᵤṲ-ṷỤ-ủ℆⒰Ⓤⓤ㍳㍺Ｕｕ]",V:"[VvᵛᵥṼ-ṿⅣ-Ⅷⅳ-ⅷ⒱Ⓥⓥⱽ㋎㍵㎴-㎹㏜㏞Ｖｖ]",W:"[WwŴŵʷᵂẀ-ẉẘ⒲Ⓦⓦ㎺-㎿㏝Ｗｗ]",X:"[XxˣẊ-ẍₓ℻Ⅸ-Ⅻⅸ-ⅻ⒳Ⓧⓧ㏓Ｘｘ]",Y:"[YyÝýÿŶ-ŸȲȳʸẎẏẙỲ-ỹ⒴Ⓨⓨ㏉Ｙｙ]",Z:"[ZzŹ-žǱ-ǳᶻẐ-ẕℤℨ⒵Ⓩⓩ㎐-㎔Ｚｚ]"};return function(i){function o(t){var r,u,f;return(r=e.exec(t.data))&&(f=n.createElement(i.tagName),i.className&&(f.className=i.className),u=t.splitText(r.index),u.splitText(r[0].length),f.appendChild(u.cloneNode(!0)),t.parentNode.replaceChild(f,u)),!!r}function f(n,t){for(var i,r=0;r<n.childNodes.length;r++)i=n.childNodes[r],i.nodeType===3?r+=t(i)?1:0:f(i,t)}var e;i=t.mixin({},u,i);i.node&&i.pattern&&(i.pattern=t.isArray(i.pattern)?i.pattern:[i.pattern],e=r(i.pattern,i.caseSensitive,i.wordsOnly,i.diacriticInsensitive),f(i.node,o))}}(window.document),u=function(){"use strict";function i(i,r){i=i||{};i.input||n.error("input is missing");r.mixin(this);this.$hint=n(i.hint);this.$input=n(i.input);this.$input.attr({"aria-activedescendant":"","aria-owns":this.$input.attr("id")+"_listbox",role:"combobox","aria-readonly":"true","aria-autocomplete":"list"});n(r.menu).attr("id",this.$input.attr("id")+"_listbox");this.query=this.$input.val();this.queryWhenFocused=this.hasFocus()?this.query:null;this.$overflowHelper=e(this.$input);this._checkLanguageDirection();0===this.$hint.length&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=t.noop);this.onSync("cursorchange",this._updateDescendent)}function e(t){return n('<pre aria-hidden="true"><\/pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:t.css("font-family"),fontSize:t.css("font-size"),fontStyle:t.css("font-style"),fontVariant:t.css("font-variant"),fontWeight:t.css("font-weight"),wordSpacing:t.css("word-spacing"),letterSpacing:t.css("letter-spacing"),textIndent:t.css("text-indent"),textRendering:t.css("text-rendering"),textTransform:t.css("text-transform")}).insertAfter(t)}function o(n,t){return i.normalizeQuery(n)===i.normalizeQuery(t)}function f(n){return n.altKey||n.ctrlKey||n.metaKey||n.shiftKey}var u;return u={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},i.normalizeQuery=function(n){return t.toStr(n).replace(/^\s*/g,"").replace(/\s{2,}/g," ")},t.mixin(i.prototype,r,{_onBlur:function(){this.resetInputValue();this.trigger("blurred")},_onFocus:function(){this.queryWhenFocused=this.query;this.trigger("focused")},_onKeydown:function(n){var t=u[n.which||n.keyCode];this._managePreventDefault(t,n);t&&this._shouldTrigger(t,n)&&this.trigger(t+"Keyed",n)},_onInput:function(){this._setQuery(this.getInputValue());this.clearHintIfInvalid();this._checkLanguageDirection()},_managePreventDefault:function(n,t){var i;switch(n){case"up":case"down":i=!f(t);break;default:i=!1}i&&t.preventDefault()},_shouldTrigger:function(n,t){var i;switch(n){case"tab":i=!f(t);break;default:i=!0}return i},_checkLanguageDirection:function(){var n=(this.$input.css("direction")||"ltr").toLowerCase();this.dir!==n&&(this.dir=n,this.$hint.attr("dir",n),this.trigger("langDirChanged",n))},_setQuery:function(n,t){var i,r;i=o(n,this.query);r=!!i&&this.query.length!==n.length;this.query=n;t||i?!t&&r&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query)},_updateDescendent:function(n,t){this.$input.attr("aria-activedescendant",t)},bind:function(){var n,i,r,f,e=this;return n=t.bind(this._onBlur,this),i=t.bind(this._onFocus,this),r=t.bind(this._onKeydown,this),f=t.bind(this._onInput,this),this.$input.on("blur.tt",n).on("focus.tt",i).on("keydown.tt",r),!t.isMsie()||t.isMsie()>9?this.$input.on("input.tt",f):this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function(n){u[n.which||n.keyCode]||t.defer(t.bind(e._onInput,e,n))}),this},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getLangDir:function(){return this.dir},getQuery:function(){return this.query||""},setQuery:function(n,t){this.setInputValue(n);this._setQuery(n,t)},hasQueryChangedSinceLastFocus:function(){return this.query!==this.queryWhenFocused},getInputValue:function(){return this.$input.val()},setInputValue:function(n){this.$input.val(n);this.clearHintIfInvalid();this._checkLanguageDirection()},resetInputValue:function(){this.setInputValue(this.query)},getHint:function(){return this.$hint.val()},setHint:function(n){this.$hint.val(n)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var n,t,i,r;n=this.getInputValue();t=this.getHint();i=n!==t&&0===t.indexOf(n);r=""!==n&&i&&!this.hasOverflow();!r&&this.clearHint()},hasFocus:function(){return this.$input.is(":focus")},hasOverflow:function(){var n=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=n},isCursorAtEnd:function(){var n,i,r;return n=this.$input.val().length,i=this.$input[0].selectionStart,t.isNumber(i)?i===n:!document.selection||(r=document.selection.createRange(),r.moveStart("character",-n),n===r.text.length)},destroy:function(){this.$hint.off(".tt");this.$input.off(".tt");this.$overflowHelper.remove();this.$hint=this.$input=this.$overflowHelper=n("<div>")}}),i}(),f=function(){"use strict";function u(i,r){i=i||{};i.templates=i.templates||{};i.templates.notFound=i.templates.notFound||i.templates.empty;i.source||n.error("missing source");i.node||n.error("missing node");i.name&&!h(i.name)&&n.error("invalid dataset name: "+i.name);r.mixin(this);this.highlight=!!i.highlight;this.name=t.toStr(i.name||f());this.limit=i.limit||5;this.displayFn=e(i.display||i.displayKey);this.templates=o(i.templates,this.displayFn);this.source=i.source.__ttAdapter?i.source.__ttAdapter():i.source;this.async=t.isUndefined(i.async)?this.source.length>2:!!i.async;this._resetLastSuggestion();this.$el=n(i.node).attr("role","presentation").addClass(this.classes.dataset).addClass(this.classes.dataset+"-"+this.name)}function e(n){function i(t){return t[n]}return n=n||t.stringify,t.isFunction(n)?n:i}function o(i,r){function u(i){return n('<div role="option">').attr("id",t.guid()).text(r(i))}return{notFound:i.notFound&&t.templatify(i.notFound),pending:i.pending&&t.templatify(i.pending),header:i.header&&t.templatify(i.header),footer:i.footer&&t.templatify(i.footer),suggestion:i.suggestion||u}}function h(n){return/^[_a-zA-Z0-9-]+$/.test(n)}var i,f;return i={dataset:"tt-selectable-dataset",val:"tt-selectable-display",obj:"tt-selectable-object"},f=t.getIdGenerator(),u.extractData=function(t){var r=n(t);return r.data(i.obj)?{dataset:r.data(i.dataset)||"",val:r.data(i.val)||"",obj:r.data(i.obj)||null}:null},t.mixin(u.prototype,r,{_overwrite:function(n,t){t=t||[];t.length?this._renderSuggestions(n,t):this.async&&this.templates.pending?this._renderPending(n):!this.async&&this.templates.notFound?this._renderNotFound(n):this._empty();this.trigger("rendered",t,!1,this.name)},_append:function(n,t){t=t||[];t.length&&this.$lastSuggestion.length?this._appendSuggestions(n,t):t.length?this._renderSuggestions(n,t):!this.$lastSuggestion.length&&this.templates.notFound&&this._renderNotFound(n);this.trigger("rendered",t,!0,this.name)},_renderSuggestions:function(n,t){var i;i=this._getSuggestionsFragment(n,t);this.$lastSuggestion=i.children().last();this.$el.html(i).prepend(this._getHeader(n,t)).append(this._getFooter(n,t))},_appendSuggestions:function(n,t){var i,r;i=this._getSuggestionsFragment(n,t);r=i.children().last();this.$lastSuggestion.after(i);this.$lastSuggestion=r},_renderPending:function(n){var t=this.templates.pending;this._resetLastSuggestion();t&&this.$el.html(t({query:n,dataset:this.name}))},_renderNotFound:function(n){var t=this.templates.notFound;this._resetLastSuggestion();t&&this.$el.html(t({query:n,dataset:this.name}))},_empty:function(){this.$el.empty();this._resetLastSuggestion()},_getSuggestionsFragment:function(r,u){var e,f=this;return e=document.createDocumentFragment(),t.each(u,function(t){var u,o;o=f._injectQuery(r,t);u=n(f.templates.suggestion(o)).data(i.dataset,f.name).data(i.obj,t).data(i.val,f.displayFn(t)).addClass(f.classes.suggestion+" "+f.classes.selectable);e.appendChild(u[0])}),this.highlight&&s({className:this.classes.highlight,node:e,pattern:r}),n(e)},_getFooter:function(n,t){return this.templates.footer?this.templates.footer({query:n,suggestions:t,dataset:this.name}):null},_getHeader:function(n,t){return this.templates.header?this.templates.header({query:n,suggestions:t,dataset:this.name}):null},_resetLastSuggestion:function(){this.$lastSuggestion=n()},_injectQuery:function(n,i){return t.isObject(i)?t.mixin({_query:n},i):i},update:function(t){function f(n){u||(u=!0,n=(n||[]).slice(0,i.limit),r=n.length,i._overwrite(t,n),r<i.limit&&i.async&&i.trigger("asyncRequested",t,i.name))}function o(u){if(u=u||[],!e&&r<i.limit){i.cancel=n.noop;var f=Math.abs(r-i.limit);r+=f;i._append(t,u.slice(0,f));i.async&&i.trigger("asyncReceived",t,i.name)}}var i=this,e=!1,u=!1,r=0;this.cancel();this.cancel=function(){e=!0;i.cancel=n.noop;i.async&&i.trigger("asyncCanceled",t,i.name)};this.source(t,f,o);!u&&f([])},cancel:n.noop,clear:function(){this._empty();this.cancel();this.trigger("cleared")},isEmpty:function(){return this.$el.is(":empty")},destroy:function(){this.$el=n("<div>")}}),u}(),i=function(){"use strict";function i(i,r){function e(t){var i=u.$node.find(t.node).first();return t.node=i.length?i:n("<div>").appendTo(u.$node),new f(t,r)}var u=this;i=i||{};i.node||n.error("node is required");r.mixin(this);this.$node=n(i.node);this.query=null;this.datasets=t.map(i.datasets,e)}return t.mixin(i.prototype,r,{_onSelectableClick:function(t){this.trigger("selectableClicked",n(t.currentTarget))},_onRendered:function(n,t,i,r){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty());this.trigger("datasetRendered",t,i,r)},_onCleared:function(){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty());this.trigger("datasetCleared")},_propagate:function(){this.trigger.apply(this,arguments)},_allDatasetsEmpty:function(){return t.every(this.datasets,t.bind(function(n){var t=n.isEmpty();return this.$node.attr("aria-expanded",!t),t},this))},_getSelectables:function(){return this.$node.find(this.selectors.selectable)},_removeCursor:function(){var n=this.getActiveSelectable();n&&n.removeClass(this.classes.cursor)},_ensureVisible:function(n){var t,i,r,u;t=n.position().top;i=t+n.outerHeight(!0);r=this.$node.scrollTop();u=this.$node.height()+parseInt(this.$node.css("paddingTop"),10)+parseInt(this.$node.css("paddingBottom"),10);t<0?this.$node.scrollTop(r+t):u<i&&this.$node.scrollTop(r+(i-u))},bind:function(){var r,i=this;return r=t.bind(this._onSelectableClick,this),this.$node.on("click.tt",this.selectors.selectable,r),this.$node.on("mouseover",this.selectors.selectable,function(){i.setCursor(n(this))}),this.$node.on("mouseleave",function(){i._removeCursor()}),t.each(this.datasets,function(n){n.onSync("asyncRequested",i._propagate,i).onSync("asyncCanceled",i._propagate,i).onSync("asyncReceived",i._propagate,i).onSync("rendered",i._onRendered,i).onSync("cleared",i._onCleared,i)}),this},isOpen:function(){return this.$node.hasClass(this.classes.open)},open:function(){this.$node.scrollTop(0);this.$node.addClass(this.classes.open)},close:function(){this.$node.attr("aria-expanded",!1);this.$node.removeClass(this.classes.open);this._removeCursor()},setLanguageDirection:function(n){this.$node.attr("dir",n)},selectableRelativeToCursor:function(n){var i,r,u,t;return r=this.getActiveSelectable(),i=this._getSelectables(),u=r?i.index(r):-1,t=u+n,t=(t+1)%(i.length+1)-1,t=t<-1?i.length-1:t,t===-1?null:i.eq(t)},setCursor:function(n){this._removeCursor();(n=n&&n.first())&&(n.addClass(this.classes.cursor),this._ensureVisible(n))},getSelectableData:function(n){return n&&n.length?f.extractData(n):null},getActiveSelectable:function(){var n=this._getSelectables().filter(this.selectors.cursor).first();return n.length?n:null},getTopSelectable:function(){var n=this._getSelectables().first();return n.length?n:null},update:function(n){function r(t){t.update(n)}var i=n!==this.query;return i&&(this.query=n,t.each(this.datasets,r)),i},empty:function(){function n(n){n.clear()}t.each(this.datasets,n);this.query=null;this.$node.addClass(this.classes.empty)},destroy:function(){function i(n){n.destroy()}this.$node.off(".tt");this.$node=n("<div>");t.each(this.datasets,i)}}),i}(),h=function(){"use strict";function i(i){this.$el=n("<span><\/span>",{role:"status","aria-live":"polite"}).css({position:"absolute",padding:"0",border:"0",height:"1px",width:"1px","margin-bottom":"-1px","margin-right":"-1px",overflow:"hidden",clip:"rect(0 0 0 0)","white-space":"nowrap"});i.$input.after(this.$el);t.each(i.menu.datasets,t.bind(function(n){n.onSync&&(n.onSync("rendered",t.bind(this.update,this)),n.onSync("cleared",t.bind(this.cleared,this)))},this))}return t.mixin(i.prototype,{update:function(n,t){var i,r=t.length;i=1===r?{result:"result",is:"is"}:{result:"results",is:"are"};this.$el.text(r+" "+i.result+" "+i.is+" available, use up and down arrow keys to navigate.")},cleared:function(){this.$el.text("")}}),i}(),c=function(){"use strict";function r(){i.apply(this,[].slice.call(arguments,0))}var n=i.prototype;return t.mixin(r.prototype,i.prototype,{open:function(){return!this._allDatasetsEmpty()&&this._show(),n.open.apply(this,[].slice.call(arguments,0))},close:function(){return this._hide(),n.close.apply(this,[].slice.call(arguments,0))},_onRendered:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),n._onRendered.apply(this,[].slice.call(arguments,0))},_onCleared:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),n._onCleared.apply(this,[].slice.call(arguments,0))},setLanguageDirection:function(t){return this.$node.css("ltr"===t?this.css.ltr:this.css.rtl),n.setLanguageDirection.apply(this,[].slice.call(arguments,0))},_hide:function(){this.$node.hide()},_show:function(){this.$node.css("display","block")}}),r}(),l=function(){"use strict";function r(r,u){var f,e,o,s,h,c,l,a,v,y,p;r=r||{};r.input||n.error("missing input");r.menu||n.error("missing menu");r.eventBus||n.error("missing event bus");u.mixin(this);this.eventBus=r.eventBus;this.minLength=t.isNumber(r.minLength)?r.minLength:1;this.input=r.input;this.menu=r.menu;this.enabled=!0;this.active=!1;this.input.hasFocus()&&this.activate();this.dir=this.input.getLangDir();this._hacks();this.menu.bind().onSync("selectableClicked",this._onSelectableClicked,this).onSync("asyncRequested",this._onAsyncRequested,this).onSync("asyncCanceled",this._onAsyncCanceled,this).onSync("asyncReceived",this._onAsyncReceived,this).onSync("datasetRendered",this._onDatasetRendered,this).onSync("datasetCleared",this._onDatasetCleared,this);f=i(this,"activate","open","_onFocused");e=i(this,"deactivate","_onBlurred");o=i(this,"isActive","isOpen","_onEnterKeyed");s=i(this,"isActive","isOpen","_onTabKeyed");h=i(this,"isActive","_onEscKeyed");c=i(this,"isActive","open","_onUpKeyed");l=i(this,"isActive","open","_onDownKeyed");a=i(this,"isActive","isOpen","_onLeftKeyed");v=i(this,"isActive","isOpen","_onRightKeyed");y=i(this,"_openIfActive","_onQueryChanged");p=i(this,"_openIfActive","_onWhitespaceChanged");this.input.bind().onSync("focused",f,this).onSync("blurred",e,this).onSync("enterKeyed",o,this).onSync("tabKeyed",s,this).onSync("escKeyed",h,this).onSync("upKeyed",c,this).onSync("downKeyed",l,this).onSync("leftKeyed",a,this).onSync("rightKeyed",v,this).onSync("queryChanged",y,this).onSync("whitespaceChanged",p,this).onSync("langDirChanged",this._onLangDirChanged,this)}function i(n){var i=[].slice.call(arguments,1);return function(){var r=[].slice.call(arguments);t.each(i,function(t){return n[t].apply(n,r)})}}return t.mixin(r.prototype,{_hacks:function(){var r,i;r=this.input.$input||n("<div>");i=this.menu.$node||n("<div>");r.on("blur.tt",function(n){var u,f,e;u=document.activeElement;f=i.is(u);e=i.has(u).length>0;t.isMsie()&&(f||e)&&(n.preventDefault(),n.stopImmediatePropagation(),t.defer(function(){r.focus()}))});i.on("mousedown.tt",function(n){n.preventDefault()})},_onSelectableClicked:function(n,t){this.select(t)},_onDatasetCleared:function(){this._updateHint()},_onDatasetRendered:function(n,t,i,r){this._updateHint();this.eventBus.trigger("render",t,i,r)},_onAsyncRequested:function(n,t,i){this.eventBus.trigger("asyncrequest",i,t)},_onAsyncCanceled:function(n,t,i){this.eventBus.trigger("asynccancel",i,t)},_onAsyncReceived:function(n,t,i){this.eventBus.trigger("asyncreceive",i,t)},_onFocused:function(){this._minLengthMet()&&this.menu.update(this.input.getQuery())},_onBlurred:function(){this.input.hasQueryChangedSinceLastFocus()&&this.eventBus.trigger("change",this.input.getQuery())},_onEnterKeyed:function(n,t){var i;(i=this.menu.getActiveSelectable())&&this.select(i)&&(t.preventDefault(),t.stopPropagation())},_onTabKeyed:function(n,t){var i;(i=this.menu.getActiveSelectable())?this.select(i)&&t.preventDefault():(i=this.menu.getTopSelectable())&&this.autocomplete(i)&&t.preventDefault()},_onEscKeyed:function(){this.close()},_onUpKeyed:function(){this.moveCursor(-1)},_onDownKeyed:function(){this.moveCursor(1)},_onLeftKeyed:function(){"rtl"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getActiveSelectable()||this.menu.getTopSelectable())},_onRightKeyed:function(){"ltr"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getActiveSelectable()||this.menu.getTopSelectable())},_onQueryChanged:function(n,t){this._minLengthMet(t)?this.menu.update(t):this.menu.empty()},_onWhitespaceChanged:function(){this._updateHint()},_onLangDirChanged:function(n,t){this.dir!==t&&(this.dir=t,this.menu.setLanguageDirection(t))},_openIfActive:function(){this.isActive()&&this.open()},_minLengthMet:function(n){return n=t.isString(n)?n:this.input.getQuery()||"",n.length>=this.minLength},_updateHint:function(){var f,i,n,e,o,s,r;f=this.menu.getTopSelectable();i=this.menu.getSelectableData(f);n=this.input.getInputValue();!i||t.isBlankString(n)||this.input.hasOverflow()?this.input.clearHint():(e=u.normalizeQuery(n),o=t.escapeRegExChars(e),s=new RegExp("^(?:"+o+")(.+$)","i"),r=s.exec(i.val),r&&this.input.setHint(n+r[1]))},isEnabled:function(){return this.enabled},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},isActive:function(){return this.active},activate:function(){return!!this.isActive()||!(!this.isEnabled()||this.eventBus.before("active"))&&(this.active=!0,this.eventBus.trigger("active"),!0)},deactivate:function(){return!this.isActive()||!this.eventBus.before("idle")&&(this.active=!1,this.close(),this.eventBus.trigger("idle"),!0)},isOpen:function(){return this.menu.isOpen()},open:function(){return this.isOpen()||this.eventBus.before("open")||(this.menu.open(),this._updateHint(),this.eventBus.trigger("open")),this.isOpen()},close:function(){return this.isOpen()&&!this.eventBus.before("close")&&(this.menu.close(),this.input.clearHint(),this.input.resetInputValue(),this.eventBus.trigger("close")),!this.isOpen()},setVal:function(n){this.input.setQuery(t.toStr(n))},getVal:function(){return this.input.getQuery()},select:function(n){var t=this.menu.getSelectableData(n);return!(!t||this.eventBus.before("select",t.obj,t.dataset))&&(this.input.setQuery(t.val,!0),this.eventBus.trigger("select",t.obj,t.dataset),this.close(),!0)},autocomplete:function(n){var i,t,r;return i=this.input.getQuery(),t=this.menu.getSelectableData(n),r=t&&i!==t.val,!(!r||this.eventBus.before("autocomplete",t.obj,t.dataset))&&(this.input.setQuery(t.val),this.eventBus.trigger("autocomplete",t.obj,t.dataset),!0)},moveCursor:function(n){var f,i,t,r,u,e,o;return f=this.input.getQuery(),i=this.menu.selectableRelativeToCursor(n),t=this.menu.getSelectableData(i),r=t?t.obj:null,u=t?t.dataset:null,o=i?i.attr("id"):null,this.input.trigger("cursorchange",o),e=this._minLengthMet()&&this.menu.update(f),!e&&!this.eventBus.before("cursorchange",r,u)&&(this.menu.setCursor(i),t?this.input.setInputValue(t.val):(this.input.resetInputValue(),this._updateHint()),this.eventBus.trigger("cursorchange",r,u),!0)},destroy:function(){this.input.destroy();this.menu.destroy()}}),r}();!function(){"use strict";function r(t,i){t.each(function(){var t,r=n(this);(t=r.data(f.typeahead))&&i(t,r)})}function y(n,t){return n.clone().addClass(t.classes.hint).removeData().css(t.css.hint).css(w(n)).prop("readonly",!0).removeAttr("id name placeholder required").attr({spellcheck:"false",tabindex:-1})}function p(n,t){n.data(f.attrs,{dir:n.attr("dir"),autocomplete:n.attr("autocomplete"),spellcheck:n.attr("spellcheck"),style:n.attr("style")});n.addClass(t.classes.input).attr({spellcheck:!1});try{n.attr("dir")||n.attr("dir","auto")}catch(n){}return n}function w(n){return{backgroundAttachment:n.css("background-attachment"),backgroundClip:n.css("background-clip"),backgroundColor:n.css("background-color"),backgroundImage:n.css("background-image"),backgroundOrigin:n.css("background-origin"),backgroundPosition:n.css("background-position"),backgroundRepeat:n.css("background-repeat"),backgroundSize:n.css("background-size")}}function b(n){var r,i;r=n.data(f.www);i=n.parent().filter(r.selectors.wrapper);t.each(n.data(f.attrs),function(i,r){t.isUndefined(i)?n.removeAttr(r):n.attr(r,i)});n.removeData(f.typeahead).removeData(f.www).removeData(f.attr).removeClass(r.classes.input);i.length&&(n.detach().insertAfter(i),i.remove())}function a(i){var u,r;return u=t.isJQuery(i)||t.isElement(i),r=u?n(i).first():[],r.length?r:null}var v,f,s;v=n.fn.typeahead;f={www:"tt-www",attrs:"tt-attrs",typeahead:"tt-typeahead"};s={initialize:function(r,s){function w(){var e,g,w,b,k,d,tt,it,nt,ft,rt,ut;t.each(s,function(n){n.highlight=!!r.highlight});e=n(this);g=n(v.html.wrapper);w=a(r.hint);b=a(r.menu);k=r.hint!==!1&&!w;d=r.menu!==!1&&!b;k&&(w=y(e,v));d&&(b=n(v.html.menu).css(v.css.menu));w&&w.val("");e=p(e,v);(k||d)&&(g.css(v.css.wrapper),e.css(k?v.css.input:v.css.inputWithNoHint),e.wrap(g).parent().prepend(k?w:null).append(d?b:null));ut=d?c:i;tt=new o({el:e});it=new u({hint:w,input:e},v);nt=new ut({node:b,datasets:s},v);ft=new h({$input:e,menu:nt});rt=new l({input:it,menu:nt,eventBus:tt,minLength:r.minLength},v);e.data(f.www,v);e.data(f.typeahead,rt)}var v;return s=t.isArray(s)?s:[].slice.call(arguments,1),r=r||{},v=e(r.classNames),this.each(w)},isEnabled:function(){var n;return r(this.first(),function(t){n=t.isEnabled()}),n},enable:function(){return r(this,function(n){n.enable()}),this},disable:function(){return r(this,function(n){n.disable()}),this},isActive:function(){var n;return r(this.first(),function(t){n=t.isActive()}),n},activate:function(){return r(this,function(n){n.activate()}),this},deactivate:function(){return r(this,function(n){n.deactivate()}),this},isOpen:function(){var n;return r(this.first(),function(t){n=t.isOpen()}),n},open:function(){return r(this,function(n){n.open()}),this},close:function(){return r(this,function(n){n.close()}),this},select:function(t){var i=!1,u=n(t);return r(this.first(),function(n){i=n.select(u)}),i},autocomplete:function(t){var i=!1,u=n(t);return r(this.first(),function(n){i=n.autocomplete(u)}),i},moveCursor:function(n){var t=!1;return r(this.first(),function(i){t=i.moveCursor(n)}),t},val:function(n){var i;return arguments.length?(r(this,function(i){i.setVal(t.toStr(n))}),this):(r(this.first(),function(n){i=n.getVal()}),i)},destroy:function(){return r(this,function(n,t){b(t);n.destroy()}),this}};n.fn.typeahead=function(n){return s[n]?s[n].apply(this,[].slice.call(arguments,1)):s.initialize.apply(this,arguments)};n.fn.typeahead.noConflict=function(){return n.fn.typeahead=v,this}}()}),function(n){"use strict";function i(t,i){this.itemsArray=[];this.$element=n(t);this.$element.hide();this.isSelect=t.tagName==="SELECT";this.multiple=this.isSelect&&t.hasAttribute("multiple");this.objectItems=i&&i.itemValue;this.placeholderText=t.hasAttribute("placeholder")?this.$element.attr("placeholder"):"";this.inputSize=Math.max(1,this.placeholderText.length);this.$container=n('<div class="bootstrap-tagsinput"><\/div>');this.$input=n('<input type="text" placeholder="'+this.placeholderText+'"/>').appendTo(this.$container);this.$element.before(this.$container);this.build(i)}function u(n,t){if(typeof n[t]!="function"){var i=n[t];n[t]=function(n){return n[i]}}}function f(n,t){if(typeof n[t]!="function"){var i=n[t];n[t]=function(){return i}}}function t(n){return n?e.text(n).html():""}function o(n){var t=0,i;return document.selection?(n.focus(),i=document.selection.createRange(),i.moveStart("character",-n.value.length),t=i.text.length):(n.selectionStart||n.selectionStart=="0")&&(t=n.selectionStart),t}function s(t,i){var r=!1;return n.each(i,function(n,i){if(typeof i=="number"&&t.which===i)return r=!0,!1;if(t.which===i.which){var u=!i.hasOwnProperty("altKey")||t.altKey===i.altKey,f=!i.hasOwnProperty("shiftKey")||t.shiftKey===i.shiftKey,e=!i.hasOwnProperty("ctrlKey")||t.ctrlKey===i.ctrlKey;if(u&&f&&e)return r=!0,!1}}),r}var r={tagClass:function(){return"label label-info"},itemValue:function(n){return n?n.toString():n},itemText:function(n){return this.itemValue(n)},itemTitle:function(){return null},freeInput:!0,addOnBlur:!0,maxTags:undefined,maxChars:undefined,confirmKeys:[13,44],delimiter:",",delimiterRegex:null,cancelConfirmKeysOnEmpty:!0,onTagExists:function(n,t){t.hide().fadeIn()},trimValue:!1,allowDuplicates:!1},e;i.prototype={constructor:i,add:function(i,r,u){var f=this,a,e,o,w,l,s,h;if((!f.options.maxTags||!(f.itemsArray.length>=f.options.maxTags))&&(i===!1||i)){if(typeof i=="string"&&f.options.trimValue&&(i=n.trim(i)),typeof i=="object"&&!f.objectItems)throw"Can't add objects when itemValue option is not set";if(!i.toString().match(/^\s*$/)){if(f.isSelect&&!f.multiple&&f.itemsArray.length>0&&f.remove(f.itemsArray[0]),typeof i=="string"&&this.$element[0].tagName==="INPUT"&&(a=f.options.delimiterRegex?f.options.delimiterRegex:f.options.delimiter,e=i.split(a),e.length>1)){for(o=0;o<e.length;o++)this.add(e[o],!0);r||f.pushVal();return}var c=f.options.itemValue(i),v=f.options.itemText(i),b=f.options.tagClass(i),y=f.options.itemTitle(i),p=n.grep(f.itemsArray,function(n){return f.options.itemValue(n)===c})[0];if(p&&!f.options.allowDuplicates){if(f.options.onTagExists){w=n(".tag",f.$container).filter(function(){return n(this).data("item")===p});f.options.onTagExists(i,w)}return}f.items().toString().length+i.length+1>f.options.maxInputLength||(l=n.Event("beforeItemAdd",{item:i,cancel:!1,options:u}),f.$element.trigger(l),l.cancel)||(f.itemsArray.push(i),s=n('<span class="tag '+t(b)+(y!==null?'" title="'+y:"")+'">'+t(v)+'<span data-role="remove"><\/span><\/span>'),s.data("item",i),f.findInputWrapper().before(s),s.after(" "),f.isSelect&&!n('option[value="'+encodeURIComponent(c)+'"]',f.$element)[0]&&(h=n("<option selected>"+t(v)+"<\/option>"),h.data("item",i),h.attr("value",c),f.$element.append(h)),r||f.pushVal(),(f.options.maxTags===f.itemsArray.length||f.items().toString().length===f.options.maxInputLength)&&f.$container.addClass("bootstrap-tagsinput-max"),f.$element.trigger(n.Event("itemAdded",{item:i,options:u})))}}},remove:function(t,i,r){var u=this,f;if(u.objectItems&&(t=typeof t=="object"?n.grep(u.itemsArray,function(n){return u.options.itemValue(n)==u.options.itemValue(t)}):n.grep(u.itemsArray,function(n){return u.options.itemValue(n)==t}),t=t[t.length-1]),t){if(f=n.Event("beforeItemRemove",{item:t,cancel:!1,options:r}),u.$element.trigger(f),f.cancel)return;n(".tag",u.$container).filter(function(){return n(this).data("item")===t}).remove();n("option",u.$element).filter(function(){return n(this).data("item")===t}).remove();n.inArray(t,u.itemsArray)!==-1&&u.itemsArray.splice(n.inArray(t,u.itemsArray),1)}i||u.pushVal();u.options.maxTags>u.itemsArray.length&&u.$container.removeClass("bootstrap-tagsinput-max");u.$element.trigger(n.Event("itemRemoved",{item:t,options:r}))},removeAll:function(){var t=this;for(n(".tag",t.$container).remove(),n("option",t.$element).remove();t.itemsArray.length>0;)t.itemsArray.pop();t.pushVal()},refresh:function(){var i=this;n(".tag",i.$container).each(function(){var r=n(this),u=r.data("item"),e=i.options.itemValue(u),o=i.options.itemText(u),s=i.options.tagClass(u),f;r.attr("class",null);r.addClass("tag "+t(s));r.contents().filter(function(){return this.nodeType==3})[0].nodeValue=t(o);i.isSelect&&(f=n("option",i.$element).filter(function(){return n(this).data("item")===u}),f.attr("value",e))})},items:function(){return this.itemsArray},pushVal:function(){var t=this,i=n.map(t.items(),function(n){return t.options.itemValue(n).toString()});t.$element.val(i,!0).trigger("change")},build:function(t){var i=this,h;if(i.options=n.extend({},r,t),i.objectItems&&(i.options.freeInput=!1),u(i.options,"itemValue"),u(i.options,"itemText"),f(i.options,"tagClass"),i.options.typeahead&&(h=i.options.typeahead||{},f(h,"source"),i.$input.typeahead(n.extend({},h,{source:function(t,r){function f(n){for(var u,f=[],t=0;t<n.length;t++)u=i.options.itemText(n[t]),e[u]=n[t],f.push(u);r(f)}this.map={};var e=this.map,u=h.source(t);n.isFunction(u.success)?u.success(f):n.isFunction(u.then)?u.then(f):n.when(u).then(f)},updater:function(n){return i.add(this.map[n]),this.map[n]},matcher:function(n){return n.toLowerCase().indexOf(this.query.trim().toLowerCase())!==-1},sorter:function(n){return n.sort()},highlighter:function(n){var t=new RegExp("("+this.query+")","gi");return n.replace(t,"<strong>$1<\/strong>")}}))),i.options.typeaheadjs){var l=null,e={},c=i.options.typeaheadjs;n.isArray(c)?(l=c[0],e=c[1]):e=c;i.$input.typeahead(l,e).on("typeahead:selected",n.proxy(function(n,t){e.valueKey?i.add(t[e.valueKey]):i.add(t);i.$input.typeahead("val","")},i))}i.$container.on("click",n.proxy(function(){i.$element.attr("disabled")||i.$input.removeAttr("disabled");i.$input.focus()},i));if(i.options.addOnBlur&&i.options.freeInput)i.$input.on("focusout",n.proxy(function(){n(".typeahead, .twitter-typeahead",i.$container).length===0&&(i.add(i.$input.val()),i.$input.val(""))},i));i.$container.on("keydown","input",n.proxy(function(t){var r=n(t.target),u=i.findInputWrapper(),f,e,s,h;if(i.$element.attr("disabled")){i.$input.attr("disabled","disabled");return}switch(t.which){case 8:o(r[0])===0&&(f=u.prev(),f.length&&i.remove(f.data("item")));break;case 46:o(r[0])===0&&(e=u.next(),e.length&&i.remove(e.data("item")));break;case 37:s=u.prev();r.val().length===0&&s[0]&&(s.before(u),r.focus());break;case 39:h=u.next();r.val().length===0&&h[0]&&(h.after(u),r.focus())}var c=r.val().length,l=Math.ceil(c/5),a=c+l+1;r.attr("size",Math.max(this.inputSize,r.val().length))},i));i.$container.on("keypress","input",n.proxy(function(t){var r=n(t.target),u,f;if(i.$element.attr("disabled")){i.$input.attr("disabled","disabled");return}u=r.val();f=i.options.maxChars&&u.length>=i.options.maxChars;i.options.freeInput&&(s(t,i.options.confirmKeys)||f)&&(u.length!==0&&(i.add(f?u.substr(0,i.options.maxChars):u),r.val("")),i.options.cancelConfirmKeysOnEmpty===!1&&t.preventDefault());var e=r.val().length,o=Math.ceil(e/5),h=e+o+1;r.attr("size",Math.max(this.inputSize,r.val().length))},i));i.$container.on("click","[data-role=remove]",n.proxy(function(t){i.$element.attr("disabled")||i.remove(n(t.target).closest(".tag").data("item"))},i));i.options.itemValue===r.itemValue&&(i.$element[0].tagName==="INPUT"?i.add(i.$element.val()):n("option",i.$element).each(function(){i.add(n(this).attr("value"),!0)}))},destroy:function(){var n=this;n.$container.off("keypress","input");n.$container.off("click","[role=remove]");n.$container.remove();n.$element.removeData("tagsinput");n.$element.show()},focus:function(){this.$input.focus()},input:function(){return this.$input},findInputWrapper:function(){for(var t=this.$input[0],i=this.$container[0];t&&t.parentNode!==i;)t=t.parentNode;return n(t)}};n.fn.tagsinput=function(t,r,u){var f=[];return this.each(function(){var e=n(this).data("tagsinput"),o;e?t||r?e[t]!==undefined&&(o=e[t].length===3&&u!==undefined?e[t](r,null,u):e[t](r),o!==undefined&&f.push(o)):f.push(e):(e=new i(this,t),n(this).data("tagsinput",e),f.push(e),this.tagName==="SELECT"&&n("option",n(this)).attr("selected","selected"),n(this).val(n(this).val()))}),typeof t=="string"?f.length>1?f:f[0]:f};n.fn.tagsinput.Constructor=i;e=n("<div />");n(function(){n("input[data-role=tagsinput], select[multiple][data-role=tagsinput]").tagsinput()})}(window.jQuery);!function(n,t){"function"==typeof define&&define.amd?define(["jquery"],function(i){return n.Bloodhound=t(i)}):"object"==typeof exports?module.exports=t(require("jquery")):n.Bloodhound=t(n.jQuery)}(this,function(n){var t=function(){"use strict";return{isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},isBlankString:function(n){return!n||/^\s*$/.test(n)},escapeRegExChars:function(n){return n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(n){return"string"==typeof n},isNumber:function(n){return"number"==typeof n},isArray:n.isArray,isFunction:n.isFunction,isObject:n.isPlainObject,isUndefined:function(n){return"undefined"==typeof n},isElement:function(n){return!(!n||1!==n.nodeType)},isJQuery:function(t){return t instanceof n},toStr:function(n){return t.isUndefined(n)||null===n?"":n+""},bind:n.proxy,each:function(t,i){function r(n,t){return i(t,n)}n.each(t,r)},map:n.map,filter:n.grep,every:function(t,i){var r=!0;return t?(n.each(t,function(n,u){if(!(r=i.call(null,u,n,t)))return!1}),!!r):r},some:function(t,i){var r=!1;return t?(n.each(t,function(n,u){if(r=i.call(null,u,n,t))return!1}),!!r):r},mixin:n.extend,identity:function(n){return n},clone:function(t){return n.extend(!0,{},t)},getIdGenerator:function(){var n=0;return function(){return n++}},templatify:function(t){function i(){return String(t)}return n.isFunction(t)?t:i},defer:function(n){setTimeout(n,0)},debounce:function(n,t,i){var r,u;return function(){var f,e,o=this,s=arguments;return f=function(){r=null;i||(u=n.apply(o,s))},e=i&&!r,clearTimeout(r),r=setTimeout(f,t),e&&(u=n.apply(o,s)),u}},throttle:function(n,t){var u,f,i,e,r,o;return r=0,o=function(){r=new Date;i=null;e=n.apply(u,f)},function(){var s=new Date,h=t-(s-r);return u=this,f=arguments,h<=0?(clearTimeout(i),i=null,r=s,e=n.apply(u,f)):i||(i=setTimeout(o,h)),e}},stringify:function(n){return t.isString(n)?n:JSON.stringify(n)},guid:function(){function n(n){var t=(Math.random().toString(16)+"000000000").substr(2,8);return n?"-"+t.substr(0,4)+"-"+t.substr(4,4):t}return"tt-"+n()+n(!0)+n(!0)+n()},noop:function(){}}}(),u="1.1.1",f=function(){"use strict";function i(n){return n=t.toStr(n),n?n.split(/\s+/):[]}function r(n){return n=t.toStr(n),n?n.split(/\W+/):[]}function u(n){n=t.toStr(n);var r=[],i="";return t.each(n.split(""),function(n){n.match(/\s+/)?i="":(r.push(i+n),i+=n)}),r}function n(n){return function(i){return i=t.isArray(i)?i:[].slice.call(arguments,0),function(r){var u=[];return t.each(i,function(i){u=u.concat(n(t.toStr(r[i])))}),u}}}return{nonword:r,whitespace:i,ngram:u,obj:{nonword:n(r),whitespace:n(i),ngram:n(u)}}}(),i=function(){"use strict";function i(i){this.maxSize=t.isNumber(i)?i:100;this.reset();this.maxSize<=0&&(this.set=this.get=n.noop)}function r(){this.head=this.tail=null}function u(n,t){this.key=n;this.val=t;this.prev=this.next=null}return t.mixin(i.prototype,{set:function(n,t){var i,r=this.list.tail;this.size>=this.maxSize&&(this.list.remove(r),delete this.hash[r.key],this.size--);(i=this.hash[n])?(i.val=t,this.list.moveToFront(i)):(i=new u(n,t),this.list.add(i),this.hash[n]=i,this.size++)},get:function(n){var t=this.hash[n];if(t)return this.list.moveToFront(t),t.val},reset:function(){this.size=0;this.hash={};this.list=new r}}),t.mixin(r.prototype,{add:function(n){this.head&&(n.next=this.head,this.head.prev=n);this.head=n;this.tail=this.tail||n},remove:function(n){n.prev?n.prev.next=n.next:this.head=n.next;n.next?n.next.prev=n.prev:this.tail=n.prev},moveToFront:function(n){this.remove(n);this.add(n)}}),i}(),e=function(){"use strict";function r(n,r){this.prefix=["__",n,"__"].join("");this.ttlKey="__ttl__";this.keyMatcher=new RegExp("^"+t.escapeRegExChars(this.prefix));this.ls=r||i;!this.ls&&this._noop()}function u(){return(new Date).getTime()}function f(n){return JSON.stringify(t.isUndefined(n)?null:n)}function e(t){return n.parseJSON(t)}function o(n){for(var r,u=[],f=i.length,t=0;t<f;t++)(r=i.key(t)).match(n)&&u.push(r.replace(n,""));return u}var i;try{i=window.localStorage;i.setItem("~~~","!");i.removeItem("~~~")}catch(n){i=null}return t.mixin(r.prototype,{_prefix:function(n){return this.prefix+n},_ttlKey:function(n){return this._prefix(n)+this.ttlKey},_noop:function(){this.get=this.set=this.remove=this.clear=this.isExpired=t.noop},_safeSet:function(n,t){try{this.ls.setItem(n,t)}catch(n){"QuotaExceededError"===n.name&&(this.clear(),this._noop())}},get:function(n){return this.isExpired(n)&&this.remove(n),e(this.ls.getItem(this._prefix(n)))},set:function(n,i,r){return t.isNumber(r)?this._safeSet(this._ttlKey(n),f(u()+r)):this.ls.removeItem(this._ttlKey(n)),this._safeSet(this._prefix(n),f(i))},remove:function(n){return this.ls.removeItem(this._ttlKey(n)),this.ls.removeItem(this._prefix(n)),this},clear:function(){for(var t=o(this.keyMatcher),n=t.length;n--;)this.remove(t[n]);return this},isExpired:function(n){var i=e(this.ls.getItem(this._ttlKey(n)));return!!(t.isNumber(i)&&u()>i)}}),r}(),r=function(){"use strict";function r(n){n=n||{};this.maxPendingRequests=n.maxPendingRequests||6;this.cancelled=!1;this.lastReq=null;this._send=n.transport;this._get=n.limiter?n.limiter(this._get):this._get;this._cache=n.cache===!1?new i(0):e}var u=0,f={},e=new i(10);return r.setMaxPendingRequests=function(n){this.maxPendingRequests=n},r.resetCache=function(){e.reset()},t.mixin(r.prototype,{_fingerprint:function(t){return t=t||{},t.url+t.type+n.param(t.data||{})},_get:function(n,t){function e(n){t(null,n);r._cache.set(i,n)}function o(){t(!0)}function h(){u--;delete f[i];r.onDeckRequestArgs&&(r._get.apply(r,r.onDeckRequestArgs),r.onDeckRequestArgs=null)}var i,s,r=this;i=this._fingerprint(n);this.cancelled||i!==this.lastReq||((s=f[i])?s.done(e).fail(o):u<this.maxPendingRequests?(u++,f[i]=this._send(n).done(e).fail(o).always(h)):this.onDeckRequestArgs=[].slice.call(arguments,0))},get:function(i,r){var f,u;r=r||n.noop;i=t.isString(i)?{url:i}:i||{};u=this._fingerprint(i);this.cancelled=!1;this.lastReq=u;(f=this._cache.get(u))?r(null,f):this._get(i,r)},cancel:function(){this.cancelled=!0}}),r}(),o=window.SearchIndex=function(){"use strict";function u(i){i=i||{};i.datumTokenizer&&i.queryTokenizer||n.error("datumTokenizer and queryTokenizer are both required");this.identify=i.identify||t.stringify;this.datumTokenizer=i.datumTokenizer;this.queryTokenizer=i.queryTokenizer;this.matchAnyQueryToken=i.matchAnyQueryToken;this.reset()}function f(n){return n=t.filter(n,function(n){return!!n}),n=t.map(n,function(n){return n.toLowerCase()})}function e(){var n={};return n[r]=[],n[i]={},n}function o(n){for(var i={},r=[],t=0,u=n.length;t<u;t++)i[n[t]]||(i[n[t]]=!0,r.push(n[t]));return r}function s(n,t){var i=0,r=0,u=[],f,e;for(n=n.sort(),t=t.sort(),f=n.length,e=t.length;i<f&&r<e;)n[i]<t[r]?i++:n[i]>t[r]?r++:(u.push(n[i]),i++,r++);return u}var i="c",r="i";return t.mixin(u.prototype,{bootstrap:function(n){this.datums=n.datums;this.trie=n.trie},add:function(n){var u=this;n=t.isArray(n)?n:[n];t.each(n,function(n){var o,s;u.datums[o=u.identify(n)]=n;s=f(u.datumTokenizer(n));t.each(s,function(n){for(var f,t=u.trie,s=n.split("");f=s.shift();)t=t[i][f]||(t[i][f]=e()),t[r].push(o)})})},get:function(n){var i=this;return t.map(n,function(n){return i.datums[n]})},search:function(n){var h,u,e=this;return h=f(this.queryTokenizer(n)),t.each(h,function(n){var t,f,h,o;if(u&&0===u.length&&!e.matchAnyQueryToken)return!1;for(t=e.trie,f=n.split("");t&&(h=f.shift());)t=t[i][h];if(t&&0===f.length)o=t[r].slice(0),u=u?s(u,o):o;else if(!e.matchAnyQueryToken)return u=[],!1}),u?t.map(o(u),function(n){return e.datums[n]}):[]},all:function(){var n=[];for(var t in this.datums)n.push(this.datums[t]);return n},reset:function(){this.datums={};this.trie=e()},serialize:function(){return{datums:this.datums,trie:this.trie}}}),u}(),s=function(){"use strict";function i(n){this.url=n.url;this.ttl=n.ttl;this.cache=n.cache;this.prepare=n.prepare;this.transform=n.transform;this.transport=n.transport;this.thumbprint=n.thumbprint;this.storage=new e(n.cacheKey)}var n;return n={data:"data",protocol:"protocol",thumbprint:"thumbprint"},t.mixin(i.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},store:function(t){this.cache&&(this.storage.set(n.data,t,this.ttl),this.storage.set(n.protocol,location.protocol,this.ttl),this.storage.set(n.thumbprint,this.thumbprint,this.ttl))},fromCache:function(){var i,t={};return this.cache?(t.data=this.storage.get(n.data),t.protocol=this.storage.get(n.protocol),t.thumbprint=this.storage.get(n.thumbprint),i=t.thumbprint!==this.thumbprint||t.protocol!==location.protocol,t.data&&!i?t.data:null):null},fromNetwork:function(n){function i(){n(!0)}function r(t){n(null,u.transform(t))}var t,u=this;n&&(t=this.prepare(this._settings()),this.transport(t).fail(i).done(r))},clear:function(){return this.storage.clear(),this}}),i}(),h=function(){"use strict";function n(n){this.url=n.url;this.prepare=n.prepare;this.transform=n.transform;this.indexResponse=n.indexResponse;this.transport=new r({cache:n.cache,limiter:n.limiter,transport:n.transport,maxPendingRequests:n.maxPendingRequests})}return t.mixin(n.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},get:function(n,t){function r(n,i){t(n?[]:u.transform(i))}var i,u=this;if(t)return n=n||"",i=this.prepare(n,this._settings()),this.transport.get(i,r)},cancelLastRequest:function(){this.transport.cancel()}}),n}(),c=function(){"use strict";function r(r){var f;return r?(f={url:null,ttl:864e5,cache:!0,cacheKey:null,thumbprint:"",prepare:t.identity,transform:t.identity,transport:null},r=t.isString(r)?{url:r}:r,r=t.mixin(f,r),!r.url&&n.error("prefetch requires url to be set"),r.transform=r.filter||r.transform,r.cacheKey=r.cacheKey||r.url,r.thumbprint=u+r.thumbprint,r.transport=r.transport?i(r.transport):n.ajax,r):null}function f(r){var u;if(r)return u={url:null,cache:!0,prepare:null,replace:null,wildcard:null,limiter:null,rateLimitBy:"debounce",rateLimitWait:300,transform:t.identity,transport:null},r=t.isString(r)?{url:r}:r,r=t.mixin(u,r),!r.url&&n.error("remote requires url to be set"),r.transform=r.filter||r.transform,r.prepare=e(r),r.limiter=o(r),r.transport=r.transport?i(r.transport):n.ajax,delete r.replace,delete r.wildcard,delete r.rateLimitBy,delete r.rateLimitWait,r}function e(n){function u(n,t){return t.url=i(t.url,n),t}function f(n,t){return t.url=t.url.replace(r,encodeURIComponent(n)),t}function e(n,t){return t}var t,i,r;return t=n.prepare,i=n.replace,r=n.wildcard,t?t:t=i?u:n.wildcard?f:e}function o(n){function f(n){return function(i){return t.debounce(i,n)}}function e(n){return function(i){return t.throttle(i,n)}}var i,u,r;return i=n.limiter,u=n.rateLimitBy,r=n.rateLimitWait,i||(i=/^throttle$/i.test(u)?e(r):f(r)),i}function i(i){return function(r){function f(n){t.defer(function(){u.resolve(n)})}function e(n){t.defer(function(){u.reject(n)})}var u=n.Deferred();return i(r,f,e),u}}return function(i){var e,u;return e={initialize:!0,identify:t.stringify,datumTokenizer:null,queryTokenizer:null,matchAnyQueryToken:!1,sufficient:5,indexRemote:!1,sorter:null,local:[],prefetch:null,remote:null},i=t.mixin(e,i||{}),!i.datumTokenizer&&n.error("datumTokenizer is required"),!i.queryTokenizer&&n.error("queryTokenizer is required"),u=i.sorter,i.sorter=u?function(n){return n.sort(u)}:t.identity,i.local=t.isFunction(i.local)?i.local():i.local,i.prefetch=r(i.prefetch),i.remote=f(i.remote),i}}();return function(){"use strict";function i(n){n=c(n);this.sorter=n.sorter;this.identify=n.identify;this.sufficient=n.sufficient;this.indexRemote=n.indexRemote;this.local=n.local;this.remote=n.remote?new h(n.remote):null;this.prefetch=n.prefetch?new s(n.prefetch):null;this.index=new o({identify:this.identify,datumTokenizer:n.datumTokenizer,queryTokenizer:n.queryTokenizer});n.initialize!==!1&&this.initialize()}var u;return u=window&&window.Bloodhound,i.noConflict=function(){return window&&(window.Bloodhound=u),i},i.tokenizers=f,t.mixin(i.prototype,{__ttAdapter:function(){function t(t,i,r){return n.search(t,i,r)}function i(t,i){return n.search(t,i)}var n=this;return this.remote?t:i},_loadPrefetch:function(){function u(n,r){return n?t.reject():(i.add(r),i.prefetch.store(i.index.serialize()),void t.resolve())}var t,r,i=this;return t=n.Deferred(),this.prefetch?(r=this.prefetch.fromCache())?(this.index.bootstrap(r),t.resolve()):this.prefetch.fromNetwork(u):t.resolve(),t.promise()},_initialize:function(){function t(){n.add(n.local)}var n=this;return this.clear(),(this.initPromise=this._loadPrefetch()).done(t),this.initPromise},initialize:function(n){return!this.initPromise||n?this._initialize():this.initPromise},add:function(n){return this.index.add(n),this},get:function(n){return n=t.isArray(n)?n:[].slice.call(arguments),this.index.get(n)},search:function(n,i,r){function e(n){var i=[];t.each(n,function(n){t.some(u,function(t){return f.identify(n)===f.identify(t)})||i.push(n)});f.indexRemote&&f.add(i);r(i)}var u,f=this;return i=i||t.noop,r=r||t.noop,u=this.sorter(this.index.search(n)),i(this.remote?u.slice():u),this.remote&&u.length<this.sufficient?this.remote.get(n,e):this.remote&&this.remote.cancelLastRequest(),this},all:function(){return this.index.all()},clear:function(){return this.index.reset(),this},clearPrefetchCache:function(){return this.prefetch&&this.prefetch.clear(),this},clearRemoteCache:function(){return r.resetCache(),this},ttAdapter:function(){return this.__ttAdapter()}}),i}()});!function(){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n};!function(t){function y(n,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=Object.create(n.prototype);for(var u in r)i[u]=r[u];return i.constructor=t,t.prototype=i,t}function iu(n){n=n||{};this.defaultProtocol=n.defaultProtocol||h.defaultProtocol;this.events=n.events||h.events;this.format=n.format||h.format;this.formatHref=n.formatHref||h.formatHref;this.nl2br=n.nl2br||h.nl2br;this.tagName=n.tagName||h.tagName;this.target=n.target||h.target;this.validate=n.validate||h.validate;this.ignoreTags=[];this.attributes=n.attributes||n.linkAttributes||h.attributes;this.className=n.className||n.linkClass||h.className;for(var i=n.ignoreTags||h.ignoreTags,t=0;t<i.length;t++)this.ignoreTags.push(i[t].toUpperCase())}function ff(n,t){for(var i=0;i<n.length;i++)if(n[i]===t)return!0;return!1}function ru(n){return n}function ef(n,t){return"url"===t?"_blank":null}function sr(){return function(n){this.j=[];this.T=n||null}}function et(n,t,i,r){for(var f=0,o=n.length,e=t,s=[],u=void 0;f<o&&(u=e.next(n[f]));)e=u,f++;if(f>=o)return[];for(;f<o-1;)u=new vi(r),s.push(u),e.on(n[f],u),e=u,f++;return u=new vi(i),s.push(u),e.on(n[o-1],u),s}function b(){return function(n){n&&(this.v=n)}}function u(n){var t=n?{v:n}:{};return y(hr,b(),t)}function of(n){return n instanceof e||n instanceof v}var h={defaultProtocol:"http",events:null,format:ru,formatHref:ru,nl2br:!1,tagName:"a",target:ef,validate:!0,ignoreTags:[],attributes:null,className:"linkified"},uu,ai,nr,hu,vu,rr,o,s,wt,nu,uf;iu.prototype={resolve:function(n){var t=n.toHref(this.defaultProtocol);return{formatted:this.get("format",n.toString(),n),formattedHref:this.get("formatHref",t,n),tagName:this.get("tagName",t,n),className:this.get("className",t,n),target:this.get("target",t,n),events:this.getObject("events",t,n),attributes:this.getObject("attributes",t,n)}},check:function(n){return this.get("validate",n.toString(),n)},get:function(t,i,r){var u=this[t],f;if(!u)return u;switch("undefined"==typeof u?"undefined":n(u)){case"function":return u(i,r.type);case"object":return f=u[r.type]||h[t],"function"==typeof f?f(i,r.type):f}return u},getObject:function(n,t,i){var r=this[n];return"function"==typeof r?r(t,i.type):r}};uu=Object.freeze({defaults:h,Options:iu,contains:ff});ai=sr();ai.prototype={defaultTransition:!1,on:function(n,t){if(n instanceof Array){for(var i=0;i<n.length;i++)this.j.push([n[i],t]);return this}return this.j.push([n,t]),this},next:function(n){for(var t=0;t<this.j.length;t++){var i=this.j[t],r=i[0],u=i[1];if(this.test(n,r))return u}return this.defaultTransition},accepts:function(){return!!this.T},test:function(n,t){return n===t},emit:function(){return this.T}};var vi=y(ai,sr(),{test:function(n,t){return n===t||t instanceof RegExp&&t.test(n)}}),fu=y(ai,sr(),{jump:function(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,t=this.next(new n(""));return t===this.defaultTransition?(t=new this.constructor(i),this.on(n,t)):i&&(t.T=i),t},test:function(n,t){return n instanceof t}}),hr=b();hr.prototype={toString:function(){return this.v+""}};var e=u(),ot=u("@"),bt=u(":"),k=u("."),cr=u(),p=u(),lr=u("\n"),a=u(),yi=u("+"),pi=u("#"),st=u(),ar=u("mailto:"),wi=u("?"),w=u("/"),bi=u("_"),ki=u(),v=u(),eu=u(),kt=u("{"),dt=u("["),gt=u("<"),ni=u("("),ht=u("}"),ct=u("]"),lt=u(">"),at=u(")"),di=u("&"),sf=Object.freeze({Base:hr,DOMAIN:e,AT:ot,COLON:bt,DOT:k,PUNCTUATION:cr,LOCALHOST:p,NL:lr,NUM:a,PLUS:yi,POUND:pi,QUERY:wi,PROTOCOL:st,MAILTO:ar,SLASH:w,UNDERSCORE:bi,SYM:ki,TLD:v,WS:eu,OPENBRACE:kt,OPENBRACKET:dt,OPENANGLEBRACKET:gt,OPENPAREN:ni,CLOSEBRACE:ht,CLOSEBRACKET:ct,CLOSEANGLEBRACKET:lt,CLOSEPAREN:at,AMPERSAND:di}),ou="aaa|aarp|abb|abbott|abogado|ac|academy|accenture|accountant|accountants|aco|active|actor|ad|adac|ads|adult|ae|aeg|aero|af|afl|ag|agency|ai|aig|airforce|airtel|al|alibaba|alipay|allfinanz|alsace|am|amica|amsterdam|an|analytics|android|ao|apartments|app|apple|aq|aquarelle|ar|aramco|archi|army|arpa|arte|as|asia|associates|at|attorney|au|auction|audi|audio|author|auto|autos|avianca|aw|ax|axa|az|azure|ba|baidu|band|bank|bar|barcelona|barclaycard|barclays|bargains|bauhaus|bayern|bb|bbc|bbva|bcg|bcn|bd|be|beats|beer|bentley|berlin|best|bet|bf|bg|bh|bharti|bi|bible|bid|bike|bing|bingo|bio|biz|bj|black|blackfriday|bloomberg|blue|bm|bms|bmw|bn|bnl|bnpparibas|bo|boats|boehringer|bom|bond|boo|book|boots|bosch|bostik|bot|boutique|br|bradesco|bridgestone|broadway|broker|brother|brussels|bs|bt|budapest|bugatti|build|builders|business|buy|buzz|bv|bw|by|bz|bzh|ca|cab|cafe|cal|call|camera|camp|cancerresearch|canon|capetown|capital|car|caravan|cards|care|career|careers|cars|cartier|casa|cash|casino|cat|catering|cba|cbn|cc|cd|ceb|center|ceo|cern|cf|cfa|cfd|cg|ch|chanel|channel|chase|chat|cheap|chloe|christmas|chrome|church|ci|cipriani|circle|cisco|citic|city|cityeats|ck|cl|claims|cleaning|click|clinic|clinique|clothing|cloud|club|clubmed|cm|cn|co|coach|codes|coffee|college|cologne|com|commbank|community|company|compare|computer|comsec|condos|construction|consulting|contact|contractors|cooking|cool|coop|corsica|country|coupon|coupons|courses|cr|credit|creditcard|creditunion|cricket|crown|crs|cruises|csc|cu|cuisinella|cv|cw|cx|cy|cymru|cyou|cz|dabur|dad|dance|date|dating|datsun|day|dclk|de|dealer|deals|degree|delivery|dell|deloitte|delta|democrat|dental|dentist|desi|design|dev|diamonds|diet|digital|direct|directory|discount|dj|dk|dm|dnp|do|docs|dog|doha|domains|download|drive|dubai|durban|dvag|dz|earth|eat|ec|edeka|edu|education|ee|eg|email|emerck|energy|engineer|engineering|enterprises|epson|equipment|er|erni|es|esq|estate|et|eu|eurovision|eus|events|everbank|exchange|expert|exposed|express|fage|fail|fairwinds|faith|family|fan|fans|farm|fashion|fast|feedback|ferrero|fi|film|final|finance|financial|firestone|firmdale|fish|fishing|fit|fitness|fj|fk|flickr|flights|florist|flowers|flsmidth|fly|fm|fo|foo|football|ford|forex|forsale|forum|foundation|fox|fr|fresenius|frl|frogans|frontier|fund|furniture|futbol|fyi|ga|gal|gallery|gallup|game|garden|gb|gbiz|gd|gdn|ge|gea|gent|genting|gf|gg|ggee|gh|gi|gift|gifts|gives|giving|gl|glass|gle|global|globo|gm|gmail|gmbh|gmo|gmx|gn|gold|goldpoint|golf|goo|goog|google|gop|got|gov|gp|gq|gr|grainger|graphics|gratis|green|gripe|group|gs|gt|gu|gucci|guge|guide|guitars|guru|gw|gy|hamburg|hangout|haus|hdfcbank|health|healthcare|help|helsinki|here|hermes|hiphop|hitachi|hiv|hk|hm|hn|hockey|holdings|holiday|homedepot|homes|honda|horse|host|hosting|hoteles|hotmail|house|how|hr|hsbc|ht|hu|hyundai|ibm|icbc|ice|icu|id|ie|ifm|iinet|il|im|immo|immobilien|in|industries|infiniti|info|ing|ink|institute|insurance|insure|int|international|investments|io|ipiranga|iq|ir|irish|is|iselect|ist|istanbul|it|itau|iwc|jaguar|java|jcb|je|jetzt|jewelry|jlc|jll|jm|jmp|jo|jobs|joburg|jot|joy|jp|jpmorgan|jprs|juegos|kaufen|kddi|ke|kerryhotels|kerrylogistics|kerryproperties|kfh|kg|kh|ki|kia|kim|kinder|kitchen|kiwi|km|kn|koeln|komatsu|kp|kpn|kr|krd|kred|kuokgroup|kw|ky|kyoto|kz|la|lacaixa|lamborghini|lamer|lancaster|land|landrover|lanxess|lasalle|lat|latrobe|law|lawyer|lb|lc|lds|lease|leclerc|legal|lexus|lgbt|li|liaison|lidl|life|lifeinsurance|lifestyle|lighting|like|limited|limo|lincoln|linde|link|live|living|lixil|lk|loan|loans|local|locus|lol|london|lotte|lotto|love|lr|ls|lt|ltd|ltda|lu|lupin|luxe|luxury|lv|ly|ma|madrid|maif|maison|makeup|man|management|mango|market|marketing|markets|marriott|mba|mc|md|me|med|media|meet|melbourne|meme|memorial|men|menu|meo|mg|mh|miami|microsoft|mil|mini|mk|ml|mm|mma|mn|mo|mobi|mobily|moda|moe|moi|mom|monash|money|montblanc|mormon|mortgage|moscow|motorcycles|mov|movie|movistar|mp|mq|mr|ms|mt|mtn|mtpc|mtr|mu|museum|mutuelle|mv|mw|mx|my|mz|na|nadex|nagoya|name|natura|navy|nc|ne|nec|net|netbank|network|neustar|new|news|nexus|nf|ng|ngo|nhk|ni|nico|nikon|ninja|nissan|nl|no|nokia|norton|nowruz|np|nr|nra|nrw|ntt|nu|nyc|nz|obi|office|okinawa|om|omega|one|ong|onl|online|ooo|oracle|orange|org|organic|origins|osaka|otsuka|ovh|pa|page|pamperedchef|panerai|paris|pars|partners|parts|party|passagens|pe|pet|pf|pg|ph|pharmacy|philips|photo|photography|photos|physio|piaget|pics|pictet|pictures|pid|pin|ping|pink|pizza|pk|pl|place|play|playstation|plumbing|plus|pm|pn|pohl|poker|porn|post|pr|praxi|press|pro|prod|productions|prof|promo|properties|property|protection|ps|pt|pub|pw|pwc|py|qa|qpon|quebec|quest|racing|re|read|realtor|realty|recipes|red|redstone|redumbrella|rehab|reise|reisen|reit|ren|rent|rentals|repair|report|republican|rest|restaurant|review|reviews|rexroth|rich|ricoh|rio|rip|ro|rocher|rocks|rodeo|room|rs|rsvp|ru|ruhr|run|rw|rwe|ryukyu|sa|saarland|safe|safety|sakura|sale|salon|samsung|sandvik|sandvikcoromant|sanofi|sap|sapo|sarl|sas|saxo|sb|sbs|sc|sca|scb|schaeffler|schmidt|scholarships|school|schule|schwarz|science|scor|scot|sd|se|seat|security|seek|select|sener|services|seven|sew|sex|sexy|sfr|sg|sh|sharp|shell|shia|shiksha|shoes|show|shriram|si|singles|site|sj|sk|ski|skin|sky|skype|sl|sm|smile|sn|sncf|so|soccer|social|softbank|software|sohu|solar|solutions|song|sony|soy|space|spiegel|spot|spreadbetting|sr|srl|st|stada|star|starhub|statefarm|statoil|stc|stcgroup|stockholm|storage|store|studio|study|style|su|sucks|supplies|supply|support|surf|surgery|suzuki|sv|swatch|swiss|sx|sy|sydney|symantec|systems|sz|tab|taipei|taobao|tatamotors|tatar|tattoo|tax|taxi|tc|tci|td|team|tech|technology|tel|telecity|telefonica|temasek|tennis|tf|tg|th|thd|theater|theatre|tickets|tienda|tiffany|tips|tires|tirol|tj|tk|tl|tm|tmall|tn|to|today|tokyo|tools|top|toray|toshiba|total|tours|town|toyota|toys|tp|tr|trade|trading|training|travel|travelers|travelersinsurance|trust|trv|tt|tube|tui|tunes|tushu|tv|tvs|tw|tz|ua|ubs|ug|uk|unicom|university|uno|uol|us|uy|uz|va|vacations|vana|vc|ve|vegas|ventures|verisign|versicherung|vet|vg|vi|viajes|video|viking|villas|vin|vip|virgin|vision|vista|vistaprint|viva|vlaanderen|vn|vodka|volkswagen|vote|voting|voto|voyage|vu|vuelos|wales|walter|wang|wanggou|watch|watches|weather|weatherchannel|webcam|weber|website|wed|wedding|weir|wf|whoswho|wien|wiki|williamhill|win|windows|wine|wme|wolterskluwer|work|works|world|ws|wtc|wtf|xbox|xerox|xin|xperia|xxx|xyz|yachts|yahoo|yamaxun|yandex|ye|yodobashi|yoga|yokohama|youtube|yt|za|zara|zero|zip|zm|zone|zuerich|zw".split("|"),vr="0123456789".split(""),gi="0123456789abcdefghijklmnopqrstuvwxyz".split(""),su=[" ","\f","\r","\t","\x0b"," "," ","᠎"],c=[],r=function(n){return new vi(n)},l=r(),yr=r(a),vt=r(e),ti=r(),pr=r(eu);for(l.on("@",r(ot)).on(".",r(k)).on("+",r(yi)).on("#",r(pi)).on("?",r(wi)).on("/",r(w)).on("_",r(bi)).on(":",r(bt)).on("{",r(kt)).on("[",r(dt)).on("<",r(gt)).on("(",r(ni)).on("}",r(ht)).on("]",r(ct)).on(">",r(lt)).on(")",r(at)).on("&",r(di)).on([",",";","!",'"',"'"],r(cr)),l.on("\n",r(lr)).on(su,pr),pr.on(su,pr),nr=0;nr<ou.length;nr++)hu=et(ou[nr],l,v,e),c.push.apply(c,hu);var cu=et("file",l,e,e),lu=et("ftp",l,e,e),au=et("http",l,e,e),hf=et("mailto",l,e,e);c.push.apply(c,cu);c.push.apply(c,lu);c.push.apply(c,au);var cf=cu.pop(),lf=lu.pop(),af=au.pop(),vf=hf.pop(),tr=r(e),ir=r(st),yf=r(ar);for(lf.on("s",tr).on(":",ir),af.on("s",tr).on(":",ir),c.push(tr),cf.on(":",ir),tr.on(":",ir),vf.on(":",yf),vu=et("localhost",l,p,e),c.push.apply(c,vu),l.on(vr,yr),yr.on("-",ti).on(vr,yr).on(gi,vt),vt.on("-",ti).on(gi,vt),rr=0;rr<c.length;rr++)c[rr].on("-",ti).on(gi,vt);ti.on("-",ti).on(vr,vt).on(gi,vt);l.defaultTransition=r(ki);var yu=function(n){for(var h,c=n.replace(/[A-Z]/g,function(n){return n.toLowerCase()}),f=n.length,e=[],t=0;t<f;){for(var r=l,a=null,o=null,u=0,s=null,i=-1;t<f&&(o=r.next(c[t]));)a=null,r=o,r.accepts()?(i=0,s=r):i>=0&&i++,u++,t++;i<0||(t-=i,u-=i,h=s.emit(),e.push(new h(n.substr(t-u,u))))}return e},pf=l,wf=Object.freeze({State:vi,TOKENS:sf,run:yu,start:pf}),nt=b();nt.prototype={type:"token",isLink:!1,toString:function(){for(var t=[],n=0;n<this.v.length;n++)t.push(this.v[n].toString());return t.join("")},toHref:function(){return this.toString()},toObject:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"http";return{type:this.type,value:this.toString(),href:this.toHref(n)}}};var pu=y(nt,b(),{type:"email",isLink:!0}),wr=y(nt,b(),{type:"email",isLink:!0,toHref:function(){return this.v,"mailto:"+this.toString()}}),br=y(nt,b(),{type:"text"}),wu=y(nt,b(),{type:"nl"}),d=y(nt,b(),{type:"url",isLink:!0,toHref:function(){for(var f=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"http",r=!1,u=!1,i=this.v,t=[],n=0;i[n]instanceof st;)r=!0,t.push(i[n].toString().toLowerCase()),n++;for(;i[n]instanceof w;)u=!0,t.push(i[n].toString()),n++;for(;of(i[n]);)t.push(i[n].toString().toLowerCase()),n++;for(;n<i.length;n++)t.push(i[n].toString());return t=t.join(""),r||u||(t=f+"://"+t),t},hasProtocol:function(){return this.v[0]instanceof st}}),bf=Object.freeze({Base:nt,MAILTOEMAIL:pu,EMAIL:wr,NL:wu,TEXT:br,URL:d}),i=function(n){return new fu(n)},ur=i(),bu=i(),ku=i(),kr=i(),du=i(),g=i(),fr=i(),ii=i(d),gu=i(),nf=i(d),f=i(d),ri=i(),ui=i(),fi=i(),ei=i(),oi=i(),tt=i(d),it=i(d),rt=i(d),ut=i(d),si=i(),hi=i(),ci=i(),li=i(),yt=i(),dr=i(),er=i(wr),tf=i(),kf=i(wr),ft=i(pu),gr=i(),pt=i(),or=i(),rf=i(),df=i(wu);ur.on(lr,df).on(st,bu).on(ar,ku).on(w,kr);bu.on(w,kr);kr.on(w,du);ur.on(v,g).on(e,g).on(p,ii).on(a,g);du.on(v,f).on(e,f).on(a,f).on(p,f);g.on(k,fr);yt.on(k,dr);fr.on(v,ii).on(e,g).on(a,g).on(p,g);dr.on(v,er).on(e,yt).on(a,yt).on(p,yt);ii.on(k,fr);er.on(k,dr);ii.on(bt,gu).on(w,f);gu.on(a,nf);nf.on(w,f);er.on(bt,tf);tf.on(a,kf);o=[e,ot,p,a,yi,pi,st,w,v,bi,ki,di];s=[bt,k,wi,cr,ht,ct,lt,at,kt,dt,gt,ni];f.on(kt,ui).on(dt,fi).on(gt,ei).on(ni,oi);ri.on(kt,ui).on(dt,fi).on(gt,ei).on(ni,oi);ui.on(ht,f);fi.on(ct,f);ei.on(lt,f);oi.on(at,f);tt.on(ht,f);it.on(ct,f);rt.on(lt,f);ut.on(at,f);si.on(ht,f);hi.on(ct,f);ci.on(lt,f);li.on(at,f);ui.on(o,tt);fi.on(o,it);ei.on(o,rt);oi.on(o,ut);ui.on(s,si);fi.on(s,hi);ei.on(s,ci);oi.on(s,li);tt.on(o,tt);it.on(o,it);rt.on(o,rt);ut.on(o,ut);tt.on(s,tt);it.on(s,it);rt.on(s,rt);ut.on(s,ut);si.on(o,tt);hi.on(o,it);ci.on(o,rt);li.on(o,ut);si.on(s,si);hi.on(s,hi);ci.on(s,ci);li.on(s,li);f.on(o,f);ri.on(o,f);f.on(s,ri);ri.on(s,ri);ku.on(v,ft).on(e,ft).on(a,ft).on(p,ft);ft.on(o,ft).on(s,gr);gr.on(o,ft).on(s,gr);wt=[e,a,yi,pi,wi,bi,ki,di,v];g.on(wt,pt).on(ot,or);ii.on(wt,pt).on(ot,or);fr.on(wt,pt);pt.on(wt,pt).on(ot,or).on(k,rf);rf.on(wt,pt);or.on(v,yt).on(e,yt).on(p,er);nu=function(n){for(var o,a,s=n.length,t=0,f=[],i=[];t<s;){for(var u=ur,h=null,c=null,e=0,l=null,r=-1;t<s&&!(h=u.next(n[t]));)i.push(n[t++]);for(;t<s&&(c=h||u.next(n[t]));)h=null,u=c,u.accepts()?(r=0,l=u):r>=0&&r++,t++,e++;if(r<0)for(o=t-e;o<t;o++)i.push(n[o]);else i.length>0&&(f.push(new br(i)),i=[]),t-=r,e-=r,a=l.emit(),f.push(new a(n.slice(t-e,t)))}return i.length>0&&f.push(new br(i)),f};uf=Object.freeze({State:fu,TOKENS:bf,run:nu,start:ur});Array.isArray||(Array.isArray=function(n){return"[object Array]"===Object.prototype.toString.call(n)});var tu=function(n){return nu(yu(n))},gf=function(n){for(var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,u=tu(n),f=[],i=0;i<u.length;i++)t=u[i],!t.isLink||r&&t.type!==r||f.push(t.toObject());return f},ne=function(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,t=tu(n);return 1===t.length&&t[0].isLink&&(!i||t[0].type===i)};t.find=gf;t.inherits=y;t.options=uu;t.parser=uf;t.scanner=wf;t.test=ne;t.tokenize=tu}(self.linkify=self.linkify||{})}();!function(n,t){var i=function(n){function i(n){return n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function t(n){return n.replace(/"/g,"&quot;")}function u(n){var i,r,u;if(!n)return"";i=[];for(r in n)u=n[r]+"",i.push(r+'="'+t(u)+'"');return i.join(" ")}function r(n){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r;s=new o(s);for(var a=f(n),c=[],l=0;l<a.length;l++)if(r=a[l],"nl"===r.type&&s.nl2br)c.push("<br>\n");else if(r.isLink&&s.check(r)){var e=s.resolve(r),b=e.formatted,k=e.formattedHref,v=e.tagName,y=e.className,p=e.target,w=e.attributes,h="<"+v+' href="'+t(k)+'"';y&&(h+=' class="'+t(y)+'"');p&&(h+=' target="'+t(p)+'"');w&&(h+=" "+u(w));h+=">"+i(b)+"<\/"+v+">";c.push(h)}else c.push(i(r.toString()));return c.join("")}var f=n.tokenize,e=n.options,o=e.Options;return String.prototype.linkify||(String.prototype.linkify=function(n){return r(this,n)}),r}(t);n.linkifyStr=i}(window,linkify);!function(n,t){var i=function(n){function u(n){this.a=n}function t(n){return tt.test(n)}function s(n){return it.test(n)}function a(n){return n.replace(rt,"\n")}function f(n,t){this.b=n;this.c=t;this.d=null;this.input=null;this.e=-1;this.f=-1;this.g=-1;this.h=-1;this.i=-1;this.j()}function e(n,t){this.k=null;this.startLine=1;this.startColumn=0;this.options=t||{};this.tokenizer=new f(this,n)}function v(n,t){var i=new e(new u(c),t);return i.tokenize(n)}function y(n){for(var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},y=ut.tokenize(n),u=[],s=[],e,b,a,d,g,f,v,nt,c=new ft(c),t=0;t<y.length;t++)if(e=y[t],e.type!==i)e.type===r?(b=p(e.chars,c),u.push.apply(u,b)):u.push(e);else{if(u.push(e),a=e.tagName.toUpperCase(),d="A"===a||l.contains(c.ignoreTags,a),!d)continue;g=u.length;w(a,y,++t,u);t+=u.length-g-1}for(t=0;t<u.length;t++){f=u[t];switch(f.type){case i:v="<"+f.tagName;f.attributes.length>0&&(nt=k(f.attributes),v+=" "+nt.join(" "));v+=">";s.push(v);break;case o:s.push("<\/"+f.tagName+">");break;case r:s.push(h(f.chars));break;case et:s.push("<!--"+h(f.chars)+"-->")}}return s.join("")}function p(t,u){for(var s,l,a=n.tokenize(t),e=[],c=0;c<a.length;c++)if(s=a[c],"nl"===s.type&&u.nl2br)e.push({type:i,tagName:"br",attributes:[],l:!0});else if(s.isLink&&u.check(s)){var f=u.resolve(s),b=(f.href,f.formatted),k=f.formattedHref,v=f.tagName,y=f.className,p=f.target,w=f.attributes,h=[["href",k]];y&&h.push(["class",y]);p&&h.push(["target",p]);for(l in w)h.push([l,w[l]]);e.push({type:i,tagName:v,attributes:h,l:!1});e.push({type:r,chars:b});e.push({type:o,tagName:v})}else e.push({type:r,chars:s.toString()});return e}function w(n,t,r,u){for(var f,e=1;r<t.length&&e>0;)f=t[r],f.type===i&&f.tagName.toUpperCase()===n?e++:f.type===o&&f.tagName.toUpperCase()===n&&e--,u.push(f),r++;return u}function h(n){return n}function b(n){return n.replace(/"/g,"&quot;")}function k(n){for(var i=[],t=0;t<n.length;t++){var r=n[t],u=r[0],f=r[1];i.push(u+'="'+b(f)+'"')}return i}var c={m:" "},d=/^#[xX]([A-Fa-f0-9]+)$/,g=/^#([0-9]+)$/,nt=/^([A-Za-z0-9]+)$/;u.prototype.parse=function(n){if(n){var t=n.match(d);return t?"&#x"+t[1]+";":(t=n.match(g))?"&#"+t[1]+";":(t=n.match(nt),t?this.a[t[1]]||"&"+t[1]+";":void 0)}};var tt=/[\t\n\f ]/,it=/[A-Za-z]/,rt=/\r\n?/g;f.prototype={j:function(){this.d="beforeData";this.input="";this.e=0;this.f=1;this.g=0;this.h=-1;this.i=-1;this.b.j()},tokenize:function(n){this.j();this.tokenizePart(n);this.tokenizeEOF()},tokenizePart:function(n){for(this.input+=a(n);this.e<this.input.length;)this.n[this.d].call(this)},tokenizeEOF:function(){this.o()},o:function(){"data"===this.d&&(this.b.p(),this.d="beforeData")},q:function(){return this.input.charAt(this.e)},r:function(){var n=this.q();return this.e++,"\n"===n?(this.f++,this.g=0):this.g++,n},s:function(){var r=this.input.indexOf(";",this.e),n,t,i;if(r!==-1&&(n=this.input.slice(this.e,r),t=this.c.parse(n),t)){for(i=n.length;i;)this.r(),i--;return this.r(),t}},t:function(){this.h=this.f;this.i=this.g;this.b.tagOpen&&this.b.tagOpen()},n:{beforeData:function(){var n=this.q();"<"===n?(this.d="tagOpen",this.t(),this.r()):(this.d="data",this.b.u())},data:function(){var n=this.q();"<"===n?(this.b.p(),this.d="tagOpen",this.t(),this.r()):"&"===n?(this.r(),this.b.v(this.s()||"&")):(this.r(),this.b.v(n))},tagOpen:function(){var n=this.r();"!"===n?this.d="markupDeclaration":"/"===n?this.d="endTagOpen":s(n)&&(this.d="tagName",this.b.w(),this.b.x(n.toLowerCase()))},markupDeclaration:function(){var n=this.r();"-"===n&&"-"===this.input.charAt(this.e)&&(this.r(),this.d="commentStart",this.b.y())},commentStart:function(){var n=this.r();"-"===n?this.d="commentStartDash":">"===n?(this.b.z(),this.d="beforeData"):(this.b.A(n),this.d="comment")},commentStartDash:function(){var n=this.r();"-"===n?this.d="commentEnd":">"===n?(this.b.z(),this.d="beforeData"):(this.b.A("-"),this.d="comment")},comment:function(){var n=this.r();"-"===n?this.d="commentEndDash":this.b.A(n)},commentEndDash:function(){var n=this.r();"-"===n?this.d="commentEnd":(this.b.A("-"+n),this.d="comment")},commentEnd:function(){var n=this.r();">"===n?(this.b.z(),this.d="beforeData"):(this.b.A("--"+n),this.d="comment")},tagName:function(){var n=this.r();t(n)?this.d="beforeAttributeName":"/"===n?this.d="selfClosingStartTag":">"===n?(this.b.B(),this.d="beforeData"):this.b.x(n)},beforeAttributeName:function(){var n=this.q();return t(n)?void this.r():void("/"===n?(this.d="selfClosingStartTag",this.r()):">"===n?(this.r(),this.b.B(),this.d="beforeData"):(this.d="attributeName",this.b.C(),this.r(),this.b.D(n)))},attributeName:function(){var n=this.q();t(n)?(this.d="afterAttributeName",this.r()):"/"===n?(this.b.F(!1),this.b.G(),this.r(),this.d="selfClosingStartTag"):"="===n?(this.d="beforeAttributeValue",this.r()):">"===n?(this.b.F(!1),this.b.G(),this.r(),this.b.B(),this.d="beforeData"):(this.r(),this.b.D(n))},afterAttributeName:function(){var n=this.q();return t(n)?void this.r():void("/"===n?(this.b.F(!1),this.b.G(),this.r(),this.d="selfClosingStartTag"):"="===n?(this.r(),this.d="beforeAttributeValue"):">"===n?(this.b.F(!1),this.b.G(),this.r(),this.b.B(),this.d="beforeData"):(this.b.F(!1),this.b.G(),this.r(),this.d="attributeName",this.b.C(),this.b.D(n)))},beforeAttributeValue:function(){var n=this.q();t(n)?this.r():'"'===n?(this.d="attributeValueDoubleQuoted",this.b.F(!0),this.r()):"'"===n?(this.d="attributeValueSingleQuoted",this.b.F(!0),this.r()):">"===n?(this.b.F(!1),this.b.G(),this.r(),this.b.B(),this.d="beforeData"):(this.d="attributeValueUnquoted",this.b.F(!1),this.r(),this.b.H(n))},attributeValueDoubleQuoted:function(){var n=this.r();'"'===n?(this.b.G(),this.d="afterAttributeValueQuoted"):"&"===n?this.b.H(this.s('"')||"&"):this.b.H(n)},attributeValueSingleQuoted:function(){var n=this.r();"'"===n?(this.b.G(),this.d="afterAttributeValueQuoted"):"&"===n?this.b.H(this.s("'")||"&"):this.b.H(n)},attributeValueUnquoted:function(){var n=this.q();t(n)?(this.b.G(),this.r(),this.d="beforeAttributeName"):"&"===n?(this.r(),this.b.H(this.s(">")||"&")):">"===n?(this.b.G(),this.r(),this.b.B(),this.d="beforeData"):(this.r(),this.b.H(n))},afterAttributeValueQuoted:function(){var n=this.q();t(n)?(this.r(),this.d="beforeAttributeName"):"/"===n?(this.r(),this.d="selfClosingStartTag"):">"===n?(this.r(),this.b.B(),this.d="beforeData"):this.d="beforeAttributeName"},selfClosingStartTag:function(){var n=this.q();">"===n?(this.r(),this.b.I(),this.b.B(),this.d="beforeData"):this.d="beforeAttributeName"},endTagOpen:function(){var n=this.r();s(n)&&(this.d="tagName",this.b.J(),this.b.x(n.toLowerCase()))}}};e.prototype={tokenize:function(n){return this.K=[],this.tokenizer.tokenize(n),this.K},tokenizePart:function(n){return this.K=[],this.tokenizer.tokenizePart(n),this.K},tokenizeEOF:function(){return this.K=[],this.tokenizer.tokenizeEOF(),this.K[0]},j:function(){this.k=null;this.startLine=1;this.startColumn=0},L:function(){this.options.M&&(this.k.M={start:{f:this.startLine,g:this.startColumn},N:{f:this.tokenizer.f,g:this.tokenizer.g}});this.startLine=this.tokenizer.f;this.startColumn=this.tokenizer.g},u:function(){this.k={type:"Chars",chars:""};this.K.push(this.k)},v:function(n){this.k.chars+=n},p:function(){this.L()},y:function(){this.k={type:"Comment",chars:""};this.K.push(this.k)},A:function(n){this.k.chars+=n},z:function(){this.L()},w:function(){this.k={type:"StartTag",tagName:"",attributes:[],l:!1};this.K.push(this.k)},J:function(){this.k={type:"EndTag",tagName:""};this.K.push(this.k)},B:function(){this.L()},I:function(){this.k.l=!0},x:function(n){this.k.tagName+=n},C:function(){this._currentAttribute=["","",null];this.k.attributes.push(this._currentAttribute)},D:function(n){this._currentAttribute[0]+=n},F:function(n){this._currentAttribute[2]=n},H:function(n){this._currentAttribute[1]=this._currentAttribute[1]||"";this._currentAttribute[1]+=n},G:function(){}};var ut={HTML5NamedCharRefs:c,EntityParser:u,EventedTokenizer:f,Tokenizer:e,tokenize:v},l=n.options,ft=l.Options,i="StartTag",o="EndTag",r="Chars",et="Comment";return y}(t);n.linkifyHtml=i}(window,linkify);Backbone.Validation=function(n){"use strict";var u={forceUpdate:!1,selector:"name",labelFormatter:"sentenceCase",valid:Function.prototype,invalid:Function.prototype},e={formatLabel:function(n,t){return s[u.labelFormatter](n,t)},format:function(){var n=Array.prototype.slice.call(arguments),t=n.shift();return t.replace(/\{(\d+)\}/g,function(t,i){return typeof n[i]!="undefined"?n[i]:t})}},f=function(t,i,r){return i=i||{},r=r||"",n.each(t,function(n,u){t.hasOwnProperty(u)&&(!n||typeof n!="object"||n instanceof Array||n instanceof Date||n instanceof RegExp||n instanceof Backbone.Model||n instanceof Backbone.Collection?i[r+u]=n:f(n,i,r+u+"."))}),i},i=function(){var a=function(t){return n.reduce(n.keys(n.result(t,"validation")||{}),function(n,t){return n[t]=void 0,n},{})},v=function(t,i){var u=t.validation?n.result(t,"validation")[i]||{}:{};return(n.isFunction(u)||n.isString(u))&&(u={fn:u}),n.isArray(u)||(u=[u]),n.reduce(u,function(t,i){return n.each(n.without(n.keys(i),"msg"),function(n){t.push({fn:r[n],val:i[n],msg:i.msg})}),t},[])},t=function(t,i,u,f){return n.reduce(v(t,i),function(o,s){var c=n.extend({},e,r),h=s.fn.call(c,u,i,s.val,t,f);return h===!1||o===!1?!1:h&&!o?n.result(s,"msg")||h:o},"")},y=function(i,r){var u,e={},o=!0,s=n.clone(r),h=f(r);return n.each(h,function(n,r){u=t(i,r,n,s);u&&(e[r]=u,o=!1)}),{invalidAttrs:e,isValid:o}},s=function(i,r){return{preValidate:function(i,r){var e=this,u={},f;return n.isObject(i)?(n.each(i,function(n,t){f=e.preValidate(t,n);f&&(u[t]=f)}),n.isEmpty(u)?undefined:u):t(this,i,r,n.extend({},this.attributes))},isValid:function(i){var r=f(this.attributes);return n.isString(i)?!t(this,i,r[i],n.extend({},this.attributes)):n.isArray(i)?n.reduce(i,function(i,u){return i&&!t(this,u,r[u],n.extend({},this.attributes))},!0,this):(i===!0&&this.validate(),this.validation?this._isValid:!0)},validate:function(t,u){var e=this,v=!t,s=n.extend({},r,u),h=a(e),c=n.extend({},h,e.attributes,t),l=f(t||c),o=y(e,c);return e._isValid=o.isValid,n.each(h,function(n,t){var r=o.invalidAttrs.hasOwnProperty(t);r||s.valid(i,t,s.selector)}),n.each(h,function(n,t){var r=o.invalidAttrs.hasOwnProperty(t),u=l.hasOwnProperty(t);r&&(u||v)&&s.invalid(i,t,o.invalidAttrs[t],s.selector)}),n.defer(function(){e.trigger("validated",e._isValid,e,o.invalidAttrs);e.trigger("validated:"+(e._isValid?"valid":"invalid"),e,o.invalidAttrs)}),!s.forceUpdate&&n.intersection(n.keys(o.invalidAttrs),n.keys(l)).length>0?o.invalidAttrs:void 0}}},i=function(t,i,r){n.extend(i,s(t,r))},o=function(n){delete n.validate;delete n.preValidate;delete n.isValid},c=function(n){i(this.view,n,this.options)},l=function(n){o(n)};return{version:"0.9.1",configure:function(t){n.extend(u,t)},bind:function(t,r){r=n.extend({},u,h,r);var e=r.model||t.model,f=r.collection||t.collection;if(typeof e=="undefined"&&typeof f=="undefined")throw"Before you execute the binding your view must have a model or a collection.\nSee http://thedersen.com/projects/backbone-validation/#using-form-model-validation for more information.";e?i(t,e,r):f&&(f.each(function(n){i(t,n,r)}),f.bind("add",c,{view:t,options:r}),f.bind("remove",l))},unbind:function(t,i){i=n.extend({},i);var u=i.model||t.model,r=i.collection||t.collection;u?o(u):r&&(r.each(function(n){o(n)}),r.unbind("add",c),r.unbind("remove",l))},mixin:s(null,u)}}(),h=i.callbacks={valid:function(n,t,i){n.$("["+i+'~="'+t+'"]').removeClass("invalid").removeAttr("data-error")},invalid:function(n,t,i,r){n.$("["+r+'~="'+t+'"]').addClass("invalid").attr("data-error",i)}},o=i.patterns={digits:/^\d+$/,number:/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/,email:/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,url:/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i},t=i.messages={required:"{0} is required",acceptance:"{0} must be accepted",min:"{0} must be greater than or equal to {1}",max:"{0} must be less than or equal to {1}",range:"{0} must be between {1} and {2}",length:"{0} must be {1} characters",minLength:"{0} must be at least {1} characters",maxLength:"{0} must be at most {1} characters",rangeLength:"{0} must be between {1} and {2} characters",oneOf:"{0} must be one of: {1}",equalTo:"{0} must be the same as {1}",digits:"{0} must only contain digits",number:"{0} must be a number",email:"{0} must be a valid email",url:"{0} must be a valid url",inlinePattern:"{0} is invalid"},s=i.labelFormatters={none:function(n){return n},sentenceCase:function(n){return n.replace(/(?:^\w|[A-Z]|\b\w)/g,function(n,t){return t===0?n.toUpperCase():" "+n.toLowerCase()}).replace(/_/g," ")},label:function(n,t){return t.labels&&t.labels[n]||s.sentenceCase(n,t)}},r=i.validators=function(){var u=String.prototype.trim?function(n){return n===null?"":String.prototype.trim.call(n)}:function(n){return n===null?"":n.toString().replace(/^\s+/,"").replace(/\s+$/,"")},i=function(t){return n.isNumber(t)||n.isString(t)&&t.match(o.number)},r=function(t){return!(n.isNull(t)||n.isUndefined(t)||n.isString(t)&&u(t)===""||n.isArray(t)&&n.isEmpty(t))};return{fn:function(t,i,r,u,f){return n.isString(r)&&(r=u[r]),r.call(u,t,i,f)},required:function(i,u,f,e,o){var s=n.isFunction(f)?f.call(e,i,u,o):f;return!s&&!r(i)?!1:s&&!r(i)?this.format(t.required,this.formatLabel(u,e)):void 0},acceptance:function(i,r,u,f){if(i!=="true"&&(!n.isBoolean(i)||i===!1))return this.format(t.acceptance,this.formatLabel(r,f))},min:function(n,r,u,f){if(!i(n)||n<u)return this.format(t.min,this.formatLabel(r,f),u)},max:function(n,r,u,f){if(!i(n)||n>u)return this.format(t.max,this.formatLabel(r,f),u)},range:function(n,r,u,f){if(!i(n)||n<u[0]||n>u[1])return this.format(t.range,this.formatLabel(r,f),u[0],u[1])},length:function(i,r,u,f){if(!n.isString(i)||i.length!==u)return this.format(t.length,this.formatLabel(r,f),u)},minLength:function(i,r,u,f){if(!n.isString(i)||i.length<u)return this.format(t.minLength,this.formatLabel(r,f),u)},maxLength:function(i,r,u,f){if(!n.isString(i)||i.length>u)return this.format(t.maxLength,this.formatLabel(r,f),u)},rangeLength:function(i,r,u,f){if(!n.isString(i)||i.length<u[0]||i.length>u[1])return this.format(t.rangeLength,this.formatLabel(r,f),u[0],u[1])},oneOf:function(i,r,u,f){if(!n.include(u,i))return this.format(t.oneOf,this.formatLabel(r,f),u.join(", "))},equalTo:function(n,i,r,u,f){if(n!==f[r])return this.format(t.equalTo,this.formatLabel(i,u),this.formatLabel(r,u))},pattern:function(n,i,u,f){if(!r(n)||!n.toString().match(o[u]||u))return this.format(t[u]||t.inlinePattern,this.formatLabel(i,f),u)}}}();return n.each(r,function(t,i){r[i]=n.bind(r[i],n.extend({},e,r))}),i}(_),function(n){"use strict";var t=function(t,i){this.current=0;this.direction=1;this.interval=!1;this.progressInterval=!1;this.size={w:0,h:0};this.$el=n(t);this.$slider=this.$el.children("ul");this.$children=!1;this.$progressBar=!1;this.$pagination=!1;this.$slider.length==0?(this.$children=this.$el.children(),this.$slider=this.$children.wrapAll("<div />").parent()):this.$children=this.$slider.children("li");this.$el.data("progressSlider")&&this.$el.data("progressSlider").destroy();this.options=n.extend({},this.defaults,i);this.init.apply(this,arguments);this.$el.data("progressSlider",this)};t.prototype={defaults:{speed:500,delay:5e3,width:"100%",pagination:!0,paginationDots:!0,paginationContainer:!1,progress:!0,progressContainer:!1,bounce:!1,autoStart:!0,applyCss:!0},calculateParentSize:function(t,i){var r=n(i),u=r.outerWidth(),f=r.outerHeight();u>this.size.w&&(this.size.w=u);f>this.size.h&&(this.size.h=f)},createProgressBar:function(){var i=this.options.progressContainer?n(this.options.progressContainer):this.createProgressBarContainer(),t=n("<div class='pslider-progress-bar-inner' />");return this.options.applyCss&&t.css({width:0,height:"100%"}),i.append(t)},createProgressBarContainer:function(){var t=n("<div class='pslider-progress-bar' />");return this.options.applyCss&&t.css({width:"100%",float:"left"}),this.$el.append(t),t},createPagination:function(){var t=this.options.paginationContainer?n(this.options.paginationContainer):this.createPaginationContainer(),i=[],r=this;return this.$children.each(function(t){i.push(r.createPaginationItem(t,n(this)))}),t.append(i),t},createPaginationItem:function(t,i){var u=this,r=n("<li class='pslider-pager'><\/li>").on("click",function(){u.goToSlide(n(this).index())});return this.options.paginationDots?r.addClass("dot").text(t):r.text(i.data("name")||t),r},createPaginationContainer:function(){var t=n('<ul class="pslider-pagination-container" />');return this.options.applyCss&&t.css({float:"left"}),this.$el.append(t),t},applyCss:function(){var n,t;this.options.applyCss&&(n={overflow:"hidden",width:this.options.width,position:"relative"},this.options.height&&(n.height=this.options.height),this.$el.css(n).addClass("pslider"),t={position:"relative",width:this.$children.length+"00%",float:"left"},this.options.height&&(t.height=this.options.height),this.$slider.css(t).addClass("pslider-slides"),this.$children.css({width:100/this.$children.length+"%",float:"left"}))},init:function(){var n=this;this.options.progress&&(this.$progressBar=this.createProgressBar());this.options.pagination&&(this.$pagination=this.createPagination());this.applyCss();this.setCurrentPager(this.current);this.options.autoStart&&this.start()},start:function(){var n=this;return this.interval=setInterval(function(){n.goToSlide(n.current+n.direction)},this.options.delay),this.startProgress(),this},stop:function(){return this.interval=clearInterval(this.interval),this},goToSlide:function(n){this.stop().start();this.$children.eq(n).length||(this.options.bounce?(this.direction=-1,n=this.$children.length-2):n=0);n<0&&(this.options.bounce?(this.direction=1,n=1):n=this.$children.length-1);var t=this,i=this.options.speed,r=this.$children.eq(n);return this.setCurrentPager(n),this.$slider.animate({left:"-"+n+"00%"},i,function(){t.current=n}),this.startProgress(),this},setCurrentPager:function(n){if(this.$pagination){var t=this.$pagination.children("li");t.removeClass("current");t.eq(n).addClass("current")}},startProgress:function(){if(this.$progressBar){var n=this.$progressBar.find(".pslider-progress-bar-inner");if(!(n.length<=0))return n.stop().width(0).animate({width:"100%"},this.options.delay,"linear"),this}},stopProgress:function(){var n=this.$progressBar.find(".pslider-progress-bar-inner");return n.stop(),this},instance:function(){return this.$dialogue},destroy:function(){this.stop().stopProgress().unbind();this.$el.removeData("progressSlider");this.$el=null;this.$slider=null;this.$children=null;this.$pagination=null;this.$progressBar=null},unbind:function(){return this.$pagination.find(".pslider-pager").off("click"),this}};n.fn.pSlider=function(n){var i=new t(this,n);return i.instance()}}(jQuery);!function(n){"use strict";function r(t){var i,r=t.attr("data-target")||(i=t.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"");return n(r)}function i(i){return this.each(function(){var u=n(this),r=u.data("bs.collapse"),f=n.extend({},t.DEFAULTS,u.data(),"object"==typeof i&&i);!r&&f.toggle&&/show|hide/.test(i)&&(f.toggle=!1);r||u.data("bs.collapse",r=new t(this,f));"string"==typeof i&&r[i]()})}var t=function(i,r){this.$element=n(i);this.options=n.extend({},t.DEFAULTS,r);this.$trigger=n('[data-toggle="collapse"][href="#'+i.id+'"],[data-toggle="collapse"][data-target="#'+i.id+'"]');this.transitioning=null;this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger);this.options.toggle&&this.toggle()},u;t.VERSION="3.3.4";t.TRANSITION_DURATION=350;t.DEFAULTS={toggle:!0};t.prototype.dimension=function(){return this.$element.hasClass("width")?"width":"height"};t.prototype.show=function(){var f,r,e,u,o,s;if(!this.transitioning&&!this.$element.hasClass("in")&&(r=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing"),!(r&&r.length&&(f=r.data("bs.collapse"))&&f.transitioning)&&(e=n.Event("show.bs.collapse"),this.$element.trigger(e),!e.isDefaultPrevented()))){if(r&&r.length&&(i.call(r,"hide"),f||r.data("bs.collapse",null)),u=this.dimension(),this.$element.removeClass("collapse").addClass("collapsing")[u](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1,o=function(){this.$element.removeClass("collapsing").addClass("collapse in")[u]("");this.transitioning=0;this.$element.trigger("shown.bs.collapse")},!n.support.transition)return o.call(this);s=n.camelCase(["scroll",u].join("-"));this.$element.one("bsTransitionEnd",n.proxy(o,this)).emulateTransitionEnd(t.TRANSITION_DURATION)[u](this.$element[0][s])}};t.prototype.hide=function(){var r,i,u;if(!this.transitioning&&this.$element.hasClass("in")&&(r=n.Event("hide.bs.collapse"),this.$element.trigger(r),!r.isDefaultPrevented())){if(i=this.dimension(),this.$element[i](this.$element[i]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1,u=function(){this.transitioning=0;this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")},!n.support.transition)return u.call(this);this.$element[i](0).one("bsTransitionEnd",n.proxy(u,this)).emulateTransitionEnd(t.TRANSITION_DURATION)}};t.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};t.prototype.getParent=function(){return n(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(n.proxy(function(t,i){var u=n(i);this.addAriaAndCollapsedClass(r(u),u)},this)).end()};t.prototype.addAriaAndCollapsedClass=function(n,t){var i=n.hasClass("in");n.attr("aria-expanded",i);t.toggleClass("collapsed",!i).attr("aria-expanded",i)};u=n.fn.collapse;n.fn.collapse=i;n.fn.collapse.Constructor=t;n.fn.collapse.noConflict=function(){return n.fn.collapse=u,this};n(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(t){var u=n(this),f,e;u.attr("data-target")||t.preventDefault();f=r(u);e=f.data("bs.collapse")?"toggle":u.data();i.call(f,e)})}(jQuery),function(n){"use strict";function r(t){t&&3===t.which||(n(e).remove(),n(i).each(function(){var r=n(this),i=u(r),f={relatedTarget:this};i.hasClass("open")&&(i.trigger(t=n.Event("hide.bs.dropdown",f)),t.isDefaultPrevented()||(r.attr("aria-expanded","false"),i.removeClass("open").trigger("hidden.bs.dropdown",f)))}))}function u(t){var i=t.attr("data-target"),r;return i||(i=(i=t.attr("href"))&&/#[A-Za-z]/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,"")),r=i&&n(i),r&&r.length?r:t.parent()}var e=".dropdown-backdrop",i='[data-toggle="dropdown"]',t=function(t){n(t).on("click.bs.dropdown",this.toggle)},f;t.VERSION="3.3.4";t.prototype.toggle=function(t){var f=n(this),i,o,e;if(!f.is(".disabled, :disabled")){if(i=u(f),o=i.hasClass("open"),r(),!o){if("ontouchstart"in document.documentElement&&!i.closest(".navbar-nav").length&&n('<div class="dropdown-backdrop"/>').insertAfter(n(this)).on("click",r),e={relatedTarget:this},i.trigger(t=n.Event("show.bs.dropdown",e)),t.isDefaultPrevented())return;f.trigger("focus").attr("aria-expanded","true");i.toggleClass("open").trigger("shown.bs.dropdown",e)}return!1}};t.prototype.keydown=function(t){var e,o,s,h,f,r;if(/(38|40|27|32)/.test(t.which)&&!/input|textarea/i.test(t.target.tagName)&&(e=n(this),t.preventDefault(),t.stopPropagation(),!e.is(".disabled, :disabled"))){if(o=u(e),s=o.hasClass("open"),!s&&27!=t.which||s&&27==t.which)return 27==t.which&&o.find(i).trigger("focus"),e.trigger("click");h=" li:not(.disabled):visible a";f=o.find('[role="menu"]'+h+', [role="listbox"]'+h);f.length&&(r=f.index(t.target),38==t.which&&r>0&&r--,40==t.which&&r<f.length-1&&r++,~r||(r=0),f.eq(r).trigger("focus"))}};f=n.fn.dropdown;n.fn.dropdown=function(i){return this.each(function(){var r=n(this),u=r.data("bs.dropdown");u||r.data("bs.dropdown",u=new t(this));"string"==typeof i&&u[i].call(r)})};n.fn.dropdown.Constructor=t;n.fn.dropdown.noConflict=function(){return n.fn.dropdown=f,this};n(document).on("click.bs.dropdown.data-api",r).on("click.bs.dropdown.data-api",".dropdown form",function(n){n.stopPropagation()}).on("click.bs.dropdown.data-api",i,t.prototype.toggle).on("keydown.bs.dropdown.data-api",i,t.prototype.keydown).on("keydown.bs.dropdown.data-api",'[role="menu"]',t.prototype.keydown).on("keydown.bs.dropdown.data-api",'[role="listbox"]',t.prototype.keydown)}(jQuery),function(n){"use strict";n.fn.emulateTransitionEnd=function(t){var i=!1,r=this;n(this).one("bsTransitionEnd",function(){i=!0});return setTimeout(function(){i||n(r).trigger(n.support.transition.end)},t),this};n(function(){n.support.transition=function(){var i=document.createElement("bootstrap"),n={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var t in n)if(void 0!==i.style[t])return{end:n[t]};return!1}();n.support.transition&&(n.event.special.bsTransitionEnd={bindType:n.support.transition.end,delegateType:n.support.transition.end,handle:function(t){if(n(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}})})}(jQuery),function(n){"use strict";var t=function(n,t){this.type=null;this.options=null;this.enabled=null;this.timeout=null;this.hoverState=null;this.$element=null;this.init("tooltip",n,t)},i;t.VERSION="3.3.4";t.TRANSITION_DURATION=150;t.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"><\/div><div class="tooltip-inner"><\/div><\/div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}};t.prototype.init=function(t,i,r){var f,e,u,o,s;if(this.enabled=!0,this.type=t,this.$element=n(i),this.options=this.getOptions(r),this.$viewport=this.options.viewport&&n(this.options.viewport.selector||this.options.viewport),this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(f=this.options.trigger.split(" "),e=f.length;e--;)if(u=f[e],"click"==u)this.$element.on("click."+this.type,this.options.selector,n.proxy(this.toggle,this));else"manual"!=u&&(o="hover"==u?"mouseenter":"focusin",s="hover"==u?"mouseleave":"focusout",this.$element.on(o+"."+this.type,this.options.selector,n.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,n.proxy(this.leave,this)));this.options.selector?this._options=n.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()};t.prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.getOptions=function(t){return(t=n.extend({},this.getDefaults(),this.$element.data(),t)).delay&&"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),t};t.prototype.getDelegateOptions=function(){var t={},i=this.getDefaults();return this._options&&n.each(this._options,function(n,r){i[n]!=r&&(t[n]=r)}),t};t.prototype.enter=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget).data("bs."+this.type);if(i&&i.$tip&&i.$tip.is(":visible"))i.hoverState="in";else{if(i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)),clearTimeout(i.timeout),i.hoverState="in",!i.options.delay||!i.options.delay.show)return i.show();i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)}};t.prototype.leave=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget).data("bs."+this.type);if(i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)),clearTimeout(i.timeout),i.hoverState="out",!i.options.delay||!i.options.delay.hide)return i.hide();i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)};t.prototype.show=function(){var c=n.Event("show.bs."+this.type),l,p,h;if(this.hasContent()&&this.enabled){if(this.$element.trigger(c),l=n.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]),c.isDefaultPrevented()||!l)return;var u=this,r=this.tip(),a=this.getUID(this.type);this.setContent();r.attr("id",a);this.$element.attr("aria-describedby",a);this.options.animation&&r.addClass("fade");var i="function"==typeof this.options.placement?this.options.placement.call(this,r[0],this.$element[0]):this.options.placement,v=/\s?auto?\s?/i,y=v.test(i);y&&(i=i.replace(v,"")||"top");r.detach().css({top:0,left:0,display:"block"}).addClass(i).data("bs."+this.type,this);this.options.container?r.appendTo(this.options.container):r.insertAfter(this.$element);var f=this.getPosition(),o=r[0].offsetWidth,s=r[0].offsetHeight;if(y){var w=i,b=this.options.container?n(this.options.container):this.$element.parent(),e=this.getPosition(b);i="bottom"==i&&f.bottom+s>e.bottom?"top":"top"==i&&f.top-s<e.top?"bottom":"right"==i&&f.right+o>e.width?"left":"left"==i&&f.left-o<e.left?"right":i;r.removeClass(w).addClass(i)}p=this.getCalculatedOffset(i,f,o,s);this.applyPlacement(p,i);h=function(){var n=u.hoverState;u.$element.trigger("shown.bs."+u.type);u.hoverState=null;"out"==n&&u.leave(u)};n.support.transition&&this.$tip.hasClass("fade")?r.one("bsTransitionEnd",h).emulateTransitionEnd(t.TRANSITION_DURATION):h()}};t.prototype.applyPlacement=function(t,i){var r=this.tip(),l=r[0].offsetWidth,e=r[0].offsetHeight,o=parseInt(r.css("margin-top"),10),s=parseInt(r.css("margin-left"),10),h,f,u;isNaN(o)&&(o=0);isNaN(s)&&(s=0);t.top=t.top+o;t.left=t.left+s;n.offset.setOffset(r[0],n.extend({using:function(n){r.css({top:Math.round(n.top),left:Math.round(n.left)})}},t),0);r.addClass("in");h=r[0].offsetWidth;f=r[0].offsetHeight;"top"==i&&f!=e&&(t.top=t.top+e-f);u=this.getViewportAdjustedDelta(i,t,h,f);u.left?t.left+=u.left:t.top+=u.top;var c=/top|bottom/.test(i),a=c?2*u.left-l+h:2*u.top-e+f,v=c?"offsetWidth":"offsetHeight";r.offset(t);this.replaceArrow(a,r[0][v],c)};t.prototype.replaceArrow=function(n,t,i){this.arrow().css(i?"left":"top",50*(1-n/t)+"%").css(i?"top":"left","")};t.prototype.setContent=function(){var n=this.tip(),t=this.getTitle();n.find(".tooltip-inner")[this.options.html?"html":"text"](t);n.removeClass("fade in top bottom left right")};t.prototype.hide=function(i){function e(){"in"!=u.hoverState&&r.detach();u.$element.removeAttr("aria-describedby").trigger("hidden.bs."+u.type);i&&i()}var u=this,r=n(this.$tip),f=n.Event("hide.bs."+this.type);if(this.$element.trigger(f),!f.isDefaultPrevented())return r.removeClass("in"),n.support.transition&&r.hasClass("fade")?r.one("bsTransitionEnd",e).emulateTransitionEnd(t.TRANSITION_DURATION):e(),this.hoverState=null,this};t.prototype.fixTitle=function(){var n=this.$element;(n.attr("title")||"string"!=typeof n.attr("data-original-title"))&&n.attr("data-original-title",n.attr("title")||"").attr("title","")};t.prototype.hasContent=function(){return this.getTitle()};t.prototype.getPosition=function(t){var u=(t=t||this.$element)[0],r="BODY"==u.tagName,i=u.getBoundingClientRect();null==i.width&&(i=n.extend({},i,{width:i.right-i.left,height:i.bottom-i.top}));var f=r?{top:0,left:0}:t.offset(),e={scroll:r?document.documentElement.scrollTop||document.body.scrollTop:t.scrollTop()},o=r?{width:n(window).width(),height:n(window).height()}:null;return n.extend({},i,e,o,f)};t.prototype.getCalculatedOffset=function(n,t,i,r){return"bottom"==n?{top:t.top+t.height,left:t.left+t.width/2-i/2}:"top"==n?{top:t.top-r,left:t.left+t.width/2-i/2}:"left"==n?{top:t.top+t.height/2-r/2,left:t.left-i}:{top:t.top+t.height/2-r/2,left:t.left+t.width}};t.prototype.getViewportAdjustedDelta=function(n,t,i,r){var f={top:0,left:0},e,u,o,s,h,c;return this.$viewport?(e=this.options.viewport&&this.options.viewport.padding||0,u=this.getPosition(this.$viewport),/right|left/.test(n)?(o=t.top-e-u.scroll,s=t.top+e-u.scroll+r,o<u.top?f.top=u.top-o:s>u.top+u.height&&(f.top=u.top+u.height-s)):(h=t.left-e,c=t.left+e+i,h<u.left?f.left=u.left-h:c>u.width&&(f.left=u.left+u.width-c)),f):f};t.prototype.getTitle=function(){var t=this.$element,n=this.options;return t.attr("data-original-title")||("function"==typeof n.title?n.title.call(t[0]):n.title)};t.prototype.getUID=function(n){for(;n+=~~(1e6*Math.random()),document.getElementById(n););return n};t.prototype.tip=function(){return this.$tip=this.$tip||n(this.options.template)};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")};t.prototype.enable=function(){this.enabled=!0};t.prototype.disable=function(){this.enabled=!1};t.prototype.toggleEnabled=function(){this.enabled=!this.enabled};t.prototype.toggle=function(t){var i=this;t&&((i=n(t.currentTarget).data("bs."+this.type))||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)));i.tip().hasClass("in")?i.leave(i):i.enter(i)};t.prototype.destroy=function(){var n=this;clearTimeout(this.timeout);this.hide(function(){n.$element.off("."+n.type).removeData("bs."+n.type)})};i=n.fn.tooltip;n.fn.tooltip=function(i){return this.each(function(){var u=n(this),r=u.data("bs.tooltip"),f="object"==typeof i&&i;!r&&/destroy|hide/.test(i)||(r||u.data("bs.tooltip",r=new t(this,f)),"string"==typeof i&&r[i]())})};n.fn.tooltip.Constructor=t;n.fn.tooltip.noConflict=function(){return n.fn.tooltip=i,this}}(jQuery),function(n){"use strict";function r(i){return this.each(function(){var u=n(this),r=u.data("bs.tab");r||u.data("bs.tab",r=new t(this));"string"==typeof i&&r[i]()})}var t=function(t){this.element=n(t)},u,i;t.VERSION="3.3.4";t.TRANSITION_DURATION=150;t.prototype.show=function(){var t=this.element,f=t.closest("ul:not(.dropdown-menu)"),i=t.data("target"),u;if(i||(i=(i=t.attr("href"))&&i.replace(/.*(?=#[^\s]*$)/,"")),!t.parent("li").hasClass("active")){var r=f.find(".active:last a"),e=n.Event("hide.bs.tab",{relatedTarget:t[0]}),o=n.Event("show.bs.tab",{relatedTarget:r[0]});(r.trigger(e),t.trigger(o),o.isDefaultPrevented()||e.isDefaultPrevented())||(u=n(i),this.activate(t.closest("li"),f),this.activate(u,u.parent(),function(){r.trigger({type:"hidden.bs.tab",relatedTarget:t[0]});t.trigger({type:"shown.bs.tab",relatedTarget:r[0]})}))}};t.prototype.activate=function(i,r,u){function o(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1);i.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0);e?(i[0].offsetWidth,i.addClass("in")):i.removeClass("fade");i.parent(".dropdown-menu").length&&i.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0);u&&u()}var f=r.find("> .active"),e=u&&n.support.transition&&(f.length&&f.hasClass("fade")||!!r.find("> .fade").length);f.length&&e?f.one("bsTransitionEnd",o).emulateTransitionEnd(t.TRANSITION_DURATION):o();f.removeClass("in")};u=n.fn.tab;n.fn.tab=r;n.fn.tab.Constructor=t;n.fn.tab.noConflict=function(){return n.fn.tab=u,this};i=function(t){t.preventDefault();r.call(n(this),"show")};n(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',i).on("click.bs.tab.data-api",'[data-toggle="pill"]',i)}(jQuery),function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.carousel"),f=n.extend({},t.DEFAULTS,u.data(),"object"==typeof i&&i),e="string"==typeof i?i:f.slide;r||u.data("bs.carousel",r=new t(this,f));"number"==typeof i?r.to(i):e?r[e]():f.interval&&r.pause().cycle()})}var t=function(t,i){this.$element=n(t);this.$indicators=this.$element.find(".carousel-indicators");this.options=i;this.paused=null;this.sliding=null;this.interval=null;this.$active=null;this.$items=null;this.options.keyboard&&this.$element.on("keydown.bs.carousel",n.proxy(this.keydown,this));"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",n.proxy(this.pause,this)).on("mouseleave.bs.carousel",n.proxy(this.cycle,this))},u,r;t.VERSION="3.3.4";t.TRANSITION_DURATION=600;t.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0};t.prototype.keydown=function(n){if(!/input|textarea/i.test(n.target.tagName)){switch(n.which){case 37:this.prev();break;case 39:this.next();break;default:return}n.preventDefault()}};t.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(n.proxy(this.next,this),this.options.interval)),this};t.prototype.getItemIndex=function(n){return this.$items=n.parent().children(".item"),this.$items.index(n||this.$active)};t.prototype.getItemForDirection=function(n,t){var i=this.getItemIndex(t),r;return("prev"==n&&0===i||"next"==n&&i==this.$items.length-1)&&!this.options.wrap?t:(r=(i+("prev"==n?-1:1))%this.$items.length,this.$items.eq(r))};t.prototype.to=function(n){var i=this,t=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(n>this.$items.length-1||n<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){i.to(n)}):t==n?this.pause().cycle():this.slide(n>t?"next":"prev",this.$items.eq(n))};t.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&n.support.transition&&(this.$element.trigger(n.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this};t.prototype.next=function(){if(!this.sliding)return this.slide("next")};t.prototype.prev=function(){if(!this.sliding)return this.slide("prev")};t.prototype.slide=function(i,r){var e=this.$element.find(".item.active"),u=r||this.getItemForDirection(i,e),l=this.interval,f="next"==i?"left":"right",a=this,o,s,h,c;return u.hasClass("active")?this.sliding=!1:(o=u[0],s=n.Event("slide.bs.carousel",{relatedTarget:o,direction:f}),(this.$element.trigger(s),!s.isDefaultPrevented())?((this.sliding=!0,l&&this.pause(),this.$indicators.length)&&(this.$indicators.find(".active").removeClass("active"),h=n(this.$indicators.children()[this.getItemIndex(u)]),h&&h.addClass("active")),c=n.Event("slid.bs.carousel",{relatedTarget:o,direction:f}),n.support.transition&&this.$element.hasClass("slide")?(u.addClass(i),u[0].offsetWidth,e.addClass(f),u.addClass(f),e.one("bsTransitionEnd",function(){u.removeClass([i,f].join(" ")).addClass("active");e.removeClass(["active",f].join(" "));a.sliding=!1;setTimeout(function(){a.$element.trigger(c)},0)}).emulateTransitionEnd(t.TRANSITION_DURATION)):(e.removeClass("active"),u.addClass("active"),this.sliding=!1,this.$element.trigger(c)),l&&this.cycle(),this):void 0)};u=n.fn.carousel;n.fn.carousel=i;n.fn.carousel.Constructor=t;n.fn.carousel.noConflict=function(){return n.fn.carousel=u,this};r=function(t){var o,r=n(this),u=n(r.attr("data-target")||(o=r.attr("href"))&&o.replace(/.*(?=#[^\s]+$)/,"")),e,f;u.hasClass("carousel")&&(e=n.extend({},u.data(),r.data()),f=r.attr("data-slide-to"),f&&(e.interval=!1),i.call(u,e),f&&u.data("bs.carousel").to(f),t.preventDefault())};n(document).on("click.bs.carousel.data-api","[data-slide]",r).on("click.bs.carousel.data-api","[data-slide-to]",r);n(window).on("load",function(){n('[data-ride="carousel"]').each(function(){var t=n(this);i.call(t,t.data())})})}(jQuery),function(n){"use strict";var t=function(n,t){this.init("popover",n,t)},i;if(!n.fn.tooltip)throw new Error("Popover requires tooltip.js");t.VERSION="3.3.4";t.DEFAULTS=n.extend({},n.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"><\/div><h3 class="popover-title"><\/h3><div class="popover-content"><\/div><\/div>'});t.prototype=n.extend({},n.fn.tooltip.Constructor.prototype);t.prototype.constructor=t;t.prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.setContent=function(){var n=this.tip(),i=this.getTitle(),t=this.getContent();n.find(".popover-title")[this.options.html?"html":"text"](i);n.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof t?"html":"append":"text"](t);n.removeClass("fade top bottom left right in");n.find(".popover-title").html()||n.find(".popover-title").hide()};t.prototype.hasContent=function(){return this.getTitle()||this.getContent()};t.prototype.getContent=function(){var t=this.$element,n=this.options;return t.attr("data-content")||("function"==typeof n.content?n.content.call(t[0]):n.content)};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};i=n.fn.popover;n.fn.popover=function(i){return this.each(function(){var u=n(this),r=u.data("bs.popover"),f="object"==typeof i&&i;!r&&/destroy|hide/.test(i)||(r||u.data("bs.popover",r=new t(this,f)),"string"==typeof i&&r[i]())})};n.fn.popover.Constructor=t;n.fn.popover.noConflict=function(){return n.fn.popover=i,this}}(jQuery),function(n,t){function h(){var n=i.elements;return"string"==typeof n?n.split(" "):n}function u(n){var t=a[n[l]];return t||(t={},s++,n[l]=s,a[s]=t),t}function c(n,i,f){return i||(i=t),r?i.createElement(n):(f||(f=u(i)),!(e=f.cache[n]?f.cache[n].cloneNode():y.test(n)?(f.cache[n]=f.createElem(n)).cloneNode():f.createElem(n)).canHaveChildren||v.test(n)||e.tagUrn?e:f.frag.appendChild(e));var e}function f(n){n||(n=t);var o,f,s,y,l,a,v=u(n);return!i.shivCSS||e||v.hasCSS||(v.hasCSS=(y="article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}",l=(s=n).createElement("p"),a=s.getElementsByTagName("head")[0]||s.documentElement,l.innerHTML="x<style>"+y+"<\/style>",!!a.insertBefore(l.lastChild,a.firstChild))),r||(o=n,(f=v).cache||(f.cache={},f.createElem=o.createElement,f.createFrag=o.createDocumentFragment,f.frag=f.createFrag()),o.createElement=function(n){return i.shivMethods?c(n,o,f):f.createElem(n)},o.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+h().join().replace(/[\w\-:]+/g,function(n){return f.createElem(n),f.frag.createElement(n),'c("'+n+'")'})+");return n}")(i,f.frag)),n}var e,r,o=n.html5||{},v=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,y=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,l="_html5shiv",s=0,a={},i;!function(){try{var n=t.createElement("a");n.innerHTML="<xyz><\/xyz>";e="hidden"in n;r=1==n.childNodes.length||function(){t.createElement("a");var n=t.createDocumentFragment();return void 0===n.cloneNode||void 0===n.createDocumentFragment||void 0===n.createElement}()}catch(n){e=!0;r=!0}}();i={elements:o.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:"3.7.2",shivCSS:!1!==o.shivCSS,supportsUnknownElements:r,shivMethods:!1!==o.shivMethods,type:"default",shivDocument:f,createElement:c,createDocumentFragment:function(n,i){if(n||(n=t),r)return n.createDocumentFragment();for(var e=(i=i||u(n)).frag.cloneNode(),f=0,o=h(),s=o.length;s>f;f++)e.createElement(o[f]);return e},addElements:function(n,t){var r=i.elements;"string"!=typeof r&&(r=r.join(" "));"string"!=typeof n&&(n=n.join(" "));i.elements=r+" "+n;f(t)}};n.html5=i;f(t)}(this,document),function(n){"use strict";var u,f,t,e,i,r;n.matchMedia=n.matchMedia||(u=n.document,t=u.documentElement,e=t.firstElementChild||t.firstChild,i=u.createElement("body"),(r=u.createElement("div")).id="mq-test-1",r.style.cssText="position:absolute;top:-100em",i.style.background="none",i.appendChild(r),function(n){return r.innerHTML='&shy;<style media="'+n+'"> #mq-test-1 { width: 42px; }<\/style>',t.insertBefore(i,e),f=42===r.offsetWidth,t.removeChild(i),{matches:f,media:n}})}(this),function(n){"use strict";function p(){y(!0)}var t={};n.respond=t;t.update=function(){};var f=[],tt=function(){var t=!1;try{t=new n.XMLHttpRequest}catch(i){t=new n.ActiveXObject("Microsoft.XMLHTTP")}return function(){return t}}(),w=function(n,t){var i=tt();i&&(i.open("GET",n,!0),i.onreadystatechange=function(){4!==i.readyState||200!==i.status&&304!==i.status||t(i.responseText)},4!==i.readyState&&i.send(null))},b=function(n){return n.replace(t.regex.minmaxwh,"").match(t.regex.other)};if(t.ajax=w,t.queue=f,t.unsupportedmq=b,t.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,comments:/\/\*[^*]*\*+([^/][^*]*\*+)*\//gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,maxw:/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,minmaxwh:/\(\s*m(in|ax)\-(height|width)\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/gi,other:/\([^\)]*\)/g},t.mediaQueriesSupported=n.matchMedia&&null!==n.matchMedia("only all")&&n.matchMedia("only all").matches,!t.mediaQueriesSupported){var c,k,l,i=n.document,r=i.documentElement,e=[],o=[],u=[],a={},s=i.getElementsByTagName("head")[0]||r,it=i.getElementsByTagName("base")[0],h=s.getElementsByTagName("link"),v=function(){var f,t=i.createElement("div"),n=i.body,o=r.style.fontSize,e=n&&n.style.fontSize,u=!1;return t.style.cssText="position:absolute;font-size:1em;width:1em",n||((n=u=i.createElement("body")).style.background="none"),r.style.fontSize="100%",n.style.fontSize="100%",n.appendChild(t),u&&r.insertBefore(n,r.firstChild),f=t.offsetWidth,u?r.removeChild(n):n.removeChild(t),r.style.fontSize=o,e&&(n.style.fontSize=e),l=parseFloat(f)},y=function(t){var it="clientWidth",rt=r[it],ut="CSS1Compat"===i.compatMode&&rt||i.body[it]||rt,p={},st=h[h.length-1],ft=(new Date).getTime(),nt,d,g,f,tt;if(t&&c&&30>ft-c)return n.clearTimeout(k),void(k=n.setTimeout(y,30));for(nt in c=ft,e)if(e.hasOwnProperty(nt)){var a=e[nt],w=a.minw,b=a.maxw,et=null===w,ot=null===b;w&&(w=parseFloat(w)*(w.indexOf("em")>-1?l||v():1));b&&(b=parseFloat(b)*(b.indexOf("em")>-1?l||v():1));a.hasquery&&(et&&ot||!(et||ut>=w)||!(ot||b>=ut))||(p[a.media]||(p[a.media]=[]),p[a.media].push(o[a.rules]))}for(d in u)u.hasOwnProperty(d)&&u[d]&&u[d].parentNode===s&&s.removeChild(u[d]);for(g in u.length=0,p)p.hasOwnProperty(g)&&(f=i.createElement("style"),tt=p[g].join("\n"),f.type="text/css",f.media=g,s.insertBefore(f,st.nextSibling),f.styleSheet?f.styleSheet.cssText=tt:f.appendChild(i.createTextNode(tt)),u.push(f))},d=function(n,i,r){var h=n.replace(t.regex.comments,"").replace(t.regex.keyframes,"").match(t.regex.media),c=h&&h.length||0,a=function(n){return n.replace(t.regex.urls,"$1"+i+"$2$3")},v=!c&&r,f,l,u,p,w,s;for((i=i.substring(0,i.lastIndexOf("/"))).length&&(i+="/"),v&&(c=1),f=0;c>f;f++)for(v?(l=r,o.push(a(n))):(l=h[f].match(t.regex.findStyles)&&RegExp.$1,o.push(RegExp.$2&&a(RegExp.$2))),w=(p=l.split(",")).length,s=0;w>s;s++)u=p[s],b(u)||e.push({media:u.split("(")[0].match(t.regex.only)&&RegExp.$2||"all",rules:o.length-1,hasquery:u.indexOf("(")>-1,minw:u.match(t.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:u.match(t.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")});y()},g=function(){if(f.length){var t=f.shift();w(t.href,function(i){d(i,t.href,t.media);a[t.href]=!0;n.setTimeout(function(){g()},0)})}},nt=function(){for(var r=0;r<h.length;r++){var i=h[r],t=i.href,u=i.media,e=i.rel&&"stylesheet"===i.rel.toLowerCase();t&&e&&!a[t]&&(i.styleSheet&&i.styleSheet.rawCssText?(d(i.styleSheet.rawCssText,t,u),a[t]=!0):(!/^([a-zA-Z:]*\/\/)/.test(t)&&!it||t.replace(RegExp.$1,"").split("/")[0]===n.location.host)&&("//"===t.substring(0,2)&&(t=n.location.protocol+t),f.push({href:t,media:u})))}g()};nt();t.update=nt;t.getEmValue=v;n.addEventListener?n.addEventListener("resize",p,!1):n.attachEvent&&n.attachEvent("onresize",p)}}(this);!function(){var n,r,i="left-open",t=$("#body");$(".navigation-link").length&&($(document).on("touchstart",function(t){n=t.originalEvent.touches[0].clientX;r=t.originalEvent.touches[0].clientY}),$(document).on("touchend",function(u){t.css("left","");var f=u.originalEvent.changedTouches[0].clientX,e=u.originalEvent.changedTouches[0].clientY;Math.abs(r-e)>100||Math.abs(n-f)<100||(n>f?t.removeClass(i):n<f&&t.addClass(i),n=0)}),$(".right").click(function(){t.removeClass(i)}))}();$(function(){$(".navbar-toggle").click(function(n){return n.preventDefault(),n.stopPropagation(),$("#body").toggleClass("left-open"),!1})});$(function(){var r,u,f,e=$(window),t=!1,i=!1,n=$(".navbar");r=function(r){window.innerWidth>=ClickView.Data.Breakpoints.sm||(r&&!t&&!n.hasClass("slide-up")&&e.scrollTop()>=n.height()&&(t=!0,i=!1,n.addClass("slide-up"),window.setTimeout(function(){t=!1},400)),r||i||!n.hasClass("slide-up")||(t=!1,i=!0,n.removeClass("slide-up"),window.setTimeout(function(){i=!1},400)))};u=0;f=function(){if(!window.scrollLock){var n=$(this).scrollTop();r&&r(n>u);u=n}};$(window).scroll(f)}),function(){var n=function(n,t,i){if(n&&n.length&&t&&t.length){i=i||{};var u=$(window),r="sticky",e=n.offset().top,f=function(){if(!window.scrollLock){var o,s=n.height()+e,f=(o=t.offset().top+t.innerHeight(),u.scrollTop()>o&&s<=window.innerHeight&&window.innerWidth>=ClickView.Data.Breakpoints.sm);f&&n.hasClass(r)||!f&&!n.hasClass(r)||f&&i.shouldStick&&!i.shouldStick()||(i.beforeSticky&&i.beforeSticky(f),n.toggleClass(r,f),i.afterSticky&&i.afterSticky(f))}};u.scroll(f);EasyMoney.Events.on("recalculate-sticky-components",f)}};$(function(){var s=$("#body"),f=$(".navbar"),t=$(".sticky-left"),h=$(".sticky-right"),r=$("#top-black-bar"),e=f.outerHeight(),u=20+e,o=function(n){r.css("margin-bottom",n?u+"px":"0")},i;n(f,r,{beforeSticky:o});n(t,r,{afterSticky:function(n){t.css("top",n?u+"px":"");h.css("margin-left",n?t.outerWidth()+"px":"0")},shouldStick:function(){return t.outerHeight()<s.outerHeight()&&t.is(":visible")}});i=$("#sub-nav");i.length&&(u+=i.outerHeight(),n(i,r,{beforeSticky:o,afterSticky:function(n){i.css("top",n?e+"px":"")}}))})}(),function(n,t){function i(t,i){this.o=n.extend({},r,i);this.e=n(t);this.init()}var r={target:"next",mode:"words",speed:"slow",truncate:10,ellipsis:"...",effect:"fade",controlBtn:"",showText:"Show more",hideText:"Hide text",showClass:"show-class",hideClass:"hide-class",atStart:"hide",lockHide:!1,dynamic:!1,changeText:!1,beforeShow:null,afterShow:null,beforeHide:null,afterHide:null};i.prototype={init:function(){var i=this,r;i.mode=i.o.mode;i.remaining={};i.ctrlHtml=' <a href="#" data-ctrl class="'+(n.isFunction(i.o.controlBtn)?"":i.o.controlBtn)+'"><\/a>';n(i.e).each(function(){n(this).data("oCnt",i.e.html());var t=n.isFunction(i.o.atStart)?i.o.atStart.call(i.e):i.o.atStart,t="undefined"!=typeof i.e.attr("data-start")?i.e.attr("data-start"):t;"hide"==t?i.hide(i.e,0):i.show(i.e,0)});n(t).on("resize",function(){i.o.dynamic&&"lines"==i.mode&&(clearTimeout(r),r=setTimeout(function(){i.reInit(i.e)},100))})},show:function(t,i){var r=this,u=n(t),e,o,s;"undefined"==typeof i&&(i=r.o.speed);e=function(){n.isFunction(r.o.afterShow)&&r.o.afterShow.call(r.e,r)};n.isFunction(r.o.beforeShow)&&r.o.beforeShow.call(r.e,r);switch(r.mode){case"chars":case"words":o=u.height();u.html(u.data("tHTML"));s=u.height();u.height(o);u.animate({height:s},i,function(){u.height("auto");e()}).removeClass(r.o.hideClass).addClass(r.o.showClass);u.data("tHTML",u.html());break;case"lines":0==u.children("div").length&&u.wrapInner("<div>");var f=u.children("div"),o=f.height(),s=f.html(u.data("oCnt")).css("height","").height();f.css("height",o);f.animate({height:s},i,function(){f.height("auto");e()});u.removeClass(r.o.hideClass).addClass(r.o.showClass);break;case"block":r.blockMode(u,"show",i,e)}if(r.status=1,!0==r.o.lockHide)return u.find("[data-ctrl]").remove(),"";if("block"==r.mode)u.off("click.coll").on("click.coll",function(n){n.preventDefault();r.hide(u)});else 0!=u.find("[data-ctrl]").length||n.isFunction(r.o.controlBtn)||u.append(r.ctrlHtml),r.ctrlBtn=n.isFunction(r.o.controlBtn)?r.o.controlBtn.call(r.e):n(u.find("[data-ctrl]")),r.ctrlBtn.off("click.coll").on("click.coll",function(n){n.preventDefault();r.hide(u)}).html(r.o.hideText)},hide:function(t,i){var r=this,f=n(t),e,u,o;"undefined"==typeof i&&(i=r.o.speed);e=function(){n.isFunction(r.o.afterHide)&&r.o.afterHide.call(r.e,r)};n.isFunction(r.o.beforeHide)&&r.o.beforeHide.call(r.e,r);f.find("[data-ctrl]").remove();switch(r.mode){case"chars":u=n.trim(f.text());r.remaining.chars=u.length-r.o.truncate;u.length>r.o.truncate&&(f.data("tHTML",f.html()),u=r.pad(u.slice(0,r.o.truncate),u.slice(r.o.truncate,u.length)),f.html(u).removeClass(r.o.showClass).addClass(r.o.hideClass),e());break;case"words":u=n.trim(f.text());u=u.split(" ");r.remaining.words=u.length-r.o.truncate;u.length>r.o.truncate&&(f.data("tHTML",f.html()),u=r.pad(u.slice(0,r.o.truncate).join(" "),u.slice(r.o.truncate,u.length).join(" ")),f.html(u).removeClass(r.o.showClass).addClass(r.o.hideClass),e());break;case"lines":0==f.children("div").length&&f.wrapInner("<div>");u=f.children("div").css("height","");u.html(u.text());o=u.height();"undefined"==typeof f.data("lHeight")?(temp=u.clone(),lHeight=temp.text("a").insertAfter(u).height(),f.data("lHeight",lHeight),u.next().remove()):lHeight=f.data("lHeight");lines=o/lHeight;r.remaining.lines=lines-r.o.truncate;0<r.remaining.lines&&(u.css("overflow","hidden"),u.animate({height:lHeight*r.o.truncate},i).data("tHeight",o),f.removeClass(r.o.showClass).addClass(r.o.hideClass),0!=f.find("[data-ctrl]").length||n.isFunction(r.o.controlBtn)||f.append(r.ctrlHtml),e());break;case"block":r.blockMode(f,"hide",i,e)}r.status=0;"block"==r.mode?f.unbind("click.coll").bind("click.coll",function(n){n.preventDefault();r.show(f)}):(r.ctrlBtn=n.isFunction(r.o.controlBtn)?r.o.controlBtn.call(r.e):n(f.find("[data-ctrl]")),r.ctrlBtn.off("click.coll").on("click.coll",function(n){n.preventDefault();r.show(f)}).html(r.o.showText),e=r.o.showText,u={chars:["character","characters"],words:["word","words"],lines:["lines","lines"]},e=e.replace("%s",r.remaining[r.mode]+(1==r.remaining[r.mode]?" "+u[r.mode][0]:" "+u[r.mode][1])),r.ctrlBtn.html(e))},pad:function(t,i){return t+'<span class="coll-ellipsis">'+this.o.ellipsis+"<\/span>"+(n.isFunction(this.o.ctrlBtn)?"":this.ctrlHtml)+'<span class="coll-hidden" style="display:none">'+i+"<\/span>"},blockMode:function(t,i,r,u){var f=["fadeOut","slideUp","fadeIn","slideDown"],e="fade"==this.o.effect?0:1,f="hide"==i?f[e]:f[e+2];n.isFunction(this.o.target)?this.o.target.call(this.e)[f](r,u):n.fn[this.o.target]&&n(t)[this.o.target]()[f](r,u);"show"==i?(t.removeClass(this.o.showClass).addClass(this.o.hideClass),this.o.changeText&&t.text(this.o.hideText)):(t.removeClass(this.o.hideClass).addClass(this.o.showClass),this.o.changeText&&t.text(this.o.showText))},reInit:function(n){n.find("[data-ctrl]").remove();n.html(this.e.data("oCnt"));0==this.status?this.hide(n,0):this.show(n,0)}};n.fn.collapser=function(t){return this.each(function(){n.data(this,"collapser")||n.data(this,"collapser",new i(this,t))})}}(jQuery,window,document),function(){function lt(){lt=function(){};a.Symbol||(a.Symbol=cr)}function cr(n){return"jscomp_symbol_"+(n||"")+hr++}function d(){lt();var n=a.Symbol.iterator;n||(n=a.Symbol.iterator=a.Symbol("iterator"));"function"!=typeof Array.prototype[n]&&sr(Array.prototype,n,{configurable:!0,writable:!0,value:function(){return fi(this)}});d=function(){}}function fi(n){var t=0;return lr(function(){return t<n.length?{done:!1,value:n[t++]}:{done:!0}})}function lr(n){return d(),n={next:n},n[a.Symbol.iterator]=function(){return this},n}function ei(n){d();lt();d();var t=n[Symbol.iterator];return t?t.call(n):fi(n)}function v(n){if(!(n instanceof Array)){n=ei(n);for(var t,i=[];!(t=n.next()).done;)i.push(t.value);n=i}return n}function ar(n,t){function u(){}var i,r;u.prototype=t.prototype;n.ha=t.prototype;n.prototype=new u;n.prototype.constructor=n;for(i in t)Object.defineProperties?(r=Object.getOwnPropertyDescriptor(t,i),r&&Object.defineProperty(n,i,r)):n[i]=t[i]}function si(n,t){if(n&&1==n.nodeType&&t){if("string"==typeof t||1==t.nodeType)return n==t||hi(n,t);if("length"in t)for(var r=0,i;i=t[r];r++)if(n==i||hi(n,i))return!0}return!1}function hi(n,t){if("string"!=typeof t)return!1;if(oi)return oi.call(n,t);t=n.parentNode.querySelectorAll(t);for(var i=0,r;r=t[i];i++)if(r==n)return!0;return!1}function vr(n){for(var t=[];n&&n.parentNode&&1==n.parentNode.nodeType;)n=n.parentNode,t.push(n);return t}function at(n,t,i){function u(n){var u,e,f,o;if(r.composed&&"function"==typeof n.composedPath)for(e=n.composedPath(),f=0;o=e[f];f++)1==o.nodeType&&si(o,t)&&(u=o);else n:{if((u=n.target)&&1==u.nodeType&&t)for(u=[u].concat(vr(u)),e=0;f=u[e];e++)if(si(f,t)){u=f;break n}u=void 0}u&&i.call(u,n,u)}var f=document,r={composed:!0,S:!0},r=void 0===r?{}:r;return f.addEventListener(n,u,r.S),{j:function(){f.removeEventListener(n,u,r.S)}}}function yr(n){var t={},i,r;if(!n||1!=n.nodeType)return t;if(n=n.attributes,!n.length)return{};for(i=0;r=n[i];i++)t[r.name]=r.value;return t}function o(n){if(n=n&&"."!=n?n:location.href,vt[n])return vt[n];if(i.href=n,"."==n.charAt(0)||"/"==n.charAt(0))return o(i.href);var t="80"==i.port||"443"==i.port?"":i.port,t="0"==t?"":t,r=i.host.replace(pr,"");return vt[n]={hash:i.hash,host:r,hostname:i.hostname,href:i.href,origin:i.origin?i.origin:i.protocol+"//"+r,pathname:"/"==i.pathname.charAt(0)?i.pathname:"/"+i.pathname,port:t,protocol:i.protocol,search:i.search}}function ci(n,t){var i=this;this.context=n;this.P=t;this.f=(this.c=/Task$/.test(t))?n.get(t):n[t];this.b=[];this.a=[];this.g=function(){for(var t=[],n=0;n<arguments.length;++n)t[+n]=arguments[n];return i.a[i.a.length-1].apply(null,[].concat(v(t)))};this.c?n.set(t,this.g):n[t]=this.g}function s(n,t,i){n=ai(n,t);n.b.push(i);li(n)}function h(n,t,i){n=ai(n,t);i=n.b.indexOf(i);-1<i&&(n.b.splice(i,1),0<n.b.length?li(n):n.j())}function li(n){var i,t,r;for(n.a=[],t=0;i=n.b[t];t++)r=n.a[t-1]||n.f.bind(n.context),n.a.push(i(r))}function ai(n,t){var i=g.filter(function(i){return i.context==n&&i.P==t})[0];return i||(i=new ci(n,t),g.push(i)),i}function r(n,i,r,u,f,e){if("function"==typeof u){var o=r.get("buildHitTask");return{buildHitTask:function(t){t.set(n,null,!0);t.set(i,null,!0);u(t,f,e);o(t)}}}return t({},n,i)}function nt(n,t){var i=yr(n),r={};return Object.keys(i).forEach(function(n){if(!n.indexOf(t)&&n!=t+"on"){var u=i[n];"true"==u&&(u=!0);"false"==u&&(u=!1);n=kr(n.slice(t.length));r[n]=u}}),r}function wr(n){"loading"==document.readyState?document.addEventListener("DOMContentLoaded",function t(){document.removeEventListener("DOMContentLoaded",t);n()}):n()}function vi(n,t){var i;return function(){for(var u=[],r=0;r<arguments.length;++r)u[+r]=arguments[r];clearTimeout(i);i=setTimeout(function(){return n.apply(null,[].concat(v(u)))},t)}}function yi(n){function t(){i||(i=!0,n())}var i=!1;return setTimeout(t,2e3),t}function br(n,t){function u(){clearTimeout(i.timeout);i.send&&h(n,"send",i.send);delete tt[r];i.R.forEach(function(n){return n()})}var r=n.get("trackingId"),i=tt[r]=tt[r]||{};clearTimeout(i.timeout);i.timeout=setTimeout(u,0);i.R=i.R||[];i.R.push(t);i.send||(i.send=function(n){return function(){for(var i=[],t=0;t<arguments.length;++t)i[+t]=arguments[t];u();n.apply(null,[].concat(v(i)))}},s(n,"send",i.send))}function kr(n){return n.replace(/[\-\_]+(\w?)/g,function(n,t){return t.toUpperCase()})}function yt(n){return"object"==typeof n&&null!==n}function f(n,t){var i=window.GoogleAnalyticsObject||"ga";window[i]=window[i]||function(){for(var t=[],n=0;n<arguments.length;++n)t[+n]=arguments[n];(window[i].q=window[i].q||[]).push(t)};window.gaDevIds=window.gaDevIds||[];0>window.gaDevIds.indexOf("i5iSjo")&&window.gaDevIds.push("i5iSjo");window[i]("provide",n,t);window.gaplugins=window.gaplugins||{};window.gaplugins[n.charAt(0).toUpperCase()+n.slice(1)]=t}function e(n,t){var i,r;if(n.set("&_av","2.4.1"),i=n.get("&_au"),i=parseInt(i||"0",16).toString(2),i.length<rt)for(r=rt-i.length;r;)i="0"+i,r--;t=rt-t;i=i.substr(0,t)+1+i.substr(t+1);n.set("&_au",parseInt(i||"0",2).toString(16))}function ut(n,i){e(n,u.T);this.a=t({},i);this.g=n;this.b=this.a.stripQuery&&this.a.queryDimensionIndex?"dimension"+this.a.queryDimensionIndex:null;this.f=this.f.bind(this);this.c=this.c.bind(this);s(n,"get",this.f);s(n,"buildHitTask",this.c)}function pi(n,t){var r=o(t.page||t.location),i=r.pathname,u;return n.a.indexFilename&&(u=i.split("/"),n.a.indexFilename==u[u.length-1]&&(u[u.length-1]="",i=u.join("/"))),"remove"==n.a.trailingSlash?i=i.replace(/\/+$/,""):"add"==n.a.trailingSlash&&(/\.\w+$/.test(i)||"/"==i.substr(-1)||(i+="/")),i={page:i+(n.a.stripQuery?gr(n,r.search):r.search)},t.location&&(i.location=t.location),n.b&&(i[n.b]=r.search.slice(1)||"(not set)"),"function"==typeof n.a.urlFieldsFilter?(t=n.a.urlFieldsFilter(i,o),r={page:t.page,location:t.location},n.b&&(r[n.b]=t[n.b]),r):i}function gr(n,t){if(Array.isArray(n.a.queryParamsWhitelist)){var i=[];return t.slice(1).split("&").forEach(function(t){var r=ei(t.split("="));t=r.next().value;r=r.next().value;-1<n.a.queryParamsWhitelist.indexOf(t)&&r&&i.push([t,r])}),i.length?"?"+i.map(function(n){return n.join("=")}).join("&"):""}return""}function pt(n,i){var r=this,f;e(n,u.U);window.addEventListener&&(this.a=t({events:["click"],fieldsObj:{},attributePrefix:"ga-"},i),this.f=n,this.c=this.c.bind(this),f="["+this.a.attributePrefix+"on]",this.b={},this.a.events.forEach(function(n){r.b[n]=at(n,f,r.c)}))}function wi(n,i){var r=this;e(n,u.V);window.IntersectionObserver&&window.MutationObserver&&(this.a=t({rootMargin:"0px",fieldsObj:{},attributePrefix:"ga-"},i),this.c=n,this.M=this.M.bind(this),this.O=this.O.bind(this),this.K=this.K.bind(this),this.L=this.L.bind(this),this.b=null,this.items=[],this.i={},this.h={},wr(function(){r.a.elements&&r.observeElements(r.a.elements)}))}function wt(n,t){var i=[],r={},u={};return t.length&&t.forEach(function(t){t=bi(t);i.push(t);u[t.id]=n.i[t.id]||null;r[t.threshold]=n.h[t.threshold]||null}),{items:i,i:u,h:r}}function bt(n,t,i){1==t.nodeType&&t.id in n.i&&i(t.id);for(var r=0,u;u=t.childNodes[r];r++)bt(n,u,i)}function bi(n){return"string"==typeof n&&(n={id:n}),t({threshold:0,trackFirstImpressionOnly:!0},n)}function ki(){this.a={}}function nu(n,t){(n.a.externalSet=n.a.externalSet||[]).push(t)}function b(n,t){t=void 0===t?{}:t;this.a={};this.b=n;this.w=t;this.l=null}function kt(n,t,i){return n=["autotrack",n,t].join(":"),c[n]||(c[n]=new b(n,i),ft||(window.addEventListener("storage",di),ft=!0)),c[n]}function dt(){if(null!=w)return w;try{window.localStorage.setItem("autotrack","autotrack");window.localStorage.removeItem("autotrack");w=!0}catch(n){w=!1}return w}function gt(n){if(n.l={},dt())try{window.localStorage.removeItem(n.b)}catch(t){}}function di(n){var i=c[n.key],r;i&&(r=t({},i.w,ni(n.oldValue)),n=t({},i.w,ni(n.newValue)),i.l=n,i.ca("externalSet",n,r))}function ni(n){var t={};if(n)try{t=JSON.parse(n)}catch(i){}return t}function et(n,t,i){this.f=n;this.timeout=t||ot;this.timeZone=i;this.b=this.b.bind(this);s(n,"sendHitTask",this.b);try{this.c=new Intl.DateTimeFormat("en-US",{timeZone:this.timeZone})}catch(r){}this.a=kt(n.get("trackingId"),"session",{hitTime:0,isExpired:!1});this.a.get().id||this.a.set({id:it()})}function gi(n,t,i){var r=n.get("trackingId");return k[r]?k[r]:k[r]=new et(n,t,i)}function p(n){return n.a.get().id}function st(n,i){e(n,u.W);window.addEventListener&&(this.b=t({increaseThreshold:20,sessionTimeout:ot,fieldsObj:{}},i),this.f=n,this.c=tr(this),this.g=vi(this.g.bind(this),500),this.o=this.o.bind(this),this.a=kt(n.get("trackingId"),"plugins/max-scroll-tracker"),this.m=gi(n,this.b.sessionTimeout,this.b.timeZone),s(n,"set",this.o),nr(this))}function nr(n){100>(n.a.get()[n.c]||0)&&window.addEventListener("scroll",n.g)}function tr(n){return n=o(n.f.get("page")||n.f.get("location")),n.pathname+n.search}function ii(n,i){e(n,u.X);window.matchMedia&&(this.a=t({changeTemplate:this.changeTemplate,changeTimeout:1e3,fieldsObj:{}},i),yt(this.a.definitions)&&(i=this.a.definitions,this.a.definitions=Array.isArray(i)?i:[i],this.b=n,this.c=[],tu(this)))}function tu(n){n.a.definitions.forEach(function(t){if(t.name&&t.dimensionIndex){var i=ir(t);n.b.set("dimension"+t.dimensionIndex,i);iu(n,t)}})}function ir(n){var t;return n.items.forEach(function(n){rr(n.media).matches&&(t=n)}),t?t.name:"(not set)"}function iu(n,t){t.items.forEach(function(i){i=rr(i.media);var u=vi(function(){var i=ir(t),u=n.b.get("dimension"+t.dimensionIndex);i!==u&&(n.b.set("dimension"+t.dimensionIndex,i),i={transport:"beacon",eventCategory:t.name,eventAction:"change",eventLabel:n.a.changeTemplate(u,i),nonInteraction:!0},n.b.send("event",r(i,n.a.fieldsObj,n.b,n.a.hitFilter)))},n.a.changeTimeout);i.addListener(u);n.c.push({fa:i,da:u})})}function rr(n){return ti[n]||(ti[n]=window.matchMedia(n))}function ht(n,i){e(n,u.Y);window.addEventListener&&(this.a=t({formSelector:"form",shouldTrackOutboundForm:this.shouldTrackOutboundForm,fieldsObj:{},attributePrefix:"ga-"},i),this.b=n,this.c=at("submit",this.a.formSelector,this.f.bind(this)))}function ct(n,i){var r=this;e(n,u.Z);window.addEventListener&&(this.a=t({events:["click"],linkSelector:"a, area",shouldTrackOutboundLink:this.shouldTrackOutboundLink,fieldsObj:{},attributePrefix:"ga-"},i),this.c=n,this.f=this.f.bind(this),this.b={},this.a.events.forEach(function(n){r.b[n]=at(n,r.a.linkSelector,r.f)}))}function ur(n,i){var f=this;e(n,u.$);document.visibilityState&&(this.a=t({sessionTimeout:ot,visibleThreshold:5e3,sendInitialPageview:!1,fieldsObj:{}},i),this.b=n,this.g=document.visibilityState,this.m=null,this.o=!1,this.v=this.v.bind(this),this.s=this.s.bind(this),this.G=this.G.bind(this),this.N=this.N.bind(this),this.c=kt(n.get("trackingId"),"plugins/page-visibility-tracker"),nu(this.c,this.N),this.f=gi(n,this.a.sessionTimeout,this.a.timeZone),s(n,"set",this.v),window.addEventListener("unload",this.G),document.addEventListener("visibilitychange",this.s),br(this.b,function(){if("visible"==document.visibilityState)f.a.sendInitialPageview&&(ri(f,{ea:!0}),f.o=!0),f.c.set({time:+new Date,state:"visible",pageId:l,sessionId:p(f.f)});else if(f.a.sendInitialPageview&&f.a.pageLoadsMetricIndex){var n={},n=(n.transport="beacon",n.eventCategory="Page Visibility",n.eventAction="page load",n.eventLabel="(not set)",n["metric"+f.a.pageLoadsMetricIndex]=1,n.nonInteraction=!0,n);f.b.send("event",r(n,f.a.fieldsObj,f.b,f.a.hitFilter))}}))}function ru(n){var t=n.c.get();return"visible"==n.g&&"hidden"==t.state&&t.pageId!=l&&(t.state="visible",t.pageId=l,n.c.set(t)),t}function fr(n,t,i){i=(i?i:{}).hitTime;var u={hitTime:i},u=(u?u:{}).hitTime;(t=t.time?(u||+new Date)-t.time:0)&&t>=n.a.visibleThreshold&&(t=Math.round(t/1e3),u={transport:"beacon",nonInteraction:!0,eventCategory:"Page Visibility",eventAction:"track",eventValue:t,eventLabel:"(not set)"},i&&(u.queueTime=+new Date-i),n.a.visibleMetricIndex&&(u["metric"+n.a.visibleMetricIndex]=t),n.b.send("event",r(u,n.a.fieldsObj,n.b,n.a.hitFilter)))}function ri(n,t){var i=t?t:{},u;t=i.hitTime;i=i.ea;u={transport:"beacon"};t&&(u.queueTime=+new Date-t);i&&n.a.pageLoadsMetricIndex&&(u["metric"+n.a.pageLoadsMetricIndex]=1);n.b.send("pageview",r(u,n.a.fieldsObj,n.b,n.a.hitFilter))}function er(n,i){e(n,u.aa);window.addEventListener&&(this.a=t({fieldsObj:{},hitFilter:null},i),this.b=n,this.u=this.u.bind(this),this.J=this.J.bind(this),this.D=this.D.bind(this),this.A=this.A.bind(this),this.B=this.B.bind(this),this.F=this.F.bind(this),"complete"!=document.readyState?window.addEventListener("load",this.u):this.u())}function uu(n){try{window.twttr.ready(function(){window.twttr.events.unbind("tweet",n.D);window.twttr.events.unbind("follow",n.A)})}catch(t){}}function or(n,i){e(n,u.ba);history.pushState&&window.addEventListener&&(this.a=t({shouldTrackUrlChange:this.shouldTrackUrlChange,trackReplaceState:!1,fieldsObj:{},hitFilter:null},i),this.b=n,this.c=location.pathname+location.search,this.H=this.H.bind(this),this.I=this.I.bind(this),this.C=this.C.bind(this),s(history,"pushState",this.H),s(history,"replaceState",this.I),window.addEventListener("popstate",this.C))}function ui(n,t){setTimeout(function(){var u=n.c,i=location.pathname+location.search;u!=i&&n.a.shouldTrackUrlChange.call(n,i,u)&&(n.c=i,n.b.set({page:i,title:document.title}),(t||n.a.trackReplaceState)&&n.b.send("pageview",r({transport:"beacon"},n.a.fieldsObj,n.b,n.a.hitFilter)))},0)}var n,sr="function"==typeof Object.defineProperties?Object.defineProperty:function(n,t,i){if(i.get||i.set)throw new TypeError("ES3 does not support getters and setters.");n!=Array.prototype&&n!=Object.prototype&&(n[t]=i.value)},a="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this,hr=0,y=window.Element.prototype,oi=y.matches||y.matchesSelector||y.webkitMatchesSelector||y.mozMatchesSelector||y.msMatchesSelector||y.oMatchesSelector,pr=/:(80|443)$/,i=document.createElement("a"),vt={},g=[],tt,t,it,u,rt,c,ft,w,k,ot,ti,l;ci.prototype.j=function(){var n=g.indexOf(this);-1<n&&(g.splice(n,1),this.c?this.context.set(this.P,this.f):this.context[this.P]=this.f)};tt={};t=Object.assign||function(n){for(var f,r,u,i=[],t=1;t<arguments.length;++t)i[t-1]=arguments[t];for(t=0,f=i.length;t<f;t++){r=Object(i[t]);for(u in r)Object.prototype.hasOwnProperty.call(r,u)&&(n[u]=r[u])}return n};it=function dr(n){return n?(n^16*Math.random()>>n/4).toString(16):"10000000-1000-4000-8000-100000000000".replace(/[018]/g,dr)};u={T:1,U:2,V:3,X:4,Y:5,Z:6,$:7,aa:8,ba:9,W:10};rt=Object.keys(u).length;ut.prototype.f=function(n){var t=this;return function(i){if("page"==i||i==t.b){var r={location:n("location"),page:n("page")};return pi(t,r)[i]}return n(i)}};ut.prototype.c=function(n){var t=this;return function(i){var r=pi(t,{location:i.get("location"),page:i.get("page")});i.set(r,null,!0);n(i)}};ut.prototype.remove=function(){h(this.g,"get",this.f);h(this.g,"buildHitTask",this.c)};f("cleanUrlTracker",ut);pt.prototype.c=function(n,i){var u=this.a.attributePrefix,f;0>i.getAttribute(u+"on").split(/\s*,\s*/).indexOf(n.type)||(u=nt(i,u),f=t({},this.a.fieldsObj,u),this.f.send(u.hitType||"event",r({transport:"beacon"},f,this.f,this.a.hitFilter,i,n)))};pt.prototype.remove=function(){var n=this;Object.keys(this.b).forEach(function(t){n.b[t].j()})};f("eventTracker",pt);n=wi.prototype;n.observeElements=function(n){var i=this;n=wt(this,n);this.items=this.items.concat(n.items);this.i=t({},n.i,this.i);this.h=t({},n.h,this.h);n.items.forEach(function(n){var t=i.h[n.threshold]=i.h[n.threshold]||new IntersectionObserver(i.O,{rootMargin:i.a.rootMargin,threshold:[+n.threshold]});(n=i.i[n.id]||(i.i[n.id]=document.getElementById(n.id)))&&t.observe(n)});this.b||(this.b=new MutationObserver(this.M),this.b.observe(document.body,{childList:!0,subtree:!0}));requestAnimationFrame(function(){})};n.unobserveElements=function(n){var r=[],u=[],t,i;this.items.forEach(function(t){n.some(function(n){return n=bi(n),n.id===t.id&&n.threshold===t.threshold&&n.trackFirstImpressionOnly===t.trackFirstImpressionOnly})?u.push(t):r.push(t)});r.length?(t=wt(this,r),i=wt(this,u),this.items=t.items,this.i=t.i,this.h=t.h,u.forEach(function(n){if(!t.i[n.id]){var u=i.h[n.threshold],r=i.i[n.id];r&&u.unobserve(r);t.h[n.threshold]||i.h[n.threshold].disconnect()}})):this.unobserveAllElements()};n.unobserveAllElements=function(){var n=this;Object.keys(this.h).forEach(function(t){n.h[t].disconnect()});this.b.disconnect();this.b=null;this.items=[];this.i={};this.h={}};n.M=function(n){for(var u,t,i,r=0;u=n[r];r++){for(t=0;i=u.removedNodes[t];t++)bt(this,i,this.L);for(t=0;i=u.addedNodes[t];t++)bt(this,i,this.K)}};n.O=function(n){for(var o,h,u,i,f,c,e=[],s=0;o=n[s];s++)for(h=0;u=this.items[h];h++)(i=o.target.id===u.id)&&((i=u.threshold)?i=o.intersectionRatio>=i:(i=o.intersectionRect,i=0<i.top||0<i.bottom||0<i.left||0<i.right)),i&&(f=u.id,i=document.getElementById(f),f={transport:"beacon",eventCategory:"Viewport",eventAction:"impression",eventLabel:f,nonInteraction:!0},c=t({},this.a.fieldsObj,nt(i,this.a.attributePrefix)),this.c.send("event",r(f,c,this.c,this.a.hitFilter,i)),u.trackFirstImpressionOnly&&e.push(u));e.length&&this.unobserveElements(e)};n.K=function(n){var t=this,i=this.i[n]=document.getElementById(n);this.items.forEach(function(r){n==r.id&&t.h[r.threshold].observe(i)})};n.L=function(n){var t=this,i=this.i[n];this.items.forEach(function(r){n==r.id&&t.h[r.threshold].unobserve(i)});this.i[n]=null};n.remove=function(){this.unobserveAllElements()};f("impressionTracker",wi);ki.prototype.ca=function(n){for(var i=[],t=1;t<arguments.length;++t)i[t-1]=arguments[t];(this.a[n]=this.a[n]||[]).forEach(function(n){return n.apply(null,[].concat(v(i)))})};c={};ft=!1;ar(b,ki);b.prototype.get=function(){if(this.l)return this.l;if(dt())try{this.l=ni(window.localStorage.getItem(this.b))}catch(n){}return this.l=t({},this.w,this.l)};b.prototype.set=function(n){if(this.l=t({},this.w,this.l,n),dt())try{var i=JSON.stringify(this.l);window.localStorage.setItem(this.b,i)}catch(r){}};b.prototype.j=function(){delete c[this.b];Object.keys(c).length||(window.removeEventListener("storage",di),ft=!1)};k={};et.prototype.isExpired=function(n){if((n=void 0===n?p(this):n,n!=p(this))||(n=this.a.get(),n.isExpired))return!0;var t=n.hitTime;return t&&(n=new Date,t=new Date(t),n-t>6e4*this.timeout||this.c&&this.c.format(n)!=this.c.format(t))?!0:!1};et.prototype.b=function(n){var t=this;return function(i){var u,r;n(i);u=i.get("sessionControl");i="start"==u||t.isExpired();u="end"==u;r=t.a.get();r.hitTime=+new Date;i&&(r.isExpired=!1,r.id=it());u&&(r.isExpired=!0);t.a.set(r)}};et.prototype.j=function(){h(this.f,"sendHitTask",this.b);this.a.j();delete k[this.f.get("trackingId")]};ot=30;st.prototype.g=function(){var t=document.documentElement,n=document.body,t=Math.min(100,Math.max(0,Math.round(window.pageYOffset/(Math.max(t.offsetHeight,t.scrollHeight,n.offsetHeight,n.scrollHeight)-window.innerHeight)*100))),n=p(this.m),i;n!=this.a.get().sessionId&&(gt(this.a),this.a.set({sessionId:n}));this.m.isExpired(this.a.get().sessionId)?gt(this.a):(n=this.a.get()[this.c]||0,t>n&&(100!=t&&100!=n||window.removeEventListener("scroll",this.g),n=t-n,100==t||n>=this.b.increaseThreshold))&&(i={},this.a.set((i[this.c]=t,i.sessionId=p(this.m),i)),t={transport:"beacon",eventCategory:"Max Scroll",eventAction:"increase",eventValue:n,eventLabel:String(t),nonInteraction:!0},this.b.maxScrollMetricIndex&&(t["metric"+this.b.maxScrollMetricIndex]=n),this.f.send("event",r(t,this.b.fieldsObj,this.f,this.b.hitFilter)))};st.prototype.o=function(n){var t=this;return function(i,r){n(i,r);var u={};(yt(i)?i:(u[i]=r,u)).page&&(i=t.c,t.c=tr(t),t.c!=i&&nr(t))}};st.prototype.remove=function(){this.m.j();window.removeEventListener("scroll",this.g);h(this.f,"set",this.o)};f("maxScrollTracker",st);ti={};ii.prototype.remove=function(){for(var t=0,n;n=this.c[t];t++)n.fa.removeListener(n.da)};ii.prototype.changeTemplate=function(n,t){return n+" => "+t};f("mediaQueryTracker",ii);ht.prototype.f=function(n,i){var u={transport:"beacon",eventCategory:"Outbound Form",eventAction:"submit",eventLabel:o(i.action).href},f;this.a.shouldTrackOutboundForm(i,o)&&(navigator.sendBeacon||(n.preventDefault(),u.hitCallback=yi(function(){i.submit()})),f=t({},this.a.fieldsObj,nt(i,this.a.attributePrefix)),this.b.send("event",r(u,f,this.b,this.a.hitFilter,i,n)))};ht.prototype.shouldTrackOutboundForm=function(n,t){return n=t(n.action),n.hostname!=location.hostname&&"http"==n.protocol.slice(0,4)};ht.prototype.remove=function(){this.c.j()};f("outboundFormTracker",ht);ct.prototype.f=function(n,i){var h=this,f;if(this.a.shouldTrackOutboundLink(i,o)){var e=i.getAttribute("href")||i.getAttribute("xlink:href"),s=o(e),s={transport:"beacon",eventCategory:"Outbound Link",eventAction:n.type,eventLabel:s.href},c=t({},this.a.fieldsObj,nt(i,this.a.attributePrefix)),u=r(s,c,this.c,this.a.hitFilter,i,n);navigator.sendBeacon||"click"!=n.type||"_blank"==i.target||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||1<n.which?this.c.send("event",u):(f=function(){if(window.removeEventListener("click",f),!n.defaultPrevented){n.preventDefault();var t=u.hitCallback;u.hitCallback=yi(function(){"function"==typeof t&&t();location.href=e})}h.c.send("event",u)},window.addEventListener("click",f))}};ct.prototype.shouldTrackOutboundLink=function(n,t){return n=n.getAttribute("href")||n.getAttribute("xlink:href"),t=t(n),t.hostname!=location.hostname&&"http"==t.protocol.slice(0,4)};ct.prototype.remove=function(){var n=this;Object.keys(this.b).forEach(function(t){n.b[t].j()})};f("outboundLinkTracker",ct);l=it();n=ur.prototype;n.s=function(){var i=this,n,t;("visible"==document.visibilityState||"hidden"==document.visibilityState)&&(n=ru(this),t={time:+new Date,state:document.visibilityState,pageId:l,sessionId:p(this.f)},"visible"==document.visibilityState&&this.a.sendInitialPageview&&!this.o&&(ri(this),this.o=!0),"hidden"==document.visibilityState&&this.m&&clearTimeout(this.m),this.f.isExpired(n.sessionId)?(gt(this.c),"hidden"==this.g&&"visible"==document.visibilityState&&(clearTimeout(this.m),this.m=setTimeout(function(){i.c.set(t);ri(i,{hitTime:t.time})},this.a.visibleThreshold))):(n.pageId==l&&"visible"==n.state&&fr(this,n),this.c.set(t)),this.g=document.visibilityState)};n.v=function(n){var t=this;return function(i,r){var u={},u=yt(i)?i:(u[i]=r,u);u.page&&u.page!==t.b.get("page")&&"visible"==t.g&&t.s();n(i,r)}};n.N=function(n,t){n.time!=t.time&&(t.pageId!=l||"visible"!=t.state||this.f.isExpired(t.sessionId)||fr(this,t,{hitTime:n.time}))};n.G=function(){"hidden"!=this.g&&this.s()};n.remove=function(){this.c.j();this.f.j();h(this.b,"set",this.v);window.removeEventListener("unload",this.G);document.removeEventListener("visibilitychange",this.s)};f("pageVisibilityTracker",ur);n=er.prototype;n.u=function(){if(window.FB)try{window.FB.Event.subscribe("edge.create",this.B);window.FB.Event.subscribe("edge.remove",this.F)}catch(n){}window.twttr&&this.J()};n.J=function(){var n=this;try{window.twttr.ready(function(){window.twttr.events.bind("tweet",n.D);window.twttr.events.bind("follow",n.A)})}catch(t){}};n.D=function(n){if("tweet"==n.region){var t={transport:"beacon",socialNetwork:"Twitter",socialAction:"tweet",socialTarget:n.data.url||n.target.getAttribute("data-url")||location.href};this.b.send("social",r(t,this.a.fieldsObj,this.b,this.a.hitFilter,n.target,n))}};n.A=function(n){if("follow"==n.region){var t={transport:"beacon",socialNetwork:"Twitter",socialAction:"follow",socialTarget:n.data.screen_name||n.target.getAttribute("data-screen-name")};this.b.send("social",r(t,this.a.fieldsObj,this.b,this.a.hitFilter,n.target,n))}};n.B=function(n){this.b.send("social",r({transport:"beacon",socialNetwork:"Facebook",socialAction:"like",socialTarget:n},this.a.fieldsObj,this.b,this.a.hitFilter))};n.F=function(n){this.b.send("social",r({transport:"beacon",socialNetwork:"Facebook",socialAction:"unlike",socialTarget:n},this.a.fieldsObj,this.b,this.a.hitFilter))};n.remove=function(){window.removeEventListener("load",this.u);try{window.FB.Event.unsubscribe("edge.create",this.B);window.FB.Event.unsubscribe("edge.remove",this.F)}catch(n){}uu(this)};f("socialWidgetTracker",er);n=or.prototype;n.H=function(n){var t=this;return function(){for(var r=[],i=0;i<arguments.length;++i)r[+i]=arguments[i];n.apply(null,[].concat(v(r)));ui(t,!0)}};n.I=function(n){var t=this;return function(){for(var r=[],i=0;i<arguments.length;++i)r[+i]=arguments[i];n.apply(null,[].concat(v(r)));ui(t,!1)}};n.C=function(){ui(this,!0)};n.shouldTrackUrlChange=function(n,t){return!(!n||!t)};n.remove=function(){h(history,"pushState",this.H);h(history,"replaceState",this.I);window.removeEventListener("popstate",this.C)};f("urlChangeTracker",or)}();!function(n){"use strict";var t=n.Shared;$(function(){var u,f,e,i,r,o;n.Data.User.username&&!n.Data.IsEmbeddedView&&(u=t.Utils.LocalStorageHelper.cacheGet("adm:migration:attempt"),t.Utils.LocalStorageHelper.cacheRemove("adm:migration:attempt"),f=n.Data.User.masterRole,e=t.Utils.Constants.ENUMS.MASTER_ROLES.ADMIN,u&&f!==e)&&(i="https://www.clickviewsupport.com/hc/en-us/articles/115013505868-New-ADM-Instructions#"+n.Data.Config.region.code.toLowerCase(),r='<p>We encountered an issue while upgrading your account to an administrator.<\/p><p>This was most likely because of an issue with your SSO set up. Please refer to our <a href="'+i+'" target="_blank">knowledge base article<\/a> for information on how to proceed. <\/p>',n.Data.User.role!==2&&n.Data.User.role!==3&&(r='<p>The account you tried to login with is a student account. Only Staff accounts can be set as administrators. Please sign in with a staff account or for more information about the new ADM setup, please see our <a href="'+i+'" target="_blank">knowledge base article<\/a>.<\/p>'),o={title:"Attention!",content:r,className:"adm-migration-warning",buttons:[{text:"Ok",className:"btn primary",success:!0}]},n.Utils.Dialog(o))})}(ClickView),function(n,t){"use strict";var i={GET:"GET",POST:"POST",PUT:"PUT",DELETE:"DELETE"},u=function(n){var i=t.Shared.Helpers.ParseUrl(n);return i.protocol==="http:"&&(i.protocol="https:"),i.href},r=function(){var t=this instanceof r?this:Object.create(r.prototype);return n.ajaxSetup({cache:!1,contentType:"application/json; charset=utf-8"}),t};r.prototype={base:function(t,r,f,e){f=f||i.GET;var s=_.defaults(e||{},{forceHttps:!1}),o={url:t,method:f,type:f};return r&&(o.data=f===i.POST||f===i.PUT?JSON.stringify(r):r),!s.forceHttps||(o.url=u(o.url)),s.traditional&&(o.traditional=!!s.traditional),n.ajax(o)},get:function(n,t,r){return this.base(n,t,i.GET,r)},post:function(n,t,r){return this.base(n,t,i.POST,r)},put:function(n,t,r){return this.base(n,t,i.PUT,r)},httpDelete:function(n,t){return this.base(n,null,i.DELETE,t)}};t.Shared.Utils.AjaxHelper=new r}(jQuery,ClickView),function(n,t,i,r){"use strict";var f=function(){var n=this instanceof f?this:Object.create(f.prototype);return n.url="/analytics/log-event",n.eventNames={login:"login",loginFailure:"login:fail",ssoRedirect:"login:ssoRedirect",requestPassword:"login:requestPassword",redirectCancel:"login:cancelRedirect",changePassword:"changePassword",videoWatched:"videoWatched",videoWatchedUnload:"videoWatched:unload",userAction:"userAction",search:"search",wwylttt:"wwylttt",frontPageAction:"frontPageAction",inviteColleague:"inviteColleague",exchangeAddToWorkspace:"exchange:addToWorkspace",interactiveCreate:"interactive:create",interactiveCreateStep:"interactive:create:step",interactiveCreateBack:"interactive:create:back",interactiveCreateFinalAction:"interactive:create:finalAction",interactiveCreateAbandon:"interactive:create:abandon",interactiveInteractionAction:"interactive:interaction:action",interactiveAnalyticsPage:"interactive:analytics",interactiveMarkingPage:"interactive:marking",interactiveMarkAnswer:"interactive:marking:answer",interactiveViewPublicEmbed:"interactive:view:publicembed",interactiveView:"interactive:view",workspaceBulkAction:"workspace:bulkAction",workspaceDragAndDrop:"workspace:dragAndDrop",workspaceFolderAction:"workspace:folderAction",workspaceEditMetadata:"workspace:editMetadata",workspacePublicStudentShare:"workspace:publicStudentShare",playlistPublicSharing:"playlist:publicSharing",playlistCreate:"playlist:create",playlistDelete:"playlist:delete",playlistAdd:"playlist:addVideo",playlistRemove:"playlist:removeVideo",pushToPublisher:"pushto:publisher",deviceStart:"device:start",deviceClose:"device:close",devicePlay:"device:play",deviceStop:"device:stop",deviceError:"device:error",campaignConvert:"campaign:convert",campaignAbandon:"campaign:abandon",emailCampaignSubscribe:"campaign:subscribe:email",marketingNotification:"marketing:notification",downloadResource:"downloadResource",heroItemClick:"hero-item-click",heroItemNavigate:"hero-item-navigate",easySlideClick:"easyslide:click",easySlideNavigate:"easyslide:navigate",libraryClick:"library:click",libraryCategorySelect:"library:category-select",breadcrumbSelect:"breadcrumb:select",curriculumSearch:"albert:curriculumSearch",watchAlbertResultVideo:"albert:watchVideo",openViewCurriculumLink:"albert:openCurriculumView",filterSearch:"albert:filterSearch",addKeyword:"albert:addKeyword",addTag:"albert:addTag",removeKeyword:"albert:removeKeyword",removeTag:"albert:removeTag",sortResult:"albert:sortResult",saveSearch:"albert:savedSearch:add",removeSavedSearch:"albert:savedSearch:remove",openAlbertEmailRequest:"albert:requestEmail:open",sendAlbertEmailRequest:"albert:requestEmail:send",curriculumSearchEmptyState:"albert:curriculumSearch:empty",requestTvProgramme:"tvguide:programme:request",request247:"tvguide:request247",tvIssue:"tvguide:issue",tvProgrammeDetails:"tvguide:programme:details",tvProgrammeShare:"tvguide:programme:share",downloadPdfClick:"downloadPdf:click",libraryReviewAction:"library_review:action",manageUserProfile:"manage:user:profile",manageUserAccount:"manage:user:account",manageSchoolLibraries:"manage:school:libraries",manageSchoolLocalCache:"manage:school:localcache",instantSearch:"search:instant",removeRecentSearch:"search:removeRecent",searchFilter:"search:filter",emptyResults:"search:emptyResults",searchLanding:"search:landing",videoClickthrough:"video:clickthrough",localCacheDownload:"video:localcache:download"},n},u;r.extend(f.prototype,{logEvent:function(n,t){return u(n,t)},logVideoWatch:function(n,t,u){var e,f,o;if(!(n instanceof ClickView.Shared.Models.MasterVideo))throw new Error("Can only log instances of ClickView.Shared.Models.MasterVideo");if(e=this._getLibraryName(n),f=n.get("trackingCode"),i&&i.cacheExists("p:"+f))return!1;o={video:r.extend({},this._toLogVideo(n,t),u),client:this._getClientData(),service:e,shared:!!ClickView.Data._bootstrap.sharecode,shareCode:ClickView.Data._bootstrap.sharecode};delete ClickView.Data._bootstrap.sharecode;this.logEvent(this.eventNames.videoWatched,o);i&&i.cacheSet("p:"+f,null,300)},logVideoWatchUnload:function(n){u(this.eventNames.videoWatchedUnload,n)},logLogin:function(n){u(this.eventNames.login,n)},logLoginFail:function(n){u(this.eventNames.loginFailure,n)},logSsoRedirect:function(n){n.From&&$.ajax({url:"/sso/setSsoRedirectSource",type:"GET",async:!0,data:{from:n.From}});u(this.eventNames.ssoRedirect,n)},logCancelRedirect:function(n){u(this.eventNames.cancelRedirect,n)},logRequestPassword:function(n){u(this.eventNames.requestPassword,n)},logChangePassword:function(n){u(this.eventNames.changePassword,n)},logUserAction:function(n){u(this.eventNames.userAction,n)},logWwylttt:function(n){u(this.eventNames.wwylttt,n)},logFrontPageAction:function(n){u(this.eventNames.frontPageAction,n)},logInviteColleague:function(n){u(this.eventNames.inviteColleague,n)},logSearch:function(n){u(this.eventNames.search,n)},logInstantSearch:function(n){u(this.eventNames.instantSearch,n)},logRemoveRecentSearch:function(n){u(this.eventNames.removeRecentSearch,n)},logSearchFilter:function(n){u(this.eventNames.searchFilter,n)},logSearchEmptyResults:function(n){u(this.eventNames.emptyResults,n)},logSearchLanding:function(){u(this.eventNames.searchLanding)},logVideoClickthrough:function(n,t){n||(n={});t||(t={});var f=this._logMediaCollection(n.mediaCollection),e=this._logAreaData(n.area),i=this._toLogVideo(n.video,{origin:!0,position:!0}),o={clickthrough:n.clickthrough};t.origin&&(i=r.extend({},i,{origin:t.origin}));u(this.eventNames.videoClickthrough,r.extend({},f,e,{video:i},o))},logExchangeAddToWorkspace:function(n){u(this.eventNames.exchangeAddToWorkspace,n)},logInteractiveCreate:function(n){u(this.eventNames.interactiveCreate,r.omit(n.toJSON(),"video","owner"))},logInteractiveCreateStep:function(n,t){var i={step:n,interactive:r.omit(t.toJSON(),"video","owner")};u(this.eventNames.interactiveCreateStep,i)},logInteractiveCreateBack:function(n,t){var i={fromStep:n,interactive:r.omit(t.toJSON(),"video","owner")};u(this.eventNames.interactiveCreateBack,i)},logInteractiveCreateAbandon:function(n){var t={location:n};u(this.eventNames.interactiveCreateAbandon,t)},logInteractiveInteractionAction:function(n,t){var i={action:n,interaction:r.omit(t.toJSON(),"data","type","actionableItems")};u(this.eventNames.interactiveInteractionAction,i)},logInteractiveCreateFinalAction:function(n,t){var i={action:n,interactive:r.omit(t.toJSON(),"video","owner")};u(this.eventNames.interactiveCreateFinalAction,i)},logInteractiveAnalyticsPage:function(n){u(this.eventNames.interactiveAnalyticsPage,r.omit(n.toJSON(),"video","owner"))},logInteractiveMarkingPage:function(n){u(this.eventNames.interactiveMarkingPage,r.omit(n.toJSON(),"video","owner"))},logInteractiveMarkAnswer:function(n,t){var i={interactive:r.omit(n.toJSON(),"video","owner"),answer:t.toJSON()};u(this.eventNames.interactiveMarkAnswer,i)},logInteractiveViewPublicEmbed:function(n){u(this.eventNames.interactiveViewPublicEmbed,{interactiveId:n})},logInteractiveView:function(n){u(this.eventNames.interactiveView,n)},logWorkspaceDragAndDrop:function(n){u(this.eventNames.workspaceDragAndDrop,r.omit(n.toJSON(),"videos","categories","category","interactives","libraries","metadata","year"))},logWorkspaceBulkAction:function(n,t){var i={action:n,number:t};u(this.eventNames.workspaceBulkAction,i)},logWorkspaceFolderAction:function(n,t){var i={action:n,folder:r.omit(t.toJSON(),"videos","categories")};u(this.eventNames.workspaceFolderAction,i)},logWorkspaceEditMetadata:function(n,t){var i={property:n,object:r.omit(t.toJSON(),"category","interactives","libraries","metadata","year")};u(this.eventNames.workspaceEditMetadata,i)},logWorkspacePublicStudentShare:function(n){u(this.eventNames.workspacePublicStudentShare,r.omit(n.toJSON(),"category","interactives","libraries","metadata","year"))},logPlaylistPublicSharing:function(n){u(this.eventNames.playlistPublicSharing,r.omit(n.toJSON(),"videos"))},logPlaylistCreate:function(n,t){var i={name:n,module:t};u(this.eventNames.playlistCreate,i)},logPlaylistDelete:function(n,t){var i={name:n,module:t};u(this.eventNames.playlistDelete,i)},logPlaylistAdd:function(n,t,i,r,f){var e={playlist:{id:n,name:t},video:{id:i,name:r},module:f};u(this.eventNames.playlistAdd,e)},logPlaylistRemove:function(n,t,i,r,f){var e={playlist:{id:n,name:t},video:{id:i,name:r},module:f};u(this.eventNames.playlistRemove,e)},logPushToPubliser:function(n,t){var i={video:n,module:t};u(this.eventNames.pushToPublisher,i)},logCampaignConvert:function(n,t){var i={campaignName:n,viewTime:t};u(this.eventNames.campaignConvert,i)},logCampaignAbandon:function(n,t){var i={campaignName:n,viewTime:t};u(this.eventNames.campaignAbandon,i)},logEmailCampaignSubscribe:function(n){u(this.eventNames.emailCampaignSubscribe,n)},logDeviceStart:function(n,t){var i={trackingCode:n,videoTitle:t};u(this.eventNames.deviceStart,i)},logDeviceClose:function(n,t){var i={closeType:n,location:t};u(this.eventNames.deviceClose,i)},logDevicePlay:function(n,t,i,r){var f={deviceId:n,trackingCode:t,videoTitle:i,videoChapter:r};u(this.eventNames.devicePlay,f)},logDeviceStop:function(n,t,i,r,f){var e={deviceId:n,trackingCode:t,videoTitle:i,videoChapter:r,videoTime:f};u(this.eventNames.deviceStop,e)},logDeviceError:function(n,t){var i={errorCode:n,errorMsg:t};u(this.eventNames.deviceError,i)},logEasySlideClick:function(n){u(this.eventNames.easySlideClick,n)},logEasySlideNavigate:function(n){u(this.eventNames.easySlideNavigate,n)},logHeroItemClick:function(n){u(this.eventNames.heroItemClick,n)},logHeroNavigation:function(n){u(this.eventNames.heroItemNavigate,n)},logLibraryClick:function(n){u(this.eventNames.libraryClick,n)},logLibraryCategorySelect:function(n){u(this.eventNames.libraryCategorySelect,n)},logBreadcrumbSelect:function(n){u(this.eventNames.breadcrumbSelect,n)},logMarketingNotification:function(n){var t=r.omit(n.toJSON(),"deleted","status","timestamp","type","typeId");u(this.eventNames.marketingNotification,t)},logDownloadResource:function(n){u(this.eventNames.downloadResource,n)},logCurriculumSearch:function(n){var t={learningArea:r.pick(n,"id","type","typeString","parentId","selectedName","learningAreaType"),searchFrom:n.from,referredFrom:n.referredFrom};u(this.eventNames.curriculumSearch,t)},logAlbertWatchVideo:function(n){var t={learningArea:r.pick(n.learningArea,"id","type","typeString","parentId","selectedName","learningAreaType"),video:n.video,keywords:n.keywords&&n.keywords.length>0?n.keywords.join(","):"",tags:n.tags&&n.tags.length>0?n.tags.join(","):"",currentPage:n.currentPage,sortBy:n.sortBy};t.learningArea.parentId=t.learningArea.parentId?t.learningArea.parentId:"00000000-0000-0000-0000-000000000000";u(this.eventNames.watchAlbertResultVideo,t)},logViewCurriculumLink:function(n){var t={learningArea:r.pick(n.learningArea,"id","type","typeString","parentId","selectedName","learningAreaType"),video:n.video};t.learningArea.parentId=t.learningArea.parentId?t.learningArea.parentId:"00000000-0000-0000-0000-000000000000";u(this.eventNames.openViewCurriculumLink,t)},logFilterSearch:function(n){n.kw&&!r.isArray(n.kw)&&(n.kw=[n.kw]);n.t&&!r.isArray(n.t)&&(n.t=[n.t]);var t={learningArea:r.pick(n,"id","type","typeString","parentId","selectedName","learningAreaType"),keywords:n.kw&&n.kw.length>0?n.kw.join(","):"",tags:n.t&&n.t.length>0?n.t.join(","):""};u(this.eventNames.filterSearch,t)},logSortResult:function(n){var t={learningArea:r.pick(n,"id","type","typeString","parentId","selectedName","learningAreaType"),sortOption:n.sort};u(this.eventNames.sortResult,t)},logAddKeyword:function(n){var t={learningArea:r.pick(n,"id","type","typeString","parentId","selectedName","learningAreaType"),keyword:{origin:n.origin,title:n.title}};u(this.eventNames.addKeyword,t)},logAddTag:function(n){var t={learningArea:r.pick(n,"id","type","typeString","parentId","selectedName","learningAreaType"),tag:{origin:n.origin,title:n.title,videoCount:n.count},filterFrom:n.filterFrom};u(this.eventNames.addTag,t)},logRemoveKeyword:function(n){var t={learningArea:r.pick(n,"id","type","typeString","parentId","selectedName","learningAreaType"),keyword:{origin:n.origin,title:n.title}};u(this.eventNames.removeKeyword,t)},logRemoveTag:function(n){var t={learningArea:r.pick(n,"id","type","typeString","parentId","selectedName","learningAreaType"),tag:{origin:n.origin,title:n.title,videoCount:n.count}};u(this.eventNames.removeTag,t)},logSaveSearch:function(n){var t={learningArea:r.pick(n,"id","type","typeString","parentId","selectedName","learningAreaType"),addFrom:n.from};u(this.eventNames.saveSearch,t)},logRemoveSavedSearch:function(n){var t={learningArea:r.pick(n,"id","type","typeString","parentId","selectedName","learningAreaType"),removeFrom:n.from};u(this.eventNames.removeSavedSearch,t)},logOpenAlbertEmail:function(n){var t={learningArea:r.pick(n,"id","type","typeString","parentId","selectedName","learningAreaType"),openFrom:n.from};u(this.eventNames.openAlbertEmailRequest,t)},logSendAlbertEmail:function(n){var t={learningArea:r.pick(n,"id","type","typeString","parentId","selectedName","learningAreaType"),sendFrom:n.from};u(this.eventNames.sendAlbertEmailRequest,t)},logAlbertEmptyResult:function(n){var t={learningArea:r.pick(n,"id","type","typeString","parentId","selectedName","learningAreaType"),keywords:n.kw&&n.kw.length>0?n.kw.join(","):"",tags:n.t&&n.t.length>0?n.t.join(","):""};t.learningArea.parentId=t.learningArea.parentId?t.learningArea.parentId:"00000000-0000-0000-0000-000000000000";u(this.eventNames.curriculumSearchEmptyState,t)},logRequestTvProgramme:function(n){u(this.eventNames.requestTvProgramme,n)},libraryReviewAction:function(n){u(this.eventNames.libraryReviewAction,n)},logWizardSeen:function(n){this.libraryReviewAction(r.extend(n,{action:"library_review_wizard_seen"}))},approveTitleSuccess:function(n){this.libraryReviewAction(r.extend(n,{action:"approve_title",success:!0}))},approveTitleFailed:function(n){this.libraryReviewAction(r.extend(n,{action:"approve_title",success:!1}))},approveAllTitlesSuccess:function(n,t){this.libraryReviewAction(r.extend(n,{action:"approve_all_titles",success:!0,from:t}))},approveAllTitlesFailed:function(n,t){this.libraryReviewAction(r.extend(n,{action:"approve_all_titles",success:!1,from:t}))},reviewTitlesClicked:function(n){this.libraryReviewAction(r.extend(n,{action:"review_titles_clicked"}))},disableLibraryReviewSuccess:function(n,t){this.libraryReviewAction(r.extend(n,{action:"disable_library_review",success:!0,from:t}))},disableLibraryReviewFailed:function(n,t){this.libraryReviewAction(r.extend(n,{action:"disable_library_review",success:!1,from:t}))},findOutMoreAboutLibraryReview:function(n,t){this.libraryReviewAction(r.extend(n,{action:"find_out_more_about_library_review",from:t}))},logRequest247:function(n){u(this.eventNames.request247,n)},logTvIssue:function(n){u(this.eventNames.tvIssue,n)},logTvProgrammeDetail:function(n){u(this.eventNames.tvProgrammeDetails,n)},logTvProgrammeShare:function(n){u(this.eventNames.tvProgrammeShare,n)},logDownloadPdfClick:function(n){u(this.eventNames.downloadPdfClick,n)},logLocalCacheDownload:function(n,t){t||(t={});var n=r.extend({},this._toLogVideo(n,t),{saveSuccess:!!t.success});u(this.eventNames.localCacheDownload,n)},logManageUserProfile:function(n){u(this.eventNames.manageUserProfile,n)},logManageUserAccount:function(n){u(this.eventNames.manageUserAccount,n)},logManageSchoolLibraries:function(n){u(this.eventNames.manageSchoolLibraries,n)},logManageSchoolLocalCache:function(n){u(this.eventNames.manageSchoolLocalCache,n)},_logAreaData:function(n){if((n instanceof EasyMoney.Model))return{area:n.get("area")}},_logMediaCollection:function(n){if(n instanceof EasyMoney.Model){var f=n.pick("layout","page","sort"),i={},r={},t=n.get("model"),u=t.libraries&&t.libraries.first();return t instanceof EasyMoney.Model&&(i=t.pick("id","name","type","typeId")),u instanceof ClickView.Shared.Models.Library&&(r=u.pick("id","name","type","typeId")),{nav:f,collection:i,library:r}}},_toLogVideo:function(n,t){var i,u,f,e;return n instanceof ClickView.Shared.Models.MasterVideo?this._toLogMasterVideo(n,t):(i={id:n.get("id"),year:n.get("year"),title:n.get("title"),rating:n.get("rating"),tokenId:n.get("tokenId"),ownerId:n.get("ownerId"),producer:n.get("producer"),libraryId:n.get("libraryId"),masterId:n.get("masterId")||n.get("id")},n.get("freeToAir")&&(u={rating:n.has("rating")?n.get("rating").code:null,year:n.get("productionYear")},n.get("owner")&&r.extend(u,{ownerId:n.get("owner").get("id")}),r.extend(i,u)),f=n.get("category"),f&&(i.category=f.name),e=n.get("shareCode"),e&&(i.shareCode=e),i)},_toLogMasterVideo:function(n,t){t||(t={});var i={id:n.get("id"),year:n.get("productionYear"),title:n.get("name"),rating:n.get("rating"),tokenId:n.get("trackingCode"),isMasterVideo:n.isMasterVideo()};return n.owner&&n.owner.get("id")&&(i.ownerId=n.owner.get("id")),n.categories&&n.categories.length&&(i.category=n.categories.first().get("name")),n.userChannels&&(i.userChannels=n.userChannels.map(function(n){return{id:n.get("id"),name:n.get("name")}})),t.playlist&&(i.playlist=t.playlist.pick("id","name")),t.origin&&(i.origin=n.getVideoOrigin()),t.position&&(i.position=n.collection.indexOf(n)),i},_getLibraryName:function(n){return(n instanceof ClickView.Shared.Models.MasterVideo)?n.isOnlineLibraryVideo()?"mylibrary":n.isMasterLibraryVideo()?"hostedlibrary":n.isExchangeVideo()?"freeToAir":n.isWorkspaceVideo()?"workspace":"none":"none"},_getClientData:function(){return{browser:ClickView.Shared.Helpers.GetBrowserName(),referrer:this._getReferrer(),userAgent:navigator.userAgent,screenSize:this._getScreenSize(),operatingSystem:this._getOSName()}},_getScreenSize:function(){return screen.width+"x"+screen.height},_getReferrer:function(){return document.referrer},_getOSName:function(){var i=navigator.appVersion,n=navigator.userAgent,t;return/iphone/i.test(n)?"iPhone":/ipad/i.test(n)?"iPad":/android/i.test(n)?"Android":/blackberry/i.test(n)?"BlackBerry":/Mac/i.test(i)?"MacOS":/X11/i.test(i)?"UNIX":/Linux/i.test(i)?"Linux":/Win/i.test(i)?(t="Windows",/nt 5.0/i.test(n)&&(t+=" 2000"),/nt 5.1/i.test(n)&&(t+=" XP"),/nt 6.0/i.test(n)&&(t+=" Vista"),/nt 6.1/i.test(n)&&(t+=" 7"),/nt 6.2/i.test(n)&&(t+=" 8"),t):"Other"}});u=function(){this.endpoint="/analytics/collect";var n=this;return function(t,i){n.log(t,i)}};r.extend(u.prototype,{getTimestamp:function(){return(new Date).getTime()/1e3|0},getScreenResolution:function(){return window.screen.width+"x"+window.screen.height},getCurrentUrl:function(){return window.location.href},log:function(n,t){var i=new Image;i.src=this.endpoint+this.buildParams(n,t)},buildParams:function(n,t){var i="?e={eventName}&t={timestamp}&sr={screenRes}",u=r.extend({},t,{eventName:n,timestamp:this.getTimestamp(),screenRes:this.getScreenResolution()});return t=t||{},t.RequestUrl=this.getCurrentUrl(),t.Referrer=document.referrer,r.isEmpty(t)||(i+="&d={data}",u.data=JSON.stringify(t)),i.replace(/{([^{}]*)}/g,function(n,t){var i=u[t];return encodeURIComponent(typeof i=="string"||typeof i=="number"?i:n)})}});u=new u;n.AnalyticsService=new f;ClickView.analytics=u}(ClickView.Shared.Utils,ClickView.Shared.Utils.AjaxHelper,ClickView.Shared.Utils.LocalStorageHelper,_);!function(n){"use strict";var t=n.Shared;t.Utils.Constants={ENUMS:{MASTER_ROLES:{GUEST:16,USER:32,ADMIN:48,SUPER_ADMIN:64,SYSTEM:255},CONTEXT_TYPES:{LIBRARY:0,CATEGORY:2,TOPIC:14,SERIES:15,HOSTED_LIBRARY:17,EXCHANGE:18,WORKSPACE:49},ERROR_CODES:{RATING_NOT_PERMITTED:2,GEO_BLOCKED_RESOURCE:17}},STRINGS:{LAYOUT_TYPES:{COMFORTABLE:"comfortable-list",COSY:"cosy-list",GRID:"grid"},AREA:{LIBRARY:"library",EXCHANGE:"exchange",WORKSPACE:"workspace",SEARCH:"search",DASHBOARD:"dashboard",ALBERT:"albert",SETTINGS:"settings"}},URL_PARAM_TYPES:{COLLECTION_ID:"collectionId",COLLECTION_NAME:"collectionName",VIDEO_ID:"videoId",VIDEO_NAME:"videoName",USER_CHANNELS_ID:"userChannelId",USER_CHANNELS_NAME:"userChannelName",GENERIC_ID:"id",GENERIC_NAME:"name"},CONTEXTS:{EASY_SLIDE:"easy-slide",SEARCH_NAV:"search-nav",AREA:"area",MEDIA_COLLECTION:"media-collection",COLLECTION_ID:"collection-id"}}}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Utils,r=n.Shared,u=t.View.extend({template:"{{text}}",tagName:"a",events:{click:"onClick"},className:function(){return this.options.className},onClick:function(){this.options.callback.call(this.options.context);this.options.close&&this.close()}}),f=t.View.extend({template:'<div class="">{{{content}}}<\/div><div class="popup-button-container-fake"><\/div>',_buttonDefaults:{success:!1,close:!0,className:"btn"},defaults:{buttons:[{text:"Cancel",className:"btn"},{text:"Okay",className:"btn primary",success:!0}]},ui:{buttons:".popup-button-container-fake"},initialize:function(){this._before=this.options.before;delete this.options.before},renderButtons:function(){var n=this;_.each(this.options.buttons,function(t){typeof t.callback!="function"&&(t.callback=t.success?n.onSuccess:n.onFail);t.context=n;var i=new u(_.extend({},n._buttonDefaults,t));n.renderView(n.ui.buttons,i,{empty:!1});n.listenToOnce(i,"close",n.close)})},onSuccess:function(){this.options.result.resolve.apply(null,this.options.bind||window);this.close()},onFail:function(){this.options.result.reject.apply(null,this.options.bind||window);this.close()},onBeforeRender:function(){return typeof this._before=="function"?(this._before.apply(null,this.options.bind||window).always(_.bind(this.render,this)),delete this._before,this.renderView(this.$el,new n.Shared.Views.LoaderView),!1):!0},onRender:function(){this.renderButtons()},viewOptions:function(){var n=_.extend({},this.options);return n.view&&n.view instanceof t.View&&(n.content=n.view.render().el.outerHTML),n}});i.Dialog=function(n){var t,i;n=n||{};n.result=$.Deferred();t=new r.Views.PopupView(_.extend({},{view:new f(n),title:n.title,cssId:"easy-dialog"},n.popupOptions));t.selfRender();i=function(){n.result.state()==="pending"&&n.result.reject()};t.on("close",i);return n.result.fail(function(){t.isClosed()||t.close()}).always(function(){t.off("close",i)})}}(ClickView,EasyMoney),function(n){var t={PDF:"pdf",ZIP:"zip",CODE:"code",IMAGE:"image",AUDIO:"audio",VIDEO:"video",DEFAULT:"default",DOCUMENT:"document",POWERPOINT:"powerpoint",SPREADSHEET:"spreadsheet"},i={};i[".doc"]=t.DOCUMENT;i[".rtf"]=t.DOCUMENT;i[".txt"]=t.DOCUMENT;i[".srt"]=t.DOCUMENT;i[".docx"]=t.DOCUMENT;i[".docm"]=t.DOCUMENT;i[".pdf"]=t.PDF;i[".avi"]=t.VIDEO;i[".wma"]=t.VIDEO;i[".wmv"]=t.VIDEO;i[".mp4"]=t.VIDEO;i[".wav"]=t.VIDEO;i[".mov"]=t.VIDEO;i[".clk"]=t.VIDEO;i[".m1v"]=t.VIDEO;i[".m4v"]=t.VIDEO;i[".mpg"]=t.VIDEO;i[".swf"]=t.VIDEO;i[".mp3"]=t.AUDIO;i[".aiff"]=t.AUDIO;i[".ai"]=t.IMAGE;i[".png"]=t.IMAGE;i[".jpg"]=t.IMAGE;i[".bmp"]=t.IMAGE;i[".tif"]=t.IMAGE;i[".psd"]=t.IMAGE;i[".gif"]=t.IMAGE;i[".ico"]=t.IMAGE;i[".ppt"]=t.POWERPOINT;i[".pps"]=t.POWERPOINT;i[".pptm"]=t.POWERPOINT;i[".ppsx"]=t.POWERPOINT;i[".pptx"]=t.POWERPOINT;i[".xls"]=t.SPREADSHEET;i[".csv"]=t.SPREADSHEET;i[".xlsx"]=t.SPREADSHEET;i[".js"]=t.CODE;i[".mht"]=t.CODE;i[".xml"]=t.CODE;i[".htm"]=t.CODE;i[".exe"]=t.CODE;i[".html"]=t.CODE;i[".website"]=t.CODE;i[".zip"]=t.ZIP;i[".rar"]=t.ZIP;n.Shared.Utils.ExtensionMapper={getFileGroup:function(n){return i[n]||t.DEFAULT}}}(ClickView),function(){"use strict";var n=ClickView.Utils;n.FullscreenHelper=EasyMoney.Service.extend({_apiMap:[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],_api:!1,defaults:{useFullscreenWindow:!0},initialize:function(n){this.options=_.extend({},this.defaults,n);var i=this._apiMap[0],t=_.find(this._apiMap,function(n){return n[1]in document});t&&(this._api={},_.each(t,function(n,t){this._api[i[t]]=n},this))},_onFsChange:function(){var n=this.isFullscreen();n||$(document).off(this._api.fullscreenchange,$.proxy(this._onFsChange,this));this.trigger("fullscreenchange",n)},_isTop:function(){return window.top===window},goFullScreen:function(n){if(this.canFullscreen()){if(this.hasFullscreenApi()){$(document).on(this._api.fullscreenchange,$.proxy(this._onFsChange,this));n[this._api.requestFullscreen](Element.ALLOW_KEYBOARD_INPUT);return}this.options.useFullscreenWindow&&(this._goFullscreenWindow(n),this.trigger("fullscreenchange",!0))}},cancelFullscreen:function(){if(this.hasFullscreenApi()){document[this._api.exitFullscreen]();return}this.isFullscreen()&&(this._cancelFullscreenWindow(),this.trigger("fullscreenchange",!1))},_goFullscreenWindow:function(n){this._cancelFullscreenWindow();$(n).addClass("fshelper-fs");$("body").addClass("fshelper-windowedfs")},_cancelFullscreenWindow:function(){$(".fshelper-fs").removeClass("fshelper-fs");$("body").removeClass("fshelper-windowedfs")},toggleFullScreen:function(n){this.isFullscreen()?this.cancelFullscreen():this.goFullScreen(n)},isFullscreen:function(){return this.hasFullscreenApi()?!!document[this._api.fullscreenElement]:$("body").hasClass("fshelper-windowedfs")},hasFullscreenApi:function(){return this._api!==!1},canFullscreen:function(){return this.hasFullscreenApi()||this.options.useFullscreenWindow&&this._isTop()}})}();CV=CV||{};CV.Utils=CV.Utils||{};CV.Utils.HandleBarsHelper=function(){var n=function(n){if(!n)return"";var t=typeof n.name=="string"?n.name:n;return(typeof t=="string")?t.toLowerCase().indexOf("please select")==-1?t:"":""},t=function(n){return n&&n>1900?"Year: "+n:""},r=function(i,r){return n(i)&&t(r)},u=function(n,t){if(!t)return n;var r=i(t);return n.replace(new RegExp("\\b("+r+")\\b","gi"),"<em>$1<\/em>")},f=function(n,t){if(!t)return n;var r=i(t.join("%&%")).split("%&%");return n.replace(new RegExp("\\b("+r.join("|")+")\\b","gi"),'<span class="highlight">$&<\/span>')},i=function(n){return n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")};return durationisFormatted=/\d+:\d+/,{SeriesFilter:n,YearFilter:t,ShowDivider:r,WordHighlighter:u,WordsHighlighter:f,durationisFormatted:durationisFormatted}}();Handlebars.registerHelper("toLower",function(n){return n?n.toLowerCase():""});Handlebars.registerHelper("toUpper",function(n){return n?n.toUpperCase():""});Handlebars.registerHelper("linkify",function(n){if(n)return window.linkifyStr&&(n=linkifyStr(n,{ignoreTags:["script","style"]})),n});Handlebars.registerHelper("videoPluraliser",function(n){var t=Number(n)===1?"video":"videos";return n+" "+t});Handlebars.registerHelper("checked",function(n){return n==!0?'checked="checked"':""});Handlebars.registerHelper("limitWords",function(n,t){return ClickView.Shared.Helpers.ToWordCount(n,t||20)});Handlebars.registerHelper("limitChars",function(n,t,i){return _.isNumber(t)||(t=150),_.isBoolean(i)||(i=!0),ClickView.Shared.Helpers.toCharacterCount(n,t,i)});Handlebars.registerHelper("capitalise",function(n){return n?ClickView.Shared.Helpers.toTitleCase(n):""});Handlebars.registerHelper("date",function(n){var t=new Date(n),i=t.getDate(),r=t.getFullYear(),u=t.getMonth()+1;return i+"/"+u+"/"+r});Handlebars.registerHelper("fileSize",function(n,t){return n==null&&(n=0),isNaN(Number(t))&&(t=1),ClickView.Shared.Helpers.ToFilesize(n,t)});Handlebars.registerHelper("ToHrs",function(n,t){return n==null&&(n=0),isNaN(Number(t))&&(t=1),ClickView.Shared.Helpers.ToHrs(n,t)});Handlebars.registerHelper("yearFilter",function(n){return CV.Utils.HandleBarsHelper.YearFilter(n)});Handlebars.registerHelper("seriesFilter",function(n,t){var i;if(i=_.isObject(n)&&n.name?n.url?"<a href="+n.url+' class="series-link">'+n.name+"<\/a>":n.name:CV.Utils.HandleBarsHelper.SeriesFilter(n),!_.isObject(t))return i;if(!i)return"";switch(t.hash.divider){case"header":return'<span class="cv-title-header">Series: <\/span>'+i;default:return(t.hash.divider||"")+" "+i}});Handlebars.registerHelper("duration",function(n){return ClickView.Shared.Helpers.formatDuration(n)});Handlebars.registerHelper("stripProtocol",function(n){return ClickView.Shared.Helpers.StripProtocol(n)});Handlebars.registerHelper("flagReason",function(n){var t=ClickView.Shared.Helpers.GetFlaggingReasons(n);return t?t.text:"Unknown"});Handlebars.registerHelper("interactionIcon",function(n){if(n&&_.isNumber(n))switch(n){case 1:return"multiple-choice";case 2:return"short-answer";case 3:return"true-false";case 4:return"annotation";case 5:return"image";case 6:return"missing-word"}});Handlebars.registerHelper("masterOrigin",function(n){return ClickView.Shared.Helpers.ParseMasterOrigin(n)});Handlebars.registerHelper("IfRecentlyProduced",function(n,t){var i=n>2010&&!(n>moment().year());return i?t.fn(this):null});Handlebars.registerHelper("placeholderColour",function(n){return ClickView.Shared.Helpers.getUserColourClass(n)});Handlebars.registerHelper("buildThumbnailUrl",function(n){return ClickView.Shared.Helpers.getThumbnailUrl(n)});Handlebars.registerHelper("ifIs",function(n,t,i,r){switch(t){case"==":return n==i?r.fn(this):r.inverse(this);case"!=":return n!=i?r.fn(this):r.inverse(this);default:return r.inverse(this)}});Handlebars.registerHelper("isValid",function(n,t,i){switch(n){case"date":return isNaN(new Date(t).getTime())?i.inverse(this):i.fn(this)}});Handlebars.registerHelper("render",function(n,t,i){var r=ClickView[t].Templates[n];if((r&&typeof r=="function"))return new Handlebars.SafeString(r(i.hash))});Handlebars.registerHelper("isPlaylist",function(n,t){return Number(n)===1?t.fn(this):t.inverse(this)});Handlebars.registerHelper("wordHighlighter",function(n,t){return CV.Utils.HandleBarsHelper.WordHighlighter(n,t)});Handlebars.registerHelper("wordsHighlighter",function(n,t){return CV.Utils.HandleBarsHelper.WordsHighlighter(n,t)});Handlebars.registerHelper("seriesWordHighlighter",function(n,t,i){var u=CV.Utils.HandleBarsHelper.SeriesFilter(n),r=CV.Utils.HandleBarsHelper.WordHighlighter(u,t);return i&&r?" - "+r:r});Handlebars.registerHelper("originHelper",function(n){switch((n||"").toUpperCase()){case"CLOUD247":return"ClickView TV";case"USER_UPLOAD":return"User Upload";case"ONLINE":return"Online";default:return"Unknown"}});Handlebars.registerHelper("pendingProgress",function(n){return n>=90?95:n>=70?85:n<=5?5:n});Handlebars.registerHelper("roleToString",function(n){switch(n){case 1:return"student";case 2:return"teacher";case 3:return"admin";default:return"user"}});Handlebars.registerHelper("analyticsSourceToReadable",function(n){return ClickView.Shared.Helpers.String.analyticsSourceToReadable(n)});Handlebars.registerHelper("toParagraphs",function(n){var t=n.split("\n");return"<p>"+t.join("<\/p><p>")+"<\/p>"});Handlebars.registerHelper("deviceIsLocked",function(n,t){return n===2?t.fn(this):t.inverse(this)});Handlebars.registerHelper("getDeviceStatusClass",function(n){return n===1?"online":n===2?"locked":"offline"});Handlebars.registerHelper("getDeviceStatus",function(n){return n===1?"online":n===2?"in use":"offline"});Handlebars.registerHelper("disableButton",function(n){return n?"disabled":null});Handlebars.registerHelper("pluralize",function(n,t,i){return n===1?t:i}),function(n,t){"use strict";n.Helpers=t.extend({},n.Helpers,{scrollToTop:function(){$("html,body").animate({scrollTop:0},250)},cdnFilter:function(n){return t.isString(n)?n.replace("cvtv.blob.core.windows.net","az713818.vo.msecnd.net"):null},GetQueryString:function(){var n={},i=location.search.slice(1).split("&");return t.each(i,function(t){if(t){var i=t.split("=");n[i[0]]=i.length>2?decodeURIComponent(i[1])+"="+decodeURIComponent(i[2]):decodeURIComponent(i[1])||""}}),n},ToWordCount:function(n,t,i){n=n.trim();var r="";return typeof n=="undefined"?"":n.length==0?"":(n=n.split(" "),n.length>t&&(n=n.slice(0,t),typeof i!="undefined"&&!i||(r="...")),n.join(" ")+r)},ToFilesize:function(n,i){i=i||0;t.isNumber(n)||(n=0);var r=n/1048576,u="MB";return r>1e3?(r=r/1024,u="GB"):i=0,r.toFixed(i)+u},ToHrs:function(n,i){i=i||0;t.isNumber(n)||(n=0);var r=n/60,u=" minutes";return r>60?(r=r/60,u=" hours"):i=0,r.toFixed(i)+u},toCharacterCount:function(n,t,i){var r,u,f;return(n=n.trim(),typeof n!="string"||n.length==0)?"":n.length<=t?n:(r=n.substring(0,t),i&&(u=r[r.length-1]," .!?".indexOf(u)==-1&&(f=r.lastIndexOf(" "),r=r.substring(0,f))),r+"...")},Guid:{empty:function(){return"00000000-0000-0000-0000-000000000000"},isEmptyGuid:function(n){return n===this.empty()},isGuid:function(n,t){return typeof n!="string"?!1:t?/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(n):/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(n)},newGuid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var t=Math.random()*16|0,i=n=="x"?t:t&3|8;return i.toString(16)})},isEqual:function(n,i){if(!t.isString(n)||!t.isString(i))return!1;var r=function(n){return n.replace(/-/g,"").toLowerCase().trim()};return r(n)===r(i)},toFormatString:function(n,t){var i;switch(t){case"N":i=n.replace(/\-/g,"");break;default:i=n}return i}},IsValidEmail:function(n){return/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(n)},GetFlaggingReasons:function(n){var i=[{id:0,cssId:"non-educational",text:"Non-educational",flagReason:1},{id:1,cssId:"poor-quality",text:"Poor quality",flagReason:2},{id:2,cssId:"offensive",text:"Offensive/Abusive",flagReason:3},{id:3,cssId:"copyright-violation",text:"Copyright violation",flagReason:4},{id:4,cssId:"not-age-appropriate",text:"Not age appropriate",flagReason:5},{id:5,cssId:"other-reason",text:"Other",flagReason:6}];return typeof n=="undefined"?i:t.findWhere(i,{flagReason:n})},formatDuration:function(n){if(!t.isNumber(n))return"";var i=new Date(n*1e3),r=i.getUTCHours(),u=i.getUTCMinutes(),f=i.getUTCSeconds();return r>0?EasyMoney.template("{{h}}:{{m}}:{{s}}",{h:r,m:t.padLeft(u,2,"0"),s:t.padLeft(f,2,"0")}):EasyMoney.template("{{m}}:{{s}}",{m:u,s:t.padLeft(f,2,"0")})},String:{analyticsSourceToReadable:function(n){if(!t.isString(n))return n;switch(n.trim().toUpperCase()){case"MYLIBRARY":return"Library";case"LIBRARY":return"Library";case"HOSTEDLIBRARY":return"Library";case"EXCHANGE":return"Exchange";case"PLAYLISTS":return"Playlists";case"SHARE":return"Share";case"WORKSPACE":return"Workspace";case"SUPLIBRARY":return"Library";case"FREETOAIR":return"Exchange";default:return n}}},StripProtocol:function(n){if(!t.isString(n))return n;var i=new RegExp(/^https?:\/\//);return i.test(n)?"//"+n.replace(i,""):n},Ratings:{getHomeRatingId:function(n){switch(n){case 1:return 1;case 3:return 2;case 7:return 3;case 15:return 4;case 31:return 5;case 63:return 6;default:return 7}}},UrlBuilder:function(n,i){var u=t.map(i,function(n,t){return t&&typeof n!="undefined"?t+"="+encodeURIComponent(n):""}),r=t.reduce(u,function(n,t){return t?n?n+"&"+t:t:n});return r?n+"?"+r:n},ParseUrl:function(n){var t=document.createElement("a");return t.href=n,t.host===""&&(t.href=t.href),t},isObject:function(n){return n===null?!1:typeof n=="function"||typeof n=="object"},formatRating:function(n){if(this.isObject(n.rating))return n;var t=n.rating;return n.rating={},n.rating.code=t||null,n.rating.ratingValue=n.ratingValue||null,n},GetRandomNumber:function(n,t){return Math.floor(Math.random()*(t-n))+n},ParseMasterOrigin:function(n){if(typeof n!="number")return n;switch(n){case 1:return"IOS_APP";case 2:return"ANDROID_APP";case 3:return"WIN_APP";case 4:return"LIBRARY_PUBLISHER";case 5:return"EXCHANGE_CLIENT";case 6:return"ONLINE";case 7:return"TINDER";case 8:return"CLOUD247";case 9:return"LIVESTREAM";default:return"UNKNOWN"}},BuildThumbUrl:function(n){var t=n,i=n.split("/"),r=i[i.length-1];return t+=r.indexOf("?")>=0?"&":"?",t+"size=small"},MasterToOnlineVideo:function(t,i){i||(i={});var r=!t.id&&ClickView.Shared.Helpers.Guid.isGuid(t.onlineId)&&!ClickView.Shared.Helpers.Guid.isEmptyGuid(t.onlineId);return r&&(t.id=t.onlineId),t.title=t.name,t.tokenId=t.trackingCode,t.origin=n.Helpers.ParseMasterOrigin(t.origin),t.dateCreated=moment.utc(t.dateCreated).toISOString(),t.resourceType=r?1:6,t.year=n.Helpers.getValidVideoYear({productionYear:t.productionYear}),i.durationInSeconds&&(t.duration=t.duration/1e3),!t.rating||(t.ratingValue=t.rating.value,t.rating=t.rating.code),t.categories&&t.categories.data&&t.categories.data.length>0&&(t.category=t.categories.data[0]),t},Slugify:function(n){return n?n.slugify():n},isNumeric:function(n){return!isNaN(parseFloat(n))&&isFinite(n)},HexToRgb:function(n){var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null},IsValidUrl:function(n){return/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(n)},getVideoExtensionWhitelist:function(){return"avi,mod,mp4,mpeg,mpeg2,m2v,mov,quicktime,qt,mov,mpeg,mpeg,mpg,mpe,m2v,x-m4v,m4v,x-flv,flv,x-ms-wmv,wmv,webm,3gpp,3gpp,3gp,3gpp2,3g2,vnd.rn-realvideo,rv,ogg,ogv,mkv,ts"},getResourceFileExtensionWhitelist:function(){return[].concat(this.getResourceFileDocsExtension()).concat(this.getResourceFileExcelExtension()).concat(this.getResourceFilePowerPointExtension()).concat(this.getResourceFilePDFExtension()).concat(this.getResourceFileTextExtension()).concat(this.getResourceFileImgExtension()).concat(this.getResourceFileArchiveExtension()).toString()},getSubtitleFileExtenstionWhitelist:function(){return this.getResourceFileSubtitleExtension().toString()},getResourceFileDocsExtension:function(){return["doc","docx","dotx","dot","rtf","docm","odt"]},getResourceFileExcelExtension:function(){return["xls","xlt","xlsx"]},getResourceFilePowerPointExtension:function(){return["ppt","pot","pps","pptx"]},getResourceFilePDFExtension:function(){return["pdf"]},getResourceFileTextExtension:function(){return["csv","txt"]},getResourceFileImgExtension:function(){return["jpg","tif","png","bmp","gif","jpeg"]},getResourceFileArchiveExtension:function(){return["zip","rar"]},getResourceFileSubtitleExtension:function(){return["srt"]},getResourceExtensionType:function(n){return(n=n.toLowerCase(),t.contains(this.getResourceFileDocsExtension(),n))?"document":t.contains(this.getResourceFileExcelExtension(),n)?"excel":t.contains(this.getResourceFilePowerPointExtension(),n)?"powerpoint":t.contains(this.getResourceFilePDFExtension(),n)?"pdf":t.contains(this.getResourceFileTextExtension(),n)?"text":t.contains(this.getResourceFileImgExtension(),n)?"image":t.contains(this.getResourceFileArchiveExtension(),n)?"archive":t.contains(this.getResourceFileSubtitleExtension(),n)?"subtitle":""},getResourceFileDisplayName:function(n,t){var i="";if(n.lastIndexOf(".")>-1&&(i=n.substr(n.lastIndexOf(".")+1)),i&&this.getResourceExtensionType(i)!=="")return n;switch(t){case"document":return n+".docx";case"excel":return n+".xlsx";case"powerpoint":return n+".ppt";case"pdf":return n+".pdf";case"text":return n+".txt";case"image":return n+".jpg";case"archive":return n+".zip";default:return n}},toTitleCase:function(n,t){var i=t||["in","of","and","with","TV","the","at","I","II"];return n.replace(/([^\W_]+[^\s-]*) */g,function(n){return i.indexOf(n.trim())>-1?n:n.charAt(0).toUpperCase()+n.substr(1).toLowerCase()})},StripHTML:function(n){var t=document.implementation.createHTMLDocument("tmp").body;return t.innerHTML=n,t.textContent||t.innerText||""},formatSafeHTML:function(n,i){if(i=t.extend({},{escape:!0,linkify:!0},i),n)return i.escape&&(n=Handlebars.Utils.escapeExpression(n)),i.linkify&&window.linkifyHtml&&(n=linkifyHtml(n,{ignoreTags:["script","style"]})),i.keywords&&(n=CV.Utils.HandleBarsHelper.WordsHighlighter(n,i.keywords)),n},_getRatingMappings:function(){return[[16,1],[32,3],[48,7],[80,15],[96,31],[128,63],[169,255]]},OnlineToMasterRatingValue:function(n){var i=this._getRatingMappings(),r=function(i){return t.last(i)===n},u=t.find(i,r)||t.last(i);return t.first(u)},GetBrowserName:function(){var n=navigator.userAgent;return/(msie|trident)/i.test(n)?"Internet Explorer":/opera/i.test(n)||/opr/i.test(n)?"Opera":/chrome/i.test(n)?"Chrome":/phantom/i.test(n)?"Phantom":/touchpad/i.test(n)?"TouchPad":/iphone/i.test(n)?"iPhone":/ipad/i.test(n)?"iPad":/android/i.test(n)?"Android":/safari/i.test(n)?"Safari":/firefox/i.test(n)?"Firefox":"Other"},GenerateHashFromString:function(n){var t=0,r=0,i=0,u="";if(n){for(i=0,r=n.length;i<r;i++)u=n.charCodeAt(i),t=(t<<5)-t+u|0;return t>>>0}},IsAuthenticated:function(){return!!ClickView&&!!ClickView.Data&&!!ClickView.Data.User&&!!ClickView.Data.User.username},getValidVideoYear:function(n){var t,i,r;return(n=n||{},t=n.productionYear,i=n.dateBroadcast,/^\+?(0|[1-9]\d*)$/.test(t)&&t>1900)?t:i&&i.length>4&&(r=i.substr(0,4),+r>1900)?r:null},isCopyAvailable:function(){return typeof document.execCommand=="function"&&typeof document.queryCommandSupported=="function"&&document.queryCommandSupported("copy")},formatUTCToLocal:function(n,t){return t?moment(moment.utc(n).toDate()).format("Do MMMM, YYYY hh:mm A"):moment(moment.utc(n).toDate()).format("Do MMMM, YYYY")},dateIsAfter:function(n,t){t||(t="1970");var i=moment(n);if(i.isValid())return i.diff(moment(t,"YYYY"),"years")>=0},stripTags:function(n,i){if(n&&i)return t.each(i,function(t){n=n.replace("<"+t+">","").replace("<"+t+"/>","")}),n},replacePTags:function(n){if(n)return n.replace(/<p>/g,"").replace(/<\/p>/g,"<br>")},formatAnnotationText:function(n){if(n)return n=this.stripTags(n,["b","i","u","ul","li","old"]),n=this.replacePTags(n),n.split("<br>")[0]||"Annotation"},getCurriculumLinkText:function(n){if(n||(n={}),ClickView.Data.Config.region===null||ClickView.Data.AlbertLearningAreaType==null)return n.plural?"Curriculum Links":"Curriculum Link";var t;return t=ClickView.Data.Config.region.code==="AU"&&ClickView.Data.AlbertLearningAreaType.type==="TAFE"?"Unit of Competency Link":"Curriculum Link",n.plural?t+"s":t},intersection2:function(n,i,r){for(var f,o,e=[],u=0;u<n.length;u++)f=n[u],o=t.any(i,function(n){return r(n,f)}),o&&e.push(f);return e},intersection:function(){var n=arguments[0],r=arguments[arguments.length-1],u=arguments.length,f=t.isEqual,i,e;for(typeof r=="function"&&(f=r,u--),i=1;i<u;i++)if(e=arguments[i],n=this.intersection2(n,e,f),n.length===0)break;return n},userIsInGroup:function(n){if(arguments.length>1&&(n=Array.prototype.slice.call(arguments)),n instanceof Array||(n=[n]),!(ClickView.Data.User.groups instanceof Array))return!1;var i=t.map(ClickView.Data.User.groups,function(n){return n.id});return t.some(i,function(i){return t.contains(n,i)})},userIsCurator:function(){return ClickView.Shared.Helpers.userIsInGroup([2046453,2046458])},getSharedByName:function(n){var r,i,u,f;return n==null?"":(r=n.displayName||"",!r)?"":(i=r.split(" "),u=t.last(i),i.length<2)?r:(i.splice(-1,1),f=t.chain(u.split("-")).map(function(n){return n[0]}).reduce(function(n,t){return n+"."+t}).value(),i.join(" ")+" "+f+".")},isSamePageRoute:function(n){if(!Backbone.History.started)return!1;var i=Backbone.history.getFragment(n);return t.some(Backbone.history.handlers,function(n){return n.route.test(i)})},getThumbnailUrl:function(n,i){if(i=t.extend({},{bgColor:"000",thumbnailSize:"small"},i),!n)return"";var r="";return(n instanceof EasyMoney.Model&&(n=n.toJSON()),typeof n=="string"?r=n:n.thumbnail&&n.thumbnail.url?r=n.thumbnail.url:t.isString(n.thumbnail)&&(r=n.thumbnail),!r&&i.allowNoDefault)?"":(r||(r=i.useCategoryImageMap?ClickView.Data.Config.urls.imageCDN+"/v1/category-map/thumbnail?name="+encodeURIComponent(i.name):ClickView.Data.Config.urls.imageCDN+"/v1/thumbnails/trackingcode/"+n.trackingCode),this.createThumbnailUrl(r,i))},compiledRegex:{leadingSlashes:/^\/\//,isCoverImage:/\/coverimage/,isDataUrl:/^data:image/},createThumbnailUrl:function(n,t){if(t||(t={}),!n)return"";if(t.clientUpload||this.compiledRegex.isDataUrl.test(n))return n;var i=new URI(n),r=this.compiledRegex.isCoverImage.test(n);return i.authority()!==ClickView.Data.Config.urls.imageApi||r||i.authority(ClickView.Data.Config.urls.imageCDN.replace(this.compiledRegex.leadingSlashes,"")),t.thumbnailSize==="original"||t.width||t.height||i.addSearch("size",t.thumbnailSize||"small"),t.bgColor&&i.addQuery("bgColor",t.bgColor),t.width&&i.addSearch("width",t.width),t.height&&i.addSearch("height",t.height),t.resizeType&&i.addSearch("resizeType",t.resizeType),t.ratio&&i.addSearch("ratio",t.ratio),i.protocol("https"),i.toString()},setModelId:function(n,t){return t=t||{},ClickView.Shared.Helpers.Guid.isGuid(n.onlineId)&&!ClickView.Shared.Helpers.Guid.isEmptyGuid(n.onlineId)&&(n.id=n.onlineId),n},trimString:function(n,i){if(!n)return"";if(n.length<i)return n;var r=n.substr(0,i),u=r.lastIndexOf(" ");return u>-1&&(r=r.substr(0,u)),(t.contains(["?","!","."]),r.substr(r.length-1,r.length))&&(r+="..."),r},escapeReqExp:function(n){return n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},generateInitials:function(n,i){var r,u;return(i||(i=[]),n==null)?null:(r=function(n){var i=n.get("name")||"",r=n.get("surname")||"",u=t.reduce(r.split("-"),function(n,t){return n+(t||"")[0]},"");return(i[0]+u).toUpperCase()},!t.isArray(n))?r(n):(u=t.chain(n).filter(function(n){return!t.contains(i,n.get("id"))}).map(r).value(),(u||[])[0])},getUserColourClass:function(n){var t=["c1","c2","c3","c4","c5","c6"];return n?t[n.charCodeAt(0)%t.length]:""},firstCharToLowerCase:function(n){return n.length<2?n.toLowerCase():n[0].toLowerCase()+n.slice(1)}});String.prototype.toTitleCase||(String.prototype.toTitleCase=function(t){return n.Helpers.toTitleCase(this,t)});String.prototype.startsWith||(String.prototype.startsWith=function(n,t){return t=t||0,this.substr(t,n.length)===n});String.prototype.endsWith||(String.prototype.endsWith=function(n,t){var i=this.toString(),r;return(typeof t!="number"||!isFinite(t)||Math.floor(t)!==t||t>i.length)&&(t=i.length),t-=n.length,r=i.lastIndexOf(n,t),r!==-1&&r===t});String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")})}(ClickView.Shared,_),function(){"use strict";var n=EasyMoney.Service.extend({initialize:function(){},defaults:{single:!1},load:function(n,t){var i=new Image;return i.onload=t,i.onerror=t,i.src=n,i},preload:function(n,t){_.isArray(n)||(n=[n]);var i=this,e=_.extend({},this.defaults,t),r=n.length,u=0,f=function(n){var t=++u;return(n.notify(t,r),t===r)?(n.resolve(),!0):!1};return $.Deferred(function(t){if(r===0){t.resolve();return}if(e.single){var o=function(){f(t)||i.load(n[u],o)};i.load(n[0],o)}else _.each(n,function(n){i.load(n,function(){f(t)})})}).promise()}});window.ClickView.ImagePreloader=new n}(),function(){"use strict";Backbone.Validation.configure({forceUpdate:!0});_.extend(Backbone.Validation.callbacks,{valid:function(n,t){var r=n.$("[name="+t+"]"),i=r.closest(".form-group");i.removeClass("has-error");i.find(".help-block").html("").addClass("hidden")},invalid:function(n,t,i){var u=n.$("[name="+t+"]"),r=u.closest(".form-group");r.addClass("has-error");r.find(".help-block").html(i).removeClass("hidden")}});_.extend(Backbone.Validation.validators,{timeRequired:function(n,t){var i=t==="startTime"?"start time":"end time";if(n==="")return"Please enter "+i+" in HH:MM:SS format"},videoDuration:function(n,t,i){var r=t==="startTime"?"start time":"end time";if(n>i)return"Entered "+r+" exceeds video duration"},clipMinDuration:function(n,t,i){if(Math.abs(i-n)<3)return"Clip must be at least 3 seconds long"},startTimeMax:function(n,t,i){if(n>=i)return"Start time must be less than end time"},endTimeMin:function(n,t,i){if(n<=i)return"End time must be greater than start time"},productionYearMin:function(n,t,i){if(n>i)return"From has to be lower than to";var r=(new Date).getFullYear();if(+n>r)return"From has to be less than "+r},productionYearMax:function(n){var t=(new Date).getFullYear();if(+n>t)return"To has to be less than "+t}});_.extend(Backbone.Validation.patterns,{timePattern:/^\d{1,2}(:\d{2}){1,2}$/,phoneNumber:/[0-9 +,()]{7,}/});_.extend(Backbone.Validation.messages,{maxLength:"Max {0} length is {1} characters",timePattern:"Please enter time in HH:MM:SS format",email:"Please enter a valid e-mail address",phoneNumber:"Please enter a valid phone number"})}(),function(n){"use strict";var t=function(n){var i=this instanceof t?this:Object.create(t.prototype);return n||(n={type:"localStorage"}),i._type=n.type,i._support=i._hasSupport(),i.localStorage=null,i._support&&(i.localStorage=window[i._type]),i._cachePrefix="_c-",i._defaultExpireTime=3600,i};_.extend(t.prototype,{_hasSupport:function(){try{return this._type in window&&window[this._type]!==null}catch(n){return!1}},get:function(n){if(this._support){var t=this.localStorage.getItem(n);try{return JSON.parse(t)}catch(i){return t}}},set:function(n,t){if(this._support)try{return(this.localStorage.removeItem(n),typeof t!="string")?(this.localStorage.setItem(n,JSON.stringify(t)),!0):(this.localStorage.setItem(n,t),!0)}catch(i){return!1}return!1},remove:function(n){if(this._support)return this.localStorage.removeItem(n)},length:function(){return this._support?this.localStorage.length:0},clear:function(){if(this._support)return this.localStorage.clear(arguments)},cacheSet:function(n,t,i){this._cacheClean();i=i||this._defaultExpireTime;var r={t:this._currentTime()+i*1e3};typeof t!="undefined"&&t!=null&&(r.d=t);this.set(this._cachePrefix+n,r)},cacheGet:function(n){var t=this.get(this._cachePrefix+n);return t?this._isExpired(t)?(this.remove(this._cachePrefix+n),null):t.d:null},cacheExists:function(n){var t=this.get(this._cachePrefix+n);return t?this._isExpired(t)?(this.remove(this._cachePrefix+n),!1):!0:!1},cacheRemove:function(n){return this.remove(this._cachePrefix+n)},cacheFlush:function(){this._cacheClean()},_cacheClean:function(){var n,t,i;if(this._support)for(n=0;n<this.localStorage.length;n++)t=this.localStorage.key(n),t.indexOf(this._cachePrefix)===0&&(i=this.get(t),i&&i.t&&this._isExpired(i)&&this.remove(t))},_isExpired:function(n){return n.t<this._currentTime()},_currentTime:function(){return(new Date).getTime()}});n.LocalStorageHelper=new t({type:"localStorage"});n.SessionStorageHelper=new t({type:"sessionStorage"})}(ClickView.Shared.Utils),function(n,t){"use strict";var i=n.Shared,r=i.Models.RadioChannel=t.Model.extend({name:"Channel",transmit:function(n,t){(t||(t={}),n)&&this.trigger(n)}}),u=t.Collection.extend({model:r});i.Services.RadioService=t.Radio.extend({name:"RadioService",initialize:function(){this.channels=new u}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared,u=t.Model.extend({idAttribute:"type"}),r=t.Collection.extend({model:u,comparator:"order"});i.Services.SortService=t.Service.extend({defaults:{sortOptions:[{type:"productionyear",text:"Production Year",order:1},{type:"mostrecent",text:"Recently Added",order:2},{type:"atoz",text:"Title A - Z",order:3}],extraSortOptions:[],omitOptions:[],storageKeyPrefix:"sort-service:type"},initialize:function(){if(this._localStorageHelper=n.Shared.Utils.LocalStorageHelper,this.collection=new r(this.options.sortOptions),this.options.extraSortOptions.length&&this.collection.add(this.options.extraSortOptions),this.options.omitOptions.length){var t=this,i=this.collection.filter(function(n){return!_.contains(t.options.omitOptions,n.get("type"))});this.collection=new r(i)}this.setCurrent(null,{initial:!0})},_getStorageKey:function(){return this.options.storageKeyPrefix+n.Data.User.username},setCurrent:function(n,r){var u,f;(r||(r={save:!1,initial:!1,ignoreUrlUpdate:!1}),u=i.Helpers.GetQueryString()||{},n||(n=u.sort),n||(n=this._localStorageHelper.get(this._getStorageKey())),n&&this.collection.get(n)||(n=this.collection.first().get("type")),this.collection.each(function(n){n.set("current",!1)}),f=n?this.collection.get(n):this.collection.first(),f.set("current",!0),r.save&&this._localStorageHelper.set(this._getStorageKey(),f.get("type")),r.ignoreUrlUpdate)||(r.initial||delete u.page,u.sort=f.get("type"),t.Events.trigger("navigate",window.location.pathname+"?"+$.param(u),{trigger:!1,replace:r.initial}))},getSortTypes:function(){return this.collection},getCurrent:function(){return this.collection.find(function(n){return n.get("current")})},getCurrentSortType:function(){var n=this.getCurrent();return n?n.get("type"):null}})}(ClickView,EasyMoney);!function(){"use strit";jQuery.timeago.settings.allowFuture=!0;jQuery.timeago.settings.strings.prefixFromNow="in";jQuery.timeago.settings.strings.suffixFromNow=null}(),function(n){"use strict";var t=function(n){return _.isObject(n)?n:{}},i=function(n){if(n){var t=n.baseClass;return n.disabled?t+" disabled":t}};n.Utils.GetClipActions=function(n){n||(n={});var t=[];return t.push({text:"Share",desc:"Share or embed this clip",className:"share-clip",eventName:"share-clip",button:!0}),n.viewOriginalVideo&&t.push({text:"View original video",desc:"View original video from which this clip was created",className:"view-original-video",eventName:"view-original-video"}),n.playClip&&t.push({text:"Play clip",desc:"Play this clip",eventName:"play-clip",className:"play-clip"}),n.editClip&&t.push({text:"Rename clip",desc:"Rename this clip",eventName:"edit-clip",className:"edit-clip"}),n.deleteClip&&t.push({text:"Delete clip",desc:"Delete this clip from this video",eventName:"delete-clip",className:"delete-clip"}),t};n.Utils.GetInteractiveActions=function(n){var e,o,s,u,f,r;return(n||(n={}),ClickView.Data&&(e=ClickView.Data,o=ClickView.Data.User),s=[1,2,6],u=[],e&&s.indexOf(o.role)===-1)?[]:(n.saveInteractive&&(r=t(n.saveInteractive),f="Save to Workspace",r&&r.disabled&&(f="Saved to Workspace"),u.push({text:f,desc:"Save copy of this interactive to your Workspace",eventName:"save-to-workspace",className:i({baseClass:"save-to-workspace",disabled:r.disabled}),button:r.button||!1,order:r.order,title:r.title})),n.questionList&&(r=t(n.questionList),u.push({text:"Question List",desc:"See the questions for this interactive",eventName:"show-question-list",className:"show-question-list",button:r.button||!1,order:r.order})),u)}}(ClickView.Shared);!function(n,t){"use strict";var i=n.Shared;i.Services.BreadcrumbService=t.Service.extend({name:"BreadcrumbService.js",defaults:{childName:"categories",permanent:[]},map:{},initialize:function(){if(typeof this.navigateUrl!="function")throw new Error("Please override "+this.name+" and implement your own this.navigateUrl()");this.options.fetching?this.listenTo(this.options.tree,"sync",this.onSync):this.registerTree(this.options.tree)},navigateUrl:null,onSync:function(){this.registerTree(this.options.tree.toJSON());this.trigger("update")},getCrumbs:function(n){var u=n instanceof t.Model?n.toJSON():n,r=this.options.permanent.slice(),i=this.map[this.options.childName+"-"+u.id];return i&&i.length||(i=[u]),r=r.concat(i),new t.Collection(r)},registerTree:function(n,t){var r,u,i,f;if(n){if(!(n instanceof Array)){r=n[this.options.childName]||n.children;this.registerTree(r);return}for(u=0;u<n.length;u++)i=n[u],f=t?t.slice():[],f.push({id:i.id,name:i.name||i.heading}),r=i.children||i[this.options.childName],this.map[this.options.childName+"-"+i.id]=f,this.registerTree(r,f)}}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared,r=t.Service.extend({_imageCdn:n.Data.Config&&n.Data.Config.urls&&n.Data.Config.urls.imageCDN,_getUrl:function(t,i,r){return r=_.extend({name:escape(i)},r),n.Data.Config.urls.imageCDN+"/v1/category-map/"+t+"?"+$.param(r)},getBanner:function(n){return this._getUrl("banner",n)},getThumbnail:function(n){return this._getUrl("thumbnail",n,{size:"medium"})},getCategoryImages:function(n){return{banner:this.getBanner(n),thumbnail:this.getThumbnail(n)}}});i.Services.CategoryImageService=new r}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared,r=t.Service.extend({_callbacks:{},initialize:function(){this.model=new t.Model},_unbindNavigateListener:function(n){var i=this.model.get(n),r=i?i.cid:n;this.stopListening(t.Events,"navigate",this._callbacks[r]);delete this._callbacks[r]},_setNavigateListener:function(n,i){var r=this,u=i.cid||n;this._callbacks[u]=function(){r.clearContext(n)};this.listenTo(t.Events,"navigate",function(n,t){t||(t={trigger:!0});t.trigger&&_.isFunction(r._callbacks[u])&&r._callbacks[u]()})},_setContext:function(n,t,i){(i||(i={clearOnNavigate:!0}),this._unbindNavigateListener(n),this.model.set(n,t),this.trigger("set-context:"+n),i.clearOnNavigate)&&this._setNavigateListener(n,t)},setContext:function(n,i,r){if(typeof i!="object")throw new Error("Please always pass an object or Model to Context Service");if(i instanceof t.Model||(i=new t.Model(i),i.loaded=!0),i.loaded){this._setContext(n,i,r);return}var u=this;this.listenTo(i,"sync",function(){u._setContext(n,i,r)})},getContext:function(n){return this.model.get(n)},clearContext:function(n){this._unbindNavigateListener(n);this.model.unset(n);this.trigger("clear-context:"+n)}});i.Services.ContextService=new r}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared,r=t.Service.extend({name:"NavigationHistoryService.js",_keyName:"navigation-history-",_usePushState:"pushState"in window.history,_historyLength:window.history.length,initialize:function(){this._sessionStorageHelper=i.Utils.SessionStorageHelper;this.listenTo(t.Events,"navigate",this.onNavigate);$(window).on("unload",_.bind(this.onUnload,this));this._getStoredHistoryLength()&&(this._historyLength=this._getStoredHistoryLength())},_getHistoryLengthKey:function(){return this._keyName+"history-length"},_getCurrentKey:function(){return this._keyName+this._historyLength},_getLastKey:function(){return this._keyName+(this._historyLength-1)},_addPage:function(n){if(!n)return!1;var t=window.location.pathname+window.location.search+window.location.hash;return this._sessionStorageHelper.set(this._getCurrentKey(),{name:n,href:t,index:this._historyLength})},_saveHistoryLength:function(){this._sessionStorageHelper.set(this._getHistoryLengthKey(),this._historyLength)},_getStoredHistoryLength:function(){return this._sessionStorageHelper.get(this._getHistoryLengthKey())},onNavigate:function(){this._usePushState&&(this._historyLength++,this._historyLength>=50&&this._saveHistoryLength())},onUnload:function(){this._getStoredHistoryLength()&&(this._historyLength++,this._saveHistoryLength())},addPage:function(n){if(!(n instanceof t.Model))return this._addPage(n);if(n.loaded)return this._addPage(n.get("name"));var i=this;return this.listenTo(n,"sync",function(){i._addPage(n.get("name"))}),!1},getLastPage:function(){return this._sessionStorageHelper.get(this._getLastKey())},goBack:function(){var n=this.getLastPage();return n?(i.Helpers.isSamePageRoute(n.href)?t.Events.trigger("navigate",n.href):window.location=n.href,!0):!1}});i.Services.NavigationHistoryService=new r}(ClickView,EasyMoney);!function(n,t){"use strict";var r=n.Shared,i=r.Utils.Constants.URL_PARAM_TYPES,u=t.Service.extend({_isAuthenticated:function(){return!!n.Data.User.username},_checkParams:function(t,i){var u=_.isObject(t),r=n.Data.Config.isDebug;if(!u){if(r)throw new Error("paramObj must be an object");t={}}return i.length?(_.each(i,function(n){if(!t[n]&&r)throw Error(n+" is required to generate url");}),t):t},_slugifyVideoName:function(n){return n?"/"+n.slugify():""},_extractParams:function(n){n||(n={});var u=_.pick(n,i.VIDEO_ID,i.VIDEO_NAME,i.COLLECTION_ID,i.COLLECTION_NAME,i.USER_CHANNELS_ID,i.USER_CHANNELS_NAME,i.GENERIC_ID,i.GENERIC_NAME);return n.video instanceof t.Model&&(u=_.extend(u,{videoId:n.video.get("id"),videoName:n.video.get("name")})),n.parent instanceof t.Model&&(u=_.extend(u,{collectionId:n.parent.get("id"),collectionName:n.parent.get("name")})),n.parent instanceof t.Collection&&(u=_.extend(u,{collectionId:n.parent.id||n.parent.options.id})),n.userChannel instanceof r.Models.UserChannel&&(u=_.extend(u,{userChannelId:n.userChannel.get("id"),userChannelName:n.userChannel.get("name")})),n.generic instanceof t.Model&&(u=_.extend(u,n.generic.pick("id","name"))),u},getGenericVideoUrl:function(n){return n=this._checkParams(n,[i.VIDEO_ID]),"/videos/"+n.videoId+this._slugifyVideoName(n.videoName)},getLibraryCategoryVideoUrl:function(n){return n=this._checkParams(n,[i.COLLECTION_ID,i.VIDEO_ID,i.VIDEO_NAME]),"/libraries/categories/"+n.collectionId+"/videos/"+n.videoId+this._slugifyVideoName(n.videoName)},getLibrarySeriesVideoUrl:function(n){return n=this._checkParams(n,[i.COLLECTION_ID,i.COLLECTION_NAME,i.VIDEO_ID,i.VIDEO_NAME]),"/libraries/series/"+n.collectionId+"/"+r.Helpers.Slugify(n.collectionName)+"/videos/"+n.videoId+this._slugifyVideoName(n.videoName)},getExchangeCategoryVideoUrl:function(n){return n=this._checkParams(n,[i.COLLECTION_ID,i.COLLECTION_NAME,i.VIDEO_ID,i.VIDEO_NAME]),"/exchange/categories/"+n.collectionId+"/"+r.Helpers.Slugify(n.collectionName)+"/videos/"+n.videoId+this._slugifyVideoName(n.videoName)},getExchangeDirectVideoUrl:function(n){return n=this._checkParams(n,[i.VIDEO_ID,i.VIDEO_NAME]),"/exchange/videos/"+n.videoId+this._slugifyVideoName(n.videoName)},getExchangeSeriesVideoUrl:function(n){return n=this._checkParams(n,[i.COLLECTION_ID,i.COLLECTION_NAME,i.VIDEO_ID,i.VIDEO_NAME]),"/exchange/series/"+n.collectionId+"/"+r.Helpers.Slugify(n.collectionName)+"/videos/"+n.videoId+this._slugifyVideoName(n.videoName)},getExchangeTopicVideoUrl:function(n){return n=this._checkParams(n,[i.COLLECTION_ID,i.COLLECTION_NAME,i.VIDEO_ID,i.VIDEO_NAME]),"/exchange/topics/"+n.collectionId+"/"+r.Helpers.Slugify(n.collectionName)+"/videos/"+n.videoId+this._slugifyVideoName(n.videoName)},getExchangeUserChannelVideoUrl:function(n){return n=this._checkParams(n,[i.COLLECTION_ID,i.COLLECTION_NAME,i.VIDEO_ID,i.VIDEO_NAME]),"/exchange/channels/"+n.collectionId+"/"+r.Helpers.Slugify(n.collectionName)+"/videos/"+n.videoId+this._slugifyVideoName(n.videoName)},getExchangeUserChannelPlaylistVideoUrl:function(n){return n=this._checkParams(n,[i.USER_CHANNELS_ID,i.USER_CHANNELS_NAME,i.COLLECTION_ID,i.COLLECTION_NAME,i.VIDEO_ID,i.VIDEO_NAME]),"/exchange/channels/"+n.userChannelId+"/"+r.Helpers.Slugify(n.userChannelName)+"/playlists/"+n.collectionId+"/"+r.Helpers.Slugify(n.collectionName)+"/videos/"+n.videoId+this._slugifyVideoName(n.videoName)},getWorkspaceCategoryVideoUrl:function(n){return n=this._checkParams(n,[i.VIDEO_ID,i.COLLECTION_ID]),"/workspace/categories/"+n.collectionId+"/videos/"+n.videoId},getLibraryVideoUrl:function(n){return n=this._checkParams(n,[i.VIDEO_ID,i.VIDEO_NAME]),"/libraries/videos/"+n.videoId+this._slugifyVideoName(n.videoName)},getWorkspaceVideoUrl:function(n){return n=this._checkParams(n,[i.VIDEO_ID]),"/workspace/videos/"+n.videoId},getOnlinePlaylistVideoUrl:function(n){return n=this._checkParams(n,[i.COLLECTION_ID,i.VIDEO_ID]),"/playlists/"+n.collectionId+"/videos/"+n.videoId},getOnlineSharedPlaylistVideoUrl:function(n){return n=this._checkParams(n,[i.COLLECTION_ID,i.VIDEO_ID]),"/playlists/share/"+n.collectionId+"/videos/"+n.videoId},getLibraryCategoryUrl:function(n){return n=this._checkParams(n,[i.COLLECTION_ID,i.COLLECTION_NAME]),"/libraries/categories/"+n.collectionId+this._slugifyVideoName(n.collectionName)},getExchangeCategoryUrl:function(n){return n=this._checkParams(n,[i.COLLECTION_ID,i.COLLECTION_NAME]),"/exchange/categories/"+n.collectionId+this._slugifyVideoName(n.collectionName)},getWorkspaceCategoryUrl:function(n){return n=this._checkParams(n,[i.COLLECTION_ID]),"/workspace/categories/"+n.collectionId},getLibrarySeriesUrl:function(n){return n=this._checkParams(n,[i.COLLECTION_ID,i.COLLECTION_NAME]),"/libraries/series/"+n.collectionId+this._slugifyVideoName(n.collectionName)},getExchangeSeriesUrl:function(n){return n=this._checkParams(n,[i.COLLECTION_ID,i.COLLECTION_NAME]),"/exchange/series/"+n.collectionId+this._slugifyVideoName(n.collectionName)},getGlobalSeriesUrl:function(n){return n=this._checkParams(n,[i.COLLECTION_ID,i.COLLECTION_NAME]),"/series/"+n.collectionId+this._slugifyVideoName(n.collectionName)},getLegacySearchUrl:function(n){return n=this._checkParams(n,[i.COLLECTION_NAME]),"/search/alllibraries?q="+encodeURIComponent(n.collectionName)},getExchangeVideoUrl:function(n,t){var i=this._extractParams({video:n,parent:t}),u;return t instanceof r.Models.Category?this.getExchangeCategoryVideoUrl(i):t instanceof r.Models.Series?this.getExchangeSeriesVideoUrl(i):t instanceof r.Models.Topic?this.getExchangeTopicVideoUrl(i):t instanceof r.Models.UserChannel?this.getExchangeUserChannelVideoUrl(i):t instanceof r.Models.MasterPlaylist&&(u=t.collection&&t.collection.parent,u instanceof r.Models.UserChannel)?this.getExchangeUserChannelPlaylistVideoUrl(this._extractParams({video:n,parent:t,userChannel:u})):this.getExchangeDirectVideoUrl(i)},getSeriesUrl:function(n){var t,i;return(n instanceof r.Models.Series)?n.get("name")?(t=n&&n.parent,!(t instanceof r.Models.MasterVideo))?"":(i=this._extractParams({parent:n}),this._isAuthenticated()&&t.isOnlineLibraryVideo())?this.getLegacySearchUrl(i):this._isAuthenticated()&&t.isLibraryVideo()?this.getLibrarySeriesUrl(i):t.isExchangeVideo()?this.getExchangeSeriesUrl(i):this.getGlobalSeriesUrl(i):"":""},getCategoryUrl:function(n){var t,i,u;return n?(t={},n.length?n instanceof r.Collections.CategoryCollection&&(t=n.first()):t=n,i=t.collection&&t.collection.parent,!(i instanceof r.Models.MasterVideo))?"":(u=this._extractParams({video:i,parent:t}),this._isAuthenticated()&&i.isLibraryVideo())?this.getLibraryCategoryUrl(u):this._isAuthenticated()&&i.isExchangeVideo()?this.getExchangeCategoryUrl(u):this._isAuthenticated()&&i.isUsersWorkspaceVideo()?this.getWorkspaceCategoryUrl(u):"":""},getVideoUrl:function(i,u){if(!i)return"";if(!(i instanceof r.Models.MasterVideo))return i instanceof t.Model&&i.get("id")?this.getGenericVideoUrl(this._extractParams({video:i})):i.id?this.getGenericVideoUrl({videoId:i.id,videoName:i.name}):"";if(!i.get("id"))return"";var f=this._extractParams({video:i,parent:u});return u&&n.Playlists.Collections.SharedVideoCollection&&u instanceof n.Playlists.Collections.SharedVideoCollection?this.getOnlineSharedPlaylistVideoUrl(f):u&&n.Playlists.Collections.VideoCollection&&u instanceof n.Playlists.Collections.VideoCollection?this.getOnlinePlaylistVideoUrl(f):i.isLibraryVideo()?u instanceof r.Models.Category?this.getLibraryCategoryVideoUrl(f):u instanceof r.Models.Series?this.getLibrarySeriesVideoUrl(f):this.getLibraryVideoUrl(f):i.isExchangeVideo()?this.getExchangeVideoUrl(i,u):i.isWorkspaceVideo()?u instanceof r.Models.Category||u instanceof t.Collection?this.getWorkspaceCategoryVideoUrl(f):this.getWorkspaceVideoUrl(f):this.getGenericVideoUrl(f)},getCollectionCuratorUrl:function(t){var f,e,u;return(t instanceof r.Models.BaseCategory)?(f=n.Data.Config.urls.clickViewCurator,t.isMasterLibraryCollection())?(e=t.getLibrary(),!e)?null:(u=this._extractParams({parent:t,generic:e}),u=this._checkParams(u,[i.COLLECTION_ID,i.COLLECTION_NAME,i.GENERIC_ID,i.GENERIC_NAME]),t instanceof r.Models.Category)?f+"/hostedlibraries/"+u.id+"/categories/"+u.collectionId:t instanceof r.Models.Series?f+"/hostedlibraries/"+u.id+"/series/"+u.collectionId:null:t.isExchangeCollection()?(u=this._extractParams({parent:t}),u=this._checkParams(u,[i.COLLECTION_ID,i.COLLECTION_NAME]),t instanceof r.Models.Category)?f+"/exchange/categories/"+u.collectionId:t instanceof r.Models.Topic?f+"/exchange/topics/"+u.collectionId:null:null:null}});r.Services.ObjectLinkService=new u}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared,r=t.Service.extend({currentUser:n.Data.User,defaultOptions:{about:!0,share:!1,flag:!1,playlist:!1,channelPlaylists:!1,pushTo:!1,curriculum:!1,interactives:!1,devices:!1,edit:!1,showDownloadLinks:!1,webPlayerView:null,shareTabView:null},isReadOnly:function(){return this.currentUser.role===8},isTeacher:function(){return this.currentUser.role===2},getCurriculumLinkText:function(){return n.Data.Config.region===null||n.Data.AlbertLearningAreaType==null?"Add Curriculum Link":n.Data.Config.region.code.toLowerCase()==="au"&&n.Data.AlbertLearningAreaType.type.toLowerCase()==="tafe"?"Add Unit of Competency Link":"Add Curriculum Link"},getAboutTab:function(t,i){return{tabId:"cv-about",order:0,text:"About",view:i.aboutTabView||new n.Shared.Views.AboutTabView({model:t,showDownloadLinks:i.showDownloadLinks}),preload:!0,selected:!0,cssId:"cv-about-tab"}},getShareTab:function(t,i){return{tabId:"cv-share",text:"Share",view:i.shareTabView||n.Shared.Views.ShareTabView,order:1,cssId:"cv-share-tab",preload:!1,selected:!1,initParams:{itemModel:t}}},getPlaylistTab:function(t,i){var r=i.channelPlaylists&&i.channelId,u=[{tabId:"cv-personal-playlist",order:1,text:"Personal Playlists",view:n.Shared.Views.PlaylistTabView,initParams:{model:t},preload:!0,selected:!r}];return r&&u.push({tabId:"cv-channel-playlist",order:0,text:"Channel Playlists",view:n.FreeToAir.Views.UserChannelPlaylistTabView,initParams:{model:t,userChannelId:i.channelId,userChannel:i.userChannel},preload:!0,selected:!0}),{tabId:"cv-playlists-tabs",text:"Add to a playlist",view:n.Shared.Views.TabView,order:2,cssId:"cv-playlists-tab",preload:!1,initParams:{collection:new n.Shared.Collections.TabCollection(u),secondary:!0}}},getPushToTab:function(t){return{tabId:"cv-push",text:"Add to your Library",view:n.Shared.Views.PushToTabView,order:3,cssId:"cv-push-to-tab",preload:!1,initParams:{model:t}}},getFlagTab:function(t,i){return{tabId:"cv-flag",text:"Flag this video",view:i.flagView||n.Shared.Views.FlagVideoView,order:4,cssId:"cv-flag-video-tab",preload:!1,initParams:{model:t}}},getCurriculumTab:function(t){return{tabId:"cv-curriculum",text:this.getCurriculumLinkText(),view:n.Shared.Views.CurriculumTabView,order:5,cssId:"cv-curriculum-map-tab",preload:!1,beta:!1,initParams:{model:t}}},getInteractivesTab:function(t,i){return{tabId:"interactive-resources-tab",order:6,text:"Interactive videos",view:n.Shared.Views.InteractiveResourcesTabView,preload:!1,selected:!1,cssId:"interactive-resources",initParams:{model:t,webPlayer:i.webPlayerView}}},getEditTab:function(t){return{tabId:"cv-edit-video",text:"Edit",view:n.Shared.Views.EditTabView,order:8,cssId:"cv-edit-tab",preload:!1,initParams:{model:t},selected:!1}},getTabs:function(t,i){i=_.extend({},this.defaultOptions,i);var r=[];return i.about&&r.push(this.getAboutTab(t,i)),i.share&&this.currentUser.username&&r.push(this.getShareTab(t,i)),i.playlist&&this.currentUser.modules.playlist&&!this.isReadOnly()&&r.push(this.getPlaylistTab(t,i)),i.pushTo&&this.currentUser.modules.pushTo&&!this.isReadOnly()&&(_.result(t,"isWorkspaceVideo",!1)||_.result(t,"isExchangeVideo",!1))&&r.push(this.getPushToTab(t,i)),i.flag&&!this.isReadOnly()&&r.push(this.getFlagTab(t,i)),i.curriculum&&this.currentUser.modules.curriculum&&_.result(t,"canBeCurriculumMapped",!1)&&!this.isReadOnly()&&r.push(this.getCurriculumTab(t,i)),i.interactives&&r.push(this.getInteractivesTab(t,i)),i.devices&&n.Data.Config.featureSwitches.sendToDevice&&this.isTeacher()&&r.push(this.getDevicesTab(t,i)),i.edit&&r.push(this.getEditTab(t)),r}});i.Services.PlayTabService=new r}(ClickView,EasyMoney),function(n,t){"use strict";var r=n.Shared,i=r.Models.RadioChannel=t.Model.extend({name:"Channel",intiailize:function(){},transmit:function(n,t){(t||(t={}),n)&&this.trigger(n)}}),u=t.Collection.extend({});r.Services.RadioService=t.Service.extend({name:"RadioService",initialize:function(){this._channelCache=new u;this.options.channels&&this.addChannels(this.options.channels)},_getChannelName:function(n){if(!(n instanceof i))throw Error("Provided channel must be an instance of Channel");return n.get("name")},getChannel:function(n){return n instanceof i?this._channelCache.get(n.id):this._channelCache.findWhere({name:n})},addChannel:function(n){var r,t;if(n||(n={}),!n.channelName&&!n.channel)throw Error("channelName option required to create a new channel");if(r=n.channelName||this._getChannelName(n.channel),this.getChannel(r))throw Error("Radio already contains a channel with the name "+r);if(t=n.channel,t&&!(t instanceof i))throw Error("Provided channel must be an instance of Channel");return t||(t=new i({name:n.channelName})),this._channelCache.add(t),t},removeChannel:function(n){var t=this.getChannel(n);t&&this._channelCache.remove(t)},getChannels:function(){return this._channelCache},_handleChannelObject:function(n){var t,i,r;for(t in n)r=n[t],!this._getChannelName(t)&&n.hasOwnProperty(t)&&(i=t),this.addChannel({channelName:i,channel:r})},_handleChannelArray:function(n){n.forEach(_.bind(function(n){var t,r;typeof n=="string"&&(t=n);n instanceof i&&(r=n);this.addChannel({channelName:t,channel:r})},this))},addChannels:function(n){if(typeof n=="object"){if(_.isArray(n)){this._handleChannelArray(n);return}if(_.isObject(n)){this._handleChannelObject(n);return}n instanceof i&&this.addChannel({channel:n})}typeof n=="string"&&this.addChannel({channelName:n})}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared,r=60,u=t.Model.extend({defaults:{trim:!0},addSuffix:function(n){return this.has("suffix")?(n.endsWith("...")&&(n=n.substring(0,n.length-this.get("suffix").length-3).trim()+"..."),n+" - "+this.get("suffix")):n},addPrefix:function(n){return this.has("prefix")?(n=this.get("prefix")+": "+n,n.endsWith("...")&&(n=n.substring(0,n.length-3).substring(0,this.get("titleLength")).trim()+"..."),n):n},combineTitles:function(){if(this.get("title").length>=this.get("titleLength")||!this.has("optionalTitle"))return this.get("title");var n=this.get("title")+" - "+this.get("optionalTitle");return!this.get("trim")||n.length<=this.get("titleLength")?n:n.substring(0,this.get("titleLength")-3).trim()+"..."},toString:function(){var n=this.combineTitles();return n=this.addPrefix(n),this.addSuffix(n)}});i.Services.TitleService=t.Service.extend({defaults:{suffix:"ClickView"},initialize:function(){this.options.titleLength=r-(this.options.suffix.length+3)},_getProperty:function(n,i){return!n||!i?"":i instanceof t.Model?i.get(n):i[n]},_setTitle:function(n){document.title=n+" - "+this.options.suffix;this.trigger("setTitle")},_buildTitle:function(n){var t,i;this._requestPending=!1;t=this._getProperty("description",n.primaryObject);n.secondaryObject&&(t=this._getProperty("name",n.secondaryObject));i=new u(_.extend({title:this._getProperty("name",n.primaryObject),optionalTitle:t,titleLength:this.options.titleLength},_.pick(n,"prefix","suffix","trim")));this._setTitle(i.toString())},setTitle:function(n){var i,r,u,f;if(n||(n={}),typeof n=="string"){this._setTitle(n);return}i=[];n.primaryObject instanceof t.Model&&!n.primaryObject.loaded&&(r=$.Deferred(),i.push(r),this.listenTo(n.primaryObject,"sync",r.resolve));n.secondaryObject instanceof t.Model&&!n.secondaryObject.loaded&&(u=$.Deferred(),i.push(u),this.listenTo(n.secondaryObject,"sync",u.resolve));this._requestPending=!0;f=this;$.when.apply(this,i).then(function(){f._buildTitle(n)})},hasRequestPending:function(){return this._requestPending}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n,r=t.Service.extend({name:"UserActivityService.js",defaults:{interval:3e4,activeOnStart:!0,detectUserInput:!1},initialize:function(){if(this.options.detectUserInput){if(this.options.activeOnStart){var n=this._getSetActive();_.isFunction(n)&&n.call(this,arguments)}this._startInterval();this._bindInput()}},isActive:function(){return this.options.detectUserInput?!!this._isActive:!document.hidden},dispose:function(){clearInterval(this.idleInterval);this._unbindInput()},_startInterval:function(){var n=_.bind(this._setInactive,this);this.idleInterval=setInterval(n,this.options.interval)},_setInactive:function(){var n=(new Date).valueOf()-this.options.interval;this.lastMovement&&this.lastMovement<n&&(this._isActive=!1)},_getSetActive:function(){var n=this;return this._boundSetActive||(this._boundSetActive=_.debounce(function(){n.lastMovement=(new Date).valueOf();n._isActive=!0},1e3)),this._boundSetActive},_bindInput:function(){var n=this._getSetActive();$(window).mousemove(n);$(window).keypress(n)},_unbindInput:function(){var n=this._getSetActive();$(window).unbind("mousemove",n);$(window).unbind("keypress",n)}});i.Services.UserActivityService=new r}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared,r=t.Service.extend({initialize:function(){this.sessionStorageHelper=i.Utils.SessionStorageHelper},saveUtm:function(){var n=i.Helpers.GetQueryString(),t;if(!n)return!1;for(t in n)n.hasOwnProperty(t)&&this.sessionStorageHelper.set(t,n[t]);return!0},getUtm:function(){var n={};return n.uTMSource=this.sessionStorageHelper.get("utm_source"),n.uTMMedium=this.sessionStorageHelper.get("utm_medium"),n.uTMCampaign=this.sessionStorageHelper.get("utm_campaign"),n}});i.Services.UtmService=new r}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared,g=function(n){return n.get("userChannels")&&n.get("userChannels").length},nt=function(){return n.Data.User.userChannels&&n.Data.User.userChannels.length},tt=function(t){if(!g(t)||!nt())return 0;var i=t.get("userChannels").find(function(t){return _.some(n.Data.User.userChannels,function(n){return t.get("id")==n.id})});return i?i.id:0},y=function(n,t){var r=n.startsWith("!"),u=r?n.substr(1):n,i;return _.isFunction(t[u])?(i=t[u](),r?!i:!!i):!1},p="other_workspace",e="workspace",s="exchange",o="hosted_library",c="online_library",w="all",v="none",w=[e,s,o,c,v],u=2,h=1,it=0,l=255,a=48,b="PlayTabView",r="VideoListItemView",f="MasterPlayView",k=[{id:"share",order:0,text:"Share",desc:"Share or embed this video.",className:"share-video",button:["!restrictionHasExpiry"],allowedLibs:w,allowedRoles:[u,h,6,8],allowedViews:[r,b]},{order:10,text:"Create an interactive video",desc:"Add questions, images and annotations to this video and test your student's understanding.",className:"create-interactive",allowedLibs:[e,s,o,c],allowedRoles:[u],allowedViews:[r,f]},{order:20,text:"Add to your Workspace",desc:"Add this video to your Workspace.",className:"add-to-workspace",allowedLibs:[s],allowedRoles:[u],allowedViews:[r,f]},{order:30,text:"Add to a playlist",desc:"Add this video to a playlist.",className:"add-to-playlist",allowedLibs:[e,s,o,c,v],allowedRoles:[u,h],allowedViews:[r]},{order:40,text:"Add to the Exchange",desc:"Add this video to the Exchange and share it with educators all over the country.",className:"add-to-exchange",allowedLibs:[e],allowedRoles:[u],allowedViews:[r,f]},{order:50,text:"Add to my channel",desc:"Add this video to your channel.",className:"add-to-exchange",allowedLibs:[e],allowedRoles:[u],allowedViews:[r,f],requiredModules:["userChannels"]},{id:"clip",order:60,text:"Create a clip",desc:"Create a new clip from this video.",className:"create-clip",allowedLibs:[e,s,o],allowedRoles:[u],allowedViews:[r,b],requiredModules:["clips"]},{order:70,text:"Add to your Library",desc:"Add this video to your Library.",className:"push-video",allowedLibs:[e,s,o],allowedRoles:[u],allowedViews:[r,f],requiredModules:["syncedLibrary"]},{order:80,text:"Edit",desc:"Edit this video.",className:"edit-video",allowedLibs:[e],allowedRoles:[u,h],allowedViews:[f,r]},{order:90,text:"Download",desc:"Download this video.",className:"download-video",allowedLibs:[e],allowedRoles:[u,h],allowedViews:[f,r]},{order:100,text:"Add "+i.Helpers.getCurriculumLinkText(),desc:"Link this video to the curriculum.",className:"add-curriculum-link",allowedLibs:[o,s,c],allowedRoles:[u],allowedViews:[f,r]},{order:110,text:"View "+i.Helpers.getCurriculumLinkText({plural:!0}),desc:"See which parts of the curriculum this video has been mapped to.",className:"view-curriculum-link",allowedLibs:[o,s,c],allowedRoles:[u],allowedViews:[f,r],requiredModules:["curriculum"]},{order:120,text:"Flag this video",desc:"Flag this video if you've found something wrong with it, or you find it inappropriate.",className:"flag-this-video",allowedLibs:[s,p],allowedRoles:[u,h],allowedViews:[f,r]},{order:130,text:"Delete",desc:"Delete this video.",className:"delete-video",allowedLibs:[e],allowedRoles:[u,h],allowedViews:[r,f]},{order:140,text:"Manage Video Access",desc:"Manage who can access this video",className:"restrict-access",allowedLibs:[o],allowedRoles:[u],allowedViews:[r,f],allowedMasterRoles:[a,l],filters:["!hasRestriction"]},{id:"edit-restriction",order:150,text:"Manage Video Access",desc:"Manage who can access this video",className:"edit-restriction",allowedLibs:[o],allowedRoles:[u],allowedViews:[r,f],allowedMasterRoles:[a,l],filters:["hasRestriction","!restrictionHasExpiry"]},{id:"approve",order:160,text:"Approve",desc:"Approve this video to remove the temporary restriction",className:"approve-restriction",button:["restrictionHasExpiry"],allowedLibs:[o],allowedRoles:[u],allowedViews:[r,f],allowedMasterRoles:[a,l],filters:["restrictionHasExpiry"]},{id:"restrict",order:170,text:"Manage Video Access",desc:"Manage who can access this video",className:"edit-restriction",allowedLibs:[o],allowedRoles:[u],allowedViews:[r,f],allowedMasterRoles:[a,l],filters:["restrictionHasExpiry"]},{order:180,text:"Open in ClickView Curator",desc:"Open and edit this video in ClickView curator.",className:"open-in-curator",allowedLibs:[e,s,o,v],allowedRoles:[u,h],allowedViews:[r,f],allowedGroups:[2046453,2046458]},{id:"download-to-cache",order:200,text:"Add to Local Cache",desc:"Make this video available in your Local Cache",className:"download-to-cache",allowedLibs:w,allowedRoles:[u],allowedViews:[r,f],allowedMasterRoles:[32,a,l],requiredModules:["localCache"],filters:["!existsInLocalCache"]}],d={librariesAllowed:function(n,t){return!!_.intersection(n.allowedLibs,t.libraryTypes).length},userAllowed:function(n,t){return _.contains(n.allowedRoles,t.userRole||0)},viewAllowed:function(n,t){return _.contains(n.allowedViews,t.viewType)},modulesAllowed:function(n,t){return n.requiredModules?_.all(n.requiredModules,function(n){return!!t.currentUser.modules[n]}):!0},groupsAllowed:function(t){return t.allowedGroups?n.Shared.Helpers.userIsInGroup(t.allowedGroups):!0},masterRolesAllowed:function(n,t){return n.allowedMasterRoles?_.contains(n.allowedMasterRoles,t.currentUser.masterRole):!0},filtersAllowed:function(n,t){return n.filters?_.all(n.filters,function(n){return y(n,t.model)}):!0}},rt=t.Service.extend({name:"VideoActionsService.js",currentUser:n.Data.User,_actionsCache:{},events:{"click .add-to-playlist":"onClickAddToPlaylist","click .add-curriculum-link":"onClickAddCurriculumLink","click .view-curriculum-link":"onClickViewCurriculumLink","click .add-to-workspace":"onClickAddToWorkspace","click .push-video":"onClickPushVideo","click .flag-this-video":"onClickFlagThisVideo","click .add-to-exchange":"onClickAddToExchange","click .create-clip":"onClickCreateClip","click .delete-video":"onClickDeleteVideo","click .download-video":"onClickDownloadVideo","click .edit-video":"onClickEditVideo","click .share-video":"onClickShareVideo","click .create-interactive":"onClickCreateInteractive","click .open-in-curator":"onClickOpenInCurator","click .restrict-access":"onClickRestrictAccess","click .approve-restriction":"onClickApprove","click .edit-restriction":"onClickEditRestriction","click .download-to-cache":"onClickDownloadToLocalCache"},initialize:function(){this._staticActions=_.filter(k,function(n){return!n.filters});this._dynamicActions=_.filter(k,function(n){return n.filters})},_getLibraryTypes:function(t){var r=t.libraries.toJSON(),i;return(_.each(r,function(t){t.type===e&&t.id!=n.Data.User.workspaceId&&(t.type=p)}),i=_.map(r,function(n){return n.type}),!i.length)?[v]:_.uniq(i)},_getOrSetCache:function(n,t){if(this._actionsCache[n])return this._actionsCache[n];var i=t();return this._actionsCache[n]=i,i},_filterActions:function(n,t){return _.filter(n,function(n){return _.all(_.keys(d),function(i){return d[i](n,t)})})},getActions:function(t,u){var f,e;if(!(t instanceof i.Models.MasterVideo))throw new Error("You must pass an instance of ClickView.Shared.Models.MasterVideo into "+this.name);u||(u=r);f=[c];t.isOnlineLibraryVideo()||(f=this._getLibraryTypes(t));e=this.currentUser.role;!n.Data.User.modules.freeToAir&&t.isExchangeVideo()&&(e=it);var o={model:t,userRole:e,viewType:u,currentUser:this.currentUser,libraryTypes:f},l=e+f.join(",")+u,s=this._getOrSetCache(l,_.bind(function(){return this._filterActions(this._staticActions,o)},this)),h=this._filterActions(this._dynamicActions,o);return h.length&&(s=s.concat(h)),_.map(s,function(n){return n.button?(n=_.extend({},n),n.button=_.all(n.button,function(n){return y(n,o.model)}),n):n})},mixin:function(n){var i,r;if(!(n.model instanceof t.Model))throw new Error(n.name+" must be passed an instance of EasyMoney.Model as it's model if you want to use VideoActionsService.mixin()");n.events||(n.events={});_.extend(n.events,this.events);for(i in this.events)this.events.hasOwnProperty(i)&&(r=this.events[i],n[r]=this[r]);n.delegateEvents()},onClickCreateInteractive:function(){var n=i.Models.InteractiveResource.newResource(this.model);this.listenTo(n,"sync",function(){i.Utils.AnalyticsService.logInteractiveCreate(n);window.location="/interactives/edit/"+n.get("id")});n.save();_.isFunction(this.showDeleteLoader)&&this.showDeleteLoader()},onClickShareVideo:function(){var n=new i.Views.ShareTabView({itemModel:this.model}),t=new i.Views.PopupView({view:n,title:"Share this video",cssId:"cv-share-tab",showButtonContainer:!0});t.selfRender()},onClickEditVideo:function(){var n=new i.Views.EditTabView({model:this.model}),t=new i.Views.PopupView({view:n,title:"Edit this video",cssId:"cv-edit-tab",showButtonContainer:!1});t.selfRender()},onClickDownloadVideo:function(){var r=n.Data.Config.urls.workspaceApi+"/workspace/download/"+this.model.get("tokenId"),t;r=i.Helpers.StripProtocol(r);this._reported||(n.Shared.Utils.AjaxHelper.post("/royalties",{videoId:this.model.get("id"),type:"download-mp4"}),this._reported=!0);t=this.$el.find("iframe");t.length==0&&(t=$("<iframe />").hide(),this.$el.append(t));t.attr("src",r)},onClickDeleteVideo:function(){var t=this,r=t.model.collection;n.Utils.Dialog({title:"Are you sure you would like to delete this video?",content:"<p>This will permanently delete the video, along with all its interactives and share links.<\/p>",buttons:[{text:"No, keep my video",className:"btn grey"},{text:"Yes, delete this video",className:"btn red",success:!0}]}).done(function(){_.isFunction(t.showDeleteLoader)&&t.showDeleteLoader();t.model.destroy({wait:!0}).then(function(){if(!!r){r.trigger("reload");return}i.Services.NavigationHistoryService.goBack()||Backbone.history.navigate("/workspace",{trigger:!0})||(window.location="/workspace")})})},onClickAddToExchange:function(){var t=new i.Views.AddToExchangeView({model:this.model}),r=new n.Shared.Views.PopupView({view:t,title:"Add to the Exchange",cssId:"add-to-exchange",showButtonContainer:!1});r.selfRender()},onClickCreateClip:function(){var t=new i.Views.CreateClipView({model:this.model}),r=new n.Shared.Views.PopupView({view:t,title:"Create a Clip",cssId:"create-clip",showButtonContainer:!1});r.selfRender()},onClickFlagThisVideo:function(){var n=new i.Views.FlagVideoView({model:this.model,popup:!0}),t=new i.Views.PopupView({view:n,title:"Flag this video",cssId:"cv-share-tab",showButtonContainer:!1});t.selfRender()},onClickPushVideo:function(){var n=new i.Views.PushToTabView({model:this.model}),t=new i.Views.PopupView({view:n,title:"Add to your Library",cssId:"cv-share-tab",showButtonContainer:!1});t.selfRender()},onClickAddToWorkspace:function(){var f=this,r={title:"Add to your Workspace",buttons:[{text:"Close",className:"btn"},{text:"Go to Workspace",className:"btn primary",success:!0}]},u=new t.Model;r.view=new i.Views.VideoListItemActionResultView({model:u});r.before=function(){return i.Utils.AjaxHelper.post("/api/workspace/push-from-master",{masterId:f.model.get("id")}).done(function(){u.set("message","This video was successfully added to your Workspace.");i.Utils.AnalyticsService.logExchangeAddToWorkspace(f.model.toAnalyticsObject())}).fail(function(){u.set("message","You do not have enough space in your Workspace.")})};n.Utils.Dialog(r).then(function(){window.location="/workspace"})},onClickAddToPlaylist:function(){var t=tt(this.model),r=[{tabId:"cv-personal-playlist",order:1,text:"Personal Playlists",view:i.Views.PlaylistTabView,initParams:{model:this.model},preload:!0,selected:!t}],u,f;t&&n.FreeToAir.Views.UserChannelPlaylistTabView&&r.push({tabId:"cv-channel-playlist",order:0,text:"Channel Playlists",view:n.FreeToAir.Views.UserChannelPlaylistTabView,initParams:{model:this.model,userChannelId:t},preload:!0,selected:!0});u=new i.Views.TabView({collection:new i.Collections.TabCollection(r),secondary:!0});f=new i.Views.PopupView({view:u,title:"Add this video to a playlist",cssId:"cv-share-tab",showButtonContainer:!0});f.selfRender()},onClickAddCurriculumLink:function(){var n=new i.Views.CurriculumTabView({model:this.model}),t=new i.Views.PopupView({view:n,title:"Add "+i.Helpers.getCurriculumLinkText()+" to this video",cssId:"add-curriculum-link-tab",showButtonContainer:!1});t.selfRender()},onClickViewCurriculumLink:function(){var t,r,u;n.Albert.Views.VideoItemView&&this instanceof n.Albert.Views.VideoItemView?(n.Shared.Utils.AnalyticsService.logViewCurriculumLink(this.getLogData()),t="AlbertResults"):t=this instanceof n.Shared.Views.MasterPlayViewActionsView?"PlayPage":"VideoList";r=new i.Views.YearLearningAreaListView({trackingCode:this.model.get("trackingCode"),learningAreaType:n.Data.AlbertLearningAreaType.type,referredFrom:t});u=new i.Views.PopupView({view:r,title:i.Helpers.getCurriculumLinkText({plural:!0}),showButtonContainer:!1,canClose:!0,positionY:10,cssId:"assigned-learning-area-popup"});u.selfRender()},onClickOpenInCurator:function(){window.open(n.Data.Config.urls.clickViewCurator+"/tools/programlookup/"+this.model.get("id"),"_blank")},onClickRestrictAccess:function(){var n=new i.Views.RestrictAccessPopupView({videoModel:this.model,buttonText:"Update access"}),t=new i.Views.PopupView({view:n,title:"Manage who can access this video",showButtonContainer:!1,canClose:!0,cssId:"restrict-access-popup"});t.selfRender()},onClickApprove:function(){var n=this;this.model.hasRestriction()&&this.model.getRestriction().destroy({success:function(){i.Utils.AnalyticsService.approveTitleSuccess({id:n.model.get("id")});n.model.set("restrictions",[]);n.model.trigger("itemUnrestricted",n.model)},error:function(){i.Utils.AnalyticsService.approveTitleFailed({id:n.model.get("id")})}})},onClickEditRestriction:function(){var t=new n.Shared.Views.RestrictAccessPopupView({videoModel:this.model,buttonText:"Update access"}),i=new n.Shared.Views.PopupView({view:t,title:"Manage who can access to this video",showButtonContainer:!1,canClose:!0,cssId:"restrict-access-popup"});i.selfRender()},onClickDownloadToLocalCache:function(){var t=new n.Shared.Views.DownloadToLocalCachePopupView({model:this.model.localCacheDownload,videoModel:this.model}),i=new n.Shared.Views.PopupView({view:t,title:"Add video to Local Cache",showButtonContainer:!1,canClose:!0,cssId:"cache-download-popup"});i.selfRender()}});i.Services.VideoActionService=new rt}(ClickView,EasyMoney);this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.AddToExchange=Handlebars.template({"1":function(n,t,i,r,u){var f;return'<div class="please-note">\r\n    <div class="inner">\r\n'+((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.existsInMaster:t,{name:"if",hash:{},fn:n.program(2,u,0),inverse:n.noop,data:u}))!=null?f:"")+"    <\/div>\r\n<\/div>\r\n"},"2":function(){return"        <p>This video has already been added to the Exchange.<\/p>\r\n"},"4":function(){return'<div class="message-content">Contribute this video to the Exchange.<\/div>\r\n'},"6":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.canEdit:t,{name:"if",hash:{},fn:n.program(7,u,0),inverse:n.program(9,u,0),data:u}))!=null?f:""},"7":function(){return'        <div class="btn-group">\r\n            <a aria-expanded="false" class="btn orange dropdown-toggle" data-toggle="dropdown">\r\n                Add <span class="caret"><\/span>\r\n            <\/a>\r\n            <ul class="dropdown-menu">\r\n                <li class="edit-button">\r\n                    <a>Edit<\/a>\r\n                <\/li>\r\n                <li class="add-button">\r\n                    <a>Add to Exchange<\/a>\r\n                <\/li>\r\n            <\/ul>\r\n        <\/div>\r\n'},"9":function(){return'        <a class="btn orange add-button">Add to Exchange<\/a>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return'<div class="video-list-item"><\/div>\r\n\r\n'+((f=i["if"].call(e,t!=null?t.hasWarning:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(4,u,0),data:u}))!=null?f:"")+'\r\n<div class="popup-button-container-fake">\r\n    <a class="btn grey close-button">Cancel<\/a>\r\n'+((f=i.unless.call(e,t!=null?t.existsInMaster:t,{name:"unless",hash:{},fn:n.program(6,u,0),inverse:n.noop,data:u}))!=null?f:"")+"<\/div>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.AlbertTagItem=Handlebars.template({"1":function(){return'<div class="delete-btn">x<\/div>'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{};return'<div class="tag-item">\r\n  <div class="tag-title">'+n.escapeExpression((f=(f=i.title||(t!=null?t.title:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(o,{name:"title",hash:{},data:u}):f))+"<\/div>\r\n  "+((e=i["if"].call(o,t!=null?t.deletable:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?e:"")+"\r\n<\/div>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.Alert=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return n.escapeExpression((f=(f=i.message||(t!=null?t.message:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"message",hash:{},data:u}):f))},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.Banner=Handlebars.template({"1":function(n,t,i,r,u){var f;return'<p class="sub-heading">'+n.escapeExpression((f=(f=i.subHeading||(t!=null?t.subHeading:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"subHeading",hash:{},data:u}):f))+"<\/p>"},"3":function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{};return'<a href="'+n.escapeExpression((f=(f=i.curatorLink||(t!=null?t.curatorLink:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(o,{name:"curatorLink",hash:{},data:u}):f))+'" target="_blank" class="open-collection-in-curator '+((e=i["if"].call(o,t!=null?t.downloadPdf:t,{name:"if",hash:{},fn:n.program(4,u,0),inverse:n.noop,data:u}))!=null?e:"")+'">Open in ClickView Curator<\/a>\r\n'},"4":function(){return"has-pdf"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{};return'<div class="banner-text">\r\n    <h1>'+n.escapeExpression((f=(f=i.name||(t!=null?t.name:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(o,{name:"name",hash:{},data:u}):f))+"<\/h1>\r\n    "+((e=i["if"].call(o,t!=null?t.subHeading:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?e:"")+"\r\n<\/div>\r\n"+((e=i["if"].call(o,t!=null?t.curatorLink:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?e:"")+'<div class="downloading-pdf-container"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.BaseTileItem=Handlebars.template({"1":function(){return"data-original"},"3":function(){return"src"},"5":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return'            <span class="video-count">\r\n            '+((f=i["if"].call(e,t!=null?t.mediaCount:t,{name:"if",hash:{},fn:n.program(6,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,t!=null?t.hasMediaAndSubCategories:t,{name:"if",hash:{},fn:n.program(8,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n            "+((f=i["if"].call(e,t!=null?t.subCategoryCount:t,{name:"if",hash:{},fn:n.program(10,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n            <\/span>\r\n"},"6":function(n,t,i,r,u){var f;return n.escapeExpression((f=(f=i.videoCountText||(t!=null?t.videoCountText:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"videoCountText",hash:{},data:u}):f))},"8":function(){return", "},"10":function(n,t,i,r,u){var f;return n.escapeExpression((f=(f=i.subCategoryCount||(t!=null?t.subCategoryCount:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"subCategoryCount",hash:{},data:u}):f))},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var o,f,e=t!=null?t:n.nullContext||{},s=i.helperMissing,h="function",c=n.escapeExpression;return'<div class="cv-thumbnail">\r\n    <a href="'+c((f=(f=i.url||(t!=null?t.url:t))!=null?f:s,typeof f===h?f.call(e,{name:"url",hash:{},data:u}):f))+'">\r\n        <img '+((o=i["if"].call(e,t!=null?t.lazyLoad:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(3,u,0),data:u}))!=null?o:"")+'="'+c((f=(f=i.thumbUrl||(t!=null?t.thumbUrl:t))!=null?f:s,typeof f===h?f.call(e,{name:"thumbUrl",hash:{},data:u}):f))+'" class="lazy">\r\n        <div class="text-content">\r\n            <p class="name">'+c((f=(f=i.name||(t!=null?t.name:t))!=null?f:s,typeof f===h?f.call(e,{name:"name",hash:{},data:u}):f))+"<\/p>\r\n"+((o=i["if"].call(e,t!=null?t.showCount:t,{name:"if",hash:{},fn:n.program(5,u,0),inverse:n.noop,data:u}))!=null?o:"")+"        <\/div>\r\n    <\/a>\r\n<\/div>\r\n"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.BaseTileList=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="tile">\r\n    <div class="tile-inner">\r\n        <div class="tile-inner-content">\r\n            <div class="tile-stripe-thick partial-loading-item"><\/div>\r\n            <div class="tile-stripe partial-loading-item"><\/div>\r\n            <div class="tile-stripe partial-loading-item"><\/div>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>\r\n<div class="tile">\r\n    <div class="tile-inner">\r\n        <div class="tile-inner-content">\r\n            <div class="tile-stripe-thick partial-loading-item"><\/div>\r\n            <div class="tile-stripe partial-loading-item"><\/div>\r\n            <div class="tile-stripe partial-loading-item"><\/div>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>\r\n<div class="tile">\r\n    <div class="tile-inner">\r\n        <div class="tile-inner-content">\r\n            <div class="tile-stripe-thick partial-loading-item"><\/div>\r\n            <div class="tile-stripe partial-loading-item"><\/div>\r\n            <div class="tile-stripe partial-loading-item"><\/div>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>\r\n<div class="tile">\r\n    <div class="tile-inner">\r\n        <div class="tile-inner-content">\r\n            <div class="tile-stripe-thick partial-loading-item"><\/div>\r\n            <div class="tile-stripe partial-loading-item"><\/div>\r\n            <div class="tile-stripe partial-loading-item"><\/div>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>\r\n<div class="tile">\r\n    <div class="tile-inner">\r\n        <div class="tile-inner-content">\r\n            <div class="tile-stripe-thick partial-loading-item"><\/div>\r\n            <div class="tile-stripe partial-loading-item"><\/div>\r\n            <div class="tile-stripe partial-loading-item"><\/div>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>\r\n<div class="tile">\r\n    <div class="tile-inner">\r\n        <div class="tile-inner-content">\r\n            <div class="tile-stripe-thick partial-loading-item"><\/div>\r\n            <div class="tile-stripe partial-loading-item"><\/div>\r\n            <div class="tile-stripe partial-loading-item"><\/div>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>\r\n<div class="tile">\r\n    <div class="tile-inner">\r\n        <div class="tile-inner-content">\r\n            <div class="tile-stripe-thick partial-loading-item"><\/div>\r\n            <div class="tile-stripe partial-loading-item"><\/div>\r\n            <div class="tile-stripe partial-loading-item"><\/div>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>\r\n<div class="tile">\r\n    <div class="tile-inner">\r\n        <div class="tile-inner-content">\r\n            <div class="tile-stripe-thick partial-loading-item"><\/div>\r\n            <div class="tile-stripe partial-loading-item"><\/div>\r\n            <div class="tile-stripe partial-loading-item"><\/div>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>\r\n<div class="tile">\r\n    <div class="tile-inner">\r\n        <div class="tile-inner-content">\r\n            <div class="tile-stripe-thick partial-loading-item"><\/div>\r\n            <div class="tile-stripe partial-loading-item"><\/div>\r\n            <div class="tile-stripe partial-loading-item"><\/div>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>\r\n<div class="tile">\r\n    <div class="tile-inner">\r\n        <div class="tile-inner-content">\r\n            <div class="tile-stripe-thick partial-loading-item"><\/div>\r\n            <div class="tile-stripe partial-loading-item"><\/div>\r\n            <div class="tile-stripe partial-loading-item"><\/div>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>\r\n<div class="tile">\r\n    <div class="tile-inner">\r\n        <div class="tile-inner-content">\r\n            <div class="tile-stripe-thick partial-loading-item"><\/div>\r\n            <div class="tile-stripe partial-loading-item"><\/div>\r\n            <div class="tile-stripe partial-loading-item"><\/div>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>\r\n<div class="tile">\r\n    <div class="tile-inner">\r\n        <div class="tile-inner-content">\r\n            <div class="tile-stripe-thick partial-loading-item"><\/div>\r\n            <div class="tile-stripe partial-loading-item"><\/div>\r\n            <div class="tile-stripe partial-loading-item"><\/div>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>\r\n<div class="tile">\r\n    <div class="tile-inner">\r\n        <div class="tile-inner-content">\r\n            <div class="tile-stripe-thick partial-loading-item"><\/div>\r\n            <div class="tile-stripe partial-loading-item"><\/div>\r\n            <div class="tile-stripe partial-loading-item"><\/div>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>\r\n<div class="tile">\r\n    <div class="tile-inner">\r\n        <div class="tile-inner-content">\r\n            <div class="tile-stripe-thick partial-loading-item"><\/div>\r\n            <div class="tile-stripe partial-loading-item"><\/div>\r\n            <div class="tile-stripe partial-loading-item"><\/div>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>\r\n<div class="tile">\r\n    <div class="tile-inner">\r\n        <div class="tile-inner-content">\r\n            <div class="tile-stripe-thick partial-loading-item"><\/div>\r\n            <div class="tile-stripe partial-loading-item"><\/div>\r\n            <div class="tile-stripe partial-loading-item"><\/div>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>\r\n<div class="tile">\r\n    <div class="tile-inner">\r\n        <div class="tile-inner-content">\r\n            <div class="tile-stripe-thick partial-loading-item"><\/div>\r\n            <div class="tile-stripe partial-loading-item"><\/div>\r\n            <div class="tile-stripe partial-loading-item"><\/div>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.BreadcrumbView=Handlebars.template({"1":function(){return"<span>"},"3":function(n,t,i,r,u){var f;return'<a href="'+n.escapeExpression((f=(f=i.url||(t!=null?t.url:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"url",hash:{},data:u}):f))+'">'},"5":function(){return"<\/span>"},"7":function(){return"<\/a>"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{};return((e=i["if"].call(o,t!=null?t.last:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(3,u,0),data:u}))!=null?e:"")+n.escapeExpression((f=(f=i.name||(t!=null?t.name:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(o,{name:"name",hash:{},data:u}):f))+((e=i["if"].call(o,t!=null?t.last:t,{name:"if",hash:{},fn:n.program(5,u,0),inverse:n.program(7,u,0),data:u}))!=null?e:"")},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.CallToAction=Handlebars.template({"1":function(n,t,i,r,u){var f;return'    <img class="cta-popup-img img-responsive" src="'+n.escapeExpression((f=(f=i.image||(t!=null?t.image:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"image",hash:{},data:u}):f))+'"><\/img>\r\n'},"3":function(n,t,i,r,u){var f;return'    <div class="cta-popup-text">'+n.escapeExpression((f=(f=i.text||(t!=null?t.text:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"text",hash:{},data:u}):f))+"<\/div>\r\n"},"5":function(){return'        <a class="btn grey close-btn">Close<\/a>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e,o=t!=null?t:n.nullContext||{};return'<div class="cta-popup" role="listbox">\r\n'+((f=i["if"].call(o,t!=null?t.image:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(o,t!=null?t.text:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:"")+'    <div class="popup-button-container-fake">\r\n        <a class="btn orange cta-btn">'+n.escapeExpression((e=(e=i.buttonText||(t!=null?t.buttonText:t))!=null?e:i.helperMissing,typeof e=="function"?e.call(o,{name:"buttonText",hash:{},data:u}):e))+"<\/a>\r\n"+((f=i["if"].call(o,t!=null?t.closeButton:t,{name:"if",hash:{},fn:n.program(5,u,0),inverse:n.noop,data:u}))!=null?f:"")+'        <a class="dont-show-label">Don\'t show this again<\/a>\r\n    <\/div>\r\n<\/div>\r\n'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.CheckBox=Handlebars.template({"1":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.check:t,{name:"if",hash:{},fn:n.program(2,u,0),inverse:n.program(4,u,0),data:u}))!=null?f:""},"2":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'    <span class="check-mark '+h((f=(f=i.colour||(t!=null?t.colour:t))!=null?f:o,typeof f===s?f.call(e,{name:"colour",hash:{},data:u}):f))+" "+h((f=(f=i.type||(t!=null?t.type:t))!=null?f:o,typeof f===s?f.call(e,{name:"type",hash:{},data:u}):f))+'"><\/span>\r\n'},"4":function(n,t,i,r,u){var f;return'    <span class="radio-button '+n.escapeExpression((f=(f=i.colour||(t!=null?t.colour:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"colour",hash:{},data:u}):f))+'"><\/span>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var o,f,e=t!=null?t:n.nullContext||{},s=i.helperMissing,h="function",c=n.escapeExpression;return'<div class="check-box '+c((f=(f=i.type||(t!=null?t.type:t))!=null?f:s,typeof f===h?f.call(e,{name:"type",hash:{},data:u}):f))+" "+c((f=(f=i.enabled||(t!=null?t.enabled:t))!=null?f:s,typeof f===h?f.call(e,{name:"enabled",hash:{},data:u}):f))+'">\r\n'+((o=i["if"].call(e,t!=null?t.correct:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?o:"")+"<\/div>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.ContentLicence=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<div class="content-licence-container">\r\n  <div class="logo"><\/div>\r\n  <div class="licence">\r\n    <p>'+n.escapeExpression((f=(f=i.licenceText||(t!=null?t.licenceText:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"licenceText",hash:{},data:u}):f))+"<\/p>\r\n  <\/div>\r\n<\/div>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.ContributorInfo=Handlebars.template({"1":function(n,t,i,r,u){var f;return'<div class="info-item">\r\n<label class="inline">'+n.escapeExpression((f=(f=i.contributedByText||(t!=null?t.contributedByText:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"contributedByText",hash:{},data:u}):f))+" by:<\/label>\r\n"},"3":function(n,t,i,r,u){var f;return n.escapeExpression((f=(f=i.ownerName||(t!=null?t.ownerName:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"ownerName",hash:{},data:u}):f))+", "},"5":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return'<!--\r\n        --><i class="org-name" data-org="'+((f=(i.toLower||t&&t.toLower||i.helperMissing).call(e,(f=t!=null?t.organisation:t)!=null?f.name:f,{name:"toLower",hash:{},data:u}))!=null?f:"")+'">'+((f=n.lambda((f=t!=null?t.organisation:t)!=null?f.name:f,t))!=null?f:"")+"<\/i>\r\n        "+((f=i["if"].call(e,(f=t!=null?t.owner:t)!=null?f.verified:f,{name:"if",hash:{},fn:n.program(6,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n"},"6":function(n,t){var i;return'<span class="verified-badge" title="'+n.escapeExpression(n.lambda((i=t!=null?t.organisation:t)!=null?i.tooltip:i,t))+'"><\/span>'},"8":function(){return"<\/div>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return((f=i["if"].call(e,t!=null?t.label:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+'\r\n<p class="about-value contributor-name">\r\n    '+((f=i["if"].call(e,t!=null?t.ownerName:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:"")+"<!--\r\n -->"+((f=i["if"].call(e,t!=null?t.organisation:t,{name:"if",hash:{},fn:n.program(5,u,0),inverse:n.noop,data:u}))!=null?f:"")+"<\/p> \t\r\n\r\n"+((f=i["if"].call(e,t!=null?t.label:t,{name:"if",hash:{},fn:n.program(8,u,0),inverse:n.noop,data:u}))!=null?f:"")},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.CopyInteractiveSuccess=Handlebars.template({"1":function(){return'<h2>You\'ve successfully created an interactive video!<\/h2>\r\n<p>Click on the "Share" button below and get your students using your exciting new interactive video.<\/p>\r\n'},"3":function(n,t,i,r,u){var f;return'<div class="please-note">\r\n    <p class="inner">A copy of the interactive <strong>'+n.escapeExpression((f=(f=i.interactiveName||(t!=null?t.interactiveName:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"interactiveName",hash:{},data:u}):f))+"<\/strong> has been saved to your Workspace. You can edit or share with students at anytime.<\/p>\r\n<\/div>\r\n"},"5":function(){return'    <div class="col-sm-4 options-container retina-preview">\r\n        <img src="/Assets/images/interactives-editor/preview-interactive@2x.png" />\r\n        <p>See how this interactive video would look to your students.<\/p>\r\n        <a class="btn grey preview">Preview<\/a>\r\n    <\/div>\r\n'},"7":function(){return'    <div class="col-sm-4 options-container retina-interactions">\r\n        <img src="/Assets/images/interactives-editor/interactions@2x.png" />\r\n        <p>Add or remove any questions, annotations or images from this video.<\/p>\r\n        <a class="btn grey edit">Edit<\/a>\r\n    <\/div>\r\n'},"9":function(){return'    <a class="share">Share this interactive video<\/a>\r\n'},"11":function(){return'    <a class="edit">Edit this interactive video<\/a>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return((f=i["if"].call(e,t!=null?t.editor:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(3,u,0),data:u}))!=null?f:"")+'<div class="publish-options">\r\n'+((f=i["if"].call(e,t!=null?t.editor:t,{name:"if",hash:{},fn:n.program(5,u,0),inverse:n.program(7,u,0),data:u}))!=null?f:"")+'    <div class="col-sm-4 options-container centre-overlay retina">\r\n        <img src="/Assets/images/interactives-editor/share-interactive@2x.png" />\r\n        <p>Share this interactive video with your students and analyse their results.<\/p>\r\n        <a class="btn orange share">Share with your students<\/a>\r\n    <\/div>\r\n    <div class="col-sm-4 options-container retina">\r\n        <img src="/Assets/images/interactives-editor/interactives-in-workspace@2x.png"/>\r\n        <p>All interactive videos you create or copy will appear in your workspace.<\/p>\r\n        <a class="btn grey workspace">View in your Workspace<\/a>\r\n    <\/div>\r\n<\/div>\r\n<div class="publish-options-responsive">\r\n    <a class="preview">Preview this interactive video<\/a>\r\n'+((f=i["if"].call(e,t!=null?t.editor:t,{name:"if",hash:{},fn:n.program(9,u,0),inverse:n.program(11,u,0),data:u}))!=null?f:"")+'    <a class="workspace">View in your workspace<\/a>\r\n<\/div>\r\n\r\n'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.CreateInteractiveButton=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<svg class="plus-icon">\r\n    <use xlink:href="#plus"><\/use>\r\n<\/svg>\r\n<div class="button-text">Create an interactive video<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.CurriculumTab=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<iframe id="'+h((f=(f=i.id||(t!=null?t.id:t))!=null?f:o,typeof f===s?f.call(e,{name:"id",hash:{},data:u}):f))+'" frameborder="0" src="'+h((f=(f=i.url||(t!=null?t.url:t))!=null?f:o,typeof f===s?f.call(e,{name:"url",hash:{},data:u}):f))+"\" scrolling='no'><\/iframe>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.DownloadPdf=Handlebars.template({"1":function(){return'        <span class="loading-spinner"><\/span>\r\n'},"3":function(){return'        <svg class="download-pdf-icon">\r\n            <use xlink:href="#pdf-icon"><\/use>\r\n        <\/svg>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<button class="download-pdf-btn btn">\r\n'+((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.requestingPdf:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(3,u,0),data:u}))!=null?f:"")+'    <span class="text">Generate PDF<\/span>\r\n<\/button>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.DropdownItemView=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return"<a>"+n.escapeExpression((f=(f=i.text||(t!=null?t.text:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"text",hash:{},data:u}):f))+"<\/a>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.Edit=Handlebars.template({"1":function(n,t,i,r,u){var f;return'<textarea class="'+n.escapeExpression((f=(f=i.property||(t!=null?t.property:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"property",hash:{},data:u}):f))+'"><\/textarea>\r\n'},"3":function(n,t,i,r,u){var f;return'<input type="text" class="'+n.escapeExpression((f=(f=i.property||(t!=null?t.property:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"property",hash:{},data:u}):f))+'" />\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.textArea:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(3,u,0),data:u}))!=null?f:""},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.EditTab=Handlebars.template({"1":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.canEdit:t,{name:"if",hash:{},fn:n.program(2,u,0),inverse:n.program(4,u,0),data:u}))!=null?f:""},"2":function(n,t,i,r,u){var f;return'<a href="'+n.escapeExpression((f=(f=i.editorUrl||(t!=null?t.editorUrl:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"editorUrl",hash:{},data:u}):f))+'" class="launch-button cv-btn">Launch ClickView Cloud Editor<\/a>\r\n'},"4":function(n,t,i,r,u){var f;return"<p>"+n.escapeExpression((f=(f=i.editReason||(t!=null?t.editReason:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"editReason",hash:{},data:u}):f))+"<\/p>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<img src="/Assets/images/logos/clickview-cloud-editor-logo.png" />\r\n<p>Edit this video with the ClickView Cloud Editor<\/p>\r\n<div class="button-container">\r\n'+((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.loaded:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+"<\/div>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.EmptyMediaCollection=Handlebars.template({"1":function(n,t,i,r,u){var e,f;return"        "+((e=(f=(f=i.emptyMessage||(t!=null?t.emptyMessage:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"emptyMessage",hash:{},data:u}):f))!=null?e:"")+"\r\n"},"3":function(n,t,i,r,u){var f;return"        There are no videos in this "+n.escapeExpression((f=(f=i.type||(t!=null?t.type:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"type",hash:{},data:u}):f))+"\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<span class="empty-video-text">\r\n'+((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.emptyMessage:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(3,u,0),data:u}))!=null?f:"")+"<\/span>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.EmptyState=Handlebars.template({"1":function(n,t,i,r,u){var o,f,e=t!=null?t:n.nullContext||{},s=i.helperMissing,h="function",c=n.escapeExpression;return"<h2>"+c((f=(f=i.header||(t!=null?t.header:t))!=null?f:s,typeof f===h?f.call(e,{name:"header",hash:{},data:u}):f))+"<\/h2>\r\n<p>"+c((f=(f=i.callToAction||(t!=null?t.callToAction:t))!=null?f:s,typeof f===h?f.call(e,{name:"callToAction",hash:{},data:u}):f))+"<\/p>\r\n"+((o=i["if"].call(e,t!=null?t.imageUrl:t,{name:"if",hash:{},fn:n.program(2,u,0),inverse:n.noop,data:u}))!=null?o:"")},"2":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<div class="empty-state-image" style="background-image:url('+h((f=(f=i.imageUrl||(t!=null?t.imageUrl:t))!=null?f:o,typeof f===s?f.call(e,{name:"imageUrl",hash:{},data:u}):f))+");height:"+h((f=(f=i.imageHeight||(t!=null?t.imageHeight:t))!=null?f:o,typeof f===s?f.call(e,{name:"imageHeight",hash:{},data:u}):f))+"px;width:"+h((f=(f=i.imageWidth||(t!=null?t.imageWidth:t))!=null?f:o,typeof f===s?f.call(e,{name:"imageWidth",hash:{},data:u}):f))+'px"><\/div>\r\n'},"4":function(n,t,i,r,u){var o,f,e=t!=null?t:n.nullContext||{},s=i.helperMissing,h="function",c=n.escapeExpression;return((o=i["if"].call(e,t!=null?t.imageUrl:t,{name:"if",hash:{},fn:n.program(2,u,0),inverse:n.noop,data:u}))!=null?o:"")+"<h2>"+c((f=(f=i.header||(t!=null?t.header:t))!=null?f:s,typeof f===h?f.call(e,{name:"header",hash:{},data:u}):f))+"<\/h2>\r\n<p>"+c((f=(f=i.callToAction||(t!=null?t.callToAction:t))!=null?f:s,typeof f===h?f.call(e,{name:"callToAction",hash:{},data:u}):f))+"<\/p>\r\n"},"6":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<a class="btn primary '+h((f=(f=i.buttonSize||(t!=null?t.buttonSize:t))!=null?f:o,typeof f===s?f.call(e,{name:"buttonSize",hash:{},data:u}):f))+' go-to" href="'+h((f=(f=i.buttonUrl||(t!=null?t.buttonUrl:t))!=null?f:o,typeof f===s?f.call(e,{name:"buttonUrl",hash:{},data:u}):f))+'">'+h((f=(f=i.buttonText||(t!=null?t.buttonText:t))!=null?f:o,typeof f===s?f.call(e,{name:"buttonText",hash:{},data:u}):f))+"<\/a>\r\n"},"8":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<a class="btn primary '+h((f=(f=i.buttonSize||(t!=null?t.buttonSize:t))!=null?f:o,typeof f===s?f.call(e,{name:"buttonSize",hash:{},data:u}):f))+' go-to-secondary" href="'+h((f=(f=i.secondaryButtonUrl||(t!=null?t.secondaryButtonUrl:t))!=null?f:o,typeof f===s?f.call(e,{name:"secondaryButtonUrl",hash:{},data:u}):f))+'">'+h((f=(f=i.secondaryButtonText||(t!=null?t.secondaryButtonText:t))!=null?f:o,typeof f===s?f.call(e,{name:"secondaryButtonText",hash:{},data:u}):f))+"<\/a>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return((f=i["if"].call(e,t!=null?t.textBeforeImage:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(4,u,0),data:u}))!=null?f:"")+((f=i["if"].call(e,t!=null?t.button:t,{name:"if",hash:{},fn:n.program(6,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,t!=null?t.secondaryButton:t,{name:"if",hash:{},fn:n.program(8,u,0),inverse:n.noop,data:u}))!=null?f:"")},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.Error=Handlebars.template({"1":function(n,t,i,r,u){var f;return'<img src="'+n.escapeExpression((f=(f=i.imageUrl||(t!=null?t.imageUrl:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"imageUrl",hash:{},data:u}):f))+'"/>\r\n'},"3":function(n,t,i,r,u){var f;return"<h2>"+n.escapeExpression((f=(f=i.heading||(t!=null?t.heading:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"heading",hash:{},data:u}):f))+"<\/h2>\r\n"},"5":function(n,t,i,r,u){var e,f;return"<p>"+((e=(f=(f=i.message||(t!=null?t.message:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"message",hash:{},data:u}):f))!=null?e:"")+"<\/p>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return((f=i["if"].call(e,t!=null?t.imageUrl:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,t!=null?t.heading:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,t!=null?t.message:t,{name:"if",hash:{},fn:n.program(5,u,0),inverse:n.noop,data:u}))!=null?f:"")},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.ExchangeLandingBannerItem=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,h="function",s=n.escapeExpression;return'<a href="'+s((f=(f=i.href||(t!=null?t.href:t))!=null?f:o,typeof f===h?f.call(e,{name:"href",hash:{},data:u}):f))+'" style="background-image: url(\''+s((i.stripProtocol||t&&t.stripProtocol||o).call(e,t!=null?t.image:t,{name:"stripProtocol",hash:{},data:u}))+'\')"><\/a>\r\n<div class="metadata">\r\n    <div class="inner">\r\n        <h2>\r\n            <a href="'+s((f=(f=i.href||(t!=null?t.href:t))!=null?f:o,typeof f===h?f.call(e,{name:"href",hash:{},data:u}):f))+'">'+s((f=(f=i.title||(t!=null?t.title:t))!=null?f:o,typeof f===h?f.call(e,{name:"title",hash:{},data:u}):f))+'<\/a>\r\n        <\/h2>\r\n    <\/div>\r\n  <div class="description-container">\r\n    <div>\r\n      <p>'+s((f=(f=i.description||(t!=null?t.description:t))!=null?f:o,typeof f===h?f.call(e,{name:"description",hash:{},data:u}):f))+"<\/p>\r\n    <\/div>\r\n  <\/div>\r\n<\/div>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.ExchangeLandingBannerView=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div id="banner-container">\r\n    <div class="banner-slider"><\/div>\r\n<\/div>\r\n\r\n<div id="picks-banner-navigation">\r\n    <h3 class="title">Recommended Videos<\/h3>\r\n    <ul class="packs-pagination"><\/ul>\r\n<\/div>\r\n<div class="cf"><\/div>\r\n<div class="progress-bar"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.FlagVideo=Handlebars.template({"1":function(){return'    <div class="form-row">\r\n        <h3>Flag this video for removal<\/h3>\r\n    <\/div>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return"<form>\r\n"+((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.showTitle:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+'    <div class="form-row">\r\n        <div class="reasons-viewpart"><\/div>\r\n    <\/div>\r\n    <div>\r\n        <div class="reasons-error" style="display: none">\r\n            <p class="error"><\/p>\r\n        <\/div>\r\n    <\/div>\r\n    <div class="form-row">\r\n        <label>Additional Comments: <\/label>\r\n        <textarea id="complaint-comments" placeholder="Additional comments" name="complaint-comments"><\/textarea>\r\n    <\/div>\r\n    <div class="popup-button-container">\r\n        <a id="submit-complaint" class="cv-btn">Submit<\/a>\r\n        <a id="cancel-button" class="btn grey">Close<\/a>\r\n    <\/div>\r\n<\/form>\r\n'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.FormInputView=Handlebars.template({"1":function(n,t,i,r,u){var e,f;return'<div class="form-row">'+((e=(f=(f=i.title||(t!=null?t.title:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"title",hash:{},data:u}):f))!=null?e:"")+"<\/div>"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return"<form>\r\n    "+((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.title:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+'\r\n    <div class="form-row">\r\n        <div class="input-list-viewpart"><\/div>\r\n        <span class="help-block hidden"><\/span>\r\n    <\/div>\r\n<\/form>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.GoogleClassroom=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<div class="share-links-container">\r\n  <div class="embed-container">\r\n  <div class="google-classroom-container">\r\n    <script src="https://apis.google.com/js/platform.js" async defer><\/script>\r\n      <div class="google-classroom-widget">\r\n          <g:sharetoclassroom url="'+n.escapeExpression((f=(f=i.resourceLink||(t!=null?t.resourceLink:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"resourceLink",hash:{},data:u}):f))+'" size="32"><\/g:sharetoclassroom>\r\n      <\/div>\r\n    <span>Share with Google Classroom<\/span>\r\n  <\/div>\r\n  <\/div>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.HorizontalListView=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="slide-container-small"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.HorizontalPartialLoading=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="partial-loading-item title"><\/div><div class="partial-slide-container"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.ImageCroppingSelect=Handlebars.template({"1":function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{};return'<div class="existing-image-container">\r\n    <img src="'+n.escapeExpression((f=(f=i.url||(t!=null?t.url:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(o,{name:"url",hash:{},data:u}):f))+'" />\r\n    <div class="change-image-banner-container">\r\n        '+((e=i["if"].call(o,t!=null?t.editable:t,{name:"if",hash:{},fn:n.program(2,u,0),inverse:n.noop,data:u}))!=null?e:"")+"\r\n    <\/div>\r\n<\/div>\r\n"},"2":function(){return'<div class="change-image-banner-text">Change image<\/div>'},"4":function(){return'<div class="centering-box">\r\n    <span class="drop-icon" />\r\n\r\n    <span class="drop-title">Drag and drop<\/span>\r\n    <span class="drop-text">an image here to upload or <i>browse<\/i><\/span>\r\n<\/div>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{};return((e=i["if"].call(o,t!=null?t.url:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(4,u,0),data:u}))!=null?e:"")+'<input class="drop-select-file-input" type="file" accept="'+n.escapeExpression((f=(f=i.imageTypes||(t!=null?t.imageTypes:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(o,{name:"imageTypes",hash:{},data:u}):f))+'" style="display: none;" />'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.InputItemView=Handlebars.template({"1":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<label class="inline thin" for="'+h((f=(f=i.cssId||(t!=null?t.cssId:t))!=null?f:o,typeof f===s?f.call(e,{name:"cssId",hash:{},data:u}):f))+'" name="'+h((f=(f=i.name||(t!=null?t.name:t))!=null?f:o,typeof f===s?f.call(e,{name:"name",hash:{},data:u}):f))+'">'+h((f=(f=i.text||(t!=null?t.text:t))!=null?f:o,typeof f===s?f.call(e,{name:"text",hash:{},data:u}):f))+"<\/label>"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var c,f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<input id="'+h((f=(f=i.cssId||(t!=null?t.cssId:t))!=null?f:o,typeof f===s?f.call(e,{name:"cssId",hash:{},data:u}):f))+'" type="'+h((f=(f=i.inputType||(t!=null?t.inputType:t))!=null?f:o,typeof f===s?f.call(e,{name:"inputType",hash:{},data:u}):f))+'" value="'+h((f=(f=i.id||(t!=null?t.id:t))!=null?f:o,typeof f===s?f.call(e,{name:"id",hash:{},data:u}):f))+'" class="'+h((f=(f=i.inputClass||(t!=null?t.inputClass:t))!=null?f:o,typeof f===s?f.call(e,{name:"inputClass",hash:{},data:u}):f))+'" name="publish" />\r\n'+((c=i["if"].call(e,t!=null?t.label:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?c:"")+"'\r\n"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.InteractionListItem=Handlebars.template({"1":function(n,t,i,r,u){var f,e,h=n.lambda,o=n.escapeExpression,s=t!=null?t:n.nullContext||{},c=i.helperMissing;return'<div class="col-xs-12 col-sm-4">\r\n    <svg class="icon" style="background-color:#'+o(h((f=t!=null?t.type:t)!=null?f.colour:f,t))+'">\r\n        <use xlink:href="#'+o((i.interactionIcon||t&&t.interactionIcon||c).call(s,t!=null?t.typeId:t,{name:"interactionIcon",hash:{},data:u}))+'"><\/use>\r\n    <\/svg>\r\n    <div class="type">'+o(h((f=t!=null?t.type:t)!=null?f.name:f,t))+'<\/div>\r\n    <div class="time">'+o((e=(e=i.time||(t!=null?t.time:t))!=null?e:c,typeof e=="function"?e.call(s,{name:"time",hash:{},data:u}):e))+'<\/div>\r\n<\/div>\r\n<div class="col-xs-12 col-sm-8">\r\n    <div class="name">'+((f=i["if"].call(s,t!=null?t.isAnnotation:t,{name:"if",hash:{},fn:n.program(2,u,0),inverse:n.program(4,u,0),data:u}))!=null?f:"")+"<\/div>\r\n<\/div>\r\n"},"2":function(n,t,i,r,u){var e,f;return(e=(f=(f=i.annotation||(t!=null?t.annotation:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"annotation",hash:{},data:u}):f))!=null?e:""},"4":function(n,t,i,r,u){var f;return n.escapeExpression((f=(f=i.name||(t!=null?t.name:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"name",hash:{},data:u}):f))},"6":function(n,t,i,r,u){var f,e,s=n.lambda,o=n.escapeExpression,h=t!=null?t:n.nullContext||{};return'<span class="icon" style="background-image: url('+o(s((f=t!=null?t.type:t)!=null?f.icon:f,t))+"); background-color: #"+o(s((f=t!=null?t.type:t)!=null?f.colour:f,t))+'"><\/span>\r\n<span class="type">'+o(s((f=t!=null?t.type:t)!=null?f.name:f,t))+'<\/span>\r\n<span class="time">'+o((e=(e=i.time||(t!=null?t.time:t))!=null?e:i.helperMissing,typeof e=="function"?e.call(h,{name:"time",hash:{},data:u}):e))+'<\/span>\r\n<span class="name">\r\n'+((f=i["if"].call(h,t!=null?t.isAnnotation:t,{name:"if",hash:{},fn:n.program(7,u,0),inverse:n.program(9,u,0),data:u}))!=null?f:"")+"<\/span>\r\n"},"7":function(n,t,i,r,u){var e,f;return"    "+((e=(f=(f=i.annotation||(t!=null?t.annotation:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"annotation",hash:{},data:u}):f))!=null?e:"")+"\r\n"},"9":function(n,t,i,r,u){var f;return"    "+n.escapeExpression((f=(f=i.name||(t!=null?t.name:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"name",hash:{},data:u}):f))+"\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.renderInPopup:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(6,u,0),data:u}))!=null?f:""},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.InteractionPrintableItem=Handlebars.template({"1":function(n,t,i,r,u){var e,f;return"        "+((e=(f=(f=i.annotation||(t!=null?t.annotation:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"annotation",hash:{},data:u}):f))!=null?e:"")+"\r\n"},"3":function(n,t,i,r,u){var f;return"        "+n.escapeExpression((f=(f=i.sentence||(t!=null?t.sentence:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"sentence",hash:{},data:u}):f))+"\r\n"},"5":function(){return'    <div class="true-or-false">\r\n        <ul>\r\n            <li class="row printable-choice-row">\r\n                <div class="printable-checkbox col-sm-1"><\/div><div class="printable-choice col-sm-11">True<\/div>\r\n            <\/li>\r\n            <li class="row printable-choice-row">\r\n                <div class="printable-checkbox col-sm-11"><\/div><div class="printable-choice col-sm-11">False<\/div>\r\n            <\/li>\r\n        <\/ul>\r\n    <\/div>\r\n'},"7":function(){return'    <div class="short-answer">\r\n        <div class="printable-textarea"><\/div>\r\n    <\/div>\r\n'},"9":function(){return'<div class="multiple-choice-viewpart"><\/div>'},"11":function(n,t){var i;return'    <div class="image">\r\n        <img src="'+n.escapeExpression(n.lambda((i=t!=null?t.data:t)!=null?i.url:i,t))+'?size=small" class="printable-image"><\/img>\r\n    <\/div>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e,o=t!=null?t:n.nullContext||{},s=i.helperMissing;return'<div class="col-sm-1 time">'+n.escapeExpression((e=(e=i.time||(t!=null?t.time:t))!=null?e:s,typeof e=="function"?e.call(o,{name:"time",hash:{},data:u}):e))+'<\/div>\r\n<div class="col-sm-11 name">\r\n    <div class="question-cell">\r\n'+((f=i["if"].call(o,t!=null?t.annotation:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(3,u,0),data:u}))!=null?f:"")+"    <\/div>\r\n"+((f=(i.ifIs||t&&t.ifIs||s).call(o,t!=null?t.type:t,"==",(f=t!=null?t.interactionType:t)!=null?f.TrueOrFalse:f,{name:"ifIs",hash:{},fn:n.program(5,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=(i.ifIs||t&&t.ifIs||s).call(o,t!=null?t.type:t,"==",(f=t!=null?t.interactionType:t)!=null?f.ShortAnswer:f,{name:"ifIs",hash:{},fn:n.program(7,u,0),inverse:n.noop,data:u}))!=null?f:"")+"    "+((f=(i.ifIs||t&&t.ifIs||s).call(o,t!=null?t.type:t,"==",(f=t!=null?t.interactionType:t)!=null?f.MultipleChoice:f,{name:"ifIs",hash:{},fn:n.program(9,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n"+((f=(i.ifIs||t&&t.ifIs||s).call(o,t!=null?t.type:t,"==",(f=t!=null?t.interactionType:t)!=null?f.Image:f,{name:"ifIs",hash:{},fn:n.program(11,u,0),inverse:n.noop,data:u}))!=null?f:"")+"<\/div>\r\n"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.InteractivePrintableWorksheet=Handlebars.template({"1":function(){return'        <div class="loader-container">\r\n            <span>Generating your worksheet<\/span>\r\n            <img class="loader" src="http://cvcdn.blob.core.windows.net/cv-online/images/misc/cv-loader-orange.gif"><\/img>\r\n        <\/div>\r\n'},"3":function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{};return'        <div class="print-button-row">\r\n            <button class="print-button btn grey" onclick="window.print()">\r\n                <svg class="print-icon">\r\n                    <use xlink:href="#print"><\/use>\r\n                <\/svg>\r\n                <span class="print-button-text">Print Worksheet<\/span>\r\n            <\/button>\r\n        <\/div>\r\n        <div class="row printable-worksheet-student">\r\n            <div class="col-sm-6">Name ______________________________<\/div>\r\n            <div class="col-sm-6">Date ______________________________<\/div>\r\n        <\/div>\r\n        <div class="printable-worksheet-title"><strong>Question Sheet:<\/strong> '+n.escapeExpression((f=(f=i.name||(t!=null?t.name:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(o,{name:"name",hash:{},data:u}):f))+'<\/div>\r\n        <div class="printable-interactions-viewpart"><\/div>\r\n        <div id="printable-worksheet-footer">\r\n            <img class="printable-worksheet-logo" src="http://static.clickview.com.au/cv-online/images/clickview-logo.png" />\r\n'+((e=i["if"].call(o,t!=null?t.showCopyright:t,{name:"if",hash:{},fn:n.program(4,u,0),inverse:n.noop,data:u}))!=null?e:"")+"        <\/div>\r\n"},"4":function(n,t,i,r,u){var f;return'            <span class="printable-worksheet-copyright">© Copyright ClickView Pty Limited '+n.escapeExpression((f=(f=i.year||(t!=null?t.year:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"year",hash:{},data:u}):f))+"<\/span>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<head>\r\n    <link rel="stylesheet" type="text/css" href="//static.clickview.com.au/cv-online/styles/bootstrap.min.css">\r\n    <link rel="stylesheet" type="text/css" href="//static.clickview.com.au/cv-online/styles/shared.min.css">\r\n    <link rel="stylesheet" type="text/css" href="//static.clickview.com.au/cv-online/styles/worksheet.min.css">\r\n<\/head>\r\n<body>\r\n    <div class="printable-worksheet">\r\n'+((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.showLoader:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(3,u,0),data:u}))!=null?f:"")+'    <\/div>\r\n    <div style="display: none">\r\n        <svg xmlns="http://www.w3.org/2000/svg">\r\n            <symbol id="print" viewBox="0 0 24 24">\r\n                <path fill-rule="evenodd" d="M6.5 20h11v-6h-11v6zm0-12h11V5h-11v3zm12.505 0C20.107 8 21 8.887 21 9.998v5.005a.995.995 0 0 1-.993.997H18.5v5h-13v-5H3.993A1 \r\n                      1 0 0 1 3 15.003V9.998C3 8.895 3.893 8 4.995 8H5.5V4h13v4h.505zM8.5 18.5h7a.5.5 0 0 0 0-1h-7a.5.5 0 0 0 0 1zm0-2h7a.5.5 0 0 0 0-1h-7a.5.5 0 0 0 0 1z" />\r\n            <\/symbol>\r\n        <\/svg>\r\n    <\/div>\r\n<\/body>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.InteractiveQuestionPartials=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="partial-loading-questions">\r\n    <div class="partial-loading-item icon"><\/div>\r\n    <div class="partial-loading-item detail"><\/div>\r\n<\/div>\r\n<div class="partial-loading-questions">\r\n    <div class="partial-loading-item icon"><\/div>\r\n    <div class="partial-loading-item detail"><\/div>\r\n<\/div>\r\n<div class="partial-loading-questions">\r\n    <div class="partial-loading-item icon"><\/div>\r\n    <div class="partial-loading-item detail"><\/div>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.InteractiveResourceItemView=Handlebars.template({"1":function(){return'<div class="tile-item-inner">\r\n'},"3":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.actionUrl:t,{name:"if",hash:{},fn:n.program(4,u,0),inverse:n.noop,data:u}))!=null?f:""},"4":function(n,t,i,r,u){var f;return' href="'+n.escapeExpression((f=(f=i.actionUrl||(t!=null?t.actionUrl:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"actionUrl",hash:{},data:u}):f))+'" '},"6":function(){return'            <div class="play-btn-mask"><\/div>\r\n            <div class="play-icon-video">\r\n                <svg class="play-icon">\r\n                    <use xlink:href="#play"><\/use>\r\n                <\/svg>\r\n            <\/div>\r\n'},"8":function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{};return" "+((e=i["if"].call(o,t!=null?t.lazyload:t,{name:"if",hash:{},fn:n.program(9,u,0),inverse:n.program(11,u,0),data:u}))!=null?e:"")+'="'+n.escapeExpression((f=(f=i.thumbUrl||(t!=null?t.thumbUrl:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(o,{name:"thumbUrl",hash:{},data:u}):f))+'" '},"9":function(){return" data-original"},"11":function(){return"src"},"13":function(n,t,i,r,u){var f;return"                    "+((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.actionUrl:t,{name:"if",hash:{},fn:n.program(14,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n"},"14":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<a href="'+h((f=(f=i.actionUrl||(t!=null?t.actionUrl:t))!=null?f:o,typeof f===s?f.call(e,{name:"actionUrl",hash:{},data:u}):f))+'">'+h((f=(f=i.name||(t!=null?t.name:t))!=null?f:o,typeof f===s?f.call(e,{name:"name",hash:{},data:u}):f))+"<\/a>"},"16":function(n,t,i,r,u){var f;return"                    "+n.escapeExpression((f=(f=i.name||(t!=null?t.name:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"name",hash:{},data:u}):f))+"\r\n"},"18":function(){return"<\/div>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e,o=t!=null?t:n.nullContext||{},s=i.helperMissing,h="function",c=n.escapeExpression;return((f=i["if"].call(o,(f=t!=null?t.options:t)!=null?f.isotope:f,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+'    <div class="cv-thumbnail">\r\n        <div class="item-number-viewpart"><\/div>\r\n        <a '+((f=i["if"].call(o,t!=null?t.isOwner:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:"")+">\r\n"+((f=i["if"].call(o,t!=null?t.actionUrl:t,{name:"if",hash:{},fn:n.program(6,u,0),inverse:n.noop,data:u}))!=null?f:"")+'            <img alt="" title="'+c((e=(e=i.name||(t!=null?t.name:t))!=null?e:s,typeof e===h?e.call(o,{name:"name",hash:{},data:u}):e))+'" '+((f=i["if"].call(o,t!=null?t.thumbUrl:t,{name:"if",hash:{},fn:n.program(8,u,0),inverse:n.noop,data:u}))!=null?f:"")+' />\r\n        <\/a>\r\n    <\/div>\r\n    <div class="info cv-video-content">\r\n        <div class="video-actions-container"><\/div>\r\n        <div class="cv-header">\r\n            <h3 class="cv-title" title="'+c((e=(e=i.name||(t!=null?t.name:t))!=null?e:s,typeof e===h?e.call(o,{name:"name",hash:{},data:u}):e))+'">\r\n'+((f=i["if"].call(o,t!=null?t.isOwner:t,{name:"if",hash:{},fn:n.program(13,u,0),inverse:n.program(16,u,0),data:u}))!=null?f:"")+'            <\/h3>\r\n        <\/div>\r\n        <div class="contributor-viewpart"><\/div>\r\n        <div class="cv-description-wrapper interactive-resource">\r\n            <p class="cv-description">'+((f=(i.linkify||t&&t.linkify||s).call(o,t!=null?t.description:t,{name:"linkify",hash:{},data:u}))!=null?f:"")+"<\/p>\r\n        <\/div>\r\n    <\/div>\r\n"+((f=i["if"].call(o,(f=t!=null?t.options:t)!=null?f.isotope:f,{name:"if",hash:{},fn:n.program(18,u,0),inverse:n.noop,data:u}))!=null?f:"")},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.InteractiveShareStep1=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<h3>Create a name for your interactive video<\/h3>\r\n<div class="new-mapping-viewpart"><\/div>\r\n<div class="mapping-list-viewpart"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.InteractiveSummaryList=Handlebars.template({"1":function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{};return'<div class="preview-interactive '+((e=i["if"].call(o,t!=null?t.show:t,{name:"if",hash:{},fn:n.program(2,u,0),inverse:n.noop,data:u}))!=null?e:"")+'"><p>'+n.escapeExpression((f=(f=i.dropdownText||(t!=null?t.dropdownText:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(o,{name:"dropdownText",hash:{},data:u}):f))+'<span class="preview-video-icon">+<\/span><\/p><\/div>'},"2":function(){return"open"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{};return((e=i.unless.call(o,t!=null?t.renderInPopup:t,{name:"unless",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?e:"")+'\r\n<p class="description">'+n.escapeExpression((f=(f=i.description||(t!=null?t.description:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(o,{name:"description",hash:{},data:u}):f))+'<\/p>\r\n<div class="interactions"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.InteractiveUnavailable=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="col-xs-12">\r\n    <div class="unavailable">\r\n        <h1>This interactive video is no longer available<\/h1>\r\n        <p class="no-margin-bottom">Over the past few months, we have been working hard to revamp ClickView’s interactive videos.<\/p>\r\n        <p class="no-margin-top">As a result, this link is no longer available.<\/p>\r\n        <p>If you have any questions, don’t hesitate to contact ClickView’s friendly support via <a href="mailto:support@clickview.com.au">support.clickview.com.au<\/a><\/p>\r\n        <img src="/Assets/images/error/shut-down-page-albert.png" class="img-responsive" alt="This page is unavailable"><\/img>\r\n    <\/div>\r\n<\/div>\r\n\r\n\r\n\r\n'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.LayoutItem=Handlebars.template({"1":function(){return"selected"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var c,f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<div alt="'+h((f=(f=i.text||(t!=null?t.text:t))!=null?f:o,typeof f===s?f.call(e,{name:"text",hash:{},data:u}):f))+'" class="'+h((f=(f=i.className||(t!=null?t.className:t))!=null?f:o,typeof f===s?f.call(e,{name:"className",hash:{},data:u}):f))+" "+((c=i["if"].call(e,t!=null?t.selected:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?c:"")+'">\r\n    <svg class="icon"> <use xlink:href="#'+h((f=(f=i.type||(t!=null?t.type:t))!=null?f:o,typeof f===s?f.call(e,{name:"type",hash:{},data:u}):f))+'"><\/use> <\/svg>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.LeftNavList=Handlebars.template({"1":function(){return"selected"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e,h=t!=null?t:n.nullContext||{},c=i.helperMissing,l="function",o=n.escapeExpression,s=n.lambda;return'<div class="toggle-nav"><\/div>\r\n<ul class="category">\r\n  <li class="'+o((e=(e=i.rootClassName||(t!=null?t.rootClassName:t))!=null?e:c,typeof e===l?e.call(h,{name:"rootClassName",hash:{},data:u}):e))+' current">\r\n    <a class="current parent">\r\n      <span><\/span>\r\n      '+o((e=(e=i.rootName||(t!=null?t.rootName:t))!=null?e:c,typeof e===l?e.call(h,{name:"rootName",hash:{},data:u}):e))+'\r\n    <\/a>\r\n    <ul class="category" style="display: block">\r\n      <li class="'+o(s((f=(f=t!=null?t.menuList:t)!=null?f.workspace:f)!=null?f.className:f,t))+' fixed sup-navigator">\r\n        <a href="'+o(s((f=(f=t!=null?t.menuList:t)!=null?f.workspace:f)!=null?f.nav:f,t))+'" class="'+((f=i["if"].call(h,(f=(f=t!=null?t.menuList:t)!=null?f.workspace:f)!=null?f.current:f,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+'">\r\n          <span><\/span>\r\n          <p class="nav-text">'+o(s((f=(f=t!=null?t.menuList:t)!=null?f.workspace:f)!=null?f.name:f,t))+'<\/p>\r\n          <div id="workspace-count" class="nav-text-container"><\/div>\r\n        <\/a>\r\n      <\/li>\r\n      <li class="'+o(s((f=(f=t!=null?t.menuList:t)!=null?f.livestream:f)!=null?f.className:f,t))+' fixed sup-navigator">\r\n        <a href="'+o(s((f=(f=t!=null?t.menuList:t)!=null?f.livestream:f)!=null?f.nav:f,t))+'" class="'+((f=i["if"].call(h,(f=(f=t!=null?t.menuList:t)!=null?f.livestream:f)!=null?f.current:f,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+'">\r\n          <span><\/span>\r\n          <p class="nav-text">'+o(s((f=(f=t!=null?t.menuList:t)!=null?f.livestream:f)!=null?f.name:f,t))+'<\/p>\r\n          <div id="livestream-count" class="nav-text-container"><\/div>\r\n        <\/a>\r\n      <\/li>\r\n    <\/ul>\r\n  <\/li>\r\n<\/ul>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.LegacyAboutTab=Handlebars.template({"1":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},(f=(f=t!=null?t.video:t)!=null?f.rating:f)!=null?f.code:f,{name:"if",hash:{},fn:n.program(2,u,0),inverse:n.noop,data:u}))!=null?f:""},"2":function(n,t){var i;return'<div class="form-row">\r\n    <label class="inline">Rating:<\/label>\r\n    <p class="about-value inline">'+n.escapeExpression(n.lambda((i=(i=t!=null?t.video:t)!=null?i.rating:i)!=null?i.code:i,t))+"<\/p>\r\n<\/div>\r\n"},"4":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},(f=(f=t!=null?t.video:t)!=null?f.channel:f)!=null?f.name:f,{name:"if",hash:{},fn:n.program(5,u,0),inverse:n.noop,data:u}))!=null?f:""},"5":function(n,t){var i;return'<div class="form-row">\r\n    <label class="inline">Channel:<\/label>\r\n    <p class="about-value inline">'+n.escapeExpression(n.lambda((i=(i=t!=null?t.video:t)!=null?i.channel:i)!=null?i.name:i,t))+"<\/p>\r\n<\/div>\r\n"},"7":function(n,t){var i;return'<div class="form-row">\r\n    <label class="inline">Production Year: <\/label>\r\n    <p class="about-value inline">'+n.escapeExpression(n.lambda((i=t!=null?t.video:t)!=null?i.year:i,t))+"<\/p>\r\n<\/div>\r\n"},"9":function(n,t,i,r,u){var f;return'<div class="form-row">\r\n    <label class="inline">Duration:<\/label>\r\n    <p class="about-value inline">'+n.escapeExpression((i.duration||t&&t.duration||i.helperMissing).call(t!=null?t:n.nullContext||{},(f=t!=null?t.video:t)!=null?f.duration:f,{name:"duration",hash:{},data:u}))+"<\/p>\r\n<\/div>\r\n"},"11":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},(f=t!=null?t.video:t)!=null?f.dateBroadcast:f,{name:"if",hash:{},fn:n.program(12,u,0),inverse:n.noop,data:u}))!=null?f:""},"12":function(n,t){var i;return'<label class="inline">Date Broadcast:<\/label>\r\n<p class="about-value inline">'+n.escapeExpression(n.lambda((i=t!=null?t.video:t)!=null?i.dateBroadcast:i,t))+"<\/p>\r\n"},"14":function(n,t,i,r,u){var f;return'<div class="form-row block">\r\n    <label>Description: <\/label>\r\n    <div class="description-viewpart">\r\n        <p class="description">'+((f=(i.linkify||t&&t.linkify||i.helperMissing).call(t!=null?t:n.nullContext||{},(f=t!=null?t.video:t)!=null?f.description:f,{name:"linkify",hash:{},data:u}))!=null?f:"")+"<\/p>\r\n    <\/div>\r\n<\/div>\r\n"},"16":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},(f=(f=t!=null?t.video:t)!=null?f.ownerComment:f)!=null?f.text:f,{name:"if",hash:{},fn:n.program(17,u,0),inverse:n.noop,data:u}))!=null?f:""},"17":function(n,t){var i;return'<div class="form-row block">\r\n    <label>Comments: <\/label>\r\n    <p class="description">'+n.escapeExpression(n.lambda((i=(i=t!=null?t.video:t)!=null?i.ownerComment:i)!=null?i.text:i,t))+"<\/p>\r\n<\/div>\r\n"},"19":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return'<div class="download-viewpart">\r\n'+((f=i["if"].call(e,t!=null?t.showMp4Download:t,{name:"if",hash:{},fn:n.program(20,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,t!=null?t.showClkDownload:t,{name:"if",hash:{},fn:n.program(22,u,0),inverse:n.noop,data:u}))!=null?f:"")+"<\/div>\r\n"},"20":function(n,t){var i;return'    <div>\r\n        <a title="Download '+n.escapeExpression(n.lambda((i=t!=null?t.video:t)!=null?i.title:i,t))+' as MP4" class="download-link download-mp4">\r\n            <span class="icon"><\/span>Download (MP4)\r\n        <\/a>\r\n    <\/div>\r\n'},"22":function(n,t){var i;return'    <div>\r\n        <a title="Download '+n.escapeExpression(n.lambda((i=t!=null?t.video:t)!=null?i.title:i,t))+' as CLK" class="download-link download-clk">\r\n            <span class="icon"><\/span>Download (CLK)\r\n        <\/a>\r\n    <\/div>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return((f=i["if"].call(e,(f=t!=null?t.video:t)!=null?f.rating:f,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,(f=t!=null?t.video:t)!=null?f.channel:f,{name:"if",hash:{},fn:n.program(4,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,(f=t!=null?t.video:t)!=null?f.year:f,{name:"if",hash:{},fn:n.program(7,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,(f=t!=null?t.video:t)!=null?f.duration:f,{name:"if",hash:{},fn:n.program(9,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,t!=null?t.showDateBroadcast:t,{name:"if",hash:{},fn:n.program(11,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,(f=t!=null?t.video:t)!=null?f.description:f,{name:"if",hash:{},fn:n.program(14,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,t!=null?t.ownerComment:t,{name:"if",hash:{},fn:n.program(16,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,(f=t!=null?t.options:t)!=null?f.showDownloadLinks:f,{name:"if",hash:{},fn:n.program(19,u,0),inverse:n.noop,data:u}))!=null?f:"")+'<div class="content-licence-viewpart"><\/div>\r\n<div class="albert-tag-viewpart"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.LiveStreamTopbarView=Handlebars.template({"1":function(n,t,i,r,u){var f;return'<a href="/livestream"><div class="recording-icon-outer"><div class="recording-icon-inner"><\/div><\/div><span class="topbar-live-stream-status">'+n.escapeExpression((f=(f=i.message||(t!=null?t.message:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"message",hash:{},data:u}):f))+"<\/span><\/a>"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.liveCount:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:""},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.LoaderBarView=Handlebars.template({"1":function(){return'<div class="loader-box">'},"3":function(n,t,i,r,u){var f;return'<p class="loading-text">'+n.escapeExpression((f=(f=i.loadingText||(t!=null?t.loadingText:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"loadingText",hash:{},data:u}):f))+"<\/p>"},"5":function(){return"<\/div>"},"7":function(){return'<div class="loading-mask"><\/div>'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return((f=i.unless.call(e,t!=null?t.boxless:t,{name:"unless",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n  "+((f=i["if"].call(e,t!=null?t.loadingText:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:"")+'\r\n  <div class="progress-bar">\r\n    <div class="bar"><\/div>\r\n  <\/div>\r\n'+((f=i.unless.call(e,t!=null?t.boxless:t,{name:"unless",hash:{},fn:n.program(5,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n "+((f=i["if"].call(e,t!=null?t.mask:t,{name:"if",hash:{},fn:n.program(7,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.LoaderView=Handlebars.template({"1":function(n,t,i,r,u){var f;return'<p class="loading-text">'+n.escapeExpression((f=(f=i.loadingText||(t!=null?t.loadingText:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"loadingText",hash:{},data:u}):f))+"<\/p>"},"3":function(){return'<div class="loading-mask"><\/div>'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{};return'<div class="image"><img class="medium-loader" src="'+n.escapeExpression((f=(f=i.imageUrl||(t!=null?t.imageUrl:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(o,{name:"imageUrl",hash:{},data:u}):f))+'"><\/div>\r\n'+((e=i["if"].call(o,t!=null?t.loadingText:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?e:"")+"\r\n"+((e=i["if"].call(o,t!=null?t.mask:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?e:"")},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.MasterVideoList=Handlebars.template({"1":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.tileMode:t,{name:"if",hash:{},fn:n.program(2,u,0),inverse:n.program(4,u,0),data:u}))!=null?f:""},"2":function(){return'    <div class="isotope-tile-item">\r\n        <div class="tile-item-inner">\r\n            <div class="cv-thumbnail"><a><\/a><\/div>\r\n            <div class="cv-video-content">\r\n                <div class="partial-loading-item title"><\/div>\r\n                <div class="partial-loading-item thin"><\/div>\r\n                <div class="partial-loading-item thin"><\/div>\r\n                <div class="partial-loading-item thin"><\/div>\r\n                <div class="partial-loading-item thin-right"><\/div>\r\n            <\/div>\r\n        <\/div>\r\n    <\/div><div class="isotope-tile-item">\r\n        <div class="tile-item-inner">\r\n            <div class="cv-thumbnail"><a><\/a><\/div>\r\n            <div class="cv-video-content">\r\n                <div class="partial-loading-item title"><\/div>\r\n                <div class="partial-loading-item thin"><\/div>\r\n                <div class="partial-loading-item thin"><\/div>\r\n                <div class="partial-loading-item thin"><\/div>\r\n                <div class="partial-loading-item thin"><\/div>\r\n                <div class="partial-loading-item thin"><\/div>\r\n                <div class="partial-loading-item thin-right"><\/div>\r\n            <\/div>\r\n        <\/div>\r\n    <\/div><div class="isotope-tile-item">\r\n        <div class="tile-item-inner">\r\n            <div class="cv-thumbnail"><a><\/a><\/div>\r\n            <div class="cv-video-content">\r\n                <div class="partial-loading-item title"><\/div>\r\n                <div class="partial-loading-item thin"><\/div>\r\n                <div class="partial-loading-item thin"><\/div>\r\n                <div class="partial-loading-item thin-right"><\/div>\r\n            <\/div>\r\n        <\/div>\r\n    <\/div><div class="isotope-tile-item">\r\n        <div class="tile-item-inner">\r\n            <div class="cv-thumbnail"><a><\/a><\/div>\r\n            <div class="cv-video-content">\r\n                <div class="partial-loading-item title"><\/div>\r\n                <div class="partial-loading-item thin"><\/div>\r\n                <div class="partial-loading-item thin"><\/div>\r\n                <div class="partial-loading-item thin"><\/div>\r\n                <div class="partial-loading-item thin"><\/div>\r\n                <div class="partial-loading-item thin"><\/div>\r\n                <div class="partial-loading-item thin"><\/div>\r\n                <div class="partial-loading-item thin-right"><\/div>\r\n            <\/div>\r\n        <\/div>\r\n    <\/div><div class="isotope-tile-item">\r\n        <div class="tile-item-inner">\r\n            <div class="cv-thumbnail"><a><\/a><\/div>\r\n            <div class="cv-video-content">\r\n                <div class="partial-loading-item title"><\/div>\r\n                <div class="partial-loading-item thin"><\/div>\r\n                <div class="partial-loading-item thin"><\/div>\r\n                <div class="partial-loading-item thin"><\/div>\r\n                <div class="partial-loading-item thin"><\/div>\r\n                <div class="partial-loading-item thin"><\/div>\r\n                <div class="partial-loading-item thin-right"><\/div>\r\n            <\/div>\r\n        <\/div>\r\n    <\/div><div class="isotope-tile-item">\r\n        <div class="tile-item-inner">\r\n            <div class="cv-thumbnail"><a><\/a><\/div>\r\n            <div class="cv-video-content">\r\n                <div class="partial-loading-item title"><\/div>\r\n                <div class="partial-loading-item thin"><\/div>\r\n                <div class="partial-loading-item thin"><\/div>\r\n                <div class="partial-loading-item thin"><\/div>\r\n                <div class="partial-loading-item thin"><\/div>\r\n                <div class="partial-loading-item thin"><\/div>\r\n                <div class="partial-loading-item thin"><\/div>\r\n                <div class="partial-loading-item thin-right"><\/div>\r\n            <\/div>\r\n        <\/div>\r\n    <\/div><div class="isotope-tile-item">\r\n        <div class="tile-item-inner">\r\n            <div class="cv-thumbnail"><a><\/a><\/div>\r\n            <div class="cv-video-content">\r\n                <div class="partial-loading-item title"><\/div>\r\n                <div class="partial-loading-item thin"><\/div>\r\n                <div class="partial-loading-item thin"><\/div>\r\n                <div class="partial-loading-item thin"><\/div>\r\n                <div class="partial-loading-item thin-right"><\/div>\r\n            <\/div>\r\n        <\/div>\r\n    <\/div><div class="isotope-tile-item">\r\n        <div class="tile-item-inner">\r\n            <div class="cv-thumbnail"><a><\/a><\/div>\r\n            <div class="cv-video-content">\r\n                <div class="partial-loading-item title"><\/div>\r\n                <div class="partial-loading-item thin"><\/div>\r\n                <div class="partial-loading-item thin"><\/div>\r\n                <div class="partial-loading-item thin-right"><\/div>\r\n            <\/div>\r\n        <\/div>\r\n    <\/div>\r\n'},"4":function(n,t,i,r,u){var f;return'    <div class="video-list-view '+((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.isLibraryVideo:t,{name:"if",hash:{},fn:n.program(5,u,0),inverse:n.noop,data:u}))!=null?f:"")+'">\r\n        <div class="cv-video">\r\n            <div class="partial-loading-item cv-thumbnail"><a><\/a><\/div>\r\n            <div class="cv-video-content">\r\n                <div class="partial-loading-item info video-title"><\/div>\r\n                <div class="partial-loading-item info"><\/div>\r\n                <div class="partial-loading-item info"><\/div>\r\n            <\/div>\r\n        <\/div>\r\n        <div class="cv-video">\r\n            <div class="partial-loading-item cv-thumbnail"><a><\/a><\/div>\r\n            <div class="cv-video-content">\r\n                <div class="partial-loading-item info video-title"><\/div>\r\n                <div class="partial-loading-item info"><\/div>\r\n                <div class="partial-loading-item info"><\/div>\r\n            <\/div>\r\n        <\/div>\r\n        <div class="cv-video">\r\n            <div class="partial-loading-item cv-thumbnail"><a><\/a><\/div>\r\n            <div class="cv-video-content">\r\n                <div class="partial-loading-item info video-title"><\/div>\r\n                <div class="partial-loading-item info"><\/div>\r\n                <div class="partial-loading-item info"><\/div>\r\n            <\/div>\r\n        <\/div>\r\n        <div class="cv-video">\r\n            <div class="partial-loading-item cv-thumbnail"><a><\/a><\/div>\r\n            <div class="cv-video-content">\r\n                <div class="partial-loading-item info video-title"><\/div>\r\n                <div class="partial-loading-item info"><\/div>\r\n                <div class="partial-loading-item info"><\/div>\r\n            <\/div>\r\n        <\/div>\r\n        <div class="cv-video">\r\n            <div class="partial-loading-item cv-thumbnail"><a><\/a><\/div>\r\n            <div class="cv-video-content">\r\n                <div class="partial-loading-item info video-title"><\/div>\r\n                <div class="partial-loading-item info"><\/div>\r\n                <div class="partial-loading-item info"><\/div>\r\n            <\/div>\r\n        <\/div>\r\n        <div class="cv-video">\r\n            <div class="partial-loading-item cv-thumbnail"><a><\/a><\/div>\r\n            <div class="cv-video-content">\r\n                <div class="partial-loading-item info video-title"><\/div>\r\n                <div class="partial-loading-item info"><\/div>\r\n                <div class="partial-loading-item info"><\/div>\r\n            <\/div>\r\n        <\/div>\r\n        <div class="cv-video">\r\n            <div class="partial-loading-item cv-thumbnail"><a><\/a><\/div>\r\n            <div class="cv-video-content">\r\n                <div class="partial-loading-item info video-title"><\/div>\r\n                <div class="partial-loading-item info"><\/div>\r\n                <div class="partial-loading-item info"><\/div>\r\n            <\/div>\r\n        <\/div>\r\n    <\/div>\r\n'},"5":function(){return" library-video "},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.showPartialLoader:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:""},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.MediaCollection=Handlebars.template({"1":function(){return'<div class="banner-viewpart">\r\n    <div class="banner">\r\n        <div class="partial-loading-item thick"><\/div>\r\n        <div class="partial-loading-item thin"><\/div>\r\n    <\/div>\r\n<\/div>\r\n'},"3":function(){return" tile-mode "},"5":function(){return'    <div class="sub-categories-viewpart"><\/div>\r\n'},"7":function(n,t,i,r,u){var f;return((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.showHeader:t,{name:"if",hash:{},fn:n.program(8,u,0),inverse:n.noop,data:u}))!=null?f:"")+'    <div class="pinned-videos-viewpart"><\/div>\r\n    <div class="cloud-videos-viewpart"><\/div>\r\n'},"8":function(){return'    <div class="sorting-container"><div class="partial-loading-item title"><\/div><\/div>\r\n'},"10":function(){return'        <div class="tile-list-view partial-loading-view">\r\n            <div class="isotope-tile-item">\r\n                <div class="tile-item-inner">\r\n                    <div class="cv-thumbnail"><a><\/a><\/div>\r\n                    <div class="cv-video-content">\r\n                        <div class="partial-loading-item title"><\/div>\r\n                        <div class="partial-loading-item thin"><\/div>\r\n                        <div class="partial-loading-item thin"><\/div>\r\n                        <div class="partial-loading-item thin"><\/div>\r\n                        <div class="partial-loading-item thin-right"><\/div>\r\n                    <\/div>\r\n                <\/div>\r\n            <\/div><div class="isotope-tile-item">\r\n                <div class="tile-item-inner">\r\n                    <div class="cv-thumbnail"><a><\/a><\/div>\r\n                    <div class="cv-video-content">\r\n                        <div class="partial-loading-item title"><\/div>\r\n                        <div class="partial-loading-item thin"><\/div>\r\n                        <div class="partial-loading-item thin"><\/div>\r\n                        <div class="partial-loading-item thin"><\/div>\r\n                        <div class="partial-loading-item thin"><\/div>\r\n                        <div class="partial-loading-item thin"><\/div>\r\n                        <div class="partial-loading-item thin-right"><\/div>\r\n                    <\/div>\r\n                <\/div>\r\n            <\/div><div class="isotope-tile-item">\r\n                <div class="tile-item-inner">\r\n                    <div class="cv-thumbnail"><a><\/a><\/div>\r\n                    <div class="cv-video-content">\r\n                        <div class="partial-loading-item title"><\/div>\r\n                        <div class="partial-loading-item thin"><\/div>\r\n                        <div class="partial-loading-item thin"><\/div>\r\n                        <div class="partial-loading-item thin-right"><\/div>\r\n                    <\/div>\r\n                <\/div>\r\n            <\/div><div class="isotope-tile-item">\r\n                <div class="tile-item-inner">\r\n                    <div class="cv-thumbnail"><a><\/a><\/div>\r\n                    <div class="cv-video-content">\r\n                        <div class="partial-loading-item title"><\/div>\r\n                        <div class="partial-loading-item thin"><\/div>\r\n                        <div class="partial-loading-item thin"><\/div>\r\n                        <div class="partial-loading-item thin"><\/div>\r\n                        <div class="partial-loading-item thin"><\/div>\r\n                        <div class="partial-loading-item thin"><\/div>\r\n                        <div class="partial-loading-item thin"><\/div>\r\n                        <div class="partial-loading-item thin-right"><\/div>\r\n                    <\/div>\r\n                <\/div>\r\n            <\/div><div class="isotope-tile-item">\r\n                <div class="tile-item-inner">\r\n                    <div class="cv-thumbnail"><a><\/a><\/div>\r\n                    <div class="cv-video-content">\r\n                        <div class="partial-loading-item title"><\/div>\r\n                        <div class="partial-loading-item thin"><\/div>\r\n                        <div class="partial-loading-item thin"><\/div>\r\n                        <div class="partial-loading-item thin"><\/div>\r\n                        <div class="partial-loading-item thin"><\/div>\r\n                        <div class="partial-loading-item thin"><\/div>\r\n                        <div class="partial-loading-item thin-right"><\/div>\r\n                    <\/div>\r\n                <\/div>\r\n            <\/div><div class="isotope-tile-item">\r\n                <div class="tile-item-inner">\r\n                    <div class="cv-thumbnail"><a><\/a><\/div>\r\n                    <div class="cv-video-content">\r\n                        <div class="partial-loading-item title"><\/div>\r\n                        <div class="partial-loading-item thin"><\/div>\r\n                        <div class="partial-loading-item thin"><\/div>\r\n                        <div class="partial-loading-item thin"><\/div>\r\n                        <div class="partial-loading-item thin"><\/div>\r\n                        <div class="partial-loading-item thin"><\/div>\r\n                        <div class="partial-loading-item thin"><\/div>\r\n                        <div class="partial-loading-item thin-right"><\/div>\r\n                    <\/div>\r\n                <\/div>\r\n            <\/div><div class="isotope-tile-item">\r\n                <div class="tile-item-inner">\r\n                    <div class="cv-thumbnail"><a><\/a><\/div>\r\n                    <div class="cv-video-content">\r\n                        <div class="partial-loading-item title"><\/div>\r\n                        <div class="partial-loading-item thin"><\/div>\r\n                        <div class="partial-loading-item thin"><\/div>\r\n                        <div class="partial-loading-item thin"><\/div>\r\n                        <div class="partial-loading-item thin-right"><\/div>\r\n                    <\/div>\r\n                <\/div>\r\n            <\/div><div class="isotope-tile-item">\r\n                <div class="tile-item-inner">\r\n                    <div class="cv-thumbnail"><a><\/a><\/div>\r\n                    <div class="cv-video-content">\r\n                        <div class="partial-loading-item title"><\/div>\r\n                        <div class="partial-loading-item thin"><\/div>\r\n                        <div class="partial-loading-item thin"><\/div>\r\n                        <div class="partial-loading-item thin-right"><\/div>\r\n                    <\/div>\r\n                <\/div>\r\n            <\/div>\r\n        <\/div>\r\n'},"12":function(n,t,i,r,u){var f;return'        <div class="tile-list-view video-tile-rows partial-loading-view">\r\n            <div class="video-list-view '+((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.isLibraryVideo:t,{name:"if",hash:{},fn:n.program(13,u,0),inverse:n.noop,data:u}))!=null?f:"")+'">\r\n                <div class="cv-video">\r\n                    <div class="partial-loading-item cv-thumbnail"><a><\/a><\/div>\r\n                    <div class="cv-video-content">\r\n                        <div class="partial-loading-item info video-title"><\/div>\r\n                        <div class="partial-loading-item info"><\/div>\r\n                        <div class="partial-loading-item info"><\/div>\r\n                    <\/div>\r\n                <\/div>\r\n                <div class="cv-video">\r\n                    <div class="partial-loading-item cv-thumbnail"><a><\/a><\/div>\r\n                    <div class="cv-video-content">\r\n                        <div class="partial-loading-item info video-title"><\/div>\r\n                        <div class="partial-loading-item info"><\/div>\r\n                        <div class="partial-loading-item info"><\/div>\r\n                    <\/div>\r\n                <\/div>\r\n                <div class="cv-video">\r\n                    <div class="partial-loading-item cv-thumbnail"><a><\/a><\/div>\r\n                    <div class="cv-video-content">\r\n                        <div class="partial-loading-item info video-title"><\/div>\r\n                        <div class="partial-loading-item info"><\/div>\r\n                        <div class="partial-loading-item info"><\/div>\r\n                    <\/div>\r\n                <\/div>\r\n                <div class="cv-video">\r\n                    <div class="partial-loading-item cv-thumbnail"><a><\/a><\/div>\r\n                    <div class="cv-video-content">\r\n                        <div class="partial-loading-item info video-title"><\/div>\r\n                        <div class="partial-loading-item info"><\/div>\r\n                        <div class="partial-loading-item info"><\/div>\r\n                    <\/div>\r\n                <\/div>\r\n                <div class="cv-video">\r\n                    <div class="partial-loading-item cv-thumbnail"><a><\/a><\/div>\r\n                    <div class="cv-video-content">\r\n                        <div class="partial-loading-item info video-title"><\/div>\r\n                        <div class="partial-loading-item info"><\/div>\r\n                        <div class="partial-loading-item info"><\/div>\r\n                    <\/div>\r\n                <\/div>\r\n                <div class="cv-video">\r\n                    <div class="partial-loading-item cv-thumbnail"><a><\/a><\/div>\r\n                    <div class="cv-video-content">\r\n                        <div class="partial-loading-item info video-title"><\/div>\r\n                        <div class="partial-loading-item info"><\/div>\r\n                        <div class="partial-loading-item info"><\/div>\r\n                    <\/div>\r\n                <\/div>\r\n                <div class="cv-video">\r\n                    <div class="partial-loading-item cv-thumbnail"><a><\/a><\/div>\r\n                    <div class="cv-video-content">\r\n                        <div class="partial-loading-item info video-title"><\/div>\r\n                        <div class="partial-loading-item info"><\/div>\r\n                        <div class="partial-loading-item info"><\/div>\r\n                    <\/div>\r\n                <\/div>\r\n            <\/div>\r\n        <\/div>\r\n'},"13":function(){return" library-video "},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return((f=i["if"].call(e,t!=null?t.showBanner:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+'<div class="video-block '+((f=i["if"].call(e,t!=null?t.tileMode:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:"")+'">\r\n'+((f=i["if"].call(e,t!=null?t.hasSubCategories:t,{name:"if",hash:{},fn:n.program(5,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i.unless.call(e,t!=null?t.tileMode:t,{name:"unless",hash:{},fn:n.program(7,u,0),inverse:n.noop,data:u}))!=null?f:"")+'    <div class="video-list-viewpart">\r\n'+((f=i["if"].call(e,t!=null?t.tileMode:t,{name:"if",hash:{},fn:n.program(10,u,0),inverse:n.program(12,u,0),data:u}))!=null?f:"")+'    <\/div>\r\n    <div class="pagination-viewpart"><\/div>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.MediaCollectionPaginatorItemView=Handlebars.template({"1":function(n,t,i,r,u){var f;return'href="'+n.escapeExpression((f=(f=i.url||(t!=null?t.url:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"url",hash:{},data:u}):f))+'"'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{};return"<a "+((e=i.unless.call(o,t!=null?t.disabled:t,{name:"unless",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?e:"")+">"+n.escapeExpression((f=(f=i.text||(t!=null?t.text:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(o,{name:"text",hash:{},data:u}):f))+"<\/a>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.Message=Handlebars.template({"1":function(){return'<span class="recipient-comment"> (Students may not send messages to other students)<\/span>'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<div>\r\n    <div class="og-data-view"><\/div>\r\n    <div class="input-group recipients-input-group">\r\n        <label class="control-label">Recipients<span class="required">*<\/span>'+((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.studentToStudentMessage:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+'<\/label>\r\n        <div class="message-recipient-container">\r\n            <div class="message-recipient-list"><\/div>\r\n            <div class="message-recipient"><\/div>\r\n        <\/div>\r\n        <span class="help-block hidden"><\/span>\r\n    <\/div>\r\n    <label>Message<\/label>\r\n    <div class="message-comment"><\/div>\r\n    <div class="message-send"><\/div>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.MessageSent=Handlebars.template({"1":function(){return'<h1>Success<\/h1>\r\n<p>Your message was successfully sent.<\/p>\r\n<p class="close-link">Send another message<\/p>\r\n'},"3":function(){return'<h1>Uh oh<\/h1>\r\n<p>Something went wrong when we were trying to send your message.<\/p>\r\n<p class="close-link">Please try again<\/p>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.success:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(3,u,0),data:u}))!=null?f:""},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.NavigationMenu=Handlebars.template({"1":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,h="function",s=n.escapeExpression;return'<div class="nav-heading" title="'+s((f=(f=i.tooltip||(t!=null?t.tooltip:t))!=null?f:o,typeof f===h?f.call(e,{name:"tooltip",hash:{},data:u}):f))+'"><h1>'+s((f=(f=i.heading||(t!=null?t.heading:t))!=null?f:o,typeof f===h?f.call(e,{name:"heading",hash:{},data:u}):f))+' <span class="video-count">('+s((i.videoPluraliser||t&&t.videoPluraliser||o).call(e,t!=null?t.mediaCount:t,{name:"videoPluraliser",hash:{},data:u}))+")<\/span><\/h1><\/div>"},"3":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<a class="navigation-link" href="'+h((f=(f=i.link||(t!=null?t.link:t))!=null?f:o,typeof f===s?f.call(e,{name:"link",hash:{},data:u}):f))+'">'+h((f=(f=i.name||(t!=null?t.name:t))!=null?f:o,typeof f===s?f.call(e,{name:"name",hash:{},data:u}):f))+"<\/a>"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return((f=i["if"].call(e,t!=null?t.topNode:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n"+((f=i["if"].call(e,t!=null?t.name:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:"")+'\r\n<div class="children"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.NewInteractiveView=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="input-mapping-container">\r\n  <input class="new-mapping-input" type="text" placeholder="E.g. English - Year 7" />\r\n  <button class="save cv-btn primary">Create New<\/button>\r\n<\/div>\r\n<p class="error"><\/p>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.PaginatorItemView=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<a href="'+h((f=(f=i.pageId||(t!=null?t.pageId:t))!=null?f:o,typeof f===s?f.call(e,{name:"pageId",hash:{},data:u}):f))+'">'+h((f=(f=i.text||(t!=null?t.text:t))!=null?f:o,typeof f===s?f.call(e,{name:"text",hash:{},data:u}):f))+"<\/a>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.PartialLoadingLeftNav=Handlebars.template({"1":function(){return'<div class="nav-header"><\/div>'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.showHeader:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+'\r\n<div class="nav-content">\r\n    <div class="partial-loading-item width1"><\/div>\r\n    <div class="partial-loading-item"><\/div>\r\n    <div class="partial-loading-item width2"><\/div>\r\n    <div class="partial-loading-item width3"><\/div>\r\n    <div class="partial-loading-item"><\/div>\r\n    <div class="partial-loading-item width2"><\/div>\r\n    <div class="partial-loading-item width1"><\/div>\r\n    <div class="partial-loading-item width3"><\/div>\r\n    <div class="partial-loading-item width2"><\/div>\r\n    <div class="partial-loading-item"><\/div>\r\n    <div class="partial-loading-item width1"><\/div>\r\n    <div class="partial-loading-item width2"><\/div>\r\n    <div class="partial-loading-item width1"><\/div>\r\n    <div class="partial-loading-item width2"><\/div>\r\n    <div class="partial-loading-item width3"><\/div>\r\n    <div class="partial-loading-item"><\/div>\r\n    <div class="partial-loading-item width1"><\/div>\r\n    <div class="partial-loading-item"><\/div>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.PlaylistTab=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="create-new-playlist">\r\n  <div class="create-new-playlist-container">\r\n    <input id="new-playlist-name" type="text" placeholder="Enter new playlist name" />\r\n    <div class="button-viewpart"><\/div>\r\n   <!-- <button class="new-playlist">Create Playlist<\/button>-->\r\n  <\/div>\r\n<\/div>\r\n<div class="cv-playlists-viewpart"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.PlaylistTabItem=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<div class="playlist-container">\r\n  <div class="playlist-text">\r\n    <span class="playlist-video-count-container">\r\n      <span class="playlist-video-count"><\/span>\r\n    <\/span>\r\n    <span class="playlist-title-container">\r\n      <span class="playlist-title">'+n.escapeExpression((f=(f=i.name||(t!=null?t.name:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"name",hash:{},data:u}):f))+'<\/span>\r\n    <\/span>\r\n  <\/div>\r\n\r\n  <span class="icon"><\/span>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.PlayView=Handlebars.template({"1":function(){return'<div class="play-interaction"><\/div>\r\n<div class="info-box">\r\n'},"3":function(){return'<span class="interactive-badge badge">Interactive<\/span>'},"5":function(n,t,i,r,u){var f;return'                <span class="series h1">'+((f=(i.seriesFilter||t&&t.seriesFilter||i.helperMissing).call(t!=null?t:n.nullContext||{},(f=t!=null?t.sharedBy:t)!=null?f.publicName:f,{name:"seriesFilter",hash:{divider:"Shared By:"},data:u}))!=null?f:"")+"<\/span>\r\n"},"7":function(n,t,i,r,u){var f;return'                <span class="series h1">'+((f=(i.seriesFilter||t&&t.seriesFilter||i.helperMissing).call(t!=null?t:n.nullContext||{},t!=null?t.series:t,{name:"seriesFilter",hash:{divider:"Series:"},data:u}))!=null?f:"")+"<\/span>\r\n"},"9":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s=n.escapeExpression;return'            <a href="'+s((f=(f=i.backUrl||(t!=null?t.backUrl:t))!=null?f:o,typeof f=="function"?f.call(e,{name:"backUrl",hash:{},data:u}):f))+'" class="cv-backlink btn">&larr; Back to '+s((i.limitChars||t&&t.limitChars||o).call(e,t!=null?t.source:t,30,{name:"limitChars",hash:{},data:u}))+"<\/a>\r\n"},"11":function(){return'            <a class="btn save-interactive">Save to my interactive videos<\/a>\r\n'},"13":function(){return'        <div id="interactive-toggle"><\/div>\r\n'},"15":function(){return"<\/div>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e,o=t!=null?t:n.nullContext||{},s=i.helperMissing,h="function",c=n.escapeExpression;return((f=i["if"].call(o,t!=null?t.isInteractive:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+'\r\n  <div class="play-viewpart-main">\r\n  \r\n    <div class="play-header-sm">\r\n        <div class="video-title cf">\r\n            <div class="video-title-viewpart">\r\n                <h1>'+c((e=(e=i.title||(t!=null?t.title:t))!=null?e:s,typeof e===h?e.call(o,{name:"title",hash:{},data:u}):e))+((f=i["if"].call(o,t!=null?t.isInteractive:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:"")+'<\/h1>\r\n            <\/div>\r\n            <div class="series-title">\r\n'+((f=i["if"].call(o,t!=null?t.sharedBy:t,{name:"if",hash:{},fn:n.program(5,u,0),inverse:n.program(7,u,0),data:u}))!=null?f:"")+'            <\/div>\r\n        <\/div>\r\n        <div class="btn-container">\r\n'+((f=i["if"].call(o,t!=null?t.source:t,{name:"if",hash:{},fn:n.program(9,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(o,t!=null?t.saveInteractive:t,{name:"if",hash:{},fn:n.program(11,u,0),inverse:n.noop,data:u}))!=null?f:"")+'        <\/div>\r\n    <\/div>\r\n    \r\n    <div class="play-body">\r\n      <div class="play_embeded_player" data-videoid="">\r\n        <div class="player_shadow"><\/div>\r\n      <\/div>\r\n      <div class="play_metadata" id="meta-data-container" style="display: none">\r\n        <div class="property">\r\n          <span class="label">Rating:<\/span>\r\n          <span class="value">'+c((e=(e=i.rating||(t!=null?t.rating:t))!=null?e:s,typeof e===h?e.call(o,{name:"rating",hash:{},data:u}):e))+'<\/span>\r\n        <\/div>\r\n    \r\n        <div class="property">\r\n          <span class="label">Year:<\/span>\r\n          <span class="value">'+c((e=(e=i.year||(t!=null?t.year:t))!=null?e:s,typeof e===h?e.call(o,{name:"year",hash:{},data:u}):e))+'<\/span>\r\n        <\/div>\r\n    \r\n        <div class="property" id="video-meta-desc">\r\n          <span class="label">Description:<\/span>\r\n          <div class="value">'+((f=(i.linkify||t&&t.linkify||s).call(o,t!=null?t.description:t,{name:"linkify",hash:{},data:u}))!=null?f:"")+'<\/div>\r\n        <\/div>\r\n      <\/div>\r\n  <\/div>\r\n  \r\n    <div class="play-header">\r\n        <div class="video-title cf">\r\n            <div class="video-title-viewpart">\r\n                <h1>'+c((e=(e=i.title||(t!=null?t.title:t))!=null?e:s,typeof e===h?e.call(o,{name:"title",hash:{},data:u}):e))+((f=i["if"].call(o,t!=null?t.isInteractive:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:"")+'<\/h1>\r\n            <\/div>\r\n            <div class="series-title">\r\n'+((f=i["if"].call(o,t!=null?t.sharedBy:t,{name:"if",hash:{},fn:n.program(5,u,0),inverse:n.program(7,u,0),data:u}))!=null?f:"")+"            <\/div>\r\n        <\/div>\r\n"+((f=i["if"].call(o,t!=null?t.shareMode:t,{name:"if",hash:{},fn:n.program(13,u,0),inverse:n.noop,data:u}))!=null?f:"")+'        <div class="btn-container">\r\n'+((f=i["if"].call(o,t!=null?t.source:t,{name:"if",hash:{},fn:n.program(9,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(o,t!=null?t.saveInteractive:t,{name:"if",hash:{},fn:n.program(11,u,0),inverse:n.noop,data:u}))!=null?f:"")+'        <\/div>\r\n    <\/div>\r\n  <div id="tab-viewpart"><\/div>\r\n  <\/div>\r\n    <div class="play-viewpart-other">\r\n'+((f=i.unless.call(o,t!=null?t.shareMode:t,{name:"unless",hash:{},fn:n.program(13,u,0),inverse:n.noop,data:u}))!=null?f:"")+'        <div id="resources-viewpart"><\/div>\r\n        <div id="related-videos-viewpart"><\/div>\r\n    <\/div>\r\n'+((f=i["if"].call(o,t!=null?t.isInteractive:t,{name:"if",hash:{},fn:n.program(15,u,0),inverse:n.noop,data:u}))!=null?f:"")},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.Popup=Handlebars.template({"1":function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{};return'<div class="titlebar-container">\r\n    <div class="cv-titlebar">\r\n        <div class="text-container">\r\n            <h1 class="title">'+((e=(f=(f=i.title||(t!=null?t.title:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(o,{name:"title",hash:{},data:u}):f))!=null?e:"")+"<\/h1>\r\n"+((e=i["if"].call(o,t!=null?t.canClose:t,{name:"if",hash:{},fn:n.program(2,u,0),inverse:n.noop,data:u}))!=null?e:"")+"        <\/div>\r\n    <\/div>\r\n<\/div>\r\n"},"2":function(){return'            <a class="close">&times;<\/a>\r\n'},"4":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.canClose:t,{name:"if",hash:{},fn:n.program(5,u,0),inverse:n.noop,data:u}))!=null?f:""},"5":function(){return'<div class="no-heading">\r\n    <a class="close">&times;<\/a>\r\n<\/div>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{};return((e=i["if"].call(o,t!=null?t.title:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(4,u,0),data:u}))!=null?e:"")+'<div class="popup-body-container '+n.escapeExpression((f=(f=i.additionalClass||(t!=null?t.additionalClass:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(o,{name:"additionalClass",hash:{},data:u}):f))+'"><\/div>\r\n<div class="popup-button-container" style="display: none"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.PrivacyControl=Handlebars.template({"1":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'    <li title="'+h((f=(f=i.text||(t!=null?t.text:t))!=null?f:o,typeof f===s?f.call(e,{name:"text",hash:{},data:u}):f))+'" data-id="'+h((f=(f=i.id||(t!=null?t.id:t))!=null?f:o,typeof f===s?f.call(e,{name:"id",hash:{},data:u}):f))+'" class="'+h((f=(f=i.cssClass||(t!=null?t.cssClass:t))!=null?f:o,typeof f===s?f.call(e,{name:"cssClass",hash:{},data:u}):f))+'"><span><\/span>'+h((f=(f=i.text||(t!=null?t.text:t))!=null?f:o,typeof f===s?f.call(e,{name:"text",hash:{},data:u}):f))+"<\/li>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=n.lambda,o=n.escapeExpression;return'<span class="arrow"><\/span>\r\n<div class="current-privacy '+o(e((f=t!=null?t.currentPrivacy:t)!=null?f.cssClass:f,t))+'" data-id="'+o(e((f=t!=null?t.currentPrivacy:t)!=null?f.id:f,t))+'"><span><\/span><\/div>\r\n\r\n<ul class="privacy-selection">\r\n'+((f=i.each.call(t!=null?t:n.nullContext||{},t!=null?t.privacies:t,{name:"each",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+"<\/ul>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.PushToTab=Handlebars.template({"1":function(n,t,i,r,u){var f;return'    <div id="desc" class="form-row">\r\n        <img src="/themes/default/images/cloud-icon.png" />  \r\n        <p>Send a request to your ClickView Administrator recommending this video be added to your library.<\/p>\r\n    <\/div>\r\n    <div class="form-row">\r\n      <label>Message:<\/label>\r\n'+((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.canBePushed:t,{name:"if",hash:{},fn:n.program(2,u,0),inverse:n.program(4,u,0),data:u}))!=null?f:"")+'    <\/div>\r\n  <div class="form-row">\r\n'},"2":function(){return'        <textarea class="message" placeholder="Optional message for your ClickView Administrator"><\/textarea>\r\n'},"4":function(){return"        <p>\r\n          This video is still being processed. Please wait for a few minutes and try again.\r\n        <\/p>\r\n"},"6":function(n,t,i,r,u){var f;return'    <div class="form-row">\r\n'+((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.error:t,{name:"if",hash:{},fn:n.program(7,u,0),inverse:n.program(9,u,0),data:u}))!=null?f:"")+"    <\/div>\r\n  <\/div>\r\n"},"7":function(){return"      <p>Failed to add video to your Library. Please try again later.<\/p>\r\n"},"9":function(){return"      <p>Your video request is now pending. You will be notified when your Administrator has added the video to your library.<\/p>\r\n"},"11":function(n,t,i,r,u){var f;return(f=(i.ifIs||t&&t.ifIs||i.helperMissing).call(t!=null?t:n.nullContext||{},t!=null?t.pushed:t,"==",!1,{name:"ifIs",hash:{},fn:n.program(12,u,0),inverse:n.noop,data:u}))!=null?f:""},"12":function(){return'      <a id="push-button" class="cv-btn">Add to your Library<\/a>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return'<div class="push-to-body">\r\n'+((f=(i.ifIs||t&&t.ifIs||i.helperMissing).call(e,t!=null?t.pushed:t,"==",!1,{name:"ifIs",hash:{},fn:n.program(1,u,0),inverse:n.program(6,u,0),data:u}))!=null?f:"")+'<\/div>\r\n<div class="popup-button-container-fake">\r\n'+((f=i["if"].call(e,t!=null?t.canBePushed:t,{name:"if",hash:{},fn:n.program(11,u,0),inverse:n.noop,data:u}))!=null?f:"")+'  <a id="cancel-button" class="btn grey">Close<\/a>\r\n<\/div>\r\n'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.RelatedVideoItem=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e,s=t!=null?t:n.nullContext||{},h=i.helperMissing,l="function",o=n.escapeExpression,c=n.lambda;return'<div class="video-image">\r\n  <a href="'+o((e=(e=i.actionUrl||(t!=null?t.actionUrl:t))!=null?e:h,typeof e===l?e.call(s,{name:"actionUrl",hash:{},data:u}):e))+'">\r\n    <img alt="" title="'+o(c((f=t!=null?t.video:t)!=null?f.title:f,t))+'" src="//api-image.clickviewapp.com/v1/thumbnails/trackingcode/'+o(c((f=t!=null?t.video:t)!=null?f.tokenId:f,t))+'?size=small" />\r\n    <span class="video-duration">'+o((i.duration||t&&t.duration||h).call(s,(f=t!=null?t.video:t)!=null?f.duration:f,{name:"duration",hash:{},data:u}))+'<\/span>\r\n  <\/a>\r\n<\/div>\r\n<div class="video-description cf">\r\n  <a href="'+o((e=(e=i.actionUrl||(t!=null?t.actionUrl:t))!=null?e:h,typeof e===l?e.call(s,{name:"actionUrl",hash:{},data:u}):e))+'">\r\n    <h4 class="title">'+o(c((f=t!=null?t.video:t)!=null?f.title:f,t))+'<\/h4>\r\n  <\/a>\r\n  <p class="series">'+((f=(i.seriesFilter||t&&t.seriesFilter||h).call(s,(f=t!=null?t.video:t)!=null?f.series:f,{name:"seriesFilter",hash:{divider:"header"},data:u}))!=null?f:"")+'<\/p>\r\n  <p class="source">'+o(c((f=t!=null?t.video:t)!=null?f.sourceName:f,t))+'<\/p>\r\n<\/div>\r\n<div class="placeholder"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.ResourceItem=Handlebars.template({"1":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.editable:t,{name:"if",hash:{},fn:n.program(2,u,0),inverse:n.program(9,u,0),data:u}))!=null?f:""},"2":function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{},s=i.helperMissing,h="function",c=n.escapeExpression;return'<div class="resource-download editable-resource row">\r\n    <div class="file-icon vertical-align">\r\n        <svg class="icon file-type-'+c((f=(f=i.fileType||(t!=null?t.fileType:t))!=null?f:s,typeof f===h?f.call(o,{name:"fileType",hash:{},data:u}):f))+" "+((e=i["if"].call(o,t!=null?t.enableEdit:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?e:"")+'">\r\n            <use xlink:href="#file-type-'+c((f=(f=i.fileType||(t!=null?t.fileType:t))!=null?f:s,typeof f===h?f.call(o,{name:"fileType",hash:{},data:u}):f))+'"><\/use>\r\n        <\/svg>\r\n    <\/div><!--\r\n    --><div class="title vertical-align">\r\n'+((e=i["if"].call(o,t!=null?t.enableEdit:t,{name:"if",hash:{},fn:n.program(5,u,0),inverse:n.program(7,u,0),data:u}))!=null?e:"")+'    <\/div><!--\r\n    --><div class="resource-ddl-actions-menu ddl-container vertical-align">\r\n        <div class="dropdown-root">\r\n            <div class="dropdown-toggle" data-toggle="dropdown">\r\n                <svg class="dropdown-toggle-icon">\r\n                    <use xlink:href="#more"><\/use>\r\n                <\/svg>\r\n            <\/div>\r\n            <ul class="dropdown-menu ddl-actions">\r\n                <li class="ddl-action resource-rename"><span>Rename<\/span><\/li>\r\n                <li class="ddl-action resource-delete"><span>Delete<\/span><\/li>\r\n            <\/ul>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>\r\n'},"3":function(){return"edit-file-icon"},"5":function(n,t,i,r,u){var f;return'        <input class="editable-title" value="'+n.escapeExpression((f=(f=i.title||(t!=null?t.title:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"title",hash:{},data:u}):f))+'" />\r\n'},"7":function(n,t,i,r,u){var f;return'        <span class="resource-title">'+n.escapeExpression((f=(f=i.title||(t!=null?t.title:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"title",hash:{},data:u}):f))+"<\/span>\r\n"},"9":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<div class="resource-download editable-resource row">\r\n    <div class="file-icon vertical-align">\r\n        <svg class="icon file-type-'+h((f=(f=i.fileType||(t!=null?t.fileType:t))!=null?f:o,typeof f===s?f.call(e,{name:"fileType",hash:{},data:u}):f))+'">\r\n            <use xlink:href="#file-type-'+h((f=(f=i.fileType||(t!=null?t.fileType:t))!=null?f:o,typeof f===s?f.call(e,{name:"fileType",hash:{},data:u}):f))+'"><\/use>\r\n        <\/svg>\r\n    <\/div><!--\r\n    --><div class="title vertical-align">\r\n        <span class="resource-title">'+h((f=(f=i.displayName||(t!=null?t.displayName:t))!=null?f:o,typeof f===s?f.call(e,{name:"displayName",hash:{},data:u}):f))+"<\/span>\r\n    <\/div>\r\n<\/div>\r\n"},"11":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<div class="resource-download row">\r\n    <div class="file-icon vertical-align">\r\n        <svg class="icon file-type-'+h((f=(f=i.extension||(t!=null?t.extension:t))!=null?f:o,typeof f===s?f.call(e,{name:"extension",hash:{},data:u}):f))+'">\r\n            <use xlink:href="#file-type-'+h((f=(f=i.extension||(t!=null?t.extension:t))!=null?f:o,typeof f===s?f.call(e,{name:"extension",hash:{},data:u}):f))+'"><\/use>\r\n        <\/svg>\r\n    <\/div><!--\r\n    --><div class="title vertical-align">\r\n        <span class="resource-title">'+h((f=(f=i.displayName||(t!=null?t.displayName:t))!=null?f:o,typeof f===s?f.call(e,{name:"displayName",hash:{},data:u}):f))+"<\/span>\r\n    <\/div>\r\n<\/div>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.isMaster:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(11,u,0),data:u}))!=null?f:""},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.Resources=Handlebars.template({"1":function(){return'    <div class="resources-sidebar-create-interactive"><span class="icon"><\/span>Create an interactive video<\/div>\r\n'},"3":function(){return'    <h3 class="sidebar-header">Resources<\/h3>\r\n'},"5":function(){return'    <div class="upload-resource-container col-xs-12">\r\n        <div class="upload-resource-viewpart"><\/div>\r\n        <div class="uploading-resource-viewpart">\r\n        <div class="uploading-resource-progress"><\/div>\r\n        <\/div>\r\n    <\/div>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return((f=i["if"].call(e,t!=null?t.showCreateInteractive:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,t!=null?t.showResourcesHeader:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:"")+'<div class="resources-list-container">\r\n    <p class="empty-text">This video has no resources<\/p>\r\n<\/div>\r\n'+((f=i["if"].call(e,t!=null?t.showUploadResource:t,{name:"if",hash:{},fn:n.program(5,u,0),inverse:n.noop,data:u}))!=null?f:"")},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.RestrictedPlayer=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var e,f;return'<div class="mask">\r\n    <div class="contents">\r\n        <div class="key-icon"><\/div>\r\n        <h2>Sorry, we can\'t show you this video.<\/h2>\r\n        <p>'+((e=(f=(f=i.restrictionDescription||(t!=null?t.restrictionDescription:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"restrictionDescription",hash:{},data:u}):f))!=null?e:"")+"<\/p>\r\n    <\/div>\r\n<\/div>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.SearchBox=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<!--[if lt IE 9]><style>#searchBox{line-height: 28px;}<\/style><![endif]-->\r\n<form>\r\n\t<input class="search-box-nav" id="searchBox" name="kw" type="text" autocomplete="off" value="'+n.escapeExpression((f=(f=i.searchTerm||(t!=null?t.searchTerm:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"searchTerm",hash:{},data:u}):f))+'" placeholder="Search..."/>\r\n\t<input class="search-submit-nav" type="submit" value=""/>\r\n\t<div class="search-ghost"><\/div>\r\n<\/form>\r\n<div class="search-drop-down-container"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.Setting=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<label><input class="enabled" type="checkbox" /> '+n.escapeExpression((f=(f=i.text||(t!=null?t.text:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"text",hash:{},data:u}):f))+"<\/label>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.ShareAsInteractiveToggle=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="toggle-container">\r\n  <span class="preview-interactive-text">Share with interactions<\/span>\r\n<\/div>\r\n<section class="row">\r\n  <div class="col-xs-4 tile">\r\n    <div class="border-container">\r\n      <div class="image student"><\/div>\r\n      <p class="text">1. Share with your students<\/p>\r\n    <\/div>\r\n  <\/div>\r\n  <div class="col-xs-4 tile">\r\n    <div class="border-container">\r\n      <div class="image laptop"><\/div>\r\n      <p class="text">2. Students view it in their own time<\/p>\r\n    <\/div>\r\n  <\/div>\r\n  <div class="col-xs-4 tile">\r\n    <div class="border-container">\r\n      <div class="image chart"><\/div>\r\n      <p class="text">3. Analyse your students results<\/p>\r\n    <\/div>\r\n  <\/div>\r\n<\/section>\r\n'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.ShareTab=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="warning-container"><\/div>\r\n<div class="share-metadata-container"><\/div>\r\n<div class="clipping-tool-viewpart-share"><\/div>\r\n<div class="share-options-tabs"><\/div>\r\n<div class="share-links-viewpart"><\/div>\r\n<div class="share-button-container"><\/div>\r\n'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.ShareTabEmbed=Handlebars.template({"1":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return'<div class="share-links-container">\r\n'+((f=i["if"].call(e,t!=null?t.embedLink:t,{name:"if",hash:{},fn:n.program(2,u,0),inverse:n.noop,data:u}))!=null?f:"")+'<\/div>\r\n\r\n<div class="share-options-container form-row mb15">\r\n    <div class="form-row half">\r\n        <label for="video-size" class="inline">Video size:<\/label>\r\n        <select id="video-size" class="inline">\r\n'+((f=i.each.call(e,t!=null?t.videoSizes:t,{name:"each",hash:{},fn:n.program(5,u,0),inverse:n.noop,data:u}))!=null?f:"")+'        <\/select>\r\n    <\/div><div class="form-row half">\r\n'+((f=i["if"].call(e,t!=null?t.showAutoplay:t,{name:"if",hash:{},fn:n.program(7,u,0),inverse:n.noop,data:u}))!=null?f:"")+'<div class="form-row half">\r\n            <input type="checkbox" class="inline" name="secure" id="video-secure" '+((f=i["if"].call(e,t!=null?t.secure:t,{name:"if",hash:{},fn:n.program(8,u,0),inverse:n.noop,data:u}))!=null?f:"")+'>\r\n            <label class="inline" for="video-secure">HTTPS<\/label>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>\r\n'},"2":function(n,t,i,r,u){var e,f,o=n.escapeExpression,s=t!=null?t:n.nullContext||{};return'  <div class="embed-container form-row mb15">\r\n    <label>Embed this '+o(n.lambda((e=t!=null?t.resourceType:t)!=null?e.name:e,t))+'<\/label>\r\n      <textarea id="embed-link" spellcheck="false" readonly>'+o((f=(f=i.embedLink||(t!=null?t.embedLink:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(s,{name:"embedLink",hash:{},data:u}):f))+"<\/textarea>\r\n      "+((e=i["if"].call(s,t!=null?t.isCopyEnabled:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?e:"")+"\r\n  <\/div>\r\n"},"3":function(){return'<a class="btn grey copy-button" title="Copied" data-trigger="manual">Copy<\/a>'},"5":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'            <option data-height="'+h((f=(f=i.height||(t!=null?t.height:t))!=null?f:o,typeof f===s?f.call(e,{name:"height",hash:{},data:u}):f))+'" data-width="'+h((f=(f=i.width||(t!=null?t.width:t))!=null?f:o,typeof f===s?f.call(e,{name:"width",hash:{},data:u}):f))+'">'+h((f=(f=i.width||(t!=null?t.width:t))!=null?f:o,typeof f===s?f.call(e,{name:"width",hash:{},data:u}):f))+" x "+h((f=(f=i.height||(t!=null?t.height:t))!=null?f:o,typeof f===s?f.call(e,{name:"height",hash:{},data:u}):f))+"<\/option>\r\n"},"7":function(n,t,i,r,u){var f;return'        <div class="form-row half">\r\n            <input type="checkbox" class="inline" name="autoplay" id="video-autoplay" '+((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.autoPlay:t,{name:"if",hash:{},fn:n.program(8,u,0),inverse:n.noop,data:u}))!=null?f:"")+'>\r\n            <label class="inline" for="video-autoplay">Autoplay<\/label>\r\n        <\/div>'},"8":function(){return"checked"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.embeddable:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+'<div class="g-classroom"><\/div>\r\n'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.ShareTabLinks=Handlebars.template({"1":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.resourceLink:t,{name:"if",hash:{},fn:n.program(2,u,0),inverse:n.noop,data:u}))!=null?f:""},"2":function(n,t,i,r,u){var e,f,o=n.escapeExpression,s=t!=null?t:n.nullContext||{};return'    <div class="form-row mb15">\r\n        <label>\r\n            Link to this '+o(n.lambda((e=t!=null?t.resourceType:t)!=null?e.name:e,t))+'\r\n        <\/label>\r\n        <div class="resource-link-container">\r\n            <input type="text" class="resource-link" spellcheck="false" value="'+o((f=(f=i.resourceLink||(t!=null?t.resourceLink:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(s,{name:"resourceLink",hash:{},data:u}):f))+'" readonly/>\r\n            '+((e=i["if"].call(s,t!=null?t.isCopyEnabled:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?e:"")+"\r\n        <\/div>\r\n    <\/div>\r\n"},"3":function(){return'<a class="btn grey copy-button" title="Copied" data-trigger="manual">Copy<\/a>'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{},s=i.helperMissing;return'<div class="share-links-container">\r\n'+((e=(i.ifIs||t&&t.ifIs||s).call(o,(e=t!=null?t.privacy:t)!=null?e.id:e,"!=",1,{name:"ifIs",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?e:"")+'<\/div>\r\n<div class="mail-to-container">\r\n    <a class="mail-to-inner" href="'+n.escapeExpression((f=(f=i.emailLink||(t!=null?t.emailLink:t))!=null?f:s,typeof f=="function"?f.call(o,{name:"emailLink",hash:{},data:u}):f))+'">\r\n        <svg>\r\n            <use xlink:href="#mail"><\/use>\r\n        <\/svg>\r\n        <span>Email this link<\/span>\r\n    <\/a>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.ShareTabOther=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<div class="mail-to-container">\r\n    <a class="mail-to-inner" href="'+n.escapeExpression((f=(f=i.emailLink||(t!=null?t.emailLink:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"emailLink",hash:{},data:u}):f))+'">\r\n        <span class="mail-image"><\/span>\r\n        <span>Email<\/span>\r\n    <\/a>\r\n<\/div>\r\n<div class="g-classroom"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.ShareTabPrivacy=Handlebars.template({"1":function(n,t,i,r,u){var f;return'    <div class="privacy-selector div-dd" data-toggle="tooltip" data-placement="top" title="" data-original-title="Click to change privacy">\r\n        <div class="div-dd-inner privacy-selector-inner">\r\n            <span class="h5">'+n.escapeExpression(n.lambda((f=t!=null?t.privacy:t)!=null?f.name:f,t))+'<\/span>\r\n            <span class="div-dd-arrow"><\/span>\r\n        <\/div>\r\n        <div class="div-dd-dropdown">\r\n            <ul>\r\n'+((f=i.each.call(t!=null?t:n.nullContext||{},t!=null?t.privacies:t,{name:"each",hash:{},fn:n.program(2,u,0),inverse:n.noop,data:u}))!=null?f:"")+"            <\/ul>\r\n        <\/div>\r\n    <\/div>\r\n"},"2":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.visible:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:""},"3":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'                <li title="'+h((f=(f=i.name||(t!=null?t.name:t))!=null?f:o,typeof f===s?f.call(e,{name:"name",hash:{},data:u}):f))+'" data-id="'+h((f=(f=i.id||(t!=null?t.id:t))!=null?f:o,typeof f===s?f.call(e,{name:"id",hash:{},data:u}):f))+'" class="privacy '+h((f=(f=i.cssClass||(t!=null?t.cssClass:t))!=null?f:o,typeof f===s?f.call(e,{name:"cssClass",hash:{},data:u}):f))+'">\r\n                    <span><\/span>'+h((f=(f=i.name||(t!=null?t.name:t))!=null?f:o,typeof f===s?f.call(e,{name:"name",hash:{},data:u}):f))+"\r\n                <\/li>\r\n"},"5":function(n,t,i,r,u){var f;return'    <div class="privacy-selector no-options"  title="The privacy of this video can not be changed">\r\n        <div class="div-dd disabled">\r\n            <div class="div-dd-inner privacy-selector-inner">\r\n                <span class="h5">'+((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.isExchangeVideo:t,{name:"if",hash:{},fn:n.program(6,u,0),inverse:n.program(7,u,0),data:u}))!=null?f:"")+'<\/span>\r\n                <span class="div-dd-arrow"><\/span>\r\n            <\/div>\r\n        <\/div>\r\n    <\/div>\r\n'},"6":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.hasUserChannel:t,{name:"if",hash:{},fn:n.program(7,u,0),inverse:n.program(9,u,0),data:u}))!=null?f:""},"7":function(n,t){var i;return n.escapeExpression(n.lambda((i=t!=null?t.privacy:t)!=null?i.name:i,t))},"9":function(){return"Exchange community"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var e,f,o=n.escapeExpression,s=t!=null?t:n.nullContext||{};return'<div class="form-row">\r\n    <label>Who can see this shared '+o(n.lambda((e=t!=null?t.resourceType:t)!=null?e.name:e,t))+': <\/label>\r\n    <span class="info" title="'+o((f=(f=i.hint||(t!=null?t.hint:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(s,{name:"hint",hash:{},data:u}):f))+'">\r\n        <svg class="question-mark-icon">\r\n            <use xlink:href="#icn-questionmark"><\/use>\r\n        <\/svg>\r\n    <\/span>\r\n'+((e=i["if"].call(s,t!=null?t.showDropdown:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(5,u,0),data:u}))!=null?e:"")+"<\/div>\r\n"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.SlidingList=Handlebars.template({"1":function(n,t,i,r,u){var f;return'<div class="heading-area">\r\n'+((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.listActionUrl:t,{name:"if",hash:{},fn:n.program(2,u,0),inverse:n.program(5,u,0),data:u}))!=null?f:"")+"<\/div>\r\n"},"2":function(n,t,i,r,u){var o,f,e=t!=null?t:n.nullContext||{},s=i.helperMissing,h="function",c=n.escapeExpression;return'    <h2>\r\n        <a href="'+c((f=(f=i.listActionUrl||(t!=null?t.listActionUrl:t))!=null?f:s,typeof f===h?f.call(e,{name:"listActionUrl",hash:{},data:u}):f))+'" class="list-action">\r\n            '+c((f=(f=i.heading||(t!=null?t.heading:t))!=null?f:s,typeof f===h?f.call(e,{name:"heading",hash:{},data:u}):f))+'\r\n            <span class="boomerang"><\/span>\r\n'+((o=i["if"].call(e,t!=null?t.subHeading:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?o:"")+"        <\/a>\r\n    <\/h2>\r\n"},"3":function(n,t,i,r,u){var f;return'            <span class="curated">'+n.escapeExpression((f=(f=i.subHeading||(t!=null?t.subHeading:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"subHeading",hash:{},data:u}):f))+"<\/span>\r\n"},"5":function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{};return"    <h2>"+n.escapeExpression((f=(f=i.heading||(t!=null?t.heading:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(o,{name:"heading",hash:{},data:u}):f))+"<\/h2>\r\n"+((e=i["if"].call(o,t!=null?t.subHeading:t,{name:"if",hash:{},fn:n.program(6,u,0),inverse:n.noop,data:u}))!=null?e:"")},"6":function(n,t,i,r,u){var f;return'    <span class="curated">'+n.escapeExpression((f=(f=i.subHeading||(t!=null?t.subHeading:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"subHeading",hash:{},data:u}):f))+"<\/span>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.heading:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+'<div class="slide-button-positioner">\r\n    <div class="slide-container margin-transition"><\/div>\r\n    <div class="slide-button-container left-button">\r\n        <div class="slide-button slide-left">\r\n            <div class="pressable">\r\n                <div class="arrow">\r\n                    <svg>\r\n                        <use xlink:href="#left"><\/use>\r\n                    <\/svg>\r\n                <\/div>\r\n            <\/div>\r\n        <\/div>\r\n    <\/div>\r\n    <div class="slide-button-container right-button">\r\n        <div class="slide-button slide-right">\r\n            <div class="pressable">\r\n                <div class="arrow">\r\n                    <svg>\r\n                        <use xlink:href="#right"><\/use>\r\n                    <\/svg>\r\n                <\/div>\r\n            <\/div>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.SlidingListItem=Handlebars.template({"1":function(n,t,i,r,u){var f,o,e=t!=null?t:n.nullContext||{};return'<div class="thumbnail">\r\n    <a href="'+n.escapeExpression((o=(o=i.href||(t!=null?t.href:t))!=null?o:i.helperMissing,typeof o=="function"?o.call(e,{name:"href",hash:{},data:u}):o))+'" '+((f=i["if"].call(e,t!=null?t.useBackgroundImage:t,{name:"if",hash:{},fn:n.program(2,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n        "+((f=i["if"].call(e,t!=null?t.isSVG:t,{name:"if",hash:{},fn:n.program(4,u,0),inverse:n.noop,data:u}))!=null?f:"")+">\r\n"+((f=i.unless.call(e,t!=null?t.useBackgroundImage:t,{name:"unless",hash:{},fn:n.program(6,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,t!=null?t.isVideo:t,{name:"if",hash:{},fn:n.program(14,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n"+((f=i["if"].call(e,t!=null?t.small:t,{name:"if",hash:{},fn:n.program(16,u,0),inverse:n.program(19,u,0),data:u}))!=null?f:"")+'\r\n        <div class="badges">\r\n'+((f=i["if"].call(e,t!=null?t.hasInteractives:t,{name:"if",hash:{},fn:n.program(22,u,0),inverse:n.noop,data:u}))!=null?f:"")+"            "+((f=i["if"].call(e,t!=null?t.duration:t,{name:"if",hash:{},fn:n.program(24,u,0),inverse:n.noop,data:u}))!=null?f:"")+'\r\n        <\/div>\r\n    <\/a>\r\n    <div class="btn-group video-actions sliding-list-video-actions"><\/div>\r\n<\/div>\r\n'},"2":function(n,t,i,r,u){var f;return' style="background-image: url('+n.escapeExpression((f=(f=i.image||(t!=null?t.image:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"image",hash:{},data:u}):f))+')" '},"4":function(){return' class="see-all-videos-tile" '},"6":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return"        "+((f=i["if"].call(e,t!=null?t.image:t,{name:"if",hash:{},fn:n.program(7,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n"+((f=i["if"].call(e,t!=null?t.isSVG:t,{name:"if",hash:{},fn:n.program(12,u,0),inverse:n.noop,data:u}))!=null?f:"")},"7":function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{};return"<img "+((e=i["if"].call(o,t!=null?t.lazyLoad:t,{name:"if",hash:{},fn:n.program(8,u,0),inverse:n.program(10,u,0),data:u}))!=null?e:"")+'="'+n.escapeExpression((f=(f=i.image||(t!=null?t.image:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(o,{name:"image",hash:{},data:u}):f))+'" />'},"8":function(){return' class="lazy" data-original'},"10":function(){return"src"},"12":function(){return'        <div class="see-all-videos-text">\r\n            SEE ALL VIDEOS\r\n            <svg class="right-arrow">\r\n                <use xlink:href="#right-arrow"><\/use>\r\n            <\/svg>\r\n                \r\n        <\/div>\r\n'},"14":function(){return'        <div class="play-btn-mask"><\/div>\r\n        <div class="play-icon-video">\r\n            <svg class="play-icon">\r\n                <use xlink:href="#play"><\/use>\r\n            <\/svg>\r\n        <\/div>\r\n'},"16":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.category:t,{name:"if",hash:{},fn:n.program(17,u,0),inverse:n.noop,data:u}))!=null?f:""},"17":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,h="function",s=n.escapeExpression;return'        <div class="bottom-container">\r\n            <p class="name">'+s((f=(f=i.name||(t!=null?t.name:t))!=null?f:o,typeof f===h?f.call(e,{name:"name",hash:{},data:u}):f))+'<\/p>\r\n            <p class="video-count">'+s((f=(f=i.videoCount||(t!=null?t.videoCount:t))!=null?f:o,typeof f===h?f.call(e,{name:"videoCount",hash:{},data:u}):f))+" "+s((i.pluralize||t&&t.pluralize||o).call(e,t!=null?t.videoCount:t,"Video","Videos",{name:"pluralize",hash:{},data:u}))+"<\/p>\r\n        <\/div>\r\n"},"19":function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{};return'        <div class="bottom-container">\r\n            <div class="name">'+n.escapeExpression((f=(f=i.name||(t!=null?t.name:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(o,{name:"name",hash:{},data:u}):f))+"<\/div>\r\n            "+((e=i["if"].call(o,t!=null?t.series:t,{name:"if",hash:{},fn:n.program(20,u,0),inverse:n.noop,data:u}))!=null?e:"")+"\r\n        <\/div>\r\n"},"20":function(n,t,i,r,u){var f;return'<div class="series">Series: '+n.escapeExpression((f=(f=i.series||(t!=null?t.series:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"series",hash:{},data:u}):f))+"<\/div>"},"22":function(){return'            <span class="metadata-badge orange has-interactives">Interactive<\/span>\r\n'},"24":function(n,t,i,r,u){return' <span class="duration">'+n.escapeExpression((i.duration||t&&t.duration||i.helperMissing).call(t!=null?t:n.nullContext||{},t!=null?t.duration:t,{name:"duration",hash:{},data:u}))+"<\/span> "},"26":function(){return'<div class="restricted-thumbnail-container"><\/div>\r\n'},"28":function(n,t,i,r,u){var f;return(f=i.unless.call(t!=null?t:n.nullContext||{},t!=null?t.isRestrictedFromStudent:t,{name:"unless",hash:{},fn:n.program(29,u,0),inverse:n.program(44,u,0),data:u}))!=null?f:""},"29":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return((f=i.unless.call(e,t!=null?t.category:t,{name:"unless",hash:{},fn:n.program(30,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,t!=null?t.series:t,{name:"if",hash:{},fn:n.program(39,u,0),inverse:n.noop,data:u}))!=null?f:"")},"30":function(n,t,i,r,u){var f,e,o=t!=null?t:n.nullContext||{};return'<div class="title '+((f=i["if"].call(o,t!=null?t.partialLoading:t,{name:"if",hash:{},fn:n.program(31,u,0),inverse:n.noop,data:u}))!=null?f:"")+'">\r\n    '+((f=i.unless.call(o,t!=null?t.isRestricted:t,{name:"unless",hash:{},fn:n.program(33,u,0),inverse:n.noop,data:u}))!=null?f:"")+n.escapeExpression((e=(e=i.name||(t!=null?t.name:t))!=null?e:i.helperMissing,typeof e=="function"?e.call(o,{name:"name",hash:{},data:u}):e))+((f=i.unless.call(o,t!=null?t.isRestricted:t,{name:"unless",hash:{},fn:n.program(35,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n"+((f=i["if"].call(o,t!=null?t.hasRestriction:t,{name:"if",hash:{},fn:n.program(37,u,0),inverse:n.noop,data:u}))!=null?f:"")+"<\/div>\r\n"},"31":function(){return"partial-loading-item"},"33":function(n,t,i,r,u){var f;return'<a href="'+n.escapeExpression((f=(f=i.href||(t!=null?t.href:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"href",hash:{},data:u}):f))+'" class="name-link">'},"35":function(){return"<\/a>"},"37":function(){return'        <div class="restricted-badge-container"><\/div>\r\n'},"39":function(n,t,i,r,u){var f;return((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.seriesHref:t,{name:"if",hash:{},fn:n.program(40,u,0),inverse:n.program(42,u,0),data:u}))!=null?f:"")+"\r\n"},"40":function(n,t,i,r,u){var o,f,e=t!=null?t:n.nullContext||{},s=i.helperMissing,h="function",c=n.escapeExpression;return'<div class="series '+((o=i["if"].call(e,t!=null?t.partialLoading:t,{name:"if",hash:{},fn:n.program(31,u,0),inverse:n.noop,data:u}))!=null?o:"")+'">\r\n    Series: <a href="'+c((f=(f=i.seriesHref||(t!=null?t.seriesHref:t))!=null?f:s,typeof f===h?f.call(e,{name:"seriesHref",hash:{},data:u}):f))+'" class="series-link">'+c((f=(f=i.series||(t!=null?t.series:t))!=null?f:s,typeof f===h?f.call(e,{name:"series",hash:{},data:u}):f))+"<\/a>\r\n<\/div>\r\n"},"42":function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{};return'<div class="series '+((e=i["if"].call(o,t!=null?t.partialLoading:t,{name:"if",hash:{},fn:n.program(31,u,0),inverse:n.noop,data:u}))!=null?e:"")+'">\r\n    Series: '+n.escapeExpression((f=(f=i.series||(t!=null?t.series:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(o,{name:"series",hash:{},data:u}):f))+"\r\n<\/div>\r\n"},"44":function(){return'<div class="title restricted-content-mask"><\/div>\r\n<div class="series restricted-content-mask"><\/div>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return((f=i.unless.call(e,t!=null?t.isRestricted:t,{name:"unless",hash:{},fn:n.program(1,u,0),inverse:n.program(26,u,0),data:u}))!=null?f:"")+((f=i["if"].call(e,t!=null?t.small:t,{name:"if",hash:{},fn:n.program(28,u,0),inverse:n.noop,data:u}))!=null?f:"")},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.SnippetApp=Handlebars.template({"1":function(){return'checked="checked"'},"3":function(n,t,i,r,u){var f=t!=null?t:n.nullContext||{},e=i.helperMissing,o=n.escapeExpression;return'<div class="row">\r\n  <div class="row">\r\n    <label>Start at:<\/label>\r\n  <\/div>\r\n\r\n  <div class="row">\r\n    <div class="col-sm-6 col-xs-12 time-container">\r\n      <input id="snippet-start-time" data-seconds="" value="'+o((i.duration||t&&t.duration||e).call(f,t!=null?t.startTime:t,{name:"duration",hash:{},data:u}))+'" />\r\n      <i class="increment-start-time noselect arrow up"><\/i>\r\n      <i class="decrement-start-time noselect arrow down" hidden="hidden"><\/i>\r\n    <\/div>\r\n    <div class="col-sm-6 snippet-button-container">\r\n      <button class="set-start btn blue">Set start time<\/button>\r\n    <\/div>\r\n    <div id="start-time-error" class="col-sm-6 col-xs-12 error-message" />\r\n  <\/div>\r\n\r\n  <div class="row">\r\n    <label>End at:<\/label>\r\n  <\/div>\r\n\r\n  <div class="row">\r\n    <div class="col-sm-6 col-xs-12 time-container">\r\n      <input id="snippet-end-time" data-seconds="" value="'+o((i.duration||t&&t.duration||e).call(f,t!=null?t.endTime:t,{name:"duration",hash:{},data:u}))+'" />\r\n      <i class="increment-end-time noselect arrow up" hidden="hidden"><\/i>\r\n      <i class="decrement-end-time noselect arrow down"><\/i>\r\n    <\/div>\r\n    <div class="col-sm-6 snippet-button-container">\r\n      <button class="set-end btn blue">Set end time<\/button>\r\n    <\/div>\r\n    <div id="end-time-error" class="col-sm-6 col-xs-12 error-message" />\r\n  <\/div>\r\n<\/div>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return'<label for="share-click-toggle" class="toggler">\r\n    <input id="share-click-toggle" type="checkbox" '+((f=i["if"].call(e,t!=null?t.enabled:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+"/>Create a clip\r\n<\/label>\r\n\r\n"+((f=i["if"].call(e,t!=null?t.enabled:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:"")},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.Sorting=Handlebars.template({"1":function(){return'        <div class="checkbox-viewpart"><\/div>\r\n'},"3":function(){return'        <div class="action-viewpart"><\/div>\r\n'},"5":function(){return'        <div class="bulk-actions-viewpart video-actions"><\/div>\r\n'},"7":function(){return'        <div class="layout-viewpart"><\/div>\r\n'},"9":function(n,t,i,r,u){var f;return'        <div class="dropdown-container">\r\n            <span class="sort-box-text">Sort by<\/span>\r\n            <div class="btn-group sorting-dropdown">\r\n                <a class="dropdown-toggle" data-toggle="dropdown">'+n.escapeExpression((f=(f=i.text||(t!=null?t.text:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"text",hash:{},data:u}):f))+"<\/a>\r\n            <\/div>\r\n        <\/div>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return'<div class="border-bottom">\r\n    <div class="left-container">\r\n'+((f=i["if"].call(e,t!=null?t.bulkActions:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,t!=null?t.headerAction:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:"")+'        <div class="breadcrumb-viewpart"><\/div>\r\n    <\/div>\r\n    <div class="right-container">\r\n'+((f=i["if"].call(e,t!=null?t.bulkActions:t,{name:"if",hash:{},fn:n.program(5,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,t!=null?t.layoutToggle:t,{name:"if",hash:{},fn:n.program(7,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,t!=null?t.showSorting:t,{name:"if",hash:{},fn:n.program(9,u,0),inverse:n.noop,data:u}))!=null?f:"")+"    <\/div>\r\n<\/div>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.SpinJsView=Handlebars.template({"1":function(n,t,i,r,u){var f;return'<p class="loading-text">'+n.escapeExpression((f=(f=i.loadingText||(t!=null?t.loadingText:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"loadingText",hash:{},data:u}):f))+"<\/p>"},"3":function(){return'<div class="loading-mask"><\/div>'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return'<div class="image"><\/div>\r\n'+((f=i["if"].call(e,t!=null?t.loadingText:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n"+((f=i["if"].call(e,t!=null?t.mask:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:"")},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.SpinnerButton=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return n.escapeExpression((f=(f=i.buttonText||(t!=null?t.buttonText:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"buttonText",hash:{},data:u}):f))},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.StickySubscribeBanner=Handlebars.template({"1":function(){return'    <div class="inner">\r\n        <h1 class="subscribe-success">Thank you for subscribing<\/h1>\r\n        <p>We\'ll notify you when the next TV Guide is available. Stay tuned!<\/p>\r\n    <\/div>\r\n    <span class="unpin"><svg><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#down"><\/use><\/svg><\/span>\r\n'},"3":function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{};return'    <div class="inner">\r\n        <h1>'+n.escapeExpression((f=(f=i.bannerText||(t!=null?t.bannerText:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(o,{name:"bannerText",hash:{},data:u}):f))+"<\/h1>\r\n    <\/div>\r\n    "+((e=i.unless.call(o,t!=null?t.isPinned:t,{name:"unless",hash:{},fn:n.program(4,u,0),inverse:n.noop,data:u}))!=null?e:"")+"\r\n"+((e=i["if"].call(o,t!=null?t.isAuthenticated:t,{name:"if",hash:{},fn:n.program(6,u,0),inverse:n.program(8,u,0),data:u}))!=null?e:"")},"4":function(){return'<span class="unpin"><svg><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#down"><\/use><\/svg><\/span>'},"6":function(){return'    <div class="btn-viewpart"><\/div>\r\n    <!--<button class="btn subscribe">Notify me<\/button>-->\r\n'},"8":function(){return'    <div class="form-group">\r\n        <input type="email" class="email" id="user-email" placeholder="Enter your email address" name="emailAddress" />\r\n        <div class="input-group-btn">\r\n            <div class="btn-viewpart"><\/div>\r\n        <\/div>\r\n        <div class="help-block hide-error"><\/div>\r\n    <\/div> \r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<div class="sticky-container">\r\n'+((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.subscribeConfirmed:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(3,u,0),data:u}))!=null?f:"")+"<\/div>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.SubjectRecommendation=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div id="subject-recommendation-form">\r\n    <div class="form-body">\r\n        <p class="description">So that we can provide better content suggestions to you in the future, please let us know which subjects you teach. If you think any of these subjects are not relevant to you, you can add or remove these subjects.<\/p>\r\n        <div id="subject-recommendation-list-container">\r\n            <div id="subject-input-container">\r\n                <input id="subject-input" class="typeahead" />\r\n            <\/div>\r\n        <\/div>\r\n    <\/div>\r\n    <div class="form-row"><\/div>\r\n    <div class="popup-button-container-fake">\r\n        <a id="confirm-btn" class="cv-btn">I teach these subjects<\/a>\r\n        <a id="close-btn" class="close-button grey btn">Close<\/a>\r\n    <\/div>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.TabCount=Handlebars.template({"1":function(n,t,i,r,u){var f;return'<span class="tab-item-count">'+n.escapeExpression((f=(f=i.count||(t!=null?t.count:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"count",hash:{},data:u}):f))+"<\/span>"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.count:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:""},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.Thumbnail=Handlebars.template({"1":function(n,t,i,r,u){var f;return' href="'+n.escapeExpression((f=(f=i.actionUrl||(t!=null?t.actionUrl:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"actionUrl",hash:{},data:u}):f))+'" '},"3":function(){return'    <div class="play-btn-mask"><\/div>\r\n    <div class="play-icon-video">\r\n        <svg class="play-icon">\r\n            <use xlink:href="#play"><\/use>\r\n        <\/svg>\r\n    <\/div>\r\n'},"5":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return" "+((f=i["if"].call(e,(f=t!=null?t.options:t)!=null?f.lazyload:f,{name:"if",hash:{},fn:n.program(6,u,0),inverse:n.program(8,u,0),data:u}))!=null?f:"")+'="'+n.escapeExpression((i.stripProtocol||t&&t.stripProtocol||i.helperMissing).call(e,t!=null?t.thumbnailUrl:t,{name:"stripProtocol",hash:{},data:u}))+"?size="+((f=i["if"].call(e,(f=t!=null?t.options:t)!=null?f.thumbnailSize:f,{name:"if",hash:{},fn:n.program(10,u,0),inverse:n.program(12,u,0),data:u}))!=null?f:"")+'" '},"6":function(){return" data-original"},"8":function(){return"src"},"10":function(n,t){var i;return n.escapeExpression(n.lambda((i=t!=null?t.options:t)!=null?i.thumbnailSize:i,t))},"12":function(){return"small"},"14":function(n,t){var i;return'    <span class="badge">'+n.escapeExpression(n.lambda((i=t!=null?t.options:t)!=null?i.badge:i,t))+"<\/span>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return"<a "+((f=i["if"].call(e,t!=null?t.actionUrl:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+">\r\n"+((f=i["if"].call(e,t!=null?t.actionUrl:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:"")+'    <img alt="" title="'+n.escapeExpression(n.lambda((f=t!=null?t.video:t)!=null?f.title:f,t))+'" '+((f=i["if"].call(e,t!=null?t.thumbnailUrl:t,{name:"if",hash:{},fn:n.program(5,u,0),inverse:n.noop,data:u}))!=null?f:"")+" />\r\n"+((f=i["if"].call(e,(f=t!=null?t.options:t)!=null?f.badge:f,{name:"if",hash:{},fn:n.program(14,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n<\/a>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.TitleBar=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="text-container">\r\n  <h1 class="title"><\/h1>\r\n  <span class="sub-title"><\/span>\r\n<\/div>\r\n<div class="buttons-container"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.UnAuthenticatedPlayer=Handlebars.template({"1":function(n,t,i,r,u){var f;return n.escapeExpression((f=(f=i.customMessage||(t!=null?t.customMessage:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"customMessage",hash:{},data:u}):f))},"3":function(){return"You must be signed in to watch this video."},"5":function(){return""},"7":function(n,t,i,r,u){var f;return'<a class="btn orange large signup" href="'+n.escapeExpression((f=(f=i.signinLink||(t!=null?t.signinLink:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"signinLink",hash:{},data:u}):f))+'">Sign in to ClickView<\/a>'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return'<div class="mask">\r\n    <div class="contents">\r\n        <div class="key-icon"><\/div>\r\n        <p>'+((f=i["if"].call(e,t!=null?t.customMessage:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(3,u,0),data:u}))!=null?f:"")+"<\/p>\r\n        "+((f=i["if"].call(e,t!=null?t.hideSignIn:t,{name:"if",hash:{},fn:n.program(5,u,0),inverse:n.program(7,u,0),data:u}))!=null?f:"")+"\r\n    <\/div>\r\n<\/div>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.UserEmailPartialLoading=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="form-group">\r\n    <label for="user-email">Email Address<\/label>\r\n    <p class="info-text">Notifications from ClickView will be sent to the below email address.<\/p>\r\n    <div class="partial-loading-item email-partial"><\/div>\r\n    <div class="partial-loading-item buttons-partial"><\/div>\r\n<\/div>\r\n<span class="note">Note: Updating this email address will not change how you sign in to ClickView.<\/span>\r\n'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.UserSettingBanner=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div id="email-banner-viewpart">\r\n    <div class="info">\r\n        We\'ve noticed that your profile is incomplete. To improve your experience using ClickView, please go to the settings page to complete your profile.\r\n    <\/div>\r\n    <div class="actions">\r\n        <span class="dismiss">Not right now<\/span>\r\n        <a href="/settings/account" class="btn complete-profile">Complete profile<\/a>\r\n    <\/div>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.VideoActionGroup=Handlebars.template({"1":function(n,t,i,r,u){var f;return'<div class="group-title">'+n.escapeExpression((f=(f=i.name||(t!=null?t.name:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"name",hash:{},data:u}):f))+"<\/div>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.name:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:""},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.VideoActionsDropdownList=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<span class="dropdown-toggle btn grey video-action-button root dropdown-link" data-toggle="dropdown">Options<\/span>\r\n<ul class="dropdown-menu ddl-actions dropdown-menu-right root"><\/ul>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.VideoActionsList=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="buttons-viewpart"><\/div>\r\n<div class="dropdown-viewpart"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.VideoListItem=Handlebars.template({"1":function(){return'<div class="tile-item-inner">\r\n'},"3":function(){return" restricted"},"5":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return"        <a "+((f=i["if"].call(e,t!=null?t.actionUrl:t,{name:"if",hash:{},fn:n.program(6,u,0),inverse:n.noop,data:u}))!=null?f:"")+' class="video-link'+((f=i.unless.call(e,t!=null?t.actionUrl:t,{name:"unless",hash:{},fn:n.program(8,u,0),inverse:n.noop,data:u}))!=null?f:"")+'">\r\n'+((f=i["if"].call(e,t!=null?t.actionUrl:t,{name:"if",hash:{},fn:n.program(10,u,0),inverse:n.noop,data:u}))!=null?f:"")+'            <img alt="" title="'+n.escapeExpression(n.lambda((f=t!=null?t.video:t)!=null?f.title:f,t))+'" '+((f=i["if"].call(e,t!=null?t.thumbUrl:t,{name:"if",hash:{},fn:n.program(12,u,0),inverse:n.noop,data:u}))!=null?f:"")+" />\r\n"+((f=i["if"].call(e,(f=t!=null?t.video:t)!=null?f.duration:f,{name:"if",hash:{},fn:n.program(17,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,t!=null?t.badge:t,{name:"if",hash:{},fn:n.program(19,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,t!=null?t.isProducedByClickView:t,{name:"if",hash:{},fn:n.program(21,u,0),inverse:n.noop,data:u}))!=null?f:"")+"        <\/a>\r\n"},"6":function(n,t,i,r,u){var f;return' href="'+n.escapeExpression((f=(f=i.actionUrl||(t!=null?t.actionUrl:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"actionUrl",hash:{},data:u}):f))+'" '},"8":function(){return" not-clickable"},"10":function(){return'            <div class="play-btn-mask"><\/div>\r\n            <div class="play-icon-video">\r\n                <svg class="play-icon">\r\n                    <use xlink:href="#play"><\/use>\r\n                <\/svg>\r\n            <\/div>\r\n'},"12":function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{};return" "+((e=i["if"].call(o,t!=null?t.lazyload:t,{name:"if",hash:{},fn:n.program(13,u,0),inverse:n.program(15,u,0),data:u}))!=null?e:"")+'="'+n.escapeExpression((f=(f=i.thumbUrl||(t!=null?t.thumbUrl:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(o,{name:"thumbUrl",hash:{},data:u}):f))+'" '},"13":function(){return'class="lazy" data-original'},"15":function(){return"src"},"17":function(n,t,i,r,u){var f;return'            <span class="duration">'+n.escapeExpression((i.duration||t&&t.duration||i.helperMissing).call(t!=null?t:n.nullContext||{},(f=t!=null?t.video:t)!=null?f.duration:f,{name:"duration",hash:{},data:u}))+"<\/span>\r\n"},"19":function(n,t,i,r,u){var f;return'            <span class="badge">'+n.escapeExpression((f=(f=i.badge||(t!=null?t.badge:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"badge",hash:{},data:u}):f))+"<\/span>\r\n"},"21":function(){return'            <div class="cv-content-badge">\r\n                <span class="content-badge" title="This video is produced by ClickView"><\/span>\r\n            <\/div>\r\n'},"23":function(){return'        <div class="restricted-thumbnail-container"><\/div>\r\n'},"25":function(n,t,i,r,u){var f,o,e=t!=null?t:n.nullContext||{},s=i.helperMissing;return'        <div class="cv-header">\r\n'+((f=i.unless.call(e,(f=t!=null?t.options:t)!=null?f.pinned:f,{name:"unless",hash:{},fn:n.program(26,u,0),inverse:n.noop,data:u}))!=null?f:"")+'            <h3 class="cv-title'+((f=i["if"].call(e,(f=t!=null?t.video:t)!=null?f.isRestricted:f,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i.unless.call(e,t!=null?t.actionUrl:t,{name:"unless",hash:{},fn:n.program(8,u,0),inverse:n.noop,data:u}))!=null?f:"")+'" title="'+n.escapeExpression(n.lambda((f=t!=null?t.video:t)!=null?f.title:f,t))+'">\r\n                '+((f=i["if"].call(e,t!=null?t.actionUrl:t,{name:"if",hash:{},fn:n.program(29,u,0),inverse:n.noop,data:u}))!=null?f:"")+"                    "+((f=(o=(o=i.title||(t!=null?t.title:t))!=null?o:s,typeof o=="function"?o.call(e,{name:"title",hash:{},data:u}):o))!=null?f:"")+"\r\n"+((f=i["if"].call(e,t!=null?t.actionUrl:t,{name:"if",hash:{},fn:n.program(31,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n            <\/h3>\r\n"+((f=i["if"].call(e,t!=null?t.origin:t,{name:"if",hash:{},fn:n.program(33,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i.unless.call(e,t!=null?t.origin:t,{name:"unless",hash:{},fn:n.program(35,u,0),inverse:n.noop,data:u}))!=null?f:"")+'                <span class="restricted-badge-container"><\/span>\r\n            <div class="cv-series">\r\n                <span>'+((f=(i.seriesFilter||t&&t.seriesFilter||s).call(e,(f=t!=null?t.video:t)!=null?f.series:f,{name:"seriesFilter",hash:{divider:"header"},data:u}))!=null?f:"")+"<\/span>\r\n"+((f=i["if"].call(e,(f=t!=null?t.options:t)!=null?f.showCategory:f,{name:"if",hash:{},fn:n.program(38,u,0),inverse:n.noop,data:u}))!=null?f:"")+"            <\/div>            \r\n        <\/div>\r\n"+((f=i["if"].call(e,t!=null?t.hasContributor:t,{name:"if",hash:{},fn:n.program(47,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,t!=null?t.showDate:t,{name:"if",hash:{},fn:n.program(49,u,0),inverse:n.noop,data:u}))!=null?f:"")+'\r\n        <p class="cv-metadata">\r\n'+((f=i["if"].call(e,(f=t!=null?t.video:t)!=null?f.fileSize:f,{name:"if",hash:{},fn:n.program(52,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,(f=t!=null?t.video:t)!=null?f.rating:f,{name:"if",hash:{},fn:n.program(54,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,(f=t!=null?t.options:t)!=null?f.showChannel:f,{name:"if",hash:{},fn:n.program(59,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,(f=t!=null?t.options:t)!=null?f.showYear:f,{name:"if",hash:{},fn:n.program(63,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,(f=t!=null?t.video:t)!=null?f.hasInteractives:f,{name:"if",hash:{},fn:n.program(66,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,t!=null?t.existsInLocalCache:t,{name:"if",hash:{},fn:n.program(68,u,0),inverse:n.noop,data:u}))!=null?f:"")+"        <\/p>\r\n"+((f=i["if"].call(e,(f=t!=null?t.video:t)!=null?f.hasRestriction:f,{name:"if",hash:{},fn:n.program(70,u,0),inverse:n.noop,data:u}))!=null?f:"")},"26":function(n,t,i,r,u){var f;return(f=i.unless.call(t!=null?t:n.nullContext||{},(f=t!=null?t.video:t)!=null?f.isRestricted:f,{name:"unless",hash:{},fn:n.program(27,u,0),inverse:n.noop,data:u}))!=null?f:""},"27":function(){return'            <div class="video-actions-container"><\/div>\r\n'},"29":function(n,t,i,r,u){var f;return'<a href="'+n.escapeExpression((f=(f=i.actionUrl||(t!=null?t.actionUrl:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"actionUrl",hash:{},data:u}):f))+'"  class="video-link">\r\n'},"31":function(){return"                <\/a>"},"33":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'                <span class="metadata-badge origin '+h((f=(f=i.origin||(t!=null?t.origin:t))!=null?f:o,typeof f===s?f.call(e,{name:"origin",hash:{},data:u}):f))+'" title="'+h((f=(f=i.badgeTitle||(t!=null?t.badgeTitle:t))!=null?f:o,typeof f===s?f.call(e,{name:"badgeTitle",hash:{},data:u}):f))+'">'+h((f=(f=i.origin||(t!=null?t.origin:t))!=null?f:o,typeof f===s?f.call(e,{name:"origin",hash:{},data:u}):f))+"<\/span>\r\n"},"35":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.isNew:t,{name:"if",hash:{},fn:n.program(36,u,0),inverse:n.noop,data:u}))!=null?f:""},"36":function(){return'                <span class="metadata-badge new" title="new">NEW<\/span>\r\n'},"38":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},(f=t!=null?t.video:t)!=null?f.category:f,{name:"if",hash:{},fn:n.program(39,u,0),inverse:n.noop,data:u}))!=null?f:""},"39":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},(f=(f=t!=null?t.video:t)!=null?f.category:f)!=null?f.name:f,{name:"if",hash:{},fn:n.program(40,u,0),inverse:n.noop,data:u}))!=null?f:""},"40":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return"                            "+((f=i["if"].call(e,(f=(f=t!=null?t.video:t)!=null?f.series:f)!=null?f.name:f,{name:"if",hash:{},fn:n.program(41,u,0),inverse:n.noop,data:u}))!=null?f:"")+' <span>\r\n                                <span class="cv-title-header">Category: <\/span>\r\n                                '+((f=i["if"].call(e,t!=null?t.categoryUrl:t,{name:"if",hash:{},fn:n.program(43,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=n.lambda((f=(f=t!=null?t.video:t)!=null?f.category:f)!=null?f.name:f,t))!=null?f:"")+((f=i["if"].call(e,t!=null?t.categoryUrl:t,{name:"if",hash:{},fn:n.program(45,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n                            <\/span>\r\n"},"41":function(){return"|"},"43":function(n,t,i,r,u){var f;return'<a class="category-link" href="'+n.escapeExpression((f=(f=i.categoryUrl||(t!=null?t.categoryUrl:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"categoryUrl",hash:{},data:u}):f))+'">'},"45":function(){return"<\/a>"},"47":function(){return'        <p class="cv-metadata contributor-info"><\/p>\r\n        <span class="cv-metadata">&bull;<\/span>\r\n        '},"49":function(n,t,i,r,u){var f;return(f=(i.isValid||t&&t.isValid||i.helperMissing).call(t!=null?t:n.nullContext||{},"date",(f=t!=null?t.video:t)!=null?f.dateCreated:f,{name:"isValid",hash:{},fn:n.program(50,u,0),inverse:n.noop,data:u}))!=null?f:""},"50":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<time class="timeago" datetime="'+h((f=(f=i.localTime||(t!=null?t.localTime:t))!=null?f:o,typeof f===s?f.call(e,{name:"localTime",hash:{},data:u}):f))+'">'+h((f=(f=i.localTime||(t!=null?t.localTime:t))!=null?f:o,typeof f===s?f.call(e,{name:"localTime",hash:{},data:u}):f))+"<\/time>"},"52":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s=n.escapeExpression;return'            <span class="metadata-badge" title="File size: '+s((i.fileSize||t&&t.fileSize||o).call(e,(f=t!=null?t.video:t)!=null?f.fileSize:f,1,{name:"fileSize",hash:{},data:u}))+'">'+s((i.fileSize||t&&t.fileSize||o).call(e,(f=t!=null?t.video:t)!=null?f.fileSize:f,1,{name:"fileSize",hash:{},data:u}))+"<\/span>\r\n"},"54":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},(f=(f=t!=null?t.video:t)!=null?f.rating:f)!=null?f.code:f,{name:"if",hash:{},fn:n.program(55,u,0),inverse:n.program(57,u,0),data:u}))!=null?f:""},"55":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s=n.escapeExpression;return'            <span class="metadata-badge" title="Rated: '+s((i.toUpper||t&&t.toUpper||o).call(e,(f=(f=t!=null?t.video:t)!=null?f.rating:f)!=null?f.code:f,{name:"toUpper",hash:{},data:u}))+'">'+s((i.toUpper||t&&t.toUpper||o).call(e,(f=(f=t!=null?t.video:t)!=null?f.rating:f)!=null?f.code:f,{name:"toUpper",hash:{},data:u}))+"<\/span>\r\n"},"57":function(){return'            <span class="metadata-badge" title="Rated: UNRATED">UNRATED<\/span>\r\n'},"59":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},(f=t!=null?t.video:t)!=null?f.channel:f,{name:"if",hash:{},fn:n.program(60,u,0),inverse:n.noop,data:u}))!=null?f:""},"60":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},(f=(f=t!=null?t.video:t)!=null?f.channel:f)!=null?f.name:f,{name:"if",hash:{},fn:n.program(61,u,0),inverse:n.noop,data:u}))!=null?f:""},"61":function(n,t){var i,r=n.lambda,u=n.escapeExpression;return'            <span class="metadata-badge" title="'+u(r((i=(i=t!=null?t.video:t)!=null?i.channel:i)!=null?i.name:i,t))+'">'+u(r((i=(i=t!=null?t.video:t)!=null?i.channel:i)!=null?i.name:i,t))+"<\/span>\r\n"},"63":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},(f=t!=null?t.video:t)!=null?f.year:f,{name:"if",hash:{},fn:n.program(64,u,0),inverse:n.noop,data:u}))!=null?f:""},"64":function(n,t){var i,r=n.lambda,u=n.escapeExpression;return'            <span class="metadata-badge" title="Year: '+u(r((i=t!=null?t.video:t)!=null?i.year:i,t))+'">'+u(r((i=t!=null?t.video:t)!=null?i.year:i,t))+"<\/span>\r\n"},"66":function(){return'            <span class="metadata-badge orange has-interactives" title="Interactive videos are available for this programme.">Interactive<\/span>\r\n'},"68":function(){return'            <span class="metadata-badge saved-to-cache">\r\n                <span class="text">Available in Local Cache<\/span>\r\n            <\/span>\r\n'},"70":function(){return'        <span class="restriction-info-container"><\/span>\r\n'},"72":function(){return'        <div class="cv-header restricted-content-mask"><\/div>\r\n        <div class="cv-metadata restricted-content-mask"><\/div>\r\n'},"74":function(){return"highlighted"},"76":function(){return'        <div class="tag-container">\r\n            <div class="tags-viewpart"><\/div>\r\n        <\/div>\r\n'},"78":function(n,t,i,r,u){var f;return'    <div class="video-preview-pane">\r\n        <div class="cv-video-footer">\r\n            <div class="preview-video-container">\r\n'+((f=i["if"].call(t!=null?t:n.nullContext||{},(f=t!=null?t.options:t)!=null?f.showPreview:f,{name:"if",hash:{},fn:n.program(79,u,0),inverse:n.noop,data:u}))!=null?f:"")+'            <\/div>\r\n            <div class="preview-pane"><\/div>\r\n        <\/div>\r\n    <\/div>\r\n'},"79":function(){return'                <div class="preview-video"><\/div>\r\n'},"81":function(){return'    <div class="video-actions-container"><\/div>\r\n'},"83":function(){return"<\/div>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,o,e=t!=null?t:n.nullContext||{};return((f=i["if"].call(e,(f=t!=null?t.options:t)!=null?f.isotope:f,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+'    <div class="checkbox-viewpart"><\/div>\r\n    <div class="cv-thumbnail'+((f=i["if"].call(e,(f=t!=null?t.video:t)!=null?f.isRestricted:f,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:"")+'">\r\n        <div class="item-number-viewpart"><\/div>\r\n'+((f=i.unless.call(e,(f=t!=null?t.video:t)!=null?f.isRestricted:f,{name:"unless",hash:{},fn:n.program(5,u,0),inverse:n.program(23,u,0),data:u}))!=null?f:"")+'    <\/div>\r\n    <div class="info cv-video-content">\r\n'+((f=i.unless.call(e,(f=t!=null?t.video:t)!=null?f.isRestrictedFromStudent:f,{name:"unless",hash:{},fn:n.program(25,u,0),inverse:n.program(72,u,0),data:u}))!=null?f:"")+'        <div class="cv-description-wrapper truncated '+((f=i["if"].call(e,t!=null?t.hasKeywords:t,{name:"if",hash:{},fn:n.program(74,u,0),inverse:n.noop,data:u}))!=null?f:"")+'">\r\n            <p  class="cv-description"><!--\r\n                -->'+((f=(o=(o=i.description||(t!=null?t.description:t))!=null?o:i.helperMissing,typeof o=="function"?o.call(e,{name:"description",hash:{},data:u}):o))!=null?f:"")+'<!--\r\n            --><\/p>\r\n            <a class="show-more" style="display: none;">... Show more<\/a>\r\n        <\/div>\r\n'+((f=i["if"].call(e,(f=t!=null?t.options:t)!=null?f.tags:f,{name:"if",hash:{},fn:n.program(76,u,0),inverse:n.noop,data:u}))!=null?f:"")+"    <\/div>\r\n"+((f=i.unless.call(e,(f=t!=null?t.video:t)!=null?f.isRestricted:f,{name:"unless",hash:{},fn:n.program(78,u,0),inverse:n.noop,data:u}))!=null?f:"")+'    <div class="placeholder"><\/div>\r\n'+((f=i["if"].call(e,(f=t!=null?t.options:t)!=null?f.pinned:f,{name:"if",hash:{},fn:n.program(81,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,(f=t!=null?t.options:t)!=null?f.isotope:f,{name:"if",hash:{},fn:n.program(83,u,0),inverse:n.noop,data:u}))!=null?f:"")},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.WebPlayer=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<iframe id="'+h((f=(f=i.id||(t!=null?t.id:t))!=null?f:o,typeof f===s?f.call(e,{name:"id",hash:{},data:u}):f))+'" allowfullscreen="" webkitallowfullscreen="" mozallowfullscreen="" frameborder="0" width="'+h((f=(f=i.width||(t!=null?t.width:t))!=null?f:o,typeof f===s?f.call(e,{name:"width",hash:{},data:u}):f))+'" height="'+h((f=(f=i.height||(t!=null?t.height:t))!=null?f:o,typeof f===s?f.call(e,{name:"height",hash:{},data:u}):f))+'" src="'+h((f=(f=i.url||(t!=null?t.url:t))!=null?f:o,typeof f===s?f.call(e,{name:"url",hash:{},data:u}):f))+'"><\/iframe>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.WysiHtml=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<div class="form-row">\r\n    <div id="text-editor-toolbar" style="display: none;">\r\n        <div class="row toolbar-row">\r\n            <span data-toggle="tooltip" data-placement="top" title="Bold" data-wysihtml5-command="bold">\r\n                <svg>\r\n                    <use xlink:href="#bold"><\/use>\r\n                <\/svg>\r\n            <\/span>\r\n\r\n            <span data-toggle="tooltip" data-placement="top" title="Italic" data-wysihtml5-command="italic">\r\n                <svg>\r\n                    <use xlink:href="#italic"><\/use>\r\n                <\/svg>\r\n            <\/span>\r\n\r\n            <span data-toggle="tooltip" data-placement="top" title="Underline" data-wysihtml5-command="underline">\r\n                <svg>\r\n                    <use xlink:href="#underline"><\/use>\r\n                <\/svg>\r\n            <\/span>\r\n\r\n            <span data-toggle="tooltip" data-placement="top" title="Unordered list" data-wysihtml5-command="insertUnorderedList">\r\n                <svg>\r\n                    <use xlink:href="#bullet-list"><\/use>\r\n                <\/svg>\r\n            <\/span>\r\n\r\n            <span data-toggle="tooltip" data-placement="top" title="Ordered list" data-wysihtml5-command="insertOrderedList">\r\n                <svg>\r\n                    <use xlink:href="#number-list"><\/use>\r\n                <\/svg>\r\n            <\/span>\r\n\r\n            <span data-toggle="tooltip" data-placement="top" title="Subscript" data-wysihtml5-command="subscript">\r\n                <svg>\r\n                    <use xlink:href="#subscript"><\/use>\r\n                <\/svg>\r\n            <\/span>\r\n\r\n            <span data-toggle="tooltip" data-placement="top" title="Superscript" data-wysihtml5-command="superscript">\r\n                <svg>\r\n                    <use xlink:href="#superscript"><\/use>\r\n                <\/svg>\r\n            <\/span>\r\n\r\n            <span data-toggle="tooltip" data-placement="top" title="Create link" data-wysihtml5-command="createLink" class="create-link-button">\r\n                <svg>\r\n                    <use xlink:href="#link"><\/use>\r\n                <\/svg>\r\n            <\/span>\r\n\r\n            <div data-wysihtml5-dialog="createLink" class="create-link hidden popover top">\r\n                <div class="arrow"><\/div>\r\n                <label for="href">Enter URL<\/label>\r\n                <input data-wysihtml5-dialog-field="href" value="http://" class="linkInput" name="href">\r\n                <a data-wysihtml5-dialog-action="save" class="btn saveLink">Add<\/a>\r\n                <a data-wysihtml5-command="removeLink" class="btn removeLink">Remove<\/a>\r\n            <\/div>\r\n        <\/div>\r\n\r\n    <\/div>\r\n    <div class="form-group">\r\n        <div id="text-editor" class="text" contenteditable="true" tabindex="0" data-placeholder="'+h((f=(f=i.placeholder||(t!=null?t.placeholder:t))!=null?f:o,typeof f===s?f.call(e,{name:"placeholder",hash:{},data:u}):f))+'" name="'+h((f=(f=i.name||(t!=null?t.name:t))!=null?f:o,typeof f===s?f.call(e,{name:"name",hash:{},data:u}):f))+'">\r\n        <\/div>\r\n        <span class="help-block hidden"><\/span>\r\n    <\/div>\r\n<\/div>\r\n'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates._MasterRelatedVideoItem=Handlebars.template({"1":function(n,t,i,r,u){var f;return'<div class="metadata-badge">'+n.escapeExpression((f=(f=i.rating||(t!=null?t.rating:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"rating",hash:{},data:u}):f))+"<\/div>"},"3":function(n,t){var i;return'<div class="metadata-badge">'+n.escapeExpression(n.lambda((i=t!=null?t.channel:t)!=null?i.name:i,t))+"<\/div>"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{},s=i.helperMissing,c="function",h=n.escapeExpression;return'<div class="tile-item-inner">\r\n    <div class="cv-thumbnail">\r\n        <a href="'+h((f=(f=i.actionUrl||(t!=null?t.actionUrl:t))!=null?f:s,typeof f===c?f.call(o,{name:"actionUrl",hash:{},data:u}):f))+'">\r\n            <div class="play-btn-mask"><\/div>\r\n            <div class="play-icon-video">\r\n                <svg class="play-icon">\r\n                    <use xlink:href="#play"><\/use>\r\n                <\/svg>\r\n            <\/div>\r\n            <img src="'+h((i.stripProtocol||t&&t.stripProtocol||s).call(o,(e=t!=null?t.thumbnail:t)!=null?e.url:e,{name:"stripProtocol",hash:{},data:u}))+'" alt="" />\r\n        <\/a>\r\n    <\/div>\r\n    <div class="info">\r\n        <div class="cv-header">\r\n            <h3 class="cv-title" title="'+h((f=(f=i.name||(t!=null?t.name:t))!=null?f:s,typeof f===c?f.call(o,{name:"name",hash:{},data:u}):f))+'">\r\n                <a href="'+h((f=(f=i.actionUrl||(t!=null?t.actionUrl:t))!=null?f:s,typeof f===c?f.call(o,{name:"actionUrl",hash:{},data:u}):f))+'">\r\n                    '+h((f=(f=i.name||(t!=null?t.name:t))!=null?f:s,typeof f===c?f.call(o,{name:"name",hash:{},data:u}):f))+'\r\n                <\/a>\r\n            <\/h3>\r\n        <\/div>\r\n        <div class="cv-metadata">\r\n            '+((e=i["if"].call(o,t!=null?t.rating:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?e:"")+"\r\n            "+((e=i["if"].call(o,(e=t!=null?t.channel:t)!=null?e.name:e,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?e:"")+"\r\n        <\/div>\r\n    <\/div>\r\n<\/div>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.ClipBar=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<div class="clip-bar-indicator" style="width:'+h((f=(f=i.width||(t!=null?t.width:t))!=null?f:o,typeof f===s?f.call(e,{name:"width",hash:{},data:u}):f))+"%; left:"+h((f=(f=i.left||(t!=null?t.left:t))!=null?f:o,typeof f===s?f.call(e,{name:"left",hash:{},data:u}):f))+'%;"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.ClippingTool=Handlebars.template({"1":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return'<div class="clipping-tool-row row">\r\n'+((f=i["if"].call(e,t!=null?t.renderInPopup:t,{name:"if",hash:{},fn:n.program(2,u,0),inverse:n.program(4,u,0),data:u}))!=null?f:"")+'\r\n    <form class="create-new-clip-form">\r\n    <div class="form-group title-form">\r\n        <label for="title">Clip Title<span class="required">*<\/span><\/label>\r\n        <input type="text" class="form-control name" name="name" placeholder="Choose a meaningful title for your clip" />\r\n        '+((f=i["if"].call(e,t!=null?t.renderInPopup:t,{name:"if",hash:{},fn:n.program(6,u,0),inverse:n.noop,data:u}))!=null?f:"")+'\r\n    <\/div>\r\n    <div class="form-group start-time-form">\r\n        <label for="startTime">Start at<span class="required">*<\/span><\/label>\r\n        <input type="text" class="form-control startTime" name="startTime" data-seconds="" placeholder="HH:MM:SS" />\r\n        '+((f=i["if"].call(e,t!=null?t.renderInPopup:t,{name:"if",hash:{},fn:n.program(6,u,0),inverse:n.noop,data:u}))!=null?f:"")+'\r\n    <\/div>\r\n    <div class="form-group end-time-form pull-right">\r\n        <label for="endTime">End at<span class="required">*<\/span><\/label>\r\n        <input type="text" class="form-control endTime" name="endTime" data-seconds="" placeholder="HH:MM:SS" />\r\n        '+((f=i["if"].call(e,t!=null?t.renderInPopup:t,{name:"if",hash:{},fn:n.program(6,u,0),inverse:n.noop,data:u}))!=null?f:"")+'\r\n    <\/div>\r\n    <div class="form-group description-form">\r\n        <label for="description">Clip Description<\/label>\r\n        <textarea placeholder="Please describe the content of this video in one or two sentences, try to be as clear and concise as possible" name="description"><\/textarea>\r\n    <\/div>\r\n'+((f=i.unless.call(e,t!=null?t.renderInPopup:t,{name:"unless",hash:{},fn:n.program(8,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,t!=null?t.renderInPopup:t,{name:"if",hash:{},fn:n.program(10,u,0),inverse:n.noop,data:u}))!=null?f:"")},"2":function(){return'<div class="create-clip-popup">'},"4":function(){return'<div class="col-sm-8">'},"6":function(){return'<div class="error-message"><span class="help-block hidden"><\/span><\/div>'},"8":function(){return'    <div class="clipping-buttons">\r\n        <button class="btn orange create-clip">Create a clip<\/button>\r\n        <button class="btn grey cancel-button">Cancel<\/button>\r\n    <\/div>\r\n    <div class="info-text">* Clips are private until you share them with others<\/div>\r\n    <\/form>\r\n<\/div>\r\n<div class="col-sm-4">\r\n    <ul class="error-messages">\r\n        <li class="help-block error-name error-message hidden"><\/li>\r\n        <li class="help-block error-startTime error-message hidden"><\/li>\r\n        <li class="help-block error-endTime error-message hidden"><\/li>\r\n        <li class="help-block error-description error-message hidden"><\/li>\r\n    <\/ul>\r\n<\/div>\r\n<\/div>\r\n'},"10":function(){return'<div class="info-text">* Clips are private until you share them with others<\/div>\r\n<\/form>\r\n<div class="popup-button-container-fake">\r\n    <a class="btn orange create-clip">Create a clip<\/a>\r\n    <a id="cancel-button" class="btn grey">Close<\/a>\r\n<\/div>\r\n'},"12":function(){return'<button class="btn orange add-new-clip create-button">\r\n    <svg class="plus-icon">\r\n        <use xlink:href="#plus"><\/use>\r\n    <\/svg>\r\n    <div class="button-text">Create a clip<\/div>\r\n<\/button>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.isCreatingClip:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(12,u,0),data:u}))!=null?f:""},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.ClipsItem=Handlebars.template({"1":function(){return'<div class="tile-item-inner">\r\n'},"3":function(n,t,i,r,u){var f;return' href="'+n.escapeExpression((f=(f=i.actionUrl||(t!=null?t.actionUrl:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"actionUrl",hash:{},data:u}):f))+'" '},"5":function(){return'            <div class="play-btn-mask"><\/div>\r\n            <div class="play-icon-video">\r\n                <svg class="play-icon">\r\n                    <use xlink:href="#play"><\/use>\r\n                <\/svg>\r\n            <\/div>\r\n'},"7":function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{};return" "+((e=i["if"].call(o,t!=null?t.lazyload:t,{name:"if",hash:{},fn:n.program(8,u,0),inverse:n.program(10,u,0),data:u}))!=null?e:"")+'="'+n.escapeExpression((f=(f=i.thumbUrl||(t!=null?t.thumbUrl:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(o,{name:"thumbUrl",hash:{},data:u}):f))+'" '},"8":function(){return" data-original"},"10":function(){return"src"},"12":function(n,t,i,r,u){var f;return'<a href="'+n.escapeExpression((f=(f=i.actionUrl||(t!=null?t.actionUrl:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"actionUrl",hash:{},data:u}):f))+'">'},"14":function(){return"<\/a>"},"16":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'                <span class="metadata-badge origin '+h((f=(f=i.origin||(t!=null?t.origin:t))!=null?f:o,typeof f===s?f.call(e,{name:"origin",hash:{},data:u}):f))+'" title="'+h((f=(f=i.badgeTitle||(t!=null?t.badgeTitle:t))!=null?f:o,typeof f===s?f.call(e,{name:"badgeTitle",hash:{},data:u}):f))+'">'+h((f=(f=i.origin||(t!=null?t.origin:t))!=null?f:o,typeof f===s?f.call(e,{name:"origin",hash:{},data:u}):f))+"<\/span>\r\n"},"18":function(n,t,i,r,u){var f;return(f=(i.isValid||t&&t.isValid||i.helperMissing).call(t!=null?t:n.nullContext||{},"date",t!=null?t.dateCreated:t,{name:"isValid",hash:{},fn:n.program(19,u,0),inverse:n.noop,data:u}))!=null?f:""},"19":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.showDate:t,{name:"if",hash:{},fn:n.program(20,u,0),inverse:n.noop,data:u}))!=null?f:""},"20":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'        <time class="timeago" datetime="'+h((f=(f=i.localTime||(t!=null?t.localTime:t))!=null?f:o,typeof f===s?f.call(e,{name:"localTime",hash:{},data:u}):f))+'">'+h((f=(f=i.localTime||(t!=null?t.localTime:t))!=null?f:o,typeof f===s?f.call(e,{name:"localTime",hash:{},data:u}):f))+"<\/time>\r\n"},"22":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},(f=t!=null?t.rating:t)!=null?f.code:f,{name:"if",hash:{},fn:n.program(23,u,0),inverse:n.program(25,u,0),data:u}))!=null?f:""},"23":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s=n.escapeExpression;return'            <span class="metadata-badge" title="Rated: '+s((i.toUpper||t&&t.toUpper||o).call(e,(f=t!=null?t.rating:t)!=null?f.code:f,{name:"toUpper",hash:{},data:u}))+'">'+s((i.toUpper||t&&t.toUpper||o).call(e,(f=t!=null?t.rating:t)!=null?f.code:f,{name:"toUpper",hash:{},data:u}))+"<\/span>\r\n"},"25":function(){return'            <span class="metadata-badge" title="Rated: UNRATED">UNRATED<\/span>\r\n'},"27":function(){return"<\/div>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e,o=t!=null?t:n.nullContext||{},s=i.helperMissing,h="function",c=n.escapeExpression;return((f=i["if"].call(o,(f=t!=null?t.options:t)!=null?f.isotope:f,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+'    <div class="checkbox-viewpart"><\/div>\r\n    <div class="cv-thumbnail">\r\n        <div class="item-number-viewpart"><\/div>\r\n        <a '+((f=i["if"].call(o,t!=null?t.actionUrl:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:"")+">\r\n"+((f=i["if"].call(o,t!=null?t.actionUrl:t,{name:"if",hash:{},fn:n.program(5,u,0),inverse:n.noop,data:u}))!=null?f:"")+'            <img alt="" title="'+c((e=(e=i.name||(t!=null?t.name:t))!=null?e:s,typeof e===h?e.call(o,{name:"name",hash:{},data:u}):e))+'" '+((f=i["if"].call(o,t!=null?t.thumbUrl:t,{name:"if",hash:{},fn:n.program(7,u,0),inverse:n.noop,data:u}))!=null?f:"")+'/>\r\n            <span class="duration">'+c((i.duration||t&&t.duration||s).call(o,t!=null?t.duration:t,{name:"duration",hash:{},data:u}))+'<\/span>\r\n        <\/a>\r\n    <\/div>\r\n    <div class="info cv-video-content">\r\n        <div class="video-actions-container"><\/div>\r\n        <div class="cv-header">\r\n            <h3 class="cv-title" title="'+c((e=(e=i.name||(t!=null?t.name:t))!=null?e:s,typeof e===h?e.call(o,{name:"name",hash:{},data:u}):e))+'">\r\n                '+((f=i["if"].call(o,t!=null?t.actionUrl:t,{name:"if",hash:{},fn:n.program(12,u,0),inverse:n.noop,data:u}))!=null?f:"")+c((e=(e=i.name||(t!=null?t.name:t))!=null?e:s,typeof e===h?e.call(o,{name:"name",hash:{},data:u}):e))+((f=i["if"].call(o,t!=null?t.actionUrl:t,{name:"if",hash:{},fn:n.program(14,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n"+((f=i["if"].call(o,t!=null?t.origin:t,{name:"if",hash:{},fn:n.program(16,u,0),inverse:n.noop,data:u}))!=null?f:"")+"            <\/h3>\r\n        <\/div>\r\n"+((f=i["if"].call(o,t!=null?t.showMetadata:t,{name:"if",hash:{},fn:n.program(18,u,0),inverse:n.noop,data:u}))!=null?f:"")+'        <p class="cv-metadata">\r\n'+((f=i["if"].call(o,t!=null?t.rating:t,{name:"if",hash:{},fn:n.program(22,u,0),inverse:n.noop,data:u}))!=null?f:"")+'        <\/p>\r\n        <div class="cv-description-wrapper truncated">\r\n            <p  class="cv-description"><!--\r\n                -->'+((f=(e=(e=i.description||(t!=null?t.description:t))!=null?e:s,typeof e===h?e.call(o,{name:"description",hash:{},data:u}):e))!=null?f:"")+'<!--\r\n            --><\/p>\r\n            <a class="show-more" style="display: none;">... Show more<\/a>\r\n        <\/div>\r\n        <div class="clip-bar-viewpart"><\/div>\r\n    <\/div>\r\n\r\n'+((f=i["if"].call(o,(f=t!=null?t.options:t)!=null?f.isotope:f,{name:"if",hash:{},fn:n.program(27,u,0),inverse:n.noop,data:u}))!=null?f:"")},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.ClipsTab=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="clipping-tool-viewpart"><\/div>\r\n<div class="clip-list-viewpart"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.CreateClip=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="web-player-viewpart"><\/div>\r\n<div class="clipping-tool-viewpart"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.EditClip=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="row">\r\n<div class="edit-clip-popup">\r\n    <form class="edit-clip-form">\r\n    <div class="form-group title-form">\r\n        <label for="title">Clip Title<span class="required">*<\/span><\/label>\r\n        <input type="text" class="form-control name" name="name" placeholder="Choose a meaningful title for your clip" />\r\n        <div class="error-message"><span class="help-block hidden"><\/span><\/div>\r\n    <\/div>\r\n    <div class="form-group description-form">\r\n        <label for="description">Clip Description<\/label>\r\n        <textarea placeholder="Please describe the content of this clip in one or two sentences, try to be as clear and concise as possible" name="description"><\/textarea>\r\n    <\/div>\r\n    <\/form>\r\n    <div class="popup-button-container-fake">\r\n        <a class="btn orange update-clip">Save Changes<\/a>\r\n        <a class="btn grey cancel-button">Cancel<\/a>\r\n    <\/div>\r\n<\/div>\r\n<\/div>\r\n'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.EmptyClips=Handlebars.template({"1":function(){return"        You don't have any clips for this video yet.\r\n"},"3":function(){return"        You don't have any clips yet.\r\n"},"5":function(){return"                <strong>1.<\/strong> Select <strong>Create a new clip<\/strong> button above\r\n"},"7":function(){return"                <strong>1.<\/strong> Select <strong>Create a new clip<\/strong> on video's action\r\n                dropdown or select the <strong>Clips<\/strong> tab under any video.\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return'<div class="empty-clip">\r\n    <div class="title text">\r\n'+((f=i["if"].call(e,t!=null?t.renderInClipsTab:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(3,u,0),data:u}))!=null?f:"")+'    <\/div>\r\n    <div class="description text">\r\n        Clips are great way to capture relevant content from a full-length video to share with your students\r\n    <\/div>\r\n    <div class="row images-box">\r\n        <div class="col-sm-4">\r\n            <img class="img-responsive" src="/Assets/images/workspace/empty-clip-graphic-clip.png">\r\n            <p class="caption">\r\n'+((f=i["if"].call(e,t!=null?t.renderInClipsTab:t,{name:"if",hash:{},fn:n.program(5,u,0),inverse:n.program(7,u,0),data:u}))!=null?f:"")+'            <\/p>\r\n        <\/div>\r\n        <div class="col-sm-4">\r\n            <img class="img-responsive" src="/Assets/images/workspace/empty-clip-graphic-start-end-time.png">\r\n            <p class="caption">\r\n                <strong>2.<\/strong> Specify a <strong>start<\/strong> and <strong>end<\/strong> time.\r\n            <\/p>\r\n        <\/div>\r\n        <div class="col-sm-4">\r\n            <img class="img-responsive" src="/Assets/images/workspace/empty-clip-graphic-folder.png">\r\n            <p class="caption">\r\n                <strong>3.<\/strong> Click <strong>Create a clip<\/strong>. Your clip will automatically saved\r\n                in Clips folder in your <strong>Workspace<\/strong> ready to share with your students.\r\n            <\/p>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.ShareClipPopup=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="titlebar-container">\r\n    <div class="cv-titlebar">\r\n        <div class="create-clip-success-title">\r\n            <h2>You\'ve created a Clip<\/h2>\r\n            <a class="close">×<\/a>\r\n            <p>It has been saved into your Clips folder. You can share this clip using the link below.<\/p>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>\r\n<div class="popup-body-container"><\/div>\r\n<div class="popup-button-container"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.CurriculumItem=Handlebars.template({"1":function(){return" col-xs-2 "},"3":function(){return" col-xs-12 "},"5":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<div class="description col-xs-10 '+h((f=(f=i.regionCode||(t!=null?t.regionCode:t))!=null?f:o,typeof f===s?f.call(e,{name:"regionCode",hash:{},data:u}):f))+'">'+h((f=(f=i.description||(t!=null?t.description:t))!=null?f:o,typeof f===s?f.call(e,{name:"description",hash:{},data:u}):f))+"<\/div>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{},s=i.helperMissing,h="function",c=n.escapeExpression;return'<a href="'+c((f=(f=i.albertUrl||(t!=null?t.albertUrl:t))!=null?f:s,typeof f===h?f.call(o,{name:"albertUrl",hash:{},data:u}):f))+'" class="code '+((e=i["if"].call(o,t!=null?t.hasDescription:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(3,u,0),data:u}))!=null?e:"")+c((f=(f=i.regionCode||(t!=null?t.regionCode:t))!=null?f:s,typeof f===h?f.call(o,{name:"regionCode",hash:{},data:u}):f))+" "+c((f=(f=i.learningAreaType||(t!=null?t.learningAreaType:t))!=null?f:s,typeof f===h?f.call(o,{name:"learningAreaType",hash:{},data:u}):f))+'">'+((e=(f=(f=i.name||(t!=null?t.name:t))!=null?f:s,typeof f===h?f.call(o,{name:"name",hash:{},data:u}):f))!=null?e:"")+"<\/a>\r\n"+((e=i["if"].call(o,t!=null?t.description:t,{name:"if",hash:{},fn:n.program(5,u,0),inverse:n.noop,data:u}))!=null?e:"")},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.SubStrandLearningArea=Handlebars.template({"1":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'    <a href="'+h((f=(f=i.strandUrl||(t!=null?t.strandUrl:t))!=null?f:o,typeof f===s?f.call(e,{name:"strandUrl",hash:{},data:u}):f))+'" class="strand">'+h((f=(f=i.strandName||(t!=null?t.strandName:t))!=null?f:o,typeof f===s?f.call(e,{name:"strandName",hash:{},data:u}):f))+"<\/a>\r\n"},"3":function(){return'<span class="hyphen">-<\/span>'},"5":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'    <a href="'+h((f=(f=i.subStrandUrl||(t!=null?t.subStrandUrl:t))!=null?f:o,typeof f===s?f.call(e,{name:"subStrandUrl",hash:{},data:u}):f))+'" class="subStrand">'+h((f=(f=i.subStrandName||(t!=null?t.subStrandName:t))!=null?f:o,typeof f===s?f.call(e,{name:"subStrandName",hash:{},data:u}):f))+"<\/a>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return'<div class="title-container">\r\n'+((f=i["if"].call(e,t!=null?t.strandUrl:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+"    "+((f=i["if"].call(e,t!=null?t.strandName:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n"+((f=i["if"].call(e,t!=null?t.subStrandUrl:t,{name:"if",hash:{},fn:n.program(5,u,0),inverse:n.noop,data:u}))!=null?f:"")+'<\/div>\r\n<div class="curriculum-list-viewpart"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.YearLearningArea=Handlebars.template({"1":function(n,t,i,r,u){var f;return" "+n.escapeExpression((f=(f=i.strandName||(t!=null?t.strandName:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"strandName",hash:{},data:u}):f))+" in "},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var o,f,e=t!=null?t:n.nullContext||{},s=i.helperMissing,h="function",c=n.escapeExpression;return'<!-- TAFE group by strand, NATCUR group by year -->\r\n<h2 class="title">'+((o=i["if"].call(e,t!=null?t.strandName:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?o:"")+c((f=(f=i.yearName||(t!=null?t.yearName:t))!=null?f:s,typeof f===h?f.call(e,{name:"yearName",hash:{},data:u}):f))+" "+c((f=(f=i.subjectName||(t!=null?t.subjectName:t))!=null?f:s,typeof f===h?f.call(e,{name:"subjectName",hash:{},data:u}):f))+'<\/h2>\r\n<div class="sub-strand-group-viewpart"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.HeroContainer=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="left-navigation-item-viewpart"><\/div>\r\n<div class="hero-list-viewpart"><\/div>\r\n<div class="right-navigation-item-viewpart"><\/div>\r\n<div class="hero-pagination-viewpart"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.HeroItem=Handlebars.template({"1":function(){return'    <p class="hero-supplemental">A ClickView Original Production<\/p>\r\n'},"3":function(n,t,i,r,u){var f;return'<p class="hero-series">Series: '+n.escapeExpression((f=(f=i.seriesName||(t!=null?t.seriesName:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"seriesName",hash:{},data:u}):f))+"<\/p>"},"5":function(n,t,i,r,u){var f;return'    <a href="'+n.escapeExpression((f=(f=i.actionUrl||(t!=null?t.actionUrl:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"actionUrl",hash:{},data:u}):f))+'" class="btn hero-call-to-action">\r\n        <svg class="play-icon">\r\n            <use xlink:href="#play-triangle"><\/use>\r\n        <\/svg>\r\n        Play Now\r\n    <\/a>\r\n'},"7":function(){return'    <div class="custom-action-container"><\/div>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var o,f,e=t!=null?t:n.nullContext||{},s=i.helperMissing,h="function",c=n.escapeExpression;return'<div class="info-viewpart">\r\n'+((o=i["if"].call(e,t!=null?t.producedByClickView:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?o:"")+'    <h1 class="hero-title">'+c((f=(f=i.name||(t!=null?t.name:t))!=null?f:s,typeof f===h?f.call(e,{name:"name",hash:{},data:u}):f))+"<\/h1>\r\n    "+((o=i["if"].call(e,t!=null?t.seriesName:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?o:"")+'\r\n    <p class="hero-byline">\r\n        '+c((f=(f=i.description||(t!=null?t.description:t))!=null?f:s,typeof f===h?f.call(e,{name:"description",hash:{},data:u}):f))+"\r\n    <\/p>\r\n"+((o=i["if"].call(e,t!=null?t.showPlayNow:t,{name:"if",hash:{},fn:n.program(5,u,0),inverse:n.program(7,u,0),data:u}))!=null?o:"")+'<\/div>\r\n<div class="image-viewpart" style="background-image: url('+c((f=(f=i.thumbnailUrl||(t!=null?t.thumbnailUrl:t))!=null?f:s,typeof f===h?f.call(e,{name:"thumbnailUrl",hash:{},data:u}):f))+');">\r\n    <a href="'+c((f=(f=i.actionUrl||(t!=null?t.actionUrl:t))!=null?f:s,typeof f===h?f.call(e,{name:"actionUrl",hash:{},data:u}):f))+'">\r\n        <div class="play-icon-large">\r\n            <svg class="play-icon">\r\n                <use xlink:href="#play"><\/use>\r\n            <\/svg>\r\n        <\/div>\r\n    <\/a>\r\n<\/div>\r\n\r\n\r\n\r\n'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.HeroNavigationItem=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<div class="centering-container">\r\n    <svg>\r\n        <use xlink:href="#'+n.escapeExpression((f=(f=i.direction||(t!=null?t.direction:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"direction",hash:{},data:u}):f))+'"><\/use>\r\n    <\/svg>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.EmptyInteractivePane=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<h4 class="title-empty">This video doesn\'t contain any interactive videos yet, but you can create one by clicking the button below.<\/h4> \r\n<p class="description">Interactive videos feature an interactive layer that helps keep students engaged, while also providing teachers with valuable feedback regarding their students understanding.<\/p>\r\n<div class="interactive-tab-create-interactive-empty"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.InteractivePane=Handlebars.template({"1":function(){return'<div class="interactive-tab-create-interactive"><\/div>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.renderButton:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+'<div class="interactive-resources-list"><\/div>\r\n<div class="pagination"<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.AboutTab=Handlebars.template({"1":function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{};return'            <p class="description-content">'+((e=(f=(f=i.linkedDescription||(t!=null?t.linkedDescription:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(o,{name:"linkedDescription",hash:{},data:u}):f))!=null?e:"")+"\r\n"+((e=i["if"].call(o,t!=null?t.ownerComment:t,{name:"if",hash:{},fn:n.program(2,u,0),inverse:n.noop,data:u}))!=null?e:"")+"            <\/p>\r\n"},"2":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},(f=t!=null?t.ownerComment:t)!=null?f.text:f,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:""},"3":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.owner:t,{name:"if",hash:{},fn:n.program(4,u,0),inverse:n.noop,data:u}))!=null?f:""},"4":function(n,t){var i,r=n.lambda,u=n.escapeExpression;return"                <strong>"+u(r((i=t!=null?t.owner:t)!=null?i.name:i,t))+" says:<\/strong> "+u(r((i=t!=null?t.ownerComment:t)!=null?i.text:i,t))+"\r\n"},"6":function(){return'            <p class="description-content empty-text">\r\n                This video does not have a description. \r\n            <\/p>\r\n'},"8":function(n,t,i,r,u){var f;return'            <li class="info-item">\r\n                <label class="inline">Clipped from:<\/label>\r\n                <p class="about-value inline">'+((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.originalVideoUrl:t,{name:"if",hash:{},fn:n.program(9,u,0),inverse:n.program(11,u,0),data:u}))!=null?f:"")+"<\/p>\r\n            <\/li>\r\n"},"9":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<a href="'+h((f=(f=i.originalVideoUrl||(t!=null?t.originalVideoUrl:t))!=null?f:o,typeof f===s?f.call(e,{name:"originalVideoUrl",hash:{},data:u}):f))+'">'+h((f=(f=i.name||(t!=null?t.name:t))!=null?f:o,typeof f===s?f.call(e,{name:"name",hash:{},data:u}):f))+"<\/a>"},"11":function(n,t,i,r,u){var f;return n.escapeExpression((f=(f=i.name||(t!=null?t.name:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"name",hash:{},data:u}):f))},"13":function(n,t,i,r,u){var f;return'            <li class="info-item">\r\n                <label class="inline">Shared by:<\/label>\r\n                <p class="about-value inline">'+n.escapeExpression((f=(f=i.sharedBy||(t!=null?t.sharedBy:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"sharedBy",hash:{},data:u}):f))+"<\/p>\r\n            <\/li>\r\n"},"15":function(n,t,i,r,u){var f;return'            <li class="info-item">\r\n                <label class="inline">Rating:<\/label>\r\n                <p class="about-value inline">'+n.escapeExpression((f=(f=i.rating||(t!=null?t.rating:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"rating",hash:{},data:u}):f))+"<\/p>\r\n            <\/li>\r\n"},"17":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},(f=t!=null?t.channel:t)!=null?f.name:f,{name:"if",hash:{},fn:n.program(18,u,0),inverse:n.noop,data:u}))!=null?f:""},"18":function(n,t){var i;return'            <li class="info-item">\r\n                <label class="inline">Broadcast Channel:<\/label>\r\n                <p class="about-value inline">'+n.escapeExpression(n.lambda((i=t!=null?t.channel:t)!=null?i.name:i,t))+"<\/p>\r\n            <\/li>\r\n"},"20":function(n,t,i,r,u){var f;return'            <li class="info-item">\r\n                <label class="inline">Production Year: <\/label>\r\n                <p class="about-value inline">'+n.escapeExpression((f=(f=i.year||(t!=null?t.year:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"year",hash:{},data:u}):f))+"<\/p>\r\n            <\/li>\r\n"},"22":function(n,t,i,r,u){return'            <li class="info-item">\r\n                <label class="inline">Duration:<\/label>\r\n                <p class="about-value inline">'+n.escapeExpression((i.duration||t&&t.duration||i.helperMissing).call(t!=null?t:n.nullContext||{},t!=null?t.duration:t,{name:"duration",hash:{},data:u}))+"<\/p>\r\n            <\/li>\r\n"},"24":function(n,t,i,r,u){var f;return'            <li class="info-item">\r\n                <label class="inline">Date Broadcast:<\/label>\r\n                <p class="about-value inline">'+n.escapeExpression((f=(f=i.dateBroadcast||(t!=null?t.dateBroadcast:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"dateBroadcast",hash:{},data:u}):f))+"<\/p>\r\n            <\/li>\r\n"},"26":function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{};return'                <li class="info-item">\r\n                    <label class="inline">'+n.escapeExpression((f=(f=i.libraryText||(t!=null?t.libraryText:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(o,{name:"libraryText",hash:{},data:u}):f))+':<\/label>\r\n                    <ul class="libraries">\r\n'+((e=i.each.call(o,t!=null?t.libraries:t,{name:"each",hash:{},fn:n.program(27,u,0),inverse:n.noop,data:u}))!=null?e:"")+"                    <\/ul>\r\n                <\/li>\r\n"},"27":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'                        <li><a class="about-value inline" href="'+h((f=(f=i.url||(t!=null?t.url:t))!=null?f:o,typeof f===s?f.call(e,{name:"url",hash:{},data:u}):f))+'">'+h((f=(f=i.name||(t!=null?t.name:t))!=null?f:o,typeof f===s?f.call(e,{name:"name",hash:{},data:u}):f))+"<\/a><\/li>\r\n"},"29":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.seriesUrl:t,{name:"if",hash:{},fn:n.program(30,u,0),inverse:n.noop,data:u}))!=null?f:""},"30":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},(f=t!=null?t.series:t)!=null?f.name:f,{name:"if",hash:{},fn:n.program(31,u,0),inverse:n.noop,data:u}))!=null?f:""},"31":function(n,t,i,r,u){var e,f,o=n.escapeExpression;return'            <li class="info-item">\r\n                <label class="inline">Series:<\/label>\r\n                <a class="about-value inline" href="'+o((f=(f=i.seriesUrl||(t!=null?t.seriesUrl:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"seriesUrl",hash:{},data:u}):f))+'">'+o(n.lambda((e=t!=null?t.series:t)!=null?e.name:e,t))+"<\/a>\r\n            <\/li>\r\n"},"33":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.categoryUrl:t,{name:"if",hash:{},fn:n.program(34,u,0),inverse:n.noop,data:u}))!=null?f:""},"34":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},(f=t!=null?t.category:t)!=null?f.name:f,{name:"if",hash:{},fn:n.program(35,u,0),inverse:n.noop,data:u}))!=null?f:""},"35":function(n,t,i,r,u){var e,f,o=n.escapeExpression;return'            <li class="info-item">\r\n                <label class="inline">Category:<\/label>\r\n                <a class="about-value inline" href="'+o((f=(f=i.categoryUrl||(t!=null?t.categoryUrl:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"categoryUrl",hash:{},data:u}):f))+'">'+o(n.lambda((e=t!=null?t.category:t)!=null?e.name:e,t))+"<\/a>\r\n            <\/li>\r\n"},"37":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.topicUrl:t,{name:"if",hash:{},fn:n.program(38,u,0),inverse:n.noop,data:u}))!=null?f:""},"38":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},(f=t!=null?t.topic:t)!=null?f.name:f,{name:"if",hash:{},fn:n.program(39,u,0),inverse:n.noop,data:u}))!=null?f:""},"39":function(n,t,i,r,u){var e,f,o=n.escapeExpression;return'            <li class="info-item">\r\n                <label class="inline">Topic:<\/label>\r\n                <a class="about-value inline" href="'+o((f=(f=i.topicUrl||(t!=null?t.topicUrl:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"topicUrl",hash:{},data:u}):f))+'">'+o(n.lambda((e=t!=null?t.topic:t)!=null?e.name:e,t))+"<\/a>\r\n            <\/li>\r\n"},"41":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.userChannelUrl:t,{name:"if",hash:{},fn:n.program(42,u,0),inverse:n.noop,data:u}))!=null?f:""},"42":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},(f=t!=null?t.userChannel:t)!=null?f.name:f,{name:"if",hash:{},fn:n.program(43,u,0),inverse:n.noop,data:u}))!=null?f:""},"43":function(n,t,i,r,u){var e,f,o=n.escapeExpression;return'            <li class="info-item">\r\n                <label class="inline">Channel:<\/label>\r\n                <a class="about-value inline" href="'+o((f=(f=i.userChannelUrl||(t!=null?t.userChannelUrl:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"userChannelUrl",hash:{},data:u}):f))+'">'+o(n.lambda((e=t!=null?t.userChannel:t)!=null?e.name:e,t))+"<\/a>\r\n            <\/li>\r\n"},"45":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.playlistUrl:t,{name:"if",hash:{},fn:n.program(46,u,0),inverse:n.noop,data:u}))!=null?f:""},"46":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},(f=t!=null?t.playlist:t)!=null?f.name:f,{name:"if",hash:{},fn:n.program(47,u,0),inverse:n.noop,data:u}))!=null?f:""},"47":function(n,t,i,r,u){var e,f,o=n.escapeExpression;return'            <li class="info-item">\r\n                <label class="inline">Playlist:<\/label>\r\n                <a class="about-value inline" href="'+o((f=(f=i.playlistUrl||(t!=null?t.playlistUrl:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"playlistUrl",hash:{},data:u}):f))+'">'+o(n.lambda((e=t!=null?t.playlist:t)!=null?e.name:e,t))+"<\/a>\r\n            <\/li>\r\n"},"49":function(){return'        <div class="info-list-group">\r\n            <div class="saved-to-cache-container">\r\n                <div class="local-cache-badge">\r\n                    <svg><use xlink:href="#lc-icon"><\/use><\/svg>\r\n                <\/div>\r\n                <p>Available in Local Cache<\/p>\r\n                <div class="info-badge-container"><\/div>\r\n            <\/div>\r\n        <\/div>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return'<div class="row">\r\n    <div class="col-sm-6 description-wrapper">\r\n        <span class="info-title">DESCRIPTION<\/span>\r\n        <div class="description-container">\r\n'+((f=i["if"].call(e,t!=null?t.linkedDescription:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(6,u,0),data:u}))!=null?f:"")+'        <\/div>\r\n    <\/div>\r\n    <div class="col-sm-6 info-wrapper">\r\n        <span class="info-title">DETAILS<\/span>\r\n        <div class="info-list-group">\r\n            <ul class="info-list">\r\n'+((f=i["if"].call(e,t!=null?t.isPlayingClip:t,{name:"if",hash:{},fn:n.program(8,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n"+((f=i["if"].call(e,t!=null?t.sharedBy:t,{name:"if",hash:{},fn:n.program(13,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n"+((f=i["if"].call(e,t!=null?t.rating:t,{name:"if",hash:{},fn:n.program(15,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n"+((f=i["if"].call(e,t!=null?t.channel:t,{name:"if",hash:{},fn:n.program(17,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n"+((f=i["if"].call(e,t!=null?t.year:t,{name:"if",hash:{},fn:n.program(20,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n"+((f=i["if"].call(e,t!=null?t.duration:t,{name:"if",hash:{},fn:n.program(22,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n"+((f=i["if"].call(e,t!=null?t.dateBroadcast:t,{name:"if",hash:{},fn:n.program(24,u,0),inverse:n.noop,data:u}))!=null?f:"")+'            <\/ul>\r\n        <\/div>\r\n        <div class="info-list-group">\r\n            <ul class="info-list">\r\n'+((f=i["if"].call(e,(f=t!=null?t.libraries:t)!=null?f.length:f,{name:"if",hash:{},fn:n.program(26,u,0),inverse:n.noop,data:u}))!=null?f:"")+"            \r\n"+((f=i["if"].call(e,t!=null?t.series:t,{name:"if",hash:{},fn:n.program(29,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n"+((f=i["if"].call(e,t!=null?t.category:t,{name:"if",hash:{},fn:n.program(33,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n"+((f=i["if"].call(e,t!=null?t.topic:t,{name:"if",hash:{},fn:n.program(37,u,0),inverse:n.noop,data:u}))!=null?f:"")+'\r\n            <\/ul>\r\n        <\/div>\r\n        <div class="info-list-group">\r\n            <ul class="info-list">\r\n'+((f=i["if"].call(e,t!=null?t.userChannel:t,{name:"if",hash:{},fn:n.program(41,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n"+((f=i["if"].call(e,t!=null?t.playlist:t,{name:"if",hash:{},fn:n.program(45,u,0),inverse:n.noop,data:u}))!=null?f:"")+'            <\/ul>\r\n        <\/div>\r\n        <div class="contributor-info"><\/div>\r\n        <div class="content-licence-viewpart"><\/div>\r\n\r\n'+((f=i["if"].call(e,t!=null?t.existsInLocalCache:t,{name:"if",hash:{},fn:n.program(49,u,0),inverse:n.noop,data:u}))!=null?f:"")+"    <\/div>\r\n<\/div>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.Chapters=Handlebars.template({"1":function(){return"<h2>Chapters<\/h2>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.showHeading:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+'<div class="chapters-container">\r\n    <p class="empty-text">This video has no chapters<\/p>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.CollectionLinks=Handlebars.template({"1":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'    <label class="inline">Library:<\/label>\r\n    <a class="about-value inline" href="'+h((f=(f=i.url||(t!=null?t.url:t))!=null?f:o,typeof f===s?f.call(e,{name:"url",hash:{},data:u}):f))+'">'+h((f=(f=i.name||(t!=null?t.name:t))!=null?f:o,typeof f===s?f.call(e,{name:"name",hash:{},data:u}):f))+"<\/a>\r\n"},"3":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.seriesUrl:t,{name:"if",hash:{},fn:n.program(4,u,0),inverse:n.noop,data:u}))!=null?f:""},"4":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},(f=t!=null?t.series:t)!=null?f.name:f,{name:"if",hash:{},fn:n.program(5,u,0),inverse:n.noop,data:u}))!=null?f:""},"5":function(n,t,i,r,u){var e,f,o=n.escapeExpression;return'            <label class="inline">Series:<\/label>\r\n            <a class="about-value inline" href="'+o((f=(f=i.seriesUrl||(t!=null?t.seriesUrl:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"seriesUrl",hash:{},data:u}):f))+'">'+o(n.lambda((e=t!=null?t.series:t)!=null?e.name:e,t))+"<\/a>\r\n"},"7":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.categoryUrl:t,{name:"if",hash:{},fn:n.program(8,u,0),inverse:n.noop,data:u}))!=null?f:""},"8":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},(f=t!=null?t.category:t)!=null?f.name:f,{name:"if",hash:{},fn:n.program(9,u,0),inverse:n.noop,data:u}))!=null?f:""},"9":function(n,t,i,r,u){var e,f,o=n.escapeExpression;return'            <label class="inline">Category:<\/label>\r\n            <a class="about-value inline" href="'+o((f=(f=i.categoryUrl||(t!=null?t.categoryUrl:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"categoryUrl",hash:{},data:u}):f))+'">'+o(n.lambda((e=t!=null?t.category:t)!=null?e.name:e,t))+"<\/a>\r\n"},"11":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.topicUrl:t,{name:"if",hash:{},fn:n.program(12,u,0),inverse:n.noop,data:u}))!=null?f:""},"12":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},(f=t!=null?t.topic:t)!=null?f.name:f,{name:"if",hash:{},fn:n.program(13,u,0),inverse:n.noop,data:u}))!=null?f:""},"13":function(n,t,i,r,u){var e,f,o=n.escapeExpression;return'            <label class="inline">Topic:<\/label>\r\n            <a class="about-value inline" href="'+o((f=(f=i.topicUrl||(t!=null?t.topicUrl:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"topicUrl",hash:{},data:u}):f))+'">'+o(n.lambda((e=t!=null?t.topic:t)!=null?e.name:e,t))+"<\/a>\r\n"},"15":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.userChannelUrl:t,{name:"if",hash:{},fn:n.program(16,u,0),inverse:n.noop,data:u}))!=null?f:""},"16":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},(f=t!=null?t.userChannel:t)!=null?f.name:f,{name:"if",hash:{},fn:n.program(17,u,0),inverse:n.noop,data:u}))!=null?f:""},"17":function(n,t,i,r,u){var e,f,o=n.escapeExpression;return'            <label class="inline">Channel:<\/label>\r\n            <a class="about-value inline" href="'+o((f=(f=i.userChannelUrl||(t!=null?t.userChannelUrl:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"userChannelUrl",hash:{},data:u}):f))+'">'+o(n.lambda((e=t!=null?t.userChannel:t)!=null?e.name:e,t))+"<\/a>\r\n"},"19":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.playlistUrl:t,{name:"if",hash:{},fn:n.program(20,u,0),inverse:n.noop,data:u}))!=null?f:""},"20":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},(f=t!=null?t.playlist:t)!=null?f.name:f,{name:"if",hash:{},fn:n.program(21,u,0),inverse:n.noop,data:u}))!=null?f:""},"21":function(n,t,i,r,u){var e,f,o=n.escapeExpression;return'            <label class="inline">Playlist:<\/label>\r\n            <a class="about-value inline" href="'+o((f=(f=i.playlistUrl||(t!=null?t.playlistUrl:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"playlistUrl",hash:{},data:u}):f))+'">'+o(n.lambda((e=t!=null?t.playlist:t)!=null?e.name:e,t))+"<\/a>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return((f=i.each.call(e,t!=null?t.libraries:t,{name:"each",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,t!=null?t.series:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,t!=null?t.category:t,{name:"if",hash:{},fn:n.program(7,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,t!=null?t.topic:t,{name:"if",hash:{},fn:n.program(11,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,t!=null?t.userChannel:t,{name:"if",hash:{},fn:n.program(15,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,t!=null?t.playlist:t,{name:"if",hash:{},fn:n.program(19,u,0),inverse:n.noop,data:u}))!=null?f:"")},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.MasterPlayView=Handlebars.template({"1":function(){return"full-width"},"3":function(n,t,i,r,u){var f;return'    <div class="banner-container clearfix">\r\n        <div class="message">You are viewing a clip<\/div>\r\n        <div class="original">\r\n            '+((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.originalVideoUrl:t,{name:"if",hash:{},fn:n.program(4,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n        <\/div>\r\n    <\/div>\r\n"},"4":function(n,t,i,r,u){var f;return'<a href="'+n.escapeExpression((f=(f=i.originalVideoUrl||(t!=null?t.originalVideoUrl:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"originalVideoUrl",hash:{},data:u}):f))+'" class="btn grey originalVideoUrl">Click to see original video<\/a>'},"6":function(){return'        <div class="video-play-actions-container">\r\n            <div class="partial-loading-view">\r\n                <div class="partial-loading-item back-button"><\/div>\r\n            <\/div>\r\n        <\/div>\r\n'},"8":function(n,t,i,r,u){var f;return'                    <div class="tab tab3"><\/div>\r\n'+((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.hasClips:t,{name:"if",hash:{},fn:n.program(9,u,0),inverse:n.noop,data:u}))!=null?f:"")},"9":function(){return'                    <div class="tab tab4"><\/div>\r\n'},"11":function(){return'<div class="side-bar-block">\r\n    <div class="chapter-view-container partial-loading-view"><\/div>\r\n    <div class="side-bar-container">\r\n        <div class="partial-loading-view">\r\n            <div class="partial-loading-item sidebar-title"><\/div>\r\n            <div class="partial-loading-item sidebar-button"><\/div>\r\n            <div class="partial-loading-item sidebar-title"><\/div>\r\n            <div class="cv-video">\r\n                <div class="partial-loading-item cv-thumbnail">\r\n                    <a><\/a>\r\n                <\/div>\r\n                <div class="cv-video-content">\r\n                    <div class="partial-loading-item video-title"><\/div>\r\n                <\/div>\r\n            <\/div>\r\n            <div class="cv-video">\r\n                <div class="partial-loading-item cv-thumbnail">\r\n                    <a><\/a>\r\n                <\/div>\r\n                <div class="cv-video-content">\r\n                    <div class="partial-loading-item video-title"><\/div>\r\n                <\/div>\r\n            <\/div>\r\n            <div class="cv-video">\r\n                <div class="partial-loading-item cv-thumbnail">\r\n                    <a><\/a>\r\n                <\/div>\r\n                <div class="cv-video-content">\r\n                    <div class="partial-loading-item video-title"><\/div>\r\n                <\/div>\r\n            <\/div>\r\n            <div class="cv-video">\r\n                <div class="partial-loading-item cv-thumbnail">\r\n                    <a><\/a>\r\n                <\/div>\r\n                <div class="cv-video-content">\r\n                    <div class="partial-loading-item video-title"><\/div>\r\n                <\/div>\r\n            <\/div>\r\n            <div class="cv-video">\r\n                <div class="partial-loading-item cv-thumbnail">\r\n                    <a><\/a>\r\n                <\/div>\r\n                <div class="cv-video-content">\r\n                    <div class="partial-loading-item video-title"><\/div>\r\n                <\/div>\r\n            <\/div>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return'<div class="main-play-block '+((f=i["if"].call(e,t!=null?t.isFullWidth:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+'">\r\n'+((f=i["if"].call(e,t!=null?t.isPlayingClip:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:"")+'    <div class="player-container">\r\n        <div class="partial-loading-view">\r\n            <div class="video-container"><\/div>\r\n        <\/div>\r\n    <\/div>\r\n    <div class="video-metadata-container">\r\n'+((f=i.unless.call(e,t!=null?t.isPlayingClip:t,{name:"unless",hash:{},fn:n.program(6,u,0),inverse:n.noop,data:u}))!=null?f:"")+'        <div class="video-info-container">\r\n            <div class="partial-loading-view">\r\n                <div class="partial-loading-item title"><\/div>\r\n                <div class="partial-loading-item description"><\/div>\r\n            <\/div>\r\n        <\/div>\r\n        <div class="tab-container">\r\n            <div class="partial-loading-view">\r\n                <div class="tab-header">\r\n                    <div class="tab tab1"><\/div>\r\n                    <div class="tab tab2"><\/div>\r\n'+((f=i.unless.call(e,t!=null?t.isPlayingClip:t,{name:"unless",hash:{},fn:n.program(8,u,0),inverse:n.noop,data:u}))!=null?f:"")+'                <\/div>\r\n                <div class="partial-loading-item info"><\/div>\r\n                <div class="partial-loading-item info"><\/div>\r\n            <\/div>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>\r\n'+((f=i.unless.call(e,t!=null?t.isPlayingClip:t,{name:"unless",hash:{},fn:n.program(11,u,0),inverse:n.noop,data:u}))!=null?f:"")},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.MasterPlayViewActions=Handlebars.template({"1":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<a href="'+h((f=(f=i.backHref||(t!=null?t.backHref:t))!=null?f:o,typeof f===s?f.call(e,{name:"backHref",hash:{},data:u}):f))+'" class="back-button play-action">\r\n    <svg>\r\n        <use xlink:href="#back"><\/use>\r\n    <\/svg>\r\n    Back to '+h((f=(f=i.from||(t!=null?t.from:t))!=null?f:o,typeof f===s?f.call(e,{name:"from",hash:{},data:u}):f))+"\r\n<\/a>\r\n"},"3":function(){return'<div class="btn-group video-actions"><\/div>\r\n'},"5":function(){return'<div class="btn-group">\r\n    <a class="add-to-playlist play-action">\r\n        <svg>\r\n            <use xlink:href="#plus"><\/use>\r\n        <\/svg>\r\n        Add to a playlist\r\n    <\/a>\r\n<\/div>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return((f=i["if"].call(e,t!=null?t.from:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,(f=t!=null?t.actions:t)!=null?f.length:f,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,t!=null?t.canAddToPlaylist:t,{name:"if",hash:{},fn:n.program(5,u,0),inverse:n.noop,data:u}))!=null?f:"")},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.MasterRelatedVideoItem=Handlebars.template({"1":function(n,t,i,r,u){return'<span class="duration video-duration">'+n.escapeExpression((i.duration||t&&t.duration||i.helperMissing).call(t!=null?t:n.nullContext||{},t!=null?t.duration:t,{name:"duration",hash:{},data:u}))+"<\/span>"},"3":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'    <p class="series">Series: \r\n      <a href='+h((f=(f=i.seriesUrl||(t!=null?t.seriesUrl:t))!=null?f:o,typeof f===s?f.call(e,{name:"seriesUrl",hash:{},data:u}):f))+' class="series-link"> '+h((f=(f=i.seriesName||(t!=null?t.seriesName:t))!=null?f:o,typeof f===s?f.call(e,{name:"seriesName",hash:{},data:u}):f))+" <\/a>\r\n    <\/p>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var c,f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<div class="video-image">\r\n  <a href="'+h((f=(f=i.actionUrl||(t!=null?t.actionUrl:t))!=null?f:o,typeof f===s?f.call(e,{name:"actionUrl",hash:{},data:u}):f))+'">\r\n    <div class="play-btn-mask"><\/div>\r\n    <div class="play-icon-video">\r\n        <svg class="play-icon">\r\n            <use xlink:href="#play"><\/use>\r\n        <\/svg>\r\n    <\/div>\r\n    <img alt="" title="'+h((f=(f=i.name||(t!=null?t.name:t))!=null?f:o,typeof f===s?f.call(e,{name:"name",hash:{},data:u}):f))+'" class="thumbnail" data-original="'+h((f=(f=i.thumbnailUrl||(t!=null?t.thumbnailUrl:t))!=null?f:o,typeof f===s?f.call(e,{name:"thumbnailUrl",hash:{},data:u}):f))+'" />\r\n    '+((c=i["if"].call(e,t!=null?t.duration:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?c:"")+'\r\n  <\/a>\r\n<\/div>\r\n<div class="video-description cf">\r\n  <a href="'+h((f=(f=i.actionUrl||(t!=null?t.actionUrl:t))!=null?f:o,typeof f===s?f.call(e,{name:"actionUrl",hash:{},data:u}):f))+'">\r\n    <h4 class="title">'+h((f=(f=i.name||(t!=null?t.name:t))!=null?f:o,typeof f===s?f.call(e,{name:"name",hash:{},data:u}):f))+"<\/h4>\r\n  <\/a>\r\n"+((c=i["if"].call(e,t!=null?t.seriesUrl:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?c:"")+"<\/div>\r\n"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.MasterVideoActionsDropdownList=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<a class="more play-action" aria-expanded="false" data-toggle="dropdown">\r\n    <svg>\r\n        <use xlink:href="#more"><\/use>\r\n    <\/svg>\r\n    '+n.escapeExpression((f=(f=i.moreText||(t!=null?t.moreText:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"moreText",hash:{},data:u}):f))+'\r\n<\/a>\r\n<ul class="dropdown-menu ddl-actions dropdown-menu-right"><\/ul>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.PlayerSideBar=Handlebars.template({"1":function(n,t,i,r,u){var f;return'<div class="promoted-content-container">\r\n    '+n.escapeExpression((f=(f=i.promotedText||(t!=null?t.promotedText:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"promotedText",hash:{},data:u}):f))+' <span class="promoted-logo"><\/span>\r\n<\/div>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<div class="player-sidebar-tabs"><\/div>\r\n'+((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.isMasterLibraryVideo:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+'<div class="player-sidebar-mask"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.SideBar=Handlebars.template({"1":function(){return'<div class="toggle-player-sidebar"><\/div>'},"3":function(){return'<div class="create-interactive-container"><\/div>\r\n'},"5":function(n,t,i,r,u){var f;return"<h2>"+n.escapeExpression((f=(f=i.title||(t!=null?t.title:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"title",hash:{},data:u}):f))+'<\/h2>\r\n<div class="related-videos-container"><\/div>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return((f=i["if"].call(e,t!=null?t.showToggle:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n\r\n"+((f=i["if"].call(e,t!=null?t.canCreateInteractive:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n"+((f=i["if"].call(e,t!=null?t.hasRelatedVideos:t,{name:"if",hash:{},fn:n.program(5,u,0),inverse:n.noop,data:u}))!=null?f:"")},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.VideoInfo=Handlebars.template({"1":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.seriesUrl:t,{name:"if",hash:{},fn:n.program(2,u,0),inverse:n.noop,data:u}))!=null?f:""},"2":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},(f=t!=null?t.series:t)!=null?f.name:f,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:""},"3":function(n,t,i,r,u){var e,f,o=n.escapeExpression;return'    <div span="series">Series:<a href="'+o((f=(f=i.seriesUrl||(t!=null?t.seriesUrl:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"seriesUrl",hash:{},data:u}):f))+'" class="series-link"> '+o(n.lambda((e=t!=null?t.series:t)!=null?e.name:e,t))+"<\/a><\/div>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{};return'<div class="title-container">\r\n    <h1 class="name"> '+n.escapeExpression((f=(f=i.name||(t!=null?t.name:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(o,{name:"name",hash:{},data:u}):f))+' <\/h1>\r\n    <div class="restricted-badge-container"><\/div>\r\n    <div class="restriction-info-container"><\/div>\r\n'+((e=i["if"].call(o,t!=null?t.series:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?e:"")+"<\/div>\r\n"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.VerifyEmail=Handlebars.template({"1":function(){return'<div class="partial-loading-item info-partial"><\/div>\r\n<div class="partial-loading-item email-partial"><\/div>\r\n<div class="partial-loading-item buttons-partial"><\/div>\r\n'},"3":function(n,t,i,r,u){var f,e,o=t!=null?t:n.nullContext||{};return"\r\n"+((f=i["if"].call(o,t!=null?t.textLabel:t,{name:"if",hash:{},fn:n.program(4,u,0),inverse:n.noop,data:u}))!=null?f:"")+'\r\n<p class="info-text">'+n.escapeExpression((e=(e=i.text||(t!=null?t.text:t))!=null?e:i.helperMissing,typeof e=="function"?e.call(o,{name:"text",hash:{},data:u}):e))+"<\/p>\r\n\r\n"+((f=i["if"].call(o,t!=null?t.noEmail:t,{name:"if",hash:{},fn:n.program(6,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n"+((f=i["if"].call(o,t!=null?t.pendingVerified:t,{name:"if",hash:{},fn:n.program(9,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n"+((f=i["if"].call(o,t!=null?t.verified:t,{name:"if",hash:{},fn:n.program(11,u,0),inverse:n.noop,data:u}))!=null?f:"")+'\r\n<span class="note">Note: Updating this email address will not change how you sign in to ClickView.<\/span>\r\n'},"4":function(n,t,i,r,u){var f;return'<label for="user-email">'+n.escapeExpression((f=(f=i.textLabel||(t!=null?t.textLabel:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"textLabel",hash:{},data:u}):f))+"<\/label>"},"6":function(n,t,i,r,u){var f;return'<input type="email" class="email" id="user-email" placeholder="Enter your email address here" name="emailAddress" />\r\n<span class="help-block hidden"><\/span>\r\n<div class="btn-group">\r\n    <div class="btn-viewpart"><\/div>\r\n'+((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.updateEmail:t,{name:"if",hash:{},fn:n.program(7,u,0),inverse:n.noop,data:u}))!=null?f:"")+"<\/div>\r\n"},"7":function(){return'    <div class="cancel-update">Cancel<\/div>\r\n'},"9":function(){return'<input type="email" class="email" id="user-email" name="emailAddress" disabled />\r\n<div class="verified-text unverified">\r\n    <span>Not yet verified<\/span>\r\n    <svg class="verified-icon">\r\n        <use xlink:href="#verified"><\/use>\r\n    <\/svg>\r\n<\/div>\r\n<div class="btn-group">\r\n    <div class="btn-viewpart"><\/div>\r\n    <div class="update-email">Update email<\/div>\r\n<\/div>\r\n'},"11":function(){return'<input type="email" class="email" id="user-email" name="emailAddress" disabled />\r\n<div class="verified-text">\r\n    <span>Verified<\/span>\r\n    <svg class="verified-icon">\r\n        <use xlink:href="#verified"><\/use>\r\n    <\/svg>\r\n<\/div>\r\n<div class="btn-group">\r\n    <div class="btn-viewpart"><\/div>\r\n<\/div>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.showPartial:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(3,u,0),data:u}))!=null?f:"")+"\r\n"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.VerifyEmailPopup=Handlebars.template({"1":function(){return'<div class="partial-loading-item info-partial"><\/div>\r\n<div class="partial-loading-item email-partial"><\/div>\r\n<div class="partial-loading-item buttons-partial"><\/div>\r\n'},"3":function(n,t,i,r,u){var f;return"\r\n"+((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.confirmation:t,{name:"if",hash:{},fn:n.program(4,u,0),inverse:n.program(6,u,0),data:u}))!=null?f:"")},"4":function(n,t,i,r,u){var f;return'<img class="email-sent" src="/Assets/images/email/request_sent@2x.png" />\r\n<p class="email-sent-text">'+n.escapeExpression((f=(f=i.confirmation||(t!=null?t.confirmation:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"confirmation",hash:{},data:u}):f))+"<\/p>\r\n"},"6":function(n,t,i,r,u){var f,e,o=t!=null?t:n.nullContext||{};return((f=i["if"].call(o,t!=null?t.textLabel:t,{name:"if",hash:{},fn:n.program(7,u,0),inverse:n.noop,data:u}))!=null?f:"")+'\r\n<p class="info-text">'+n.escapeExpression((e=(e=i.text||(t!=null?t.text:t))!=null?e:i.helperMissing,typeof e=="function"?e.call(o,{name:"text",hash:{},data:u}):e))+"<\/p>\r\n\r\n"+((f=i["if"].call(o,t!=null?t.noEmail:t,{name:"if",hash:{},fn:n.program(9,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n"+((f=i["if"].call(o,t!=null?t.pendingVerified:t,{name:"if",hash:{},fn:n.program(11,u,0),inverse:n.noop,data:u}))!=null?f:"")+'<span class="note">Note: Updating this email address will not change how you sign in to ClickView.<\/span>\r\n'},"7":function(n,t,i,r,u){var f;return'<label for="user-email">'+n.escapeExpression((f=(f=i.textLabel||(t!=null?t.textLabel:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"textLabel",hash:{},data:u}):f))+"<\/label>"},"9":function(){return'<input type="email" class="email" id="user-email" placeholder="Enter your email your address here" name="emailAddress"/>\r\n<span class="help-block hidden"><\/span>\r\n<div class="btn-group">\r\n    <div class="btn-viewpart"><\/div>\r\n<\/div>\r\n'},"11":function(){return'<input type="email" class="email" id="user-email" name="emailAddress" disabled/>\r\n<div class="btn-group">\r\n    <div class="btn-viewpart"><\/div>\r\n    <div class="update-email">Update email<\/div>\r\n<\/div>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.showPartial:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(3,u,0),data:u}))!=null?f:"")+"\r\n"},useData:!0});!function(n,t){"use strict";var i=n.Shared;i.Models.NestedCategory=t.NestedModel.extend({getMediaCount:function(){if(this._mediaCount)return this._mediaCount;this._mediaCount=0;var t=this,n=function(i){i.has("videos")&&i.get("videos").pagination?t._mediaCount+=i.get("videos").pagination.totalItems:i.has("mediaCount")&&(t._mediaCount+=i.get("mediaCount"));i.categories&&i.categories.each(n);i.children&&i.children.each(n)};return n(this),this._mediaCount=this._mediaCount.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","),this._mediaCount},parse:function(t){return n.Shared.Helpers.Guid.isGuid(t.onlineId)&&!n.Shared.Helpers.Guid.isEmptyGuid(t.onlineId)&&(t.id=t.onlineId),t}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Models.Banner=t.Model.extend({defaults:{name:"",displayName:"","with":"banner"},initialize:function(){this.set("displayName",this.get("name").toTitleCase())}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared,r=t.Collection.extend({name:"BaseCategoryVideoCollection",url:function(){return"/api/"+this.options.type+"/"+this.parent.get("id")+"/videos"},initialize:function(n,t){if(this.options=t||{},this.listenTo(this,"sync",this.onSync),!this.options.type)return new Error("Must specify type on "+this.name+" (e.g topic, category, series)");this.model=i.Models.MasterVideo},onSync:function(){this.loaded=!0},hasFetched:function(){return this.loaded},parse:function(n){return n&&n.pagination&&(this.pagination=n.pagination),n&&n.data?n.data:n}});i.Models.BaseCategory=i.Models.NestedCategory.extend({defaults:{videos:[]},associations:{banner:function(n,t){return new i.Models.Banner(n,t)},thumbnail:function(n,t){return new i.Models.Thumbnail(n,t)},libraries:function(n,t){return new i.Collections.LibraryCollection(n,_.extend({},t,{parse:!0}))},pinnedVideos:function(n,t){return new i.Collections.PinnedVideoCollection(n,t)}},initialize:function(){this.listenTo(this,"sync",this.onSync)},onSync:function(){this.loaded=!0},isMasterLibraryCollection:function(){return!this.isOnlineCollection()&&_.contains(this.getLibraries(),"hosted_library")},isExchangeCollection:function(){return _.contains(this.getLibraries(),"exchange")},isOnlineCollection:function(){return n.Shared.Helpers.Guid.isGuid(this.get("id"))&&!n.Shared.Helpers.Guid.isEmptyGuid(this.get("id"))},getLibrary:function(){return!this.libraries||!this.libraries.length?null:this.libraries.first()},getLibraries:function(){if(!this.libraries)return[];if(this.isOnlineCollection())return["hosted_library"];var n=this.libraries?this.libraries.toJSON():this.get("libraries").data&&this.get("libraries").data;return n?_.map(n,function(n){return n.type}):[]}});i.Models.Category=i.Models.BaseCategory.extend({associations:_.extend({children:function(n,t){return new i.Collections.CategoryCollection(n,_.extend({},t,{parse:!0}))},videos:function(n,t){return new r(n,_.extend({},t,{parse:!0,type:"category"}))}},i.Models.BaseCategory.prototype.associations)});i.Models.Series=i.Models.BaseCategory.extend({associations:_.extend({videos:function(n,t){return new r(n,_.extend({},t,{parse:!0,type:"series"}))}},i.Models.BaseCategory.prototype.associations)});i.Models.Topic=i.Models.BaseCategory.extend({associations:_.extend({videos:function(n,t){return new r(n,_.extend({},t,{parse:!0,type:"topic"}))}},i.Models.BaseCategory.prototype.associations)});i.Models.UserChannel=i.Models.BaseCategory.extend({associations:_.extend({videos:function(n,t){return new r(n,_.extend({},t,{parse:!0,type:"userchannel"}))}},i.Models.BaseCategory.prototype.associations)});i.Models.MasterPlaylist=i.Models.BaseCategory.extend({associations:_.extend({videos:function(n,t){return new r(n,_.extend({},t,{parse:!0,type:"playlist"}))}},i.Models.BaseCategory.prototype.associations)})}(ClickView,EasyMoney),function(n){var t=n.Shared;t.Models.Clip=EasyMoney.NestedModel.extend({loaded:!1,urlRoot:"/api/clips",defaults:{startTime:0,endTime:0,duration:0,videoDuration:0,resourceType:"Clip"},associations:{video:function(n,i){return new t.Models.MasterVideo(n,i)},owner:function(n,i){return new t.Models.Owner(n,_.extend({},i,{parse:!0}))}},initialize:function(){this.listenTo(this,"sync",this.onSync);this.set("duration",this.getDuration())},onSync:function(){this.loaded=!0},validation:function(){var n=this.get("videoDuration"),t=this.get("startTime"),i=this.get("endTime");return{name:{required:!0,msg:"Title is required"},startTime:{timeRequired:!0,videoDuration:n,startTimeMax:i,clipMinDuration:i},endTime:{timeRequired:!0,videoDuration:n,endTimeMin:t,clipMinDuration:t}}},getDuration:function(n){var t=this.get("endTime")-this.get("startTime");return n?n.inMs?t*1e3:void 0:t},save:function(n,t){n=n||this.toJSON();t=t||{};return n=_.omit(n,["video","owner"]),t.attrs=n,EasyMoney.NestedModel.prototype.save.call(this,n,t)},share:function(n){return t.Utils.AjaxHelper.get("/api/sharedResource",{resourceId:this.get("id"),resourceType:this.get("resourceType"),privacyId:n}).done(_.bind(function(n){this.trigger("shared",n,this)},this))},getAvailablePrivacies:function(){return this.get("video")?this.get("video").getAvailablePrivacies():[1,2]},currentUserIsOwner:function(){return n.Data.User?this.owner&&n.Data.User.username===this.owner.get("username"):!1}})}(ClickView);!function(n,t){n.Models.Group=t.Model.extend({name:"Group.js"})}(ClickView.Shared,EasyMoney);!function(n){"use strict";var t=n.Shared,i={"Primary Library":"ClickView Primary Library","Secondary Library":"ClickView Secondary Library"},r=t.Models.NestedCategory;t.Models.Library=r.extend({parseSchoolLibrary:function(t){var i=n.currentUser.get("schoolName");return t.tooltip=i+"'s library",t.name="School Library",t},parse:function(){var t=r.prototype.parse.apply(this,arguments);return n.currentUser.hasSyncedLibary()&&i[t.name]&&(t.name=i[t.name]),n.currentUser.isTertiaryCustomer()||t.id!==n.currentUser.get("customerId")||(t=this.parseSchoolLibrary(t)),t}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Models.MasterVideo=t.NestedModel.extend({loaded:!1,name:"MasterVideo",modules:{FreeToAir:"FREETOAIR",Exchange:"EXCHANGE",Library:"LIBRARY",SupplementaryLibrary:"SUPLIBRARY",Workspace:"WORKSPACE"},origins:{Livestream:"LIVESTREAM",iOS:"IOS_APP",Android:"ANDROID_APP",Windows:"WIN_APP",Online:"ONLINE",Cloud247:"CLOUD247"},defaults:{dateAired:"",description:"",duration:"",module:"",rating:"",resourceType:"MasterVideo",title:"",trackingCode:"",thumbnail:"",tags:"",series:{},categories:[],userChannels:[],topics:[]},urlRoot:"/api/videos",associations:{thumbnail:function(n,t){return new i.Models.Thumbnail(n,t)},owner:function(n,t){return new i.Models.Owner(n,t)},interactives:function(n,t){var r=new i.Collections.InteractiveResourceCollection(n,_.extend({},t,{mode:"server"}));return r._hasFetched=!0,r},clips:function(n,t){var u=n&&n.pagination,f=n&&n.data&&n.data.slice(0,7),r=new i.Collections.VideoClipsCollection(f,_.extend({},t,{pagination:u}));return r._hasFetched=!0,r},resources:function(n,t){var r=new i.Collections.MasterResourceCollection(n,_.extend({},t,{parse:!0}));return r._loaded=!0,r},libraries:function(n,t){return new i.Collections.LibraryCollection(n,_.extend({},t,{parse:!0}))},categories:function(n,t){return new i.Collections.CategoryCollection(n,_.extend({},t,{parse:!0}))},userChannels:function(n,t){return new i.Collections.UserChannelCollection(n,_.extend({},t,{parse:!0}))},tags:function(n,t){return new i.Collections.TagCollection(n,_.extend({},t,{parse:!0}))},series:function(n,t){return new i.Models.Series(n,_.extend({},t,{parse:!0}))},topics:function(n,t){return new i.Collections.TopicsCollection(n,_.extend({},t,{parse:!0}))},playlists:function(n,t){return new i.Collections.PlaylistsCollection(n,_.extend({},t,{parse:!0}))},producer:function(n,i){return new t.Model(n,i)},chapters:function(n,i){return new t.PagedCollection(n,i)},restrictions:function(n,t){return new i.Collections.RestrictionCollection(n,t)},localCacheDownloads:function(n,t){return new i.Collections.LocalCacheDownloadCollection(n,t)}},initialize:function(n,t){t||(t={});this.listenTo(this,"sync",this.onSync);this.get("trackingCode")&&this.onSync();t.loaded&&(this.loaded=!0)},onSync:function(){this.loaded=!0},parse:function(n){return this._parsed?n:(this._parsed=!0,i.Helpers.MasterToOnlineVideo(n))},omitAttrsOnSave:function(){return _.keys(this.associations)},studentSharingEnabled:function(){var i=new n.Shared.Collections.CustomerSettingCollection(n.Data.CustomerSettings),t=i.getByName(n.Shared.SettingOptions.Permanent.STUDENT_WS_SHARING);return t&&!!t.get("value")},getAvailablePrivacies:function(){if(this.isUserChannelVideo())return[3];if(this.isExchangeVideo()||this.isLibraryVideo())return[2];if(this.isLivestreamVideo())return this.studentSharingEnabled()?[1,2,3]:[1,2];if(this.isBroadcast())return[1,2];if(this.isWorkspaceVideo()&&(this.isUserUploadVideo()||this.isMobileUpload())){if(this.isUsersWorkspaceVideo()&&n.Data.User.role===1&&this.studentSharingEnabled())return[1,2,3];if(this.isUsersWorkspaceVideo()&&n.Data.User.role===2)return[1,2,3]}return[1,2]},getActionUrl:function(){return i.Services.ObjectLinkService.getVideoUrl(this)},actionUrl:function(){return this.getActionUrl()},getShareRequestData:function(n){var t;return t=this.isMasterVideo()?{resourceId:this.get("id"),resourceType:"MasterVideo"}:{resourceId:this.get("trackingCode"),resourceType:"Video"},(typeof n=="number"||typeof n=="string")&&(t.privacyId=n),t},share:function(n){var t=this.getShareRequestData(n);return i.Utils.AjaxHelper.get("/api/sharedResource",t).done(_.bind(function(n){this.trigger("shared",n,this)},this))},toAnalyticsObject:function(){return{curatorUsername:this.get("userName"),programId:this.get("id"),title:this.get("title"),trackingCode:this.get("trackingCode"),workspaceId:this.get("workspaceId")}},getModule:function(){var n=this.get("module");return _.isString(n)?n.toUpperCase():""},getLibraries:function(){if(!this.libraries)return[];if(this.isOnlineLibraryVideo())return["hosted_library"];var n=this.libraries?this.libraries.toJSON():this.get("libraries").data&&this.get("libraries").data;return n?_.map(n,function(n){return n.type}):[]},getLibraryIds:function(){return this.libraries.map(function(n){return n.get("id")})},isMasterLibraryVideo:function(){return this.isMasterVideo()&&_.contains(this.getLibraries(),"hosted_library")},isExchangeVideo:function(){return _.contains(this.getLibraries(),"exchange")},isWorkspaceVideo:function(){return _.contains(this.getLibraries(),"workspace")},isUsersWorkspaceVideo:function(){return this.isWorkspaceVideo()?this.libraries.any(function(t){return t.get("id")==n.Data.User.workspaceId}):!1},isCloud247Video:function(){return this.isCloud247()},isUserChannelVideo:function(){return this.get("userChannels")&&this.get("userChannels").length},canBeCurriculumMapped:function(){return this.isLibraryVideo()||this.isExchangeVideo()||this.isMasterLibraryVideo()},showLicence:function(){return this.isExchangeVideo()||this.isWorkspaceVideo()&&this.isCloud247()},isOnlineLibraryVideo:function(){return this.get("masterId")&&typeof this.get("masterId")=="number"?!1:n.Shared.Helpers.Guid.isGuid(this.get("id"))&&!n.Shared.Helpers.Guid.isEmptyGuid(this.get("id"))},isPlaylistVideo:function(){return!1},isLibraryVideo:function(){return this.isOnlineLibraryVideo()||this.isMasterLibraryVideo()},isSupLibraryVideo:function(){this.isOnlineLibraryVideo()},isMasterVideo:function(){return!n.Shared.Helpers.Guid.isGuid(this.get("id"))||n.Shared.Helpers.Guid.isEmptyGuid(this.get("id"))},isLivestreamVideo:function(){return this.getMasterOrigin()===this.origins.Livestream},isMobileUpload:function(){var n=this.getMasterOrigin(),t=[this.origins.Windows,this.origins.Android,this.origins.iOS];return _.contains(t,n)},isUserUploadVideo:function(){return this.getMasterOrigin()===this.origins.Online},isCloud247:function(){return this.getMasterOrigin()===this.origins.Cloud247},isBroadcast:function(){return!!this.hasChannel()||!!this.get("dateBroadcast")},isRestricted:function(){if(!this.hasRestriction()||n.currentUser.isAdmin())return!1;var t=n.currentUser.get("yearGroupId"),i=n.Shared.Constants.OnlineYearGroups;return i[t]?this.restrictions.any(function(i){return i.get("groupId")===n.Shared.Constants.OnlineYearGroups.All?!0:i.get("groupId")===t?!0:!1}):!0},hasRestriction:function(){return this.restrictions&&this.restrictions.length?!0:!1},restrictionHasExpiry:function(){return this.hasRestriction()?!!this.getRestriction().get("expiresOn"):!1},getRestriction:function(){if(!this.hasRestriction())return null;var n=this.restrictions.max(function(n){return n.get("groupId")}).clone(),t=n.get("groupId");return n.set("name",this.getRestrictionName(t)),n.set("objectId",this.get("id")),n.set("description",this.getRestrictionDescription(t)),n.set("displayText",this.getRestrictionDisplayName(t)),n},getRestrictionDisplayName:function(t){return n.Shared.Constants.OnlineYearGroupMetadata[t].displayText},getRestrictionName:function(t){return n.Shared.Constants.OnlineYearGroupMetadata[t].name},getRestrictionDescription:function(t){return n.Shared.Constants.OnlineYearGroupMetadata[t].description},getRestrictedBy:function(n){if(!this.hasRestriction())return null;n||(n={});var r=typeof n.beginningOfSentence!==undefined?n.beginningOfSentence:!1,t=this.getRestriction(),i=r?"Your ClickView Administrator":"your ClickView Administrator";return t.get("restrictedByFirstName")&&t.get("restrictedByLastName")&&(i=t.get("restrictedByFirstName")[0]+" "+t.get("restrictedByLastName")),i},existsInLocalCache:function(){return this.localCacheDownloads&&!!this.localCacheDownloads.length},hasChannel:function(){return this.channel&&this.channel.get("id")},isProducedByClickView:function(){return this.producer&&this.producer.get("id")==n.Data.Config.resources.clickViewProducerId},currentUserIsOwner:function(){return n.Data.User.username&&this.owner.get("username")===n.Data.User.username},getMasterOrigin:function(){return n.Shared.Helpers.ParseMasterOrigin(this.get("origin"))},getVideoOrigin:function(){return this.isLibraryVideo()?"library":this.isExchangeVideo()?"exchange":this.isWorkspaceVideo()?"workspace":""},getActionGroupName:function(){var n="";return this.isExchangeVideo()?n="Exchange":this.isWorkspaceVideo()&&(n="Workspace"),!n||(n+=" Actions"),n},getActionGroups:function(n){var t=new i.Models.VideoActionGroupCollection,r=new i.Models.VideoActionGroup,u=new i.Models.VideoActionGroup({name:this.getActionGroupName()}),f=function(n){return n==="workspace"||n==="exchange"},e=function(n){return n==="hosted_library"};return n.each(function(n){var t=n.get("allowedLibs");_.any(t,f)&&!_.any(t,e)?u.actions.add(n):r.actions.add(n)}),!r.actions.length||t.add(r),!u.actions.length||t.add(u),t},save:function(n,i){var r=this.get("name"),u=this.get("description");return i=_.extend({},i,{attrs:{name:r,description:u}}),t.Model.prototype.save.call(this,n,i)}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Models.Organisation=t.Model.extend({defaults:{tooltip:"This video was uploaded by a verified member of the ClickView Content Team"}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Models.Owner=t.NestedModel.extend({associations:{customer:t.Model,customers:function(n){return new i.Collections.Customers(n,{parse:!0})},organisation:function(n,t){return new i.Models.Organisation(n,t)},groups:function(n,t){return new i.Collections.Groups(n,t)}},initialize:function(){this.formatOrganisation()},formatOrganisation:function(){this.customers&&this.customers.length&&(this.set("customer",this.customers.at(0).toJSON()),this.set("organisation",this.customer.get("organisation")))},isVerified:function(){return this.get("groups")?this.get("groups").some(function(n){return n.get("id")===2046453},this):!1},toJSON:function(){return _.extend(t.NestedModel.prototype.toJSON.apply(this,arguments),{verified:this.isVerified()})}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Models.Tag=t.Model.extend({defaults:{title:""}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Models.Thumbnail=t.Model.extend({name:"Thumbnail",defaults:{size:"small",bgColor:"000"},getUrl:function(n){n||(n={});var t=new URI(this.get("url")||""),i=n.size||this.defaults.size,r=n.bgColor||this.defaults.bgColor;return t.authority()==="api-image.clickviewapp.com"&&t.authority("img.clickviewapp.com"),t.authority()==="img.clickviewapp.com"&&t.addSearch("size",i)&&t.addSearch("bgColor",r),t.protocol(""),t.toString()},toString:function(){return this.getUrl()}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Models.BaseInteractiveModel=t.NestedModel.extend({constructor:function(){this.listenTo(this,"sync",this._onSync);this.listenTo(t.Events,"initial-sync",this._onSync);t.NestedModel.prototype.constructor.apply(this,arguments)},_onSync:function(){this._savedState=this.toJSON()},revert:function(){this._savedState&&(this.clear({silent:!0}),this.set(this._savedState,{reset:!0}),this._hasChanges=!1,t.Events.trigger("initial-sync"),t.Events.trigger("revert"))},print:function(){}})}(ClickView,EasyMoney);!function(n){"use strict";var t=n.Shared;t.Models.ActionableItem=t.Models.BaseInteractiveModel.extend({name:"ActionableItem.js",defaults:{selected:!1,text:null,order:0,name:""},initialize:function(){}})}(ClickView,EasyMoney),function(n,t){n.Models.Chapter=t.Model.extend({defaults:{id:null,title:null,checksum:null,duration:null}})}(ClickView.Shared,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Models.Interaction=i.Models.BaseInteractiveModel.extend({name:"interaction",url:function(){return"/api/interactions/bulk"+(this.has("id")?"/"+this.get("id"):"")},defaults:{data:{}},validation:function(){return n.Interactive&&n.Interactive.Utils&&typeof n.Interactive.Utils.GetValidation=="function"?n.Interactive.Utils.GetValidation(this.type.get("id")):{}},initialize:function(){this.listenTo(this.data,"change",this.onDataChange);this.listenTo(this,"change",this.onChange);this.listenTo(this,"sync",this.onSync)},onChange:function(){this._hasChanges=!0},onDataChange:function(){this.trigger("change")},onSync:function(){this.resetChanges()},resetChanges:function(){this._hasChanges=!1},hasChanges:function(){return this._hasChanges},associations:{type:t.Model,data:t.Model,actionableItems:function(n,t){return new i.Collections.ActionableItemsCollection(n,t)}},getTimepoint:function(){return this.collection.parent},getType:function(){return this.type.get("id")},setType:function(n){this.type=n}})}(ClickView,EasyMoney),function(){"use strict";var n=ClickView.Shared;n.Models.Interactive=n.Models.BaseInteractiveModel.extend({defaults:{id:null,url:null,readOnly:!1,player:"clickview",autoplay:!0,currentChapter:0,startTime:!1},url:function(){return"/api/interactives/"+this.get("id")},initialize:function(n,t){this.options=t||{};this.listenTo(this,"sync",this.onSync);this.get("id")&&this.get("name")&&(this._loaded=!0);this.options.playPage&&this.setUpService(t.edit);this.listenTo(this,"change:chapters",this.setDuration)},associations:{timepoints:function(t,i){return new n.Collections.TimePointCollection(t,i)},chapters:function(t,i){return new n.Collections.ChapterCollection(t,i)}},setUpService:function(n){ClickView.Interactive&&ClickView.Interactive.Services&&typeof ClickView.Interactive.Services.InteractiveService=="function"&&(ClickView.Interactive.InteractiveService=new ClickView.Interactive.Services.InteractiveService({model:this,edit:n}))},setDuration:function(){var n=0;this.chapters.each(function(t){n+=t.get("duration")*1e3});this.set("duration",n)},isAutoplay:function(){return this.get("autoplay")&&this.get("readOnly")},getProgress:function(){var n=(this.get("currentTime")||0)/this.get("duration");return n*100},getDuration:function(){return this.get("duration")},getPosterImage:function(){return this.get("posterImage")},onSync:function(){this._loaded=!0;EasyMoney.Events.trigger("initial-sync")},parse:function(n){return this.has("duration")&&(n.duration=this.get("duration")),n},startSession:function(){if(this.get("readOnly")){this._triggerStart(0);return}if(!this.options.metadataId)throw new Error("Please provide a metadataId");var n="/api/interactives/"+this.get("id")+"/metadata/"+this.options.metadataId+"/start",t=this;$.ajax({url:n,method:"POST",success:function(n){n&&_.isNumber(n.resultId)&&t._triggerStart(n.resultId)}})},hasChapters:function(){return this.has("chapters")&&this.get("chapters").length},getNextTimepoint:function(n){var t=this.timepoints.indexOf(n);return this.timepoints.at(t+1)},getPreviousTimepoint:function(n){var t=this.timepoints.indexOf(n);return this.timepoints.at(t-1)},_triggerStart:function(n){this.set("resultId",n);this.trigger("start",this)},isLoaded:function(){return this._loaded||!1}})}();!function(n,t){"use strict";var i=n.Shared;i.Models.InteractiveResource=t.NestedModel.extend({name:"InteractiveResource",url:function(){return"/api/videos/"+this.get("videoId")+"/interactives"+(this._copy?"?copy=true":"")},destroy:function(n){return n||(n={}),n.url="/api/interactives/"+this.get("id")+"/metadata",t.NestedModel.prototype.destroy.call(this,n)},initialize:function(){this.listenTo(this,"loaded sync",this.onSync);this.listenTo(this,"copy",this.onCopy);this.ajaxService=i.Utils.AjaxHelper},associations:{video:function(t,i){return new n.Shared.Models.MasterVideo(t,_.extend({},i,{parse:!0}))},thumbnail:function(n){return new i.Models.Thumbnail(n)}},validation:{name:{required:!0}},onSync:function(){this._loaded=!0},onCopy:function(){this.set("userHasCopy",!0);this.onSync()},isOnlineInteractive:function(){return i.Helpers.Guid.isGuid(this.get("videoId"))},getUsername:function(){return this.isOnlineInteractive()?this.get("username"):this.get("owner").username},getThumbnail:function(t){t||(t={});var i="";return(this.thumbnail&&this.thumbnail.get("url")&&(i=this.thumbnail.get("url")),this.get("thumbnailUrl")&&(i=this.get("thumbnailUrl")),i)?n.Shared.Helpers.createThumbnailUrl(i,t):n.Shared.Helpers.getThumbnailUrl(this.get("video"))},actionUrl:function(){return"/interactives/play/"+this.get("id")},getAvailablePrivacies:function(){return this.get("video").getAvailablePrivacies()||[2]},share:function(n){var t={resourceId:this.get("id"),resourceType:"interactive"};return t.privacyId=n,this.set("privacyId",n),this.ajaxService.get("/api/sharedResource",t).success(_.bind(function(n){this.trigger("shared",n,this)},this))},isLoaded:function(){return this._loaded||!1},isExchangeVideo:function(){return!1},isWorkspaceVideo:function(){return!1},canBeCurriculumMapped:function(){return!1},showLicence:function(){return!1},isLibraryVideo:function(){return!1},isSupLibraryVideo:function(){var t=this.get("libraryOwnerId");return _.some(n.Data.User.supplementaryLibraries,function(n){return t===n.schoolId})},isMasterVideo:function(){return!1},toVideoJSON:function(){var n=this.getStandardizedVideo();return _.extend(n,{title:this.get("name"),description:this.get("description")||n.description})},getStandardizedVideo:function(){return _.pick(this.video.toJSON(),"id","trackingCode","name","description","duration","rating")},copy:function(){return this._copy=!0,this.save()},save:function(n,i){n=_.extend({},this.toJSON(),n);i=i||{};return n=_.omit(n,["video"]),i.attrs=n,t.NestedModel.prototype.save.call(this,n,i)}},{newResource:function(t){var i=t.get("masterId")||t.get("id"),r=n.Shared.Helpers.Guid.isEmptyGuid(t.get("ownerId"))?n.Data.SupLibId||n.Data.User.customerId:t.get("ownerId");return new this({description:"",duration:this.getDurationFromVideo(t),name:"",videoId:i,videoTitle:this.getTitleFromVideo(t),trackingCode:t.get("trackingCode"),libraryOwnerId:r})},getDurationFromVideo:function(n){return i.Helpers.Guid.isGuid(n.get("id"))?n.get("duration")*1e3:n.get("duration")},getTitleFromVideo:function(n){return i.Helpers.Guid.isGuid(n.get("id"))?n.get("title"):n.get("name")}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Models.TimePoint=i.Models.BaseInteractiveModel.extend({name:"TimePoint",url:function(){return"/api/timepoints"+(this.isNew()?"":"/"+this.get("id"))},associations:{interactions:function(n,t){return new i.Collections.InteractionCollection(n,t)}},initialize:function(){this.listenTo(this,"change",this.onChange);this.listenTo(this,"sync",this.onSync)},onChange:function(){t.Events.trigger("timepoint:disableProgress",!0);this._hasChanges=!0},onSync:function(){this.resetChanges()},resetChanges:function(){t.Events.trigger("timepoint:disableProgress",!1);this._hasChanges=!1},hasChanges:function(){return this._hasChanges},getDisplayTime:function(){return this.get("visibleAt")},getDisplayDuration:function(){return this.get("visibleFor")?this.get("visibleFor"):1e3},getType:function(){console.log("This shouldn't be called on a timepoint")},shouldPause:function(){return this.get("shouldPause")},setCurrent:function(n){this.set("current",n,{silent:!0});this.trigger("current-changed")},isCurrent:function(){return this.get("current")||!1},removeEmptyAlternatives:function(){n.Interactive&&n.Interactive.Utils&&!~i.Utils.InteractionEnum&&this.interactions.each(function(t){if(t.get("typeId")===n.Interactive.Utils.InteractionEnum.MultipleChoice){var i=t.actionableItems.last();i.get("name")||t.actionableItems.pop()}})}})}(ClickView,EasyMoney);!function(n){"use strict";var t=n.Shared;t.Models.NavigationViewModel=t.Models.NestedCategory.extend({defaults:{showChildren:!1},initialize:function(){this.children&&this.listenTo(this.children,"sync",this.onLoad)},navigateUrl:function(){return this.rootUrl+this.get("id")+"/"+this._toLowerDash("name")},hightlightUrl:function(){return this.rootUrl+this.get("id")},onLoad:function(){this.loaded=!0;this.trigger("sync")},parse:function(n){return(n=n.data||n,n.length)?(this.set("children",n),null):n},fetch:function(){return this.children.fetch()},hasFetched:function(){return this.children.hasFetched()},_toLowerDash:function(n){var i=this.get(n)||"";return t.Utils.slugify(i)}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Models.LibraryCategory=t.NestedModel.extend({associations:{children:function(n,t){return new i.Collections.LibraryCategoriesCollection(n,t)}}});i.Collections.LibraryCategoriesCollection=t.Collection.extend({url:"/api/mylibrary/nav",model:i.Models.LibraryCategory});i.Models.LibraryNavigationViewModel=i.Models.NavigationViewModel.extend({associations:{children:function(n,t){return new i.Collections.LibraryCategoriesCollection(n,t)}}});i.Collections.SupLibCategoriesCollection=t.Collection.extend({url:function(){return"/api/suplib/nav?sid="+this.parent.get("sid")},model:i.Models.LibraryCategory});i.Models.SupLibNavigationViewModel=i.Models.NavigationViewModel.extend({associations:{children:function(n,t){return new i.Collections.SupLibCategoriesCollection(n,t)}}})}(ClickView,EasyMoney),function(n){n.Shared.Models.Video=EasyMoney.Model.extend({defaults:{id:"",year:"",score:0,title:"",rating:"",series:"",tokenId:"",category:{},producer:"",fileSize:0,libraryId:"",dateCreated:"",description:"",ratingValue:0,previewOpen:!1,origin:"",source:"",module:"",ownerId:null,checked:!1,isNew:!1},actionUrl:function(){var t="";switch(this.get("module")){case"LIBRARY":t="/mylibrary/videos/"+this.get("id");break;case"EXCHANGE":t="/exchange/videos/"+this.get("id");break;case"WORKSPACE":t="/workspace/videos/"+this.get("id");break;case"SUPLIBRARY":t="/suplibrary/videos/"+this.get("id");break;case"FREETOAIR":t="/exchange/videos/"+this.get("id")+"/"+n.Shared.Helpers.Slugify(this.get("title"))}return t},toggle:function(){this.set({selected:!this.get("selected")})},getAjaxData:function(){return{resourceId:this.get("tokenId"),resourceType:this.get("resourceType")||"video"}},parse:function(n){return n.year<1900&&(n.year=null),n},share:function(t){var i=this.getAjaxData();return this.get("resourceType")==="interactive"&&this.get("interactiveVideoId")&&(i={resourceId:this.get("interactiveVideoId"),resourceType:"interactive"}),_.isNumber(t)&&(i.privacyId=t),this.set("privacyId",t),n.Shared.Utils.AjaxHelper.get("/api/sharedResource",i).success(_.bind(function(n){this.trigger("shared",n,this)},this))},getAvailablePrivacies:function(){return this.isExchangeVideo()?[2]:this.isLibraryVideo()?[2]:this.isUserUploadVideo()||this.isMobileUpload()||this.isLivestreamVideo()?[1,2,3]:this.isWorkspaceVideo()&&!this.isCloud247()&&(n.Data.User.role===2||n.Data.User.role===1&&n.Data.AllowStudentsSharing)?[1,2,3]:[1,2]},toAnalyticsObject:function(){return{title:this.get("title"),programId:this.get("id"),workspaceId:this.get("workspaceId"),trackingCode:this.get("trackingCode"),curatorUsername:this.get("userName")}},getModule:function(){var n=this.get("module");return _.isString(n)?n.toUpperCase():""},isMasterVideo:function(){return this.getModule()=="FREETOAIR"},hasUserChannels:function(){return this.get("userChannels")&&this.get("userChannels").length},isExchangeVideo:function(){return this.getModule()=="EXCHANGE"||this.getModule()=="FREETOAIR"},isLibraryVideo:function(){return this.getModule()=="LIBRARY"||this.getModule()=="SUPLIBRARY"},isSupLibraryVideo:function(){return this.getModule()=="SUPLIBRARY"},isWorkspaceVideo:function(){return this.getModule()=="WORKSPACE"},isUserUploadVideo:function(){return(this.get("origin")||"").toUpperCase()=="USER_UPLOAD"},isLivestreamVideo:function(){return(this.get("origin")||"").toUpperCase()==="LIVESTREAM"},isMobileUpload:function(){var n=(this.get("origin")||"").toUpperCase();return["ANDROID_APP","IOS_APP","WINDOWS_APP"].indexOf(n)>-1},isCloud247:function(){return(this.get("origin")||"").toUpperCase()==="CLOUD247"},canBeCurriculumMapped:function(){return this.isLibraryVideo()||this.isExchangeVideo()},showLicence:function(){return this.isExchangeVideo()||this.isWorkspaceVideo()&&this.isCloud247()},getVideoOrigin:function(){return this.isLibraryVideo()||this.isSupLibraryVideo()?"library":this.isExchangeVideo()?"exchange":this.isWorkspaceVideo()?"workspace":""}});n.Shared.Models.InteractiveVideo=n.Shared.Models.Video.extend({idAttribute:"interactiveVideoId",url:function(){return"/api/interactives/videos/"+this.get("id")},actionUrl:function(){return"/interactives/videos/"+this.get("id")},share:function(){var t={resourceId:this.get("interactiveVideoId"),resourceType:"interactive"},i=2;return t.privacyId=i,this.set("privacyId",i),n.Shared.Utils.AjaxHelper.get("/api/sharedResource",t).success(_.bind(function(n){this.trigger("shared",n,this)},this))}})}(ClickView);!function(n){var t=n.Models.MasterVideo.prototype;n.Models.AlbertVideo=n.Models.MasterVideo.extend({name:"AlbertVideo.js",idAttribute:"trackingCode",actionUrl:function(){return"/videos/"+this.get("id")+"/"+n.Helpers.Slugify(this.get("title"))},parse:n.Helpers.MasterToOnlineVideo})}(ClickView.Shared,EasyMoney);!function(n,t){n.DashboardConstants={WIDGET_TYPES:{SmallSlidingList:0,BigSlidingList:1,Hero:2}};n.Models.Dashboard=t.NestedModel.extend({name:"Dashboard.js",url:"/api/dashboard",associations:{widgets:function(t,i){return new n.Collections.WidgetCollection(t,i)}},initialize:function(n){this.listenTo(this,"sync",this.onSync);n&&n.length&&(this._loaded=!0)},onSync:function(){this.setLoaded()},hasFetched:function(){return this._loaded},setLoaded:function(){this._loaded=!0},resetLoaded:function(){this._loaded=!1},getHeroItem:function(){return this.get("widgets").findWhere({type:n.DashboardConstants.WIDGET_TYPES.Hero})},getSlidingListWidgets:function(){return this.get("widgets").filter(function(t){return t.get("type")===n.DashboardConstants.WIDGET_TYPES.SmallSlidingList||t.get("type")===n.DashboardConstants.WIDGET_TYPES.BigSlidingList})}})}(ClickView.Shared,EasyMoney);!function(n,t){n.Models.Widget=t.NestedModel.extend({name:"Widget.js",defaults:{videos:[],banner:{}},url:function(){throw new Error("Implement in extending view");},initialize:function(){this.listenTo(this,"sync error",this.onSync)},associations:{banner:function(n,i){return new t.Model(n,i)}},onSync:function(){this.videos.trigger("sync");this.loaded=!0},hasFetched:function(){return this.loaded},getSlides:function(){return this.get("videos").map(function(n){return{name:n.get("title"),duration:n.get("duration"),image:ClickView.Shared.Helpers.getThumbnailUrl(n),href:n.actionUrl(),isVideo:n instanceof ClickView.Shared.Models.MasterVideo,pageLoad:!0,series:n.get("series")&&n.get("series").get("name"),seriesHref:ClickView.Shared.Services.ObjectLinkService.getSeriesUrl(n.get("series")),hasInteractives:n.get("hasInteractives")||n.interactives&&n.interactives.length>0,originalModel:n}})},isSmall:function(){return this.get("type")===n.DashboardConstants.WIDGET_TYPES.SmallSlidingList}})}(ClickView.Shared,EasyMoney),function(n,t){"use strict";var i=n.Shared;i.Models.Analytics=t.Model.extend({url:"/analytics/collect",defaultOptions:{shouldLog:!0},eventNames:{},initialize:function(n,t){this.options=_.extend({},this.defaultOptions,t)},log:function(n,t){if(!this.options.shouldLog){console&&console.log("Event Logging: ",n,t);return}var i=new Image;i.src=this.url+"?"+this.buildParams(n,t)},buildParams:function(n,t){t=_.extend({RequestUrl:this._getCurrentUrl(),Referrer:document.referrer},this.toJSON(),t);var i={e:n,sr:this._getViewPortSize(),d:JSON.stringify(t)};return $.param(i)},_getViewPortSize:function(){return window.innerWidth+"x"+window.innerHeight},_getCurrentUrl:function(){return window.location.href}})}(ClickView,EasyMoney);!function(n){"use strict";n.Models.CheckBoxWrapper=EasyMoney.Model.extend({name:"CheckBoxWrapper",initialize:function(){if(this.collection=this.get("collection"),!this.collection.selected||!_.isFunction(this.collection.selected))throw new Error("Please ensure collection has a 'selected' method when instantiating "+this.name);this.listenTo(this.collection,"change:selected destroy remove",this.checkSelected);this.checkSelected()},checkSelected:function(){this.set("selected",this.collection.selected().length===this.collection.length&&this.collection.length>1)},toggle:function(){this.collection.trigger("selected",!this.get("selected"))}});n.Models.PlaylistWrapper=EasyMoney.Model.extend({name:"PlaylistWrapper",initialize:function(){this.collection=this.get("collection")},iterate:function(n){_.each(this.collection,function(t){n(t)})},map:function(n){return _.map(this.collection,function(t){return n(t)})},length:function(){return this.collection.length},getTokenId:function(){return _.first(this.collection).get("tokenId")}});n.Models.PushToWrapper=EasyMoney.Model.extend({isMasterVideo:function(){return!0},isWorkspaceVideo:function(){return!0}})}(ClickView.Shared),function(n,t){var i=n.Shared;i.Models.EmailSubscribe=t.Model.extend({defaults:{emailAddress:"",confirmUrl:"",verifyUrl:"",resendUrl:""},initialize:function(){this.listenTo(this,"sync",this.onSync);this.listenTo(this,"request",this.onRequest)},onSync:function(){this.setLoaded()},onRequest:function(){this.resetLoaded()},setLoaded:function(){this._loaded=!0},resetLoaded:function(){this._loaded=!1},hasLoaded:function(){return!!this._loaded},validation:{emailAddress:{required:!0,pattern:"email",msg:"Please provide a valid email address"}}})}(ClickView,EasyMoney),function(n,t){"use strict";n.Models.ExchangeBannerItem=t.Model.extend({defaults:{id:"",title:"",description:"",image:""}})}(ClickView.Shared,EasyMoney),function(n,t){n.Models.EZProxy=t.Model.extend({defaults:{id:null,schoolId:null,host:"",subDomain:""},url:"/api/customers/"+ClickView.Data.User.customerId+"/ez-proxy"})}(ClickView.Shared,EasyMoney);ClickView.Shared.Models.Count=EasyMoney.Model.extend({defaults:{},name:"count"});ClickView.Shared.Models.LiveStreamCount=EasyMoney.Model.extend({defaults:{},name:"livestream-count",url:"/api/livestream/count",getCount:function(){return this.get("liveCount")+this.get("archiveCount")}});!function(n,t){"use strict";var i=n.Shared;i.Models.YearLearningArea=t.NestedModel.extend({defaults:{subject:{},year:{},strand:{},subStrand:{},collection:[]},associations:{subject:function(n,i){return new t.Model(n,_.extend({},i,{parse:!0}))},year:function(n,i){return new t.Model(n,_.extend({},i,{parse:!0}))},strand:function(n,i){return new t.Model(n,_.extend({},i,{parse:!0}))},subStrand:function(n,i){return new t.Model(n,_.extend({},i,{parse:!0}))},collection:function(n,t){return new i.Collections.SubStrandLearningAreaCollection(n,_.extend({},t,{parse:!0}))}}});i.Models.SubStrandLearningArea=i.Models.YearLearningArea.extend({associations:_.extend({},i.Models.YearLearningArea.prototype.associations,{collection:function(n,t){return new i.Collections.CurriculumCollection(n,_.extend({},t,{parse:!0}))}})});i.Models.Curriculum=t.Model.extend({})}(ClickView,EasyMoney),function(n,t){n.Shared.Models.Playlist=t.Model.extend({defaults:{id:null,name:"",type:"1",videos:[],videoCount:0,privacyId:1},urlRoot:"/api/playlists",_requesting:"",initialize:function(){this.listenTo(this,"video-sync",this.onSync);this.listenTo(this,"video-error",this.onError);this.listenTo(this,"video-request",this.onRequest)},onSync:function(){this._requesting=!1},onRequest:function(){this._requesting=!0},onError:function(){this._requesting=!1},isRequesting:function(){return this._requesting},onAddSuccess:function(n,t){this.trigger("video-sync");n||(n={});t.success&&this.increment("videoCount",n.count);this.trigger("addVideo",t)},onRemoveSuccess:function(n,t){this.trigger("video-sync");n||(n={});t.success&&this.decrement("videoCount",n.count);this.trigger("removeVideo",t)},onXhrError:function(){this.trigger("video-error")},getVideoIds:function(n){return n.map(function(n){return n.get("id")})},addVideo:function(n){if(_.isArray(n)){this.addVideos(n);return}return this.trigger("video-request"),$.ajax({type:"post",url:"/api/playlists/"+this.get("id"),data:JSON.stringify({videoIds:n.get("id")}),dataType:"json",contentType:"application/json; charset=utf-8"}).success(_.bind(this.onAddSuccess,this,{count:1})).error(_.bind(this.onXhrError,this))},addVideos:function(t){var r=this.urlRoot+"/"+this.get("id"),i=this.getVideoIds(t);this.trigger("video-request");n.Shared.Utils.AjaxHelper.post(r,i).success(_.bind(this.onAddSuccess,this,{count:i.length})).error(_.bind(this.onXhrError,this))},removeVideo:function(n){if(_.isArray(n)){this.removeVideos(n);return}return this.trigger("video-request"),$.ajax({type:"delete",url:"/api/playlists/"+this.get("id")+"/videos/"+n.get("id"),dataType:"json",contentType:"application/json; charset=utf-8"}).success(_.bind(this.onRemoveSuccess,this,{count:1})).error(_.bind(this.onXhrError,this))},removeVideos:function(t){var r=this.urlRoot+"/"+this.get("id")+"/videos/delete",i=this.getVideoIds(t);this.trigger("video-request");n.Shared.Utils.AjaxHelper.post(r,i).success(_.bind(this.onRemoveSuccess,this,{count:i.length})).error(_.bind(this.onXhrError,this))},share:function(t){var i={resourceId:this.get("id"),resourceType:"playlist"};return _.isNumber(t)&&(i.privacyId=t),this.set("privacyId",t),n.Shared.Utils.AjaxHelper.get("/api/sharedResource",i).success(_.bind(function(n){this.trigger("shared",n,this)},this))},getAvailablePrivacies:function(){return[1,2,3]},isPlaylist:function(){return this.get("type")==1}});n.Shared.Collections.Playlists=t.Collection.extend({model:n.Shared.Models.Playlist})}(ClickView,EasyMoney),function(n){"use strict";n.Models.BaseSetting=EasyMoney.Model.extend({idAttribute:"name",defaults:{name:null,value:null},urlRoot:function(){if(!this.entityType)throw new Error("Must provide entity type e.g: customers or users");return"/api/v1/"+this.entityType+"/settings"}});n.Models.UserSetting=n.Models.BaseSetting.extend({entityType:"users"});n.Models.CustomerSetting=n.Models.BaseSetting.extend({entityType:"customers"})}(ClickView.Shared);!function(n,t){"use strict";var i=n.Shared;i.Models.ShareModel=t.NestedModel.extend({associations:{itemModel:t.Model,ezProxyModel:i.Models.EZProxy},templates:{iframeTemplate:'<iframe frameborder="0" allowfullscreen webkitallowfullscreen mozallowfullscreen width="{{width}}" height="{{height}}" src="{{embedUrl}}"><\/iframe>',embedUrlTemplate:"{{ezproxyhost}}{{protocol}}://{{hostname}}/share/embed?shareCode={{shortCode}}{{queryStrings}}"},isVideo:function(){return this.get("resourceType").type==="video"},isClip:function(){return this.get("resourceType").type==="clip"},getSnippet:function(){var t=this.itemModel.get("description")||this.itemModel.video&&this.itemModel.video.description;return t?n.Shared.Helpers.ToWordCount(t,20,!0):""},getImage:function(){var t=this.itemModel.get("trackingCode")||this.itemModel.get("tokenId")||this.itemModel.video&&this.itemModel.video.trackingCode;return!t?"":n.Data.Config.urls.imageCDN+"/v1/thumbnails/trackingcode/"+t+"?size=small"},getProtocol:function(n){return n?"https":"http"},getEmailLink:function(n){var t="Check out this "+this.get("resourceType").name+" on ClickView",i=function(n){return encodeURIComponent(n)},r=n.replace(/[?&]/g,i);return"mailto:?subject="+t+"&body="+r},getCurrentOnlineHost:function(){var i=document.createElement("a"),t;return i.href=this.ezProxyModel&&this.ezProxyModel.get("subDomain")?this.ezProxyModel.get("subDomain"):n.Data.Config.urls.onlineUrl,t=i.host,t.substring(0,t.indexOf(":")>=0?t.indexOf(":"):t.length)},generateQueryString:function(n,t){var r,u,i;return(t=t||[],r={t:{prop:"startTime",def:0},et:{prop:"endTime",def:0},i:{prop:"chapter",def:1}},this.get("canAutoplay")&&(r.a={prop:"autoPlay",def:""}),u=_.reduce(r,function(n,i,r){var u,f;return _.contains(t,i.prop)?n:(u=this.get(i.prop),u===i.def)?n:(f=typeof u,f!=="undefined"&&f!=="object")?n+"&"+r+"="+u.toString():n},"",this),i=u.replace(/^&/,"").trim(),i.length>0)?n+i:i},generateLinks:function(){var t={embedLink:"",resourceLink:"",emailLink:""},n=this.get("shortUrl"),i=this.getProtocol(this.get("secure")),r=n.indexOf("://");return r!=-1&&(n=i+n.substring(r)),this.ezProxyModel&&this.ezProxyModel.get("subDomain")&&(n=i+"://"+this.getCurrentOnlineHost()+"/share?shareCode="+this.get("shortCode")),this.ezProxyModel&&this.ezProxyModel.get("host")&&(n=this.ezProxyModel.get("host")+n),t.resourceLink=n+this.generateQueryString("?",["autoPlay"]),t.emailLink=this.getEmailLink(t.resourceLink),t},getEmbedUrlSrc:function(n){var r=this.get("autoPlay"),i;return n&&n.autoplay&&this.set("autoPlay",!0),i=t.template(this.templates.embedUrlTemplate,{ezproxyhost:!this.ezProxyModel.get("host")?"":this.ezProxyModel.get("host"),protocol:this.getProtocol(this.get("secure")),hostname:this.getCurrentOnlineHost(),shortCode:this.get("shortCode"),queryStrings:this.generateQueryString("&",null)}),n&&n.autoplay&&this.set("autoPlay",r),i},getEmbedUrl:function(){return t.template(this.templates.iframeTemplate,{height:this.get("height"),width:this.get("width"),embedUrl:this.getEmbedUrlSrc()})},getClipUrl:function(){return this.get("shortUrl")+this.generateQueryString("?")},generateMetadata:function(n){n||(n={autoplay:!0});var t="",i="";return this.isVideo()&&(i=this.getEmbedUrlSrc(n),t=this.get("shortUrl")),this.isClip()&&(i=this.getEmbedUrlSrc(n),t=this.getClipUrl()),{siteName:"clickview",type:this.get("resourceType").type,link:t,title:this.itemModel.get("title")||this.itemModel.get("name"),snippet:this.getSnippet(),image:this.getImage(),embedLink:i}}})}(ClickView,EasyMoney),function(n,t){"use strict";n.Models.SnippetViewModel=t.Model.extend({defaults:{enabled:!1,startTime:0,endTime:0,videoDuration:0,chapterIndex:0,currentTime:0}})}(ClickView.Shared,EasyMoney),function(n,t){"use strict";var i=n.Shared;i.Models.SpinnerModel=t.Model.extend({url:!1,defaults:{showSpinner:!1},initialize:function(){},show:function(){this.set("showSpinner",!0)},hide:function(){this.set("showSpinner",!1)}})}(ClickView,EasyMoney),function(n,t){n.Models.SubNavButton=t.Model.extend({defaults:{text:"",desc:"",view:null,args:{},order:0,cssClass:"",bulkAction:!1,alwaysActive:!1,stopPropagation:!0}})}(ClickView.Shared,EasyMoney),function(n,t){n.Shared.Models.Tab=t.Model.extend({defaults:{text:"",view:null,order:0,cssId:"",preload:!1,selected:!1,cssClass:"",beta:!1,rendered:!1,initParams:{}}});n.Shared.Collections.TabCollection=t.Collection.extend({model:n.Shared.Models.Tab,comparator:"order"})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.Shared;i.Models.UserEmail=t.Model.extend({url:"/api/account/email",resendUrl:"/api/account/email/resend",defaults:{emailAddress:"",status:-1},initialize:function(){this.listenTo(this,"sync",this.onSync);this.listenTo(this,"request",this.onRequest)},onSync:function(){this._loaded=!0},onRequest:function(){this._loaded=!1},hasLoaded:function(){return this._loaded},setLoaded:function(){this._loaded=!0},isVerified:function(){return this.get("emailAddress")&&this.get("status")===1},isPending:function(){return this.get("emailAddress")&&this.get("status")===0},validation:{emailAddress:{required:!0,pattern:"email",msg:"Please provide a valid email address"}}})}(ClickView,EasyMoney),function(n,t){n.Shared.Models.WebPlayer=t.Model.extend({defaults:{id:"",url:"",width:640,height:360,autoplay:!1,trackingCode:"",parameters:{}},setUrl:function(){var u=this.get("webPlayerHost")||n.Data.Config.urls.webplayer||"http://webplayer.clickview.com.au",f=u+"/home/ev",t=_.omit(this.get("parameters"),["p","vid"])||{},i,r;t.a=!!this.get("autoplay");i=this.get("id");$.isNumeric(i)?t.vid=i:t.p=this.get("trackingCode");r=n.Shared.Helpers.UrlBuilder(f,t);this.set("url",r)},initialize:function(){this.setUrl()}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Collections.BaseInteractiveCollection=t.Collection.extend({name:"TimePointCollection.js",constructor:function(){t.Collection.prototype.constructor.apply(this,arguments);this.listenTo(this,"change",this._onChange)},_onChange:function(){typeof this.parent=="object"&&this.parent instanceof t.NestedModel&&this.parent.trigger("change")}})}(ClickView,EasyMoney);!function(n){"use strict";var t=n.Shared;t.Collections.ActionableItemsCollection=t.Collections.BaseInteractiveCollection.extend({name:"ActionableItemsCollection",model:t.Models.ActionableItem,comparator:function(n){return n.get("order")},last:function(){return this.length===0?null:this.at(this.length-1)}})}(ClickView,EasyMoney),function(n,t){n.Collections.ChapterCollection=t.Collection.extend({model:n.Models.Chapter,getByTimepoint:function(n){for(var t=0,i=n,u,r;t<this.length;t++){if(u=this.at(t),r=u.get("duration"),i<=r)break;i-=r}return{index:t,timepoint:i}}})}(ClickView.Shared,EasyMoney);!function(n){"use strict";var t=n.Shared;t.Collections.InteractionCollection=t.Collections.BaseInteractiveCollection.extend({name:"InteractionCollection",model:t.Models.Interaction})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.Shared;i.Collections.InteractiveCollection=t.Collection.extend({url:"/api/term-updates",model:i.Models.InteractiveVideo,initialize:function(){this.listenTo(this,"sync",this.onLoad)},onLoad:function(){this._loaded=!0}});i.Collections.InteractionMappingCollection=t.Collection.extend({model:n.Shared.Models.InteractiveVideo,_hasSynced:!1,_videoId:null,initialize:function(){if(this._videoId=this.options.videoId,!this._videoId)throw new Error("Video id missing");this.listenTo(this,"sync",this._onSync)},hasSynced:function(){return this._hasSynced},_onSync:function(){this._hasSynced=!0},select:function(n){if(this.indexOf(n)===-1){console.log("Not in collection");return}var t=this.getSelected();(this.unselect(),t!==n)&&n.set("_selected",!0)},unselect:function(){this.each(function(n){n.set("_selected",!1)})},getSelected:function(){return this.findWhere({_selected:!0})},url:function(){return"/api/interactives/mappings/"+this._videoId}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Collections.InteractiveResourceCollection=t.PagedCollection.extend({name:"InteractiveResourceCollection",model:i.Models.InteractiveResource,_pageSize:25,mode:"client",url:function(){switch(this.options.type){case"online":return"/api/videos/"+this.options.id+"/interactives?trackingCode="+this.options.trackingCode;case"master":return"/api/videos/"+this.options.id+"/interactives";default:return"/api/user/interactives"}},initialize:function(){this.listenTo(this,"sync",this.onSync);this.on("selected",this.onSelected,this);this.options.pageSize&&this.options.pageSize!=="auto"&&(this._pageSize=this.options.pageSize)},onSync:function(){this.__private__.totalItems=this.models.length;this._fullCollection=this.set(this.toJSON());this.reset(this._getFullCollectionPage(this.currentPage()),{silent:!0});this.resetPageData();this._loaded=!0},resetPageData:function(){this.__private__.totalItems=this._fullCollection.length;this.__private__.totalPages=Math.ceil(this.__private__.totalItems/this._pageSize);this.__private__.pageSize=this._pageSize;this.__private__.page=1},getPagination:function(n){return{totalPages:Math.ceil(n.length/this._pageSize),totalItems:n.length,page:0,pageSize:this._pageSize}},_getFullCollectionPage:function(n){var t=Math.max(0,n-1)*this.pageSize(),i=Math.max(0,t)+this.pageSize();return this._fullCollection.slice(t,i)},parse:function(n,i){return n?(n={data:n,pagination:this.getPagination(n)},t.PagedCollection.prototype.parse.call(this,n,i)):null},onFetchSuccess:function(n,i){i||(i={});n={data:n,pagination:this.getPagination(n)};t.PagedCollection.prototype.onFetchSuccess.call(this,i,n)},onSelected:function(n){this.each(function(t){t.set("selected",n)})},selected:function(){return this.where({selected:!0})},isLoaded:function(){return this._loaded||!1}})}(ClickView,EasyMoney);!function(n){"use strict";var t=n.Shared;t.Collections.TimePointCollection=t.Collections.BaseInteractiveCollection.extend({name:"TimePointCollection",model:t.Models.TimePoint,clearCurrent:function(){this.each(function(n){n.setCurrent(!1)})},comparator:"visibleAt"})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Collections.BaseCategoryCollection=t.Collection.extend({page:1,initialize:function(){this.listenTo(this,"sync",this.onSync)},onSync:function(){this.loaded=!0},parse:function(n){return n&&n.data?(this.pagination=n.pagination,n.data):n},getMediaCount:function(){return this._mediaCount},getNextPage:function(){return!this.pagination||this.pagination.totalPages<=this.page?!1:(this.page++,this.fetch({remove:!1}))}});i.Collections.CategoryCollection=i.Collections.BaseCategoryCollection.extend({model:i.Models.Category,toFlat:function(){var n=[],t=function(i){n.push(i);i.categories&&_.each(i.categories,t)};return _.each(this.toJSON(),t),n}});i.Collections.SeriesCollection=i.Collections.BaseCategoryCollection.extend({model:i.Models.Series});i.Collections.TopicsCollection=i.Collections.BaseCategoryCollection.extend({model:i.Models.Topic});i.Collections.UserChannelCollection=i.Collections.BaseCategoryCollection.extend({model:i.Models.UserChannel});i.Collections.PlaylistsCollection=i.Collections.BaseCategoryCollection.extend({model:i.Models.MasterPlaylist})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Collections.Customers=t.Collection.extend({parse:function(n){return n||(n={}),n.data||n}})}(ClickView,EasyMoney);!function(n,t){n.Collections.Groups=t.PagedCollection.extend({name:"Groups.js",model:n.Models.Group})}(ClickView.Shared,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Collections.LibraryCollection=t.Collection.extend({model:i.Models.Library,parse:function(n){return n&&n.data?n.data:n}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Collections.TagCollection=t.Collection.extend({model:i.Models.Tag})}(ClickView,EasyMoney),function(n,t){n.Collections.VideoCollection=t.PagedCollection.extend({model:n.Models.Video,dataProperties:{items:"videos",pagination:"pagination"},defaults:{pageSize:15,firstPage:1,sortOption:0}})}(ClickView.Shared,EasyMoney);!function(n,t){n.Collections.WidgetCollection=t.Collection.extend({name:"WidgetCollection.js",model:n.Models.Widget})}(ClickView.Shared,EasyMoney),function(n){"use strict";var t=EasyMoney.Model.extend({defaults:{text:null,type:null,selected:!1}});n.Collections.ActionItemCollection=EasyMoney.Collection.extend({model:t,initialize:function(){this.listenTo(this,"change:selected",this.onChangeSelected)},onChangeSelected:function(n){n.get("selected")&&this.each(function(t){t.set("selected",t===n)})}})}(ClickView.Shared),function(n){n.Collections.ClipsCollection=EasyMoney.PagedCollection.extend({model:n.Models.Clip,defaults:{page:1,limit:25,orderby:"orderbydesc:datecreated","with":"video[thumbnail,libraries,rating]"},url:function(){return"/api/clips"},initialize:function(){this.listenTo(this,"sync",this.setLoaded);this.listenTo(this,"request",this.resetLoaded);this.listenTo(this,"selected",this.onSelected)},onSelected:function(n){this.each(function(t){t.set("selected",n)})},setLoaded:function(){this._loaded=!0},resetLoaded:function(){this._loaded=!1},isLoaded:function(){return this._loaded},isFetching:function(){return!this.isLoaded()},toData:function(n){var t=_.extend({},this.options,n&&n.data),i="{"+t.orderby+",page:"+t.page+",limit:"+t.limit+"}";return{"with":t.with,filter:i}},fetch:function(n){return EasyMoney.PagedCollection.prototype.fetch.call(this,{data:this.toData(n)})},selected:function(){return this.where({selected:!0})}});n.Collections.VideoClipsCollection=n.Collections.ClipsCollection.extend({defaults:{page:1,limit:7,orderby:"orderbydesc:datecreated","with":""},initialize:function(t,i){var u=[],r;t&&t.length&&(u=_.take(t,this.options.limit));r={};i&&i.pagination&&(r=this.getPagination(i.pagination));this.options=_.extend({},this.options,r);this.options.pagination=r;this.options.ownerId=ClickView.Data.User.id;n.Collections.ClipsCollection.prototype.initialize.call(this,u,i)},url:function(){return"/api/videos/"+this.options.videoId+"/clips"},getPagination:function(n){return n?{totalPages:Math.ceil(n.totalItems/this.options.limit),totalItems:n.totalItems,page:n.page||1,pageSize:this.options.limit}:{}},toData:function(n){var t=_.extend({},this.options,n&&n.data),i="{owner.id:"+t.ownerId+"}",r="{"+t.orderby+",page:"+t.page+",limit:"+t.limit+"}";return{"with":i,filter:r}},parse:function(n){var t={};return n&&n.pagination&&(t=this.getPagination(n.pagination),this.options=_.extend({},this.options,t),this.options.pagination=t,this.__private__=_.extend({},this.__private__,t)),n&&n.data||[]}})}(ClickView.Shared),function(n){"use strict";n.Collections.ExchangeBannerCollection=EasyMoney.Collection.extend({model:n.Models.ExchangeBannerItem,url:"/api/exchange/recommended",initialize:function(){this.listenTo(this,"sync",this.onSync)},onSync:function(){this.loaded=!0}})}(ClickView.Shared);!function(n,t){"use strict";var r=n.Shared,i={SUBJECTS:0,YEARS:1,STRANDS:2,SUBSTRANDS:3,CURRICULA:4};r.Collections.YearLearningAreaCollection=t.Collection.extend({model:r.Models.YearLearningArea,initialize:function(){this.listenTo(this,"sync",this.onSync)},url:function(){var n=this.options.learningAreaType,t=this.options.trackingCode;if(!n||!t)throw Error("LearningAreaType and trackingCode required to retrieve curriculum links.");return"/api/v2/learning-areas/"+n+"/links/"+t},onSync:function(){this.loaded=!0},parse:function(t){return _.chain(t).map(function(t){return{subject:_.find(t.data,function(n){return n.type===i.SUBJECTS}),year:_.find(t.data,function(n){return n.type===i.YEARS}),strand:_.find(t.data,function(n){return n.type===i.STRANDS}),collection:_.filter(t.data,function(t){return n.Data.AlbertLearningAreaType&&n.Data.AlbertLearningAreaType.type.toLowerCase()==="tafe"?t.type!==i.SUBJECTS&&t.type!==i.YEARS&&t.type!==i.STRANDS:t.type!==i.SUBJECTS&&t.type!==i.YEARS})}}).groupBy(function(t){return n.Data.AlbertLearningAreaType&&n.Data.AlbertLearningAreaType.type.toLowerCase()==="tafe"?t.strand.id:t.year.id}).map(function(n){return{subject:n[0].subject,year:n[0].year,strand:n[0].strand,collection:_.map(n,function(n){return n.collection})}}).value()}});r.Collections.SubStrandLearningAreaCollection=t.Collection.extend({model:r.Models.SubStrandLearningArea,parse:function(n){var t=_.chain(n).map(function(n){return{strand:_.find(n,function(n){return n.type===i.STRANDS}),subStrand:_.find(n,function(n){return n.type===i.SUBSTRANDS}),curriculum:_.find(n,function(n){return n.type===i.CURRICULA})}}).groupBy(function(n){return n.subStrand.id}).map(function(n){return{strand:n[0].strand,subStrand:n[0].subStrand,collection:_.sortBy(_.pluck(n,"curriculum"),"name")}}).value();return _.sortBy(t,"strand.name")}});r.Collections.CurriculumCollection=t.Collection.extend({model:r.Models.Curriculum})}(ClickView,EasyMoney),function(n){n.Collections.LibraryVideoCollection=n.Collections.VideoCollection.extend({category:null,initialize:function(n,i){t.initialize.apply(this,arguments);this.category=i.category},parse:function(n){return this.category=n.category,t.parse.apply(this,arguments)},getCurrentCategory:function(){return this.category}});var t=n.Collections.VideoCollection.prototype}(ClickView.Shared,EasyMoney),function(n){n.Collections.PinnedVideoCollection=EasyMoney.Collection.extend({model:n.Models.MasterVideo,getSlides:function(){return this.map(function(n){return{name:n.get("name")||n.get("title"),duration:n.get("duration"),image:ClickView.Shared.Helpers.getThumbnailUrl(n,{thumbnailSize:"small"}),href:ClickView.Shared.Services.ObjectLinkService.getVideoUrl(n),isVideo:n instanceof ClickView.Shared.Models.MasterVideo,series:n.get("series")&&n.get("series").get("name"),seriesHref:ClickView.Shared.Services.ObjectLinkService.getSeriesUrl(n.get("series")),hasInteractives:n.get("hasInteractives")||!!n.interactives&&n.interactives.length>0,originalModel:n}})}})}(ClickView.Shared),function(n){"use strict";n.SettingOptions={Permanent:{SCHOOL_MESSAGING:"school_messaging",STUDENT_WS_SHARING:"student_ws_sharing",STUDENT_TO_STUDENT_MESSAGING:"student_to_student_messaging",HIDE_RESOURCES_FOR_STUDENTS:"hide_resources_for_students"},Temporary:{}};n.Collections.BaseSettingCollection=EasyMoney.Collection.extend({model:n.Models.BaseSetting,getByName:function(n){return this.findWhere({name:n})},url:function(){if(!this.entityType)throw new Error("Must provide entity type e.g: customers or users");return"/api/v1/"+this.entityType+"/settings"}});n.Collections.CustomerSettingCollection=n.Collections.BaseSettingCollection.extend({entityType:"customers",model:n.Models.CustomerSetting});n.Collections.UserSettingCollection=n.Collections.BaseSettingCollection.extend({entityType:"users",model:n.Models.UserSetting})}(ClickView.Shared);!function(n,t){"use strict";var i=n.Shared;i.Collections.BaseSlideCollection=t.Collection.extend({getSlides:function(){return this.map(function(n){var t=n.get("module")==="SUPLIBRARY";return{name:n.get("title"),duration:n.get("duration"),image:i.Helpers.getThumbnailUrl(n),href:t?"/suplibrary/videos/"+n.get("id"):"/mylibrary/videos/"+n.get("id"),isVideo:!0,pageLoad:t,hasInteractives:n.get("hasInteractives")||n.interactives&&n.interactives.length>0,series:n.get("series"),originalModel:n}})}})}(ClickView,EasyMoney),function(n,t){n.Collections.SubNavCollection=t.Collection.extend({model:n.Models.SubNavButton,comparator:"order"})}(ClickView.Shared,EasyMoney),function(n,t,i){"use strict";t.Shared.Controllers.SharedController=i.Controller.extend({$leftNav:null,hasLeftNav:!0,searchable:!1,hidingLeftNavClass:"no-left-md",initialize:function(){this.hasLeftNav&&(this.$leftNav=n(".left-container"));this.searchable&&this.setupSearchBox();this.listenTo(Backbone.history,"all",this.logUserAction);this.contextService=t.Shared.Services.ContextService},setupSearchBox:function(){var u;if(t.Data.User.username){if(!t.Data.User.legacySearch){var f=new i.RadioChannel("SearchNavChannel"),r=this.filterService||new t.SearchApp.Services.FilterService,e=new t.SearchApp.Views.SearchNavAppView({controller:this.id,model:r.getQueryModel(),filterService:r,radio:new i.Radio({name:"SearchNavRadio",channels:[f]})});n("#search-area-nav").html(e.render().el);return}u=new t.Shared.Views.SearchBox({controller:this.id,inTopBar:!0});n("#search-area-nav").html(u.render().el)}},hideLeftNavResponsive:function(){n(".left").addClass("responsive-hide");n(".right").addClass("no-left-md")},hideLeftNav:function(t){if(this.hasLeftNav){if(t&&t.always){this.$leftNav.hide();n(".right").addClass("full-size");return}return n(".right").addClass(this.hidingLeftNavClass),n(".left").addClass("responsive-hide")}},showLeftNav:function(t){if(this.hasLeftNav)return t&&t.always&&this.$leftNav.show(),n(".right").removeClass(this.hidingLeftNavClass+" full-size no-left-md"),n(".left").removeClass("responsive-hide")},getUserActionData:function(n,t,i,r){var u={module:this.id,action:i,arguments:r,detail:typeof t=="string"?t:null};switch(i){case"videoPreview":u.video={name:t.title,trackingCode:t.tokenId}}return u},logUserAction:function(){var n=this.getUserActionData.apply(this,arguments);t.Shared.Utils.AnalyticsService&&t.Shared.Utils.AnalyticsService.logUserAction(n)},getTitleService:function(){return this._titleService?this._titleService:(this._titleService=new t.Shared.Services.TitleService,this._titleService)},setTitle:function(n){this.getTitleService().setTitle(n);this._titleWasSet=!0},usedTitleService:function(){return this._titleWasSet},onBeforeRouteAction:function(){this._titleWasSet=!1},logPageView:function(){this.trigger("logPageView")}})}(jQuery,ClickView,EasyMoney),function(n,t,i,r){"use strict";n.Shared.Controllers.LibraryController=n.Shared.Controllers.SharedController.extend({id:"library",routePrefix:"library",searchable:!0,hasLeftNav:!0,_currentCategoryId:null,_menuTree:null,videoCollection:[],initialize:function(t){n.Shared.Controllers.SharedController.prototype.initialize.apply(this,arguments);this.videoCollection=this.getVideoCollection(t);this.hasLeftNav&&this.setupLeftNav()},getVideoCollection:function(t){return new n.Shared.Collections.VideoCollection(t.videos,r.extend({},t.pageData,{category:t.category}))},setupLeftNav:function(){this.navigationViewModel.set({topNode:!0});this.navigationView=new n.Shared.Views.LibraryNavigationMenuView({rootUrl:this.navigationViewModel.get("sid")?"/suplibrary":"/mylibrary",model:this.navigationViewModel,navTemplate:this.navigationViewModel.get("sid")?"{{rootUrl}}/{{id}}/"+this.navigationViewModel.get("sid"):"{{rootUrl}}/{{id}}",selected:n.Data.SupCategoryId});this.$leftNav.append(this.navigationView.render().el);this.setCurrentCategory(n.Shared.Helpers.Guid.empty())},setCurrentCategory:function(n){this._currentCategoryId=n;this.videoCollection&&this.videoCollection.setCategoryId(n)},isCurrentCategory:function(n){return this._currentCategoryId==null?!1:this._currentCategoryId==n},getUserActionData:function(t,i,r,u){var e=n.Shared.Controllers.SharedController.prototype.getUserActionData.apply(this,arguments),f;return r==="play"&&(f=this.videoCollection._byId[u[0]],f&&(e.video={title:f.get("title"),trackingCode:f.get("tokenId")})),e}})}(ClickView,EasyMoney,$,_),function(n,t){"use strict";var r=new RegExp(/\W$/),o=new RegExp(/\s/),u=moment().subtract(1,"months").startOf("month"),f=moment().subtract(7,"days").startOf("day"),e=moment().subtract(1,"days"),i=n.Utils.Constants.CONTEXTS;n.Views.VideoListItemActionResultView=t.View.extend({template:"{{message}}",tagName:"p"});n.Views.VideoListItemView=t.View.extend({tagName:"div",name:"Shared Video List Item View",className:function(){return this.options.pinned?"cv-video video-pinned":"cv-video"},template:n.Templates.VideoListItem,previewViewCID:null,defaults:{showCheckbox:!1,showPreview:!0,clickable:!0,lazyload:!1,showCategory:!1,pinned:!1,thumbnailSize:"small",showChannel:!0,showYear:!0,showContributor:!0,truncateDescription:!0,maxTruncatedCharCount:300,maxTileTruncatedWordCount:25,tags:!1,keywords:!1,origin:!1,showCVContentBadge:!1,showVideoAction:!0,tileMode:!1,reRenderOnRestrict:!0,reRenderOnUnrestrict:!0,showRestrictionToAdmin:!1,logClickthrough:!0},ui:{previewText:".preview-video",previewPane:".preview-pane",$timestamp:"time.timeago",$videoActionsContainer:".video-actions-container",restrictionInfo:".restriction-info-container",thumbnail:".cv-thumbnail img",restrictedThumbnail:".restricted-thumbnail-container",verifiedBadge:".verified-badge",contributorInfo:".contributor-info",$checkbox:".checkbox-viewpart",interactiveBadge:".has-interactives",restrictedBadge:".restricted-badge-container",localCacheBadge:".saved-to-cache",$itemNumber:".item-number-viewpart",$description:".cv-description",$descriptionWrapper:".cv-description-wrapper",$tags:".tags-viewpart",$collapserMask:".cv-collapser-mask",$showMoreButton:".show-more"},events:{"click .preview-video":"togglePreview","click .video-link":"onClick","click .series-link":"onClick","click .category-link":"onClick","click .cv-thumbnail":"onClick","click .show-more":"onClickShowMore"},initialize:function(){n.Services.VideoActionService.mixin(this);this.listenTo(this.model,"show:loader",this.showDeleteLoader);this.listenTo(this.model,"hide:loader",this.hideDeleteLoader);this.listenTo(this.model,"change:previewOpen",this.onRender);this.contextService=n.Services.ContextService;this.bindRestrictionListeners()},bindRestrictionListeners:function(){var n=this.getVideoModel();if(this.options.reRenderOnRestrict&&this.listenTo(n,"itemRestricted",this.render),this.options.reRenderOnUnrestrict){this.listenTo(n,"itemUnrestricted",this.render);return}this.listenTo(n,"itemUnrestricted",this.close)},showDeleteLoader:function(){this.hideDeleteLoader();this.renderView(this.$el,new n.Views.LoaderView({cover:!0,mask:!0}),{empty:!1,childIndex:"deleteLoader"})},hideDeleteLoader:function(){var n=this.getChildByIndex("deleteLoader");n&&n.close()},getActionUrl:function(){return this.options.clickable?ClickView.Shared.Services.ObjectLinkService.getVideoUrl(this.model,this.options.parent):!1},getBadgeTitle:function(n){var i=this.getVideoOrigin(n),t="This video comes from ";switch(i){case"library":t+="your Library";break;case"workspace":t+="your Workspace";break;case"exchange":t+="the Exchange"}return t},getModel:function(){var n=this.model.toJSON(),e,i;n=ClickView.Shared.Helpers.formatRating(n);_.isEmpty(n.category)&&!!n.categories&&!!n.categories.data&&n.categories.data.length>0&&(n.category=n.categories.data[0],this.model.set("category",n.categories.data[0]));n.category&&n.category.name&&(n.category.name=this.getCategoryName({highlight:!1}));this.model.series&&(n.series.url=this.options.clickable&&ClickView.Shared.Services.ObjectLinkService.getSeriesUrl(this.model.series),n.series.name=this.getSeriesName({highlight:!1}));this.options.tileMode&&(n.description=this._truncateTileDescription(n.description));n.description=ClickView.Shared.Helpers.formatSafeHTML(n.description,{keywords:this.options.keywords&&this.options.keywords.length&&this.options.keywords.pluck("title"),linkify:!1});!this.options.tileMode&&this.options.truncateDescription&&this.model.set("descriptionMarkup",n.description);(this.model.get("hasInteractives")||this.model.interactives&&this.model.interactives.length>0)&&(n.hasInteractives=!0);var f=ClickView.Shared.Helpers.getThumbnailUrl(n,{bgColor:"000"}),r=n.description,u=this.getActionUrl(),t=this.getVideoModel();return _.result(t,"hasRestriction")&&(n.hasRestriction=!0,e=t.getRestriction(),t.isRestricted()&&(n.isRestricted=!0,u=!1,ClickView.currentUser.isStudent()&&(n.isRestrictedFromStudent=!0,r=t.restrictionHasExpiry()?"This video is pending approval by your ClickView Administrator":"This video is restricted by "+this.getVideoModel().getRestrictedBy()))),i=moment.utc(this.model.get("dateCreated")),{video:n,options:this.options,actionUrl:u,showDate:!this.model.isLibraryVideo(),localTime:i.toDate().toISOString(),badge:this.options.badge?this.options.badge:!1,lazyload:this.options.lazyload,thumbUrl:f,showCategory:this.options.showCategory,categoryUrl:this.options.clickable&&this.options.showCategory&&ClickView.Shared.Services.ObjectLinkService.getCategoryUrl(this.model.categories),descriptionId:this.model.get("id"),origin:this.getVideoOrigin(this.model),badgeTitle:this.getBadgeTitle(this.model),isProducedByClickView:this.isProducedByClickView(),hasContributor:this.hasContributor(),title:this.getTitle(),isNew:this.isNew(i),hasKeywords:this.hasKeywords(),description:r,existsInLocalCache:_.result(this.getVideoModel(),"existsInLocalCache")}},isNew:function(n){return this.model.isMasterLibraryVideo()&&n.isAfter(u)||this.model.isExchangeVideo()&&n.isAfter(f)||this.model.isWorkspaceVideo()&&n.isAfter(e)},hasKeywords:function(){return this.options.keywords&&this.options.keywords.length},highlightProperty:function(n){if(!this.hasKeywords())return n;var i;if(this.options.keywords instanceof t.Collection)i=this.options.keywords.pluck("title");else if(_.isArray(this.options.keywords))i=this.options.keyword;else throw Error("Keyword highlighting accepts either an array of strings or an EasyMoney Collection.");return CV.Utils.HandleBarsHelper.WordsHighlighter(n,i)},getTitle:function(){return this.highlightProperty(this.model.get("name"))},getSeriesName:function(n){var t=this.model.series&&this.model.series.get("name");return t&&n.highlight?this.highlightProperty(this.model.series.get("name")):t?t:null},getCategoryName:function(n){var t=this.model.get("category");return t&&n.highlight?this.highlightProperty(t.name):t?t.name:null},logClickthrough:function(t){if(this.options.logClickthrough){var r={};r.type=t.hasClass("series-link")?"series":t.hasClass("category-link")?"category":"video";r.link=t.attr("href")||this.getActionUrl();n.Utils.AnalyticsService.logVideoClickthrough({mediaCollection:this.contextService.getContext(i.MEDIA_COLLECTION),area:this.contextService.getContext(i.AREA),video:this.model,clickthrough:r})}},onClick:function(i){var u=$(i.currentTarget),r;if(u)return(this.logClickthrough(u),_.result(this.getVideoModel(),"isRestricted"))?!0:u.hasClass("linkified")?!0:(r=u.attr("href")||this.getActionUrl(),!r)?!0:n.Helpers.isSamePageRoute(r)?(t.Events.trigger("navigate",r),!1):(window.location=r,!1)},onClickShowMore:function(){if(!this._showingMore){this.ui.$descriptionWrapper.removeClass("truncated");this.ui.$descriptionWrapper.addClass("opened");this.ui.$showMoreButton.text("Show less");this._showingMore=!0;return}this.ui.$descriptionWrapper.addClass("truncated");this.ui.$descriptionWrapper.removeClass("opened");this.ui.$showMoreButton.text("... Show more");this._showingMore=!1},updatePreviewText:function(){if(this.model.get("previewOpen")){this.ui.previewText.html('<p>Hide video<span class="preview-video-icon">-<\/span><\/p>').addClass("open");return}this.ui.previewText.html('<p>Show video<span class="preview-video-icon">+<\/span><\/p>').removeClass("open")},updatePreviewPane:function(){if(this.options.showPreview){if(this.model.get("preoriginviewOpen")){this.ui.previewPane.slideDown();t.Events.trigger("isotope");return}this.ui.previewPane.slideUp();t.Events.trigger("isotope")}},getVideoOrigin:function(t){if(this.options.origin){var i=t instanceof n.Models.MasterVideo,r=t instanceof n.Models.Video;return!i&&!r?"":t.getVideoOrigin()}},isProducedByClickView:function(){if(this.options.showCVContentBadge)return(this.model instanceof n.Models.MasterVideo)?this.model.isProducedByClickView():void 0},_truncateTileDescription:function(n){var i,t,u;if(n)return(i=n.split(" ").length,i<this.options.maxTileTruncatedWordCount)?n:(t=n.split(" ").splice(0,this.options.maxTileTruncatedWordCount),u=t.pop().replace(r,""),t.push(u),t.join(" ")+"...")},truncateDescription:function(){var n=this;this._itemTimeout=setTimeout(function(){n.isClosed()||n.ui.$description.height()>36&&n.ui.$showMoreButton.show()},0)},extraVideoActions:function(){},renderVideoActions:function(){var t,u,i,r,f;ClickView.Data.User.username&&this.options.showVideoAction&&(_.result(this.getVideoModel(),"isRestricted")||(t=n.Services.VideoActionService.getActions(this.model),u=this,this.options.exclusiveActions&&(i=_.filter(t,function(n){return _.contains(u.options.exclusiveActions,n.id)}),_.each(i,function(n){n.button=!0}),i.length&&(t=i)),r=this.extraVideoActions(),r instanceof Array&&(t=t.concat(r)),f=new ClickView.Shared.Views.VideoActionsListView({collection:new ClickView.Shared.Collections.VideoActionCollection(t),itemModel:this.model}),this.renderView(this.ui.$videoActionsContainer,f),this.delegateEvents()))},getVideoModel:function(){return this.model instanceof ClickView.Shared.Models.InteractiveResource?this.model.video:this.model instanceof ClickView.Shared.Models.Clip?this.model.video:this.model},renderRestrictedThumbnail:function(){if(_.result(this.getVideoModel(),"isRestricted")){var n=this.getVideoModel().restrictionHasExpiry()?"Awaiting Approval":"Restricted",t=new ClickView.Shared.Views.RestrictedThumbnailView({text:n});this.renderView(this.ui.restrictedThumbnail,t)}},renderRestrictedBadge:function(){_.result(this.getVideoModel(),"hasRestriction")&&this.renderView(this.ui.restrictedBadge,new ClickView.Shared.Views.RestrictedBadgeView({model:this.getVideoModel()}))},renderLocalCacheBadge:function(){_.result(this.getVideoModel(),"existsInLocalCache")&&this.ui.localCacheBadge.tooltip({title:"This video will be played from your school's Local Cache"})},renderRestrictionInfo:function(){_.result(this.getVideoModel(),"hasRestriction")&&this.renderView(this.ui.restrictionInfo,new ClickView.Shared.Views.RestrictionInfoView({model:this.getVideoModel(),showBanner:!0,showRestrictionToAdmin:this.options.showRestrictionToAdmin}))},renderRestriction:function(){this.renderRestrictedThumbnail();this.renderRestrictionInfo();this.renderRestrictedBadge()},initTimeago:function(){this.ui.$timestamp.timeago()},hasContributor:function(){return this.options.showContributor&&this.model.owner&&this.model.owner.organisation&&this.model.owner.organisation.get("name")},renderContributorInfo:function(){this.hasContributor()&&this.renderView(this.ui.contributorInfo,new ClickView.Shared.Views.ContributorInfoView({model:this.model}))},renderCheckbox:function(){var t=new n.Views.CheckBoxView({model:this.model,colour:"grey"});this.renderView(this.ui.$checkbox,t)},renderTags:function(){if(this.model.tags){var t=new n.Views.VideoTagListView({collection:this.model.tags});this.renderView(this.ui.$tags,t)}},onRender:function(){this.renderContributorInfo();this.updatePreviewText();this.updatePreviewPane();this.renderVideoActions();this.renderRestriction();this.renderLocalCacheBadge();this.initTimeago();this.model.isLast()&&this.$el.addClass("last");this.options.showCheckbox&&this.renderCheckbox();this.options.tags&&this.renderTags();this.ui.interactiveBadge.tooltip()},onRendered:function(){var n=this.model,t=n.get("ui.hidden");t&&this.$el.hide().fadeIn(function(){n.set({"ui.hidden":!1},{silent:!0})});!this.options.tileMode&&this.options.truncateDescription&&this.truncateDescription()},togglePreview:function(){if(this.model.get("previewOpen")){this.closePreview();return}this.openPreview()},openPreview:function(){this.model.set("previewOpen",!0);var t=new ClickView.Shared.Models.WebPlayer({id:this.model.get("id"),width:520,height:292,autoplay:!0,parameters:{bc:!1,bf:!1},trackingCode:this.model.get("tokenId")}),n=new ClickView.Shared.Views.WebPlayerView({model:t,name:"PreviewVideo"});this.previewViewCID=n.cid;this.renderView(this.ui.previewPane,n);this.ui.previewPane.hide().slideDown();Backbone.history.trigger("userAction",this.model.toJSON(),"videoPreview")},closePreview:function(){this.model.set("previewOpen",!1);var n=this.getChildById(this.previewViewCID);n&&n.close();this.previewViewCID=null},onBoarding:function(){return this.model&&this.model.collection&&this.model.collection.first()===this.model?"video-list-item":null},onClose:function(){clearTimeout(this._itemTimeout)}})}(ClickView.Shared,EasyMoney),function(n,t){"use strict";n.Shared.Views.VideoActionButtonView=t.View.extend({tagName:"a",template:function(n){return n.text},className:function(){var n="btn grey video-action-button";return this.model.get("className")&&(n+=" "+this.model.get("className")),n},attributes:function(){return{title:this.model.get("desc")}},events:{click:"onClick"},onClick:function(){n.Shared.Views.VideoActionItemView.prototype.onClick.apply(this,arguments)},onRender:function(){this.model.has("desc")&&this.$el.tooltip({delay:{show:500,hide:100}})},onClose:function(){this.model.has("desc")&&this.$el.tooltip("destroy")}});n.Shared.Views.VideoActionButtonListView=t.ListView.extend({className:"video-action-button-listview",childView:n.Shared.Views.VideoActionButtonView,tagName:"div"});n.Shared.Views.VideoActionItemView=t.View.extend({name:"VideoActionItemView",id:function(){return!this.model.get("cssId")?null:this.model.get("cssId")},model:n.Shared.Models.VideoAction,tagName:"li",template:function(n){return'<a title="'+n.desc+'">'+n.text+"<\/a>"},ui:{anchor:"a"},events:{click:"onClick"},className:function(){var n="ddl-video-action";return this.model.get("className")&&(n+=" "+this.model.get("className")),n},onClick:function(n){var t=this.options.itemModel,i=this.model.get("eventName");i&&t&&t.trigger(i,t,this,n);Backbone.history.trigger("userAction",this.model.get("text"),"videoAction")},onRender:function(){this.model.has("desc")&&this.ui.anchor.tooltip({placement:"left",container:"body",delay:{show:500,hide:100}})},onClose:function(){this.model.has("desc")&&this.ui.anchor.tooltip("destroy")}});var i=t.ListView.extend({name:"VideoActionListView",childView:n.Shared.Views.VideoActionItemView,buildChildView:function(n){return new this.childView({model:n,itemModel:this.options.itemModel})}}),r=t.View.extend({name:"VideoActionGroupView",tagName:"li",template:n.Shared.Templates.VideoActionGroup,renderVideoActions:function(){var n=this.model.actions,t=new i({collection:n,itemModel:this.options.itemModel});this.renderView(this.$el,t,{empty:!1})},viewOptions:function(){var n=this.model.collection.length>1;return{name:n?this.model.get("name"):null}},onRender:function(){this.renderVideoActions()}});n.Shared.Views.VideoActionGroupListView=t.ListView.extend({name:"VideoActionGroupListView",tagName:"div",className:"dropdown-root",template:n.Shared.Templates.VideoActionsDropdownList,childView:r,_itemsRendered:!1,ui:{$ddlActions:".ddl-actions"},events:{"show.bs.dropdown":"onShowDropdown"},onShowDropdown:function(){this._renderItems()},renderItems:function(){return},_renderItems:function(){this._itemsRendered||(this.collection=this.getDropdownGroups(),t.ListView.prototype.renderItems.apply(this),this._itemsRendered=!0)},getDropdownGroups:function(){if(this.options.itemModel&&_.isFunction(this.options.itemModel.getActionGroups))return this.options.itemModel.getActionGroups(this.collection);var t=new n.Shared.Models.VideoActionGroup({actions:this.collection.toJSON()});return new n.Shared.Models.VideoActionGroupCollection([t])},buildChildView:function(n){return new this.childView({model:n,itemModel:this.options.itemModel})},addOne:function(n){this.renderView(this.ui.$ddlActions,this.buildChildView(n),{empty:!1})}});n.Shared.Views.VideoActionsListView=t.View.extend({name:"VideoActionsListView",className:"video-actions",template:n.Shared.Templates.VideoActionsList,defaults:{showDDL:!0},ui:{$dropdown:".dropdown-viewpart",$buttons:".buttons-viewpart"},setButtonsClasses:function(){var n=this.$el.find(".video-action-button");n.last().addClass("last-action-button");n.first().addClass("first-action-button")},renderButtons:function(){var t=new n.Shared.Collections.VideoActionCollection(this.collection.where({button:!0})),i;t.length&&(i=new n.Shared.Views.VideoActionButtonListView({collection:t,itemModel:this.options.itemModel}),this.renderView(this.ui.$buttons,i))},renderDropdown:function(){var t=new n.Shared.Collections.VideoActionCollection(this.collection.where({button:!1})),i;t.length&&(i=new n.Shared.Views.VideoActionGroupListView({collection:t,itemModel:this.options.itemModel}),this.renderView(this.ui.$dropdown,i))},onRender:function(){this.renderButtons();this.renderDropdown()},onRendered:function(){this.setButtonsClasses()}});n.Shared.Models.VideoActionGroup=t.NestedModel.extend({defaults:{library:"",actions:[]},associations:{actions:function(t,i){return new n.Shared.Collections.VideoActionCollection(t,i)}}});n.Shared.Models.VideoActionGroupCollection=t.Collection.extend({model:n.Shared.Models.VideoActionGroup});n.Shared.Models.VideoAction=t.Model.extend({defaults:{cssId:"",text:"button text, please replace",desc:"",eventName:"video:action:",button:!1}});n.Shared.Collections.VideoActionCollection=t.Collection.extend({model:n.Shared.Models.VideoAction,comparator:"order"})}(ClickView,EasyMoney),function(n,t){"use strict";n.Views.VideoListListView=t.ListView.extend({tagName:"div",name:"Shared Video List List View",className:"cv-videos",childView:n.Views.VideoListItemView,_noVideoTemplate:"<p>There are no videos here!<\/p>",_noVideoMessageVisible:!1,initialize:function(){this.listenTo(this.collection,"add",this.addOne);this.listenTo(this.collection,"destroy",this._onDestory);this.listenTo(this.collection,"reload",this._onReload);this.listenTo(this.collection,"reset",this.render);this.listenTo(this.collection,"request",this._onRequest);this.listenTo(this.collection,"getpage",this._onPageChange);this.listenTo(this.collection,"update",this._onUpdate);this.childView=this.options.childView||this.childView;this.options.noVideoTemplate||(this.options.noVideoTemplate=this._noVideoTemplate)},addOne:function(n){var t=this.collection.length<=1,i=this.collection.indexOf(n),r=this.renderView(this.$el,this.buildChildView(n),{empty:t,at:i});r.trigger("rendered");this.hideNoVideosMessage()},renderItems:function(){t.ListView.prototype.renderItems.apply(this,arguments);this.lazyLoad()},buildChildView:function(n){return new this.childView(_.extend({},this.options.listOptions,{model:n,actions:this.options.actions,privacies:this.options.privacies,showCategory:this.options.showCategory,clips:this.options.clips,parent:this.options.parent,lazyload:!0}))},showLoader:function(){this.renderView(this.$el,new ClickView.Shared.Views.SpinJsView)},_onUpdate:function(){this.lazyLoad()},onRender:function(){t.ListView.prototype.onRender.apply(this,arguments);this.hideOrShowNoVideoMessage()},onRendered:function(){this.lazyLoad()},_onPageChange:function(){this.hideOrShowNoVideoMessage()},_onDestory:function(){this.hideOrShowNoVideoMessage()},_onReload:function(){this.hideOrShowNoVideoMessage()},_onRequest:function(){},hideOrShowNoVideoMessage:function(){if(this.collection.length>0){this.hideNoVideosMessage();return}this.showNoVideosMessage()},showNoVideosMessage:function(){this._noVideoMessageVisible||(this.$el.html("<div class='no-videos'>"+this.renderTemplate(this.options.noVideoTemplate,this.options.listOptions)+"<\/div>"),this._noVideoMessageVisible=!0)},hideNoVideosMessage:function(){this._noVideoMessageVisible&&(this.$el.find(".no-videos").remove(),this._noVideoMessageVisible=!1)},lazyLoad:function(){if(this._lazyLoad){this._lazyLoad.update();return}this._lazyLoad=new LazyLoad({elements_selector:".lazy"})},destroyLazyLoad:function(){this._lazyLoad&&this._lazyLoad.destroy()},onClose:function(){this.destroyLazyLoad()}})}(ClickView.Shared,EasyMoney),function(n,t){"use strict";n.Views.VideoListView=t.View.extend({tagName:"div",name:"Shared Video List View",template:'<div class="videolist-viewpart"><\/div><div class="pagination-viewpart"><\/div>',className:"cv-video-list",videoItemView:n.Views.VideoListItemView,_loaded:!1,defaults:{pagination:!0,noVideoTemplate:!1,actions:{}},ui:{videoList:".videolist-viewpart",pagination:".pagination-viewpart"},initialize:function(){this.listenTo(this.collection,"sync",this.onSync);this._loaded=!this.collection.isFetching();this.videoItemView=this.options.videoItemView||this.videoItemView},onSync:function(){this._loaded||(this._loaded=!0,this.render());this.collection.trigger("update")},renderPagination:function(){if(!this.options.pagination){this.ui.pagination.hide();return}var t=new n.Views.PaginatorView({collection:this.collection});this.renderView(this.ui.pagination,t)},renderVideos:function(){var t=new n.Views.VideoListListView({collection:this.collection,actions:this.options.actions,childView:this.videoItemView,noVideoTemplate:this.options.noVideoTemplate,listOptions:_.omit(this.options,["collection","actions","videoItemView","noVideoTemplate","pagination"])});this.renderView(this.ui.videoList,t)},showLoader:function(){this.renderView(this.ui.videoList,new ClickView.Shared.Views.LoaderView)},onRender:function(){if(!this._loaded){this.showLoader();return}this.renderVideos();this.renderPagination()}})}(ClickView.Shared,EasyMoney),function(n,t){"use strict";var i=n.Shared;i.Views.SpinnerButtonView=t.View.extend({name:"SpinnerButtonView",tagName:"button",template:i.Templates.SpinnerButton,className:function(){return this.options.className?options.className:"btn-spinner"},defaults:{showSpinner:!1,detectWidth:!0,detectHeight:!0,buttonText:"Save",preventMultiClick:!0,spinnerSize:"small",spinJSOptions:{spinColor:"#ffffff"},tooltipOptions:{toggle:"tooltip",placement:"top"}},attributes:function(){if(!this.options.tooltip)return{};var n=this.options.tooltipOptions;return{title:this.options.tooltip,"data-toggle":n.toggle,"data-placement":n.placement}},events:{},initialize:function(){this.model||(this.model=new i.Models.SpinnerModel({showSpinner:this.options.showSpinner}));this.setSpinOptions();this.listenTo(this,"showSpinner",this.showSpinner);this.listenTo(this,"hideSpinner",this.hideSpinner);this.listenTo(this,"togglettonModelSpinner",this.toggleSpinner);this.listenTo(this.model,"change:showSpinner",this.render)},setSpinOptions:function(){var n,t;switch(this.options.spinnerSize){case"small":n={length:2,width:2,radius:4};break;case"medium":n={length:3,width:3,radius:5};break;default:n={}}t=this.options.spinJSOptions.spinOptions||{};this.options.spinJSOptions.spinOptions=_.extend({},t,n)},toggleSpinner:function(){this.model.get("showSpinner")?this.hideSpinner():this.showSpinner()},showSpinner:function(){this.model.set("showSpinner",!0)},hideSpinner:function(){this.model.set("showSpinner",!1)},viewOptions:function(){return{buttonText:this.options.buttonText}},storeDimensions:function(){this.options.detectWidth&&this.model.set("buttonWidth",this.$el.width());this.options.detectHeight&&this.model.set("buttonHeight",this.$el.height())},applyDimensions:function(){this.options.detectWidth&&this.$el.width(this.model.get("buttonWidth"));this.options.detectHeight&&this.$el.height(this.model.get("buttonHeight"))},resetDimensions:function(){this.options.detectWidth&&this.$el.css("width")&&this.$el.css("width","");this.options.detectHeight&&this.$el.css("height")&&this.$el.css("height","")},renderSpinner:function(){this.model.get("showSpinner")&&this.storeDimensions();var t=new n.Shared.Views.SpinJsView(this.options.spinJSOptions);this.renderView(this.$el,t);t.trigger("rendered");this.model.get("showSpinner")&&this.applyDimensions()},renderTooltip:function(){this.options.tooltip&&this.$el.tooltip()},onRender:function(){this.resetDimensions();this.renderTooltip()},onBeforeRender:function(){return this.model.get("showSpinner")?(this.renderSpinner(),!1):!0},onClose:function(){this.options.tooltip&&this.$el.tooltip("destroy")}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Views.CopyInteractiveSuccessView=t.View.extend({template:i.Templates.CopyInteractiveSuccess,className:function(){return"publish-view "+(this.options.editor?"drop-shadow-box":"")},initialize:function(){this.listenTo(this.model,"sync copy",this.render)},events:{"click .preview":"preview","click .share":"share","click .workspace":"workspace","click .edit":"edit"},preview:function(){window.location="/interactives/play/"+this.model.get("id")},edit:function(){window.location="/interactives/edit/"+this.model.get("id")},share:function(){var n=new i.Views.InteractiveShareTabView({itemModel:this.model}),t=new i.Views.PopupView({view:n,title:"Share this interactive video",cssId:"cv-share-tab",showButtonContainer:!0});this.options.editor||this.close();t.selfRender()},onBeforeRender:function(){return this.model.isLoaded()?!0:(this.renderView(this.$el,new n.Shared.Views.LoaderView),!1)},workspace:function(){window.location="/workspace/categories/interactives"},viewOptions:function(){return{editor:this.options.editor,interactiveName:this.model.get("name")}},onRender:function(){this.trigger("resize")}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Views.CreateInteractiveButton=i.Views.SpinnerButtonView.extend({template:i.Templates.CreateInteractiveButton,className:"btn primary create-interactive create-button",tagName:"button",events:{click:"create"},initialize:function(){this.listenTo(this.model,"sync",this.onSaveSuccess)},onSaveSuccess:function(){i.Utils.AnalyticsService.logInteractiveCreate(this.model);this.model.set({syncing:!1,message:"Successfully created interactive!"});t.Events.trigger("interactivesTab:interactive-created",this.model);window.location="/interactives/edit/"+this.model.get("id")},create:function(){this.model.save();this.renderSpinner()},renderSpinner:function(){this.storeDimensions();this.renderView(this.$el,new i.Views.SpinJsView({spinColor:"#FFF"}));this.applyDimensions()}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared,r=n.Interactive;i.Views.InteractionListItem=t.View.extend({template:i.Templates.InteractionListItem,className:"interaction-list-item",viewOptions:function(){var t,u=this.model.get("typeId")===r.Utils.InteractionEnum.Annotation;return u&&(t=i.Helpers.formatAnnotationText(this.model.data.get("annotation"))),{time:n.Interactive.Utils.FormatDuration(this.options.timepoint.get("visibleAt")),isAnnotation:u,annotation:t,renderInPopup:this.options.renderInPopup}}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared,r=n.Interactive,u=t.View.extend({template:'<div class="printable-checkbox col-sm-1" ><\/div><div class="printable-choice col-sm-11">{{name}}<\/div>',tagName:"li",className:"row printable-choice-row"}),f=t.ListView.extend({childView:u});i.Views.InteractionPrintableItem=t.View.extend({name:"InteractionPrintableItem.js",template:i.Templates.InteractionPrintableItem,className:"row question-row",ui:{multipleChoiceView:".multiple-choice-viewpart"},initialize:function(){this.underscoreRegex=new RegExp("^[^_]+$");this.missingWordRegex=new RegExp("{([^{}]*)}","g")},replaceWithInputs:function(n,t){return n.replace(this.missingWordRegex,_.bind(function(n,i){var r=t.models.filter(_.bind(function(n){return n.get("order")===parseInt(i,10)&&this.underscoreRegex.test(n.get("name"))},this))[0],u;if(r)return u=2*r.get("name").length,Array(u+1).join("_")},this))},viewOptions:function(){var f,t=this.model.get("typeId"),u=r.Utils.InteractionEnum,e=this.model.get("name");return t===u.Annotation&&(f=i.Helpers.formatAnnotationText(this.model.data.get("annotation"))),t===u.MissingWord&&(e=this.replaceWithInputs(this.model.data.get("sentence"),this.model.actionableItems)),{time:n.Interactive.Utils.FormatDuration(this.options.timepoint.get("visibleAt")),interactionType:u,type:t,annotation:f,sentence:e}},onRender:function(){this.model.get("typeId")===r.Utils.InteractionEnum.MultipleChoice&&this.renderView(this.ui.multipleChoiceView,new f({collection:this.model.actionableItems}))}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared,r=t.ListView.extend({initialize:function(){this.childView=i.Views.PrintableTimePointListView}});i.Views.InteractivePrintableWorksheetView=t.View.extend({name:"InteractionPrintableWorksheetView.js",tagName:"html",template:i.Templates.InteractivePrintableWorksheet,ui:{list:".printable-interactions-viewpart",worksheet:".printable-worksheet"},defaults:{showLoader:!1},initialize:function(){this.options.interactive&&(this.interactive=this.options.interactive)},showCopyright:function(){var n,t;if(!this.options.showLoader)return this.model?(n=this.model.get("owner"),!n)?!1:(t=function(n){return n.toLowerCase().includes("clickview")},!!n.schoolName)?t(n.schoolName):!n.customers?!1:_.any(n.customers.data,function(n){return t(n.name)}):!1},getName:function(){if(!this.options.showLoader)return this.model.get("name")?this.model.get("name"):this.interactive&&this.interactive.get("name")},viewOptions:function(){return{year:(new Date).getFullYear(),showCopyright:this.showCopyright(),showLoader:this.options.showLoader,name:this.getName()}},onRender:function(){this.options.showLoader||this.renderView(this.ui.list,new r({collection:this.interactive.timepoints}))}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Views.InteractiveResourceItemView=i.Views.VideoListItemView.extend({name:"InteractiveResourceListItem.js",template:i.Templates.InteractiveResourceItemView,ui:{contributorInfo:".contributor-viewpart",$videoActions:".video-actions-container",$description:".cv-description-wrapper"},defaults:_.extend({},i.Views.VideoListItemView.prototype.defaults,{applyEllipses:!0,lazyload:!1}),initialize:function(){this.mainWebPlayer=this.options.webPlayer;this.interactive=this.constructInteractiveModel();this.listenTo(this.model,"save-to-workspace",this.saveToWorkspace);this.listenTo(this.model,"show-question-list",this.showQuestionList)},configurePopupPlayer:function(){return n.Shared.Helpers.UrlBuilder(n.Data.Config.urls.webplayer+"/ev.aspx",{p:this.model.get("trackingCode"),a:!0,s:!1,c:!1})},constructInteractiveModel:function(){return new i.Models.Interactive({id:this.model.get("interactiveId"),url:this.configurePopupPlayer(),player:"clickview",readOnly:!0,autoplay:!0,demoMode:!0},{edit:!1})},onClick:function(n){return n.preventDefault(),n.stopPropagation(),this.previewInteractive(),!1},saveToWorkspace:function(){this.model.get("userHasCopy")||n.Data.User.username===this.model.getUsername()||this.saveToWorkspaceSuccessPopup()},showQuestionList:function(){this.mainWebPlayer.pause();var r=new i.Views.InteractiveSummaryList({model:this.interactive,renderInPopup:!0}),t={title:"Question List",view:r,popupOptions:{cssId:"interactive-questions-popup"},buttons:[{text:"Close",className:"btn grey",success:!0},]},u=_.bind(function(){return this.interactive.fetch()},this),f=_.bind(function(){return setTimeout(_.bind(this.saveToWorkspace,this),0)},this),e=_.bind(function(){return setTimeout(_.bind(this.printWorksheet,this),0)},this);this.interactive.isLoaded()||(t.before=u);t.buttons.push({text:"Print as Worksheet",className:"btn grey",callback:e,close:!1});this.model.get("userHasCopy")||n.Data.User.username===this.model.getUsername()||t.buttons.push({text:"Save to Workspace",className:"btn orange",callback:f});n.Utils.Dialog(t)},previewInteractive:function(){this.mainWebPlayer.pause();this.interactive.get("timepoints")&&(this.interactive=this.constructInteractiveModel());this.interactive.setUpService(!1);var t=new n.Interactive.Views.AppView({model:this.interactive,showCloseButton:!0,interactiveResource:this.model,playedFrom:"interactiveTab"}),r=new i.Views.PopupView({view:t,className:"interactive-video-popup",positionX:"0",positionY:"0"});r.selfRender()},saveToWorkspaceSuccessPopup:function(){var n=this.model.clone(),t=new i.Views.CopyInteractiveSuccessView({model:n}),r=new i.Views.PopupView({title:"Share this interactive video",view:t,cssId:"copy-interactive-success"});r.selfRender();n.copy().done(_.bind(function(){n.trigger("copy");this.model.set("userHasCopy",!0);this.renderVideoActions()},this))},renderToTab:function(n){var t=new i.Views.InteractivePrintableWorksheetView({model:this.model,interactive:this.interactive});n.document.write(t.render().el.innerHTML);n.document.close();n.document.title="Worksheet - "+this.model.get("name")},printWorksheet:function(){var n=window.open("",""),t;if(n.opener=null,t=new i.Views.InteractivePrintableWorksheetView({showLoader:!0}),n.document.write(t.render().el.innerHTML),n.document.close(),!this.interactive.isLoaded()){this.interactive.fetch().done(_.bind(function(){this.renderToTab(n)},this));return}this.renderToTab(n)},sharePopup:function(){var n=new i.Views.InteractiveShareTabView({itemModel:this.model}),t=new i.Views.PopupView({view:n,title:"Share this interactive video",cssId:"cv-share-tab",showButtonContainer:!0});this.options.editor&&this.close();t.selfRender()},getModel:function(){var t=n.Data.User.username===this.model.getUsername();return{name:this.model.get("name"),description:this.model.get("description"),video:this.model.video,options:this.options,actionUrl:this.getActionUrl(),lazyload:this.options.lazyload,thumbUrl:this.model.getThumbnail(),isOwner:t}},getContributor:function(){var n=this.model.get("owner"),r,u,f,e;if(n)return this.model.isOnlineInteractive()?(r=n.firstName,u=n.surname,f={name:n.schoolName}):(e=n.customers&&n.customers.data&&n.customers.data[0],r=n.name,u=n.surname,f=e&&e.organisation),new t.Model({owner:new i.Models.Owner({name:r,surname:u,organisation:f}),dateCreated:this.model.get("dateCreated")})},renderContributorInfo:function(){this.model.get("_cachedContributor")||this.model.set("_cachedContributor",this.getContributor());var n=new i.Views.ContributorInfoView({model:this.model.get("_cachedContributor"),multipleLines:!0});this.renderView(this.ui.contributorInfo,n)},renderVideoActions:function(){var t=this.model.get("userHasCopy")||n.Data.User.username===this.model.getUsername(),r=new i.Collections.VideoActionCollection(i.Utils.GetInteractiveActions({questionList:{button:!0,order:1},saveInteractive:{button:!0,order:2,disabled:t,title:t?"You already own a copy of this Interactive Video.":""}})),u=new i.Views.VideoActionsListView({collection:r,itemModel:this.model});this.renderView(this.ui.$videoActions,u)},onRender:function(){this.renderContributorInfo();this.renderVideoActions()}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Views.InteractiveResourceListItem=t.View.extend({template:i.Templates.InteractiveResourceItem,tagName:"li",events:{"click .question-list":"getInteractive","click .preview":"previewInteractive","click .save":"saveInteractive","click .view":"view"},ui:{questionList:".question-list-container",contributorInfo:".contributor-viewpart",alreadyOwns:".already-yours"},viewOptions:function(){return{savedToWorkspace:n.Data.User.username===this.model.getUsername()}},initialize:function(){this.mainWebPlayer=this.options.webPlayer;var t=n.Shared.Helpers.UrlBuilder(n.Data.Config.urls.webplayer+"/ev.aspx",{p:this.model.get("trackingCode"),a:!0,s:!1,c:!1});this.interactive=new i.Models.Interactive({id:this.model.get("interactiveId"),url:t,player:"clickview",readOnly:!0,autoplay:!0,demoMode:!0},{edit:!1})},renderContributorInfo:function(){var n,t;i.Models.Organisation&&(i.Helpers.Guid.isGuid(this.model.get("videoId"))?(n=this.model.get("owner"),n&&(n=new i.Models.Owner({name:n.firstName,surname:n.surname,organisation:{name:n.schoolName}}),this.model.set({owner:n.toJSON()}))):(n=this.model.get("owner"),n.customers&&n.customers.data&&n.customers.data.length&&(n.organisation=n.customers.data[0])),t=new i.Views.ContributorInfoView({model:this.model}),this.renderView(this.ui.contributorInfo,t))},renderQuestions:function(){var n=new i.Views.InteractiveSummaryList({model:this.interactive,dropdownText:"More info",description:this.model.get("description")});this.renderView(this.ui.questionList,n)},onRender:function(){this.renderContributorInfo();this.renderQuestions();this.initTooltips()},initTooltips:function(){this.ui.alreadyOwns.tooltip()},previewInteractive:function(){this.mainWebPlayer.pause();this.interactive.setUpService(!1);var t=new n.Interactive.Views.AppView({model:this.interactive,showCloseButton:!0}),r=new i.Views.PopupView({view:t,className:"interactive-video-popup",positionX:"0",positionY:"0",canClose:!1,additionalClass:"interactive-popup"});r.selfRender()},play:function(){this.mainWebPlayer.play()},view:function(){var n=new i.Views.CopyInteractiveSuccessView({model:this.model}),t=new i.Views.PopupView({title:"Share this interactive video",view:n,cssId:"copy-interactive-success"});t.selfRender()},sharePopup:function(){var n=new i.Views.InteractiveShareTabView({itemModel:this.model,enableClipping:!1}),t=new i.Views.PopupView({view:n,title:"Share this interactive video",cssId:"cv-share-tab",showButtonContainer:!0});this.options.editor&&this.close();t.selfRender()},saveInteractive:function(){if(n.Data.User.username===this.model.getUsername()){this.sharePopup();return}this.model.copy();this.view()}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Views.InteractiveResourcesListView=t.ListView.extend({childView:i.Views.InteractiveResourceItemView,className:"interactive-items",initialize:function(){this.listenTo(t.Events,"interactivesTab:interactive-created",this.addOne);this.listenTo(this.collection,"paginator:pagechanged",this.render)},addOne:function(n){var r=this.model.get("masterId")||this.model.get("id"),t;n.set({trackingCode:this.model.get("tokenId"),videoId:r,videoTitle:i.Models.InteractiveResource.getTitleFromVideo(this.model),video:this.model.toJSON()});t=this.buildChildView.call(this,n);this.renderView(this.$el,t,{empty:!1})},buildChildView:function(n){var t=_.extend({},_.omit(this.options,["model","id"]),{model:n});return new this.childView(t)}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Views.EmptyInteractivePane=t.View.extend({template:i.Templates.EmptyInteractivePane,className:"interactive-resources-empty",ui:{interactiveResourcesCreateButton:".interactive-tab-create-interactive-empty"},renderEmptyPane:function(){var n=i.Models.InteractiveResource.newResource(this.model),t=new i.Views.CreateInteractiveButton({model:n});this.renderView(this.ui.interactiveResourcesCreateButton,t)},onRender:function(){this.renderEmptyPane()}});i.Views.InteractivePane=t.View.extend({template:i.Templates.InteractivePane,className:"interactive-resources",ui:{interactiveResourcesCreateButton:".interactive-tab-create-interactive",interactiveResourcesList:".interactive-resources-list",pagination:".pagination"},renderCreateButton:function(){if(this.options.renderButton){var n=i.Models.InteractiveResource.newResource(this.model),t=new i.Views.CreateInteractiveButton({model:n});this.renderView(this.ui.interactiveResourcesCreateButton,t)}},renderResourceList:function(){var n=new i.Views.InteractiveResourcesListView({model:this.model,collection:this.collection,webPlayer:this.options.webPlayer});this.renderView(this.ui.interactiveResourcesList,n,{empty:!1})},renderPagination:function(){var n=new i.Views.PaginatorView({collection:this.collection});this.renderView(this.ui.pagination,n)},viewOptions:function(){return this.options},onRender:function(){this.renderCreateButton();this.renderResourceList();this.renderPagination()}});i.Views.InteractiveResourcesTabView=t.View.extend({template:!1,className:"interactive-resources-tab",defaults:{renderButton:!0,preload:!1},initialize:function(){if(!(this.collection instanceof i.Collections.InteractiveResourceCollection))throw Error("An InteractiveResourceCollection is required.");this.listenTo(this.collection,"sync",this.render);this.options.preload&&this.collection.fetch()},onBeforeRender:function(){return this.collection._loaded?!0:(this.renderView(this.$el,new i.Views.SpinJsView({loadingText:"Loading interactive videos...",cover:!0})),this.options.preload||this.collection.fetch(),!1)},renderEmptyInteractivePane:function(){var n=new i.Views.EmptyInteractivePane({model:this.model});this.renderView(this.$el,n)},renderInteractivePane:function(){var n=new i.Views.InteractivePane({model:this.model,collection:this.collection,webPlayer:this.options.webPlayer,renderButton:this.options.renderButton});this.renderView(this.$el,n)},onRender:function(){this.collection.length>0?this.renderInteractivePane():this.renderEmptyInteractivePane()}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared,r=t.ListView.extend({template:i.Templates.InteractiveQuestionPartials,initialize:function(){this.childView=i.Views.TimePointListView},onRender:function(){this.collection&&this.collection.length&&this.$el.empty();this.collection&&!this.collection.length&&this.$el.html('<div class="interaction-list-empty">There are currently no questions for this video.<\/div>')}});i.Views.InteractiveSummaryList=t.View.extend({template:i.Templates.InteractiveSummaryList,className:"question-list",defaults:{renderInPopup:!1,dropdownText:"Question List"},events:{"click .preview-interactive":"toggle"},ui:{list:".interactions",description:".description"},initialize:function(){this.listenTo(this.model,"sync",this.onSync);this.options.renderInPopup||this.listenTo(this.model,"change:show",this.render)},onSync:function(){(this.model.get("show")||this.options.renderInPopup)&&this.render();this.options.renderInPopup||this.ui.list.toggle(!!this.model.get("show"))},toggle:function(){this.model.isLoaded()||this.model.fetch();this.model.toggle("show")},renderListView:function(){var n=new r({collection:this.model.timepoints,renderInPopup:this.options.renderInPopup});this.renderView(this.ui.list,n);this.options.renderInPopup||this.ui.list.toggle(!!this.model.get("show"))},viewOptions:function(){return{dropdownText:this.options.dropdownText,description:this.options.description,renderInPopup:this.options.renderInPopup}},onBeforeRender:function(){return this.options.renderInPopup&&!this.model.isLoaded()?(this.renderView(this.$el,new n.Shared.Views.LoaderView),!1):!0},onRender:function(){this.renderListView()}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared,r;i.Views.TimePointListView=r=t.ListView.extend({childView:i.Views.InteractionListItem,initialize:function(){this.collection=this.model.interactions},buildChildView:function(n){var t=_.extend({},_.omit(this.options,["collection","model","id"]),{model:n,timepoint:this.model});return new this.childView(t)},onRendered:function(){this.model.cid===this.model.collection.at(this.model.collection.length-1).cid&&t.Events.trigger("popup:resize")}});i.Views.PrintableTimePointListView=r.extend({tagName:"li",childView:i.Views.InteractionPrintableItem})}(ClickView,EasyMoney),function(n,t){"use strict";n.Views.PaginatorItemView=t.View.extend({tagName:"li",name:"PaginatorItemView",template:n.Templates.PaginatorItemView,pageId:0,_pagedCollection:!1,initialize:function(){this.pageId=this.options.pageId;this.currentPage=this.options.currentPage;this.text=this.options.text;this.disabled=this.options.disabled;this.collection instanceof t.PagedCollection&&(this._pagedCollection=!0)},events:{"click a":"navigate"},navigate:function(){if(this.disabled)return!1;var n=this.pageId;return this.pageId==0&&(n=""),this.collection.trigger("paginator:navigate",this.pageId,this),this._pagedCollection&&this.collection.getPage(this.pageId),this.collection.trigger("paginator:pagechanged",this.pageId,this),Backbone.history.trigger("userAction",this.pageId,"pagination"),!1},getModel:function(){return{pageId:this.pageId,text:this.text||this.pageId}},onRender:function(){this.pageId==this.currentPage&&this.$el.addClass("current");this.$el.addClass(this.options.cssClass);this.disabled&&this.$el.addClass("disabled")}});n.Views.PaginatorView=t.View.extend({className:"cv-paginator",tagName:"ul",name:"PaginatorView",childView:n.Views.PaginatorItemView,template:function(){return this.options.showDivider&&this.pageCount()>1?'<div class="top-divider"><\/div>':!1},_pagedCollection:!1,_currentPage:1,defaults:{showPages:5,showFirst:!0,showLast:!0,hideOnEmpty:!0,showDivider:!0,firstPage:1,lastPage:10},initialize:function(){if(!this.collection)throw new Error("Paginator View requires a collection");this.collection instanceof t.PagedCollection&&(this._pagedCollection=!0);this._pagedCollection||this.listenTo(this.collection,"paginator:pagechanged",this.onPageChanged);this.listenTo(this.collection,"getpage",this.onPageChanged);this.listenTo(this.collection,"reload reset",this.reRender)},onPageChanged:function(n){this._currentPage=n;this.reRender()},reRender:function(){this.render()},onBeforeRender:function(){if(this.options.hideOnEmpty&&this.collection.length==0)return this.$el.empty(),!1},pageCount:function(){return this._pagedCollection?this.collection.totalPages():this.options.lastPage-(this.firstPage()-1)},firstPage:function(){return this._pagedCollection?this.collection.firstPage():this.options.firstPage},lastPage:function(){return this._pagedCollection?this.collection.lastPage():this.options.lastPage},nextPage:function(){return this._pagedCollection?this.collection.nextPage():Math.min(this.lastPage(),this.currentPage()+1)},previousPage:function(){return this._pagedCollection?this.collection.previousPage():Math.max(this.firstPage(),this.currentPage()-1)},currentPage:function(){return this._pagedCollection?this.collection.currentPage():this._currentPage},previousDisabled:function(){return this._pagedCollection?this.collection.isFirstPage():this.currentPage()<=this.firstPage()},nextDisabled:function(){return this._pagedCollection?this.collection.isLastPage():this.currentPage()>=this.nextPage()},firstDisabled:function(){return this.previousDisabled()},lastDisabled:function(){return this.nextDisabled()},_getStep:function(){return(this.options.showPages-1)/2},_getMiddle:function(){var n=this._getStep();return Math.max(n+1,Math.min(this.currentPage(),this.pageCount()-n))},buildChildView:function(n){return new this.childView(n)},addAll:function(){var t=this.pageCount(),f=this.currentPage(),i=this._getStep(),r=this._getMiddle(),e=r-i,o=r+i,s=this.previousDisabled(),h=this.nextDisabled(),c=this.firstDisabled(),l=this.lastDisabled(),n,u;if(!(t<=1)){for(this.options.showFirst&&this.renderView(this.$el,this.buildChildView({pageId:this.firstPage(),text:"First",className:"first",disabled:c,collection:this.collection,title:this.options.title}),{empty:!1}),this.renderView(this.$el,this.buildChildView({pageId:this.previousPage(),text:"Previous",className:"prev",disabled:s,collection:this.collection,title:this.options.title}),{empty:!1}),n=e;n<=Math.min(o,t);n++)u=this.buildChildView({pageId:n,currentPage:f,collection:this.collection,title:this.options.title}),this.renderView(this.$el,u,{empty:!1});this.renderView(this.$el,this.buildChildView({pageId:this.nextPage(),text:"Next",className:"next",disabled:h,collection:this.collection,title:this.options.title}),{empty:!1});this.options.showLast&&this.renderView(this.$el,this.buildChildView({pageId:this.lastPage(),text:"Last",cssClass:"last",disabled:l,collection:this.collection,title:this.options.title}),{empty:!1})}},onRender:function(){this.addAll()}})}(ClickView.Shared,EasyMoney,jQuery),function(n){n.Views.SelfRefreshingPaginatorView=n.Views.PaginatorView.extend({initialize:function(){n.Views.PaginatorView.prototype.initialize.apply(this,arguments);this.listenTo(this.collection,"reload",this.reload)},reload:function(){var t=this.collection.lastPage(),i=this.collection.firstPage(),n=this.collection.currentPage();(n!==i||n!==t)&&(n===t&&this.collection.length||(n!==t||this.collection.length?this.collection.fetchFromMaster({page:n}):this.navigateToUrl(n-1)))},getUrl:function(n){var t=window.location.pathname;return this.collection.currentPage()!==1&&(t=t.substring(0,t.lastIndexOf("/"))),n===1?t:t+"/"+n},navigate:function(n){n.preventDefault();this.navigateToUrl(this.pageId)},navigateToUrl:function(n){EasyMoney.Events.trigger("navigate",this.getUrl(n));window.scrollTo(0,0)}})}(ClickView.Shared);!function(n,t){"use strict";var i=n.Shared,r,u=2046453,f=2046458;r=t.View.extend({name:"ListToggleView",className:"list-style-toggle",template:'<a class="tile-btn"><\/a><a class="list-btn"><\/a>',events:{"click .tile-btn":"onTileBtnClick","click .list-btn":"onListBtnClick"},onTileBtnClick:function(){t.Events.trigger("tile")},onListBtnClick:function(){t.Events.trigger("list")}});i.Views.BannerView=t.View.extend({name:"BannerView.js",className:"banner",template:i.Templates.Banner,model:i.Models.Banner,defaults:{showListToggle:!0,lazyLoad:!0},bannerMappings:{"Most Recent":1,"Staff Picks (ClickView TV)":4},ui:{downloadPdfContainer:".downloading-pdf-container"},hasBannerId:function(){return!!this.model.get("id")},getCuratorLink:function(){var n=this.model.parent;return(n instanceof i.Models.BaseCategory)?i.Services.ObjectLinkService.getCollectionCuratorUrl(n):null},renderDownloadButton:function(){this.renderView(this.ui.downloadPdfContainer,new i.Views.DownloadPdfView({model:this.model.parent,breadcrumbService:this.options.breadcrumbService}))},showDownloadPdf:function(){return this.options.totalVideos<1||!n.Data.User.username?!1:this.model.parent?n.Shared.Helpers.Guid.isEmptyGuid(this.model.parent.get("onlineId"))&&this.model.parent.get("type")==="category"?!0:!n.Shared.Helpers.Guid.isGuid(this.model.parent.get("onlineId"))&&this.model.parent.get("type")==="series"?!0:!1:!1},viewOptions:function(){var t=n.Shared.Helpers.userIsInGroup([u,f]);return{name:this.options.name,lazyLoad:this.options.lazyLoad,subHeading:this.options.subHeading,isCurator:t,curatorLink:t&&this.getCuratorLink(),downloadPdf:this.showDownloadPdf()}},onRender:function(){var t=this.model.get("url");!t&&this.model.parent&&(t=i.Services.CategoryImageService.getBanner(this.model.parent.get("name")));t=i.Helpers.StripProtocol(t);t=i.Helpers.cdnFilter(t);this.$el.css({"background-image":"url("+t+")"});n.Data.User.role!==1&&this.showDownloadPdf()&&this.renderDownloadButton()},onRendered:function(){this.options.showListToggle&&this.renderView(this.$el,new r,{empty:!1})}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared,r=t.View.extend({template:i.Templates.BreadcrumbView,tagName:"li",analyticsService:n.Shared.Utils.AnalyticsService,events:{"click a":"onClick"},initialize:function(){this.service=this.options.service},onClick:function(n){var r=$(n.currentTarget),i;if(r&&(i=r.attr("href"),i))return this.options.channel&&this.options.channelEvent?this.options.channel.trigger(this.options.channelEvent,{url:i,trigger:!0}):t.Events.trigger("navigate",i),this.analyticsService.logBreadcrumbSelect({id:this.model.get("id"),name:this.model.get("name")}),!1},viewOptions:function(){return{url:this.model.get("url")||this.service.navigateUrl(this.model),last:this.options.last}}});i.Views.BreadcrumbView=t.ListView.extend({name:"BreadcrumbView.js",childView:r,className:"breadcrumbs",initialize:function(){if(!(this.options.service instanceof i.Services.BreadcrumbService))throw new Error(this.name+" requires an instance of ClickView.Shared.Services.BreadcrumbService");this.setCollection();this.listenTo(this.options.service,"update",this.onUpdate)},onUpdate:function(){this.setCollection();this.render()},setCollection:function(){this.collection=this.options.service.getCrumbs(this.model)},addOne:function(n,t){this.renderView(this.$el,this.buildChildView.call(this,n,t),{empty:!1})},buildChildView:function(n,t){var i=_.extend({},_.omit(this.options,["collection","model","id"]),{model:n,last:t===this.collection.length-1});return new this.childView(i)}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Views.MediaCollectionPaginatorItemView=i.Views.PaginatorItemView.extend({name:"MediaCollectionPaginatorItemView",template:i.Templates.MediaCollectionPaginatorItemView,getUrl:function(){var n=i.Helpers.GetQueryString()||{};return n.page=this.pageId,n.q&&(n.q=decodeURIComponent(n.q)),window.location.pathname+"?"+$.param(n)},navigate:function(r){if(r.preventDefault(),this.disabled)return!1;var u=i.Helpers.GetQueryString()||{};return u.q&&(u.query=decodeURIComponent(u.q)),u.page=this.pageId,this.options.sortService instanceof n.Shared.Services.SortService&&(u.sort=this.options.sortService.getCurrentSortType()),typeof this.collection.setFetchData=="function"&&this.collection.setFetchData(_.pick(u,["page","sort"])),this.collection.fetch({data:u}),t.Events.trigger("navigate",this.getUrl(),{trigger:!1}),this.options.title&&n.Shared.Services.NavigationHistoryService.addPage(this.options.title),!1},getModel:function(){return _.extend({},i.Views.PaginatorItemView.prototype.getModel.apply(this,arguments),{url:this.getUrl(),disabled:this.disabled})}});i.Views.MediaCollectionPaginatorView=i.Views.PaginatorView.extend({name:"PaginatorView.js",childView:i.Views.MediaCollectionPaginatorItemView,buildChildView:function(n){return n||(n={}),n.sortService=this.options.sortService,i.Views.PaginatorView.prototype.buildChildView.apply(this,arguments)}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared,r=i.Utils.Constants.STRINGS.LAYOUT_TYPES,u=i.Utils.Constants.CONTEXTS.MEDIA_COLLECTION,f=t.View.extend({template:i.Templates.EmptyMediaCollection,className:"empty-video",defaults:{collectionType:"categories"},viewOptions:function(){var n;switch(this.options.collectionType){case"series":n="series";break;case"topics":n="topic";break;case"channels":n="channel";break;default:n="category"}return{type:n,emptyMessage:this.options.emptyMessage}}}),e=t.ListView.extend({template:'<h1 class="sub-categories-title">Categories<\/h1><div class="categories-container"><\/div>',className:"tile-list sub-category-tile-list",tagName:"div",ui:{categories:".categories-container"},initialize:function(){this.childView=i.Views.BaseTileItemView},addOne:function(n){this.renderView(this.ui.categories,this.buildChildView.call(this,n),{empty:!1})}});i.Views.MediaCollectionView=t.View.extend({name:"MediaCollectionView.js",template:i.Templates.MediaCollection,className:function(){var n="media-collection";return this.isLoaded()?n:(n+=" partial-loading-view",this.getLayoutPreference()===r.COSY&&(n+=" cosy"),n)},videoListView:i.Views.MasterVideoListView,defaults:{showListToggle:!1,showHeading:!0,showSorting:!0,showHeader:!0,showPagination:!0,showPinnedVideos:!1,tileMode:!1,showBanner:!0,bulkActions:!1,isLibraryVideo:!1,layoutToggle:!0,layoutDefault:r.COMFORTABLE,layoutStorageKey:"_c-"+n.Data.User.username+":layout:preference:type",trackContext:!0,emptyMessage:null},ui:{banner:".banner-viewpart",sorting:".sorting-container",videoList:".video-list-viewpart",pagination:".pagination-viewpart",videoBlock:".video-block",subCategories:".sub-categories-viewpart",listView:".tile-list-view",pinnedVideos:".pinned-videos-viewpart",cloudVideos:".cloud-videos-viewpart"},initialize:function(){this.collection&&!this.options.tileMode&&(this.listenTo(this.collection,"request",this.onCollectionRequest),this.listenTo(this.collection,"itemsrendered",this.onCollectionSync));this.initializeSortService();this.initializeLayout();this.videoListView=this.videoListView||i.Views.MasterVideoListView;this.model&&this.collection&&(this.listenTo(this.model,"sync",this.initializeRestrictionListeners),this.listenTo(this.collection,"sync",this.initializeRestrictionListeners));this.contextService=i.Services.ContextService;this.setContext()},initializeSortService:function(){if(this.options.showSorting){if(!this.options.isCuratedCollection){this.sortService=new i.Services.SortService;return}this.sortService=new i.Services.SortService({storageKeyPrefix:"sort-service:widgets:type",extraSortOptions:[{type:"orderindex",text:"Curator picks",order:0}]})}},initializeLayout:function(){this.options.layoutToggle&&this.listenTo(this.collection,"change:layout",this.changeLayout)},setContext:function(){if(this.options.trackContext){var n;this.collection&&this.collection instanceof t.PagedCollection&&(n=this.collection.currentPage());this.contextService.setContext(u,{model:this.model,collection:this.collection,page:n,layout:this.getLayoutPreference(),sort:this.sortService&&this.sortService.getCurrentSortType()})}},initializeRestrictionListeners:function(){this.model.pinnedVideos&&this.model.pinnedVideos.length&&this.collection&&this.collection.length&&(this._restrictionListenersBound||(this.listenTo(this.model.pinnedVideos,"itemRestricted itemUnrestricted",this.onRestrictionChange),this.listenTo(this.collection,"itemRestricted itemUnrestricted",this.onRestrictionChange),this._restrictionListenersBound=!0))},onSync:function(){this.render()},onCollectionRequest:function(){this.isInDOM()&&this.ui.videoBlock.addClass("video-fade-out")},onCollectionSync:function(){this.isInDOM()&&this.ui.videoBlock.removeClass("video-fade-out");this.setContext()},onRestrictionChange:function(n){if(this.collection.contains(n)&&this.model.pinnedVideos.get(n.get("id"))&&(this.listenToOnce(this.model,"sync",this.renderPinnedVideos),this.model.fetch()),this.model.pinnedVideos.contains(n)&&(this.renderPinnedVideos(),this.collection.get(n.get("id")))){var t=i.Helpers.GetQueryString()||{};this.collection.fetch({data:t})}},changeLayout:function(n){n&&(n===r.COSY&&this.ui.videoBlock.toggleClass("cosy"),n===r.COMFORTABLE&&this.ui.videoBlock.removeClass("cosy"),this.setLayoutPreference(n))},getLayoutPreference:function(){var n=i.Utils.LocalStorageHelper.get(this.options.layoutStorageKey);return n?n:this.options.layoutDefault},setLayoutPreference:function(n){i.Utils.LocalStorageHelper.set(this.options.layoutStorageKey,n);this.setContext()},closeVideoLoader:function(){return this._videoSpinner&&this._videoSpinner.close(),!0},isLoaded:function(){var n=!0;return n&=!this.model||this.model.loaded,n&this.collection.loaded},hasSubCategories:function(){return this.model.categories&&this.model.categories.length},extraSortOptions:function(){},fetchData:function(){var n=[],t=i.Helpers.GetQueryString()||{};this.options.showSorting&&(t.sort||(t.sort=this.sortService.getCurrentSortType()));!this.model||this.model.loaded||n.push(this.model.fetch());this.collection.loaded||n.push(this.collection.fetch({data:t}));$.when.apply(this,n).then(_.bind(this.onSync,this))},bindScrollEvent:function(){$(window).bind("scroll."+this.cid,_.debounce(_.bind(this.onScroll,this),333))},unbindScrollEvent:function(){$(window).unbind("scroll."+this.cid)},onScroll:function(){var n=$(window);n.scrollTop()+n.height()>$(document).height()-100&&this.collection.nextPage()},_getSubHeading:function(){if(!this.collection)return"";var n=this._getTotalItems();return n+" "+(Number(n)===1?"video":"videos")},_showLayoutToggle:function(){return!this.options.tileMode&&this.options.layoutToggle},_getTotalItems:function(){return _.isFunction(this.collection.totalItems)?this.collection.totalItems():this.collection.length},renderBanner:function(){var n,t;this.options.showBanner&&this.model&&this.model.banner&&(n=this.model.get("name"),i.Models.Series&&this.model instanceof i.Models.Series&&(n="Series: "+n),t=new i.Views.BannerView(_.extend({},this.options,{model:this.model.banner,name:n,id:this.model.get("dateCreated"),subHeading:this._getSubHeading(),breadcrumbService:this.options.breadcrumbService,totalVideos:Number(this._getTotalItems())})),this.renderView(this.ui.banner,t))},renderSubCategories:function(){this.hasSubCategories()&&this.renderView(this.ui.subCategories,new e({collection:this.model.categories,rootUrlTemplate:this.options.rootUrlTemplate}))},renderMediaList:function(n){n||(n={});var t=new this.videoListView(_.extend({parent:this.model,collection:this.collection,currentUser:this.options.currentUser,name:this.model.get("name"),tileMode:this.options.tileMode,collectionType:this.options.collectionType,bulkActions:this.options.bulkActions,rootUrl:this.options.rootUrl,isLibraryVideo:this.options.isLibraryVideo,layoutToggle:this._showLayoutToggle(),videoListItemOptions:this.options.videoListItemOptions},n));this.renderView(this.ui.videoList,t)},renderHeading:function(){if(this.options.showHeading){var n={name:this.model.get("name"),collection:this.collection,showSorting:this.options.showSorting,breadcrumbService:this.options.breadcrumbService,model:this.model,extraSortOptions:this.extraSortOptions(),channel:this.options.channel,channelEvent:this.options.channelEvent,sortService:this.sortService,layoutToggle:this._showLayoutToggle(),layoutDefault:this.getLayoutPreference()};this.options.heading&&(n.heading=this.options.heading);this.renderView(this.ui.sorting,new i.Views.SortingView(n))}},renderPagination:function(){if(this.options.showPagination&&!this.options.tileMode){var n=new i.Views.MediaCollectionPaginatorView({collection:this.collection,title:this.model.get("name"),sortService:this.sortService});this.renderView(this.ui.pagination,n,{empty:!1})}},renderVideoLoader:function(){this.closeVideoLoader();var n=this._videoSpinner=new i.Views.SpinJsView({cover:!0,spinColor:"#d7d7d7"});return this.renderView(this.$el,n,{empty:!1}),!0},renderPinnedVideos:function(){if(this.options.showPinnedVideos&&this.model&&this.model.pinnedVideos&&!(this.model.pinnedVideos.length<4)){i.Services.ContextService.setContext(i.Utils.Constants.CONTEXTS.EASY_SLIDE,{location:this.name});var n=new i.Views.HorizontalListView({collection:this.model.pinnedVideos,heading:"Curated by ClickView",shouldFetch:!1});this.renderView(this.ui.pinnedVideos,n)}},renderPinnedVideoPartialLoading:function(){if(this.options.showPinnedVideos){var n=new i.Views.HorizontalPartialLoadingView({slidingListView:i.Views.SlidingListView});i.Services.ContextService.setContext(i.Utils.Constants.CONTEXTS.EASY_SLIDE,{location:this.name});this.renderView(this.ui.pinnedVideos,n)}},onBeforeRender:function(){return this.isLoaded()||(this._resetClassName(),this.fetchData()),!0},viewOptions:function(){return{hasSubCategories:this.hasSubCategories(),showBanner:this.options.showBanner,showHeader:this.options.showHeader,tileMode:this.options.tileMode,isLibraryVideo:this.options.isLibraryVideo,layoutToggle:this.options.layoutToggle}},onRender:function(){if(!this.isLoaded()){this.renderPinnedVideoPartialLoading();return}if(this._resetClassName(),this.renderBanner(),this.renderSubCategories(),this.renderHeading(),!this.collection||!this.collection.length){this.renderView(this.ui.videoList,new f({collectionType:this.options.collectionType,emptyMessage:this.options.emptyMessage}));return}this.renderMediaList();this.renderPagination();this.renderPinnedVideos();this.options.tileMode&&this.bindScrollEvent();this._showLayoutToggle()&&this.changeLayout(this.getLayoutPreference())},onRendered:function(){this.options.tileMode&&this.ui.listView.isotope({itemSelector:".isotope-tile-item",sortBy:"original-order",layoutMode:"moduloColumns",percentPosition:!0,moduloColumns:{columnWidth:".isotope-tile-item",gutter:0}})},onClose:function(){this.unbindScrollEvent();this.model&&this.model.cancel();this.collection&&this.collection.cancel()},_resetClassName:function(){this.$el.attr("class",_.result(this,"className"))}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared,r=i.Utils.Constants.STRINGS.LAYOUT_TYPES,u,f,e,o,s,h;i.Views.HeaderButtonView=h=t.View.extend({name:"HeaderButton",className:"header-button",tagName:"button",template:!1,events:{click:"onClick"},onClick:function(){}});s=t.View.extend({name:"LayoutItemView",className:"layout-item",template:i.Templates.LayoutItem,tagName:"span",initialize:function(){this.listenTo(this.model,"change:selected",this.render)},events:{click:"onClick"},onClick:function(n){return n.preventDefault(),n.stopPropagation(),this.model.set("selected",!0),!1}});o=t.ListView.extend({name:"LayoutListView",className:"layout-list",tagName:"span",childView:s});e=t.View.extend({name:"AddToPlaylistButtonView",tagName:"button",className:"btn grey video-action-button",template:"{{text}}",events:{click:"onClick"},onClick:function(){this.collection.trigger("bulk:add-to-playlist")},viewOptions:function(){return{text:"Add to a playlist ("+this.collection.selected().length+" videos)"}}});u=t.View.extend({name:"DropDownItemView",tagName:"li",template:i.Templates.DropdownItemView,events:{click:"onClick"},radioChannels:["sort-view"],onClick:function(n){return n.preventDefault(),n.stopPropagation(),this.radio["sort-view"].trigger("sort",this.model.get("type")),!1},onBeforeRender:function(){var n=this.model.get("current");return n&&this.$el.hide(),!n}});f=t.ListView.extend({className:"dropdown-menu",name:"DropdownListView",tagName:"ul",childView:u,template:!1});i.Views.SortingView=t.View.extend({name:"SortingView.js",template:i.Templates.Sorting,className:"sorting-viewpart",radioChannels:{"sort-view":{sort:"sort"}},defaults:{fetch:!0,heading:function(){if(this.collection&&(!this.collection||this.collection instanceof t.PagedCollection))return this.collection.totalItems()+" videos in "+this.options.name},bulkActions:!1,showSorting:!0,extraSortOptions:!1,headerAction:!1,layoutToggle:!1,layoutDefault:r.COMFORTABLE,layoutTypes:{comfortableList:!0,cosyList:!0,grid:!1}},ui:{sortingDropdown:".sorting-dropdown",checkbox:".checkbox-viewpart",bulkActionsDropdown:".bulk-actions-viewpart",breadcrumbs:".breadcrumb-viewpart",layout:".layout-viewpart",headerAction:".action-viewpart"},initialize:function(){this.radio=this.options.radio||new t.Radio({name:"sortingRadio"});this.options.showSorting&&(this.sortService=this.options.sortService||new i.Services.SortService,this.sortTypes=this.sortService.getSortTypes(),this.sortType=this.sortService.getCurrent());this.handleBulkActions();this.initLayoutToggle()},sort:function(t){(n.Shared.Services.NavigationHistoryService.addPage(this.options.name),this.sortService.setCurrent(t,{save:!0}),this.sortType=this.sortService.getCurrent(),this.render(),this.options.fetch&&this.options.showSorting)&&this.collection.length&&this.collection.fetch({data:{sort:this.sortType.get("type")}})},initLayoutToggle:function(){this.options.layoutToggle&&(this.layoutActionItems=new i.Collections.ActionItemCollection(this.getLayoutItems()),this.listenTo(this.layoutActionItems,"change:selected",this.onSelectLayoutItem))},getLayoutItems:function(){var n=[],t=this.options.layoutTypes,i;if(t.comfortableList&&n.push({text:"comfortable",type:r.COMFORTABLE,className:"list"}),t.cosyList&&n.push({text:"cosy",type:r.COSY,className:"list"}),t.grid&&n.push({text:"grid",type:r.GRID,className:"grid"}),n.length<2)throw Error("More than 1 layout toggle is requried. Check your options or disable layout toggling.");return i=_.bind(function(n){n.selected=n.type===this.options.layoutDefault},this),_.each(n,i)},onSelectLayoutItem:function(n){n.get("selected")&&this.collection.trigger("change:layout",n.get("type"))},handleBulkActions:function(){if(this.options.bulkActions)this.bulkActionCollection=new n.Shared.Collections.VideoActionCollection([{text:"Add to a playlist",desc:"Add this video to a playlist",eventName:"bulk:add-to-playlist",className:"add-to-playlist"}]),this.listenTo(this.collection,"change:selected",this.render),this.listenTo(this.collection,"bulk:add-to-playlist",this.bulkAddToPlaylist)},bulkAddToPlaylist:function(){var t=new n.Shared.Models.PlaylistWrapper({collection:this.collection.selected()}),i=new n.Shared.Views.PlaylistTabView({model:t}),r=new n.Shared.Views.PopupView({view:i,title:"Add this video to a playlist",cssId:"cv-share-tab",showButtonContainer:!0});r.selfRender()},viewOptions:function(){return{text:this.sortType&&this.sortType.get("text"),heading:this.options.heading,bulkActions:this.options.bulkActions,showSorting:this.options.showSorting,layoutToggle:this.options.layoutToggle}},renderSortingDropdown:function(){var n=new f({collection:this.sortTypes,current:this.sortType,radio:this.radio});this.renderView(this.ui.sortingDropdown,n,{empty:!1})},renderBulkActionsDropdown:function(){if(!(this.collection.selected().length<2)){var n=new e({collection:this.collection});this.renderView(this.ui.bulkActionsDropdown,n)}},renderCheckbox:function(){var t=new n.Shared.Models.CheckBoxWrapper({collection:this.collection}),r=new i.Views.CheckBoxView({model:t,colour:"grey"});this.renderView(this.ui.checkbox,r)},renderBreadcrumbs:function(){this.renderView(this.ui.breadcrumbs,new i.Views.BreadcrumbView({model:this.model,service:this.options.breadcrumbService,channel:this.options.channel,channelEvent:this.options.channelEvent}))},renderHeaderAction:function(){this.renderView(this.ui.headerAction,new h)},renderHeaderText:function(){this.ui.breadcrumbs.html(_.isFunction(this.options.heading)?this.options.heading.call(this):this.options.heading)},renderLayoutToggle:function(){var n=new o({collection:this.layoutActionItems});this.renderView(this.ui.layout,n)},onRender:function(){this.options.headerAction&&this.renderHeaderAction();this.options.breadcrumbService?this.renderBreadcrumbs():this.renderHeaderText();this.options.showSorting&&this.renderSortingDropdown();this.options.bulkActions&&(this.renderCheckbox(),this.renderBulkActionsDropdown());this.options.layoutToggle&&this.renderLayoutToggle()},onRendered:function(){this.$el.find("[title]").tooltip()},onClose:function(){this.$("[title]").tooltip("destroy")}})}(ClickView,EasyMoney),function(n,t){"use strict";n.Shared.Views.PlayView=t.View.extend({name:"PlayView",model:n.Shared.Models.Video,resourceCollection:null,relatedVideoCollection:null,template:n.Shared.Templates.PlayView,resourcesView:n.Shared.Views.ResourcesView,relatedVideosView:n.Shared.Views.RelatedVideosView,_playLogged:!1,_logTimeout:null,ui:{$playerViewpart:".play_embeded_player",$tabViewpart:"#tab-viewpart",$relatedVideosViewpart:"#related-videos-viewpart",$resourcesViewpart:"#resources-viewpart",$playViewpartOther:".play-viewpart-other",$playViewpartMain:".play-viewpart-main"},events:{"click .cv-backlink":"back","click .series-link":"onClickSeriesLink"},defaults:{controllerName:null,renderResources:!0,canFlag:!1},initialize:function(){this.listenTo(this.model,"sync",this.onSync);this.currentUser=n.Data.User;this.analyticsService=n.Shared.Utils.AnalyticsService;this.albertLearningAreaType=n.Data.AlbertLearningAreaType;this.resourceCollection=new n.Shared.Collections.ResourceCollection([],this.model);this.relatedVideoCollection=this.options.relatedVideoCollection?this.options.relatedVideoCollection:new n.Shared.Collections.RelatedVideosCollection([],this.model);this.options.controllerName=="playlists"&&this.model.collection&&(this.relatedVideoCollection=this.model.collection);this.listenTo(this.resourceCollection,"sync",this.onResourceSync);this.listenTo(this.relatedVideoCollection,"sync",this.onRelatedVideosSync);this._hasVideoModel()&&(this.setWebplayerModel(),this.fetchRelatedData(),this.startBackupPlayLogger())},setWebplayerModel:function(){var t=this.model.get("id"),i=this.model.get("masterId");this.webplayerModel=new n.Shared.Models.WebPlayer({id:i||t,autoplay:!0,parameters:n.Shared.Helpers.GetQueryString(),trackingCode:this.model.get("tokenId")});this.listenTo(this.webplayerModel,"change:currenttime",this.onCurrentTimeChange);this.listenTo(this.webplayerModel,"ended",this.onVideoEnded);this.listenTo(this.webplayerModel,"showDevices",this.startDeviceApp)},fetchRelatedData:function(){this.resourceCollection.fetch();this.relatedVideoCollection instanceof n.Shared.Collections.RelatedVideosCollection?this.relatedVideoCollection.fetch():this.relatedVideoCollection.trigger("sync",this.relatedVideoCollection)},onClickSeriesLink:function(n){var r=$(n.currentTarget),i;if(r&&(i=r.attr("href"),i))return t.Events.trigger("navigate",i),!1},onSync:function(){this._hasVideoModel()&&(this.setWebplayerModel(),this.startBackupPlayLogger(),this.fetchRelatedData(),this.render())},onResourceSync:function(n){n._loaded=!0;this.relatedVideoCollection._loaded&&this.renderSideBar()},_backupLoggerTimeout:null,startBackupPlayLogger:function(){clearTimeout(this._backupLoggerTimeout);var n=this;this._backupLoggerTimeout=setTimeout(function(){n.webplayerModel&&n.webplayerModel.get("ready")||n.logPlay()},8e3)},getExtraLoggingValues:function(){return{}},logPlay:function(){if(!this._playLogged&&this._hasVideoModel()&&this.analyticsService){var n=this.options.controllerName;this.analyticsService.logVideoWatch(this.model,n,this.getExtraLoggingValues());this._playLogged=!0}},onClose:function(){clearTimeout(this._logTimeout);$(window).off("keypress")},back:function(n){var r=$(n.currentTarget),i;if(r&&(Backbone.history.trigger("userAction",this.model.get("title"),"backButton"),i=r.attr("href"),i))return this.model.get("redirect")?(window.location.href=i,!1):(t.Events.trigger("navigate",i),!1)},startDeviceApp:function(){var i=n.Services.DeviceService,t;i&&(t=i.getEventChannel("device:config"),t)&&t.trigger("cv-device-start",this.model)},onBeforeRender:function(){if(!this._hasVideoModel())return this.renderLoader(),!1},getModel:function(){var t=this.model.toJSON();t.source=this.options.source;t.backUrl=this.options.backUrl;var i=n.Shared.Helpers.GetQueryString(),r=i.albert,u=i.search;return!r||(t.backUrl=!u?"/albert":"/albert#search=true",t.source="Albert",this.model.set("redirect",!0)),t},_hasVideoModel:function(){return this.model.get("tokenId")&&this.model.get("id")},_timeEventsReceived:0,onCurrentTimeChange:function(){this._playLogged||this.webplayerModel&&(this.webplayerModel.get("paused")||this.webplayerModel.get("currenttime")<=0||(this._timeEventsReceived++,this._timeEventsReceived<3)||this.logPlay())},onVideoEnded:function(){this.logPlay()},renderWebPlayer:function(){this.webPlayerView=new n.Shared.Views.WebPlayerView({model:this.webplayerModel});this.renderView(this.ui.$playerViewpart,this.webPlayerView)},renderRelatedVideos:function(){var n={model:this.model,collection:this.relatedVideoCollection},t;return this.options.headerTitle&&(n.headerTitle=this.options.headerTitle),this.options.controllerName=="playlists"&&(n.headerTitle="Other videos in this playlist"),t=new this.relatedVideosView(n),this.renderView(this.ui.$relatedVideosViewpart,t),t},renderResources:function(){var n=new this.resourcesView({model:this.model,collection:this.resourceCollection});return this.renderView(this.ui.$resourcesViewpart,n),n},renderTabs:function(){var t=this.getTabs(),i=new n.Shared.Views.TabView({collection:new n.Shared.Collections.TabCollection(t),videoModel:this.model});this.renderView(this.ui.$tabViewpart,i)},onRelatedVideosSync:function(n){n._loaded=!0;this.resourceCollection._loaded&&this.renderSideBar()},onResourcesSync:function(n){n._loaded||(n._loaded=!0);this.isInDOM()&&this.renderResources()},getSignedInUsersChannelId:function(){return 0},getTabs:function(){var t=this.getSignedInUsersChannelId();return n.Shared.Services.PlayTabService.getTabs(this.model,{channelId:t,userChannel:this.options.userChannel,webPlayerView:this.webPlayerView,flag:this.options.canFlag,about:!0,share:!0,pushTo:!0,devices:!0,playlist:!0,curriculum:!0,interactives:!0,channelPlaylists:!!t})},bindSpacebar:function(){$(window).off("keypress");var n=this;$(window).on("keypress",function(t){var i=t.target.tagName.toLowerCase();if(t.charCode===32&&i!=="input"&&i!=="textarea")return t.stopPropagation(),n.webPlayerView&&n.webPlayerView.togglePlay(),!1})},onRender:function(){this._firstRender=!0;this.renderWebPlayer();this.renderTabs();this.renderSideBar();this.bindSpacebar()},renderSideBar:function(){if(!this.relatedVideoCollection._loaded||!this.resourceCollection._loaded)return this.renderView(this.ui.$resourcesViewpart,new n.Shared.Views.LoaderView({cover:!0})),!1;this._firstRender&&(this.renderResources(),this.renderRelatedVideos())},renderLoader:function(){var t=new n.Shared.Views.LoaderView;this.renderView(this.$el,t)}})}(ClickView,EasyMoney),function(n,t){"use strict";n.Shared.Views.AboutTabView=t.View.extend({name:"AboutTabView.js",model:n.Shared.Models.Video,template:n.Shared.Templates.LegacyAboutTab,_reported:!1,initialize:function(){this.config=n.Data.Config;this.currentUser=n.Data.User},defaults:{showDownloadLinks:!1,alwaysShowLicence:!1,showTags:n.Data.Config.albertOptions&&n.Data.Config.albertOptions.enabledTag},ui:{contentLicence:".content-licence-viewpart",downloads:".download-viewpart",albertTag:".albert-tag-viewpart",verifiedBadge:".verified-badge",contributorInfo:".contributor-info"},getModel:function(){var t=this.model.toJSON();return t.year<1970&&(t.year=!1),t=n.Shared.Helpers.formatRating(t),!t.dateBroadcast||(t.dateBroadcast=moment(t.dateBroadcast).isBefore("0001-01-02")?null:n.Shared.Helpers.formatUTCToLocal(t.dateBroadcast)),{video:t,options:this.options,showMp4Download:!0,showClkDownload:!1,showDateBroadcast:t.module.toLowerCase()==="free2air",ownerComment:t.ownerComment&&!_.isEmpty(t.ownerComment)}},events:{"click .download-mp4":"downloadMp4","click .download-clk":"downloadClk"},startDownload:function(n){var t=this.$el.find("iframe");t.length===0&&(t=$("<iframe />").hide(),this.$el.append(t));t.attr("src",n)},downloadMp4:function(){var t=this.config.urls.workspaceApi+"/workspace/download/"+this.model.get("tokenId");t=n.Shared.Helpers.StripProtocol(t);this.recordRoyalty();this.startDownload(t)},downloadClk:function(){var t=this.config.urls.workspaceApi+"/workspace/downloadclk/"+this.model.get("tokenId");t=n.Shared.Helpers.StripProtocol(t);this.recordRoyalty();this.startDownload(t)},recordRoyalty:function(){this._reported||(n.Shared.Utils.AjaxHelper.post("/royalties",{videoId:this.model.get("id"),type:"download-mp4"}),this._reported=!0)},renderContentLicence:function(){n.Data.Config.featureSwitches.showRoyaltyCollectionLicense&&(this.model.showLicence()||this.options.alwaysShowLicence)&&this.renderView(this.ui.contentLicence,new n.Shared.Views.ContentLicenceView({licence:n.Data.Config.contentLicence}))},renderAlbertTag:function(){if(this.options.showTags&&this.currentUser.role!==1&&this.currentUser.role!==8&&(this.model.isLibraryVideo()||this.model.isExchangeVideo())){var t=new n.Shared.Collections.AlbertTagsCollection(null,{trackingCode:this.model.get("tokenId")}),i=new n.Shared.Views.AlbertTagsView({collection:t});this.renderView(this.ui.albertTag,i)}},renderContributorInfo:function(){this.model.has("owner")&&this.renderView(this.ui.contributorInfo,new n.Shared.Views.ContributorInfoView({model:this.model,label:!0}))},onRender:function(){this.renderContributorInfo();this.renderContentLicence();this.renderAlbertTag()}})}(ClickView,EasyMoney),function(n,t){"use strict";var u=t.Model.extend({defaults:{id:"",url:"",title:"",series:"",tokenId:"",source:"",description:"",duration:""},actionUrl:function(){return this.get("url")}}),i,r;n.Collections.RelatedVideosCollection=t.Collection.extend({model:u,videoModel:null,url:function(){if(this.videoModel!=null){var n=this.getSource(),t=this.videoModel.get("tokenId");return"/api/curriculum/relatedVideos/"+n+"/library/"+this.videoModel.get("libraryId")+"/videos/"+t}},getSource:function(){return this.videoModel.isWorkspaceVideo()?"workspace":this.videoModel.isExchangeVideo()?"exchange":this.videoModel.isSupLibraryVideo()?"suplibrary":this.videoModel.isLibraryVideo()?"mylibrary":void 0},initialize:function(n,t){this.videoModel=t;this.listenTo(this,"sync",this.onSync)},onSync:function(){this.loaded=!0}});i=n.Views.RelatedVideosListItem=t.View.extend({name:"relatedVideosListItem",className:"related-video",template:n.Templates.RelatedVideoItem,events:{click:"onClick"},initialize:function(){this.listenTo(this.model,"remove",this.close)},onClick:function(){Backbone.history.trigger("userAction",this.model.get("title"),"relatedVideoClick")},getModel:function(){var n=this.model.get("url");_.isFunction(this.model.actionUrl)&&(n=this.model.actionUrl());var t=ClickView.Shared.Helpers.GetQueryString(),i=t.albert,r=t.search;return!i||(n=n+(!r?"?albert=true":"?albert=true&search=true")),{video:this.model.toJSON(),actionUrl:n?n.toLowerCase():n}}});r=n.Views.RelatedVideosListView=t.ListView.extend({name:"relatedVideosListView",childView:i,tagName:"div",className:"related-videos-list",initialize:function(){this.listenTo(this.collection,"add",this.addOne)}});n.Views.RelatedVideosView=t.View.extend({id:"related-videos-widget",name:"RelatedVideosView",model:n.Models.Video,template:'<h3 class="sidebar-header">{{headerTitle}}<\/h3><div class="related-videos-viewpart"><p class="no-videos">No related videos found for this video.<\/p><\/div>',relatedVideosListView:r,defaults:{headerTitle:"Related videos"},ui:{videoList:".related-videos-viewpart"},_loaded:!1,_scrollBarInit:!1,initialize:function(){this.collection==null&&(this.collection=new n.Collections.RelatedVideosCollection([],this.model),this.collection.fetch());this._loaded=this.collection.length>0;this.listenTo(this.collection,"sync add",this.onLoad)},getModel:function(){return this.options},showLoader:function(){},onLoad:function(){this._loaded||(this._loaded=!0);this.render()},renderVideos:function(){if(!this.collection._loaded){this.renderView(this.ui.videoList,new n.Views.LoaderView({cover:!0,imageUrl:"/Assets/images/icons/cv-inline-loader.GIF"}));return}if(this.collection.length){var t=new this.relatedVideosListView({collection:this.collection});this.renderView(this.ui.videoList,t)}},onRender:function(){this.renderVideos()}})}(ClickView.Shared,EasyMoney),function(n,t){"use strict";var i=n.Shared;i.Models.Resource=t.Model.extend({defaults:{id:"",ext:"",title:"",fileName:""}});i.Models.MasterResource=t.Model.extend({defaults:{id:"",name:"",type:"",fileId:"",url:""}});i.Collections.ResourceCollection=t.Collection.extend({model:i.Models.Resource,initialize:function(n,t){this.videoModel=t;this.listenTo(this,"sync",this.onSync)},url:function(){return"/api/videos/"+this.videoModel.get("tokenId")+"/resources"},parse:function(n){return n&&n.data?n.data:n},onSync:function(){this.loaded=!0;this._loaded=!0}});i.Collections.MasterResourceCollection=i.Collections.ResourceCollection.extend({model:i.Models.MasterResource,url:function(){return"/api/videos/"+this.videoModel.get("id")+"/master-resources"}});var r=t.View.extend({name:"Resource List Item",className:"video-resource",template:i.Templates.ResourceItem,ui:{$resourceDownload:".resource-download"},events:{click:"onClick"},initialize:function(){this.listenTo(this.model,"remove",this.close)},onClick:function(){var t=this.model.toJSON();return t.service=n.Data.SupLibId?"Supplementary Library":"Library",i.Utils.AnalyticsService.logDownloadResource(t),Backbone.history.trigger("userAction",this.model.get("title")+this.model.get("ext"),"resourceDownload"),this.startDownload(this.getDownloadLink()),!1},getExtension:function(){return n.Shared.Utils.ExtensionMapper.getFileGroup(this.model.get("ext"))},getDownloadLink:function(){return t.template("//resources.clickview.com.au/ResourceProxy.aspx?title={{title}}&fileId={{fileId}}",{title:this.model.get("title"),fileId:this.model.get("fileName")})},getModel:function(){var n=this.model.get("title"),t=this.model.get("ext");return _.extend({},this.model.toJSON(),{title:n,extension:this.getExtension(),downloadLink:this.getDownloadLink(),displayName:n.endsWith(t)?n:n+"."+t})},startDownload:function(n){var t=this.$el.find("iframe");t.length==0&&(t=$("<iframe />").hide(),this.$el.append(t));t.attr("src",n)}}),u=t.ListView.extend({name:"Resources ListView",tagName:"div",className:"video-resource-list",childView:r,initialize:function(){this.listenTo(this.collection,"add",this.addOne)},buildChildView:function(n){return n.set("isMaster",!1),t.ListView.prototype.buildChildView.apply(this,arguments)}}),f=r.extend({name:"Master Resource List Item",template:i.Templates.ResourceItem,defaults:{enableEdit:!1},ui:{titleElement:".editable-title"},events:{"click .file-icon":"onClick","click .title":"onClick","click .download-icon":"onClick","click .resource-rename":"renameResource","click .resource-delete":"removeResource","focusout .editable-title":"updateResource","keypress .editable-title":"editTitleKeypress"},getModel:function(){var t=this.model.get("name"),i=this.model.get("metadata").type;return _.extend({},this.model.toJSON(),{title:t,fileType:i,editable:this.options.video.currentUserIsOwner(),enableEdit:this.options.enableEdit,displayName:n.Shared.Helpers.getResourceFileDisplayName(t,i)})},onRender:function(){this.options.enableEdit&&this.ui.titleElement.focus()},onClick:function(){var n,t,r;if(!this.options.enableEdit)return n=this.model.toJSON(),t={id:n.id,service:n.service,fileName:n.fileId,ext:n.name.substr(n.name.lastIndexOf(".")+1),title:n.name},i.Utils.AnalyticsService.logDownloadResource(t),Backbone.history.trigger("userAction",this.model.get("name"),"resourceDownload"),r=this.model.get("url")+"?dl=true&name="+encodeURIComponent(this.model.get("name")),this.startDownload(r),!1},getService:function(){return this.options.video?this.options.video.isExchangeVideo()?"exchange":this.options.video.isWorkspaceVideo()?"workspace":"":""},removeResource:function(){var r=this,u=this.getService(),f=function(){i.Utils.AjaxHelper.httpDelete("/api/"+u+"/resources/"+r.model.get("id")).done(function(n){n.success&&(r.model.trigger("destroy",r.model.get("id")),t.Events.trigger("resource-upload:remove-resource"))})};n.Utils.Dialog({title:"Delete additional learning resource",content:"<p>Are you sure you want to delete this additional learning resource?<\/p>",buttons:[{text:"Cancel",className:"btn"},{text:"Delete",className:"btn red",success:!0}]}).then(f)},renameResource:function(){this.options.enableEdit=!0;this.render()},updateResource:function(){var n=this;this.options.enableEdit=!1;this.model.set("name",this.ui.titleElement.val());i.Utils.AjaxHelper.put("/api/"+this.getService()+"/resources/",this.model.toJSON()).done(function(t){t.success&&n.render()})},editTitleKeypress:function(n){n.which===13&&this.updateResource()},editResourceTitle:function(){this.options.editable=!1;this.tempTxt=this.model.get("name");this.render()}}),e=i.Views.MasterResourcesListView=u.extend({childView:f,buildChildView:function(n){return n.set("service",this.options.service),n.set("isMaster",!0),t.ListView.prototype.buildChildView.apply(this,arguments)}});i.Views.ResourcesView=t.View.extend({name:"ResourcesView.js",model:i.Models.Video,className:"resources-container",radioChannels:["SideBarChannel"],template:i.Templates.Resources,defaults:{showCreateInteractive:!1,showResourcesHeader:!1,excludeResourcePrefixList:["cv___"]},ui:{$resourcesList:".resources-list-container",$uploadResourceViewpart:".upload-resource-viewpart",$uploadingResourceProgressBar:".uploading-resource-progress",$createInteractiveButton:".resources-sidebar-create-interactive"},initialize:function(){if(!(this.model instanceof i.Models.MasterVideo))return new Error("Please pass an instance of ClickView.Shared.Models.MasterVideo into "+this.name);this.collection==null?(this.collection=this.model.isMasterVideo()?new i.Collections.MasterResourceCollection([],this.model):new i.Collections.ResourceCollection([],this.model),this.collection.fetch()):this.dataReady();this.uploadingResource=!1;this.enableUploadResource=this.model.isUsersWorkspaceVideo()&&n.Data.User.role===2;this.enableUploadResource&&(this.uploadResourcesCollection=new n.NewUpload.Collections.ResourceFileCollection);this.bindListeners()},bindListeners:function(){this.listenTo(t.Events,"resource-upload:uploadingStart",this.uploadingResourceStart);this.listenTo(t.Events,"resource-upload:uploading",this.resourceUploading);this.listenTo(t.Events,"resource-upload:completed",this.uploadResourceCompleted);this.listenTo(t.Events,"resource-upload:remove-resource",this.render);this.listenTo(this.collection,"sync add",this.onLoad)},showLoader:function(){},dataReady:function(){(this.collection&&this.model.isExchangeVideo()&&this.excludeResourceList(),this.options.radio)&&this.options.radio.SideBarChannel.trigger("sidebar:data:resources",this.collection).trigger("sidebar:event:ready")},onLoad:function(){this.dataReady();this.render()},excludeResourceList:function(){var n=this;_.each(this.options.excludeResourcePrefixList,function(t){var i=n.collection.filter(function(n){return n.get("name").toLowerCase().startsWith(t.toLowerCase())});n.collection.remove(i)})},renderResourceUploader:function(){this.uploadingResource?this.renderProgressBar():this.renderUploadResource()},renderResources:function(){var n;n=this.model.isMasterVideo()?new e({video:this.model,collection:this.collection,service:this.options.service}):new u({collection:this.collection});this.renderView(this.ui.$resourcesList,n)},renderUploadResource:function(){this.renderView(this.ui.$uploadResourceViewpart,new n.NewUpload.Views.UploadResourceView({collection:this.uploadResourcesCollection,onlyResources:!0,shouldBindUnload:!1}))},uploadResourceCompleted:function(){this.uploadResourcesCollection.each(function(n){n.set("name",n.get("name")+"."+n.get("extension"));n.set("url",n.get("fileUrl"))});var n=this.uploadResourcesCollection.toJSON();i.Utils.AjaxHelper.post("/api/upload/v3/videos/"+this.model.get("id")+"/resources",n).success(this.uploadResourcesSuccess.bind(this)).error(this.uploadResourcesError.bind(this))},uploadingResourceStart:function(){this.uploadingResource=!0;this.render()},renderProgressBar:function(){this.progressView=new i.Views.ProgressBarView({boxless:!0,loadingText:"0%"});this.renderView(this.ui.$uploadingResourceProgressBar,this.progressView)},resourceUploading:function(n){this.progressView.update(n.percent-2,n.percent.toFixed(0)+"%")},uploadResourcesSuccess:function(n){this.collection.add(this.uploadResourcesCollection.models[0].set("id",n.data[0].id));this.uploadResourcesCollection.reset();this.uploadingResource=!1;this.render()},uploadResourcesError:function(){this.uploadingResource=!1;this.render()},renderCreateButton:function(){var n=i.Models.InteractiveResource.newResource(this.model),t=new i.Views.CreateInteractiveButton({model:n});this.renderView(this.ui.$createInteractiveButton,t)},_scrollBarInit:!1,initScrollBar:function(){this.isRendered()&&!this._scrollBarInit&&(this.ui.$resourcesList.length>0&&this.ui.$resourcesList.mCustomScrollbar({axis:"y",theme:"minimal-dark",scrollInertia:0}),this._scrollBarInit=!0)},viewOptions:function(){return{showCreateInteractive:this.options.showCreateInteractive,showResourcesHeader:this.options.showResourcesHeader&&this.collection.length>0,showUploadResource:this.model.isUsersWorkspaceVideo(),uploadingResource:this.uploadingResource}},onBeforeRender:function(){return this.collection._loaded?!0:(this.renderView(this.$el,new n.Shared.Views.SpinJsView({spinColor:"#fff"})),!1)},shouldRender:function(){return this.collection.length>0},onRender:function(){this.renderCreateButton();this.collection.length>0&&this.renderResources();this.enableUploadResource&&this.renderResourceUploader()}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared,r="ChapterChannel",u="SideBarChannel",f=t.Model.extend({idAttribute:"number"}),e=t.Collection.extend({model:f,setCurrent:function(n){this.clearCurrent();var t=this.get(n);t&&t.set("current",!0)},clearCurrent:function(){this.each(function(n){n.set("current",!1)})}}),o=t.View.extend({template:'{{title}}<span class="chapter-duration">{{chapterDuration}}<\/span>',tagName:"li",className:function(){return this.model.get("current")?"chapter current":"chapter"},radioChannels:[r],events:{click:"onClick"},initialize:function(){this.listenTo(this.model,"change:current",this.render)},onClick:function(){console.log("going to chapter",this.model.collection.indexOf(this.model));this.radio[r].trigger("channels:goto:chapter",this.model.collection.indexOf(this.model))},_resetClassName:function(){this.$el.attr("class",_.result(this,"className"))},viewOptions:function(){return{chapterDuration:i.Helpers.formatDuration(this.model.get("duration"))}},onRender:function(){this._resetClassName()}}),s=t.ListView.extend({childView:o,tagName:"ol"});i.Views.ChapterView=t.View.extend({className:"chapters-view",template:i.Templates.Chapters,radioChannels:[r,u],ui:{chapters:".chapters-container"},initialize:function(){this.listenToOnce(this.model,"change:ready",this.onReady);this.listenTo(this,"tab:show",this.initScrollBar);this.isReady()&&this.onReady()},ChapterChannel:{"channels:goto:chapter":"goToChapter"},isReady:function(){return this.model.get("ready")},onReady:function(){this.getEventsApi();this.getChapters()},onChapterChange:function(n,t){this.collection.setCurrent(t.number);window.setTimeout(_.bind(this.scrollToCurrent,this),100)},getEventsApi:function(){this._eventsApi=this.options.webPlayerView._eventsApi},getChapters:function(){this.query("getChapters",function(n){this.collection=new e(n);this.radio[u].trigger("sidebar:data:chapters",this.collection).trigger("sidebar:event:ready");this.bindEvents();this.render()})},bindEvents:function(){this._eventsApi.on("cv-player-chapterchange",_.bind(this.onChapterChange,this))},query:function(t,i,r){if(this.isReady()){var u=n.Shared.Helpers.Guid.newGuid(),f=r||this;this._eventsApi.one("cv-player-querycallback-"+u,function(n,t){i.call(f,t)});this._eventsApi.trigger("cv-player-query",t,u)}},goToChapter:function(n){this._eventsApi.trigger("cv-player-changechapter",n,0)},scrollToCurrent:function(){this._initScrollBar||this.isRendered()&&this.$el instanceof jQuery&&this.ui.chapters.mCustomScrollbar("scrollTo",this.$el.find(".current"))},renderChapters:function(){!this.collection||this.collection.length<2||this.renderView(this.ui.chapters,new s({collection:this.collection,radio:this.radio}))},initScrollBar:function(){this._initScrollBar||this.isRendered()&&this.$el instanceof jQuery&&(this.ui.chapters.mCustomScrollbar({axis:"y",theme:"clickview",scrollInertia:0,mouseWheel:{scrollAmount:40,preventDefault:!0},onTotalScrollOffset:100}),this._initScrollBar=!0)},onBeforeRender:function(){return this.isReady()?!0:!1},viewOptions:function(){return{showHeading:this.options.showHeading}},onRender:function(){this.renderChapters();this.initScrollBar()}});i.Views.PlayerSideBarView=t.View.extend({_readyCount:0,template:i.Templates.PlayerSideBar,className:function(){return"player-side-bar-view"+(this.isProducedByClickView()?" produced-by-clickview":"")+(this.model.isMasterLibraryVideo()?" show-promo-banner":"")},radioChannels:[r,u],ui:{tabs:".player-sidebar-tabs",mask:".player-sidebar-mask"},initialize:function(){(this.radio=new t.Radio({name:"PlayerSideBarRadio"}),this._webPlayerModel=this.options.webPlayerModel,this._webPlayerModel)&&this.listenTo(this._webPlayerModel,"change:sideBarMask",this.toggleMask)},SideBarChannel:{"sidebar:data:chapters":"setChapters","sidebar:data:resources":"setResources","sidebar:event:ready":"onTabReady"},setChapters:function(n){this._chapterCollection=n},setResources:function(n){this._resourceCollection=n},onTabReady:function(){if(this._chapterCollection&&this._resourceCollection&&this._resourceCollection.length){var n=this.tabCollection.find(function(n){return n.get("tabId")==="resources-tab"});n&&n.set("selected",!0)}},isProducedByClickView:function(){return this.model.isProducedByClickView()},toggleMask:function(){if(this._webPlayerModel.get("sideBarMask")){this.ui.mask.addClass("active");return}this.ui.mask.removeClass("active")},getTabs:function(){var n=[{tabId:"chapers-tab",order:1,text:"Chapters",view:i.Views.ChapterView,preload:!1,selected:!0,cssId:"chapters-tab",initParams:{model:this.options.webPlayerModel,webPlayerView:this.options.webPlayerView,radio:this.radio,showHeading:!this.options.canSeeResources},icon:"#chapters"}];return this.options.canSeeResources&&n.push({tabId:"resources-tab",order:2,text:"Resources",view:i.Views.MasterResourcesView,preload:!0,selected:!1,cssId:"resources-tab",initParams:{model:this.model,collection:this.collection,radio:this.radio},icon:"#resources"}),n},viewOptions:function(){return{promotedText:this.isProducedByClickView()?"Produced by":"Curated by",isMasterLibraryVideo:this.model.isMasterLibraryVideo()}},onRender:function(){this.tabCollection=new i.Collections.TabCollection(this.getTabs());this.renderView(this.ui.tabs,new i.Views.TabView({collection:this.tabCollection}))}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared,r=i.Utils.Constants.ENUMS.ERROR_CODES,a=i.Utils.Constants.ENUMS.CONTEXT_TYPES,u=i.Utils.Constants.CONTEXTS.COLLECTION_ID,f=t.View.extend({name:"UnAuthenticatedPlayerView.js",className:"video-container no-auth",template:i.Templates.UnAuthenticatedPlayer,viewOptions:function(){return{signupLink:n.Data.Config.urls.companyWebsite+"/demo",signinLink:"//"+window.location.host+"/signin?returnUrl="+window.location.href,customMessage:this.options.customMessage,hideSignIn:this.options.hideSignIn}}}),e=t.View.extend({name:"RestrictedPlayerView.js",className:"video-container restricted",template:i.Templates.RestrictedPlayer,viewOptions:function(){return{restrictionDescription:this.options.description}}}),o=i.Views.MasterVideoActionsDropdownListView=n.Shared.Views.VideoActionGroupListView.extend({defaults:{moreText:""},template:i.Templates.MasterVideoActionsDropdownList}),s=i.Views.MasterPlayViewActionsView=t.View.extend({name:"PlayViewActions",template:i.Templates.MasterPlayViewActions,ui:{$videoActions:".video-actions"},defaults:{backLocation:{}},events:{"click .back-button":"onClickBackButton"},initialize:function(){if(!(this.model instanceof i.Models.MasterVideo))throw new Error("this.model on "+this.name+" must be an instance of ClickView.Shared.Models.MasterVideo");i.Services.VideoActionService.mixin(this)},onClickBackButton:function(n){if(n.preventDefault(),i.Services.NavigationHistoryService.goBack())return!1;var t=this.options.backLocation;return t.href?(Backbone.history.navigate(t.href,{trigger:!0})||(window.location=t.href),!1):!0},getActions:function(){var t=i.Services.VideoActionService.getActions(this.model,"MasterPlayView");return new n.Shared.Collections.VideoActionCollection(t)},viewOptions:function(){return{from:this.options.backLocation.name,backHref:this.options.backLocation.href,actions:this.getActions(),canAddToPlaylist:this.options.canPlay&&this.options.canAddToPlaylist}},renderVideoActions:function(){if(this.options.canPlay){var n=new o({collection:this.getActions(),itemModel:this.model,moreText:"More"});this.renderView(this.ui.$videoActions,n)}},onRender:function(){this.renderVideoActions()}}),h=t.View.extend({template:i.Templates.SideBar,className:function(){return this.isLoaded()?"":"partial-loading-view"},ui:{relatedVideos:".related-videos-container",toggleButton:".toggle-player-sidebar",interactiveButton:".create-interactive-container"},defaults:{showToggle:!0},isLoaded:function(){return this.collection?this.collection:!0},togglePlayerSideBar:function(){t.Events.trigger("toggle-side-bar")},renderRelatedVideos:function(){if(this.collection&&this.collection.length){var n=this.collection.reject(_.bind(function(n){return n.get("id")==this.model.get("id")},this));this.renderView(this.ui.relatedVideos,new i.Views.MasterRelatedVideoListView({collection:n,parent:this.collection.parent}))}},renderInteractiveButton:function(){var n=i.Models.InteractiveResource.newResource(this.model),t=new i.Views.CreateInteractiveButton({model:n});this.renderView(this.ui.interactiveButton,t)},renderToggleButton:function(){var n="Show chapters";this.options.canSeeResources&&(n+=" and resources");this._toggleButton=new i.Views.ToggleButtonView({toggleOn:this.options.showSideBarOnLoad,text:n});this.listenTo(this._toggleButton,"toggle",this.togglePlayerSideBar);this.renderView(this.ui.toggleButton,this._toggleButton)},viewOptions:function(){return{hasRelatedVideos:this.collection&&this.collection.length,canCreateInteractive:this.options.canCreateInteractive,showToggle:this.options.showToggle,title:this.options.title}},onBeforeRender:function(){return this.isLoaded()?!0:!1},onRender:function(){this.renderToggleButton();this.renderInteractiveButton();this.renderRelatedVideos()}}),c=function(n){return n.description},l=t.View.extend({name:"AboutTab",template:i.Templates.AboutTab,ui:{contributor:".contributor-info",description:".description-container",contentLicence:".content-licence-viewpart",lcInfoBadge:".info-badge-container"},events:{"click a":"onClick","click .description-container .edit-result-view":"onClickDescription"},initialize:function(){this.options.clip&&this.listenTo(this.options.clip,"sync",function(){t.Events.trigger("clips:dirty:collection")});this.contextService=i.Services.ContextService},onClick:function(n){var u=$(n.currentTarget),r;return u&&(r=u.attr("href"),r)?(i.Helpers.isSamePageRoute(r)?t.Events.trigger("navigate",r):window.location=r,!1):!1},onClickDescription:function(){if(this.canEditInfo()){this.getChildByIndex("description").close();var n={property:"description",textArea:!0},t=this.options.clip?new i.Views.EditInlineClipView(_.extend({},n,{model:this.options.clip,description:this.model.get("description")})):new i.Views.EditView(_.extend({},n,{model:this.model}));this.listenToOnce(t,"close",this.renderEditableDescription);this.renderView(this.ui.description,t)}},renderEditableDescription:function(){if(this.canEditInfo()){var n={template:c,title:"description",container:"body"},t=this.options.clip?new i.Views.EditInlineClipResultView(_.extend({},n,{model:this.options.clip,video:this.model})):new i.Views.EditResultView(_.extend({},n,{model:this.model}));this.renderView(this.ui.description,t,{childIndex:"description"})}},canEditInfo:function(){return this.options.clip&&!this.options.clip.currentUserIsOwner()?!1:this.options.clip?this.options.clip.currentUserIsOwner():this.model.isExchangeVideo()&&!this.model.isUserChannelVideo()?!1:this.model.owner.get("username")!==undefined&&this.model.owner.get("username")===n.Data.User.username},hasHiddenText:function(){var n=this.ui.description.find(".description-content").outerHeight();return n>2&&n>this.ui.description.outerHeight()},isAuthenticated:function(){return!!n.Data.User.username},getCategoryUrl:function(n){return i.Services.ObjectLinkService.getCategoryUrl(n)},getTopicUrl:function(n){return n?this.isAuthenticated()&&this.model.isExchangeVideo()?"/exchange/topics/"+n.get("id")+"/"+n.get("name").slugify():null:null},getUserChannelUrl:function(n){return n?this.model.isUserChannelVideo()?"/exchange/channels/"+n.get("id")+"/"+n.get("name").slugify():null:null},getSeriesUrl:function(n){return i.Services.ObjectLinkService.getSeriesUrl(n)},getPlaylistUrl:function(n){if(!n)return null;if(this.model.isUserChannelVideo()){var t=this.model.userChannels.first();return"/exchange/channels/"+t.get("id")+"/"+t.get("name").slugify()+"/playlists/"+n.get("id")}return null},getCategory:function(){if(this.model.categories&&(!this.model.categories||this.model.categories.length)){var n=this.contextService.getContext(u),r=n instanceof t.Model&&n.get("collectionId"),i=this.model.categories.get(r);return i?i:this.model.categories.first()}},getLibraries:function(){if(!this.model.libraries||!this.model.libraries.length)return null;var t=n.Data._bootstrap.libraries||[],i=this.model.libraries.filter(function(n){return n.get("type")==="hosted_library"}).map(function(n){return n.toJSON()}),r=n.Shared.Helpers.intersection(t,i,function(n,t){return n.id===t.id});return _.map(r,function(n){return{name:n.name,url:"/libraries/"+n.id+"/"+n.name.slugify()+"/categories"}})},viewOptions:function(){var t=this.getCategory(),i=this.model.topics&&this.model.topics.length&&this.model.topics.first(),r=this.model.isUserChannelVideo()&&this.model.userChannels.first(),u=this.model.playlists&&this.model.playlists.length&&this.model.playlists.first(),f=this.getLibraries(),o=this.options.originalVideoUrl,s=this.model.get("dateBroadcast")&&n.Shared.Helpers.dateIsAfter(this.model.get("dateBroadcast"),"1970")&&n.Shared.Helpers.formatUTCToLocal(this.model.get("dateBroadcast")),h=this.options.clip&&this.options.clip.get("description")?this.options.clip.get("description"):this.model.get("description"),c=this.options.clip?this.options.clip.getDuration({inMs:!0}):this.model.get("duration"),e="";return this.options.isShareView&&(e=n.Shared.Helpers.getSharedByName(n.Data._bootstrap.sharedBy)),{category:t&&t.toJSON(),categoryUrl:this.getCategoryUrl(t),topic:i&&i.toJSON(),topicUrl:this.getTopicUrl(i),userChannel:r&&r.toJSON(),userChannelUrl:this.getUserChannelUrl(r),series:this.model.series&&this.model.series.toJSON(),seriesUrl:this.getSeriesUrl(this.model.series),playlist:u&&u.toJSON(),playlistUrl:this.getPlaylistUrl(u),libraries:f,linkedDescription:n.Shared.Helpers.formatSafeHTML(h),libraryText:f&&f.length===0?"Library":"Libraries",isPlayingClip:this.options.clip,originalVideoUrl:o,isWorkspaceClip:this.options.isWorkspaceClip,dateBroadcast:s,sharedBy:e,duration:c,existsInLocalCache:this.model.existsInLocalCache()}},renderLocalCacheInfoBadge:function(){if(this.model.existsInLocalCache()){var n=new i.Views.InfoBadgeView({text:"This video will be played from your school's Local Cache"});this.renderView(this.ui.lcInfoBadge,n)}},renderContentLicence:function(){n.Data.Config.featureSwitches.showRoyaltyCollectionLicense&&(this.model.showLicence()||this.options.alwaysShowLicence)&&this.renderView(this.ui.contentLicence,new n.Shared.Views.ContentLicenceView({licence:n.Data.Config.contentLicence}))},renderContributorInfo:function(){if(this.options.clip){if(!this.options.clip.get("owner")||!this.options.clip.get("owner").get("username"))return;this.renderView(this.ui.contributor,new i.Views.ContributorInfoView({model:this.options.clip,label:!0,contributedByText:"Created"}));return}this.options.isShareView||this.model.owner&&this.model.owner.get("username")&&this.renderView(this.ui.contributor,new i.Views.ContributorInfoView({model:this.model,label:!0}))},onRender:function(){this.renderContributorInfo();this.renderContentLicence();this.renderEditableDescription();this.renderLocalCacheInfoBadge()}});i.Views.MasterPlayView=t.View.extend({name:"MasterPlayView.js",className:function(){return"master-play-view"+(this.showSideBarOnLoad()?"":" hidden-player-sidebar")+(!this.getBackLocation().href?" no-back-button":"")},template:i.Templates.MasterPlayView,defaults:{isShareView:!1,preloadInteractives:!0,sideBarTitle:"Related Videos"},ui:{tabs:".tab-container",player:".player-container",sideBar:".side-bar-container",videoInfo:".video-info-container",interactives:".interactives-container",videoActions:".video-play-actions-container",mainPlayBlock:".main-play-block",chapters:".chapter-view-container"},events:{"click .originalVideoUrl":"onClickOriginalVideoUrl"},initialize:function(){if(this.currentUser=n.Data.User,!(this.model instanceof i.Models.MasterVideo))throw new Error("this.model on "+this.name+" must be an instance of ClickView.Shared.Models.MasterVideo");if(this.collection&&!(this.collection.model.prototype instanceof i.Models.MasterVideo))throw new Error("this.collection.model on "+this.name+" must be an instance of ClickView.Shared.Models.MasterVideo");!this.collection&&this.model.loaded&&this.setRelatedCollection();this.listenTo(this.model,"error",this.onError);this.listenTo(this.model,"change:restrictions",this.onRestrictionChange);this.listenTo(t.Events,"toggle-side-bar",this.togglePlayerSideBar);this.listenTo(t.Events,"render-side-bar",this.renderSideBar)},isPlayingClip:function(){return this.options.clip},togglePlayerSideBar:function(){this.$el.toggleClass("hidden-player-sidebar")},onError:function(n,t){switch(t.status){case 403:this.renderForbiddenError(t.responseJSON.code);break;case 404:this.renderError({message:"The video you are attempting to view could not be found"})}},setRelatedCollection:function(){if(this.model.playlists&&this.model.playlists.length&&this.model.isUserChannelVideo()){this.collection=this.model.playlists.first().videos;return}if(this.model.userChannels&&this.model.userChannels.length){this.collection=this.model.userChannels.first().videos;return}if(this.isAuthenticated()&&this.model.series&&this.model.series.get("id")){this.collection=this.model.series.videos;this.options.sideBarTitle="Other Videos in This Series";return}if(this.isAuthenticated()&&this.model.categories&&this.model.categories.length){this.collection=this.model.categories.first().videos;return}if(this.isAuthenticated()&&this.model.topics&&this.model.topics.length){this.collection=this.model.topics.first().videos;return}if(this.options.fallbackCollection){this.collection=this.options.fallbackCollection;return}},fetchRelatedCollection:function(){if(this.collection)return this.collection&&(this.collection.hasFetched()||this.collection.isFetching())?void 0:this.collection.fetch()},logPlay:function(){this._playLogged||this._hasVideoModel()&&(n.Shared.Utils.AnalyticsService.logVideoWatch(this.model,this.options,this.getExtraLoggingValues()),this._playLogged=!0)},getExtraLoggingValues:function(){return{}},_backupLoggerTimeout:null,startBackupPlayLogger:function(){clearTimeout(this._backupLoggerTimeout);var n=this;this._backupLoggerTimeout=setTimeout(function(){n._webPlayerModel&&n._webPlayerModel.get("ready")||n.logPlay()},8e3)},_timeEventsReceived:0,onChangeCurrentTime:function(){this._playLogged||this._webPlayerModel&&(this._webPlayerModel.get("paused")||this._webPlayerModel.get("currenttime")<=0||(this._timeEventsReceived++,this._timeEventsReceived<3)||this.logPlay())},onVideoEnded:function(){this.logPlay()},_hasVideoModel:function(){return this.model.get("tokenId")&&this.model.get("id")},isLoaded:function(){return this.model.loaded},isCollectionLoaded:function(){return this.collection?this.collection.loaded:!0},startDeviceApp:function(){var i=n.Services.DeviceService,t;i&&(t=i.getEventChannel("device:config"),t)&&t.trigger("cv-device-start",this.model,this.getWebPlayerModel())},fetchData:function(){var n=[],t,i;this.model.loaded||n.push(this.model.fetch());this.options.clip&&!this.options.clip.loaded&&this.options.clip.fetch({data:{"with":"owner"}});this.collection&&!this.collection.loaded&&(t=this.fetchRelatedCollection(),t&&n.push(t));i=this;$.when.apply(this,n).then(function(){this.collection||i.setRelatedCollection();i.render()})},getWebPlayerModel:function(){if(this._webPlayerModel)return this._webPlayerModel;var n=i.Helpers.GetQueryString()||{};return n.rt=this.canSeeResources(),this.options.clip&&(n=_.extend(n,{t:this.options.clip.get("startTime"),et:this.options.clip.get("endTime"),i:this.options.clip.get("startChapterIndex")})),this._webPlayerModel=new i.Models.WebPlayer({id:this.model.get("id"),autoplay:!0,parameters:n,trackingCode:this.model.get("tokenId")}),this.listenTo(this._webPlayerModel,"showDevices",this.startDeviceApp),this.listenTo(this._webPlayerModel,"change:currenttime",this.onChangeCurrentTime),this.listenTo(this._webPlayerModel,"ended",this.onVideoEnded),this._webPlayerModel},getInfoTab:function(){return{tabId:"info-tab",order:1,text:"Info",view:l,preload:!0,selected:!0,cssId:"info-tab",initParams:{model:this.model,isPlayingClip:this.isPlayingClip(),originalVideoUrl:this.isPlayingClip()&&this.getOriginalVideoUrl(),isWorkspaceClip:this.options.isWorkspaceClip,clip:this.options.clip,isShareView:this.options.isShareView}}},getInteractivesTab:function(){var t=this.getInteractiveCollection();return{tabId:"interactive-resources-tab",order:1,text:"Interactive videos",view:n.Shared.Views.InteractiveResourcesTabView,countCollection:t,preload:this.options.preloadInteractives,selected:!1,cssId:"interactive-resources",initParams:{model:this.model,preload:this.options.preloadInteractives,collection:t,webPlayer:this.webPlayerView,renderButton:!0}}},getShareTab:function(){return this.isPlayingClip()?{tabId:"cv-share",text:"Share",view:n.Shared.Views.ShareTabView,order:1,cssId:"cv-share-tab",preload:!1,selected:!1,initParams:{itemModel:this.options.clip,clip:this.options.clip,resourceType:{type:"clip",name:"clip"}}}:{tabId:"cv-share",text:"Share",view:n.Shared.Views.ShareTabView,order:1,cssId:"cv-share-tab",preload:!1,selected:!1,initParams:{itemModel:this.model,enableClipping:!n.Data.User.modules.clips||this.model.isOnlineLibraryVideo()}}},getClipsTab:function(){return{tabId:"clips-tab",text:"Clips",order:1,cssId:"clips",countCollection:this.model.clips,view:n.Shared.Views.ClipsTabView,preload:!1,selected:!1,initParams:{model:this.model,webPlayer:this.webPlayerView}}},getTabs:function(){var t=i.Services.VideoActionService.getActions(this.model,"PlayTabView"),r=this.canPlay()&&_.any(t,function(n){return n.id==="share"}),u=this.canPlay()&&_.any(t,function(n){return n.id==="clip"}),n=[];return(n.push(this.getInfoTab()),!this.isAuthenticated())?n:(this.canPlay()&&this.canCreateInteractive()&&n.push(this.getInteractivesTab()),r&&n.push(this.getShareTab()),u&&this.hasClips()&&!this.isPlayingClip()&&n.push(this.getClipsTab()),n)},getBackLocation:function(){var n=i.Services.NavigationHistoryService.getLastPage(),t,u,r;return n?n:(t="",this.model.series&&this.model.series.get("id")&&(u=this.model.series,n=i.Services.ObjectLinkService.getSeriesUrl(u),n&&(t=u.get("name"))),this.model.categories&&this.model.categories.length&&(r=this.model.categories.first(),r.get("id")&&(n=i.Services.ObjectLinkService.getCategoryUrl(r)),n&&(t=r.get("name"))),!i.Helpers.isSamePageRoute(n))?{}:{href:n,name:t}},getInteractiveCollection:function(){if(this.options.preloadInteractives){var n=this.model.isOnlineLibraryVideo()?"online":"master";return new i.Collections.InteractiveResourceCollection([],{id:this.model.get("id"),type:n,trackingCode:this.model.get("trackingCode"),pageSize:5})}},isAuthenticated:function(){return this.currentUser.username},hasUserChannels:function(){return this.model.get("userChannels")&&this.model.get("userChannels").length},hasClips:function(){return n.Data.User.modules.clips&&!this.model.isOnlineLibraryVideo()},isShared:function(){return this.options.isShareView},showSideBarOnLoad:function(){return!this.model.isRestricted()&&(this.model.isMasterLibraryVideo()||this.hasMasterResources())},hasMasterResources:function(){return this.model.resources&&this.model.resources.length},getOriginalVideoUrl:function(){return this.model.isWorkspaceVideo()?this.model.isUsersWorkspaceVideo()?"/workspace/videos/"+this.model.get("id"):"":this.model.getActionUrl()},onClickOriginalVideoUrl:function(i){return i.preventDefault(),n.Shared.Helpers.isSamePageRoute(this.getOriginalVideoUrl())?t.Events.trigger("navigate",this.getOriginalVideoUrl()):window.location.href=this.getOriginalVideoUrl(),!1},onRestrictionChange:function(){this.isLoaded()&&(this.renderActions(),this.renderVideoInfo())},canAddToPlaylist:function(){return this.model.isExchangeVideo()&&!this.model.isUserChannelVideo()&&n.Data.User.role==1?!1:this.model.isWorkspaceVideo()&&!this.model.currentUserIsOwner()?!1:this.isPlayingClip()?!1:this.isAuthenticated()},canCreateInteractive:function(){return n.Data.User.role!==2?!1:this.model.isWorkspaceVideo()&&!this.model.currentUserIsOwner()?!1:this.isPlayingClip()?!1:this.isAuthenticated()},canPlay:function(){return!this.isAuthenticated()&&this.model.isBroadcast()?!1:this.model.isBroadcast()&&this.model.isUserChannelVideo()&&n.currentUser.isStudent()?!1:this.model.isUserChannelVideo()?!0:this.model.isExchangeVideo()?!this.isShared()&&!n.Data.User.modules.freeToAir?!1:this.isShared()?this.isAuthenticated():n.Data.User.role!==1&&this.isAuthenticated():this.model.isRestricted()?!1:!0},canSeeResources:function(){if(this.model.isRestricted())return!1;if(!n.currentUser.isStudent()&&n.Data.User.role!=8)return!0;var t=new i.Collections.CustomerSettingCollection(n.Data.CustomerSettings),r=!!t.getByName(i.SettingOptions.Permanent.HIDE_RESOURCES_FOR_STUDENTS).get("value");return!r},renderError:function(n){this._hasError=!0;this.renderView(this.$el,new i.Views.ErrorView(n))},renderForbiddenError:function(n){switch(n){case r.RATING_NOT_PERMITTED:this.renderError({heading:"Sorry, we can't show you this video.",message:"Your year group ("+this.currentUser.yearGroup+") can only view videos with a rating of "+this.currentUser.maxRatingCode+"."});break;case r.GEO_BLOCKED_RESOURCE:this.renderError({heading:"Region locked resource",message:"You are attempting to view a resource which is not available in your country."})}},renderUnAutheticatedPlayer:function(){var t={};n.Data.User.username&&!n.Data.User.modules.freeToAir&&_.extend(t,{hideSignIn:!0,customMessage:"Unfortunately, your organisation's subscription does not include access to the ClickView Exchange."});this.currentUser.role===1&&_.extend(t,{hideSignIn:!0,customMessage:"Students may not view Exchange videos. Please ask your teacher to send you a share link, which they can find in the share tab under the video."});this.renderView(this.ui.player,new f(t))},renderRestrictedPlayer:function(){var i=this.model.getRestriction(),r=this.model.getRestrictedBy({beginningOfSentence:!0}),u=n.Shared.Helpers.firstCharToLowerCase(i.get("description")),t=this.model.restrictionHasExpiry()?"This video is pending approval by your ClickView Administrator":"<strong>"+r+"<\/strong> has restricted access to this video from <strong>"+u+"<\/strong>.";n.currentUser.isStaff()?this.renderView(this.ui.player,new e({model:this.model,description:t})):this.renderError({heading:"Sorry, we can't show you this video.",message:t})},renderWebPlayer:function(){if(!this.canPlay())return this.renderUnAutheticatedPlayer();this.webPlayerView=new i.Views.WebPlayerView({model:this.getWebPlayerModel()});this.isPlayingClip()||this.listenTo(this.getWebPlayerModel(),"change:ready",this.renderPlayerSideBar);this.listenTo(this.getWebPlayerModel(),"change:ready",this.bindUnload);this.renderView(this.ui.player,this.webPlayerView)},renderPlayerSideBar:function(){this.ui.chapters.removeClass("partial-loading-view");this.renderView(this.ui.chapters,new i.Views.PlayerSideBarView({webPlayerModel:this.getWebPlayerModel(),webPlayerView:this.webPlayerView,model:this.model,collection:this.model.isMasterVideo()?this.model.resources:null,canSeeResources:this.canSeeResources()}))},renderActions:function(){this.isPlayingClip()||this.renderView(this.ui.videoActions,new s(_.extend({},this.options,{model:this.model,canAddToPlaylist:this.canAddToPlaylist(),backLocation:this.getBackLocation(),canPlay:this.canPlay()})))},renderVideoInfo:function(){this.isPlayingClip()?this.renderView(this.ui.videoInfo,new i.Views.ClipInfoView({model:this.options.clip})):this.renderView(this.ui.videoInfo,new i.Views.VideoInfoView({model:this.model}))},renderInteractives:function(){this.renderView(this.ui.interactives,new i.Views.InteractiveResourcesTabView({webPlayer:this.webPlayerView,collection:this.model.interactives}))},renderTabs:function(){var n=new i.Views.TabView({collection:new i.Collections.TabCollection(this.getTabs())});this.renderView(this.ui.tabs,n)},renderSideBar:function(){if(this.isPlayingClip()){if(this.ui.sideBar.remove(),this.options.isWorkspaceClip)return;this.ui.mainPlayBlock.addClass("clip");return}if(this.collection&&!this.collection.loaded){var n=this.fetchRelatedCollection();if(!n)return;n.done(function(){t.Events.trigger("render-side-bar")});return}if(!this.collection||this.model.isWorkspaceVideo()&&!this.model.isUsersWorkspaceVideo()){this.ui.sideBar.remove();this.ui.mainPlayBlock.addClass("full-width");return}this.renderView(this.ui.sideBar,new h({collection:this.collection,model:this.model,canCreateInteractive:this.canCreateInteractive(),showToggle:this.canPlay(),title:this.options.sideBarTitle,showSideBarOnLoad:this.showSideBarOnLoad(),canSeeResources:this.canSeeResources()}))},onBeforeRender:function(){return this.isLoaded()?!0:(this.fetchData(),!0)},viewOptions:function(){return{isPlayingClip:this.isPlayingClip(),originalVideoUrl:this.isPlayingClip()&&this.getOriginalVideoUrl(),isFullWidth:!this.options.isWorkspaceClip&&this.isPlayingClip(),hasClips:this.hasClips()}},onRender:function(){this.isLoaded()&&(this.model.isRestricted()?this.renderRestrictedPlayer():this.renderWebPlayer(),this.renderActions(),this.renderVideoInfo(),this.renderTabs(),this.renderSideBar(),this.startBackupPlayLogger(),this._resetClassName())},_resetClassName:function(){this.$el.attr("class",_.result(this,"className"))},onClose:function(){this.logUnload();this.unBindUnload()},unBindUnload:function(){$(window).off("unload")},bindUnload:function(){$(window).on("unload",_.bind(this.logUnload,this))},logUnload:function(){var t=this.getWebPlayerModel();t&&t.get("ready")&&n.Shared.Utils.AnalyticsService.logVideoWatchUnload({id:this.model.get("id"),trackingCode:this.model.get("trackingCode"),videoDuration:this.model.get("duration"),watchDuration:t.get("currenttime")*1e3})}});i.Views.MasterPlayView.extend=function(){throw new Error("Please do not extend ClickView.Shared.Views.MasterPlayView, instead implement your functionality in a generic way which can either be turned on with options, or activates via ClickView.Shared.Services.VideoActionsService. Talk to Sha if you disagree.");}}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared,r=t.View.extend({template:i.Templates.MasterRelatedVideoItem,className:"related-video",ui:{thumbnail:".thumbnail"},events:{"click a":"onClick"},getThumbnailUrl:function(){return n.Shared.Helpers.getThumbnailUrl(this.model,{bgColor:"000"})},buildUrl:function(){var n=this.options.parent||this.model.collection;return i.Services.ObjectLinkService.getVideoUrl(this.model,n)},onClick:function(n){var u=$(n.currentTarget),r;if(u&&(r=u.attr("href"),r))return i.Helpers.isSamePageRoute(r)?t.Events.trigger("navigate",r):window.location=r,!1},viewOptions:function(){return{thumbnailUrl:this.getThumbnailUrl(),actionUrl:this.buildUrl(),seriesName:this.model.series&&this.model.series.get("name"),seriesUrl:this.model.series&&i.Services.ObjectLinkService.getSeriesUrl(this.model.series)}},onRendered:function(){this.destroyLazyLoad();this._lazyLoad=new LazyLoad({elements:this.ui.thumbnail.eq(0)})},destroyLazyLoad:function(){this._lazyLoad&&this._lazyLoad.destroy()},onClose:function(){this.destroyLazyLoad()}});i.Views.MasterRelatedVideoListView=t.ListView.extend({template:'<div class="items"><\/div><a class="show-more">Show more<\/a>',_renderCount:5,_totalRendered:0,childView:r,ui:{items:".items",showMore:".show-more"},events:{"click .show-more":"renderItems"},addOne:function(n){this.renderView(this.ui.items,this.buildChildView.call(this,n),{empty:!1})},renderItems:function(){var n=_.first(_.rest(this.collection,this._totalRendered),this._renderCount);_.each(n,this.addOne,this);this._totalRendered+=n.length;this._totalRendered>=this.collection.length&&this.ui.showMore.hide()}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Views.MasterResourcesView=t.View.extend({template:'<div class="resources-children"><\/div>',className:"master-resources-view",radioChannels:["SideBarChannel"],ui:{resources:".resources-children"},initialize:function(){this.listenTo(this,"tab:show",this.initScrollBar)},renderResources:function(){this.renderView(this.ui.resources,new i.Views.ResourcesView({model:this.model,collection:this.collection,radio:this.radio}))},initScrollBar:function(){this._initScrollBar||this.isRendered()&&this.$el instanceof jQuery&&(this.ui.resources.mCustomScrollbar({axis:"y",theme:"clickview",scrollInertia:0,mouseWheel:{scrollAmount:40,preventDefault:!0},onTotalScrollOffset:100}),this._initScrollBar=!0)},onRender:function(){this.renderResources()}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared,r=function(n){return n?'<h1 class="name">'+n.name+"<\/h1>":""};i.Views.VideoInfoView=t.View.extend({name:"VideoInfoView.js",template:i.Templates.VideoInfo,className:"video-info",events:{"click .title-container .edit-result-view":"onClickTitle","click .series-link":"onClickSeries"},ui:{title:".title-container",restrictedBadge:".restricted-badge-container",restrictionInfo:".restriction-info-container"},initialize:function(){if(!(this.model instanceof i.Models.MasterVideo))throw new Error(this.name+" must be initialized with an instance of ClickView.Shared.Models.MasterVideo as it's model");},onClickTitle:function(){if(this.canEditInfo()){var n=new i.Views.EditView({model:this.model,property:"name"});this.listenToOnce(n,"close",this.renderEditableTitle);this.renderView(this.ui.title,n)}},onClickSeries:function(n){var u,r;return n.preventDefault(),n.stopPropagation(),u=$(n.currentTarget),u?(r=u.attr("href")||this.getSeriesUrl(),!r)?!0:i.Helpers.isSamePageRoute(r)?(t.Events.trigger("navigate",r),!1):(window.location=r,!1):void 0},getSeriesUrl:function(){return i.Services.ObjectLinkService.getSeriesUrl(this.model.series)},getVideoModel:function(){return this.model instanceof i.Models.Clip?this.model.video:this.model},canEditInfo:function(){return this.model.isExchangeVideo()&&!this.model.isUserChannelVideo()?!1:this.model.owner.get("username")!==undefined&&this.model.owner.get("username")===n.Data.User.username},viewOptions:function(){return{series:this.model.series&&this.model.series.toJSON(),seriesUrl:this.getSeriesUrl(this.model.series),existsInLocalCache:this.model.existsInLocalCache()}},renderEditableTitle:function(){this.canEditInfo()&&this.renderView(this.ui.title,new i.Views.EditResultView({model:this.model,template:r,title:"title"}))},renderRestrictedBadge:function(){this.getVideoModel().hasRestriction()&&this.renderView(this.ui.restrictedBadge,new n.Shared.Views.RestrictedBadgeView({model:this.model}))},renderRestrictionInfo:function(){var t=this.getVideoModel();this.renderView(this.ui.restrictionInfo,new n.Shared.Views.RestrictionInfoView({model:t,showBanner:t.restrictionHasExpiry()}))},renderRestriction:function(){this.renderRestrictionInfo();this.renderRestrictedBadge()},onRender:function(){this.renderEditableTitle();this.renderRestriction()}});i.Views.ClipInfoView=i.Views.VideoInfoView.extend({initialize:function(){this.listenTo(this.model,"sync",function(){t.Events.trigger("clips:dirty:collection")})},canEditInfo:function(){return this.model.currentUserIsOwner()},viewOptions:function(){return{clipTitle:this.model.get("name")}}})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.Shared;i.Views.ShareTabView=t.View.extend({className:"cv-share-view",name:"ShareTabView",template:n.Shared.Templates.ShareTab,model:i.Models.ShareModel,defaults:{fetch:!0,hidePrivacies:[],embeddable:!0,resourceType:{type:"video",name:"video"},canAutoplay:!0,enableClipping:!1},privacies:[{id:1,img:"/themes/default/images/privacy-private.png",name:"Only me",cssClass:"private",visible:!1},{id:2,img:"/themes/default/images/privacy-school.png",name:"Just my school",cssClass:"school",visible:!1},{id:3,img:"/themes/default/images/privacy-public.png",name:"Everyone (Public)",cssClass:"public",visible:!1}],ui:{privacyContainer:".share-metadata-container",videoContainer:".video-metadata-container",linksContainer:".share-links-viewpart",clippingToolContainer:".clipping-tool-viewpart-share",warningContainer:".warning-container",$buttonContainer:".share-button-container",shareOptionTabs:".share-options-tabs"},initialize:function(){if(this.itemModel=this.options.itemModel,!this.itemModel)throw new Error("No item passed into ShareTab");if(this.ezProxyModel=new i.Models.EZProxy,this.model=new this.model(_.extend({itemModel:this.itemModel,ezProxyModel:this.ezProxyModel,embeddable:this.options.embeddable,resourceType:this.options.resourceType,autoPlay:!1,shortUrl:"",shortCode:"",showEmbedOptions:!1,showLinks:!0,secure:!0,canAutoplay:this.options.canAutoplay},this.options.shareData)),this.options.enableClipping&&this.setupClippingTool(),n.Data.User&&n.Data.User.role==1&&!this.studentSharingEnabled()&&(this.options.hidePrivacies=[3]),this.privacies=$.extend(!0,[],this.privacies),this.model.set("privacy",this.getPrivacy(this.itemModel.get("privacyId"))),this.bindListeners(),this.initPrivacies(),this.ezProxyModel.fetch(),this.options.fetch){this.itemModel.share();return}this.setShareData()},bindListeners:function(){this.listenTo(this.itemModel,"change:privacyId",this.render);this.listenTo(this.model,"change:privacy",this.onPrivacyChange);this.listenTo(this.model,"change:privacy",this.checkLoaded);this.listenTo(this.itemModel,"shared",this.setShareData);this.listenTo(this.itemModel,"change:privacyId",this.onUpdate);this.listenTo(this,"onrender",this.renderPrivacyView);this.listenTo(this,"onrender",this.onPrivacyChange);this.listenTo(this.ezProxyModel,"sync error",this.onEzProxySync);this.listenTo(this.itemModel,"change:restrictions",this.onRestrictionChange)},initPrivacies:function(){_.each(this.getVisiblePrivacies(),function(n){var t=this.getPrivacy(n);t.visible=!0},this)},triggerResize:function(){this.trigger("resize")},getUrlTab:function(){return{tabId:"url",text:"Link",view:new n.Shared.Views.ShareTabLinksView({model:this.model}),order:1,cssId:"url-tab",selected:!0,preload:!0}},getSendInMessageTab:function(){return{tabId:"send-message",text:"Send in message",view:new i.Views.MessageView({shareModel:this.model}),order:2,cssId:"send-message-tab",selected:!1,preload:!1}},getEmbedTab:function(){return{tabId:"embed",text:"Embed",view:new n.Shared.Views.ShareTabEmbedView({model:this.model,videoSizes:this.options.videoSizes,canAutoplay:this.options.canAutoplay,embeddable:this.options.embeddable}),order:3,cssId:"embed-tab",selected:!1,preload:!1}},getTabs:function(){var t=[this.getUrlTab()],i=new n.Shared.Collections.CustomerSettingCollection(n.Data.CustomerSettings),r=!!i.getByName(n.Shared.SettingOptions.Permanent.SCHOOL_MESSAGING).get("value");return!_.isEmpty(n.Data.User)&&n.Data.User.role!==8&&n.Data.User.modules.messaging&&r&&t.push(this.getSendInMessageTab()),t.push(this.getEmbedTab()),t},renderTabs:function(){if(this.itemModel.get("privacyId")!==1){var n=new i.Collections.TabCollection(this.getTabs()),t=new i.Views.TabView({collection:n,secondary:!0});this.renderView(this.ui.shareOptionTabs,t)}},getVisiblePrivacies:function(){if(!_.isFunction(this.itemModel.getAvailablePrivacies))return[2];var n=this.itemModel.getAvailablePrivacies();return _.reject(n,function(n){return _.contains(this.options.hidePrivacies,n)},this)},setupClippingTool:function(){this.options.enableClipping&&(this.clippingModel=new n.Shared.Models.SnippetViewModel,this.listenTo(this.clippingModel,"clipstop",this.onClipStop),this.listenTo(this.clippingModel,"clipupdate",this.onClipUpdate))},studentSharingEnabled:function(){var i=new n.Shared.Collections.CustomerSettingCollection(n.Data.CustomerSettings),t=i.getByName(n.Shared.SettingOptions.Permanent.STUDENT_WS_SHARING);return t&&!!t.get("value")},getPrivacy:function(n){return _.findWhere(this.privacies,{id:n})},getRestrictionDescription:function(){var i=this.itemModel.getRestriction(),u=this.itemModel.getRestrictedBy({beginningOfSentence:!0}),t=n.Shared.Helpers.firstCharToLowerCase(i.get("description")),r=t;return i.getMetadata().individualGroup||(r=t.replace("and","or")),"<strong>"+u+"<\/strong> has restricted access to this video from <strong>"+t+"<\/strong>. If you share this video with <strong>"+r+"<\/strong>, they won’t be able to watch it."},renderPrivacyView:function(){var t=new n.Shared.Views.ShareTabPrivacyView({model:this.model,itemModel:this.itemModel,privacies:this.privacies});this.renderView(this.ui.privacyContainer,t)},renderWarning:function(){var t="",i;(this.options.resourceType&&this.options.resourceType.type==="video"&&(this.itemModel.hasRestriction()?t=this.getRestrictionDescription():n.currentUser.isStaff()&&(this.itemModel.get("module")==="EXCHANGE"||this.itemModel.isExchangeVideo&&this.itemModel.isExchangeVideo())&&(t="Any videos shared or embedded from the Exchange will be viewable by your students, as long as they have the correct year group rating.")),t)&&(i=new n.Shared.Views.WarningView({message:t}),this.renderView(this.ui.warningContainer,i))},renderClippingTool:function(){if(this.options.enableClipping){var t=new n.Shared.Views.SnippetAppView({model:this.clippingModel});this.renderView(this.ui.clippingToolContainer,t)}},onBeforeRender:function(){if(!this.model.loaded||!this._ezProxyLoaded)return this._loaded=!1,this.renderView(this.$el,new n.Shared.Views.SpinJsView({cover:!0})),!1},onRender:function(){this.renderClippingTool();this.renderWarning();this.renderTabs();this.triggerResize()},showClippingTool:function(){this.options.enableClipping&&this.ui.clippingToolContainer instanceof jQuery&&this.ui.clippingToolContainer.show()},hideClippingTool:function(){typeof this.ui.clippingToolContainer!="string"&&this.ui.clippingToolContainer.hide()},onClipUpdate:function(n){this.model.set({startTime:n.get("startTime"),endTime:n.get("endTime"),chapter:n.get("chapterIndex")+1})},onClipStop:function(){this.model.unset("startTime");this.model.unset("endTime");this.model.unset("chapter")},onUpdate:function(){var n=this.getPrivacy(this.itemModel.get("privacyId"));this.model.set("privacy",n)},onPrivacyChange:function(){var n=this.model.get("privacy");n&&(n.id===1?(this.model.set("showEmbedOptions",!1),this.model.set("showLinks",!1),this.options.enableClipping&&(this.clippingModel&&this.clippingModel.set("enabled",!1),this.hideClippingTool())):(this.model.set("showLinks",!0),this.options.enableClipping&&this.showClippingTool()))},onRestrictionChange:function(){this.render()},_loaded:!1,checkLoaded:function(){this._loaded||this.model.get("privacy")&&(this._loaded=!0,this.render())},onEzProxySync:function(){this._ezProxyLoaded=!0;this.render()},setShareData:function(n){var t={};n.ShortCode&&(t.shortCode=n.ShortCode);n.ShortenedUrl&&n.ShortenedUrl.ShortUrl&&(t.shortUrl=n.ShortenedUrl.ShortUrl);t.privacy=this.getPrivacy(n.PrivacyId);t.proxyUrl=n.ProxyUrl;this.model.set(t);this.model.loaded=!0;this.render()}})}(ClickView,EasyMoney);!function(n){"use strict";var t=n.Shared,i=t.Models.ShareModel.extend({getImage:function(){var i=this.itemModel.thumbnail.get("url")||this.itemModel.get("thumbnailUrl"),t;return i?i:(t=this.itemModel.video.get("tokenId"),!t?"":n.Data.Config.urls.imageCDN+"/v1/thumbnails/trackingcode/"+t+"?size=small")}});n.Shared.Views.InteractiveShareTabView=n.Shared.Views.ShareTabView.extend({name:"InteractiveShareTabView",model:i,defaults:_.extend({},n.Shared.Views.ShareTabView.prototype.defaults,{embeddable:!0,resourceType:{type:"interactive",name:"interactive"},canAutoplay:!1,videoSizes:[{width:931,height:395},{width:1241,height:525},{width:1489,height:630}]}),renderWarning:function(){if(this.itemModel.get("privacyId")===3||!this.model.get("privacy")||this.model.get("privacy").id===3){var t=new n.Shared.Views.WarningView({message:"No results are collected when sharing Interactive Videos publicly."});this.renderView(this.ui.warningContainer,t)}}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Views.GoogleClassroomView=t.View.extend({template:i.Templates.GoogleClassroom,viewOptions:function(){return this.model.generateLinks()}});i.Views.ShareTabEmbedView=t.View.extend({template:i.Templates.ShareTabEmbed,defaults:{canAutoplay:!0},events:{"change #video-size":"videoSizeChange","click  #video-secure":"secureClick","click  #video-autoplay":"autoPlayClick","focus #embed-link":"onFocus"},ui:{embedLink:"#embed-link",copyButton:".copy-button",sizeSelect:"#video-size",googleClassroomContainer:".g-classroom"},videoSizes:[{width:640,height:360},{width:843,height:480},{width:1024,height:576},{width:1280,height:720}],initialize:function(){this.ezProxyModel=this.model.ezProxyModel;_.isArray(this.options.videoSizes)&&this.options.videoSizes.length>0&&(this.videoSizes=this.options.videoSizes);this.model.set(this.videoSizes[0]);this.listenTo(this.model,"change",_.throttle(this.render,200));this.listenTo(this,"tab:show",this.onShow)},initClipboard:function(){if(i.Helpers.isCopyAvailable()){var n=this;if(this.ui.copyButton instanceof jQuery&&this.ui.copyButton.length){this._clipboard=new Clipboard(this.ui.copyButton[0],{target:function(){return n.ui.embedLink[0]}});this._clipboard.on("success",function(){n.ui.copyButton.tooltip("show");window.setTimeout(function(){n.ui.copyButton.tooltip("hide")},1e3)})}}},autoPlayClick:function(n){this.model.set("autoPlay",!!n.currentTarget.checked)},secureClick:function(n){this.model.set("secure",!!n.currentTarget.checked)},videoSizeChange:function(){var n=this.ui.sizeSelect.find("option:selected"),t=n.data("width"),i=n.data("height");this.model.set({width:t,height:i})},viewOptions:function(){return{embedLink:this.model.getEmbedUrl(),videoSizes:this.videoSizes,isCopyEnabled:i.Helpers.isCopyAvailable(),showAutoplay:this.options.canAutoplay,embeddable:this.options.embeddable}},onShow:function(){this.focus();this.autoGrow()},onFocus:function(){this.ui.embedLink instanceof jQuery&&this.ui.embedLink.select()},focus:function(){this.ui.embedLink instanceof jQuery&&this.ui.embedLink.focus()},autoGrow:function(){this.ui.embedLink.autogrow&&this.ui.embedLink.autogrow({animate:!1,onInitialize:!0})},onRender:function(){this.ui.sizeSelect.find("option[data-width='"+this.model.get("width")+"']").attr("selected","selected");this.initClipboard();this.autoGrow();this.renderView(this.ui.googleClassroomContainer,new i.Views.GoogleClassroomView(this.options))},onClose:function(){this._clipboard&&this._clipboard.destroy()}});i.Views.ShareTabLinksView=t.View.extend({className:"cv-share-view-links",name:"ShareTabLinksView",template:i.Templates.ShareTabLinks,defaults:{resourceType:{type:"video",name:"video"},canAutoplay:!0,generateLinks:!0},videoSizes:[{width:640,height:360},{width:843,height:480},{width:1024,height:576},{width:1280,height:720}],ui:{copyButton:".copy-button",resourceLink:".resource-link"},events:{"click .resource-link":"onClick"},onClick:function(){this.ui.resourceLink.select()},focus:function(){this.ui.resourceLink.focus()},expand:function(){var n=this.ui.embedLink[0];this.ui.embedLink.height($("#embed-link")[0].scrollHeight)},initialize:function(){this.ezProxyModel=this.model.ezProxyModel;this.listenTo(this.model,"change",_.throttle(this.render,200));this.listenTo(this,"tab:show",this.focus)},viewOptions:function(){return{isCopyEnabled:i.Helpers.isCopyAvailable()}},getModel:function(){return _.extend(this.model.toJSON(),this.viewOptions(),this.model.generateLinks())},initClipboard:function(){if(i.Helpers.isCopyAvailable()){var n=this;if(this.ui.copyButton instanceof jQuery&&this.ui.copyButton.length){this._clipboard=new Clipboard(this.ui.copyButton[0],{target:function(){return n.ui.resourceLink[0]}});this._clipboard.on("success",function(){n.ui.copyButton.tooltip("show");window.setTimeout(function(){n.isClosed()||n.ui.copyButton.tooltip("hide")},1e3)})}}},onRender:function(){this.initClipboard();this.focus()},onClose:function(){this._clipboard&&this._clipboard.destroy()}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared;n.Shared.Views.ShareTabPrivacyView=t.View.extend({className:"share-metadata",name:"ShareTabPrivacyView",template:n.Shared.Templates.ShareTabPrivacy,ui:{privacySelector:".privacy-selector",info:".info"},events:{"click .privacy-selector .privacy":"privacySelect","click .privacy-selector-inner":"toggleDropdown"},initialize:function(){this.privacies=this.options.privacies;this.itemModel=this.options.itemModel;this.listenTo(this.model,"change:privacy",this.render);$(document).on("click",$.proxy(this.closeDropdown,this))},onClose:function(){$(document).off("click",$.proxy(this.closeDropdown,this))},isExchangeVideo:function(){var n=!1;return this.options.itemModel&&typeof this.options.itemModel.isExchangeVideo=="function"&&(n=this.options.itemModel.isExchangeVideo()),n},toggleDropdown:function(n){return this.ui.privacySelector instanceof jQuery&&this.ui.privacySelector.hasClass("dd-open")||n===!0?(this.closeDropdown(),!1):(this.openDropdown(),!1)},closeDropdown:function(){this.ui.privacySelector instanceof jQuery&&this.ui.privacySelector.removeClass("dd-open")},openDropdown:function(){this.ui.privacySelector instanceof jQuery&&this.ui.privacySelector.addClass("dd-open")},privacySelect:function(n){var i=$(n.currentTarget),t;i&&(t=i.data("id"),t)&&(this.changePrivacy(t),this.toggleDropdown(!0))},changePrivacy:function(n){this.itemModel.share(n)},renderTooltip:function(){this.ui.info.tooltip();this.ui.privacySelector.tooltip()},getRestrictedInfoTemplate:function(){var t=this.itemModel.getRestriction();return t.get("groupId")===n.Shared.Constants.OnlineYearGroups.All?"This {{type}} can only be viewed by admins in the same school as you.":"This {{type}} can be viewed by anyone who is from the same school as you, except for "+n.Shared.Helpers.firstCharToLowerCase(t.get("description"))+"."},getInfoTemplate:function(){switch(this.model.get("privacy").id){case 1:return"This {{type}} is currently private.";case 2:return this.isExchangeVideo()?"This {{type}} can be viewed by anyone with a ClickView account.":_.result(this.itemModel,"hasRestriction")?this.getRestrictedInfoTemplate():"This {{type}} can be viewed by anyone who is from the same school as you.";case 3:return"This {{type}} is public and can be viewed by anyone.";default:return""}},viewOptions:function(){return{hint:t.template(this.getInfoTemplate(),{type:this.model.get("resourceType").name}),privacies:this.privacies,showDropdown:_.where(this.privacies,{visible:!0}).length>1,isExchangeVideo:this.isExchangeVideo(),hasUserChannel:_.result(this.itemModel,"isInUserChannel",!1)}},onRender:function(){this.renderTooltip()}})}(ClickView,EasyMoney);!function(n){"use strict";var t=n.Shared;t.Views.SharedShareTabView=t.Views.ShareTabView.extend({name:"SharedShareTabView"})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared,r=t.View.extend({template:'<a class="nav-heading" href="/mylibrary"><h1>Library<\/h1><\/div>',className:"navigation-view other"}),u=t.View.extend({template:'<a class="nav-heading" href="/suplibrary?sid={{schoolId}}"><h1>{{name}}<\/h1><\/div>',className:"navigation-view other"});i.Views.LibraryNavigationMenuView=t.ListView.extend({childView:u,tagName:"div",className:"library-navigation-view",initialize:function(){this.collection=new t.Collection(n.Data.User.supplementaryLibraries);this.model.loaded||(this.listenTo(this.model,"sync",this.render),this.model.fetch());this.navView=new n.Shared.Views.NavigationMenuView(this.options)},buildChildView:function(t){if(this.model.get("sid")==t.get("schoolId"))return this.navView=new n.Shared.Views.NavigationMenuView(this.options),this.navView;var i=_.extend({},_.omit(this.options,["collection","model","id"]),{model:t});return new this.childView(i)},setSelected:function(n){this.navView.setSelected(n)},onBeforeRender:function(){return this.model.loaded?!0:(this.renderView(this.$el,new i.Views.PartialLoadingLeftNavView),!1)},onRender:function(){this.model.get("sid")?n.Data.NoLibrary||this.renderView(this.$el,new r,{empty:!1}):this.renderView(this.$el,this.navView,{empty:!1})}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Views.NavigationMenuView=t.View.extend({name:"NavigationMenuView.js",className:function(){return"navigation-view"},analyticsService:n.Shared.Utils.AnalyticsService,navTemplate:"{{rootUrl}}/{{id}}/{{name}}",template:i.Templates.NavigationMenu,_currentClass:null,defaults:{hasRootSiblings:!1},ui:{$children:".children",$link:".navigation-link",$heading:".nav-heading"},events:{"click .navigation-link":"onClick","click .nav-heading":"onClickHeading"},initialize:function(){this.options.pipeline||(this.options.pipeline=new t.Model);this.options.selected&&this.options.pipeline.set("selected",this.options.selected);this.options.navTemplate&&(this.navTemplate=this.options.navTemplate);this.listenTo(this.model,"sync",this.render);this.listenTo(this.model,"change:showChildren",this.updateClasses);this.listenTo(this.options.pipeline,"deselect",this.deselect);this.listenTo(this.options.pipeline,"change:selected",this.setShowChildren);(this._isRootNode()||this.options.hasRootSiblings)&&this.listenTo(this.options.pipeline,"render",this.render);this._isRootNode()&&!this.model.loaded&&this.model.fetch();this.setShowChildren()},_isRootNode:function(){return this.options.hasRootSiblings?!1:!this.options.parent},setShowChildren:function(){this.model.set("showChildren",this.shouldShowChildren(),{trigger:!1});this.updateClasses()},updateClasses:function(){var n=_.result(this,"className")+" "+this.getClasses();n!==this._currentClass&&(this._currentClass=n,this.$el.attr("class",this._currentClass))},getClasses:function(){var n;return n=this.model.get("showChildren")?"children-selected":"closed",this.shouldHighlight()&&(n+=" selected"),this.isParent()&&(n+=" parent"),this.options.hasRootSiblings&&(n+=" has-siblings"),n},isParent:function(){return this.hasChildren()&&!this.model.get("topNode")},hasChildren:function(){return this.model.get("children")&&this.model.get("children").length},hasParent:function(){return this.options.parent&&!this.options.parent._isRootNode()},isSelected:function(){var n=this.options.pipeline.get("selected"),t=this.model.get("id")||this.model.get("libraryId");return!n||!t?!1:n==t},select:function(){this.model.set("selected",!0)},deselect:function(){this.model.set("selected",!1)},onClick:function(n){n.stopPropagation();n.preventDefault();this.hasChildren()&&this.model.toggle("showChildren");var i=$(n.currentTarget);return this.isSelected()&&window.location.pathname===i.attr("href")?!1:(t.Events.trigger("navigate",this.navigateUrl()),this.setSelected(this.model.get("id")),this.analyticsService.logLibraryCategorySelect({id:this.model.get("id"),name:this.model.get("name"),type:"leftNav"}),!1)},onClickHeading:function(){if(this.options.hasRootSiblings){if(this.isSelected()||this.childrenSelected()){this.setSelected(!1);return}this.hasChildren()&&(this.setSelected(this.model.get("libraryId")),this.analyticsService.logLibraryClick({id:this.model.get("libraryId"),name:this.model.get("heading"),type:"leftNav"}))}},setSelected:function(n){(n||n===!1)&&this.options.pipeline.set("selected",n)},getMediaCount:function(){return this.model.get("videos")&&this.model.get("videos").pagination?this.model.get("videos").pagination.totalItems||0:this.model.get("mediaCount")},navigateUrl:function(){var n=i.Helpers.Slugify(this.model.get("name"));return t.template(this.navTemplate,{rootUrl:this.options.rootUrl,id:this.model.get("id"),name:n})},currentPath:function(){return window.location.pathname.toLowerCase()},currentPathId:function(){var n=this.currentPath().split("/");return n.length<4?null:n[3]},shouldHighlight:function(){return this.isSelected()},childrenSelected:function(){var t=this.options.pipeline.get("selected"),n=function(i){return!i||!i.length?!1:i.some(function(i){return t==i.get("id")?!0:n(i.get("children"))})};return n(this.model.get("children"))},renderChildren:function(){if(this.hasChildren()){var n=this;this.model.get("children").forEach(function(r){r instanceof Backbone.Model||(r=new t.Model(r));var u=new i.Views.NavigationMenuView({model:r,parent:n,rootUrl:n.options.rootUrl,pipeline:n.options.pipeline,navTemplate:n.options.navTemplate});n.renderView(n.ui.$children,u,{empty:!1})})}},onBeforeRender:function(){return this._isRootNode()&&!this.model.loaded?(this.renderView(this.$el,new i.Views.PartialLoadingLeftNavView),!1):!0},shouldShowChildren:function(){return this._isRootNode()||this.shouldHighlight()||this.childrenSelected()},renderTooltip:function(){this.model.get("tooltip")&&this.ui.$heading.tooltip()},viewOptions:function(){return{link:this.navigateUrl(),parent:this.isParent(),mediaCount:this.model.get("topNode")?this.model.getMediaCount():0}},onRender:function(){this.renderChildren();this.updateClasses();this.renderTooltip()},onClose:function(){this.stopListening(this.options.pipeline);this.stopListening(this.model)}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Views.NavigationView=t.View.extend({name:"NavigationView.js",className:"navigation-viewpart",template:!1,_localStorage:i.Utils.LocalStorageHelper,defaults:{renderTabs:!0},initialize:function(){this.menus=this.options.menus},tabSelected:function(){return _.some(this.tabs,function(n){return n.selected})},renderTabs:function(){var u=0,t,r;this.tabs=this.menus.map(function(n){return{tabId:n.get("tabId"),text:n.get("heading"),order:u++,view:new i.Views.NavigationMenuView({model:n}),cssId:n.get("cssId"),selected:window.location.pathname.indexOf(n.rootUrl)>-1}});!this.tabSelected()&&this._localStorage.get("selectedMenu")&&(t=_.findWhere(this.tabs,{text:this._localStorage.get("selectedMenu")})||{},t.selected=!0);this.tabSelected()||(this.tabs[0].selected=!0);r=new n.Shared.Views.TabView({collection:new n.Shared.Collections.TabCollection(this.tabs)});this.renderView(this.$el,r)},renderMenu:function(n){n.set({topNode:!0});this.navigationMenuView=new i.Views.NavigationMenuView({model:n,rootUrl:this.options.rootUrl});this.renderView(this.$el,this.navigationMenuView,{empty:!1})},setSelected:function(n){this.navigationMenuView&&this.navigationMenuView.setSelected(n)},renderMenus:function(){_.forEach(this.menus,_.bind(this.renderMenu,this))},onRender:function(){if(this.menus instanceof Array||(this.menus=[this.menus]),this.menus.length<=1){this.renderMenu(this.menus[0]);return}this.options.renderTabs?this.renderTabs():this.renderMenus()}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Views.PartialLoadingLeftNavView=t.View.extend({name:"PartialLoadingLeftNavView",className:"partial-loading-view left-nav",template:i.Templates.PartialLoadingLeftNav,defaults:{showHeader:!0}})}(ClickView,EasyMoney);!function(n,t){n.Views.HeroContainerView=t.View.extend({name:"HeroContainerView.js",template:n.Templates.HeroContainer,className:"hero-view",defaults:{delay:15e3},ui:{$leftNavigation:".left-navigation-item-viewpart",$rightNavigation:".right-navigation-item-viewpart",$list:".hero-list-viewpart",$pagination:".hero-pagination-viewpart"},events:{mouseenter:"stopTimer",mousedown:"stopTimer",mouseleave:"startTimer"},initialize:function(){this.model&&(this.listenTo(this.model,"sync",this.onSync),this.listenTo(this.model,"error",this.onError));this.collection&&this.collection.loaded&&(this._synced=!0,this.listenTo(this.collection,"change:active",this.onChangeActive),this.setActiveModel(),this.preloadImages());this.heroItemView=this.options.heroItemView?this.options.heroItemView:n.Views.HeroItemView;this.listenTo(t.Events,"hero:move-left-navigation",this.onMoveLeft);this.listenTo(t.Events,"hero:move-right-navigation",this.onMoveRight)},onMoveLeft:function(){var n=this.collection.at(this.collection.indexOf(this._activeModel)-1);if(n){n.set("active",!0);return}n=this.collection.at(this.collection.length-1);n.set("active",!0,{first:!0})},onMoveRight:function(){var n=this.collection.at(this.collection.indexOf(this._activeModel)+1);if(n){n.set("active",!0);return}n=this.collection.at(0);n.set("active",!0,{last:!0})},onChangeActive:function(n,t,i){if(t){this.collection.forEach(function(t){t.get("id")!==n.get("id")&&t.set("active",!1)});var r=this,u=this._activeModel;this._activeModel=n;this.collection.indexOf(u)>this.collection.indexOf(this._activeModel)&&!(i&&i.last)||i&&i.first?(this._heroView&&this._heroView.$el.addClass("out-right"),setTimeout(function(){r.renderHeroItem({entrance:"in-left"})},250)):(this._heroView&&this._heroView.$el.addClass("out-left"),setTimeout(function(){r.renderHeroItem({entrance:"in-right"})},250))}},onSync:function(){if(this.model){this._synced=!0;var n=this.model.get("videos").take(5);if(this.collection=this.model.get("videos"),this.collection.reset(n,{silent:!0}),!this.collection.length){this.close();return}this.listenTo(this.collection,"change:active",this.onChangeActive);this.preloadImages();this.setActiveModel();this.startTimer();this.render()}},onError:function(){this.close()},setActiveModel:function(){this.collection.each(function(n){n.set("active",!1,{silent:!0})});this._activeModel=this.collection.at(0);this._activeModel.set("active",!0,{silent:!0})},preloadImages:function(){var n=this.collection.map(function(n){return ClickView.Shared.Helpers.getThumbnailUrl(n,{thumbnailSize:"large"})});ClickView.ImagePreloader.preload(n)},startTimer:function(){if(!this.model||this.model.hasFetched()){var n=this;this.interval=setInterval(function(){var t=n.collection.indexOf(n._activeModel)+1;n.collection.at(t)?n.collection.at(t).set("active",!0,{timed:!0}):n.collection.at(0).set("active",!0,{last:!0,timed:!0})},this.options.delay)}},stopTimer:function(){this.interval=clearInterval(this.interval)},renderPartialLoadingView:function(){this.renderView(this.$el,new n.Views.HeroPartialLoadingView)},renderNavigationItems:function(){this.renderView(this.ui.$leftNavigation,new n.Views.HeroNavigationItemView({collection:this.collection,direction:"left-navigation",dashboardId:this.model&&this.model.get("dashboardId")}));this.renderView(this.ui.$rightNavigation,new n.Views.HeroNavigationItemView({collection:this.collection,direction:"right-navigation",dashboardId:this.model&&this.model.get("dashboardId")}))},renderHeroItem:function(n){var t=n&&n.entrance;this._heroView=new this.heroItemView({model:this._activeModel,dashboardId:this.model&&this.model.get("dashboardId"),entrance:t});this.renderView(this.ui.$list,this._heroView)},renderPaginationView:function(){var t=new n.Views.HeroPaginationListView({collection:this.collection,dashboardId:this.model&&this.model.get("dashboardId")});this.renderView(this.ui.$pagination,t)},onBoarding:function(){return"hero-view"},onBeforeRender:function(){return this.model&&!this.model.hasFetched()?(this.renderPartialLoadingView(),!1):this._synced?!0:(this.onSync(),!1)},onRender:function(){this.renderHeroItem({entrance:"initial"});this.collection.length>1&&(this.renderNavigationItems(),this.renderPaginationView())},onClose:function(){this.interval&&clearInterval(this.interval)}})}(ClickView.Shared,EasyMoney);!function(n,t){n.Views.HeroItemView=t.View.extend({name:"HeroItemView.js",template:n.Templates.HeroItem,analyticsService:ClickView.Shared.Utils.AnalyticsService,defaults:{entrance:"in-right",showPlayNow:!0},className:function(){return"hero-item fade "+this.options.entrance},events:{"click .hero-call-to-action":"onClickCallToAction","click .image-viewpart":"onClickImageViewpart"},ui:{$title:".hero-title",$series:".hero-series",$byline:".hero-byline"},logClick:function(n){this.analyticsService.logHeroItemClick({type:n,id:this.model.get("id"),title:this.model.get("name"),trackingCode:this.model.get("trackingCode"),dashboardId:this.options.dashboardId,url:this.model.actionUrl(),position:this.model.collection.indexOf(this.model)+1})},onClickCallToAction:function(){this.logClick("call-to-action")},onClickImageViewpart:function(){this.logClick("image")},getActionUrl:function(){return},viewOptions:function(){return _.extend({seriesName:this.model.series&&this.model.series.get("name"),thumbnailUrl:ClickView.Shared.Helpers.getThumbnailUrl(this.model,{thumbnailSize:"large"}),actionUrl:this.model.actionUrl&&this.model.actionUrl(),producedByClickView:this.model.isProducedByClickView&&this.model.isProducedByClickView(),showPlayNow:this.options.showPlayNow},this.options)},onRendered:function(){this.ui.$title.collapser({mode:"lines",truncate:4,ellipsis:"...",afterHide:_.bind(function(){this.ui.$title.find("a").hide()},this)});this.ui.$series.collapser({mode:"lines",truncate:2,ellipsis:"...",afterHide:_.bind(function(){this.ui.$series.find("a").hide()},this)});var n=Math.ceil(this.ui.$title.height()/24),t=Math.ceil(this.ui.$series.height()/15);this.ui.$byline.collapser({mode:"lines",truncate:this.options.descriptionLineCount||7-n-t,ellipsis:"...",afterHide:_.bind(function(){this.ui.$byline.find("a").hide()},this)})}})}(ClickView.Shared,EasyMoney);!function(n,t){n.Views.HeroListView=t.View.extend({name:"HeroListView.js",template:!1,initialize:function(){this.listenTo(this.collection,"change:active",this.onChangeActive)},onChangeActive:function(){var n=this.collection.findWhere({wasActive:!0});n||this.render();setTimeout(_.bind(this.render,this),500)},onRender:function(){this.renderView(this.$el,new n.Views.HeroItemView({model:this.model}))}})}(ClickView.Shared,EasyMoney);!function(n,t){n.Views.HeroNavigationItemView=t.View.extend({name:"HeroNavigationItemView.js",template:n.Templates.HeroNavigationItem,analyticsService:ClickView.Shared.Utils.AnalyticsService,className:function(){return"hero-navigation-item "+this.options.direction},events:{mouseenter:"onMouseEnter",mouseleave:"onMouseLeave","click svg":"onClickSvg"},initialize:function(){this.breakpoints=ClickView.Data.Breakpoints},widthIsSmall:function(){return window.innerWidth<this.breakpoints.sm},onMouseEnter:function(){this.widthIsSmall()},onMouseLeave:function(){this.widthIsSmall()},onClickSvg:function(){this.onMouseEnter();t.Events.trigger("hero:move-"+this.options.direction);this.analyticsService.logHeroNavigation({type:"arrow",direction:this.getDirection(),dashboardId:this.options.dashboardId})},getDirection:function(){return this.options.direction.indexOf("left")>-1?"left":"right"},viewOptions:function(){return{direction:this.getDirection()}}})}(ClickView.Shared,EasyMoney);!function(n,t){var i=t.View.extend({tagName:"li",template:!1,analyticsService:ClickView.Shared.Utils.AnalyticsService,className:function(){return"hero-pagination-item "+(this.model.get("active")?"active":"")},events:{click:"onClick"},onClick:function(){this.model.set("active",!0);this.analyticsService.logHeroNavigation({type:"pager",dashboardId:this.options.dashboardId})}});n.Views.HeroPaginationListView=t.ListView.extend({name:"HeroPaginationListView.js",childView:i,className:"hero-pagination-list-view",tagName:"ul",initialize:function(){this.listenTo(this.collection,"change:active",this.onChangeActive)},onChangeActive:function(n,t,i){if(t)if(i&&i.timed){var r=this;setTimeout(function(){r.render()},250)}else this.render()}})}(ClickView.Shared,EasyMoney);!function(n,t){n.Views.HeroPartialLoadingView=t.View.extend({name:"HeroPartialLoadingView.js",template:!1,className:"hero-item partial-loading"})}(ClickView.Shared,EasyMoney),function(n,t){"use strict";var i=t.Model.extend({defaults:{id:"",title:"",deletable:!1},url:function(){var n=this.get("id");return"/api/curriculum/tags/"+n},save:function(){var n=this,t=this.collection.options.trackingCode;$.ajax({type:"POST",url:"/api/curriculum/videos/"+t+"/tags?title="+this.get("title"),success:function(t){t.hasError||(n.set("id",t.data.id),n.trigger("saved",n))}})}}),r,u;n.Collections.AlbertTagsCollection=t.Collection.extend({model:i,url:function(){var n=this.options.trackingCode;return"/api/curriculum/videos/"+n+"/tags"},parse:function(n){return n.tags}});r=t.View.extend({name:"albertTagsListItem",className:"albert-tag",template:n.Templates.AlbertTagItem,initialize:function(){this.listenTo(this.model,"remove",this.close)},events:{"click .delete-btn":"deleteTag"},getModel:function(){return this.model.toJSON()},deleteTag:function(){this.model.destroy({success:function(){$("#remove-msg").show();setTimeout(function(){$("#remove-msg").hide()},2e3)},error:function(){}})}});u=t.ListView.extend({name:"albertTagsListView",childView:r,tagNAme:"div",className:"albert-tags-list",initialize:function(){this.listenTo(this.collection,"add",this.addOne)}});n.Views.AlbertTagsView=t.View.extend({id:"albert-tags-widget",name:"AlbertTagsView",model:n.Models.AlbertTag,template:'<div id="tag-input-container"><input id="albert-tag-input" class="typeahead" placeholder="Please enter a tag name" /><button id="albert-add-tag-btn" class="cv-btn">Add new tag<\/button><\/div><div id="loading"><\/div><div id="duplicate-error" class="message error">This tag already exists<\/div><div id="remove-msg" class="message success">Tag has been removed<\/div><div class="albert-tags-viewpart"><\/div>',_newTag:null,ui:{tagList:".albert-tags-viewpart",tagInputContainer:"#tag-input-container",tagInput:"#albert-tag-input",addTagBtn:"#albert-add-tag-btn",loading:"#loading",existValidation:"#duplicate-error"},events:{"click #albert-add-tag-btn":"addTag","keyup #albert-tag-input":"addTagByKey"},addTagByKey:function(n){n.keyCode==13&&this.addTag()},addTag:function(){var r=this,n=this.ui.tagInput.val(),t;_.isEmpty(n)||(t=this.collection.where({title:n}),t.length===0?(this.ui.tagInput.attr("disabled","disabled"),this.ui.addTagBtn.removeClass("disabled").addClass("disabled"),this.ui.addTagBtn.attr("disabled","disabled"),this._newTag=new i({title:n,deletable:!0}),this.ui.loading.show(),this.collection.create(this._newTag)):(this.ui.existValidation.show(),setTimeout(function(){r.ui.existValidation.hide()},2e3),this.ui.tagInput.typeahead("val",null)))},tagEdit:function(){var n=this;n.ui.tagInput.typeahead({hint:!0,highlight:!0,minLength:2},{name:"tag",displayKey:"value",source:function(n,t){return $.ajax({url:"http://suggestqueries.google.com/complete/search?q="+n+"&client=firefox",dataType:"JSONP",data:{format:"json"},success:function(n){var r=n[1],i=[];return $.each(r,function(n,t){i.push({value:t})}),t(i)}})}})},initialize:function(){this.collection.fetch();this._loaded=this.collection.length>0;this.listenTo(this.collection,"sync",this.onLoad);this.listenTo(this.collection,"saved",this.onSaved)},onSaved:function(){this.ui.loading.hide();this.ui.tagInput.removeAttr("disabled");this.ui.addTagBtn.removeAttr("disabled");this.ui.addTagBtn.removeClass("disabled");this.ui.tagInput.typeahead("val",null);this._newTag=null},getModel:function(){return this.options},onLoad:function(){this._loaded||(this._loaded=!0,this.render())},onBeforeRender:function(){if(this._loaded===!1)return $("#loading").css("display","show"),!1},renderTags:function(){var n=new u({collection:this.collection});this.renderView(this.ui.tagList,n);ClickView.Data.User.isPrimaryContanct||this.ui.tagInputContainer.hide();this.tagEdit()},onRender:function(){this.renderTags()},onRendered:function(){}})}(ClickView.Shared,EasyMoney);!function(n,t){"use strict";var i=n.Shared,r=function(n){if(n||(n={}),n.id){var t="/albert/search/"+n.typeString.toLowerCase()+"/"+n.id;return n.parentId&&(t+="?parentId="+n.parentId),t}},u=function(t,i){i||(i={});var r=_.extend({},t,{from:"Curriculum View",referredFrom:i.referredFrom});n.Shared.Utils.AnalyticsService.logCurriculumSearch(r)},f=function(t){var r=n.Data.AlbertLearningAreaType&&n.Data.AlbertLearningAreaType.type,i={id:t.get("id"),type:t.get("type"),typeString:t.get("typeString"),parentId:t.get("parentId"),selectedName:t.get("name"),learningAreaType:r};return n.Albert.Services.AlbertService?_.extend({},i,{clearParams:!0,reset:!0}):i};i.Views.CurriculumItemView=t.View.extend({name:"CurriculumItemView.js",className:"curriculum",tagName:"li",template:i.Templates.CurriculumItem,initialize:function(){n.Albert.Services.AlbertService&&(this.radio=t.Global.radio,this.isAlbertSearch=!0)},events:{"click a":"search"},search:function(n){var t=f(this.model);return(u(t,{referredFrom:this.options.referredFrom}),!this.isAlbertSearch)?!0:(n.preventDefault(),this.radio.AlbertChannel.trigger("albert:action:closepopup"),this.radio.AlbertChannel.trigger("albert:data:fetchlearningarea",t),!1)},viewOptions:function(){return{regionCode:n.Data.Config.region.code.toLowerCase(),hasDescription:this.model.get("description"),learningAreaType:n.Data.AlbertLearningAreaType.type.toLowerCase(),albertUrl:r({id:this.model.get("id"),typeString:this.model.get("typeString"),parentId:this.model.get("parentId")})}}});i.Views.CurriculumListView=t.ListView.extend({name:"CurriculumListView.js",className:"curricula",childView:i.Views.CurriculumItemView,onRendered:function(){n.Data.Config.albertOptions&&n.Data.Config.albertOptions.enableMathJax&&MathJax.Hub.Queue(["Typeset",MathJax.Hub])}});i.Views.SubStrandLearningAreaItemView=t.View.extend({name:"SubStrandLearningAreaItemView.js",template:i.Templates.SubStrandLearningArea,tagName:"li",initialize:function(){n.Albert.Services.AlbertService&&(this.radio=t.Global.radio,this.isAlbertSearch=!0)},ui:{$curriculumList:".curriculum-list-viewpart"},events:function(){var n=_.partial(_.bind(this.search,this),{type:"strand"}),t=_.partial(_.bind(this.search,this),{type:"subStrand"});return{"click .title-container a.strand":n,"click .title-container a.subStrand":t}},search:function(n,t){if(!n.type)return!0;var r=n.type==="strand"?this.model.strand:this.model.subStrand,i=f(r);return(u(i,{referredFrom:this.options.referredFrom}),!this.isAlbertSearch)?!0:(t.preventDefault(),this.radio.AlbertChannel.trigger("albert:action:closepopup"),this.radio.AlbertChannel.trigger("albert:data:fetchlearningarea",i),!1)},viewOptions:function(){var n=r({id:this.model.strand.get("id"),typeString:this.model.strand.get("typeString"),parentId:this.model.strand.get("parentId")}),t=r({id:this.model.subStrand.get("id"),typeString:this.model.subStrand.get("typeString"),parentId:this.model.subStrand.get("parentId")});return{strandName:this.model.strand.get("name"),strandUrl:n,subStrandName:this.model.subStrand.get("name"),subStrandUrl:t}},onRender:function(){var n=new i.Views.CurriculumListView(_.extend({},this.options,{collection:this.model.collection}));this.renderView(this.ui.$curriculumList,n)}});i.Views.SubStrandLearningAreaListView=t.ListView.extend({name:"SubStrandLearningAreaItemView.js",className:"sub-strands",childView:i.Views.SubStrandLearningAreaItemView});i.Views.YearLearningAreaItemView=t.View.extend({name:"YearLearningAreaItemView.js",model:i.Models.YearLearningArea,className:"year-group",tagName:"li",template:i.Templates.YearLearningArea,ui:{$subStrandGroup:".sub-strand-group-viewpart"},viewOptions:function(){var i=this.model.subject.get("name"),t=this.model.year.get("name");return{subjectName:i&&i.toTitleCase(),yearName:t&&t.toLowerCase()==="gcse"?t.toUpperCase():t.toTitleCase(),strandName:n.Data.AlbertLearningAreaType&&n.Data.AlbertLearningAreaType.type.toLowerCase()==="tafe"?this.model.strand.get("name"):""}},onRender:function(){var n=new i.Views.SubStrandLearningAreaListView(_.extend({},this.options,{collection:this.model.collection}));this.renderView(this.ui.$subStrandGroup,n)}});i.Views.YearLearningAreaListView=t.ListView.extend({name:"YearLearningAreaListView.js",childView:i.Views.YearLearningAreaItemView,initialize:function(){(this.collection=new i.Collections.YearLearningAreaCollection(null,this.options),this.listenTo(this.collection,"sync",this.render),n.Albert.Services.AlbertService)&&(this.radio=t.Global.radio,this.listenTo(this.radio.AlbertChannel,"albert:action:closepopup",this.close))},onBeforeRender:function(){return this.collection.loaded?this.collection.loaded&&!this.collection.length?(this.$el.html('<div class="empty-links">There are no curriculum links available for this video.<\/div>'),!1):!0:(this.renderView(this.$el,new i.Views.LoaderView),this.collection.fetch(),!1)},renderItems:function(){this.collection.comparator="year.order";this.collection.sort();t.ListView.prototype.renderItems.apply(this,arguments);this.trigger("resize")}})}(ClickView,EasyMoney),function(n,t){"use strict";n.Shared.Views.BasePopupView=t.View.extend({name:"BasePopupView",tagName:"div",className:"cv-popup",events:{"popup:open":"open","popup:close":"close"},template:!1,defaults:{cssId:"",width:500,height:250,closeEl:null,showMask:!0,bodyHtml:"",positionX:null,positionY:null,maskColour:"#000",maskOpacity:.4,removeOnHide:!0,canClose:!0,clickClose:!1,zindex:9999},initialize:function(){$(document).on("keypress",_.bind(this.keydownHandler,this));this.listenTo(t.Events,"popup:resize",this.style)},keydownHandler:function(n){n.keyCode===27&&this.closePopup()},position:function(n,t){var u=n||this.$el.outerWidth()/2,i=t||this.$el.outerHeight()/2,r;this.$el.css("margin-top",-i);this.$el.css("margin-left",-u);r=this.$el.offset();r.top<0&&(i=i+r.top-15,this.$el.css("margin-top",-i));this.$el.outerHeight()+r.top>window.innerHeight&&(i=r.top-15,this.$el.css("margin-top",-i))},style:function(){this.options.cssId&&this.$el.attr("id",this.options.cssId);this.$el.css({"z-index":this.options.zindex});this.position(this.options.positionX,this.options.positionY)},renderMask:function(){if(this.options.showMask&&$.fn.mask&&(this.$mask=$("body").mask({opacity:this.options.maskOpacity,bgColour:this.options.maskColour}).show(),this.options.canClose))this.$mask.on("click",$.proxy(this.closePopup,this))},renderPopup:function(n,t){if(this.options.bodyHtml){n.html(this.options.bodyHtml);return}return this.listenTo(t,"close",this.closePopup),this.renderView(n,t,{inPopup:!0,popupView:this})},onShow:function(){this.openPopup()},onHide:function(){this.options.showMask&&this.$mask.hide()},openPopup:function(){this.options.showMask&&this.$mask.show();this.style()},closePopup:function(){this.hide();this.options.removeOnHide&&this.close()},onClickClose:function(){this.options.clickClose&&(this.trigger("popup:onclickclose"),this.options.view&&this.options.view.trigger("popup:onclickclose"));this.closePopup()},onClose:function(){this.unregisterEventListeners();this.trigger("popup:closed")},registerEventListeners:function(){if(this.options.closeEl)this.$el.find(this.options.closeEl).on("click",_.bind(this.onClickClose,this));this.$el.on("resize",_.bind(this.style,this))},unregisterEventListeners:function(){$(document).off("keypress",_.bind(this.keydownHandler,this));this.$el.find(this.options.closeEl).off("click",_.bind(this.onClickClose,this))},onRender:function(){this.renderMask();this.renderPopup(this.$el,this.options.view);this.hide()},onRendered:function(){this.show()}});n.Shared.Views.PopupView=n.Shared.Views.BasePopupView.extend({name:"PopupView",template:n.Shared.Templates.Popup,_buttonTemplate:'<a class="{{cssClass}} btn">{{text}}<\/a>',popupDefaults:{showButtonContainer:!1,closeButtonText:"Close",closeOnChildClose:!0,canClose:!0,hide:!0},ui:{$titleContainer:".popup-title-container",$bodyContainer:".popup-body-container",$buttonContainer:".popup-button-container"},initialize:function(t){n.Shared.Views.BasePopupView.prototype.initialize.apply(this,arguments);this.options=_.extend({},this.options,this.popupDefaults,t);this.listenToChild("close",this.onChildClose);this.listenTo(this.options.view,"resize",this.style);$(window).on("resize",_.debounce(_.bind(this.style,this),300));this.listenTo(this.options.view,"popup:hide:buttons",this.hideButtons);this.listenTo(this.options.view,"popup:show:buttons",this.showButtons);this.$contentContainer=$("#content-container");this.$body=$("body");this.$subNav=$("#sub-nav")},getModel:function(){return{title:this.options.title,canClose:this.options.canClose,additionalClass:this.options.additionalClass}},registerEvents:function(){this.options.closeEl?this.options.closeEl+=", .close":this.options.closeEl=".close";this.options.showButtonContainer&&(this.options.closeEl+=", .close-button");this.registerEventListeners()},createButton:function(n,t){if(this.options.showButtonContainer){var i=$(this.renderTemplate(this._buttonTemplate,{text:n,cssClass:t}));this.ui.$buttonContainer.append(i)}},hideButtons:function(){this.ui.$buttonContainer.hide()},showButtons:function(){this.ui.$buttonContainer.show()},closePopup:function(){window.scrollLock=!1;this.$body.removeClass("lock");this.$contentContainer.css("top","");window.scrollTo(0,this.scrollY);n.Shared.Views.BasePopupView.prototype.closePopup.apply(this,arguments)},lockBody:function(){window.scrollLock=!0;this.scrollY=window.scrollY;var t=window.scrollY;t-=window.innerWidth>n.Data.Breakpoints.sm?this.$contentContainer.offset().top:this.$subNav.outerHeight(!0);this.$contentContainer.css("top",-t+"px");this.$body.addClass("lock")},onRender:function(){var t=this,n;this.renderMask();this.lockBody();n=this.renderPopup(this.ui.$bodyContainer,this.options.view);n&&_.isFunction(n.onRenderedInPopup)&&n.onRenderedInPopup.call(n,this);this.createButton(this.options.closeButtonText,"close-button grey");!this.options.showButtonContainer||this.showButtons();this.options.hide&&this.hide();this.options.canClose&&this.registerEvents()},onChildClose:function(){this.options.closeOnChildClose&&this.closePopup()},selfRender:function(n){var t=this.render().el;n?n.append(t):this.$body.append(t);this.trigger("rendered");this.show()}});n.Shared.Views.BottomRightPopup=n.Shared.Views.PopupView.extend({position:function(){var n=this.$el.outerHeight();this.$el.css("margin-top",-n);this.$el.css("right","3%");this.options.cornerDistance&&(this.$el.css("margin-top",-n-this.options.cornerDistance.bottom),this.$el.css("right",this.options.cornerDistance.right+"px"))}})}(ClickView,EasyMoney),function(n,t){var r,i;r=t.View.extend({tagName:"button",template:"{{text}}",_shouldTrigger:!0,defaults:{position:"right",css:"",enabled:!0},viewOptions:function(){return{text:this.options.text}},className:function(){var n="btn "+this.options.css+" ";return n+=this.options.position==="left"?"btnleft":"btnright",this.options.large&&(n+=" large"),n},events:{click:"onClick"},onClick:function(){this.model&&this.options.eventName&&this._shouldTrigger&&this.model.trigger(this.options.eventName)}});i=r.extend({initialize:function(){this.options.disabledModelProp&&this.listenTo(this.model,"change:"+this.options.disabledModelProp,this.onDisabledChange)},onDisabledChange:function(){this.options.disabledModelProp&&(this.model.get(this.options.disabledModelProp)?(this.$el.addClass("disabled"),this._shouldTrigger=!1):(this.$el.removeClass("disabled"),this._shouldTrigger=!0))},onRender:function(){this.onDisabledChange()}});n.Shared.Views.MultiStepView=t.View.extend({_currentView:null,template:'<div class="multistep-view"><div class="step-body"><\/div><div class="buttons"><\/div><\/div>',ui:{body:".step-body",buttons:".buttons"},defaults:{lastStepText:"Save",showLastStep:!1,largeButtons:!1},buttons:[],constructor:function(){this.stepModel=new t.Model({currentStep:0,steps:[],disablenext:!0,disablefinish:!0});t.View.prototype.constructor.apply(this,arguments);this.listenTo(this.stepModel,"next",this.goNext);this.listenTo(this.stepModel,"back",this.goBack);this.listenTo(this.stepModel,"button:next:click",this._stepComplete);this.listenTo(this.stepModel,"button:back:click",this._previousStep);this.listenTo(this.stepModel,"button:finish:click",this._finish);this.listenTo(this.stepModel,"change:currentStep",this.renderStep)},goNext:function(){var n=this.stepModel.get("steps").length,t=this.stepModel.get("currentStep");t>=n||this.stepModel.increment("currentStep")},goBack:function(){this.stepModel.decrement("currentStep")},addStep:function(n,t){var i=this.stepModel.get("steps");i.push({view:n,args:t||{}});this.stepModel.trigger("addstep")},_stepComplete:function(){this._currentView&&this._currentView.stepComplete()},_previousStep:function(){this._currentView&&this._currentView.prevStep()},_finish:function(){this._currentView&&this._currentView.stepComplete()},renderStep:function(){var i=this.stepModel.get("currentStep"),t=this.stepModel.get("steps")[i],n;if(t==null){console.log("No step");return}n=new t.view(_.extend({},{stepModel:this.stepModel,model:this.model},t.args));this._currentView&&this._currentView.close();this.renderView(this.ui.body,n);this._currentView=n;this.onStepChange(i,n);n.onShowStep()},onStepChange:function(n,t){this.renderButtons(t)},onRender:function(){this.renderStep()},renderButtons:function(n){var u=this.stepModel.get("currentStep"),f=this.stepModel.get("steps").length,t=this.ui.buttons,r;t.empty();r={next:{text:"Next",css:"primary",eventName:"button:next:click",disabledModelProp:"disablenext",position:"right",large:this.options.largeButtons},back:{text:"Back",css:"secondary",eventName:"button:back:click",disabledModelProp:"disableback",position:"left",large:this.options.largeButtons},navigateBack:{text:"Back",css:"secondary",eventName:"button:navigateback:click",disabledModelProp:"disableback",position:"left",large:this.options.largeButtons},finish:{text:this.options.lastStepText,css:"orange",eventName:"button:finish:click",disabledModelProp:"disablefinish",position:"right",large:this.options.largeButtons}};u>0&&n.showBack&&this.renderButton(t,r.back,i);u===0&&n.showNavigateBack&&this.renderButton(t,r.navigateBack,i);u<f-1&&n.showNext&&this.renderButton(t,r.next,i);u>=f-1&&this.options.showLastStep&&this.renderButton(t,r.finish,i);_.each(this.buttons,function(n){this.renderButton(t,n)},this)},renderButton:function(n,t,i){i=i||r;var u=new i(_.extend({},{model:this.stepModel},t));this.renderView(n,u,{empty:!1})},disableFinish:function(){this.stepModel.set("disablefinish",!0)},enableFinish:function(){this.stepModel.set("disablefinish",!1)}});n.Shared.Views.MultiStepStepView=t.View.extend({template:!1,showBack:!0,showNext:!0,onShowStep:function(){},stepComplete:function(){this.goNext()},prevStep:function(){this.goBack()},goNext:function(){this.options.stepModel.trigger("next")},goBack:function(){this.options.stepModel.trigger("back")},disableNext:function(){this.options.stepModel.set("disablenext",!0)},enableNext:function(){this.options.stepModel.set("disablenext",!1)},disableFinish:function(){this.options.stepModel.set("disablefinish",!0)},enableFinish:function(){this.options.stepModel.set("disablefinish",!1)}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared,r=t.Model.extend({urlRoot:"/api/workspace/workspaceitems",initialize:function(){this.on("sync error",this.setLoaded,this);this.on("request",this.resetLoaded,this)},setLoaded:function(){this._loaded=!0},resetLoaded:function(){this._loaded=!1},isLoaded:function(){return this._loaded},isEdited:function(){var t=this.get("sourceExternalId");return!!t&&!n.Shared.Helpers.Guid.isEmptyGuid(t)}}),u=t.Model.extend({urlRoot:"/Ajax/CanEdit",initialize:function(){this.on("sync",this.setLoaded,this);this.on("request",this.resetLoaded,this)},setLoaded:function(){this._loaded=!0},resetLoaded:function(){this._loaded=!1},isLoaded:function(){return this._loaded}});i.Views.AddToExchangeView=t.View.extend({template:i.Templates.AddToExchange,className:"add-to-exchange",events:{"click .add-button":"add","click .edit-button":"edit","click .close-button":"close"},ui:{videoListItem:".video-list-item",messageContent:".message-content"},viewOptions:{hasWarning:function(){return this.existsInMaster()},existsInMaster:function(){return this.existsInMaster()},canEdit:function(){return this.canEdit.get("success")}},initialize:function(){this.canEdit=new u;this.workspaceItem=new r;var n=this.canEdit.fetch({data:{tokenId:this.model.get("tokenId")}}),t=this.workspaceItem.fetch({data:{videoId:this.model.get("id")}});$.when(n,t).always(this.render.bind(this))},getVideoType:function(){return this.model.isCloud247()?"broadcast":n.Data.User.userChannels&&n.Data.User.userChannels.length?"channel-video":"own-video"},add:function(){var n=this.getVideoType();window.location="/exchange/contribute/"+n+"/"+this.model.get("id");this.renderLoader()},edit:function(){window.location=n.Data.Config.urls.cloudEditor+"/edit/video/"+this.model.get("tokenId");this.renderLoader()},renderLoader:function(){this.renderView(this.$el,new i.Views.LoaderView({mask:!0,cover:!0}),{empty:!1})},existsInMaster:function(){return this.model.isExchangeVideo()},onBeforeRender:function(){return!this.workspaceItem.isLoaded()||!this.canEdit.isLoaded()?(this.renderView(this.$el,new n.Shared.Views.LoaderView),!1):!0},onRender:function(){this.renderView(this.ui.videoListItem,new i.Views.VideoListItemView({model:this.model,clickable:!1,showVideoAction:!1}));this.trigger("resize")}})}(ClickView,EasyMoney);!function(n,t){"use strict";n.Views.AlertView=t.View.extend({name:"AlertView.js",className:function(){return"cv-alert "+this.options.state},template:n.Templates.Alert,defaults:{state:"alert-success",timeout:5e3,message:"Succesfully saved your data"},initialize:function(){this.listenTo(this,"rendered",this.startTimer)},startTimer:function(){setTimeout(_.bind(function(){this.close()},this),this.options.timeout)},selfRender:function(n){var t=this.render().el,i=n||$("body");i.prepend(t);this.trigger("rendered")}})}(ClickView.Shared,EasyMoney);!function(n,t){"use strict";var i=n.Shared,r;r=i.Views.BaseTileItemView=t.View.extend({name:"BaseTileItemView",className:"tile",template:i.Templates.BaseTileItem,analyticsService:n.Shared.Utils.AnalyticsService,defaults:{lazyLoad:!0,rootUrl:""},ui:{image:"img"},events:{"click a":"onClick"},onClick:function(n){return n&&n.stopPropagation(),t.Events.trigger("navigate",this.navigateUrl()),this.analyticsService.logLibraryCategorySelect({id:this.model.get("id"),name:this.model.get("name"),type:"tile"}),!1},getVideoCount:function(){var n=0;return this.model.videos instanceof t.Collection&&this.model.videos.pagination?n=this.model.videos.pagination.totalItems:this.model.get("videos")&&this.model.get("videos").pagination&&(n=this.model.get("videos").pagination.totalItems),n},getVideoCountText:function(){var n=this.getVideoCount();return n+" video"+(n===1?"":"s")},getSubCategoryCount:function(){var n=this.model.get("categories");if(n&&n.pagination)return n.pagination.totalItems},getSubCategoryCountText:function(){var n=this.getSubCategoryCount();return n?n+" subcategor"+(n===1?"y":"ies"):""},navigateUrl:function(){return this.options.rootUrlTemplate?t.template(this.options.rootUrlTemplate,{categoryId:this.model.get("id"),categoryName:this.model.get("name").slugify()}):_.result(this.options,"rootUrl")+this.model.get("id")+"/"+i.Helpers.Slugify(this.model.get("name"))},onBoarding:function(){return this.model.collection.indexOf(this.model)===0?"category":null},onOnBoardingClosed:function(){this.onClick()},viewOptions:function(){var t=this.model.thumbnail.get("url"),r,n,u;return t||(t=i.Services.CategoryImageService.getThumbnail(this.model.get("name"))),r=new URI(t),r.setQuery("size","medium"),n=this.getVideoCount(),u=this.getSubCategoryCount(),{url:this.navigateUrl(),thumbUrl:r.toString(),videoCountText:this.getVideoCountText(),mediaCount:n,hasMediaAndSubCategories:n&&u,showCount:n||u,lazyLoad:this.options.lazyLoad,subCategoryCount:this.getSubCategoryCountText()}}});i.Views.BaseTileListView=t.ListView.extend({name:"BaseTileListView.js",className:"tile-list partial-loading-view",tagName:"div",loaded:!1,page:0,childView:r,template:i.Templates.BaseTileList,initialize:function(){this.collection.loaded&&this.dataLoaded();this.listenTo(this.collection,"sync",this.dataLoaded);this.listenTo(this.collection,"add",this.itemAdded);this.onScroll=_.bind(_.debounce(this.onScroll,333),this);$(document).on("scroll",this.onScroll)},_resetClassName:function(){this.$el.attr("class",_.result(this,"className"))},onScroll:function(){var n=$(window);n.scrollTop()+n.height()>$(document).height()-100&&(this.options.virtualPaging?(this.page++,this.renderItems()):this.collection.getNextPage({remove:!1}))},dataLoaded:function(){this.loaded||(this.virtualPaging&&(this.collection=this.collection.toFlat()),this.loaded=!0,this.trigger("swap"))},itemAdded:function(n){this._firstRender||this.onFirstRender();var t=this.buildChildView(n);this.renderView(this.$el,t,{empty:!1});this.lazyLoad()},renderItems:function(){this.options.virtualPaging?_.each(_.chain(this.collection.models).rest(this.page*25).first(25).value(),this.addOne,this):this.collection instanceof t.Collection?this.collection.each(this.addOne,this):_.each(this.collection,this.addOne,this)},onBeforeRender:function(){return this.loaded?!0:(this.collection.hasFetched()||this.collection.fetch(),!0)},onFirstRender:function(){this.$el.empty();this.$el.removeClass("partial-loading-view");this._firstRender=!0},onRender:function(){this.collection.length&&this.onFirstRender()},onRendered:function(){t.Events.trigger("start-categories-onboarding");this.lazyLoad()},lazyLoad:function(){if(this._lazyLoad){this._lazyLoad.update();return}this._lazyLoad=new LazyLoad({elements_selector:".lazy"})},destroyLazyLoad:function(){this._lazyLoad&&this._lazyLoad.destroy()},onClose:function(){$(document).off("scroll",this.onScroll);this.destroyLazyLoad()}})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.Shared;i.Views.CallToActionView=t.View.extend({name:"CallToAction",tagName:"div",template:n.Shared.Templates.CallToAction,defaults:{buttonText:"Try it now!",htmlText:!1},ui:{ctaImage:".cta-popup-img",ctaText:".cta-popup-text",ctaButton:".cta-btn"},events:{"click .cta-btn":"callToAction","click .dont-show-label":"clickDontShowAgain"},initialize:function(){this.options.action&&(this.action=this.options.action,delete this.options.action);this.listenToOnce(this,"close",this.closePopup)},viewOptions:function(){var n=_.extend({},this.options);return n.view&&n.view instanceof t.View&&(n.content=n.view.render().el.outerHTML),n},closePopup:function(){this.options.analyticsName&&n.Shared.Utils.AnalyticsService.logCampaignAbandon(this.options.analyticsName,new Date-this.timerStart)},callToAction:function(){_.isFunction(this.action)&&(this.action.apply(this,arguments),this.options.analyticsName&&n.Shared.Utils.AnalyticsService.logCampaignConvert(this.options.analyticsName,new Date-this.timerStart));this.options.userOptionId&&n.Shared.Utils.AjaxHelper.get("/calltoaction/"+this.options.userOptionId)},clickDontShowAgain:function(){this.options.userOptionId&&n.Shared.Utils.AjaxHelper.get("/calltoaction/"+this.options.userOptionId);this.trigger("close")},onRender:function(){this.options.htmlText&&(this.ui.ctaText.text(""),this.ui.ctaText.append(this.options.text));this.options.analyticsName&&(this.timerStart=new Date)}})}(ClickView,EasyMoney),function(n,t){"use strict";n.Views.CheckBoxView=t.View.extend({name:"CheckBoxView.js",template:ClickView.Shared.Templates.CheckBox,className:"checkbox-view",defaults:{type:"check",correct:!1,check:!0,toggleableAttribute:"selected",colour:"green",enabled:!0},events:{click:"toggleCorrect"},initialize:function(){var n="change:"+this.options.toggleableAttribute;this.listenTo(this.model,n,this.render)},viewOptions:function(){return{type:this.options.type,correct:this.model.get(this.options.toggleableAttribute),check:this.options.check,colour:this.options.colour,enabled:this.options.enabled?"enabled":"disabled"}},toggleCorrect:function(){this.options.enabled&&(this.model.toggle(this.options.toggleableAttribute),window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty())}})}(ClickView.Shared,EasyMoney,_),function(n,t){"use strict";n.Shared.Views.ContentLicenceView=t.View.extend({name:"ContentLicenceView",template:n.Shared.Templates.ContentLicence,id:"content-licence",defaults:{licence:{company:"",licenceText:""}},initialize:function(){this.licence=this.options.licence},getModel:function(){return this.licence},onBeforeRender:function(){if(!this.licence.company)return!1},onRender:function(){this.$el.addClass(this.licence.company.replace(" ","").toLowerCase())}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Views.ContributorInfoView=t.View.extend({template:i.Templates.ContributorInfo,className:"info-item",defaults:{label:!1,contributedByText:"Contributed"},ui:{timestamp:"time.timeago",badge:".verified-badge"},formatContributorName:function(n){return n?n.name&&n.surname?(n.name+" "+n.surname.substring(0,1)).toTitleCase():n.name?n.name.split(" ")[0]:"":""},viewOptions:function(){var n=this.model.get("owner"),i=n&&_.isFunction(n.get)&&n.get("organisation");return n instanceof t.Model&&(n=n.toJSON()),i instanceof t.Model&&(i=i.toJSON()),{options:this.options,owner:n,organisation:i,dateCreated:this.model.get("dateCreated"),ownerName:this.formatContributorName(n),label:this.options.label,contributedByText:this.options.contributedByText}},renderTooltip:function(){this.ui.badge.tooltip()},onRender:function(){this.renderTooltip()}})}(ClickView,EasyMoney),function(n,t){"use strict";n.Shared.Views.CurriculumTabView=t.View.extend({name:"CurriculumTabView",model:n.Shared.Models.Video,template:n.Shared.Templates.CurriculumTab,className:"curriculum-container",_ownerLibraryId:null,_learningAreaType:null,_iframeLoaded:!1,ui:{iframe:"iframe"},initialize:function(){this.currentUser=n.Data.User;this.config=n.Data.Config;this.ajaxHelper=n.Shared.Utils.AjaxHelper;this.getLibraryId()},getLibraryId:function(){this.model.isOnlineLibraryVideo()?this.getLibraryOwnerId():this.getLibraryIds()},getLibraryIds:function(){this._libraryIds=this.model.getLibraryIds();this._learningAreaType=n.Data.AlbertLearningAreaType.type.toLowerCase();this.isRendered()&&this.render()},getLibraryOwnerId:function(){var t="/api/curriuclum/videos/"+this.model.get("trackingCode")+"/owner";return this.ajaxHelper.get(t).done(_.bind(function(t){this._ownerLibraryId=t.libraryOwnerId;this._learningAreaType=n.Data.AlbertLearningAreaType.type.toLowerCase();this.isRendered()&&this.render()},this))},getModel:function(){return{url:this.getUrl(),width:930,height:370}},getUrl:function(){var t={width:930,height:370,apiUrl:this.config.urls.curriculumApp,source:this.getSource(),libraryOwnerId:this._ownerLibraryId,libraryIds:this._libraryIds,learningAreaType:this._learningAreaType,username:this.currentUser.username,customerId:this.currentUser.customerId,schoolName:encodeURIComponent(this.currentUser.schoolName),displayName:encodeURIComponent(this.currentUser.displayName),trackingCode:this.model.get("tokenId")},n="{{apiUrl}}/Curriculum?sourceName={{source}}&tokenId={{trackingCode}}&userId={{username}}&userName={{{displayName}}}&schoolName={{{schoolName}}}&width={{width}}&height={{height}}&learningAreaType={{learningAreaType}}";return this.model.isOnlineLibraryVideo()&&(n+="&schoolId={{libraryOwnerId}}"),this.model.isMasterLibraryVideo()&&(_.each(this._libraryIds,function(t){n+="&schoolId="+t}),n+="&masterId="+this.model.get("id")),this.model.isExchangeVideo()&&(n+="&masterId="+this.model.get("id")),this.renderTemplate(n,t)},onBeforeRender:function(){this._iframeLoaded||this.showLoader()},showLoader:function(){var t=new n.Shared.Views.LoaderView({cover:!0});this.renderView(this.$el,t,{empty:!1,childIndex:"loader"})},hideLoader:function(){var n=this.getChildByIndex("loader");n&&n.close()},onRender:function(){var n=this;this.ui.iframe.on("load",function(){n._iframeLoaded=!0;n.hideLoader()})},getSource:function(){return this.model.isLibraryVideo()||this.model.isMasterLibraryVideo()?"MyLibrary":this.model.isExchangeVideo()?"Exchange":this.model.isWorkspaceVideo()?"Workspace":void 0}})}(ClickView,EasyMoney);!function(n,t){var i=n.Shared;i.Views.DownloadPdfView=t.View.extend({name:"DownloadPdfView.js",className:"download-pdf-button-container",template:i.Templates.DownloadPdf,defaults:{requestingPdf:!1},events:{click:"requestPdf"},viewOptions:function(){return{requestingPdf:this.options.requestingPdf}},requestPdf:function(){if(n.Data.User.email){this.sendPdfRequest();return}this.renderVerifyEmail()},sendPdfRequest:function(){var r=this;this.options.requestingPdf=!0;this.render();var t=this.getLibraryCollection(),u="/api/downloads/export-videos-to-email?collectionId="+t.collection.id,f={libraryId:t.library?t.library.id:0,format:"pdf",type:t.type,useremail:n.Data.User.email},e={library:t.library,collection:t.collection,type:t.type};i.Utils.AnalyticsService.logDownloadPdfClick(e);i.Utils.AjaxHelper.post(u,f).done(function(n){r.options.requestingPdf=!1;r.render();n?r.renderSuccessPopup(t):r.renderFailurePopup()})},renderSuccessPopup:function(t){var i={title:"Please check your inbox",content:'<div class="pdf-email-img-container"><img class="pdf-img" src="/Assets/images/icons/pdf-email-filled@2x.png"/><\/div><p>A PDF containing all the videos in <strong>'+t.collection.name+"<\/strong> is being generated. Once it's ready we will send it to <strong>"+n.Data.User.email+"<\/strong>, this can take up to 10 minutes.<\/p>",buttons:[{text:"Ok",className:"btn primary",success:!0}]};n.Utils.Dialog(i)},renderFailurePopup:function(){n.Utils.Dialog({title:"Generating PDF",content:"<p>Oops... Something went wrong. Please try again.<\/p>",buttons:[{text:"Ok",className:"btn primary",success:!0}]})},renderVerifyEmail:function(){var n=new i.Models.UserEmail,t=new i.Views.VerifyEmailView({text:"To ensure you receive PDF file, please verify your email:",model:n,verifyUrl:this.model.get("verifyUrl"),resendUrl:this.model.get("resendUrl"),verifiedConfirmation:"Thank you for verifying!"}),r=new i.Views.PopupView({cssId:"email-confirmation",view:t,title:"Please verify your email"});r.selfRender()},getLibraryCollection:function(){return this.model.get("type")==="series"?{collection:{id:this.model.get("id"),name:this.model.get("name")},type:this.model.get("type")}:{library:{id:this.model.libraries.models[0].get("id"),name:this.model.libraries.models[0].get("name")},collection:{id:this.model.get("id"),name:this.model.get("name")},type:this.model.get("type")}}})}(ClickView,EasyMoney);dd=ClickView.Shared.Views.Dropdown=EasyMoney.View.extend({tagName:"div",className:"cv-dropdown",arrowW:10,template:!1,defaults:{w:200,align:"bottomRight",autoCenter:!1,alignTo:null,alignVerticalToParent:!1,style:"default",theme:"default",closeOn:"body",closeOnEsc:!0,view:null,trigger:"none",delay:1e3,openOnInit:!0,removeOnClose:!0},defaultEvents:{click:"stopPropagation"},initialize:function(){if(this.events=_.extend({},this.defaultEvents,this.events||{}),this.isOpen=!1,this.options.renderTo){if(!this.options.view)return console.error("Dropdown.js: You don’t have a view to load in the dropdown"),!1}else return console.error('Dropdown.js: You need to specify an element to "renderTo"'),!1;if(this.options.closeOn=="body"){$(document.body).on("click.cvdropdown",_.bind(this.deferClose,this));this.$el.on("click",_.bind(this.stopDeferClose,this))}if(this.options.closeOnEsc)$(document.body).on("keyup.cvdropdown",_.bind(this.closeOnEsc,this));if(this.options.trigger==="delay"&&this.bindDelayedTrigger(),this.options.trigger==="hover")this.bindHoverTrigger();else if(this.options.trigger!=="none")this.options.renderTo.on(this.options.trigger,_.bind(this.toggle,this));this.setup();this.on("dropdown:opened",this.render,this);this.view.on("dropdown:close",this.closeDropdown,this);this.view.on("dropdown:open",this.open,this);(this.options.trigger==="none"||this.options.openOnInit)&&_.defer(_.bind(this.open,this))},removeDropdown:function(){this.unbindTrigger();this.off("dropdown:opened",this.render,this);this.view.off("dropdown:close",this.closeDropdown,this);this.view.off("dropdown:open",this.open,this);this.$el.remove();this.options.renderTo.data("dropdown",null)},unbindTrigger:function(){this.options.closeOn=="body"&&$(document.body).off("click.cvdropdown");this.options.closeOnEsc&&$(document.body).off("keyup.cvdropdown");this.options.trigger==="delay"&&this.unbindDelayedTrigger();this.options.trigger==="hover"?this.unbindHoverTrigger():this.options.trigger!=="none"&&this.options.renderTo.unbind(this.options.trigger,this.toggle.bind(this))},bindHoverTrigger:function(){this.options.renderTo.bind("mouseenter",this.open.bind(this));this.options.renderTo.bind("mouseleave",this.delayEnd.bind(this))},unbindHoverTrigger:function(){this.options.renderTo.unbind("mouseenter",this.open.bind(this));this.options.renderTo.unbind("mouseleave",this.delayEnd.bind(this))},bindDelayedTrigger:function(){this.options.renderTo.bind("mouseenter",this.delayStart.bind(this));this.options.renderTo.bind("mouseleave",this.delayEnd.bind(this))},unbindDelayedTrigger:function(){this.options.renderTo.unbind("mouseenter",this.delayStart.bind(this));this.options.renderTo.unbind("mouseleave",this.delayEnd.bind(this))},delayStart:function(){clearTimeout(this.closeTimeout);this.delayTimeout=setTimeout(this.open.bind(this),this.options.delay)},delayEnd:function(){clearTimeout(this.delayTimeout);this.closeTimeout=setTimeout(this.closeDropdown.bind(this),300)},setup:function(){this.$el.appendTo(this.options.renderTo);this.$el.width(this.options.w+"px");this.$el.addClass("align-"+this.options.align);this.$el.addClass("style-"+this.options.style);this.$el.addClass("theme-"+this.options.theme);this.view=this.options.view},onRender:function(){this.renderView(this.$el,this.view)},stopPropagation:function(n){n.stopPropagation();n.stopImmediatePropagation();n.preventDefault()},toggle:function(n){this.isOpen!==!0?this.open(n):this.closeDropdown(n)},open:function(n){(clearTimeout(this.closeTimeout),clearTimeout(this.deferCloseTimeout),n&&n.stopPropagation(),this.isOpen)||(this.isOpen=!0,this.options.renderTo.addClass("dropdown-open"),this.$el.addClass("open"),this.trigger("dropdown:opened"),this.view.trigger("dropdown:opened"),this.adjustPosition())},onBeforeClose:function(n){this.closeDropdown(n)},closeDropdown:function(){this.isOpen&&(this.isOpen=!1,this.options.renderTo.removeClass("dropdown-open"),this.$el.removeClass("open"),this.trigger("dropdown:closed"),this.view.trigger("dropdown:closed"),(this.options.trigger==="none"||this.options.removeOnClose)&&this.removeDropdown())},closeOnEsc:function(n){n.which==27&&this.deferClose()},deferClose:function(){this.deferCloseTimeout=setTimeout(_.bind(this.closeDropdown,this),0)},stopDeferClose:function(){clearTimeout(this.deferCloseTimeout)},adjustPosition:function(){this.options.align==="left"||this.options.align==="right"?this.alignVerticalMiddle():this.options.align==="top"||this.options.align==="bottom"?this.alignHorizontalMiddle():this.options.align==="auto"?this.autoAlign():this.autoCenter();this.options.alignVerticalToParent&&(this.el.style.top=this.options.renderTo[0].offsetTop)},alignVerticalMiddle:function(){var n=this.$el.outerHeight();this.$el.css({top:"50%",marginTop:"-"+n/2+"px"})},alignHorizontalMiddle:function(){var n=this.$el.outerWidth();this.$el.css({left:"50%",marginLeft:"-"+n/2+"px"})},autoAlign:function(){this.align&&this.$el.removeClass("align-"+this.align);var t=this.rightDist(),i=this.bottomDist(),n="bottomRight";t<0&&i<0?n="topLeft":t<0?n="bottomLeft":i<0&&(n="topRight");this.align=n;this.$el.addClass("align-"+n);this.autoCenter()},rightDist:function(){return window.innerWidth-this.el.getBoundingClientRect().right},bottomDist:function(){return window.innerHeight-this.el.getBoundingClientRect().bottom},autoCenter:function(){var t=this.options.renderTo,n={left:0,top:0},u,i,r;if(this.options.alignTo&&(t=this.options.alignTo,n=t.position()),u=n.top+t.outerHeight(),i=n.left,this.options.align=="bottomLeft"&&(i=n.left-this.$el.outerWidth()+t.outerWidth()),this.options.autoCenter!==!0){this.$el.css({left:i,top:u,position:"absolute"});return}r=-8+t.outerWidth()/2-this.arrowW/2+"px";this.el.style.removeProperty("left");this.el.style.removeProperty("right");/Left$/.test(this.align)?this.$el.css("right",r+n.left):this.$el.css("left",r+n.left)}});$.fn.cvDropdown=function(n,t){return t=t||{},this.each(function(){var i=$(this).data("dropdown"),r;if(i){i.close();return}r=new dd(_.extend({renderTo:$(this),view:n},t));$(this).data("dropdown",r)})},function(n,t,i){"use strict";n.Views.EditTabView=i.View.extend({name:"EditTabView",id:"edit-tab",model:ClickView.Shared.Models.Video,template:n.Templates.EditTab,_canEdit:!1,_loaded:!1,_reason:"This video cannot be edited",initialize:function(){this.config=ClickView.Data.Config;this.checkEditable()},ui:{container:".button-container"},checkEditable:function(){var n=this;ClickView.Shared.Utils.AjaxHelper.get("/Ajax/CanEdit/",{tokenId:this.model.get("tokenId")}).success(function(t){t&&(n._reason=t.message,n._canEdit=!!t.success)}).done(function(){n._loaded=!0;n.render()})},getModel:function(){return{editorUrl:this.config.urls.cloudEditor+"/edit/video/"+this.model.get("tokenId"),loaded:this._loaded,canEdit:this._canEdit,editReason:this._reason}},renderLoader:function(){this.renderView(this.$el,new t.Views.LoaderView({loadingText:"Checking if video can be edited"}),{empty:!1})},onRender:function(){this._loaded||this.renderLoader()}})}(ClickView.Shared,ClickView.Shared,EasyMoney),function(n){"use strict";n.Views.EditResultView=EasyMoney.View.extend({className:function(){return"edit-result-view "+this.options.title+"-content"},defaults:{title:"title",template:!1,container:!1},template:function(){return this.options.template.apply(this,arguments)},renderTooltip:function(){this.$el.tooltip({placement:"bottom",delay:333,title:"Edit "+this.options.title,container:this.options.container})},onRender:function(){this.renderTooltip()},onClose:function(){this.$el.tooltip("destroy")}});n.Views.EditView=EasyMoney.View.extend({template:n.Templates.Edit,className:function(){var n="edit-view";return this.options.title&&(n=n+" "+this.options.title+"-content"),n},defaults:{textArea:!1,property:"name",adjustWidth:!0,adjustHeight:!0},bindings:{},viewOptions:{property:function(){return this.options.property},textArea:function(){return this.options.textArea}},initialize:function(){this._initialValue=this.model.get(this.options.property);this.ui[this.options.property]="."+this.options.property;this.bindings["."+this.options.property]={observe:this.options.property,onSet:ClickView.Shared.Helpers.StripHTML};this.listenTo(this.model,"sync",this.close);this.listenTo(this.model,"change:"+this.options.property,this.setWidth);this.listenTo(this.model,"change:"+this.options.property,this.setHeight)},focusInput:function(){this.ui[this.options.property].get(0).focus()},onClick:function(n){!this.$el.has(n.target).length>0&&this.trySave()},onKeydown:function(n){switch(n.keyCode){case 27:this.revert();break;case 13:n.shiftKey||this.trySave()}},bindEvents:function(){var n=this.cid,t=this.onClick.bind(this);$(window).bind("keydown."+n,this.onKeydown.bind(this));setTimeout(function(){$(window).bind("click."+n,t)},333)},unbindEvents:function(){$(window).unbind("click."+this.cid);$(window).unbind("keydown."+this.cid)},newValueIsValid:function(n){return/^\s+$/.test(n)||/^[^\w]+$/.test(n)?!1:!0},trySave:function(){var n=this.model.get(this.options.property);n&&this.newValueIsValid(n)||this.revert();n!==this._initialValue&&this.model.save();this.close()},revert:function(){this.model.set(this.options.property,this._initialValue);this.close()},fakeDiv:function(){return this.$fakeDiv||(this.$fakeDiv=this.initFakeElement("div"))},fakeSpan:function(){return this.$fakeSpan||(this.$fakeSpan=this.initFakeElement("span"))},initFakeElement:function(n){var t=this.ui[this.options.property],i=$("<"+n+">").hide();return i.css({"font-size":t.css("font-size"),"font-family":t.css("font-family"),"font-weight":t.css("font-weight")}),i.appendTo(document.body),i},padding:function(){var n=this.ui[this.options.property];return n.outerHeight(!0)-n.innerHeight()},textWidth:function(){var n="&nbsp",t=this.ui[this.options.property],i=t.val().replace(/ /g,n);return this.fakeSpan().html(i||n).width()+this.padding()},textHeight:function(){var n="<br>",t=this.ui[this.options.property],i=t.val().replace(/\n/g,n);return this.fakeDiv().html(i||n).width(this.$el.width()-this.padding()).height()},setWidth:function(){var n,t,i;this.options.adjustWidth&&(n=this.textWidth(),this.options.property==="description"&&(n+=30),t=this.$el.parent().width(),i=Math.min(n,t),this.ui[this.options.property].outerWidth(i))},setHeight:function(){if(this.options.adjustHeight&&this.options.textArea){var n=this.textHeight();this.ui[this.options.property].height(n)}},removeFakeElements:function(){!this.$fakeDiv||this.$fakeDiv.remove();!this.$fakeSpan||this.$fakeSpan.remove()},onRender:function(){this.stickit()},onRendered:function(){this.setWidth();this.setHeight();this.bindEvents();this.focusInput()},onClose:function(){this.unbindEvents();this.removeFakeElements()}})}(ClickView.Shared);!function(n,t){"use strict";n.Views.EmptyStateView=t.View.extend({template:n.Templates.EmptyState,className:"empty-state",events:{"click .go-to":"onClick","click .go-to-secondary":"onClickSecondary"},defaults:{textBeforeImage:!0,buttonSize:"large"},viewOptions:function(){return{button:this.options.buttonText,secondaryButton:this.options.secondaryButtonText}},onClick:function(n){return(n.preventDefault(),this.options.callback&&typeof this.options.callback=="function")?(this.options.callback(),!1):(t.Events.trigger("navigate",this.options.buttonUrl),!1)},onClickSecondary:function(n){return(n.preventDefault(),this.options.secondaryCallback&&typeof this.options.secondaryCallback=="function")?(this.options.secondaryCallback(),!1):(t.Events.trigger("navigate",this.options.secondaryButtonUrl),!1)}})}(ClickView.Shared,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Views.ErrorView=t.View.extend({template:i.Templates.Error,className:"js-error-view",defaults:{heading:"Error",message:"Something went wrong.",imageUrl:"/Assets/images/error/albert-error@2x.png"},viewOptions:function(){return this.options}})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.Shared;n.Shared.Views.ExchangeLandingBannerItemView=t.View.extend({className:"slide",name:"Landing Banner Item View",model:i.Models.BannerItem,template:n.Shared.Templates.ExchangeLandingBannerItem,events:{"click a":"onClick"},onClick:function(n){var r=$(n.currentTarget),i;return Backbone.history.trigger("userAction",this.model.get("title"),"bannerClick"),r&&(i=r.attr("href"),i&&this.options.onController)?(t.Events.trigger("navigate",i),!1):void 0},viewOptions:function(){var n="/exchange/videos/"+this.model.get("id");return i.Helpers.isNumeric(this.model.get("id"))&&(n+="/"+i.Helpers.Slugify(this.model.get("title"))),{href:n}},onRender:function(){this.$el.data("name",this.model.get("title"))}})}(ClickView,EasyMoney),function(n){"use strict";n.Views.ExchangeLandingBannerView=EasyMoney.View.extend({name:"Landing Banner View",tagName:"div",className:"picks-banner-container",childView:n.Views.ExchangeLandingBannerItemView,template:n.Templates.ExchangeLandingBannerView,loaded:!1,slider:null,defaults:{delay:15e3,onController:!0},ui:{slider:".banner-slider",progressBar:".progress-bar",pagination:".packs-pagination"},initialize:function(){this.loaded=!1;this.listenTo(this.collection,"sync",this.onLoad)},addSlide:function(n){this.renderView(this.ui.slider,new this.childView({model:n,onController:this.options.onController}),{empty:!1})},onLoad:function(){this.loaded=!0;this.render()},onBeforeRender:function(){if(!this.loaded)return this.renderLoader(),!1},onRender:function(){this.collection.length||this.$el.hide();this.collection.each(this.addSlide,this);this.createSlider()},renderLoader:function(){this.$el.html("<div class='loader'><p>Loading...<\/p><\/div>")},createSlider:function(){this.collection.length!=0&&(this.slider=this.ui.slider.pSlider({delay:this.options.delay,width:"100%",height:"100%",paginationDots:!1,progress:!1,paginationContainer:this.ui.pagination}))},onBeforeClose:function(){this.slider&&this.slider.destroy()}})}(ClickView.Shared),function(n,t){"use strict";var i,r,u,f;i=t.Model.extend({defaults:{id:0,cssId:"",text:""}});n.Shared.Collections.ReasonCollection=r=t.Collection.extend({model:i});f=t.View.extend({name:"FlagVideoReasonItemView",className:"form-row inner",template:'<input id="{{cssId}}" type="radio" value="{{id}}" class="reason" name="reason"><label class="inline thin" for="{{cssId}}" name="reason">{{text}}<\/label>',tagName:"div",model:i});u=t.ListView.extend({name:"FlagVideoReasonView",className:"reasons",template:!1,tagName:"div",childView:f});n.Shared.Views.FlagVideoView=t.View.extend({name:"FlagVideoView",className:function(){return"cv-flag-video"+(this.options.popup?" popup-view":"")},template:n.Shared.Templates.FlagVideo,model:n.Shared.Models.Video,defaults:{showTitle:!0},bindings:{"[name=reason]":{observe:"reason",onSet:function(n){return this.hideError(),n}},"[name=complaint-comments]":{observe:"comment",onSet:function(t){return this.hideError(),n.Shared.Helpers.StripHTML(t)}}},events:{"click #submit-complaint":"onSubmit","click #cancel-button":"close"},ui:{$reasonsViewpart:".reasons-viewpart",$complaintTextarea:"#complaint-comments",$reasonErrorMesssage:".reasons-error"},initialize:function(){this.collection=new r(n.Shared.Helpers.GetFlaggingReasons());this.flagVideoModel=new t.Model},onSubmit:function(){if(!this.flagVideoModel.get("reason")){this.showError("Please select a reason");return}var t=this.collection.get(this.flagVideoModel.get("reason"));if(t&&t.get("text")==="Other"&&!this.flagVideoModel.get("comment")){this.showError("Please provide a comment as to why you are flagging this video");return}n.Shared.Utils.AjaxHelper.post(this.getUrl(),this.getData()).success(_.bind(this.onSuccess,this)).error(_.bind(this.onError,this))},onSuccess:function(n){if(!n.success){this.showError("Something went wrong, please try again");return}this.$el.html('<div class="success-flag"><h3>Thank you, an administrator has been notified<\/h3><\/div>')},onError:function(){this.showError("Something went wrong, please try again")},getUrl:function(){return this.model.isWorkspaceVideo()?"/api/workspace/flag":this.model.isExchangeVideo()?"/api/exchange/flag/freetoair":""},getData:function(){return{id:this.model.get("id"),comment:this.flagVideoModel.get("comment"),reason:this.collection.get(this.flagVideoModel.get("reason")).get("flagReason")}},showError:function(n){this.ui.$reasonErrorMesssage.find("p").text(n);this.ui.$reasonErrorMesssage.show()},hideError:function(){this.ui.$reasonErrorMesssage.hide()},viewOptions:{showTitle:function(){return this.options.showTitle}},renderReasons:function(){var n=new u({collection:this.collection});this.renderView(this.ui.$reasonsViewpart,n)},onRender:function(){this.renderReasons();this.stickit(this.flagVideoModel)},onClose:function(){this.unstickit(this.flagVideoModel)}})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.Shared,r,u,f,e;r=t.Model.extend({defaults:{id:0,cssId:"",text:""}});i.Collections.InputOptionCollection=u=t.Collection.extend({model:r});e=t.View.extend({name:"InputItemView",className:"form-row inner",template:i.Templates.InputItemView,tagName:"div",model:r,defaults:{inputType:"radio",inputName:"inputName",inputClass:"input-class",label:!0,labelName:"labelName"},viewOptions:function(){return _.extend({},this.options,{id:this.model.get("id"),cssId:this.model.get("cssId")})}});f=t.ListView.extend({name:"RadioListView",className:"radio-list",template:!1,tagName:"div",childView:e});i.Views.FormInputView=t.View.extend({name:"FormInputView.js",template:i.Templates.FormInputView,className:function(){return this.options.className||"cv-form-input"},defaults:{title:"title",inputType:"radio",inputName:"inputName"},ui:{$inputListViewpart:".input-list-viewpart"},initialize:function(){!this.options.collection||this.options.collection instanceof u||this.throwError("Please ensure your collection is an InputOptionCollection when instantiating "+this.name);!this.collection&&this.options.inputList&&(this.collection=new u(this.options.inputList));this.model||(this.model=new t.Model);this.typeIsCheckbox();this.handleValidation()},typeIsCheckbox:function(){this.options.inputType&&this.options.inputType.toLowerCase()!=="checkbox"||(this.options.checkboxValues||this.throwError("Array of values required to map against each checkbox"),this.model.set(this.options.observeAttr||"selected",this.options.checkboxValues))},handleValidation:function(){this.options.shouldValidate&&(this.model.validation[this.options.observeAttr]={required:!0})},stickItBindings:function(){var n=this.options.inputName||"selected",t={};return t["[name="+n+"]"]={observe:this.options.observeAttr||n,onSet:function(n){console.log(n)},setOptions:{validate:this.options.shouldVlidate}},t},throwError:function(n){throw new Error(n);},viewOptions:function(){return this.options},renderInputList:function(){var n=new f({collection:this.collection,model:this.model,inputType:this.options.inputType,inputName:this.options.observeAttr});this.renderView(this.ui.$inputListViewpart,n)},onRender:function(){this.renderInputList();this.stickit(this.model,this.stickItBindings())},onClose:function(){this.unstickit()}})}(ClickView,EasyMoney),function(n,t){n.FormSchema={};n.FormSchema.InputTypes={email:"email",text:"text",checkbox:"checkbox"};n.FormSchema.ControlTypes={select:"select",input:"input",textarea:"textarea"};n.Views.FormView=t.View.extend({className:"form-view",template:"<form><\/form>",ui:{$form:"form"},defaults:{button:{text:"Submit",cssClass:"orange"},schema:[{label:"First name",attribute:"name",cssClass:"input large",required:!0,type:n.FormSchema.ControlTypes.input,input:{type:n.FormSchema.InputTypes.text,placeholder:"Name"}},{label:"Email",attribute:"email",cssClass:"input large",required:!0,type:n.FormSchema.ControlTypes.input,input:{type:n.FormSchema.InputTypes.email,placeholder:"Email"}},{label:"Who rules the Internet?",attribute:"whoRules",required:!0,type:n.FormSchema.ControlTypes.select,select:{collection:[{value:1,label:"Cats"},{value:2,label:"Dogs"}],defaultOption:{label:"Choose one...",value:null},labelPath:"label",valuePath:"value"}}]},events:{"submit form":"submit"},bindings:{},submit:function(n){n.preventDefault();this.model.trigger("submit")},parse:function(n){if(n.length){var t=n.shift(),i='<div class="form-row">'+(t.label?"<label>"+t.label+"<\/label>":"")+this.htmlSwitch(t)+"<\/div>";this.ui.$form.append(i);this.bindings["."+t.attribute]=this.bindingSwitch(t);this.parse(n)}else this.ui.$form.append('<div class="form-row"><button type="submit" class="btn '+this.options.button.cssClass+'">'+this.options.button.text+"<\/button><\/div>")},htmlSwitch:function(t){var i=t.required?" required":"",r=t.attribute+(t.cssClass?" "+t.cssClass:"");switch(t.type){case n.FormSchema.ControlTypes.input:return this.inputHtml(t,r,i);case n.FormSchema.ControlTypes.textarea:return this.textareaHtml(t,r,i);case n.FormSchema.ControlTypes.select:return this.selectHtml(t,r,i);default:return null}},bindingSwitch:function(t){switch(t.type){case n.FormSchema.ControlTypes.input:case n.FormSchema.ControlTypes.textarea:return this.inputBinding(t);case n.FormSchema.ControlTypes.select:return this.selectBinding(t);default:return null}},selectHtml:function(n,t,i){return"<"+n.type+' class="'+t+'"'+i+"><\/"+n.type+">"},inputHtml:function(n,t,i){return"<"+n.type+' class="'+t+'" type="'+n.input.type+'"'+(n.input.placeholder?' placeholder="'+n.input.placeholder+'"':"")+i+" />"},textareaHtml:function(n,t,i){return"<"+n.type+' class="'+t+'"'+(n.textarea.placeholder?' placeholder="'+n.textarea.placeholder+'"':"")+i+"><\/"+n.type+">"},selectBinding:function(n){return{observe:n.attribute,selectOptions:{labelPath:n.select.labelPath||"label",valuePath:n.select.valuePath||"value",defaultOption:n.select.defaultOption,collection:function(){return n.select.collection}}}},inputBinding:function(n){return n.attribute},onRender:function(){this.parse(this.options.schema.slice(0));this.stickit()}})}(ClickView.Shared,EasyMoney);!function(n,t){"use strict";var i=n.Shared,r;i.Views.HorizontalPartialLoadingView=r=t.View.extend({name:"HorizontalPartialLoadingView",template:i.Templates.HorizontalPartialLoading,className:"partial-loading-view",ui:{$partialSlideContainer:".partial-slide-container"},onRender:function(){this.renderView(this.ui.$partialSlideContainer,new this.options.slidingListView({heading:!1,small:!0,partialLoading:!0,collection:new t.Collection([{},{},{},{}]),forPartialLoading:!0}))}});i.Views.HorizontalListView=t.View.extend({template:i.Templates.HorizontalListView,className:"horizontal-list-view",defaults:{heading:"Videos",small:!0,shouldFetch:!0,listActionUrl:!1,hidesLessThanColumnCount:!0},ui:{slideContainer:".slide-container-small"},initialize:function(){this.slidingListView=this.options.slidingListView||i.Views.SlidingListView;this.listenTo(this.collection,"sync",this.onSync);this.listenTo(this.collection,"error",this.close)},onSync:function(){if(!this.collection.length){this.close();return}this.render()},renderPartialLoading:function(){var n=new r({slidingListView:this.slidingListView});this.renderView(this.$el,n)},getSlides:function(){return this.collection.getSlides()},onBeforeRender:function(){return!this.collection.hasFetched()&&this.options.shouldFetch?(this.options.fetchOptions?this.collection.fetch(this.options.fetchOptions):this.collection.fetch(),this.renderPartialLoading(),!1):!0},onRender:function(){var n=this.options.totalItems;!n&&this.collection instanceof t.PagedCollection&&(n=this.collection.totalItems());n=_.isNumber(n)?n:this.collection.length;this.renderView(this.$el,new this.slidingListView(_.extend({},this.options.slideOptions,{type:this.options.type,heading:this.options.heading,listActionUrl:this.options.listActionUrl,small:this.options.small,collection:this.getSlides(),totalItems:n,hidesLessThanColumnCount:this.options.hidesLessThanColumnCount})))}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared,f=t.View.extend({template:'<div class="cropper-view"><img src="{{base64image}}" /><\/div><div class="popup-button-container"><a class="btn orange save">Crop<\/a><a class="btn gray cancel">Cancel<\/a><\/div>',className:"cropper-view-container",ui:{img:"img"},events:{"click .save":"crop","click .cancel":"cancel"},crop:function(){var n=this.ui.img.cropper("getCroppedCanvas");this.close();typeof this.options.onCrop=="function"&&this.options.onCrop(n.toDataURL(this.options.mimeType))},cancel:function(){typeof this.options.onCancel=="function"&&this.options.onCancel();this.close()},onRendered:function(){this.ui.img.cropper({autoCropArea:1,aspectRatio:this.options.aspectRatio||NaN,minCropBoxWidth:this.options.minWidth,minCropBoxHeight:this.options.minHeigth})}}),r=105,u=30,e=n.Shared.Views.PopupView.extend({resize:function(){var i=this.options.width/this.options.height,n,t,f=(this.options.width+u)/window.innerWidth>(this.options.height+r)/window.innerHeight;this.options.width+u>window.innerWidth||this.options.height+r>window.innerHeight?f?(n=window.innerWidth*.8,t=n/i):(t=window.innerHeight*.8,n=t*i):(n=this.options.width,t=this.options.height);n<256&&(n=256);t<144&&(t=144);this.$el.width(n+u);this.$el.height(t+r);this.position()},onRender:function(){this.resize();n.Shared.Views.PopupView.prototype.onRender.apply(this,arguments)}});i.Views.ImageCroppingSelectView=t.View.extend({template:i.Templates.ImageCroppingSelect,className:function(){return"drop-area "+(this.options.aspectRatio?"has-ratio ":"")+(this.options.url?"":"selecting")},defaults:{text:"Drag and drop an image here or",buttonText:"Browse",buttonClasses:"btn gray",imageTypes:"image/jpg,image/jpeg,image/png",maxWidth:1920,maxHeight:1080,editable:!0},ui:{input:"input"},attributes:function(){return this.options.aspectRatio?{style:"padding-bottom:"+100/this.options.aspectRatio+"%;"}:null},events:{drop:"onDrop",dragover:"dragEnter",dragenter:"stopPropagation",dragleave:"dragLeave",dragexit:"dragExit","click span":"onClick","change input":"onFileSelect","click .change-image-banner-container":"onClick"},initialize:function(){this.parentCid=this.options.parentCid||""},onClick:function(n){return this.ui.input.val(""),this.ui.input.click(),this.stopPropagation(n)},renderLoader:function(){this._spinView=new i.Views.SpinJsView({cover:!0,mask:!0});this.renderView(this.$el,this._spinView,{empty:!1})},stopPropagation:function(n){return n.preventDefault(),n.stopPropagation(),!1},dragEnter:function(n){this.stopPropagation(n);this.$el.addClass("drag-over")},dragLeave:function(n){n&&this.stopPropagation(n);this.$el.removeClass("drag-over")},dragExit:function(n){this.stopPropagation(n);this.$el.removeClass("drag-over")},onDrop:function(n){if(this.stopPropagation(n),n.originalEvent&&n.originalEvent.dataTransfer&&n.originalEvent.dataTransfer.files.length>0){var i=n.originalEvent.dataTransfer.files[0].type;this.isValidMimeType(i)?(this._mimeType=i,this.openCropper(n.originalEvent.dataTransfer.files[0],this._mimeType)):t.Events.trigger("image-cropper-invalid-mimetype"+this.parentCid,this.options.imageTypes)}},onFileSelect:function(){if(this.ui.input[0].files.length){var n=this.ui.input[0].files[0].type;this.isValidMimeType(n)?(this._mimeType=n,this.openCropper(this.ui.input[0].files[0])):t.Events.trigger("image-cropper-invalid-mimetype"+this.parentCid,this.options.imageTypes)}},isValidMimeType:function(n){var t=this.options.imageTypes.split(",");return _.contains(t,n)},scaleDownImage:function(n,t){var u=document.createElement("canvas"),f=u.getContext("2d"),i=n.width,r=n.height;i>r?(r=this.options.maxWidth/i*r,i=this.options.maxWidth):(i=this.options.maxHeight/r*i,r=this.options.maxHeight);u.width=i;u.height=r;f.drawImage(n,0,0,i,r);t({width:i,height:r,base64Image:u.toDataURL(this._mimeType)})},getImageSize:function(n){var i=new Image,t;i.src=this.reader.result;t=this;i.onload=function(){if(this.width>t.options.maxWidth||this.height>t.options.maxHeight){t.scaleDownImage(this,n);return}n({base64Image:t.reader.result,width:this.width,height:this.height})}},onReaderLoad:function(){var n=this;this.getImageSize(function(i){if(n.options.minHeight&&n.options.minWidth&&(i.height<n.options.minHeight||i.width<n.options.minWidth))return n._spinView.close(),t.Events.trigger("image-cropper-too-small"+n.parentCid),!1;var r=new e({view:new f({base64image:i.base64Image,onCrop:n.options.onCrop,onCancel:n.options.onCancel,mimeType:n._mimeType,minHeight:n.options.minHeight,minWidth:n.options.minWidth,aspectRatio:n.options.aspectRatio}),title:"Resize and crop your image",id:"image-cropper",hide:!1,width:i.width,height:i.height});r.selfRender();n.listenToOnce(r,"popup:closed",n.dragLeave);n._spinView.close()})},openCropper:function(n){this.renderLoader();this.reader=new FileReader;this.reader.addEventListener("load",_.bind(this.onReaderLoad,this));this.reader.readAsDataURL(n)},viewOptions:function(){return{showButton:this.options.showButton,url:this.options.url}}});i.Views.ImageSelectView=t.View.extend({name:"ImageSelectView.js",template:'<div class="image-viewpart"><\/div><div class="error-viewpart">{{errorMessage}}<\/div>',className:function(){return this.options.className},defaults:{editable:!0},events:{"click .change-image-banner-container":"onClick","click .browse":"onClick"},ui:{$imageViewpart:".image-viewpart",errorViewpart:".error-viewpart"},initialize:function(){if(!this.options.imageConfig)throw new Error("Please pass in an image config.");this.listenTo(this.model,"change:url",this.render);this.listenTo(this.model,"change:errorMessage",this.render);this.listenTo(t.Events,"image-cropper-invalid-mimetype"+this.cid,this.onInvalidMimeType);this.listenTo(t.Events,"image-cropper-too-small"+this.cid,this.onTooSmall);this.imageConfig=this.options.imageConfig},onCancel:function(){typeof this.options.onCancel=="function"&&this.options.onCancel()},onCrop:function(n){if(this.model.set("url",n),this.model.unset("errorMessage"),typeof this.options.onCrop=="function")this.options.onCrop(n)},onInvalidMimeType:function(){this.model.set("errorMessage","The image must be a JPG or a PNG file.")},onTooSmall:function(){this.model.set("errorMessage","The photo you provided is too small. It must be at least "+this.imageConfig.MIN_WIDTH+" pixels wide and "+this.imageConfig.MIN_HEIGHT+" pixels high.")},getCropOptions:function(){return{placeholderImage:this.imageConfig.PLACEHOLDER,url:this.model.get("url"),minHeight:this.imageConfig.MIN_HEIGHT,minWidth:this.imageConfig.MIN_WIDTH,aspectRatio:this.imageConfig.ASPECT_RATIO,type:this.imageConfig.TYPE,onCrop:_.bind(this.onCrop,this),onCancel:_.bind(this.onCancel,this),parentCid:this.cid,editable:this.options.editable}},renderImageSelectView:function(){var n=new i.Views.ImageCroppingSelectView(this.getCropOptions());this.renderView(this.ui.$imageViewpart,n)},onRender:function(){this.renderImageSelectView()}})}(ClickView,EasyMoney),function(n,t){"use strict";var i,r,u,f,e;i=t.View.extend({template:n.Shared.Templates.NewInteractiveView,className:"new-interactive-mapping",ui:{input:".new-mapping-input",error:".error"},events:{"click .save":"onSave","keypress .new-mapping-input":"keyDown"},initialize:function(){this.itemModel=this.options.itemModel;this.mappingCollection=this.options.mappingCollection},invalid:function(n){this.ui.error.text(n);this.ui.error.show()},valid:function(){this.ui.error.empty();this.ui.error.hide()},keyDown:function(n){n.which===13&&(this.onSave(),n.stopPropagation(),n.preventDefault())},onSave:function(){var i=this.ui.input.val(),t;if(!i.match(/^[A-Za-z0-9\s\-_,\.;:()]+$/g)||i.length===0){this.invalid("Your interactive video's name cannot be left blank and may only include letters, numbers and spaces");return}this.valid();t=this;n.Shared.Utils.AjaxHelper.post("/api/interactives",{id:this.itemModel.get("interactiveId"),videoId:this.itemModel.get("id"),name:i}).done(function(i){if(!_.isObject(i)||!i.interactiveId){t.invalid("Failed to create Interactive. Please try again");return}var r=new n.Shared.Models.InteractiveVideo(i);t.mappingCollection.add(r);t.mappingCollection.select(r)}).fail(function(){t.invalid("Failed to create Interactive. Please try again")})}});e=t.View.extend({template:'<span class="icon"><\/span> <span class="text">{{name}}<\/div>',tagName:"li",className:"interactive-mapping",events:{click:"onClick"},initialize:function(){this.listenTo(this.model,"change:_selected",this.onSelected)},onSelected:function(){this.model.get("_selected")?this.$el.addClass("selected"):this.$el.removeClass("selected")},onRender:function(){this.onSelected()},onClick:function(){this.model.collection.select(this.model)}});f=t.ListView.extend({childView:e,className:"interactive-mappings",tagName:"div",template:"<ul><\/ul>",ui:{list:"ul"},initialize:function(){this.listenTo(this.collection,"add",this.addOne)},addOne:function(n){this.renderView(this.ui.list,this.buildChildView.call(this,n),{empty:!1})},onRendered:function(){this.$el.mCustomScrollbar({axis:"y",theme:"clickview",scrollInertia:0,mouseWheel:{scrollAmount:40}})}});r=n.Shared.Views.MultiStepStepView.extend({template:n.Shared.Templates.InteractiveShareStep1,showNext:!1,ui:{newMapping:".new-mapping-viewpart",mappingList:".mapping-list-viewpart"},initialize:function(){this.mappingCollection=this.options.mappingCollection;this.itemModel=this.options.itemModel;this.listenTo(this.mappingCollection,"sync",this.render);this.listenTo(this.mappingCollection,"change:_selected",this.onSelected)},onBeforeRender:function(){return this.options.mappingCollection.hasSynced()?!0:(this.renderLoader(),!1)},renderLoader:function(){var t=new n.Shared.Views.LoaderView;this.renderView(this.$el,t)},renderMappings:function(){var n=new f({collection:this.mappingCollection});this.renderView(this.ui.mappingList,n)},renderNewMapping:function(){var n=new i({mappingCollection:this.mappingCollection,itemModel:this.itemModel});this.renderView(this.ui.newMapping,n)},onRender:function(){this.renderNewMapping();this.renderMappings()},onSelected:function(){this.mappingCollection.getSelected()?(this.enableNext(),this.goNext()):this.disableNext()},onShowStep:function(){this.mappingCollection.unselect()},stepComplete:function(){this.mappingCollection.getSelected()&&this.goNext()}});u=n.Shared.Views.MultiStepStepView.extend({template:!1,initialize:function(){this.selectedMapping=this.options.mappingCollection.getSelected()},onRender:function(){this.renderView(this.$el,new n.Shared.Views.InteractiveShareTabView({itemModel:this.selectedMapping}))}});n.Shared.Views.InteractiveShareView=n.Shared.Views.MultiStepView.extend({className:"interactive-share-view",defaults:{lastStepText:"Share"},buttons:[{text:"Close",css:"secondary",eventName:"button:close:click"}],initialize:function(){this.itemModel=this.options.itemModel;this.mappingCollection=new n.Shared.Collections.InteractionMappingCollection([],{videoId:this.itemModel.get("id")});this.mappingCollection.fetch();this.addStep(r,{mappingCollection:this.mappingCollection,itemModel:this.itemModel});this.addStep(u,{mappingCollection:this.mappingCollection});this.listenTo(this.stepModel,"button:close:click",this.close)}})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.Shared;i.Views.InteractiveUnavailableView=t.View.extend({name:"InteractivePageUnavailable",template:n.Shared.Templates.InteractiveUnavailable})}(ClickView,EasyMoney),function(n,t,i){"use strict";n.Views.LibraryListView=i.View.extend({name:"Library List View",videoItemView:null,defaults:{hasSort:!1},template:'<div id="titlebar-viewpart"><\/div><div id="videos-viewpart"><\/div>',ui:{titleBar:"#titlebar-viewpart",videos:"#videos-viewpart"},initialize:function(){this.listenTo(this.collection,"pagechanged",this.onPageChange);this.listenTo(this.collection,"getpage",this.pageLoaded);this.currentUser=ClickView.Data.User},onPageChange:function(n){var t="/"+this.collection.getCategoryId();n>1&&(t+="/"+n);i.Events.trigger("navigate",t,{trigger:!1,controllerAsRoot:!0});window.scrollTo(0,0)},pageLoaded:function(){this.renderTitleBar()},renderVideosView:function(){var n=new ClickView.Shared.Collections.VideoActionCollection(this.getActions()),i=new t.Views.VideoListView({collection:this.collection,actions:n,videoItemView:this.videoItemView,noVideoTemplate:"<p>There are no videos in this category<\/p>"});this.renderView(this.ui.videos,i)},renderTitleBar:function(){var n=this.getTitleBarText(),t;typeof n!="object"&&(n={title:n});t=new ClickView.Shared.Views.TitleBarView(n);this.renderView(this.ui.titleBar,t)},getTitleBarText:function(){var n=this.collection.getCurrentCategory();return n?{title:n.name,subtitle:"("+n.videoCount+" video"+(n.videoCount==1?"":"s")+")"}:{title:""}},viewOptions:function(){return{hasSort:this.options.hasSort}},onRender:function(){this.renderTitleBar();this.renderVideosView()}})}(ClickView.Shared,ClickView.Shared,EasyMoney),function(n,t){"use strict";var i=new t.Model,r,u;n.Shared.Views.LibrarySortingView=t.View.extend({template:'<div class="border-bottom"><h2>{{heading}}<span class="sub-title">{{subtitle}}<\/span><\/h2><div class="btn-group sorting-dropdown"><span class="sort-box-text">Sort by<\/span><a class="dropdown-toggle" data-toggle="dropdown">{{text}}<\/a><\/div><\/div>',className:"sorting-viewpart",defaults:{sortTypes:new t.Collection([{sortOption:"mostpopular",text:"Most Popular"},{sortOption:"mostrecent",text:"Most Recent"},{sortOption:"leastrecent",text:"Least Recent"},{sortOption:"atoz",text:"Title A - Z"},{sortOption:"ztoa",text:"Title Z - A"},{sortOption:"classic",text:"Series, Title A - Z"}])},ui:{sortingDropdown:".sorting-dropdown"},initialize:function(){var i=this.getQueryString()||{},n=i.sort,t;n||(this.sortType=this.options.sortTypes.models[0].toJSON());t=this;this.options.sortTypes.forEach(function(i){n===i.get("sortOption")&&(t.sortType=i.toJSON())});this.bindEvents()},viewOptions:function(){return{text:this.sortType.text,heading:this.options.heading,subtitle:this.options.subtitle}},onBeforeRender:function(){return!!this.collection.length},onRender:function(){this.renderView(this.ui.sortingDropdown,new u({collection:this.options.sortTypes,current:this.sortType}),{empty:!1})},bindEvents:function(){this._eventsBound||(this.listenTo(i,"sortVideo",this.sort),this._eventsBound=!0)},sort:function(n,i){t.Events.trigger("navigate",window.location.pathname+"?"+$.param(n),{trigger:!1});this.collection.setSortOption(n);this.collection.fetch();this.sortType=i;this.render()},getQueryString:function(){var n=window.location.search.substring(1);return n?_.chain(n.split("&")).map(function(n){var t=n.split("=");return[t[0],decodeURIComponent(t[1])]}).object().value():!1}});r=t.View.extend({tagName:"li",template:"<a>{{text}}<\/a>",events:{click:"onClick"},onClick:function(){var n=this.getQueryString()||{};n.sort=this.model.get("sortOption");i.trigger("sortVideo",n,this.model.toJSON())},onBeforeRender:function(){var n=this.model.get("sortOption")===this.options.current.sortOption;return n&&this.$el.hide(),!n},getQueryString:function(){var n=window.location.search.substring(1);return n?_.chain(n.split("&")).map(function(n){var t=n.split("=");return[t[0],decodeURIComponent(t[1])]}).object().value():!1}});u=t.ListView.extend({className:"dropdown-menu",tagName:"ul",childView:r,template:!1})}(ClickView,EasyMoney),function(n,t){"use strict";n.Shared.Views.LoaderView=t.View.extend({name:"LoaderView",template:n.Shared.Templates.LoaderView,className:"cv-loader",defaults:{loadingText:null,mask:!1,cover:!1,imageUrl:"/Assets/images/cv-loader-orange.gif"},getModel:function(){return this.options},onRender:function(){this.options.cover&&this.$el.addClass("cover");this.options.additionalClasses&&this.options.additionalClasses.length>0&&this.$el.addClass(this.options.additionalClasses.join(" "));this.options.mask&&this.$el.find(".loading-mask").fadeIn({duration:300,easing:"easeInOutQuint"})}});n.Shared.Views.LoaderBarView=n.Shared.Views.LoaderView.extend({className:"cv-loader bar",defaults:{loadingText:"Loading...",mask:!0,cover:!0,duration:9e3},_percent:0,_interval:null,ui:{bar:".progress-bar .bar"},template:n.Shared.Templates.LoaderBarView,updateBar:function(n){this.ui.bar.css("width",n+"%")},onClose:function(){clearInterval(this._interval)},startProgress:function(){this._percent=0;var n=this,t=this.options.duration/200;this._interval=setInterval(function(){n._percent+=.5;n.updateBar(n._percent);n._percent>=100&&(n.ui.bar.addClass("progress-striped"),clearInterval(n._interval))},t)},viewOptions:function(){return this.options},onRender:function(){n.Shared.Views.LoaderView.prototype.onRender.apply(this,arguments);this.startProgress()}});n.Shared.Views.ProgressBarView=n.Shared.Views.LoaderView.extend({className:"cv-loader bar",defaults:{loadingText:"Loading...",width:"100%",percent:0,mask:!1,cover:!0,striped:!1},_isInitialized:!1,ui:{bar:".progress-bar .bar",text:".loading-text"},template:n.Shared.Templates.LoaderBarView,update:function(n,t){t&&(this.options.loadingText=t,this.ui.text.text(this.options.loadingText));(n||n==0)&&(this.options.percent=n<=100?n:100,this.ui.bar.css("width",this.options.percent+"%"))},initialize:function(){},onRender:function(){this._isInitialized||(this.options.striped&&this.ui.bar.addClass("progress-striped"),this.update(this.options.percent),this._isInitialized=!0);n.Shared.Views.LoaderView.prototype.onRender.apply(this,arguments)}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Views.MasterVideoItemView=i.Views.VideoListItemView.extend({__super:function(n){return i.Views.VideoListItemView.prototype[n].apply(this,arguments)},className:function(){return this.__super("className")+" isotope-tile-item"},getModel:function(){var n=this.model.channel?this.model.channel.toJSON():null;return _.extend({},this.__super("getModel"),{channel:n})}});i.Views.MasterVideoListView=t.ListView.extend({name:"Programmes ListView",tagName:"div",template:i.Templates.MasterVideoList,className:function(){var n=this.options.tileMode?"tile-list-view":"tile-list-view video-tile-rows";return!this.collection.loaded&&this.options.showPartialLoader&&(n+=" partial-loading-view"),this.options.bulkActions&&(n+=" bulk"),n},_localStorage:n.Shared.Utils.LocalStorageHelper,childView:i.Views.MasterVideoItemView,defaults:{tileMode:!1,bulkActions:!1,showPartialLoader:!0,isLibraryVideo:!1},buildChildView:function(n){return n.set("parentName",this.options.name),new this.childView(_.extend({model:n,allowDownload:this.options.allowDownload,currentUser:this.options.currentUser,isotope:!0,showPreview:this.canPreview(),showCheckbox:this.options.bulkActions,rootUrl:this.options.rootUrl,keywords:this.options.keywords,tileMode:this.options.tileMode,lazyload:!0,parent:this.options.parent},this.options.videoListItemOptions))},canPreview:function(){var t=n.currentUser;return t&&t.has("username")&&!t.isStudent()},initialize:function(){if(this.options.tileMode&&this.listenTo(this.collection,"add",this.itemAdded),this.listenTo(t.Events,"list",this.listSelected),this.listenTo(t.Events,"tile",this.tileSelected),this.options.tileMode){this.selectViewMode=_.debounce(_.bind(this.selectViewMode,this),333);$(window).on("resize",this.selectViewMode)}if(this.options.tileMode){this.onScroll=_.debounce(_.bind(this.onScroll,this),333);$(document).on("scroll",this.onScroll)}else this.listenTo(this.collection,"request",this.onRequest),this.listenTo(this.collection,"sync",this.onSync);this.options.childView&&(this.childView=this.options.childView);this.listenTo(this.collection,"itemRestricted itemUnrestricted",this.lazyLoad)},onRequest:function(){this.options.showPartialLoader&&(this.$el.addClass("partial-loading-view"),this.render())},onSync:function(){this.options.showPartialLoader&&this.$el.removeClass("partial-loading-view");this.render();this.collection.trigger("itemsrendered")},itemAdded:function(n){if(this.options.tileMode){var t=this.buildChildView(n),i=$(t.render().el);this.$el.append(i);t.trigger("rendered");this.lazyLoad();this.isotopeInitialized&&this.$el.isotope("appended",$(i))}else this.addOne(n)},listSelected:function(){this._localStorage.set("videoList:list",!0);this.list()},tileSelected:function(){this._localStorage.set("videoList:list",!1);this.tile()},list:function(){t.Events.trigger("videolistview:list");this.$el.addClass("video-tile-rows");this.$el.isotope({layoutMode:"vertical"});this._currentMode="list";this.isotopeInitialized=!0},tile:function(){t.Events.trigger("videolistview:tile");this.$el.removeClass("video-tile-rows");this.$el.isotope({itemSelector:".isotope-tile-item",sortBy:"original-order",layoutMode:"moduloColumns",percentPosition:!0,moduloColumns:{columnWidth:".isotope-tile-item",gutter:0}});this._currentMode="tile";this.isotopeInitialized=!0},selectViewMode:function(){window.innerWidth<1200?this.list():this.tile()},renderItems:function(){this.options.showPartialLoader&&this.collection&&!this.collection.isLoaded()||(this.$el.empty(),t.ListView.prototype.renderItems.apply(this,arguments),this.lazyLoad())},viewOptions:function(){return{tileMode:this.options.tileMode,showPartialLoader:this.options.showPartialLoader,isLibraryVideo:this.options.isLibraryVideo}},lazyLoad:function(){if(this.isInDOM()){if(this._lazyLoad){this._lazyLoad.update();return}this._lazyLoad=new LazyLoad({elements_selector:".lazy"})}},destroyLazyLoad:function(){this._lazyLoad&&this._lazyLoad.destroy()},onRendered:function(){this.options.tileMode&&this.selectViewMode();t.Events.trigger("start-contributed-by-onboarding");this.lazyLoad()},onClose:function(){$(window).off("resize",this.selectViewMode);$(document).off("scroll",this.onScroll);this.destroyLazyLoad()},onScroll:function(){var n=$(window);n.scrollTop()+n.height()>$(document).height()-100&&this.collection.getNextPage({remove:!1})}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared,r;i.Models.User=t.Model.extend({idAttribute:"username"});i.Collections.UserCollection=t.Collection.extend({model:i.Models.User});i.Models.Message=t.NestedModel.extend({urlRoot:"/api/messaging/conversations/messages/bulk",defaults:{recipients:[]},associations:{metadata:t.Model,recipients:function(n,t){return new i.Collections.UserCollection(n,t)}},validate:function(){return this.recipients.length?null:"recipients"}});r=t.View.extend({className:"message-success",template:i.Templates.MessageSent,events:{"click .close-link":"close"}});i.Views.MessageView=t.View.extend({className:"send-video",template:i.Templates.Message,ui:{ogDataView:".og-data-view",messageSend:".message-send",messageComment:".message-comment",messageRecipient:".message-recipient",messageCommentText:".message-comment-text",messageRecipientList:".message-recipient-list",recipientContainer:".message-recipient-container",inputGroup:".recipients-input-group"},events:{"click .send-button":"send","click .close-button":"close","focus .message-recipient-input":"onInputFocus","blur .message-recipient-input":"onInputBlur"},initialize:function(){this.model||this.newMessage();this.bindListeners()},newMessage:function(){this.model=new i.Models.Message},bindListeners:function(){this.listenTo(this.model,"error",this.renderErrorView);this.listenTo(this.model,"sync",this.renderSuccessView);this.listenTo(this.model,"request",this.renderLoader);this.listenTo(this.model.recipients,"add",this.isValid);this.listenTo(this.model,"invalid request",this.renderError)},onInputFocus:function(){this.ui.recipientContainer.addClass("focused")},onInputBlur:function(){this.ui.recipientContainer.removeClass("focused")},send:function(){this.model.isValid()&&(this.model.set("metadata",this.options.shareModel.generateMetadata({autoplay:!0})),this.model.save())},sendAnother:function(){this.stopListening(this.model);this.newMessage();this.bindListeners();this.render()},renderError:function(){this.ui.inputGroup.toggleClass("has-error",!!this.model.validationError)},renderErrorView:function(){var n=new r({success:!1});this.listenTo(n,"close",this.render);this.renderView(this.$el,n)},renderSuccessView:function(){var n=new r({success:!0});this.listenTo(n,"close",this.sendAnother);this.renderView(this.$el,n)},renderSelectedRecipients:function(){this.renderView(this.ui.messageRecipientList,new i.Views.RecipientListView({collection:this.model.recipients}))},renderMessageRecipient:function(){this.renderView(this.ui.messageRecipient,new i.Views.MessageRecipientView({collection:this.model.recipients}))},renderMessageComment:function(){this.renderView(this.ui.messageComment,new i.Views.MessageCommentView({model:this.model}))},renderMessageSend:function(){this.renderView(this.ui.messageSend,new i.Views.MessageSendView)},renderOgDataView:function(){var t=new n.Messaging.Views.OgDataView({model:this.model.metadata,embedded:!0});this.renderView(this.ui.ogDataView,t)},renderLoader:function(){this.renderView(this.$el,new i.Views.SpinJsView({cover:!0}))},getCurrentHost:function(){var i=document.createElement("a"),t;return i.href=n.Data.Config.urls.onlineUrl,t=i.host,t.substring(0,t.indexOf(":")>=0?t.indexOf(":"):t.length)},viewOptions:function(){var t=new n.Shared.Collections.CustomerSettingCollection(n.Data.CustomerSettings),i=!!t.getByName(n.Shared.SettingOptions.Permanent.STUDENT_TO_STUDENT_MESSAGING).get("value");return{studentToStudentMessage:n.Data.User.role===1&&!i}},onRender:function(){this.renderSelectedRecipients();this.renderMessageRecipient();this.renderMessageComment();this.renderMessageSend();this.trigger("resize")}});i.Views.MessageRecipientView=t.View.extend({template:'<input class="typeahead message-recipient-input" type="text" placeholder="Enter recipient name"/>',defaults:{queryLimit:25},ui:{typeahead:".typeahead"},queryUsers:function(n,t,i){var r=this;$.get("/api/messages/usersearch?q="+n+"&limit="+(this.options.queryLimit+this.collection.length),function(n){i(_.filter(n,function(n){return!r.collection.some(function(t){return n.username===t.get("username")})}))})},formatUser:function(n){return n.name+" "+n.surname},userSelected:function(n,t){this.collection.add(t);this.ui.typeahead.typeahead("val","")},initTypeAhead:function(){var n=this,t=function(t,i,r){n.queryUsers(t,i,r)};this.ui.typeahead.typeahead({async:!0},{source:_.throttle(t,500,{leading:!1}),display:this.formatUser});this.ui.typeahead.bind("typeahead:selected",_.bind(this.userSelected,this))},onRender:function(){this.initTypeAhead()}});i.Views.MessageCommentView=t.View.extend({template:'<textarea class="message-comment-text large" placeholder="Enter a comment here"><\/textarea>',ui:{textarea:".message-comment-text"},bindings:{".message-comment-text":"body"},initAutoGrow:function(){this.ui.textarea instanceof jQuery&&this.ui.textarea.autogrow()},onRender:function(){this.stickit();this.initAutoGrow()}});i.Views.MessageSendView=t.View.extend({template:'<a class="btn orange send-button pull-right">Send<\/a>'});i.Views.RecipientView=t.View.extend({tagName:"span",className:"recipient-list-pill",events:{"click .remove-recipient":"removeRecipient"},removeRecipient:function(){this.model.collection.remove(this.model)},template:'{{name}} {{surname}}<span class="remove-recipient">&times;<\/span>'});i.Views.RecipientListView=t.ListView.extend({childView:i.Views.RecipientView,initialize:function(){this.listenTo(this.collection,"add remove",this.render)}})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.Shared;i.Views.OnBoardingTooltipView=t.View.extend({className:"onboarding-tooltip-hook",template:'<div class="onboarding-tooltip"><span class="close">&times;<\/close><p class="caption">{{caption}}<\/p><div class="buttons"><\/div><\/div>'})}(ClickView,EasyMoney),function(n,t){"use strict";n.Shared.Views.PlaylistTabItemView=t.View.extend({className:"playlist-item",name:"PlaylistTabItemView in PlaylistView.js",template:n.Shared.Templates.PlaylistTabItem,initialize:function(){this.videoModel=this.options.videoModel;this.listenTo(this.model,"reset",this.render);this.listenTo(this.model,"change:added",this.updateIcon);this.listenTo(this.model,"change:videoCount",this.updateVideoCount);this.listenTo(this.model,"addVideo",this.showAddMessage);this.listenTo(this.model,"removeVideo",this.showRemoveMessage);this.listenTo(this.model,"addVideo",this.addToPlaylist);this.listenTo(this.model,"removeVideo",this.removeFromPlaylist);this.listenTo(this.model,"videosExist",this.showExistsMessage);this.listenTo(this.model,"change:showSpinner",this.toggleSpinner)},events:{click:"toggleAddToPlaylist"},toggleAddToPlaylist:function(){if(!this.model.isRequesting()){var t=this.model.get("id"),i=this.model.get("name"),r=this.videoModel.get("id"),u=this.videoModel.get("name"),f=this.videoModel.get("module");if(this.model.set("showSpinner",!0),this.videoModel instanceof n.Shared.Models.PlaylistWrapper&&this.videoModel.get("collection")){this.toggleBulkAddToPlaylist();return}if(this.model.get("added")){this.model.removeVideo(this.videoModel);n.Shared.Utils.AnalyticsService.logPlaylistRemove(t,i,r,u,f);return}this.model.addVideo(this.videoModel);n.Shared.Utils.AnalyticsService.logPlaylistAdd(t,i,r,u,f)}},toggleBulkAddToPlaylist:function(){var n=this.videoModel.get("collection");if(this.model.get("added")){this.model.removeVideos(this.videoModel.get("collection"),{updateCount:!0});return}this.model.addVideos(n,{updateCount:!0})},showAddMessage:function(n){if(n.success){this.showMessage("Added!");return}this.showMessage("Error!",!0)},showRemoveMessage:function(n){if(n.success){this.showMessage("Removed!");return}this.showMessage("Error!",!0)},showExistsMessage:function(){this.showMessage("Already added",!0)},showMessage:function(n,t){var u="cv-success",i,r;this.model.set("showSpinner",!1);t&&(u="cv-error",n=n||"Error!");i=jQuery('<div class="message-slide '+u+'"><span class="message">'+n+"<\/span><\/div>");this.$el.append(i);r=this.$el.outerHeight();i.css({"border-bottom-width":r,"border-left-width":.75*r}).animate({width:"150px"},500).delay(500).animate({width:0}).promise().done(function(){$(this).remove()})},toggleSpinner:function(){if(this.model.get("showSpinner")){this.renderView(this.$el,new n.Shared.Views.SpinJsView({cover:!0,mask:!0}),{empty:!1,childIndex:"spinner"});return}this.closeChildrenByIndex("spinner")},addToPlaylist:function(n){this.model.set({added:n.success})},removeFromPlaylist:function(n){this.model.set({added:!n.success})},render:function(){return this.$el.html(this.template(this.model.toJSON())),this.model.get("type")==0&&this.$el.addClass("favourites"),this.updateVideoCount(),this.updateIcon(),this},updateVideoCount:function(){var n=this.model.get("videoCount")||0,t=n+" video"+(n==1?"":"s");this.$el.find(".playlist-video-count").text(t)},updateIcon:function(){var n=this.$el.find(".icon").removeClass("added");this.model.get("added")&&n.addClass("added")}});n.Shared.Views.PlaylistListView=t.ListView.extend({tagName:"div",className:"cv-playlists",name:"PlaylistsTabView.js",_loaded:!1,childView:n.Shared.Views.PlaylistTabItemView,initialize:function(){this.videoModel=this.options.videoModel;this.listenTo(this.collection,"add",this.addNewItem);this.listenTo(this.collection,"sync",this.onLoaded);this.listenTo(this.collection,"request",this.onRequest);this.collection.models.length>0&&(this._loaded=!0)},triggerResize:function(){this.trigger("resize")},onLoaded:function(){this._loaded||(this._loaded=!0,this.render())},onRequest:function(){this._loaded=!1;this.renderLoader()},onBeforeRender:function(){if(!this._loaded)return this.renderLoader(),!1},addOne:function(n){this.renderView(this.$el,new this.childView({model:n,videoModel:this.videoModel}),{empty:!1})},addNewItem:function(t){var i=new n.Shared.Views.PlaylistTabItemView({model:t,videoModel:this.videoModel});this.renderView(this.$el,i,{empty:!1,at:this.collection.indexOf(t)})},renderLoader:function(){this.renderView(this.$el,new n.Shared.Views.LoaderView)},onRender:function(){t.ListView.prototype.onRender.apply(this,arguments);this.triggerResize()}});n.Shared.Views.PlaylistTabView=t.View.extend({name:"PlaylistTabView",className:"cv-playlist-tab",model:n.Shared.Models.Video,template:n.Shared.Templates.PlaylistTab,ui:{$input:"#new-playlist-name",$playlistViewpart:".cv-playlists-viewpart",$tabs:".tab-viewpart",$button:".button-viewpart"},events:{"click .new-playlist":"createPlaylist","keypress #new-playlist-name":"keyDown"},initialize:function(){this.collection=new(n.Shared.Collections.Playlists.extend({url:"/api/playlists"}));this.spinnerModel=new t.Model;this.getPlaylists()},triggerResize:function(){this.trigger("resize")},getPlaylists:function(){this.collection.fetch({reset:!0,add:!1,url:"/api/playlists/video/"+this.model.get("tokenId")})},keyDown:function(n){n.which===13&&(this.createPlaylist(),n.stopPropagation(),n.preventDefault())},createPlaylist:function(){if(!this.spinnerModel.get("showSpinner")){var t=this.ui.$input.val();typeof t!="string"||t.length<=0||(this.spinnerModel.set("showSpinner",!0),this.collection.create({name:t},{wait:!0,at:1,success:_.bind(function(i,r){r.success&&(this.model instanceof n.Shared.Models.PlaylistWrapper&&this.model.get("collection")?i.addVideos(this.model.get("collection"),{updateCount:!0}):i.addVideo(this.model,{updateCount:!0}));this.ui.$input.val("");this.spinnerModel.set("showSpinner",!1);n.Shared.Utils.AnalyticsService.logPlaylistCreate(t,this.model.get("module"))},this),error:function(){this.spinnerModel.set("showSpinner",!1)}}))}},renderListView:function(){this.listView=new n.Shared.Views.PlaylistListView({videoModel:this.model,collection:this.collection});this.listenTo(this.listView,"resize",this.triggerResize);this.renderView(this.ui.$playlistViewpart,this.listView)},renderCreateButton:function(){var t=new n.Shared.Views.SpinnerButtonView({model:this.spinnerModel,buttonText:"Create Playlist",className:"new-playlist",spinnerOptions:{spinColor:"#ffffff"}});this.renderView(this.ui.$button,t)},onRender:function(){this.renderCreateButton();this.renderListView()},onClose:function(){delete this.collection}})}(ClickView,EasyMoney),function(n,t){n.Shared.Views.PopoverView=t.View.extend({name:"PopoverView",className:"popover-view",template:!1,defaults:{html:!0,container:"body",placement:"bottom",delay:0,trigger:"click",popoverClass:null,lazyLoad:!0,closeOnBodyClick:!1},initialize:function(){this.toggler=this.options.toggler;this.options.lazyLoad||this.initInnerView(this.options.view);this.toggler.on("click.popover"+this.cid,_.bind(this._onClick,this));if(this.render(),this.options.closeOnBodyClick)$("body").on("click",this.hide.bind(this));this.options.closeOnScroll&&$(window).scroll(this.hide.bind(this));this.listenTo(t.Events,"popover:hideothers",this._hideInstance)},initInnerView:function(n){this.view||(this.view=_.isFunction(n)?new n:n,this.listenTo(this.view,"show",this.show),this.listenTo(this.view,"hide",this.hide))},onClose:function(){this.toggler.off("click.popover"+this.cid)},_onClick:function(){return t.Events.trigger("popover:hideothers",this.cid),!1},_hideInstance:function(n){n!==this.cid&&this.hide()},show:function(){this.toggler.popover("show")},hide:function(){this.toggler.popover("hide")},toggle:function(){this.toggler.popover("toggle")},initPopover:function(){var n=this;this.toggler.popover({html:n.options.html,container:n.options.container,placement:n.options.placement,delay:n.options.delay,trigger:n.options.trigger,content:n.$el,template:n.getTemplate()});this.toggler.on("show.bs.popover",_.bind(function(){this.getChildByIndex("innerView")||this.renderInnerView();this.view.show()},this));this.toggler.on("shown.bs.popover",_.bind(function(){this.view.trigger("rendered")},this));this.toggler.on("hidden.bs.popover",_.bind(function(){this.view&&this.view.hide()},this))},getTemplate:function(){var n="";return this.options.popoverClass&&(n=" "+this.options.popoverClass),'<div class="popover'+n+'" role="tooltip"><div class="arrow"><\/div><h3 class="popover-title"><\/h3><div class="popover-content"><\/div><\/div>'},onBeforeClose:function(){this.toggler.popover("destroy")},onRender:function(){this.options.lazyLoad||this.renderInnerView();this.initPopover()},renderInnerView:function(){this.initInnerView(this.options.view);this.renderView(this.$el,this.view,{childIndex:"innerView"})}})}(ClickView,EasyMoney),function(n,t){"use strict";n.Views.PrivacyControlView=t.View.extend({className:"cv-privacy-control",name:"PrivacyControlView",template:n.Templates.PrivacyControl,isOpen:!1,_privacies:{},defaults:{defaultPrivacyId:1,showPrivacies:["private","school","public"],embeddable:!0,resourceType:{type:"video",name:"Video"},privacies:{"private":{id:1,cssClass:"private",text:"Private"},school:{id:2,cssClass:"school",text:"My School"},"public":{id:3,cssClass:"public",text:"Public"}}},initialize:function(){this._privacies={};this.populatePrivacyObject();this.setPrivacy(this.model.get("privacyId")||this.options.defaultPrivacyId);this.bindEvents()},events:{"click .current-privacy":"toggleDropdown","click .arrow":"toggleDropdown","click .privacy-selection li":"update"},populatePrivacyObject:function(){_.each(this.options.showPrivacies,function(n){this._privacies[n]=this.options.privacies[n]},this)},bindEvents:function(){t.Events.on("closePrivacyControl",this.closeDropdown,this);$(document).on("click",this.triggerCloseAll)},unBindEvents:function(){t.Events.off("closePrivacyControl",this.closeDropdown);$(document).off("click",this.triggerCloseAll)},onClose:function(){this.unBindEvents()},triggerCloseAll:function(){t.Events.trigger("closePrivacyControl")},toggleDropdown:function(n){n.stopPropagation();var t=this._isOpen;return this.triggerCloseAll(),t||this.openDropdown(),!1},openDropdown:function(){this.$el.addClass("open").find(".privacy-selection").show();this._isOpen=!0},closeDropdown:function(){if(this._isOpen)return this.$el.removeClass("open").find(".privacy-selection").hide(),this._isOpen=!1,!0},setPrivacy:function(n){this._currentPrivacy=this.getPrivacyById(n)},getPrivacyById:function(n){return _.findWhere(this.options.privacies,{id:n})},update:function(n){n.stopPropagation();var t=$(n.target).closest("li"),i=t.data("id");this.setPrivacy(i);this.render();this.closeDropdown();this.model.share(this._currentPrivacy.id);this.renderSharePopup()},renderSharePopup:function(){this.closeChildrenByIndex("SharePopup");var n=new ClickView.Shared.Views.ShareTabView({itemModel:this.model,fetch:!1,embeddable:this.options.embeddable,resourceType:this.options.resourceType}),t=new ClickView.Shared.Views.PopupView({view:n,title:"Share",cssId:"cv-share-tab",showButtonContainer:!0,closeButtonText:"Close"});t.selfRender()},getModel:function(){return{privacies:this._privacies,currentPrivacy:this._currentPrivacy}}})}(ClickView.Shared,EasyMoney),function(n,t){"use strict";n.Shared.Views.PushToTabView=t.View.extend({name:"PushTo.js",id:"push-to-tab",model:n.Shared.Models.Video,template:n.Shared.Templates.PushToTab,_pushed:!1,_error:!1,events:{"click #push-button":"push","click #cancel-button":"close"},ui:{body:".push-to-body",buttonContainer:".popup-button-container",$messageTextarea:".message"},_canbePushedLoaded:!1,initialize:function(){this.model.set("canBePushed",null);this.ajaxHelper=n.Shared.Utils.AjaxHelper;this.config=n.Data.Config;this.listenTo(this.model,"change:canBePushed",this.onCanBePushedChanged);this.setCanBePushed()},push:function(){var t=this,i=this.model.get("id"),r=this.ui.$messageTextarea.val();this.showLoader();this.pushVideo(i,r).done(function(i){if(t._pushed=!0,i.success){n.Shared.Utils.AnalyticsService.logPushToPubliser(t.model.get("title"),t.model.get("module"));t.showSuccess();return}t.showError()})},showSuccess:function(){this._error=!1;this.render()},showError:function(){this._error=!0;this.render()},getModel:function(){return{pushed:this._pushed,error:this._error,canBePushed:this.model.get("canBePushed"),websiteLink:this.config.urls.companyWebsite}},showLoader:function(){this.renderView(this.$el,new n.Shared.Views.LoaderView({loadingText:"Sending request to your Administrator..."}))},pushVideo:function(t,i){var r="/Ajax/";return this.model.isMasterVideo()?(n.Shared.Helpers.Guid.isGuid(t)&&(t=this.model.get("masterId")),r+="PushMasterVideoToLibrary"):r+="PushToLibrary",this.ajaxHelper.post(r,{id:t,service:this.getService(this.model),message:i})},getService:function(n){if(n.isMasterLibraryVideo())return"hosted_collection";if(n.isMasterVideo()){if(n.isExchangeVideo())return"exchange2";if(n.isWorkspaceVideo())return"workspace"}return n.isWorkspaceVideo()?"workspace":n.isExchangeVideo()?"exchange":null},onBeforeRender:function(){return(this.model.set("websiteLink","http://clickview.com.au"),this._canbePushedLoaded||!!this.model.get("canBePushed"))?!0:(this.renderLoader(),!1)},onCanBePushedChanged:function(){this.render()},setCanBePushed:function(){var n=this,t=this.model.get("tokenId");return n.ajaxHelper.get("/Ajax/CanBePushed",{tokenId:t}).done(function(t){n._canbePushedLoaded=!0;n.model.set("canBePushed",!!t.success)}).fail(function(){n._canbePushedLoaded=!0;n.model.set("canBePushed",!1)})},renderLoader:function(t){t=t||this.$el;this.renderView(t,new n.Shared.Views.LoaderView)},onRender:function(){this.trigger("resize")}})}(ClickView,EasyMoney),function(n,t,i,r){"use strict";var u=t.Model.extend({defaults:{text:"",selected:!1,searchTerm:""}}),f=t.Collection.extend({model:u,url:"/api/search/autocompletion",parse:function(n){this.reset();var t=this.searchTerm;return r.map(n,function(n){return{text:n,searchTerm:t}})}}),e=t.Collection.extend({model:u}),o=EasyMoney.View.extend({model:u,tagName:"li",render:function(){var n=this.model.get("text"),t=this.model.get("searchTerm").split(" "),i;return t.length>1&&(t.pop(),n=t.join(" ")+" "+n),n=n.toLowerCase().replace(this.model.get("searchTerm"),'<span class="partial-bold">'+this.model.get("searchTerm")+"<\/span>"),i=!this.model.get("selected")?"":"selected",this.$el.html(n).addClass(i),this}}),s=EasyMoney.View.extend({model:u,tagName:"li",render:function(){var n=this.model.get("text"),t=!this.model.get("selected")?"":"selected";return this.$el.html(n).addClass(t),this}}),h=EasyMoney.View.extend({tagName:"ul",className:"search-drop-down",selectedSuggestion:0,initialize:function(){this.listenTo(this.collection.suggestions,"sync reset",this.render)},deselect:function(){var n=function(n){n.set("selected",!1)};r.each(this.collection.suggestions.models,n);r.each(this.collection.recentSearches.models,n)},selectUp:function(){if(this.collection.suggestions.length!=0||this.collection.recentSearches.length!=0){if(this.deselect(),this.selectedSuggestion--,this.selectedSuggestion<0&&(this.selectedSuggestion=this.collection.suggestions.length+this.collection.recentSearches.length),this.selectedSuggestion>this.collection.suggestions.length){this.collection.recentSearches.at(this.selectedSuggestion-this.collection.suggestions.length-1).set("selected",!0);return}this.selectedSuggestion>0&&this.collection.suggestions.at(this.selectedSuggestion-1).set("selected",!0)}},selectDown:function(){if(this.collection.suggestions.length!=0||this.collection.recentSearches.length!=0){if(this.deselect(),this.selectedSuggestion++,this.selectedSuggestion>this.collection.suggestions.length+this.collection.recentSearches.length&&(this.selectedSuggestion=1),this.selectedSuggestion>this.collection.suggestions.length){this.collection.recentSearches.at(this.selectedSuggestion-this.collection.suggestions.length-1).set("selected",!0);return}this.collection.suggestions.at(this.selectedSuggestion-1).set("selected",!0)}},addOneSuggestion:function(n){this.$el.append(new o({model:n}).render().el)},addOneRecentSearch:function(n){this.$el.append(new s({model:n}).render().el)},render:function(){return this.collection.suggestions.length==0&&this.collection.recentSearches.length==0?(this.$el.hide(),this):(this.$el.empty().show(),this.collection.suggestions.each(this.addOneSuggestion,this),this.collection.recentSearches.length>0&&this.$el.append('<li class="search-divide"><\/li><li class="recent-searches">Recent Searches:<\/li>'),this.collection.recentSearches.each(this.addOneRecentSearch,this),this)}});n.Views.SearchBox=EasyMoney.View.extend({className:"search-box-container",template:n.Templates.SearchBox,defaults:{redirect:!0,inTopBar:!1},selectors:{ghost:".search-ghost",searchBox:"#searchBox",dropDownContainer:".search-drop-down-container"},keyCodes:{tab:9,enter:13,upArrow:38,downArrow:40},oldText:"",events:{"blur input":"onLoseFocus","keyup input":"onKeyUp","keydown input":"preventCursor","focus .search-box-nav":"onGainFocus","click .search-submit-nav":"onClick","mousedown .search-drop-down-container li":"onDropDownClick"},onLoseFocus:function(){this.recentSearches.reset();this.suggestions.reset();this.options.inTopBar&&i("#collapse-target").removeClass("search-focused")},onGainFocus:function(){var n=this.$searchbox.val().toLowerCase();n.length!=0&&this.fetchSuggestions(n);this.fetchRecentSearches(n);this.searchDropDown.render();this.options.inTopBar&&i("#collapse-target").addClass("search-focused")},onClick:function(n){this.submit();n.preventDefault();n.stopPropagation()},onDropDownClick:function(n){var r=i(n.currentTarget),t;n.which==1&&(r.hasClass("recent-searches")||(t=r.text(),t&&this.submit(t)))},onKeyUp:function(n){switch(n.keyCode){case this.keyCodes.enter:this.setInputText();this.submit();return;case this.keyCodes.upArrow:if(this.searchDropDown.selectUp(),this.searchDropDown.render(),this.searchDropDown.selectedSuggestion==0){this.restoreInputText();return}break;case this.keyCodes.downArrow:this.searchDropDown.selectDown();this.searchDropDown.render();break;default:this.$ghost.empty();this.searchDropDown.selectedSuggestion=0;this.oldText=this.$searchbox.val();this.timeOut&&clearTimeout(this.timeOut);this.timeOut=setTimeout(r.bind(this.runSearch,this),250);return}this.setInputText()},preventCursor:function(n){(n.keyCode==this.keyCodes.tab||n.keyCode==this.keyCodes.enter||n.keyCode==this.keyCodes.upArrow||n.keyCode==this.keyCodes.downArrow)&&n.preventDefault()},resetAll:function(){this.recentSearches.reset();this.suggestions.reset()},runSearch:function(){var n=this.$searchbox.val().toLowerCase();if(n.length==0){this.resetAll();return}this.fetchSuggestions(n);this.fetchRecentSearches(n)},submit:function(n){var t=n||this.$searchbox.val()||"",f,i,u;if((t=t.replace(/<[a-zA-Z\/][^>]*>/,""),t.length!==0)&&!/^\?+$/.test(t)){if(typeof Storage=="undefined"){this.redirect(t);return}if(f=ClickView.Shared.Utils.LocalStorageHelper,i=f.get("recentSearches"),!i||typeof i!="string"){f.set("recentSearches",t);this.redirect(t);return}r.contains(i.split(","),t)||(u=i.split(","),u.push(t),u.length>3&&u.shift(),f.set("recentSearches",u.join(",")));this.redirect(t)}},redirect:function(n){var t="pushState"in window.history?"/":"#",i;if(n=encodeURIComponent(n.trim()),!this.options.redirect){ClickView.EventManager.trigger("navigate:search",{to:n,keepSource:!0,trigger:!0});return}if(this.controller=="search"&&ClickView.Router&&ClickView.Router.searchQuery){i=ClickView.Router.searchQuery.get("source").get("id")||"mylibrary";window.location.href="/search"+t+i+"?q="+n;return}if(this.controller=="exchange"||this.controller==="freeToAir"){window.location.href="/search"+t+"exchange?q="+n;return}if(this.controller==="workspace"){window.location.href="/search"+t+"workspace?q="+n;return}window.location.href="/search"+t+"alllibraries?q="+n},setInputText:function(){if(this.searchDropDown.selectedSuggestion>0){var n=this.$el.find(".selected").text();this.$searchbox.val(n);this.$ghost.html(n)}},restoreInputText:function(){var n=this.$ghost.html();n=this.oldText+n.substr(this.oldText.length);this.$searchbox.val(this.oldText);this.$ghost.html(n)},fetchSuggestions:function(n){var t=n.split(" ");if(t[t.length-1].trim()!=""){if(n.length>25){this.suggestions.reset();return}this.suggestions.searchTerm=n;this.suggestions.fetch({data:{q:t[t.length-1]}})}},fetchRecentSearches:function(n){var t=null,i=ClickView.Shared.Utils.LocalStorageHelper.get("recentSearches");typeof i=="string"&&(t=r.map(i.split(",").slice(-3),function(t){return{text:t,searchTerm:n}}));this.recentSearches.reset(t)},renderSearchDropDown:function(){this.$searchDropDownContainer.html(this.searchDropDown.render().el)},render:function(){return this.$el.html(this.template({searchTerm:this._args.searchTerm})),this.$ghost=this.$el.find(this.selectors.ghost),this.$searchbox=this.$el.find(this.selectors.searchBox),this.$searchDropDownContainer=this.$el.find(this.selectors.dropDownContainer),this.renderSearchDropDown(),this},initialize:function(n){this.controller="mylibrary";this.suggestions=new f;this.recentSearches=new e;this.searchDropDown=new h({collection:{suggestions:this.suggestions,recentSearches:this.recentSearches}});n&&n.controller&&(this.controller=n.controller);this._args=r.extend({},n);this.analyticsService=ClickView.Shared.Utils.AnalyticsService}})}(ClickView.Shared,Backbone,jQuery,_),function(n){"use strict";n.Views.SettingView=EasyMoney.View.extend({name:"SettingView.js",className:"option-view",template:n.Templates.Setting,defaults:{text:"Enabled"},viewOptions:function(){return{text:this.options.text,enabled:this.model.get("value")}},bindings:{".enabled":"value"},initialize:function(){this.listenTo(this.model,"change:value",_.debounce(this.save,200))},save:function(){var n=this;this.model.save().done(function(){n.render()})},onRender:function(){this.stickit()}})}(ClickView.Shared);!function(n,t){"use strict";var i=n.Shared,r=t.View.extend({template:!1,initialize:function(){i.Services.VideoActionService.mixin(this)},onRender:function(){if(n.Data.User.username&&!this.model.isRestricted()){var t=i.Services.VideoActionService.getActions(this.model),r=new i.Views.MasterVideoActionsDropdownListView({collection:new n.Shared.Collections.VideoActionCollection(t),itemModel:this.model});this.renderView(this.$el,r);this.delegateEvents()}}});i.Views.SlidingListItemView=t.View.extend({template:i.Templates.SlidingListItem,tagName:"div",analyticsService:n.Shared.Utils.AnalyticsService,className:function(){return"slide-item "+(this.model.get("large")?"large":"small")},defaults:{lazyLoad:!0,bgColor:"000",showVideoActions:!1},ui:{image:"img",lazyImage:".lazy",videoActions:".video-actions",thumbnail:".thumbnail",restrictedThumbnail:".restricted-thumbnail-container",restrictedBadge:".restricted-badge-container"},events:{"click .thumbnail > a":"onClickThumbnail","click .name-link":"onClickName","click .series-link":"onClickSeries","show.bs.dropdown":"onShowDropdown"},initialize:function(){this.validateModel()},validateModel:function(){if(this.model.get("isVideo")){var n=this.getOriginalModel();if(!(n instanceof i.Models.MasterVideo))throw new Error("Videos sent to SlidingListView mustbe MasterVideo models.");}},setWidth:function(){if(this.model.get("large")&&this.options.columnCount>=4){this.options.width=5e3/this.options.totalWidth;return}this.options.width=100/this.options.columnCount/(this.options.totalWidth/100)},cancelEvent:function(n){n.stopPropagation();n.preventDefault()},logClick:function(n){var t=i.Services.ContextService.getContext(i.Utils.Constants.CONTEXTS.EASY_SLIDE),r=Math.ceil((this.model.collection.indexOf(this.model)+1)/this.options.columnCount);this.analyticsService.logEasySlideClick({id:this.model.get("id"),name:this.model.get("name"),url:this.model.get("href"),trackingCode:this.model.get("trackingCode"),page:r,type:n,location:t.get("location")})},onShowDropdown:function(){var n=this.$(".video-actions"),t;$("body").append(n.css({position:"absolute",left:n.offset().left,top:n.offset().top,right:"auto"}).detach());t=this;$("body > .video-actions").one("hidden.bs.dropdown",function(){t.ui.thumbnail.append($("body > .video-actions").css({position:!1,left:"auto",top:"7.5px",right:"7.5px"}).detach())})},onClickThumbnail:function(n){this.logClick("thumbnail");this.onClick(n)},onClickName:function(n){this.logClick("name");this.onClick(n)},onClick:function(i){if(n.Shared.Helpers.isSamePageRoute(this.model.get("href")))return this.cancelEvent(i),t.Events.trigger("navigate",this.model.get("href")),!1},onClickSeries:function(i){return this.logClick("series-name"),n.Shared.Helpers.isSamePageRoute(this.model.get("seriesHref"))?(this.cancelEvent(i),t.Events.trigger("navigate",this.model.get("seriesHref")),!1):void 0},renderVideoActions:function(){if(this.options.showVideoActions){var n=this.model.get("originalModel");n&&this.renderView(this.ui.videoActions,new r({model:n}))}},renderRestrictedThumbnail:function(t){if(t.isRestricted()){var i=new n.Shared.Views.RestrictedThumbnailView({text:"Restricted"});this.renderView(this.ui.restrictedThumbnail,i)}},renderRestrictedBadge:function(t){t.hasRestriction()&&this.renderView(this.ui.restrictedBadge,new n.Shared.Views.RestrictedBadgeView({model:t}))},renderRestriction:function(){var n=this.model.get("originalModel");n instanceof i.Models.MasterVideo&&(this.renderRestrictedThumbnail(n),this.renderRestrictedBadge(n))},getOriginalModel:function(){return this.model.get("originalModel")},getModel:function(){var i=t.ListView.prototype.getModel.apply(this,arguments),u,r;return(window.URI&&i.image&&i.large&&(u=new URI(i.image),u.setQuery("size","medium"),i.image=u.toString()),i.small=this.options.small,!this.model.get("isVideo"))?i:(r=this.model.get("originalModel"),i.isRestricted=r.isRestricted(),i.hasRestriction=r.hasRestriction(),i.isRestrictedFromStudent=i.isRestricted&&n.currentUser.isStudent(),i.hasRestriction&&(i.restriction=r.getRestriction().get("description")),i)},viewOptions:function(){return this.options},onRender:function(){this.setWidth();this.$el.css("width",this.options.width+"%");this.renderVideoActions();this.renderRestriction()}});i.Views.SlidingListView=t.ListView.extend({name:"SlidingListView.js",className:"easy-slide",template:i.Templates.SlidingList,childView:i.Views.SlidingListItemView,tagName:"div",marginLeft:0,analyticsService:n.Shared.Utils.AnalyticsService,ui:{slideContainer:".slide-container",leftButtonContainer:".left-button",rightButtonContainer:".right-button",rightButton:".slide-right",leftButton:".slide-left"},events:{"click .slide-left":"slideLeft","click .slide-right":"slideRight","click .list-action":"onClick"},defaults:{slideDistance:100,small:!1,lazyLoad:!0,listActionUrl:!1,columnCount:0,totalItems:11,hidesLessThanColumnCount:!0,imageBgColor:"000"},initialize:function(){this.options.breakpoints=n.Data.Breakpoints;!(this.collection instanceof t.Collection)&&this.collection instanceof Array&&(this.collection=new t.Collection(this.collection));this.collection=this.trimCollection();var r=n.Data.Config.isDebug;if(r&&!i.Services.ContextService.getContext(i.Utils.Constants.CONTEXTS.EASY_SLIDE))throw new Error(this.name+' Please set a context for use in logging. e.g. ClickView.Shared.Services.ContextService.setContext("easy-slide", {location: "dashboard"})');},setUpCollection:function(){if(this.options.small||this.shouldBeSmallForm())this.collection.forEach(function(n){n.set({large:!1,small:!0})});else{this.collection=new t.Collection(this.collection.first(Math.floor(this.collection.length/5)*5));var n=this.generateLargeIndexes(this.collection.length);this.collection.forEach(function(t,i){t.set("large",_.contains(n,i))})}},shouldBeSmallForm:function(){return window.innerWidth<this.options.breakpoints.md?!0:!1},trimCollection:function(){var n=this.collection,r=n.length,u=this.options.listActionUrl,f=this.options.totalItems,t,i;return u&&r<f&&(t=this.options.heading,this.options.type&&(t="this "+this.options.type),i="Click to see all videos in "+t,n.push({name:i,description:"",href:this.options.listActionUrl,pageLoad:!1,isSVG:!0,image:!1})),n},onClick:function(n){return n.preventDefault(),t.Events.trigger("navigate",this.options.listActionUrl),this.analyticsService.logEasySlideClick({heading:this.options.heading,url:this.options.listActionUrl,type:"heading"}),!1},canSlideRight:function(){var n=this.marginLeft-this.options.slideDistance;return-n<=this.options.maxSlide},canSlideLeft:function(){var n=this.marginLeft+this.options.slideDistance;return n<this.options.slideDistance},slideRight:function(n){var t,i;n&&n.stopPropagation();t=this.marginLeft-this.options.slideDistance;t<this.maxMarginLeft&&(t=this.maxMarginLeft);this.canSlideRight()&&(this.ui.slideContainer.css("margin-left",t+"%"),this.marginLeft=t,this.styleButtons(),this.analyticsService.logEasySlideNavigate({direction:"right",heading:this.options.heading,url:this.options.listActionUrl}),i=this,window.setTimeout(function(){i.lazyLoad.update()},500))},slideLeft:function(n){n&&n.stopPropagation();var t=this.marginLeft+this.options.slideDistance;t>0&&(t=0);this.canSlideLeft()&&(this.ui.slideContainer.css("margin-left",t+"%"),this.marginLeft=t,this.styleButtons(),this.analyticsService.logEasySlideNavigate({direction:"left",heading:this.options.heading,url:this.options.listActionUrl}))},setColumnCount:function(){this.options.columnCount=window.innerWidth<this.options.breakpoints.xs?2:window.innerWidth<this.options.breakpoints.sm?2:window.innerWidth<this.options.breakpoints.md?3:4},setTotalWidth:function(){var n=0,t=this,i=t.options.columnCount>=4;this.collection.forEach(function(r){if(r.get("large")&&i){if(n+=2,t.options.small)throw new Error("Cannot use large items with small Sliding List View");}else n+=t.options.small||!i?1:.5});this.options.totalWidth=Math.ceil(n/this.options.columnCount)*100;this.options.maxSlide=this.options.totalWidth-100},addOne:function(n){this.renderView(this.ui.slideContainer,this.buildChildView.call(this,n),{empty:!1})},buildChildView:function(n){var t=_.extend({},_.omit(this.options,["collection","model","id"]),{model:n,bgColor:this.options.imageBgColor,small:this.options.small||this.shouldBeSmallForm()});return t.itemCount=this.collection.length,new this.childView(t)},viewOptions:function(){var n=this.options.small||this.shouldBeSmallForm();return _.extend({},this.options,{small:n})},initIsotope:function(){this.ui.slideContainer.isotope({itemSelector:".slide-item",layoutMode:"packery"})},styleButtons:function(){var n=100/this.options.columnCount/(this.options.totalWidth/100);this.ui.leftButtonContainer.css("width",this.options.totalWidth*(n/100)+"%");this.ui.rightButtonContainer.css("width",this.options.totalWidth*(n/100)+"%");this.ui.rightButton.css({display:this.canSlideRight()?"block":"none"});this.ui.leftButton.css({display:this.canSlideLeft()?"block":"none"})},manageSize:function(){this.options.small||this.shouldBeSmallForm()?this.$el.addClass("small-form"):this.$el.removeClass("small-form")},bindResize:function(){this.resizeBound||($(window).bind("resize",_.bind(_.throttle(this.onResize,250),this)),this.resizeBound=!0,this.oldWidth=window.outerWidth)},onResize:function(){this.oldWidth!==window.innerWidth&&(this.manageSize(),this.render(),this.onRendered(),this.oldWidth=window.innerWidth,this.lazyLoad&&this.lazyLoad.update())},generateLargeIndexes:function(n){for(var t=[0];t.length<n/5;)t.length%2?t.push(_.last(t)+5):t.push(_.last(t)+1);return t},initLazyload:function(){this.lazyLoad||(this.lazyLoad=new LazyLoad({container:this.$el[0]}))},onBeforeRender:function(){if(this.setUpCollection(),this.setColumnCount(),this.setTotalWidth(),this.marginLeft=0,this.collection){var n=this.collection.length,t=this.options.columnCount;if((this.maxMarginLeft=-(n/t-1)*100,!n)||this.options.hidesLessThanColumnCount&&n<t)return!1}},onRender:function(){this.ui.slideContainer.css("width",this.options.totalWidth+"%");t.ListView.prototype.onRender.apply(this,arguments)},onRendered:function(){var n=this.collection.length,t=this.options.columnCount;if(this.collection){if(!n)return!1;if(this.options.hidesLessThanColumnCount&&n<t)return this.$el.hide(),!1}this.initIsotope();this.styleButtons();this.manageSize();this.bindResize();this.initLazyload()}})}(ClickView,EasyMoney),function(n,t){"use strict";n.Views.SnippetAppView=t.View.extend({name:"ClickView.Snippet.Views.AppView.js",className:"snippet-tool",template:n.Templates.SnippetApp,defaults:{timesDiff:3,negativeHours:"Hours must be positive",negativeMinutes:"Minutes must be positive",negativeSeconds:"Seconds must be positive",exceedsVideoDuration:"Entered value exceeds video duration",startGreaterEnd:"Start time must be less than end time",endLessStart:"End time must be greater than start time",textEntered:"Only numbers and ':' are allowed",smallDiff:"Clip must be at least 3 seconds long",renderCheckbox:!0},_webplayerIframe:null,initialize:function(){this.model=this.model||new n.Models.SnippetViewModel;this._webplayerIframe=$(".video-container iframe");this.listenTo(this.model,"change:enabled",this.onEnableChange);this.listenTo(this.model,"change:endTime change:startTime",this.updateTimes);this.listenTo(this.model,"change:endTime change:startTime",this.checkArrows);this.listenTo(this.model,"change:endTime change:startTime",this.resetErrors);this.listenTo(this.model,"change:currentTime",this.updateButtonText)},ui:{$endTime:"#snippet-end-time",container:".time-container",$startTime:"#snippet-start-time",$endTimeError:"#end-time-error",$startTimeError:"#start-time-error",$decrementEndTimeArrow:".decrement-end-time",$incrementEndTimeArrow:".increment-end-time",$incrementStartTimeArrow:".increment-start-time",$decrementStartTimeArrow:".decrement-start-time",setStartTimeBtn:".set-start",setEndTimeBtn:".set-end"},events:{"click #share-click-toggle":"toggleSnippet","click .increment-start-time":"incrementStartTime","click .decrement-start-time":"decrementStartTime","click .increment-end-time":"incrementEndTime","click .decrement-end-time":"decrementEndTime","keyup #snippet-start-time":"checkStartTime","keyup #snippet-end-time":"checkEndTime","blur #snippet-start-time":"changeStartTime","blur #snippet-end-time":"changeEndTime","click .set-start":"setStartTime","click .set-end":"setEndTime"},onEnableChange:function(){var n=this.model.get("enabled");n||(this.model.set({startTime:0,endTime:0}),this.model.trigger("clipstop"));this.eventsApi.trigger("cv-player-cliptooltoggle",n);this.render()},toggleSnippet:function(){var n,t;this.isReady()&&(n=!this.model.get("enabled"),n&&(this.eventsApi.trigger("cv-player-pause"),t=this,setTimeout(function(){t.eventsApi.trigger("cv-player-cliptoolset",{start:"now"})},1)),this.model.set("enabled",n))},incrementStartTime:function(){this.isReady()&&this.eventsApi.trigger("cv-player-cliptoolset",{start:this.model.get("startTime")+1})},decrementStartTime:function(){this.isReady()&&(this.model.get("startTime")<=0||this.eventsApi.trigger("cv-player-cliptoolset",{start:this.model.get("startTime")-1}))},incrementEndTime:function(){if(this.isReady()){var n=this.model.get("endTime");n>=this.videoDuration()||this.eventsApi.trigger("cv-player-cliptoolset",{end:n+1})}},decrementEndTime:function(){if(this.isReady()){var n=this.model.get("endTime");n<=0||this.eventsApi.trigger("cv-player-cliptoolset",{end:n-1})}},setStartTime:function(){if(this.model.get("endTime")-this.model.get("currentTime")<=this.defaults.timesDiff){this.ui.$startTimeError.text(this.defaults.smallDiff);return}this.eventsApi.trigger("cv-player-cliptoolset",{start:"now"})},setEndTime:function(){if(this.model.get("currentTime")-this.model.get("startTime")<=this.defaults.timesDiff){this.ui.$endTimeError.text(this.defaults.smallDiff);return}this.eventsApi.trigger("cv-player-cliptoolset",{end:"now"})},checkStartTime:function(n){switch(n.keyCode){case 13:this.changeStartTime();break;case 38:this.incrementStartTime();break;case 40:this.decrementStartTime()}},changeStartTime:function(){if(this.isReady())try{var n=this.convertToSeconds(this.ui.$startTime.val());if(n>=this.model.get("endTime"))throw this.defaults.startGreaterEnd;if(n>this.model.get("endTime")-this.defaults.timesDiff)throw this.defaults.smallDiff;this.eventsApi.trigger("cv-player-cliptoolset",{start:n})}catch(t){this.ui.$startTimeError.text(t)}},checkEndTime:function(n){switch(n.keyCode){case 13:this.changeEndTime();break;case 38:this.incrementEndTime();break;case 40:this.decrementEndTime()}},changeEndTime:function(){if(this.isReady())try{var n=this.convertToSeconds(this.ui.$endTime.val());if(this.model.get("startTime")>=n)throw this.defaults.endLessStart;if(this.model.get("startTime")>n-this.defaults.timesDiff)throw this.defaults.smallDiff;if(n>this.videoDuration())throw this.defaults.exceedsVideoDuration;this.eventsApi.trigger("cv-player-cliptoolset",{end:n})}catch(t){this.ui.$endTimeError.text(t)}},convertToSeconds:function(n){var t=n.split(":"),u=0,r=0,i=0;switch(t.length){case 1:i=Number(t[0]);break;case 2:r=Number(t[0]);i=Number(t[1]);break;case 3:u=Number(t[0]);r=Number(t[1]);i=Number(t[2])}return this.validateTimeComponents(u,r,i),u*3600+r*60+i},convertToTime:function(n){return ClickView.Shared.Helpers.formatDuration(n)},validateTimeComponents:function(n,t,i){if(isNaN(i)||isNaN(t)||isNaN(n))throw this.defaults.textEntered;if(n<0)throw this.defaults.negativeHours;if(t<0)throw this.defaults.negativeMinutes;if(i<0)throw this.defaults.negativeSeconds;},checkArrows:function(){this.model.get("startTime")<=0?this.ui.$decrementStartTimeArrow.hide():this.ui.$decrementStartTimeArrow.show();this.model.get("endTime")>=this.videoDuration()?this.ui.$incrementEndTimeArrow.hide():this.ui.$incrementEndTimeArrow.show();this.model.get("endTime")-this.model.get("startTime")<=this.defaults.timesDiff?(this.ui.$incrementStartTimeArrow.hide(),this.ui.$decrementEndTimeArrow.hide()):(this.ui.$incrementStartTimeArrow.show(),this.ui.$decrementEndTimeArrow.show())},updateTimes:function(){this.ui.$startTime.val(this.convertToTime(this.model.get("startTime")));this.ui.$endTime.val(this.convertToTime(this.model.get("endTime")))},onTimeUpdate:function(n,t){this.model.set("currentTime",t)},resetErrors:function(){this.ui.$startTimeError.empty();this.ui.$endTimeError.empty()},videoDuration:function(){return Math.floor(this.model.get("videoDuration"))},updateButtonText:function(){var t=this.model.get("currentTime"),n=this.convertToTime(t);this.ui.setStartTimeBtn.text("Set start time to "+n);this.ui.setEndTimeBtn.text("Set end time to "+n)},onBeforeRender:function(){return this.hasWebplayerIframe()?!0:!1},registerWebPlayerApiInstance:function(){if(this.hasWebplayerIframe()){var n=this.model,t=ClickView.Shared.Helpers.ParseUrl(this._webplayerIframe[0].src),i=t.protocol+"//"+t.hostname;this.eventsApi=new CVEventsApi(this._webplayerIframe[0].contentWindow,i);this.eventsApi.on("cv-player-cliptooltoggle",this.toggleSnippet);this.eventsApi.on("cv-player-cliptoolupdate",_.bind(function(n,t){this.model.set({startTime:t.start,endTime:t.end,chapterIndex:t.chapterIndex,videoDuration:t.duration,currentTime:t.currentTime})},this));this.eventsApi.on("cv-player-cliptoolupdate",_.debounce(function(){n.trigger("clipupdate",n)},250));this.eventsApi.on("cv-player-timeupdate",_.bind(this.onTimeUpdate,this))}},hasWebplayerIframe:function(){return!this._webplayerIframe||this._webplayerIframe.length===0?!1:!0},isReady:function(){return!!this.eventsApi},onRendered:function(){this.registerWebPlayerApiInstance()}})}(ClickView.Shared,EasyMoney);!function(n,t){"use strict";n.Shared.Views.SpinJsView=t.View.extend({name:"SpinJsView",className:"spin-js-loader",template:n.Shared.Templates.SpinJsView,defaults:{loadingTextMargin:15,loadingText:null,mask:!1,cover:!1,imageUrl:"/Assets/images/cv-loader-orange.gif",spinColor:"#f8981d",spinOptions:{lines:11,length:4,width:4,radius:6,corners:1,rotate:0,direction:1,speed:1,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2e9,top:"50%",left:"50%"}},ui:{$image:".image",text:".loading-text"},initialize:function(){this.options.module&&(this.module=options.module);this.options.spinOptions.color=this.options.spinColor;this.options.spinOptions=_.extend({},this.options.spinOptions,this.options.customSpinOptions)},getModel:function(){return this.options},onRender:function(){this.options.cover&&this.$el.addClass("cover");this.options.additionalClasses&&this.options.additionalClasses.length>0&&this.$el.addClass(this.options.additionalClasses.join(" "));this.options.mask&&this.$el.find(".loading-mask").fadeIn({duration:300,easing:"easeInOutQuint"})},onRendered:function(){this.spinner=new Spinner(this.options.spinOptions).spin(this.ui.$image[0]);this.options.loadingText&&this.ui.text.css({"margin-top":this.options.spinOptions.radius*2+this.options.loadingTextMargin+"px"})}})}(ClickView,EasyMoney),function(n,t){var i=n.Shared;i.Views.StickySubscribeBannerView=t.View.extend({name:"StickySubscribeBanner",className:"sticky-banner navbar-fixed-bottom",template:i.Templates.StickySubscribeBanner,ajaxHelper:i.Utils.AjaxHelper,defaults:{bannerText:"Sign up now"},bindings:{"[name=emailAddress]":{observe:"emailAddress"}},ui:{$btnContainer:".btn-viewpart",$formGroup:".form-group",$helpBlock:".help-block"},events:{"click .subscribe":"handleSubscription","click .unpin":"onClickHide"},initialize:function(){if(this.localStorageHelper=i.Utils.LocalStorageHelper,!this.options.localStorageKeys&&!this.options.localStorageKeys.closed&&!this.options.localStorageKeys.pinned)throw Error("Local storage keys are required to avoid spamming the user. Format should be unique for this view.");this.localStorageHelper.get(this.bannerIsClosed())||(this.listenTo(this.model,"change:subscribeConfirmed",this.render),this.spinnerModel=new i.Models.SpinnerModel,n.Data.User.email&&this.model.set("emailAddress",n.Data.User.email))},bannerIsPinned:function(){return this.options.localStorageKeys.pinned},bannerIsClosed:function(){return this.options.localStorageKeys.closed},isAuthenticated:function(){return!!n.Data.User.username},isVerified:function(){return!!n.Data.User.email},sendEmail:function(){var n=this.model.get("confirmUrl");if(!n)throw Error("ConfirmUrl must be set on EmailSubscribe model");this.ajaxHelper.post(n,this.model.toJSON()).done(_.bind(function(){this.model.set("subscribeConfirmed",!0)},this))},onClickHide:function(){this.localStorageHelper.get(this.bannerIsPinned())||(this.localStorageHelper.set(this.bannerIsPinned(),!0),this.render())},unpinBanner:function(){this.$el.removeClass("navbar-fixed-bottom")},getCustomerType:function(){return n.Data.User.username?n.Data.User.modules.twentyFourSeven?"247Customer":"baseCustomer":"nonCustomer"},onSubscribeSuccess:function(){var n=_.bind(function(){this.localStorageHelper.set(this.bannerIsClosed(),!0);this.close()},this);this.$el.addClass("slide-away");setTimeout(n,3e3)},handleSubscription:function(n){return(n.stopPropagation(),n.preventDefault(),this.spinnerModel.get("showSpinner"))?!1:this.isAuthenticated()&&this.isVerified()?(this.spinnerModel.show(),this.sendEmail(),!1):this.isAuthenticated()&&!this.isVerified()?(this.renderVerifyPopup(),!1):(this.spinnerModel.show(),this.model.validate(),!this.model.isValid())?(this.spinnerModel.hide(),!1):(this.sendEmail(),!1)},bindValidation:function(){Backbone.Validation.bind(this,{valid:_.bind(function(){this.ui.$formGroup.removeClass("has-error");this.ui.$helpBlock.html("").addClass("hide-error")},this),invalid:_.bind(function(n,t,i){this.ui.$formGroup.addClass("has-error");this.ui.$helpBlock.html(i).removeClass("hide-error")},this)})},logAnalytics:function(){var t,r=this.model.get("verifiedStatus");_.isNumber(r)&&(r===0&&(t="pending"),r===1&&(t="verified"),r===2&&(t="expired"));i.Utils.AnalyticsService.logEmailCampaignSubscribe({customerType:this.getCustomerType(),email:n.Data.User.email||this.model.get("emailAddress"),campaign:this.model.get("campaign"),verifiedStatus:t})},renderVerifyPopup:function(){var n=new i.Models.UserEmail,t=new i.Views.VerifyEmailView({text:"To ensure you're notified when a new TV guide is released, please verify your email:",model:n,verifyUrl:this.model.get("verifyUrl"),resendUrl:this.model.get("resendUrl"),isPopup:!0,verifiedConfirmation:"Thank you for subscribing!"}),r;this.listenTo(t,"close",function(){n.get("confirmation")&&this.model.set({verifiedStatus:n.get("status"),emailAddress:n.get("emailAddress"),subscribeConfirmed:!0})});r=new i.Views.PopupView({cssId:"email-confirmation",view:t,title:"Please verify your email"});r.selfRender()},renderButtonContainer:function(){var n=this.isAuthenticated()?"Notify me":"Subscribe";this.renderView(this.ui.$btnContainer,new i.Views.SpinnerButtonView({model:this.spinnerModel,buttonText:n,className:"btn sticky-banner-btn subscribe white",spinJSOptions:{spinColor:"#979797",spinnerSize:"medium"}}))},onBeforeRender:function(){var n=!!this.localStorageHelper.get(this.bannerIsClosed());return!n},viewOptions:function(){return{bannerText:this.options.bannerText,isAuthenticated:this.isAuthenticated(),isPinned:this.localStorageHelper.get(this.bannerIsPinned())}},onRender:function(){if(this.stickit(),this.bindValidation(),this.model.get("subscribeConfirmed")){this.logAnalytics();setTimeout(_.bind(function(){this.onSubscribeSuccess()},this),3e3);return}this.localStorageHelper.get(this.bannerIsPinned())&&this.unpinBanner();this.renderButtonContainer()}})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.Views.SubNavItemView=t.View.extend({name:"SubNavItemView",tagName:"li",className:function(){var n=[this.model.get("cssClass"),"item"];return!this.model.get("bulkAction")||n.push("bulk"),n.join(" ").trim()},defaults:{},template:'<span class="inner"><i class="icon"><\/i>{{text}}<\/span>',events:{click:"onClick"},initialize:function(){this.listenTo(this.model,"change:disabled",this.render)},alertMessage:function(){alert("Please select a video first.")},onClick:function(n){if(this.model.get("stopPropagation")&&(n.stopPropagation(),n.preventDefault()),this.isDisabled()){this.alertMessage();return}this.model.trigger("click",this,n)},renderTooltip:function(){this.$el.attr("data-toggle","tooltip");this.$el.attr("data-placement","top");this.$el.attr("title",this.model.get("desc"));this.$el.tooltip()},isDisabled:function(){return this.model.get("disabled")&&!this.model.get("alwaysActive")},onRender:function(){this.$el.removeClass("disabled");this.isDisabled()&&this.$el.addClass("disabled");this.renderTooltip()}});n.Views.SubNavView=t.ListView.extend({name:"SubNavView",className:"cv-subnav",childView:i,template:'{{#if checkAll}}<li><div class="check-all"><input type="checkbox" name="check-all" id="check-all" {{checked checked}} title="Check all"><\/div><\/li>{{/if}}',initialize:function(){this.itemCollection=this.options.itemCollection;this.listenTo(this.collection,"click",this.subnavClicked);this.listenTo(this.itemCollection,"reset",this.render);this.listenTo(this.itemCollection,"change:checked",this.updateSubNavItemStates)},defaults:{showCheckAll:!0},events:{"click #check-all":"checkAll"},subnavClicked:function(n){var t=n.model,i=this.getCheckedItems();_.each(i,function(i){i.trigger(t.get("id"),i,n)});this.itemCollection.trigger("bulk:"+t.get("id"),this.getCheckedItems(),n)},addOne:function(n){var t=this.childView,i;n.get("view")&&(t=n.get("view"));i=_.extend({},{model:n},n.get("args"));this.renderView(this.$el,new t(i),{empty:!1})},updateSubNavItemStates:function(){var n=this.getCheckedItems();this.collection.each(function(t){if(n.length==1){t.set("disabled",!1);return}if(n.length>1&&t.get("bulkAction")){t.set("disabled",!1);return}t.set("disabled",!0)})},getModel:function(){var n=this.getCheckedItems().length==this.itemCollection.length;return{checked:n,checkAll:this.options.showCheckAll}},getCheckedItems:function(){return this.itemCollection.where({checked:!0})},checkAll:function(n){var t=n.currentTarget.checked;this.itemCollection.each(function(n){n.set({checked:t},{silent:!0});n.trigger("selected")});this.updateSubNavItemStates()},onRender:function(){this.updateSubNavItemStates();t.ListView.prototype.onRender.apply(this,arguments)}})}(ClickView.Shared,EasyMoney),function(n,t){"use strict";n.Shared.Views.TabCountView=t.View.extend({name:"TabCountView",tagName:"span",template:n.Shared.Templates.TabCount,initialize:function(){this.listenTo(this.collection,"add remove sync",this.event)},getCount:function(){var n;return this.collection instanceof t.PagedCollection&&(n=this.collection.totalItems()),n?n:this.collection.length},viewOptions:function(){return{count:this.getCount()}}});n.Shared.Views.TabView=t.View.extend({name:"TabView",className:function(){return"cv-tab-view "+(this.options.secondary?"secondary":"")},template:'<div class="tab-navigation"><\/div><div class="tab-body"><\/div>',ui:{$tabBody:".tab-body",$tabNavigation:".tab-navigation"},renderTabNavigation:function(){this.renderView(this.ui.$tabNavigation,new n.Shared.Views.TabNavView({collection:this.collection}))},renderTabs:function(){this.renderView(this.ui.$tabBody,new n.Shared.Views.TabBodyView({collection:this.collection}))},collapseIfFat:function(){if(!(window.innerWidth<480)&&this.$el.is(":visible")){if(this.totalWidth){this.totalWidth<this.ui.$tabNavigation.outerWidth()&&(this.$el.removeClass("collapse-tabs"),this.totalWidth=0);return}var t=this.ui.$tabNavigation.find("li"),n=_.reduce(t,function(n,t){return n+$(t).outerWidth()},0);n>this.ui.$tabNavigation.outerWidth()&&(this.totalWidth=n,this.$el.addClass("collapse-tabs"))}},onRender:function(){this.collection.length>1&&this.renderTabNavigation();this.renderTabs()},onRendered:function(){this.collapseIfFat();$(window).bind("resize",_.bind(_.debounce(this.collapseIfFat,300),this))},onClose:function(){$(window).unbind("resize")}});n.Shared.Views.TabNavItemView=t.View.extend({name:"TabNavItemView",tagName:"li",model:n.Shared.Models.Tab,defaults:{showTabCountWhenZero:!1},template:'<div><span class="inner">{{#if icon}}<svg><use xlink:href="{{icon}}"><\/use><\/svg>{{/if}}{{{text}}}<\/span><div class="tab-count-viewpart"><\/div><\/div>{{#if beta}}<span class="beta">BETA<\/span>{{/if}}',events:{click:"onClick"},initialize:function(){this.countCollection=this.model.get("countCollection");this.countCollection instanceof t.Collection&&this.listenTo(this.countCollection,"add remove sync",this.renderTabCount);this.listenTo(this.model,"change:selected",this.render)},onClick:function(){if(this.model.get("selected")){this.model.collection.trigger("dropdown");return}this.model.collection.trigger("dropdown:hide");this.model.set({selected:!0});Backbone.history.trigger("userAction",this.model.get("text"),"tabNavigation")},renderTabCount:function(){if(this.countCollection&&this.countCollection instanceof t.Collection){var i=new n.Shared.Views.TabCountView({collection:this.countCollection});this.renderView(this.$el.find(".tab-count-viewpart"),i)}},onRender:function(){this.$el.removeClass("selected");this.model.get("selected")&&this.$el.addClass("selected");this.model.get("tabId")&&this.$el.attr("id",this.model.get("tabId"));this.renderTabCount()}});n.Shared.Views.TabNavView=t.ListView.extend({name:"TabNavView",childView:n.Shared.Views.TabNavItemView,initialize:function(){this.listenTo(this.collection,"change:selected",this.deSelectAll);this.listenTo(this.collection,"dropdown",this.dropdown);this.listenTo(this.collection,"dropdown:hide",this.hideDropdown)},dropdown:function(){this.$el.toggleClass("dropdown")},hideDropdown:function(){this.$el.removeClass("dropdown")},deSelectAll:function(n){n.get("selected")&&_.each(this.collection.where({selected:!0}),function(t){t!==n&&t.set({selected:!1})},this)}});n.Shared.Views.TabBodyItemView=t.View.extend({id:function(){return this.model.get("cssId")||""},name:"TabBodyItemView",model:n.Shared.Models.Tab,tagName:"div",template:!1,initialize:function(){this.listenTo(this.model,"change:selected",this.changeTabView)},className:function(){var n="tab-pane";return this.model.get("selected")&&(n+=" active"),n},ensureInstance:function(n){if(typeof n=="function"){var t=new n(this.model.get("initParams"));return this.model.set("view",t),this._view=t,t}return this._view=n,n},onRender:function(){this.toggleHidden();this.model.get("preload")&&this.renderTab();this.model.get("selected")||this.$el.hide()},renderTab:function(){this.model.get("rendered")||(this.renderView(this.$el,this.ensureInstance(this.model.get("view"))),this.model.set("rendered",!0))},changeTabView:function(){this.toggleHidden()},toggleHidden:function(){this.model.get("selected")?(this.model.get("rendered")||this.renderTab(),this.show(),this._view&&this._view.trigger("tab:show"),this.model.collection.trigger("tab:change",this._view)):(this.hide(),this._view&&this._view.trigger("tab:hide"))}});n.Shared.Views.TabBodyView=t.ListView.extend({name:"TabBodyView",tagName:"div",childView:n.Shared.Views.TabBodyItemView,template:!1})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Views.VideoTagItemView=t.View.extend({name:"VideoTagItemView",tagName:"li",className:"tag selectable",template:function(n){return n.title}});i.Views.VideoTagListView=t.ListView.extend({name:"VideoTagListView",className:"tags",childView:i.Views.VideoTagItemView})}(ClickView,EasyMoney);!function(n,t){var i=n.Shared;i.Views.ThumbnailView=t.View.extend({name:"ThumbnailView.js",template:i.Templates.Thumbnail,className:"cv-thumbnail",defaults:{badge:!1,lazyload:!1,thumbnailSize:"small"},initialize:function(){this.options.video?this.video=this.options.video:this.model instanceof n.Shared.Models.Video&&(this.video=this.model)},getActionUrl:function(){return this.options.clickable?this.model.actionUrl():!1},getThumbnailUrl:function(){return this.options.thumbnailUrl?this.options.thumbnailUrl:this.model.thumbnail&&this.model.thumbnail.url?this.options.thumbnailUrl:n.Data.Config.urls.imageCDN+"/v1/thumbnails/trackingcode/"+this.video.tokenId},viewOptions:function(){return{video:this.video,options:this.options,actionUrl:this.options.actionUrl||this.getActionUrl(),thumbnailUrl:this.getThumbnailUrl()}}})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.Views.TitleBarButtonView=t.View.extend({tagName:"li",name:"TitlebarButton",className:function(){return[this.model.get("cssClass"),"button"].join(" ").trim()},template:'<span class="inner"><i class="icon"><\/i>{{text}}<\/span>',events:{click:"onClick"},onClick:function(){}});n.Views.TitleBarOptionsView=n.Views.TitleBarButtonView.extend({template:"<div class='video-actions-viewpart'><\/div>",ui:{$videoActions:".video-actions-viewpart"},initialize:function(){n.Views.TitleBarButtonView.prototype.initialize.apply(this,arguments);this.listenTo(this.collection,"change:selected destroy remove",this.render)},renderVideoActions:function(){var t=new n.Views.VideoActionsListView({collection:this.options.actions,itemModel:this.collection,text:this.getButtonText()});this.renderView(this.ui.$videoActions,t)},getButtonText:function(){return"Options ("+this.collection.selected().length+" videos)"},onBeforeRender:function(){return this.collection.selected().length<2?(this.hide(),!1):(this.show(),!0)},onRender:function(){this.renderVideoActions()}});n.Views.TitleBarButtonsListView=t.ListView.extend({childView:n.Views.TitleBarButtonView,name:"titleBarButtonsListView",buildChildView:function(n){var i=_.extend({},{model:n},n.get("args")),t=this.childView;return n.get("view")&&(t=n.get("view")),new t(i)}});n.Views.TitleBarView=t.View.extend({name:"TitleBar",className:"cv-titlebar",template:n.Templates.TitleBar,_titleTemplate:"{{title}}",_subtitleTemplate:"{{subtitle}}",ui:{buttonsContainer:".buttons-container",title:".title",subtitle:".sub-title"},initialize:function(){this.buttonsCollection=this.options.buttons;this._titleTemplate=this.options.title||this._titleTemplate;this._subtitleTemplate=this.options.subtitle||this._subtitleTemplate;this.model&&this.listenTo(this.model,"change",this.render)},getModel:function(){return this.model?this.model.toJSON():{}},renderButtons:function(){var t=new n.Views.TitleBarButtonsListView({collection:this.buttonsCollection});this.renderView(this.ui.buttonsContainer,t)},renderTitle:function(){this.ui.title.html(this.renderTemplate(this._titleTemplate))},renderSubtitle:function(){var n=this.renderTemplate(this._subtitleTemplate);this.ui.subtitle.html(n)},onRender:function(){this.renderTitle();this.renderSubtitle();this.renderButtons()}});n.Models.TitleBarButton=t.Model.extend({defaults:{view:null,args:{},text:"",cssClass:"",order:0,stopPropagation:!0}});n.Collections.TitleBarCollection=t.Collection.extend({model:n.Models.TitleBarButton,comparator:"order"})}(ClickView.Shared,EasyMoney),function(n,t){"use strict";var i=n.Shared;i.Views.ToggleButtonView=t.View.extend({className:"toggle-button-container",template:'{{#if text}}<div class="toggle-label">{{text}}<\/div>{{/if}}<div class="toggle-button {{#if toggleOn}}on{{/if}}{{#if toggleDisable}} disabled{{/if}}"><span class="handle"><\/span><\/div>',defaults:{toggleOn:!1,toggleDisable:!1,text:""},ui:{$label:".toggle-label",$button:".toggle-button"},events:{"click .toggle-button":"onClick"},initialize:function(){this.model&&!this.model.get("toggleOn")&&this.model.set("toggleOn",!!this.options.toggleOn);this.model&&!this.model.get("toggleDisable")&&this.model.set("toggleDisable",!!this.options.toggleDisable);this.model||(this.model=new t.Model({toggleOn:!!this.options.toggleOn,toggleDisable:!!this.options.toggleDisable}));this.listenTo(this.model,"change:toggleOn",this.onToggle);this.listenTo(this.model,"change:toggleDisable",this.onDisable)},onClick:function(n){return n.preventDefault(),n.stopPropagation(),this.model.get("toggleDisable")||this.toggle(),!1},onToggle:function(){this.model.get("toggleOn")?this.ui.$button.addClass("on"):this.ui.$button.removeClass("on");this.trigger("toggle",this.model.get("toggleOn"));this.model.trigger("toggle",this.model.get("toggleOn"))},onDisable:function(){this.model.get("toggleDisable")?this.ui.$button.addClass("disabled"):this.ui.$button.removeClass("disabled")},toggle:function(){this.model.set("toggleOn",!this.model.get("toggleOn"))},toggleOff:function(){this.model.set("toggleOn",!1)},toggleOn:function(){this.model.set("toggleOn",!0)},isDisabled:function(){return this.model.get("toggleDisable")===!1},toggled:function(n){n?this.toggleOn():this.toggleOff()},toggleEnable:function(){this.model.set("toggleDisable",!1)},toggleDisable:function(){this.model.set("toggleDisable",!0)},viewOptions:function(){return{toggleOn:this.model.get("toggleOn"),toggleDisable:this.model.get("toggleDisable"),text:this.options.text}}})}(ClickView,EasyMoney),function(n,t){"use strict";n.Shared.Views.ToggleInteractionView=t.View.extend({className:"interactive-toggle-view",template:'<span class="info" title="This toggles an interactive layer on your video.">i<\/span><span class="preview-interactive-text">Enable Interactive<\/span>',ui:{info:".info"},events:{"click .info":"clickInfo","click .onboarding-tooltip-hook":"stopPropagation"},onRender:function(){this.toggleButton=new n.Shared.Views.ToggleButtonView({toggleOn:this.options.interactiveMode});this.listenTo(this.toggleButton,"toggle",this.toggle);this.renderView(this.$el,this.toggleButton,{prepend:!0,empty:!1});this.ui.info.tooltip();this.options.showTour||this.ui.info.hide()},toggle:function(){this.trigger("toggle")},stopPropagation:function(n){n.stopPropagation()},clickInfo:function(i){if(i.stopPropagation(),this.ui.info.tooltip("destroy"),this.toolTipShowing){t.OnBoarding.stop();this.toolTipShowing=!1;return}this.toolTipShowing=!0;var r=this;t.OnBoarding.start([{name:"info",caption:"To find out more about interactive videos you can take a short tour.",position:r.toggleButton.toggled()?"top":"bottom",buttonText:"Take tour",selector:".info",before:!0,windowClickClose:!0,offset:{float:"right"},css:r.toggleButton.toggled()?{left:"-132px",bottom:"calc(100% + 30px)"}:{left:"-132px",top:"calc(100% + 40px)"},action:function(){if(n.Data.showInteractiveTour=!0,r.toggleButton.toggled()){t.Events.trigger("startTour:interactive");return}r.toggleButton.toggle()},onOnBoardingClosed:function(){r.ui.info.tooltip()}}])},onBoarding:"info",onOnBoardingClosed:function(){this.toolTipShowing=!1}})}(ClickView,EasyMoney),function(n,t,i){t.Views.VerifyEmailView=i.View.extend({name:"VerifyEmailView.js",tagName:"form",className:"verify-email form-group",ajaxHelper:n.Shared.Utils.AjaxHelper,bindings:{"[name=emailAddress]":{observe:"emailAddress"}},defaults:{text:"Please verify you email",textLabel:"",resendUrl:"",verifyUrl:"",verifiedConfirmation:"",isPopup:!1},events:{"click .update-email-btn":"onClickUpdate","click .update-email":"onClickUpdate","click .cancel-update":"onClickCancelUpdate","click .verify-email":"onClickVerify","click .pending-email":"onClickResend","blur #user-email":"validateInput"},ui:{$btnContainer:".btn-viewpart"},template:function(){return this.options.isPopup?t.Templates.VerifyEmailPopup.apply(this,arguments):t.Templates.VerifyEmail.apply(this,arguments)},initialize:function(){if(!this.model||!(this.model instanceof t.Models.UserEmail))throw Error(this.name+": UserEmail model is required at instantiation.");this.listenTo(this.model,"sync",this.onSync);this.model.hasLoaded()||this.model.fetch();this.spinnerModel=new t.Models.SpinnerModel},validateInput:function(){var n=this.model.get("emailAddress");n&&this.model.validate()},triggerInvalidate:function(n){n||(n={});Backbone.Validation.callbacks.invalid(this,n.name,n.error,null)},cancelEvent:function(n){n.stopPropagation();n.preventDefault()},onSync:function(n){this.originalUserEmail=n.clone();this.spinnerModel.hide();this.model.isVerified()&&this.model.set("confirmation",this.options.verifiedConfirmation);this.render()},onClickCancelUpdate:function(n){return this.cancelEvent(n),this.originalUserEmail&&this.model.set(this.originalUserEmail.toJSON()),this.model.unset("updateEmail"),this.render(),!1},onClickUpdate:function(n){return(this.cancelEvent(n),this.model.validate(),!this.model.isValid())?!1:(this.model.clear({silent:!0}),this.model.set("updateEmail",!0),this.model.setLoaded(),this.render(),!1)},onClickVerify:function(n){if(this.cancelEvent(n),this.model.validate(),!this.model.isValid())return!1;var t=_.bind(function(){this.model.set("confirmation","A verification email has been sent to "+this.model.get("emailAddress")+".");this.spinnerModel.hide();this.render()},this),i=_.bind(function(){this.spinnerModel.hide();this.triggerInvalidate({name:"emailAddress",error:"An error has occurred and your email could not be saved. Please try again shortly."})},this);return this.sendEmail({type:"verify",success:t,fail:i}),!1},onClickResend:function(n){this.cancelEvent(n);var t=_.bind(function(){this.model.set("confirmation","A verification email has been re-sent to "+this.model.get("emailAddress"));this.spinnerModel.hide();this.render()},this),i=_.bind(function(){this.spinnerModel.hide();this.triggerInvalidate({name:"emailAddress",msg:"Failed to send verification email. Please try again."})},this);return this.sendEmail({type:"resend",success:t,fail:i}),!1},sendEmail:function(n){n||(n={});this.spinnerModel.show();var t;if(n.type==="resend"&&(t=this.options.resendUrl||this.model.resendUrl),n.type==="verify"&&(t=this.options.verifyUrl),!t&&n.type==="verify"){this.model.save().then(n.success,n.fail);return}if(!t)throw Error("No endpoint specified for email verification");this.ajaxHelper.post(t,this.model.toJSON()).then(n.success,n.fail)},getText:function(){return this.model.isPending()?"A confirmation email has been sent to the email address below. Please check your inbox to verify your email.":this.model.get("confirmation")?"A confirmation email has been sent to "+this.model.get("emailAddress")+". Please check your inbox to verify your email.":this.options.text},getButtonText:function(){return this.model.isPending()?"Re-send Verification Email":this.model.isVerified()?"Update Email":"Verify Email"},getButtonClass:function(){return"btn"+(this.model.isPending()?" pending-email grey":this.model.isVerified()?" update-email-btn grey":" verify-email orange")},renderButtonContainer:function(){this.renderView(this.ui.$btnContainer,new t.Views.SpinnerButtonView({model:this.spinnerModel,buttonText:this.getButtonText(),className:this.getButtonClass(),spinJSOptions:{spinColor:"#979797",spinnerSize:"medium"}}))},viewOptions:function(){var n={text:this.getText(),textLabel:this.options.textLabel,showPartial:!this.model.hasLoaded(),noEmail:!this.model.get("emailAddress")&&!this.model.isPending(),pendingVerified:this.model.isPending()};return this.options.isPopup?n:_.extend({},n,{verified:this.model.isVerified()})},onRender:function(){this.stickit();Backbone.Validation.bind(this);this.renderButtonContainer()}})}(ClickView,ClickView.Shared,EasyMoney);!function(n,t){var i=n.Shared;i.Views.WarningView=t.View.extend({template:'<div class="inner">{{#if heading}}<h4>{{heading}}<\/h4>{{/if}}<p>{{{message}}}<\/p><\/div>',className:"please-note",viewOptions:function(){return this.options}})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.Shared;i.Views.WebPlayerView=t.View.extend({tagName:"div",name:"WebPlayerView",className:"video-container",model:i.Models.WebPlayer,template:i.Templates.WebPlayer,ui:{iframe:"iframe"},_enableIeFs:!1,_eventsApi:null,initialize:function(){this._enableIeFs=this.isTop();this.eventFns={timeupdate:_.bind(this.onTimeupdate,this),play:_.bind(this.onPlay,this),pause:_.bind(this.onPause,this),ended:_.bind(this.onEnded,this),pong:_.bind(this.onPong,this),showDeviceToggle:_.bind(this.showDeviceToggle,this)}},isTop:function(){return window.top===window},initWebplayerEvents:function(){if(this.ui.iframe&&this.ui.iframe.length!==0&&CVEventsApi&&this._enableIeFs){var t=this;this.ui.iframe.on("load",function(){var r=$(this).get(0),i;t._eventsApi=new CVEventsApi(r.contentWindow);t._eventsApi.on("cv-player-pong",t.eventFns.pong);t._eventsApi.trigger("cv-player-ping");t._eventsApi.on("_cvwp:fsc",_.bind(t.onFullscreenChange,t));t._eventsApi.trigger("_cv:showfsbtn");t._eventsApi.on("cv-player-timeupdate",t.eventFns.timeupdate);t._eventsApi.on("cv-player-play",t.eventFns.play);t._eventsApi.on("cv-player-pause",t.eventFns.pause);t._eventsApi.on("cv-player-ended",t.eventFns.ended);if(i=n.Data.User,i.role==2&&t.options.name!=="PreviewVideo"){t._eventsApi.trigger("_cv:showdevicesbtn");t._eventsApi.on("_cvwp:devices:click",t.eventFns.showDeviceToggle)}})}},onTimeupdate:function(n,t){this.model.set("ready",!0);this.model.set("currenttime",t)},onPlay:function(){this.model.set("ready",!0);this.model.set("paused",!1)},onPause:function(){this.model.set("ready",!0);this.model.set("paused",!0)},onEnded:function(){this.model.trigger("ended")},onPong:function(){this.model.set("ready",!0)},pause:function(){this._eventsApi&&this._eventsApi.trigger("cv-player-pause")},play:function(){this._eventsApi&&this._eventsApi.trigger("cv-player-play")},togglePlay:function(){this.model.get("paused")?this.play():this.pause()},onFullscreenChange:function(n,t,i){if(t){this.requestFs(i);return}this.cancelFs(i)},showDeviceToggle:function(n){this.model.trigger("showDevices",!!n)},requestFs:function(n){n||$("html").addClass("player-fullscreen");this.isDesktopApp()&&window.external.PostMessage("clickview.player.request.enter.fullscreen")},cancelFs:function(n){n||$("html").removeClass("player-fullscreen");this.isDesktopApp()&&window.external.PostMessage("clickview.player.request.exit.fullscreen")},isDesktopApp:function(){return navigator.userAgent.indexOf("ClickView.Windows.Desktop.App/")!==-1},onRender:function(){this.initWebplayerEvents()},onClose:function(){this._eventsApi&&(this._eventsApi.off("_cvwp:fsc"),this._eventsApi.off("cv-player-timeupdate"),this._eventsApi.off("cv-player-play"),this._eventsApi.off("cv-player-pause"),this._eventsApi.off("cv-player-ended"),this._eventsApi.off("cv-player-pong"),this._eventsApi.off("_cvwp:devices:click"))}})}(ClickView,EasyMoney),function(n,t,i){"use strict";n.Views.WysiHtmlView=t.View.extend({name:"WysiHtmlView.js",template:ClickView.Shared.Templates.WysiHtml,className:"wysihtml-view",ui:{$createLinkPopover:".create-link-container",$createLinkButton:".create-link-button",$createLink:".create-link",$editor:"#text-editor"},events:{"click .toolbar":"fireChangeNameEvent","paste #text-editor":"fireChangeNameEvent","keyup #text-editor":"fireEditorChangeEvent","click .removeLink":"fireChangeNameEvent"},test:function(n){return n.preventDefault(),n.stopPropagation(),!1},getValue:function(){return this.editor.getValue()},getEditor:function(){return this.editor},getHtml:function(){return this.ui.$editor.html()},fireEditorChangeEvent:function(){n.Helpers.GetBrowserName()==="Internet Explorer"&&this.fireChangeNameEvent()},fireChangeNameEvent:function(){this.ui.$editor.trigger("change")},initializeEditor:function(){this.listenTo(this.editor,"save:dialog",i.bind(this.onSaveLinkDialog,this));this.listenTo(this.editor,"show:dialog",i.bind(this.onShowLinkDialog,this));this.listenTo(this.editor,"hide:dialog",i.bind(this.onHideLinkDialog,this));this.listenTo(this.editor,"cancel:dialog",i.bind(this.onCancelLinkDialog,this))},onSaveLinkDialog:function(){this.fireChangeNameEvent()},onCancelLinkDialog:function(){this.ui.$createLinkButton.tooltip()},onShowLinkDialog:function(){this.ui.$createLinkButton.tooltip("destroy");this.ui.$createLink.removeClass("hidden")},onHideLinkDialog:function(){this.ui.$createLinkButton.tooltip()},onRendered:function(){this.editor=new wysihtml5.Editor("text-editor",{toolbar:"text-editor-toolbar",parserRules:wysihtml5ParserRules});this.listenTo(this.editor,"load",i.bind(this.initializeEditor,this));$('[data-toggle="tooltip"]').tooltip()},onBeforeClose:function(){this.stopListening(this.editor);this.editor.toolbar&&this.editor.toolbar.destroy();this.editor.destroy();this.ui.$editor.remove();$("#text-editor-toolbar").remove();$("body").removeClass("wysihtml5-supported")}})}(ClickView.Shared,EasyMoney,_);!function(n,t){n.Views.ClipBarView=t.View.extend({name:"ClipBarView.js",template:n.Templates.ClipBar,className:"clip-bar",getChapter:function(){return this.options.chapters[this.model.get("startChapterIndex")-1]||_.first(this.options.chapters)},isMetadataChapters:function(){if(this.options.chapters&&this.options.chapters.length&&this.options.video.get("chapters").length)return!0},viewOptions:function(){if(this.isMetadataChapters())return{left:Math.ceil(this.model.get("startTime")/(this.options.video.get("duration")/1e3)*100),width:Math.ceil(this.model.getDuration()/(this.options.video.get("duration")/1e3)*100)};var n=this.getChapter(),t=Math.ceil(this.model.get("startTime")/n.duration*100),i=Math.ceil(this.model.getDuration()/n.duration*100);return{left:t,width:i}}})}(ClickView.Shared,EasyMoney),function(n,t){"use strict";var i=n.Shared;i.Views.ClippingToolView=t.View.extend({name:"ClippingToolView",template:i.Templates.ClippingTool,ui:{createClip:".create-clip",addNewClip:".add-new-clip"},events:{"click .add-new-clip":"onAddNewClipClick","click .create-clip":"onCreateClipClick","click .cancel-button":"onCancelCreateClipClick","keyup .startTime":"onUpdateStartTimeKeyUp","keyup .endTime":"onUpdateEndTimeKeyUp"},bindings:function(){return{"[name=name]":{observe:"name",setOptions:{validate:!0}},"[name=description]":{observe:"description"},"[name=startTime]":{observe:"startTime",onGet:function(n){return this.convertToTime(n)},onSet:function(n){return this.isTimeValid(n)?this.convertToSeconds(n):""},setOptions:{validate:!0}},"[name=endTime]":{observe:"endTime",onGet:function(n){return this.convertToTime(n)},onSet:function(n){return this.isTimeValid(n)?this.convertToSeconds(n):""},setOptions:{validate:!0}}}},defaults:{isCreatingClip:!1},initialize:function(){this.webPlayer=this.options.webPlayer;this.model=new i.Models.Clip;this.chapters=this.options.chapters;this.currentChapter=_.find(this.chapters,function(n){return n.current});this.timeRegex=new RegExp(/^\d{1,2}(:\d{2}){1,2}$/)},setupNewClip:function(){var n=this.options.video.toJSON();this.model=new i.Models.Clip;this.model.set("video",n);this.model.set("videoId",n.id);this.model.set("videoDuration",this.currentChapter.duration);this.model.set("endTime",this.currentChapter.duration);this.listenTo(this.model,"validated:valid",this.clipIsValid);this.listenTo(this.model,"validated:invalid",this.clipIsInvalid)},onAddNewClipClick:function(){this.isReady()&&(this.eventsApi.trigger("cv-player-pause"),this.setupNewClip(),setTimeout(_.bind(function(){this.eventsApi.trigger("cv-player-cliptoolset",{start:"now"})},this),1),this.eventsApi.trigger("cv-player-cliptooltoggle",!0),this.options.isCreatingClip=!0,$(".empty-clip").addClass("hide"),this.render(),this.ui.createClip.addClass("disabled"))},onCancelCreateClipClick:function(n){return n.stopPropagation(),this.eventsApi.trigger("cv-player-cliptooltoggle",!1),this.eventsApi.trigger("cv-player-play"),this.options.isCreatingClip=!1,$(".empty-clip").removeClass("hide"),this.render(),!1},onCreateClipClick:function(n){if(n.stopPropagation(),!this.model.isValid(!0))return!1;this.eventsApi.trigger("cv-player-cliptooltoggle",!1);this.model.set("duration",this.model.getDuration());var i=function(){t.Events.trigger("clips:add",this.model);this.collection.resetPageData();this.collection.fetch({reset:!0})};return this.collection.create(this.model,{at:0,wait:!0,success:_.bind(i,this)}),this.options.isCreatingClip=!1,this.render(),!1},onUpdateStartTimeKeyUp:function(){this.model.isValid("startTime")&&this.eventsApi.trigger("cv-player-cliptoolset",{start:this.model.get("startTime")})},onUpdateEndTimeKeyUp:function(){this.model.isValid("endTime")&&this.eventsApi.trigger("cv-player-cliptoolset",{end:this.model.get("endTime")})},isTimeValid:function(n){return this.timeRegex.test(n)},clipIsValid:function(){this.ui.createClip.removeClass("disabled")},clipIsInvalid:function(){this.ui.createClip.addClass("disabled")},convertToSeconds:function(n){var t=n.split(":"),u=0,r=0,i=0;switch(t.length){case 1:i=Number(t[0]);break;case 2:r=Number(t[0]);i=Number(t[1]);break;case 3:u=Number(t[0]);r=Number(t[1]);i=Number(t[2])}return u*3600+r*60+i},convertToTime:function(n){return i.Helpers.formatDuration(n)},hasWebPlayer:function(){return this.webPlayer},isReady:function(){return!!this.eventsApi},registerWebPlayerApiInstance:function(){if(this.hasWebPlayer()&&(this.eventsApi=this.webPlayer._eventsApi,this.eventsApi)){this.eventsApi.on("cv-player-cliptoolupdate",_.bind(function(n,t){this.model.set({startTime:t.start,endTime:t.end,startChapterIndex:t.chapterIndex+1,videoDuration:t.duration})},this));this.eventsApi.on("cv-player-chapterchange",this.onChapterChange,this)}},onChapterChange:function(n,t,i){this.chapters&&(this.currentChapter=this.chapters[i])},onBeforeRender:function(){return this.hasWebPlayer()?!0:!1},viewOptions:function(){return{isCreatingClip:this.options.isCreatingClip,renderInPopup:!1}},onRender:function(){this.stickit();Backbone.Validation.bind(this,{model:this.model,valid:function(n,t){var i=n.$("[name="+t+"]"),r=i.closest(".form-group");r.removeClass("has-error");$(".help-block.error-"+t).html("").addClass("hidden")},invalid:function(n,t,i){var r=n.$("[name="+t+"]"),u=r.closest(".form-group");u.addClass("has-error");$(".help-block.error-"+t).html(i).removeClass("hidden")}})},onRendered:function(){this.registerWebPlayerApiInstance()},onClose:function(){this.eventsApi.off("cv-player-cliptoolupdate")}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Views.ClipsItemView=i.Views.VideoListItemView.extend({name:"ClipsItemView.js",template:i.Templates.ClipsItem,defaults:_.extend({},i.Views.VideoListItemView.prototype.defaults,{applyEllipses:!0,lazyload:!1,showMetadata:!1}),ui:{$contributorInfo:".contributor-viewpart",$videoActions:".video-actions-container",$clipBar:".clip-bar-viewpart",$timestamp:".timeago",$collapserMask:".cv-collapser-mask",$showMoreButton:".show-more",$description:".cv-description",$descriptionWrapper:".cv-description-wrapper"},initialize:function(){if(this.eventsApi=this.options.webPlayer._eventsApi,this.listenTo(this.model,"share-clip",this.onClickShareClip),this.listenTo(this.model,"play-clip",this.onClickPlayClip),this.listenTo(this.model,"edit-clip",this.onClickEditClip),this.listenTo(this.model,"delete-clip",this.onClickDeleteClip),this.listenTo(this.model,"sync",this.onSync),this.clonedModel=this.model.clone(),this.video=this.options.video||this.model.get("video"),!this.video)throw new Error("Please set a video model on the clip, or pass as an option to this ClipsItemView.js");},onSync:function(){this.render();this.trigger("rendered")},onClickPlayClip:function(){return this.previewClip(),n.Shared.Helpers.scrollToTop(),!1},onClick:function(n){n.preventDefault();n.stopPropagation();this.onClickPlayClip()},onClickShareClip:function(){var n=new i.Views.ShareTabView({itemModel:this.model,clip:this.model,resourceType:{type:"clip",name:"clip"}}),t=new i.Views.PopupView({view:n,title:"Share this clip",cssId:"cv-share-tab",showButtonContainer:!0});t.selfRender()},onClickEditClip:function(){var n=new i.Views.EditClipView({originalModel:this.model,model:this.clonedModel}),t=new i.Views.PopupView({view:n,title:"Edit Clip",cssId:"edit-clip",showButtonContainer:!1,clickClose:!0});t.selfRender()},onClickDeleteClip:function(){var i=this;n.Utils.Dialog({title:"Are you sure you would like to delete this clip?",content:"<p>This clip will be deleted permanently.<\/p>",buttons:[{text:"No, keep my clip",className:"btn grey"},{text:"Yes, delete this clip",className:"btn red",success:!0}]}).done(function(){_.isFunction(i.showDeleteLoader)&&i.showDeleteLoader();i.model.trigger("show:loader");i.model.destroy({wait:!0}).done(function(){t.Events.trigger("clips:destroy",this.clip)})})},previewClip:function(){this.eventsApi.trigger("cv-player-pause");var n=this.model.get("startChapterIndex")-1,t={start:this.model.get("startTime"),end:this.model.get("endTime"),chapterIndex:n,autoPlay:!0};this.eventsApi.trigger("cv-player-setclip",t)},getThumbnail:function(){return n.Shared.Helpers.getThumbnailUrl(this.video,{bgColor:"000"})},getActionUrl:function(){var n=new URI("/workspace/videos/"+this.video.get("id")+"/clips/"+this.model.get("id"));return n.search({t:this.model.get("startTime"),et:this.model.get("endTime"),i:this.model.get("startChapterIndex")}),n.toString()},getModel:function(){var t=this.model.get("description")||this.video.get("description");return t=n.Shared.Helpers.formatSafeHTML(t),this.model.set("descriptionMarkup",t),{options:this.options,name:this.model.get("name"),duration:this.model.getDuration({inMs:!0}),actionUrl:this.getActionUrl(),thumbUrl:this.getThumbnail(),description:t,dateCreated:this.model.get("dateCreated"),rating:this.video.get("rating"),badge:!1,descriptionId:this.model.get("id"),localTime:moment.utc(this.model.get("dateCreated")).toDate().toISOString(),lazyload:this.options.lazyload,showDate:!0,showMetadata:this.options.showMetadata,origin:this.getVideoOrigin(this.video),badgeTitle:this.getBadgeTitle(this.video)}},renderVideoActions:function(){var n=new i.Views.VideoActionsListView({collection:this.options.actions,itemModel:this.model});this.renderView(this.ui.$videoActions,n)},renderClipBar:function(){var n=new i.Views.ClipBarView({model:this.model,chapters:this.options.chapters,video:this.options.video});this.renderView(this.ui.$clipBar,n)},onRender:function(){this.renderVideoActions();this.renderClipBar()}})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.Shared;i.Views.ClipsListView=t.ListView.extend({childView:i.Views.ClipsItemView,className:"clip-list",initialize:function(){this.webPlayer=this.options.webPlayer;this.listenTo(this.collection,"add destroy",this.onCollectionUpdate);this.listenTo(t.Events,"clips:destroy",this.onClipDestroy)},onCollectionUpdate:function(){t.Events.trigger("clips:dirty:collection");this.render()},onClipDestroy:function(){var t=this.collection.currentPage(),i=this.collection.length<=0,n=t;i&&(n=n-1);this.collection.fetch({data:{page:n||1},parse:!0})},buildChildView:function(n){var t=_.extend({},_.omit(this.options,["collection","id"]),{model:n,chapters:this.options.chapters,video:this.options.video});return new this.childView(t)},onBeforeRender:function(){return!this.collection||!this.collection.length&&this.collection.currentPage()===1?(this.renderView(this.$el,new i.Views.EmptyClipsView({renderInClipsTab:!0})),!1):!0}});i.Views.ClipsListWrapperView=i.Views.VideoListView.extend({initialize:function(){i.Views.VideoListView.prototype.initialize.apply(this,arguments);this._loaded=this.collection.hasFetched()},renderVideos:function(){var n=new i.Views.ClipsListView({collection:this.collection,video:this.options.video,webPlayer:this.options.webPlayer,actions:this.options.actions,chapters:this.options.chapters});this.renderView(this.ui.videoList,n)}})}(ClickView,EasyMoney);!function(n,t){"use strict";n.Views.ClipsTabView=t.View.extend({className:"clip-tab",template:n.Templates.ClipsTab,ui:{clippingToolContainer:".clipping-tool-viewpart",clipList:".clip-list-viewpart",pagination:".pagination"},initialize:function(){this.collection=this.model.get("clips");this.collection.options.videoId=this.model.get("id");this.listenTo(this.collection,"sync",this.onSync);this.listenTo(this.options.webPlayer.model,"change:ready",this.getChapters)},onSync:function(n){n instanceof t.Collection&&this.render()},getChapters:function(){if(this.options.webPlayer){this.eventsApi=this.options.webPlayer._eventsApi;var n=ClickView.Shared.Helpers.Guid.newGuid();this.eventsApi.on("cv-player-querycallback-"+n,_.bind(function(n){var t=JSON.parse(n.data);this.chapters=_.first(t.data);this.render()},this));this.eventsApi.trigger("cv-player-query","getChapters",n)}},hasChapters:function(){return this.chapters},getActions:function(){return new n.Collections.VideoActionCollection(n.Utils.GetClipActions({shareClip:!0,editClip:!0,deleteClip:!0,playClip:!0}))},renderClippingTool:function(){var t=new n.Views.ClippingToolView({collection:this.collection,video:this.model,webPlayer:this.options.webPlayer,chapters:this.chapters});this.renderView(this.ui.clippingToolContainer,t)},renderClips:function(){var t=new n.Views.ClipsListWrapperView({video:this.model,collection:this.collection,webPlayer:this.options.webPlayer,actions:this.getActions(),chapters:this.chapters});this.renderView(this.ui.clipList,t)},renderLoader:function(){this.renderView(this.$el,new n.Views.SpinJsView({loadingText:"Loading clips...",cover:!0}))},onBeforeRender:function(){return this.collection.hasFetched()?this.options.webPlayer.model.get("ready")?this.hasChapters()?!0:(this.getChapters(),!1):(this.renderLoader(),!1):(this.renderLoader(),this.collection.fetch({data:{limit:7}}),!1)},onRender:function(){this.renderClippingTool();this.renderClips()}})}(ClickView.Shared,EasyMoney);!function(n,t){"use strict";var i=n.Shared,r=i.Views.PopupView.extend({template:i.Templates.ShareClipPopup}),u=i.Views.ClippingToolView.extend({template:i.Templates.ClippingTool,initialize:function(){this.webPlayer=this.options.webPlayer;this.model=this.model;this.timeRegex=new RegExp(/^\d{1,2}(:\d{2}){1,2}$/);this.listenTo(this.model,"validated:valid",this.clipIsValid);this.listenTo(this.model,"validated:invalid",this.clipIsInvalid)},events:{"click .create-clip":"onCreateClipClick","keyup .startTime":"onUpdateStartTimeKeyUp","keyup .endTime":"onUpdateEndTimeKeyUp"},addNewClip:function(){this.isReady()&&(setTimeout(_.bind(function(){this.eventsApi.trigger("cv-player-cliptoolset",{start:"now"})},this),1),this.eventsApi.trigger("cv-player-cliptooltoggle",!0),this.ui.createClip.addClass("disabled"))},onCreateClipClick:function(){if(!this.model.isValid(!0))return!1;var n=this;this.model.set("duration",this.model.getDuration());this.model.save().done(function(){t.Events.trigger("clips:add",n.model)})},viewOptions:function(){return{isCreatingClip:!0,renderInPopup:!0}},onRender:function(){this.stickit();Backbone.Validation.bind(this,{model:this.model})},onRendered:function(){this.registerWebPlayerApiInstance();this.addNewClip()}});i.Views.CreateClipView=t.View.extend({template:i.Templates.CreateClip,className:"create-clip",ui:{webPlayer:".web-player-viewpart",clippingTool:".clipping-tool-viewpart"},events:{"click #cancel-button":"close"},initialize:function(){this._webPlayerModel=new i.Models.WebPlayer({id:this.model.get("id"),parameters:i.Helpers.GetQueryString(),trackingCode:this.model.get("tokenId")});this.setupClippingTool();this.listenToOnce(this._webPlayerModel,"change:ready",this.renderClippingTool);this.listenTo(this.clip,"sync",this.onSaveSuccess);this.listenTo(this.clip,"error",this.onSaveError)},setupClippingTool:function(){var n=this.model.toJSON();this.clip=new i.Models.Clip;this.clip.set("video",n);this.clip.set("videoId",n.id)},onSaveSuccess:function(){this.close();var n=new i.Views.ShareTabView({itemModel:this.clip,clip:this.clip,resourceType:{type:"clip",name:"clip"}}),t=new r({view:n,cssId:"cv-share-tab",showButtonContainer:!0});t.selfRender()},onSaveError:function(){var n=new i.Views.ErrorView({heading:"Error",message:"Something went wrong. Please try again later.",imageUrl:""});this.renderView(this.$el,n)},renderWebPlayer:function(){this.webPlayerView=new i.Views.WebPlayerView({model:this._webPlayerModel});this.renderView(this.ui.webPlayer,this.webPlayerView);this.ui.webPlayer.hide()},renderClippingTool:function(){this.ui.webPlayer.show();var n=new u({model:this.clip,video:this.model,webPlayer:this.webPlayerView});this.renderView(this.ui.clippingTool,n)},renderSpinner:function(){this.renderView(this.ui.clippingTool,new i.Views.SpinJsView)},onRender:function(){this.renderWebPlayer();this.renderSpinner()}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Shared;i.Views.EditClipView=t.View.extend({template:i.Templates.EditClip,ui:{$updateClip:".update-clip"},bindings:function(){return{"[name=name]":{observe:"name",setOptions:{validate:!0}},"[name=description]":{observe:"description"}}},events:{"click .update-clip":"onUpdateClipClick","click .cancel-button":"onCancelClick"},initialize:function(){this.originalModel=this.options.originalModel;this.model.set("videoDuration",this.model.get("endTime"));this.originalModel.set("videoDuration",this.model.get("endTime"));this.listenTo(this.model,"validated:valid",this.clipIsValid);this.listenTo(this.model,"validated:invalid",this.clipIsInvalid);this.listenTo(this,"popup:onclickclose",this.onCancelClick)},clipIsValid:function(){this.ui.$updateClip.removeClass("disabled")},clipIsInvalid:function(){this.ui.$updateClip.addClass("disabled")},onUpdateClipClick:function(){if(!this.model.isValid(!0))return!1;this.originalModel.set({name:this.model.get("name"),description:this.model.get("description")});this.originalModel.save();this.close()},onCancelClick:function(){this.model.set(this.originalClip);this.originalModel.set({name:this.model.get("name"),description:this.model.get("description")});this.close()},onRender:function(){this.stickit();Backbone.Validation.bind(this,{model:this.model})}});i.Views.EditInlineClipView=i.Views.EditView.extend({initialize:function(){this._initialValue=this.model.get(this.options.property)||this.options.description;this.ui[this.options.property]="."+this.options.property;this.bindings["."+this.options.property]={observe:this.options.property,onSet:n.Shared.Helpers.StripHTML};this.listenTo(this.model,"sync",this.close);this.listenTo(this.model,"change:"+this.options.property,this.setWidth);this.listenTo(this.model,"change:"+this.options.property,this.setHeight)}});i.Views.EditInlineClipResultView=i.Views.EditResultView.extend({viewOptions:function(){return{description:this.model.get("description")||this.options.video.get("description")}}})}(ClickView,EasyMoney),function(n,t){n.Views.EmptyClipsView=t.View.extend({template:n.Templates.EmptyClips,defaults:{renderInClipsTab:!1},viewOptions:function(){return{renderInClipsTab:this.options.renderInClipsTab}}})}(ClickView.Shared,EasyMoney);!function(n,t){n.Views.WidgetsHorizontalListView=n.Views.HorizontalListView.extend({name:"WidgetsHorizontalListView.js",initialize:function(){this.slidingListView=this.options.slidingListView||ClickView.Shared.Views.SlidingListView;this.listenTo(this.model,"sync",this.onSync);this.listenTo(this.model,"error",this.close)},onSync:function(){if(this.model.videos&&!this.model.videos.length){this.close();return}this.render()},getSlides:function(){return this.model.getSlides()},getListActionUrl:function(){var t=this.options.dashboard?"/dashboard/":"/exchange/";return t+this.model.get("id")+"/"+n.Helpers.Slugify(this.model.get("name"))},onBeforeRender:function(){return!this.model.hasFetched()&&this.options.shouldFetch?(this.model.fetch({parse:!0}),this.renderPartialLoading(),!1):!0},onRender:function(){var n;this.model.videos&&this.model.videos instanceof t.PagedCollection&&(n=this.model.videos.totalItems());n=_.isNumber(n)?n:this.model.videos.length;this.renderView(this.$el,new this.slidingListView(_.extend({},this.options.slideOptions,{heading:this.model.get("name"),subHeading:this.model.get("description"),listActionUrl:this.getListActionUrl(),small:this.options.small,collection:this.getSlides(),totalItems:n,pageLoad:!0})))}})}(ClickView.Shared,EasyMoney);!function(n,t){n.Views.WidgetsView=t.View.extend({name:"WidgetsView.js",template:!1,initialize:function(){if(!this.options.widgetModel)throw new Error("Pass a widget model");this.widgets||(this.widgets=this.model.getSlidingListWidgets())},onRender:function(){this.widgets.forEach(function(t){var i=new this.options.widgetModel({id:t.get("collectionId"),dashboardId:t.get("id")}),r;this.collection&&this.collection.get(t.get("collectionId"))&&(r=this.collection.get(t.get("collectionId")).toJSON(),i.set(_.omit(r,"type","id")),i.loaded=!0);this.renderView(this.$el,new n.Views.WidgetsHorizontalListView({model:i,small:t.isSmall(),dashboard:this.options.dashboard}),{empty:!1})},this)}})}(ClickView.Shared,EasyMoney);!function(n,t){"use strict";var i=t.Router.prototype;n.Router.BaseRouter=t.Router.extend({_firstRun:!0,navigateEvent:function(t,r){var u=_.extend({scrollToTop:!0},r);u.scrollToTop&&n.Helpers.scrollToTop();i.navigateEvent.call(this,t,u)},onStart:function(){var n=this.__private__.controllers;for(var t in n)n.hasOwnProperty(t)&&this.listenTo(n[t],"logPageView",this.logPageView)},execute:function(n,t,r){i.execute.call(this,n,t,r);t&&this.logPageView()},logPageView:function(){var t,i;if(this._firstRun){this._firstRun=!1;return}if(t=this.__private__.currentController,!(t instanceof n.Controllers.SharedController))throw new Error("Please only use instances of ClickView.Shared.Controllers.SharedController with ClickView.Shared.Router.BaseRouter");if(i=t.getTitleService(),ga("set","page","/"+Backbone.history.getFragment()),!t.usedTitleService()||!i.hasRequestPending()){ga("send","pageView");return}this.listenToOnce(i,"setTitle",function(){ga("send","pageView")})}})}(ClickView.Shared,EasyMoney);this.ClickView=this.ClickView||{};this.ClickView.UserOptions=this.ClickView.UserOptions||{};this.ClickView.UserOptions.Templates=this.ClickView.UserOptions.Templates||{};this.ClickView.UserOptions.Templates.DropdownView=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=null!=t?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<li class="user-details"><div class="display-name">'+h(typeof(f=null!=(f=i.displayName||(null!=t?t.displayName:t))?f:o)===s?f.call(e,{name:"displayName",hash:{},data:u}):f)+'<\/div><div class="school-name">'+h(typeof(f=null!=(f=i.schoolName||(null!=t?t.schoolName:t))?f:o)===s?f.call(e,{name:"schoolName",hash:{},data:u}):f)+"<\/div><\/li>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.UserOptions=this.ClickView.UserOptions||{};this.ClickView.UserOptions.Templates=this.ClickView.UserOptions.Templates||{};this.ClickView.UserOptions.Templates.UserOption=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=null!=t?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<a href="'+h(typeof(f=null!=(f=i.url||(null!=t?t.url:t))?f:o)===s?f.call(e,{name:"url",hash:{},data:u}):f)+'">'+h(typeof(f=null!=(f=i.text||(null!=t?t.text:t))?f:o)===s?f.call(e,{name:"text",hash:{},data:u}):f)+"<\/a>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.UserOptions=this.ClickView.UserOptions||{};this.ClickView.UserOptions.Templates=this.ClickView.UserOptions.Templates||{};this.ClickView.UserOptions.Templates.UserOptionsDropdownView=Handlebars.template({1:function(n,t,i,r,u){var f;return' <a href="'+n.escapeExpression("function"==typeof(f=null!=(f=i.supportSiteLink||(null!=t?t.supportSiteLink:t))?f:i.helperMissing)?f.call(null!=t?t:n.nullContext||{},{name:"supportSiteLink",hash:{},data:u}):f)+'" target="_blank" class="help-center">Help Centre<\/a>|'},3:function(n,t,i,r,u){var f;return" - "+n.escapeExpression("function"==typeof(f=null!=(f=i.yearGroup||(null!=t?t.yearGroup:t))?f:i.helperMissing)?f.call(null!=t?t:n.nullContext||{},{name:"yearGroup",hash:{},data:u}):f)},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var e,f,o=null!=t?t:n.nullContext||{};return(null!=(e=i.if.call(o,null!=t?t.showHelpCenter:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))?e:"")+'\r\n<a class="dropdown-toggle display-name-top" data-toggle="dropdown">'+n.escapeExpression("function"==typeof(f=null!=(f=i.displayName||(null!=t?t.displayName:t))?f:i.helperMissing)?f.call(o,{name:"displayName",hash:{},data:u}):f)+(null!=(e=i.if.call(o,null!=t?t.showYearGroup:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))?e:"")+"<\/a>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.UserOptions=this.ClickView.UserOptions||{};this.ClickView.UserOptions.Templates=this.ClickView.UserOptions.Templates||{};this.ClickView.UserOptions.Templates.UserOptionsView=Handlebars.template({1:function(n,t,i,r,u){var f;return" - Max viewable rating: "+n.escapeExpression("function"==typeof(f=null!=(f=i.maxRatingCode||(null!=t?t.maxRatingCode:t))?f:i.helperMissing)?f.call(null!=t?t:n.nullContext||{},{name:"maxRatingCode",hash:{},data:u}):f)},3:function(){return'<div class="admin-options-container">\r\n    <p class="sub-title">Administration<\/p>\r\n    <div class="admin-options-viewpart"><\/div>\r\n<\/div>\r\n<div class="divider"><\/div>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var o,f,e=null!=t?t:n.nullContext||{},s=i.helperMissing,h="function",c=n.escapeExpression;return'<div class="menu-arrow"><\/div>\r\n<li class="user-details" title="'+c(typeof(f=null!=(f=i.roleName||(null!=t?t.roleName:t))?f:s)===h?f.call(e,{name:"roleName",hash:{},data:u}):f)+(null!=(o=i.if.call(e,null!=t?t.showMaxRatingValue:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))?o:"")+'"><p class="display-name">'+c(typeof(f=null!=(f=i.displayName||(null!=t?t.displayName:t))?f:s)===h?f.call(e,{name:"displayName",hash:{},data:u}):f)+'<\/p><p class="school-name">'+c(typeof(f=null!=(f=i.schoolName||(null!=t?t.schoolName:t))?f:s)===h?f.call(e,{name:"schoolName",hash:{},data:u}):f)+'<\/p><\/li>\r\n<li class="divider"><\/li>\r\n<div class="user-options-viewpart"><\/div>\r\n<div class="divider"><\/div>\r\n'+(null!=(o=i.if.call(e,null!=t?t.showAdminOptions:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))?o:"")+'<li class="sign-out"><a href="/signout">Sign Out<\/a><\/li>'},useData:!0}),function(n,t){"use strict";n.UserOptions.Models.User=t.Model.extend({})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.UserOptions;i.Models.UserOption=t.Model.extend({action:function(){window.location=this.get("url")}});i.Models.AppsUserOption=i.Models.UserOption.extend({defaults:{text:"Download Apps",url:"/apps"}});i.Models.SettingUserOption=i.Models.UserOption.extend({defaults:{text:"Settings",url:"/settings"}});i.Models.AnalyticsUserOption=i.Models.UserOption.extend({defaults:{text:"Analytics",url:"/usage/dashboard"}});i.Models.LibraryUpdatesUserOption=i.Models.UserOption.extend({defaults:{text:"Library Updates",url:"/termupdates"}});i.Models.ActivateDeviceUserOption=i.Models.UserOption.extend({defaults:{text:"Devices",url:"/settings/devices"}});i.Models.SignageUserOption=i.Models.UserOption.extend({defaults:{text:"Signage",url:"/signage/manage"}});i.Models.SignOutUserOption=i.Models.UserOption.extend({defaults:{text:"Sign Out",url:"/signout"}});i.Models.LiveStreamUserOption=i.Models.UserOption.extend({defaults:{text:"Live Streams",url:"/livestream"}})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.UserOptions;i.Views.UserOption=t.View.extend({tagName:"li",template:i.Templates.UserOption,className:"user-option-item",events:{click:"onClick"},onClick:function(){this.model.action()},onBoarding:function(){return this.model instanceof i.Models.SettingUserOption?"new-settings-location":this.model instanceof i.Models.LiveStreamUserOption?"new-livestream-location":void 0}});i.Views.UserOptionsListView=t.ListView.extend({childView:i.Views.UserOption});i.Views.UserOptionsView=t.View.extend({name:"UserOptionsDropdownView",tagName:"ul",className:"dropdown-menu",template:i.Templates.UserOptionsView,initialize:function(){this.userCollection=new t.Collection;this.adminCollection=new t.Collection;this.updateUserCollection();this.updateAdminCollection()},ui:{userOptions:".user-options-viewpart",adminOptions:".admin-options-viewpart"},onRender:function(){this.onRenderUserOptions();this.onRenderAdminOptions()},viewOptions:function(){return{showAdminOptions:this.adminCollection.length>0,showMaxRatingValue:this.model.get("maxRating")<255&&this.model.get("maxRatingCode")}},updateUserCollection:function(){this.model.get("userChannels")&&this.addUserChannels();2!==this.model.get("role")&&1!==this.model.get("role")||this.userCollection.add(new i.Models.SettingUserOption);this.userCollection.add(new i.Models.AppsUserOption);this.model.get("modules")&&this.model.get("modules").signage&&this.userCollection.add(new i.Models.SignageUserOption)},updateAdminCollection:function(){2!=this.model.get("role")&&3!=this.model.get("role")||this.adminCollection.add(new i.Models.ActivateDeviceUserOption);this.model.get("isPrimaryContanct")&&this.adminCollection.add(new i.Models.AnalyticsUserOption);var n=this.model.get("modules")&&this.model.get("modules").pushTo;2==this.model.get("role")&&this.model.get("isPrimaryContanct")&&n&&this.adminCollection.add(new i.Models.LibraryUpdatesUserOption);this.model.get("modules")&&this.model.get("modules").liveStream&&this.adminCollection.add(new i.Models.LiveStreamUserOption)},isAdminUser:function(){var t=n.Shared&&n.Shared.Utils&&n.Shared.Utils.Constants&&n.Shared.Utils.Constants.ENUMS.MASTER_ROLES.ADMIN;return this.model.get("masterRole")===t},onRenderUserOptions:function(){this.renderView(this.ui.userOptions,new i.Views.UserOptionsListView({collection:this.userCollection}))},onRenderAdminOptions:function(){this.renderView(this.ui.adminOptions,new i.Views.UserOptionsListView({collection:this.adminCollection}))},addUserChannels:function(){var n=this;_.each(this.model.get("userChannels"),function(t){n.userCollection.add(new i.Models.UserOption({text:n.formatChannelName(t),url:n.formatChannelUrl(t)}),{at:0})})},formatChannelName:function(n){return this.model.get("userChannels").length>1?n.name&&n.name.length>26?"Channel: "+n.name.substr(0,26)+"...":"Channel: "+n.name:"My Channel"},formatChannelUrl:function(t){return"/exchange/channels/"+t.id+"/"+n.Shared.Helpers.Slugify(t.name)}});i.Views.DropdownView=t.ListView.extend({className:"dropdown-menu",tagName:"ul",childView:i.Views.UserOption,template:i.Templates.DropdownView});i.Views.UserOptionsDropdownView=t.View.extend({className:"btn-group user-options",template:i.Templates.UserOptionsDropdownView,viewOptions:function(){var t=n&&n.Data&&n.Data.Config&&n.Data.Config.urls&&n.Data.Config.urls.supportWebsite;return{showHelpCenter:this.options.showHelpCentre,supportSiteLink:t,showYearGroup:this.model.get("yearGroup")&&1===this.model.get("role")}},onRender:function(){this.collection&&this.collection.length>0?this.renderView(this.$el,new i.Views.DropdownView({collection:this.collection,model:this.model}),{empty:!1}):this.renderView(this.$el,new i.Views.UserOptionsView({model:this.model}),{empty:!1})}})}(ClickView,EasyMoney),function(n){"use strict";if(!EasyMoney)throw new Error("Please make sure to include EasyMoney before this app.");(n=n||{}).UserOptions=n.UserOptions||{Views:{},Models:{}}}(ClickView),function(n,t){"use strict";var i=n.LiveStream;i.Models.LiveStream=t.Model.extend({defaults:{width:640,height:360},_usercode:"",_embedded:!1,url:function(){return!this._usercode?this._embedded?"/api/livestream/"+this.get("id")+"/current/live-item":"/api/livestream/"+this.get("id")+"/live-item":"/api/livestream/current/usercode?usercode="+encodeURIComponent(this._usercode)},share:function(t){this.set("privacy",t);var i="/api/livestream/"+this.get("id")+"/privacy?privacy="+t;return n.Shared.Utils.AjaxHelper.post(i).success(_.bind(function(){},this))},setUsercode:function(n){this._usercode=n},setEmbedded:function(n){this._embedded=n}});i.Models.ArchiveStream=t.Model.extend({defaults:{showAddToWsBtn:!1},url:function(){return"/api/livestream/"+this.get("id")+"/archive-item"}});i.Models.ScheduleStream=t.Model.extend({defaults:{},url:function(){return"/api/livestream/schedule/"+this.get("id")},share:function(t){this.set("privacy",t);var i="/api/livestream/schedule/"+this.get("id")+"?privacy="+t;return n.Shared.Utils.AjaxHelper.post(i).success(_.bind(function(){},this))}});i.Models.UserLiveStream=t.Model.extend({defaults:{},url:"/api/livestream/current-user-stream",_currentUserStreamInterval:null,getUserStream:function(){this.fetch()}});i.Models.Usage=t.Model.extend({defaults:{},url:"/api/livestream/usages",getUsages:function(){this.fetch()},getCreditRemain:function(){var n=this.toJSON();return n.totalValues-_.reduce(n.usages,function(n,t){return n+Math.round(t.value)},0)}});i.Models.WorkspaceTrackingCode=t.Model.extend({defaults:{id:null,trackingCode:null},url:function(){return"/api/livestream/workspace-videos/"+this.get("id")}});i.Models.Device=t.Model.extend({defaults:{},url:"api/livestream/devices/user"});i.Models.Feedback=t.Model.extend({defaults:{setupRate:5,qualityRate:5,shareRate:5,comment:null}})}(ClickView,EasyMoney);$(function(){if(!_.isEmpty(ClickView.Data.User)&&ClickView.Data&&ClickView.Data.User&&ClickView.Data.User.modules&&ClickView.Data.User.modules.liveStream&&!!ClickView.Shared.Models.LiveStreamCount&&!!ClickView.LiveStream.Views.LiveStreamTopbarView){ClickView.LiveStream.userLiveStreamModel=new ClickView.LiveStream.Models.UserLiveStream(ClickView.Data.UserLiveStream);var n=new ClickView.Shared.Models.LiveStreamCount,t=new ClickView.LiveStream.Views.LiveStreamTopbarView({model:n});(ClickView.Data.User.isPrimaryContanct||ClickView.Data.UserLiveStreamPermission!=null)&&$("#topbar-live-stream-container").html(t.render().el)}}),function(n,t){"use strict";var i=n.LiveStream;i.Views.LiveStreamTopbarView=t.View.extend({name:"LiveStreamTopbarView",className:"live-stream-container",template:n.Shared.Templates.LiveStreamTopbarView,model:n.Shared.Models.LiveStreamCount,initialize:function(){this.isLive=!1;this.listenTo(this.model,"sync",this.onStreamModelChange);this.listenTo(t.Events,"livestream:channel-create-completed",this.onLiveStreamUpdated);this.listenTo(t.Events,"livestream:stream-stopped",this.onLiveStreamUpdated)},onStreamModelChange:function(){this.isLive=this.model.get("liveCount")<=0?!1:!0;this.render()},onLiveStreamUpdated:function(t){t.schoolId==n.Data.User.customerId&&n.Data.User.modules.liveStream&&(n.Data.User.isPrimaryContanct||n.Data.UserLiveStreamPermission!=null)&&this.model.fetch()},viewOptions:function(){return{message:"Live streaming",className:"recording"}}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Notifications,r=n.Shared;i.Models.Notification=t.Model.extend({defaults:{dateCreated:"",timestamp:-1,thumbnail:"",name:"",body:"",link:"",notificationStatus:0,notificationType:0},initialize:function(n){this.set(this._getAdditionalData(n),{silent:!0})},isExternalLink:function(){return/^(?:[a-z]+:)?\/\//i.test(this.get("link"))},isUnread:function(){return this.get("notificationStatus")!==3},isSeen:function(){var n=this.get("notificationStatus");return n===2||n===3},setSeen:function(){this.isSeen()||this.set("notificationStatus",2)},markRead:function(){$.ajax({method:"POST",url:"/api/notifications/markread",data:JSON.stringify({id:this.id})});this.set("notificationStatus",3)},parse:function(n){return n?_.extend(n,this._getAdditionalData(n)):n},_getAdditionalData:function(n){if(!n)return n;var t={};return t.timestamp=moment.utc(n.dateCreated).valueOf()||-1,n.link&&(n.link=n.link.replace("http://","https://")),t},isMarketing:function(){var n=this.get("notificationType");return!!n&&n.startsWith("marketing-")}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Notifications,r=n.Shared;i.Collections.Notifications=t.Collection.extend({model:i.Models.Notification,url:"/api/notifications",_oldest:null,_newest:null,initialize:function(){this.listenTo(this,"add",this._onAdd);this.listenTo(this,"sync",this._onSync)},_onAdd:function(n){var t=n.get("timestamp");(this._oldest===null||this._oldest.get("timestamp")>t)&&(this._oldest=n);(this._newest===null||this._newest.get("timestamp")<t)&&(this._newest=n)},_onSync:function(){this.loaded=!0},getNewest:function(){return this._newest},getNextOlder:function(n,t){t=t||{};this._oldest!==null&&(t.before=this._oldest.get("timestamp"));this.limitFetch(n,t)},getNextNewer:function(n,t){t=t||{};this._newest!==null&&(t.after=this._newest.get("timestamp"));this.limitFetch(n,t)},limitFetch:function(n,t){var i=_.extend({limit:n||25},t);return this.fetch({data:i,remove:!1})},parse:function(n){return n?n.data&&n.pagination?n.data:n:[]},markSeen:function(){var n,t;this.length!==0&&(n=this.getNewest(),n!=null)&&(n.isSeen()||(t=n.get("timestamp"),$.ajax({method:"POST",url:"/api/notifications/markseen",data:JSON.stringify({lastSeen:t})}),this.each(function(n){n.get("timestamp")>t||n.setSeen()})))}})}(ClickView,EasyMoney);this.ClickView=this.ClickView||{};this.ClickView.Notifications=this.ClickView.Notifications||{};this.ClickView.Notifications.Templates=this.ClickView.Notifications.Templates||{};this.ClickView.Notifications.Templates.NotificationItem=Handlebars.template({"1":function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{};return'<a class="link" href="'+n.escapeExpression((f=(f=i.link||(t!=null?t.link:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(o,{name:"link",hash:{},data:u}):f))+'" '+((e=i["if"].call(o,t!=null?t.isExternalLink:t,{name:"if",hash:{},fn:n.program(2,u,0),inverse:n.noop,data:u}))!=null?e:"")+">\r\n"},"2":function(){return'target="_blank"'},"4":function(){return"<\/a>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var o,f,e=t!=null?t:n.nullContext||{},s=i.helperMissing,h="function",c=n.escapeExpression;return((o=i["if"].call(e,t!=null?t.link:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?o:"")+'    <div class="inner">\r\n        <div class="actions">\r\n            <span class="mark-read" title="Mark this as read"><\/span>\r\n        <\/div>\r\n        <div class="image '+c((f=(f=i.iconClass||(t!=null?t.iconClass:t))!=null?f:s,typeof f===h?f.call(e,{name:"iconClass",hash:{},data:u}):f))+'"><\/div>\r\n        <div class="content">\r\n            <p class="title">'+c((f=(f=i.name||(t!=null?t.name:t))!=null?f:s,typeof f===h?f.call(e,{name:"name",hash:{},data:u}):f))+'<\/p>\r\n            <time class="time" datetime="'+c((f=(f=i.time||(t!=null?t.time:t))!=null?f:s,typeof f===h?f.call(e,{name:"time",hash:{},data:u}):f))+'">'+c((f=(f=i.dateCreated||(t!=null?t.dateCreated:t))!=null?f:s,typeof f===h?f.call(e,{name:"dateCreated",hash:{},data:u}):f))+"<\/time>\r\n        <\/div>\r\n    <\/div>\r\n"+((o=i["if"].call(e,t!=null?t.link:t,{name:"if",hash:{},fn:n.program(4,u,0),inverse:n.noop,data:u}))!=null?o:"")},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Notifications=this.ClickView.Notifications||{};this.ClickView.Notifications.Templates=this.ClickView.Notifications.Templates||{};this.ClickView.Notifications.Templates.Notifications=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<h2>Notifications<\/h2>\r\n<div class="list"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Notifications=this.ClickView.Notifications||{};this.ClickView.Notifications.Templates=this.ClickView.Notifications.Templates||{};this.ClickView.Notifications.Templates.NotificationsDropdown=Handlebars.template({"1":function(){return'<p class="heading">Notifications<\/p>\r\n'},"3":function(){return'<div class="footer">\r\n    <p><a href="/notifications" class="see-all">See all notifications<\/a><\/p>\r\n<\/div>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return((f=i["if"].call(e,t!=null?t.showTitle:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+'<div class="list"><\/div>\r\n'+((f=i["if"].call(e,t!=null?t.hasNotifications:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:"")},useData:!0});!function(n,t){"use strict";var i=n.Notifications,r=n.Shared;i.Views.NotificationItem=t.View.extend({name:"NotificationItem",template:i.Templates.NotificationItem,className:"notification",tagName:"li",ui:{timestamp:"time",markRead:".mark-read"},events:{"click .mark-read":"_onMarkReadClick",click:"_onClick",contextmenu:"_onClick"},initialize:function(){this.listenTo(this.model,"remove",this.close);this.listenTo(this.model,"change:notificationStatus",this._onStatusChanged)},viewOptions:function(){return{time:moment.utc(this.model.get("dateCreated")).toISOString(),iconClass:this.getIconClass()}},_onStatusChanged:function(){this.setReadClass()},onRender:function(){this.setReadClass();this.initTimeago()},setReadClass:function(){this.model.isUnread()?this.$el.addClass("unread"):this.$el.removeClass("unread")},initTimeago:function(){this.ui.timestamp.timeago()},getIconClass:function(){switch(this.model.get("alertType")){case 1:return"alert";case 2:return"warning";case 3:return"info";case 4:return"success";default:return"info"}},_onMarkReadClick:function(n){return n.stopPropagation(),this.model.markRead(),!1},_onClick:function(t){t.stopPropagation();this.model.isMarketing()&&n.Shared.Utils.AnalyticsService.logMarketingNotification(this.model);this.model.markRead()}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Notifications,r=n.Shared;i.Views.NotificationList=t.ListView.extend({name:"NotificationList",childView:i.Views.NotificationItem,className:function(){var n="notifications";return this.options.compactView&&(n+=" compact"),n},addOne:function(n){var t=null;n.collection&&(t=n.collection.indexOf(n));this.renderView(this.$el,this.buildChildView.call(this,n),{empty:!1,at:t})},initialize:function(){this.listenTo(this.collection,"add",this.addOne)}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Notifications,r=n.Shared;i.Views.NotificationsApp=t.View.extend({name:"Notifications",className:"notifications-app",template:i.Templates.Notifications,ui:{list:".list"},defaults:{showTitle:!0},_viewOpen:!0,initialize:function(){this.collection||(this.collection=new i.Collections.Notifications,this.collection.limitFetch(this.options.pageSize));this.listenTo(this,"notify",this._onNotify);this.listenToOnce(this.collection,"sync",this._onSync);this.listenToOnce(this.collection,"sync",this.render);n.Services.NotificationService&&this.listenTo(n.Services.NotificationService,"notify",this._onNotify)},renderNotifications:function(){var n=new i.Views.NotificationList({collection:this.collection});this.renderView(this.ui.list,n)},onRender:function(){if(!this.collection.length){this.ui.list.html('<div class="no-notifications"><p>You don\'t have any notifications yet. Your notifications will appear here.<\/p><\/div>');return}this.renderNotifications()},_onNotify:function(n){this.collection.add(new this.collection.model(n),{at:0})},onShow:function(){this._viewOpen=!0;this.markSeen()},onHide:function(){this._viewOpen=!1},_onSync:function(){this.markSeen()},markSeen:function(){this._viewOpen&&this.collection.markSeen()},onScrolled:function(){this.collection.isFetching()||this.collection.getNextOlder(this.options.pageSize)},onBeforeRender:function(){if(!this.collection.loaded)return this.renderView(this.$el,new r.Views.SpinJsView({cover:!0})),!1}})}(ClickView,EasyMoney);!function(n){"use strict";var t=n.Notifications,i=n.Shared;t.Views.NotificationsDropdown=t.Views.NotificationsApp.extend({name:"NotificationDropdown",className:"notifications-dropdown notifications-app",template:t.Templates.NotificationsDropdown,_initScrollBar:!1,defaults:{pageSize:6,compactView:!0},events:{"click .see-all":"seeAll"},initScrollBar:function(){if(!this._initScrollBar&&this.isInDOM()){var n=this;this.ui.list.mCustomScrollbar&&this.ui.list.mCustomScrollbar({axis:"y",theme:"clickview",scrollInertia:0,mouseWheel:{scrollAmount:40,preventDefault:!0},callbacks:{onTotalScroll:function(){n.onScrolled(this)}},onTotalScrollOffset:100});this._initScrollBar=!0}},renderNotifications:function(){var n=new t.Views.NotificationList({collection:this.collection,compactView:this.options.compactView});this.renderView(this.ui.list,n)},seeAll:function(n){n.stopPropagation();window.location="/notifications"},viewOptions:function(){return{showTitle:!this.options.compactView,hasNotifications:this.collection&&this.collection.length}},onRender:function(){t.Views.NotificationsApp.prototype.onRender.apply(this,arguments);this.initScrollBar()},onRendered:function(){this.initScrollBar()}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Notifications;i.Services.NotificationService=t.Service.extend({name:"NotificationService",_connection:null,_hub:null,_started:!1,_ready:!1,_reconnectTries:0,defaults:{tryReconnect:!0,reconnectAttempts:100,reconnectWait:1e4,logging:!1},initialize:function(){this._connection=$.hubConnection(this.options.endpoint);this._hub=this._getHub();this._userActivityService=n.Services.UserActivityService;this.setupListeners()},log:function(n){this.options.logging&&console.log(this.name+": "+n)},start:function(){if(!this._started){if(this.log("Starting..."),this._started=!0,this._userActivityService&&!this._userActivityService.isActive()){this._started=!1;this._tryReconnect();return}var n=this;this._getConnectionToken(function(t,i){if(t){n._beginSignalR(t);return}if(n._started=!1,i===403||i===401){n.log("Failed to get token");return}n.log("Failed to get token. Retrying...");n._tryReconnect()})}},ready:function(n,t){if(t=t||this,this._ready){n.apply(t);return}this.listenToOnce(this,"connected",function(){n.apply(t)})},getConnectionState:function(){return this._connstate},setupListeners:function(){this._hub.on("notify",_.bind(function(n){this.trigger("notify",n)},this));this._hub.on("notifyCount",_.bind(function(n){this.trigger("notifyCount",n)},this))},_setConnectionState:function(n){this._connstate=n;this.trigger(n);this.trigger("connectionStateChanged",n)},_getHub:function(){return this._connection.createHubProxy("notificationHub")},_getConnectionToken:function(t){var i=this;n.Shared.Utils.AjaxHelper.post("/api/notifications/start",null,{forceHttps:!1}).always(function(n,r,u){var f=n&&n.status||u&&u.status;t(i._parseConnectionToken(n),f)})},_parseConnectionToken:function(n){return n==null?null:n.token},_beginSignalR:function(n){var t=this;t._setConnectionState("connecting");this._connection.start({waitForPageLoad:!1}).done(function(){t._onConnected(n)}).fail(function(n){t.log(n.message);t._setConnectionState("disconnected");t._started=!1;t._tryReconnect()});this._connection.disconnected(function(){t._started=!1;t._ready=!1;t._setConnectionState("disconnected");t.log("Disconnected");t._tryReconnect()});this._connection.reconnecting(function(){t.log("Reconnecting...");t._setConnectionState("reconnecting")});this._connection.reconnected(function(){t.log("Reconnected");t._setConnectionState("connected")})},_tryReconnect:function(){if(this.options.tryReconnect){if(this.options.reconnectAttempts>0&&this._reconnectTries>=this.options.reconnectAttempts){this.log("Aborting reconnect");return}setTimeout(_.bind(function(){this.log("Reconnecting...");this._reconnectTries++;this.start()},this),this.options.reconnectWait)}},_onConnected:function(n){this._reconnectTries=0;var t=this;this._hub.invoke("subscribe",n).done(function(){t.log("Started");t._ready=!0;t._setConnectionState("connected")}).fail(function(n){t.log("Failed to call subscribe",n)})}})}(ClickView,EasyMoney);$(function(){"use strict";var n,t;ClickView.Data.initTopBar&&(n=ClickView.Notifications,_.extend(ClickView.Services,{NotificationService:new n.Services.NotificationService({endpoint:ClickView.Data.Config.urls.notificationService,tryReconnect:!ClickView.Data.Config.isDebug})}),t=[1,2,6],ClickView.Data.User&&t.indexOf(ClickView.Data.User.role)!==-1&&ClickView.Services.NotificationService.start())}),function(n){n.fn.autogrow=function(t){function r(i){var u=n(this),o=u.innerHeight(),r=this.scrollHeight,e=u.data("autogrow-start-height")||0,f;if(o<r)this.scrollTop=0,t.animate?u.stop().animate({height:r},t.speed):u.innerHeight(r);else if(!i||i.which==8||i.which==46||i.ctrlKey&&i.which==88)if(o>e){f=u.clone().addClass(t.cloneClass).css({position:"absolute",zIndex:-10,height:""}).val(u.val());u.after(f);do r=f[0].scrollHeight-1,f.innerHeight(r);while(r===f[0].scrollHeight);r++;f.remove();u.focus();r<e&&(r=e);o>r&&t.animate?u.stop().animate({height:r},t.speed):u.innerHeight(r)}else u.innerHeight(e)}var i=n(this).css({overflow:"hidden",resize:"none"}),u=i.selector,f={context:n(document),animate:!0,speed:200,fixMinHeight:!0,cloneClass:"autogrowclone",onInitialize:!1};t=n.isPlainObject(t)?t:{context:t?t:n(document)};t=n.extend({},f,t);i.each(function(i,u){var f,e;u=n(u);u.is(":visible")||parseInt(u.css("height"),10)>0?f=parseInt(u.css("height"),10)||u.innerHeight():(e=u.clone().addClass(t.cloneClass).val(u.val()).css({position:"absolute",visibility:"hidden",display:"block"}),n("body").append(e),f=e.innerHeight(),e.remove());t.fixMinHeight&&u.data("autogrow-start-height",f);u.css("height",f);t.onInitialize&&r.call(u)});t.context.on("keyup paste",u,r);return i}}(jQuery),function(n,t){"object"==typeof exports?module.exports=t():"function"==typeof define&&define.amd?define(t):n.IPv6=t(n)}(this,function(n){var t=n&&n.IPv6;return{best:function(n){var r,t,i,u;for(n=n.toLowerCase().split(":"),i=n.length,r=8,""===n[0]&&""===n[1]&&""===n[2]?(n.shift(),n.shift()):""===n[0]&&""===n[1]?n.shift():""===n[i-1]&&""===n[i-2]&&n.pop(),i=n.length,-1!==n[i-1].indexOf(".")&&(r=7),t=0;t<i&&""!==n[t];t++);if(t<r)for(n.splice(t,1,"0000");n.length<r;)n.splice(t,0,"0000");for(t=0;t<r;t++){for(i=n[t].split(""),u=0;3>u;u++)if("0"===i[0]&&1<i.length)i.splice(0,1);else break;n[t]=i.join("")}var i=-1,f=u=0,e=-1,o=!1;for(t=0;t<r;t++)o?"0"===n[t]?f+=1:(o=!1,f>u&&(i=e,u=f)):"0"===n[t]&&(o=!0,e=t,f=1);for(f>u&&(i=e,u=f),1<u&&n.splice(i,u,""),i=n.length,r="",""===n[0]&&(r=":"),t=0;t<i;t++){if(r+=n[t],t===i-1)break;r+=":"}return""===n[i-1]&&(r+=":"),r},noConflict:function(){return n.IPv6===this&&(n.IPv6=t),this}}}),function(n){function i(n){throw RangeError(g[n]);}function s(n,t){for(var i=n.length;i--;)n[i]=t(n[i]);return n}function h(n,t){return s(n.split(d),t).join(".")}function c(n){for(var r=[],i=0,f=n.length,t,u;i<f;)t=n.charCodeAt(i++),55296<=t&&56319>=t&&i<f?(u=n.charCodeAt(i++),56320==(u&64512)?r.push(((t&1023)<<10)+(u&1023)+65536):(r.push(t),i--)):r.push(t);return r}function l(n){return s(n,function(n){var t="";return 65535<n&&(n-=65536,t+=f(n>>>10&1023|55296),n=56320|n&1023),t+f(n)}).join("")}function a(n,t){return n+22+75*(26>n)-((0!=t)<<5)}function v(n,i,r){var u=0;for(n=r?t(n/700):n>>1,n+=t(n/i);455<n;u+=36)n=t(n/35);return t(u+36*n/(n+38))}function y(n){var h=[],p=n.length,u,e=0,a=128,c=72,f,o,s,r,y;for(f=n.lastIndexOf("-"),0>f&&(f=0),o=0;o<f;++o)128<=n.charCodeAt(o)&&i("not-basic"),h.push(n.charCodeAt(o));for(f=0<f?f+1:0;f<p;){for(o=e,u=1,s=36;;s+=36){if(f>=p&&i("invalid-input"),r=n.charCodeAt(f++),r=10>r-48?r-22:26>r-65?r-65:26>r-97?r-97:36,(36<=r||r>t((2147483647-e)/u))&&i("overflow"),e+=r*u,y=s<=c?1:s>=c+26?26:s-c,r<y)break;r=36-y;u>t(2147483647/r)&&i("overflow");u*=r}u=h.length+1;c=v(e-o,u,0==o);t(e/u)>2147483647-a&&i("overflow");a+=t(e/u);e%=u;h.splice(e++,0,a)}return l(h)}function p(n){var o,s,y,d,p,u,e,h,r,l=[],w,b,k;for(n=c(n),w=n.length,o=128,s=0,p=72,u=0;u<w;++u)r=n[u],128>r&&l.push(f(r));for((y=d=l.length)&&l.push("-");y<w;){for(e=2147483647,u=0;u<w;++u)r=n[u],r>=o&&r<e&&(e=r);for(b=y+1,e-o>t((2147483647-s)/b)&&i("overflow"),s+=(e-o)*b,o=e,u=0;u<w;++u)if(r=n[u],r<o&&2147483647<++s&&i("overflow"),r==o){for(h=s,e=36;;e+=36){if(r=e<=p?1:e>=p+26?26:e-p,h<r)break;k=h-r;h=36-r;l.push(f(a(r+k%h,0)));h=t(k/h)}l.push(f(a(h,0)));p=v(s,b,y==d);s=0;++y}++s;++o}return l.join("")}var e="object"==typeof exports&&exports,w="object"==typeof module&&module&&module.exports==e&&module,u="object"==typeof global&&global;(u.global===u||u.window===u)&&(n=u);var r,b=/^xn--/,k=/[^ -~]/,d=/\x2E|\u3002|\uFF0E|\uFF61/g,g={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},t=Math.floor,f=String.fromCharCode,o;if(r={version:"1.2.3",ucs2:{decode:c,encode:l},decode:y,encode:p,toASCII:function(n){return h(n,function(n){return k.test(n)?"xn--"+p(n):n})},toUnicode:function(n){return h(n,function(n){return b.test(n)?y(n.slice(4).toLowerCase()):n})}},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define(function(){return r});else if(e&&!e.nodeType)if(w)w.exports=r;else for(o in r)r.hasOwnProperty(o)&&(e[o]=r[o]);else n.punycode=r}(this),function(n,t){"object"==typeof exports?module.exports=t():"function"==typeof define&&define.amd?define(t):n.SecondLevelDomains=t(n)}(this,function(n){var i=n&&n.SecondLevelDomains,t={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ","do":" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ","in":" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch "},has:function(n){var i=n.lastIndexOf("."),r,u;return 0>=i||i>=n.length-1?!1:(r=n.lastIndexOf(".",i-1),0>=r||r>=i-1)?!1:(u=t.list[n.slice(i+1)],u?0<=u.indexOf(" "+n.slice(r+1,i)+" "):!1)},is:function(n){var i=n.lastIndexOf("."),r;return 0>=i||i>=n.length-1||0<=n.lastIndexOf(".",i-1)?!1:(r=t.list[n.slice(i+1)],r?0<=r.indexOf(" "+n.slice(0,i)+" "):!1)},get:function(n){var i=n.lastIndexOf("."),r,u;return 0>=i||i>=n.length-1?null:(r=n.lastIndexOf(".",i-1),0>=r||r>=i-1)?null:(u=t.list[n.slice(i+1)],!u||0>u.indexOf(" "+n.slice(r+1,i)+" ")?null:n.slice(r+1))},noConflict:function(){return n.SecondLevelDomains===this&&(n.SecondLevelDomains=i),this}};return t}),function(n,t){"object"==typeof exports?module.exports=t(require("./punycode"),require("./IPv6"),require("./SecondLevelDomains")):"function"==typeof define&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):n.URI=t(n.punycode,n.IPv6,n.SecondLevelDomains,n)}(this,function(n,t,i,r){function u(n,t){var i=1<=arguments.length,r=2<=arguments.length;if(!(this instanceof u))return i?r?new u(n,t):new u(n):new u;if(void 0===n){if(i)throw new TypeError("undefined is not a valid argument for URI");n="undefined"!=typeof location?location.href+"":""}return this.href(n),void 0!==t?this.absoluteTo(t):this}function h(n){return n.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function c(n){return void 0===n?"Undefined":String(Object.prototype.toString.call(n)).slice(8,-1)}function e(n){return"Array"===c(n)}function b(n,t){var r={},i,u;if("RegExp"===c(t))r=null;else if(e(t))for(i=0,u=t.length;i<u;i++)r[t[i]]=!0;else r[t]=!0;for(i=0,u=n.length;i<u;i++)(r&&void 0!==r[n[i]]||!r&&t.test(n[i]))&&(n.splice(i,1),u--,i--);return n}function v(n,t){var i,r,u;if(e(t)){for(i=0,r=t.length;i<r;i++)if(!v(n,t[i]))return!1;return!0}for(u=c(t),i=0,r=n.length;i<r;i++)if("RegExp"===u){if("string"==typeof n[i]&&n[i].match(t))return!0}else if(n[i]===t)return!0;return!1}function k(n,t){if(!e(n)||!e(t)||n.length!==t.length)return!1;n.sort();t.sort();for(var i=0,r=n.length;i<r;i++)if(n[i]!==t[i])return!1;return!0}function p(n){return n.replace(/^\/+|\/+$/g,"")}function nt(n){return escape(n)}function w(n){return encodeURIComponent(n).replace(/[!'()*]/g,nt).replace(/\*/g,"%2A")}function l(n){return function(t,i){return void 0===t?this._parts[n]||"":(this._parts[n]=t||null,this.build(!i),this)}}function d(n,t){return function(i,r){return void 0===i?this._parts[n]||"":(null!==i&&(i+="",i.charAt(0)===t&&(i=i.substring(1))),this._parts[n]=i,this.build(!r),this)}}var tt=r&&r.URI,f,o,s,a,y,g;u.version="1.17.0";f=u.prototype;o=Object.prototype.hasOwnProperty;u._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,duplicateQueryParameters:u.duplicateQueryParameters,escapeQuerySpace:u.escapeQuerySpace}};u.duplicateQueryParameters=!1;u.escapeQuerySpace=!0;u.protocol_expression=/^[a-z][a-z0-9.+-]*$/i;u.idn_expression=/[^a-z0-9\.-]/i;u.punycode_expression=/(xn--)/i;u.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;u.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;u.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?\u00ab\u00bb\u201c\u201d\u2018\u2019]))/ig;u.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?\u00ab\u00bb\u201c\u201d\u201e\u2018\u2019]+$/};u.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"};u.invalid_hostname_characters=/[^a-zA-Z0-9\.-]/;u.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"};u.getDomAttribute=function(n){if(n&&n.nodeName){var t=n.nodeName.toLowerCase();return"input"===t&&"image"!==n.type?void 0:u.domAttributes[t]}};u.encode=w;u.decode=decodeURIComponent;u.iso8859=function(){u.encode=escape;u.decode=unescape};u.unicode=function(){u.encode=w;u.decode=decodeURIComponent};u.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}};u.encodeQuery=function(n,t){var i=u.encode(n+"");return void 0===t&&(t=u.escapeQuerySpace),t?i.replace(/%20/g,"+"):i};u.decodeQuery=function(n,t){n+="";void 0===t&&(t=u.escapeQuerySpace);try{return u.decode(t?n.replace(/\+/g,"%20"):n)}catch(i){return n}};s={encode:"encode",decode:"decode"};y=function(n,t){return function(i){try{return u[t](i+"").replace(u.characters[n][t].expression,function(i){return u.characters[n][t].map[i]})}catch(r){return i}}};for(a in s)u[a+"PathSegment"]=y("pathname",s[a]),u[a+"UrnPathSegment"]=y("urnpath",s[a]);s=function(n,t,i){return function(r){var e,f,o;for(e=i?function(n){return u[t](u[i](n))}:u[t],r=(r+"").split(n),f=0,o=r.length;f<o;f++)r[f]=e(r[f]);return r.join(n)}};u.decodePath=s("/","decodePathSegment");u.decodeUrnPath=s(":","decodeUrnPathSegment");u.recodePath=s("/","encodePathSegment","decode");u.recodeUrnPath=s(":","encodeUrnPathSegment","decode");u.encodeReserved=y("reserved","encode");u.parse=function(n,t){var i;return t||(t={}),i=n.indexOf("#"),-1<i&&(t.fragment=n.substring(i+1)||null,n=n.substring(0,i)),i=n.indexOf("?"),-1<i&&(t.query=n.substring(i+1)||null,n=n.substring(0,i)),"//"===n.substring(0,2)?(t.protocol=null,n=n.substring(2),n=u.parseAuthority(n,t)):(i=n.indexOf(":"),-1<i&&(t.protocol=n.substring(0,i)||null,t.protocol&&!t.protocol.match(u.protocol_expression)?t.protocol=void 0:"//"===n.substring(i+1,i+3)?(n=n.substring(i+3),n=u.parseAuthority(n,t)):(n=n.substring(i+1),t.urn=!0))),t.path=n,t};u.parseHost=function(n,t){var i,r,u;return n=n.replace(/\\/g,"/"),i=n.indexOf("/"),-1===i&&(i=n.length),"["===n.charAt(0)?(r=n.indexOf("]"),t.hostname=n.substring(1,r)||null,t.port=n.substring(r+2,i)||null,"/"===t.port&&(t.port=null)):(u=n.indexOf(":"),r=n.indexOf("/"),u=n.indexOf(":",u+1),-1!==u&&(-1===r||u<r)?(t.hostname=n.substring(0,i)||null,t.port=null):(r=n.substring(0,i).split(":"),t.hostname=r[0]||null,t.port=r[1]||null)),t.hostname&&"/"!==n.substring(i).charAt(0)&&(i++,n="/"+n),n.substring(i)||"/"};u.parseAuthority=function(n,t){return n=u.parseUserinfo(n,t),u.parseHost(n,t)};u.parseUserinfo=function(n,t){var i=n.indexOf("/"),r=n.lastIndexOf("@",-1<i?i:n.length-1);return-1<r&&(-1===i||r<i)?(i=n.substring(0,r).split(":"),t.username=i[0]?u.decode(i[0]):null,i.shift(),t.password=i[0]?u.decode(i.join(":")):null,n=n.substring(r+1)):(t.username=null,t.password=null),n};u.parseQuery=function(n,t){if(!n)return{};if(n=n.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!n)return{};for(var i={},s=n.split("&"),h=s.length,f,r,e=0;e<h;e++)(f=s[e].split("="),r=u.decodeQuery(f.shift(),t),f=f.length?u.decodeQuery(f.join("="),t):null,o.call(i,r))?(("string"==typeof i[r]||null===i[r])&&(i[r]=[i[r]]),i[r].push(f)):i[r]=f;return i};u.build=function(n){var t="";return n.protocol&&(t+=n.protocol+":"),!n.urn&&(t||n.hostname)&&(t+="//"),t+=u.buildAuthority(n)||"","string"==typeof n.path&&("/"!==n.path.charAt(0)&&"string"==typeof n.hostname&&(t+="/"),t+=n.path),"string"==typeof n.query&&n.query&&(t+="?"+n.query),"string"==typeof n.fragment&&n.fragment&&(t+="#"+n.fragment),t};u.buildHost=function(n){var t="";if(n.hostname)t=u.ip6_expression.test(n.hostname)?t+("["+n.hostname+"]"):t+n.hostname;else return"";return n.port&&(t+=":"+n.port),t};u.buildAuthority=function(n){return u.buildUserinfo(n)+u.buildHost(n)};u.buildUserinfo=function(n){var t="";return n.username&&(t+=u.encode(n.username),n.password&&(t+=":"+u.encode(n.password)),t+="@"),t};u.buildQuery=function(n,t,i){var s="",h,r,f,c;for(r in n)if(o.call(n,r)&&r)if(e(n[r]))for(h={},f=0,c=n[r].length;f<c;f++)void 0!==n[r][f]&&void 0===h[n[r][f]+""]&&(s+="&"+u.buildQueryParameter(r,n[r][f],i),!0!==t&&(h[n[r][f]+""]=!0));else void 0!==n[r]&&(s+="&"+u.buildQueryParameter(r,n[r],i));return s.substring(1)};u.buildQueryParameter=function(n,t,i){return u.encodeQuery(n,i)+(null!==t?"="+u.encodeQuery(t,i):"")};u.addQuery=function(n,t,i){if("object"==typeof t)for(var r in t)o.call(t,r)&&u.addQuery(n,r,t[r]);else if("string"==typeof t)void 0===n[t]?n[t]=i:("string"==typeof n[t]&&(n[t]=[n[t]]),e(i)||(i=[i]),n[t]=(n[t]||[]).concat(i));else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");};u.removeQuery=function(n,t,i){var r;if(e(t))for(i=0,r=t.length;i<r;i++)n[t[i]]=void 0;else if("RegExp"===c(t))for(r in n)t.test(r)&&(n[r]=void 0);else if("object"==typeof t)for(r in t)o.call(t,r)&&u.removeQuery(n,r,t[r]);else if("string"==typeof t)void 0!==i?"RegExp"===c(i)?n[t]=!e(n[t])&&i.test(n[t])?void 0:b(n[t],i):n[t]!==String(i)||e(i)&&1!==i.length?e(n[t])&&(n[t]=b(n[t],i)):n[t]=void 0:n[t]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter");};u.hasQuery=function(n,t,i,r){if("object"==typeof t){for(var f in t)if(o.call(t,f)&&!u.hasQuery(n,f,t[f]))return!1;return!0}if("string"!=typeof t)throw new TypeError("URI.hasQuery() accepts an object, string as the name parameter");switch(c(i)){case"Undefined":return t in n;case"Boolean":return n=Boolean(e(n[t])?n[t].length:n[t]),i===n;case"Function":return!!i(n[t],t,n);case"Array":return e(n[t])?(r?v:k)(n[t],i):!1;case"RegExp":return e(n[t])?r?v(n[t],i):!1:Boolean(n[t]&&n[t].match(i));case"Number":i=String(i);case"String":return e(n[t])?r?v(n[t],i):!1:n[t]===i;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter");}};u.commonPath=function(n,t){for(var r=Math.min(n.length,t.length),i=0;i<r;i++)if(n.charAt(i)!==t.charAt(i)){i--;break}return 1>i?n.charAt(0)===t.charAt(0)&&"/"===n.charAt(0)?"/":"":(("/"!==n.charAt(i)||"/"!==t.charAt(i))&&(i=n.substring(0,i).lastIndexOf("/")),n.substring(0,i+1))};u.withinString=function(n,t,i){var r,f,e;i||(i={});var o=i.start||u.findUri.start,s=i.end||u.findUri.end,h=i.trim||u.findUri.trim;for(o.lastIndex=0;;){if(r=o.exec(n),!r)break;(r=r.index,i.ignoreHtml&&(f=n.slice(Math.max(r-3,0),r),f&&/[a-z0-9-]=["']?$/i.test(f)))||(f=r+n.slice(r).search(s),e=n.slice(r,f).replace(h,""),i.ignore&&i.ignore.test(e)||(f=r+e.length,e=t(e,r,f,n),n=n.slice(0,r)+e+n.slice(f),o.lastIndex=r+e.length))}return o.lastIndex=0,n};u.ensureValidHostname=function(t){if(t.match(u.invalid_hostname_characters)){if(!n)throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-] and Punycode.js is not available');if(n.toASCII(t).match(u.invalid_hostname_characters))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');}};u.noConflict=function(n){return n?(n={URI:this.noConflict()},r.URITemplate&&"function"==typeof r.URITemplate.noConflict&&(n.URITemplate=r.URITemplate.noConflict()),r.IPv6&&"function"==typeof r.IPv6.noConflict&&(n.IPv6=r.IPv6.noConflict()),r.SecondLevelDomains&&"function"==typeof r.SecondLevelDomains.noConflict&&(n.SecondLevelDomains=r.SecondLevelDomains.noConflict()),n):(r.URI===this&&(r.URI=tt),this)};f.build=function(n){return!0===n?this._deferred_build=!0:(void 0===n||this._deferred_build)&&(this._string=u.build(this._parts),this._deferred_build=!1),this};f.clone=function(){return new u(this)};f.valueOf=f.toString=function(){return this.build(!1)._string};f.protocol=l("protocol");f.username=l("username");f.password=l("password");f.hostname=l("hostname");f.port=l("port");f.query=d("query","?");f.fragment=d("fragment","#");f.search=function(n,t){var i=this.query(n,t);return"string"==typeof i&&i.length?"?"+i:i};f.hash=function(n,t){var i=this.fragment(n,t);return"string"==typeof i&&i.length?"#"+i:i};f.pathname=function(n,t){if(void 0===n||!0===n){var i=this._parts.path||(this._parts.hostname?"/":"");return n?(this._parts.urn?u.decodeUrnPath:u.decodePath)(i):i}return this._parts.path=this._parts.urn?n?u.recodeUrnPath(n):"":n?u.recodePath(n):"/",this.build(!t),this};f.path=f.pathname;f.href=function(n,t){var f,i,r;if(void 0===n)return this.toString();if(this._string="",this._parts=u._parts(),i=n instanceof u,r="object"==typeof n&&(n.hostname||n.path||n.pathname),n.nodeName&&(r=u.getDomAttribute(n),n=n[r]||"",r=!1),!i&&r&&void 0!==n.pathname&&(n=n.toString()),"string"==typeof n||n instanceof String)this._parts=u.parse(String(n),this._parts);else if(i||r)for(f in i=i?n._parts:n,i)o.call(this._parts,f)&&(this._parts[f]=i[f]);else throw new TypeError("invalid input");return this.build(!t),this};f.is=function(n){var r=!1,f=!1,e=!1,t=!1,s=!1,h=!1,c=!1,o=!this._parts.urn;this._parts.hostname&&(o=!1,f=u.ip4_expression.test(this._parts.hostname),e=u.ip6_expression.test(this._parts.hostname),r=f||e,s=(t=!r)&&i&&i.has(this._parts.hostname),h=t&&u.idn_expression.test(this._parts.hostname),c=t&&u.punycode_expression.test(this._parts.hostname));switch(n.toLowerCase()){case"relative":return o;case"absolute":return!o;case"domain":case"name":return t;case"sld":return s;case"ip":return r;case"ip4":case"ipv4":case"inet4":return f;case"ip6":case"ipv6":case"inet6":return e;case"idn":return h;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return c}return null};var it=f.protocol,rt=f.port,ut=f.hostname;return f.protocol=function(n,t){if(void 0!==n&&n&&(n=n.replace(/:(\/\/)?$/,""),!n.match(u.protocol_expression)))throw new TypeError('Protocol "'+n+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return it.call(this,n,t)},f.scheme=f.protocol,f.port=function(n,t){if(this._parts.urn)return void 0===n?"":this;if(void 0!==n&&(0===n&&(n=null),n&&(n+="",":"===n.charAt(0)&&(n=n.substring(1)),n.match(/[^0-9]/))))throw new TypeError('Port "'+n+'" contains characters other than [0-9]');return rt.call(this,n,t)},f.hostname=function(n,t){if(this._parts.urn)return void 0===n?"":this;if(void 0!==n){var i={};if("/"!==u.parseHost(n,i))throw new TypeError('Hostname "'+n+'" contains characters other than [A-Z0-9.-]');n=i.hostname}return ut.call(this,n,t)},f.origin=function(n,t){if(this._parts.urn)return void 0===n?"":this;if(void 0===n){var i=this.protocol();return this.authority()?(i?i+"://":"")+this.authority():""}return i=u(n),this.protocol(i.protocol()).authority(i.authority()).build(!t),this},f.host=function(n,t){if(this._parts.urn)return void 0===n?"":this;if(void 0===n)return this._parts.hostname?u.buildHost(this._parts):"";if("/"!==u.parseHost(n,this._parts))throw new TypeError('Hostname "'+n+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},f.authority=function(n,t){if(this._parts.urn)return void 0===n?"":this;if(void 0===n)return this._parts.hostname?u.buildAuthority(this._parts):"";if("/"!==u.parseAuthority(n,this._parts))throw new TypeError('Hostname "'+n+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},f.userinfo=function(n,t){if(this._parts.urn)return void 0===n?"":this;if(void 0===n){if(!this._parts.username)return"";var i=u.buildUserinfo(this._parts);return i.substring(0,i.length-1)}return"@"!==n[n.length-1]&&(n+="@"),u.parseUserinfo(n,this._parts),this.build(!t),this},f.resource=function(n,t){var i;return void 0===n?this.path()+this.search()+this.hash():(i=u.parse(n),this._parts.path=i.path,this._parts.query=i.query,this._parts.fragment=i.fragment,this.build(!t),this)},f.subdomain=function(n,t){if(this._parts.urn)return void 0===n?"":this;if(void 0===n){if(!this._parts.hostname||this.is("IP"))return"";var i=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,i)||""}return i=this._parts.hostname.length-this.domain().length,i=this._parts.hostname.substring(0,i),i=new RegExp("^"+h(i)),n&&"."!==n.charAt(n.length-1)&&(n+="."),n&&u.ensureValidHostname(n),this._parts.hostname=this._parts.hostname.replace(i,n),this.build(!t),this},f.domain=function(n,t){if(this._parts.urn)return void 0===n?"":this;if("boolean"==typeof n&&(t=n,n=void 0),void 0===n){if(!this._parts.hostname||this.is("IP"))return"";var i=this._parts.hostname.match(/\./g);return i&&2>i.length?this._parts.hostname:(i=this._parts.hostname.length-this.tld(t).length-1,i=this._parts.hostname.lastIndexOf(".",i-1)+1,this._parts.hostname.substring(i)||"")}if(!n)throw new TypeError("cannot set domain empty");return u.ensureValidHostname(n),!this._parts.hostname||this.is("IP")?this._parts.hostname=n:(i=new RegExp(h(this.domain())+"$"),this._parts.hostname=this._parts.hostname.replace(i,n)),this.build(!t),this},f.tld=function(n,t){if(this._parts.urn)return void 0===n?"":this;if("boolean"==typeof n&&(t=n,n=void 0),void 0===n){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.lastIndexOf("."),r=this._parts.hostname.substring(r+1);return!0!==t&&i&&i.list[r.toLowerCase()]?i.get(this._parts.hostname)||r:r}if(n)if(n.match(/[^a-zA-Z0-9-]/))if(i&&i.is(n))r=new RegExp(h(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(r,n);else throw new TypeError('TLD "'+n+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");r=new RegExp(h(this.tld())+"$");this._parts.hostname=this._parts.hostname.replace(r,n)}else throw new TypeError("cannot set TLD empty");return this.build(!t),this},f.directory=function(n,t){if(this._parts.urn)return void 0===n?"":this;if(void 0===n||!0===n){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var i=this._parts.path.length-this.filename().length-1,i=this._parts.path.substring(0,i)||(this._parts.hostname?"/":"");return n?u.decodePath(i):i}return i=this._parts.path.length-this.filename().length,i=this._parts.path.substring(0,i),i=new RegExp("^"+h(i)),this.is("relative")||(n||(n="/"),"/"!==n.charAt(0)&&(n="/"+n)),n&&"/"!==n.charAt(n.length-1)&&(n+="/"),n=u.recodePath(n),this._parts.path=this._parts.path.replace(i,n),this.build(!t),this},f.filename=function(n,t){var i,r;return this._parts.urn?void 0===n?"":this:void 0===n||!0===n?!this._parts.path||"/"===this._parts.path?"":(i=this._parts.path.lastIndexOf("/"),i=this._parts.path.substring(i+1),n?u.decodePathSegment(i):i):(i=!1,"/"===n.charAt(0)&&(n=n.substring(1)),n.match(/\.?\//)&&(i=!0),r=new RegExp(h(this.filename())+"$"),n=u.recodePath(n),this._parts.path=this._parts.path.replace(r,n),i?this.normalizePath(t):this.build(!t),this)},f.suffix=function(n,t){if(this._parts.urn)return void 0===n?"":this;if(void 0===n||!0===n){if(!this._parts.path||"/"===this._parts.path)return"";var i=this.filename(),r=i.lastIndexOf(".");return-1===r?"":(i=i.substring(r+1),i=/^[a-z0-9%]+$/i.test(i)?i:"",n?u.decodePathSegment(i):i)}if("."===n.charAt(0)&&(n=n.substring(1)),i=this.suffix())r=n?new RegExp(h(i)+"$"):new RegExp(h("."+i)+"$");else{if(!n)return this;this._parts.path+="."+u.recodePath(n)}return r&&(n=u.recodePath(n),this._parts.path=this._parts.path.replace(r,n)),this.build(!t),this},f.segment=function(n,t,i){var u=this._parts.urn?":":"/",r=this.path(),f="/"===r.substring(0,1),r=r.split(u),o;if(void 0!==n&&"number"!=typeof n&&(i=t,t=n,n=void 0),void 0!==n&&"number"!=typeof n)throw Error('Bad segment "'+n+'", must be 0-based integer');if(f&&r.shift(),0>n&&(n=Math.max(r.length+n,0)),void 0===t)return void 0===n?r:r[n];if(null===n||void 0===r[n])if(e(t))for(r=[],n=0,o=t.length;n<o;n++)(t[n].length||r.length&&r[r.length-1].length)&&(r.length&&!r[r.length-1].length&&r.pop(),r.push(p(t[n])));else(t||"string"==typeof t)&&(t=p(t),""===r[r.length-1]?r[r.length-1]=t:r.push(t));else t?r[n]=p(t):r.splice(n,1);return f&&r.unshift(""),this.path(r.join(u),i)},f.segmentCoded=function(n,t,i){var r,f;if("number"!=typeof n&&(i=t,t=n,n=void 0),void 0===t){if(n=this.segment(n,t,i),e(n))for(r=0,f=n.length;r<f;r++)n[r]=u.decode(n[r]);else n=void 0!==n?u.decode(n):void 0;return n}if(e(t))for(r=0,f=t.length;r<f;r++)t[r]=u.encode(t[r]);else t="string"==typeof t||t instanceof String?u.encode(t):t;return this.segment(n,t,i)},g=f.query,f.query=function(n,t){if(!0===n)return u.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("function"==typeof n){var i=u.parseQuery(this._parts.query,this._parts.escapeQuerySpace),r=n.call(this,i);return this._parts.query=u.buildQuery(r||i,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this}return void 0!==n&&"string"!=typeof n?(this._parts.query=u.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this):g.call(this,n,t)},f.setQuery=function(n,t,i){var f=u.parseQuery(this._parts.query,this._parts.escapeQuerySpace),r;if("string"==typeof n||n instanceof String)f[n]=void 0!==t?t:null;else if("object"==typeof n)for(r in n)o.call(n,r)&&(f[r]=n[r]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=u.buildQuery(f,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof n&&(i=t),this.build(!i),this},f.addQuery=function(n,t,i){var r=u.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return u.addQuery(r,n,void 0===t?null:t),this._parts.query=u.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof n&&(i=t),this.build(!i),this},f.removeQuery=function(n,t,i){var r=u.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return u.removeQuery(r,n,t),this._parts.query=u.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof n&&(i=t),this.build(!i),this},f.hasQuery=function(n,t,i){var r=u.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return u.hasQuery(r,n,t,i)},f.setSearch=f.setQuery,f.addSearch=f.addQuery,f.removeSearch=f.removeQuery,f.hasSearch=f.hasQuery,f.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},f.normalizeProtocol=function(n){return"string"==typeof this._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!n)),this},f.normalizeHostname=function(i){return this._parts.hostname&&(this.is("IDN")&&n?this._parts.hostname=n.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!i)),this},f.normalizePort=function(n){return"string"==typeof this._parts.protocol&&this._parts.port===u.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!n)),this},f.normalizePath=function(n){var t=this._parts.path,e,r,i,f;if(!t)return this;if(this._parts.urn)return this._parts.path=u.recodeUrnPath(this._parts.path),this.build(!n),this;if("/"===this._parts.path)return this;for(t=u.recodePath(t),r="","/"!==t.charAt(0)&&(e=!0,t="/"+t),("/.."===t.slice(-3)||"/."===t.slice(-2))&&(t+="/"),t=t.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),e&&(r=t.substring(1).match(/^(\.\.\/)+/)||"")&&(r=r[0]);;){if(i=t.search(/\/\.\.(\/|$)/),-1===i)break;else if(0===i){t=t.substring(3);continue}f=t.substring(0,i).lastIndexOf("/");-1===f&&(f=i);t=t.substring(0,f)+t.substring(i+3)}return e&&this.is("relative")&&(t=r+t.substring(1)),this._parts.path=t,this.build(!n),this},f.normalizePathname=f.normalizePath,f.normalizeQuery=function(n){return"string"==typeof this._parts.query&&(this._parts.query.length?this.query(u.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!n)),this},f.normalizeFragment=function(n){return this._parts.fragment||(this._parts.fragment=null,this.build(!n)),this},f.normalizeSearch=f.normalizeQuery,f.normalizeHash=f.normalizeFragment,f.iso8859=function(){var n=u.encode,t=u.decode;u.encode=escape;u.decode=decodeURIComponent;try{this.normalize()}finally{u.encode=n;u.decode=t}return this},f.unicode=function(){var n=u.encode,t=u.decode;u.encode=w;u.decode=unescape;try{this.normalize()}finally{u.encode=n;u.decode=t}return this},f.readable=function(){var t=this.clone(),i,f,r;if(t.username("").password("").normalize(),i="",t._parts.protocol&&(i+=t._parts.protocol+"://"),t._parts.hostname&&(t.is("punycode")&&n?(i+=n.toUnicode(t._parts.hostname),t._parts.port&&(i+=":"+t._parts.port)):i+=t.host()),t._parts.hostname&&t._parts.path&&"/"!==t._parts.path.charAt(0)&&(i+="/"),i+=t.path(!0),t._parts.query){for(var r="",e=0,o=t._parts.query.split("&"),s=o.length;e<s;e++)f=(o[e]||"").split("="),r=r+("&"+u.decodeQuery(f[0],this._parts.escapeQuerySpace).replace(/&/g,"%26")),void 0!==f[1]&&(r+="="+u.decodeQuery(f[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"));i+="?"+r.substring(1)}return i+u.decodeQuery(t.hash(),!0)},f.absoluteTo=function(n){var t=this.clone(),i=["protocol","username","password","hostname","port"],r,f;if(this._parts.urn)throw Error("URNs do not have any generally defined hierarchical components");if(n instanceof u||(n=new u(n)),t._parts.protocol||(t._parts.protocol=n._parts.protocol),this._parts.hostname)return t;for(r=0;f=i[r];r++)t._parts[f]=n._parts[f];return t._parts.path?".."===t._parts.path.substring(-2)&&(t._parts.path+="/"):(t._parts.path=n._parts.path,t._parts.query||(t._parts.query=n._parts.query)),"/"!==t.path().charAt(0)&&(i=(i=n.directory())?i:0===n.path().indexOf("/")?"/":"",t._parts.path=(i?i+"/":"")+t._parts.path,t.normalizePath()),t.build(),t},f.relativeTo=function(n){var f=this.clone().normalize(),t,i,r;if(f._parts.urn)throw Error("URNs do not have any generally defined hierarchical components");if(n=new u(n).normalize(),t=f._parts,i=n._parts,r=f.path(),n=n.path(),"/"!==r.charAt(0))throw Error("URI is already relative");if("/"!==n.charAt(0))throw Error("Cannot calculate a URI relative to another relative URI");if(t.protocol===i.protocol&&(t.protocol=null),t.username===i.username&&t.password===i.password&&null===t.protocol&&null===t.username&&null===t.password&&t.hostname===i.hostname&&t.port===i.port)t.hostname=null,t.port=null;else return f.build();return r===n?(t.path="",f.build()):(r=u.commonPath(r,n),!r)?f.build():(i=i.path.substring(r.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../"),t.path=i+t.path.substring(r.length)||"./",f.build())},f.equals=function(n){var f=this.clone();n=new u(n);var i={},r={},s={},t;if(f.normalize(),n.normalize(),f.toString()===n.toString())return!0;if(i=f.query(),r=n.query(),f.query(""),n.query(""),f.toString()!==n.toString()||i.length!==r.length)return!1;i=u.parseQuery(i,this._parts.escapeQuerySpace);r=u.parseQuery(r,this._parts.escapeQuerySpace);for(t in i)if(o.call(i,t)){if(e(i[t])){if(!k(i[t],r[t]))return!1}else if(i[t]!==r[t])return!1;s[t]=!0}for(t in r)if(o.call(r,t)&&!s[t])return!1;return!0},f.duplicateQueryParameters=function(n){return this._parts.duplicateQueryParameters=!!n,this},f.escapeQuerySpace=function(n){return this._parts.escapeQuerySpace=!!n,this},u}),function(n,t){"object"==typeof exports?module.exports=t(require("./URI")):"function"==typeof define&&define.amd?define(["./URI"],t):n.URITemplate=t(n.URI,n)}(this,function(n,t){function i(n){return i._cache[n]?i._cache[n]:(this instanceof i)?(this.expression=n,i._cache[n]=this,this):new i(n)}function r(n){this.data=n;this.cache={}}var e=t&&t.URITemplate,o=Object.prototype.hasOwnProperty,u=i.prototype,f={"":{prefix:"",separator:",",named:!1,empty_name_separator:!1,encode:"encode"},"+":{prefix:"",separator:",",named:!1,empty_name_separator:!1,encode:"encodeReserved"},"#":{prefix:"#",separator:",",named:!1,empty_name_separator:!1,encode:"encodeReserved"},".":{prefix:".",separator:".",named:!1,empty_name_separator:!1,encode:"encode"},"/":{prefix:"/",separator:"/",named:!1,empty_name_separator:!1,encode:"encode"},";":{prefix:";",separator:";",named:!0,empty_name_separator:!1,encode:"encode"},"?":{prefix:"?",separator:"&",named:!0,empty_name_separator:!0,encode:"encode"},"&":{prefix:"&",separator:"&",named:!0,empty_name_separator:!0,encode:"encode"}};return i._cache={},i.EXPRESSION_PATTERN=/\{([^a-zA-Z0-9%_]?)([^\}]+)(\}|$)/g,i.VARIABLE_PATTERN=/^([^*:]+)((\*)|:(\d+))?$/,i.VARIABLE_NAME_PATTERN=/[^a-zA-Z0-9%_]/,i.expand=function(n,t){for(var u=f[n.operator],h=u.named?"Named":"Unnamed",c=n.variables,e=[],o,r,s=0;r=c[s];s++)o=t.get(r.name),o.val.length?e.push(i["expand"+h](o,u,r.explode,r.explode&&u.separator||",",r.maxlength,r.name)):o.type&&e.push("");return e.length?u.prefix+e.join(u.separator):""},i.expandNamed=function(t,i,r,u,f,e){var c="",o=i.encode,a,l,h,s,v;for(i=i.empty_name_separator,a=!t[o].length,l=2===t.type?"":n[o](e),s=0,v=t.val.length;s<v;s++)f?(h=n[o](t.val[s][1].substring(0,f)),2===t.type&&(l=n[o](t.val[s][0].substring(0,f)))):a?(h=n[o](t.val[s][1]),2===t.type?(l=n[o](t.val[s][0]),t[o].push([l,h])):t[o].push([void 0,h])):(h=t[o][s][1],2===t.type&&(l=t[o][s][0])),c&&(c+=u),r?c+=l+(i||h?"=":"")+h:(s||(c+=n[o](e)+(i||h?"=":"")),2===t.type&&(c+=l+","),c+=h);return c},i.expandUnnamed=function(t,i,r,u,f){var o="",s=i.encode,c,l,h,e,a;for(i=i.empty_name_separator,c=!t[s].length,e=0,a=t.val.length;e<a;e++)f?h=n[s](t.val[e][1].substring(0,f)):c?(h=n[s](t.val[e][1]),t[s].push([2===t.type?n[s](t.val[e][0]):void 0,h])):h=t[s][e][1],o&&(o+=u),2===t.type&&(l=f?n[s](t.val[e][0].substring(0,f)):t[s][e][0],o+=l,o=r?o+(i||h?"=":""):o+","),o+=h;return o},i.noConflict=function(){return t.URITemplate===i&&(t.URITemplate=e),i},u.expand=function(n){var u="",t,f;for(this.parts&&this.parts.length||this.parse(),n instanceof r||(n=new r(n)),t=0,f=this.parts.length;t<f;t++)u+="string"==typeof this.parts[t]?this.parts[t]:i.expand(this.parts[t],n);return u},u.parse=function(){var o=this.expression,h=i.EXPRESSION_PATTERN,l=i.VARIABLE_PATTERN,a=i.VARIABLE_NAME_PATTERN,u=[],s=0,r,n,t,e,c;for(h.lastIndex=0;;){if(n=h.exec(o),null===n){u.push(o.substring(s));break}else u.push(o.substring(s,n.index)),s=n.index+n[0].length;if(!f[n[1]])throw Error('Unknown Operator "'+n[1]+'" in "'+n[0]+'"');if(!n[3])throw Error('Unclosed Expression "'+n[0]+'"');for(r=n[2].split(","),e=0,c=r.length;e<c;e++){if(t=r[e].match(l),null===t)throw Error('Invalid Variable "'+r[e]+'" in "'+n[0]+'"');if(t[1].match(a))throw Error('Invalid Variable Name "'+t[1]+'" in "'+n[0]+'"');r[e]={name:t[1],explode:!!t[3],maxlength:t[4]&&parseInt(t[4],10)}}if(!r.length)throw Error('Expression Missing Variable(s) "'+n[0]+'"');u.push({expression:n[0],operator:n[1],variables:r})}return u.length||u.push(o),this.parts=u,this},r.prototype.get=function(n){var t=this.data,r={type:0,val:[],encode:[],encodeReserved:[]},i;if(void 0!==this.cache[n])return this.cache[n];if(this.cache[n]=r,t="[object Function]"===String(Object.prototype.toString.call(t))?t(n):"[object Function]"===String(Object.prototype.toString.call(t[n]))?t[n](n):t[n],void 0!==t&&null!==t)if("[object Array]"===String(Object.prototype.toString.call(t))){for(i=0,n=t.length;i<n;i++)void 0!==t[i]&&null!==t[i]&&r.val.push([void 0,String(t[i])]);r.val.length&&(r.type=3)}else if("[object Object]"===String(Object.prototype.toString.call(t))){for(i in t)o.call(t,i)&&void 0!==t[i]&&null!==t[i]&&r.val.push([i,String(t[i])]);r.val.length&&(r.type=2)}else r.type=1,r.val.push([void 0,String(t)]);return r},n.expand=function(t,r){var u=new i(t).expand(r);return new n(u)},i}),function(n,t){"object"==typeof exports?module.exports=t(require("jquery","./URI")):"function"==typeof define&&define.amd?define(["jquery","./URI"],t):t(n.jQuery,n.URI)}(this,function(n,t){function r(n){return n.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function u(n){var i=n.nodeName.toLowerCase();if("input"!==i||"image"===n.type)return t.domAttributes[i]}function c(t){return{get:function(i){return n(i).uri()[t]()},set:function(i,r){return n(i).uri()[t](r),r}}}function f(t,r){var f,o,s;return!u(t)||!r?!1:(f=r.match(h),!f||!f[5]&&":"!==f[2]&&!i[f[2]])?!1:(s=n(t).uri(),f[5])?s.is(f[5]):":"===f[2]?(o=f[1].toLowerCase()+":",i[o]?i[o](s,f[4]):!1):(o=f[1].toLowerCase(),e[o]?i[f[2]](s[o](),f[4],o):!1)}var e={},i={"=":function(n,t){return n===t},"^=":function(n,t){return!!(n+"").match(new RegExp("^"+r(t),"i"))},"$=":function(n,t){return!!(n+"").match(new RegExp(r(t)+"$","i"))},"*=":function(n,t,i){return"directory"===i&&(n+="/"),!!(n+"").match(new RegExp(r(t),"i"))},"equals:":function(n,t){return n.equals(t)},"is:":function(n,t){return n.is(t)}},o,s,h;return n.each("origin authority directory domain filename fragment hash host hostname href password path pathname port protocol query resource scheme search subdomain suffix tld username".split(" "),function(t,i){e[i]=!0;n.attrHooks["uri:"+i]=c(i)}),o=function(t,i){return n(t).uri().href(i).toString()},n.each(["src","href","action","uri","cite"],function(t,i){n.attrHooks[i]={set:o}}),n.attrHooks.uri.get=function(t){return n(t).uri()},n.fn.uri=function(n){var i=this.first(),r=i.get(0),f=u(r),e;if(!f)throw Error('Element "'+r.nodeName+'" does not have either property: href, src, action, cite');if(void 0!==n){if(e=i.data("uri"),e)return e.href(n);n instanceof t||(n=t(n||""))}else{if(n=i.data("uri"))return n;n=t(i.attr(f)||"")}return n._dom_element=r,n._dom_attribute=f,n.normalize(),i.data("uri",n),n},t.prototype.build=function(n){return this._dom_element?(this._string=t.build(this._parts),this._deferred_build=!1,this._dom_element.setAttribute(this._dom_attribute,this._string),this._dom_element[this._dom_attribute]=this._string):!0===n?this._deferred_build=!0:(void 0===n||this._deferred_build)&&(this._string=t.build(this._parts),this._deferred_build=!1),this},h=/^([a-zA-Z]+)\s*([\^\$*]?=|:)\s*(['"]?)(.+)\3|^\s*([a-zA-Z0-9]+)\s*$/,s=n.expr.createPseudo?n.expr.createPseudo(function(n){return function(t){return f(t,n)}}):function(n,t,i){return f(n,i[3])},n.expr[":"].uri=s,n});!function(n,t){"use strict";var i=n.Messaging,r=n.Shared;i.Models.Conversation=t.NestedModel.extend({urlRoot:"/api/messaging/conversations",defaults:{selected:!1,sendOnEnter:!0},associations:{users:function(n,t){return new i.Collections.Users(n,t)},messages:function(n,t){return new i.Collections.Messages(n,t)}},initialize:function(n){this.set(this._getAdditionalData(n),{silent:!0});this.setAssociation("messages",[],{});this.listenTo(this,"updateLastMessage",this._onUpdateLastMessage);this.listenTo(this,"change:sendOnEnter",this.onChangeSendOnEnter);this.loadSendOnEnterPreference()},loadSendOnEnterPreference:function(){var t=n.Shared.Utils.LocalStorageHelper.get("messaging:sendOnEnter");t===null&&(t=!0);this.set("sendOnEnter",t)},onChangeSendOnEnter:function(){n.Shared.Utils.LocalStorageHelper.set("messaging:sendOnEnter",this.get("sendOnEnter"))},select:function(){this.collection&&this.collection.select&&this.collection.select(this)},selected:function(){return this.collection?this.collection.selected===this:!1},isGroupConversation:function(){var n=this.get("users");return!n||!n.models?!1:n.models.length>2},getTitle:function(n){if(this.isGroupConversation())return this.get("name");var t=this.get("users")||{},i=t.models||[],r=_.chain(i).filter(function(t){return t.id!==n.id}).map(function(n){return n.get("name")+" "+n.get("surname")});return _.first(r.value())},hasStudents:function(){var t=this.users.reject(function(t){return t.get("username")===n.Data.User.username});return _.any(t,function(n){return n.get("role")===1})},_onUpdateLastMessage:function(n){var t={lastMessageSnippet:""};n&&(n.body?t.lastMessageSnippet=n.body:n.metadata&&n.metadata.link&&(t.lastMessageSnippet=n.metadata.link),t.lastMessageTime=n.dateCreated,t.timestamp=this._getTimestamp(n.dateCreated),n.sender&&(t.lastMessageSender=n.sender.name));this.set(t)},_getAdditionalData:function(n){if(!n)return n;var t={};return t.timestamp=0,n.lastMessageTime&&(t.timestamp=this._getTimestamp(n.lastMessageTime)),n.id&&(t.actionUrl="/messages/"+n.id),t},parse:function(n){return n?_.extend(n,this._getAdditionalData(n)):n},_getTimestamp:function(n){return moment.utc(n).valueOf()}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Messaging,r=n.Shared;i.Models.Message=t.NestedModel.extend({initialize:function(){this.listenTo(this,"request",this.onRequest);this.listenTo(this,"sync error",this.onSync)},associations:{sender:function(n,t){return new i.Models.User(n,t)},metadata:function(n){return new i.Models.MessageMetadata(n)}},parse:function(n){return n.timestamp=this._getTimestamp(n.dateCreated),n},_getTimestamp:function(n){return moment.utc(n).valueOf()},onRequest:function(){this._loaded=!1},onSync:function(){this._loaded=!0},hasLoaded:function(){return!!this._loaded},isMine:function(n){return this.isNew()?!0:this.get("sender.id")===n?!0:!1}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Messaging;i.Models.MessageErrorViewModel=t.Model.extend({defaults:{hasError:!1,message:""}})}(ClickView,EasyMoney),function(n){n.Models.MessageMetadata=EasyMoney.Model.extend({urlRoot:"/api/og/messagemetadata",defaults:{link:null,title:null,image:null,snippet:null},isEmpty:function(){return!this.get("link")},isAudio:function(){return this.get("type")==="audio"},isImage:function(){return this.get("type")==="image"},isVideo:function(){return this.get("type")==="video"},isClickViewLink:function(){var n=this.get("siteName");return typeof n=="string"&&(n=n.toLowerCase()),n==="clickview"}})}(ClickView.Messaging);!function(n,t){"use strict";var i=n.Messaging,r=n.Shared;i.Models.MessagesApp=t.NestedModel.extend({defaults:{currentConversation:null},associations:{conversations:function(n,t){return n instanceof i.Collections.Conversations?n:new i.Collections.Conversations(n,t)},currentUser:function(n,t){return new i.Models.User(n,t)}}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Messaging,r=n.Shared;i.Models.User=t.Model.extend({})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Messaging,r=n.Shared;i.Collections.Conversations=t.Collection.extend({model:function(n,t){return new i.Models.Conversation(n,t)},url:"/api/messaging/conversations",initialize:function(n){this.listenTo(this,"change:timestamp",this.sort);this.listenToOnce(this,"sync",this.onSync);this.listenToOnce(this,"reset",this.onReset);n&&n.length>0&&(this.loaded=!0)},onReset:function(){this.selected=null},onSync:function(){this.loaded=!0},comparator:function(n){return-n.get("timestamp")},select:function(n){var t=this.selected;this.indexOf(n)>=0&&(this.selected=n,n.trigger("_selected",!0),t&&t.trigger("_selected",!1),this.trigger("selected",n))},getUnreadCount:function(){var n=this.where(function(n){return!!n.get("unread")});return n.length},parse:function(n){return n.data?n.data:n}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Messaging,r=n.Shared;i.Collections.Messages=t.Collection.extend({model:i.Models.Message,url:function(){return"/api/messaging/conversations/"+this._getConversationId()+"/messages"},initialize:function(){this.listenTo(this,"sync",this.onSync)},onSync:function(){this.loaded=!0},comparitor:"timestamp",_getConversationId:function(){if(this.parent)return this.parent.id;if(this.options.conversationId)return this.options.conversationId;throw new Error("Conversation Id required!");},parse:function(n){return n.data},getMessagesAfter:function(n){var t=this.get(n),i;return t?(i=function(n){return n.get("timestamp")>t.get("timestamp")},this.filter(i)):[]},fetchOlderMessages:function(){var n=this.last();this.fetch({data:{before:n.get("dateCreated")},remove:!1,merge:!0})}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Messaging,r=n.Shared;i.Collections.Users=t.PagedCollection.extend({model:i.Models.User})}(ClickView,EasyMoney);this.ClickView=this.ClickView||{};this.ClickView.Messaging=this.ClickView.Messaging||{};this.ClickView.Messaging.Templates=this.ClickView.Messaging.Templates||{};this.ClickView.Messaging.Templates.ConnectionInfoBanner=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return"<p>"+n.escapeExpression((f=(f=i.msg||(t!=null?t.msg:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"msg",hash:{},data:u}):f))+"<\/p>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Messaging=this.ClickView.Messaging||{};this.ClickView.Messaging.Templates=this.ClickView.Messaging.Templates||{};this.ClickView.Messaging.Templates.Conversation=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<div class="heading">\r\n    <div class="name">\r\n        <p>'+n.escapeExpression((f=(f=i.name||(t!=null?t.name:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"name",hash:{},data:u}):f))+'<\/p>\r\n        <span class="online-indicator-viewpart"><\/span>\r\n    <\/div>\r\n    <div class="connection-banner-viewpart"><\/div>\r\n<\/div>\r\n<div class="list-container"><\/div>\r\n<div class="send-form-viewpart"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Messaging=this.ClickView.Messaging||{};this.ClickView.Messaging.Templates=this.ClickView.Messaging.Templates||{};this.ClickView.Messaging.Templates.ConversationItem=Handlebars.template({"1":function(){return'            <div class="circle group"><span class="initials">G<\/span><\/div>\r\n'},"3":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s=n.escapeExpression;return'            <div class="circle '+s((i.placeholderColour||t&&t.placeholderColour||o).call(e,t!=null?t.initials:t,{name:"placeholderColour",hash:{},data:u}))+'"><span class="initials">'+s((f=(f=i.initials||(t!=null?t.initials:t))!=null?f:o,typeof f=="function"?f.call(e,{name:"initials",hash:{},data:u}):f))+"<\/span><\/div>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var c,f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<a href="'+h((f=(f=i.actionUrl||(t!=null?t.actionUrl:t))!=null?f:o,typeof f===s?f.call(e,{name:"actionUrl",hash:{},data:u}):f))+'">\r\n    <div class="inner">\r\n        <div class="image">\r\n'+((c=i["if"].call(e,t!=null?t.isGroup:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(3,u,0),data:u}))!=null?c:"")+'        <\/div>\r\n        <div class="content">\r\n            <p class="name">'+h((f=(f=i.name||(t!=null?t.name:t))!=null?f:o,typeof f===s?f.call(e,{name:"name",hash:{},data:u}):f))+'<span class="online-indicator-viewpart"><\/span><\/p>\r\n            <time datetime="'+h((f=(f=i.lastMessageTime||(t!=null?t.lastMessageTime:t))!=null?f:o,typeof f===s?f.call(e,{name:"lastMessageTime",hash:{},data:u}):f))+'" class="time">'+h((f=(f=i.lastMessageTime||(t!=null?t.lastMessageTime:t))!=null?f:o,typeof f===s?f.call(e,{name:"lastMessageTime",hash:{},data:u}):f))+'<\/time>\r\n            <p class="snippet">'+h((f=(f=i.lastMessageSnippet||(t!=null?t.lastMessageSnippet:t))!=null?f:o,typeof f===s?f.call(e,{name:"lastMessageSnippet",hash:{},data:u}):f))+"<\/p>\r\n        <\/div>\r\n    <\/div>\r\n<\/a>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Messaging=this.ClickView.Messaging||{};this.ClickView.Messaging.Templates=this.ClickView.Messaging.Templates||{};this.ClickView.Messaging.Templates.Conversations=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<p class="heading">Conversations<\/p>\r\n<div class="list">\r\n    <div class="conversations"><\/div>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Messaging=this.ClickView.Messaging||{};this.ClickView.Messaging.Templates=this.ClickView.Messaging.Templates||{};this.ClickView.Messaging.Templates.ConversationsDropdown=Handlebars.template({"1":function(){return'<div class="list"><div class="conversations"><\/div><\/div>\r\n<div class="footer">\r\n    <p><a href="/messages" class="see-all">See all messages<\/a><\/p>\r\n<\/div>\r\n'},"3":function(){return'<div class="no-messages">\r\n    <p>You don\'t have any messages yet. Your messages will appear here.<\/p>\r\n<\/div>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.hasConversations:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(3,u,0),data:u}))!=null?f:""},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Messaging=this.ClickView.Messaging||{};this.ClickView.Messaging.Templates=this.ClickView.Messaging.Templates||{};this.ClickView.Messaging.Templates.EmptyState=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<img src="https://static.clickview.com.au/cv-online/images/messages/emptystate-v1.png" class="mailbox" />\r\n<h2>You do not have any conversations yet.<\/h2>\r\n<p> Learn how to send a message <a href="'+n.escapeExpression((f=(f=i.supportWebsite||(t!=null?t.supportWebsite:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"supportWebsite",hash:{},data:u}):f))+'" target="_blank">here<\/a>.<\/p>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Messaging=this.ClickView.Messaging||{};this.ClickView.Messaging.Templates=this.ClickView.Messaging.Templates||{};this.ClickView.Messaging.Templates.MessageError=Handlebars.template({"1":function(n,t,i,r,u){var f;return'    <p class="error-text error">'+n.escapeExpression((f=(f=i.errorText||(t!=null?t.errorText:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"errorText",hash:{},data:u}):f))+"<\/p>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.hasError:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:""},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Messaging=this.ClickView.Messaging||{};this.ClickView.Messaging.Templates=this.ClickView.Messaging.Templates||{};this.ClickView.Messaging.Templates.MessageItem=Handlebars.template({"1":function(n,t){var i,r=n.lambda,u=n.escapeExpression;return'<div class="sender">\r\n    <p class="name">'+u(r((i=t!=null?t.sender:t)!=null?i.name:i,t))+" "+u(r((i=t!=null?t.sender:t)!=null?i.surname:i,t))+"<\/p>\r\n<\/div>\r\n"},"3":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return'    <div class="circle '+n.escapeExpression((i.placeholderColour||t&&t.placeholderColour||i.helperMissing).call(e,t!=null?t.initials:t,{name:"placeholderColour",hash:{},data:u}))+'">'+((f=i["if"].call(e,t!=null?t.hasSender:t,{name:"if",hash:{},fn:n.program(4,u,0),inverse:n.noop,data:u}))!=null?f:"")+"<\/div>\r\n"},"4":function(n,t,i,r,u){var f;return'<span class="initials">'+n.escapeExpression((f=(f=i.initials||(t!=null?t.initials:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"initials",hash:{},data:u}):f))+"<\/span>"},"6":function(){return'    <div class="circle failed"><span class="initials">!<\/span><\/div>\r\n'},"8":function(n,t,i,r,u){var f;return'    <div class="content">'+((f=(i.linkify||t&&t.linkify||i.helperMissing).call(t!=null?t:n.nullContext||{},t!=null?t.body:t,{name:"linkify",hash:{},data:u}))!=null?f:"")+"<\/div>\r\n"},"10":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'    <time datetime="'+h((f=(f=i.datetime||(t!=null?t.datetime:t))!=null?f:o,typeof f===s?f.call(e,{name:"datetime",hash:{},data:u}):f))+'" class="time">'+h((f=(f=i.time||(t!=null?t.time:t))!=null?f:o,typeof f===s?f.call(e,{name:"time",hash:{},data:u}):f))+"<\/time>\r\n"},"12":function(){return'    <a class="resend">Resend this message<\/a>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return((f=i["if"].call(e,t!=null?t.hasSender:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+'<div class="image">\r\n'+((f=i.unless.call(e,t!=null?t.failed:t,{name:"unless",hash:{},fn:n.program(3,u,0),inverse:n.program(6,u,0),data:u}))!=null?f:"")+'<\/div>\r\n\r\n\r\n<div class="inner">\r\n'+((f=i["if"].call(e,t!=null?t.body:t,{name:"if",hash:{},fn:n.program(8,u,0),inverse:n.noop,data:u}))!=null?f:"")+'    <div class="og-data-viewpart"><\/div>\r\n<\/div>\r\n<div class="time-container">\r\n'+((f=i.unless.call(e,t!=null?t.failed:t,{name:"unless",hash:{},fn:n.program(10,u,0),inverse:n.program(12,u,0),data:u}))!=null?f:"")+"<\/div>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Messaging=this.ClickView.Messaging||{};this.ClickView.Messaging.Templates=this.ClickView.Messaging.Templates||{};this.ClickView.Messaging.Templates.NewMessagesBar=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="text-container">\r\n    <div class="text">new messages<\/div>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Messaging=this.ClickView.Messaging||{};this.ClickView.Messaging.Templates=this.ClickView.Messaging.Templates||{};this.ClickView.Messaging.Templates.OgData=Handlebars.template({"1":function(n,t,i,r,u){var f;return'<a href="'+n.escapeExpression((f=(f=i.link||(t!=null?t.link:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"link",hash:{},data:u}):f))+'" target="_blank">'},"3":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return"    "+((f=i["if"].call(e,t!=null?t.renderPlayThumbnail:t,{name:"if",hash:{},fn:n.program(4,u,0),inverse:n.noop,data:u}))!=null?f:"")+'\r\n        <div class="play-btn-mask"><\/div>\r\n        <div class="play-icon-video">\r\n            <svg class="play-icon">\r\n                <use xlink:href="#play"><\/use>\r\n            <\/svg>\r\n        <\/div>\r\n'+((f=i.unless.call(e,t!=null?t.playVideo:t,{name:"unless",hash:{},fn:n.program(6,u,0),inverse:n.noop,data:u}))!=null?f:"")+"    "+((f=i["if"].call(e,t!=null?t.renderPlayThumbnail:t,{name:"if",hash:{},fn:n.program(8,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n"},"4":function(){return'<div class="cv-thumbnail">'},"6":function(n,t,i,r,u){var f;return'        <img class="og-image img-thumbnail" src="'+n.escapeExpression((f=(f=i.image||(t!=null?t.image:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"image",hash:{},data:u}):f))+'" />\r\n'},"8":function(){return"<\/div>"},"10":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return"<"+h((f=(f=i.linksTag||(t!=null?t.linksTag:t))!=null?f:o,typeof f===s?f.call(e,{name:"linksTag",hash:{},data:u}):f))+' class="og-link" href="'+h((f=(f=i.link||(t!=null?t.link:t))!=null?f:o,typeof f===s?f.call(e,{name:"link",hash:{},data:u}):f))+'" target="_blank">'+h((f=(f=i.host||(t!=null?t.host:t))!=null?f:o,typeof f===s?f.call(e,{name:"host",hash:{},data:u}):f))+"<\/"+h((f=(f=i.linksTag||(t!=null?t.linksTag:t))!=null?f:o,typeof f===s?f.call(e,{name:"linksTag",hash:{},data:u}):f))+">"},"12":function(n,t,i,r,u){var e,f;return'<p class="og-desc">'+((e=(f=(f=i.snippet||(t!=null?t.snippet:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"snippet",hash:{},data:u}):f))!=null?e:"")+"<\/p>"},"14":function(){return'<span class="close">&times;<\/span>'},"16":function(){return"<\/a>"},"18":function(n,t,i,r,u){var f;return'<div class="close-video">Close video<\/div>\r\n<div class="video-container">\r\n    <iframe allowfullscreen="" webkitallowfullscreen="" mozallowfullscreen="" frameborder="0" src="'+n.escapeExpression((f=(f=i.embedLink||(t!=null?t.embedLink:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"embedLink",hash:{},data:u}):f))+'"><\/iframe>\r\n<\/div>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{},s=i.helperMissing,h="function",c=n.escapeExpression;return((e=i["if"].call(o,t!=null?t.clickable:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?e:"")+"\r\n\r\n"+((e=i["if"].call(o,t!=null?t.image:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?e:"")+'\r\n<h3 class="og-title"><'+c((f=(f=i.linksTag||(t!=null?t.linksTag:t))!=null?f:s,typeof f===h?f.call(o,{name:"linksTag",hash:{},data:u}):f))+' target="_blank" href="'+c((f=(f=i.link||(t!=null?t.link:t))!=null?f:s,typeof f===h?f.call(o,{name:"link",hash:{},data:u}):f))+'">'+((e=(f=(f=i.title||(t!=null?t.title:t))!=null?f:s,typeof f===h?f.call(o,{name:"title",hash:{},data:u}):f))!=null?e:"")+"<\/"+c((f=(f=i.linksTag||(t!=null?t.linksTag:t))!=null?f:s,typeof f===h?f.call(o,{name:"linksTag",hash:{},data:u}):f))+"><\/h3>\r\n"+((e=i["if"].call(o,t!=null?t.link:t,{name:"if",hash:{},fn:n.program(10,u,0),inverse:n.noop,data:u}))!=null?e:"")+"\r\n"+((e=i["if"].call(o,t!=null?t.snippet:t,{name:"if",hash:{},fn:n.program(12,u,0),inverse:n.noop,data:u}))!=null?e:"")+"\r\n"+((e=i["if"].call(o,t!=null?t.showClose:t,{name:"if",hash:{},fn:n.program(14,u,0),inverse:n.noop,data:u}))!=null?e:"")+"\r\n\r\n"+((e=i["if"].call(o,t!=null?t.clickable:t,{name:"if",hash:{},fn:n.program(16,u,0),inverse:n.noop,data:u}))!=null?e:"")+"\r\n\r\n"+((e=i["if"].call(o,t!=null?t.playVideo:t,{name:"if",hash:{},fn:n.program(18,u,0),inverse:n.noop,data:u}))!=null?e:"")+"\r\n"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Messaging=this.ClickView.Messaging||{};this.ClickView.Messaging.Templates=this.ClickView.Messaging.Templates||{};this.ClickView.Messaging.Templates.SendForm=Handlebars.template({"1":function(){return" checked"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<div class="textbox-container">\r\n    <div class="form-group textbox">\r\n        <textarea class="textbox large" name="body" placeholder="Write a reply..." rows="1"><\/textarea>\r\n        <span class="help-block hidden"><\/span>\r\n    <\/div><div class="form-group og-data-viewpart"><\/div>\r\n\r\n    <div class="submit-container">\r\n        <label class="press-enter">Press enter to send message <input type="checkbox" class="checkbox" '+((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.sendOnEnter:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+'/><\/label>\r\n        <button class="btn primary send" type="submit">Reply<\/button>\r\n    <\/div>\r\n    <div class="typing-notification-viewpart"><\/div>\r\n    <div class="message-error-viewpart"><\/div>\r\n<\/div>\r\n\r\n'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Messaging=this.ClickView.Messaging||{};this.ClickView.Messaging.Templates=this.ClickView.Messaging.Templates||{};this.ClickView.Messaging.Templates.TypingNotification=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return h((f=(f=i.users||(t!=null?t.users:t))!=null?f:o,typeof f===s?f.call(e,{name:"users",hash:{},data:u}):f))+" "+h((f=(f=i.verb||(t!=null?t.verb:t))!=null?f:o,typeof f===s?f.call(e,{name:"verb",hash:{},data:u}):f))+" typing..."},useData:!0});!function(n,t){"use strict";var i=n.Messaging,r=n.Shared;i.Views.ConnectionInfoBanner=t.View.extend({name:"ConnectionInfoBanner",className:"connection-info-banner",template:i.Templates.ConnectionInfoBanner,_unloading:!1,initialize:function(){this.listenTo(n.Services.MessagingService,"connected",this.render,this);this.listenTo(n.Services.MessagingService,"disconnected",this.render,this);this.listenTo(n.Services.MessagingService,"reconnecting",this.render,this);this.bindWindowEvent("beforeunload",this.onBeforeUnload);this.hide()},bindWindowEvent:function(n,t){this._windowevents||(this._windowevents=[]);var i=_.bind(t,this);window.addEventListener(n,i);this._windowevents.push({name:n,fn:i})},unbindWindowEvents:function(){_.each(this._windowevents,function(n){window.removeEventListener(n.name,n.fn)})},onClose:function(){this.unbindWindowEvents()},onBeforeUnload:function(){this._unloading=!0},onBeforeRender:function(){if(this._unloading)return!1},getInfoObj:function(){var t=n.Services.MessagingService.getConnectionState();switch(t){case"disconnected":return{msg:"Disconnected from messaging. Are you still there?",className:"alert",hide:!1,show:!0};case"reconnecting":return{msg:"It seems we are having troubles contacting our servers right now. Please hold tight",className:"warning",hide:!1,show:!0};case"connected":return{msg:"Hooray! We're back",className:"success",hide:!0,show:!1}}return{}},viewOptions:function(){return this.getInfoObj()},slideHide:function(){this.$el.delay(2e3).slideUp()},slideShow:function(){this.$el.delay(500).slideDown()},onRender:function(){var n=this.getInfoObj();if(!n.msg){this.hide();return}this.$el.prop("class",this.className+" "+n.className);n.show&&this.slideShow();n.hide&&this.slideHide()}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Messaging,r=n.Shared;i.Views.Conversation=t.View.extend({name:"Conversation",className:"conversation-app",template:i.Templates.Conversation,ui:{list:".list-container",sendForm:".send-form-viewpart",$onlineIndicator:".online-indicator-viewpart",connectionBanner:".connection-banner-viewpart"},initialize:function(){this.model||this._getModel(this.options.appModel.conversations,this.options.conversationId);n.Services.MessagingService&&this.listenTo(n.Services.MessagingService,"message",this._onMessageReceived,this)},viewOptions:function(){var n=this.options.appModel.get("currentUser");return{name:this.model.getTitle(n)}},_onMessageReceived:function(n){this.model.id===n&&this._markRead()},_afterModelSet:function(){this.bindListeners();this.model.messages.loaded||n.Services.MessagingService.ready(function(){this.model.messages.fetch()},this)},_getModel:function(n,t){if(n.loaded)return this.fetchModel(n,t);this.listenToOnce(n,"sync",function(){this.fetchModel(n,t)})},fetchModel:function(n,t){if(!t)return this.onSync(n.first(),!1);var r=n.get(t);if(r)return this.onSync(r,!1);r=new i.Models.Conversation({id:conversationId});r.fetch().success(_.bind(function(){this.onSync(r,!0)},this))},onSync:function(n,t){n&&(this.model=n,t&&conversations.add(n),this._afterModelSet())},bindListeners:function(){this.listenTo(this.model.messages,"sync",this._onSyncMessages);this.listenTo(this.model.messages,"add",this._onMessageAdd)},_onMessageAdd:function(){},_onSyncMessages:function(){this._markRead()},_markRead:function(){if(this.model.messages){var t=this.model.messages.max(function(n){return n.get("timestamp")});t&&t.id&&(this.model.set({unread:!1,lastReadMessageId:t.id}),n.Services.MessagingService.markRead(this.model.id,t.id))}},renderMessages:function(){var n=new i.Views.MessageList({collection:this.model.messages,appModel:this.options.appModel,conversation:this.model});this.renderView(this.ui.list,n)},renderSendForm:function(){var n=new i.Views.SendFormView({conversation:this.model});this.renderView(this.ui.sendForm,n)},renderOnlineIndicator:function(){var n=new i.Views.OnlineIndicatorView({conversation:this.model,appModel:this.options.appModel});this.renderView(this.ui.$onlineIndicator,n)},renderConnectionBanner:function(){var n=new i.Views.ConnectionInfoBanner;this.renderView(this.ui.connectionBanner,n)},isReady:function(){return this.model&&this.model.messages&&this.model.users},onRender:function(){this.renderMessages();this.renderSendForm();this.renderOnlineIndicator();this.renderConnectionBanner();this._markRead()}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Messaging,r=n.Shared;i.Views.ConversationItem=t.View.extend({name:"ConversationItem",template:i.Templates.ConversationItem,className:"conversation",tagName:"li",setSelected:function(){var n=this.model.selected();n?this.$el.addClass("selected"):this.$el.removeClass("selected")},ui:{timestamp:"time",$onlineIndicator:".online-indicator-viewpart"},events:{click:"_onClick"},_onClick:function(){return this.model.select(),!1},initialize:function(){this.listenTo(this.model,"remove",this.close);this.listenTo(this.model,"_selected",this.setSelected);this.listenTo(this.model,"change:lastMessageTime",this.render);this.listenTo(this.model,"change:unread",this.render)},viewOptions:function(){var n=this.options.appModel.get("currentUser");return{time:moment(this.model.get("dateCreated")).toISOString(),initials:r.Helpers.generateInitials(this.model.users.models,[n.get("id")]),name:this.model.getTitle(n),isGroup:this.model.isGroupConversation()}},renderOnlineIndicator:function(){var n=new i.Views.OnlineIndicatorView({conversation:this.model,appModel:this.options.appModel});this.renderView(this.ui.$onlineIndicator,n)},onRender:function(){this.initTimeago();this.setSelected();this.renderOnlineIndicator();this.model.get("unread")?this.$el.addClass("unread"):this.$el.removeClass("unread")},initTimeago:function(){this.ui.timestamp.timeago()}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Messaging,r=n.Shared;i.Views.ConversationList=t.ListView.extend({name:"ConversationList",childView:i.Views.ConversationItem,className:function(){return this.options.compactView?"compact":""},initialize:function(){this.listenTo(this.collection,"add",this.addOne);this.listenTo(this.collection,"sort",this.render)},buildChildView:function(n){var t=_.extend({},_.omit(this.options,["collection","model","id"]),{model:n,collection:this.collection});return new this.childView(t)}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Messaging,r=n.Shared;i.Views.Conversations=t.View.extend({name:"Conversations",className:"conversations-app",template:i.Templates.Conversations,ui:{conversations:".conversations"},initialize:function(){n.Services.MessagingService&&this.listenTo(n.Services.MessagingService,"markRead",this._onMarkedRead,this);this.listenTo(this.model.conversations,"sync",this.render);this.listenTo(this.model.conversations,"selected",this._onConversationSelected)},_onMarkedRead:function(n,t){var i=this.model.conversations.findWhere({id:n});i&&i.set({unread:!1,lastReadMessageId:t})},_onConversationSelected:function(n){t.Events.trigger("navigate",n.get("actionUrl"))},renderConversations:function(){var n=new i.Views.ConversationList({collection:this.model.conversations,appModel:this.model,compactView:this.options.compactView});this.renderView(this.ui.conversations,n)},onRender:function(){this.renderConversations();this.initScrollBar()},onRendered:function(){this.initScrollBar()},onBeforeRender:function(){this._initScrollBar=!1},initScrollBar:function(){this._initScrollBar||this.isInDOM()&&this.ui.conversations instanceof jQuery&&(this.ui.conversations.mCustomScrollbar&&this.ui.conversations.mCustomScrollbar({axis:"y",theme:"clickview",scrollInertia:0,mouseWheel:{scrollAmount:40,preventDefault:!0},onTotalScrollOffset:100}),this._initScrollBar=!0)}})}(ClickView,EasyMoney);!function(n){"use strict";var t=n.Messaging,i=n.Shared;t.Views.ConversationsDropdown=t.Views.Conversations.extend({name:"ConversationsDropdown",className:"conversations-dropdown conversations-app",template:t.Templates.ConversationsDropdown,events:{"click .see-all":"seeAll"},ui:_.extend({},t.Views.Conversations.prototype.ui,{$empty:".no-messages"}),initialize:function(){this.model=new t.Models.MessagesApp({currentUser:this.options.user,conversations:new t.Collections.Conversations});this.options.compactView=!0;this.model.conversations.fetch();n.Services.MessagingService&&this.listenTo(n.Services.MessagingService,"message",this._onMessageReceived,this);t.Views.Conversations.prototype.initialize.apply(this,arguments)},_onMessageReceived:function(n,i){var r=this.model.conversations.findWhere({id:n}),u;if(!r){u=new t.Models.Conversation({id:n});u.fetch({success:_.bind(function(){this.model.conversations.add(u)},this)});return}r.trigger("updateLastMessage",i);r.selected()||r.set("unread",!0)},_onConversationSelected:function(n){var t=n.get("actionUrl");t&&(window.location=t)},seeAll:function(n){n.stopPropagation()},isLoaded:function(){return this.model.conversations.loaded},onBeforeRender:function(){return this.isLoaded()?!0:(this.renderView(this.$el,new n.Shared.Views.LoaderView),!1)},onRender:function(){this.model.conversations&&this.model.conversations.length||this.renderView(this.ui.$empty,new t.Views.EmptyStateView);t.Views.Conversations.prototype.onRender.apply(this,arguments)},viewOptions:function(){return{hasConversations:this.model.conversations&&this.model.conversations.length}}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Messaging,r=n.Shared;i.Views.EmptyStateView=t.View.extend({template:i.Templates.EmptyState,className:"empty-state",events:{"click a":"onClick"},onClick:function(n){n.stopPropagation()},viewOptions:function(){return{supportWebsite:n.Data.Config.urls.supportWebsite.split("#")[0]+"/articles/115005505028"}}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Messaging;i.Views.MessageErrorView=t.View.extend({name:"MessageErrorView",className:"error-container",template:i.Templates.MessageError,initialize:function(){this.listenTo(this.model,"change:hasError",this.render)}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Messaging,r=n.Shared;i.Views.MessageItem=t.View.extend({name:"MessageItem",template:i.Templates.MessageItem,className:function(){return"message"},ui:{timestamp:"time",ogDataViewpart:".og-data-viewpart",circle:".circle",$newMessagesBar:".new-messages-bar"},events:{"click .resend":"resendMessage"},initialize:function(){this.listenTo(this.model,"remove",this.close);this.listenTo(this.model,"request sync error",this.render);this.listenTo(this.model,"error",this._onError)},viewOptions:function(){var n=moment(this.model.get("dateCreated"));return{datetime:n.toISOString(),time:n.local().format("lll"),initials:r.Helpers.generateInitials(this.model.sender),hasSender:this.model.sender&&this.model.sender.id,failed:this.model.hasLoaded()&&this.model.isNew()}},renderLoader:function(){this.renderView(this.ui.circle,new r.Views.SpinJsView({cover:!0,spinColor:"#fff"}),{empty:!1})},renderOgDataView:function(){var n=new i.Views.OgDataView({model:this.model.get("metadata"),embedded:!0});this.renderView(this.ui.ogDataViewpart,n)},resendMessage:function(){this.model.collection.create(this.model)},onRender:function(){this.$el.attr("data-mid",this.model.id);var n=this.model.get("metadata");n&&!n.isEmpty()&&this.renderOgDataView();this.model.isMine(this.options.appModel.get("currentUser.id"))&&this.$el.addClass("ralign");!this.model.hasLoaded()&&this.model.isNew()&&this.renderLoader()}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Messaging,r=n.Shared;i.Views.MessageList=t.ListView.extend({name:"MessageList",tagName:"div",childView:i.Views.MessageItem,className:"list",template:'<div class="messages"><\/div>',ui:{messages:".messages"},initialize:function(){this.listenTo(this.collection,"add",this.addOne);this.listenTo(this.collection,"sync",this._onSync)},addOne:function(n,t,i){var u,r,f;this._rendered&&(this._loaderView&&this._loaderView.close(),u=0,n.collection&&(u=n.collection.indexOf(n)),r=!1,u!==0&&(r=!0),!i.isNew&&this.isFirstUnreadMessage(n)&&this.renderNewMessagesBar(r),f=this.buildChildView.call(this,n),this.renderView(this.ui.messages,f,{empty:!1,prepend:r}))},renderNewMessagesBar:function(n){var t=new i.Views.NewMessagesBar({collection:this.collection});this.renderView(this.ui.messages,t,{empty:!1,prepend:n})},renderItems:function(){this.collection&&this.collection.each(this.addOne,this)},onBeforeRender:function(){return!this.collection||!this.collection.length?(this._loaderView=new n.Shared.Views.SpinJsView,this.renderView(this.$el,this._loaderView),!1):!0},isFirstUnreadMessage:function(n){var t=this.options.conversation.get("lastReadMessageId"),i=this.collection.getMessagesAfter(t);return _.last(i)===n},_storeLastMessage:function(){this.collection.length&&(this._lastMessage=$('[data-mid="'+this.collection.last().get("id")+'"]'))},_onSync:function(){this._rendered||this.render();this.initScrollBar();this.scrollTo(this._lastMessage?this._lastMessage:"bottom");this._lastMessage=null},onRender:function(){this._rendered=!0},onRendered:function(){this.initScrollBar()},initScrollBar:function(){this.collection&&this.collection.length&&(this._initScrollBar||this.isRendered()&&this.$el instanceof jQuery&&(this.$el.mCustomScrollbar({axis:"y",theme:"clickview",scrollInertia:0,mouseWheel:{scrollAmount:40,preventDefault:!0},onTotalScrollOffset:100,advanced:{updateOnContentResize:!0,updateOnImageLoad:!0},callbacks:{onUpdate:_.bind(function(){this._isScrolledToBottom()&&this.scrollTo("bottom")},this),onTotalScrollBack:_.bind(function(){this._storeLastMessage();this.collection.fetchOlderMessages()},this)}}),this._initScrollBar=!0,this.scrollTo("bottom")))},_isScrolledToBottom:function(){var n=this.$el.find(".mCSB_container"),i=n.position().top,r=n.height(),t=this.$el.height(),u=t/2;return Math.abs(i)+t>=r-u?!0:!1},scrollTo:function(n){this._initScrollBar&&this.$el.mCustomScrollbar("scrollTo",n)},onClose:function(){this.$el.mCustomScrollbar("destroy")}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Messaging,r=n.Shared;i.Views.NewMessagesBar=t.View.extend({name:"NewMessagesBar",template:i.Templates.NewMessagesBar,className:"new-messages-bar",initialize:function(){this.listenTo(this.collection,"add",this.onNewMessage)},onNewMessage:function(n){n.isNew()&&this.close()}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Messaging;i.Views.OgDataView=t.View.extend({name:"OgDataView.js",className:function(){var n="og-data";return this.options.embedded&&(n+=" embedded"),n},template:i.Templates.OgData,defaults:{embedded:!1},events:{"click .close":"clear","click .cv-thumbnail":"playVideo","click .play-btn-icon":"playVideo","click .close-video":"closeVideo"},clear:function(n){n.preventDefault();this.model=null;delete this.model;this.options.message.unset("metadata");this.close()},closeVideo:function(n){return n.preventDefault(),this._playing=!1,this.render(),!1},playVideo:function(){this._playing=!0;this.render()},viewOptions:function(){var n=this.model.get("link");if(!n)return{};var t=new URI(n),i=!this._playing&&this.options.embedded&&this.model.isVideo()&&this.model.isClickViewLink()&&this.model.has("embedLink"),r=this.options.embedded&&!i;return{host:t.protocol()+"://"+t.hostname(),showClose:!this.options.embedded,clickable:r,linksTag:r&&!this._playing?"span":"a",renderPlayThumbnail:i,playVideo:this._playing}}})}(ClickView,EasyMoney),function(n){"use strict";n.Views.OnlineIndicatorView=EasyMoney.View.extend({template:!1,name:"OnlineIndicatorView",className:"online-indicator",initialize:function(){this.conversation=this.options.conversation;this.currentUser=this.options.appModel.currentUser;ClickView.Services.MessagingService&&this.listenTo(ClickView.Services.MessagingService,"usersOnline userOnline",this.online)},online:function(n){this.conversation.id===n&&this.render()},isUserOnline:function(){if(this.conversation.isGroupConversation()||!ClickView.Services.MessagingService)return!1;var t=function(n){return n.id!==this.currentUser.id},n=this.conversation.users.find(_.bind(t,this));if(!n)return!1;try{return ClickView.Services.MessagingService.isUserOnline(this.conversation.id,n.id)}catch(i){return!1}},onBeforeRender:function(){return this.isUserOnline()?(this.show(),!0):(this.hide(),!1)}})}(ClickView.Messaging);!function(n,t){"use strict";var i=n.Messaging,r=n.Shared;i.Views.SendFormView=t.View.extend({className:"send-message-form",tagName:"form",template:i.Templates.SendForm,_typing:!1,_unloading:!1,_syncingMetadata:!1,ui:{checkbox:".checkbox",textbox:"textarea.textbox",$ogDataViewpart:".og-data-viewpart",$typingNotification:".typing-notification-viewpart",textboxGroup:".form-group.textbox",sendButton:"button.send",$messageErrorViewpart:".message-error-viewpart"},events:{submit:"onSubmit","keyup .textbox":"keyUp","keydown .textbox":"keyDown","change .checkbox":"onCheck"},bindings:{"[name=body]":{observe:"body",setOptions:{validate:!0}}},initialize:function(){this.conversation=this.options.conversation;this.model=new i.Models.Message;this.viewModel=new i.Models.MessageErrorViewModel;this.bindListeners();n.Services.MessagingService&&(this.listenTo(n.Services.MessagingService,"userTyping",this.onUserTyping,this),this.listenTo(n.Services.MessagingService,"connectionStateChanged",this.connectionStateChanged,this));this.bindWindowEvent("beforeunload",this.onBeforeUnload)},bindWindowEvent:function(n,t){this._windowevents||(this._windowevents=[]);var i=_.bind(t,this);window.addEventListener(n,i);this._windowevents.push({name:n,fn:i})},unbindWindowEvents:function(){_.each(this._windowevents,function(n){window.removeEventListener(n.name,n.fn)})},onBeforeUnload:function(){this._unloading=!0},bindListeners:function(){this._prevModel&&this.stopListening(this._prevModel);this.listenTo(this.model,"change:body",this.onChangeBody);this.listenTo(this.model,"change:metadata",this.onMetaDataChange)},disable:function(){this.ui.textbox.blur();this.ui.textbox.prop("disabled","disabled");this.ui.sendButton.prop("disabled","disabled");this.ui.sendButton.addClass("disabled");this._disabled=!0},isStudentToStudentConversation:function(){return n.Data.User.role===1&&this.conversation.hasStudents()},studentToStudentEnabled:function(){var t=new r.Collections.CustomerSettingCollection(n.Data.CustomerSettings);return!!t.getByName(r.SettingOptions.Permanent.STUDENT_TO_STUDENT_MESSAGING).get("value")},enable:function(){(!this.isStudentToStudentConversation()||this.studentToStudentEnabled())&&(this.ui.textbox.focus(),this.ui.textbox.prop("disabled",""),this.ui.sendButton.prop("disabled",""),this.ui.sendButton.removeClass("disabled"),this._disabled=!1)},keyUp:function(n){return this.conversation.get("sendOnEnter")&&n.which===13&&!n.shiftKey?(n.preventDefault(),this.onSubmit(),!1):(this.validate(),this.typing(),!0)},keyDown:function(n){if(this.conversation.get("sendOnEnter")&&n.which===13&&!n.shiftKey)return!1},typing:_.throttle(function(){this.isClosed()||(this._typing=!!(this.getTextLength()>0),n.Services.MessagingService.typing(this.conversation.id,this._typing))},3e3),doneTyping:function(){this._typing=!1;n.Services.MessagingService.typing(this.conversation.id,!1)},getTextLength:function(){return(this.ui.textbox.val()||"").length},onChangeBody:function(){var n=this.model.get("body");if(_.isString(n)){var r=this.model.previous("body"),t=this.diffStr(r,n),i=!1;t&&(t.length>4||/\s$/.test(t))&&(i=!0);this.tryParseOgData(n,i)}},diffStr:function(n,t){for(var u=n||"",r=t||"",i=0;i<r.length;i++)if(u[i]!==r[i])return r.substring(i);return t},tryParseOgData:function(t,i,r){var u,f;r=r||function(){};try{if(this.model.get("metadata")){r.apply(this);return}if(u=t.match(/\S+/g),!u||u.length===0){r.apply(this);return}if(i||u.splice(-1,1),f=_.find(u,n.Shared.Helpers.IsValidUrl),!f){r.apply(this);return}this.getMetadata(f,r)}catch(e){r.apply(this)}},getMetadata:function(n,t){if(t=t||function(){},this._syncingMetadata){t.apply(this);return}this._syncingMetadata=!0;var r=new i.Models.MessageMetadata;this.renderLoader();r.fetch({data:{url:n},success:_.bind(this.onSyncMetadata,this)}).always(_.bind(function(){this._syncingMetadata=!1;this.removeLoader();t.apply(this)},this))},onSyncMetadata:function(n){this._syncingMetadata=!1;this.model.set("metadata",n.toJSON())},renderLoader:function(){this.removeLoader();this.renderView(this.ui.textboxGroup,new r.Views.SpinJsView({cover:!0}),{empty:!1,childIndex:"loader"})},removeLoader:function(){this.closeChildrenByIndex("loader")},validate:function(){this.clearErrorMessage();var i=this.model.get("body"),r=this.model.get("metadata.link"),n=this.validateBody(i),t=this.validateLink(r);return n.valid||t.valid?!0:n.valid?t.valid?!1:(this.showErrorMessage(t.message),this.doneTyping(),!1):(this.showErrorMessage(n.message),this.doneTyping(),!1)},onSubmit:function(){if(this.clearErrorMessage(),this._disabled)return!1;if(this.validate()){var n=function(){this.conversation.messages.create(this.model,{at:0});this._prevModel=this.model;this.model=new i.Models.Message;this.bindListeners();this.rebindStickit();this.closeChildrenByIndex("ogDataView")};return this.tryParseOgData(this.model.get("body"),!0,n),this.doneTyping(),!1}return this.doneTyping(),!1},validateBody:function(n){var t={message:"",valid:!0};return _.isString(n)?n.trim(" ").length===0?(t.message="Can't send empty message.",t.valid=!1,t):n.length>2048?(t.message="This message is too long.",t.valid=!1,t):t:(t.message="Can't send empty message.",t.valid=!1,t)},validateLink:function(n){var t={message:"",valid:!0};return _.isString(n)?n.length<4?(t.message="Invalid link.",t.valid=!1,t):t:(t.message="Invalid message content.",t.valid=!1,t)},showErrorMessage:function(n){this.viewModel.set({hasError:!0,errorText:n})},clearErrorMessage:function(){this.viewModel.set({hasError:!1,errorText:""})},onMetaDataChange:function(){this.ui.textbox.toggleClass("has-metadata",!!this.model.get("metadata"));this.renderOgDataView()},connectionStateChanged:function(n){!this._unloading&&this.isRendered()&&(n==="connected"?this.enable():this.disable())},onCheck:function(){this.conversation.set("sendOnEnter",this.ui.checkbox.is(":checked"))},viewOptions:function(){return{sendOnEnter:this.conversation.get("sendOnEnter")}},renderErrorView:function(){var n=new i.Views.MessageErrorView({model:this.viewModel});return this.renderView(this.ui.$messageErrorViewpart,n)},renderTypingNotification:function(){var n=new i.Views.TypingNotificationView({conversation:this.conversation});this.renderView(this.ui.$typingNotification,n)},renderOgDataView:function(){var n=new i.Views.OgDataView({model:this.model.get("metadata"),message:this.model});this.renderView(this.ui.$ogDataViewpart,n,{childIndex:"ogDataView"})},rebindStickit:function(){this.unstickit(this._prevModel);this.stickit()},renderStudentToStudentTooltip:function(){this.isStudentToStudentConversation()&&!this.studentToStudentEnabled()&&(this.disable(),this.$el.attr("title","Student to student messaging has been disabled by your administrator.").tooltip())},onBeforeRender:function(){return this.conversation.loadSendOnEnterPreference(),!0},onRender:function(){this.ui.textbox.autogrow({animate:!1});this.renderErrorView();this.stickit();this.renderTypingNotification();this.renderStudentToStudentTooltip()},onClose:function(){this._typing&&this.doneTyping()}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Messaging;i.Views.TypingNotificationView=t.View.extend({name:"TypingNotificationView",className:"typing-notification-view",template:i.Templates.TypingNotification,_users:[],viewOptions:function(){return{users:this.formatUsers(),verb:this._users.length===1?"is":"are"}},initialize:function(){this._users=[];this.conversation=this.options.conversation;this.populateUsers();n.Services.MessagingService&&this.listenTo(n.Services.MessagingService,"userTyping",this.onUserTyping,this)},populateUsers:function(){var i=n.Services.MessagingService.getTypingUsers(this.conversation.id),t;this.conversation&&this.conversation.users&&(t=this.conversation.users,this._users=_.chain(i).filter(function(t){return t!==n.Data.User.id}).map(function(n){return t.get(n)}).value())},onUserTyping:function(t,i,r){var u,f;this.conversation.users&&this.conversation.id===t&&(u=this.conversation.users.get(i),u&&u.id!==n.Data.User.id)&&(f=function(n){return u===n},r?_.any(this._users,f)||this._users.push(u):_.any(this._users,f)&&this._users.splice(_.findIndex(this._users,f),1),this.render())},formatUsers:function(){var n=_.map(this._users,this.formatUser),t=n.pop(),i=n.join(", ");return _.compact([i,t]).join(" and ")},formatUser:function(n){return n.get("name")+" "+n.get("surname")},onBeforeRender:function(){return this._users.length?!0:(this.$el.empty(),!1)}})}(ClickView,EasyMoney);!function(n){"use strict";var t=n.Messaging,i=n.Notifications,r=n.Shared;t.Services.MessagingService=i.Services.NotificationService.extend({name:"MessagingService",_onlineUsers:{},_typingUsers:{},setupListeners:function(){this._hub.on("message",_.bind(function(n,t){this.trigger("message",n,t)},this));this._hub.on("markRead",_.bind(function(n,t){this.trigger("markRead",n,t)},this));this._hub.on("usersOnline",_.bind(function(n,t){this._usersOnline(n,t)},this));this._hub.on("userOnline",_.bind(function(n,t){this._userOnline(n,t,!0)},this));this._hub.on("userOffline",_.bind(function(n,t){this._userOnline(n,t,!1)},this));this._hub.on("userTyping",_.bind(function(n,t,i){this._userTyping(n,t,!!i)},this));this._hub.on("unreadConversationCount",_.bind(function(n){this.trigger("unreadConversationCount",n)},this))},_userTyping:function(n,t,i){var r=this._typingUsers[n];_.isObject(r)||(r=this._typingUsers[n]={});i?r[t]=!0:delete r[t];this.trigger("userTyping",n,t,i)},_userOnline:function(n,t,i){var r=this._onlineUsers[n];_.isObject(r)||(r=this._onlineUsers[n]={});r[t]=i;this.trigger("userOnline",n,t,i)},_usersOnline:function(n,t){this._onlineUsers[n]=_.reduce(t,function(n,t){return n[t.userId]=t.isOnline,n},{});this.trigger("usersOnline",n,t)},isUserOnline:function(n,t){var i=this._onlineUsers[n];if(!_.isObject(i))throw new Error("Unknown conversation");return!!i[t]},getTypingUsers:function(n){var t=this._typingUsers[n];return _.isObject(t)?_.chain(t).keys().map(function(n){return+n}).filter(function(n){return!isNaN(n)}).value():[]},markRead:function(n){this.ready(function(){this._hub.invoke("markRead",n,null)})},typing:function(n,t){this.ready(function(){this._hub.invoke("typing",n,!!t)})},_getHub:function(){return this._connection.createHubProxy("messagingHub")},_getConnectionToken:function(t){var i=this;n.Shared.Utils.AjaxHelper.post("/api/messages/start",null,{forceHttps:!1}).always(function(n,r,u){var f=n&&n.statusCode||u&&u.statusCode;t(i._parseConnectionToken(n),f)})}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Messaging,r=n.Shared;i.Controllers.MessagingController=n.Shared.Controllers.SharedController.extend({id:"messaging",routePrefix:"messages",routes:{"":"index",":id":"conversation"},_hasDisconnected:null,initialize:function(){this.router=this.options.router;this.appModel=new i.Models.MessagesApp({currentUser:n.Data.User,conversations:this.options.conversations||new i.Collections.Conversations});this.appModel.conversations.loaded?this._onConversationsLoaded():(this.listenToOnce(this.appModel.conversations,"sync",this._onConversationsLoaded),this.appModel.conversations.fetch());this.listenTo(n.Services.MessagingService,"message",this._onMessageReceived);this.listenTo(n.Services.MessagingService,"disconnected",this._onDisconnected);this.listenTo(n.Services.MessagingService,"connected",this._onConnected)},_onDisconnected:function(){this._hasDisconnected=!0},_onConnected:function(){this._hasDisconnected===!0&&this.reloadAll();this._hasDisconnected=!1},reloadAll:function(){if(this.appModel.conversations.loaded){console.log("forcing full refresh...");var n=-1;this.appModel.conversations.selected&&(n=this.appModel.conversations.selected.id);this.appModel.conversations.fetch({reset:!0,success:_.bind(function(){if(n!==-1){this.router.execute.call(this.router,_.bind(this.conversation,this),[n]);return}t.Events.trigger("navigate","/messages")},this)})}},_onMessageReceived:function(n,t){var u=this.appModel.conversations.findWhere({id:n}),r;if(!u){r=new i.Models.Conversation({id:n});this._addMessage(r,t);r.fetch({success:_.bind(function(){this.appModel.conversations.add(r)},this)});return}this._addMessage(u,t)},_addMessage:function(n,t){if(n.messages){var r=new i.Models.Message(t,{parse:!0});n.messages.add(r,{merge:!0,at:0,isNew:!0});n.trigger("updateLastMessage",t);n.selected()||n.set("unread",!0)}},index:function(){return this.appModel.conversations.loaded?(this._selectFirstConversation(),!1):(this.listenToOnce(this.appModel.conversations,"sync",this._selectFirstConversation),this.renderNav(!0),{view:new i.Views.EmptyStateView,swap:!0})},conversation:function(n){var r,t;return this.renderNav(),r=new i.Views.Conversation({appModel:this.appModel,conversationId:n}),this.appModel.conversations.loaded?(t=this.appModel.conversations.get(n),t&&t.select()):this.listenToOnce(this.appModel.conversations,"sync",function(){var t=this.appModel.conversations.get(n);t&&t.select()}),{view:r,swap:!0}},renderNav:function(n){this.$nav||(this.$nav=$("#messaging-nav"));this.$el||(this.$el=$("#messaging-app"));this.navView||(this.navView=new i.Views.Conversations({model:this.appModel}),this.$nav.html(this.navView.render().el),this.navView.trigger("rendered"));n?this.hideNav():this.showNav()},hideNav:function(){this.$el.addClass("no-left");this.$el.removeClass("right-small");this.$nav.addClass("hidden")},showNav:function(){this.$el.removeClass("no-left");this.$el.addClass("right-small");this.$nav.removeClass("hidden")},_onConversationsLoaded:function(){this.listenTo(this.appModel.conversations,"add",this.onNewConversation)},onNewConversation:function(n){this.appModel.conversations.length===1&&this._navigateConversation(n.id)},_selectFirstConversation:function(){var n=this.appModel.conversations.first();if(n&&n.id){this._navigateConversation(n.id);return}},_navigateConversation:function(n){t.Events.trigger("navigate","/messages/"+n)}})}(ClickView,EasyMoney);$(function(){!function(n){"use strict";var t=n.Messaging;t.Router=n.Shared.Router.BaseRouter.extend({history:!0,container:$("#messaging-app")})}(ClickView,EasyMoney)});$(function(){"use strict";var r=ClickView.Messaging,n=ClickView.Shared;if(ClickView.Data.initTopBar)try{_.extend(ClickView.Services,{MessagingService:new r.Services.MessagingService({endpoint:ClickView.Data.Config.urls.notificationService,tryReconnect:!ClickView.Data.Config.isDebug})});var u=new n.Collections.CustomerSettingCollection(ClickView.Data.CustomerSettings),t=u.getByName(n.SettingOptions.Permanent.SCHOOL_MESSAGING),i=t&&!!t.get("value");i&&[1,2].indexOf(ClickView.Data.User.role)!==-1&&!_.isEmpty(ClickView.Data.User)&&ClickView.Data.User.modules&&ClickView.Data.User.modules.messaging&&i&&ClickView.Services.MessagingService.start()}catch(f){window.trackJs&&typeof window.trackJs.track=="function"&&window.trackJs.track(f)}});$(function(){"use strict";var n=window.ClickView||{},i,t;if(n.Data=n.Data||{},n.Data.User=n.Data.User||{},n.Data.User.modules=n.Data.User.modules||{},n.Data.Config=n.Data.Config||{},n.Data.Config.featureSwitches=n.Data.Config.featureSwitches||{},n.Data.initTopBar){var u=new n.UserOptions.Models.User(n.Data.User),o=u.get("role")===1||u.get("role")===2,s=new n.UserOptions.Views.UserOptionsDropdownView({model:u,showHelpCentre:o});if($("#user-options").html(s.render().el),i=$("#top-black-bar .notifications .link"),n.Data.Config.featureSwitches.notifications&&n.Notifications.Views.NotificationsDropdown&&new n.Shared.Views.PopoverView({toggler:i,view:function(){return new n.Notifications.Views.NotificationsDropdown},container:i,popoverClass:"notifications-popover",trigger:"click",closeOnBodyClick:!0,closeOnScroll:!0}),n.Services.NotificationService){t=$('<div class="notify-count notify-badge off"><\/div>');i.append(t);n.Services.NotificationService.on("notifyCount",function(n){t.text(n);n>0?t.removeClass("off"):t.addClass("off")})}var f=$("#top-black-bar .messages .link"),h=new n.Shared.Collections.CustomerSettingCollection(n.Data.CustomerSettings),e=h.getByName(n.Shared.SettingOptions.Permanent.SCHOOL_MESSAGING),c=e&&!!e.get("value");if(n.Data.User.modules.messaging&&n.Messaging.Collections.Conversations&&n.Messaging.Views.Conversations&&n.Messaging.Views.ConversationsDropdown&&c){var l={user:n.Data.User},a=new n.Shared.Views.PopoverView({toggler:f,view:function(){return new n.Messaging.Views.ConversationsDropdown(l)},container:f,popoverClass:"message-popover",trigger:"click",closeOnBodyClick:!0,closeOnScroll:!0}),r=$('<div class="conversation-count notify-badge off"><\/div>');f.append(r);n.Services.MessagingService.on("unreadConversationCount",function(n){r.text(n);n>0?r.removeClass("off"):r.addClass("off")})}if(!n.Data.User.username)$(".sign-in-link a").on("click",function(n){n.preventDefault();window.location="/signin?returnUrl="+encodeURIComponent(window.location.toString())})}});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.AnnotationInteraction=Handlebars.template({"1":function(n,t){var i;return"  <p>"+n.escapeExpression(n.lambda((i=t!=null?t.data:t)!=null?i.text:i,t))+"<\/p>\r\n"},"3":function(n,t){var i;return"  "+((i=n.lambda((i=t!=null?t.data:t)!=null?i.html:i,t))!=null?i:"")+"\r\n"},"5":function(n,t,i,r,u){var e,f;return((e=(f=(f=i.annotation||(t!=null?t.annotation:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"annotation",hash:{},data:u}):f))!=null?e:"")+"\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return((f=i["if"].call(e,(f=t!=null?t.data:t)!=null?f.text:f,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,(f=t!=null?t.data:t)!=null?f.html:f,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,t!=null?t.annotation:t,{name:"if",hash:{},fn:n.program(5,u,0),inverse:n.noop,data:u}))!=null?f:"")},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.AppView=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<div class="close-interactive-view-container" style="display: none;">\r\n    <div class="close-interactive-view">&times;<\/div>\r\n<\/div>\r\n<div class="player-view"><\/div>\r\n<div class="interactions-container"><\/div>\r\n<div class="splash-cover" style="background-image: url(\''+n.escapeExpression((f=(f=i.posterImage||(t!=null?t.posterImage:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"posterImage",hash:{},data:u}):f))+'\')"><\/div>\r\n<a class="start-interaction loading"><\/a>\r\n<div class="analytics-container"><\/div>\r\n<div class="mobile-device-banner">\r\n    <div class="mobile-dialog">\r\n        <p class="mobile-message">Interactive videos are best experienced in fullscreen mode.<\/p>\r\n        <a class="btn orange go-fullscreen">Go Fullscreen<\/a>\r\n        <a class="continue-normal">Continue anyway<\/a>\r\n    <\/div>\r\n<\/div>\r\n<div class="rotate-message">\r\n    <div class="message-container">\r\n        <img class="rotate-image" src="//static.clickview.com.au/cv-online/images/interactions/orientation-graphic.png"/>\r\n        <p class="rotate-message-text">Rotate me please<\/p>\r\n        <a class="close-fullscreen">Exit fullscreen<\/a>\r\n    <\/div>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.BaseInteraction=Handlebars.template({"1":function(n,t,i,r,u){var e,f;return"            "+((e=(f=(f=i.name||(t!=null?t.name:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"name",hash:{},data:u}):f))!=null?e:"")+"\r\n"},"3":function(n,t,i,r,u){var f;return"            "+n.escapeExpression((f=(f=i.name||(t!=null?t.name:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"name",hash:{},data:u}):f))+"\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e,s=n.lambda,o=n.escapeExpression,h=t!=null?t:n.nullContext||{};return'<div class="interaction-title">\r\n    <div class="heading">\r\n        <span class="icon" style="background-image: url('+o(s((f=t!=null?t.type:t)!=null?f.icon:f,t))+");background-color: #"+o(s((f=t!=null?t.type:t)!=null?f.colour:f,t))+'"><\/span><span class="heading-text">\r\n'+((f=i["if"].call(h,t!=null?t.isAnnotation:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(3,u,0),data:u}))!=null?f:"")+'        <\/span>\r\n    <\/div>\r\n<\/div>\r\n\r\n<div class="interaction-viewpart"><\/div>\r\n<div class="interaction-error">'+o((e=(e=i.errorMessage||(t!=null?t.errorMessage:t))!=null?e:i.helperMissing,typeof e=="function"?e.call(h,{name:"errorMessage",hash:{},data:u}):e))+"<\/div>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.Details=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="drop-shadow-box">\r\n    <div class="video-viewpart"><\/div>\r\n    <div class="details-form">\r\n        <div class="form-group">\r\n            <label for="interactive-name" class="control-label">Interactive Name<span class="required">*<\/span><\/label>\r\n            <div class="input-group">\r\n                <input type="text" class="form-control interactive-name large" placeholder="Give your interactive video a name" name="name" id="interactive-name" />\r\n                <span class="help-block hidden"><\/span>\r\n            <\/div>\r\n        <\/div>\r\n        <div class="form-group">\r\n            <label for="interactive-description" class="control-label">Description<\/label>\r\n            <div class="input-group">\r\n                <textarea class="interactive-description large" placeholder="Give your interactive a brief description" name="description" id="interactive-description"><\/textarea>\r\n                <span class="help-block hidden"><\/span>\r\n            <\/div>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>\r\n<div class="drop-shadow-box question-list"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.EditSubNav=Handlebars.template({"1":function(){return'    <div class="subnav-progress-viewpart"><\/div>\r\n'},"3":function(n,t,i,r,u){var f;return'<a class="btn orange save-and-continue">'+n.escapeExpression((f=(f=i.buttonText||(t!=null?t.buttonText:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"buttonText",hash:{},data:u}):f))+"<\/a>"},"5":function(){return'<a class="back-button">Back<\/a>'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e,o=t!=null?t:n.nullContext||{};return"<h1>"+n.escapeExpression((e=(e=i.name||(t!=null?t.name:t))!=null?e:i.helperMissing,typeof e=="function"?e.call(o,{name:"name",hash:{},data:u}):e))+"<\/h1>\r\n"+((f=i.unless.call(o,t!=null?t.secondary:t,{name:"unless",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(o,t!=null?t.buttonText:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n"+((f=i["if"].call(o,t!=null?t.showBackButton:t,{name:"if",hash:{},fn:n.program(5,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.ImageInteraction=Handlebars.template({"1":function(n,t,i,r,u){var f;return"    <p>"+n.escapeExpression((f=(f=i.caption||(t!=null?t.caption:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"caption",hash:{},data:u}):f))+"<\/p>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{};return'<div class="image-box">\r\n    <img src="'+n.escapeExpression((f=(f=i.url||(t!=null?t.url:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(o,{name:"url",hash:{},data:u}):f))+'" />\r\n'+((e=i["if"].call(o,t!=null?t.caption:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?e:"")+"<\/div>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.InteractionItem=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<td class="icon-cell">\r\n\t<img src="'+h((f=(f=i.typeIconUrl||(t!=null?t.typeIconUrl:t))!=null?f:o,typeof f===s?f.call(e,{name:"typeIconUrl",hash:{},data:u}):f))+'"/>\r\n<\/td>\r\n<td class="question-cell">'+h((f=(f=i.name||(t!=null?t.name:t))!=null?f:o,typeof f===s?f.call(e,{name:"name",hash:{},data:u}):f))+'<\/td>\r\n<td class="answer-cell">\r\n\t<a role="button" class="btn '+h((f=(f=i.buttonClass||(t!=null?t.buttonClass:t))!=null?f:o,typeof f===s?f.call(e,{name:"buttonClass",hash:{},data:u}):f))+'">'+h((f=(f=i.buttonText||(t!=null?t.buttonText:t))!=null?f:o,typeof f===s?f.call(e,{name:"buttonText",hash:{},data:u}):f))+"<\/a>\r\n<\/td>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.InteractionTimeline=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<div class="interaction-control play no-margin">\r\n  <span><\/span>\r\n<\/div>\r\n\r\n<div class="interaction-control timeline no-margin">\r\n    <div class="progress-container"><\/div>\r\n<\/div>\r\n\r\n<div class="interaction-control time">\r\n  <span>\r\n    <span class="time-progress">00:00<\/span> / <span class="total-duration">'+n.escapeExpression((f=(f=i.totalDuration||(t!=null?t.totalDuration:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"totalDuration",hash:{},data:u}):f))+'<\/span>\r\n  <\/span>\r\n<\/div>\r\n\r\n<div class="interaction-control fullscreen rt">\r\n  <span><\/span>\r\n<\/div>\r\n\r\n<div class="interaction-control volume rt">\r\n  <span><\/span>\r\n<\/div>\r\n\r\n\r\n<div class="interaction-control settings rt">\r\n  <span><\/span>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.InteractiveVideoItem=Handlebars.template({"1":function(n,t,i,r,u){var f;return'<input type="checkbox" class="cv-checkbox" '+n.escapeExpression((i.checked||t&&t.checked||i.helperMissing).call(t!=null?t:n.nullContext||{},(f=t!=null?t.video:t)!=null?f.Checked:f,{name:"checked",hash:{},data:u}))+" />\r\n"},"3":function(n,t,i,r,u){var f;return'href="'+n.escapeExpression((f=(f=i.actionUrl||(t!=null?t.actionUrl:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"actionUrl",hash:{},data:u}):f))+'"'},"5":function(n,t,i,r,u){var f;return'        <span class="duration">'+n.escapeExpression((i.duration||t&&t.duration||i.helperMissing).call(t!=null?t:n.nullContext||{},(f=t!=null?t.video:t)!=null?f.duration:f,{name:"duration",hash:{},data:u}))+"<\/span>\r\n"},"7":function(n,t,i,r,u){var f;return'\t\t<span class="badge">'+n.escapeExpression((f=(f=i.badge||(t!=null?t.badge:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"badge",hash:{},data:u}):f))+"<\/span>\r\n"},"9":function(n,t,i,r,u){var f;return'<a href="'+n.escapeExpression((f=(f=i.actionUrl||(t!=null?t.actionUrl:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"actionUrl",hash:{},data:u}):f))+'">'},"11":function(){return'            <span class="cv-new">new<\/span>\r\n'},"13":function(){return"<\/a>"},"15":function(n,t,i,r,u){var f;return'        <span class="metadata-badge">'+n.escapeExpression((i.fileSize||t&&t.fileSize||i.helperMissing).call(t!=null?t:n.nullContext||{},(f=t!=null?t.video:t)!=null?f.fileSize:f,1,{name:"fileSize",hash:{},data:u}))+"<\/span>\r\n"},"17":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing;return'        <span class="metadata-badge" title="'+((f=(i.ifIs||t&&t.ifIs||o).call(e,(f=(f=t!=null?t.video:t)!=null?f.rating:f)!=null?f.code:f,"==","Unrated",{name:"ifIs",hash:{},fn:n.program(18,u,0),inverse:n.program(20,u,0),data:u}))!=null?f:"")+'">'+n.escapeExpression((i.toUpper||t&&t.toUpper||o).call(e,(f=(f=t!=null?t.video:t)!=null?f.rating:f)!=null?f.code:f,{name:"toUpper",hash:{},data:u}))+"<\/span>\r\n"},"18":function(){return"Unrated"},"20":function(n,t,i,r,u){var f;return"Rated: "+n.escapeExpression((i.toUpper||t&&t.toUpper||i.helperMissing).call(t!=null?t:n.nullContext||{},(f=(f=t!=null?t.video:t)!=null?f.rating:f)!=null?f.code:f,{name:"toUpper",hash:{},data:u}))},"22":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.showDate:t,{name:"if",hash:{},fn:n.program(23,u,0),inverse:n.noop,data:u}))!=null?f:""},"23":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'        <time class="timeago" datetime="'+h((f=(f=i.localTime||(t!=null?t.localTime:t))!=null?f:o,typeof f===s?f.call(e,{name:"localTime",hash:{},data:u}):f))+'">'+h((f=(f=i.localTime||(t!=null?t.localTime:t))!=null?f:o,typeof f===s?f.call(e,{name:"localTime",hash:{},data:u}):f))+"<\/time>\r\n"},"25":function(){return'            <div class="preview-video"><\/div>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=n.lambda,s=n.escapeExpression,h=i.helperMissing;return((f=i["if"].call(e,(f=t!=null?t.options:t)!=null?f.showCheckbox:f,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+'<div class="cv-thumbnail">\r\n    <a '+((f=i["if"].call(e,t!=null?t.actionUrl:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:"")+'>\r\n        <img alt="" title="'+s(o((f=t!=null?t.video:t)!=null?f.title:f,t))+'" data-original="//thumbs.clickview.com.au/coverimages?trackingCode='+s(o((f=t!=null?t.video:t)!=null?f.tokenId:f,t))+'" />\r\n'+((f=i["if"].call(e,(f=t!=null?t.video:t)!=null?f.duration:f,{name:"if",hash:{},fn:n.program(5,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,t!=null?t.badge:t,{name:"if",hash:{},fn:n.program(7,u,0),inverse:n.noop,data:u}))!=null?f:"")+'    <\/a>\r\n<\/div>\r\n<div class="cv-video-content">\r\n    <div class="cv-header">\r\n        <h3 class="cv-title" title="'+s(o((f=t!=null?t.video:t)!=null?f.title:f,t))+'">\r\n            '+((f=i["if"].call(e,t!=null?t.actionUrl:t,{name:"if",hash:{},fn:n.program(9,u,0),inverse:n.noop,data:u}))!=null?f:"")+"\r\n            "+s(o((f=t!=null?t.video:t)!=null?f.title:f,t))+' <span class="badge">Interactive<\/span>\r\n'+((f=i["if"].call(e,(f=t!=null?t.video:t)!=null?f.isNew:f,{name:"if",hash:{},fn:n.program(11,u,0),inverse:n.noop,data:u}))!=null?f:"")+"            "+((f=i["if"].call(e,t!=null?t.actionUrl:t,{name:"if",hash:{},fn:n.program(13,u,0),inverse:n.noop,data:u}))!=null?f:"")+'\r\n        <\/h3>\r\n        <div class="cv-series"><span>'+((f=(i.seriesFilter||t&&t.seriesFilter||h).call(e,(f=t!=null?t.video:t)!=null?f.series:f,{name:"seriesFilter",hash:{divider:"header"},data:u}))!=null?f:"")+'<\/span><\/div>\r\n\t    <div class="video-actions-container"><\/div>    \r\n    <\/div>\r\n    <p class="cv-metadata">\r\n'+((f=i["if"].call(e,(f=t!=null?t.video:t)!=null?f.fileSize:f,{name:"if",hash:{},fn:n.program(15,u,0),inverse:n.noop,data:u}))!=null?f:"")+"        \r\n"+((f=i["if"].call(e,(f=t!=null?t.video:t)!=null?f.rating:f,{name:"if",hash:{},fn:n.program(17,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=(i.isValid||t&&t.isValid||h).call(e,"date",(f=t!=null?t.video:t)!=null?f.dateCreate:f,{name:"isValid",hash:{},fn:n.program(22,u,0),inverse:n.noop,data:u}))!=null?f:"")+'        \r\n    <\/p>\r\n\t<div class="cv-description-wrapper">\r\n\t\t<div>\r\n\t\t\t<p class="cv-description">'+s(o((f=t!=null?t.video:t)!=null?f.description:f,t))+'<\/p>\r\n\t\t<\/div>\r\n\t<\/div>\r\n    <div class="cv-video-footer">\r\n        <div class="preview-video-container">\r\n'+((f=i["if"].call(e,(f=t!=null?t.options:t)!=null?f.showPreview:f,{name:"if",hash:{},fn:n.program(25,u,0),inverse:n.noop,data:u}))!=null?f:"")+'        <\/div>\r\n        <div class="preview-analytics-container">\r\n            <div class="preview-analytics"><\/div>\r\n\t\t<\/div>\r\n    <\/div>\r\n<\/div>\r\n<div class="preview-pane"><\/div>\r\n<div class="preview-analytics-pane"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.LinkInteraction=Handlebars.template({"1":function(n,t,i,r,u){var f;return"<p>"+n.escapeExpression((f=(f=i.caption||(t!=null?t.caption:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"caption",hash:{},data:u}):f))+"<\/p>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var o,f,e=t!=null?t:n.nullContext||{},s=i.helperMissing,h="function",c=n.escapeExpression;return'<div class="link-box">\r\n    <a href="'+c((f=(f=i.url||(t!=null?t.url:t))!=null?f:s,typeof f===h?f.call(e,{name:"url",hash:{},data:u}):f))+'" class="btn orange" target="_blank">'+c((f=(f=i.linkText||(t!=null?t.linkText:t))!=null?f:s,typeof f===h?f.call(e,{name:"linkText",hash:{},data:u}):f))+"<\/a>\r\n<\/div>\r\n\r\n"+((o=i["if"].call(e,t!=null?t.caption:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?o:"")},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.MissingWordInteraction=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var e,f;return'<p class="missing-word-sentence">\r\n    '+((e=(f=(f=i.sentence||(t!=null?t.sentence:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"sentence",hash:{},data:u}):f))!=null?e:"")+"\r\n<\/p>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.MultipleChoiceInteraction=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return""},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.NoInteractiveVideos=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="no-interactives">\r\n\t<div class="col-md-6 col-xs-12">\r\n\t\t<h2>Introducting Interactive Videos<\/h2>\r\n\t\t<p>ClickView Interactive Videos are curriculum-aligned programs that feature an interactive layer. They assist in keeping students engaged, allowing for self paced learning, and improving comprehension.<\/p>\r\n\t\t<a class="btn orange large" href="/mylibrary">Browse Interactive Videos<\/a>\r\n\t<\/div>\r\n\t<div class="col-md-6 col-xs-12">\r\n\t\t<img src="//cvcdn.blob.core.windows.net/cv-online/images/onboarding/interactive-videos/interactive-video-onboarding-graphic.png" />\r\n\t<\/div>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.OptionItem=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<div class="row">\r\n    <div class="col-sm-3 col-xs-12">\r\n        <div class="answer-box-container"><\/div>\r\n    <\/div>\r\n    <div class="col-sm-9 col-xs-12">\r\n        <div class="alternative-container">\r\n            '+n.escapeExpression((f=(f=i.name||(t!=null?t.name:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"name",hash:{},data:u}):f))+"\r\n        <\/div>\r\n    <\/div>\r\n<\/div>\r\n\r\n\r\n\r\n\r\n"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.Play=Handlebars.template({"1":function(n,t,i,r,u){var f;return'    <div class="form-row">\r\n      <label class="inline">Year: <\/label>\r\n      <p class="about-value inline">'+n.escapeExpression((f=(f=i.year||(t!=null?t.year:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"year",hash:{},data:u}):f))+"<\/p>\r\n    <\/div>\r\n"},"3":function(n,t,i,r,u){return'    <div class="form-row">\r\n      <label class="inline">Duration:<\/label>\r\n      <p class="about-value inline">'+n.escapeExpression((i.duration||t&&t.duration||i.helperMissing).call(t!=null?t:n.nullContext||{},t!=null?t.duration:t,{name:"duration",hash:{},data:u}))+"<\/p>\r\n    <\/div>\r\n"},"5":function(n,t,i,r,u){var f;return'    <div class="form-row block">\r\n      <label>Description: <\/label>\r\n      <p class="description">'+n.escapeExpression((f=(f=i.description||(t!=null?t.description:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"description",hash:{},data:u}):f))+"<\/p>\r\n    <\/div>\r\n"},"7":function(n,t,i,r,u){var f;return'<div class="sticky-footer">\r\n    <div class="container player-buttons">\r\n'+((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.source:t,{name:"if",hash:{},fn:n.program(8,u,0),inverse:n.noop,data:u}))!=null?f:"")+'      <a class="btn orange large share-this-video">Share with my students<\/a>\r\n      <a class="btn orange large view-student-results">View student results<\/a>\r\n    <\/div>\r\n<\/div>\r\n'},"8":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s=n.escapeExpression;return'      <a href="'+s((f=(f=i.backUrl||(t!=null?t.backUrl:t))!=null?f:o,typeof f=="function"?f.call(e,{name:"backUrl",hash:{},data:u}):f))+'" class="cv-backlink btn large">&larr; Back to '+s((i.limitChars||t&&t.limitChars||o).call(e,t!=null?t.source:t,30,{name:"limitChars",hash:{},data:u}))+"<\/a>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{},s=i.helperMissing,h="function",c=n.escapeExpression;return'<div class="play-interaction"><\/div>\r\n<div class="question-list"><\/div>\r\n<!--<div class="show-interactive-info">\r\n  Show Video Info\r\n<\/div>\r\n<div id="cv-about-tab" class="interactive-info-container">\r\n  <div class="hide-interactive-info">Hide Video Info<\/div>\r\n  <div class="interactive-info">\r\n    <h1>\r\n      '+c((f=(f=i.title||(t!=null?t.title:t))!=null?f:s,typeof f===h?f.call(o,{name:"title",hash:{},data:u}):f))+'\r\n      <span class="badge">BETA<\/span>\r\n    <\/h1>\r\n    <div class="form-row">\r\n      <label class="inline">Rating:<\/label>\r\n      <p class="about-value inline">'+c((f=(f=i.rating||(t!=null?t.rating:t))!=null?f:s,typeof f===h?f.call(o,{name:"rating",hash:{},data:u}):f))+"<\/p>\r\n    <\/div>\r\n"+((e=i["if"].call(o,t!=null?t.year:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?e:"")+((e=i["if"].call(o,t!=null?t.duration:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?e:"")+((e=i["if"].call(o,t!=null?t.description:t,{name:"if",hash:{},fn:n.program(5,u,0),inverse:n.noop,data:u}))!=null?e:"")+"  <\/div>\r\n<\/div>\r\n"+((e=i.unless.call(o,t!=null?t.shareView:t,{name:"unless",hash:{},fn:n.program(7,u,0),inverse:n.noop,data:u}))!=null?e:"")+"-->"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.Player=Handlebars.template({"1":function(){return'<div class="preview-banner-container">\r\n    <div class="info-icon">i<\/div>\r\n    <div class="preview-banner-text">This is a preview of your interactive video. Share it with your students to collect their results.<\/div>\r\n    <div class="close-preview-banner">&times;<\/div>\r\n<\/div>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{};return((e=i["if"].call(o,t!=null?t.showPreviewBanner:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?e:"")+'<div class="video">\r\n    <iframe id="video-player" src="'+n.escapeExpression((f=(f=i.url||(t!=null?t.url:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(o,{name:"url",hash:{},data:u}):f))+'" allowfullscreen webkitallowfullscreen mozallowfullscreen frameborder="0" scrolling="no"><\/iframe>\r\n    <div class="player-overlay"><\/div>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.PlaySubNav=Handlebars.template({"1":function(){return'<span class="btn grey nav-bar-button backToWS pull-left">&larr; Back to Workspace<\/span>\r\n'},"3":function(){return'<span class="btn orange nav-bar-button pull-right share">Share<\/span>\r\n<span class="btn nav-bar-button pull-right analytics">View Analytics<\/span>\r\n'},"5":function(){return'<span class="btn grey nav-bar-button pull-right export-to-csv">Export to CSV<\/span>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e,o=t!=null?t:n.nullContext||{};return((f=i["if"].call(o,t!=null?t.back:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+"<h1>"+n.escapeExpression((e=(e=i.name||(t!=null?t.name:t))!=null?e:i.helperMissing,typeof e=="function"?e.call(o,{name:"name",hash:{},data:u}):e))+"<\/h1>\r\n"+((f=i["if"].call(o,t!=null?t.playView:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(o,t!=null?t.exportToCSV:t,{name:"if",hash:{},fn:n.program(5,u,0),inverse:n.noop,data:u}))!=null?f:"")},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.Popup=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="text">\r\n  <p>Interactive videos are curriculum-aligned content that feature an interactive layer that helps to keep students engaged throughout the duration of the video.<\/p><p>Interactive videos allow for self-paced learning and improve student comprehension. You can watch the video below to find out more.<\/p>\r\n<\/div>\r\n<div class="thumbnail">\r\n    <img class="thumbnail-img" src="/Assets/images/interactions/interactive-video-popup-graphic.png" />\r\n    <img class="play-btn" src="/Assets/images/icons/universal-play-button1.png">\r\n<\/div>\r\n<div class="buttons-viewpart">\r\n    <a class="btn orange close-popup">Got it!<\/a>\r\n    <a class="dont-show-label">Don\'t show this again<\/a>\r\n    <div class="spacer" style="clear: both;"><\/div>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.SaveInteractive=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{},s=i.helperMissing;return'<p class="cv-description">'+((e=(i.linkify||t&&t.linkify||s).call(o,t!=null?t.description:t,{name:"linkify",hash:{},data:u}))!=null?e:"")+'<\/p>\r\n<div class="input-container">\r\n  <label class="video-title-label">Name your interactive video<\/label>\r\n  <p class="example">Eg. Caption Cook Interactive - Year 10 History<\/p>\r\n  <input type="text" class="video-name-input" value="'+n.escapeExpression((f=(f=i.title||(t!=null?t.title:t))!=null?f:s,typeof f=="function"?f.call(o,{name:"title",hash:{},data:u}):f))+'"/>\r\n  <p class="error">Your interactive video\'s name cannot be left blank and may only include letters, numbers and spaces.<\/p>\r\n<\/div>\r\n<div class="popup-button-container">\r\n  <a class="btn grey close-btn">Cancel<\/a>\r\n  <a class="btn orange add">Add to my interactive videos<\/a>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.ShortAnswerInteraction=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<textarea class="short-answer">'+n.escapeExpression((f=(f=i.text||(t!=null?t.text:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"text",hash:{},data:u}):f))+"<\/textarea>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.SummaryInteraction=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<div class="interaction-title">\r\n  <div class="heading">\r\n        <span class="heading-text">'+n.escapeExpression((f=(f=i.name||(t!=null?t.name:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"name",hash:{},data:u}):f))+'<\/span>\r\n  <\/div>\r\n<\/div>\r\n<div class="interaction-viewpart">\r\n  <div class="interaction-list-viewpart"><\/div>\r\n<\/div>\r\n'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.SummaryTimePointItem=Handlebars.template({"1":function(n,t){var i;return"            "+((i=n.lambda((i=t!=null?t.data:t)!=null?i.annotation:i,t))!=null?i:"")+"\r\n"},"3":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.isShortAnswer:t,{name:"if",hash:{},fn:n.program(4,u,0),inverse:n.program(6,u,0),data:u}))!=null?f:""},"4":function(n,t,i,r,u){var e,f;return"            "+((e=(f=(f=i.name||(t!=null?t.name:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"name",hash:{},data:u}):f))!=null?e:"")+"\r\n"},"6":function(n,t,i,r,u){var f;return"            "+n.escapeExpression((f=(f=i.name||(t!=null?t.name:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"name",hash:{},data:u}):f))+"\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var e,f,l=n.lambda,o=n.escapeExpression,s=t!=null?t:n.nullContext||{},h=i.helperMissing,c="function";return'    <div class="icon col-xs-2 col-sm-2 col-md-1 " style="background-image: url('+o(l((e=t!=null?t.type:t)!=null?e.icon:e,t))+"); background-color: #"+o(l((e=t!=null?t.type:t)!=null?e.colour:e,t))+';"><\/div>\r\n    <div class="time col-xs-4 col-sm-3 col-md-2">'+o((f=(f=i.time||(t!=null?t.time:t))!=null?f:h,typeof f===c?f.call(s,{name:"time",hash:{},data:u}):f))+'<\/div>\r\n    <div class="name col-xs-6 col-sm-7 col-md-6 ">\r\n        <a class="edit-link">\r\n'+((e=i["if"].call(s,t!=null?t.isAnnotation:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(3,u,0),data:u}))!=null?e:"")+'        <\/a>\r\n    <\/div>\r\n    <div class="buttons col-xs-12 col-sm-12 col-md-3 ">\r\n        <button class="btn '+o((f=(f=i.buttonClass||(t!=null?t.buttonClass:t))!=null?f:h,typeof f===c?f.call(s,{name:"buttonClass",hash:{},data:u}):f))+' go-to-button">'+o((f=(f=i.buttonText||(t!=null?t.buttonText:t))!=null?f:h,typeof f===c?f.call(s,{name:"buttonText",hash:{},data:u}):f))+"<\/button>\r\n    <\/div>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.TimePoint=Handlebars.template({"1":function(){return'    <div class="time-select-container"><\/div>\r\n'},"3":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return((f=i["if"].call(e,t!=null?t.previewMode:t,{name:"if",hash:{},fn:n.program(4,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i.unless.call(e,t!=null?t.previewMode:t,{name:"unless",hash:{},fn:n.program(6,u,0),inverse:n.noop,data:u}))!=null?f:"")},"4":function(){return'    <button class="btn grey pull-left exit-preview">Exit preview<\/button>\r\n'},"6":function(){return'    <a class="btn orange continue-video">Save & Continue<\/a>\r\n    <a class="btn blue skip">Come back later<\/a>\r\n'},"8":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return'    <!--<button class="btn grey pull-left preview">Preview<\/button>-->\r\n    <button class="btn orange pull-right save">Save<\/button>\r\n\r\n    <!--<div class="btn-group">\r\n        <button class="btn orange pull-right add-interaction dropdown-toggle" data-toggle="dropdown">Add  <span class="caret"><\/span><\/button>\r\n        <ul class="dropdown-menu">\r\n'+((f=i.each.call(e,t!=null?t.interactionTypes:t,{name:"each",hash:{},fn:n.program(9,u,0),inverse:n.noop,data:u}))!=null?f:"")+'        <\/ul>\r\n    <\/div>\r\n    <div class="btn-group pull-right">\r\n        <button class="btn red pull-right remove-interaction dropdown-toggle" data-toggle="dropdown">Delete  <span class="caret"><\/span><\/button>\r\n        <ul class="dropdown-menu">\r\n            <li>\r\n'+((f=i["if"].call(e,t!=null?t.id:t,{name:"if",hash:{},fn:n.program(11,u,0),inverse:n.noop,data:u}))!=null?f:"")+'            <\/li>\r\n            <li>\r\n                <a class="delete-timepoint">Delete<\/a>\r\n            <\/li>\r\n        <\/ul>\r\n    <\/div>-->\r\n'},"9":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'            <li class="interaction-type" data-id="'+h((f=(f=i.id||(t!=null?t.id:t))!=null?f:o,typeof f===s?f.call(e,{name:"id",hash:{},data:u}):f))+'">\r\n                <a>'+h((f=(f=i.name||(t!=null?t.name:t))!=null?f:o,typeof f===s?f.call(e,{name:"name",hash:{},data:u}):f))+"<\/a>\r\n            <\/li>\r\n"},"11":function(){return'                <a class="discard-timepoint">Discard changes<\/a>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return'<div class="interactions-viewpart"><\/div>\r\n<div class="interaction-footer">\r\n'+((f=i["if"].call(e,t!=null?t.editMode:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i.unless.call(e,t!=null?t.editMode:t,{name:"unless",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,t!=null?t.editMode:t,{name:"if",hash:{},fn:n.program(8,u,0),inverse:n.noop,data:u}))!=null?f:"")+"<\/div>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.TrueOrFalseInteraction=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="options-viewpart"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.VideoSummary=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e,s=n.lambda,o=n.escapeExpression,h=t!=null?t:n.nullContext||{},c=i.helperMissing,l="function";return'<div class="checkbox-viewpart"><\/div>\r\n<div class="cv-video">\r\n    <div class="cv-thumbnail">\r\n        <a>\r\n            <img alt="" title="'+o(s((f=t!=null?t.video:t)!=null?f.title:f,t))+'" src="'+o((e=(e=i.thumbUrl||(t!=null?t.thumbUrl:t))!=null?e:c,typeof e===l?e.call(h,{name:"thumbUrl",hash:{},data:u}):e))+'" />\r\n        <\/a>\r\n        <div class="file-select-container"><\/div>\r\n    <\/div>\r\n    <div class="info cv-video-content">\r\n        <div class="cv-header">\r\n            <h3 class="cv-title" title="'+o(s((f=t!=null?t.video:t)!=null?f.title:f,t))+'">'+o(s((f=t!=null?t.video:t)!=null?f.title:f,t))+'<\/h3>\r\n        <\/div>\r\n        <div class="cv-description-wrapper">\r\n            <div>\r\n                <p class="cv-description">'+((f=(i.linkify||t&&t.linkify||c).call(h,(f=t!=null?t.video:t)!=null?f.description:f,{name:"linkify",hash:{},data:u}))!=null?f:"")+'<\/p>\r\n            <\/div>\r\n        <\/div>\r\n        <span class="help-block">'+o((e=(e=i.errorMessage||(t!=null?t.errorMessage:t))!=null?e:c,typeof e===l?e.call(h,{name:"errorMessage",hash:{},data:u}):e))+"<\/span>\r\n    <\/div>\r\n<\/div>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.AnnotationForm=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="form-row">\r\n    <div class="text-editor-viewpart"><\/div>\r\n<\/div>\r\n'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.AnswerView=Handlebars.template({"1":function(){return"disabled"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{};return'<div class="row">\r\n    <div class="col-sm-3 col-xs-12 checkbox-container">\r\n        <div class="outer-box">\r\n        <\/div>\r\n    <\/div>\r\n    <div class="col-sm-9 col-xs-12 answer-container '+((e=i["if"].call(o,t!=null?t.disabled:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?e:"")+'">\r\n        <input type="text" placeholder="Answer" class="alternative large" '+((e=i["if"].call(o,t!=null?t.disabled:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?e:"")+' tabindex="'+n.escapeExpression((f=(f=i.tabIndex||(t!=null?t.tabIndex:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(o,{name:"tabIndex",hash:{},data:u}):f))+'" />\r\n    <\/div>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.BaseInteractionEditor=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<div class="interaction-body"><\/div>\r\n<div class="interaction-error">'+n.escapeExpression((f=(f=i.errorMessage||(t!=null?t.errorMessage:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"errorMessage",hash:{},data:u}):f))+"<\/div>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.EditorAppView=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<div class="editor-viewpart">\r\n    <div class="tiles">\r\n        <h3 class="editor-header">Select a question to show at <strong class="current-time">'+n.escapeExpression((f=(f=i.currentTime||(t!=null?t.currentTime:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"currentTime",hash:{},data:u}):f))+'<\/strong><\/h3>\r\n        <div class="message-viewpart"><\/div>\r\n    <\/div>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.Footer=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="form-row">\r\n    <button class="btn gray large pull-left preview">Preview<\/button>\r\n    <button class="btn orange large pull-right save">Save<\/button>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.Header=Handlebars.template({"1":function(n,t,i,r,u){var f;return'    <li role="separator" class="divider"><\/li>\r\n    <li class="dropdown-header">Add new question<\/li>\r\n'+((f=i.each.call(t!=null?t:n.nullContext||{},t!=null?t.interactionTypes:t,{name:"each",hash:{},fn:n.program(2,u,0),inverse:n.noop,data:u}))!=null?f:"")},"2":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'    <li class="interaction-type" data-id="'+h((f=(f=i.id||(t!=null?t.id:t))!=null?f:o,typeof f===s?f.call(e,{name:"id",hash:{},data:u}):f))+'">\r\n        <a><span class="icon" style="background-image: url('+h((f=(f=i.icon||(t!=null?t.icon:t))!=null?f:o,typeof f===s?f.call(e,{name:"icon",hash:{},data:u}):f))+');"><\/span>'+h((f=(f=i.name||(t!=null?t.name:t))!=null?f:o,typeof f===s?f.call(e,{name:"name",hash:{},data:u}):f))+"<\/a>\r\n    <\/li>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var o,f,e=t!=null?t:n.nullContext||{},s=i.helperMissing,h="function",c=n.escapeExpression;return'<span class="back-button" data-placement="right"><\/span>\r\n<span class="header">'+c((f=(f=i.title||(t!=null?t.title:t))!=null?f:s,typeof f===h?f.call(e,{name:"title",hash:{},data:u}):f))+'<\/span>\r\n<div class="header-options dropdown-toggle" data-toggle="dropdown"><span class="cog"><\/span><\/div>\r\n<ul class="dropdown-menu options-menu" role="menu">\r\n    <li><a class="preview">Preview<\/a><\/li>\r\n    <li><a class="discard '+c((f=(f=i.interactableClass||(t!=null?t.interactableClass:t))!=null?f:s,typeof f===h?f.call(e,{name:"interactableClass",hash:{},data:u}):f))+'">Discard changes<\/a><\/li>\r\n    <li><a class="delete">Delete<\/a><\/li>\r\n'+((o=i["if"].call(e,t!=null?t.admin:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?o:"")+"<\/ul>\r\n"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.ImageForm=Handlebars.template({"1":function(){return'<div class="file-select"><\/div>\r\n'},"3":function(n,t){var i;return'<div class="image-box">\r\n    <img src="'+n.escapeExpression(n.lambda((i=t!=null?t.data:t)!=null?i.url:i,t))+'" />\r\n    <div class="image-box-overlay">\r\n        <div class="center-buttons">\r\n            <!--<a class="btn gray edit-button">Edit<\/a>-->\r\n            <a class="btn grey delete-button">Remove<\/a>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e,o=t!=null?t:n.nullContext||{};return((f=i.unless.call(o,(f=t!=null?t.data:t)!=null?f.url:f,{name:"unless",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(o,(f=t!=null?t.data:t)!=null?f.url:f,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:"")+'<div class="form-group">\r\n    <div name="data"><\/div>\r\n    <span class="help-block hidden"><\/span>\r\n<\/div>\r\n<div class="form-group">\r\n    <span class="image-validation">'+n.escapeExpression((e=(e=i.imgErrorMessage||(t!=null?t.imgErrorMessage:t))!=null?e:i.helperMissing,typeof e=="function"?e.call(o,{name:"imgErrorMessage",hash:{},data:u}):e))+'<\/span>\r\n<\/div>\r\n<div class="form-row">\r\n    <div class="form-group">\r\n        <label for="caption">Caption<\/label>\r\n        <input type="text" placeholder="Add a caption" class="caption" name="caption" id="caption"/>\r\n        <span class="help-block hidden"><\/span>\r\n    <\/div>\r\n<\/div>\r\n'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.InteractionSummaryItem=Handlebars.template({"1":function(n,t,i,r,u){var e,f;return"            "+((e=(f=(f=i.annotation||(t!=null?t.annotation:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"annotation",hash:{},data:u}):f))!=null?e:"")+"\r\n"},"3":function(n,t,i,r,u){var f;return"            "+n.escapeExpression((f=(f=i.name||(t!=null?t.name:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"name",hash:{},data:u}):f))+"\r\n"},"5":function(n,t,i,r,u){var f;return'        <a class="edit-interaction">Edit this '+n.escapeExpression((f=(f=i.noun||(t!=null?t.noun:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"noun",hash:{},data:u}):f))+"<\/a>\r\n"},"7":function(n,t,i,r,u){var f;return'        <button class="btn red delete-button">Delete<\/button>\r\n        <span class="edit-text">Go to this '+n.escapeExpression((f=(f=i.noun||(t!=null?t.noun:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"noun",hash:{},data:u}):f))+"<\/span>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e,s=n.lambda,o=n.escapeExpression,h=t!=null?t:n.nullContext||{};return'<span class="icon" style="background-image: url('+o(s((f=t!=null?t.type:t)!=null?f.icon:f,t))+"); background-color: #"+o(s((f=t!=null?t.type:t)!=null?f.colour:f,t))+';"><\/span>\r\n<span class="content">\r\n    <span class="type col-lg-2 col-md-2 col-xs-6">'+o(s((f=t!=null?t.type:t)!=null?f.name:f,t))+'<\/span>\r\n    <span class="time col-lg-1 col-md-1 col-xs-6 ">'+o((e=(e=i.time||(t!=null?t.time:t))!=null?e:i.helperMissing,typeof e=="function"?e.call(h,{name:"time",hash:{},data:u}):e))+'<\/span>\r\n    <span class="name col-lg-7 col-md-6 col-sm-8 col-xs-12">\r\n        <a class="edit-link">\r\n'+((f=i["if"].call(h,t!=null?t.annotation:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(3,u,0),data:u}))!=null?f:"")+'        <\/a>\r\n    <\/span>\r\n    <span class="buttons col-lg-2 col-md-3 col-sm-4 col-xs-12">\r\n'+((f=i["if"].call(h,t!=null?t.detailsView:t,{name:"if",hash:{},fn:n.program(5,u,0),inverse:n.program(7,u,0),data:u}))!=null?f:"")+"    <\/span>\r\n<\/span>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.MissingWordItem=Handlebars.template({"1":function(n,t,i,r,u){var c,f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'            <span class="clickable-word '+((c=i["if"].call(e,t!=null?t.selected:t,{name:"if",hash:{},fn:n.program(2,u,0),inverse:n.noop,data:u}))!=null?c:"")+'" id="'+h((f=(f=i.index||(t!=null?t.index:t))!=null?f:o,typeof f===s?f.call(e,{name:"index",hash:{},data:u}):f))+"-"+h((f=(f=i.word||(t!=null?t.word:t))!=null?f:o,typeof f===s?f.call(e,{name:"word",hash:{},data:u}):f))+'">'+h((f=(f=i.word||(t!=null?t.word:t))!=null?f:o,typeof f===s?f.call(e,{name:"word",hash:{},data:u}):f))+"<\/span>\r\n"},"2":function(){return" selected "},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<div class="form-row">\r\n    <div class="form-group">\r\n        <div class="select-words" name="actionableItems">\r\n'+((f=i.each.call(t!=null?t:n.nullContext||{},t!=null?t.words:t,{name:"each",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+'        <\/div>\r\n        <span class="help-block hidden"><\/span>\r\n    <\/div>\r\n<\/div>\r\n'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.MissingWords=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="text-viewpart"><\/div>\r\n<div class="words-viewpart"><\/div>\r\n<div class="preview-viewpart"><\/div>\r\n\r\n'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.MissingWordsWordItem=Handlebars.template({"1":function(){return" selected "},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var c,f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<span class="clickable-word '+((c=i["if"].call(e,t!=null?t.selected:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?c:"")+'" id="'+h((f=(f=i.index||(t!=null?t.index:t))!=null?f:o,typeof f===s?f.call(e,{name:"index",hash:{},data:u}):f))+"-"+h((f=(f=i.word||(t!=null?t.word:t))!=null?f:o,typeof f===s?f.call(e,{name:"word",hash:{},data:u}):f))+'">'+h((f=(f=i.word||(t!=null?t.word:t))!=null?f:o,typeof f===s?f.call(e,{name:"word",hash:{},data:u}):f))+"<\/span>\r\n\r\n"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.MissingWordText=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="form-group">\r\n    <label for="sentence">Sentence<span class="required">*<\/span><\/label>\r\n    <input type="text" id="sentence" class="sentence" placeholder="Type your sentence here" name="data" />\r\n    <span class="help-block hidden"><\/span>\r\n<\/div>\r\n'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.MultipleChoiceForm=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<div class="row">\r\n    <div class="col-md-12 form-group">\r\n        <label for="question">'+h((f=(f=i.questionPrompt||(t!=null?t.questionPrompt:t))!=null?f:o,typeof f===s?f.call(e,{name:"questionPrompt",hash:{},data:u}):f))+'<span class="required">*<\/span><\/label>\r\n        <input type="text" placeholder="Please enter your question here" class="question large" name="name" id="question" tabindex="1" />\r\n        <span class="help-block hidden"><\/span>\r\n    <\/div>\r\n<\/div>\r\n\r\n<div class="form-group">\r\n    <label>'+h((f=(f=i.alternativesText||(t!=null?t.alternativesText:t))!=null?f:o,typeof f===s?f.call(e,{name:"alternativesText",hash:{},data:u}):f))+'<span class="required">*<\/span><\/label>\r\n    <div class="'+h((f=(f=i.subClassName||(t!=null?t.subClassName:t))!=null?f:o,typeof f===s?f.call(e,{name:"subClassName",hash:{},data:u}):f))+'"><\/div>\r\n    <span class="help-block hidden" name="actionableItems"><\/span>\r\n<\/div>\r\n'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.ShortAnswerForm=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'    <div class="form-group">\r\n        <label for="short-answer">Question<span class="required">*<\/span><\/label>\r\n        <textarea class="short-answer" placeholder="Type your short answer question here..." id="short-answer" name="name" />\r\n        <span class="help-block hidden"><\/span>\r\n        <p class="note">Note: You will be required to mark the answers to this question<\/p>\r\n    <\/div>\r\n'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.TimeSelector=Handlebars.template({"1":function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{};return'    At <span class="visible-at"><\/span>\r\n'+((e=i["if"].call(o,t!=null?t.multipleInteractions:t,{name:"if",hash:{},fn:n.program(2,u,0),inverse:n.program(4,u,0),data:u}))!=null?e:"")+"    "+n.escapeExpression((f=(f=i.interactionName||(t!=null?t.interactionName:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(o,{name:"interactionName",hash:{},data:u}):f))+" will appear\r\n"+((e=i["if"].call(o,t!=null?t.pause:t,{name:"if",hash:{},fn:n.program(6,u,0),inverse:n.program(8,u,0),data:u}))!=null?e:"")},"2":function(){return"    these\r\n"},"4":function(){return"    this\r\n"},"6":function(){return'    and the video will <span class="playpause">pause<\/span>.\r\n'},"8":function(n,t,i,r,u){var f;return'    for <span class="visible-for"><\/span> <span class="seconds">'+n.escapeExpression((f=(f=i.seconds||(t!=null?t.seconds:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"seconds",hash:{},data:u}):f))+'<\/span>. The video will <span class="playpause">continue playing<\/span> when it appears.\r\n'},"10":function(n,t,i,r,u){var f;return((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.multipleInteractions:t,{name:"if",hash:{},fn:n.program(11,u,0),inverse:n.program(13,u,0),data:u}))!=null?f:"")+'    question will appear at <span class="visible-at"><\/span>.\r\n'},"11":function(){return"    These\r\n"},"13":function(){return"    This\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<div class="form-row">\r\n'+((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.readOnly:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(10,u,0),data:u}))!=null?f:"")+"<\/div>\r\n"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Interactive=this.ClickView.Interactive||{};this.ClickView.Interactive.Templates=this.ClickView.Interactive.Templates||{};this.ClickView.Interactive.Templates.VideoInformationTab=Handlebars.template({"1":function(n,t){var i;return'<div class="series-viewpart">\r\n    <span class="bold-text">Series:<\/span>\r\n    <span>'+n.escapeExpression(n.lambda((i=t!=null?t.series:t)!=null?i.name:i,t))+"<\/span>\r\n<\/div>\r\n"},"3":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},(f=(f=t!=null?t.video:t)!=null?f.rating:f)!=null?f.code:f,{name:"if",hash:{},fn:n.program(4,u,0),inverse:n.noop,data:u}))!=null?f:""},"4":function(n,t){var i;return'<div class="rating-viewpart">\r\n    <div class="rating-code">'+n.escapeExpression(n.lambda((i=t!=null?t.rating:t)!=null?i.code:i,t))+"<\/div>\r\n<\/div>\r\n"},"6":function(n,t,i,r,u){var f;return'<div class="description-viewpart">\r\n    <span class="bold-text">Video Description:<\/span>\r\n    <span class="description-text">'+((f=(i.linkify||t&&t.linkify||i.helperMissing).call(t!=null?t:n.nullContext||{},t!=null?t.description:t,{name:"linkify",hash:{},data:u}))!=null?f:"")+"<\/span>\r\n<\/div>\r\n"},"8":function(n,t,i,r,u){var f;return'<div class="description-viewpart">\r\n    <span class="bold-text">Interactive Description:<\/span>\r\n    <span class="description-text">'+((f=(i.linkify||t&&t.linkify||i.helperMissing).call(t!=null?t:n.nullContext||{},t!=null?t.interactiveDescription:t,{name:"linkify",hash:{},data:u}))!=null?f:"")+"<\/span>\r\n<\/div>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e,o=t!=null?t:n.nullContext||{};return'<div class="video-title-viewpart">\r\n    <span class="bold-text">Video Title:<\/span>\r\n    <span>'+n.escapeExpression((e=(e=i.title||(t!=null?t.title:t))!=null?e:i.helperMissing,typeof e=="function"?e.call(o,{name:"title",hash:{},data:u}):e))+"<\/span>\r\n<\/div>\r\n"+((f=i["if"].call(o,(f=t!=null?t.series:t)!=null?f.name:f,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(o,(f=t!=null?t.video:t)!=null?f.rating:f,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(o,t!=null?t.description:t,{name:"if",hash:{},fn:n.program(6,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(o,t!=null?t.interactiveDescription:t,{name:"if",hash:{},fn:n.program(8,u,0),inverse:n.noop,data:u}))!=null?f:"")},useData:!0}),function(n){"use strict";var t=n.Interactive,i=n.Shared;t.Models.Video=n.Shared.Models.Video.extend({actionUrl:function(){return"/interactives/videos/"+this.get("id")}})}(ClickView,EasyMoney),function(n){"use strict";var t=n.Interactive,i=n.Shared;t.Collections.VideoCollection=i.Collections.LibraryVideoCollection.extend({model:t.Models.Video,_categoryId:"",url:function(){return"/api/interactives/categories/"+this._categoryId+"/videos"},setCategoryId:function(n){return this._categoryId=n,this},getCategoryId:function(){return this._categoryId}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Interactive,r=n.Shared;i.Views.BaseView=t.View.extend({constructor:function(){this.service=i.InteractiveService;t.View.prototype.constructor.apply(this,arguments)}});i.Views.BaseListView=t.ListView.extend({constructor:function(){this.service=i.InteractiveService;t.ListView.prototype.constructor.apply(this,arguments)}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Interactive,r=n.Shared,u=t.Events;i.Views.SliderView=i.Views.BaseView.extend({name:"slider",tagName:"div",className:"slider",template:'<div class="bar"><\/div><span class="handle"><\/span>',hoz:!0,_isActive:!1,ui:{handle:".handle",bar:".bar"},initialize:function(){this.eventFns={mouseDown:_.bind(this.mouseDown,this),mouseUp:_.bind(this.mouseUp,this),mouseMove:_.bind(this.mouseMove,this),touchStart:_.bind(this.touchStart,this),touchEnd:_.bind(this.touchEnd,this)};this.bindEvents();this.onInitialize()},isActive:function(){return this._isActive},onInitialize:function(){},bindEvents:function(){this.$el.on("mousedown",this.eventFns.mouseDown);this.$el.on("touchstart",this.eventFns.touchStart)},onClose:function(){this.$el.off("mousedown",this.eventFns.mouseDown)},setPosition:function(n){var t=Math.max(0,Math.min(n,100));this.hoz?(this.ui.bar.css("width",t+"%"),this.ui.handle.css("left",t+"%")):(this.ui.bar.css("height",t+"%"),this.ui.handle.css("top",100-t+"%"))},mouseDown:function(n){this.$el.off("mousedown",this.eventFns.mouseDown);$(document).on("mousemove",this.eventFns.mouseMove);$(document).on("mouseup",this.eventFns.mouseUp);this._onDown(n)},touchStart:function(n){this.$el.off("touchstart",this.eventFns.touchStart);$(document).on("touchmove",this.eventFns.mouseMove);$(document).on("touchend",this.eventFns.touchEnd);$(document).on("touchcancel",this.eventFns.touchEnd);this._onDown(n)},_onDown:function(n){this._isActive=!0;var t=this.calculateDistance(n);this.setPosition(t);this.onMouseDown(n,t)},onMouseDown:function(){},mouseMove:function(n){var t=this.calculateDistance(n);this.setPosition(t);this.onMouseMove(n,t);return!1},onMouseMove:function(){},mouseUp:function(n){$(document).off("mousemove",this.eventFns.mouseMove);$(document).off("mouseup",this.eventFns.mouseUp);this.$el.on("mousedown",this.eventFns.mouseDown);this._onEnd(n)},touchEnd:function(n){$(document).off("touchmove",this.eventFns.mouseMove);$(document).off("touchend",this.eventFns.touchEnd);$(document).off("touchcancel",this.eventFns.touchEnd);this.$el.on("touchstart",this.eventFns.touchStart);this._onEnd(n)},_onEnd:function(n){this._isActive=!1;var t=this.calculateDistance(n);this.setPosition(t);this.onMouseUp(n,t)},onMouseUp:function(){},calculateDistance:function(n){var u=this.$el,f=this.$el.height(),e=this.$el.width(),t=u.offset(),i=n.pageX,r=n.pageY;return(n.originalEvent.touches&&n.originalEvent.touches.length>0&&(i=n.originalEvent.touches[0].pageX,r=n.originalEvent.touches[0].pageY),this.hoz)?Math.max(0,Math.min((i-t.left)/e,1))*100:Math.max(0,Math.min(1-(r-t.top)/f,1))*100}})}(ClickView,EasyMoney);!function(n){"use strict";var t=n.Interactive,i=n.Shared;t.Views.AddInteractionButtonView=t.Views.BaseView.extend({template:'<div class="shadow-box"><a class="btn orange">Add question at <span class="current-time">{{currentTime}}<\/span><\/a><\/div><div class="shadow"><\/div><div class="arrow"><\/div>',className:"slide-handle-tooltip",ui:{arrow:".arrow",time:".current-time"},events:{"mousedown .btn":"onClick"},initialize:function(){this.listenTo(this.model,"change:currentTime",this.renderTime)},stopPropagation:function(n){n.stopPropagation()},renderTime:function(){this.ui.time.text(t.Utils.FormatDuration(this.model.get("currentTime")))},onClick:function(n){n.stopPropagation();this.service.promptForInteraction()},getModel:function(){return{currentTime:t.Utils.FormatDuration(this.model.get("currentTime"))}}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Interactive,u=n.Shared,r=t.Events;i.Views.CaptionSettingView=n.Shared.Views.ToggleButtonView.extend({initialize:function(){n.Shared.Views.ToggleButtonView.prototype.initialize.apply(this,arguments);this.listenTo(this.model,"change:captions",this.onToggled);this.listenTo(this.model,"change:hascaptions",this.onHasCaptions)},onToggled:function(){this.toggled(this.model.get("captions"))},onClick:function(){r.trigger("togglecaptions");n.Shared.Views.ToggleButtonView.prototype.onClick.apply(this,arguments)},onHasCaptions:function(){this.model.get("hascaptions")?this.toggleEnable():this.toggleDisable()}})}(ClickView,EasyMoney),function(){"use strict";var t=ClickView.Interactive,n=EasyMoney.Events;t.Views.InteractionTimelineView=t.Views.BaseView.extend({id:"interaction-timeline",template:t.Templates.InteractionTimeline,ui:{progress:".progress-container",timeline:".timeline",timeProgress:".time-progress",totalDuration:".total-duration",play:".play",volume:".volume",settings:".settings",fullscreen:".fullscreen",time:".time"},events:{"click .play > span":"play","click .pause > span":"pause","click .fullscreen > span":"toggleFullscreen","click .volume > span":"mute","touchstart .volume > span":"buttonTouched","mouseover .volume":"addHover","mouseout .volume":"removeHover","touchstart .settings > span":"buttonTouched","click .settings > span":"buttonTouched"},addHover:function(n){var t=$(n.currentTarget);t.addClass("hover");this.$el.find(".interaction-control.hover").not(t).removeClass("hover")},removeHover:function(n){$(n.currentTarget).removeClass("hover")},buttonTouched:function(n){n.preventDefault();var t=$(n.currentTarget).parent();t.toggleClass("hover");this.$el.find(".interaction-control.hover").not(t).removeClass("hover")},initialize:function(){this.listenTo(this.model,"change:currentTime",this.onTimeChange);this.listenTo(this.model,"change:volume",this.onVolumeChange);this.listenTo(this.model,"sync",this.render);this.listenTo(this.model,"change:duration",this.renderProgressBar);this.listenTo(this.model,"change:duration",this.setDuration);this.listenTo(this.model,"change:disableProgressBar",this.toggleDisable);this.listenTo(n,"pause player-pause",this.onPause);this.listenTo(n,"play player-play",this.onPlay);this.listenTo(n,"mute",this.onMute);this.listenTo(n,"disablefullscreen",this.disableFullscreenButton);this.listenTo(n,"interactive:resize",this.onResize)},toggleDisable:function(){if(this.service.isEditMode()){var n=!!this.model.get("disableProgressBar");this.$el.toggleClass("disabled",n);this.$el.attr({"data-original-title":n?"Your question has unsaved changes.":""});n?this.$el.tooltip({container:"#"+this.id}):this.$el.tooltip("destroy")}},setDuration:function(){this.ui.totalDuration.html(this.formatDuration(this.model.get("duration")))},onTimeChange:function(){this.ui.timeProgress.html(this.formatDuration(this.model.get("currentTime")))},onVolumeChange:function(){var n=this.model.get("volume");n?this.ui.volume.removeClass("off"):this.ui.volume.addClass("off")},play:function(){this.service.promptUnlock(function(){n.trigger("play")})},onPlay:function(){this.ui.play.addClass("pause")},pause:function(){n.trigger("pause")},onPause:function(){this.ui.play.removeClass("pause")},mute:function(){var t=this.model.get("volume");n.trigger("setvolume",t===0?100:0)},toggleFullscreen:function(){n.trigger("fullscreen")},onMute:function(){this.ui.volume.addClass("mute")},viewOptions:function(){return{totalDuration:this.formatDuration(this.model.getDuration())}},onBeforeRender:function(){return this.model.isLoaded()?!0:!1},renderProgressBar:function(){if(this.model.get("duration")){var n=new t.Views.ProgressBarView({model:this.model});this.renderView(this.ui.progress,n)}},renderVolume:function(){var n=new t.Views.VolumeControlView({model:this.model});this.renderView(this.ui.volume,n,{empty:!1})},renderSettings:function(){var n=new t.Views.SettingsWindowView({model:this.model});this.renderView(this.ui.settings,n,{empty:!1})},onRender:function(){this.renderProgressBar();this.renderVolume();this.renderSettings();this.model.get("_canFullscreen")||this.disableFullscreenButton();ClickView.Support.isMobile&&this.ui.volume.hide();this.toggleDisable()},onRendered:function(){this.responsiveFontSize()},disableFullscreenButton:function(){this.ui.fullscreen.hide()},formatDuration:function(n){return t.Utils.FormatDuration(n)},responsiveFontSize:function(){var n=Math.ceil(.28*this.$el.outerHeight());this.ui.time.css("font-size",n+"px")},onResize:function(){this.responsiveFontSize()}})}();!function(n,t){"use strict";var i=n.Interactive,u=n.Shared,r=t.Events;i.Views.ProgressBarView=i.Views.SliderView.extend({name:"progressBar",tagName:"div",className:"progress-viewpart",template:'<div class="progress"><div class="progress-bar"><\/div><span class="handle"><\/span><\/div>',defaults:{renderChapters:!1,showAddButton:!1},ui:{progress:".progress",progressBar:".progress-bar",handle:".handle"},onInitialize:function(){this.listenTo(this.model,"change:currentTime",this.onTimeUpdate);this.listenTo(this.model.timepoints,"add remove",this.render)},bindEvents:function(){this.$el.on("mousedown touchstart",_.bind(this.shouldPrompt,this));i.Views.SliderView.prototype.bindEvents.apply(this,arguments)},shouldPrompt:function(n){if(this.service.shouldPrompt()){n.stopImmediatePropagation();var t=this;return this.service.promptUnlock(function(){t.$el.trigger(n)}),!1}},renderTimePoint:function(n,t){var r=t===0?"timepoint":"",u=new i.Views.TimelineTimePointView({model:n,interactive:this.model,onBoarding:r});this.renderView(this.$el,u,{empty:!1})},onTimeUpdate:function(){this.isActive()||this.setPosition(this.model.getProgress())},setPosition:function(n){var t=Math.max(0,Math.min(n,100));this.ui.progressBar.css("width",t+"%");this.ui.handle.css("left",t+"%")},onMouseDown:function(n,t){r.trigger("seekstart");r.trigger("seek",t,!0);this.ui.handle.addClass("grabbing")},onMouseMove:function(n,t){r.trigger("seek",t,!0)},onMouseUp:function(n,t){r.trigger("seekend");r.trigger("seek",t,!1);this.ui.handle.removeClass("grabbing")},renderAddButton:function(){this.options.showAddButton&&this.renderView(this.ui.handle,new i.Views.AddInteractionButtonView({model:this.model}))},renderChapters:function(){var n=this.model.get("duration"),t=0,i=this;this.model.chapters.each(function(r){var u=r.get("duration")*1e3,f=$("<span><\/span>");f.css({left:t/n*100+"%",width:u/n*100+"%",height:"10px",border:"1px solid red",display:"inline-block","box-sizing":"border-box"});i.$el.append(f);t=u})},onRender:function(){this.model.timepoints.each(_.bind(this.renderTimePoint,this));this.setPosition(this.model.getProgress());this.service.isEditMode()&&this.renderAddButton();this.options.renderChapters&&this.model.chapters&&this.renderChapters()}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Interactive,u=n.Shared,r=t.Events;i.Views.QualitySettingView=i.Views.BaseView.extend({template:'{{#each qualities}}<option value="{{text}}">{{text}}<\/option>{{/each}}',tagName:"select",initialize:function(){this.listenTo(this.model,"change:playbackqualities",this.render);this.listenTo(this.model,"change:currentquality",this.selectCurrent)},events:{change:"onChange"},onChange:function(n){var t=$(n.currentTarget).val();r.trigger("changeres",t)},onRender:function(){this.selectCurrent()},selectCurrent:function(){var n=this.$el.find('option[value="'+this.model.get("currentquality")+'"]');n.prop("selected",!0)},getModel:function(){return{qualities:this.model.get("playbackqualities")||[],current:this.model.get("currentquality")}}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Interactive,u=n.Shared,r=t.Events;i.Views.SettingsWindowView=i.Views.BaseView.extend({template:!1,className:"options",initialize:function(){this.listenTo(r,"togglesettings",this.toggleSettings)},toggleSettings:function(){var n=this.$el.is(":visible");n?this.hide():this.show()},renderSetting:function(n,t){var r=new i.Views.SettingView({model:{name:n},view:t});this.renderView(this.$el,r,{empty:!1})},onRender:function(){this.renderSetting("Captions",new i.Views.CaptionSettingView({model:this.model,toggleDisable:!0}));this.renderSetting("Quality",new i.Views.QualitySettingView({model:this.model}))}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Interactive,r=n.Shared,u=t.Events;i.Views.SettingView=i.Views.BaseView.extend({template:"<div class='title'>{{name}}<\/div><div class='viewpart'><\/div>",className:"option",ui:{view:".viewpart"},initialize:function(){if(!this.options.view)throw new Error("Setting has no view");},onRender:function(){this.renderView(this.ui.view,this.options.view)}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Interactive,r=n.Shared,u=t.Events;i.Views.TimelineTimePointView=i.Views.BaseView.extend({tagName:"span",className:"interaction",template:!1,events:{mousedown:"onClick"},initialize:function(){this.listenTo(this.model,"change:visibleFor change:visibleAt",this.style)},onClick:function(n){n.stopPropagation();var t=this;return this.service.promptUnlock(function(){t.service.goToTimepoint(t.model)}),!1},getWidth:function(){var n=this.model.getDisplayDuration()/this.options.interactive.get("duration")*100;return n||.5},getPosition:function(){return this.model.getDisplayTime()/this.options.interactive.get("duration")*100},getColor:function(){return this.model.interactions.length?this.model.interactions.at(0).type.get("colour"):"transparent"},style:function(){this.$el.css("background-color","#"+this.getColor());this.$el.css("left",this.getPosition()-.25+"%");this.$el.css("width",this.getWidth()+"%")},onRender:function(){this.style()},onBoarding:function(){return this.options.onBoarding}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.Interactive,u=n.Shared,r=t.Events;i.Views.VolumeControlView=i.Views.SliderView.extend({name:"volumeControl",className:"volume-control",template:'<div class="volume-bar"><div class="bar"><\/div><span class="handle"><\/span><\/div>',hoz:!1,onInitialize:function(){this.listenTo(this.model,"change:volume",this.onVolumeChanged)},onVolumeChanged:function(){if(!this.isActive()){var n=this.model.get("volume");typeof n!="number"&&(n=100);this.setPosition(n)}},onRender:function(){this.onVolumeChanged()},onMouseDown:function(n,t){r.trigger("setvolume",t);this.$el.addClass("active")},onMouseUp:function(){this.$el.removeClass("active")},onMouseMove:function(n,t){r.trigger("setvolume",t)}})}(ClickView,EasyMoney),function(){"use strict";var t=ClickView.Interactive,n=EasyMoney.Events,i;t.Views.AppView=t.Views.BaseView.extend({name:"AppView.js",template:t.Templates.AppView,id:"interaction",_fsHelper:null,_progressReporter:null,_animationDuration:500,isMobile:!1,ui:{player:".player-view",interaction:".interactions-container",startInteraction:".start-interaction",splash:".splash-cover",$closeContainer:".close-interactive-view-container",$analyticsContainer:".analytics-container",$mobileDeviceBanner:".mobile-device-banner"},events:{"click .start-interaction":"playClick","click .close-interactive-view":"close","click .go-fullscreen":"triggerFullscreen","click .continue-normal":"hideMobileBanner","click .close-fullscreen":"closeFullscreen"},viewOptions:function(){return{posterImage:this.model.get("posterImage")||this.options.posterImage,editMode:this.options.edit}},initialize:function(){this.isMobile=ClickView.Support.isMobile;this.bindEventListeners();this.bindModelListeners();this.model.isLoaded()||this.model.fetch();this._progressReporter=new t.Services.ProgressReporter(this.model,{isMobile:this.isMobile});t.LogService=new t.Services.Logger;this._fsHelper=new ClickView.Utils.FullscreenHelper;this.listenTo(this._fsHelper,"fullscreenchange",this.onFullscreenChange);this.model.set("_canFullscreen",this._fsHelper.canFullscreen());ClickView.ImagePreloader.preload(ClickView.ImageLists.interactions)},bindEventListeners:function(){this.listenTo(n,"closeTimepoint",this.onTimePointviewClose);this.listenTo(n,"interaction",this.renderTimepoint);this.listenTo(n,"fullscreen",this.toggleFullScreen);this.listenTo(n,"iframe:loaded",this.playerLoaded);this.listenTo(n,"player-ended",this.renderSummary);this.listenTo(n,"show-summary",this.renderSummary);this.listenTo(n,"close-summary",this.closeSummary);this.listenTo(n,"show-onboarding-analytics",this.showOnboardingAnalytics);this.listenTo(n,"hide-onboarding-analytics",this.hideOnboardingAnalytics);this.listenToOnce(n,"player-play",this.onFirstPlay);this.listenTo(this.service,"render-timepoint",this.renderTimepoint);this.listenTo(this.service,"render-interaction-selection",this.renderInteractionSelection);this.listenTo(this.service,"no-timepoint",this.renderInteractionSelection)},bindModelListeners:function(){this.listenTo(this.model,"sync",this.render);this.listenTo(this.model,"start",this.startInteraction)},onFirstPlay:function(){(this.service.logView(this.options.playedFrom,this.options.interactiveResource),this.isMobile)&&(this.model.startSession(),this.showPlayerMask())},playerLoaded:function(){if(this._playerLoaded=!0,this.service.isEditMode()||(this.ui.startInteraction.removeClass("loading"),this.spinner.stop()),this.isMobile){this.hideSplash();return}this.model.isAutoplay()&&this.startInteraction()},triggerStartProcedure:function(){this._playerLoaded&&this.model.startSession()},playClick:function(){this.isMobile||this.triggerStartProcedure()},_started:!1,startInteraction:function(i){if(!this._started){if(this._started=!0,!this.model.isAutoplay()&&!this.model.get("readOnly")){var r=this.model.get("resultId");this._progressReporter.start(r);t.LogService.start(r)}this.isMobile||(this.showPlayerMask(),i!==!0&&n.trigger("play"));this.model.chapters&&this.model.chapters.length?this.hideSplash():this.listenToOnce(this.model,"change:chapters",this.hideSplash)}},hideSplash:function(){this.ui.splash.remove();this.ui.startInteraction.remove();this.service.isEditMode()||n.trigger("play")},renderSummary:function(){if(!this.service.isEditMode()){var n=new t.Views.SummaryInteractionView({model:this.model});this.$el.addClass("interaction-showing");this.renderView(this.ui.interaction,n)}},closeSummary:function(){this.$el.removeClass("interaction-showing")},showOnboardingAnalytics:function(){var i=this;setTimeout(function(){var r,u,f,e;try{u=ClickView.Data.User.displayName;r=u.substring(0,u.lastIndexOf(" ")+2)+"."}catch(o){r="Your results"}n.trigger("pause");i.toggleOnboardingAnalytics();f=ClickView.InteractiveAnalytics.Utils.Mapper(i.model,t.LogService.getLogCache(),i._progressReporter.getModifiedSessions(),r);e=new ClickView.InteractiveAnalytics.Views.OnBoardingView({model:f,loaded:!0});i.renderView(i.ui.$analyticsContainer,e)},600)},hideOnboardingAnalytics:function(){n.trigger("play");this.toggleOnboardingAnalytics()},toggleOnboardingAnalytics:function(){this.ui.$analyticsContainer.slideToggle()},renderTimepoint:function(n,i){(this.service.isEditMode()||n.shouldPause())&&EasyMoney.Events.trigger("pause");this.timePointView=new t.Views.TimePointView({model:n,onBoarding:i});this.$el.addClass("interaction-showing");this.renderView(this.ui.interaction,this.timePointView);this.editorAppView=!1},renderInteractionSelection:function(){!this.editorAppView&&this.service.isEditMode()&&(this.$el.addClass("interaction-showing"),this.editorAppView=new t.Views.EditorAppView({model:this.model}),this.renderView(this.ui.interaction,this.editorAppView))},onBeforeRender:function(){return this.model.isLoaded()?!0:!1},onRender:function(){ClickView.ImagePreloader.preload(this.service.getImagesFromInteractive());this.spinner=new Spinner(i).spin(this.ui.startInteraction[0]);var n=this.model.get("player");n==="vimeo"?this.renderView(this.ui.player,new t.Views.VimeoPlayerView({model:this.model})):n==="clickview"&&this.renderView(this.ui.player,new t.Views.ClickViewPlayerView({model:this.model,showPreviewBanner:this.options.showPreviewBanner}));this.options.showCloseButton&&this.ui.$closeContainer.show();this.showMobileBanner()},onRendered:function(){this.onResize();$(window).bind("resize",_.bind(_.throttle(this.onResize,250),this))},responsiveFontSize:function(){var n=Math.ceil(.028*this.$el.outerHeight());n<12&&(n=12);this.$el.css("font-size",n+"px")},onResize:function(){var n=this;window.setTimeout(function(){if(EasyMoney.Events.trigger("interactive:resize"),n.responsiveFontSize(),n._fsHelper.isFullscreen()){n.$el.addClass("thin");return}var t=n.$el.parent();t.outerWidth()*.43<t.outerHeight()?n.$el.addClass("thin"):n.$el.removeClass("thin")},this._animationDuration+100)},onFullscreenChange:function(n){n?(this.$el.addClass("fullscreen"),this.hideMobileBanner(),$(".navbar").hide()):(this.$el.removeClass("fullscreen"),this.showMobileBanner(),$(".navbar").show());this.onResize()},toggleFullScreen:function(){this._fsHelper.toggleFullScreen(this.el)},showPlayerMask:function(){this.$el.find(".player-overlay").show()},triggerFullscreen:function(){n.trigger("fullscreen");this.onResize();this.hideMobileBanner();this.listenTo(n,"fullscreen",this.showMobileBanner)},closeFullscreen:function(){n.trigger("fullscreen")},hideMobileBanner:function(){this.ui.$mobileDeviceBanner.removeClass("showing")},showMobileBanner:function(){ClickView.Support.isMobile&&this.ui.$mobileDeviceBanner.addClass("showing")},onTimePointviewClose:function(){this.service.isEditMode()||this.$el.removeClass("interaction-showing")}});i={loadingText:null,mask:!1,cover:!1,imageUrl:"/Assets/images/cv-loader-orange.gif",color:"#ffffff",spinOptions:{lines:11,length:4,width:4,radius:6,corners:1,rotate:0,direction:1,speed:1,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2e9,top:"50%",left:"50%"}}}(),function(){"use strict";var n=ClickView.Interactive;n.Views.DrawingView=n.Views.BaseView.extend({className:"canvas-container",template:!1,ui:{canvas:"canvas"},prevX:0,prevY:0,currX:0,currY:0,dot_flag:!1,x:"red",y:2,onRender:function(){this.canvas=document.createElement("canvas");this.canvas.height=$(".player-view").outerHeight();this.canvas.width=$(".player-view").outerWidth();this.$el[0].appendChild(this.canvas);this.ui.canvas=$(this.$el.find("canvas"));this.context=this.canvas.getContext("2d");this.addEventListeners()},addEventListeners:function(){this.canvas.addEventListener("mousemove",_.bind(this.onMouseMove,this));this.canvas.addEventListener("mousedown",_.bind(this.onMouseDown,this));this.canvas.addEventListener("mouseup",_.bind(this.onMouseUp,this));this.canvas.addEventListener("mouseout",_.bind(this.onMouseOut,this))},onMouseMove:function(n){this.findxy("move",n)},onMouseDown:function(n){this.findxy("down",n)},onMouseUp:function(n){this.findxy("up",n)},onMouseOut:function(n){this.findxy("out",n)},draw:function(){this.context.beginPath();this.context.moveTo(this.prevX,this.prevY);this.context.lineTo(this.currX,this.currY);this.context.strokeStyle=this.x;this.context.lineWidth=this.y;this.context.stroke();this.context.closePath()},findxy:function(n,t){n=="down"&&(this.prevX=this.currX,this.prevY=this.currY,this.currX=t.clientX-this.ui.canvas.offset().left,this.currY=t.clientY-this.ui.canvas.offset().top,this.flag=!0,this.dot_flag=!0,this.dot_flag&&(this.context.beginPath(),this.context.fillStyle=this.x,this.context.fillRect(this.currX,this.currY,2,2),this.context.closePath(),this.dot_flag=!1));(n=="up"||n=="out")&&(this.flag=!1);n=="move"&&this.flag&&(this.prevX=this.currX,this.prevY=this.currY,this.currX=t.clientX-this.ui.canvas.offset().left,this.currY=t.clientY-this.ui.canvas.offset().top,this.draw())}})}(),function(){"use strict";var t=ClickView.Interactive,n=EasyMoney.Events;t.Views.PlayerView=t.Views.BaseView.extend({name:"PlayerView.js",className:"video-container",template:t.Templates.Player,ui:{iframe:"iframe",$previewBanner:".preview-banner-container"},events:{"click .player-overlay":"onClick","click .close-preview-banner":"closePreviewBanner","click .info-icon":"togglePreviewBanner"},playing:!1,initialize:function(){this.bindEvents();this.playing=!1;this.listenTo(this,"onRendered",this.onRendered)},bindEvents:function(){this.listenTo(this.service,"play seek seek-ms",this.lockCheck);this.listenTo(n,"play",this.play);this.listenTo(n,"pause",this.pause);this.listenTo(n,"stop",this.stop);this.listenTo(n,"seek",this.seek);this.listenTo(n,"seek-ms",this.seekMs);this.listenTo(this.service,"seek-ms",this.seekMs);this.listenTo(n,"setvolume",this.setVolume);this.listenTo(n,"togglecaptions",this.toggleCaptions);this.listenTo(n,"changeres",this.changeQuality);this.listenTo(n,"query-player-state",this.getPlayState)},getPlayState:function(){EasyMoney.Events.trigger("response-player-state",{state:this.playing})},unbindEvents:function(){},onClick:function(){this.playing?n.trigger("pause"):n.trigger("play")},play:function(){},onPlay:function(){this.playing=!0;n.trigger("player-play")},pause:function(){},onPause:function(){this.playing=!1;n.trigger("player-pause")},renderTimelineView:function(){var n=new t.Views.InteractionTimelineView({model:this.model});this.renderView(this.$el,n,{empty:!1})},viewOptions:function(){return{showPreviewBanner:this.options.showPreviewBanner}},onRender:function(){this.renderTimelineView()},isReady:function(){return!0},onClose:function(){this.unbindEvents()},onEnded:function(){n.trigger("player-ended")},seek:function(){},seekMs:function(){},setVolume:function(){},onVolumeChange:function(n,t){this.model.set("volume",t*100)},toggleCaptions:function(){},onToggleCaptions:function(n,t){this.model.set("captions",!!t)},onHasCaptions:function(n,t){this.model.set("hascaptions",t)},changeQuality:function(){},onQualityChanged:function(n,t){this.model.set("currentquality",t)},closePreviewBanner:function(){this.ui.$previewBanner.addClass("minimized")},togglePreviewBanner:function(){this.ui.$previewBanner.toggleClass("minimized")}});t.Views.ClickViewPlayerView=t.Views.PlayerView.extend({name:"ClickViewPlayerView.js",_iframeLoaded:!1,_qualities:[],initialize:function(){t.Views.PlayerView.prototype.initialize.apply(this,arguments)},onRender:function(){t.Views.PlayerView.prototype.onRender.apply(this,arguments);var i=this;this.ui.iframe.load(function(){i.eventsApi=new CVEventsApi(this.contentWindow);i.bindPostMessageEvents.apply(i);i._iframeLoaded=!0;n.trigger("iframe:loaded");i.onLoad.apply(i)})},onLoad:function(){this.eventsApi.trigger("cv-player-addlistener","cv-player-timeupdate2")},isReady:function(){return!!this._iframeLoaded&&!!this.eventsApi},bindPostMessageEvents:function(){this.eventsApi.on("cv-player-timeupdate2",this.updateTime,this);this.eventsApi.on("cv-player-play",this.onPlay,this);this.eventsApi.on("cv-player-pause",this.onPause,this);this.eventsApi.on("cv-player-ended",this.onEnded,this);this.eventsApi.on("cv-player-volumechange",this.onVolumeChange,this);this.eventsApi.on("cv-player-qualitychange",this.onQualityChanged,this);this.eventsApi.on("cv-player-subtitles",this.onToggleCaptions,this);this.eventsApi.on("cv-player-hassubtitles",this.onHasCaptions,this);this.eventsApi.on("cv-player-chapterchange",this.onChapterChange,this);this.eventsApi.one("cv-player-timeupdate2",this.onFirstLoad,this)},onPlay:function(){this._firstPlayTriggered||(n.trigger("first-play"),this._firstPlayTriggered=!0);this.query("currentTime",function(n){typeof n=="number"&&this.setTime(n)});t.Views.PlayerView.prototype.onPlay.apply(this,arguments)},onFirstLoad:function(){this.query("getAvailableQualities",function(n){this.model.set("playbackqualities",n)});this.query("currentQuality",function(n){this.onQualityChanged(null,n)});this.query("paused",function(n){n!==!1||this.playing||this.onPlay()});this.query("getChapters",function(n){this.pause();this.model.set("chapters",n);this.model.get("startTime")&&this.seekMs(this.model.get("startTime"))})},query:function(n,t,i){if(this.isReady()){var r=ClickView.Shared.Helpers.Guid.newGuid(),u=i||this;this.eventsApi.one("cv-player-querycallback-"+r,function(n,i){t.call(u,i)});this.eventsApi.trigger("cv-player-query",n,r)}},unbindEvents:function(){this.isReady()&&(this.eventsApi.off("cv-player-timeupdate2",this.updateTime),this.eventsApi.off("cv-player-play",this.onPlay),this.eventsApi.off("cv-player-pause",this.onPause),this.eventsApi.off("cv-player-ended",this.onEnded),this.eventsApi.off("cv-player-volumechange",this.onVolumeChange),this.eventsApi.off("cv-player-qualitychange",this.onQualityChanged),this.eventsApi.off("cv-player-chapterchange",this.onChapterChange))},setTime:function(n){var i,r,t,u;if(!this.service.hasControl()){if(i=n,this.model.hasChapters())for(r=this.model.get("currentChapter"),t=0;t<r;t++)u=this.model.get("chapters").at(t),i+=u.get("duration");this.model.set("currentTime",i*1e3)}},updateTime:function(n,t){this.setTime(t)},onChapterChange:function(n,t,i){this.model.set("currentChapter",i)},play:function(){this.isReady()&&this.eventsApi.trigger("cv-player-play")},pause:function(){this.isReady()&&this.eventsApi.trigger("cv-player-pause")},seek:function(n,t){if(this.isReady()&&n!==null){if(this.model.hasChapters())return this.seekChapter(this.model.get("duration")/1e5*n,t);this.eventsApi.trigger("cv-player-seekto",n+"%",t)}},seekMs:function(n,t){if(this.isReady()){var i=n/1e3;if(this.model.hasChapters())return this.seekChapter(i,t);this.eventsApi.trigger("cv-player-seekto",i,t)}},seekChapter:function(n,t){var i=this.model.get("chapters").getByTimepoint(n),r=this.model.get("currentChapter");r!==i.index?t||this.eventsApi.trigger("cv-player-changechapter",i.index,i.timepoint):r===i.index&&this.eventsApi.trigger("cv-player-seekto",i.timepoint,t)},setVolume:function(n){this.isReady()&&this.eventsApi.trigger("cv-player-setvolume",n/100)},toggleCaptions:function(){if(this.isReady()){var n=!this.model.get("captions");this.eventsApi.trigger("cv-player-subtitles",n)}},changeQuality:function(n){this.isReady()&&this.eventsApi.trigger("cv-player-setquality",n)}});t.Views.VimeoPlayerView=t.Views.PlayerView.extend({name:"VimeoPlayView.js",playerOrigin:"*",initialize:function(){t.Views.PlayerView.prototype.initialize.apply(this,arguments);window.addEventListener?window.addEventListener("message",_.bind(this.onMessageReceived,this),!1):window.attachEvent("onmessage",_.bind(this.onMessageReceived,this),!1)},onMessageReceived:function(n){if(!/^https?:\/\/player.vimeo.com/.test(n.origin))return!1;this.playerOrigin==="*"&&(this.playerOrigin=n.origin);var t=JSON.parse(n.data);switch(t.event){case"ready":this.onReady();break;case"playProgress":this.updateTime(t.data);break;case"pause":this.onPause();break;case"play":this.onPlay()}},updateTime:function(n){this.setTime(n.seconds)},onReady:function(){this.postMessage("addEventListener","pause");this.postMessage("addEventListener","play");this.postMessage("addEventListener","playProgress")},postMessage:function(n,t){var i={method:n},r,u;t&&(i.value=t);r=JSON.stringify(i);u=this.ui.iframe[0].contentWindow.postMessage(i,this.playerOrigin)},play:function(){this.postMessage("play")},pause:function(){this.postMessage("pause")},seek:function(){}})}(),function(){"use strict";var n=ClickView.Interactive,t=EasyMoney.Events,i=new EasyMoney.Model;n.Views.InteractionListView=n.Views.BaseView.extend({name:"InteractionView.js",ui:{$interactionViewpart:".interaction-viewpart"},template:'<div class="interaction-viewpart"><\/div>',initialize:function(){this.interactions=this.model.interactions;this.listenTo(this.interactions,"add",this.renderInteraction)},renderInteraction:function(t){var i,r=!this.options.previewMode&&this.service.isEditMode(),u=n.Utils.GetInteractionViewByType(t.getType(),r);i=r?new n.Views.BaseInteractionEditorWrapperView({view:new u({model:t}),model:t}):new n.Views.BaseInteractionWrapperView({view:new u({model:t,shouldPause:this.model.get("shouldPause"),isPreview:this.options.previewMode}),model:t});this.renderView(this.ui.$interactionViewpart,i,{empty:!1})},renderInteractions:function(){this.interactions.each(_.bind(this.renderInteraction,this))},validate:function(){var n=!0;return this.__private__.childViews.each(function(t){n&=t.validate()}),n},onRender:function(){this.renderInteractions()},onRendered:function(){}});n.Views.TimePointView=n.Views.BaseView.extend({_scrollBarLoaded:!1,name:"TimePointView",className:"timepoint-view",template:n.Templates.TimePoint,events:{"click .continue-video":"continueVideo","click .skip":"skip","click .view-summary":"viewSummary","click .save":"save","click .exit-preview":"exitPreview"},ui:{$interactionsViewpart:".interactions-viewpart",$skip:".skip",$timeselect:".time-select-container"},initialize:function(){this.listenTo(this.model,"current-changed",this.currentTimepointChanged);this.listenTo(this.service,"previewInteraction",this.preview);this.listenTo(this.model,"request",this.renderLoader)},currentTimepointChanged:function(){this.model.isCurrent()||this.skip(!1)},viewSummary:function(){t.trigger("show-summary pause")},validate:function(){return this.getChildByIndex("InteractionListView").validate()?!0:(this.ui.$skip.css("visibility","visible"),!1)},skip:function(n){t.trigger("closeTimepoint");this.closeChildren();var i=this;window.setTimeout(function(){n&&t.trigger("play");i.close()},500)},initializeScrollbar:function(){this._scrollBarLoaded&&this.ui.$interactionsViewpart.mCustomScrollbar("destroy");this.ui.$interactionsViewpart.mCustomScrollbar({axis:"y",theme:"clickview",scrollInertia:0,mouseWheel:{scrollAmount:40}});this._scrollBarLoaded=!0;this.listenTo(EasyMoney.Events,"timepoint:scroll-to-bottom",this.scrollToBottom)},scrollToBottom:function(){this.ui.$interactionsViewpart.mCustomScrollbar("scrollTo","bottom")},continueVideo:function(){this.validate()&&(n.EventManager.getOrCreateChannel("interaction").trigger("continue"),this.skip(!0))},addInteraction:function(n){this.service.addInteraction($(n.currentTarget).data("id"),this.model)},renderInteractions:function(){var t=new n.Views.InteractionListView({model:this.model,previewMode:this.previewMode});this.renderView(this.ui.$interactionsViewpart,t,{childIndex:"InteractionListView"})},renderTimeSelectView:function(){if(this.service.isEditMode()){var t=new n.Views.TimeSelectorView({model:this.model});this.renderView(this.ui.$timeselect,t)}},renderLoader:function(){var n=new ClickView.Shared.Views.SpinJsView({loadingText:"Saving your question..."});this.renderView(this.ui.$interactionsViewpart,n)},save:function(){if(this.service.isValid(this.model)){var n=this,t=this.model.interactions.find(function(n){return!n.get("id")});this.renderLoader();this.service.save(this.model).then(function(){!t||ClickView.Shared.Utils.AnalyticsService.logInteractiveInteractionAction(n.service._analyticsEvents.ADD,t);n.service.goToAfterTimepoint(n.model);n.model.get("playerShouldResume")&&EasyMoney.Events.trigger("play")}).fail(function(){n.renderInteractions();throw new Error("save failed");})}},preview:function(){this.previewMode=!0;this.model.removeEmptyAlternatives();this.render()},exitPreview:function(){this.previewMode=!1;this.render()},deleteTimepoint:function(){confirm("Are you sure you want to delete all the questions for this time?")&&this.service.removeTimepoint(this.model)},discardTimepoint:function(){this.service.revertTimepoint(this.model)},onRender:function(){this.renderInteractions();this.renderTimeSelectView();this.editModeClass()},editModeClass:function(){this.$el.toggleClass("edit-mode-timepoint",!this.previewMode&&this.service.isEditMode())},onRendered:function(){this.initializeScrollbar()},viewOptions:function(){return{previewMode:this.previewMode,editMode:!this.previewMode&&this.service.isEditMode(),interactionTypes:this.service.isEditMode()?n.Utils.GetInteractionTypes:[]}},onBoarding:function(){return this.options.onBoarding?"interaction":""}})}(),function(){"use strict";var n=ClickView.Interactive;n.Views.BaseInteractionView=n.Views.BaseView.extend({name:"BaseInteractionView.js",initialize:function(){var t=n.EventManager.getOrCreateChannel("interaction");this.listenTo(t,"continue",this.continueInteraction);this.options.shouldPause||this.save()},continueInteraction:function(n){this.validate(n)&&this.save()},validate:function(){return!0},save:function(){var i=this.model.get("id"),r=this.model.actionableItems.filter(function(n){return!!n.get("selected")}),t=_.map(r,function(n){return{actionableItemId:n.attributes.id,value:n.attributes.text||n.attributes.name}});n.LogService.log(i,t);t.length&&EasyMoney.Events.trigger("interactionCompleted",t[0].actionableItemId)}})}(),function(){"use strict";var n=ClickView.Interactive;n.Views.BaseInteractionWrapperView=n.Views.BaseView.extend({template:n.Templates.BaseInteraction,name:"BaseInteractionWrapperView",className:"interaction-item",ui:{$interactionViewPart:".interaction-viewpart",$icon:".icon",$error:".interaction-error"},initialize:function(){this.internactionView=this.options.view},viewOptions:function(){return{name:n.Utils.GetFixedTitle(this.model.getType())||this.model.get("name"),iconClass:"multiple-choice",errorMessage:this.model.get("errorMessage")||"Psst, you haven't attempted this question yet. You can continue to watch the video and answer the question later if you like.",isAnnotation:n.Utils.InteractionHasDangerousHtml(this.model.getType())}},validate:function(){return this.internactionView.validate()?!0:(this.displayErrorMessage(),!1)},displayErrorMessage:function(){this.ui.$error.show()},renderInteractionView:function(){this.renderView(this.ui.$interactionViewPart,this.internactionView)},onRender:function(){this.ui.$icon.css("background-image","url("+this.model.type.get("icon")+")");this.renderInteractionView()}})}(),function(){"use strict";var n=ClickView.Interactive;n.Views.AnnotationInteractionView=n.Views.BaseInteractionView.extend({className:"annotation-interaction-view",template:n.Templates.AnnotationInteraction,validate:function(){return this.model.actionableItems.at(0).set("selected",!0),this.model.actionableItems.at(0).set("text",this.model.actionableItems.at(0).get("name")),!0},viewOptions:function(){return{annotation:this.model.data.get("annotation")}},onRendered:function(){_.each(this.$el.find("a"),function(n){$(n).attr("target","_blank")})}})}(),function(){"use strict";var n=ClickView.Interactive;n.Views.ImageInteractionView=n.Views.BaseInteractionView.extend({className:"image-interaction-view",template:n.Templates.ImageInteraction,ui:{img:"img",imageBox:".image-box"},viewOptions:function(){return this.model.data.toJSON()},validate:function(){return this.model.actionableItems.at(0).set("selected",!0),this.model.actionableItems.at(0).set("text",this.model.actionableItems.at(0).get("name")),!0},onRender:function(){var n=this;this.ui.img.load(function(){n.ui.imageBox.css("width",n.ui.img.outerWidth()+"px")})}})}(),function(){"use strict";var n=ClickView.Interactive;n.Views.LinkInteractionView=n.Views.BaseInteractionView.extend({className:"link-interaction-view",template:n.Templates.LinkInteraction,viewOptions:function(){return{url:this.model.get("data").url,linkText:this.model.get("data").linkText||"Open link",caption:this.model.get("data").caption}},validate:function(){return this.model.actionableItems.at(0).set("selected",!0),this.model.actionableItems.at(0).set("text",this.model.actionableItems.at(0).get("name")),!0}})}(),function(){"use strict";var n=ClickView.Interactive,t="17pt arial";n.Views.MissingWordInteractionView=n.Views.BaseInteractionView.extend({name:"MissingWordInteraction",events:{"click .continue-video":"continueVideo"},template:n.Templates.MissingWordInteraction,ui:{$missingSentence:".missing-word-sentence",inputs:"input"},replaceWithInputs:function(n,t){return n.replace(/{([^{}]*)}/g,_.bind(function(n,i){var r=t.findWhere({order:parseInt(i,10)}),u=this.getWordWidth(r.get("name"));return'<input type="text" name="'+i+'" value="{{'+i+'}}" style="width:'+u+'px" />'},this))},getWordWidth:function(n){var u=document.createElement("canvas"),i=u.getContext("2d"),r;return i.font=t,r=i.measureText(n),r.width},viewOptions:function(){var n={},t=this.replaceWithInputs(this.model.data.get("sentence"),this.model.actionableItems);return this.model.actionableItems.each(function(t){n[t.get("order")]=t.get("text")||""}),{sentence:EasyMoney.template(t,n)}},validate:function(){var n=!0,t=this;return this.ui.inputs.each(function(i,r){t.model.actionableItems.at(i).set({selected:!!r.value,text:r.value});n&=!!r.value}),n}})}(),function(){"use strict";var n=ClickView.Interactive;n.Views.OptionItemView=n.Views.BaseView.extend({name:"OptionItemView.js",className:"option-container",template:n.Templates.OptionItem,ui:{$optionContainer:".answer-box-container"},defaults:{correctAnswerCount:0},initialize:function(){this.listenTo(this.model,"change:selected",this.toggleAnswers);this.showRadioButtons=this.collection.filter(function(n){return!!n.get("isCorrect")}).length===1},onRender:function(){this.renderOption()},renderOption:function(){this.options.isPreview&&(this.model.set({previewCorrect:this.model.get("selected")}),this.listenTo(this.model,"change:previewCorrect",this.togglePreviewAnswer));var n=new ClickView.Shared.Views.CheckBoxView({model:this.model,type:this.showRadioButtons?"radio":"check",correct:this.options.isPreview?this.model.previewCorrect:this.model.selected,check:!this.showRadioButtons,toggleableAttribute:this.options.isPreview?"previewCorrect":"selected"});this.renderView(this.ui.$optionContainer,n)},toggleAnswers:function(){this.model.get("selected")&&this.showRadioButtons&&this.collection.each(function(n){this.model!==n&&n.set({selected:!1})},this)},togglePreviewAnswer:function(){this.model.get("previewCorrect")&&this.showRadioButtons&&this.collection.each(function(n){this.model!==n&&n.set({previewCorrect:!1})},this)},isChecked:function(){return this.model.get("selected")},viewOptions:function(){return _.extend({},this.model.toJSON(),{inputId:this.hash(this.cid),inputName:this.hash(this.options.parentId),inputType:this.showRadioButtons?"radio":"checkbox",isSelected:this.model.get("selected")?"checked=true":""})},hash:function(n){var t=0,i,r,u;if(n.length===0)return t;for(i=0,u=n.length;i<u;i++)r=n.charCodeAt(i),t=(t<<5)-t+r|0;return Math.abs(t)}});n.Views.OptionListView=EasyMoney.ListView.extend({name:"OptionListView.js",childView:n.Views.OptionItemView,initialize:function(){},validate:function(){var n=!1;return this.__private__.childViews.each(function(t){n|=t.isChecked()}),n},addOne:function(n){n.get("name")&&this.renderView(this.$el,this.buildChildView.call(this,n),{empty:!1})},buildChildView:function(n){var t=_.extend({},_.omit(this.options,["collection","model","id"]),{model:n,parentId:this.cid,correctAnswerCount:this.correctAnswerCount,collection:this.collection,isPreview:this.options.isPreview});return new this.childView(t)}});n.Views.MultipleChoiceInteractionView=n.Views.BaseInteractionView.extend({className:"multiple-choice-interaction-view",ui:{$optionsViewpart:".options-viewpart"},template:n.Templates.MultipleChoiceInteraction,renderOptions:function(){var t=new n.Views.OptionListView({collection:this.model.actionableItems,isPreview:this.options.isPreview});this.renderView(this.$el,t,{childIndex:"listView"})},validate:function(){return this.getChildByIndex("listView").validate()},onRender:function(){this.renderOptions()}})}(),function(){"use strict";var n=ClickView.Interactive;n.Views.ShortAnswerInteractionView=n.Views.BaseInteractionView.extend({name:"ShortAnswerInteraction",template:n.Templates.ShortAnswerInteraction,ui:{$shortAnswer:".short-answer"},viewOptions:function(){return{text:this.model.actionableItems.at(0).get("text")}},validate:function(){var n=this.ui.$shortAnswer.val();return this.model.actionableItems.at(0).set({text:n,selected:!0}),this.ui.$shortAnswer.val().length>0}})}();!function(n,t){"use strict";var i=n.Interactive,f=n.Shared,r=i.Views.BaseView.extend({template:i.Templates.SummaryTimePointItem,className:"row interaction-summary-item",events:{"click .go-to-button":"goToInteraction"},viewOptions:function(){var t=i.LogService.getLogCache()[this.model.get("id")],r=this.model.actionableItems.filter(function(n){return!!n.get("selected")}),n=r.length>0&&t;return{time:i.Utils.FormatDuration(this.options.timepoint.get("visibleAt")),type:i.Utils.GetInteractionType(this.model.get("typeId")),isAnnotation:this.model.get("typeId")===4,isShortAnswer:this.model.get("typeId")===2,buttonText:this.getButtonText(n),buttonClass:this.getButtonClass(n)}},getButtonText:function(n){return i.Utils.InteractionIsReadOnly(this.model.get("typeId"))?n?"Viewed":"View":n?"Answered":"Answer"},getButtonClass:function(n){return n?"green":"grey"},goToInteraction:function(){this.service.goToTimepoint(this.options.timepoint)}}),u=i.Views.BaseListView.extend({childView:r,tagName:"div",initialize:function(){this.collection=this.model.interactions},buildChildView:function(n){var t=_.extend({},_.omit(this.options,["collection","model","id"]),{model:n,timepoint:this.model});return new this.childView(t)}});i.Views.TimepointsSummaryView=i.Views.BaseListView.extend({name:"TimepointsSummaryView",tagName:"div",childView:u,initialize:function(){this.collection=this.model.timepoints},onBeforeRender:function(){if(this.model._loaded){if(!this.collection.length)return this.$el.html("<li class='empty-interactives-overview-message'>This interactive doesn't seem to have any questions...<\/li>"),!1}else return!1;return!0}});i.Views.SummaryInteractionView=i.Views.BaseView.extend({name:"SummaryInteractionView.js",template:i.Templates.SummaryInteraction,className:"summary-interaction-view",ui:{$interactionsList:".interaction-list-viewpart"},viewOptions:function(){return{name:"Summary"}},initialize:function(){this.listenTo(this.service,"seek-ms",this.triggerClose);this.listenTo(t.Events,"seek-ms",this.triggerClose);this.listenTo(t.Events,"seek",this.triggerClose)},onRender:function(){this.renderTimepoints()},renderTimepoints:function(){var n=new i.Views.TimepointsSummaryView({model:this.model});this.renderView(this.ui.$interactionsList,n)},triggerClose:function(){t.Events.trigger("close-summary")},onRendered:function(){this.initializeScrollbar()},initializeScrollbar:function(){this._scrollBarLoaded&&this.ui.$interactionsList.mCustomScrollBar("destroy");this.ui.$interactionsList.mCustomScrollbar({axis:"y",theme:"clickview",scrollInertia:0,mouseWheel:{scrollAmount:40}});this._scrollBarLoaded=!0}})}(ClickView,EasyMoney),function(){"use strict";var n=ClickView.Interactive,t,i;i=n.Views.BaseView.extend({name:"TrueOrFalseItemView",template:n.Templates.OptionItem,className:"option-container",ui:{$optionContainer:".answer-box-container"},initialize:function(){this.listenTo(this.model,"change:selected",this.toggleAnswers)},viewOptions:function(){return{value:this.model.get("name")==="Yes"?1:0,inputId:this.hash(this.cid),inputName:this.hash(this.options.parentId)}},onRender:function(){this.renderOption()},renderOption:function(){this.options.isPreview&&(this.model.set({previewCorrect:this.model.get("selected")}),this.listenTo(this.model,"change:previewCorrect",this.togglePreviewAnswer));var n=new ClickView.Shared.Views.CheckBoxView({model:this.model,type:"radio",correct:this.options.isPreview?this.model.previewCorrect:this.model.selected,check:!1,toggleableAttribute:this.options.isPreview?"previewCorrect":"selected"});this.renderView(this.ui.$optionContainer,n)},toggleAnswers:function(){this.model.get("selected")&&this.collection.each(function(n){this.model!==n&&n.set({selected:!1})},this)},togglePreviewAnswer:function(){this.model.get("previewCorrect")&&this.collection.each(function(n){this.model!==n&&n.set({previewCorrect:!1})},this)},toggleSelected:function(){this.collection.each(function(n){n.set("selected",!1)});this.model.set("selected",!0)},hash:function(n){var t=0,i,r,u;if(n.length===0)return t;for(i=0,u=n.length;i<u;i++)r=n.charCodeAt(i),t=(t<<5)-t+r|0;return Math.abs(t)},isChecked:function(){return this.model.get("selected")}});t=EasyMoney.ListView.extend({name:"TrueOrFalseInteractionListView.js",tagName:"ul",className:"t-or-f-list",childView:i,hash:function(n){var t=0,i,r,u;if(n.length==0)return t;for(i=0,u=n.length;i<u;i++)r=n.charCodeAt(i),t=(t<<5)-t+r|0;return Math.abs(t)},buildChildView:function(n){var t=_.extend({},_.omit(this.options,["collection","model","id"]),{model:n,parentId:this.cid,collection:this.collection,isPreview:this.options.isPreview});return new this.childView(t)},validate:function(){var n=!1;return this.__private__.childViews.each(function(t){n|=t.isChecked()}),n}});n.Views.TrueOrFalseInteractionView=n.Views.BaseInteractionView.extend({name:"TrueOrFalseInteractionView.js",ui:{$questionViewpart:".options-viewpart"},template:n.Templates.TrueOrFalseInteraction,getModel:function(){return{question:this.model.get("name")}},validate:function(){var n=this.getChildByIndex("listView");return n.validate()},renderQuestions:function(){var n=new t({collection:this.model.actionableItems,isPreview:this.options.isPreview});this.renderView(this.ui.$questionViewpart,n,{childIndex:"listView"})},onRender:function(){this.renderQuestions()}})}(),function(){"use strict";var n=ClickView.Interactive;n.EventManager=function(){var t=function(){},n={};return t.prototype={getOrCreateChannel:function(t){var r=n[t],i;return r?r:(i=_.extend({},EasyMoney.Events),n[t]=i,i)},removeChannelIfExists:function(t){delete n[t]}},new t}()}();!function(n,t){"use strict";var i=n.Interactive,r=n.Shared;i.Utils=i.Utils||{};i.Utils.FormatDuration=function(n){if(!_.isNumber(n))return"";var i=new Date(n),r=i.getUTCHours(),u=i.getUTCMinutes(),f=i.getUTCSeconds();return r>0?t.template("{{h}}:{{m}}:{{s}}",{h:r,m:_.padLeft(u,2,"0"),s:_.padLeft(f,2,"0")}):t.template("{{m}}:{{s}}",{m:u,s:_.padLeft(f,2,"0")})}}(ClickView,EasyMoney),function(n){"use strict";n.Utils.Helpers={getFriendlyMimeTypes:function(n){return n.split(",").map(function(n){return n.replace("image/","")}).join(", ")}}}(ClickView.Interactive);ClickView=ClickView||{};ClickView.ImageLists=ClickView.ImageLists||{};ClickView.ImageLists.interactions=["https://static.clickview.com.au/cv-online/images/interactions/splash/play-icon.svg","https://static.clickview.com.au/cv-online/images/interactions/svg/default/play-icon-large.svg","https://static.clickview.com.au/cv-online/images/interactions/svg/hover/play-icon-large-hover.svg","https://static.clickview.com.au/cv-online/images/interactions/svg/default/pause-icon-large.svg","https://static.clickview.com.au/cv-online/images/interactions/svg/hover/pause-icon-large-hover.svg","https://static.clickview.com.au/cv-online/images/interactions/svg/default/expand.svg","https://static.clickview.com.au/cv-online/images/interactions/svg/hover/expand-hover.svg","https://static.clickview.com.au/cv-online/images/interactions/svg/default/sound-on-icon-large.svg","https://static.clickview.com.au/cv-online/images/interactions/svg/hover/sound-icon-large-hover.svg","https://static.clickview.com.au/cv-online/images/interactions/svg/default/sound-off-icon-large.svg","https://static.clickview.com.au/cv-online/images/interactions/svg/hover/sound-off-icon-large-hover.svg","https://static.clickview.com.au/cv-online/images/interactions/svg/default/cog.svg","https://static.clickview.com.au/cv-online/images/interactions/svg/hover/cog-hover.svg","https://static.clickview.com.au/cv-online/images/interactions/svg/default/small-screen-icon-default.svg","https://static.clickview.com.au/cv-online/images/interactions/svg/hover/small-screen-icon-hover.svg"],function(){"use strict";var n=ClickView.Interactive,t=n.Views,u,i,r,f,e,o,s,h,c;n.Utils=n.Utils||{};u=function(n){throw new Error("Invalid Interaction Type ID: "+n);};n.Utils.InteractionEnum={MultipleChoice:1,ShortAnswer:2,TrueOrFalse:3,Annotation:4,Image:5,MissingWord:6};i=[];i[1]=function(){return t.MultipleChoiceInteractionView};i[2]=function(){return t.ShortAnswerInteractionView};i[3]=function(){return t.TrueOrFalseInteractionView};i[4]=function(){return t.AnnotationInteractionView};i[5]=function(){return t.ImageInteractionView};i[6]=function(){return t.MissingWordInteractionView};i[7]=function(){return t.LinkInteractionView};i[8]=function(){return t.MultipleChoiceInteractionView};r=[];r[1]=function(){return t.MultipleChoiceView};r[2]=function(){return t.ShortAnswerView};r[3]=function(){return t.TrueOrFalseView};r[4]=function(){return t.AnnotationView};r[5]=function(){return t.ImageView};r[6]=function(){return t.MissingWordsView};r[7]=function(){return t.LinkView};r[8]=function(){return t.MultipleChoiceInteractionView};n.Utils.GetInteractionViewByType=function(n,t){var f=t?r[n]:i[n];return f||u(n),f()};n.Utils.InteractionHasDangerousHtml=function(t){return t===n.Utils.InteractionEnum.Annotation};n.Utils.InteractionIsReadOnly=function(t){return t===n.Utils.InteractionEnum.Annotation||t===n.Utils.InteractionEnum.Image};f=ClickView.Data.InteractionTypes;n.Utils.GetInteractionType=function(n){var t=_.findWhere(f,{id:n});return t||u(n),t};n.Utils.GetInteractionTypes=function(){return f};e=[[{order:0,isCorrect:!1}],[{name:"Answer",isCorrect:null}],[{name:"True",order:0,isCorrect:!1},{name:"False",order:1,isCorrect:!1}],[{name:"Answer"}],[{name:"Viewed",isCorrect:!0}],[]];n.Utils.GetDefaultActionableItems=function(n){var t=e[n-1];return t||u(n),t};o=[{typeId:1,name:""},{typeId:2,name:""},{typeId:3,name:""},{typeId:4,name:"Annotation",data:{annotation:""}},{typeId:5,name:""},{typeId:6,name:"Missing Word",data:{sentence:""}}];n.Utils.GetDefaultInteraction=function(t){var i=o[t-1];return i||u(t),i.type=n.Utils.GetInteractionType(t),i.actionableItems=n.Utils.GetDefaultActionableItems(t),i};s=[{name:{required:!0,msg:"A question is required"},actionableItems:function(n){var t=typeof n.toJSON=="function"?n.toJSON():n;return t.length<2?"Please create at least two alternatives":_.uniq(t,function(n){return n.name.toLowerCase()}).length!==t.length?"You have entered the same answer twice":_.any(t,function(n){return n.isCorrect})?null:"You must select at least one correct answer"}},{name:{required:!0,msg:"Please write a short answer question"}},{name:{required:!0,msg:"A question is required"},actionableItems:function(n){var t=typeof n.toJSON=="function"?n.toJSON():n;return _.any(t,function(n){return n.isCorrect})?null:"Please mark one of the answers as correct"}},{data:function(n){return n=typeof n.toJSON=="function"?n.toJSON():n,n.annotation?void 0:"Please write an annotation"}},{data:function(n){return n=typeof n.toJSON=="function"?n.toJSON():n,n.url?void 0:"Please select an image"}},{data:function(n){return(n=typeof n.toJSON=="function"?n.toJSON():n,!n.sentence)?"Please write a sentence":n.sentence.split(" ").length<2?"Please write more than one word":void 0},actionableItems:function(n){var t=typeof n.toJSON=="function"?n.toJSON():n;if(t.length<1)return"Please select one or more missing words"}},{}];n.Utils.GetValidation=function(n){var t=s[n-1];return t||u(n),_.extend({name:{required:!0}},t)};h=[{text:null},{text:null},{text:null},{text:"Additional information"},{text:"Image"},{text:"Fill in the missing word(s)"}];n.Utils.GetFixedTitle=function(n){var t=h[n-1];return t||u(n),t.text};c=[{text:"question"},{text:"question"},{text:"question"},{text:"annotation"},{text:"image"},{text:"question"},];n.Utils.GetDescriptiveNoun=function(n){var t=c[n-1];return t||u(n),t.text}}(),function(n,t,i){i.mixin({padLeft:function(n,t,i){n=n.toString();var r=t-n.length;return r<=0?n:new Array(r+1).join(i)+n}});n.registerHelper("duration",function(n,r){if(i.isNumber(n)){if(CV.Utils.HandleBarsHelper.durationisFormatted.test(n))return n;r==="s"&&(n=n*1e3);var u=new Date(n),f=u.getUTCHours(),e=u.getUTCMinutes(),o=u.getUTCSeconds();return f>0?t.template("{{h}}:{{m}}:{{s}}",{h:f,m:i.padLeft(e,2,"0"),s:i.padLeft(o,2,"0")}):t.template("{{m}}:{{s}}",{m:e,s:i.padLeft(o,2,"0")})}})}(Handlebars,EasyMoney,_);!function(n,t){"use strict";var r=n.Interactive,i=n.Shared,u=t.Events;r.Services.InteractiveService=t.Service.extend({name:"Interactive Service",_playing:!1,_analyticsEvents:null,initialize:function(n){this.model=n.model;this.options=_.extend({},this.defaults,n);this.bindListeners();this._analyticsEvents={ADD:"add",REMOVE:"remove",BACK:"back",DISCARD_UPDATE:"discard-update",DISCARD_NEW:"discard-new",UPDATE:"update",EDIT_GOTO:"edit-goto",DETAILS_GOTO:"details-goto"}},logView:function(t,r){if(r instanceof i.Models.InteractiveResource){var u={playedFrom:t};u.interactive=r.pick(["id","interactiveId","name"]);u.video=r.video.pick(["trackingCode","id","masterId","title"]);n.Shared.Utils.AnalyticsService.logInteractiveView(u)}},isEditMode:function(){return!!this.options.edit},bindListeners:function(){this.listenTo(this.model,"change:currentTime",this.onTimeUpdate);this.listenTo(t.Events,"timepoint:disableProgress",this.toggleProgressBar);this.listenTo(t.Events,"response-player-state",this.setPlayerState)},goToAfterTimepoint:function(n){this.trigger("seek-ms",n.get("visibleAt")+(n.get("visibleFor")||1e3)+1);this.model.set("currentTime",n.get("visibleAt")+(n.get("visibleFor")||1e3)+1)},goToTimepoint:function(n){this._takeControl();this.isEditMode()&&t.Events.trigger("pause");this.trigger("seek-ms",n.get("visibleAt"));this.model.set("currentTime",n.get("visibleAt"));var i=this;window.setTimeout(function(){i._releaseControl()},1e3)},promptForInteraction:function(){u.trigger("pause");this.trigger("render-interaction-selection")},getPlayerState:function(){t.Events.trigger("query-player-state")},setPlayerState:function(n){this._playing=n.state},addAndRenderInteraction:function(n,u){this.getPlayerState();t.Events.trigger("pause");u||(u={});var f=new i.Models.TimePoint({interactiveId:this.model.get("id"),visibleAt:this.model.get("currentTime"),shouldPause:1,current:!0,playerShouldResume:this._playing,interactions:[]}),e=f.interactions.add(r.Utils.GetDefaultInteraction(n));e.set({interactiveId:this.model.get("id")});this.model.timepoints.add(f);u.silent&&f.resetChanges();this.renderTimepoint(f)},addInteractionToTimepoint:function(n,t){var i=t.collection.parent,u=i.interactions.add(r.Utils.GetDefaultInteraction(n));return u.set({interactiveId:this.model.get("id")}),this.model.timepoints.add(i),u},getCurrentTimepoint:function(){return this.model.timepoints.find(function(n){return n.isCurrent()})},isEmpty:function(){var n=this;return this.model.timepoints.all(function(t){return!t.get("id")&&!t.hasChanges()?(n.removeTimepoint(t,{prompt:!1}),!0):!t.get("interactions").length})},onTimeUpdate:function(n,t){for(var i,u,f,r=0;r<this.model.timepoints.length;r++)if(i=this.model.timepoints.at(r),i.interactions&&i.interactions.length){if(u=i.getDisplayTime(),f=u+i.getDisplayDuration(),i.isCurrent()&&(t<u||t>f)&&i.setCurrent(!1),i.isCurrent())return;if(t>=u&&t<f){this.model.timepoints.clearCurrent();i.setCurrent(!0);this.renderTimepoint(i);return}}this.trigger("no-timepoint")},renderTimepoint:function(n){n&&n.interactions&&n.interactions.length&&this.trigger("render-timepoint",n)},removeTimepoint:function(n){n.resetChanges();n.setCurrent(!1);n.destroy();this.trigger("no-timepoint")},revertTimepoint:function(t,i){i||(i={render:!0,analyticsEvent:this._analyticsEvents.DISCARD_UPDATE});n.Shared.Utils.AnalyticsService.logInteractiveInteractionAction(i.analyticsEvent,t);t.revert();t.interactions.each(function(n){n.revert()},this);t.resetChanges();i.render&&this.renderTimepoint(t)},removeInteraction:function(t,i){i||(i={prompt:!0,analyticsEvent:this._analyticsEvents.REMOVE});var u=this,r=function(){n.Shared.Utils.AnalyticsService.logInteractiveInteractionAction(i.analyticsEvent,t);var r=t.collection.parent;t.destroy();r.interactions.length||u.removeTimepoint(r)};if(!i.prompt){r();return}n.Utils.Dialog({title:"Delete question",content:"<p>Are you sure you want to delete this question?<\/p>",buttons:[{text:"Cancel",className:"btn"},{text:"Delete",className:"btn red",success:!0}]}).then(r)},revertInteraction:function(n,t){var i,r;t||(t={render:!0});i=n.collection.parent;n.revert();r=!0;i.interactions.each(function(n){r=r&&!n.hasChanges()});r?this.revertTimepoint(i,t):t.render&&this.renderTimepoint(i)},save:function(n){var t;if(n instanceof i.Models.Interactive)t=this.saveInteractive;else if(n instanceof i.Models.TimePoint)t=this.saveTimepoint;else if(n instanceof i.Models.Interaction)t=this.saveInteraction;else return $.Deferred().reject();return t(n)},saveInteractive:function(){},saveTimepoint:function(n){var i,t=$.Deferred(),r=[];return n.removeEmptyAlternatives(),n.save(null,{silent:!0}).success(function(){n.interactions.each(function(t){t.set({timepointId:n.get("id")},{silent:!0});r.push(t.save(null,{silent:!0}).error(function(){i=!0}))})}).error(function(){t.reject()}).always(function(){$.when.apply(this,r).then(function(){i?t.reject():t.resolve()})}),t},saveInteraction:function(){},isValid:function(n){var t;if(n instanceof i.Models.Interactive)t=this.validateInteractive;else if(n instanceof i.Models.TimePoint)t=this.validateTimepoint;else if(n instanceof i.Models.Interaction)t=this.valiateInteraction;else return!0;return t(n)},validateTimepoint:function(n){var t=!0;return n.interactions.each(function(n){n.validate();t&=n.isValid()}),t},valiateInteraction:function(n){return n.validate(),n.isValid()},shouldPrompt:function(n){return this.isEditMode()?(n||(n=this.getCurrentTimepoint()),n&&n.hasChanges()):!1},promptUnlock:function(t,i){var u=this,r=u.getCurrentTimepoint();if(!this.isEditMode()||!r||!r.hasChanges())return t();i=_.extend({},{save:function(){u.isValid(r)&&u.save(r).then(function(){n.Shared.Utils.AnalyticsService.logInteractiveInteractionAction(u._analyticsEvents.UPDATE,r);i.after(r)})},undo:function(){r.has("id")?u.revertTimepoint(r,{render:!1,analyticsEvent:u._analyticsEvents.DISCARD_UPDATE}):u.removeInteraction(r.interactions.at(0),{prompt:!1,analyticsEvent:u._analyticsEvents.DISCARD_NEW});i.after()},after:function(){t()}},i);n.Utils.Dialog({title:"Unsaved changes",content:"<p>Do you want to save your changes?<\/p>",buttons:[{text:"Cancel",className:"btn"},{text:"Discard changes",className:"btn",callback:i.undo},{text:"Save changes",className:"btn primary",callback:i.save}]})},getImagesFromInteractive:function(){var n=[];return this.model.timepoints.each(function(t){t.interactions.each(function(t){if(t.get("typeId")===r.Utils.InteractionEnum.Image){var u=i.Helpers.getThumbnailUrl(t.data.get("url"));u&&n.push(u)}})}),n},getNextTimepoint:function(n){return this.model.getNextTimepoint(n)},getPreviousTimepoint:function(n){return this.model.getPreviousTimepoint(n)},sortTimepoints:function(){this.model.timepoints.sort()},toggleProgressBar:function(n){this.model.set("disableProgressBar",n)},hasControl:function(){return this._hasControl},_takeControl:function(){this._hasControl=!0},_releaseControl:function(){this._hasControl=!1}})}(ClickView,EasyMoney),function(){"use strict";var n=ClickView.Interactive;n.Services.Logger=EasyMoney.Service.extend({hub:null,resultId:null,_isReady:!1,_logCache:{},initialize:function(){this._logCache={}},start:function(n){this.resultId=n;this.initConnection()},isReady:function(){return this._isReady&&_.isNumber(this.resultId)&&this.resultId},initConnection:function(){this.hub=$.connection.resultsHub;this._connect();var n=this;$.connection.hub.disconnected(function(){n._isReady=!1;n._log("Disconnected from result hub");n._tryReconnect()})},_log:function(n){window.console&&window.console.log(n)},_tryReconnect:function(){var n=this;setTimeout(function(){n._connect()},5e3)},_connect:function(){var n=this;$.connection.hub.start().done(function(){n._log("Connected to result hub");n._isReady=!0;n._save()}).fail(function(){n._log("Failed to connect to result hub");n._isReady=!1;n._tryReconnect()})},log:function(n,t){this._logCache[n]={actions:t,saved:!1,timestamp:(new Date).getTime()};this._save()},getLogCache:function(){return this._logCache},_save:function(){var t=this,n;this.isReady()&&(_.isEmpty(this._logCache)||(n={},_.each(this._logCache,function(t,i){t.saved||(n[i]=t.actions)},this),this.hub.server.saveActions(this.resultId,n).done(function(){_.each(n,function(n,i){t._logCache[i].saved=!0})}).fail(function(n){console.log("Failed to save results",n)})))}})}(),function(n){"use strict";var i=ClickView.Interactive,t=n.Events,r=n.Service.extend({_lastSessionId:0,_sessions:{},_modifiedSessions:{},startNewSession:function(n){var t=++this._lastSessionId;return this._sessions[t]={sessionId:t,start:n,end:0,timestamp:(new Date).getTime()},t},updateSession:function(n,t){if(_.isNumber(n)){var i=this._sessions[n];if(i){if(!_.isNumber(i.start)){i.start=t;return}t!==i.start&&t!==i.end&&(i.end=t,this._markModified(n))}}},getModifiedSessions:function(){var n=_.keys(this._modifiedSessions),t=_.map(n,function(n){return this._sessions[n]},this);return this._modifiedSessions={},t},_markModified:function(n){this._modifiedSessions[n]=!0}});i.Services.ProgressReporter=n.Service.extend({model:null,hub:null,_isReady:!1,_currentSessionId:null,_resultId:null,_poller:null,defaults:{isMobile:!1},initialize:function(n,t){this.model=n;this.sessionManager=new r;this.options=_.extend({},this.defaults,t)},start:function(n){this._resultId=n;this.initConnection();this.listenTo(this.model,"change:currentTime",this.onTimeUpdate);this.listenTo(t,"player-play",this.onPlay);this.listenTo(t,"player-pause",this.onPause);this.listenTo(t,"player-ended",this.onEnded);this.listenTo(t,"seekstart",this.onSeekStart);this.startPolling();this.options.isMobile&&this.startNewSession(0)},startPolling:function(){clearInterval(this._poller);this._poller=setInterval(_.bind(this.pushProgress,this),2500)},initConnection:function(){this.hub=$.connection.playProgressHub;this._connect();var n=this;$.connection.hub.disconnected(function(){n._isReady=!1;n._log("Disconnected from progress hub");n._tryReconnect()})},_log:function(n){window.console&&window.console.log(n)},_tryReconnect:function(){var n=this;setTimeout(function(){n._connect()},5e3)},_connect:function(){var n=this;$.connection.hub.start().done(function(){n._log("Connected to progress hub");n._isReady=!0}).fail(function(){n._log("Failed to connect to progress hub");n._isReady=!1;n._tryReconnect()})},onTimeUpdate:function(){this.updateSession(this.model.get("currentTime"))},onPlay:function(){this.startNewSession()},onPause:function(){this.endSession()},onEnded:function(){this.pushProgress()},onSeekStart:function(){this.endSession()},startNewSession:function(n){this._currentSessionId===null&&(this._currentSessionId=this.sessionManager.startNewSession(n))},endSession:function(){this._currentSessionId!==null&&(this.updateSession(this.model.get("currentTime")),this._currentSessionId=null)},updateSession:function(n){this.sessionManager.updateSession(this._currentSessionId,n)},isReady:function(){return this._isReady&&this._resultId},getModifiedSessions:function(){return this.sessionManager.getModifiedSessions()},pushProgress:function(){var n,t,i;this.isReady()&&(n=this.getModifiedSessions(),_.isArray(n)&&n.length!==0)&&(t=this,i=function(){_.each(n,function(n){t.sessionManager._markModified(n.sessionId)})},this.hub.server.reportProgress(this._resultId,n).fail(i))}})}(EasyMoney);!function(n,t){var i=function(){var n={};return t.apply(n,arguments),n.moxie};"function"==typeof define&&define.amd?define("moxie",[],i):"object"==typeof module&&module.exports?module.exports=i():n.moxie=i()}(this||window,function(){!function(n,t){"use strict";function f(n,t){for(var r,f=[],i=0;i<n.length;++i){if(r=u[n[i]]||e(n[i]),!r)throw"module definition dependecy not found: "+n[i];f.push(r)}t.apply(null,f)}function i(n,i,r){if("string"!=typeof n)throw"invalid module definition, module id must be defined and be a string";if(i===t)throw"invalid module definition, dependencies must be specified";if(r===t)throw"invalid module definition, definition function must be specified";f(i,function(){u[n]=r.apply(null,arguments)})}function r(n){return!!u[n]}function e(t){for(var i=n,u=t.split(/[.\/]/),r=0;r<u.length;++r){if(!i[u[r]])return;i=i[u[r]]}return i}function o(i){for(var o=0;o<i.length;o++){for(var f=n,s=i[o],r=s.split(/[.\/]/),e=0;e<r.length-1;++e)f[r[e]]===t&&(f[r[e]]={}),f=f[r[e]];f[r[r.length-1]]=u[s]}}var u={};i("moxie/core/utils/Basic",[],function(){function n(n){var t;return n===t?"undefined":null===n?"null":n.nodeType?"node":{}.toString.call(n).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()}function u(){return t(!1,!1,arguments)}function f(){return t(!0,!1,arguments)}function e(){return t(!1,!0,arguments)}function o(){return t(!0,!0,arguments)}function s(i){switch(n(i)){case"array":return t(!1,!0,[[],i]);case"object":return t(!1,!0,[{},i]);default:return i}}function h(t){switch(n(t)){case"array":return Array.prototype.slice.call(t);case"object":return u({},t)}return t}function t(u,f,e){var s,o=e[0];return i(e,function(e,c){c>0&&i(e,function(i,e){var c=-1!==r(n(i),["array","object"]);return i===s||u&&o[e]===s?!0:(c&&f&&(i=h(i)),n(o[e])===n(i)&&c?t(u,f,[o[e],i]):o[e]=i,void 0)})}),o}function c(n,t){function r(){this.constructor=n}for(var i in t)({}).hasOwnProperty.call(t,i)&&(n[i]=t[i]);return r.prototype=t.prototype,n.prototype=new r,n.super=t.prototype,n}function i(n,t){var i,u,r,f;if(n){try{i=n.length}catch(e){i=f}if(i===f||"number"!=typeof i){for(u in n)if(n.hasOwnProperty(u)&&t(n[u],u)===!1)return}else for(r=0;i>r;r++)if(t(n[r],r)===!1)return}}function l(t){var i;if(!t||"object"!==n(t))return!0;for(i in t)return!1;return!0}function a(t,i){function r(f){"function"===n(t[f])&&t[f](function(n){++f<u&&!n?r(f):i(n)})}var u=t.length;"function"!==n(i)&&(i=function(){});t&&t.length||i();r(0)}function v(n,t){var u=0,f=n.length,r=new Array(f);i(n,function(n,i){n(function(n){if(n)return t(n);var e=[].slice.call(arguments);e.shift();r[i]=e;u++;u===f&&(r.unshift(null),t.apply(this,r))})})}function r(n,t){if(t){if(Array.prototype.indexOf)return Array.prototype.indexOf.call(t,n);for(var i=0,r=t.length;r>i;i++)if(t[i]===n)return i}return-1}function y(t,i){var u=[],f;"array"!==n(t)&&(t=[t]);"array"!==n(i)&&(i=[i]);for(f in t)-1===r(t[f],i)&&u.push(t[f]);return u.length?u:!1}function p(n,t){var u=[];return i(n,function(n){-1!==r(n,t)&&u.push(n)}),u.length?u:null}function w(n){for(var i=[],t=0;t<n.length;t++)i[t]=n[t];return i}function b(n){return n?String.prototype.trim?String.prototype.trim.call(n):n.toString().replace(/^\s*/,"").replace(/\s*$/,""):n}function k(n){if("string"!=typeof n)return n;var t,i={t:1099511627776,g:1073741824,m:1048576,k:1024};return n=/^([0-9\.]+)([tmgk]?)$/.exec(n.toLowerCase().replace(/[^0-9\.tmkg]/g,"")),t=n[2],n=+n[1],i.hasOwnProperty(t)&&(n*=i[t]),Math.floor(n)}function d(n){var t=[].slice.call(arguments,1);return n.replace(/%([a-z])/g,function(n,i){var r=t.shift();switch(i){case"s":return r+"";case"d":return parseInt(r,10);case"f":return parseFloat(r);case"c":return"";default:return r}})}function g(n,t){var i=this;setTimeout(function(){n.call(i)},t||1)}var nt=function(){var n=0;return function(t){for(var r=(new Date).getTime().toString(32),i=0;5>i;i++)r+=Math.floor(65535*Math.random()).toString(32);return(t||"o_")+r+(n++).toString(32)}}();return{guid:nt,typeOf:n,extend:u,extendIf:f,extendImmutable:e,extendImmutableIf:o,clone:s,inherit:c,each:i,isEmptyObj:l,inSeries:a,inParallel:v,inArray:r,arrayDiff:y,arrayIntersect:p,toArray:w,trim:b,sprintf:d,parseSizeStr:k,delay:g}});i("moxie/core/utils/Encode",[],function(){var t=function(n){return unescape(encodeURIComponent(n))},n=function(n){return decodeURIComponent(escape(n))},i=function(t,i){if("function"==typeof atob)return i?n(window.atob(t)):window.atob(t);var u,o,l,a,v,s,h,f,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r=0,p=0,c="",y=[];if(!t)return t;t+="";do a=e.indexOf(t.charAt(r++)),v=e.indexOf(t.charAt(r++)),s=e.indexOf(t.charAt(r++)),h=e.indexOf(t.charAt(r++)),f=a<<18|v<<12|s<<6|h,u=255&f>>16,o=255&f>>8,l=255&f,y[p++]=64==s?String.fromCharCode(u):64==h?String.fromCharCode(u,o):String.fromCharCode(u,o,l);while(r<t.length);return c=y.join(""),i?n(c):c},r=function(n,i){var e;if(i&&(n=t(n)),"function"==typeof btoa)return window.btoa(n);var s,h,c,l,a,v,y,r,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",f=0,w=0,o="",p=[];if(!n)return n;do s=n.charCodeAt(f++),h=n.charCodeAt(f++),c=n.charCodeAt(f++),r=s<<16|h<<8|c,l=63&r>>18,a=63&r>>12,v=63&r>>6,y=63&r,p[w++]=u.charAt(l)+u.charAt(a)+u.charAt(v)+u.charAt(y);while(f<n.length);return o=p.join(""),e=n.length%3,(e?o.slice(0,e-3):o)+"===".slice(e||3)};return{utf8_encode:t,utf8_decode:n,atob:i,btoa:r}});i("moxie/core/utils/Env",["moxie/core/utils/Basic"],function(n){function f(n,t,i){var r=0,f=0,u=0,s={dev:-6,alpha:-5,a:-5,beta:-4,b:-4,RC:-3,rc:-3,"#":-2,p:1,pl:1},e=function(n){return n=(""+n).replace(/[_\-+]/g,"."),n=n.replace(/([^.\d]+)/g,".$1.").replace(/\.{2,}/g,"."),n.length?n.split("."):[-8]},o=function(n){return n?isNaN(n)?s[n]||-7:parseInt(n,10):0};for(n=e(n),t=e(t),f=Math.max(n.length,t.length),r=0;f>r;r++)if(n[r]!=t[r]){if(n[r]=o(n[r]),t[r]=o(t[r]),n[r]<t[r]){u=-1;break}if(n[r]>t[r]){u=1;break}}if(!i)return u;switch(i){case">":case"gt":return u>0;case">=":case"ge":return u>=0;case"<=":case"le":return 0>=u;case"==":case"=":case"eq":return 0===u;case"<>":case"!=":case"ne":return 0!==u;case"":case"<":case"lt":return 0>u;default:return null}}var u=function(n){var c="",o="?",s="function",l="undefined",u="object",t="name",i="version",h={has:function(n,t){return-1!==t.toLowerCase().indexOf(n.toLowerCase())},lowerize:function(n){return n.toLowerCase()}},r={rgx:function(){for(var r,h,y,f,t,a,i,v,o,e=0,c=arguments;e<c.length;e+=2){if(v=c[e],o=c[e+1],typeof r===l){r={};for(f in o)t=o[f],typeof t===u?r[t[0]]=n:r[t]=n}for(h=y=0;h<v.length;h++)if(a=v[h].exec(this.getUA())){for(f=0;f<o.length;f++)i=a[++y],t=o[f],typeof t===u&&t.length>0?2==t.length?r[t[0]]=typeof t[1]==s?t[1].call(this,i):t[1]:3==t.length?r[t[0]]=typeof t[1]!==s||t[1].exec&&t[1].test?i?i.replace(t[1],t[2]):n:i?t[1].call(this,i,t[2]):n:4==t.length&&(r[t[0]]=i?t[3].call(this,i.replace(t[1],t[2])):n):r[t]=i?i:n;break}if(a)break}return r},str:function(t,i){var r,f;for(r in i)if(typeof i[r]===u&&i[r].length>0){for(f=0;f<i[r].length;f++)if(h.has(i[r][f],t))return r===o?n:r}else if(h.has(i[r],t))return r===o?n:r;return t}},f={browser:{oldsafari:{major:{1:["/8","/1","/3"],2:"/4","?":"/"},version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",RT:"ARM"}}}},e={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[t,i],[/\s(opr)\/([\w\.]+)/i],[[t,"Opera"],i],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]+)*/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]+)*/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi)\/([\w\.-]+)/i],[t,i],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[t,"IE"],i],[/(edge)\/((\d+)?[\w\.]+)/i],[t,i],[/(yabrowser)\/([\w\.]+)/i],[[t,"Yandex"],i],[/(comodo_dragon)\/([\w\.]+)/i],[[t,/_/g," "],i],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i,/(uc\s?browser|qqbrowser)[\/\s]?([\w\.]+)/i],[t,i],[/(dolfin)\/([\w\.]+)/i],[[t,"Dolphin"],i],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[t,"Chrome"],i],[/XiaoMi\/MiuiBrowser\/([\w\.]+)/i],[i,[t,"MIUI Browser"]],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)/i],[i,[t,"Android Browser"]],[/FBAV\/([\w\.]+);/i],[i,[t,"Facebook"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[i,[t,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[i,t],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[t,[i,r.str,f.browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[t,i],[/(navigator|netscape)\/([\w\.-]+)/i],[[t,"Netscape"],i],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/([\w\.-]+)/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]+)*/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[t,i]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[i,[t,"EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[t,i],[/rv\:([\w\.]+).*(gecko)/i],[i,t]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[t,i],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[t,[i,r.str,f.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[t,"Windows"],[i,r.str,f.os.windows.version]],[/\((bb)(10);/i],[[t,"BlackBerry"],i],[/(blackberry)\w*\/?([\w\.]+)*/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i,/linux;.+(sailfish);/i],[t,i],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],[[t,"Symbian"],i],[/\((series40);/i],[t],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[t,"Firefox OS"],i],[/(nintendo|playstation)\s([wids3portablevu]+)/i,/(mint)[\/\s\(]?(\w+)*/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?([\w\.-]+)*/i,/(hurd|linux)\s?([\w\.]+)*/i,/(gnu)\s?([\w\.]+)*/i],[t,i],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[t,"Chromium OS"],i],[/(sunos)\s?([\w\.]+\d)*/i],[[t,"Solaris"],i],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],[t,i],[/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],[[t,"iOS"],[i,/_/g,"."]],[/(mac\sos\sx)\s?([\w\s\.]+\w)*/i,/(macintosh|mac(?=_powerpc)\s)/i],[[t,"Mac OS"],[i,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]+)*/i,/(haiku)\s(\w+)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,/(unix)\s?([\w\.]+)*/i],[t,i]]};return function(n){var t=n||(window&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:c);this.getBrowser=function(){return r.rgx.apply(this,e.browser)};this.getEngine=function(){return r.rgx.apply(this,e.engine)};this.getOS=function(){return r.rgx.apply(this,e.os)};this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS()}};this.getUA=function(){return t};this.setUA=function(n){return t=n,this};this.setUA(t)}}(),e=function(){var r={access_global_ns:function(){return!!window.moxie},define_property:function(){return!1}(),create_canvas:function(){var n=document.createElement("canvas"),t=!(!n.getContext||!n.getContext("2d"));return r.create_canvas=t,t},return_response_type:function(t){try{if(-1!==n.inArray(t,["","text","document"]))return!0;if(window.XMLHttpRequest){var i=new XMLHttpRequest;if(i.open("get","/"),"responseType"in i)return i.responseType=t,i.responseType!==t?!1:!0}}catch(r){}return!1},use_blob_uri:function(){var n=window.URL;return n&&"createObjectURL"in n&&"revokeObjectURL"in n}(),use_data_uri:function(){var n=new Image;return n.onload=function(){r.use_data_uri=1===n.width&&1===n.height},setTimeout(function(){n.src="data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="},1),!1}(),use_data_uri_over32kb:function(){return r.use_data_uri&&("IE"!==i.browser||i.version>=9)},use_data_uri_of:function(n){return r.use_data_uri&&33e3>n||r.use_data_uri_over32kb()},use_fileinput:function(){if(navigator.userAgent.match(/(Android (1.0|1.1|1.5|1.6|2.0|2.1))|(Windows Phone (OS 7|8.0))|(XBLWP)|(ZuneWP)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1.0|2.0|2.5|3.0))/))return!1;var n=document.createElement("input");return n.setAttribute("type","file"),r.use_fileinput=!n.disabled},use_webgl:function(){var i,u=document.createElement("canvas"),n=null;try{n=u.getContext("webgl")||u.getContext("experimental-webgl")}catch(f){}return n||(n=null),i=!!n,r.use_webgl=i,u=t,i}};return function(t){var i=[].slice.call(arguments);return i.shift(),"function"===n.typeOf(r[t])?r[t].apply(this,i):!!r[t]}}(),r=(new u).getResult(),i={can:e,uaParser:u,browser:r.browser.name,version:r.browser.version,os:r.os.name,osVersion:r.os.version,verComp:f,swf_url:"../flash/Moxie.swf",xap_url:"../silverlight/Moxie.xap",global_event_dispatcher:"moxie.core.EventTarget.instance.dispatchEvent"};return i.OS=i.os,i});i("moxie/core/Exceptions",["moxie/core/utils/Basic"],function(n){function t(n,t){for(var i in n)if(n[i]===t)return i;return null}return{RuntimeError:function(){function i(n,i){this.code=n;this.name=t(r,n);this.message=this.name+(i||": RuntimeError "+this.code)}var r={NOT_INIT_ERR:1,EXCEPTION_ERR:3,NOT_SUPPORTED_ERR:9,JS_ERR:4};return n.extend(i,r),i.prototype=Error.prototype,i}(),OperationNotAllowedException:function(){function t(n){this.code=n;this.name="OperationNotAllowedException"}return n.extend(t,{NOT_ALLOWED_ERR:1}),t.prototype=Error.prototype,t}(),ImageError:function(){function i(n){this.code=n;this.name=t(r,n);this.message=this.name+": ImageError "+this.code}var r={WRONG_FORMAT:1,MAX_RESOLUTION_ERR:2,INVALID_META_ERR:3};return n.extend(i,r),i.prototype=Error.prototype,i}(),FileException:function(){function i(n){this.code=n;this.name=t(r,n);this.message=this.name+": FileException "+this.code}var r={NOT_FOUND_ERR:1,SECURITY_ERR:2,ABORT_ERR:3,NOT_READABLE_ERR:4,ENCODING_ERR:5,NO_MODIFICATION_ALLOWED_ERR:6,INVALID_STATE_ERR:7,SYNTAX_ERR:8};return n.extend(i,r),i.prototype=Error.prototype,i}(),DOMException:function(){function i(n){this.code=n;this.name=t(r,n);this.message=this.name+": DOMException "+this.code}var r={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25};return n.extend(i,r),i.prototype=Error.prototype,i}(),EventException:function(){function t(n){this.code=n;this.name="EventException"}return n.extend(t,{UNSPECIFIED_EVENT_TYPE_ERR:0}),t.prototype=Error.prototype,t}()}});i("moxie/core/utils/Dom",["moxie/core/utils/Env"],function(n){var i=function(n){return"string"!=typeof n?n:document.getElementById(n)},t=function(n,t){if(!n.className)return!1;var i=new RegExp("(^|\\s+)"+t+"(\\s+|$)");return i.test(n.className)},r=function(n,i){t(n,i)||(n.className=n.className?n.className.replace(/\s+$/,"")+" "+i:i)},u=function(n,t){if(n.className){var i=new RegExp("(^|\\s+)"+t+"(\\s+|$)");n.className=n.className.replace(i,function(n,t,i){return" "===t&&" "===i?" ":""})}},f=function(n,t){return n.currentStyle?n.currentStyle[t]:window.getComputedStyle?window.getComputedStyle(n,null)[t]:void 0},e=function(t,i){function h(n){var t,i,r=0,f=0;return n&&(i=n.getBoundingClientRect(),t="CSS1Compat"===u.compatMode?u.documentElement:u.body,r=i.left+t.scrollLeft,f=i.top+t.scrollTop),{x:r,y:f}}var r,f,e,o=0,s=0,u=document;if(t=t,i=i||u.body,t&&t.getBoundingClientRect&&"IE"===n.browser&&(!u.documentMode||u.documentMode<8))return f=h(t),e=h(i),{x:f.x-e.x,y:f.y-e.y};for(r=t;r&&r!=i&&r.nodeType;)o+=r.offsetLeft||0,s+=r.offsetTop||0,r=r.offsetParent;for(r=t.parentNode;r&&r!=i&&r.nodeType;)o-=r.scrollLeft||0,s-=r.scrollTop||0,r=r.parentNode;return{x:o,y:s}},o=function(n){return{w:n.offsetWidth||n.clientWidth,h:n.offsetHeight||n.clientHeight}};return{get:i,hasClass:t,addClass:r,removeClass:u,getStyle:f,getPos:e,getSize:o}});i("moxie/core/EventTarget",["moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Basic"],function(n,t,i){function u(){this.uid=i.guid()}var r={};return i.extend(u.prototype,{init:function(){this.uid||(this.uid=i.guid("uid_"))},addEventListener:function(n,t,u,f){var e,o=this;return this.hasOwnProperty("uid")||(this.uid=i.guid("uid_")),n=i.trim(n),/\s/.test(n)?(i.each(n.split(/\s+/),function(n){o.addEventListener(n,t,u,f)}),void 0):(n=n.toLowerCase(),u=parseInt(u,10)||0,e=r[this.uid]&&r[this.uid][n]||[],e.push({fn:t,priority:u,scope:f||this}),r[this.uid]||(r[this.uid]={}),r[this.uid][n]=e,void 0)},hasEventListener:function(n){var t;return n?(n=n.toLowerCase(),t=r[this.uid]&&r[this.uid][n]):t=r[this.uid],t?t:!1},removeEventListener:function(n,t){var u,f,e=this;if(n=n.toLowerCase(),/\s/.test(n))return i.each(n.split(/\s+/),function(n){e.removeEventListener(n,t)}),void 0;if(u=r[this.uid]&&r[this.uid][n]){if(t){for(f=u.length-1;f>=0;f--)if(u[f].fn===t){u.splice(f,1);break}}else u=[];u.length||(delete r[this.uid][n],i.isEmptyObj(r[this.uid])&&delete r[this.uid])}},removeAllEventListeners:function(){r[this.uid]&&delete r[this.uid]},dispatchEvent:function(n){var s,h,f,u,c,e={},l=!0,o;if("string"!==i.typeOf(n)){if(u=n,"string"!==i.typeOf(u.type))throw new t.EventException(t.EventException.UNSPECIFIED_EVENT_TYPE_ERR);n=u.type;u.total!==c&&u.loaded!==c&&(e.total=u.total,e.loaded=u.loaded);e.async=u.async||!1}return(-1!==n.indexOf("::")?function(t){s=t[0];n=t[1]}(n.split("::")):s=this.uid,n=n.toLowerCase(),h=r[s]&&r[s][n])&&(h.sort(function(n,t){return t.priority-n.priority}),f=[].slice.call(arguments),f.shift(),e.type=n,f.unshift(e),o=[],i.each(h,function(n){f[0].target=n.scope;e.async?o.push(function(t){setTimeout(function(){t(n.fn.apply(n.scope,f)===!1)},1)}):o.push(function(t){t(n.fn.apply(n.scope,f)===!1)})}),o.length&&i.inSeries(o,function(n){l=!n})),l},bindOnce:function(n,t,i,r){var u=this;u.bind.call(this,n,function f(){return u.unbind(n,f),t.apply(this,arguments)},i,r)},bind:function(){this.addEventListener.apply(this,arguments)},unbind:function(){this.removeEventListener.apply(this,arguments)},unbindAll:function(){this.removeAllEventListeners.apply(this,arguments)},trigger:function(){return this.dispatchEvent.apply(this,arguments)},handleEventProps:function(n){var t=this;this.bind(n.join(" "),function(n){var t="on"+n.type.toLowerCase();"function"===i.typeOf(this[t])&&this[t].apply(this,arguments)});i.each(n,function(n){n="on"+n.toLowerCase(n);"undefined"===i.typeOf(t[n])&&(t[n]=null)})}}),u.instance=new u,u});i("moxie/runtime/Runtime",["moxie/core/utils/Env","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/EventTarget"],function(n,t,i,r){function u(n,r,e,o,s){var h,c=this,l=t.guid(r+"_"),a=s||"browser";n=n||{};f[l]=this;e=t.extend({access_binary:!1,access_image_binary:!1,display_media:!1,do_cors:!1,drag_and_drop:!1,filter_by_extension:!0,resize_image:!1,report_upload_progress:!1,return_response_headers:!1,return_response_type:!1,return_status_code:!0,send_custom_headers:!1,select_file:!1,select_folder:!1,select_multiple:!0,send_binary_string:!1,send_browser_cookies:!0,send_multipart:!0,slice_blob:!1,stream_upload:!1,summon_file_dialog:!1,upload_filesize:!0,use_http_method:!0},e);n.preferred_caps&&(a=u.getMode(o,n.preferred_caps,a));h=function(){var n={};return{exec:function(t,i,r,u){if(h[i]&&(n[t]||(n[t]={context:this,instance:new h[i]}),n[t].instance[r]))return n[t].instance[r].apply(this,u)},removeInstance:function(t){delete n[t]},removeAllInstances:function(){var i=this;t.each(n,function(n,r){"function"===t.typeOf(n.instance.destroy)&&n.instance.destroy.call(n.context);i.removeInstance(r)})}}}();t.extend(this,{initialized:!1,uid:l,type:r,mode:u.getMode(o,n.required_caps,a),shimid:l+"_container",clients:0,options:n,can:function(n,i){var r=arguments[2]||e,f;if("string"===t.typeOf(n)&&"undefined"===t.typeOf(i)&&(n=u.parseCaps(n)),"object"===t.typeOf(n)){for(f in n)if(!this.can(f,n[f],r))return!1;return!0}return"function"===t.typeOf(r[n])?r[n].call(this,i):i===r[n]},getShimContainer:function(){var r,n=i.get(this.shimid);return n||(r=i.get(this.options.container)||document.body,n=document.createElement("div"),n.id=this.shimid,n.className="moxie-shim moxie-shim-"+this.type,t.extend(n.style,{position:"absolute",top:"0px",left:"0px",width:"1px",height:"1px",overflow:"hidden"}),r.appendChild(n),r=null),n},getShim:function(){return h},shimExec:function(n,t){var i=[].slice.call(arguments,2);return c.getShim().exec.call(this,this.uid,n,t,i)},exec:function(n,t){var i=[].slice.call(arguments,2);return c[n]&&c[n][t]?c[n][t].apply(this,i):c.shimExec.apply(this,arguments)},destroy:function(){if(c){var n=i.get(this.shimid);n&&n.parentNode.removeChild(n);h&&h.removeAllInstances();this.unbindAll();delete f[this.uid];this.uid=null;l=c=h=n=null}}});this.mode&&n.required_caps&&!this.can(n.required_caps)&&(this.mode=!1)}var e={},f={};return u.order="html5,flash,silverlight,html4",u.getRuntime=function(n){return f[n]?f[n]:!1},u.addConstructor=function(n,t){t.prototype=r.instance;e[n]=t},u.getConstructor=function(n){return e[n]||null},u.getInfo=function(n){var t=u.getRuntime(n);return t?{uid:t.uid,type:t.type,mode:t.mode,can:function(){return t.can.apply(t,arguments)}}:null},u.parseCaps=function(n){var i={};return"string"!==t.typeOf(n)?n||{}:(t.each(n.split(","),function(n){i[n]=!0}),i)},u.can=function(n,t){var i,r,f=u.getConstructor(n);return f?(i=new f({required_caps:t}),r=i.mode,i.destroy(),!!r):!1},u.thatCan=function(n,t){var i=(t||u.order).split(/\s*,\s*/);for(var r in i)if(u.can(i[r],n))return i[r];return null},u.getMode=function(n,i,r){var u=null;if("undefined"===t.typeOf(r)&&(r="browser"),i&&!t.isEmptyObj(n)){if(t.each(i,function(i,r){if(n.hasOwnProperty(r)){var f=n[r](i);if("string"==typeof f&&(f=[f]),u){if(!(u=t.arrayIntersect(u,f)))return u=!1}else u=f}}),u)return-1!==t.inArray(r,u)?r:u[0];if(u===!1)return!1}return r},u.getGlobalEventTarget=function(){if(/^moxie\./.test(n.global_event_dispatcher)&&!n.can("access_global_ns")){var i=t.guid("moxie_event_target_");window[i]=function(n,t){r.instance.dispatchEvent(n,t)};n.global_event_dispatcher=i}return n.global_event_dispatcher},u.capTrue=function(){return!0},u.capFalse=function(){return!1},u.capTest=function(n){return function(){return!!n}},u});i("moxie/runtime/RuntimeClient",["moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/Runtime"],function(n,t,i,r){return function(){var n;i.extend(this,{connectRuntime:function(u){function o(i){var f,s;return i.length?(f=i.shift().toLowerCase(),(s=r.getConstructor(f))?(n=new s(u),n.bind("Init",function(){n.initialized=!0;setTimeout(function(){n.clients++;e.ruid=n.uid;e.trigger("RuntimeInit",n)},1)}),n.bind("Error",function(){n.destroy();o(i)}),n.bind("Exception",function(n,i){var r=i.name+"(#"+i.code+")"+(i.message?", from: "+i.message:"");e.trigger("RuntimeError",new t.RuntimeError(t.RuntimeError.EXCEPTION_ERR,r))}),n.mode?(n.init(),void 0):(n.trigger("Error"),void 0)):(o(i),void 0)):(e.trigger("RuntimeError",new t.RuntimeError(t.RuntimeError.NOT_INIT_ERR)),n=null,void 0)}var f,e=this;if("string"===i.typeOf(u)?f=u:"string"===i.typeOf(u.ruid)&&(f=u.ruid),f){if(n=r.getRuntime(f))return e.ruid=f,n.clients++,n;throw new t.RuntimeError(t.RuntimeError.NOT_INIT_ERR);}o((u.runtime_order||r.order).split(/\s*,\s*/))},disconnectRuntime:function(){n&&--n.clients<=0&&n.destroy();n=null},getRuntime:function(){return n&&n.uid?n:n=null},exec:function(){return n?n.exec.apply(this,arguments):null},can:function(t){return n?n.can(t):!1}})}});i("moxie/file/Blob",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient"],function(n,t,i){function u(f,e){function o(t,i,f){var e,o=r[this.uid];return"string"===n.typeOf(o)&&o.length?(e=new u(null,{type:f,size:i-t}),e.detach(o.substr(t,e.size)),e):null}i.call(this);f&&this.connectRuntime(f);e?"string"===n.typeOf(e)&&(e={data:e}):e={};n.extend(this,{uid:e.uid||n.guid("uid_"),ruid:f,size:e.size||0,type:e.type||"",slice:function(n,t,i){return this.isDetached()?o.apply(this,arguments):this.getRuntime().exec.call(this,"Blob","slice",this.getSource(),n,t,i)},getSource:function(){return r[this.uid]?r[this.uid]:null},detach:function(n){if(this.ruid&&(this.getRuntime().exec.call(this,"Blob","destroy"),this.disconnectRuntime(),this.ruid=null),n=n||"","data:"==n.substr(0,5)){var i=n.indexOf(";base64,");this.type=n.substring(5,i);n=t.atob(n.substring(i+8))}this.size=n.length;r[this.uid]=n},isDetached:function(){return!this.ruid&&"string"===n.typeOf(r[this.uid])},destroy:function(){this.detach();delete r[this.uid]}});e.data?this.detach(e.data):r[this.uid]=e}var r={};return u});i("moxie/core/I18n",["moxie/core/utils/Basic"],function(n){var t={};return{addI18n:function(i){return n.extend(t,i)},translate:function(n){return t[n]||n},_:function(n){return this.translate(n)},sprintf:function(t){var i=[].slice.call(arguments,1);return t.replace(/%[a-z]/g,function(){var t=i.shift();return"undefined"!==n.typeOf(t)?t:""})}}});i("moxie/core/utils/Mime",["moxie/core/utils/Basic","moxie/core/I18n"],function(n,t){var i={mimes:{},extensions:{},addMimeType:function(n){for(var i,r,u=n.split(/,/),t=0;t<u.length;t+=2){for(r=u[t+1].split(/ /),i=0;i<r.length;i++)this.mimes[r[i]]=u[t];this.extensions[u[t]]=r}},extList2mimes:function(t,i){for(var u,r,f,s=this,o=[],e=0;e<t.length;e++)for(u=t[e].extensions.toLowerCase().split(/\s*,\s*/),r=0;r<u.length;r++){if("*"===u[r])return[];if(f=s.mimes[u[r]],i&&/^\w+$/.test(u[r]))o.push("."+u[r]);else if(f&&-1===n.inArray(f,o))o.push(f);else if(!f)return[]}return o},mimes2exts:function(t){var i=this,r=[];return n.each(t,function(t){if(t=t.toLowerCase(),"*"===t)return r=[],!1;var u=t.match(/^(\w+)\/(\*|\w+)$/);u&&("*"===u[2]?n.each(i.extensions,function(n,t){new RegExp("^"+u[1]+"/").test(t)&&[].push.apply(r,i.extensions[t])}):i.extensions[t]&&[].push.apply(r,i.extensions[t]))}),r},mimes2extList:function(i){var u=[],r=[];return"string"===n.typeOf(i)&&(i=n.trim(i).split(/\s*,\s*/)),r=this.mimes2exts(i),u.push({title:t.translate("Files"),extensions:r.length?r.join(","):"*"}),u},getFileExtension:function(n){var t=n&&n.match(/\.([^.]+)$/);return t?t[1].toLowerCase():""},getFileMime:function(n){return this.mimes[this.getFileExtension(n)]||""}};return i.addMimeType("application/msword,doc dot,application/pdf,pdf,application/pgp-signature,pgp,application/postscript,ps ai eps,application/rtf,rtf,application/vnd.ms-excel,xls xlb xlt xla,application/vnd.ms-powerpoint,ppt pps pot ppa,application/zip,zip,application/x-shockwave-flash,swf swfl,application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx,application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx,application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx,application/vnd.openxmlformats-officedocument.presentationml.template,potx,application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx,application/x-javascript,js,application/json,json,audio/mpeg,mp3 mpga mpega mp2,audio/x-wav,wav,audio/x-m4a,m4a,audio/ogg,oga ogg,audio/aiff,aiff aif,audio/flac,flac,audio/aac,aac,audio/ac3,ac3,audio/x-ms-wma,wma,image/bmp,bmp,image/gif,gif,image/jpeg,jpg jpeg jpe,image/photoshop,psd,image/png,png,image/svg+xml,svg svgz,image/tiff,tiff tif,text/plain,asc txt text diff log,text/html,htm html xhtml,text/css,css,text/csv,csv,text/rtf,rtf,video/mpeg,mpeg mpg mpe m2v,video/quicktime,qt mov,video/mp4,mp4,video/x-m4v,m4v,video/x-flv,flv,video/x-ms-wmv,wmv,video/avi,avi,video/webm,webm,video/3gpp,3gpp 3gp,video/3gpp2,3g2,video/vnd.rn-realvideo,rv,video/ogg,ogv,video/x-matroska,mkv,application/vnd.oasis.opendocument.formula-template,otf,application/octet-stream,exe"),i});i("moxie/file/FileInput",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Mime","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/I18n","moxie/runtime/Runtime","moxie/runtime/RuntimeClient"],function(n,t,i,r,u,f,e,o,s){function h(t){var f,h,l;if(-1!==n.inArray(n.typeOf(t),["string","node"])&&(t={browse_button:t}),h=r.get(t.browse_button),!h)throw new u.DOMException(u.DOMException.NOT_FOUND_ERR);l={accept:[{title:e.translate("All Files"),extensions:"*"}],multiple:!1,required_caps:!1,container:h.parentNode||document.body};t=n.extend({},l,t);"string"==typeof t.required_caps&&(t.required_caps=o.parseCaps(t.required_caps));"string"==typeof t.accept&&(t.accept=i.mimes2extList(t.accept));f=r.get(t.container);f||(f=document.body);"static"===r.getStyle(f,"position")&&(f.style.position="relative");f=h=null;s.call(this);n.extend(this,{uid:n.guid("uid_"),ruid:null,shimid:null,files:null,init:function(){var i=this;i.bind("RuntimeInit",function(u,f){i.ruid=f.uid;i.shimid=f.shimid;i.bind("Ready",function(){i.trigger("Refresh")},999);i.bind("Refresh",function(){var e,o,i,u,s;i=r.get(t.browse_button);u=r.get(f.shimid);i&&(e=r.getPos(i,r.get(t.container)),o=r.getSize(i),s=parseInt(r.getStyle(i,"z-index"),10)||0,u&&n.extend(u.style,{top:e.y+"px",left:e.x+"px",width:o.w+"px",height:o.h+"px",zIndex:s+1}));u=i=null});f.exec.call(i,"FileInput","init",t)});i.connectRuntime(n.extend({},t,{required_caps:{select_file:!0}}))},getOption:function(n){return t[n]},setOption:function(n,r){if(t.hasOwnProperty(n)){var f=t[n];switch(n){case"accept":"string"==typeof r&&(r=i.mimes2extList(r));break;case"container":case"required_caps":throw new u.FileException(u.FileException.NO_MODIFICATION_ALLOWED_ERR);}t[n]=r;this.exec("FileInput","setOption",n,r);this.trigger("OptionChanged",n,r,f)}},disable:function(t){var i=this.getRuntime();i&&this.exec("FileInput","disable","undefined"===n.typeOf(t)?!0:t)},refresh:function(){this.trigger("Refresh")},destroy:function(){var t=this.getRuntime();t&&(t.exec.call(this,"FileInput","destroy"),this.disconnectRuntime());"array"===n.typeOf(this.files)&&n.each(this.files,function(n){n.destroy()});this.files=null;this.unbindAll()}});this.handleEventProps(c)}var c=["ready","change","cancel","mouseenter","mouseleave","mousedown","mouseup"];return h.prototype=f.instance,h});i("moxie/file/File",["moxie/core/utils/Basic","moxie/core/utils/Mime","moxie/file/Blob"],function(n,t,i){function r(r,u){var f,e;u||(u={});i.apply(this,arguments);this.type||(this.type=t.getFileMime(u.name));u.name?(f=u.name.replace(/\\/g,"/"),f=f.substr(f.lastIndexOf("/")+1)):this.type&&(e=this.type.split("/")[0],f=n.guid((""!==e?e:"file")+"_"),t.extensions[this.type]&&(f+="."+t.extensions[this.type][0]));n.extend(this,{name:f||n.guid("file_"),relativePath:"",lastModifiedDate:u.lastModifiedDate||(new Date).toLocaleString()})}return r.prototype=i.prototype,r});i("moxie/file/FileDrop",["moxie/core/I18n","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/utils/Basic","moxie/core/utils/Env","moxie/file/File","moxie/runtime/RuntimeClient","moxie/core/EventTarget","moxie/core/utils/Mime"],function(n,t,i,r,u,f,e,o,s){function h(i){var f,u=this;"string"==typeof i&&(i={drop_zone:i});f={accept:[{title:n.translate("All Files"),extensions:"*"}],required_caps:{drag_and_drop:!0}};i="object"==typeof i?r.extend({},f,i):f;i.container=t.get(i.drop_zone)||document.body;"static"===t.getStyle(i.container,"position")&&(i.container.style.position="relative");"string"==typeof i.accept&&(i.accept=s.mimes2extList(i.accept));e.call(u);r.extend(u,{uid:r.guid("uid_"),ruid:null,files:null,init:function(){u.bind("RuntimeInit",function(n,t){u.ruid=t.uid;t.exec.call(u,"FileDrop","init",i);u.dispatchEvent("ready")});u.connectRuntime(i)},destroy:function(){var n=this.getRuntime();n&&(n.exec.call(this,"FileDrop","destroy"),this.disconnectRuntime());this.files=null;this.unbindAll()}});this.handleEventProps(c)}var c=["ready","dragenter","dragleave","drop","error"];return h.prototype=o.instance,h});i("moxie/file/FileReader",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/core/Exceptions","moxie/core/EventTarget","moxie/file/Blob","moxie/runtime/RuntimeClient"],function(n,t,i,r,u,f){function e(){function r(n,r){if(this.trigger("loadstart"),this.readyState===e.LOADING)return this.trigger("error",new i.DOMException(i.DOMException.INVALID_STATE_ERR)),this.trigger("loadend"),void 0;if(!(r instanceof u))return this.trigger("error",new i.DOMException(i.DOMException.NOT_FOUND_ERR)),this.trigger("loadend"),void 0;if(this.result=null,this.readyState=e.LOADING,r.isDetached()){var f=r.getSource();switch(n){case"readAsText":case"readAsBinaryString":this.result=f;break;case"readAsDataURL":this.result="data:"+r.type+";base64,"+t.btoa(f)}this.readyState=e.DONE;this.trigger("load");this.trigger("loadend")}else this.connectRuntime(r.ruid),this.exec("FileReader","read",n,r)}f.call(this);n.extend(this,{uid:n.guid("uid_"),readyState:e.EMPTY,result:null,error:null,readAsBinaryString:function(n){r.call(this,"readAsBinaryString",n)},readAsDataURL:function(n){r.call(this,"readAsDataURL",n)},readAsText:function(n){r.call(this,"readAsText",n)},abort:function(){this.result=null;-1===n.inArray(this.readyState,[e.EMPTY,e.DONE])&&(this.readyState===e.LOADING&&(this.readyState=e.DONE),this.exec("FileReader","abort"),this.trigger("abort"),this.trigger("loadend"))},destroy:function(){this.abort();this.exec("FileReader","destroy");this.disconnectRuntime();this.unbindAll()}});this.handleEventProps(o);this.bind("Error",function(n,t){this.readyState=e.DONE;this.error=t},999);this.bind("Load",function(){this.readyState=e.DONE},999)}var o=["loadstart","progress","load","abort","error","loadend"];return e.EMPTY=0,e.LOADING=1,e.DONE=2,e.prototype=r.instance,e});i("moxie/core/utils/Url",["moxie/core/utils/Basic"],function(n){var t=function(i,r){var o,s=["source","scheme","authority","userInfo","user","pass","host","port","relative","path","directory","file","query","fragment"],e=s.length,u={},h=/^(?:([^:\/?#]+):)?(?:\/\/()(?:(?:()(?:([^:@\/]*):?([^:@\/]*))?@)?(\[[\da-fA-F:]+\]|[^:\/?#]*)(?::(\d*))?))?()(?:(()(?:(?:[^?#\/]*\/)*)()(?:[^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/.exec(i||""),c=/^\/\/\w/.test(i),f;switch(n.typeOf(r)){case"undefined":r=t(document.location.href,!1);break;case"string":r=t(r,!1)}for(;e--;)h[e]&&(u[s[e]]=h[e]);return(o=!c&&!u.scheme,(c||o)&&(u.scheme=r.scheme),o)&&(u.host=r.host,u.port=r.port,f="",/^[^\/]/.test(u.path)&&(f=r.path,f=/\/[^\/]*\.[^\/]*$/.test(f)?f.replace(/\/[^\/]+$/,"/"):f.replace(/\/?$/,"/")),u.path=f+(u.path||"")),u.port||(u.port={http:80,https:443}[u.scheme]||80),u.port=parseInt(u.port,10),u.path||(u.path="/"),delete u.source,u},i=function(n){var i="object"==typeof n?n:t(n);return i.scheme+"://"+i.host+(i.port!=={http:80,https:443}[i.scheme]?":"+i.port:"")+i.path+(i.query?i.query:"")},r=function(n){function i(n){return[n.scheme,n.host,n.port].join("/")}return"string"==typeof n&&(n=t(n)),i(t())===i(n)};return{parseUrl:t,resolveUrl:i,hasSameOrigin:r}});i("moxie/runtime/RuntimeTarget",["moxie/core/utils/Basic","moxie/runtime/RuntimeClient","moxie/core/EventTarget"],function(n,t,i){function r(){this.uid=n.guid("uid_");t.call(this);this.destroy=function(){this.disconnectRuntime();this.unbindAll()}}return r.prototype=i.instance,r});i("moxie/file/FileReaderSync",["moxie/core/utils/Basic","moxie/runtime/RuntimeClient","moxie/core/utils/Encode"],function(n,t,i){return function(){function r(n,t){var f,r;if(!t.isDetached())return f=this.connectRuntime(t.ruid).exec.call(this,"FileReaderSync","read",n,t),this.disconnectRuntime(),f;r=t.getSource();switch(n){case"readAsBinaryString":return r;case"readAsDataURL":return"data:"+t.type+";base64,"+i.btoa(r);case"readAsText":for(var e="",u=0,o=r.length;o>u;u++)e+=String.fromCharCode(r[u]);return e}}t.call(this);n.extend(this,{uid:n.guid("uid_"),readAsBinaryString:function(n){return r.call(this,"readAsBinaryString",n)},readAsDataURL:function(n){return r.call(this,"readAsDataURL",n)},readAsText:function(n){return r.call(this,"readAsText",n)}})}});i("moxie/xhr/FormData",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/file/Blob"],function(n,t,i){function r(){var n,r=[];t.extend(this,{append:function(u,f){var o=this,e=t.typeOf(f);f instanceof i?n={name:u,value:f}:"array"===e?(u+="[]",t.each(f,function(n){o.append(u,n)})):"object"===e?t.each(f,function(n,t){o.append(u+"["+t+"]",n)}):"null"===e||"undefined"===e||"number"===e&&isNaN(f)?o.append(u,"false"):r.push({name:u,value:f.toString()})},hasBlob:function(){return!!this.getBlob()},getBlob:function(){return n&&n.value||null},getBlobName:function(){return n&&n.name||null},each:function(i){t.each(r,function(n){i(n.value,n.name)});n&&i(n.value,n.name)},destroy:function(){n=null;r=[]}})}return r});i("moxie/xhr/XMLHttpRequest",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/utils/Encode","moxie/core/utils/Url","moxie/runtime/Runtime","moxie/runtime/RuntimeTarget","moxie/file/Blob","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/core/utils/Env","moxie/core/utils/Mime"],function(n,t,i,r,u,f,e,o,s,h,c,l){function y(){this.uid=n.guid("uid_")}function a(){function i(n,t){if(tt.hasOwnProperty(n))return 1===arguments.length?c.can("define_property")?tt[n]:vt[n]:(c.can("define_property")?tt[n]=t:vt[n]=t,void 0)}function pt(t){function u(){s&&(s.destroy(),s=null);r.dispatchEvent("loadend");r=null}function o(f){s.bind("LoadStart",function(n){i("readyState",a.LOADING);r.dispatchEvent("readystatechange");r.dispatchEvent(n);ft&&r.upload.dispatchEvent(n)});s.bind("Progress",function(n){i("readyState")!==a.LOADING&&(i("readyState",a.LOADING),r.dispatchEvent("readystatechange"));r.dispatchEvent(n)});s.bind("UploadProgress",function(n){ft&&r.upload.dispatchEvent({type:"progress",lengthComputable:!1,total:n.total,loaded:n.loaded})});s.bind("Load",function(t){i("readyState",a.DONE);i("status",Number(f.exec.call(s,"XMLHttpRequest","getStatus")||0));i("statusText",p[i("status")]||"");i("response",f.exec.call(s,"XMLHttpRequest","getResponse",i("responseType")));~n.inArray(i("responseType"),["text",""])?i("responseText",i("response")):"document"===i("responseType")&&i("responseXML",i("response"));nt=f.exec.call(s,"XMLHttpRequest","getAllResponseHeaders");r.dispatchEvent("readystatechange");i("status")>0?(ft&&r.upload.dispatchEvent(t),r.dispatchEvent(t)):(g=!0,r.dispatchEvent("error"));u()});s.bind("Abort",function(n){r.dispatchEvent(n);u()});s.bind("Error",function(n){g=!0;i("readyState",a.DONE);r.dispatchEvent("readystatechange");et=!0;r.dispatchEvent(n);u()});f.exec.call(s,"XMLHttpRequest","send",{url:ht,method:st,async:it,user:ct,password:lt,headers:b,mimeType:rt,encoding:yt,responseType:r.responseType,withCredentials:r.withCredentials,options:w},t)}var r=this;at=(new Date).getTime();s=new e;"string"==typeof w.required_caps&&(w.required_caps=f.parseCaps(w.required_caps));w.required_caps=n.extend({},w.required_caps,{return_response_type:r.responseType});t instanceof h&&(w.required_caps.send_multipart=!0);n.isEmptyObj(b)||(w.required_caps.send_custom_headers=!0);ot||(w.required_caps.do_cors=!0);w.ruid?o(s.connectRuntime(w)):(s.bind("RuntimeInit",function(n,t){o(t)}),s.bind("RuntimeError",function(n,t){r.dispatchEvent("RuntimeError",t)}),s.connectRuntime(w))}function wt(){i("responseText","");i("responseXML",null);i("response",null);i("status",0);i("statusText","");at=bt=null}var ht,st,ct,lt,at,bt,s,k,vt=this,tt={timeout:0,readyState:a.UNSENT,withCredentials:!1,status:0,statusText:"",responseType:"",responseXML:null,responseText:null,response:null},it=!0,b={},yt=null,rt=null,ut=!1,d=!1,ft=!1,et=!1,g=!1,ot=!1,kt=null,dt=null,w={},nt="";n.extend(this,tt,{uid:n.guid("uid_"),upload:new y,open:function(f,e,o,s,h){var c;if(!f||!e)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(/[\u0100-\uffff]/.test(f)||r.utf8_encode(f)!==f)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(~n.inArray(f.toUpperCase(),["CONNECT","DELETE","GET","HEAD","OPTIONS","POST","PUT","TRACE","TRACK"])&&(st=f.toUpperCase()),~n.inArray(st,["CONNECT","TRACE","TRACK"]))throw new t.DOMException(t.DOMException.SECURITY_ERR);if(e=r.utf8_encode(e),c=u.parseUrl(e),ot=u.hasSameOrigin(c),ht=u.resolveUrl(e),(s||h)&&!ot)throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);if(ct=s||c.user,lt=h||c.pass,it=o||!0,it===!1&&(i("timeout")||i("withCredentials")||""!==i("responseType")))throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);ut=!it;d=!1;b={};wt.call(this);i("readyState",a.OPENED);this.dispatchEvent("readystatechange")},setRequestHeader:function(u,f){if(i("readyState")!==a.OPENED||d)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(/[\u0100-\uffff]/.test(u)||r.utf8_encode(u)!==u)throw new t.DOMException(t.DOMException.SYNTAX_ERR);return u=n.trim(u).toLowerCase(),~n.inArray(u,["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","content-transfer-encoding","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"])||/^(proxy\-|sec\-)/.test(u)?!1:(b[u]?b[u]+=", "+f:b[u]=f,!0)},hasRequestHeader:function(n){return n&&b[n.toLowerCase()]||!1},getAllResponseHeaders:function(){return nt||""},getResponseHeader:function(t){return t=t.toLowerCase(),g||~n.inArray(t,["set-cookie","set-cookie2"])?null:nt&&""!==nt&&(k||(k={},n.each(nt.split(/\r\n/),function(t){var i=t.split(/:\s+/);2===i.length&&(i[0]=n.trim(i[0]),k[i[0].toLowerCase()]={header:i[0],value:n.trim(i[1])})})),k.hasOwnProperty(t))?k[t].header+": "+k[t].value:null},overrideMimeType:function(r){var u,f;if(~n.inArray(i("readyState"),[a.LOADING,a.DONE]))throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(r=n.trim(r.toLowerCase()),/;/.test(r)&&(u=r.match(/^([^;]+)(?:;\scharset\=)?(.*)$/))&&(r=u[1],u[2]&&(f=u[2])),!l.mimes[r])throw new t.DOMException(t.DOMException.SYNTAX_ERR);kt=r;dt=f},send:function(i,u){if(w="string"===n.typeOf(u)?{ruid:u}:u?u:{},this.readyState!==a.OPENED||d)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(i instanceof o)w.ruid=i.ruid,rt=i.type||"application/octet-stream";else if(i instanceof h){if(i.hasBlob()){var f=i.getBlob();w.ruid=f.ruid;rt=f.type||"application/octet-stream"}}else"string"==typeof i&&(yt="UTF-8",rt="text/plain;charset=UTF-8",i=r.utf8_encode(i));this.withCredentials||(this.withCredentials=w.required_caps&&w.required_caps.send_browser_cookies&&!ot);ft=!ut&&this.upload.hasEventListener();g=!1;et=!i;ut||(d=!0);pt.call(this,i)},abort:function(){if(g=!0,ut=!1,~n.inArray(i("readyState"),[a.UNSENT,a.OPENED,a.DONE]))i("readyState",a.UNSENT);else{if(i("readyState",a.DONE),d=!1,!s)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);s.getRuntime().exec.call(s,"XMLHttpRequest","abort",et);et=!0}},destroy:function(){s&&("function"===n.typeOf(s.destroy)&&s.destroy(),s=null);this.unbindAll();this.upload&&(this.upload.unbindAll(),this.upload=null)}});this.handleEventProps(v.concat(["readystatechange"]));this.upload.handleEventProps(v)}var p={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Reserved",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",426:"Upgrade Required",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",510:"Not Extended"},v;return y.prototype=i.instance,v=["loadstart","progress","abort","error","load","timeout","loadend"],a.UNSENT=0,a.OPENED=1,a.HEADERS_RECEIVED=2,a.LOADING=3,a.DONE=4,a.prototype=i.instance,a});i("moxie/runtime/Transporter",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient","moxie/core/EventTarget"],function(n,t,i,r){function u(){function h(){f=e=0;o=this.result=null}function c(t,i){var s=this;r=i;s.bind("TransportingProgress",function(t){e=t.loaded;f>e&&-1===n.inArray(s.state,[u.IDLE,u.DONE])&&l.call(s)},999);s.bind("TransportingComplete",function(){e=f;s.state=u.DONE;o=null;s.result=r.exec.call(s,"Transporter","getAsBlob",t||"")},999);s.state=u.BUSY;s.trigger("TransportingStarted");l.call(s)}function l(){var n,u=this,i=f-e;s>i&&(s=i);n=t.btoa(o.substr(e,s));r.exec.call(u,"Transporter","receive",n,f)}var a,r,o,f,e,s;i.call(this);n.extend(this,{uid:n.guid("uid_"),state:u.IDLE,result:null,transport:function(t,i,r){var u=this,e;(r=n.extend({chunk_size:204798},r),(a=r.chunk_size%3)&&(r.chunk_size+=3-a),s=r.chunk_size,h.call(this),o=t,f=t.length,"string"===n.typeOf(r)||r.ruid)?c.call(u,i,this.connectRuntime(r)):(e=function(n,t){u.unbind("RuntimeInit",e);c.call(u,i,t)},this.bind("RuntimeInit",e),this.connectRuntime(r))},abort:function(){var n=this;n.state=u.IDLE;r&&(r.exec.call(n,"Transporter","clear"),n.trigger("TransportingAborted"));h.call(n)},destroy:function(){this.unbindAll();r=null;this.disconnectRuntime();h.call(this)}})}return u.IDLE=0,u.BUSY=1,u.DONE=2,u.prototype=r.instance,u});i("moxie/image/Image",["moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/file/FileReaderSync","moxie/xhr/XMLHttpRequest","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/runtime/Transporter","moxie/core/utils/Env","moxie/core/EventTarget","moxie/file/Blob","moxie/file/File","moxie/core/utils/Encode"],function(n,t,i,r,u,f,e,o,s,h,c,l,a){function v(){function p(n){try{return n||(n=this.exec("Image","getInfo")),this.size=n.size,this.width=n.width,this.height=n.height,this.type=n.type,this.meta=n.meta,""===this.name&&(this.name=n.name),!0}catch(t){return this.trigger("error",t.code),!1}}function r(t){var u=n.typeOf(t);try{if(t instanceof v){if(!t.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);w.apply(this,arguments)}else if(t instanceof c){if(!~n.inArray(t.type,["image/jpeg","image/png"]))throw new i.ImageError(i.ImageError.WRONG_FORMAT);h.apply(this,arguments)}else if(-1!==n.inArray(u,["blob","file"]))r.call(this,new l(null,t),arguments[1]);else if("string"===u)"data:"===t.substr(0,5)?r.call(this,new c(null,{data:t}),arguments[1]):b.apply(this,arguments);else{if("node"!==u||"img"!==t.nodeName.toLowerCase())throw new i.DOMException(i.DOMException.TYPE_MISMATCH_ERR);r.call(this,t.src,arguments[1])}}catch(f){this.trigger("error",f.code)}}function w(t,i){var r=this.connectRuntime(t.ruid);this.ruid=r.uid;r.exec.call(this,"Image","loadFromImage",t,"undefined"===n.typeOf(i)?!0:i)}function h(t,i){function u(n){r.ruid=n.uid;n.exec.call(r,"Image","loadFromBlob",t)}var r=this;r.name=t.name||"";t.isDetached()?(this.bind("RuntimeInit",function(n,t){u(t)}),i&&"string"==typeof i.required_caps&&(i.required_caps=f.parseCaps(i.required_caps)),this.connectRuntime(n.extend({required_caps:{access_image_binary:!0,resize_image:!0}},i))):u(this.connectRuntime(t.ruid))}function b(n,t){var i,r=this;i=new u;i.open("get",n);i.responseType="blob";i.onprogress=function(n){r.trigger(n)};i.onload=function(){h.call(r,i.response,!0)};i.onerror=function(n){r.trigger(n)};i.onloadend=function(){i.destroy()};i.bind("RuntimeError",function(n,t){r.trigger("RuntimeError",t)});i.send(null,t)}e.call(this);n.extend(this,{uid:n.guid("uid_"),ruid:null,name:"",size:0,width:0,height:0,type:"",meta:{},clone:function(){this.load.apply(this,arguments)},load:function(){r.apply(this,arguments)},resize:function(t){var o,e,u=this,r={x:0,y:0,width:u.width,height:u.height},f=n.extendIf({width:u.width,height:u.height,type:u.type||"image/jpeg",quality:90,crop:!1,fit:!0,preserveHeaders:!0,resample:"default",multipass:!0},t),s;try{if(!u.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);if(u.width>v.MAX_RESIZE_WIDTH||u.height>v.MAX_RESIZE_HEIGHT)throw new i.ImageError(i.ImageError.MAX_RESOLUTION_ERR);if((o=u.meta&&u.meta.tiff&&u.meta.tiff.Orientation||1,-1!==n.inArray(o,[5,6,7,8]))&&(s=f.width,f.width=f.height,f.height=s),f.crop){switch(e=Math.max(f.width/u.width,f.height/u.height),t.fit?(r.width=Math.min(Math.ceil(f.width/e),u.width),r.height=Math.min(Math.ceil(f.height/e),u.height),e=f.width/r.width):(r.width=Math.min(f.width,u.width),r.height=Math.min(f.height,u.height),e=1),"boolean"==typeof f.crop&&(f.crop="cc"),f.crop.toLowerCase().replace(/_/,"-")){case"rb":case"right-bottom":r.x=u.width-r.width;r.y=u.height-r.height;break;case"cb":case"center-bottom":r.x=Math.floor((u.width-r.width)/2);r.y=u.height-r.height;break;case"lb":case"left-bottom":r.x=0;r.y=u.height-r.height;break;case"lt":case"left-top":r.x=0;r.y=0;break;case"ct":case"center-top":r.x=Math.floor((u.width-r.width)/2);r.y=0;break;case"rt":case"right-top":r.x=u.width-r.width;r.y=0;break;case"rc":case"right-center":case"right-middle":r.x=u.width-r.width;r.y=Math.floor((u.height-r.height)/2);break;case"lc":case"left-center":case"left-middle":r.x=0;r.y=Math.floor((u.height-r.height)/2);break;case"cc":case"center-center":case"center-middle":default:r.x=Math.floor((u.width-r.width)/2);r.y=Math.floor((u.height-r.height)/2)}r.x=Math.max(r.x,0);r.y=Math.max(r.y,0)}else e=Math.min(f.width/u.width,f.height/u.height),e>1&&!f.fit&&(e=1);this.exec("Image","resize",r,e,f)}catch(h){u.trigger("error",h.code)}},downsize:function(t){var i,r={width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90,crop:!1,fit:!1,preserveHeaders:!0,resample:"default"};i="object"==typeof t?n.extend(r,t):n.extend(r,{width:arguments[0],height:arguments[1],crop:arguments[2],preserveHeaders:arguments[3]});this.resize(i)},crop:function(n,t,i){this.downsize(n,t,!0,i)},getAsCanvas:function(){if(!s.can("create_canvas"))throw new i.RuntimeError(i.RuntimeError.NOT_SUPPORTED_ERR);return this.exec("Image","getAsCanvas")},getAsBlob:function(n,t){if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsBlob",n||"image/jpeg",t||90)},getAsDataURL:function(n,t){if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsDataURL",n||"image/jpeg",t||90)},getAsBinaryString:function(n,t){var i=this.getAsDataURL(n,t);return a.atob(i.substring(i.indexOf("base64,")+7))},embed:function(r,u){function l(t,u){var f=this,l,h,v;if(s.can("create_canvas")&&(l=f.getAsCanvas(),l))return r.appendChild(l),l=null,f.destroy(),e.trigger("embedded"),void 0;if(h=f.getAsDataURL(t,u),!h)throw new i.ImageError(i.ImageError.WRONG_FORMAT);s.can("use_data_uri_of",h.length)?(r.innerHTML='<img src="'+h+'" width="'+f.width+'" height="'+f.height+'" alt="" />',f.destroy(),e.trigger("embedded")):(v=new o,v.bind("TransportingComplete",function(){c=e.connectRuntime(this.result.ruid);e.bind("Embedded",function(){n.extend(c.getShimContainer().style,{top:"0px",left:"0px",width:f.width+"px",height:f.height+"px"});c=null},999);c.exec.call(e,"ImageView","display",this.result.uid,width,height);f.destroy()}),v.transport(a.atob(h.substring(h.indexOf("base64,")+7)),t,{required_caps:{display_media:!0},runtime_order:"flash,silverlight",container:r}))}var c,e=this,h=n.extend({width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90,fit:!0,resample:"nearest"},u),f;try{if(!(r=t.get(r)))throw new i.DOMException(i.DOMException.INVALID_NODE_TYPE_ERR);if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);return this.width>v.MAX_RESIZE_WIDTH||this.height>v.MAX_RESIZE_HEIGHT,f=new v,f.bind("Resize",function(){l.call(this,h.type,h.quality)}),f.bind("Load",function(){this.downsize(h)}),this.meta.thumb&&this.meta.thumb.width>=h.width&&this.meta.thumb.height>=h.height?f.load(this.meta.thumb.data):f.clone(this,!1),f}catch(y){this.trigger("error",y.code)}},destroy:function(){this.ruid&&(this.getRuntime().exec.call(this,"Image","destroy"),this.disconnectRuntime());this.meta&&this.meta.thumb&&this.meta.thumb.data.destroy();this.unbindAll()}});this.handleEventProps(y);this.bind("Load Resize",function(){return p.call(this)},999)}var y=["progress","load","error","resize","embedded"];return v.MAX_RESIZE_WIDTH=8192,v.MAX_RESIZE_HEIGHT=8192,v.prototype=h.instance,v});i("moxie/runtime/html5/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(n,t,i,u){function o(t){var o=this,s=i.capTest,h=i.capTrue,c=n.extend({access_binary:s(window.FileReader||window.File&&window.File.getAsDataURL),access_image_binary:function(){return o.can("access_binary")&&!!f.Image},display_media:s((u.can("create_canvas")||u.can("use_data_uri_over32kb"))&&r("moxie/image/Image")),do_cors:s(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),drag_and_drop:s(function(){var n=document.createElement("div");return("draggable"in n||"ondragstart"in n&&"ondrop"in n)&&("IE"!==u.browser||u.verComp(u.version,9,">"))}()),filter_by_extension:s(function(){return!("Chrome"===u.browser&&u.verComp(u.version,28,"<")||"IE"===u.browser&&u.verComp(u.version,10,"<")||"Safari"===u.browser&&u.verComp(u.version,7,"<")||"Firefox"===u.browser&&u.verComp(u.version,37,"<"))}()),return_response_headers:h,return_response_type:function(n){return"json"===n&&window.JSON?!0:u.can("return_response_type",n)},return_status_code:h,report_upload_progress:s(window.XMLHttpRequest&&(new XMLHttpRequest).upload),resize_image:function(){return o.can("access_binary")&&u.can("create_canvas")},select_file:function(){return u.can("use_fileinput")&&window.File},select_folder:function(){return o.can("select_file")&&("Chrome"===u.browser&&u.verComp(u.version,21,">=")||"Firefox"===u.browser&&u.verComp(u.version,42,">="))},select_multiple:function(){return!(!o.can("select_file")||"Safari"===u.browser&&"Windows"===u.os||"iOS"===u.os&&u.verComp(u.osVersion,"7.0.0",">")&&u.verComp(u.osVersion,"8.0.0","<"))},send_binary_string:s(window.XMLHttpRequest&&((new XMLHttpRequest).sendAsBinary||window.Uint8Array&&window.ArrayBuffer)),send_custom_headers:s(window.XMLHttpRequest),send_multipart:function(){return!!(window.XMLHttpRequest&&(new XMLHttpRequest).upload&&window.FormData)||o.can("send_binary_string")},slice_blob:s(window.File&&(File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice)),stream_upload:function(){return o.can("slice_blob")&&o.can("send_multipart")},summon_file_dialog:function(){return o.can("select_file")&&!("Firefox"===u.browser&&u.verComp(u.version,4,"<")||"Opera"===u.browser&&u.verComp(u.version,12,"<")||"IE"===u.browser&&u.verComp(u.version,10,"<"))},upload_filesize:h,use_http_method:h},arguments[2]);i.call(this,t,arguments[1]||e,c);n.extend(this,{init:function(){this.trigger("Init")},destroy:function(n){return function(){n.call(o);n=o=null}}(this.destroy)});n.extend(this.getShim(),f)}var e="html5",f={};return i.addConstructor(e,o),f});i("moxie/runtime/html5/file/Blob",["moxie/runtime/html5/Runtime","moxie/file/Blob"],function(n,t){function i(){function n(n,t,i){var r;if(!window.File.prototype.slice)return(r=window.File.prototype.webkitSlice||window.File.prototype.mozSlice)?r.call(n,t,i):null;try{return n.slice(),n.slice(t,i)}catch(u){return n.slice(t,i-t)}}this.slice=function(){return new t(this.getRuntime().uid,n.apply(this,arguments))};this.destroy=function(){this.getRuntime().getShim().removeInstance(this.uid)}}return n.Blob=i});i("moxie/core/utils/Events",["moxie/core/utils/Basic"],function(n){function u(){this.returnValue=!1}function f(){this.cancelBubble=!0}var i={},t="moxie_"+n.guid(),e=function(r,e,o,s){var h,c;e=e.toLowerCase();r.addEventListener?(h=o,r.addEventListener(e,h,!1)):r.attachEvent&&(h=function(){var n=window.event;n.target||(n.target=n.srcElement);n.preventDefault=u;n.stopPropagation=f;o(n)},r.attachEvent("on"+e,h));r[t]||(r[t]=n.guid());i.hasOwnProperty(r[t])||(i[r[t]]={});c=i[r[t]];c.hasOwnProperty(e)||(c[e]=[]);c[e].push({func:h,orig:o,key:s})},r=function(r,u,f){var e,s,o;if(u=u.toLowerCase(),r[t]&&i[r[t]]&&i[r[t]][u]){for(e=i[r[t]][u],o=e.length-1;o>=0&&(e[o].orig!==f&&e[o].key!==f||(r.removeEventListener?r.removeEventListener(u,e[o].func,!1):r.detachEvent&&r.detachEvent("on"+u,e[o].func),e[o].orig=null,e[o].func=null,e.splice(o,1),f===s));o--);if(e.length||delete i[r[t]][u],n.isEmptyObj(i[r[t]])){delete i[r[t]];try{delete r[t]}catch(h){r[t]=s}}}},o=function(u,f){u&&u[t]&&n.each(i[u[t]],function(n,t){r(u,t,f)})};return{addEvent:e,removeEvent:r,removeAllEvents:o}});i("moxie/runtime/html5/file/FileInput",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(n,t,i,r,u,f,e){function o(){var n,o;i.extend(this,{init:function(s){var a,v,p,l,w,y,h=this,c=h.getRuntime();n=s;p=f.extList2mimes(n.accept,c.can("filter_by_extension"));v=c.getShimContainer();v.innerHTML='<input id="'+c.uid+'" type="file" style="font-size:999px;opacity:0;"'+(n.multiple&&c.can("select_multiple")?"multiple":"")+(n.directory&&c.can("select_folder")?"webkitdirectory directory":"")+(p?' accept="'+p.join(",")+'"':"")+" />";a=r.get(c.uid);i.extend(a.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"});l=r.get(n.browse_button);o=r.getStyle(l,"z-index")||"auto";c.can("summon_file_dialog")&&("static"===r.getStyle(l,"position")&&(l.style.position="relative"),u.addEvent(l,"click",function(n){var t=r.get(c.uid);t&&!t.disabled&&t.click();n.preventDefault()},h.uid),h.bind("Refresh",function(){w=parseInt(o,10)||1;r.get(n.browse_button).style.zIndex=w;this.getRuntime().getShimContainer().style.zIndex=w-1}));y=c.can("summon_file_dialog")?l:v;u.addEvent(y,"mouseover",function(){h.trigger("mouseenter")},h.uid);u.addEvent(y,"mouseout",function(){h.trigger("mouseleave")},h.uid);u.addEvent(y,"mousedown",function(){h.trigger("mousedown")},h.uid);u.addEvent(r.get(n.container),"mouseup",function(){h.trigger("mouseup")},h.uid);(c.can("summon_file_dialog")?a:l).setAttribute("tabindex",-1);a.onchange=function b(){if(h.files=[],i.each(this.files,function(i){var r="";return n.directory&&"."==i.name?!0:(i.webkitRelativePath&&(r="/"+i.webkitRelativePath.replace(/^\//,"")),i=new t(c.uid,i),i.relativePath=r,h.files.push(i),void 0)}),"IE"!==e.browser&&"IEMobile"!==e.browser)this.value="";else{var r=this.cloneNode(!0);this.parentNode.replaceChild(r,this);r.onchange=b}h.files.length&&h.trigger("change")};h.trigger({type:"ready",async:!0});v=null},setOption:function(n,t){var u=this.getRuntime(),i=r.get(u.uid),e;switch(n){case"accept":t?(e=t.mimes||f.extList2mimes(t,u.can("filter_by_extension")),i.setAttribute("accept",e.join(","))):i.removeAttribute("accept");break;case"directory":t&&u.can("select_folder")?(i.setAttribute("directory",""),i.setAttribute("webkitdirectory","")):(i.removeAttribute("directory"),i.removeAttribute("webkitdirectory"));break;case"multiple":t&&u.can("select_multiple")?i.setAttribute("multiple",""):i.removeAttribute("multiple")}},disable:function(n){var t,i=this.getRuntime();(t=r.get(i.uid))&&(t.disabled=!!n)},destroy:function(){var e=this.getRuntime(),s=e.getShim(),t=e.getShimContainer(),f=n&&r.get(n.container),i=n&&r.get(n.browse_button);f&&u.removeAllEvents(f,this.uid);i&&(u.removeAllEvents(i,this.uid),i.style.zIndex=o);t&&(u.removeAllEvents(t,this.uid),t.innerHTML="");s.removeInstance(this.uid);n=t=f=i=s=null}})}return n.FileInput=o});i("moxie/runtime/html5/file/FileDrop",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime"],function(n,t,i,r,u,f){function e(){function c(n){if(!n.dataTransfer||!n.dataTransfer.types)return!1;var t=i.toArray(n.dataTransfer.types||[]);return-1!==i.inArray("Files",t)||-1!==i.inArray("public.file-url",t)||-1!==i.inArray("application/x-moz-file",t)}function s(n,i){if(v(n)){var r=new t(h,n);r.relativePath=i||"";e.push(r)}}function a(n){for(var t=[],r=0;r<n.length;r++)[].push.apply(t,n[r].extensions.split(/\s*,\s*/));return-1===i.inArray("*",t)?t:[]}function v(n){if(!o.length)return!0;var t=f.getFileExtension(n.name);return!t||-1!==i.inArray(t,o)}function y(n,t){var r=[];i.each(n,function(n){var t=n.webkitGetAsEntry();t&&(t.isFile?s(n.getAsFile(),t.fullPath):r.push(t))});r.length?l(r,t):t()}function l(n,t){var r=[];i.each(n,function(n){r.push(function(t){p(n,t)})});i.inSeries(r,function(){t()})}function p(n,t){n.isFile?n.file(function(i){s(i,n.fullPath);t()},function(){t()}):n.isDirectory?w(n,t):t()}function w(n,t){function i(n){u.readEntries(function(t){t.length?([].push.apply(r,t),i(n)):n()},n)}var r=[],u=n.createReader();i(function(){l(r,t)})}var n,h,e=[],o=[];i.extend(this,{init:function(t){var f,r=this;n=t;h=r.ruid;o=a(n.accept);f=n.container;u.addEvent(f,"dragover",function(n){c(n)&&(n.preventDefault(),n.dataTransfer.dropEffect="copy")},r.uid);u.addEvent(f,"drop",function(n){c(n)&&(n.preventDefault(),e=[],n.dataTransfer.items&&n.dataTransfer.items[0].webkitGetAsEntry?y(n.dataTransfer.items,function(){r.files=e;r.trigger("drop")}):(i.each(n.dataTransfer.files,function(n){s(n)}),r.files=e,r.trigger("drop")))},r.uid);u.addEvent(f,"dragenter",function(){r.trigger("dragenter")},r.uid);u.addEvent(f,"dragleave",function(){r.trigger("dragleave")},r.uid)},destroy:function(){u.removeAllEvents(n&&r.get(n.container),this.uid);h=e=o=n=null;this.getRuntime().getShim().removeInstance(this.uid)}})}return n.FileDrop=e});i("moxie/runtime/html5/file/FileReader",["moxie/runtime/html5/Runtime","moxie/core/utils/Encode","moxie/core/utils/Basic"],function(n,t,i){function r(){function u(n){return t.atob(n.substring(n.indexOf("base64,")+7))}var n,r=!1;i.extend(this,{read:function(t,f){var e=this;e.result="";n=new window.FileReader;n.addEventListener("progress",function(n){e.trigger(n)});n.addEventListener("load",function(t){e.result=r?u(n.result):n.result;e.trigger(t)});n.addEventListener("error",function(t){e.trigger(t,n.error)});n.addEventListener("loadend",function(t){n=null;e.trigger(t)});"function"===i.typeOf(n[t])?(r=!1,n[t](f.getSource())):"readAsBinaryString"===t&&(r=!0,n.readAsDataURL(f.getSource()))},abort:function(){n&&n.abort()},destroy:function(){n=null;this.getRuntime().getShim().removeInstance(this.uid)}})}return n.FileReader=r});i("moxie/runtime/html5/xhr/XMLHttpRequest",["moxie/runtime/html5/Runtime","moxie/core/utils/Basic","moxie/core/utils/Mime","moxie/core/utils/Url","moxie/file/File","moxie/file/Blob","moxie/xhr/FormData","moxie/core/Exceptions","moxie/core/utils/Env"],function(n,t,i,r,u,f,e,o,s){function h(){function l(n,t){var r,i,u=this;r=t.getBlob().getSource();i=new window.FileReader;i.onload=function(){t.append(t.getBlobName(),new f(null,{type:r.type,data:i.result}));c.send.call(u,n,t)};i.readAsBinaryString(r)}function a(){return!window.XMLHttpRequest||"IE"===s.browser&&s.verComp(s.version,8,"<")?function(){for(var t=["Msxml2.XMLHTTP.6.0","Microsoft.XMLHTTP"],n=0;n<t.length;n++)try{return new ActiveXObject(t[n])}catch(i){}}():new window.XMLHttpRequest}function v(n){var t=n.responseXML,i=n.responseText;return"IE"===s.browser&&i&&t&&!t.documentElement&&/[^\/]+\/[^\+]+\+xml/.test(n.getResponseHeader("Content-Type"))&&(t=new window.ActiveXObject("Microsoft.XMLDOM"),t.async=!1,t.validateOnParse=!1,t.loadXML(i)),t&&("IE"===s.browser&&0!==t.parseError||!t.documentElement||"parsererror"===t.documentElement.tagName)?null:t}function y(t){var r="----moxieboundary"+(new Date).getTime(),u="--",i="\r\n",e="",s=this.getRuntime();if(!s.can("send_binary_string"))throw new o.RuntimeError(o.RuntimeError.NOT_SUPPORTED_ERR);return n.setRequestHeader("Content-Type","multipart/form-data; boundary="+r),t.each(function(n,t){e+=n instanceof f?u+r+i+'Content-Disposition: form-data; name="'+t+'"; filename="'+unescape(encodeURIComponent(n.name||"blob"))+'"'+i+"Content-Type: "+(n.type||"application/octet-stream")+i+i+n.getSource()+i:u+r+i+'Content-Disposition: form-data; name="'+t+'"'+i+i+unescape(encodeURIComponent(n))+i}),e+=u+r+u+i}var n,h,c=this;t.extend(this,{send:function(i,u){var o=this,p="Mozilla"===s.browser&&s.verComp(s.version,4,">=")&&s.verComp(s.version,7,"<"),w="Android Browser"===s.browser,v=!1,c;if(h=i.url.replace(/^.+?\/([\w\-\.]+)$/,"$1").toLowerCase(),n=a(),n.open(i.method,i.url,i.async,i.user,i.password),u instanceof f)u.isDetached()&&(v=!0),u=u.getSource();else if(u instanceof e){if(u.hasBlob())if(u.getBlob().isDetached())u=y.call(o,u),v=!0;else if((p||w)&&"blob"===t.typeOf(u.getBlob().getSource())&&window.FileReader)return l.call(o,i,u),void 0;u instanceof e&&(c=new window.FormData,u.each(function(n,t){n instanceof f?c.append(t,n.getSource()):c.append(t,n)}),u=c)}n.upload?(i.withCredentials&&(n.withCredentials=!0),n.addEventListener("load",function(n){o.trigger(n)}),n.addEventListener("error",function(n){o.trigger(n)}),n.addEventListener("progress",function(n){o.trigger(n)}),n.upload.addEventListener("progress",function(n){o.trigger({type:"UploadProgress",loaded:n.loaded,total:n.total})})):n.onreadystatechange=function(){switch(n.readyState){case 3:var t,u;try{r.hasSameOrigin(i.url)&&(t=n.getResponseHeader("Content-Length")||0);n.responseText&&(u=n.responseText.length)}catch(f){t=u=0}o.trigger({type:"progress",lengthComputable:!!t,total:parseInt(t,10),loaded:u});break;case 4:n.onreadystatechange=function(){};try{if(n.status>=200&&n.status<400){o.trigger("load");break}}catch(f){}o.trigger("error")}};t.isEmptyObj(i.headers)||t.each(i.headers,function(t,i){n.setRequestHeader(i,t)});""!==i.responseType&&"responseType"in n&&(n.responseType="json"!==i.responseType||s.can("return_response_type","json")?i.responseType:"text");v?n.sendAsBinary?n.sendAsBinary(u):function(){for(var i=new Uint8Array(u.length),t=0;t<u.length;t++)i[t]=255&u.charCodeAt(t);n.send(i.buffer)}():n.send(u);o.trigger("loadstart")},getStatus:function(){try{if(n)return n.status}catch(t){}return 0},getResponse:function(t){var o=this.getRuntime(),r,f,e;try{switch(t){case"blob":return r=new u(o.uid,n.response),f=n.getResponseHeader("Content-Disposition"),f&&(e=f.match(/filename=([\'\"'])([^\1]+)\1/),e&&(h=e[2])),r.name=h,r.type||(r.type=i.getFileMime(h)),r;case"json":return s.can("return_response_type","json")?n.response:200===n.status&&window.JSON?JSON.parse(n.responseText):null;case"document":return v(n);default:return""!==n.responseText?n.responseText:null}}catch(c){return null}},getAllResponseHeaders:function(){try{return n.getAllResponseHeaders()}catch(t){}return""},abort:function(){n&&n.abort()},destroy:function(){c=h=null;this.getRuntime().getShim().removeInstance(this.uid)}})}return n.XMLHttpRequest=h});i("moxie/runtime/html5/utils/BinaryReader",["moxie/core/utils/Basic"],function(n){function t(n){n instanceof ArrayBuffer?i.apply(this,arguments):r.apply(this,arguments)}function i(t){var i=new DataView(t);n.extend(this,{readByteAt:function(n){return i.getUint8(n)},writeByteAt:function(n,t){i.setUint8(n,t)},SEGMENT:function(n,r,u){switch(arguments.length){case 2:return t.slice(n,n+r);case 1:return t.slice(n);case 3:if(null===u&&(u=new ArrayBuffer),u instanceof ArrayBuffer){var f=new Uint8Array(this.length()-r+u.byteLength);n>0&&f.set(new Uint8Array(t.slice(0,n)),0);f.set(new Uint8Array(u),n);f.set(new Uint8Array(t.slice(n+r)),n+u.byteLength);this.clear();t=f.buffer;i=new DataView(t);break}default:return t}},length:function(){return t?t.byteLength:0},clear:function(){i=t=null}})}function r(t){function i(n,i,r){r=3===arguments.length?r:t.length-i-1;t=t.substr(0,i)+n+t.substr(r+i)}n.extend(this,{readByteAt:function(n){return t.charCodeAt(n)},writeByteAt:function(n,t){i(String.fromCharCode(t),n,1)},SEGMENT:function(n,r,u){switch(arguments.length){case 1:return t.substr(n);case 2:return t.substr(n,r);case 3:i(null!==u?u:"",n,r);break;default:return t}},length:function(){return t?t.length:0},clear:function(){t=null}})}return n.extend(t.prototype,{littleEndian:!1,read:function(n,t){var r,u,i;if(n+t>this.length())throw new Error("You are trying to read outside the source boundaries.");for(u=this.littleEndian?0:-8*(t-1),i=0,r=0;t>i;i++)r|=this.readByteAt(n+i)<<Math.abs(u+8*i);return r},write:function(n,t,i){var u,r;if(n>this.length())throw new Error("You are trying to write outside the source boundaries.");for(u=this.littleEndian?0:-8*(i-1),r=0;i>r;r++)this.writeByteAt(n+r,255&t>>Math.abs(u+8*r))},BYTE:function(n){return this.read(n,1)},SHORT:function(n){return this.read(n,2)},LONG:function(n){return this.read(n,4)},SLONG:function(n){var t=this.read(n,4);return t>2147483647?t-4294967296:t},CHAR:function(n){return String.fromCharCode(this.read(n,1))},STRING:function(n,t){return this.asArray("CHAR",n,t).join("")},asArray:function(n,t,i){for(var u=[],r=0;i>r;r++)u[r]=this[n](t+r);return u}}),t});i("moxie/runtime/html5/image/JPEGHeaders",["moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(n,t){return function i(r){var o,f,e,u=[],s=0;if(o=new n(r),65496!==o.SHORT(0))throw o.clear(),new t.ImageError(t.ImageError.WRONG_FORMAT);for(f=2;f<=o.length();)if(e=o.SHORT(f),e>=65488&&65495>=e)f+=2;else{if(65498===e||65497===e)break;s=o.SHORT(f+2)+2;e>=65505&&65519>=e&&u.push({hex:e,name:"APP"+(15&e),start:f,length:s,segment:o.SEGMENT(f,s)});f+=s}return o.clear(),{headers:u,restore:function(t){var e,r,i;for(i=new n(t),f=65504==i.SHORT(2)?4+i.SHORT(4):2,r=0,e=u.length;e>r;r++)i.SEGMENT(f,0,u[r].segment),f+=u[r].length;return t=i.SEGMENT(),i.clear(),t},strip:function(t){var r,u,e,f;for(e=new i(t),u=e.headers,e.purge(),r=new n(t),f=u.length;f--;)r.SEGMENT(u[f].start,u[f].length,"");return t=r.SEGMENT(),r.clear(),t},get:function(n){for(var i=[],t=0,r=u.length;r>t;t++)u[t].name===n.toUpperCase()&&i.push(u[t].segment);return i},set:function(n,t){var i,r,e,f=[];for("string"==typeof t?f.push(t):f=t,i=r=0,e=u.length;e>i&&(u[i].name===n.toUpperCase()&&(u[i].segment=f[r],u[i].length=f[r].length,r++),!(r>=f.length));i++);},purge:function(){this.headers=u=[]}}}});i("moxie/runtime/html5/image/ExifParser",["moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(n,i,r){function u(f){function h(i,u){for(var s,a,h,v,f,y,o=this,p=[],w={},k={1:"BYTE",7:"UNDEFINED",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",9:"SLONG",10:"SRATIONAL"},d={BYTE:1,UNDEFINED:1,ASCII:1,SHORT:2,LONG:4,RATIONAL:8,SLONG:4,SRATIONAL:8},b=o.SHORT(i),l=0;b>l;l++)if(p=[],f=i+2+12*l,s=u[o.SHORT(f)],s!==t){if(a=k[o.SHORT(f+=2)],h=o.LONG(f+=2),v=d[a],!v)throw new r.ImageError(r.ImageError.INVALID_META_ERR);if(f+=4,v*h>4&&(f=o.LONG(f)+e.tiffHeader),f+v*h>=this.length())throw new r.ImageError(r.ImageError.INVALID_META_ERR);"ASCII"!==a?(p=o.asArray(a,f,h),y=1==h?p[0]:p,w[s]=c.hasOwnProperty(s)&&"object"!=typeof y?c[s][y]:y):w[s]=n.trim(o.STRING(f,h).replace(/\0$/,""))}return w}function y(n,t,i){var u,l,f,o=0,h,c,r;if("string"==typeof t){h=s[n.toLowerCase()];for(c in h)if(h[c]===t){t=c;break}}for(u=e[n.toLowerCase()+"IFD"],l=this.SHORT(u),r=0;l>r;r++)if(f=u+12*r+2,this.SHORT(f)==t){o=f+8;break}if(!o)return!1;try{this.write(o,i,4)}catch(a){return!1}return!0}var a,s,c,e,l,o,v;if(i.call(this,f),s={tiff:{274:"Orientation",270:"ImageDescription",271:"Make",272:"Model",305:"Software",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},exif:{36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"},thumb:{513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength"}},c={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}},e={tiffHeader:10},l=e.tiffHeader,a={clear:this.clear},n.extend(this,{read:function(){try{return u.prototype.read.apply(this,arguments)}catch(n){throw new r.ImageError(r.ImageError.INVALID_META_ERR);}},write:function(){try{return u.prototype.write.apply(this,arguments)}catch(n){throw new r.ImageError(r.ImageError.INVALID_META_ERR);}},UNDEFINED:function(){return this.BYTE.apply(this,arguments)},RATIONAL:function(n){return this.LONG(n)/this.LONG(n+4)},SRATIONAL:function(n){return this.SLONG(n)/this.SLONG(n+4)},ASCII:function(n){return this.CHAR(n)},TIFF:function(){return o||null},EXIF:function(){var t=null,i,r;if(e.exifIFD){try{t=h.call(this,e.exifIFD,s.exif)}catch(u){return null}if(t.ExifVersion&&"array"===n.typeOf(t.ExifVersion)){for(i=0,r="";i<t.ExifVersion.length;i++)r+=String.fromCharCode(t.ExifVersion[i]);t.ExifVersion=r}}return t},GPS:function(){var t=null;if(e.gpsIFD){try{t=h.call(this,e.gpsIFD,s.gps)}catch(i){return null}t.GPSVersionID&&"array"===n.typeOf(t.GPSVersionID)&&(t.GPSVersionID=t.GPSVersionID.join("."))}return t},thumb:function(){if(e.IFD1)try{var n=h.call(this,e.IFD1,s.thumb);if("JPEGInterchangeFormat"in n)return this.SEGMENT(e.tiffHeader+n.JPEGInterchangeFormat,n.JPEGInterchangeFormatLength)}catch(t){}return null},setExif:function(n,t){return"PixelXDimension"!==n&&"PixelYDimension"!==n?!1:y.call(this,"exif",n,t)},clear:function(){a.clear();f=s=c=o=e=a=null}}),65505!==this.SHORT(0)||"EXIF\0"!==this.STRING(4,5).toUpperCase())throw new r.ImageError(r.ImageError.INVALID_META_ERR);if(this.littleEndian=18761==this.SHORT(l),42!==this.SHORT(l+=2))throw new r.ImageError(r.ImageError.INVALID_META_ERR);e.IFD0=e.tiffHeader+this.LONG(l+=2);o=h.call(this,e.IFD0,s.tiff);"ExifIFDPointer"in o&&(e.exifIFD=e.tiffHeader+o.ExifIFDPointer,delete o.ExifIFDPointer);"GPSInfoIFDPointer"in o&&(e.gpsIFD=e.tiffHeader+o.GPSInfoIFDPointer,delete o.GPSInfoIFDPointer);n.isEmptyObj(o)&&(o=null);v=this.LONG(e.IFD0+12*this.SHORT(e.IFD0)+2);v&&(e.IFD1=e.tiffHeader+v)}return u.prototype=i.prototype,u});i("moxie/runtime/html5/image/JPEG",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/html5/image/JPEGHeaders","moxie/runtime/html5/utils/BinaryReader","moxie/runtime/html5/image/ExifParser"],function(n,t,i,r,u){function f(f){function c(n){var i,r,t=0;for(n||(n=s);t<=n.length();){if(i=n.SHORT(t+=2),i>=65472&&65475>=i)return t+=5,{height:n.SHORT(t),width:n.SHORT(t+=2)};r=n.SHORT(t+=2);t+=r-2}return null}function l(){var t,n,i=e.thumb();return i&&(t=new r(i),n=c(t),t.clear(),n)?(n.data=i,n):null}function a(){e&&o&&s&&(e.clear(),o.purge(),s.clear(),h=o=e=s=null)}var s,o,e,h;if(s=new r(f),65496!==s.SHORT(0))throw new t.ImageError(t.ImageError.WRONG_FORMAT);o=new i(f);try{e=new u(o.get("app1")[0])}catch(v){}h=c.call(this);n.extend(this,{type:"image/jpeg",size:s.length(),width:h&&h.width||0,height:h&&h.height||0,setExif:function(t,i){return e?("object"===n.typeOf(t)?n.each(t,function(n,t){e.setExif(t,n)}):e.setExif(t,i),o.set("app1",e.SEGMENT()),void 0):!1},writeHeaders:function(){return arguments.length?o.restore(arguments[0]):o.restore(f)},stripHeaders:function(n){return o.strip(n)},purge:function(){a.call(this)}});e&&(this.meta={tiff:e.TIFF(),exif:e.EXIF(),gps:e.GPS(),thumb:l()})}return f});i("moxie/runtime/html5/image/PNG",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader"],function(n,t,i){function r(r){function o(){var n,t;return n=s.call(this,8),"IHDR"==n.type?(t=n.start,{width:u.LONG(t),height:u.LONG(t+=4)}):null}function e(){u&&(u.clear(),r=f=h=c=u=null)}function s(n){var t,i,r,f;return t=u.LONG(n),i=u.STRING(n+=4,4),r=n+=4,f=u.LONG(n+t),{length:t,type:i,start:r,CRC:f}}var u,h,c,f;u=new i(r),function(){for(var i=0,t=0,r=[35152,20039,3338,6666],t=0;t<r.length;t++,i+=2)if(r[t]!=u.SHORT(i))throw new n.ImageError(n.ImageError.WRONG_FORMAT);}();f=o.call(this);t.extend(this,{type:"image/png",size:u.length(),width:f.width,height:f.height,purge:function(){e.call(this)}});e.call(this)}return r});i("moxie/runtime/html5/image/ImageInfo",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/html5/image/JPEG","moxie/runtime/html5/image/PNG"],function(n,t,i,r){return function(u){var f,e=[i,r];f=function(){for(var n=0;n<e.length;n++)try{return new e[n](u)}catch(i){}throw new t.ImageError(t.ImageError.WRONG_FORMAT);}();n.extend(this,{type:"",size:0,width:0,height:0,setExif:function(){},writeHeaders:function(n){return n},stripHeaders:function(n){return n},purge:function(){u=null}});n.extend(this,f);this.purge=function(){f.purge();f=null}}});i("moxie/runtime/html5/image/ResizerCanvas",[],function(){function n(i,r,u){var e=i.width>i.height?"width":"height",s=Math.round(i[e]*r),o=!1,f;return"nearest"!==u&&(.5>r||r>2)&&(r=.5>r?.5:2,o=!0),f=t(i,r),o?n(f,s/f[e],u):f}function t(n,t){var r=n.width,u=n.height,f=Math.round(r*t),e=Math.round(u*t),i=document.createElement("canvas");return i.width=f,i.height=e,i.getContext("2d").drawImage(n,0,0,r,u,0,0,f,e),n=null,i}return{scale:n}});i("moxie/runtime/html5/image/Image",["moxie/runtime/html5/Runtime","moxie/core/utils/Basic","moxie/core/Exceptions","moxie/core/utils/Encode","moxie/file/Blob","moxie/file/File","moxie/runtime/html5/image/ImageInfo","moxie/runtime/html5/image/ResizerCanvas","moxie/core/utils/Mime","moxie/core/utils/Env"],function(n,t,i,r,u,f,e,o,s,h){function c(){function w(){if(!n&&!a)throw new i.ImageError(i.DOMException.INVALID_STATE_ERR);return n||a}function g(){var t=w();return"canvas"==t.nodeName.toLowerCase()?t:(n=document.createElement("canvas"),n.width=t.width,n.height=t.height,n.getContext("2d").drawImage(t,0,0),n)}function b(n){return r.atob(n.substring(n.indexOf("base64,")+7))}function tt(n,t){return"data:"+(t||"")+";base64,"+r.btoa(n)}function k(n){var t=this,r=n.substr(0,5);a=new Image;a.onerror=function(){nt.call(this);t.trigger("error",i.ImageError.WRONG_FORMAT)};a.onload=function(){t.trigger("load")};a.src="data:"===r||"blob:"===r?n:tt(n,v.type)}function it(n,t){var r,u=this;return window.FileReader?(r=new FileReader,r.onload=function(){t.call(u,this.result)},r.onerror=function(){u.trigger("error",i.ImageError.WRONG_FORMAT)},r.readAsDataURL(n),void 0):t.call(this,n.getAsDataURL())}function rt(n,i){var o=Math.PI/180,e=document.createElement("canvas"),r=e.getContext("2d"),u=n.width,f=n.height;switch(t.inArray(i,[5,6,7,8])>-1?(e.width=f,e.height=u):(e.width=u,e.height=f),i){case 2:r.translate(u,0);r.scale(-1,1);break;case 3:r.translate(u,f);r.rotate(180*o);break;case 4:r.translate(0,f);r.scale(1,-1);break;case 5:r.rotate(90*o);r.scale(1,-1);break;case 6:r.rotate(90*o);r.translate(0,-f);break;case 7:r.rotate(90*o);r.translate(u,-f);r.scale(-1,1);break;case 8:r.rotate(-90*o);r.translate(-u,0)}return r.drawImage(n,0,0,u,f),e}function nt(){l&&(l.purge(),l=null);a&&h.can("use_blob_uri")&&URL.revokeObjectURL(a.src);c=a=n=v=null;y=!1}var a,l,n,c,v,p=this,y=!1,d=!0;t.extend(this,{loadFromBlob:function(n){var t=this.getRuntime(),r=arguments.length>1?arguments[1]:!0;if(!t.can("access_binary"))throw new i.RuntimeError(i.RuntimeError.NOT_SUPPORTED_ERR);v=n;n.isDetached()?(c=n.getSource(),k.call(this,c)):h.can("use_blob_uri")?k.call(this,URL.createObjectURL(n.getSource())):it.call(this,n.getSource(),function(n){r&&(c=b(n));k.call(this,n)})},loadFromImage:function(t,i){var r=this;r.meta=t.meta;v=new f(null,{name:t.name,size:t.size,type:t.type});h.can("create_canvas")&&!i?(n=t.getAsCanvas(),setTimeout(function(){r.trigger("load")})):k.call(this,i?c=t.getAsBinaryString():t.getAsDataURL())},getInfo:function(){var n,t=this.getRuntime();return!l&&c&&t.can("access_image_binary")&&(l=new e(c)),n={width:w().width||0,height:w().height||0,type:v.type||s.getFileMime(v.name),size:c&&c.length||v.size||0,name:v.name||"",meta:null},d&&(n.meta=l&&l.meta||this.meta||{},!n.meta||!n.meta.thumb||n.meta.thumb.data instanceof u||(n.meta.thumb.data=new u(null,{type:"image/jpeg",data:n.meta.thumb.data}))),n},resize:function(t,i,r){var u=document.createElement("canvas"),f;(u.width=t.width,u.height=t.height,u.getContext("2d").drawImage(w(),t.x,t.y,t.width,t.height,0,0,u.width,u.height),n=o.scale(u,i),d=r.preserveHeaders,d)||(f=this.meta&&this.meta.tiff&&this.meta.tiff.Orientation||1,n=rt(n,f));this.width=n.width;this.height=n.height;y=!0;this.trigger("Resize")},getAsCanvas:function(){return n||(n=g()),n.id=this.uid+"_canvas",n},getAsBlob:function(n,t){return n!==this.type?(y=!0,new f(null,{name:v.name||"",type:n,data:p.getAsDataURL(n,t)})):new f(null,{name:v.name||"",type:n,data:p.getAsBinaryString(n,t)})},getAsDataURL:function(t){var i=arguments[1]||90;if(!y&&"data:"===a.src.substr(0,5))return a.src;if(g(),"image/jpeg"!==t)return n.toDataURL("image/png");try{return n.toDataURL("image/jpeg",i/100)}catch(r){return n.toDataURL("image/jpeg")}},getAsBinaryString:function(t,i){if(!y)return c||(c=b(p.getAsDataURL(t,i))),c;if("image/jpeg"!==t)c=b(p.getAsDataURL(t,i));else{var r;i||(i=90);g();try{r=n.toDataURL("image/jpeg",i/100)}catch(u){r=n.toDataURL("image/jpeg")}c=b(r);l&&(c=l.stripHeaders(c),d&&(l.meta&&l.meta.exif&&l.setExif({PixelXDimension:this.width,PixelYDimension:this.height}),c=l.writeHeaders(c)),l.purge(),l=null)}return y=!1,c},destroy:function(){p=null;nt.call(this);this.getRuntime().getShim().removeInstance(this.uid)}})}return n.Image=c});i("moxie/runtime/flash/Runtime",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/runtime/Runtime"],function(n,t,i,u,f){function s(){var n;try{n=navigator.plugins["Shockwave Flash"];n=n.description}catch(t){try{n=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(i){n="0.0"}}return n=n.match(/\d+/g),parseFloat(n[0]+"."+n[1])}function h(n){var r=i.get(n);r&&"OBJECT"==r.nodeName&&("IE"===t.browser?(r.style.display="none",function u(){4==r.readyState?c(n):setTimeout(u,10)}()):r.parentNode.removeChild(r))}function c(n){var t=i.get(n),r;if(t){for(r in t)"function"==typeof t[r]&&(t[r]=null);t.parentNode.removeChild(t)}}function l(c){var a,l=this;c=n.extend({swf_url:t.swf_url},c);f.call(this,c,e,{access_binary:function(n){return n&&"browser"===l.mode},access_image_binary:function(n){return n&&"browser"===l.mode},display_media:f.capTest(r("moxie/image/Image")),do_cors:f.capTrue,drag_and_drop:!1,report_upload_progress:function(){return"client"===l.mode},resize_image:f.capTrue,return_response_headers:!1,return_response_type:function(t){return"json"===t&&window.JSON?!0:!n.arrayDiff(t,["","text","document"])||"browser"===l.mode},return_status_code:function(t){return"browser"===l.mode||!n.arrayDiff(t,[200,404])},select_file:f.capTrue,select_multiple:f.capTrue,send_binary_string:function(n){return n&&"browser"===l.mode},send_browser_cookies:function(n){return n&&"browser"===l.mode},send_custom_headers:function(n){return n&&"browser"===l.mode},send_multipart:f.capTrue,slice_blob:function(n){return n&&"browser"===l.mode},stream_upload:function(n){return n&&"browser"===l.mode},summon_file_dialog:!1,upload_filesize:function(t){return n.parseSizeStr(t)<=2097152||"client"===l.mode},use_http_method:function(t){return!n.arrayDiff(t,["GET","POST"])}},{access_binary:function(n){return n?"browser":"client"},access_image_binary:function(n){return n?"browser":"client"},report_upload_progress:function(n){return n?"browser":"client"},return_response_type:function(t){return n.arrayDiff(t,["","text","json","document"])?"browser":["client","browser"]},return_status_code:function(t){return n.arrayDiff(t,[200,404])?"browser":["client","browser"]},send_binary_string:function(n){return n?"browser":"client"},send_browser_cookies:function(n){return n?"browser":"client"},send_custom_headers:function(n){return n?"browser":"client"},slice_blob:function(n){return n?"browser":"client"},stream_upload:function(n){return n?"client":"browser"},upload_filesize:function(t){return n.parseSizeStr(t)>=2097152?"client":"browser"}},"client");s()<11.3&&(this.mode=!1);n.extend(this,{getShim:function(){return i.get(this.uid)},shimExec:function(n,t){var i=[].slice.call(arguments,2);return l.getShim().exec(this.uid,n,t,i)},init:function(){var i,e,r;r=this.getShimContainer();n.extend(r.style,{position:"absolute",top:"-8px",left:"-8px",width:"9px",height:"9px",overflow:"hidden"});i='<object id="'+this.uid+'" type="application/x-shockwave-flash" data="'+c.swf_url+'" ';"IE"===t.browser&&(i+='classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ');i+='width="100%" height="100%" style="outline:0"><param name="movie" value="'+c.swf_url+'" /><param name="flashvars" value="uid='+escape(this.uid)+"&target="+f.getGlobalEventTarget()+'" /><param name="wmode" value="transparent" /><param name="allowscriptaccess" value="always" /><\/object>';"IE"===t.browser?(e=document.createElement("div"),r.appendChild(e),e.outerHTML=i,e=r=null):r.innerHTML=i;a=setTimeout(function(){l&&!l.initialized&&l.trigger("Error",new u.RuntimeError(u.RuntimeError.NOT_INIT_ERR))},5e3)},destroy:function(n){return function(){h(l.uid);n.call(l);clearTimeout(a);c=a=n=l=null}}(this.destroy)},o)}var e="flash",o={};return f.addConstructor(e,l),o});i("moxie/runtime/flash/file/Blob",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(n,t){var i={slice:function(n,i,r,u){var f=this.getRuntime();return 0>i?i=Math.max(n.size+i,0):i>0&&(i=Math.min(i,n.size)),0>r?r=Math.max(n.size+r,0):r>0&&(r=Math.min(r,n.size)),n=f.shimExec.call(this,"Blob","slice",i,r,u||""),n&&(n=new t(f.uid,n)),n}};return n.Blob=i});i("moxie/runtime/flash/file/FileInput",["moxie/runtime/flash/Runtime","moxie/file/File","moxie/core/utils/Dom","moxie/core/utils/Basic"],function(n,t,i,r){var u={init:function(n){var u=this,e=this.getRuntime(),f=i.get(n.browse_button);f&&(f.setAttribute("tabindex",-1),f=null);this.bind("Change",function(){var n=e.shimExec.call(u,"FileInput","getFiles");u.files=[];r.each(n,function(n){u.files.push(new t(e.uid,n))})},999);this.getRuntime().shimExec.call(this,"FileInput","init",{accept:n.accept,multiple:n.multiple});this.trigger("ready")}};return n.FileInput=u});i("moxie/runtime/flash/file/FileReader",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(n,t){function i(n,i){switch(i){case"readAsText":return t.atob(n,"utf8");case"readAsBinaryString":return t.atob(n);case"readAsDataURL":return n}return null}var r={read:function(n,t){var r=this;return r.result="","readAsDataURL"===n&&(r.result="data:"+(t.type||"")+";base64,"),r.bind("Progress",function(t,u){u&&(r.result+=i(u,n))},999),r.getRuntime().shimExec.call(this,"FileReader","readAsBase64",t.uid)}};return n.FileReader=r});i("moxie/runtime/flash/file/FileReaderSync",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(n,t){function i(n,i){switch(i){case"readAsText":return t.atob(n,"utf8");case"readAsBinaryString":return t.atob(n);case"readAsDataURL":return n}return null}var r={read:function(n,t){var r,u=this.getRuntime();return(r=u.shimExec.call(this,"FileReaderSync","readAsBase64",t.uid))?("readAsDataURL"===n&&(r="data:"+(t.type||"")+";base64,"+r),i(r,n,t.type)):null}};return n.FileReaderSync=r});i("moxie/runtime/flash/runtime/Transporter",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(n,t){var i={getAsBlob:function(n){var i=this.getRuntime(),r=i.shimExec.call(this,"Transporter","getAsBlob",n);return r?new t(i.uid,r):null}};return n.Transporter=i});i("moxie/runtime/flash/xhr/XMLHttpRequest",["moxie/runtime/flash/Runtime","moxie/core/utils/Basic","moxie/file/Blob","moxie/file/File","moxie/file/FileReaderSync","moxie/runtime/flash/file/FileReaderSync","moxie/xhr/FormData","moxie/runtime/Transporter","moxie/runtime/flash/runtime/Transporter"],function(n,t,i,r,u,f,e,o){var s={send:function(n,r){function f(){n.transport=u.mode;u.shimExec.call(s,"XMLHttpRequest","send",n,r)}function l(n,t){u.shimExec.call(s,"XMLHttpRequest","appendBlob",n,t.uid);r=null;f()}function a(n,t){var i=new o;i.bind("TransportingComplete",function(){t(this.result)});i.transport(n.getSource(),n.type,{ruid:u.uid})}var s=this,u=s.getRuntime(),c,h;(t.isEmptyObj(n.headers)||t.each(n.headers,function(n,t){u.shimExec.call(s,"XMLHttpRequest","setRequestHeader",t,n.toString())}),r instanceof e)?(r.each(function(n,t){n instanceof i?c=t:u.shimExec.call(s,"XMLHttpRequest","append",t,n)}),r.hasBlob())?(h=r.getBlob(),h.isDetached()?a(h,function(n){h.destroy();l(c,n)}):l(c,h)):(r=null,f()):r instanceof i?r.isDetached()?a(r,function(n){r.destroy();r=n.uid;f()}):(r=r.uid,f()):f()},getResponse:function(n){var f,i,e=this.getRuntime();if(i=e.shimExec.call(this,"XMLHttpRequest","getResponseAsBlob")){if(i=new r(e.uid,i),"blob"===n)return i;try{if(f=new u,~t.inArray(n,["","text"]))return f.readAsText(i);if("json"===n&&window.JSON)return JSON.parse(f.readAsText(i))}finally{i.destroy()}}return null},abort:function(){var n=this.getRuntime();n.shimExec.call(this,"XMLHttpRequest","abort");this.dispatchEvent("readystatechange");this.dispatchEvent("abort")}};return n.XMLHttpRequest=s});i("moxie/runtime/flash/image/Image",["moxie/runtime/flash/Runtime","moxie/core/utils/Basic","moxie/runtime/Transporter","moxie/file/Blob","moxie/file/FileReaderSync"],function(n,t,i,r,u){var f={loadFromBlob:function(n){function f(n){u.shimExec.call(r,"Image","loadFromBlob",n.uid);r=u=null}var r=this,u=r.getRuntime(),t;n.isDetached()?(t=new i,t.bind("TransportingComplete",function(){f(t.result.getSource())}),t.transport(n.getSource(),n.type,{ruid:u.uid})):f(n.getSource())},loadFromImage:function(n){var t=this.getRuntime();return t.shimExec.call(this,"Image","loadFromImage",n.uid)},getInfo:function(){var t=this.getRuntime(),n=t.shimExec.call(this,"Image","getInfo");return n.meta&&n.meta.thumb&&n.meta.thumb.data&&!(t.meta.thumb.data instanceof r)&&(n.meta.thumb.data=new r(t.uid,n.meta.thumb.data)),n},getAsBlob:function(n,t){var i=this.getRuntime(),u=i.shimExec.call(this,"Image","getAsBlob",n,t);return u?new r(i.uid,u):null},getAsDataURL:function(){var n,i=this.getRuntime(),t=i.Image.getAsBlob.apply(this,arguments);return t?(n=new u,n.readAsDataURL(t)):null}};return n.Image=f});i("moxie/runtime/silverlight/Runtime",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/runtime/Runtime"],function(n,t,i,u,f){function s(n){var r,t,i,u,o,f=!1,s=null,e=0,h;try{try{s=new ActiveXObject("AgControl.AgControl");s.IsVersionSupported(n)&&(f=!0);s=null}catch(c){if(h=navigator.plugins["Silverlight Plug-In"],h){for(r=h.description,"1.0.30226.2"===r&&(r="2.0.30226.2"),t=r.split(".");t.length>3;)t.pop();for(;t.length<4;)t.push(0);for(i=n.split(".");i.length>4;)i.pop();do u=parseInt(i[e],10),o=parseInt(t[e],10),e++;while(e<i.length&&u===o);o>=u&&!isNaN(u)&&(f=!0)}}}catch(l){f=!1}return f}function h(h){var l,c=this;h=n.extend({xap_url:t.xap_url},h);f.call(this,h,e,{access_binary:f.capTrue,access_image_binary:f.capTrue,display_media:f.capTest(r("moxie/image/Image")),do_cors:f.capTrue,drag_and_drop:!1,report_upload_progress:f.capTrue,resize_image:f.capTrue,return_response_headers:function(n){return n&&"client"===c.mode},return_response_type:function(n){return"json"!==n?!0:!!window.JSON},return_status_code:function(t){return"client"===c.mode||!n.arrayDiff(t,[200,404])},select_file:f.capTrue,select_multiple:f.capTrue,send_binary_string:f.capTrue,send_browser_cookies:function(n){return n&&"browser"===c.mode},send_custom_headers:function(n){return n&&"client"===c.mode},send_multipart:f.capTrue,slice_blob:f.capTrue,stream_upload:!0,summon_file_dialog:!1,upload_filesize:f.capTrue,use_http_method:function(t){return"client"===c.mode||!n.arrayDiff(t,["GET","POST"])}},{return_response_headers:function(n){return n?"client":"browser"},return_status_code:function(t){return n.arrayDiff(t,[200,404])?"client":["client","browser"]},send_browser_cookies:function(n){return n?"browser":"client"},send_custom_headers:function(n){return n?"client":"browser"},use_http_method:function(t){return n.arrayDiff(t,["GET","POST"])?"client":["client","browser"]}});s("2.0.31005.0")&&"Opera"!==t.browser||(this.mode=!1);n.extend(this,{getShim:function(){return i.get(this.uid).content.Moxie},shimExec:function(n,t){var i=[].slice.call(arguments,2);return c.getShim().exec(this.uid,n,t,i)},init:function(){var n;n=this.getShimContainer();n.innerHTML='<object id="'+this.uid+'" data="data:application/x-silverlight," type="application/x-silverlight-2" width="100%" height="100%" style="outline:none;"><param name="source" value="'+h.xap_url+'"/><param name="background" value="Transparent"/><param name="windowless" value="true"/><param name="enablehtmlaccess" value="true"/><param name="initParams" value="uid='+this.uid+",target="+f.getGlobalEventTarget()+'"/><\/object>';l=setTimeout(function(){c&&!c.initialized&&c.trigger("Error",new u.RuntimeError(u.RuntimeError.NOT_INIT_ERR))},"Windows"!==t.OS?1e4:5e3)},destroy:function(n){return function(){n.call(c);clearTimeout(l);h=l=n=c=null}}(this.destroy)},o)}var e="silverlight",o={};return f.addConstructor(e,h),o});i("moxie/runtime/silverlight/file/Blob",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/file/Blob"],function(n,t,i){return n.Blob=t.extend({},i)});i("moxie/runtime/silverlight/file/FileInput",["moxie/runtime/silverlight/Runtime","moxie/file/File","moxie/core/utils/Dom","moxie/core/utils/Basic"],function(n,t,i,r){function u(n){for(var i="",t=0;t<n.length;t++)i+=(""!==i?"|":"")+n[t].title+" | *."+n[t].extensions.replace(/,/g,";*.");return i}var f={init:function(n){var f=this,e=this.getRuntime(),o=i.get(n.browse_button);o&&(o.setAttribute("tabindex",-1),o=null);this.bind("Change",function(){var n=e.shimExec.call(f,"FileInput","getFiles");f.files=[];r.each(n,function(n){f.files.push(new t(e.uid,n))})},999);e.shimExec.call(this,"FileInput","init",u(n.accept),n.multiple);this.trigger("ready")},setOption:function(n,t){"accept"==n&&(t=u(t));this.getRuntime().shimExec.call(this,"FileInput","setOption",n,t)}};return n.FileInput=f});i("moxie/runtime/silverlight/file/FileDrop",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Dom","moxie/core/utils/Events"],function(n,t,i){var r={init:function(){var n,r=this,u=r.getRuntime();return n=u.getShimContainer(),i.addEvent(n,"dragover",function(n){n.preventDefault();n.stopPropagation();n.dataTransfer.dropEffect="copy"},r.uid),i.addEvent(n,"dragenter",function(n){n.preventDefault();var i=t.get(u.uid).dragEnter(n);i&&n.stopPropagation()},r.uid),i.addEvent(n,"drop",function(n){n.preventDefault();var i=t.get(u.uid).dragDrop(n);i&&n.stopPropagation()},r.uid),u.shimExec.call(this,"FileDrop","init")}};return n.FileDrop=r});i("moxie/runtime/silverlight/file/FileReader",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/file/FileReader"],function(n,t,i){return n.FileReader=t.extend({},i)});i("moxie/runtime/silverlight/file/FileReaderSync",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/file/FileReaderSync"],function(n,t,i){return n.FileReaderSync=t.extend({},i)});i("moxie/runtime/silverlight/runtime/Transporter",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/runtime/Transporter"],function(n,t,i){return n.Transporter=t.extend({},i)});i("moxie/runtime/silverlight/xhr/XMLHttpRequest",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/xhr/XMLHttpRequest","moxie/runtime/silverlight/file/FileReaderSync","moxie/runtime/silverlight/runtime/Transporter"],function(n,t,i){return n.XMLHttpRequest=t.extend({},i)});i("moxie/runtime/silverlight/image/Image",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/file/Blob","moxie/runtime/flash/image/Image"],function(n,t,i,r){return n.Image=t.extend({},r,{getInfo:function(){var u=this.getRuntime(),n={meta:{}},r=u.shimExec.call(this,"Image","getInfo");return r.meta&&(t.each(["tiff","exif","gps","thumb"],function(t){var e,f,o,i,u=r.meta[t];if(u&&u.keys)for(n.meta[t]={},f=0,o=u.keys.length;o>f;f++)e=u.keys[f],i=u[e],i&&(/^(\d|[1-9]\d+)$/.test(i)?i=parseInt(i,10):/^\d*\.\d+$/.test(i)&&(i=parseFloat(i)),n.meta[t][e]=i)}),n.meta&&n.meta.thumb&&n.meta.thumb.data&&!(u.meta.thumb.data instanceof i)&&(n.meta.thumb.data=new i(u.uid,n.meta.thumb.data))),n.width=parseInt(r.width,10),n.height=parseInt(r.height,10),n.size=parseInt(r.size,10),n.type=r.type,n.name=r.name,n},resize:function(n,t,i){this.getRuntime().shimExec.call(this,"Image","resize",n.x,n.y,n.width,n.height,t,i.preserveHeaders,i.resample)}})});i("moxie/runtime/html4/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(n,t,i,u){function o(t){var o=this,s=i.capTest,h=i.capTrue;i.call(this,t,e,{access_binary:s(window.FileReader||window.File&&File.getAsDataURL),access_image_binary:!1,display_media:s((u.can("create_canvas")||u.can("use_data_uri_over32kb"))&&r("moxie/image/Image")),do_cors:!1,drag_and_drop:!1,filter_by_extension:s(function(){return!("Chrome"===u.browser&&u.verComp(u.version,28,"<")||"IE"===u.browser&&u.verComp(u.version,10,"<")||"Safari"===u.browser&&u.verComp(u.version,7,"<")||"Firefox"===u.browser&&u.verComp(u.version,37,"<"))}()),resize_image:function(){return f.Image&&o.can("access_binary")&&u.can("create_canvas")},report_upload_progress:!1,return_response_headers:!1,return_response_type:function(t){return"json"===t&&window.JSON?!0:!!~n.inArray(t,["text","document",""])},return_status_code:function(t){return!n.arrayDiff(t,[200,404])},select_file:function(){return u.can("use_fileinput")},select_multiple:!1,send_binary_string:!1,send_custom_headers:!1,send_multipart:!0,slice_blob:!1,stream_upload:function(){return o.can("select_file")},summon_file_dialog:function(){return o.can("select_file")&&!("Firefox"===u.browser&&u.verComp(u.version,4,"<")||"Opera"===u.browser&&u.verComp(u.version,12,"<")||"IE"===u.browser&&u.verComp(u.version,10,"<"))},upload_filesize:h,use_http_method:function(t){return!n.arrayDiff(t,["GET","POST"])}});n.extend(this,{init:function(){this.trigger("Init")},destroy:function(n){return function(){n.call(o);n=o=null}}(this.destroy)});n.extend(this.getShim(),f)}var e="html4",f={};return i.addConstructor(e,o),f});i("moxie/runtime/html4/file/FileInput",["moxie/runtime/html4/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(n,t,i,r,u,f,e){function o(){function c(){var w,v,a,h,f,y,l=this,p=l.getRuntime();y=i.guid("uid_");w=p.getShimContainer();o&&(a=r.get(o+"_form"),a&&(i.extend(a.style,{top:"100%"}),a.firstChild.setAttribute("tabindex",-1)));h=document.createElement("form");h.setAttribute("id",y+"_form");h.setAttribute("method","post");h.setAttribute("enctype","multipart/form-data");h.setAttribute("encoding","multipart/form-data");i.extend(h.style,{overflow:"hidden",position:"absolute",top:0,left:0,width:"100%",height:"100%"});f=document.createElement("input");f.setAttribute("id",y);f.setAttribute("type","file");f.setAttribute("accept",s.join(","));p.can("summon_file_dialog")&&f.setAttribute("tabindex",-1);i.extend(f.style,{fontSize:"999px",opacity:0});h.appendChild(f);w.appendChild(h);i.extend(f.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"});"IE"===e.browser&&e.verComp(e.version,10,"<")&&i.extend(f.style,{filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"});f.onchange=function(){var n;this.value&&(n=this.files?this.files[0]:{name:this.value},n=new t(p.uid,n),this.onchange=function(){},c.call(l),l.files=[n],f.setAttribute("id",n.uid),h.setAttribute("id",n.uid+"_form"),l.trigger("change"),f=h=null)};p.can("summon_file_dialog")&&(v=r.get(n.browse_button),u.removeEvent(v,"click",l.uid),u.addEvent(v,"click",function(n){f&&!f.disabled&&f.click();n.preventDefault()},l.uid));o=y;w=a=v=null}var o,n,h,s=[];i.extend(this,{init:function(t){var o,i=this,e=i.getRuntime();n=t;s=f.extList2mimes(t.accept,e.can("filter_by_extension"));o=e.getShimContainer(),function(){var f,c,s;f=r.get(t.browse_button);h=r.getStyle(f,"z-index")||"auto";e.can("summon_file_dialog")?("static"===r.getStyle(f,"position")&&(f.style.position="relative"),i.bind("Refresh",function(){c=parseInt(h,10)||1;r.get(n.browse_button).style.zIndex=c;this.getRuntime().getShimContainer().style.zIndex=c-1})):f.setAttribute("tabindex",-1);s=e.can("summon_file_dialog")?f:o;u.addEvent(s,"mouseover",function(){i.trigger("mouseenter")},i.uid);u.addEvent(s,"mouseout",function(){i.trigger("mouseleave")},i.uid);u.addEvent(s,"mousedown",function(){i.trigger("mousedown")},i.uid);u.addEvent(r.get(t.container),"mouseup",function(){i.trigger("mouseup")},i.uid);f=null}();c.call(this);o=null;i.trigger({type:"ready",async:!0})},setOption:function(n,t){var i,u=this.getRuntime();"accept"==n&&(s=t.mimes||f.extList2mimes(t,u.can("filter_by_extension")));i=r.get(o);i&&i.setAttribute("accept",s.join(","))},disable:function(n){var t;(t=r.get(o))&&(t.disabled=!!n)},destroy:function(){var e=this.getRuntime(),c=e.getShim(),t=e.getShimContainer(),f=n&&r.get(n.container),i=n&&r.get(n.browse_button);f&&u.removeAllEvents(f,this.uid);i&&(u.removeAllEvents(i,this.uid),i.style.zIndex=h);t&&(u.removeAllEvents(t,this.uid),t.innerHTML="");c.removeInstance(this.uid);o=s=n=t=f=i=c=null}})}return n.FileInput=o});i("moxie/runtime/html4/file/FileReader",["moxie/runtime/html4/Runtime","moxie/runtime/html5/file/FileReader"],function(n,t){return n.FileReader=t});i("moxie/runtime/html4/xhr/XMLHttpRequest",["moxie/runtime/html4/Runtime","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Url","moxie/core/Exceptions","moxie/core/utils/Events","moxie/file/Blob","moxie/xhr/FormData"],function(n,t,i,r,u,f,e,o){function s(){function c(t){var o,u,r,e,s=this,h=!1;if(n){if(o=n.id.replace(/_iframe$/,""),u=i.get(o+"_form")){for(r=u.getElementsByTagName("input"),e=r.length;e--;)switch(r[e].getAttribute("type")){case"hidden":r[e].parentNode.removeChild(r[e]);break;case"file":h=!0}r=[];h||u.parentNode.removeChild(u);u=null}setTimeout(function(){f.removeEvent(n,"load",s.uid);n.parentNode&&n.parentNode.removeChild(n);var i=s.getRuntime().getShimContainer();i.children.length||i.parentNode.removeChild(i);i=n=null;t()},1)}}var h,s,n;t.extend(this,{send:function(l,a){function d(){var u=k.getShimContainer()||document.body,i=document.createElement("div");i.innerHTML='<iframe id="'+p+'_iframe" name="'+p+'_iframe" src="javascript:&quot;&quot;" style="display:none"><\/iframe>';n=i.firstChild;u.appendChild(n);f.addEvent(n,"load",function(){var i;try{i=n.contentWindow.document||n.contentDocument||window.frames[n.id].document;/^4(0[0-9]|1[0-7]|2[2346])\s/.test(i.title)?h=i.title.replace(/^(\d+).*$/,"$1"):(h=200,s=t.trim(i.body.innerHTML),y.trigger({type:"progress",loaded:s.length,total:s.length}),b&&y.trigger({type:"uploadprogress",loaded:b.size||1025,total:b.size||1025}))}catch(u){if(!r.hasSameOrigin(l.url))return c.call(y,function(){y.trigger("error")}),void 0;h=404}c.call(y,function(){y.trigger("load")})},y.uid)}var p,v,w,b,y=this,k=y.getRuntime();if(h=s=null,a instanceof o&&a.hasBlob()){if(b=a.getBlob(),p=b.uid,w=i.get(p),v=i.get(p+"_form"),!v)throw new u.DOMException(u.DOMException.NOT_FOUND_ERR);}else p=t.guid("uid_"),v=document.createElement("form"),v.setAttribute("id",p+"_form"),v.setAttribute("method",l.method),v.setAttribute("enctype","multipart/form-data"),v.setAttribute("encoding","multipart/form-data"),k.getShimContainer().appendChild(v);v.setAttribute("target",p+"_iframe");a instanceof o&&a.each(function(n,i){if(n instanceof e)w&&w.setAttribute("name",i);else{var r=document.createElement("input");t.extend(r,{type:"hidden",name:i,value:n});w?v.insertBefore(r,w):v.appendChild(r)}});v.setAttribute("action",l.url);d();v.submit();y.trigger("loadstart")},getStatus:function(){return h},getResponse:function(n){if("json"===n&&"string"===t.typeOf(s)&&window.JSON)try{return JSON.parse(s.replace(/^\s*<pre[^>]*>/,"").replace(/<\/pre>\s*$/,""))}catch(i){return null}return s},abort:function(){var t=this;n&&n.contentWindow&&(n.contentWindow.stop?n.contentWindow.stop():n.contentWindow.document.execCommand?n.contentWindow.document.execCommand("Stop"):n.src="about:blank");c.call(this,function(){t.dispatchEvent("abort")})},destroy:function(){this.getRuntime().getShim().removeInstance(this.uid)}})}return n.XMLHttpRequest=s});i("moxie/runtime/html4/image/Image",["moxie/runtime/html4/Runtime","moxie/runtime/html5/image/Image"],function(n,t){return n.Image=t});o(["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Dom","moxie/core/EventTarget","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/Blob","moxie/core/I18n","moxie/core/utils/Mime","moxie/file/FileInput","moxie/file/File","moxie/file/FileDrop","moxie/file/FileReader","moxie/core/utils/Url","moxie/runtime/RuntimeTarget","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/image/Image","moxie/core/utils/Events","moxie/runtime/html5/image/ResizerCanvas"])}(this)});!function(n,t){var i=function(){var n={};return t.apply(n,arguments),n.plupload};"function"==typeof define&&define.amd?define("plupload",["./moxie"],i):"object"==typeof module&&module.exports?module.exports=i(require("./moxie")):n.plupload=i(n.moxie)}(this||window,function(n){!function(n,t,i){function s(n){function u(n,i,r){var u={chunks:"slice_blob",jpgresize:"send_binary_string",pngresize:"send_binary_string",progress:"report_upload_progress",multi_selection:"select_multiple",dragdrop:"drag_and_drop",drop_element:"drag_and_drop",headers:"send_custom_headers",urlstream_upload:"send_binary_string",canSendBinary:"send_binary",triggerDialog:"summon_file_dialog"};u[n]?t[u[n]]=i:r||(t[n]=i)}var i=n.required_features,t={};return"string"==typeof i?r.each(i.split(/\s*,\s*/),function(n){u(n,!0)}):"object"==typeof i?r.each(i,function(n,t){u(t,n)}):i===!0&&(n.chunk_size&&n.chunk_size>0&&(t.slice_blob=!0),r.isEmptyObj(n.resize)&&n.multipart!==!1||(t.send_binary_string=!0),n.http_method&&(t.use_http_method=n.http_method),r.each(n,function(n,t){u(t,!!n,!0)})),t}var e=window.setTimeout,o={},u=t.core.utils,f=t.runtime.Runtime,r={VERSION:"2.3.3",STOPPED:1,STARTED:2,QUEUED:1,UPLOADING:2,FAILED:4,DONE:5,GENERIC_ERROR:-100,HTTP_ERROR:-200,IO_ERROR:-300,SECURITY_ERROR:-400,INIT_ERROR:-500,FILE_SIZE_ERROR:-600,FILE_EXTENSION_ERROR:-601,FILE_DUPLICATE_ERROR:-602,IMAGE_FORMAT_ERROR:-700,MEMORY_ERROR:-701,IMAGE_DIMENSIONS_ERROR:-702,moxie:t,mimeTypes:u.Mime.mimes,ua:u.Env,typeOf:u.Basic.typeOf,extend:u.Basic.extend,guid:u.Basic.guid,getAll:function(n){var t,i=[],u;for("array"!==r.typeOf(n)&&(n=[n]),u=n.length;u--;)t=r.get(n[u]),t&&i.push(t);return i.length?i:null},get:u.Dom.get,each:u.Basic.each,getPos:u.Dom.getPos,getSize:u.Dom.getSize,xmlEncode:function(n){var t={"<":"lt",">":"gt","&":"amp",'"':"quot","'":"#39"};return n?(""+n).replace(/[<>&\"\']/g,function(n){return t[n]?"&"+t[n]+";":n}):n},toArray:u.Basic.toArray,inArray:u.Basic.inArray,inSeries:u.Basic.inSeries,addI18n:t.core.I18n.addI18n,translate:t.core.I18n.translate,sprintf:u.Basic.sprintf,isEmptyObj:u.Basic.isEmptyObj,hasClass:u.Dom.hasClass,addClass:u.Dom.addClass,removeClass:u.Dom.removeClass,getStyle:u.Dom.getStyle,addEvent:u.Events.addEvent,removeEvent:u.Events.removeEvent,removeAllEvents:u.Events.removeAllEvents,cleanName:function(n){for(var i=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"],t=0;t<i.length;t+=2)n=n.replace(i[t],i[t+1]);return n=n.replace(/\s+/g,"_"),n=n.replace(/[^a-z0-9_\-\.]+/gi,"")},buildUrl:function(n,t){var i="";return r.each(t,function(n,t){i+=(i?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(n)}),i&&(n+=(n.indexOf("?")>0?"&":"?")+i),n},formatSize:function(n){function u(n,t){return Math.round(n*Math.pow(10,t))/Math.pow(10,t)}if(n===i||/\D/.test(n))return r.translate("N/A");var t=Math.pow(1024,4);return n>t?u(n/t,1)+" "+r.translate("tb"):n>(t/=1024)?u(n/t,1)+" "+r.translate("gb"):n>(t/=1024)?u(n/t,1)+" "+r.translate("mb"):n>1024?Math.round(n/1024)+" "+r.translate("kb"):n+" "+r.translate("b")},parseSize:u.Basic.parseSizeStr,predictRuntime:function(n,t){var i,u;return i=new r.Uploader(n),u=f.thatCan(i.getOption().required_features,t||n.runtimes),i.destroy(),u},addFileFilter:function(n,t){o[n]=t}};r.addFileFilter("mime_types",function(n,t,i){n.length&&!n.regexp.test(t.name)?(this.trigger("Error",{code:r.FILE_EXTENSION_ERROR,message:r.translate("File extension error."),file:t}),i(!1)):i(!0)});r.addFileFilter("max_file_size",function(n,t,i){var u;n=r.parseSize(n);t.size!==u&&n&&t.size>n?(this.trigger("Error",{code:r.FILE_SIZE_ERROR,message:r.translate("File size error."),file:t}),i(!1)):i(!0)});r.addFileFilter("prevent_duplicates",function(n,t,i){if(n)for(var u=this.files.length;u--;)if(t.name===this.files[u].name&&t.size===this.files[u].size)return this.trigger("Error",{code:r.FILE_DUPLICATE_ERROR,message:r.translate("Duplicate file error."),file:t}),i(!1),void 0;i(!0)});r.addFileFilter("prevent_empty",function(n,t,u){n&&!t.size&&t.size!==i?(this.trigger("Error",{code:r.FILE_SIZE_ERROR,message:r.translate("File size error."),file:t}),u(!1)):u(!0)});r.Uploader=function(n){function k(){var n,t,i=0;if(this.state==r.STARTED){for(t=0;t<c.length;t++)n||c[t].status!=r.QUEUED?i++:(n=c[t],this.trigger("BeforeUpload",n)&&(n.status=r.UPLOADING,this.trigger("UploadFile",n)));i==c.length&&(this.state!==r.STOPPED&&(this.state=r.STOPPED,this.trigger("StateChanged")),this.trigger("UploadComplete",c))}}function g(n){n.percent=n.size>0?Math.ceil(100*(n.loaded/n.size)):100;p()}function p(){var t,n,u,f=0;for(l.reset(),t=0;t<c.length;t++)n=c[t],n.size!==i?(l.size+=n.origSize,u=n.loaded*n.origSize/n.size,(!n.completeTimestamp||n.completeTimestamp>w)&&(f+=u),l.loaded+=u):l.size=i,n.status==r.DONE?l.uploaded++:n.status==r.FAILED?l.failed++:l.queued++;l.size===i?l.percent=c.length>0?Math.ceil(100*(l.uploaded/c.length)):0:(l.bytesPerSec=Math.ceil(f/((+new Date-w||1)/1e3)),l.percent=l.size>0?Math.ceil(100*(l.loaded/l.size)):0)}function d(){var n=a[0]||v[0];return n?n.getRuntime().uid:!1}function rt(){this.bind("FilesAdded FilesRemoved",function(n){n.trigger("QueueChanged");n.refresh()});this.bind("CancelUpload",ht);this.bind("BeforeUpload",ft);this.bind("UploadFile",et);this.bind("UploadProgress",ot);this.bind("StateChanged",st);this.bind("QueueChanged",p);this.bind("Error",lt);this.bind("FileUploaded",ct);this.bind("Destroy",at)}function nt(n,i){var u=this,e=0,o=[],s={runtime_order:n.runtimes,required_caps:n.required_features,preferred_caps:b,swf_url:n.flash_swf_url,xap_url:n.silverlight_xap_url};r.each(n.runtimes.split(/\s*,\s*/),function(t){n[t]&&(s[t]=n[t])});n.browse_button&&r.each(n.browse_button,function(i){o.push(function(o){var h=new t.file.FileInput(r.extend({},s,{accept:n.filters.mime_types,name:n.file_data_name,multiple:n.multi_selection,container:n.container,browse_button:i}));h.onready=function(){var n=f.getInfo(this.ruid);r.extend(u.features,{chunks:n.can("slice_blob"),multipart:n.can("send_multipart"),multi_selection:n.can("select_multiple")});e++;a.push(this);o()};h.onchange=function(){u.addFile(this.files)};h.bind("mouseenter mouseleave mousedown mouseup",function(t){y||(n.browse_button_hover&&("mouseenter"===t.type?r.addClass(i,n.browse_button_hover):"mouseleave"===t.type&&r.removeClass(i,n.browse_button_hover)),n.browse_button_active&&("mousedown"===t.type?r.addClass(i,n.browse_button_active):"mouseup"===t.type&&r.removeClass(i,n.browse_button_active)))});h.bind("mousedown",function(){u.trigger("Browse")});h.bind("error runtimeerror",function(){h=null;o()});h.init()})});n.drop_element&&r.each(n.drop_element,function(n){o.push(function(i){var o=new t.file.FileDrop(r.extend({},s,{drop_zone:n}));o.onready=function(){var n=f.getInfo(this.ruid);r.extend(u.features,{chunks:n.can("slice_blob"),multipart:n.can("send_multipart"),dragdrop:n.can("drag_and_drop")});e++;v.push(this);i()};o.ondrop=function(){u.addFile(this.files)};o.bind("error runtimeerror",function(){o=null;i()});o.init()})});r.inSeries(o,function(){"function"==typeof i&&i(e)})}function ut(n,r,u,f){var e=new t.image.Image;try{e.onload=function(){r.width>this.width&&r.height>this.height&&r.quality===i&&r.preserve_headers&&!r.crop?(this.destroy(),f(n)):e.downsize(r.width,r.height,r.crop,r.preserve_headers)};e.onresize=function(){var t=this.getAsBlob(n.type,r.quality);this.destroy();f(t)};e.bind("error runtimeerror",function(){this.destroy();f(n)});e.load(n,u)}catch(o){f(n)}}function tt(n,i,e){function h(n,i,f){var e=u[n];switch(n){case"max_file_size":"max_file_size"===n&&(u.max_file_size=u.filters.max_file_size=i);break;case"chunk_size":(i=r.parseSize(i))&&(u[n]=i,u.send_file_name=!0);break;case"multipart":u[n]=i;i||(u.send_file_name=!0);break;case"http_method":u[n]="PUT"===i.toUpperCase()?"PUT":"POST";break;case"unique_names":u[n]=i;i&&(u.send_file_name=!0);break;case"filters":"array"===r.typeOf(i)&&(i={mime_types:i});f?r.extend(u.filters,i):u.filters=i;i.mime_types&&("string"===r.typeOf(i.mime_types)&&(i.mime_types=t.core.utils.Mime.mimes2extList(i.mime_types)),i.mime_types.regexp=function(n){var t=[];return r.each(n,function(n){r.each(n.extensions.split(/,/),function(n){/^\s*\*\s*$/.test(n)?t.push("\\.*"):t.push("\\."+n.replace(new RegExp("["+"/^$.*+?|()[]{}\\".replace(/./g,"\\$&")+"]","g"),"\\$&"))})}),new RegExp("("+t.join("|")+")$","i")}(i.mime_types),u.filters.mime_types=i.mime_types);break;case"resize":u.resize=i?r.extend({preserve_headers:!0,crop:!1},i):!1;break;case"prevent_duplicates":u.prevent_duplicates=u.filters.prevent_duplicates=!!i;break;case"container":case"browse_button":case"drop_element":i="container"===n?r.get(i):r.getAll(i);case"runtimes":case"multi_selection":case"flash_swf_url":case"silverlight_xap_url":u[n]=i;f||(c=!0);break;default:u[n]=i}f||o.trigger("OptionChanged",n,i,e)}var o=this,c=!1;"object"==typeof n?r.each(n,function(n,t){h(t,n,e)}):h(n,i,e);e?(u.required_features=s(r.extend({},u)),b=s(r.extend({},u,{required_features:!0}))):c&&(o.trigger("Destroy"),nt.call(o,u,function(n){n?(o.runtime=f.getInfo(d()).type,o.trigger("Init",{runtime:o.runtime}),o.trigger("PostInit")):o.trigger("Error",{code:r.INIT_ERROR,message:r.translate("Init error.")})}))}function ft(n,t){if(n.settings.unique_names){var i=t.name.match(/\.([^.]+)$/),r="part";i&&(r=i[1]);t.target_name=t.id+"."+r}}function et(n,i){function v(){y-->0?e(s,1e3):(i.loaded=f,n.trigger("Error",{code:r.HTTP_ERROR,message:r.translate("HTTP Error."),file:i,response:h.responseText,status:h.status,responseHeaders:h.getAllResponseHeaders()}))}function s(){var e,s,t={};i.status===r.UPLOADING&&n.state!==r.STOPPED&&(n.settings.send_file_name&&(t.name=i.target_name||i.name),o&&l.chunks&&u.size>o?(s=Math.min(o,u.size-f),e=u.slice(f,f+s)):(s=u.size,e=u),o&&l.chunks&&(n.settings.send_chunk_number?(t.chunk=Math.ceil(f/o),t.chunks=Math.ceil(u.size/o)):(t.offset=f,t.total=u.size)),n.trigger("BeforeChunkUpload",i,t,e,f)&&p(t,e,s))}function p(o,p,w){var b;h=new t.xhr.XMLHttpRequest;h.upload&&(h.upload.onprogress=function(t){i.loaded=Math.min(i.size,f+t.loaded);n.trigger("UploadProgress",i)});h.onload=function(){return h.status<200&&h.status>=400?(v(),void 0):(y=n.settings.max_retries,w<u.size?(p.destroy(),f+=w,i.loaded=Math.min(f,u.size),n.trigger("ChunkUploaded",i,{offset:i.loaded,total:u.size,response:h.responseText,status:h.status,responseHeaders:h.getAllResponseHeaders()}),"Android Browser"===r.ua.browser&&n.trigger("UploadProgress",i)):i.loaded=i.size,p=b=null,!f||f>=u.size?(i.size!=i.origSize&&(u.destroy(),u=null),n.trigger("UploadProgress",i),i.status=r.DONE,i.completeTimestamp=+new Date,n.trigger("FileUploaded",i,{response:h.responseText,status:h.status,responseHeaders:h.getAllResponseHeaders()})):e(s,1),void 0)};h.onerror=function(){v()};h.onloadend=function(){this.destroy()};n.settings.multipart&&l.multipart?(h.open(n.settings.http_method,c,!0),r.each(n.settings.headers,function(n,t){h.setRequestHeader(t,n)}),b=new t.xhr.FormData,r.each(r.extend(o,n.settings.multipart_params),function(n,t){b.append(t,n)}),b.append(n.settings.file_data_name,p),h.send(b,a)):(c=r.buildUrl(n.settings.url,r.extend(o,n.settings.multipart_params)),h.open(n.settings.http_method,c,!0),r.each(n.settings.headers,function(n,t){h.setRequestHeader(t,n)}),h.hasRequestHeader("Content-Type")||h.setRequestHeader("Content-Type","application/octet-stream"),h.send(p,a))}var u,c=n.settings.url,o=n.settings.chunk_size,y=n.settings.max_retries,l=n.features,f=0,a={runtime_order:n.settings.runtimes,required_caps:n.settings.required_features,preferred_caps:b,swf_url:n.settings.flash_swf_url,xap_url:n.settings.silverlight_xap_url};i.loaded&&(f=i.loaded=o?o*Math.floor(i.loaded/o):0);u=i.getSource();r.isEmptyObj(n.settings.resize)||-1===r.inArray(u.type,["image/jpeg","image/png"])?s():ut(u,n.settings.resize,a,function(n){u=n;i.size=n.size;s()})}function ot(n,t){g(t)}function st(n){if(n.state==r.STARTED)w=+new Date;else if(n.state==r.STOPPED)for(var t=n.files.length-1;t>=0;t--)n.files[t].status==r.UPLOADING&&(n.files[t].status=r.QUEUED,p())}function ht(){h&&h.abort()}function ct(n){p();e(function(){k.call(n)},1)}function lt(n,t){t.code===r.INIT_ERROR?n.destroy():t.code===r.HTTP_ERROR&&(t.file.status=r.FAILED,t.file.completeTimestamp=+new Date,g(t.file),n.state==r.STARTED&&(n.trigger("CancelUpload"),e(function(){k.call(n)},1)))}function at(n){n.stop();r.each(c,function(n){n.destroy()});c=[];a.length&&(r.each(a,function(n){n.destroy()}),a=[]);v.length&&(r.each(v,function(n){n.destroy()}),v=[]);b={};y=!1;w=h=null;l.reset()}var u,w,l,h,it=r.guid(),c=[],b={},a=[],v=[],y=!1;u={chunk_size:0,file_data_name:"file",filters:{mime_types:[],max_file_size:0,prevent_duplicates:!1,prevent_empty:!0},flash_swf_url:"js/Moxie.swf",http_method:"POST",max_retries:0,multipart:!0,multi_selection:!0,resize:!1,runtimes:f.order,send_file_name:!0,send_chunk_number:!0,silverlight_xap_url:"js/Moxie.xap"};tt.call(this,n,null,!0);l=new r.QueueProgress;r.extend(this,{id:it,uid:it,state:r.STOPPED,features:{},runtime:null,files:c,settings:u,total:l,init:function(){var t,i,n=this;return t=n.getOption("preinit"),"function"==typeof t?t(n):r.each(t,function(t,i){n.bind(i,t)}),rt.call(n),r.each(["container","browse_button","drop_element"],function(t){if(null===n.getOption(t))return(i={code:r.INIT_ERROR,message:r.sprintf(r.translate("%s specified, but cannot be found."),t)},!1)}),i?n.trigger("Error",i):u.browse_button||u.drop_element?(nt.call(n,u,function(t){var i=n.getOption("init");"function"==typeof i?i(n):r.each(i,function(t,i){n.bind(i,t)});t?(n.runtime=f.getInfo(d()).type,n.trigger("Init",{runtime:n.runtime}),n.trigger("PostInit")):n.trigger("Error",{code:r.INIT_ERROR,message:r.translate("Init error.")})}),void 0):n.trigger("Error",{code:r.INIT_ERROR,message:r.translate("You must specify either browse_button or drop_element.")})},setOption:function(n,t){tt.call(this,n,t,!this.runtime)},getOption:function(n){return n?u[n]:u},refresh:function(){a.length&&r.each(a,function(n){n.trigger("Refresh")});this.trigger("Refresh")},start:function(){this.state!=r.STARTED&&(this.state=r.STARTED,this.trigger("StateChanged"),k.call(this))},stop:function(){this.state!=r.STOPPED&&(this.state=r.STOPPED,this.trigger("StateChanged"),this.trigger("CancelUpload"))},disableBrowse:function(){y=arguments[0]!==i?arguments[0]:!0;a.length&&r.each(a,function(n){n.disable(y)});this.trigger("DisableBrowse",y)},getFile:function(n){for(var t=c.length-1;t>=0;t--)if(c[t].id===n)return c[t]},addFile:function(n,i){function a(n,t){var i=[];r.each(s.settings.filters,function(t,r){o[r]&&i.push(function(i){o[r].call(s,t,n,function(n){i(!n)})})});r.inSeries(i,t)}function u(n){var o=r.typeOf(n);if(n instanceof t.file.File){if(!n.ruid&&!n.isDetached()){if(!f)return!1;n.ruid=f;n.connectRuntime(f)}u(new r.File(n))}else n instanceof t.file.Blob?(u(n.getSource()),n.destroy()):n instanceof r.File?(i&&(n.name=i),h.push(function(t){a(n,function(i){i||(c.push(n),l.push(n),s.trigger("FileFiltered",n));e(t,1)})})):-1!==r.inArray(o,["file","blob"])?u(new t.file.File(null,n)):"node"===o&&"filelist"===r.typeOf(n.files)?r.each(n.files,u):"array"===o&&(i=null,r.each(n,u))}var f,s=this,h=[],l=[];f=d();u(n);h.length&&r.inSeries(h,function(){l.length&&s.trigger("FilesAdded",l)})},removeFile:function(n){for(var i="string"==typeof n?n:n.id,t=c.length-1;t>=0;t--)if(c[t].id===i)return this.splice(t,1)[0]},splice:function(n,t){var u=c.splice(n===i?0:n,t===i?c.length:t),f=!1;return this.state==r.STARTED&&(r.each(u,function(n){if(n.status===r.UPLOADING)return(f=!0,!1)}),f&&this.stop()),this.trigger("FilesRemoved",u),r.each(u,function(n){n.destroy()}),f&&this.start(),u},dispatchEvent:function(n){var t,r,i;if(n=n.toLowerCase(),t=this.hasEventListener(n))for(t.sort(function(n,t){return t.priority-n.priority}),r=[].slice.call(arguments),r.shift(),r.unshift(this),i=0;i<t.length;i++)if(t[i].fn.apply(t[i].scope,r)===!1)return!1;return!0},bind:function(n,t,i,u){r.Uploader.prototype.bind.call(this,n,t,u,i)},destroy:function(){this.trigger("Destroy");u=l=null;this.unbindAll()}})};r.Uploader.prototype=t.core.EventTarget.instance;r.File=function(){function t(t){r.extend(this,{id:r.guid(),name:t.name||t.fileName,type:t.type||"",relativePath:t.relativePath||"",size:t.fileSize||t.size,origSize:t.fileSize||t.size,loaded:0,percent:0,status:r.QUEUED,lastModifiedDate:t.lastModifiedDate||(new Date).toLocaleString(),completeTimestamp:0,getNative:function(){var n=this.getSource().getSource();return-1!==r.inArray(r.typeOf(n),["blob","file"])?n:null},getSource:function(){return n[this.id]?n[this.id]:null},destroy:function(){var t=this.getSource();t&&(t.destroy(),delete n[this.id])}});n[this.id]=t}var n={};return t}();r.QueueProgress=function(){var n=this;n.size=0;n.loaded=0;n.uploaded=0;n.failed=0;n.queued=0;n.percent=0;n.bytesPerSec=0;n.reset=function(){n.size=n.loaded=n.uploaded=n.failed=n.queued=n.percent=n.bytesPerSec=0}};n.plupload=r}(this,n)});!function(n,t){function u(){return new Date(Date.UTC.apply(Date,arguments))}function e(){var n=new Date;return u(n.getFullYear(),n.getMonth(),n.getDate())}function y(n,t){return n.getUTCFullYear()===t.getUTCFullYear()&&n.getUTCMonth()===t.getUTCMonth()&&n.getUTCDate()===t.getUTCDate()}function c(n){return function(){return this[n].apply(this,arguments)}}function p(t,i){function o(n,t){return t.toLowerCase()}var u,f=n(t).data(),e={},s=new RegExp("^"+i.toLowerCase()+"([A-Z])"),r;i=new RegExp("^"+i.toLowerCase());for(r in f)i.test(r)&&(u=r.replace(s,o),e[u]=f[r]);return e}function w(t){var u={},i;if(r[t]||(t=t.split("-")[0],r[t]))return i=r[t],n.each(v,function(n,t){t in i&&(u[t]=i[t])}),u}var l=function(){var t={get:function(n){return this.slice(n)[0]},contains:function(n){for(var i=n&&n.valueOf(),t=0,r=this.length;r>t;t++)if(this[t].valueOf()===i)return t;return-1},remove:function(n){this.splice(n,1)},replace:function(t){t&&(n.isArray(t)||(t=[t]),this.clear(),this.push.apply(this,t))},clear:function(){this.length=0},copy:function(){var n=new l;return n.replace(this),n}};return function(){var i=[];return i.push.apply(i,arguments),n.extend(i,t),i}}(),f=function(t,r){this._process_options(r);this.dates=new l;this.viewDate=this.o.defaultViewDate;this.focusDate=null;this.element=n(t);this.isInline=!1;this.isInput=this.element.is("input");this.component=this.element.hasClass("date")?this.element.find(".add-on, .input-group-addon, .btn"):!1;this.hasInput=this.component&&this.element.find("input").length;this.component&&0===this.component.length&&(this.component=!1);this.picker=n(i.template);this._buildEvents();this._attachEvents();this.isInline?this.picker.addClass("datepicker-inline").appendTo(this.element):this.picker.addClass("datepicker-dropdown dropdown-menu");this.o.rtl&&this.picker.addClass("datepicker-rtl");this.viewMode=this.o.startView;this.o.calendarWeeks&&this.picker.find("tfoot .today, tfoot .clear").attr("colspan",function(n,t){return parseInt(t)+1});this._allow_update=!1;this.setStartDate(this._o.startDate);this.setEndDate(this._o.endDate);this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled);this.setDatesDisabled(this.o.datesDisabled);this.fillDow();this.fillMonths();this._allow_update=!0;this.update();this.showMode();this.isInline&&this.show()},h,a,o,s,v,r,i;f.prototype={constructor:f,_process_options:function(f){var o,c,a,v,h,l;this._o=n.extend({},this._o,f);o=this.o=n.extend({},this._o);c=o.language;switch(r[c]||(c=c.split("-")[0],r[c]||(c=s.language)),o.language=c,o.startView){case 2:case"decade":o.startView=2;break;case 1:case"year":o.startView=1;break;default:o.startView=0}switch(o.minViewMode){case 1:case"months":o.minViewMode=1;break;case 2:case"years":o.minViewMode=2;break;default:o.minViewMode=0}if(o.startView=Math.max(o.startView,o.minViewMode),o.multidate!==!0&&(o.multidate=Number(o.multidate)||!1,o.multidate!==!1&&(o.multidate=Math.max(0,o.multidate))),o.multidateSeparator=String(o.multidateSeparator),o.weekStart%=7,o.weekEnd=(o.weekStart+6)%7,a=i.parseFormat(o.format),(o.startDate!==-1/0&&(o.startDate=o.startDate?o.startDate instanceof Date?this._local_to_utc(this._zero_time(o.startDate)):i.parseDate(o.startDate,a,o.language):-1/0),1/0!==o.endDate&&(o.endDate=o.endDate?o.endDate instanceof Date?this._local_to_utc(this._zero_time(o.endDate)):i.parseDate(o.endDate,a,o.language):1/0),o.daysOfWeekDisabled=o.daysOfWeekDisabled||[],n.isArray(o.daysOfWeekDisabled)||(o.daysOfWeekDisabled=o.daysOfWeekDisabled.split(/[,\s]*/)),o.daysOfWeekDisabled=n.map(o.daysOfWeekDisabled,function(n){return parseInt(n,10)}),o.datesDisabled=o.datesDisabled||[],n.isArray(o.datesDisabled))||(v=[],v.push(i.parseDate(o.datesDisabled,a,o.language)),o.datesDisabled=v),o.datesDisabled=n.map(o.datesDisabled,function(n){return i.parseDate(n,a,o.language)}),h=String(o.orientation).toLowerCase().split(/\s+/g),l=o.orientation.toLowerCase(),h=n.grep(h,function(n){return/^auto|left|right|top|bottom$/.test(n)}),o.orientation={x:"auto",y:"auto"},l&&"auto"!==l)if(1===h.length)switch(h[0]){case"top":case"bottom":o.orientation.y=h[0];break;case"left":case"right":o.orientation.x=h[0]}else l=n.grep(h,function(n){return/^left|right$/.test(n)}),o.orientation.x=l[0]||"auto",l=n.grep(h,function(n){return/^top|bottom$/.test(n)}),o.orientation.y=l[0]||"auto";if(o.defaultViewDate){var y=o.defaultViewDate.year||(new Date).getFullYear(),p=o.defaultViewDate.month||0,w=o.defaultViewDate.day||1;o.defaultViewDate=u(y,p,w)}else o.defaultViewDate=e();o.showOnFocus=o.showOnFocus!==t?o.showOnFocus:!0},_events:[],_secondaryEvents:[],_applyEvents:function(n){for(var f,r,u,i=0;i<n.length;i++)f=n[i][0],2===n[i].length?(r=t,u=n[i][1]):3===n[i].length&&(r=n[i][1],u=n[i][2]),f.on(u,r)},_unapplyEvents:function(n){for(var f,r,u,i=0;i<n.length;i++)f=n[i][0],2===n[i].length?(u=t,r=n[i][1]):3===n[i].length&&(u=n[i][1],r=n[i][2]),f.off(r,u)},_buildEvents:function(){var t={keyup:n.proxy(function(t){-1===n.inArray(t.keyCode,[27,37,39,38,40,32,13,9])&&this.update()},this),keydown:n.proxy(this.keydown,this)};this.o.showOnFocus===!0&&(t.focus=n.proxy(this.show,this));this.isInput?this._events=[[this.element,t]]:this.component&&this.hasInput?this._events=[[this.element.find("input"),t],[this.component,{click:n.proxy(this.show,this)}]]:this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:n.proxy(this.show,this)}]];this._events.push([this.element,"*",{blur:n.proxy(function(n){this._focused_from=n.target},this)}],[this.element,{blur:n.proxy(function(n){this._focused_from=n.target},this)}]);this._secondaryEvents=[[this.picker,{click:n.proxy(this.click,this)}],[n(window),{resize:n.proxy(this.place,this)}],[n(document),{"mousedown touchstart":n.proxy(function(n){this.element.is(n.target)||this.element.find(n.target).length||this.picker.is(n.target)||this.picker.find(n.target).length||this.hide()},this)}]]},_attachEvents:function(){this._detachEvents();this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents();this._applyEvents(this._secondaryEvents)},_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_trigger:function(t,r){var u=r||this.dates.get(-1),f=this._utc_to_local(u);this.element.trigger({type:t,date:f,dates:n.map(this.dates,this._utc_to_local),format:n.proxy(function(n,t){0===arguments.length?(n=this.dates.length-1,t=this.o.format):"string"==typeof n&&(t=n,n=this.dates.length-1);t=t||this.o.format;var r=this.dates.get(n);return i.formatDate(r,t,this.o.language)},this)})},show:function(){if(!this.element.attr("readonly")||this.o.enableOnReadonly!==!1)return(this.isInline||this.picker.appendTo(this.o.container),this.place(),this.picker.show(),this._attachSecondaryEvents(),this._trigger("show"),(window.navigator.msMaxTouchPoints||"ontouchstart"in document)&&this.o.disableTouchKeyboard&&n(this.element).blur(),this)},hide:function(){return this.isInline?this:this.picker.is(":visible")?(this.focusDate=null,this.picker.hide().detach(),this._detachSecondaryEvents(),this.viewMode=this.o.startView,this.showMode(),this.o.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())&&this.setValue(),this._trigger("hide"),this):this},remove:function(){return this.hide(),this._detachEvents(),this._detachSecondaryEvents(),this.picker.remove(),delete this.element.data().datepicker,this.isInput||delete this.element.data().date,this},_utc_to_local:function(n){return n&&new Date(n.getTime()+6e4*n.getTimezoneOffset())},_local_to_utc:function(n){return n&&new Date(n.getTime()-6e4*n.getTimezoneOffset())},_zero_time:function(n){return n&&new Date(n.getFullYear(),n.getMonth(),n.getDate())},_zero_utc_time:function(n){return n&&new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()))},getDates:function(){return n.map(this.dates,this._utc_to_local)},getUTCDates:function(){return n.map(this.dates,function(n){return new Date(n)})},getDate:function(){return this._utc_to_local(this.getUTCDate())},getUTCDate:function(){var n=this.dates.get(-1);return"undefined"!=typeof n?new Date(n):null},clearDates:function(){var n;this.isInput?n=this.element:this.component&&(n=this.element.find("input"));n&&n.val("").change();this.update();this._trigger("changeDate");this.o.autoclose&&this.hide()},setDates:function(){var t=n.isArray(arguments[0])?arguments[0]:arguments;return this.update.apply(this,t),this._trigger("changeDate"),this.setValue(),this},setUTCDates:function(){var t=n.isArray(arguments[0])?arguments[0]:arguments;return this.update.apply(this,n.map(t,this._utc_to_local)),this._trigger("changeDate"),this.setValue(),this},setDate:c("setDates"),setUTCDate:c("setUTCDates"),setValue:function(){var n=this.getFormattedDate();return this.isInput?this.element.val(n).change():this.component&&this.element.find("input").val(n).change(),this},getFormattedDate:function(r){r===t&&(r=this.o.format);var u=this.o.language;return n.map(this.dates,function(n){return i.formatDate(n,r,u)}).join(this.o.multidateSeparator)},setStartDate:function(n){return this._process_options({startDate:n}),this.update(),this.updateNavArrows(),this},setEndDate:function(n){return this._process_options({endDate:n}),this.update(),this.updateNavArrows(),this},setDaysOfWeekDisabled:function(n){return this._process_options({daysOfWeekDisabled:n}),this.update(),this.updateNavArrows(),this},setDatesDisabled:function(n){this._process_options({datesDisabled:n});this.update();this.updateNavArrows()},place:function(){var p,s,u,w;if(this.isInline)return this;var f=this.picker.outerWidth(),e=this.picker.outerHeight(),h=n(this.o.container).width(),b=n(this.o.container).height(),c=n(this.o.container).scrollTop(),l=n(this.o.container).offset(),a=[];this.element.parents().each(function(){var t=n(this).css("z-index");"auto"!==t&&0!==t&&a.push(parseInt(t))});var v=Math.max.apply(Math,a)+10,r=this.component?this.component.parent().offset():this.element.offset(),y=this.component?this.component.outerHeight(!0):this.element.outerHeight(!1),o=this.component?this.component.outerWidth(!0):this.element.outerWidth(!1),t=r.left-l.left,i=r.top-l.top;return this.picker.removeClass("datepicker-orient-top datepicker-orient-bottom datepicker-orient-right datepicker-orient-left"),"auto"!==this.o.orientation.x?(this.picker.addClass("datepicker-orient-"+this.o.orientation.x),"right"===this.o.orientation.x&&(t-=f-o)):r.left<0?(this.picker.addClass("datepicker-orient-left"),t-=r.left-10):t+f>h?(this.picker.addClass("datepicker-orient-right"),t=r.left+o-f):this.picker.addClass("datepicker-orient-left"),u=this.o.orientation.y,("auto"===u&&(p=-c+i-e,s=c+b-(i+y+e),u=Math.max(p,s)===s?"top":"bottom"),this.picker.addClass("datepicker-orient-"+u),"top"===u?i+=y:i-=e+parseInt(this.picker.css("padding-top")),this.o.rtl)?(w=h-(t+o),this.picker.css({top:i,right:w,zIndex:v})):this.picker.css({top:i,left:t,zIndex:v}),this},_allow_update:!0,update:function(){if(!this._allow_update)return this;var r=this.dates.copy(),t=[],u=!1;return arguments.length?(n.each(arguments,n.proxy(function(n,i){i instanceof Date&&(i=this._local_to_utc(i));t.push(i)},this)),u=!0):(t=this.isInput?this.element.val():this.element.data("date")||this.element.find("input").val(),t=t&&this.o.multidate?t.split(this.o.multidateSeparator):[t],delete this.element.data().date),t=n.map(t,n.proxy(function(n){return i.parseDate(n,this.o.format,this.o.language)},this)),t=n.grep(t,n.proxy(function(n){return n<this.o.startDate||n>this.o.endDate||!n},this),!0),this.dates.replace(t),this.dates.length?this.viewDate=new Date(this.dates.get(-1)):this.viewDate<this.o.startDate?this.viewDate=new Date(this.o.startDate):this.viewDate>this.o.endDate&&(this.viewDate=new Date(this.o.endDate)),u?this.setValue():t.length&&String(r)!==String(this.dates)&&this._trigger("changeDate"),!this.dates.length&&r.length&&this._trigger("clearDate"),this.fill(),this},fillDow:function(){var t=this.o.weekStart,n="<tr>",i;for(this.o.calendarWeeks&&(this.picker.find(".datepicker-days thead tr:first-child .datepicker-switch").attr("colspan",function(n,t){return parseInt(t)+1}),i='<th class="cw">&#160;<\/th>',n+=i);t<this.o.weekStart+7;)n+='<th class="dow">'+r[this.o.language].daysMin[t++%7]+"<\/th>";n+="<\/tr>";this.picker.find(".datepicker-days thead").append(n)},fillMonths:function(){for(var n="",t=0;12>t;)n+='<span class="month">'+r[this.o.language].monthsShort[t++]+"<\/span>";this.picker.find(".datepicker-months td").html(n)},setRange:function(t){t&&t.length?this.range=n.map(t,function(n){return n.valueOf()}):delete this.range;this.fill()},getClassNames:function(t){var i=[],r=this.viewDate.getUTCFullYear(),f=this.viewDate.getUTCMonth(),u=new Date;return t.getUTCFullYear()<r||t.getUTCFullYear()===r&&t.getUTCMonth()<f?i.push("old"):(t.getUTCFullYear()>r||t.getUTCFullYear()===r&&t.getUTCMonth()>f)&&i.push("new"),this.focusDate&&t.valueOf()===this.focusDate.valueOf()&&i.push("focused"),this.o.todayHighlight&&t.getUTCFullYear()===u.getFullYear()&&t.getUTCMonth()===u.getMonth()&&t.getUTCDate()===u.getDate()&&i.push("today"),-1!==this.dates.contains(t)&&i.push("active"),(t.valueOf()<this.o.startDate||t.valueOf()>this.o.endDate||-1!==n.inArray(t.getUTCDay(),this.o.daysOfWeekDisabled))&&i.push("disabled"),this.o.datesDisabled.length>0&&n.grep(this.o.datesDisabled,function(n){return y(t,n)}).length>0&&i.push("disabled","disabled-date"),this.range&&(t>this.range[0]&&t<this.range[this.range.length-1]&&i.push("range"),-1!==n.inArray(t.valueOf(),this.range)&&i.push("selected")),i},fill:function(){var y,g=new Date(this.viewDate),f=g.getUTCFullYear(),p=g.getUTCMonth(),w=this.o.startDate!==-1/0?this.o.startDate.getUTCFullYear():-1/0,ft=this.o.startDate!==-1/0?this.o.startDate.getUTCMonth():-1/0,b=1/0!==this.o.endDate?this.o.endDate.getUTCFullYear():1/0,et=1/0!==this.o.endDate?this.o.endDate.getUTCMonth():1/0,ot=r[this.o.language].today||r.en.today||"",st=r[this.o.language].clear||r.en.clear||"",e,k,c,h,s,o,l,it,rt,a,ut,v;if(!isNaN(f)&&!isNaN(p)){for(this.picker.find(".datepicker-days thead .datepicker-switch").text(r[this.o.language].months[p]+" "+f),this.picker.find("tfoot .today").text(ot).toggle(this.o.todayBtn!==!1),this.picker.find("tfoot .clear").text(st).toggle(this.o.clearBtn!==!1),this.updateNavArrows(),this.fillMonths(),e=u(f,p-1,28),k=i.getDaysInMonth(e.getUTCFullYear(),e.getUTCMonth()),e.setUTCDate(k),e.setUTCDate(k-(e.getUTCDay()-this.o.weekStart+7)%7),c=new Date(e),c.setUTCDate(c.getUTCDate()+42),c=c.valueOf(),s=[];e.valueOf()<c;){if(e.getUTCDay()===this.o.weekStart&&(s.push("<tr>"),this.o.calendarWeeks)){var nt=new Date(+e+(this.o.weekStart-e.getUTCDay()-7)%7*864e5),tt=new Date(Number(nt)+(11-nt.getUTCDay())%7*864e5),d=new Date(Number(d=u(tt.getUTCFullYear(),0,1))+(11-d.getUTCDay())%7*864e5),ht=(tt-d)/6048e5+1;s.push('<td class="cw">'+ht+"<\/td>")}(h=this.getClassNames(e),h.push("day"),this.o.beforeShowDay!==n.noop)&&(o=this.o.beforeShowDay(this._utc_to_local(e)),o===t?o={}:"boolean"==typeof o?o={enabled:o}:"string"==typeof o&&(o={classes:o}),o.enabled===!1&&h.push("disabled"),o.classes&&(h=h.concat(o.classes.split(/\s+/))),o.tooltip&&(y=o.tooltip));h=n.unique(h);s.push('<td class="'+h.join(" ")+'"'+(y?' title="'+y+'"':"")+">"+e.getUTCDate()+"<\/td>");y=null;e.getUTCDay()===this.o.weekEnd&&s.push("<\/tr>");e.setUTCDate(e.getUTCDate()+1)}for(this.picker.find(".datepicker-days tbody").empty().append(s.join("")),l=this.picker.find(".datepicker-months").find("th:eq(1)").text(f).end().find("span").removeClass("active"),(n.each(this.dates,function(n,t){t.getUTCFullYear()===f&&l.eq(t.getUTCMonth()).addClass("active")}),(w>f||f>b)&&l.addClass("disabled"),f===w&&l.slice(0,ft).addClass("disabled"),f===b&&l.slice(et+1).addClass("disabled"),this.o.beforeShowMonth!==n.noop)&&(it=this,n.each(l,function(t,i){if(!n(i).hasClass("disabled")){var r=new Date(f,t,1),u=it.o.beforeShowMonth(r);u===!1&&n(i).addClass("disabled")}})),s="",f=10*parseInt(f/10,10),rt=this.picker.find(".datepicker-years").find("th:eq(1)").text(f+"-"+(f+9)).end().find("td"),f-=1,ut=n.map(this.dates,function(n){return n.getUTCFullYear()}),v=-1;11>v;v++)a=["year"],-1===v?a.push("old"):10===v&&a.push("new"),-1!==n.inArray(f,ut)&&a.push("active"),(w>f||f>b)&&a.push("disabled"),s+='<span class="'+a.join(" ")+'">'+f+"<\/span>",f+=1;rt.html(s)}},updateNavArrows:function(){if(this._allow_update){var t=new Date(this.viewDate),n=t.getUTCFullYear(),i=t.getUTCMonth();switch(this.viewMode){case 0:this.picker.find(".prev").css(this.o.startDate!==-1/0&&n<=this.o.startDate.getUTCFullYear()&&i<=this.o.startDate.getUTCMonth()?{visibility:"hidden"}:{visibility:"visible"});this.picker.find(".next").css(1/0!==this.o.endDate&&n>=this.o.endDate.getUTCFullYear()&&i>=this.o.endDate.getUTCMonth()?{visibility:"hidden"}:{visibility:"visible"});break;case 1:case 2:this.picker.find(".prev").css(this.o.startDate!==-1/0&&n<=this.o.startDate.getUTCFullYear()?{visibility:"hidden"}:{visibility:"visible"});this.picker.find(".next").css(1/0!==this.o.endDate&&n>=this.o.endDate.getUTCFullYear()?{visibility:"hidden"}:{visibility:"visible"})}}},click:function(t){var e,f,o,r,h,s,c;if(t.preventDefault(),r=n(t.target).closest("span, td, th"),1===r.length)switch(r[0].nodeName.toLowerCase()){case"th":switch(r[0].className){case"datepicker-switch":this.showMode(1);break;case"prev":case"next":h=i.modes[this.viewMode].navStep*("prev"===r[0].className?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveMonth(this.viewDate,h);this._trigger("changeMonth",this.viewDate);break;case 1:case 2:this.viewDate=this.moveYear(this.viewDate,h);1===this.viewMode&&this._trigger("changeYear",this.viewDate)}this.fill();break;case"today":s=new Date;s=u(s.getFullYear(),s.getMonth(),s.getDate(),0,0,0);this.showMode(-2);c="linked"===this.o.todayBtn?null:"view";this._setDate(s,c);break;case"clear":this.clearDates()}break;case"span":r.hasClass("disabled")||(this.viewDate.setUTCDate(1),r.hasClass("month")?(o=1,f=r.parent().find("span").index(r),e=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(f),this._trigger("changeMonth",this.viewDate),1===this.o.minViewMode&&this._setDate(u(e,f,o))):(o=1,f=0,e=parseInt(r.text(),10)||0,this.viewDate.setUTCFullYear(e),this._trigger("changeYear",this.viewDate),2===this.o.minViewMode&&this._setDate(u(e,f,o))),this.showMode(-1),this.fill());break;case"td":r.hasClass("day")&&!r.hasClass("disabled")&&(o=parseInt(r.text(),10)||1,e=this.viewDate.getUTCFullYear(),f=this.viewDate.getUTCMonth(),r.hasClass("old")?0===f?(f=11,e-=1):f-=1:r.hasClass("new")&&(11===f?(f=0,e+=1):f+=1),this._setDate(u(e,f,o)))}this.picker.is(":visible")&&this._focused_from&&n(this._focused_from).focus();delete this._focused_from},_toggle_multidate:function(n){var t=this.dates.contains(n);if(n||this.dates.clear(),-1!==t?(this.o.multidate===!0||this.o.multidate>1||this.o.toggleActive)&&this.dates.remove(t):this.o.multidate===!1?(this.dates.clear(),this.dates.push(n)):this.dates.push(n),"number"==typeof this.o.multidate)for(;this.dates.length>this.o.multidate;)this.dates.remove(0)},_setDate:function(n,t){t&&"date"!==t||this._toggle_multidate(n&&new Date(n));t&&"view"!==t||(this.viewDate=n&&new Date(n));this.fill();this.setValue();t&&"view"===t||this._trigger("changeDate");var i;this.isInput?i=this.element:this.component&&(i=this.element.find("input"));i&&i.change();!this.o.autoclose||t&&"date"!==t||this.hide()},moveMonth:function(n,i){var e;if(!n)return t;if(!i)return n;var u,f,r=new Date(n.valueOf()),o=r.getUTCDate(),s=r.getUTCMonth(),h=Math.abs(i);if(i=i>0?1:-1,1===h)f=-1===i?function(){return r.getUTCMonth()===s}:function(){return r.getUTCMonth()!==u},u=s+i,r.setUTCMonth(u),(0>u||u>11)&&(u=(u+12)%12);else{for(e=0;h>e;e++)r=this.moveMonth(r,i);u=r.getUTCMonth();r.setUTCDate(o);f=function(){return u!==r.getUTCMonth()}}for(;f();)r.setUTCDate(--o),r.setUTCMonth(u);return r},moveYear:function(n,t){return this.moveMonth(n,12*t)},dateWithinRange:function(n){return n>=this.o.startDate&&n<=this.o.endDate},keydown:function(n){var t,u,i,o,r,f;if(!this.picker.is(":visible"))return void(27===n.keyCode&&this.show());o=!1;r=this.focusDate||this.viewDate;switch(n.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide();n.preventDefault();break;case 37:case 39:if(!this.o.keyboardNavigation)break;t=37===n.keyCode?-1:1;n.ctrlKey?(u=this.moveYear(this.dates.get(-1)||e(),t),i=this.moveYear(r,t),this._trigger("changeYear",this.viewDate)):n.shiftKey?(u=this.moveMonth(this.dates.get(-1)||e(),t),i=this.moveMonth(r,t),this._trigger("changeMonth",this.viewDate)):(u=new Date(this.dates.get(-1)||e()),u.setUTCDate(u.getUTCDate()+t),i=new Date(r),i.setUTCDate(r.getUTCDate()+t));this.dateWithinRange(i)&&(this.focusDate=this.viewDate=i,this.setValue(),this.fill(),n.preventDefault());break;case 38:case 40:if(!this.o.keyboardNavigation)break;t=38===n.keyCode?-1:1;n.ctrlKey?(u=this.moveYear(this.dates.get(-1)||e(),t),i=this.moveYear(r,t),this._trigger("changeYear",this.viewDate)):n.shiftKey?(u=this.moveMonth(this.dates.get(-1)||e(),t),i=this.moveMonth(r,t),this._trigger("changeMonth",this.viewDate)):(u=new Date(this.dates.get(-1)||e()),u.setUTCDate(u.getUTCDate()+7*t),i=new Date(r),i.setUTCDate(r.getUTCDate()+7*t));this.dateWithinRange(i)&&(this.focusDate=this.viewDate=i,this.setValue(),this.fill(),n.preventDefault());break;case 13:r=this.focusDate||this.dates.get(-1)||this.viewDate;this.o.keyboardNavigation&&(this._toggle_multidate(r),o=!0);this.focusDate=null;this.viewDate=this.dates.get(-1)||this.viewDate;this.setValue();this.fill();this.picker.is(":visible")&&(n.preventDefault(),"function"==typeof n.stopPropagation?n.stopPropagation():n.cancelBubble=!0,this.o.autoclose&&this.hide());break;case 9:this.focusDate=null;this.viewDate=this.dates.get(-1)||this.viewDate;this.fill();this.hide()}o&&(this._trigger(this.dates.length?"changeDate":"clearDate"),this.isInput?f=this.element:this.component&&(f=this.element.find("input")),f&&f.change())},showMode:function(n){n&&(this.viewMode=Math.max(this.o.minViewMode,Math.min(2,this.viewMode+n)));this.picker.children("div").hide().filter(".datepicker-"+i.modes[this.viewMode].clsName).css("display","block");this.updateNavArrows()}};h=function(t,i){this.element=n(t);this.inputs=n.map(i.inputs,function(n){return n.jquery?n[0]:n});delete i.inputs;o.call(n(this.inputs),i).bind("changeDate",n.proxy(this.dateUpdated,this));this.pickers=n.map(this.inputs,function(t){return n(t).data("datepicker")});this.updateDates()};h.prototype={updateDates:function(){this.dates=n.map(this.pickers,function(n){return n.getUTCDate()});this.updateRanges()},updateRanges:function(){var t=n.map(this.dates,function(n){return n.valueOf()});n.each(this.pickers,function(n,i){i.setRange(t)})},dateUpdated:function(t){if(!this.updating){this.updating=!0;var e=n(t.target).data("datepicker"),i=e.getUTCDate(),f=n.inArray(t.target,this.inputs),r=f-1,u=f+1,o=this.inputs.length;if(-1!==f){if(n.each(this.pickers,function(n,t){t.getUTCDate()||t.setUTCDate(i)}),i<this.dates[r])for(;r>=0&&i<this.dates[r];)this.pickers[r--].setUTCDate(i);else if(i>this.dates[u])for(;o>u&&i>this.dates[u];)this.pickers[u++].setUTCDate(i);this.updateDates();delete this.updating}}},remove:function(){n.map(this.pickers,function(n){n.remove()});delete this.element.data().datepicker}};a=n.fn.datepicker;o=function(i){var u=Array.apply(null,arguments),r;return u.shift(),this.each(function(){var o=n(this),e=o.data("datepicker"),l="object"==typeof i&&i,v;if(!e){var a=p(this,"date"),y=n.extend({},s,a,l),b=w(y.language),c=n.extend({},s,b,a,l);o.hasClass("input-daterange")||c.inputs?(v={inputs:c.inputs||o.find("input").toArray()},o.data("datepicker",e=new h(this,n.extend(c,v)))):o.data("datepicker",e=new f(this,c))}if("string"==typeof i&&"function"==typeof e[i]&&(r=e[i].apply(e,u),r!==t))return!1}),r!==t?r:this};n.fn.datepicker=o;s=n.fn.datepicker.defaults={autoclose:!1,beforeShowDay:n.noop,beforeShowMonth:n.noop,calendarWeeks:!1,clearBtn:!1,toggleActive:!1,daysOfWeekDisabled:[],datesDisabled:[],endDate:1/0,forceParse:!0,format:"mm/dd/yyyy",keyboardNavigation:!0,language:"en",minViewMode:0,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-1/0,startView:0,todayBtn:!1,todayHighlight:!1,weekStart:0,disableTouchKeyboard:!1,enableOnReadonly:!0,container:"body"};v=n.fn.datepicker.locale_opts=["format","rtl","weekStart"];n.fn.datepicker.Constructor=f;r=n.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear"}};i={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(n){return n%4==0&&n%100!=0||n%400==0},getDaysInMonth:function(n,t){return[31,i.isLeapYear(n)?29:28,31,30,31,30,31,31,30,31,30,31][t]},validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,parseFormat:function(n){var t=n.replace(this.validParts,"\x00").split("\x00"),i=n.match(this.validParts);if(!t||!t.length||!i||0===i.length)throw new Error("Invalid date format.");return{separators:t,parts:i}},parseDate:function(e,o,s){function nt(){var n=this.slice(0,c[h].length),t=c[h].slice(0,n.length);return n.toLowerCase()===t.toLowerCase()}var v,y,h,tt,c,a,it,d,w;if(!e)return t;if(e instanceof Date)return e;if("string"==typeof o&&(o=i.parseFormat(o)),tt=/([\-+]\d+)([dmwy])/,c=e.match(/([\-+]\d+)([dmwy])/g),/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(e)){for(e=new Date,h=0;h<c.length;h++)switch(v=tt.exec(c[h]),y=parseInt(v[1]),v[2]){case"d":e.setUTCDate(e.getUTCDate()+y);break;case"m":e=f.prototype.moveMonth.call(f.prototype,e,y);break;case"w":e.setUTCDate(e.getUTCDate()+7*y);break;case"y":e=f.prototype.moveYear.call(f.prototype,e,y)}return u(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),0,0,0)}c=e&&e.match(this.nonpunctuation)||[];e=new Date;var p,b,k={},g=["yyyy","yy","M","MM","m","mm","d","dd"],l={yyyy:function(n,t){return n.setUTCFullYear(t)},yy:function(n,t){return n.setUTCFullYear(2e3+t)},m:function(n,t){if(isNaN(n))return n;for(t-=1;0>t;)t+=12;for(t%=12,n.setUTCMonth(t);n.getUTCMonth()!==t;)n.setUTCDate(n.getUTCDate()-1);return n},d:function(n,t){return n.setUTCDate(t)}};if(l.M=l.MM=l.mm=l.m,l.dd=l.d,e=u(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0),a=o.parts.slice(),c.length!==a.length&&(a=n(a).filter(function(t,i){return-1!==n.inArray(i,g)}).toArray()),c.length===a.length){for(h=0,it=a.length;it>h;h++){if(p=parseInt(c[h],10),v=a[h],isNaN(p))switch(v){case"MM":b=n(r[s].months).filter(nt);p=n.inArray(b[0],r[s].months)+1;break;case"M":b=n(r[s].monthsShort).filter(nt);p=n.inArray(b[0],r[s].monthsShort)+1}k[v]=p}for(h=0;h<g.length;h++)w=g[h],w in k&&!isNaN(k[w])&&(d=new Date(e),l[w](d,k[w]),isNaN(d)||(e=d))}return e},formatDate:function(t,u,f){var e;if(!t)return"";"string"==typeof u&&(u=i.parseFormat(u));e={d:t.getUTCDate(),D:r[f].daysShort[t.getUTCDay()],DD:r[f].days[t.getUTCDay()],m:t.getUTCMonth()+1,M:r[f].monthsShort[t.getUTCMonth()],MM:r[f].months[t.getUTCMonth()],yy:t.getUTCFullYear().toString().substring(2),yyyy:t.getUTCFullYear()};e.dd=(e.d<10?"0":"")+e.d;e.mm=(e.m<10?"0":"")+e.m;t=[];for(var s=n.extend([],u.separators),o=0,h=u.parts.length;h>=o;o++)s.length&&t.push(s.shift()),t.push(e[u.parts[o]]);return t.join("")},headTemplate:'<thead><tr><th class="prev">&#171;<\/th><th colspan="5" class="datepicker-switch"><\/th><th class="next">&#187;<\/th><\/tr><\/thead>',contTemplate:'<tbody><tr><td colspan="7"><\/td><\/tr><\/tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"><\/th><\/tr><tr><th colspan="7" class="clear"><\/th><\/tr><\/tfoot>'};i.template='<div class="datepicker"><div class="datepicker-days"><table class=" table-condensed">'+i.headTemplate+"<tbody><\/tbody>"+i.footTemplate+'<\/table><\/div><div class="datepicker-months"><table class="table-condensed">'+i.headTemplate+i.contTemplate+i.footTemplate+'<\/table><\/div><div class="datepicker-years"><table class="table-condensed">'+i.headTemplate+i.contTemplate+i.footTemplate+"<\/table><\/div><\/div>";n.fn.datepicker.DPGlobal=i;n.fn.datepicker.noConflict=function(){return n.fn.datepicker=a,this};n.fn.datepicker.version="1.4.0";n(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(t){var i=n(this);i.data("datepicker")||(t.preventDefault(),o.call(i,"show"))});n(function(){o.call(n('[data-provide="datepicker-inline"]'))})}(window.jQuery),function(){ClickView.NewUpload.Config={onbeforeunload:"Navigating away from this page will cancel your submission, are you sure you want to leave?",fadeTime:250}}(),function(n){"use strict";n.Models.FileUpload=EasyMoney.Model.extend({defaults:{uploadId:"",ingestUrl:"",maxChunkSize:0,minChunkSize:0}})}(ClickView.NewUpload),function(n){"use strict";n.Models.ResourceFileUpload=EasyMoney.Model.extend({defaults:{fileId:"",uploadId:"",name:"",type:"",extension:"",fileSize:0,fileUrl:"",ingestUrl:"",metadata:{type:""},contribution:!1}})}(ClickView.NewUpload),function(n){"use strict";n.Models.SubtitleFileUpload=n.Models.ResourceFileUpload.extend({defaults:_.extend({},n.Models.ResourceFileUpload.prototype.defaults,{language:"",selectedLanguage:{}}),setDefaulSelectedLanguage:function(){var n=this.getDefaultLanguageKey(),t=CVLanguages.getEnglishName(n);this.set("selectedLanguage",{key:n,name:t})},getDefaultLanguageKey:function(){var n=ClickView.Data.Config.region.code.toLowerCase();switch(n){case"au":return"en-au";case"nz":return"en-nz";case"uk":return"en-gb";default:return"en"}}})}(ClickView.NewUpload);!function(n,t){"use strict";var i=n.NewUpload,r=n.Shared;i.Models.UploadModel=t.Model.extend({defaults:{origin:6,status:3,videoType:"ownvideo",destination:1},categoryRequired:!0,initialize:function(n,t){t||(t={});t.categoryRequired===!1&&(this.categoryRequired=!1)},url:function(){return this.isFromWorkspace?"/api/exchange/contribute":"/api/upload/v3/complete"},validation:function(){var n={title:{required:!0,maxLength:255},description:{required:!0,maxLength:4096},rating:{required:!0},category:{required:this.categoryRequired}};return this.isFreeToAir()&&_.extend(n,{dateBroadcast:{required:!0,fn:function(n){return Date.parse(n)!==NaN?null:"Invalid date specified"}},productionYear:{required:!1,range:[1900,(new Date).getFullYear()]},series:{required:!1,maxLength:255},channel:{required:!0},producer:{required:!1,maxLength:255},season:{required:!1,maxLength:255}}),n},isFreeToAir:function(){return this.get("videoType")==="freetoair"},isLibraryVideo:function(){return!1},isExchangeVideo:function(){return!1},mapContribution:function(n){this.set(n.pick("title","description","trackingCode","thumbnail","duration","dateBroadcast","rating","channel"));this.set("tokenId",this.get("trackingCode"));this.set("masterId",n.get("id"))}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.NewUpload;i.Collections.ResourceFileCollection=t.Collection.extend({model:i.Models.ResourceFileUpload});i.Collections.SubtitleFileCollection=t.Collection.extend({model:i.Models.SubtitleFileUpload})}(ClickView,EasyMoney);this.ClickView=this.ClickView||{};this.ClickView.NewUpload=this.ClickView.NewUpload||{};this.ClickView.NewUpload.Templates=this.ClickView.NewUpload.Templates||{};this.ClickView.NewUpload.Templates.BroadcastMetadata=Handlebars.template({"1":function(){return" - Hide "},"3":function(){return" + Show "},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{};return'<form>\r\n    <h2>Broadcast Details<\/h2>\r\n    <div class="form-group col-sm-6">\r\n        <label for="video-channel" class="control-label">Channel<span class="required">*<\/span><\/label>\r\n        <select name="channel" id="video-channel" class="large"><\/select>\r\n        <span class="help-block hidden"><\/span>\r\n    <\/div>\r\n    <div class="form-group col-sm-6">\r\n        <label for="date-broadcast" class="control-label">Date Broadcast<span class="required">*<\/span><\/label>\r\n        <div class="input-group">\r\n            <input type="text" class="form-control date-broadcast large" placeholder="When did this video air?" name="dateBroadcast" id="date-broadcast" />\r\n            <span class="help-block hidden"><\/span>\r\n        <\/div>\r\n    <\/div>\r\n    <div class="form-group col-sm-12 new-row">\r\n        <label for="video-series" class="control-label">Series<\/label>\r\n        <input type="text" placeholder="Does this video belong to a series?" name="series" id="video-series" class="large" autocomplete="off"/>\r\n        <span class="help-block hidden"><\/span>\r\n    <\/div>\r\n    <div class="form-group col-sm-12 season-group">\r\n        <label for="video-season" class="control-label">Season<\/label>\r\n        <input type="text" name="season" id="video-season" class="large"/>\r\n        <span class="help-block hidden"><\/span>\r\n    <\/div>\r\n\r\n    <div class="clearfix">\r\n        <span class="show-additional-info">\r\n            '+((e=i["if"].call(o,t!=null?t.additionalInfoVisible:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(3,u,0),data:u}))!=null?e:"")+n.escapeExpression((f=(f=i.additionalInfoText||(t!=null?t.additionalInfoText:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(o,{name:"additionalInfoText",hash:{},data:u}):f))+'\r\n        <\/span>\r\n    <\/div>\r\n    <div class="additional-information">\r\n        <div class="form-group col-sm-6">\r\n            <label>Production Year<\/label>\r\n            <div class="input-group">\r\n                <input type="text" class="form-control production-year large" placeholder="Which year was this video filmed or created?" name="production-year"/>\r\n            <\/div>\r\n        <\/div>\r\n        <div class="form-group col-sm-6">\r\n            <label for="video-producer" class="control-label">Producer<\/label>\r\n            <input type="text" placeholder="Who created this video?" name="producer" id="video-producer" class="large"/>\r\n            <span class="help-block hidden"><\/span>\r\n        <\/div>\r\n    <\/div>\r\n<\/form>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.NewUpload=this.ClickView.NewUpload||{};this.ClickView.NewUpload.Templates=this.ClickView.NewUpload.Templates||{};this.ClickView.NewUpload.Templates.ResourceSelect=Handlebars.template({"1":function(n,t,i,r,u){var f;return'    <div class="resource-drop-area col-xs-12">\r\n        <p class="message">'+n.escapeExpression((f=(f=i.message||(t!=null?t.message:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"message",hash:{},data:u}):f))+'<\/p>\r\n        <div class="resource-browse-btn-container"><button class="btn secondary btnleft large resource-browse">Select a file<\/button><\/div>\r\n    <\/div>\r\n'},"3":function(){return'    <div class="upload-title-container resource col-xs-6 col-sm-3">\r\n        <h3 class="header">Resources<\/h3>\r\n    <\/div>\r\n    <div class="upload-button-container">\r\n        <button class="upload-resource-btn resource-browse btn grey">Upload resource<\/button>\r\n    <\/div>\r\n    <div class="col-xs-12 upload-note-container">\r\n        <span class="note">word, excel, powerpoint, pdf, text and images are supported. Maximum file size 10 MB<\/span>\r\n    <\/div>    \r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.onlyResources:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(3,u,0),data:u}))!=null?f:""},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.NewUpload=this.ClickView.NewUpload||{};this.ClickView.NewUpload.Templates=this.ClickView.NewUpload.Templates||{};this.ClickView.NewUpload.Templates.ResourceUpload=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="resource-add-viewpart"><\/div>\r\n<div class="resource-added-list"><\/div>\r\n'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.NewUpload=this.ClickView.NewUpload||{};this.ClickView.NewUpload.Templates=this.ClickView.NewUpload.Templates||{};this.ClickView.NewUpload.Templates.ResourceUploadItem=Handlebars.template({"1":function(){return"col-xs-11"},"3":function(){return"col-xs-9"},"5":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'                \t<span class="file-display-name-title">'+h((f=(f=i.name||(t!=null?t.name:t))!=null?f:o,typeof f===s?f.call(e,{name:"name",hash:{},data:u}):f))+h((f=(f=i.displayedExtenstion||(t!=null?t.displayedExtenstion:t))!=null?f:o,typeof f===s?f.call(e,{name:"displayedExtenstion",hash:{},data:u}):f))+"<\/span>\r\n"},"7":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'                \t<input class="file-display-name" type="text" value="'+h((f=(f=i.name||(t!=null?t.name:t))!=null?f:o,typeof f===s?f.call(e,{name:"name",hash:{},data:u}):f))+'" />\r\n                \t<span class="file-extension-name">.'+h((f=(f=i.extension||(t!=null?t.extension:t))!=null?f:o,typeof f===s?f.call(e,{name:"extension",hash:{},data:u}):f))+'<\/span>\r\n                \t<div class="file-edit-container">\r\n                \t\t<button class="edit-resource-icon save-resource-title"><\/button>\r\n                \t\t<button class="btn secondary edit-resource-icon cancel-edit-resource-title"><\/button>\r\n                \t<\/div>\r\n'},"9":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.editable:t,{name:"if",hash:{},fn:n.program(10,u,0),inverse:n.noop,data:u}))!=null?f:""},"10":function(){return'            <div class="remove-resource-container">\r\n                <span class="edit-resouce-icon remove-resource"><\/span>\r\n            <\/div>\r\n            <div class="edit-resource-title-container">\r\n                <span class="edit-resource-icon edit-resource-title"><\/span>\r\n            <\/div>\r\n'},"12":function(){return'        <div class="uploading-resource-progress col-xs-3"><\/div>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{},s=i.helperMissing,h="function",c=n.escapeExpression;return'<div class="resource-item col-xs-12">\r\n    <div class="resource-meta '+((e=i["if"].call(o,t!=null?t.completed:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(3,u,0),data:u}))!=null?e:"")+'">\r\n        <div class="resource-name-container">\r\n            <svg class="icon '+c((f=(f=i.extensionType||(t!=null?t.extensionType:t))!=null?f:s,typeof f===h?f.call(o,{name:"extensionType",hash:{},data:u}):f))+'">\r\n                <use xlink:href="#'+c((f=(f=i.extensionType||(t!=null?t.extensionType:t))!=null?f:s,typeof f===h?f.call(o,{name:"extensionType",hash:{},data:u}):f))+'"><\/use>\r\n            <\/svg>\r\n            <div class="resource-name">\r\n'+((e=i["if"].call(o,t!=null?t.editable:t,{name:"if",hash:{},fn:n.program(5,u,0),inverse:n.program(7,u,0),data:u}))!=null?e:"")+"            <\/div>\r\n        <\/div>\r\n    <\/div>\r\n"+((e=i["if"].call(o,t!=null?t.completed:t,{name:"if",hash:{},fn:n.program(9,u,0),inverse:n.program(12,u,0),data:u}))!=null?e:"")+"<\/div>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.NewUpload=this.ClickView.NewUpload||{};this.ClickView.NewUpload.Templates=this.ClickView.NewUpload.Templates||{};this.ClickView.NewUpload.Templates.SubtitleLanguageOption=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="select-subtitle-language-body">\r\n\t<input id="select-language-input" class="typeahead" type="text" placeholder="Please specify language for your subtitle file" />\r\n<\/div>\r\n<div class="btn-viewpart"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.NewUpload=this.ClickView.NewUpload||{};this.ClickView.NewUpload.Templates=this.ClickView.NewUpload.Templates||{};this.ClickView.NewUpload.Templates.SubtitleLanguageOptionButton=Handlebars.template({"1":function(){return"disabled"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<div class="select-subtitle-language-bottom">\r\n    <button class="subtitle-popup-btn btn orange save '+((f=i.unless.call(t!=null?t:n.nullContext||{},t!=null?t.enabled:t,{name:"unless",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+'">Save<\/button>\r\n    <button class="subtitle-popup-btn  btn grey cancel">Cancel<\/button>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.NewUpload=this.ClickView.NewUpload||{};this.ClickView.NewUpload.Templates=this.ClickView.NewUpload.Templates||{};this.ClickView.NewUpload.Templates.SubtitleUpload=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="upload-title-container subtitle col-xs-6 col-sm-3">\r\n    <h3 class="header">Subtitles<\/h3>\r\n<\/div>\r\n<div class="upload-button-container">\r\n    <button class="upload-subtitle-btn btn grey">Upload subtitle<\/button>\r\n<\/div>\r\n<div class="upload-note-container col-xs-12">\r\n    <span class="note">.srt subtitle is supported. You can upload up to 5 subtitles<\/span>\r\n<\/div>\r\n<div class="subtitle-added-list"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.NewUpload=this.ClickView.NewUpload||{};this.ClickView.NewUpload.Templates=this.ClickView.NewUpload.Templates||{};this.ClickView.NewUpload.Templates.TypeSelect=Handlebars.template({"1":function(n,t,i,r,u){var f;return'<div class="video-type-container channel-video-container">\r\n    <div class="video-type-block">\r\n        <img src="//static.clickview.com.au/cv-online/images/freetoair/upload-to-channel@2x.png" />\r\n        <a class="btn orange large channel-video-click">Your own video<\/a>\r\n        <p>For videos that you have created yourself or that you have the right to share. Videos contributed here will be added to your <a class="channel-link" href="'+n.escapeExpression((f=(f=i.channelUrl||(t!=null?t.channelUrl:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"channelUrl",hash:{},data:u}):f))+'">channel<\/a> as well as the Exchange.<\/p>\r\n    <\/div>\r\n<\/div>\r\n'},"3":function(){return'<div class="video-type-container own-video-container">\r\n    <div class="video-type-block">\r\n        <img src="//static.clickview.com.au/cv-online/images/freetoair/upload-own-video@2x.png"/>\r\n        <a class="btn orange large own-video-click">Your own video<\/a>\r\n        <p>For videos that you have created yourself or that you have the right to share with the ClickView Exchange community.<\/p>\r\n    <\/div>\r\n<\/div>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<div class="exchange-notification-banner-viewpart"><\/div>\r\n<h1>What type of video would you like to contribute?<\/h1>\r\n<div class="video-type-container broadcast-container">\r\n    <div class="video-type-block">\r\n        <img src="//static.clickview.com.au/cv-online/images/freetoair/upload-free-to-air@2x.png"/>\r\n        <a class="btn orange large free-to-air-video">Television Broadcast<\/a>\r\n        <p>For videos recorded from Broadcast Television that you wish contribute to the ClickView Exchange community.<\/p>\r\n    <\/div>\r\n<\/div>\r\n'+((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.hasUserChannel:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(3,u,0),data:u}))!=null?f:"")},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.NewUpload=this.ClickView.NewUpload||{};this.ClickView.NewUpload.Templates=this.ClickView.NewUpload.Templates||{};this.ClickView.NewUpload.Templates.Upload=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="video-viewpart"><\/div>\r\n<div class="progress-container">\r\n    <div class="progress-viewpart"><\/div>\r\n<\/div>\r\n<div class="metadata-viewpart"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.NewUpload=this.ClickView.NewUpload||{};this.ClickView.NewUpload.Templates=this.ClickView.NewUpload.Templates||{};this.ClickView.NewUpload.Templates.UploadSuccess=Handlebars.template({"1":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return"        <p>Your video has been successfully submitted to the ClickView Exchange. You will receive a notification when it is available from your channel: <strong>"+h((f=(f=i.channelName||(t!=null?t.channelName:t))!=null?f:o,typeof f===s?f.call(e,{name:"channelName",hash:{},data:u}):f))+'<\/strong><\/p>\r\n        <a class="btn orange go-to-channel" href="'+h((f=(f=i.userChannelUrl||(t!=null?t.userChannelUrl:t))!=null?f:o,typeof f===s?f.call(e,{name:"userChannelUrl",hash:{},data:u}):f))+'">Go to my channel<\/a>\r\n'},"3":function(){return'        <p>Your video has been successfully submitted to the ClickView Exchange. It will be visible to other ClickView users once it has been approved by ClickView\'s Content Team.<\/p>\r\n        <a class="btn orange go-home" href="/exchange">Go back to Home<\/a>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<div class="upload-success-viewpart">\r\n    <div class="block">\r\n        <div class="success-tick"><\/div>\r\n    <\/div>\r\n    <div class="block">\r\n        <h1>Video successfully submitted!<\/h1>\r\n'+((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.userChannelUrl:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(3,u,0),data:u}))!=null?f:"")+"    <\/div>\r\n<\/div>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.NewUpload=this.ClickView.NewUpload||{};this.ClickView.NewUpload.Templates=this.ClickView.NewUpload.Templates||{};this.ClickView.NewUpload.Templates.VideoMetadata=Handlebars.template({"1":function(){return'<span class="required">*<\/span>'},"3":function(n,t,i,r,u){var f;return"        <p>This video will be added to your channel: <strong>"+n.escapeExpression((f=(f=i.channelName||(t!=null?t.channelName:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"channelName",hash:{},data:u}):f))+"<\/strong>, as well as the ClickView Exchange. Please make sure that all the video information you've included above is as precise and detailed as possible.\r\n"},"5":function(){return"        <p>This video will be viewed by teachers and students throughout the country. Please make sure that all the video information you've included above is as precise and detailed as possible.\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return'<form>\r\n    <h2>Video Information<\/h2>\r\n    <div class="form-group">\r\n        <label for="video-title" class="control-label">Title<span class="required">*<\/span><\/label>\r\n        <input type="text" placeholder="Choose a meaningful title" name="title" id="video-title" class="large"/>\r\n        <span class="help-block hidden"><\/span>\r\n    <\/div>\r\n    <div class="form-group">\r\n        <label for="video-description" class="control-label">Description<span class="required">*<\/span><\/label>\r\n        <textarea placeholder="Please describe the content of this video in one or two sentences, try to be as clear and concise as possible" name="description" id="video-description" class="large"><\/textarea>\r\n        <span class="help-block hidden"><\/span>\r\n    <\/div>\r\n    <div class="form-group col-sm-6">\r\n        <label for="video-rating" class="control-label">Rating<span class="required">*<\/span><\/label>\r\n        <select name="rating" id="video-rating" class="large"><\/select>\r\n        <span class="help-block hidden"><\/span>\r\n    <\/div>\r\n    <div class="form-group col-sm-6">\r\n        <label for="video-category" class="control-label">Category'+((f=i["if"].call(e,t!=null?t.categoryRequired:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+'<\/label>\r\n        <select name="category" id="video-category" class="large"><\/select>\r\n        <span class="help-block hidden"><\/span>\r\n    <\/div>\r\n    <div class="form-group resource-add-form col-xs-12">\r\n        <div class="toggle-resource-form col-xs-12"><\/div>\r\n        <div class="resource-add-form-container col-xs-12">\r\n            <div class="subtitle-viewpart"><\/div>\r\n            <div class="resource-viewpart"><\/div>\r\n        <\/div>\r\n    <\/div>\r\n<\/form>\r\n<div class="please-note">\r\n    <div class="inner">\r\n'+((f=i["if"].call(e,t!=null?t.channelContribution:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.program(5,u,0),data:u}))!=null?f:"")+'        By adding videos to your channel, you agree to ClickView\'s terms in relation to <a target="_black" href="https://www.clickview.com.au/terms-and-conditions/#uploading-user-content">Uploading User Content<\/a>.<\/p>\r\n    <\/div>\r\n<\/div>'},useData:!0});!function(n,t){"use strict";var i=n.NewUpload,r=n.Shared;i.Views.BroadcastMetadataView=r.Views.MultiStepStepView.extend({template:i.Templates.BroadcastMetadata,defaults:{additionalInfoVisible:!1,additionalInfoText:"additional fields",seasonVisible:!1},ui:{dateBroadcast:".date-broadcast",productionYear:".production-year",additionalInfo:".additional-information",additionalInfoText:".show-additional-info",seriesInput:"[name=series]",seasonInput:"[name=season]",seasonGroup:".season-group"},events:{"click .show-additional-info":"showAdditionalInfo"},bindings:function(){return{"[name=season]":{observe:"season",setOptions:{validate:!0}},"[name=producer]":{observe:"producer",setOptions:{validate:!0}},"[name=production-year]":{observe:"productionYear",setOptions:{validate:!0},getVal:function(n){return parseInt(n.val())}},"[name=channel]":{observe:"channel",selectOptions:{collection:this.options.channels,labelPath:"name",valuePath:"id",defaultOption:{label:"On which channel did this video broadcast?",value:null}},setOptions:{validate:!0}}}},initialize:function(){this.viewModel=new t.Model(this.options);this.listenTo(this.viewModel,"change",this.updateDomState);this.listenTo(this.model,"validated",this.onValidate)},fetchData:function(){var n=this.options.channels.loaded?$.Deferred().resolve():this.options.channels.fetch(),t=this.options.series.loaded?$.Deferred().resolve():this.options.series.fetch();$.when(n,t).then(_.bind(this.render,this))},initDatePickers:function(){if(this.ui.dateBroadcast.datepicker({clearBtn:!0,autoclose:!0,format:"d/m/yyyy",endDate:"0d"}),!!this.model.get("dateBroadcast")){var n=this.model.get("dateBroadcast"),t=moment(n),i=t.format("D/M/YYYY");this.ui.dateBroadcast.datepicker("update",i)}this.ui.dateBroadcast.on("changeDate",this.updateDate.bind(this));this.ui.productionYear.datepicker({format:" yyyy",viewMode:"years",minViewMode:"years",endDate:new Date((new Date).getFullYear(),0,1)})},updateDate:function(){var n=this.ui.dateBroadcast.val();this.model.set("dateBroadcast",n)},toggleAdditinalInfo:function(n,t,i,r){r?n.show():n.hide();t.text((r?"- Hide ":"+ Show ")+i)},showAdditionalInfo:function(){this.viewModel.set("additionalInfoVisible",!this.viewModel.get("additionalInfoVisible"))},isLoaded:function(){return this.options.channels.loaded&&this.options.series.loaded},onValidate:function(){},updateDomState:function(){var n=this.viewOptions();this.ui.additionalInfoText.text((n.additionalInfoVisible?"- Hide ":"+ Show ")+n.additionalInfoText);this.ui.additionalInfo.toggle(n.additionalInfoVisible);this.ui.seasonGroup.toggle(n.seasonVisible)},viewOptions:function(){return this.viewModel.toJSON()},onRender:function(){this.initDatePickers();this.stickit();this.bindValidation()},onRendered:function(){this.seriesTypeAhead()},seriesTypeAhead:function(){var n=this;this.ui.seriesInput.typeahead({hint:!0,highlight:!0,minLength:2},{display:"name",source:function(t,i){var r=n.options.series.select(function(n){return n.get("name").toLowerCase().indexOf(t.toLowerCase())>=0}).map(function(n){return{name:n.get("name"),id:n.get("id")}});i(r)}});this.model.get("series")&&this.ui.seriesInput.typeahead("val",this.model.get("series").name);this.ui.seriesInput.on("typeahead:select",function(t,i){n.model.set("series",i);n.ui.seasonInput.focus()})},seasonTypeAhead:function(n){var t=this.options.series.find(function(t){return t.name==n}).seasons;this.ui.seasonInput.typeahead({hint:!0,highlight:!0,minLength:2},{source:function(n,i){var r=t.select(function(t){return t.get("name").toLowerCase().indxeOf(n.toLowerCase())>=0}).map(function(n){return n.get("name")});i(r)}});this.ui.seriesInput.on("typeahead:select",function(n,t){self.model.set("season",t)})},bindValidation:function(){Backbone.Validation.bind(this)},onBeforeRender:function(){return this.isLoaded()?!0:(this.renderView(this.$el,new r.Views.SpinJsView),!1)},onClose:function(){Backbone.Validation.unbind(this)},stepComplete:function(){}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.NewUpload,r=n.Shared;i.Views.FileSelectView=t.View.extend({template:'<div class="drop-area"><div class="drop-message"><p>Drag and drop a video here or<\/p><button class="btn orange large browse">Select a video file<\/button><\/div><\/div>',className:"file-select",ui:{dropArea:".drop-area"},events:{"dragenter .drop-area":"dragEnter","dragleave .drop-area":"dragLeave"},initialize:function(){this.listenTo(this.model,"validation:nofileselected",this.noFileSelected)},noFileSelected:function(){this.$el.addClass("no-file")},dragEnter:function(){this.ui.dropArea.addClass("drag-over")},dragLeave:function(){this.ui.dropArea.removeClass("drag-over")}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.NewUpload,r=n.Shared;i.Views.MetadataView=r.Views.MultiStepView.extend({locked:!1,defaults:{lastStepText:"Submit",showLastStep:!0,largeButtons:!1,includeResources:!1},events:{"submit form":"preventSubmit"},initialize:function(){var n=_.extend({},{model:this.model},this.options);this.addStep(this.options.videoMetadataView||i.Views.VideoMetadataView,n);this.model.isFreeToAir()&&(this.addStep(i.Views.BroadcastMetadataView,n),this.options.channels&&!this.options.channels.loaded&&this.options.channels.fetch(),this.options.series&&!this.options.series.loaded&&this.options.series.fetch({data:{"with":"seasons",filter:"{limit:100}"}}));this.listenTo(this.stepModel,"button:finish:click",this.onSubmit);this.listenTo(this.stepModel,"button:navigateback:click",this.onNavigateBack);this.options.contribution&&this.enableFinish();this.resourceFileCollection=this.options.resourceFileCollection;this.resourceFileCollection.include=!0;this.subtitleFileCollection=this.options.subtitleFileCollection;this.subtitleFileCollection.include=!0;this.listenTo(t.Events,"subnav:lock",this.lock);this.listenTo(t.Events,"subnav:unlock",this.unlock)},preventSubmit:function(n){return n.preventDefault(),!1},onNavigateBack:function(){if(this.checkLock())return!1;if(this.options.contribution){window.location="/workspace";return}t.Events.trigger("navigate","/exchange/contribute")},onSubmit:function(){if(this.model.validate(),!this.options.contribution&&!this.model.has("fileSize")){this.model.trigger("validation:nofileselected");return}if(!this.options.contribution&&!this.model.uploaded){this.model.trigger("validation:uploadincomplete");return}this.model.isValid()&&(this.model.set("resources",this.MapAdditionalResource(this.resourceFileCollection)),this.model.set("subtitles",this.MapAdditionalResource(this.subtitleFileCollection)),this.model.save())},lock:function(){this.locked=!0},unlock:function(){this.locked=!1},checkLock:function(){if(this.locked)return window.confirm(i.Config.onbeforeunload)?(t.Events.trigger("upload:cancel"),this.locked=!1,!1):!0},MapAdditionalResource:function(n){return n.map(function(n){return n.get("contribution")&&n.set("metadata",{type:n.get("metadata")}),n.set("name",n.get("name")+"."+n.get("extension")),n.toJSON()})},onRendered:function(){this.options.contribution&&this.lock()}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.NewUpload,r=n.Shared;i.Views.ResourceItemView=t.View.extend({name:"ResourceItemView",template:i.Templates.ResourceUploadItem,model:i.Models.ResourceFileUpload,defaults:{editable:!0,isSubtitle:!1,removeTitle:"Delete additional learning resource",removeMessage:"Are you sure you want to delete this additional learning resource?"},ui:{progressBar:".uploading-resource-progress",resouceNameContainer:".resource-name-container",resourceIcon:".resource-icon",resourceName:".resource-name",fileNameInput:".file-display-name",fileExtension:".file-extension-name",editResourceTitle:".edit-resource-title-container"},events:{"click .remove-resource":"removeResource","click .edit-resource-title":"updateResource","click .save-resource-title":"saveResourceTitle","click .cancel-edit-resource-title":"cancelEditTitle","keydown .file-display-name":"updateTitle"},initialize:function(){_.isEmpty(this.model.get("name"))&&this.model.set("name",this.model.get("fileName"));this.listenTo(t.Events,"resource-upload:completed",this.resourceUploadcompleted);this.listenTo(t.Events,"resource-upload:uploading",this.resourceUploading)},onRender:function(){this.model.get("completed")||this.renderProgressBar();this.textWidth();this.ui.fileNameInput.prop("readonly",this.options.editable);this.options.editable||this.ui.fileNameInput.focus()},viewOptions:function(){return{extensionType:this.getExtensionType(),editable:this.options.editable,isSubtitle:this.options.isSubtitle,displayedExtenstion:this.getDisplayExtension()}},getDisplayExtension:function(){return this.model.get("contribution")?"":this.model.get("extension")?"."+this.model.get("extension"):void 0},removeResource:function(){var i=this,u=function(){r.Utils.AjaxHelper.post("/api/upload/v3/cancel",i.model.toJSON()).done(function(){t.Events.trigger("resource-upload:removed",i.model)});i.model.destroy({})};this.options.plugin?confirm(this.options.removeMessage)&&u():n.Utils.Dialog({title:this.options.removeTitle,content:"<p>"+this.options.removeMessage+"<\/p>",buttons:[{text:"Cancel",className:"btn"},{text:"Delete",className:"btn red",success:!0}]}).then(u)},getExtensionType:function(){if(this.model.get("exist"))return this.model.get("metadata").type;var r=this.model.get("extension"),t="file-type-",i=n.Shared.Helpers.getResourceExtensionType(r);return i?t+i:t+this.model.get("metadata")},resourceUploadcompleted:function(n){this.model.get("uploadId")===n&&(this.model.set("completed",!0),this.options.editable=!0,this.render())},renderProgressBar:function(){this.progressView=new r.Views.ProgressBarView({boxless:!0,loadingText:"0%"});this.renderView(this.ui.progressBar,this.progressView)},resourceUploading:function(n){this.model.get("uploadId")===n.uploadId&&this.progressView.update(n.percent,n.percent.toFixed(0)+"%")},initFakeElem:function(){var n=$("<span><\/span>").hide();return n.appendTo(document.body),n},fakeElem:function(n){this.$fakeSpan=this.$fakeSpan||(this.$fakeSpan=this.initFakeElem("span"));this.$fakeSpan.text(n)},textWidth:function(n){n||(n=this.model.get("name"));this.fakeElem(n);var t=this.ui.resouceNameContainer.outerWidth()-this.ui.resourceIcon.outerWidth()-this.ui.editResourceTitle.outerWidth()-this.ui.fileExtension.outerWidth(),i=this.$fakeSpan.outerWidth(),r=i<t?i+20:t-20;this.ui.fileNameInput.outerWidth(r)},updateResource:function(){this.options.editable=!1;this.tempTxt=this.model.get("name");this.render()},saveResourceTitle:function(){this.options.editable=!0;var n=this.ui.fileNameInput.val();this.model.set("name",n);this.render()},cancelEditTitle:function(){this.options.editable=!0;this.model.set("name",this.tempTxt);this.render()},updateTitle:function(){var n=this.ui.fileNameInput.val();_.debounce(this.textWidth(n),300)}});i.Views.ResourceListView=t.ListView.extend({name:"ResourceListView",tagName:"div",collection:i.Collections.resourceFileCollection,childView:i.Views.ResourceItemView,initialize:function(){this.listenTo(this.collection,"add",this.addOne);this.listenTo(this.collection,"remove",this.render)},removeResource:function(n){this.collection.remove(n)}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.NewUpload,r=n.Shared;i.Views.ResourceSelectView=t.View.extend({template:i.Templates.ResourceSelect,className:"file-select",initialize:function(){this.listenTo(t.Events,"resource-upload:fileAdded",this.dragLeave)},ui:{dropArea:".resource-drop-area",resourceBtn:".resource-browse"},events:{"dragenter .resource-drop-area":"dragEnter","dragleave .resource-drop-area":"dragLeave"},viewOptions:function(){return{message:this.options.onlyResources?"or drop here to upload":"Drag and drop any supplementary materials here to upload",onlyResource:this.options.onlyResource}},noFileSelected:function(){this.$el.addClass("no-file")},dragEnter:function(){this.ui.dropArea.addClass("drag-over")},dragLeave:function(){this.ui.dropArea.removeClass("drag-over")},enabledButton:function(n){this.ui.resourceBtn.prop("disabled",!n)}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.NewUpload;i.Views.SubtitleLanguageOptionView=t.View.extend({name:"SubtitleLanguageListView",template:i.Templates.SubtitleLanguageOption,defaults:{enabled:!0},radioChannels:{"subtitle-view":{initLanguage:"initLanguage"}},ui:{languageInput:"#select-language-input",buttonView:".btn-viewpart"},events:{"typeahead:selected":"languageSelected","click .save":"saveLanguageOption","click .cancel":"cancelSubtitle"},renderButtonView:function(){var n=new i.Views.SubtitleLanguageOptionButtonView({model:this.model,enabled:this.options.enabled});this.renderView(this.ui.buttonView,n)},subtitleLanguageMatcher:function(n){var r=this,t=[],i;return n&&(i=CVLanguages.getEnglishNameContains(n),_.each(i,function(n,i){var u=_.find(r.options.selectedLanguages,function(n){return n.key===i});u||t.push({key:i,name:n.englishName})})),t},initializeTypeahead:function(){var n=this;this.ui.languageInput.typeahead({hint:!0,highlight:!0,minLength:3},{name:"languages",displayKey:"name",source:function(t,i){var r=n.subtitleLanguageMatcher(t);return i(r)}})},initLanguage:function(){this.options.selectedLanguages.length!==0&&this.hasDefaultLanguage()||this.model.setDefaulSelectedLanguage();_.isEmpty(this.model.get("selectedLanguage"))?this.options.enabled=!1:this.ui.languageInput.val(this.model.get("selectedLanguage").name);this.ui.languageInput.focus();this.renderButtonView()},hasDefaultLanguage:function(){var n=this.model.getDefaultLanguageKey();return _.find(this.options.selectedLanguages,function(t){return t.key===n})},languageSelected:function(n,t){var i=CVLanguages.getEnglishName(t.key);i&&(this.model.set("selectedLanguage",t),this.options.enabled=!0);this.renderButtonView()},saveLanguageOption:function(){this.radio["subtitle-view"].trigger("language-selected",this.model.get("fileId"));this.close()},cancelSubtitle:function(){this.model.get("language")||this.radio["subtitle-view"].trigger("cancel",this.model.get("fileId"));this.close()},onRender:function(){this.initializeTypeahead();this.renderButtonView()}});i.Views.SubtitleLanguageOptionButtonView=t.View.extend({name:"SubtitleLanguageOptionButtonView",template:i.Templates.SubtitleLanguageOptionButton,viewOptions:function(){return{enabled:this.options.enabled}}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.NewUpload,r=n.Shared;i.Views.SubtitleItemView=i.Views.ResourceItemView.extend({name:"SubtitleItemView",model:i.Models.SubtitleFileUpload,defaults:_.extend({},i.Views.ResourceItemView.prototype.defaults,{languageSelected:!1,isSubtitle:!0,removeTitle:"Delete subtitle",removeMessage:"Are you sure you want to delete this subtitle?"}),radioChannels:{"subtitle-view":{"language-selected":"updateSelectedLanguage",cancel:"cancelSubtitle"}},initialize:function(){if(!this.model.get("name")&&this.model.get("language")){var n=this.getEnglishNameByCode(this.model.get("language"));this.model.set("name",n)}this.listenTo(t.Events,"resource-upload:completed",this.resourceUploadcompleted);this.listenTo(t.Events,"resource-upload:uploading",this.resourceUploading)},onRender:function(){this.model.get("completed")||this.renderProgressBar()},resourceUploadcompleted:function(n){this.model.get("uploadId")===n&&(this.model.set("completed",!0),this.options.editable=!0,this.renderLanguageOptionPopup(),this.render())},getDisplayExtension:function(){if(this.options.isSubtitle)return" Subtitle"},getEnglishNameByCode:function(n){return CVLanguages.getEnglishName(n)},renderLanguageOptionPopup:function(){var t=this.model.collection.chain().map(function(n){return n.get("selectedLanguage")}).filter(function(n){return n.key}).value(),r=new i.Views.SubtitleLanguageOptionView({model:this.model,selectedLanguages:t,radio:this.radio});this.options.canCloseOption=!!this.model.get("language");this.popup=new n.Shared.Views.PopupView({view:r,title:"Which language is your subtitle file for?",cssId:"cv-subtitle-popup",showButtonContainer:!1,canClose:this.options.languageSelected});this.popup.selfRender();this.radio["subtitle-view"].trigger("initLanguage")},updateSelectedLanguage:function(n){this.model.get("fileId")===n&&(this.options.languageSelected=!0,this.model.set("name",this.model.get("selectedLanguage").name),this.model.set("language",this.model.get("selectedLanguage").key),this.render())},updateResource:function(){this.renderLanguageOptionPopup()},cancelSubtitle:function(n){var i=this;this.model.get("fileId")===n&&(r.Utils.AjaxHelper.post("/api/upload/v3/cancel",i.model.toJSON()).done(function(){t.Events.trigger("resource-upload:removed",i.model)}),i.model.destroy({}))}});i.Views.SubtitleListView=i.Views.ResourceListView.extend({name:"SubtitleListView",tagName:"div",collection:i.Collections.SubtitleFileCollection,childView:i.Views.SubtitleItemView})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.NewUpload,r=n.Shared;i.Views.TypeSelectView=t.View.extend({className:"contribute-view type-select",template:i.Templates.TypeSelect,onBoarding:["upload:broadcast","upload:ownvideo"],ui:{$notificationBanner:".exchange-notification-banner-viewpart"},events:{"click .free-to-air-video":"freeToAirClick","click .own-video-click":"ownVideoClick","click .channel-video-click":"channelVideoClick","click .channel-link":"onClickChannelLink"},freeToAirClick:function(){t.Events.trigger("navigate","/exchange/contribute/broadcast")},ownVideoClick:function(){t.Events.trigger("navigate","/exchange/contribute/own-video")},channelVideoClick:function(){t.Events.trigger("navigate","/exchange/contribute/channel-video")},onClickChannelLink:function(n){n.preventDefault();t.Events.trigger("navigate",this.getChannelLink())},getChannelLink:function(){var t=n.Data.User.userChannels,i=t&&t.length;return i?"/exchange/channels/"+t[0].id+"/"+r.Helpers.Slugify(t[0].name):""},renderNotificationBanner:function(){var t=new n.FreeToAir.Views.NotificationBannerView({type:"CommunityGuidelines"});this.renderView(this.ui.$notificationBanner,t)},viewOptions:function(){var t=n.Data.User.userChannels;return{hasUserChannel:t&&t.length,channelUrl:this.getChannelLink()}},onRender:function(){this.renderNotificationBanner()},onRendered:function(){t.Events.trigger("start-upload-onboarding")}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.NewUpload,r=n.Shared;i.Views.UploadResourceView=t.View.extend({template:i.Templates.ResourceUpload,defaults:{extensions:n.Shared.Helpers.getResourceFileExtensionWhitelist(),maxFileSize:10485760,maxFileSizeChunked:10485760,shouldBindUnload:!0},ui:{resource:".resource-add-viewpart",progress:".progress-viewpart",resourceAdded:".resource-added-list"},initialize:function(){this.radio=new t.Radio({name:"uploadResourceRadio"})},initializePluploader:function(){var n=this;this.pluploader=new plupload.Uploader({runtimes:"html5,flash,silverlight,html4",url:"/api/upload/v3/",browse_button:this.$(".resource-browse").get(0),filters:{mime_types:[{title:"Resource files",extensions:this.options.extensions}]},chunk_size:1048576,multi_selection:!1,container:this.$el.get(0),max_retries:5,multipart:!1,flash_swf_url:"/Assets/js/libs/plupload/Moxie.swf",silverlight_xap_url:"/Assets/js/libs/plupload/Moxie.xap",init:{Init:function(){n.canChunk=this.features.chunks&&this.settings.chunk_size>0;this.settings.filters.max_file_size=n.canChunk?n.options.maxFileSizeChunked:n.options.maxFileSize}}});this.pluploader.init();this.bindPluploaderEvents()},unbindPluploaderEvents:function(){this.pluploader.unbindAll()},bindPluploaderEvents:function(){this.pluploader.bind("FilesAdded",_.bind(this.filesAdded,this));this.pluploader.bind("UploadProgress",_.bind(this.fileUploading,this));this.pluploader.bind("FileUploaded",_.bind(this.fileUploaded,this));this.pluploader.bind("Error",_.bind(this.uploadErrorHandler,this));this.pluploader.bind("ChunkUploaded",_.bind(this.chunkUploadedHandler,this))},filesAdded:function(n,i){var f;t.Events.trigger("resource-upload:fileAdded");var s=this,r=_.first(i),u=r.name.substr(r.name.lastIndexOf(".")+1),e=r.name.slice(0,-u.length-1),o={name:e,fileSize:r.size,extension:u};this.fileUpload=this.getuploadModel();f=this.getType(u);this.fileUpload.set({fileSize:r.size,name:e,metadata:{type:f},extension:u,type:f});this.collection.add(this.fileUpload);this.options.shouldBindUnload&&this.bindUnload();this.uploading(o)},getuploadModel:function(){return new i.Models.ResourceFileUpload},uploading:function(n){var t=this.options.onlyResources?"/api/upload/v3?permenant=true":"/api/upload/v3";r.Utils.AjaxHelper.post(t,n).success(this.uploadSessionStarted.bind(this)).error(this.onUploadSessionError.bind(this))},uploadSessionStarted:function(n){this.fileUpload.set(n);this.options.onlyResources&&t.Events.trigger("resource-upload:uploadingStart");var i=Math.min(this.fileUpload.get("fileSize"),this.pluploader.settings.chunk_size);this.setHeaders(0,i);this.pluploader.settings.url=this.fileUpload.get("ingestUrl");this.pluploader.start()},onUploadSessionError:function(){alert("There was a problem establishing an upload session. Please try again.")},onResourceRemoved:function(n){this.collection.remove(n);this.unbindUnload()},fileUploading:function(n,i){t.Events.trigger("resource-upload:uploading",{uploadId:this.fileUpload.get("uploadId"),percent:i.percent})},fileUploaded:function(n,i,r){var u=JSON.parse(r.response);this.fileUpload.set("fileUrl",u.url||u.Url);this.fileUpload.set("fileId",u.id);this.fileUpload.set("contribution",!1);this.collection.add(this.fileUpload);t.Events.trigger("resource-upload:completed",this.fileUpload.get("uploadId"))},chunkUploadedHandler:function(n,t,i){var r=Math.ceil(i.offset/this.pluploader.settings.chunk_size),u=Math.min(i.total-i.offset,this.pluploader.settings.chunk_size);this.setHeaders(r,u)},setHeaders:function(n,t){var i={"x-cv-upload-chunkindex":n,"x-cv-upload-chunklength":t,Accept:"application/json; charset=utf-8"};this.pluploader.settings.headers=i},uploadErrorHandler:function(t,i){switch(i.code){case-600:n.Utils.Dialog({title:"File size limit exceeded",content:"<p>The file you selected was too large. Maximum upload size is "+r.Helpers.ToFilesize(this.pluploader.settings.filters.max_file_size,1)+"<\/p>",buttons:[{text:"OK",className:"btn",success:!0}]});break;case-601:n.Utils.Dialog({title:"Unsupported file type",content:"<p>The file you selected was not a supported.<\/p>",buttons:[{text:"OK",className:"btn",success:!0}]});break;default:n.Utils.Dialog({title:"Error",content:"<p>"+i.message+"<\/p>",buttons:[{text:"Close",className:"btn",success:!0}]})}},renderResourceSelectView:function(){var n=new i.Views.ResourceSelectView({onlyResources:this.options.onlyResources});this.renderView(this.ui.resource,n)},renderResourceListView:function(){this.options.onlyResources||this.renderView(this.ui.resourceAdded,new i.Views.ResourceListView({collection:this.collection,plugin:this.options.isPlugin}))},unbindUnload:function(){this.collection.length||($(window).off("unload"),$(window).off("beforeunload"),t.Events.trigger("subnav:unlock"))},bindUnload:function(){$(window).on("unload",_.bind(this.onUnload,this));$(window).on("beforeunload",_.bind(this.beforeUnload,this));t.Events.trigger("subnav:lock")},beforeUnload:function(){return i.Config.onbeforeunload},onUnload:function(){this.resourceUpload&&r.Utils.AjaxHelper.post("/api/upload/v3/cancel",this.resourceUpload.toJSON())},renderPluploader:function(){this.renderResourceSelectView();this.initializePluploader();this.options.onlyResources||this.renderResourceListView()},onRendered:function(){this.renderPluploader()},getType:function(t){return t=t.toLowerCase(),n.Shared.Helpers.getResourceExtensionType(t)}})}(ClickView,EasyMoney);!function(n){"use strict";var t=n.NewUpload,i=t.Views.UploadResourceView.prototype;t.Views.UploadSubtitleView=t.Views.UploadResourceView.extend({template:t.Templates.SubtitleUpload,defaults:_.extend({},i.defaults,{extensions:n.Shared.Helpers.getSubtitleFileExtenstionWhitelist()}),ui:_.extend({},i.ui,{subtitleAdded:".subtitle-added-list",uploadSubtitleBtn:".upload-subtitle-btn"}),initialize:function(){i.initialize.apply(this,arguments);this.listenTo(this.collection,"add remove",this.onUpdateBtn)},onUpdateBtn:function(){var n=this.collection.length;n>4?(this.ui.uploadSubtitleBtn.addClass("disabled"),this.ui.uploadSubtitleBtn.attr("disabled","disabled")):(this.ui.uploadSubtitleBtn.removeClass("disabled"),this.ui.uploadSubtitleBtn.removeAttr("disabled","disabled"))},initializePluploader:function(){var n=this;this.pluploader=new plupload.Uploader({runtimes:"html5,flash,silverlight,html4",url:"/api/upload/v3/",browse_button:this.$(".upload-subtitle-btn").get(0),filters:{mime_types:[{title:"Subtitle files",extensions:this.options.extensions}]},chunk_size:1048576,multi_selection:!1,container:this.$el.get(0),max_retries:5,multipart:!1,flash_swf_url:"/Assets/js/libs/plupload/Moxie.swf",silverlight_xap_url:"/Assets/js/libs/plupload/Moxie.xap",init:{Init:function(){n.canChunk=this.features.chunks&&this.settings.chunk_size>0;this.settings.filters.max_file_size=n.canChunk?n.options.maxFileSizeChunked:n.options.maxFileSize}}});this.pluploader.init();this.bindPluploaderEvents()},getuploadModel:function(){return new t.Models.SubtitleFileUpload},renderResourceSelectView:function(){return},renderResourceListView:function(){this.options.onlyResources||this.renderView(this.ui.subtitleAdded,new t.Views.SubtitleListView({collection:this.collection,plugin:this.options.isPlugin,radio:this.radio}))}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.NewUpload,r=n.Shared;i.Views.UploadSuccessView=t.View.extend({template:i.Templates.UploadSuccess,events:{"click .go-home":"onClick","click .go-to-channel":"onClickChannelLink"},onClick:function(n){return n.stopPropagation(),t.Events.trigger("navigate","/exchange"),!1},onClickChannelLink:function(n){n.preventDefault();t.Events.trigger("navigate",this.getUserChannelUrl())},getUserChannl:function(){return n.Data.User.userChannels&&n.Data.User.userChannels.length?n.Data.User.userChannels[0]:null},getUserChannelUrl:function(){var t=this.getUserChannl();return t?"/exchange/channels/"+t.id+"/"+n.Shared.Helpers.Slugify(t.name):""},viewOptions:function(){var n=this.getUserChannl();return{userChannelUrl:this.getUserChannelUrl(),channelName:n?n.name:""}}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.NewUpload,r=n.Shared;i.Views.UploadView=t.View.extend({template:i.Templates.Upload,className:"contribute-view transparent-box col-md-10 col-md-offset-1",defaults:{extensions:n.Shared.Helpers.getVideoExtensionWhitelist(),maxFileSize:209715200,maxFileSizeChunked:4294967296,categoryRequired:!0,addToUserChannel:!1,showLogs:!1},ui:{video:".video-viewpart",progress:".progress-viewpart",metadata:".metadata-viewpart",resource:".resource-viewpart"},initialize:function(){this.model||(this.model=new i.Models.UploadModel(null,{categoryRequired:this.options.categoryRequired}),!this.options.videoType||this.model.set("videoType",this.options.videoType),!this.options.destination||this.model.set("destination",this.options.destination),this.model.isFromWorkspace=!!this.options.contribution);this.options.maxFileSizeChunked=this.options.cvContributorUploadSize||this.options.maxFileSizeChunked;this.options.username=n.Data.User.username;this.listenTo(this.model,"change:videoType",this.videoTypeSelected);this.listenTo(this.model,"request",this.onRequest);this.listenTo(this.model,"sync",this.onSaved);this.listenTo(this.model,"error",this.onError);this.listenTo(this.model,"cancel-upload",this.cancelUploadClicked);this.listenTo(t.Events,"upload:cancel",this.cancelUpload);this.options.contribution&&(this.listenTo(this.options.contribution,"sync",this.onContributionSync),this.listenTo(this.options.contribution,"error",this.onContributionError));this.fileUpload=new i.Models.FileUpload;this.options.addToUserChannel&&(this.setUserChannels(),this.model.set("status",1));this.resourceFileCollection=new i.Collections.ResourceFileCollection;this.subtitleFileCollection=new i.Collections.SubtitleFileCollection},initializePluploader:function(){var n=this;this.pluploader=new plupload.Uploader({runtimes:"html5,flash,silverlight,html4",url:"/api/upload/v3/",browse_button:this.$(".browse").get(0),filters:{mime_types:[{title:"Video files",extensions:this.options.extensions}]},chunk_size:4194304,drop_element:this.$(".drop-area").get(0),multi_selection:!1,container:this.$el.get(0),max_retries:5,multipart:!1,flash_swf_url:"/Assets/js/libs/plupload/Moxie.swf",silverlight_xap_url:"/Assets/js/libs/plupload/Moxie.xap",init:{Init:function(){n.canChunk=this.features.chunks&&this.settings.chunk_size>0;this.settings.filters.max_file_size=n.canChunk?n.options.maxFileSizeChunked:n.options.maxFileSize}}});this.pluploader.init();this.bindPluploaderEvents()},unbindPluploaderEvents:function(){this.pluploader.unbindAll()},bindPluploaderEvents:function(){this.pluploader.bind("FilesAdded",_.bind(this.filesAdded,this));this.pluploader.bind("UploadProgress",_.bind(this.fileUploading,this));this.pluploader.bind("FileUploaded",_.bind(this.fileUploaded,this));this.pluploader.bind("Error",_.bind(this.uploadErrorHandler,this));this.pluploader.bind("ChunkUploaded",_.bind(this.chunkUploadedHandler,this));this.pluploader.bind("BeforeChunkUpload",_.bind(this.beforeChunkUploadedHandler,this))},filesAdded:function(n,t){var i=_.first(t),u=i.name.split("."),f=u.length>1?u.pop():"",e=u.join("."),o={name:e,fileSize:i.size,extension:f};this.model.set({fileSize:i.size,fileName:i.name});this.renderVideoListItem();this.renderProgress();this.bindUnload();r.Utils.AjaxHelper.post("/api/upload/v3/",o).success(this.uploadSessionStarted.bind(this)).error(this.onUploadSessionError.bind(this))},uploadSessionStarted:function(n){this.fileUpload.set(n);this.pluploader.settings.url=this.fileUpload.get("ingestUrl");this.pluploader.start()},onUploadSessionError:function(){alert("There was a problem establishing an upload session. Please try again.")},fileUploading:function(n,t){this.progressView.update(t.percent,t.percent.toFixed(0)+"%");t.percent>=100&&(this.progressView.update(t.percent,"Upload Complete"),this.metadataView.enableFinish())},fileUploaded:function(n,t,i){var r=JSON.parse(i.response);this.model.uploaded=!0;this.model.set("fileUrl",r.url||r.Url)},beforeChunkUploadedHandler:function(n,t,i,r){var u=i.chunk,f=r.size,e=t.size;this.options.showLogs&&console.log("Uploading chunk: "+u+" length: "+f);n.settings.headers=this.getChunkHeaders(u,f,e)},chunkUploadedHandler:function(n,t,i){if(this.options.showLogs){var r=i.offset/i.total*100;console.log("Chunk uploaded "+r.toFixed(2)+"%")}},getChunkHeaders:function(n,t,i){return{"x-cv-upload-chunkindex":n,"x-cv-upload-chunklength":t,"x-cv-upload-length":i,Accept:"application/json; charset=utf-8"}},setUserChannels:function(){var t=n.Data.User.userChannels;t&&t.length&&this.model.set("userChannels",_.map(t,function(n){return n.id}))},uploadErrorHandler:function(t,i){switch(i.code){case-600:n.Utils.Dialog({title:"Whoops",content:"<p>The file you selected was too large to upload. Maximum filesize is: "+r.Helpers.ToFilesize(this.pluploader.settings.filters.max_file_size,1)+"<\/p>",buttons:[{text:"Okay",className:"btn primary",success:!0}]});break;case-601:n.Utils.Dialog({title:"Whoops",content:"<p>The file you selected was not a supported video file. All major formats are supported including AVI, MP4, MPEG, MOV and MKV.<\/p>",buttons:[{text:"Okay",className:"btn primary",success:!0}]});break;default:n.Utils.Dialog({title:"Error",content:"<p>"+i.message+"<\/p>",buttons:[{text:"Okay",className:"btn primary",success:!0}]})}},renderFileSelector:function(){if(this.options.contribution&&this.model.get("trackingCode"))return this.renderVideoListItem();var n=new i.Views.FileSelectView({model:this.model});this.renderView(this.ui.video,n)},renderMetadata:function(){var n=this.options.metadataView||i.Views.MetadataView;this.metadataView=new n(_.extend({model:this.model,resourceFileCollection:this.resourceFileCollection,subtitleFileCollection:this.subtitleFileCollection},this.options));this.renderView(this.ui.metadata,this.metadataView)},renderVideoListItem:function(){var t=new i.Views.VideoListItem({model:this.model,lazyload:!1,clickable:!1,showPreview:!1,ratings:this.options.ratings,actions:new n.Shared.Collections.VideoActionCollection(this.getActions())});this.renderView(this.ui.video,t)},getActions:function(){var n=[];return this.model.isFromWorkspace||n.push({text:"Cancel",desc:"Cancel upload",eventName:"cancel-upload",className:"cancel-upload",button:!0,order:1}),n},renderProgress:function(){this.progressView=new r.Views.ProgressBarView({boxless:!0,loadingText:"0%"});this.renderView(this.ui.progress,this.progressView)},videoTypeSelected:function(){this.render();this.onRendered()},onRequest:function(){this.spinJsView=new r.Views.SpinJsView({cover:!0,mask:!0});this.renderView(this.$el,this.spinJsView,{empty:!1})},onSaved:function(){this.renderView(this.$el,new i.Views.UploadSuccessView({channelContribution:this.options.channelContribution}));this.unbindUnload()},onError:function(){alert("Something went wrong. Please try again later.");this.spinJsView&&this.spinJsView.close();this.renderMetadata();this.renderPluploader();this.$el.removeClass("transparent-box")},unbindUnload:function(){$(window).off("unload");$(window).off("beforeunload");t.Events.trigger("subnav:unlock")},bindUnload:function(){$(window).on("unload",_.bind(this.onUnload,this));$(window).on("beforeunload",_.bind(this.beforeUnload,this));t.Events.trigger("subnav:lock")},beforeUnload:function(){return i.Config.onbeforeunload},cancelUploadClicked:function(){confirm("Are you sure you want to cancel upload?")&&(t.Events.trigger("upload:cancel"),this.model.unset("fileSize"),this.model.unset("fileName"),this.clearProgress(),this.renderPluploader())},clearProgress:function(){this.ui.progress.empty()},cancelUpload:function(){this.pluploader&&(this.pluploader.stop(),this.unbindPluploaderEvents(),this.onUnload());this.unbindUnload()},onUnload:function(){this.fileUpload&&r.Utils.AjaxHelper.post("/api/upload/v3/cancel",this.fileUpload.toJSON())},swapIn:function(){var n=this;window.setTimeout(function(){n.trigger("swap")},i.Config.fadeTime)},isLoaded:function(){return!(this.options.contribution&&!this.options.contribution.loaded)},onContributionSync:function(){var n=this;this.options.contribution&&this.model.mapContribution(this.options.contribution);!this.options.contribution.get("resources")||_.each(this.options.contribution.get("resources"),function(t){n.resourceFileCollection.add(new i.Models.ResourceFileUpload({fileId:t.fileId,name:t.name,metadata:t.metadata.type,fileUrl:t.url,completed:!0,contribution:!0}))});!this.options.contribution.get("subtitles")||_.each(this.options.contribution.get("subtitles"),function(t){n.subtitleFileCollection.add(new i.Models.SubtitleFileUpload({fileId:t.fileId,name:t.name,metadata:t.type,fileUrl:t.url,completed:!0,contribution:!0,language:t.language}))});this.render()},onContributionError:function(n,t){this.options.contribution.set(t.responseJSON);this.contributionError=!0;this.options.contribution.loaded=!0;this.render()},renderContributionError:function(){this.renderView(this.$el,new r.Views.ErrorView({message:this.options.contribution.get("message")}))},renderPluploader:function(){this.renderFileSelector();this.options.contribution||this.initializePluploader();this.options.contribution&&this.bindUnload()},onBeforeRender:function(){return this.isLoaded()?!0:(this.options.contribution.fetch(),!1)},onRender:function(){this.swapIn()},onRendered:function(){if(this.contributionError)return this.renderContributionError();this.renderMetadata();this.renderPluploader();this.$el.removeClass("transparent-box")}})}(ClickView,EasyMoney);!function(n){"use strict";var t=n.NewUpload,i=n.Shared;t.Views.VideoListItem=i.Views.VideoListItemView.extend({initialize:function(){this.listenTo(this.model,"change",this.onChange)},getRatingName:function(n){var t=this.options.ratings.find(function(t){return t.get("id")===n});return t?t.get("code"):""},onChange:function(){this.render()},getModel:function(){var t=this.model.toJSON();return t.rating={code:this.getRatingName(t.rating)},this.options.trimDescription&&(t.description=n.Shared.Helpers.ToWordCount(t.description||"",65,!0)),t.title||(t.title=t.fileName),{video:t,options:this.options,actionUrl:this.options.clickable?this.model.actionUrl():!1,showDate:!this.model.isLibraryVideo()&&!this.model.isExchangeVideo(),localTime:moment.utc(this.model.get("dateCreated")).toDate().toISOString(),badge:this.options.badge?this.options.badge:!1,lazyload:this.options.lazyload,thumbUrl:t.thumbnail?t.thumbnail:n.Data.Config.urls.imageCDN+"/v1/thumbnails/trackingcode/"+t.tokenId+"?size=small",title:t.title}},renderVideoActions:function(){var t=new n.Shared.Views.VideoActionsListView({collection:this.options.actions,itemModel:this.model});this.renderView(this.ui.$videoActionsContainer,t);t.trigger("rendered");this.delegateEvents()}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.NewUpload,r=n.Shared;i.Views.VideoMetadataView=r.Views.MultiStepStepView.extend({template:i.Templates.VideoMetadata,className:"metadata-form",showNavigateBack:!0,showResourcesForm:!1,ui:{toggleResourceForm:".toggle-resource-form",resourceViewPart:".resource-viewpart",subtitleViewPart:".subtitle-viewpart",resourceAddFormContainer:".resource-add-form-container"},events:{"click .toggle-resource-form":"toggleResources"},bindings:function(){return{"[name=title]":{observe:"title",setOptions:{validate:!0},onSet:n.Shared.Helpers.StripHTML},"[name=description]":{observe:"description",setOptions:{validate:!0},onSet:n.Shared.Helpers.StripHTML},"[name=rating]":{observe:"rating",selectOptions:{collection:this.options.ratings,labelPath:"displayName",valuePath:"id",defaultOption:{label:"Please choose a rating",value:null}},setOptions:{validate:!0}},"[name=category]":{observe:"category",selectOptions:{collection:this.options.categories.toFlatSelectList(),labelPath:"name",valuePath:"id",defaultOption:{label:"Please choose a category",value:null}},setOptions:{validate:!0}}}},initialize:function(){var n=this.options.categories.loaded?$.Deferred().resolve():this.options.categories.fetch(),t=this.options.ratings.loaded?$.Deferred().resolve():this.options.ratings.fetch();$.when(n,t).then(_.bind(this.render,this))},isLoaded:function(){return this.options.ratings.loaded&&this.options.categories.loaded&&!(this.options.contribution&&!this.options.contribution.loaded)},onValidated:function(){this.isStepValid()?this.enableNext():this.disableNext()},bindValidation:function(){Backbone.Validation.bind(this)},isStepValid:function(){return this.model.isValid(["title","description","rating","category"])},viewOptions:function(){var t=n.Data.User.userChannels;return{categoryRequired:this.options.categoryRequired,channelName:t&&t.length?t[0].name:"",channelContribution:this.options.addToUserChannel&&t&&t.length,isContribution:!!this.options.contribution}},onRender:function(){this.enableNext();this.stickit();this.bindValidation();this.renderResource()},onClose:function(){Backbone.Validation.unbind(this)},onBeforeRender:function(){return this.isLoaded()?!0:(this.renderView(this.$el,new r.Views.SpinJsView),!1)},stepComplete:function(){if(this.model.isFreeToAir()&&this.isStepValid())return this.goNext();this.model.validate()},renderResource:function(){this.options.resourceFileCollection.include=this.showResourcesForm;this.options.subtitleFileCollection.include=this.showResourcesForm;this.renderView(this.ui.toggleResourceForm,new i.Views.ResourceToggleView({show:this.showResourcesForm}));this.renderView(this.ui.subtitleViewPart,new i.Views.UploadSubtitleView({collection:this.options.subtitleFileCollection,onlyResources:!1,isPlugin:this.options.isPlugin}));this.renderView(this.ui.resourceViewPart,new i.Views.UploadResourceView({collection:this.options.resourceFileCollection,onlyResources:!1,isPlugin:this.options.isPlugin}))},toggleResources:function(){this.showResourcesForm=!this.showResourcesForm;this.showResourcesForm?this.ui.resourceAddFormContainer.show():this.ui.resourceAddFormContainer.hide();this.options.resourceFileCollection.include=this.showResourcesForm;this.options.subtitleFileCollection.include=this.showResourcesForm;this.renderView(this.ui.toggleResourceForm,new i.Views.ResourceToggleView({show:this.showResourcesForm}))}});i.Views.ResourceToggleView=t.View.extend({template:'<input id="resource-toggle" class="resource-subtitle-toggle-checkbox" type="checkbox" {{checked show}}/><label for="resource-toggle" class="control-label toggle-message">Include Resources & Subtitle<\/p>',getModel:function(){return{show:this.options.show}}})}(ClickView,EasyMoney),function(n){"use strict";n.Models.ActionItem=EasyMoney.Model.extend({defaults:{text:null,action:null,selected:!1}})}(ClickView.OrderedCollections),function(n){"use strict";n.Models.Playlist=ClickView.Shared.Models.MasterPlaylist.extend({urlRoot:"/api/orderedcollections",defaults:{name:null,videos:[],thumbnail:{},editable:!1,description:null},associations:{thumbnail:function(n,t){return new ClickView.Shared.Models.Thumbnail(n,t)},videos:function(t,i){return new n.Collections.VideoCollection(t,_.extend({},i,{parse:!0}))}},initialize:function(){this.listenTo(this,"sync",this.setLoaded);this.listenTo(this,"request",this.resetLoaded)},isLoaded:function(){return this._loaded},setLoaded:function(){this._loaded=!0;this.loaded=!0},resetLoaded:function(){this._loaded=!1},validate:function(n){return n.name?null:"Name is required"},share:function(n){var t={resourceId:this.get("id"),resourceType:"masterPlaylist"};return _.isNumber(n)&&(t.privacyId=n),this.set("privacyId",n),ClickView.Shared.Utils.AjaxHelper.get("/api/sharedResource",t).success(_.bind(function(n){this.trigger("shared",n,this)},this))},getAvailablePrivacies:function(){return[1,2,3]},assoc:function(n,t){t||(t={});var i="/api/orderedcollections/"+this.get("id")+"/videos",r={videoId:n.get("id")};return ClickView.Shared.Utils.AjaxHelper.post(i,r).done(_.bind(this.onAssociate,this,_.extend({},t,{assocCount:1})))},assocMany:function(n,t){if(t||(t={}),!n.length)return null;var r="/api/orderedcollections/"+this.id+"/videos/add",i=_.map(n,function(n){return n.id}),u={videoIds:i},f={assocCount:i.length||0};return ClickView.Shared.Utils.AjaxHelper.post(r,u).done(_.bind(this.onAssociate,this,_.extend({},t,f)))},dissoc:function(n,t){t||(t={});var i="/api/orderedcollections/"+this.get("id")+"/videos/"+n.get("id");return ClickView.Shared.Utils.AjaxHelper.httpDelete(i).done(_.bind(this.onDissociate,this,t))},dissocMany:function(n,t){if(t||(t={}),!n.length)return null;var r="/api/orderedcollections/"+this.id+"/videos/remove",i=_.pluck(n,"id"),u={videoIds:i},f={assocCount:i.length||0};return ClickView.Shared.Utils.AjaxHelper.post(r,u).done(_.bind(this.onDissociate,this,_.extend({},t,f)))},onAssociate:function(n){n.updateCount&&this.videos.incrementTotalItems(n.assocCount);this.trigger("associate",{success:!0})},onDissociate:function(n){n.updateCount&&this.videos.decrementTotalItems(n.assocCount);this.trigger("dissociate",{success:!0})},containsVideo:function(n){return this.videos?!!this.videos.findWhere({id:n}):!1},parse:function(n){n.dateModified&&(n.localDateModified=moment.utc(n.dateModified).toDate().toISOString());n.dateCreated&&(n.localDateCreated=moment.utc(n.dateCreated).toDate().toISOString());for(var t in this.associations)_.has(n,t)&&!n[t]&&delete n[t];return n},save:function(n,t){n=n||this.toJSON();t=t||{};return n=_.omit(n,["videos","thumbnail"]),t.attrs=n,EasyMoney.NestedModel.prototype.save.call(this,n,t)},rootUrl:function(){return"/orderedcollections"},actionUrl:function(){return this.rootUrl()+"/playlists/"+this.id}});n.Models.PlaylistWithPagedVideoCollection=n.Models.Playlist.extend({defaults:_.extend({},n.Models.Playlist.prototype.defaults,{videos:{data:[],pagination:{}}}),associations:_.extend({},n.Models.Playlist.prototype.associations,{videos:function(t){return new n.Collections.PagedVideoCollection(t.data,t.pagination)}})})}(ClickView.OrderedCollections),function(n){"use strict";n.Models.Thumbnail=EasyMoney.Model.extend({defaults:{url:null}})}(ClickView.OrderedCollections),function(n){"use strict";n.Models.Video=ClickView.Shared.Models.Video.extend({defaults:_.extend({},ClickView.Shared.Models.Video.prototype.defaults,{module:"ORDEREDCOLLECTIONS"}),urlRoot:function(){return"/api/orderedcollections/"+this.getPlaylistId()+"/videos"},actionUrl:function(){return"/orderedcollections/playlists/"+this.getPlaylistId()+"/videos/"+this.id},getPlaylistId:function(){return this.get("playlistId")||this.collection.parent.id},getAjaxData:function(){return{resourceId:this.get("id"),resourceType:this.get("resourceType")}},isMasterVideo:function(){return!0},parse:function(n){return n=ClickView.Shared.Helpers.MasterToOnlineVideo(n),n.year=ClickView.Shared.Helpers.getValidVideoYear({productionYear:n.productionYear}),n}});n.Models.RelatedVideo=n.Models.Video.extend({defaults:_.extend({},n.Models.Video.prototype.defaults,{url:function(){return this.actionUrl()}}),getPlaylistId:function(){return this.collection.options.playlistId}})}(ClickView.OrderedCollections),function(n){"use strict";n.Collections.ActionItemCollection=EasyMoney.Collection.extend({model:n.Models.ActionItem,initialize:function(){this.listenTo(this,"change:selected",this.onChangeSelected)},onChangeSelected:function(n){n.get("selected")&&this.each(function(t){t.set("selected",t===n)})}})}(ClickView.OrderedCollections),function(n){"use strict";n.Collections.PlaylistCollection=EasyMoney.PagedCollection.extend({url:"/api/orderedcollections",model:n.Models.PlaylistWithPagedVideoCollection,defaults:{page:1,limit:25,"with":"videos",orderby:"orderbydesc:datecreated"},initialize:function(){this.listenTo(this,"sync",this.setLoaded);this.listenTo(this,"request",this.resetLoaded)},isLoaded:function(){return this._loaded},setLoaded:function(){this._loaded=!0},resetLoaded:function(){this._loaded=!1},fetchFromMaster:function(n){this.fetch({data:this.toData(n)})},toData:function(n){var t=_.extend({},this.defaults,n);return{"with":t.with,filter:"{"+t.orderby+",page:"+t.page+",limit:"+t.limit+"}"}}});n.Collections.AllPlaylistCollection=EasyMoney.Collection.extend({url:"/api/orderedcollections/all",model:n.Models.PlaylistWithPagedVideoCollection,defaults:{page:1,limit:25,"with":"videos",orderby:"orderbydesc:datecreated"},initialize:function(){this.listenTo(this,"sync",this.setLoaded);this.listenTo(this,"request",this.resetLoaded)},isLoaded:function(){return this._loaded},setLoaded:function(){this._loaded=!0},resetLoaded:function(){this._loaded=!1},toData:function(n){var t=_.extend({},this.defaults,n);return{"with":t.with,filter:"{"+t.orderby+",page:"+t.page+",limit:"+t.limit+"}"}}})}(ClickView.OrderedCollections),function(n){n.Collections.RelatedVideosCollection=ClickView.Shared.Collections.RelatedVideosCollection.extend({model:n.Models.RelatedVideo,url:function(){return"/api/orderedcollections/"+this.options.playlistId+"/videos"},fetch:function(){ClickView.Shared.Collections.RelatedVideosCollection.prototype.fetch.call(this,{data:{"with":"rating,thumbnail",filter:"{orderbydesc:datecreated,page:1,limit:25}"}})},parse:function(n){return _.filter(n.data,function(n){return n.id!=this.options.videoId},this)}})}(ClickView.OrderedCollections),function(n){"use strict";n.Collections.VideoCollection=EasyMoney.Collection.extend({model:n.Models.Video,url:function(){return"/api/orderedcollections/"+this.parent.id+"/videos"},initialize:function(){this.listenTo(this,"reorder",this.reorder)},decrementTotalItems:function(n){n=_.isNumber(n)&&n||1;this._totalItems-=n},incrementTotalItems:function(n){n=_.isNumber(n)&&n||1;this._totalItems+=n},reorder:function(n,t){var i=this.at(n);this.remove(i,{silent:!0});this.add(i,{at:t,silent:!0})},currentPage:function(){return Math.ceil(this.length/this.pageSize())},nextPage:function(){return Math.min(this.currentPage()+1,this.totalPages())},totalPages:function(){return Math.ceil(this.totalItems()/this.pageSize())},totalItems:function(){return this._totalItems},setTotalItems:function(n){this._totalItems=n},pageSize:function(){return this._pageSize},parse:function(n){return n?n.pagination?(this._pageSize=n.pagination.pageSize||0,this._totalItems=n.pagination.totalItems||0,n.data):[]:[]}});n.Collections.PagedVideoCollection=EasyMoney.PagedCollection.extend({model:n.Models.Video})}(ClickView.OrderedCollections);this.ClickView=this.ClickView||{};this.ClickView.OrderedCollections=this.ClickView.OrderedCollections||{};this.ClickView.OrderedCollections.Templates=this.ClickView.OrderedCollections.Templates||{};this.ClickView.OrderedCollections.Templates.CreatePlaylist=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="form-group">\r\n    <label for="name" class="control-label">Playlist\'s Name<span class="required">*<\/span><\/label>\r\n    <input id="name" class="name form-control large" name="name" type="text" placeholder="Choose a meaningful name for your playlist" required />\r\n    <span class="help-block hidden"><\/span>\r\n<\/div>\r\n<div class="form-group">\r\n    <label for="description" class="control-label">Description<\/label>\r\n    <textarea placeholder="Describe the content of this playlist in one or two sentences, try to be as clear and concise as possible" name="description" id="description" class="large"><\/textarea>\r\n    <span class="help-block hidden"><\/span>\r\n<\/div>\r\n<div class="popup-button-container">\r\n    <a class="btn grey cancel">Cancel<\/a>\r\n    <a class="btn orange create">Create<\/a>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.OrderedCollections=this.ClickView.OrderedCollections||{};this.ClickView.OrderedCollections.Templates=this.ClickView.OrderedCollections.Templates||{};this.ClickView.OrderedCollections.Templates.DDLItem=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return n.escapeExpression((f=(f=i.text||(t!=null?t.text:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"text",hash:{},data:u}):f))},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.OrderedCollections=this.ClickView.OrderedCollections||{};this.ClickView.OrderedCollections.Templates=this.ClickView.OrderedCollections.Templates||{};this.ClickView.OrderedCollections.Templates.Description=Handlebars.template({"1":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.description:t,{name:"if",hash:{},fn:n.program(2,u,0),inverse:n.program(4,u,0),data:u}))!=null?f:""},"2":function(){return'    <div class="description-viewpart"><\/div>\r\n'},"4":function(){return'    <div class="add-description-container">\r\n        <span class="description-text">Add description<\/span>\r\n    <\/div>\r\n'},"6":function(n,t,i,r,u){var f;return'    <p class="playlist-description-text">'+((f=(i.linkify||t&&t.linkify||i.helperMissing).call(t!=null?t:n.nullContext||{},t!=null?t.description:t,{name:"linkify",hash:{},data:u}))!=null?f:"")+"<\/p>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.editable:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(6,u,0),data:u}))!=null?f:""},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.OrderedCollections=this.ClickView.OrderedCollections||{};this.ClickView.OrderedCollections.Templates=this.ClickView.OrderedCollections.Templates||{};this.ClickView.OrderedCollections.Templates.LayoutItemView=Handlebars.template({"1":function(){return"selected"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var o,f,e=t!=null?t:n.nullContext||{},s=i.helperMissing,h="function",c=n.escapeExpression;return'<div alt="'+c((f=(f=i.text||(t!=null?t.text:t))!=null?f:s,typeof f===h?f.call(e,{name:"text",hash:{},data:u}):f))+'" class="'+c((f=(f=i.action||(t!=null?t.action:t))!=null?f:s,typeof f===h?f.call(e,{name:"action",hash:{},data:u}):f))+" "+((o=i["if"].call(e,t!=null?t.selected:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?o:"")+'" />'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.OrderedCollections=this.ClickView.OrderedCollections||{};this.ClickView.OrderedCollections.Templates=this.ClickView.OrderedCollections.Templates||{};this.ClickView.OrderedCollections.Templates.Playlist=Handlebars.template({"1":function(){return'    <div class="toggle-viewpart"><\/div>\r\n'},"3":function(){return'<div class="helper-viewpart"><\/div>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{};return'<div class="nav-container">\r\n    <a href="'+n.escapeExpression((f=(f=i.rootUrl||(t!=null?t.rootUrl:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(o,{name:"rootUrl",hash:{},data:u}):f))+'" class="back icon left-arrow btn grey">All playlists<\/a>\r\n'+((e=i["if"].call(o,t!=null?t.isOwner:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?e:"")+'<\/div>\r\n<div class="playlist-header-viewpart"><\/div>\r\n'+((e=i["if"].call(o,t!=null?t.isOwner:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?e:"")+'<div class="video-list-viewpart"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.OrderedCollections=this.ClickView.OrderedCollections||{};this.ClickView.OrderedCollections.Templates=this.ClickView.OrderedCollections.Templates||{};this.ClickView.OrderedCollections.Templates.PlaylistDDL=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<a class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false">\r\n    '+n.escapeExpression((f=(f=i.text||(t!=null?t.text:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"text",hash:{},data:u}):f))+"\r\n<\/a>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.OrderedCollections=this.ClickView.OrderedCollections||{};this.ClickView.OrderedCollections.Templates=this.ClickView.OrderedCollections.Templates||{};this.ClickView.OrderedCollections.Templates.PlaylistHeader=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<div class="thumbnail-viewpart">\r\n    <div class="drop-area">\r\n        <div class="existing-image-container">\r\n            <img src="'+n.escapeExpression((f=(f=i.thumbnailUrl||(t!=null?t.thumbnailUrl:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"thumbnailUrl",hash:{},data:u}):f))+'" /><div class="change-image-banner-container"><div class="change-image-banner-text">Change image<\/div><\/div>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>\r\n<div class="metadata-container">\r\n    <div class="title-viewpart"><\/div>\r\n    <div class="additional-metadata-container">\r\n        <span class="video-count-viewpart"><\/span>\r\n    <\/div>\r\n    <div class="description-viewpart"><\/div>\r\n<\/div>\r\n<div class="actions-viewpart"><\/div>\r\n'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.OrderedCollections=this.ClickView.OrderedCollections||{};this.ClickView.OrderedCollections.Templates=this.ClickView.OrderedCollections.Templates||{};this.ClickView.OrderedCollections.Templates.PlaylistItem=Handlebars.template({"1":function(n,t,i,r,u){var f;return' href="'+n.escapeExpression((f=(f=i.url||(t!=null?t.url:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"url",hash:{},data:u}):f))+'" '},"3":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s=n.escapeExpression;return'            <div class="playlist-btn-video-count">'+s((f=(f=i.videoCount||(t!=null?t.videoCount:t))!=null?f:o,typeof f=="function"?f.call(e,{name:"videoCount",hash:{},data:u}):f))+" "+s((i.pluralize||t&&t.pluralize||o).call(e,t!=null?t.videoCount:t,"Video","Videos",{name:"pluralize",hash:{},data:u}))+"<\/div>\r\n"},"5":function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{};return" "+((e=i["if"].call(o,t!=null?t.lazyload:t,{name:"if",hash:{},fn:n.program(6,u,0),inverse:n.program(8,u,0),data:u}))!=null?e:"")+'="'+n.escapeExpression((f=(f=i.thumbnailUrl||(t!=null?t.thumbnailUrl:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(o,{name:"thumbnailUrl",hash:{},data:u}):f))+'?size=medium" '},"6":function(){return" data-original"},"8":function(){return"src"},"10":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s=n.escapeExpression;return'        <span class="badge">'+s((f=(f=i.videoCount||(t!=null?t.videoCount:t))!=null?f:o,typeof f=="function"?f.call(e,{name:"videoCount",hash:{},data:u}):f))+" "+s((i.pluralize||t&&t.pluralize||o).call(e,t!=null?t.videoCount:t,"Video","Videos",{name:"pluralize",hash:{},data:u}))+"<\/span>\r\n"},"12":function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.videoCount:t,{name:"if",hash:{},fn:n.program(13,u,0),inverse:n.noop,data:u}))!=null?f:""},"13":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s=n.escapeExpression;return'            <span class="video-count">'+s((f=(f=i.videoCount||(t!=null?t.videoCount:t))!=null?f:o,typeof f=="function"?f.call(e,{name:"videoCount",hash:{},data:u}):f))+" "+s((i.pluralize||t&&t.pluralize||o).call(e,t!=null?t.videoCount:t,"Video","Videos",{name:"pluralize",hash:{},data:u}))+" -<\/span>\r\n"},"15":function(n,t,i,r,u){var f;return(f=(i.isValid||t&&t.isValid||i.helperMissing).call(t!=null?t:n.nullContext||{},"date",t!=null?t.localDateModified:t,{name:"isValid",hash:{},fn:n.program(16,u,0),inverse:n.noop,data:u}))!=null?f:""},"16":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'            <span class="time-text">Updated <\/span>\r\n            <time class="timeago" datetime="'+h((f=(f=i.localDateModified||(t!=null?t.localDateModified:t))!=null?f:o,typeof f===s?f.call(e,{name:"localDateModified",hash:{},data:u}):f))+'">'+h((f=(f=i.localDateModified||(t!=null?t.localDateModified:t))!=null?f:o,typeof f===s?f.call(e,{name:"localDateModified",hash:{},data:u}):f))+"<\/time>\r\n"},"18":function(n,t,i,r,u){var f;return(f=(i.isValid||t&&t.isValid||i.helperMissing).call(t!=null?t:n.nullContext||{},"date",t!=null?t.localDateCreated:t,{name:"isValid",hash:{},fn:n.program(19,u,0),inverse:n.noop,data:u}))!=null?f:""},"19":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'            <span class="time-text">Created <\/span>\r\n            <time class="timeago" datetime="'+h((f=(f=i.localDateCreated||(t!=null?t.localDateCreated:t))!=null?f:o,typeof f===s?f.call(e,{name:"localDateCreated",hash:{},data:u}):f))+'">'+h((f=(f=i.localDateCreated||(t!=null?t.localDateCreated:t))!=null?f:o,typeof f===s?f.call(e,{name:"localDateCreated",hash:{},data:u}):f))+"<\/time>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,o,e=t!=null?t:n.nullContext||{},s=n.escapeExpression,h=i.helperMissing;return'<div class="cv-thumbnail">\r\n    <a '+((f=i["if"].call(e,t!=null?t.url:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+'>\r\n        <div class="playlist-btn-mask"><\/div>\r\n        <div class="playlist-btn-group">\r\n            <div class="playlist-btn-icon"><\/div>\r\n'+((f=i["if"].call(e,t!=null?t.videoCount:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:"")+'        <\/div>\r\n        <img alt="" title="'+s(n.lambda((f=t!=null?t.video:t)!=null?f.title:f,t))+'" '+((f=i["if"].call(e,t!=null?t.thumbnailUrl:t,{name:"if",hash:{},fn:n.program(5,u,0),inverse:n.noop,data:u}))!=null?f:"")+" />\r\n"+((f=i["if"].call(e,t!=null?t.showBadge:t,{name:"if",hash:{},fn:n.program(10,u,0),inverse:n.noop,data:u}))!=null?f:"")+'    <\/a>\r\n<\/div>\r\n<div class="cv-video-content">\r\n    <div class="name-container">\r\n        <div class="playlist-name">'+s((o=(o=i.name||(t!=null?t.name:t))!=null?o:h,typeof o=="function"?o.call(e,{name:"name",hash:{},data:u}):o))+'<\/div>\r\n    <\/div>\r\n    <div class="description-container">\r\n        <div class="cv-metadata contributor-info">\r\n'+((f=i["if"].call(e,t!=null?t.showVideoCount:t,{name:"if",hash:{},fn:n.program(12,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=i["if"].call(e,t!=null?t.localDateModified:t,{name:"if",hash:{},fn:n.program(15,u,0),inverse:n.program(18,u,0),data:u}))!=null?f:"")+'        <\/div>\r\n        <div class="playlist-description-wrapper">\r\n            <div>\r\n                <p class="playlist-description-text">'+((f=(i.linkify||t&&t.linkify||h).call(e,t!=null?t.description:t,{name:"linkify",hash:{},data:u}))!=null?f:"")+"<\/p>\r\n            <\/div>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>\r\n"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.OrderedCollections=this.ClickView.OrderedCollections||{};this.ClickView.OrderedCollections.Templates=this.ClickView.OrderedCollections.Templates||{};this.ClickView.OrderedCollections.Templates.Playlists=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="header-viewpart"><\/div>\r\n<div class="list-viewpart"><\/div>\r\n<div class="paginator-viewpart"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.OrderedCollections=this.ClickView.OrderedCollections||{};this.ClickView.OrderedCollections.Templates=this.ClickView.OrderedCollections.Templates||{};this.ClickView.OrderedCollections.Templates.PlaylistsHeader=Handlebars.template({"1":function(){return'<div class="button-container">\r\n    <button class="new-playlist btn grey icon add">Add Playlist<\/button>\r\n<\/div>\r\n'},"3":function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s=n.escapeExpression;return'<div class="count-container pull-left">'+s((f=(f=i.count||(t!=null?t.count:t))!=null?f:o,typeof f=="function"?f.call(e,{name:"count",hash:{},data:u}):f))+" "+s((i.pluralize||t&&t.pluralize||o).call(e,t!=null?t.count:t,"Playlist","Playlists",{name:"pluralize",hash:{},data:u}))+"<\/div>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.currentUserIsOwner:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(3,u,0),data:u}))!=null?f:""},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.OrderedCollections=this.ClickView.OrderedCollections||{};this.ClickView.OrderedCollections.Templates=this.ClickView.OrderedCollections.Templates||{};this.ClickView.OrderedCollections.Templates.PlaylistTitle=Handlebars.template({"1":function(){return'    <div class="title-viewpart"><\/div>\r\n'},"3":function(n,t,i,r,u){var f;return"    "+n.escapeExpression((f=(f=i.name||(t!=null?t.name:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"name",hash:{},data:u}):f))+"\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return(f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.editable:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(3,u,0),data:u}))!=null?f:""},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.OrderedCollections=this.ClickView.OrderedCollections||{};this.ClickView.OrderedCollections.Templates=this.ClickView.OrderedCollections.Templates||{};this.ClickView.OrderedCollections.Templates.VideoCount=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s=n.escapeExpression;return s((f=(f=i.videoCount||(t!=null?t.videoCount:t))!=null?f:o,typeof f=="function"?f.call(e,{name:"videoCount",hash:{},data:u}):f))+" "+s((i.pluralize||t&&t.pluralize||o).call(e,t!=null?t.videoCount:t,"video","videos",{name:"pluralize",hash:{},data:u}))},useData:!0}),function(n){"use strict";n.Views.CreatePlaylistView=EasyMoney.View.extend({name:"CreatePlaylistView.js",className:"create-playlist",template:n.Templates.CreatePlaylist,events:{"click .create":"onClickCreate","click .cancel":"onClickCancel"},bindings:{"[name=name]":{observe:"name",setOptions:{validate:!0},onSet:ClickView.Shared.Helpers.StripHTML},"[name=description]":{observe:"description",setOptions:{validate:!0},onSet:ClickView.Shared.Helpers.StripHTML}},initialize:function(){this.listenTo(this.model,"sync",this.onSync);this.listenTo(this.model,"request",this.onRequest);this.listenTo(this.model,"create:success",this.onSuccess)},onSync:function(n){this.close();this.collection.add(n)},onClickCreate:function(n){n.stopPropagation();n.preventDefault();this.model.validate();this.model.isValid()&&(this.renderLoader(),this.collection.add(this.model),this.model.save().done(_.bind(this.onCreateSuccess,this)).fail(_.bind(this.onCreateFail,this)))},onClickCancel:function(){this.close()},onCreateSuccess:function(){var n=_.bind(function(){EasyMoney.Events.trigger("navigate",this.options.actionUrl)},this),t={title:"Create a new playlist",content:"<p>Your playlist was successfully created. Go to your videos and start adding them to your playlist.<\/p>",buttons:[{text:"I'll do it later",className:"grey btn"},{text:"Go to videos",className:"btn primary",callback:n}]};ClickView.Utils.Dialog(t)},onCreateFail:function(){ClickView.Utils.Dialog({title:"Create a new playlist",content:"<p>Sorry, an error prevented your playlist from being created. Please try again.<\/p>",buttons:[{text:"Close",className:"grey btn",success:!0}]})},renderLoader:function(){this.renderView(this.$el,new ClickView.Shared.Views.SpinJsView({cover:!0,mask:!0}),{empty:!1})},onRender:function(){this.stickit();Backbone.Validation.bind(this)},onClose:function(){this.unstickit();Backbone.Validation.unbind(this)}})}(ClickView.OrderedCollections),function(n){"use strict";n.Views.DescriptionView=EasyMoney.View.extend({name:"DescriptionView.js",className:"playlist-description",template:n.Templates.Description,ui:{$description:".description-viewpart"},events:{"click .edit-result-view":"onClickEditDescription","click .add-description-container":"onClickEditDescription"},initialize:function(){this.listenTo(this.model,"change:editable",this.render)},onClickEditDescription:function(){var n=new ClickView.Shared.Views.EditView({model:this.model,property:"description",textArea:!0,adjustWidth:!1});this.listenTo(n,"close",this.render);this.renderView(this.$el,n)},renderDescription:function(){var n=function(n){return n.description},t=new ClickView.Shared.Views.EditResultView({model:this.model,title:"description",template:n});this.renderView(this.ui.$description,t)},onRender:function(){this.renderDescription()}})}(ClickView.OrderedCollections),function(n){"use strict";var t;t=EasyMoney.View.extend({name:"VideoCountView",className:"video-count",template:n.Templates.VideoCount,tagName:"span",initialize:function(){this.listenTo(this.model.videos,"remove",this.render)},viewOptions:function(){return{videoCount:this.model.videos.totalItems()||0}}});n.Views.PlaylistHeaderView=EasyMoney.View.extend({name:"PlaylistHeaderView",className:function(){return"playlist-header "+(this.model.get("editable")?"edit-mode":"")},template:n.Templates.PlaylistHeader,ui:{$title:".title-viewpart",$actions:".actions-viewpart",$thumbnail:".thumbnail-viewpart",$videoCount:".video-count-viewpart",$description:".description-viewpart",$imageSelect:".image-select-viewpart"},initialize:function(){this.listenTo(this.model,"share-playlist",this.sharePlaylist);this.listenTo(this.model,"delete-playlist",this.deletePlaylist)},sharePlaylist:function(){var t=new n.Views.ShareTabView({embeddable:!1,itemModel:this.model,resourceType:{type:"playlist",name:"playlist"}}),i=new ClickView.Shared.Views.PopupView({view:t,title:"Share this playlist",cssId:"cv-share-tab",showButtonContainer:!0});i.selfRender()},deletePlaylist:function(){var n={title:"Delete this playlist",content:"<p>Are you sure you want to delete this playlist?<\/p>",buttons:[{text:"Cancel",className:"grey btn"},{text:"Delete",className:"btn red",callback:_.bind(this.destroyPlaylist,this)}]};ClickView.Utils.Dialog(n)},destroyPlaylist:function(){this.model.destroy({wait:!0,success:_.bind(this.navigate,this)})},navigate:function(){EasyMoney.Events.trigger("navigate",this.model.rootUrl())},getActions:function(){return[{text:"Share",desc:"Share this playlist",eventName:"share-playlist",className:"share-playlist",button:!0,order:1},{text:"Delete playlist",desc:"Delete this playlist",eventName:"delete-playlist",className:"delete-playlist",order:3}]},renderVideoCount:function(){var n=new t({model:this.model});this.renderView(this.ui.$videoCount,n)},renderActions:function(){if(!this.model.get("editable")){var n=new ClickView.Shared.Collections.VideoActionCollection(this.getActions()),t=new ClickView.Shared.Views.VideoActionsListView({collection:n,itemModel:this.model});this.renderView(this.ui.$actions,t)}},onCropCancel:function(){},onCropDone:function(n){var t="/api/orderedcollections/"+this.model.get("id")+"/thumbnails/upload",i={dataUrl:n};this.renderView(this.ui.$thumbnail,new ClickView.Shared.Views.SpinJsView({cover:!0,mask:!0}),{empty:!1});ClickView.Shared.Utils.AjaxHelper.post(t,i).done(this.onCropUpload.bind(this))},onCropUpload:function(n){this.model.thumbnail.set("url",n.url);this.model.unset("hasError");this.model.unset("errorMessage");this.renderThumbnail()},getThumbnail:function(){var n=ClickView.Shared.Helpers.getThumbnailUrl(this.model,{allowNoDefault:!0,thumbnailSize:"medium"}),t;return n?n:(t=this.model.videos&&this.model.videos.first(),ClickView.Shared.Helpers.getThumbnailUrl(t,{thumbnailSize:"medium"}))},renderImageSelector:function(){var n=new ClickView.Shared.Views.ImageSelectView({onCrop:_.bind(this.onCropDone,this),onCancel:_.bind(this.onCropCancel,this),model:this.model.thumbnail,imageConfig:{ASPECT_RATIO:16/9,MIN_HEIGHT:144,MIN_WIDTH:256},editable:this.model.get("editable")});this.renderView(this.ui.$thumbnail,n)},renderThumbnail:function(){if(this.model.get("editable")){this.renderImageSelector();return}var n=new ClickView.Shared.Views.ThumbnailView({model:this.model,thumbnailUrl:this.getThumbnail(),thumbnailSize:"medium"});this.renderView(this.ui.$thumbnail,n)},renderDescription:function(){var t=new n.Views.DescriptionView({model:this.model});this.renderView(this.ui.$description,t)},renderTitle:function(){var t=new n.Views.PlaylistTitleView({model:this.model});this.renderView(this.ui.$title,t)},onRender:function(){this.renderTitle();this.renderActions();this.renderThumbnail();this.renderVideoCount();this.renderDescription()}})}(ClickView.OrderedCollections),function(n){"use strict";n.Views.PlaylistHeaderAction=EasyMoney.View.extend({name:"PlaylistHeaderAction",className:"playlists-header",template:n.Templates.PlaylistsHeader,defaults:{currentUserIsOwner:!1},ui:{$newPlaylist:".new-playlist"},events:{"click .new-playlist":"onClickNewPlaylist"},onClickNewPlaylist:function(){this.renderNewPlaylistPopup()},renderNewPlaylistPopup:function(){var t=new n.Models.Playlist,i=new n.Views.CreatePlaylistView({model:t}),r=new ClickView.Shared.Views.PopupView({view:i,title:"Share this video",cssId:"cv-share-tab",showButtonContainer:!0});r.selfRender()},viewOptions:function(){return{count:this.collection.totalItems(),currentUserIsOwner:this.options.currentUserIsOwner}}});n.Views.SortingView=ClickView.Shared.Views.SortingView.extend({renderHeaderAction:function(){var t=new n.Views.PlaylistHeaderAction({model:this.model,collection:this.collection,currentUserIsOwner:!0});this.renderView(this.ui.headerAction,t)}})}(ClickView.OrderedCollections),function(n){"use strict";var t,i;i=n.Views.PlaylistItemView=EasyMoney.View.extend({name:"PlaylistItemView",template:n.Templates.PlaylistItem,className:function(){return"playlist-item"+(this.options.layout==="grid"?" col-sm-4 col-lg-3":" cv-video")},ui:{$timestamp:"time.timeago"},events:{"click .name-container":"onClickName","click .cv-thumbnail":"onClickThumbnail"},defaults:{maxCharCount:80},navigate:function(){EasyMoney.Events.trigger("navigate",this.getActionUrl())},getActionUrl:function(){throw new Error("Implement getActionUrl on "+this.name);},onClickName:function(n){return n.preventDefault(),this.navigate(),!1},onClickThumbnail:function(n){return n.preventDefault(),n.stopPropagation(),this.navigate(),!1},initTimeago:function(){this.ui.$timestamp.timeago()},getThumbnail:function(){var n=ClickView.Shared.Helpers.getThumbnailUrl(this.model,{allowNoDefault:!0,thumbnailSize:"medium"}),t;return n?n:(t=this.model.videos&&this.model.videos.first(),ClickView.Shared.Helpers.getThumbnailUrl(t,{thumbnailSize:"medium"}))},viewOptions:function(){var n=this.model.get("description"),t,i;return this.options.layout==="grid"&&n&&(n=ClickView.Shared.Helpers.toCharacterCount(n,this.options.maxCharCount)),t=this.options.layout==="grid",i=this.model.videos.totalItems(),{url:this.getActionUrl(),videoCount:i,badge:this.options.badge?this.options.badge:!1,thumbnailUrl:this.getThumbnail(),showVideoCount:!t,showBadge:t&&i,description:n}},onRender:function(){this.initTimeago()}});t=n.Views.PlaylistListView=EasyMoney.ListView.extend({name:"PlaylistListView",childView:i,tagName:"div",className:function(){var n="playlist-list "+this.options.layout;return this.options.layout==="grid"&&(n+=" row"),n},initialize:function(){this.listenTo(this.collection,"sync request",this.render)},addOne:function(n){(this.options.currentUserIsOwner||n.videos.length)&&EasyMoney.ListView.prototype.addOne.apply(this,arguments)},onBeforeRender:function(){if(this.collection.isLoaded()){if(this.collection.isEmpty())return this.$el.html("This channel doesn't have any playlists yet.").addClass("empty-state"),!1}else return this.renderView(this.$el,new ClickView.Shared.Views.LoaderView),!1;return!0}});n.Views.PlaylistsView=EasyMoney.View.extend({name:"PlaylistsView.js",className:"user-playlists",template:n.Templates.Playlists,listView:t,defaultLayout:"grid",layoutKey:"cv:playlists:layout",ui:{$list:".list-viewpart",$header:".header-viewpart",$paginator:".paginator-viewpart"},initialize:function(){this.listenToOnce(this.collection,"sync",this.render);this.listenTo(this.collection,"change:layout",this.onChangeLayout)},onChangeLayout:function(n){localStorage.setItem(this.layoutKey,n);this.renderList()},getLayout:function(){return localStorage.getItem(this.layoutKey)||this.defaultLayout},renderList:function(){var n=new this.listView({collection:this.collection,layout:this.getLayout(),currentUserIsOwner:this.options.currentUserIsOwner,parent:this.options.parent});this.renderView(this.ui.$list,n)},renderHeader:function(){var t=new n.Views.SortingView({collection:this.collection,layout:this.getLayout()});this.renderView(this.ui.$header,t)},onBeforeRender:function(){return this.collection.isLoaded()?!0:(this.renderView(this.$el,new ClickView.Shared.Views.LoaderView),!1)},onRender:function(){this.renderList();this.renderHeader()}})}(ClickView.OrderedCollections),function(n){"use strict";n.Views.PlaylistTitleView=EasyMoney.View.extend({name:"PlaylistTitleView.js",className:"playlist-title",template:n.Templates.PlaylistTitle,ui:{$description:".title-viewpart"},events:{"click .edit-result-view":"onClickEditTitle"},initialize:function(){this.listenTo(this.model,"change:editable",this.render)},onClickEditTitle:function(){var n=new ClickView.Shared.Views.EditView({model:this.model,property:"name"});this.listenTo(n,"close",this.render);this.renderView(this.$el,n)},renderTitle:function(){var n=function(n){return n.name},t=new ClickView.Shared.Views.EditResultView({model:this.model,title:"name",template:n});this.renderView(this.ui.$description,t)},onRender:function(){this.renderTitle()}})}(ClickView.OrderedCollections),function(n){"use strict";var t;t=EasyMoney.View.extend({name:"NumberView",className:"number",template:function(){return this.model.collection.indexOf(this.model)+1},initialize:function(){this.listenTo(this.model.collection,"remove",this.render)}});n.Views.PlaylistVideoItemView=ClickView.Shared.Views.VideoListItemView.extend({name:"PlaylistVideoItemView.js",renderNumber:function(){var n=new t({model:this.model});this.renderView(this.ui.$itemNumber,n)},onRender:function(){ClickView.Shared.Views.VideoListItemView.prototype.onRender.apply(this,arguments);this.renderNumber()}})}(ClickView.OrderedCollections),function(n){"use strict";n.Views.PlaylistVideoListView=ClickView.Shared.Views.MasterVideoListView.extend({name:"PlaylistVideoListView.js",defaults:_.extend({},ClickView.Shared.Views.MasterVideoListView.defaults,{editable:!1}),initialize:function(){ClickView.Shared.Views.MasterVideoListView.prototype.initialize.apply(this,arguments);this.playlist=this.collection.parent;this.listenTo(this.collection,"sync",this.onSync)},buildChildView:function(n){return new this.childView(_.extend({},_.omit(this.options,["collection","model","id"]),{model:n,isotope:!0,trimDescription:!0,showPreview:this.canPreview()}))},bindEvents:function(){$(window).bind("scroll."+this.cid,this.onScroll.bind(this))},unbindEvents:function(){$(window).unbind("scroll."+this.cid)},onSync:function(){this.unrenderLoader();this.refreshSortable();this.render()},refreshSortable:function(){this.options.editable&&this.$el.sortable("refresh")},toggleSortable:function(){this.options.editable?this.initSortable():this.destroySortable()},initSortable:function(){this.options.editable&&this.$el.sortable({containment:"parent",axis:"y",animation:300,placeholder:"sort-placeholder",tolerance:"pointer",cursor:"grabbing",stop:this.stopSorting.bind(this),start:this.startSorting.bind(this)})},destroySortable:function(){this.$el.sortable("destroy")},startSorting:function(n,t){this.sourceIndex=t.item.index()},stopSorting:function(n,t){var i=t.item.index();this.collection.trigger("reorder",this.sourceIndex,i);var u=this.collection.at(i).get("id"),r=this.collection.at(i+1),f=r?r.get("id"):0;ClickView.Shared.Utils.AjaxHelper.put("/api/orderedcollections/reorder",{sourceMemberId:u,ownerId:this.playlist.id,destinationMemberId:f})},onScroll:function(){if(!(window.innerHeight+window.scrollY<document.body.offsetHeight)&&!this.collection.isFetching()&&this.collection.currentPage()!==this.collection.totalPages()){var n=this.collection.nextPage();this.collection.fetch({remove:!1,reset:!1,parse:!0,data:{"with":"thumbnail,rating,channel",page:n}});this.renderLoader()}},renderLoader:function(){this.renderView(this.$el,new ClickView.Shared.Views.LoaderView,{empty:!1,childIndex:"loader"})},unrenderLoader:function(){this.closeChildrenByIndex("loader")},renderPagination:function(){},onRender:function(){ClickView.Shared.Views.MasterVideoListView.prototype.onRender.apply(this,arguments);this.bindEvents()},onRendered:function(){this.initSortable()},onClose:function(){ClickView.Shared.Views.MasterVideoListView.prototype.onClose.apply(this,arguments);this.unbindEvents()}})}(ClickView.OrderedCollections),function(n){"use strict";var t;t=EasyMoney.View.extend({name:"ReoderHelperView",className:"reorder-helper",tagName:"p",template:"You can reorder the videos within this playlist by dragging and dropping them"});n.Views.PlaylistView=EasyMoney.View.extend({name:"PlaylistView.js",className:"user-playlist",template:n.Templates.Playlist,ui:{$videoList:".video-list-viewpart",$header:".playlist-header-viewpart",$toggle:".toggle-viewpart",$helper:".helper-viewpart"},events:{"click .back":"onClickBack"},initialize:function(){this.toggleModel=new EasyMoney.Model;this.bindListeners()},bindListeners:function(){this.listenTo(this.model,"sync",this.render);this.listenTo(this.model,"change:editable",this.onEdit);this.listenTo(this.toggleModel,"toggle",this.onToggle)},getBackUrl:function(){throw new Error("Implement this backToPlaylists");},onClickBack:function(n){return n.preventDefault(),EasyMoney.Events.trigger("navigate",this.getBackUrl()),!1},onToggle:function(n){this.model.set("editable",n)},onEdit:function(){this.onBeforeRender()&&(this.renderHeader(),this.model.get("editable")?this.renderHelper():this.ui.$helper.empty(),this.model.videos&&this.model.videos.length?this.renderVideoList():this.renderEmptyState())},getActions:function(){return[{text:"Remove from playlist",desc:"Remove this video from this playlist",eventName:"delete-video",className:"delete-video"}]},viewOptions:function(){return{backUrl:this.model.backUrl(),isOwner:!0}},renderVideoList:function(){var t,i;this.closeChildrenByIndex("videoList");!this.options.actions&&this.model.get("editable")&&(t=new ClickView.Shared.Collections.VideoActionCollection(this.getActions()));i=new n.Views.PlaylistVideoListView({collection:this.model.videos,videoItemView:n.Views.PlaylistVideoItemView,actions:t,currentUser:ClickView.Data.User});this.renderView(this.ui.$videoList,i,{childIndex:"videoList"})},renderHeader:function(){this.closeChildrenByIndex("header");var t=new n.Views.PlaylistHeaderView({model:this.model});this.renderView(this.ui.$header,t,{childIndex:"header"})},renderToggle:function(){var n=new ClickView.Shared.Views.ToggleButtonView({model:this.toggleModel,text:"Toggle to edit playlist",toggleOn:this.model.get("editable")});this.renderView(this.ui.$toggle,n)},renderHelper:function(){(this.closeChildrenByIndex("helper"),this.model.get("editable")&&this.model.videos.length>1)&&this.renderView(this.ui.$helper,new t,{childIndex:"helper"})},renderEmptyState:function(){this.closeChildrenByIndex("emptyState");var n=new Shared.Views.EmptyStateView({header:"There are no videos in this playlist yet"});this.renderView(this.ui.$videoList,n,{childIndex:"emptyState"})},onBeforeRender:function(){return this.model.isLoaded()?!0:(this.renderView(this.$el,new ClickView.Shared.Views.LoaderView),!1)},onRender:function(){this.renderHeader();this.renderToggle();this.renderHelper();this.renderVideoList()}})}(ClickView.OrderedCollections),function(n){"use strict";n.Views.ShareTabView=ClickView.Shared.Views.ShareTabView.extend({name:"ShareTabView.js",initialize:function(){ClickView.Shared.Views.ShareTabView.prototype.initialize.apply(this,arguments);this.listenTo(this.itemModel,"shared",this.onShared)},onShared:function(){this.itemModel.get("privacyId")===3&&ClickView.Shared.Utils.AnalyticsService.logPlaylistPublicSharing(this.itemModel)},renderWarning:function(){if(this._loaded&&(this.ui.warningContainer.empty(),(this.itemModel.get("privacyId")||this.model.get("privacy").id)===3)){var n=new ClickView.Shared.Views.WarningView({message:"Please note: Only videos that you own or have the right to distribute will be publicly available."});this.renderView(this.ui.warningContainer,n)}}})}(ClickView.OrderedCollections),function(n){"use strict";var t=n.PushToDevice;t.Utils.Constants={CHANNELS:{APP:"device:app",CONFIG:"device:config",WEBPLAYER:"device:webplayer"},EVENTS:{APP:{DEVICELIST:"cv:ptd:devicelist",UPDATE_DEVICE:"cv:ptd:devicechange",ADD_DEVICE:"cv:ptd:adddevice",REMOVE_DEVICE:"cv:ptd:removedevice",DEVICE_PLAYBACK_STATUS:"cv:ptd:playbackstatus",SERVER_ERROR:"cv:ptd:error",TIME_SYNC:"cv:ptd:timesync",DEVICE_UNLOCK:"cv:ptd:unlockdevice",DEVICE_UPDATE:"cv:ptd:updatedevice",SYNC_TIME:"cv:ptd:synctime",GET_LOCK:"cv:ptd:getlock",ACTIVATE:"cv:ptd:activate",REMOVE:"cv:ptd:remove",LOCK_DEVICE:"cv:ptd:lockdevice",SEND_COMMAND:"cv:ptd:sendcommand",INVOKE:"cv:ptd:invoke",CONNECTION_UPDATE:"cv:ptd:connectionupdate",CHANGE_CHAPTER:"cv:ptd:changechapter",ACTIVATE_ERROR:"cv:ptd:activateerror"},SERVER:{SUBSCRIBE:"subscribe",SUBSCRIBE_ADM:"subscribeadm",PAIR:"pair",UNPAIR:"unpair",COMMAND:"command",LOCK:"lock",TIME_SYNC:"timesync",CURRENT_STATUS:"currentstatus",DEVICELIST:"devicelist",UPDATE_DEVICE:"devicestatechange",ADD_DEVICE:"paired",REMOVE_DEVICE:"unpaired",DEVICE_PLAYBACK_STATUS:"playstatuschange",SERVER_ERROR:"servererror",LOCK_EXPIRED:"lockexpired"},CONFIG:{START:"cv-device-start",ACTIVATE:"cv-device-activate",STOP:"cv-device-stop"}},DEVICE_STATUS:{OFFLINE:0,ONLINE:1,LOCKED:2,SUSPENDED:3},COMMAND_TYPE:{PLAY:"PLAY",PAUSE:"PAUSE",RESUME:"RESUME",STOP:"STOP",PREV:"PREV",NEXT:"NEXT",UNLOCK:"UNLOCK",LOADING:"LOADING",CHAPTER:"CHAPTER"},ERROR:{DEVICE_OFFLINE:1,DEVICE_NAME_IS_NULL:2,CUSTOMER_NOT_FOUND:3,PIN_NOT_FOUND:4,DEVICE_CREATION_ERROR:5,DEVICE_NOT_FOUND:6,DEVICE_DELETION_ERROR:7,DEVICE_MUST_BE_LOCKED:8,DEVICE_LOCKED_BY_OTHER_USER:9}}}(ClickView),function(n){"use strict";var t=n.PushToDevice.Utils,i=t.Constants.COMMAND_TYPE;t.BuildDeviceCommand=function(n,t,r){if(r=r||{},n&&t||console.log("Error: DeviceCommand requires a command and deviceId"),!i.hasOwnProperty(n)){console.log("Error: Command does not exist");return}return{deviceId:t,command:n,data:r.data||"",params:r.params||""}};t.GetErrorMessage=function(n,i){if(i=i||{},n){var u=t.Constants.ERROR,r=null;switch(n){case u.DEVICE_OFFLINE:r="Sorry, the device you're trying to connect to is currently offline.";break;case u.DEVICE_NAME_IS_NULL:r="Please ensure you provide a name for your device.";break;case u.CUSTOMER_NOT_FOUND:r="Sorry, the customer id you provided is not valid.";break;case u.PIN_NOT_FOUND:r="Sorry, the provided pin is not valid. Please try again.";break;case u.DEVICE_CREATION_ERROR:r="Sorry, device activation could not be completed. Please try again.";break;case u.DEVICE_NOT_FOUND:r="Sorry, the device you're trying to access could not be found.";break;case u.DEVICE_DELETION_ERROR:r="Sorry, the device could not be removed. Please try again.";break;case u.DEVICE_MUST_BE_LOCKED:r="Sorry, the device must be locked before senging a new commands.";break;case u.DEVICE_LOCKED_BY_OTHER_USER:r="Sorry, the device is currently in use. Please try again later.";break;default:r="Sorry, an unknown error has occurred."}return{errorCode:n,errorMessage:r}}}}(ClickView,EasyMoney),function(n,t){"use strict";var r=n.PushToDevice,f=n.Services,e=n.Shared,u=r.Utils.Constants,i=u.EVENTS;r.Utils.SignalRConnection=t.Service.extend({name:"DeviceConnService",defaults:{tryReconnect:!0,reconnectAttempts:100,reconnectWait:5e3,logging:!1},initialize:function(){if(!this.options.connection||!this.options.connection.hub||!this.options.connection.endPoint){console.log("Error: Hub name and endpoint required as options");return}var n=this.options.connection;this._user=this.options.user||{};this._connection=$.hubConnection(n.endPoint+"/signalr",{useDefaultPath:!1});this._hub=this._connection.createHubProxy(n.hub);this.options.logging&&this._connection.error(function(n){console.log("SignalR error: "+n)});this._reconnectTries=0;this._started=!1;this._appEventBus=f.DeviceService.getEventChannel(u.CHANNELS.APP);this.registerServerListeners();this.registerAppListeners()},registerServerListeners:function(){this.listenTo(this._hub,i.SERVER.DEVICELIST,_.bind(this._handleDeviceList,this));this.listenTo(this._hub,i.SERVER.UPDATE_DEVICE,_.bind(this._handleDeviceUpdate,this));this.listenTo(this._hub,i.SERVER.ADD_DEVICE,_.bind(this._handleAddDevice,this));this.listenTo(this._hub,i.SERVER.REMOVE_DEVICE,_.bind(this._handleRemoveDevice,this));this.listenTo(this._hub,i.SERVER.DEVICE_PLAYBACK_STATUS,_.bind(this._handlePlaybackStatus,this));this.listenTo(this._hub,i.SERVER.SERVER_ERROR,_.bind(this._handleServerError,this));this.listenTo(this._hub,i.SERVER.LOCK_EXPIRED,_.bind(this._handleLockExpired,this));this.listenTo(this._hub,i.SERVER.TIME_SYNC,_.bind(this._handleTimeSync,this));this.listenTo(this._hub,i.SERVER.CURRENT_STATUS,_.bind(this._handleCurrentDeviceStatus,this))},registerAppListeners:function(){this.listenTo(this._appEventBus,i.APP.ACTIVATE,this._activateDevice);this.listenTo(this._appEventBus,i.APP.REMOVE,this._removeDevice);this.listenTo(this._appEventBus,i.APP.SEND_COMMAND,this._sendCommand);this.listenTo(this._appEventBus,i.APP.LOCK_DEVICE,this._lock);this.listenTo(this._appEventBus,i.APP.DISCONNECT,this.stop)},log:function(n,t){(this.options.logging||t)&&console.log(this.name+": "+n)},start:function(n){if(n=n||{},!this._started){if(this._started=!0,n.isAdm){this._startAsAdm();return}this._startAsUser()}},overridePlayback:function(n){if(!n.deviceId||!n.command){this.log("DeviceId and command required to override playback.");return}this._sendCommand(n)},_startAsAdm:function(){this._connection.start({withCredentials:!1}).done(_.bind(this._onConnectedAdm,this,this._user.crmId)).fail(_.bind(this._tryReconnect,this));this._connection.disconnected(_.bind(this._handleReconnect,this))},_startAsUser:function(){var t=_.bind(function(n){if(!n||!n.token){this._started=!1;this.log("Failed to get token",!0);this._tryReconnect();return}this._connection.start({withCredentials:!1}).done(_.bind(this._onConnected,this,n.token)).fail(_.bind(this._tryReconnect,this));this._connection.disconnected(_.bind(this._handleReconnect,this))},this);n.Shared.Utils.AjaxHelper.post("/api/devices/start",null,{forceHttps:!1}).always(t)},stop:function(n){n=_.extend({async:!1,notifyServer:!0},n);this._started=!1;this._connection.stop(n.async,n.notifyServer)},_onConnected:function(n){this._hub.invoke(i.SERVER.SUBSCRIBE,n).done(_.bind(function(){this._appEventBus.trigger(i.APP.CONNECTION_UPDATE,{connected:!0});this.log("Connected!",!0)},this)).fail(_.bind(this.log,this))},_onConnectedAdm:function(n){this._hub.invoke(i.SERVER.SUBSCRIBE_ADM,n).done(_.bind(this.log,this,"Connected!",!0)).fail(_.bind(this.log,this))},_tryReconnect:function(n){if(this.options.tryReconnect){if(this.options.logging&&n&&this.log("Trying to reconnect after error: ",n),this.options.reconnectAttempts>1&&this._reconnectTries>=this.options.reconnectAttempts){this.log("Aborting reconnect");return}this._appEventBus.trigger(i.APP.CONNECTION_UPDATE,{connected:!1});setTimeout(_.bind(function(){this.log("Reconnecting...",!0);this._reconnectTries++;this.start()},this),this.options.reconnectWait)}},_handleReconnect:function(){if(!this._started){this.stopListening(this._appEventBus);return}this._started=!1;this._tryReconnect()},_handleDeviceList:function(n){this.log("Received Devicelist");this.log(JSON.stringify(n));this._appEventBus.trigger(i.APP.DEVICELIST,{deviceList:n})},_handleDeviceUpdate:function(n){this.log("Received Device Update"+JSON.stringify(n));this._appEventBus.trigger(i.APP.UPDATE_DEVICE,{deviceModel:n})},_handleAddDevice:function(n){this.log("Add Device: "+JSON.stringify(n));this._appEventBus.trigger(i.APP.ADD_DEVICE,{deviceModel:n})},_handleRemoveDevice:function(n){this.log("Remove Device: "+JSON.stringify(n));this._appEventBus.trigger(i.APP.REMOVE_DEVICE,{deviceId:n})},_handlePlaybackStatus:function(n,t){this.log("Received device status from "+n+": "+JSON.stringify(t));this._appEventBus.trigger(i.APP.DEVICE_PLAYBACK_STATUS,{deviceId:n,playState:t})},_handleServerError:function(n,t){var u=r.Utils.GetErrorMessage(t);e.Utils.AnalyticsService.logDeviceError(t,n);this.log("Received Error: "+JSON.stringify(u));this._appEventBus.trigger(i.APP.SERVER_ERROR,u)},_handleLockExpired:function(n){this.log("Lock Expired: "+n);this._appEventBus.trigger(i.APP.DEVICE_UNLOCK,n)},_handleTimeSync:function(n,t){this.log("Received Time Sync from "+n+": "+t);this._appEventBus.trigger(i.APP.TIME_SYNC,{deviceId:n,time:t})},_handleCurrentDeviceStatus:function(n){this.log("Device Status: "+JSON.stringify(n))},_activateDevice:function(n){n&&n.crmId&&n.pin&&n.deviceName||this.log("Error: New device object not formatted correctly");this._hub.invoke(i.SERVER.PAIR,n).fail(_.bind(this.log,this))},_removeDevice:function(n){this._hub.invoke(i.SERVER.UNPAIR,n).fail(_.bind(this.log,this))},_sendCommand:function(n){if(!n.deviceId||!n.command){this.log("Command not correctly formatted.");return}var t={DeviceId:n.deviceId,CommandType:n.command,Data:n.data||"",Params:n.params||""};this._hub.invoke(i.SERVER.COMMAND,t).done(_.bind(this.log,this,"Command sent: "+JSON.stringify(t))).fail(_.bind(this.log,this))},_lock:function(n,t,r){this._hub.invoke(i.SERVER.LOCK,n,t,r).fail(_.bind(this.log,this))}})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.PushToDevice;i.Services.ConnectionManagerService=t.Service.extend({name:"ConnectionManagerService",connection:null,createConnection:function(n){return this.connection=n,this},getConnection:function(){if(!this.connection){console.log("Error: No connections exist");return}return this.connection},start:function(n){if(n=n||{},!this.connection){console.log("Error: Cannot be started, connection does not exist");return}return this.connection.start(n),this},stop:function(){if(!this.connection){console.log("Error: Cannot be stopped, connection does not exist");return}return this.connection.stop(),delete this.connection,this}})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.PushToDevice,f=n.Shared,r=i.Utils.Constants,u=r.EVENTS;i.Services.DeviceService=t.Service.extend({name:"DeviceService",initialize:function(){var f,n;if(!this.options.connection||!this.options.connection.hub||!this.options.connection.endPoint)return"Error: Required SignalR connection details have not been provided.";if(!this.options.renderHook)return"Error: renderHook element not provided.";this.connection=this.options.connection;this.user=this.options.user;this.renderHook=this.options.renderHook;f=["WEBPLAYER"];this.eventManager=new i.Services.EventManagerService({channels:_.omit(r.CHANNELS,f)});this.deviceAppInstance=new i.Services.ConnectionManagerService;n=this.getEventChannel(r.CHANNELS.CONFIG);this.listenTo(n,u.CONFIG.START,this.playerBootstrap);this.listenTo(n,u.CONFIG.ACTIVATE,this.activateBootstrap);this.listenTo(n,u.CONFIG.STOP,this.teardown);this.listenTo(t.Events,"navigate",this.stopAndTeardown)},playerBootstrap:function(n,t){var f,u;this.deviceAppStarted||(f=this.getWebplayerEventChannel(),f&&this.eventManager.registerExistingChannel(r.CHANNELS.WEBPLAYER,f),this.startup(),u=new i.Models.VideoDevice,u.video.set(n.toJSON()),u.user.set(this.user),this._webPlayerModel=t,this._webPlayerModel&&this._webPlayerModel.set("sideBarMask",!0),this.appView=new i.Views.PlayerAppView({model:u}),$(this.renderHook).append(this.appView.render().el))},activateBootstrap:function(){this.startup({isAdm:!0})},getWebplayerEventChannel:function(){var n=$("iframe").get(0);return n.contentWindow?new CVEventsApi(n.contentWindow):null},startup:function(n){this.deviceAppStarted=!0;this.hasOwnProperty("deviceAppInstance")||(this.deviceAppInstance=new i.Services.ConnectionManagerService);var t=new i.Utils.SignalRConnection({connection:this.connection,user:this.user});this.deviceAppInstance.createConnection(t).start(n)},stopAndTeardown:function(){var n=this.getCurrentConnection();n&&n.stop({async:!0,notifyServer:!0});this.teardown()},teardown:function(){this.deviceAppStarted&&(this.deviceAppInstance.stop(),delete this.deviceAppInstance,this.deviceAppStarted=!1,this._webPlayerModel&&this._webPlayerModel.set("sideBarMask",!1),this.eventManager.hasChannel(r.CHANNELS.WEBPLAYER)&&this.eventManager.removeChannel(r.CHANNELS.WEBPLAYER),this.appView&&(this.appView.unBindUnload(),this.appView.close(),$(this.appView.$el).remove()))},getEventChannel:function(n){return this.eventManager.getChannel(n)},getCurrentConnection:function(){if(this.deviceAppStarted)return this.deviceAppInstance.getConnection()}})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.PushToDevice,r=t.Events;i.Services.EventManagerService=t.Service.extend({name:"EventManagerService",initialize:function(){this._channelCache={};this.options.channels&&this.registerNewChannels(this.options.channels)},hasChannel:function(n){return this._channelCache.hasOwnProperty(n)},getChannel:function(n){return this._channelCache.hasOwnProperty(n)?this._channelCache[n]:null},createChannel:function(n){if(this._channelCache.hasOwnProperty(n))return this._channelCache[n];var t=_.extend({},r);return this._channelCache[n]=t,t},removeChannel:function(n){this._channelCache.hasOwnProperty(n)&&delete this._channelCache[n]},getActiveChannels:function(){return this._channelCache},registerExistingChannel:function(n,t){if(this._channelCache.hasOwnProperty(n))return this._channelCache[n];this._channelCache[n]=t},registerNewChannels:function(n){if(typeof n=="object")for(var t in n)n.hasOwnProperty(t)&&this.createChannel(n[t])}})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.PushToDevice;i.Models.ActivateDevice=t.Model.extend({validation:{name:[{required:!0,msg:"A device must have a name"},{maxLength:75}],pin:[{required:!0,msg:"A pin is required"},{pattern:"number",msg:"Your pin must be a 4 digit number"},{length:4,msg:"Your pin must have 4 digits"}]}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.PushToDevice,u=n.Services,r=i.Utils.Constants,f=r.EVENTS;i.Models.Chapter=t.Model.extend({defaults:{current:!1,duration:0,number:1,title:""},initialize:function(){this._appEventBus=u.DeviceService.getEventChannel(r.CHANNELS.APP);this.listenTo(this._appEventBus,f.APP.CHANGE_CHAPTER,this.changeChapter)},changeChapter:function(n){this.set("current",this.get("number")===n)}})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.PushToDevice;i.Models.Device=t.Model.extend({idAttribute:"deviceId",defaults:{crmId:0,dateCreated:"",dateDeleted:"",dateModified:"",deleted:!1,deviceId:"",lastAccessed:"",haveLock:!1,lockedBy:"",lockedByUserId:"",name:"",status:0},parse:function(n,t){return t=t||{},n.haveLock=!1,n.status&&t.userId&&n.lockedByUserId===t.userId&&(n.haveLock=!0),n},parseAndSet:function(n,t){return t=t||{},this.set(this.parse(n,t),t)}})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.PushToDevice;i.Models.Playback=t.Model.extend({defaults:{isPlaying:!1,status:"",time:"",chapter:""}})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.PushToDevice;i.Models.User=t.Model.extend({})}(ClickView,EasyMoney);!function(n,t){"use strict";var i=n.PushToDevice,r=n.Shared;i.Models.VideoDevice=t.NestedModel.extend({defaults:{devices:[],video:null,user:null,chapters:[],playback:null,activeDeviceId:null},associations:{devices:function(n,t){return new i.Collections.DevicesCollection(n,t)},video:function(n,t){return new r.Models.Video(n,t)},user:function(n,t){return new i.Models.User(n,t)},chapters:function(n,t){return new i.Collections.ChapterCollection(n,t)},playback:function(n,t){return new i.Models.Playback(n,t)}},getVideo:function(){return this.video},getActiveDevice:function(){return this.get("activeDeviceId")?this.devices.get(this.get("activeDeviceId")):null},releaseActiveDevice:function(){var n=this.devices.get(this.get("activeDeviceId"));n.set("haveLock",!1);this.set("activeDeviceId",!1)},currentDuration:function(){return this.hasChapters()?this.chapters.current().get("duration"):this.video.get("duration")/1e3},hasChapters:function(){return this.chapters.length>1}})}(ClickView,EasyMoney),function(n){"use strict";if(n.Data.Config.urls){var t=n.PushToDevice,i={connection:{hub:"DeviceUserHub",endPoint:n.Data.Config.urls.devices,reconnectTrys:100},renderHook:".video-container",user:n.Data.User};_.extend(n.Services,{DeviceService:new t.Services.DeviceService(i)})}}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.PushToDevice;i.Collections.ChapterCollection=t.Collection.extend({model:i.Models.Chapter,current:function(){var n=function(n){return n.get("current")};return this.find(n)},previous:function(){var n=this.current();if(n)return this.indexOf(n)>0?this.at(this.indexOf(n)-1):void 0},next:function(){var n=this.current();if(n)return this.indexOf(n)<this.length?this.at(this.indexOf(n)+1):void 0}})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.PushToDevice,r=i.Utils.Constants;i.Collections.DevicesCollection=t.Collection.extend({model:i.Models.Device,modelId:"deviceId",comparator:function(n){var t=n.get("status");return t===r.DEVICE_STATUS.OFFLINE&&(t=r.DEVICE_STATUS.SUSPENDED),[t,n.get("name").toLowerCase()]},initialize:function(){this.activeDeviceId=null},haveLock:function(n){var t=function(t){return t.get("deviceId")===n&&t.get("haveLock")};return this.find(t)},setActiveDevice:function(n){this.activeDeviceId=n},getActiveDevice:function(){return this.activeDeviceId?this.get(this.activeDeviceId):null},isNameUnique:function(n){var t=function(t){return t.get("name")!==n};return this.all(t)}})}(ClickView,EasyMoney);this.ClickView=this.ClickView||{};this.ClickView.PushToDevice=this.ClickView.PushToDevice||{};this.ClickView.PushToDevice.Templates=this.ClickView.PushToDevice.Templates||{};this.ClickView.PushToDevice.Templates.ActivateApp=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="row add-device-container">\r\n    <div class="col-xs-12">\r\n        <div class="show-me-viewpart"><\/div>\r\n        <div class="pair-device-form-viewpart"><\/div>\r\n    <\/div>\r\n<\/div>\r\n<div class="row hr-container">\r\n    <div class="col-xs-12"><div class="hr"><\/div><\/div>\r\n<\/div>\r\n<div class="row device-list-container-viewpart"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.PushToDevice=this.ClickView.PushToDevice||{};this.ClickView.PushToDevice.Templates=this.ClickView.PushToDevice.Templates||{};this.ClickView.PushToDevice.Templates.ActivateDevice=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<form class="row" id="activate-device-form">\r\n    <div class="form-group col-xs-5 col-sm-5">\r\n        <label for="device-name">Name your device<\/label><span class="info-icon" data-placement="right" title="Name a device based on its location to help staff identify it quickly.">i<\/span>\r\n        <div class="input-group">\r\n            <input  type="text" id="device-name" name="name" class="device-name-input" placeholder="e.g. English E12" />\r\n            <span class="help-block hidden"><\/span>\r\n        <\/div>\r\n    <\/div>\r\n    <div class="form-group col-xs-5 col-sm-5">\r\n        <label for="device-pin">Enter your 4 digit pin<\/label><span class="info-icon" data-placement="right" title="Open the ClickView tvOS app or Vivi to get your pin.">i<\/span>\r\n        <div class="input-group">\r\n            <input type="text" id="device-pin" name="pin" class="device-pin-input" placeholder="e.g. 1234"/>\r\n            <span class="help-block hidden"><\/span>\r\n        <\/div>\r\n    <\/div>\r\n    <div class="form-group col-xs-2 col-sm-2">\r\n        <div class="activate-button-viewpart"><\/div>\r\n    <\/div>\r\n<\/form>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.PushToDevice=this.ClickView.PushToDevice||{};this.ClickView.PushToDevice.Templates=this.ClickView.PushToDevice.Templates||{};this.ClickView.PushToDevice.Templates.DeviceContainer=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="device-exit"><span class="close-icon">&times;<\/span>Close<\/div>\r\n<div class="device-error-viewpart"><\/div>\r\n<div class="device-content-container">\r\n    <div class="device-header row">\r\n        <div class="col-xs-6">\r\n            <h1 class="device-header-title">Select a device<\/h1>\r\n        <\/div>\r\n        <div class="col-xs-6">\r\n            <img class="device-header-img" src="/Assets/images/pushtodevice/tv@2x.png" />\r\n        <\/div>\r\n    <\/div>\r\n    <div class="device-list-viewpart row"><\/div>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.PushToDevice=this.ClickView.PushToDevice||{};this.ClickView.PushToDevice.Templates=this.ClickView.PushToDevice.Templates||{};this.ClickView.PushToDevice.Templates.DeviceControls=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="device-progress-viewpart"><\/div>\r\n<div class="device-control-group">\r\n    <div class="device-playtoggle-viewpart"><\/div>\r\n    <div class="device-chapter-viewpart"><\/div>\r\n    <div class="device-playback-viewpart"><\/div>\r\n    <div class="device-spinner-viewpart"><\/div>\r\n<\/div>\r\n'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.PushToDevice=this.ClickView.PushToDevice||{};this.ClickView.PushToDevice.Templates=this.ClickView.PushToDevice.Templates||{};this.ClickView.PushToDevice.Templates.DeviceCurrentlyPlaying=Handlebars.template({"1":function(n,t,i,r,u){var f;return'                <div class="chapter">Chapter: '+n.escapeExpression((f=(f=i.chapterName||(t!=null?t.chapterName:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"chapterName",hash:{},data:u}):f))+"<\/div>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var c,f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<div class="device-exit"> <span class="close-icon">&times;<\/span>'+h((f=(f=i.exitText||(t!=null?t.exitText:t))!=null?f:o,typeof f===s?f.call(e,{name:"exitText",hash:{},data:u}):f))+'<\/div>\r\n<div class="device-error-viewpart"><\/div>\r\n<div class="device-playback row">\r\n    <div class="col-xs-12">\r\n        <div class="device-state-viewpart">\r\n            <div class="device-currently-playing">\r\n                <div class="playback-device">Currently playing on: '+h((f=(f=i.deviceName||(t!=null?t.deviceName:t))!=null?f:o,typeof f===s?f.call(e,{name:"deviceName",hash:{},data:u}):f))+'<\/div>\r\n                <div class="title">'+h((f=(f=i.title||(t!=null?t.title:t))!=null?f:o,typeof f===s?f.call(e,{name:"title",hash:{},data:u}):f))+"<\/div>\r\n"+((c=i["if"].call(e,t!=null?t.chapterName:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?c:"")+'            <\/div>\r\n            <a class="stop-playback">Stop playback<\/a>\r\n            <div class="device-loading-viewpart"><\/div>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.PushToDevice=this.ClickView.PushToDevice||{};this.ClickView.PushToDevice.Templates=this.ClickView.PushToDevice.Templates||{};this.ClickView.PushToDevice.Templates.DeviceItem=Handlebars.template({"1":function(){return'                <div class="padlock"><\/div>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var h,f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s=n.escapeExpression;return'<div class="row">\r\n    <div class="col-xs-6">\r\n        <div class="device-name">'+s((f=(f=i.name||(t!=null?t.name:t))!=null?f:o,typeof f=="function"?f.call(e,{name:"name",hash:{},data:u}):f))+'<\/div>\r\n    <\/div>\r\n    <div class="col-xs-6">\r\n        <div class="device-state-viewpart">\r\n            <div class="device-status-group">\r\n'+((h=(i.ifIs||t&&t.ifIs||o).call(e,t!=null?t.status:t,"==",2,{name:"ifIs",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?h:"")+'                <div class="device-activity '+s((i.getDeviceStatusClass||t&&t.getDeviceStatusClass||o).call(e,t!=null?t.status:t,{name:"getDeviceStatusClass",hash:{},data:u}))+'">'+s((i.getDeviceStatus||t&&t.getDeviceStatus||o).call(e,t!=null?t.status:t,{name:"getDeviceStatus",hash:{},data:u}))+'<\/div>\r\n                <div class="indicator-'+s((i.getDeviceStatusClass||t&&t.getDeviceStatusClass||o).call(e,t!=null?t.status:t,{name:"getDeviceStatusClass",hash:{},data:u}))+'"><\/div>\r\n            <\/div>\r\n            <div class="device-actions">\r\n                <div class="remove-button-viewpart"><\/div>\r\n            <\/div>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.PushToDevice=this.ClickView.PushToDevice||{};this.ClickView.PushToDevice.Templates=this.ClickView.PushToDevice.Templates||{};this.ClickView.PushToDevice.Templates.PlaybackButton=Handlebars.template({"1":function(){return'<a class="device-offline">Device offline<\/a>\r\n'},"3":function(){return'<a class="device-start">Play on device<\/a>\r\n'},"5":function(){return'<a class="device-locked">Device in use<\/a>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing;return((f=(i.ifIs||t&&t.ifIs||o).call(e,t!=null?t.status:t,"==",0,{name:"ifIs",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=(i.ifIs||t&&t.ifIs||o).call(e,t!=null?t.status:t,"==",1,{name:"ifIs",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=(i.ifIs||t&&t.ifIs||o).call(e,t!=null?t.status:t,"==",2,{name:"ifIs",hash:{},fn:n.program(5,u,0),inverse:n.noop,data:u}))!=null?f:"")+((f=(i.ifIs||t&&t.ifIs||o).call(e,t!=null?t.status:t,"==",3,{name:"ifIs",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.PushToDevice=this.ClickView.PushToDevice||{};this.ClickView.PushToDevice.Templates=this.ClickView.PushToDevice.Templates||{};this.ClickView.PushToDevice.Templates.PlaybackTime=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f=t!=null?t:n.nullContext||{},e=i.helperMissing,o=n.escapeExpression;return'<div class="time-progress">'+o((i.duration||t&&t.duration||e).call(f,t!=null?t.currentTime:t,"s",{name:"duration",hash:{},data:u}))+'<\/div>\r\n<div class="time-divider">&nbsp;/&nbsp;<\/div>\r\n<div class="total-duration">'+o((i.duration||t&&t.duration||e).call(f,t!=null?t.totalDuration:t,"s",{name:"duration",hash:{},data:u}))+"<\/div>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.PushToDevice=this.ClickView.PushToDevice||{};this.ClickView.PushToDevice.Templates=this.ClickView.PushToDevice.Templates||{};this.ClickView.PushToDevice.Templates.PlayerDeviceItem=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{},o=i.helperMissing,s=n.escapeExpression;return'<div class="row">\r\n    <div class="col-xs-6">\r\n        <div class="device-icon"><\/div>\r\n        <div class="device-name">'+s((f=(f=i.name||(t!=null?t.name:t))!=null?f:o,typeof f=="function"?f.call(e,{name:"name",hash:{},data:u}):f))+'<\/div>\r\n        <div class="indicator-'+s((i.getDeviceStatusClass||t&&t.getDeviceStatusClass||o).call(e,t!=null?t.status:t,{name:"getDeviceStatusClass",hash:{},data:u}))+'"><\/div>\r\n    <\/div>\r\n    <div class="col-xs-6">\r\n        <div class="device-actions">\r\n            <div class="device-playback-viewpart"><\/div>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>\r\n'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.PushToDevice=this.ClickView.PushToDevice||{};this.ClickView.PushToDevice.Templates=this.ClickView.PushToDevice.Templates||{};this.ClickView.PushToDevice.Templates.ShowDevices=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return"<h2>"+n.escapeExpression((f=(f=i.title||(t!=null?t.title:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"title",hash:{},data:u}):f))+'<\/h2>\r\n<div class="available-devices-viewpart"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.PushToDevice=this.ClickView.PushToDevice||{};this.ClickView.PushToDevice.Templates=this.ClickView.PushToDevice.Templates||{};this.ClickView.PushToDevice.Templates.ShowMe=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<p>\r\n    It\'s now possible to display video content from the ClickView platform on any Apple TV (4th gen) or Vivi located within your network. To get started, your device must first be activated. The steps below will help guide you through the activation process. \r\n<\/p>\r\n<div class="steps">\r\n    <div class="step">\r\n        <span class="step-number">1<\/span> Open the ClickView tvOS app on your Apple TV (4th gen) or select ClickView under your Vivi\'s video direct menu.\r\n    <\/div>\r\n    <div class="step">\r\n        <span class="step-number">2<\/span> A four digit pincode will be displayed on the screen. Enter this pincode, along with a device name in the form below.\r\n    <\/div>\r\n    <div class="step">\r\n        <span class="step-number">3<\/span> Once your device has been activated, click <span class="ptd-icon"><\/span> on any video on the platform to play the content through your device.\r\n    <\/div>\r\n<\/div>\r\n<p class="more-information">\r\n    For additional information on how to activate your device, please refer to the <a href="'+n.escapeExpression((f=(f=i.supportWebsite||(t!=null?t.supportWebsite:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"supportWebsite",hash:{},data:u}):f))+'/articles/224755887" target="_blank">Apple TV (4th gen) activation tutorial<\/a>.\r\n<\/p>'},useData:!0}),function(n,t){"use strict";var i=n.PushToDevice;i.Views.DeviceListView=t.ListView.extend({name:"DeviceListView",className:"device-list",initialize:function(){this.listenTo(this.collection,"add",this.onAdd);this.listenTo(this.collection,"remove",this.onRemove);this.listenTo(this.collection,"change",this.onChange)},onChange:function(){this.collection.sort();this.render()},onAdd:function(){if(this.collection.length===1){this.render();return}this.addOne.apply(this,arguments);this.collection.sort();this.render()},onRemove:function(){if(this.collection.isEmpty()){this.renderEmptyState();return}this.render()},renderEmptyState:function(){this.$el.html("Device list is currently empty.")},onBeforeRender:function(){return this.collection.isEmpty()?(this.renderEmptyState(),!1):!0}})}(ClickView,EasyMoney),function(n,t){"use strict";var u=n.PushToDevice,e=n.Services,i=u.Utils.Constants,r=i.EVENTS,f=i.COMMAND_TYPE;u.Views.ChapterControlsView=t.View.extend({name:"ChapterControlsView",className:"device-controls-chapters",template:'<div class="device-control-previous {{#unless canDoPrevious}}disabled{{/unless}}"><\/div><div class="device-control-next {{#unless canDoNext}}disabled{{/unless}}"><\/div>',events:{"click .device-control-previous":"invokePrevious","click .device-control-next":"invokeNext"},initialize:function(){this._appEventBus=e.DeviceService.getEventChannel(i.CHANNELS.APP);this.listenTo(this._appEventBus,r.APP.CHANGE_CHAPTER,this.render)},viewOptions:function(){return{canDoNext:this.canDoNext(),canDoPrevious:this.canDoPrevious()}},canDoNext:function(){return this.model.chapters.current()!==this.model.chapters.last()},canDoPrevious:function(){return this.model.chapters.current()!==this.model.chapters.first()},invokePrevious:function(){var n,t,i;this.model.playback.get("commandSent")||this.model.playback.get("isPlaying")&&this.canDoPrevious()&&(n=this.model.chapters.previous(),n)&&(t=n.get("number"),i=0,this.model.playback.set("commandSent",!0),this._appEventBus.trigger(r.APP.INVOKE,f.PLAY,{params:t+", "+i}))},invokeNext:function(){var n,t,i;this.model.playback.get("commandSent")||this.model.playback.get("isPlaying")&&this.canDoNext()&&(n=this.model.chapters.next(),n)&&(t=n.get("number"),i=0,this.model.playback.set("commandSent",!0),this._appEventBus.trigger(r.APP.INVOKE,f.PLAY,{params:t+", "+i}))},onClose:function(){this.stopListening(this._appEventBus)},onBeforeRender:function(){return this.model.hasChapters()?!0:!1}})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.PushToDevice;i.Views.ControlSpinner=t.View.extend({name:"ControlSpinner",className:"device-spinner",template:!1,initialize:function(){this.listenTo(this.model.playback,"change:isLoading",this.render)},renderSpinner:function(){var t=new n.Shared.Views.SpinJsView({spinOptions:{length:2,width:2,radius:4}});this.renderView(this.$el,t);t.trigger("rendered")},onRender:function(){if(this.model.playback.get("isLoading")){this.renderSpinner();return}}})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.PushToDevice;i.Views.PlaybackTimeView=t.View.extend({name:"PlaybackView",className:"device-controls-timepart",template:i.Templates.PlaybackTime,initialize:function(){this.listenTo(this.model.playback,"change:time",this.render)},viewOptions:function(){return{currentTime:this.model.playback.get("time")||0,totalDuration:this.model.currentDuration()}}})}(ClickView,EasyMoney),function(n,t){"use strict";var u=n.PushToDevice,e=n.Services,i=u.Utils.Constants,f=i.EVENTS,r=i.COMMAND_TYPE;u.Views.PlayToggleView=t.View.extend({name:"PlayToggleView",className:"device-controls-playtoggle",template:'<div class="device-control-play {{#if isPlaying}}hidden{{/if}}"><\/div><div class="device-control-pause {{#unless isPlaying}}hidden{{/unless}}"><\/div>',events:{"click .device-control-play":"invokePlay","click .device-control-pause":"invokePause"},viewOptions:function(){return{isPlaying:function(){var n=this.model.playback.get("status");return n===r.PLAY}}},initialize:function(){this._appEventBus=e.DeviceService.getEventChannel(i.CHANNELS.APP);this.listenTo(this.model.playback,"change:status",this.render)},invokePlay:function(){this.model.playback.get("isPlaying")&&this._appEventBus.trigger(f.APP.INVOKE,r.PLAY)},invokePause:function(){this.model.playback.get("isPlaying")&&this._appEventBus.trigger(f.APP.INVOKE,r.PAUSE)},onClose:function(){this.stopListening(this._appEventBus)}})}(ClickView,EasyMoney),function(n,t){"use strict";var r=n.PushToDevice,u=n.Services,i=r.Utils.Constants,f=i.EVENTS;r.Views.ProgressBarView=t.View.extend({name:"ProgressBarView",className:"playback-progress-container",template:'<div class="playback-progress"><\/div>',ui:{$playbackProgress:".playback-progress"},events:{click:"seek"},initialize:function(){this._appEventBus=u.DeviceService.getEventChannel(i.CHANNELS.APP);this.listenTo(this.model.playback,"change:time",this.updateProgress)},seek:function(n){if(this.model.playback.get("isPlaying")){var t=n.offsetX/this.$el.width(),r=this.model.currentDuration(),u=r*t,e=this.model.chapters.current().get("number")||0;this._appEventBus.trigger(f.APP.INVOKE,i.COMMAND_TYPE.PLAY,{params:e+","+Math.floor(u)})}},updateProgress:function(){if(this.model.playback.get("status")===i.COMMAND_TYPE.STOP){this.ui.$playbackProgress.width(0);return}var n=this.model.playback.get("time")/this.model.currentDuration()*100;this.ui.$playbackProgress.width(n+"%")}})}(ClickView,EasyMoney),function(n,t){"use strict";var u=n.PushToDevice,e=n.Services,o=n.Shared,f=u.Utils.Constants,i=f.EVENTS,r=f.COMMAND_TYPE,s=u.Utils.BuildDeviceCommand;u.Views.PlayerAppView=t.View.extend({name:"PlayerAppView",id:"push-to-device",template:'<div class="device-player-viewpart"><\/div><div class="device-controls-viewpart"><\/div>',ui:{$player:".device-player-viewpart",$controls:".device-controls-viewpart"},initialize:function(){this._appEventBus=e.DeviceService.getEventChannel(f.CHANNELS.APP);this._playerEventBus=e.DeviceService.getEventChannel(f.CHANNELS.WEBPLAYER);this.registerSignalRListeners();this.registerAppListeners();this.start()},registerSignalRListeners:function(){this.listenToOnce(this._appEventBus,i.APP.DEVICELIST,this.setDeviceList);this.listenTo(this._appEventBus,i.APP.UPDATE_DEVICE,this.updateDevice);this.listenTo(this._appEventBus,i.APP.ADD_DEVICE,this.addDevice);this.listenTo(this._appEventBus,i.APP.REMOVE_DEVICE,this.removeDevice);this.listenTo(this._appEventBus,i.APP.DEVICE_PLAYBACK_STATUS,this.updatePlaybackStatus);this.listenTo(this._appEventBus,i.APP.SERVER_ERROR,this.handleServerError);this.listenTo(this._appEventBus,i.APP.TIME_SYNC,this.updatePlaybackTime)},registerAppListeners:function(){this.listenTo(this._appEventBus,i.APP.GET_LOCK,this.getLock);this.listenTo(this._appEventBus,i.APP.UNLOCK,this.handleServerError);this.listenTo(this._appEventBus,i.APP.INVOKE,this.invokeControl);this.listenTo(this.model,i.CONFIG.STOP,this.stop);this.listenTo(this.model.devices,"change:haveLock",this.onLockUpdate)},start:function(){this._playerEventBus.trigger("cv-player-pause");this.getVideoChapters();o.Utils.AnalyticsService.logDeviceStart(this.model.video.get("trackingCode"),this.model.video.get("title"))},stop:function(){this.unBindUnload();var n=e.DeviceService.getEventChannel(f.CHANNELS.CONFIG);this.stopListening(this._appEventBus);n.trigger(i.CONFIG.STOP)},getVideoChapters:function(){var t=n.Shared.Helpers.Guid.newGuid(),i=_.bind(function(n,t){this.model.chapters.set(t)},this);this._playerEventBus.one("cv-player-querycallback-"+t,i);this._playerEventBus.trigger("cv-player-query","getChapters",t)},bindUnload:function(){if(!this._unloadIsBound){this._unloadIsBound=!0;$(window).unbind("beforeunload");$(window).on("beforeunload",function(){return"Are you sure you want to leave? Playback will be stopped."});var n=function(){e.DeviceService.getCurrentConnection().stop({async:!0,notifyServer:!0});o.Utils.AnalyticsService.logDeviceClose("hard")};$(window).on("unload",n)}},sendCommand:function(n,t,r){this._appEventBus.trigger(i.APP.SEND_COMMAND,s(n,t,r))},setDeviceList:function(n,t){(t=t||{},n.deviceList)&&(this.model.devices._hasFetched=!0,this.model.devices.reset(n.deviceList,{parse:!0,userId:this.model.get("user.id")}))},updateDevice:function(n,t){(t=t||{},n.deviceModel&&n.deviceModel.deviceId)&&this.model.devices.get(n.deviceModel.deviceId).parseAndSet(n.deviceModel,{userId:this.model.get("user.id")})},addDevice:function(n,t){(t=t||{},n.deviceModel)&&this.model.devices.add(n.deviceModel,{parse:!0})},removeDevice:function(n,t){(t=t||{},n.deviceId)&&this.model.devices.remove(n.deviceId,{parse:!0})},invokeControl:function(n,t){var i,u;(t=t||{},i=this.model.devices.getActiveDevice(),i)&&(u=i.get("deviceId"),u&&n)&&i.get("status")!==f.DEVICE_STATUS.SUSPENDED&&this.model.devices.haveLock(u)&&(n!==r.PAUSE&&this.model.playback.set("isLoading",!0),_.debounce(this.sendCommand(n,u,t),1e3,!0))},updatePlaybackStatus:function(n,t){var u,f;(t=t||{},n.playState)&&(u=n.playState.commandType,u&&(this.model.playback.set("status",u),this.render()),(u===r.PLAY||u===r.STOP)&&(this.model.playback.set("commandSent",!1),this.model.playback.set("isLoading",this.shouldShowLoader(u))),u===r.CHAPTER&&(f=parseInt(n.playState.params)||1,this._appEventBus.trigger(i.APP.CHANGE_CHAPTER,f)))},updatePlaybackTime:function(n,t){if(t=t||{},n.time&&this.model.playback.get("isPlaying")){this.model.playback.set("time",n.time);return}},onLockUpdate:function(n,t){var e=this.model.playback.get("status")===r.PLAY,s=this.model.playback.get("isPlaying");if(t&&!s&&e){this.model.devices.setActiveDevice(n.cid);var i=n.get("deviceId"),u=this.model.video.get("trackingCode"),f=this.model.chapters.current().get("number"),h={data:u,params:f};this.sendCommand(r.PLAY,i,h);o.Utils.AnalyticsService.logDevicePlay(i,u,this.model.video.get("title"),f)}},getLock:function(n){this._appEventBus.trigger(i.APP.LOCK_DEVICE,n.get("deviceId"),this.model.get("user.id"),this.model.get("user.displayName"))},resetPlayState:function(){this.model.playback.set("status",null,{silent:!0});this.model.devices.getActiveDevice().set("haveLock",!1,{silent:!0});this.model.devices.getActiveDevice().set("startPlayback",!1);this.model.devices.setActiveDevice(null)},shouldShowLoader:function(n){var t=!1;switch(n){case r.CHAPTER:case r.SEEKING:case r.LOADING:t=!0}return t},renderControls:function(){var n=new u.Views.DeviceControlsView({model:this.model});this.renderView(this.ui.$controls,n)},renderDeviceList:function(){this.unBindUnload();var n=new u.Views.DeviceContainerView({model:this.model});this.renderView(this.ui.$player,n)},renderPlayerView:function(){this.bindUnload();var n=new u.Views.PlayerPlaybackView({model:this.model});this.renderView(this.ui.$player,n)},playbackRendering:function(){var n=this.model.playback.get("status");if(n===r.PLAY){this.model.playback.set("isPlaying",!0);this.renderPlayerView();this.renderControls();return}if(n===r.STOP||n===r.UNLOCK){this.model.playback.set("isPlaying",!1);this.resetPlayState();this.renderDeviceList();this.renderControls();return}},onBeforeRender:function(){var n=this.model.playback.get("status"),t=this.model.playback.get("isPlaying");return n?!t&&n===r.PLAY?!0:n===r.STOP||n===r.UNLOCK?!0:!1:!0},onRender:function(){if(this.model.playback.get("status")){this.playbackRendering();return}this.renderDeviceList();this.renderControls()},unBindUnload:function(){this._unloadIsBound&&(this._unloadIsBound=!1,$(window).off("beforeunload"),$(window).off("unload"))}})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.PushToDevice;i.Views.PlayerBannerView=t.View.extend({name:"PlayerBannerView",className:"device-banner-group",template:'<div class="device-banner-message">{{text}}<\/div>',initialize:function(){this.listenTo(this.model.playback,"closeBanner",this.close)},viewOptions:function(){return _.extend({text:"An Error has occured."},this.options)}})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.PushToDevice,u=n.Services,r=i.Utils.Constants,f=r.EVENTS;i.Views.DeviceControlsView=t.View.extend({name:"DeviceControlsView",className:"device-controls-container",template:i.Templates.DeviceControls,ui:{$progress:".device-progress-viewpart",$playToggle:".device-playtoggle-viewpart",$chapterControls:".device-chapter-viewpart",$playbackTime:".device-playback-viewpart",$controlSpinner:".device-spinner-viewpart"},initialize:function(){this._appEventBus=u.DeviceService.getEventChannel(r.CHANNELS.APP)},renderPlayToggle:function(){var n=new i.Views.PlayToggleView({model:this.model});this.renderView(this.ui.$playToggle,n)},renderChapterControls:function(){var n=new i.Views.ChapterControlsView({model:this.model});this.renderView(this.ui.$chapterControls,n)},renderPlaybackTime:function(){var n=new i.Views.PlaybackTimeView({model:this.model});this.renderView(this.ui.$playbackTime,n)},renderProgressBar:function(){var n=new i.Views.ProgressBarView({model:this.model});this.renderView(this.ui.$progress,n)},renderControlSpinner:function(){var n=new i.Views.ControlSpinner({model:this.model});this.renderView(this.ui.$controlSpinner,n)},onRender:function(){this.renderProgressBar();this.renderPlayToggle();this.renderChapterControls();this.renderPlaybackTime();this.renderControlSpinner()}})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.PushToDevice,f=n.Shared,e=n.Services,r=i.Utils.Constants,u=r.EVENTS;i.Views.PlaybackButtonView=t.View.extend({name:"StartPlaybackView",template:i.Templates.PlaybackButton,events:{"click .device-start":"onClick"},initialize:function(){this.listenTo(this.model,"change:showSpinner",this.render)},onClick:function(n){n.preventDefault();this.model.set("startPlayback",!0)},renderSpinner:function(){var t=new n.Shared.Views.SpinJsView({loadingText:"Starting playback...",spinOptions:{length:2,width:2,radius:4}});this.renderView(this.$el,t);t.trigger("rendered")},onRender:function(){if(this.model.get("showSpinner")){this.renderSpinner();return}}});i.Views.DeviceItemView=t.View.extend({name:"DeviceItemView",tagName:"li",className:"device-item col-xs-12",template:i.Templates.PlayerDeviceItem,ui:{$devicePlayback:".device-playback-viewpart",$playToggle:".device-play-toggle"},initialize:function(){this._appEventBus=e.DeviceService.getEventChannel(r.CHANNELS.APP);this.videoDeviceModel=this.options.videoDeviceModel||{};this.listenTo(this.model,"change:startPlayback",this.startPlayback);this.listenTo(this.model,"change",this.render)},renderPlaybackButton:function(){var n=new i.Views.PlaybackButtonView({model:this.model});this.renderView(this.ui.$devicePlayback,n)},startPlayback:function(){if(this.model.set("showSpinner",!0),this.videoDeviceModel.playback.set("status",r.COMMAND_TYPE.PLAY),!this.model.get("haveLock")){this._appEventBus.trigger(u.APP.GET_LOCK,this.model);return}var n={data:this.model.video.get("trackingCode"),params:this.videoDeviceModel.chapters.current().get("number")};this._appEventBus.trigger(u.APP.INVOKE,r.COMMAND_TYPE.PLAY,n)},onClose:function(){this.stopListening(this._appEventBus)},onBeforeRender:function(){return this.model.get("showSpinner")&&!this.model.get("startPlayback")&&this.model.set("showSpinner",!1),!0},onRender:function(){this.renderPlaybackButton()}});i.Views.PlayerListView=i.Views.DeviceListView.extend({childView:i.Views.DeviceItemView,className:"device-list",initialize:function(){i.Views.DeviceListView.prototype.initialize.apply(this,arguments)},renderEmptyState:function(){this.$el.html("There are no devices currently connected.<p class='subtext'>Download the ClickView tvOS app onto your Apple TV to get started.<\/p>").addClass("device-list-empty")}});i.Views.DeviceContainerView=t.View.extend({name:"DeviceContainerView",className:"device-container",template:i.Templates.DeviceContainer,ui:{$deviceHeader:".device-header",$deviceListViewpart:".device-list-viewpart"},events:{"click .device-exit":"exit"},initialize:function(){this.listenTo(this.model.devices,"reset",this.render)},exit:function(){this.model.trigger(u.CONFIG.STOP);f.Utils.AnalyticsService.logDeviceClose("soft","devicelist")},renderLoader:function(){var n=new f.Views.SpinJsView({loadingText:"Searching for devices..."});this.renderView(this.ui.$deviceListViewpart,n,{empty:!1});n.trigger("rendered")},renderDeviceList:function(){var n=new i.Views.PlayerListView({collection:this.model.devices,videoDeviceModel:this.model});this.renderView(this.ui.$deviceListViewpart,n)},onRender:function(){if(!this.model.devices.hasFetched()){this.renderLoader();return}this.renderDeviceList()}})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.PushToDevice,f=n.Shared,e=n.Services,r=i.Utils.Constants,u=r.EVENTS,o=r.COMMAND_TYPE;i.Views.PlayerPlaybackView=t.View.extend({name:"PlayerPlaybackView",className:"device-play",template:i.Templates.DeviceCurrentlyPlaying,initialize:function(){this._appEventBus=e.DeviceService.getEventChannel(r.CHANNELS.APP);this.activeDevice=this.model.devices.getActiveDevice();this.listenTo(this.activeDevice,"change:status",this.handleSuspend);this.listenTo(this._appEventBus,u.APP.CHANGE_CHAPTER,this.render)},ui:{$error:".device-error-viewpart"},events:{"click .stop-playback":"handleStop","click .device-exit":"exit"},viewOptions:function(){var n=this.model.get("video.title");return{deviceName:this.activeDevice.get("name"),title:n,chapterName:function(){var t=this.model.chapters.current().get("title");return!t||t==="Chapter"||t===n?null:t},exitText:"Close"}},handleStop:function(){var n=this.activeDevice.get("status")===r.DEVICE_STATUS.SUSPENDED;if(n){this.exit();return}this.stopPlayback()},exit:function(){this.stopPlayback();this.model.trigger(u.CONFIG.STOP);f.Utils.AnalyticsService.logDeviceClose("soft","devicelist")},stopPlayback:function(){this.logStop();this._appEventBus.trigger(u.APP.INVOKE,o.STOP)},logStop:function(){var n=this.activeDevice.get("deviceId"),t=this.model.video.get("trackingCode"),i=this.model.chapters.current().get("number"),r=this.model.video.get("title"),u=this.model.playback.get("time");f.Utils.AnalyticsService.logDeviceStop(n,t,r,i,u)},handleSuspend:function(){var n=this.activeDevice.get("status")===r.DEVICE_STATUS.SUSPENDED,t;n&&(t="The device appears to have gone offline. Re-open the app to continue playback.",this.renderView(this.ui.$error,new i.Views.PlayerBannerView({model:this.model,text:t})));n||this.model.playback.trigger("closeBanner")},handleConnectionUpdate:function(n){if(!n)this.renderView(this.ui.$error,new i.Views.PlayerBannerView({model:this.model,text:"Connection lost. Reconnecting..."}));n&&this.model.playback.trigger("closeBanner")},onClose:function(){this.stopListening(this._appEventBus)}})}(ClickView,EasyMoney),function(n,t){"use strict";if(!t)throw new Error("Please make sure to include EasyMoney before this app.");n=n||{};n.OnBoarding=n.OnBoarding||{Views:{},Models:{},Collections:{}}}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.OnBoarding;i.Models.Slide=t.Model.extend({})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.OnBoarding;i.Collections.SlideCollection=t.Collection.extend({model:i.Models.Slide,currentSlide:1})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.OnBoarding;i.Views.IndicatorView=t.View.extend({template:!1,tagName:"li",attributes:{"data-target":"#carousel-box"},className:function(){return this.model.get("active")?"active":""},onRender:function(){this.$el.attr("data-slide-to",this.options.index)}})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.OnBoarding;i.Views.SlideView=t.View.extend({template:'<img src="{{image}}" /><h3>{{{heading}}}<\/h3><p class="text">{{text}}<\/p>',ui:{image:"img",heading:"h3",text:".text"},className:function(){return this.model.get("active")?"item active":"item"},onRender:function(){var n=this;this.ui.image.load(function(){n.options.parent.trigger("resize")});this.model.get("heading")||this.ui.heading.hide();this.model.get("imageSize")&&this.ui.image.css(this.model.get("imageSize"));this.model.get("image")||this.ui.image.hide();this.model.get("htmlText")&&(this.ui.text.hide(),this.$el.append(this.model.get("text")))}})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.OnBoarding;i.Views.OnBoardingView=t.View.extend({id:"carousel-box",template:'<ol class="carousel-indicators"><\/ol><div class="carousel-inner" role="listbox"><\/div><div class="popup-button-container-fake"><a class="btn grey back-btn">Back<\/a><a class="btn orange onboarding-button">Next<\/a>{{#if closeButton}}<a class="btn grey close-btn">Close<\/a>{{/if}}{{#if checkboxOptOut}}<input type="checkbox" id="opt-out-checkbox" /><label for="opt-out-checkbox">Don\'t show this again<\/label>{{else}}<a class="dont-show-label">Don\'t show this again<\/a><\/div>{{/if}}',className:"carousel slide",defaults:{wrap:!1,interval:!1,closeText:"Got it!",optOut:!0,showBackButton:!0,closeButton:!1,checkboxOptOut:!1},ui:{carouselSlides:".carousel-inner",onBoardingButton:".onboarding-button",carouselIndicators:".carousel-indicators",dontShowLabel:".dont-show-label",backButton:".back-btn",optOutCheckbox:"#opt-out-checkbox"},events:{"click .finished":"closeOnBoarding","click .dont-show-label":"clickDontShowAgain","click .onboarding-button":"next","click .back-btn":"prev","click .close-btn":"close","change #opt-out-checkbox":"optOutChecked"},initialize:function(){this.collection.first().set("active",!0);this._onClose=this.options.onClose;this.options.onClose=null},optOutChecked:function(){this.dontShowAgain=this.ui.optOutCheckbox[0].checked},next:function(){this.$el.carousel("next")},prev:function(){this.$el.carousel("prev")},initializeCarousel:function(){this.$el.carousel(this.options);this.$el.on("slide.bs.carousel",_.bind(this.onSlide,this))},onSlide:function(n){this.collection.currentSlide=$(n.relatedTarget).index();this.ui.dontShowLabel.hide();this.collection.currentSlide>0?this.ui.backButton.show():this.ui.backButton.hide();this.lastSlide(this.collection.currentSlide==this.collection.length-1);this.setSize()},lastSlide:function(n){n?this.ui.onBoardingButton.text(this.options.closeText).addClass("finished"):this.ui.onBoardingButton.text("Next").removeClass("finished");this.options.optOut&&this.ui.dontShowLabel.show()},renderSlide:function(n,t){this.renderView(this.ui.carouselIndicators,new i.Views.IndicatorView({model:n,index:t}),{empty:!1});this.renderView(this.ui.carouselSlides,new i.Views.SlideView({model:n,parent:this}),{empty:!1})},renderSlides:function(){this.collection.forEach(_.bind(this.renderSlide,this))},onCloseClick:function(n){n&&n.preventDefault();this.closeOnBoarding()},closeOnBoarding:function(){typeof this._onClose=="function"&&this._onClose();this.trigger("close")},clickDontShowAgain:function(){this.dontShowAgain=!0;this.closeOnBoarding();this.options.userOptionId&&$.get("/calltoaction/"+this.options.userOptionId)},onRender:function(){this.renderSlides();this.initializeCarousel();this.lastSlide(this.collection.currentSlide>=this.collection.length);this.ui.backButton.hide();this.ui.dontShowLabel.show();this.collection.length<=1&&(this.ui.carouselIndicators.hide(),this.lastSlide(!0));this.onResize=_.debounce(_.bind(this.onResize,this),300);$(window).on("resize",this.onResize);this.onResize()},onRendered:function(){this.setSize()},setSize:function(){var n=this.ui.carouselSlides.outerHeight();(!this.currentSize||this.currentSize<n)&&(this.currentSize=n);this.ui.carouselSlides.css("min-height",this.currentSize)},onResize:function(){this.ui.carouselSlides.css("max-height",window.innerHeight*.9-90+"px")},onClose:function(){this.$el.off("slide.bs.carousel");$(window).off("resize",this.onResize);this.dontShowAgain&&this.options.userOptionId&&$.get("/calltoaction/"+this.options.userOptionId);this.$el.carousel("pause");this.$el.removeData("carousel")},viewOptions:function(){return this.options}})}(ClickView,EasyMoney)