/*!
 * jQuery JavaScript Library v1.11.3
 * http://jquery.com/
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 *
 * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
 * Released under the MIT license
 * http://jquery.org/license
 *
 * Date: 2015-04-28T16:19Z
 */

/*!
 * Sizzle CSS Selector Engine v2.2.0-pre
 * http://sizzlejs.com/
 *
 * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors
 * Released under the MIT license
 * http://jquery.org/license
 *
 * Date: 2014-12-16
 */

//     (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors

//     Underscore may be freely distributed under the MIT license.

//     (c) 2010-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors

//     Backbone may be freely distributed under the MIT license.

/**
 * @license RequireJS text 2.0.12 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
 * Available via the MIT or new BSD license.
 * see: http://github.com/requirejs/text for details
 */

/*! jQuery UI - v1.11.4 - 2015-09-15
* http://jqueryui.com
* Includes: core.js, widget.js, mouse.js, draggable.js
* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */

/*!
 * jQuery UI Core 1.11.4
 * http://jqueryui.com
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/category/ui-core/
 */

/*!
 * jQuery UI Widget 1.11.4
 * http://jqueryui.com
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/jQuery.widget/
 */

/*!
 * jQuery UI Mouse 1.11.4
 * http://jqueryui.com
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/mouse/
 */

/*!
 * jQuery UI Draggable 1.11.4
 * http://jqueryui.com
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/draggable/
 */

/*!
 * Draggabilly PACKAGED v2.1.0
 * Make that shiz draggable
 * http://draggabilly.desandro.com
 * MIT license
 */

/**
 * Bridget makes jQuery widgets
 * v2.0.0
 * MIT license
 */

/*!
 * getSize v2.0.2
 * measure size of elements
 * MIT license
 */

/*!
 * Unipointer v2.1.0
 * base class for doing one thing with pointer event
 * MIT license
 */

/*!
 * Unidragger v2.1.0
 * Draggable base class
 * MIT license
 */

/*!
 * Draggabilly v2.1.0
 * Make that shiz draggable
 * http://draggabilly.desandro.com
 * MIT license
 */

(function(e,t){typeof module=="object"&&typeof module.exports=="object"?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)})(typeof window!="undefined"?window:this,function(e,t){function g(e){var t="length"in e&&e.length,n=h.type(e);return n==="function"||h.isWindow(e)?!1:e.nodeType===1&&t?!0:n==="array"||t===0||typeof t=="number"&&t>0&&t-1 in e}function S(e,t,n){if(h.isFunction(t))return h.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return h.grep(e,function(e){return e===t!==n});if(typeof t=="string"){if(E.test(t))return h.filter(t,e,n);t=h.filter(t,e)}return h.grep(e,function(e){return h.inArray(e,t)>=0!==n})}function A(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function _(e){var t=M[e]={};return h.each(e.match(O)||[],function(e,n){t[n]=!0}),t}function P(){T.addEventListener?(T.removeEventListener("DOMContentLoaded",H,!1),e.removeEventListener("load",H,!1)):(T.detachEvent("onreadystatechange",H),e.detachEvent("onload",H))}function H(){if(T.addEventListener||event.type==="load"||T.readyState==="complete")P(),h.ready()}function q(e,t,n){if(n===undefined&&e.nodeType===1){var r="data-"+t.replace(I,"-$1").toLowerCase();n=e.getAttribute(r);if(typeof n=="string"){try{n=n==="true"?!0:n==="false"?!1:n==="null"?null:+n+""===n?+n:F.test(n)?h.parseJSON(n):n}catch(i){}h.data(e,t,n)}else n=undefined}return n}function R(e){var t;for(t in e){if(t==="data"&&h.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function U(e,t,r,i){if(!h.acceptData(e))return;var s,o,u=h.expando,a=e.nodeType,f=a?h.cache:e,l=a?e[u]:e[u]&&u;if((!l||!f[l]||!i&&!f[l].data)&&r===undefined&&typeof t=="string")return;l||(a?l=e[u]=n.pop()||h.guid++:l=u),f[l]||(f[l]=a?{}:{toJSON:h.noop});if(typeof t=="object"||typeof t=="function")i?f[l]=h.extend(f[l],t):f[l].data=h.extend(f[l].data,t);return o=f[l],i||(o.data||(o.data={}),o=o.data),r!==undefined&&(o[h.camelCase(t)]=r),typeof t=="string"?(s=o[t],s==null&&(s=o[h.camelCase(t)])):s=o,s}function z(e,t,n){if(!h.acceptData(e))return;var r,i,s=e.nodeType,o=s?h.cache:e,u=s?e[h.expando]:h.expando;if(!o[u])return;if(t){r=n?o[u]:o[u].data;if(r){h.isArray(t)?t=t.concat(h.map(t,h.camelCase)):t in r?t=[t]:(t=h.camelCase(t),t in r?t=[t]:t=t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!R(r):!h.isEmptyObject(r))return}}if(!n){delete o[u].data;if(!R(o[u]))return}s?h.cleanData([e],!0):l.deleteExpando||o!=o.window?delete o[u]:o[u]=null}function et(){return!0}function tt(){return!1}function nt(){try{return T.activeElement}catch(e){}}function rt(e){var t=it.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function wt(e,t){var n,r,i=0,s=typeof e.getElementsByTagName!==B?e.getElementsByTagName(t||"*"):typeof e.querySelectorAll!==B?e.querySelectorAll(t||"*"):undefined;if(!s)for(s=[],n=e.childNodes||e;(r=n[i])!=null;i++)!t||h.nodeName(r,t)?s.push(r):h.merge(s,wt(r,t));return t===undefined||t&&h.nodeName(e,t)?h.merge([e],s):s}function Et(e){J.test(e.type)&&(e.defaultChecked=e.checked)}function St(e,t){return h.nodeName(e,"table")&&h.nodeName(t.nodeType!==11?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function xt(e){return e.type=(h.find.attr(e,"type")!==null)+"/"+e.type,e}function Tt(e){var t=vt.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Nt(e,t){var n,r=0;for(;(n=e[r])!=null;r++)h._data(n,"globalEval",!t||h._data(t[r],"globalEval"))}function Ct(e,t){if(t.nodeType!==1||!h.hasData(e))return;var n,r,i,s=h._data(e),o=h._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r<i;r++)h.event.add(t,n,u[n][r])}o.data&&(o.data=h.extend({},o.data))}function kt(e,t){var n,r,i;if(t.nodeType!==1)return;n=t.nodeName.toLowerCase();if(!l.noCloneEvent&&t[h.expando]){i=h._data(t);for(r in i.events)h.removeEvent(t,r,i.handle);t.removeAttribute(h.expando)}if(n==="script"&&t.text!==e.text)xt(t).text=e.text,Tt(t);else if(n==="object")t.parentNode&&(t.outerHTML=e.outerHTML),l.html5Clone&&e.innerHTML&&!h.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML);else if(n==="input"&&J.test(e.type))t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value);else if(n==="option")t.defaultSelected=t.selected=e.defaultSelected;else if(n==="input"||n==="textarea")t.defaultValue=e.defaultValue}function Ot(t,n){var r,i=h(n.createElement(t)).appendTo(n.body),s=e.getDefaultComputedStyle&&(r=e.getDefaultComputedStyle(i[0]))?r.display:h.css(i[0],"display");return i.detach(),s}function Mt(e){var t=T,n=At[e];if(!n){n=Ot(e,t);if(n==="none"||!n)Lt=(Lt||h("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement),t=(Lt[0].contentWindow||Lt[0].contentDocument).document,t.write(),t.close(),n=Ot(e,t),Lt.detach();At[e]=n}return n}function jt(e,t){return{get:function(){var n=e();if(n==null)return;if(n){delete this.get;return}return(this.get=t).apply(this,arguments)}}}function Vt(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Xt.length;while(i--){t=Xt[i]+n;if(t in e)return t}return r}function $t(e,t){var n,r,i,s=[],o=0,u=e.length;for(;o<u;o++){r=e[o];if(!r.style)continue;s[o]=h._data(r,"olddisplay"),n=r.style.display,t?(!s[o]&&n==="none"&&(r.style.display=""),r.style.display===""&&V(r)&&(s[o]=h._data(r,"olddisplay",Mt(r.nodeName)))):(i=V(r),(n&&n!=="none"||!i)&&h._data(r,"olddisplay",i?n:h.css(r,"display")))}for(o=0;o<u;o++){r=e[o];if(!r.style)continue;if(!t||r.style.display==="none"||r.style.display==="")r.style.display=t?s[o]||"":"none"}return e}function Jt(e,t,n){var r=Rt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function Kt(e,t,n,r,i){var s=n===(r?"border":"content")?4:t==="width"?1:0,o=0;for(;s<4;s+=2)n==="margin"&&(o+=h.css(e,n+X[s],!0,i)),r?(n==="content"&&(o-=h.css(e,"padding"+X[s],!0,i)),n!=="margin"&&(o-=h.css(e,"border"+X[s]+"Width",!0,i))):(o+=h.css(e,"padding"+X[s],!0,i),n!=="padding"&&(o+=h.css(e,"border"+X[s]+"Width",!0,i)));return o}function Qt(e,t,n){var r=!0,i=t==="width"?e.offsetWidth:e.offsetHeight,s=Pt(e),o=l.boxSizing&&h.css(e,"boxSizing",!1,s)==="border-box";if(i<=0||i==null){i=Ht(e,t,s);if(i<0||i==null)i=e.style[t];if(Dt.test(i))return i;r=o&&(l.boxSizingReliable()||i===e.style[t]),i=parseFloat(i)||0}return i+Kt(e,t,n||(o?"border":"content"),r,s)+"px"}function Gt(e,t,n,r,i){return new Gt.prototype.init(e,t,n,r,i)}function on(){return setTimeout(function(){Yt=undefined}),Yt=h.now()}function un(e,t){var n,r={height:e},i=0;t=t?1:0;for(;i<4;i+=2-t)n=X[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function an(e,t,n){var r,i=(sn[t]||[]).concat(sn["*"]),s=0,o=i.length;for(;s<o;s++)if(r=i[s].call(n,t,e))return r}function fn(e,t,n){var r,i,s,o,u,a,f,c,p=this,d={},v=e.style,m=e.nodeType&&V(e),g=h._data(e,"fxshow");n.queue||(u=h._queueHooks(e,"fx"),u.unqueued==null&&(u.unqueued=0,a=u.empty.fire,u.empty.fire=function(){u.unqueued||a()}),u.unqueued++,p.always(function(){p.always(function(){u.unqueued--,h.queue(e,"fx").length||u.empty.fire()})})),e.nodeType===1&&("height"in t||"width"in t)&&(n.overflow=[v.overflow,v.overflowX,v.overflowY],f=h.css(e,"display"),c=f==="none"?h._data(e,"olddisplay")||Mt(e.nodeName):f,c==="inline"&&h.css(e,"float")==="none"&&(!l.inlineBlockNeedsLayout||Mt(e.nodeName)==="inline"?v.display="inline-block":v.zoom=1)),n.overflow&&(v.overflow="hidden",l.shrinkWrapBlocks()||p.always(function(){v.overflow=n.overflow[0],v.overflowX=n.overflow[1],v.overflowY=n.overflow[2]}));for(r in t){i=t[r];if(en.exec(i)){delete t[r],s=s||i==="toggle";if(i===(m?"hide":"show")){if(i!=="show"||!g||g[r]===undefined)continue;m=!0}d[r]=g&&g[r]||h.style(e,r)}else f=undefined}if(!h.isEmptyObject(d)){g?"hidden"in g&&(m=g.hidden):g=h._data(e,"fxshow",{}),s&&(g.hidden=!m),m?h(e).show():p.done(function(){h(e).hide()}),p.done(function(){var t;h._removeData(e,"fxshow");for(t in d)h.style(e,t,d[t])});for(r in d)o=an(m?g[r]:0,r,p),r in g||(g[r]=o.start,m&&(o.end=o.start,o.start=r==="width"||r==="height"?1:0))}else(f==="none"?Mt(e.nodeName):f)==="inline"&&(v.display=f)}function ln(e,t){var n,r,i,s,o;for(n in e){r=h.camelCase(n),i=t[r],s=e[n],h.isArray(s)&&(i=s[1],s=e[n]=s[0]),n!==r&&(e[r]=s,delete e[n]),o=h.cssHooks[r];if(o&&"expand"in o){s=o.expand(s),delete e[r];for(n in s)n in e||(e[n]=s[n],t[n]=i)}else t[r]=i}}function cn(e,t,n){var r,i,s=0,o=rn.length,u=h.Deferred().always(function(){delete a.elem}),a=function(){if(i)return!1;var t=Yt||on(),n=Math.max(0,f.startTime+f.duration-t),r=n/f.duration||0,s=1-r,o=0,a=f.tweens.length;for(;o<a;o++)f.tweens[o].run(s);return u.notifyWith(e,[f,s,n]),s<1&&a?n:(u.resolveWith(e,[f]),!1)},f=u.promise({elem:e,props:h.extend({},t),opts:h.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Yt||on(),duration:n.duration,tweens:[],createTween:function(t,n){var r=h.Tween(e,f.opts,t,n,f.opts.specialEasing[t]||f.opts.easing);return f.tweens.push(r),r},stop:function(t){var n=0,r=t?f.tweens.length:0;if(i)return this;i=!0;for(;n<r;n++)f.tweens[n].run(1);return t?u.resolveWith(e,[f,t]):u.rejectWith(e,[f,t]),this}}),l=f.props;ln(l,f.opts.specialEasing);for(;s<o;s++){r=rn[s].call(f,e,l,f.opts);if(r)return r}return h.map(l,an,f),h.isFunction(f.opts.start)&&f.opts.start.call(e,f),h.fx.timer(h.extend(a,{elem:e,anim:f,queue:f.opts.queue})),f.progress(f.opts.progress).done(f.opts.done,f.opts.complete).fail(f.opts.fail).always(f.opts.always)}function Fn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i=0,s=t.toLowerCase().match(O)||[];if(h.isFunction(n))while(r=s[i++])r.charAt(0)==="+"?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function In(e,t,n,r){function o(u){var a;return i[u]=!0,h.each(e[u]||[],function(e,u){var f=u(t,n,r);if(typeof f=="string"&&!s&&!i[f])return t.dataTypes.unshift(f),o(f),!1;if(s)return!(a=f)}),a}var i={},s=e===Hn;return o(t.dataTypes[0])||!i["*"]&&o("*")}function qn(e,t){var n,r,i=h.ajaxSettings.flatOptions||{};for(r in t)t[r]!==undefined&&((i[r]?e:n||(n={}))[r]=t[r]);return n&&h.extend(!0,e,n),e}function Rn(e,t,n){var r,i,s,o,u=e.contents,a=e.dataTypes;while(a[0]==="*")a.shift(),i===undefined&&(i=e.mimeType||t.getResponseHeader("Content-Type"));if(i)for(o in u)if(u[o]&&u[o].test(i)){a.unshift(o);break}if(a[0]in n)s=a[0];else{for(o in n){if(!a[0]||e.converters[o+" "+a[0]]){s=o;break}r||(r=o)}s=s||r}if(s)return s!==a[0]&&a.unshift(s),n[s]}function Un(e,t,n,r){var i,s,o,u,a,f={},l=e.dataTypes.slice();if(l[1])for(o in e.converters)f[o.toLowerCase()]=e.converters[o];s=l.shift();while(s){e.responseFields[s]&&(n[e.responseFields[s]]=t),!a&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),a=s,s=l.shift();if(s)if(s==="*")s=a;else if(a!=="*"&&a!==s){o=f[a+" "+s]||f["* "+s];if(!o)for(i in f){u=i.split(" ");if(u[1]===s){o=f[a+" "+u[0]]||f["* "+u[0]];if(o){o===!0?o=f[i]:f[i]!==!0&&(s=u[0],l.unshift(u[1]));break}}}if(o!==!0)if(o&&e["throws"])t=o(t);else try{t=o(t)}catch(c){return{state:"parsererror",error:o?c:"No conversion from "+a+" to "+s}}}}return{state:"success",data:t}}function Jn(e,t,n,r){var i;if(h.isArray(t))h.each(t,function(t,i){n||Wn.test(e)?r(e,i):Jn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&h.type(t)==="object")for(i in t)Jn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Yn(){try{return new e.XMLHttpRequest}catch(t){}}function Zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function ir(e){return h.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:!1}var n=[],r=n.slice,i=n.concat,s=n.push,o=n.indexOf,u={},a=u.toString,f=u.hasOwnProperty,l={},c="1.11.3",h=function(e,t){return new h.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,d=/^-ms-/,v=/-([\da-z])/gi,m=function(e,t){return t.toUpperCase()};h.fn=h.prototype={jquery:c,constructor:h,selector:"",length:0,toArray:function(){return r.call(this)},get:function(e){return e!=null?e<0?this[e+this.length]:this[e]:r.call(this)},pushStack:function(e){var t=h.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return h.each(this,e,t)},map:function(e){return this.pushStack(h.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(r.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:s,sort:n.sort,splice:n.splice},h.extend=h.fn.extend=function(){var e,t,n,r,i,s,o=arguments[0]||{},u=1,a=arguments.length,f=!1;typeof o=="boolean"&&(f=o,o=arguments[u]||{},u++),typeof o!="object"&&!h.isFunction(o)&&(o={}),u===a&&(o=this,u--);for(;u<a;u++)if((i=arguments[u])!=null)for(r in i){e=o[r],n=i[r];if(o===n)continue;f&&n&&(h.isPlainObject(n)||(t=h.isArray(n)))?(t?(t=!1,s=e&&h.isArray(e)?e:[]):s=e&&h.isPlainObject(e)?e:{},o[r]=h.extend(f,s,n)):n!==undefined&&(o[r]=n)}return o},h.extend({expando:"jQuery"+(c+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return h.type(e)==="function"},isArray:Array.isArray||function(e){return h.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!h.isArray(e)&&e-parseFloat(e)+1>=0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},isPlainObject:function(e){var t;if(!e||h.type(e)!=="object"||e.nodeType||h.isWindow(e))return!1;try{if(e.constructor&&!f.call(e,"constructor")&&!f.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}if(l.ownLast)for(t in e)return f.call(e,t);for(t in e);return t===undefined||f.call(e,t)},type:function(e){return e==null?e+"":typeof e=="object"||typeof e=="function"?u[a.call(e)]||"object":typeof e},globalEval:function(t){t&&h.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(d,"ms-").replace(v,m)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,s=e.length,o=g(e);if(n)if(o)for(;i<s;i++){r=t.apply(e[i],n);if(r===!1)break}else for(i in e){r=t.apply(e[i],n);if(r===!1)break}else if(o)for(;i<s;i++){r=t.call(e[i],i,e[i]);if(r===!1)break}else for(i in e){r=t.call(e[i],i,e[i]);if(r===!1)break}return e},trim:function(e){return e==null?"":(e+"").replace(p,"")},makeArray:function(e,t){var n=t||[];return e!=null&&(g(Object(e))?h.merge(n,typeof e=="string"?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(o)return o.call(t,e,n);r=t.length,n=n?n<0?Math.max(0,r+n):n:0;for(;n<r;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,t){var n=+t.length,r=0,i=e.length;while(r<n)e[i++]=t[r++];if(n!==n)while(t[r]!==undefined)e[i++]=t[r++];return e.length=i,e},grep:function(e,t,n){var r,i=[],s=0,o=e.length,u=!n;for(;s<o;s++)r=!t(e[s],s),r!==u&&i.push(e[s]);return i},map:function(e,t,n){var r,s=0,o=e.length,u=g(e),a=[];if(u)for(;s<o;s++)r=t(e[s],s,n),r!=null&&a.push(r);else for(s in e)r=t(e[s],s,n),r!=null&&a.push(r);return i.apply([],a)},guid:1,proxy:function(e,t){var n,i,s;return typeof t=="string"&&(s=e[t],t=e,e=s),h.isFunction(e)?(n=r.call(arguments,2),i=function(){return e.apply(t||this,n.concat(r.call(arguments)))},i.guid=e.guid=e.guid||h.guid++,i):undefined},now:function(){return+(new Date)},support:l}),h.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){u["[object "+t+"]"]=t.toLowerCase()});var y=function(e){function ot(e,t,r,i){var s,u,f,l,c,d,g,y,S,x;(t?t.ownerDocument||t:E)!==p&&h(t),t=t||p,r=r||[],l=t.nodeType;if(typeof e!="string"||!e||l!==1&&l!==9&&l!==11)return r;if(!i&&v){if(l!==11&&(s=Z.exec(e)))if(f=s[1]){if(l===9){u=t.getElementById(f);if(!u||!u.parentNode)return r;if(u.id===f)return r.push(u),r}else if(t.ownerDocument&&(u=t.ownerDocument.getElementById(f))&&b(t,u)&&u.id===f)return r.push(u),r}else{if(s[2])return D.apply(r,t.getElementsByTagName(e)),r;if((f=s[3])&&n.getElementsByClassName)return D.apply(r,t.getElementsByClassName(f)),r}if(n.qsa&&(!m||!m.test(e))){y=g=w,S=t,x=l!==1&&e;if(l===1&&t.nodeName.toLowerCase()!=="object"){d=o(e),(g=t.getAttribute("id"))?y=g.replace(tt,"\\$&"):t.setAttribute("id",y),y="[id='"+y+"'] ",c=d.length;while(c--)d[c]=y+gt(d[c]);S=et.test(e)&&vt(t.parentNode)||t,x=d.join(",")}if(x)try{return D.apply(r,S.querySelectorAll(x)),r}catch(T){}finally{g||t.removeAttribute("id")}}}return a(e.replace(z,"$1"),t,r,i)}function ut(){function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}var e=[];return t}function at(e){return e[w]=!0,e}function ft(e){var t=p.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function lt(e,t){var n=e.split("|"),i=e.length;while(i--)r.attrHandle[n[i]]=t}function ct(e,t){var n=t&&e,r=n&&e.nodeType===1&&t.nodeType===1&&(~t.sourceIndex||L)-(~e.sourceIndex||L);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ht(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function pt(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function dt(e){return at(function(t){return t=+t,at(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function vt(e){return e&&typeof e.getElementsByTagName!="undefined"&&e}function mt(){}function gt(e){var t=0,n=e.length,r="";for(;t<n;t++)r+=e[t].value;return r}function yt(e,t,n){var r=t.dir,i=n&&r==="parentNode",s=x++;return t.first?function(t,n,s){while(t=t[r])if(t.nodeType===1||i)return e(t,n,s)}:function(t,n,o){var u,a,f=[S,s];if(o){while(t=t[r])if(t.nodeType===1||i)if(e(t,n,o))return!0}else while(t=t[r])if(t.nodeType===1||i){a=t[w]||(t[w]={});if((u=a[r])&&u[0]===S&&u[1]===s)return f[2]=u[2];a[r]=f;if(f[2]=e(t,n,o))return!0}}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function wt(e,t,n){var r=0,i=t.length;for(;r<i;r++)ot(e,t[r],n);return n}function Et(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u<a;u++)if(s=e[u])if(!n||n(s,r,i))o.push(s),f&&t.push(u);return o}function St(e,t,n,r,i,s){return r&&!r[w]&&(r=St(r)),i&&!i[w]&&(i=St(i,s)),at(function(s,o,u,a){var f,l,c,h=[],p=[],d=o.length,v=s||wt(t||"*",u.nodeType?[u]:u,[]),m=e&&(s||!t)?Et(v,h,e,u,a):v,g=n?i||(s?e:d||r)?[]:o:m;n&&n(m,g,u,a);if(r){f=Et(g,p),r(f,[],u,a),l=f.length;while(l--)if(c=f[l])g[p[l]]=!(m[p[l]]=c)}if(s){if(i||e){if(i){f=[],l=g.length;while(l--)(c=g[l])&&f.push(m[l]=c);i(null,g=[],f,a)}l=g.length;while(l--)(c=g[l])&&(f=i?H(s,c):h[l])>-1&&(s[f]=!(o[f]=c))}}else g=Et(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):D.apply(o,g)})}function xt(e){var t,n,i,s=e.length,o=r.relative[e[0].type],u=o||r.relative[" "],a=o?1:0,l=yt(function(e){return e===t},u,!0),c=yt(function(e){return H(t,e)>-1},u,!0),h=[function(e,n,r){var i=!o&&(r||n!==f)||((t=n).nodeType?l(e,n,r):c(e,n,r));return t=null,i}];for(;a<s;a++)if(n=r.relative[e[a].type])h=[yt(bt(h),n)];else{n=r.filter[e[a].type].apply(null,e[a].matches);if(n[w]){i=++a;for(;i<s;i++)if(r.relative[e[i].type])break;return St(a>1&&bt(h),a>1&&gt(e.slice(0,a-1).concat({value:e[a-2].type===" "?"*":""})).replace(z,"$1"),n,a<i&&xt(e.slice(a,i)),i<s&&xt(e=e.slice(i)),i<s&&gt(e))}h.push(n)}return bt(h)}function Tt(e,t){var n=t.length>0,i=e.length>0,s=function(s,o,u,a,l){var c,h,d,v=0,m="0",g=s&&[],y=[],b=f,w=s||i&&r.find.TAG("*",l),E=S+=b==null?1:Math.random()||.1,x=w.length;l&&(f=o!==p&&o);for(;m!==x&&(c=w[m])!=null;m++){if(i&&c){h=0;while(d=e[h++])if(d(c,o,u)){a.push(c);break}l&&(S=E)}n&&((c=!d&&c)&&v--,s&&g.push(c))}v+=m;if(n&&m!==v){h=0;while(d=t[h++])d(g,y,o,u);if(s){if(v>0)while(m--)!g[m]&&!y[m]&&(y[m]=M.call(a));y=Et(y)}D.apply(a,y),l&&!s&&y.length>0&&v+t.length>1&&ot.uniqueSort(a)}return l&&(S=E,f=b),g};return n?at(s):s}var t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w="sizzle"+1*new Date,E=e.document,S=0,x=0,T=ut(),N=ut(),C=ut(),k=function(e,t){return e===t&&(c=!0),0},L=1<<31,A={}.hasOwnProperty,O=[],M=O.pop,_=O.push,D=O.push,P=O.slice,H=function(e,t){var n=0,r=e.length;for(;n<r;n++)if(e[n]===t)return n;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",j="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",I=F.replace("w","w#"),q="\\["+j+"*("+F+")(?:"+j+"*([*^$|!~]?=)"+j+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+j+"*\\]",R=":("+F+")(?:\\(("+"('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|"+"((?:\\\\.|[^\\\\()[\\]]|"+q+")*)|"+".*"+")\\)|)",U=new RegExp(j+"+","g"),z=new RegExp("^"+j+"+|((?:^|[^\\\\])(?:\\\\.)*)"+j+"+$","g"),W=new RegExp("^"+j+"*,"+j+"*"),X=new RegExp("^"+j+"*([>+~]|"+j+")"+j+"*"),V=new RegExp("="+j+"*([^\\]'\"]*?)"+j+"*\\]","g"),$=new RegExp(R),J=new RegExp("^"+I+"$"),K={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F.replace("w","w*")+")"),ATTR:new RegExp("^"+q),PSEUDO:new RegExp("^"+R),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+j+"*(even|odd|(([+-]|)(\\d*)n|)"+j+"*(?:([+-]|)"+j+"*(\\d+)|))"+j+"*\\)|)","i"),bool:new RegExp("^(?:"+B+")$","i"),needsContext:new RegExp("^"+j+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+j+"*((?:-\\d)?\\d*)"+j+"*\\)|)(?=[^-]|$)","i")},Q=/^(?:input|select|textarea|button)$/i,G=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/[+~]/,tt=/'|\\/g,nt=new RegExp("\\\\([\\da-f]{1,6}"+j+"?|("+j+")|.)","ig"),rt=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,r&1023|56320)},it=function(){h()};try{D.apply(O=P.call(E.childNodes),E.childNodes),O[E.childNodes.length].nodeType}catch(st){D={apply:O.length?function(e,t){_.apply(e,P.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}n=ot.support={},s=ot.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},h=ot.setDocument=function(e){var t,i,o=e?e.ownerDocument||e:E;if(o===p||o.nodeType!==9||!o.documentElement)return p;p=o,d=o.documentElement,i=o.defaultView,i&&i!==i.top&&(i.addEventListener?i.addEventListener("unload",it,!1):i.attachEvent&&i.attachEvent("onunload",it)),v=!s(o),n.attributes=ft(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ft(function(e){return e.appendChild(o.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Y.test(o.getElementsByClassName),n.getById=ft(function(e){return d.appendChild(e).id=w,!o.getElementsByName||!o.getElementsByName(w).length}),n.getById?(r.find.ID=function(e,t){if(typeof t.getElementById!="undefined"&&v){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},r.filter.ID=function(e){var t=e.replace(nt,rt);return function(e){return e.getAttribute("id")===t}}):(delete r.find.ID,r.filter.ID=function(e){var t=e.replace(nt,rt);return function(e){var n=typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id");return n&&n.value===t}}),r.find.TAG=n.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!="undefined")return t.getElementsByTagName(e);if(n.qsa)return t.querySelectorAll(e)}:function(e,t){var n,r=[],i=0,s=t.getElementsByTagName(e);if(e==="*"){while(n=s[i++])n.nodeType===1&&r.push(n);return r}return s},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(v)return t.getElementsByClassName(e)},g=[],m=[];if(n.qsa=Y.test(o.querySelectorAll))ft(function(e){d.appendChild(e).innerHTML="<a id='"+w+"'></a>"+"<select id='"+w+"-\f]' msallowcapture=''>"+"<option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+j+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||m.push("\\["+j+"*(?:value|"+B+")"),e.querySelectorAll("[id~="+w+"-]").length||m.push("~="),e.querySelectorAll(":checked").length||m.push(":checked"),e.querySelectorAll("a#"+w+"+*").length||m.push(".#.+[+~]")}),ft(function(e){var t=o.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&m.push("name"+j+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||m.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),m.push(",.*:")});return(n.matchesSelector=Y.test(y=d.matches||d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ft(function(e){n.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),g.push("!=",R)}),m=m.length&&new RegExp(m.join("|")),g=g.length&&new RegExp(g.join("|")),t=Y.test(d.compareDocumentPosition),b=t||Y.test(d.contains)?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!r&&r.nodeType===1&&!!(n.contains?n.contains(r):e.compareDocumentPosition&&e.compareDocumentPosition(r)&16)}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},k=t?function(e,t){if(e===t)return c=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r?r:(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,r&1||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===o||e.ownerDocument===E&&b(E,e)?-1:t===o||t.ownerDocument===E&&b(E,t)?1:l?H(l,e)-H(l,t):0:r&4?-1:1)}:function(e,t){if(e===t)return c=!0,0;var n,r=0,i=e.parentNode,s=t.parentNode,u=[e],a=[t];if(!i||!s)return e===o?-1:t===o?1:i?-1:s?1:l?H(l,e)-H(l,t):0;if(i===s)return ct(e,t);n=e;while(n=n.parentNode)u.unshift(n);n=t;while(n=n.parentNode)a.unshift(n);while(u[r]===a[r])r++;return r?ct(u[r],a[r]):u[r]===E?-1:a[r]===E?1:0},o},ot.matches=function(e,t){return ot(e,null,null,t)},ot.matchesSelector=function(e,t){(e.ownerDocument||e)!==p&&h(e),t=t.replace(V,"='$1']");if(n.matchesSelector&&v&&(!g||!g.test(t))&&(!m||!m.test(t)))try{var r=y.call(e,t);if(r||n.disconnectedMatch||e.document&&e.document.nodeType!==11)return r}catch(i){}return ot(t,p,null,[e]).length>0},ot.contains=function(e,t){return(e.ownerDocument||e)!==p&&h(e),b(e,t)},ot.attr=function(e,t){(e.ownerDocument||e)!==p&&h(e);var i=r.attrHandle[t.toLowerCase()],s=i&&A.call(r.attrHandle,t.toLowerCase())?i(e,t,!v):undefined;return s!==undefined?s:n.attributes||!v?e.getAttribute(t):(s=e.getAttributeNode(t))&&s.specified?s.value:null},ot.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ot.uniqueSort=function(e){var t,r=[],i=0,s=0;c=!n.detectDuplicates,l=!n.sortStable&&e.slice(0),e.sort(k);if(c){while(t=e[s++])t===e[s]&&(i=r.push(s));while(i--)e.splice(r[i],1)}return l=null,e},i=ot.getText=function(e){var t,n="",r=0,s=e.nodeType;if(!s)while(t=e[r++])n+=i(t);else if(s===1||s===9||s===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(s===3||s===4)return e.nodeValue;return n},r=ot.selectors={cacheLength:50,createPseudo:at,match:K,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(nt,rt),e[3]=(e[3]||e[4]||e[5]||"").replace(nt,rt),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1].slice(0,3)==="nth"?(e[3]||ot.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*(e[3]==="even"||e[3]==="odd")),e[5]=+(e[7]+e[8]||e[3]==="odd")):e[3]&&ot.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return K.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&$.test(n)&&(t=o(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(nt,rt).toLowerCase();return e==="*"?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=T[e+" "];return t||(t=new RegExp("(^|"+j+")"+e+"("+j+"|$)"))&&T(e,function(e){return t.test(typeof e.className=="string"&&e.className||typeof e.getAttribute!="undefined"&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=ot.attr(r,e);return i==null?t==="!=":t?(i+="",t==="="?i===n:t==="!="?i!==n:t==="^="?n&&i.indexOf(n)===0:t==="*="?n&&i.indexOf(n)>-1:t==="$="?n&&i.slice(-n.length)===n:t==="~="?(" "+i.replace(U," ")+" ").indexOf(n)>-1:t==="|="?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var s=e.slice(0,3)!=="nth",o=e.slice(-4)!=="last",u=t==="of-type";return r===1&&i===0?function(e){return!!e.parentNode}:function(t,n,a){var f,l,c,h,p,d,v=s!==o?"nextSibling":"previousSibling",m=t.parentNode,g=u&&t.nodeName.toLowerCase(),y=!a&&!u;if(m){if(s){while(v){c=t;while(c=c[v])if(u?c.nodeName.toLowerCase()===g:c.nodeType===1)return!1;d=v=e==="only"&&!d&&"nextSibling"}return!0}d=[o?m.firstChild:m.lastChild];if(o&&y){l=m[w]||(m[w]={}),f=l[e]||[],p=f[0]===S&&f[1],h=f[0]===S&&f[2],c=p&&m.childNodes[p];while(c=++p&&c&&c[v]||(h=p=0)||d.pop())if(c.nodeType===1&&++h&&c===t){l[e]=[S,p,h];break}}else if(y&&(f=(t[w]||(t[w]={}))[e])&&f[0]===S)h=f[1];else while(c=++p&&c&&c[v]||(h=p=0)||d.pop())if((u?c.nodeName.toLowerCase()===g:c.nodeType===1)&&++h){y&&((c[w]||(c[w]={}))[e]=[S,h]);if(c===t)break}return h-=i,h===r||h%r===0&&h/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||ot.error("unsupported pseudo: "+e);return i[w]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?at(function(e,n){var r,s=i(e,t),o=s.length;while(o--)r=H(e,s[o]),e[r]=!(n[r]=s[o])}):function(e){return i(e,0,n)}):i}},pseudos:{not:at(function(e){var t=[],n=[],r=u(e.replace(z,"$1"));return r[w]?at(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),t[0]=null,!n.pop()}}),has:at(function(e){return function(t){return ot(e,t).length>0}}),contains:at(function(e){return e=e.replace(nt,rt),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:at(function(e){return J.test(e||"")||ot.error("unsupported lang: "+e),e=e.replace(nt,rt).toLowerCase(),function(t){var n;do if(n=v?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||n.indexOf(e+"-")===0;while((t=t.parentNode)&&t.nodeType===1);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return G.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},text:function(e){var t;return e.nodeName.toLowerCase()==="input"&&e.type==="text"&&((t=e.getAttribute("type"))==null||t.toLowerCase()==="text")},first:dt(function(){return[0]}),last:dt(function(e,t){return[t-1]}),eq:dt(function(e,t,n){return[n<0?n+t:n]}),even:dt(function(e,t){var n=0;for(;n<t;n+=2)e.push(n);return e}),odd:dt(function(e,t){var n=1;for(;n<t;n+=2)e.push(n);return e}),lt:dt(function(e,t,n){var r=n<0?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:dt(function(e,t,n){var r=n<0?n+t:n;for(;++r<t;)e.push(r);return e})}},r.pseudos.nth=r.pseudos.eq;for(t in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=ht(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=pt(t);return mt.prototype=r.filters=r.pseudos,r.setFilters=new mt,o=ot.tokenize=function(e,t){var n,i,s,o,u,a,f,l=N[e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=r.preFilter;while(u){if(!n||(i=W.exec(u)))i&&(u=u.slice(i[0].length)||u),a.push(s=[]);n=!1;if(i=X.exec(u))n=i.shift(),s.push({value:n,type:i[0].replace(z," ")}),u=u.slice(n.length);for(o in r.filter)(i=K[o].exec(u))&&(!f[o]||(i=f[o](i)))&&(n=i.shift(),s.push({value:n,type:o,matches:i}),u=u.slice(n.length));if(!n)break}return t?u.length:u?ot.error(e):N(e,a).slice(0)},u=ot.compile=function(e,t){var n,r=[],i=[],s=C[e+" "];if(!s){t||(t=o(e)),n=t.length;while(n--)s=xt(t[n]),s[w]?r.push(s):i.push(s);s=C(e,Tt(i,r)),s.selector=e}return s},a=ot.select=function(e,t,i,s){var a,f,l,c,h,p=typeof e=="function"&&e,d=!s&&o(e=p.selector||e);i=i||[];if(d.length===1){f=d[0]=d[0].slice(0);if(f.length>2&&(l=f[0]).type==="ID"&&n.getById&&t.nodeType===9&&v&&r.relative[f[1].type]){t=(r.find.ID(l.matches[0].replace(nt,rt),t)||[])[0];if(!t)return i;p&&(t=t.parentNode),e=e.slice(f.shift().value.length)}a=K.needsContext.test(e)?0:f.length;while(a--){l=f[a];if(r.relative[c=l.type])break;if(h=r.find[c])if(s=h(l.matches[0].replace(nt,rt),et.test(f[0].type)&&vt(t.parentNode)||t)){f.splice(a,1),e=s.length&&gt(f);if(!e)return D.apply(i,s),i;break}}}return(p||u(e,d))(s,t,!v,i,et.test(e)&&vt(t.parentNode)||t),i},n.sortStable=w.split("").sort(k).join("")===w,n.detectDuplicates=!!c,h(),n.sortDetached=ft(function(e){return e.compareDocumentPosition(p.createElement("div"))&1}),ft(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild.getAttribute("href")==="#"})||lt("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,t.toLowerCase()==="type"?1:2)}),(!n.attributes||!ft(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),e.firstChild.getAttribute("value")===""}))&&lt("value",function(e,t,n){if(!n&&e.nodeName.toLowerCase()==="input")return e.defaultValue}),ft(function(e){return e.getAttribute("disabled")==null})||lt(B,function(e,t,n){var r;if(!n)return e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),ot}(e);h.find=y,h.expr=y.selectors,h.expr[":"]=h.expr.pseudos,h.unique=y.uniqueSort,h.text=y.getText,h.isXMLDoc=y.isXML,h.contains=y.contains;var b=h.expr.match.needsContext,w=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^.[^:#\[\.,]*$/;h.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),t.length===1&&r.nodeType===1?h.find.matchesSelector(r,e)?[r]:[]:h.find.matches(e,h.grep(t,function(e){return e.nodeType===1}))},h.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if(typeof e!="string")return this.pushStack(h(e).filter(function(){for(t=0;t<i;t++)if(h.contains(r[t],this))return!0}));for(t=0;t<i;t++)h.find(e,r[t],n);return n=this.pushStack(i>1?h.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},filter:function(e){return this.pushStack(S(this,e||[],!1))},not:function(e){return this.pushStack(S(this,e||[],!0))},is:function(e){return!!S(this,typeof e=="string"&&b.test(e)?h(e):e||[],!1).length}});var x,T=e.document,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=h.fn.init=function(e,t){var n,r;if(!e)return this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?n=[null,e,null]:n=N.exec(e);if(n&&(n[1]||!t)){if(n[1]){t=t instanceof h?t[0]:t,h.merge(this,h.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:T,!0));if(w.test(n[1])&&h.isPlainObject(t))for(n in t)h.isFunction(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}r=T.getElementById(n[2]);if(r&&r.parentNode){if(r.id!==n[2])return x.find(e);this.length=1,this[0]=r}return this.context=T,this.selector=e,this}return!t||t.jquery?(t||x).find(e):this.constructor(t).find(e)}return e.nodeType?(this.context=this[0]=e,this.length=1,this):h.isFunction(e)?typeof x.ready!="undefined"?x.ready(e):e(h):(e.selector!==undefined&&(this.selector=e.selector,this.context=e.context),h.makeArray(e,this))};C.prototype=h.fn,x=h(T);var k=/^(?:parents|prev(?:Until|All))/,L={children:!0,contents:!0,next:!0,prev:!0};h.extend({dir:function(e,t,n){var r=[],i=e[t];while(i&&i.nodeType!==9&&(n===undefined||i.nodeType!==1||!h(i).is(n)))i.nodeType===1&&r.push(i),i=i[t];return r},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}}),h.fn.extend({has:function(e){var t,n=h(e,this),r=n.length;return this.filter(function(){for(t=0;t<r;t++)if(h.contains(this,n[t]))return!0})},closest:function(e,t){var n,r=0,i=this.length,s=[],o=b.test(e)||typeof e!="string"?h(e,t||this.context):0;for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(o?o.index(n)>-1:n.nodeType===1&&h.find.matchesSelector(n,e))){s.push(n);break}return this.pushStack(s.length>1?h.unique(s):s)},index:function(e){return e?typeof e=="string"?h.inArray(this[0],h(e)):h.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(h.unique(h.merge(this.get(),h(e,t))))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),h.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return h.dir(e,"parentNode")},parentsUntil:function(e,t,n){return h.dir(e,"parentNode",n)},next:function(e){return A(e,"nextSibling")},prev:function(e){return A(e,"previousSibling")},nextAll:function(e){return h.dir(e,"nextSibling")},prevAll:function(e){return h.dir(e,"previousSibling")},nextUntil:function(e,t,n){return h.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return h.dir(e,"previousSibling",n)},siblings:function(e){return h.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return h.sibling(e.firstChild)},contents:function(e){return h.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:h.merge([],e.childNodes)}},function(e,t){h.fn[e]=function(n,r){var i=h.map(this,t,n);return e.slice(-5)!=="Until"&&(r=n),r&&typeof r=="string"&&(i=h.filter(r,i)),this.length>1&&(L[e]||(i=h.unique(i)),k.test(e)&&(i=i.reverse())),this.pushStack(i)}});var O=/\S+/g,M={};h.Callbacks=function(e){e=typeof e=="string"?M[e]||_(e):h.extend({},e);var t,n,r,i,s,o,u=[],a=!e.once&&[],f=function(c){n=e.memory&&c,r=!0,s=o||0,o=0,i=u.length,t=!0;for(;u&&s<i;s++)if(u[s].apply(c[0],c[1])===!1&&e.stopOnFalse){n=!1;break}t=!1,u&&(a?a.length&&f(a.shift()):n?u=[]:l.disable())},l={add:function(){if(u){var r=u.length;(function s(t){h.each(t,function(t,n){var r=h.type(n);r==="function"?(!e.unique||!l.has(n))&&u.push(n):n&&n.length&&r!=="string"&&s(n)})})(arguments),t?i=u.length:n&&(o=r,f(n))}return this},remove:function(){return u&&h.each(arguments,function(e,n){var r;while((r=h.inArray(n,u,r))>-1)u.splice(r,1),t&&(r<=i&&i--,r<=s&&s--)}),this},has:function(e){return e?h.inArray(e,u)>-1:!!u&&!!u.length},empty:function(){return u=[],i=0,this},disable:function(){return u=a=n=undefined,this},disabled:function(){return!u},lock:function(){return a=undefined,n||l.disable(),this},locked:function(){return!a},fireWith:function(e,n){return u&&(!r||a)&&(n=n||[],n=[e,n.slice?n.slice():n],t?a.push(n):f(n)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l},h.extend({Deferred:function(e){var t=[["resolve","done",h.Callbacks("once memory"),"resolved"],["reject","fail",h.Callbacks("once memory"),"rejected"],["notify","progress",h.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return h.Deferred(function(n){h.each(t,function(t,s){var o=h.isFunction(e[t])&&e[t];i[s[1]](function(){var e=o&&o.apply(this,arguments);e&&h.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s[0]+"With"](this===r?n.promise():this,o?[e]:arguments)})}),e=null}).promise()},promise:function(e){return e!=null?h.extend(e,r):r}},i={};return r.pipe=r.then,h.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=function(){return i[s[0]+"With"](this===i?r:this,arguments),this},i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=r.call(arguments),i=n.length,s=i!==1||e&&h.isFunction(e.promise)?i:0,o=s===1?e:h.Deferred(),u=function(e,t,n){return function(i){t[e]=this,n[e]=arguments.length>1?r.call(arguments):i,n===a?o.notifyWith(t,n):--s||o.resolveWith(t,n)}},a,f,l;if(i>1){a=new Array(i),f=new Array(i),l=new Array(i);for(;t<i;t++)n[t]&&h.isFunction(n[t].promise)?n[t].promise().done(u(t,l,n)).fail(o.reject).progress(u(t,f,a)):--s}return s||o.resolveWith(l,n),o.promise()}});var D;h.fn.ready=function(e){return h.ready.promise().done(e),this},h.extend({isReady:!1,readyWait:1,holdReady:function(e){e?h.readyWait++:h.ready(!0)},ready:function(e){if(e===!0?--h.readyWait:h.isReady)return;if(!T.body)return setTimeout(h.ready);h.isReady=!0;if(e!==!0&&--h.readyWait>0)return;D.resolveWith(T,[h]),h.fn.triggerHandler&&(h(T).triggerHandler("ready"),h(T).off("ready"))}}),h.ready.promise=function(t){if(!D){D=h.Deferred();if(T.readyState==="complete")setTimeout(h.ready);else if(T.addEventListener)T.addEventListener("DOMContentLoaded",H,!1),e.addEventListener("load",H,!1);else{T.attachEvent("onreadystatechange",H),e.attachEvent("onload",H);var n=!1;try{n=e.frameElement==null&&T.documentElement}catch(r){}n&&n.doScroll&&function i(){if(!h.isReady){try{n.doScroll("left")}catch(e){return setTimeout(i,50)}P(),h.ready()}}()}}return D.promise(t)};var B=typeof undefined,j;for(j in h(l))break;l.ownLast=j!=="0",l.inlineBlockNeedsLayout=!1,h(function(){var e,t,n,r;n=T.getElementsByTagName("body")[0];if(!n||!n.style)return;t=T.createElement("div"),r=T.createElement("div"),r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(t),typeof t.style.zoom!==B&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",l.inlineBlockNeedsLayout=e=t.offsetWidth===3,e&&(n.style.zoom=1)),n.removeChild(r)}),function(){var e=T.createElement("div");if(l.deleteExpando==null){l.deleteExpando=!0;try{delete e.test}catch(t){l.deleteExpando=!1}}e=null}(),h.acceptData=function(e){var t=h.noData[(e.nodeName+" ").toLowerCase()],n=+e.nodeType||1;return n!==1&&n!==9?!1:!t||t!==!0&&e.getAttribute("classid")===t};var F=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,I=/([A-Z])/g;h.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?h.cache[e[h.expando]]:e[h.expando],!!e&&!R(e)},data:function(e,t,n){return U(e,t,n)},removeData:function(e,t){return z(e,t)},_data:function(e,t,n){return U(e,t,n,!0)},_removeData:function(e,t){return z(e,t,!0)}}),h.fn.extend({data:function(e,t){var n,r,i,s=this[0],o=s&&s.attributes;if(e===undefined){if(this.length){i=h.data(s);if(s.nodeType===1&&!h._data(s,"parsedAttrs")){n=o.length;while(n--)o[n]&&(r=o[n].name,r.indexOf("data-")===0&&(r=h.camelCase(r.slice(5)),q(s,r,i[r])));h._data(s,"parsedAttrs",!0)}}return i}return typeof e=="object"?this.each(function(){h.data(this,e)}):arguments.length>1?this.each(function(){h.data(this,e,t)}):s?q(s,e,h.data(s,e)):undefined},removeData:function(e){return this.each(function(){h.removeData(this,e)})}}),h.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=h._data(e,t),n&&(!r||h.isArray(n)?r=h._data(e,t,h.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=h.queue(e,t),r=n.length,i=n.shift(),s=h._queueHooks(e,t),o=function(){h.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return h._data(e,n)||h._data(e,n,{empty:h.Callbacks("once memory").add(function(){h._removeData(e,t+"queue"),h._removeData(e,n)})})}}),h.fn.extend({queue:function(e,t){var n=2;return typeof e!="string"&&(t=e,e="fx",n--),arguments.length<n?h.queue(this[0],e):t===undefined?this:this.each(function(){var n=h.queue(this,e,t);h._queueHooks(this,e),e==="fx"&&n[0]!=="inprogress"&&h.dequeue(this,e)})},dequeue:function(e){return this.each(function(){h.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=h.Deferred(),s=this,o=this.length,u=function(){--r||i.resolveWith(s,[s])};typeof e!="string"&&(t=e,e=undefined),e=e||"fx";while(o--)n=h._data(s[o],e+"queueHooks"),n&&n.empty&&(r++,n.empty.add(u));return u(),i.promise(t)}});var W=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,X=["Top","Right","Bottom","Left"],V=function(e,t){return e=t||e,h.css(e,"display")==="none"||!h.contains(e.ownerDocument,e)},$=h.access=function(e,t,n,r,i,s,o){var u=0,a=e.length,f=n==null;if(h.type(n)==="object"){i=!0;for(u in n)h.access(e,t,u,n[u],!0,s,o)}else if(r!==undefined){i=!0,h.isFunction(r)||(o=!0),f&&(o?(t.call(e,r),t=null):(f=t,t=function(e,t,n){return f.call(h(e),n)}));if(t)for(;u<a;u++)t(e[u],n,o?r:r.call(e[u],u,t(e[u],n)))}return i?e:f?t.call(e):a?t(e[0],n):s},J=/^(?:checkbox|radio)$/i;(function(){var e=T.createElement("input"),t=T.createElement("div"),n=T.createDocumentFragment();t.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",l.leadingWhitespace=t.firstChild.nodeType===3,l.tbody=!t.getElementsByTagName("tbody").length,l.htmlSerialize=!!t.getElementsByTagName("link").length,l.html5Clone=T.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",e.type="checkbox",e.checked=!0,n.appendChild(e),l.appendChecked=e.checked,t.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue,n.appendChild(t),t.innerHTML="<input type='radio' checked='checked' name='t'/>",l.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!0,t.attachEvent&&(t.attachEvent("onclick",function(){l.noCloneEvent=!1}),t.cloneNode(!0).click());if(l.deleteExpando==null){l.deleteExpando=!0;try{delete t.test}catch(r){l.deleteExpando=!1}}})(),function(){var t,n,r=T.createElement("div");for(t in{submit:!0,change:!0,focusin:!0})n="on"+t,(l[t+"Bubbles"]=n in e)||(r.setAttribute(n,"t"),l[t+"Bubbles"]=r.attributes[n].expando===!1);r=null}();var K=/^(?:input|select|textarea)$/i,Q=/^key/,G=/^(?:mouse|pointer|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=/^([^.]*)(?:\.(.+)|)$/;h.event={global:{},add:function(e,t,n,r,i){var s,o,u,a,f,l,c,p,d,v,m,g=h._data(e);if(!g)return;n.handler&&(a=n,n=a.handler,i=a.selector),n.guid||(n.guid=h.guid++),(o=g.events)||(o=g.events={}),(l=g.handle)||(l=g.handle=function(e){return typeof h===B||!!e&&h.event.triggered===e.type?undefined:h.event.dispatch.apply(l.elem,arguments)},l.elem=e),t=(t||"").match(O)||[""],u=t.length;while(u--){s=Z.exec(t[u])||[],d=m=s[1],v=(s[2]||"").split(".").sort();if(!d)continue;f=h.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=h.event.special[d]||{},c=h.extend({type:d,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&h.expr.match.needsContext.test(i),namespace:v.join(".")},a);if(!(p=o[d])){p=o[d]=[],p.delegateCount=0;if(!f.setup||f.setup.call(e,r,v,l)===!1)e.addEventListener?e.addEventListener(d,l,!1):e.attachEvent&&e.attachEvent("on"+d,l)}f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),h.event.global[d]=!0}e=null},remove:function(e,t,n,r,i){var s,o,u,a,f,l,c,p,d,v,m,g=h.hasData(e)&&h._data(e);if(!g||!(l=g.events))return;t=(t||"").match(O)||[""],f=t.length;while(f--){u=Z.exec(t[f])||[],d=m=u[1],v=(u[2]||"").split(".").sort();if(!d){for(d in l)h.event.remove(e,d+t[f],n,r,!0);continue}c=h.event.special[d]||{},d=(r?c.delegateType:c.bindType)||d,p=l[d]||[],u=u[2]&&new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=s=p.length;while(s--)o=p[s],(i||m===o.origType)&&(!n||n.guid===o.guid)&&(!u||u.test(o.namespace))&&(!r||r===o.selector||r==="**"&&o.selector)&&(p.splice(s,1),o.selector&&p.delegateCount--,c.remove&&c.remove.call(e,o));a&&!p.length&&((!c.teardown||c.teardown.call(e,v,g.handle)===!1)&&h.removeEvent(e,d,g.handle),delete l[d])}h.isEmptyObject(l)&&(delete g.handle,h._removeData(e,"events"))},trigger:function(t,n,r,i){var s,o,u,a,l,c,p,d=[r||T],v=f.call(t,"type")?t.type:t,m=f.call(t,"namespace")?t.namespace.split("."):[];u=c=r=r||T;if(r.nodeType===3||r.nodeType===8)return;if(Y.test(v+h.event.triggered))return;v.indexOf(".")>=0&&(m=v.split("."),v=m.shift(),m.sort()),o=v.indexOf(":")<0&&"on"+v,t=t[h.expando]?t:new h.Event(v,typeof t=="object"&&t),t.isTrigger=i?2:3,t.namespace=m.join("."),t.namespace_re=t.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=undefined,t.target||(t.target=r),n=n==null?[t]:h.makeArray(n,[t]),l=h.event.special[v]||{};if(!i&&l.trigger&&l.trigger.apply(r,n)===!1)return;if(!i&&!l.noBubble&&!h.isWindow(r)){a=l.delegateType||v,Y.test(a+v)||(u=u.parentNode);for(;u;u=u.parentNode)d.push(u),c=u;c===(r.ownerDocument||T)&&d.push(c.defaultView||c.parentWindow||e)}p=0;while((u=d[p++])&&!t.isPropagationStopped())t.type=p>1?a:l.bindType||v,s=(h._data(u,"events")||{})[t.type]&&h._data(u,"handle"),s&&s.apply(u,n),s=o&&u[o],s&&s.apply&&h.acceptData(u)&&(t.result=s.apply(u,n),t.result===!1&&t.preventDefault());t.type=v;if(!i&&!t.isDefaultPrevented()&&(!l._default||l._default.apply(d.pop(),n)===!1)&&h.acceptData(r)&&o&&r[v]&&!h.isWindow(r)){c=r[o],c&&(r[o]=null),h.event.triggered=v;try{r[v]()}catch(g){}h.event.triggered=undefined,c&&(r[o]=c)}return t.result},dispatch:function(e){e=h.event.fix(e);var t,n,i,s,o,u=[],a=r.call(arguments),f=(h._data(this,"events")||{})[e.type]||[],l=h.event.special[e.type]||{};a[0]=e,e.delegateTarget=this;if(l.preDispatch&&l.preDispatch.call(this,e)===!1)return;u=h.event.handlers.call(this,e,f),t=0;while((s=u[t++])&&!e.isPropagationStopped()){e.currentTarget=s.elem,o=0;while((i=s.handlers[o++])&&!e.isImmediatePropagationStopped())if(!e.namespace_re||e.namespace_re.test(i.namespace))e.handleObj=i,e.data=i.data,n=((h.event.special[i.origType]||{}).handle||i.handler).apply(s.elem,a),n!==undefined&&(e.result=n)===!1&&(e.preventDefault(),e.stopPropagation())}return l.postDispatch&&l.postDispatch.call(this,e),e.result},handlers:function(e,t){var n,r,i,s,o=[],u=t.delegateCount,a=e.target;if(u&&a.nodeType&&(!e.button||e.type!=="click"))for(;a!=this;a=a.parentNode||this)if(a.nodeType===1&&(a.disabled!==!0||e.type!=="click")){i=[];for(s=0;s<u;s++)r=t[s],n=r.selector+" ",i[n]===undefined&&(i[n]=r.needsContext?h(n,this).index(a)>=0:h.find(n,this,null,[a]).length),i[n]&&i.push(r);i.length&&o.push({elem:a,handlers:i})}return u<t.length&&o.push({elem:this,handlers:t.slice(u)}),o},fix:function(e){if(e[h.expando])return e;var t,n,r,i=e.type,s=e,o=this.fixHooks[i];o||(this.fixHooks[i]=o=G.test(i)?this.mouseHooks:Q.test(i)?this.keyHooks:{}),r=o.props?this.props.concat(o.props):this.props,e=new h.Event(s),t=r.length;while(t--)n=r[t],e[n]=s[n];return e.target||(e.target=s.srcElement||T),e.target.nodeType===3&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,o.filter?o.filter(e,s):e},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(e,t){return e.which==null&&(e.which=t.charCode!=null?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,r,i,s=t.button,o=t.fromElement;return e.pageX==null&&t.clientX!=null&&(r=e.target.ownerDocument||T,i=r.documentElement,n=r.body,e.pageX=t.clientX+(i&&i.scrollLeft||n&&n.scrollLeft||0)-(i&&i.clientLeft||n&&n.clientLeft||0),e.pageY=t.clientY+(i&&i.scrollTop||n&&n.scrollTop||0)-(i&&i.clientTop||n&&n.clientTop||0)),!e.relatedTarget&&o&&(e.relatedTarget=o===e.target?t.toElement:o),!e.which&&s!==undefined&&(e.which=s&1?1:s&2?3:s&4?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==nt()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){if(this===nt()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if(h.nodeName(this,"input")&&this.type==="checkbox"&&this.click)return this.click(),!1},_default:function(e){return h.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==undefined&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=h.extend(new h.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?h.event.trigger(i,null,t):h.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},h.removeEvent=T.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===B&&(e[r]=null),e.detachEvent(r,n))},h.Event=function(e,t){if(!(this instanceof h.Event))return new h.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.defaultPrevented===undefined&&e.returnValue===!1?et:tt):this.type=e,t&&h.extend(this,t),this.timeStamp=e&&e.timeStamp||h.now(),this[h.expando]=!0},h.Event.prototype={isDefaultPrevented:tt,isPropagationStopped:tt,isImmediatePropagationStopped:tt,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=et;if(!e)return;e.preventDefault?e.preventDefault():e.returnValue=!1},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=et;if(!e)return;e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=et,e&&e.stopImmediatePropagation&&e.stopImmediatePropagation(),this.stopPropagation()}},h.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){h.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,s=e.handleObj;if(!i||i!==r&&!h.contains(r,i))e.type=s.origType,n=s.handler.apply(this,arguments),e.type=t;return n}}}),l.submitBubbles||(h.event.special.submit={setup:function(){if(h.nodeName(this,"form"))return!1;h.event.add(this,"click._submit keypress._submit",function(e){var t=e.target,n=h.nodeName(t,"input")||h.nodeName(t,"button")?t.form:undefined;n&&!h._data(n,"submitBubbles")&&(h.event.add(n,"submit._submit",function(e){e._submit_bubble=!0}),h._data(n,"submitBubbles",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&h.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){if(h.nodeName(this,"form"))return!1;h.event.remove(this,"._submit")}}),l.changeBubbles||(h.event.special.change={setup:function(){if(K.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")h.event.add(this,"propertychange._change",function(e){e.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),h.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),h.event.simulate("change",this,e,!0)});return!1}h.event.add(this,"beforeactivate._change",function(e){var t=e.target;K.test(t.nodeName)&&!h._data(t,"changeBubbles")&&(h.event.add(t,"change._change",function(e){this.parentNode&&!e.isSimulated&&!e.isTrigger&&h.event.simulate("change",this.parentNode,e,!0)}),h._data(t,"changeBubbles",!0))})},handle:function(e){var t=e.target;if(this!==t||e.isSimulated||e.isTrigger||t.type!=="radio"&&t.type!=="checkbox")return e.handleObj.handler.apply(this,arguments)},teardown:function(){return h.event.remove(this,"._change"),!K.test(this.nodeName)}}),l.focusinBubbles||h.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){h.event.simulate(t,e.target,h.event.fix(e),!0)};h.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=h._data(r,t);i||r.addEventListener(e,n,!0),h._data(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=h._data(r,t)-1;i?h._data(r,t,i):(r.removeEventListener(e,n,!0),h._removeData(r,t))}}}),h.fn.extend({on:function(e,t,n,r,i){var s,o;if(typeof e=="object"){typeof t!="string"&&(n=n||t,t=undefined);for(s in e)this.on(s,t,n,e[s],i);return this}n==null&&r==null?(r=t,n=t=undefined):r==null&&(typeof t=="string"?(r=n,n=undefined):(r=n,n=t,t=undefined));if(r===!1)r=tt;else if(!r)return this;return i===1&&(o=r,r=function(e){return h().off(e),o.apply(this,arguments)},r.guid=o.guid||(o.guid=h.guid++)),this.each(function(){h.event.add(this,e,r,n,t)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,h(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if(typeof e=="object"){for(i in e)this.off(i,t,e[i]);return this}if(t===!1||typeof t=="function")n=t,t=undefined;return n===!1&&(n=tt),this.each(function(){h.event.remove(this,e,n,t)})},trigger:function(e,t){return this.each(function(){h.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return h.event.trigger(e,t,n,!0)}});var it="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",st=/ jQuery\d+="(?:null|\d+)"/g,ot=new RegExp("<(?:"+it+")[\\s/>]","i"),ut=/^\s+/,at=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ft=/<([\w:]+)/,lt=/<tbody/i,ct=/<|&#?\w+;/,ht=/<(?:script|style|link)/i,pt=/checked\s*(?:[^=]|=\s*.checked.)/i,dt=/^$|\/(?:java|ecma)script/i,vt=/^true\/(.*)/,mt=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,gt={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:l.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},yt=rt(T),bt=yt.appendChild(T.createElement("div"));gt.optgroup=gt.option,gt.tbody=gt.tfoot=gt.colgroup=gt.caption=gt.thead,gt.th=gt.td,h.extend({clone:function(e,t,n){var r,i,s,o,u,a=h.contains(e.ownerDocument,e);l.html5Clone||h.isXMLDoc(e)||!ot.test("<"+e.nodeName+">")?s=e.cloneNode(!0):(bt.innerHTML=e.outerHTML,bt.removeChild(s=bt.firstChild));if((!l.noCloneEvent||!l.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!h.isXMLDoc(e)){r=wt(s),u=wt(e);for(o=0;(i=u[o])!=null;++o)r[o]&&kt(i,r[o])}if(t)if(n){u=u||wt(e),r=r||wt(s);for(o=0;(i=u[o])!=null;o++)Ct(i,r[o])}else Ct(e,s);return r=wt(s,"script"),r.length>0&&Nt(r,!a&&wt(e,"script")),r=u=i=null,s},buildFragment:function(e,t,n,r){var i,s,o,u,a,f,c,p=e.length,d=rt(t),v=[],m=0;for(;m<p;m++){s=e[m];if(s||s===0)if(h.type(s)==="object")h.merge(v,s.nodeType?[s]:s);else if(!ct.test(s))v.push(t.createTextNode(s));else{u=u||d.appendChild(t.createElement("div")),a=(ft.exec(s)||["",""])[1].toLowerCase(),c=gt[a]||gt._default,u.innerHTML=c[1]+s.replace(at,"<$1></$2>")+c[2],i=c[0];while(i--)u=u.lastChild;!l.leadingWhitespace&&ut.test(s)&&v.push(t.createTextNode(ut.exec(s)[0]));if(!l.tbody){s=a==="table"&&!lt.test(s)?u.firstChild:c[1]==="<table>"&&!lt.test(s)?u:0,i=s&&s.childNodes.length;while(i--)h.nodeName(f=s.childNodes[i],"tbody")&&!f.childNodes.length&&s.removeChild(f)}h.merge(v,u.childNodes),u.textContent="";while(u.firstChild)u.removeChild(u.firstChild);u=d.lastChild}}u&&d.removeChild(u),l.appendChecked||h.grep(wt(v,"input"),Et),m=0;while(s=v[m++]){if(r&&h.inArray(s,r)!==-1)continue;o=h.contains(s.ownerDocument,s),u=wt(d.appendChild(s),"script"),o&&Nt(u);if(n){i=0;while(s=u[i++])dt.test(s.type||"")&&n.push(s)}}return u=null,d},cleanData:function(e,t){var r,i,s,o,u=0,a=h.expando,f=h.cache,c=l.deleteExpando,p=h.event.special;for(;(r=e[u])!=null;u++)if(t||h.acceptData(r)){s=r[a],o=s&&f[s];if(o){if(o.events)for(i in o.events)p[i]?h.event.remove(r,i):h.removeEvent(r,i,o.handle);f[s]&&(delete f[s],c?delete r[a]:typeof r.removeAttribute!==B?r.removeAttribute(a):r[a]=null,n.push(s))}}}}),h.fn.extend({text:function(e){return $(this,function(e){return e===undefined?h.text(this):this.empty().append((this[0]&&this[0].ownerDocument||T).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var t=St(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var t=St(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?h.filter(e,this):this,i=0;for(;(n=r[i])!=null;i++)!t&&n.nodeType===1&&h.cleanData(wt(n)),n.parentNode&&(t&&h.contains(n.ownerDocument,n)&&Nt(wt(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&h.cleanData(wt(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&h.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return h.clone(this,e,t)})},html:function(e){return $(this,function(e){var t=this[0]||{},n=0,r=this.length;if(e===undefined)return t.nodeType===1?t.innerHTML.replace(st,""):undefined;if(typeof e=="string"&&!ht.test(e)&&(l.htmlSerialize||!ot.test(e))&&(l.leadingWhitespace||!ut.test(e))&&!gt[(ft.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(at,"<$1></$2>");try{for(;n<r;n++)t=this[n]||{},t.nodeType===1&&(h.cleanData(wt(t,!1)),t.innerHTML=e);t=0}catch(i){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=arguments[0];return this.domManip(arguments,function(t){e=this.parentNode,h.cleanData(wt(this)),e&&e.replaceChild(t,this)}),e&&(e.length||e.nodeType)?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t){e=i.apply([],e);var n,r,s,o,u,a,f=0,c=this.length,p=this,d=c-1,v=e[0],m=h.isFunction(v);if(m||c>1&&typeof v=="string"&&!l.checkClone&&pt.test(v))return this.each(function(n){var r=p.eq(n);m&&(e[0]=v.call(this,n,r.html())),r.domManip(e,t)});if(c){a=h.buildFragment(e,this[0].ownerDocument,!1,this),n=a.firstChild,a.childNodes.length===1&&(a=n);if(n){o=h.map(wt(a,"script"),xt),s=o.length;for(;f<c;f++)r=a,f!==d&&(r=h.clone(r,!0,!0),s&&h.merge(o,wt(r,"script"))),t.call(this[f],r,f);if(s){u=o[o.length-1].ownerDocument,h.map(o,Tt);for(f=0;f<s;f++)r=o[f],dt.test(r.type||"")&&!h._data(r,"globalEval")&&h.contains(u,r)&&(r.src?h._evalUrl&&h._evalUrl(r.src):h.globalEval((r.text||r.textContent||r.innerHTML||"").replace(mt,"")))}a=n=null}}return this}}),h.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){h.fn[e]=function(e){var n,r=0,i=[],o=h(e),u=o.length-1;for(;r<=u;r++)n=r===u?this:this.clone(!0),h(o[r])[t](n),s.apply(i,n.get());return this.pushStack(i)}});var Lt,At={};(function(){var e;l.shrinkWrapBlocks=function(){if(e!=null)return e;e=!1;var t,n,r;n=T.getElementsByTagName("body")[0];if(!n||!n.style)return;return t=T.createElement("div"),r=T.createElement("div"),r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(t),typeof t.style.zoom!==B&&(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(T.createElement("div")).style.width="5px",e=t.offsetWidth!==3),n.removeChild(r),e}})();var _t=/^margin/,Dt=new RegExp("^("+W+")(?!px)[a-z%]+$","i"),Pt,Ht,Bt=/^(top|right|bottom|left)$/;e.getComputedStyle?(Pt=function(t){return t.ownerDocument.defaultView.opener?t.ownerDocument.defaultView.getComputedStyle(t,null):e.getComputedStyle(t,null)},Ht=function(e,t,n){var r,i,s,o,u=e.style;return n=n||Pt(e),o=n?n.getPropertyValue(t)||n[t]:undefined,n&&(o===""&&!h.contains(e.ownerDocument,e)&&(o=h.style(e,t)),Dt.test(o)&&_t.test(t)&&(r=u.width,i=u.minWidth,s=u.maxWidth,u.minWidth=u.maxWidth=u.width=o,o=n.width,u.width=r,u.minWidth=i,u.maxWidth=s)),o===undefined?o:o+""}):T.documentElement.currentStyle&&(Pt=function(e){return e.currentStyle},Ht=function(e,t,n){var r,i,s,o,u=e.style;return n=n||Pt(e),o=n?n[t]:undefined,o==null&&u&&u[t]&&(o=u[t]),Dt.test(o)&&!Bt.test(t)&&(r=u.left,i=e.runtimeStyle,s=i&&i.left,s&&(i.left=e.currentStyle.left),u.left=t==="fontSize"?"1em":o,o=u.pixelLeft+"px",u.left=r,s&&(i.left=s)),o===undefined?o:o+""||"auto"}),function(){function a(){var t,n,r,a;n=T.getElementsByTagName("body")[0];if(!n||!n.style)return;t=T.createElement("div"),r=T.createElement("div"),r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(t),t.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",i=s=!1,u=!0,e.getComputedStyle&&(i=(e.getComputedStyle(t,null)||{}).top!=="1%",s=(e.getComputedStyle(t,null)||{width:"4px"}).width==="4px",a=t.appendChild(T.createElement("div")),a.style.cssText=t.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",a.style.marginRight=a.style.width="0",t.style.width="1px",u=!parseFloat((e.getComputedStyle(a,null)||{}).marginRight),t.removeChild(a)),t.innerHTML="<table><tr><td></td><td>t</td></tr></table>",a=t.getElementsByTagName("td"),a[0].style.cssText="margin:0;border:0;padding:0;display:none",o=a[0].offsetHeight===0,o&&(a[0].style.display="",a[1].style.display="none",o=a[0].offsetHeight===0),n.removeChild(r)}var t,n,r,i,s,o,u;t=T.createElement("div"),t.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",r=t.getElementsByTagName("a")[0],n=r&&r.style;if(!n)return;n.cssText="float:left;opacity:.5",l.opacity=n.opacity==="0.5",l.cssFloat=!!n.cssFloat,t.style.backgroundClip="content-box",t.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle=t.style.backgroundClip==="content-box",l.boxSizing=n.boxSizing===""||n.MozBoxSizing===""||n.WebkitBoxSizing==="",h.extend(l,{reliableHiddenOffsets:function(){return o==null&&a(),o},boxSizingReliable:function(){return s==null&&a(),s},pixelPosition:function(){return i==null&&a(),i},reliableMarginRight:function(){return u==null&&a(),u}})}(),h.swap=function(e,t,n,r){var i,s,o={};for(s in t)o[s]=e.style[s],e.style[s]=t[s];i=n.apply(e,r||[]);for(s in t)e.style[s]=o[s];return i};var Ft=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,qt=/^(none|table(?!-c[ea]).+)/,Rt=new RegExp("^("+W+")(.*)$","i"),Ut=new RegExp("^([+-])=("+W+")","i"),zt={position:"absolute",visibility:"hidden",display:"block"},Wt={letterSpacing:"0",fontWeight:"400"},Xt=["Webkit","O","Moz","ms"];h.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Ht(e,"opacity");return n===""?"1":n}}}},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":l.cssFloat?"cssFloat":"styleFloat"},style:function(e,t,n,r){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var i,s,o,u=h.camelCase(t),a=e.style;t=h.cssProps[u]||(h.cssProps[u]=Vt(a,u)),o=h.cssHooks[t]||h.cssHooks[u];if(n===undefined)return o&&"get"in o&&(i=o.get(e,!1,r))!==undefined?i:a[t];s=typeof n,s==="string"&&(i=Ut.exec(n))&&(n=(i[1]+1)*i[2]+parseFloat(h.css(e,t)),s="number");if(n==null||n!==n)return;s==="number"&&!h.cssNumber[u]&&(n+="px"),!l.clearCloneStyle&&n===""&&t.indexOf("background")===0&&(a[t]="inherit");if(!o||!("set"in o)||(n=o.set(e,n,r))!==undefined)try{a[t]=n}catch(f){}},css:function(e,t,n,r){var i,s,o,u=h.camelCase(t);return t=h.cssProps[u]||(h.cssProps[u]=Vt(e.style,u)),o=h.cssHooks[t]||h.cssHooks[u],o&&"get"in o&&(s=o.get(e,!0,n)),s===undefined&&(s=Ht(e,t,r)),s==="normal"&&t in Wt&&(s=Wt[t]),n===""||n?(i=parseFloat(s),n===!0||h.isNumeric(i)?i||0:s):s}}),h.each(["height","width"],function(e,t){h.cssHooks[t]={get:function(e,n,r){if(n)return qt.test(h.css(e,"display"))&&e.offsetWidth===0?h.swap(e,zt,function(){return Qt(e,t,r)}):Qt(e,t,r)},set:function(e,n,r){var i=r&&Pt(e);return Jt(e,n,r?Kt(e,t,r,l.boxSizing&&h.css(e,"boxSizing",!1,i)==="border-box",i):0)}}}),l.opacity||(h.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=h.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if((t>=1||t==="")&&h.trim(s.replace(Ft,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(t===""||r&&!r.filter)return}n.filter=Ft.test(s)?s.replace(Ft,i):s+" "+i}}),h.cssHooks.marginRight=jt(l.reliableMarginRight,function(e,t){if(t)return h.swap(e,{display:"inline-block"},Ht,[e,"marginRight"])}),h.each({margin:"",padding:"",border:"Width"},function(e,t){h.cssHooks[e+t]={expand:function(n){var r=0,i={},s=typeof n=="string"?n.split(" "):[n];for(;r<4;r++)i[e+X[r]+t]=s[r]||s[r-2]||s[0];return i}},_t.test(e)||(h.cssHooks[e+t].set=Jt)}),h.fn.extend({css:function(e,t){return $(this,function(e,t,n){var r,i,s={},o=0;if(h.isArray(t)){r=Pt(e),i=t.length;for(;o<i;o++)s[t[o]]=h.css(e,t[o],!1,r);return s}return n!==undefined?h.style(e,t,n):h.css(e,t)},e,t,arguments.length>1)},show:function(){return $t(this,!0)},hide:function(){return $t(this)},toggle:function(e){return typeof e=="boolean"?e?this.show():this.hide():this.each(function(){V(this)?h(this).show():h(this).hide()})}}),h.Tween=Gt,Gt.prototype={constructor:Gt,init:function(e,t,n,r,i,s){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=s||(h.cssNumber[n]?"":"px")},cur:function(){var e=Gt.propHooks[this.prop];return e&&e.get?e.get(this):Gt.propHooks._default.get(this)},run:function(e){var t,n=Gt.propHooks[this.prop];return this.options.duration?this.pos=t=h.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Gt.propHooks._default.set(this),this}},Gt.prototype.init.prototype=Gt.prototype,Gt.propHooks={_default:{get:function(e){var t;return e.elem[e.prop]==null||!!e.elem.style&&e.elem.style[e.prop]!=null?(t=h.css(e.elem,e.prop,""),!t||t==="auto"?0:t):e.elem[e.prop]},set:function(e){h.fx.step[e.prop]?h.fx.step[e.prop](e):e.elem.style&&(e.elem.style[h.cssProps[e.prop]]!=null||h.cssHooks[e.prop])?h.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},Gt.propHooks.scrollTop=Gt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},h.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},h.fx=Gt.prototype.init,h.fx.step={};var Yt,Zt,en=/^(?:toggle|show|hide)$/,tn=new RegExp("^(?:([+-])=|)("+W+")([a-z%]*)$","i"),nn=/queueHooks$/,rn=[fn],sn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=tn.exec(t),s=i&&i[3]||(h.cssNumber[e]?"":"px"),o=(h.cssNumber[e]||s!=="px"&&+r)&&tn.exec(h.css(n.elem,e)),u=1,a=20;if(o&&o[3]!==s){s=s||o[3],i=i||[],o=+r||1;do u=u||".5",o/=u,h.style(n.elem,e,o+s);while(u!==(u=n.cur()/r)&&u!==1&&--a)}return i&&(o=n.start=+o||+r||0,n.unit=s,n.end=i[1]?o+(i[1]+1)*i[2]:+i[2]),n}]};h.Animation=h.extend(cn,{tweener:function(e,t){h.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r<i;r++)n=e[r],sn[n]=sn[n]||[],sn[n].unshift(t)},prefilter:function(e,t){t?rn.unshift(e):rn.push(e)}}),h.speed=function(e,t,n){var r=e&&typeof e=="object"?h.extend({},e):{complete:n||!n&&t||h.isFunction(e)&&e,duration:e,easing:n&&t||t&&!h.isFunction(t)&&t};r.duration=h.fx.off?0:typeof r.duration=="number"?r.duration:r.duration in h.fx.speeds?h.fx.speeds[r.duration]:h.fx.speeds._default;if(r.queue==null||r.queue===!0)r.queue="fx";return r.old=r.complete,r.complete=function(){h.isFunction(r.old)&&r.old.call(this),r.queue&&h.dequeue(this,r.queue)},r},h.fn.extend({fadeTo:function(e,t,n,r){return this.filter(V).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=h.isEmptyObject(e),s=h.speed(t,n,r),o=function(){var t=cn(this,h.extend({},e),s);(i||h._data(this,"finish"))&&t.stop(!0)};return o.finish=o,i||s.queue===!1?this.each(o):this.queue(s.queue,o)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return typeof e!="string"&&(n=t,t=e,e=undefined),t&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=e!=null&&e+"queueHooks",s=h.timers,o=h._data(this);if(i)o[i]&&o[i].stop&&r(o[i]);else for(i in o)o[i]&&o[i].stop&&nn.test(i)&&r(o[i]);for(i=s.length;i--;)s[i].elem===this&&(e==null||s[i].queue===e)&&(s[i].anim.stop(n),t=!1,s.splice(i,1));(t||!n)&&h.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=h._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],s=h.timers,o=r?r.length:0;n.finish=!0,h.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0);for(t=s.length;t--;)s[t].elem===this&&s[t].queue===e&&(s[t].anim.stop(!0),s.splice(t,1));for(t=0;t<o;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),h.each(["toggle","show","hide"],function(e,t){var n=h.fn[t];h.fn[t]=function(e,r,i){return e==null||typeof e=="boolean"?n.apply(this,arguments):this.animate(un(t,!0),e,r,i)}}),h.each({slideDown:un("show"),slideUp:un("hide"),slideToggle:un("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){h.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),h.timers=[],h.fx.tick=function(){var e,t=h.timers,n=0;Yt=h.now();for(;n<t.length;n++)e=t[n],!e()&&t[n]===e&&t.splice(n--,1);t.length||h.fx.stop(),Yt=undefined},h.fx.timer=function(e){h.timers.push(e),e()?h.fx.start():h.timers.pop()},h.fx.interval=13,h.fx.start=function(){Zt||(Zt=setInterval(h.fx.tick,h.fx.interval))},h.fx.stop=function(){clearInterval(Zt),Zt=null},h.fx.speeds={slow:600,fast:200,_default:400},h.fn.delay=function(e,t){return e=h.fx?h.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},function(){var e,t,n,r,i;t=T.createElement("div"),t.setAttribute("className","t"),t.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",r=t.getElementsByTagName("a")[0],n=T.createElement("select"),i=n.appendChild(T.createElement("option")),e=t.getElementsByTagName("input")[0],r.style.cssText="top:1px",l.getSetAttribute=t.className!=="t",l.style=/top/.test(r.getAttribute("style")),l.hrefNormalized=r.getAttribute("href")==="/a",l.checkOn=!!e.value,l.optSelected=i.selected,l.enctype=!!T.createElement("form").enctype,n.disabled=!0,l.optDisabled=!i.disabled,e=T.createElement("input"),e.setAttribute("value",""),l.input=e.getAttribute("value")==="",e.value="t",e.setAttribute("type","radio"),l.radioValue=e.value==="t"}();var hn=/\r/g;h.fn.extend({val:function(e){var t,n,r,i=this[0];if(!arguments.length){if(i)return t=h.valHooks[i.type]||h.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&(n=t.get(i,"value"))!==undefined?n:(n=i.value,typeof n=="string"?n.replace(hn,""):n==null?"":n);return}return r=h.isFunction(e),this.each(function(n){var i;if(this.nodeType!==1)return;r?i=e.call(this,n,h(this).val()):i=e,i==null?i="":typeof i=="number"?i+="":h.isArray(i)&&(i=h.map(i,function(e){return e==null?"":e+""})),t=h.valHooks[this.type]||h.valHooks[this.nodeName.toLowerCase()];if(!t||!("set"in t)||t.set(this,i,"value")===undefined)this.value=i})}}),h.extend({valHooks:{option:{get:function(e){var t=h.find.attr(e,"value");return t!=null?t:h.trim(h.text(e))}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a<u;a++){n=r[a];if((n.selected||a===i)&&(l.optDisabled?!n.disabled:n.getAttribute("disabled")===null)&&(!n.parentNode.disabled||!h.nodeName(n.parentNode,"optgroup"))){t=h(n).val();if(s)return t;o.push(t)}}return o},set:function(e,t){var n,r,i=e.options,s=h.makeArray(t),o=i.length;while(o--){r=i[o];if(h.inArray(h.valHooks.option.get(r),s)>=0)try{r.selected=n=!0}catch(u){r.scrollHeight}else r.selected=!1}return n||(e.selectedIndex=-1),i}}}}),h.each(["radio","checkbox"],function(){h.valHooks[this]={set:function(e,t){if(h.isArray(t))return e.checked=h.inArray(h(e).val(),t)>=0}},l.checkOn||(h.valHooks[this].get=function(e){return e.getAttribute("value")===null?"on":e.value})});var pn,dn,vn=h.expr.attrHandle,mn=/^(?:checked|selected)$/i,gn=l.getSetAttribute,yn=l.input;h.fn.extend({attr:function(e,t){return $(this,h.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){h.removeAttr(this,e)})}}),h.extend({attr:function(e,t,n){var r,i,s=e.nodeType;if(!e||s===3||s===8||s===2)return;if(typeof e.getAttribute===B)return h.prop(e,t,n);if(s!==1||!h.isXMLDoc(e))t=t.toLowerCase(),r=h.attrHooks[t]||(h.expr.match.bool.test(t)?dn:pn);if(n===undefined)return r&&"get"in r&&(i=r.get(e,t))!==null?i:(i=h.find.attr(e,t),i==null?undefined:i);if(n!==null)return r&&"set"in r&&(i=r.set(e,n,t))!==undefined?i:(e.setAttribute(t,n+""),n);h.removeAttr(e,t)},removeAttr:function(e,t){var n,r,i=0,s=t&&t.match(O);if(s&&e.nodeType===1)while(n=s[i++])r=h.propFix[n]||n,h.expr.match.bool.test(n)?yn&&gn||!mn.test(n)?e[r]=!1:e[h.camelCase("default-"+n)]=e[r]=!1:h.attr(e,n,""),e.removeAttribute(gn?n:r)},attrHooks:{type:{set:function(e,t){if(!l.radioValue&&t==="radio"&&h.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}}}),dn={set:function(e,t,n){return t===!1?h.removeAttr(e,n):yn&&gn||!mn.test(n)?e.setAttribute(!gn&&h.propFix[n]||n,n):e[h.camelCase("default-"+n)]=e[n]=!0,n}},h.each(h.expr.match.bool.source.match(/\w+/g),function(e,t){var n=vn[t]||h.find.attr;vn[t]=yn&&gn||!mn.test(t)?function(e,t,r){var i,s;return r||(s=vn[t],vn[t]=i,i=n(e,t,r)!=null?t.toLowerCase():null,vn[t]=s),i}:function(e,t,n){if(!n)return e[h.camelCase("default-"+t)]?t.toLowerCase():null}});if(!yn||!gn)h.attrHooks.value={set:function(e,t,n){if(!h.nodeName(e,"input"))return pn&&pn.set(e,t,n);e.defaultValue=t}};gn||(pn={set:function(e,t,n){var r=e.getAttributeNode(n);r||e.setAttributeNode(r=e.ownerDocument.createAttribute(n)),r.value=t+="";if(n==="value"||t===e.getAttribute(n))return t}},vn.id=vn.name=vn.coords=function(e,t,n){var r;if(!n)return(r=e.getAttributeNode(t))&&r.value!==""?r.value:null},h.valHooks.button={get:function(e,t){var n=e.getAttributeNode(t);if(n&&n.specified)return n.value},set:pn.set},h.attrHooks.contenteditable={set:function(e,t,n){pn.set(e,t===""?!1:t,n)}},h.each(["width","height"],function(e,t){h.attrHooks[t]={set:function(e,n){if(n==="")return e.setAttribute(t,"auto"),n}}})),l.style||(h.attrHooks.style={get:function(e){return e.style.cssText||undefined},set:function(e,t){return e.style.cssText=t+""}});var bn=/^(?:input|select|textarea|button|object)$/i,wn=/^(?:a|area)$/i;h.fn.extend({prop:function(e,t){return $(this,h.prop,e,t,arguments.length>1)},removeProp:function(e){return e=h.propFix[e]||e,this.each(function(){try{this[e]=undefined,delete this[e]}catch(t){}})}}),h.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(e,t,n){var r,i,s,o=e.nodeType;if(!e||o===3||o===8||o===2)return;return s=o!==1||!h.isXMLDoc(e),s&&(t=h.propFix[t]||t,i=h.propHooks[t]),n!==undefined?i&&"set"in i&&(r=i.set(e,n,t))!==undefined?r:e[t]=n:i&&"get"in i&&(r=i.get(e,t))!==null?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=h.find.attr(e,"tabindex");return t?parseInt(t,10):bn.test(e.nodeName)||wn.test(e.nodeName)&&e.href?0:-1}}}}),l.hrefNormalized||h.each(["href","src"],function(e,t){h.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),l.optSelected||(h.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),h.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){h.propFix[this.toLowerCase()]=this}),l.enctype||(h.propFix.enctype="encoding");var En=/[\t\r\n\f]/g;h.fn.extend({addClass:function(e){var t,n,r,i,s,o,u=0,a=this.length,f=typeof e=="string"&&e;if(h.isFunction(e))return this.each(function(t){h(this).addClass(e.call(this,t,this.className))});if(f){t=(e||"").match(O)||[];for(;u<a;u++){n=this[u],r=n.nodeType===1&&(n.className?(" "+n.className+" ").replace(En," "):" ");if(r){s=0;while(i=t[s++])r.indexOf(" "+i+" ")<0&&(r+=i+" ");o=h.trim(r),n.className!==o&&(n.className=o)}}}return this},removeClass:function(e){var t,n,r,i,s,o,u=0,a=this.length,f=arguments.length===0||typeof e=="string"&&e;if(h.isFunction(e))return this.each(function(t){h(this).removeClass(e.call(this,t,this.className))});if(f){t=(e||"").match(O)||[];for(;u<a;u++){n=this[u],r=n.nodeType===1&&(n.className?(" "+n.className+" ").replace(En," "):"");if(r){s=0;while(i=t[s++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");o=e?h.trim(r):"",n.className!==o&&(n.className=o)}}}return this},toggleClass:function(e,t){var n=typeof e;return typeof t=="boolean"&&n==="string"?t?this.addClass(e):this.removeClass(e):h.isFunction(e)?this.each(function(n){h(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var t,r=0,i=h(this),s=e.match(O)||[];while(t=s[r++])i.hasClass(t)?i.removeClass(t):i.addClass(t)}else if(n===B||n==="boolean")this.className&&h._data(this,"__className__",this.className),this.className=this.className||e===!1?"":h._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n<r;n++)if(this[n].nodeType===1&&(" "+this[n].className+" ").replace(En," ").indexOf(t)>=0)return!0;return!1}}),h.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(e,t){h.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),h.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return arguments.length===1?this.off(e,"**"):this.off(t,e||"**",n)}});var Sn=h.now(),xn=/\?/,Tn=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;h.parseJSON=function(t){if(e.JSON&&e.JSON.parse)return e.JSON.parse(t+"");var n,r=null,i=h.trim(t+"");return i&&!h.trim(i.replace(Tn,function(e,t,i,s){return n&&t&&(r=0),r===0?e:(n=i||t,r+=!s-!i,"")}))?Function("return "+i)():h.error("Invalid JSON: "+t)},h.parseXML=function(t){var n,r;if(!t||typeof t!="string")return null;try{e.DOMParser?(r=new DOMParser,n=r.parseFromString(t,"text/xml")):(n=new ActiveXObject("Microsoft.XMLDOM"),n.async="false",n.loadXML(t))}catch(i){n=undefined}return(!n||!n.documentElement||n.getElementsByTagName("parsererror").length)&&h.error("Invalid XML: "+t),n};var Nn,Cn,kn=/#.*$/,Ln=/([?&])_=[^&]*/,An=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,On=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Mn=/^(?:GET|HEAD)$/,_n=/^\/\//,Dn=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Pn={},Hn={},Bn="*/".concat("*");try{Cn=location.href}catch(jn){Cn=T.createElement("a"),Cn.href="",Cn=Cn.href}Nn=Dn.exec(Cn.toLowerCase())||[],h.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Cn,type:"GET",isLocal:On.test(Nn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Bn,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":h.parseJSON,"text xml":h.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?qn(qn(e,h.ajaxSettings),t):qn(h.ajaxSettings,e)},ajaxPrefilter:Fn(Pn),ajaxTransport:Fn(Hn),ajax:function(e,t){function x(e,t,n,r){var f,g,y,w,S,x=t;if(b===2)return;b=2,o&&clearTimeout(o),a=undefined,s=r||"",E.readyState=e>0?4:0,f=e>=200&&e<300||e===304,n&&(w=Rn(l,E,n)),w=Un(l,w,E,f);if(f)l.ifModified&&(S=E.getResponseHeader("Last-Modified"),S&&(h.lastModified[i]=S),S=E.getResponseHeader("etag"),S&&(h.etag[i]=S)),e===204||l.type==="HEAD"?x="nocontent":e===304?x="notmodified":(x=w.state,g=w.data,y=w.error,f=!y);else{y=x;if(e||!x)x="error",e<0&&(e=0)}E.status=e,E.statusText=(t||x)+"",f?d.resolveWith(c,[g,x,E]):d.rejectWith(c,[E,x,y]),E.statusCode(m),m=undefined,u&&p.trigger(f?"ajaxSuccess":"ajaxError",[E,l,f?g:y]),v.fireWith(c,[E,x]),u&&(p.trigger("ajaxComplete",[E,l]),--h.active||h.event.trigger("ajaxStop"))}typeof e=="object"&&(t=e,e=undefined),t=t||{};var n,r,i,s,o,u,a,f,l=h.ajaxSetup({},t),c=l.context||l,p=l.context&&(c.nodeType||c.jquery)?h(c):h.event,d=h.Deferred(),v=h.Callbacks("once memory"),m=l.statusCode||{},g={},y={},b=0,w="canceled",E={readyState:0,getResponseHeader:function(e){var t;if(b===2){if(!f){f={};while(t=An.exec(s))f[t[1].toLowerCase()]=t[2]}t=f[e.toLowerCase()]}return t==null?null:t},getAllResponseHeaders:function(){return b===2?s:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=y[n]=y[n]||e,g[e]=t),this},overrideMimeType:function(e){return b||(l.mimeType=e),this},statusCode:function(e){var t;if(e)if(b<2)for(t in e)m[t]=[m[t],e[t]];else E.always(e[E.status]);return this},abort:function(e){var t=e||w;return a&&a.abort(t),x(0,t),this}};d.promise(E).complete=v.add,E.success=E.done,E.error=E.fail,l.url=((e||l.url||Cn)+"").replace(kn,"").replace(_n,Nn[1]+"//"),l.type=t.method||t.type||l.method||l.type,l.dataTypes=h.trim(l.dataType||"*").toLowerCase().match(O)||[""],l.crossDomain==null&&(n=Dn.exec(l.url.toLowerCase()),l.crossDomain=!(!n||n[1]===Nn[1]&&n[2]===Nn[2]&&(n[3]||(n[1]==="http:"?"80":"443"))===(Nn[3]||(Nn[1]==="http:"?"80":"443")))),l.data&&l.processData&&typeof l.data!="string"&&(l.data=h.param(l.data,l.traditional)),In(Pn,l,t,E);if(b===2)return E;u=h.event&&l.global,u&&h.active++===0&&h.event.trigger("ajaxStart"),l.type=l.type.toUpperCase(),l.hasContent=!Mn.test(l.type),i=l.url,l.hasContent||(l.data&&(i=l.url+=(xn.test(i)?"&":"?")+l.data,delete l.data),l.cache===!1&&(l.url=Ln.test(i)?i.replace(Ln,"$1_="+Sn++):i+(xn.test(i)?"&":"?")+"_="+Sn++)),l.ifModified&&(h.lastModified[i]&&E.setRequestHeader("If-Modified-Since",h.lastModified[i]),h.etag[i]&&E.setRequestHeader("If-None-Match",h.etag[i])),(l.data&&l.hasContent&&l.contentType!==!1||t.contentType)&&E.setRequestHeader("Content-Type",l.contentType),E.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", "+Bn+"; q=0.01":""):l.accepts["*"]);for(r in l.headers)E.setRequestHeader(r,l.headers[r]);if(!l.beforeSend||l.beforeSend.call(c,E,l)!==!1&&b!==2){w="abort";for(r in{success:1,error:1,complete:1})E[r](l[r]);a=In(Hn,l,t,E);if(!a)x(-1,"No Transport");else{E.readyState=1,u&&p.trigger("ajaxSend",[E,l]),l.async&&l.timeout>0&&(o=setTimeout(function(){E.abort("timeout")},l.timeout));try{b=1,a.send(g,x)}catch(S){if(!(b<2))throw S;x(-1,S)}}return E}return E.abort()},getJSON:function(e,t,n){return h.get(e,t,n,"json")},getScript:function(e,t){return h.get(e,undefined,t,"script")}}),h.each(["get","post"],function(e,t){h[t]=function(e,n,r,i){return h.isFunction(n)&&(i=i||r,r=n,n=undefined),h.ajax({url:e,type:t,dataType:i,data:n,success:r})}}),h._evalUrl=function(e){return h.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},h.fn.extend({wrapAll:function(e){if(h.isFunction(e))return this.each(function(t){h(this).wrapAll(e.call(this,t))});if(this[0]){var t=h(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return h.isFunction(e)?this.each(function(t){h(this).wrapInner(e.call(this,t))}):this.each(function(){var t=h(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=h.isFunction(e);return this.each(function(n){h(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){h.nodeName(this,"body")||h(this).replaceWith(this.childNodes)}).end()}}),h.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0||!l.reliableHiddenOffsets()&&(e.style&&e.style.display||h.css(e,"display"))==="none"},h.expr.filters.visible=function(e){return!h.expr.filters.hidden(e)};var zn=/%20/g,Wn=/\[\]$/,Xn=/\r?\n/g,Vn=/^(?:submit|button|image|reset|file)$/i,$n=/^(?:input|select|textarea|keygen)/i;h.param=function(e,t){var n,r=[],i=function(e,t){t=h.isFunction(t)?t():t==null?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};t===undefined&&(t=h.ajaxSettings&&h.ajaxSettings.traditional);if(h.isArray(e)||e.jquery&&!h.isPlainObject(e))h.each(e,function(){i(this.name,this.value)});else for(n in e)Jn(n,e[n],t,i);return r.join("&").replace(zn,"+")},h.fn.extend({serialize:function(){return h.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=h.prop(this,"elements");return e?h.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!h(this).is(":disabled")&&$n.test(this.nodeName)&&!Vn.test(e)&&(this.checked||!J.test(e))}).map(function(e,t){var n=h(this).val();return n==null?null:h.isArray(n)?h.map(n,function(e){return{name:t.name,value:e.replace(Xn,"\r\n")}}):{name:t.name,value:n.replace(Xn,"\r\n")}}).get()}}),h.ajaxSettings.xhr=e.ActiveXObject!==undefined?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Yn()||Zn()}:Yn;var Kn=0,Qn={},Gn=h.ajaxSettings.xhr();e.attachEvent&&e.attachEvent("onunload",function(){for(var e in Qn)Qn[e](undefined,!0)}),l.cors=!!Gn&&"withCredentials"in Gn,Gn=l.ajax=!!Gn,Gn&&h.ajaxTransport(function(e){if(!e.crossDomain||l.cors){var t;return{send:function(n,r){var i,s=e.xhr(),o=++Kn;s.open(e.type,e.url,e.async,e.username,e.password);if(e.xhrFields)for(i in e.xhrFields)s[i]=e.xhrFields[i];e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),!e.crossDomain&&!n["X-Requested-With"]&&(n["X-Requested-With"]="XMLHttpRequest");for(i in n)n[i]!==undefined&&s.setRequestHeader(i,n[i]+"");s.send(e.hasContent&&e.data||null),t=function(n,i){var u,a,f;if(t&&(i||s.readyState===4)){delete Qn[o],t=undefined,s.onreadystatechange=h.noop;if(i)s.readyState!==4&&s.abort();else{f={},u=s.status,typeof s.responseText=="string"&&(f.text=s.responseText);try{a=s.statusText}catch(l){a=""}!u&&e.isLocal&&!e.crossDomain?u=f.text?200:404:u===1223&&(u=204)}}f&&r(u,a,f,s.getAllResponseHeaders())},e.async?s.readyState===4?setTimeout(t):s.onreadystatechange=Qn[o]=t:t()},abort:function(){t&&t(undefined,!0)}}}}),h.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return h.globalEval(e),e}}}),h.ajaxPrefilter("script",function(e){e.cache===undefined&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),h.ajaxTransport("script",function(e){if(e.crossDomain){var t,n=T.head||h("head")[0]||T.documentElement;return{send:function(r,i){t=T.createElement("script"),t.async=!0,e.scriptCharset&&(t.charset=e.scriptCharset),t.src=e.url,t.onload=t.onreadystatechange=function(e,n){if(n||!t.readyState||/loaded|complete/.test(t.readyState))t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),t=null,n||i(200,"success")},n.insertBefore(t,n.firstChild)},abort:function(){t&&t.onload(undefined,!0)}}}});var er=[],tr=/(=)\?(?=&|$)|\?\?/;h.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=er.pop()||h.expando+"_"+Sn++;return this[e]=!0,e}}),h.ajaxPrefilter("json jsonp",function(t,n,r){var i,s,o,u=t.jsonp!==!1&&(tr.test(t.url)?"url":typeof t.data=="string"&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&tr.test(t.data)&&"data");if(u||t.dataTypes[0]==="jsonp")return i=t.jsonpCallback=h.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,u?t[u]=t[u].replace(tr,"$1"+i):t.jsonp!==!1&&(t.url+=(xn.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return o||h.error(i+" was not called"),o[0]},t.dataTypes[0]="json",s=e[i],e[i]=function(){o=arguments},r.always(function(){e[i]=s,t[i]&&(t.jsonpCallback=n.jsonpCallback,er.push(i)),o&&h.isFunction(s)&&s(o[0]),o=s=undefined}),"script"}),h.parseHTML=function(e,t,n){if(!e||typeof e!="string")return null;typeof t=="boolean"&&(n=t,t=!1),t=t||T;var r=w.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=h.buildFragment([e],t,i),i&&i.length&&h(i).remove(),h.merge([],r.childNodes))};var nr=h.fn.load;h.fn.load=function(e,t,n){if(typeof e!="string"&&nr)return nr.apply(this,arguments);var r,i,s,o=this,u=e.indexOf(" ");return u>=0&&(r=h.trim(e.slice(u,e.length)),e=e.slice(0,u)),h.isFunction(t)?(n=t,t=undefined):t&&typeof t=="object"&&(s="POST"),o.length>0&&h.ajax({url:e,type:s,dataType:"html",data:t}).done(function(e){i=arguments,o.html(r?h("<div>").append(h.parseHTML(e)).find(r):e)}).complete(n&&function(e,t){o.each(n,i||[e.responseText,t,e])}),this},h.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){h.fn[t]=function(e){return this.on(t,e)}}),h.expr.filters.animated=function(e){return h.grep(h.timers,function(t){return e===t.elem}).length};var rr=e.document.documentElement;h.offset={setOffset:function(e,t,n){var r,i,s,o,u,a,f,l=h.css(e,"position"),c=h(e),p={};l==="static"&&(e.style.position="relative"),u=c.offset(),s=h.css(e,"top"),a=h.css(e,"left"),f=(l==="absolute"||l==="fixed")&&h.inArray("auto",[s,a])>-1,f?(r=c.position(),o=r.top,i=r.left):(o=parseFloat(s)||0,i=parseFloat(a)||0),h.isFunction(t)&&(t=t.call(e,n,u)),t.top!=null&&(p.top=t.top-u.top+o),t.left!=null&&(p.left=t.left-u.left+i),"using"in t?t.using.call(e,p):c.css(p)}},h.fn.extend({offset:function(e){if(arguments.length)return e===undefined?this:this.each(function(t){h.offset.setOffset(this,e,t)});var t,n,r={top:0,left:0},i=this[0],s=i&&i.ownerDocument;if(!s)return;return t=s.documentElement,h.contains(t,i)?(typeof i.getBoundingClientRect!==B&&(r=i.getBoundingClientRect()),n=ir(s),{top:r.top+(n.pageYOffset||t.scrollTop)-(t.clientTop||0),left:r.left+(n.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}):r},position:function(){if(!this[0])return;var e,t,n={top:0,left:0},r=this[0];return h.css(r,"position")==="fixed"?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),h.nodeName(e[0],"html")||(n=e.offset()),n.top+=h.css(e[0],"borderTopWidth",!0),n.left+=h.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-h.css(r,"marginTop",!0),left:t.left-n.left-h.css(r,"marginLeft",!0)}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||rr;while(e&&!h.nodeName(e,"html")&&h.css(e,"position")==="static")e=e.offsetParent;return e||rr})}}),h.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n=/Y/.test(t);h.fn[e]=function(r){return $(this,function(e,r,i){var s=ir(e);if(i===undefined)return s?t in s?s[t]:s.document.documentElement[r]:e[r];s?s.scrollTo(n?h(s).scrollLeft():i,n?i:h(s).scrollTop()):e[r]=i},e,r,arguments.length,null)}}),h.each(["top","left"],function(e,t){h.cssHooks[t]=jt(l.pixelPosition,function(e,n){if(n)return n=Ht(e,t),Dt.test(n)?h(e).position()[t]+"px":n})}),h.each({Height:"height",Width:"width"},function(e,t){h.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){h.fn[r]=function(r,i){var s=arguments.length&&(n||typeof r!="boolean"),o=n||(r===!0||i===!0?"margin":"border");return $(this,function(t,n,r){var i;return h.isWindow(t)?t.document.documentElement["client"+e]:t.nodeType===9?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):r===undefined?h.css(t,n,o):h.style(t,n,r,o)},t,s?r:undefined,s,null)}})}),h.fn.size=function(){return this.length},h.fn.andSelf=h.fn.addBack,typeof define=="function"&&define.amd&&define("jquery",[],function(){return h});var sr=e.jQuery,or=e.$;return h.noConflict=function(t){return e.$===h&&(e.$=or),t&&e.jQuery===h&&(e.jQuery=sr),h},typeof t===B&&(e.jQuery=e.$=h),h}),function(){function x(e){function t(t,n,r,i,s,o){for(;s>=0&&s<o;s+=e){var u=i?i[s]:s;r=n(r,t[u],u,t)}return r}return function(n,r,i,s){r=v(r,s,4);var o=!S(n)&&d.keys(n),u=(o||n).length,a=e>0?0:u-1;return arguments.length<3&&(i=n[o?o[a]:a],a+=e),t(n,r,i,o,a,u)}}function C(e){return function(t,n,r){n=m(n,r);var i=E(t),s=e>0?0:i-1;for(;s>=0&&s<i;s+=e)if(n(t[s],s,t))return s;return-1}}function k(e,t,n){return function(r,i,s){var u=0,a=E(r);if(typeof s=="number")e>0?u=s>=0?s:Math.max(s+a,u):a=s>=0?Math.min(s+1,a):s+a+1;else if(n&&s&&a)return s=n(r,i),r[s]===i?s:-1;if(i!==i)return s=t(o.call(r,u,a),d.isNaN),s>=0?s+u:-1;for(s=e>0?u:a-1;s>=0&&s<a;s+=e)if(r[s]===i)return s;return-1}}function M(e,t){var n=O.length,i=e.constructor,s=d.isFunction(i)&&i.prototype||r,o="constructor";d.has(e,o)&&!d.contains(t,o)&&t.push(o);while(n--)o=O[n],o in e&&e[o]!==s[o]&&!d.contains(t,o)&&t.push(o)}var e=this,t=e._,n=Array.prototype,r=Object.prototype,i=Function.prototype,s=n.push,o=n.slice,u=r.toString,a=r.hasOwnProperty,f=Array.isArray,l=Object.keys,c=i.bind,h=Object.create,p=function(){},d=function(e){if(e instanceof d)return e;if(!(this instanceof d))return new d(e);this._wrapped=e};typeof exports!="undefined"?(typeof module!="undefined"&&module.exports&&(exports=module.exports=d),exports._=d):e._=d,d.VERSION="1.8.3";var v=function(e,t,n){if(t===void 0)return e;switch(n==null?3:n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,s){return e.call(t,n,r,i,s)}}return function(){return e.apply(t,arguments)}},m=function(e,t,n){return e==null?d.identity:d.isFunction(e)?v(e,t,n):d.isObject(e)?d.matcher(e):d.property(e)};d.iteratee=function(e,t){return m(e,t,Infinity)};var g=function(e,t){return function(n){var r=arguments.length;if(r<2||n==null)return n;for(var i=1;i<r;i++){var s=arguments[i],o=e(s),u=o.length;for(var a=0;a<u;a++){var f=o[a];if(!t||n[f]===void 0)n[f]=s[f]}}return n}},y=function(e){if(!d.isObject(e))return{};if(h)return h(e);p.prototype=e;var t=new p;return p.prototype=null,t},b=function(e){return function(t){return t==null?void 0:t[e]}},w=Math.pow(2,53)-1,E=b("length"),S=function(e){var t=E(e);return typeof t=="number"&&t>=0&&t<=w};d.each=d.forEach=function(e,t,n){t=v(t,n);var r,i;if(S(e))for(r=0,i=e.length;r<i;r++)t(e[r],r,e);else{var s=d.keys(e);for(r=0,i=s.length;r<i;r++)t(e[s[r]],s[r],e)}return e},d.map=d.collect=function(e,t,n){t=m(t,n);var r=!S(e)&&d.keys(e),i=(r||e).length,s=Array(i);for(var o=0;o<i;o++){var u=r?r[o]:o;s[o]=t(e[u],u,e)}return s},d.reduce=d.foldl=d.inject=x(1),d.reduceRight=d.foldr=x(-1),d.find=d.detect=function(e,t,n){var r;S(e)?r=d.findIndex(e,t,n):r=d.findKey(e,t,n);if(r!==void 0&&r!==-1)return e[r]},d.filter=d.select=function(e,t,n){var r=[];return t=m(t,n),d.each(e,function(e,n,i){t(e,n,i)&&r.push(e)}),r},d.reject=function(e,t,n){return d.filter(e,d.negate(m(t)),n)},d.every=d.all=function(e,t,n){t=m(t,n);var r=!S(e)&&d.keys(e),i=(r||e).length;for(var s=0;s<i;s++){var o=r?r[s]:s;if(!t(e[o],o,e))return!1}return!0},d.some=d.any=function(e,t,n){t=m(t,n);var r=!S(e)&&d.keys(e),i=(r||e).length;for(var s=0;s<i;s++){var o=r?r[s]:s;if(t(e[o],o,e))return!0}return!1},d.contains=d.includes=d.include=function(e,t,n,r){S(e)||(e=d.values(e));if(typeof n!="number"||r)n=0;return d.indexOf(e,t,n)>=0},d.invoke=function(e,t){var n=o.call(arguments,2),r=d.isFunction(t);return d.map(e,function(e){var i=r?t:e[t];return i==null?i:i.apply(e,n)})},d.pluck=function(e,t){return d.map(e,d.property(t))},d.where=function(e,t){return d.filter(e,d.matcher(t))},d.findWhere=function(e,t){return d.find(e,d.matcher(t))},d.max=function(e,t,n){var r=-Infinity,i=-Infinity,s,o;if(t==null&&e!=null){e=S(e)?e:d.values(e);for(var u=0,a=e.length;u<a;u++)s=e[u],s>r&&(r=s)}else t=m(t,n),d.each(e,function(e,n,s){o=t(e,n,s);if(o>i||o===-Infinity&&r===-Infinity)r=e,i=o});return r},d.min=function(e,t,n){var r=Infinity,i=Infinity,s,o;if(t==null&&e!=null){e=S(e)?e:d.values(e);for(var u=0,a=e.length;u<a;u++)s=e[u],s<r&&(r=s)}else t=m(t,n),d.each(e,function(e,n,s){o=t(e,n,s);if(o<i||o===Infinity&&r===Infinity)r=e,i=o});return r},d.shuffle=function(e){var t=S(e)?e:d.values(e),n=t.length,r=Array(n);for(var i=0,s;i<n;i++)s=d.random(0,i),s!==i&&(r[i]=r[s]),r[s]=t[i];return r},d.sample=function(e,t,n){return t==null||n?(S(e)||(e=d.values(e)),e[d.random(e.length-1)]):d.shuffle(e).slice(0,Math.max(0,t))},d.sortBy=function(e,t,n){return t=m(t,n),d.pluck(d.map(e,function(e,n,r){return{value:e,index:n,criteria:t(e,n,r)}}).sort(function(e,t){var n=e.criteria,r=t.criteria;if(n!==r){if(n>r||n===void 0)return 1;if(n<r||r===void 0)return-1}return e.index-t.index}),"value")};var T=function(e){return function(t,n,r){var i={};return n=m(n,r),d.each(t,function(r,s){var o=n(r,s,t);e(i,r,o)}),i}};d.groupBy=T(function(e,t,n){d.has(e,n)?e[n].push(t):e[n]=[t]}),d.indexBy=T(function(e,t,n){e[n]=t}),d.countBy=T(function(e,t,n){d.has(e,n)?e[n]++:e[n]=1}),d.toArray=function(e){return e?d.isArray(e)?o.call(e):S(e)?d.map(e,d.identity):d.values(e):[]},d.size=function(e){return e==null?0:S(e)?e.length:d.keys(e).length},d.partition=function(e,t,n){t=m(t,n);var r=[],i=[];return d.each(e,function(e,n,s){(t(e,n,s)?r:i).push(e)}),[r,i]},d.first=d.head=d.take=function(e,t,n){return e==null?void 0:t==null||n?e[0]:d.initial(e,e.length-t)},d.initial=function(e,t,n){return o.call(e,0,Math.max(0,e.length-(t==null||n?1:t)))},d.last=function(e,t,n){return e==null?void 0:t==null||n?e[e.length-1]:d.rest(e,Math.max(0,e.length-t))},d.rest=d.tail=d.drop=function(e,t,n){return o.call(e,t==null||n?1:t)},d.compact=function(e){return d.filter(e,d.identity)};var N=function(e,t,n,r){var i=[],s=0;for(var o=r||0,u=E(e);o<u;o++){var a=e[o];if(S(a)&&(d.isArray(a)||d.isArguments(a))){t||(a=N(a,t,n));var f=0,l=a.length;i.length+=l;while(f<l)i[s++]=a[f++]}else n||(i[s++]=a)}return i};d.flatten=function(e,t){return N(e,t,!1)},d.without=function(e){return d.difference(e,o.call(arguments,1))},d.uniq=d.unique=function(e,t,n,r){d.isBoolean(t)||(r=n,n=t,t=!1),n!=null&&(n=m(n,r));var i=[],s=[];for(var o=0,u=E(e);o<u;o++){var a=e[o],f=n?n(a,o,e):a;t?((!o||s!==f)&&i.push(a),s=f):n?d.contains(s,f)||(s.push(f),i.push(a)):d.contains(i,a)||i.push(a)}return i},d.union=function(){return d.uniq(N(arguments,!0,!0))},d.intersection=function(e){var t=[],n=arguments.length;for(var r=0,i=E(e);r<i;r++){var s=e[r];if(d.contains(t,s))continue;for(var o=1;o<n;o++)if(!d.contains(arguments[o],s))break;o===n&&t.push(s)}return t},d.difference=function(e){var t=N(arguments,!0,!0,1);return d.filter(e,function(e){return!d.contains(t,e)})},d.zip=function(){return d.unzip(arguments)},d.unzip=function(e){var t=e&&d.max(e,E).length||0,n=Array(t);for(var r=0;r<t;r++)n[r]=d.pluck(e,r);return n},d.object=function(e,t){var n={};for(var r=0,i=E(e);r<i;r++)t?n[e[r]]=t[r]:n[e[r][0]]=e[r][1];return n},d.findIndex=C(1),d.findLastIndex=C(-1),d.sortedIndex=function(e,t,n,r){n=m(n,r,1);var i=n(t),s=0,o=E(e);while(s<o){var u=Math.floor((s+o)/2);n(e[u])<i?s=u+1:o=u}return s},d.indexOf=k(1,d.findIndex,d.sortedIndex),d.lastIndexOf=k(-1,d.findLastIndex),d.range=function(e,t,n){t==null&&(t=e||0,e=0),n=n||1;var r=Math.max(Math.ceil((t-e)/n),0),i=Array(r);for(var s=0;s<r;s++,e+=n)i[s]=e;return i};var L=function(e,t,n,r,i){if(r instanceof t){var s=y(e.prototype),o=e.apply(s,i);return d.isObject(o)?o:s}return e.apply(n,i)};d.bind=function(e,t){if(c&&e.bind===c)return c.apply(e,o.call(arguments,1));if(!d.isFunction(e))throw new TypeError("Bind must be called on a function");var n=o.call(arguments,2),r=function(){return L(e,r,t,this,n.concat(o.call(arguments)))};return r},d.partial=function(e){var t=o.call(arguments,1),n=function(){var r=0,i=t.length,s=Array(i);for(var o=0;o<i;o++)s[o]=t[o]===d?arguments[r++]:t[o];while(r<arguments.length)s.push(arguments[r++]);return L(e,n,this,this,s)};return n},d.bindAll=function(e){var t,n=arguments.length,r;if(n<=1)throw new Error("bindAll must be passed function names");for(t=1;t<n;t++)r=arguments[t],e[r]=d.bind(e[r],e);return e},d.memoize=function(e,t){var n=function(r){var i=n.cache,s=""+(t?t.apply(this,arguments):r);return d.has(i,s)||(i[s]=e.apply(this,arguments)),i[s]};return n.cache={},n},d.delay=function(e,t){var n=o.call(arguments,2);return setTimeout(function(){return e.apply(null,n)},t)},d.defer=d.partial(d.delay,d,1),d.throttle=function(e,t,n){var r,i,s,o=null,u=0;n||(n={});var a=function(){u=n.leading===!1?0:d.now(),o=null,s=e.apply(r,i),o||(r=i=null)};return function(){var f=d.now();!u&&n.leading===!1&&(u=f);var l=t-(f-u);return r=this,i=arguments,l<=0||l>t?(o&&(clearTimeout(o),o=null),u=f,s=e.apply(r,i),o||(r=i=null)):!o&&n.trailing!==!1&&(o=setTimeout(a,l)),s}},d.debounce=function(e,t,n){var r,i,s,o,u,a=function(){var f=d.now()-o;f<t&&f>=0?r=setTimeout(a,t-f):(r=null,n||(u=e.apply(s,i),r||(s=i=null)))};return function(){s=this,i=arguments,o=d.now();var f=n&&!r;return r||(r=setTimeout(a,t)),f&&(u=e.apply(s,i),s=i=null),u}},d.wrap=function(e,t){return d.partial(t,e)},d.negate=function(e){return function(){return!e.apply(this,arguments)}},d.compose=function(){var e=arguments,t=e.length-1;return function(){var n=t,r=e[t].apply(this,arguments);while(n--)r=e[n].call(this,r);return r}},d.after=function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},d.before=function(e,t){var n;return function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=null),n}},d.once=d.partial(d.before,2);var A=!{toString:null}.propertyIsEnumerable("toString"),O=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];d.keys=function(e){if(!d.isObject(e))return[];if(l)return l(e);var t=[];for(var n in e)d.has(e,n)&&t.push(n);return A&&M(e,t),t},d.allKeys=function(e){if(!d.isObject(e))return[];var t=[];for(var n in e)t.push(n);return A&&M(e,t),t},d.values=function(e){var t=d.keys(e),n=t.length,r=Array(n);for(var i=0;i<n;i++)r[i]=e[t[i]];return r},d.mapObject=function(e,t,n){t=m(t,n);var r=d.keys(e),i=r.length,s={},o;for(var u=0;u<i;u++)o=r[u],s[o]=t(e[o],o,e);return s},d.pairs=function(e){var t=d.keys(e),n=t.length,r=Array(n);for(var i=0;i<n;i++)r[i]=[t[i],e[t[i]]];return r},d.invert=function(e){var t={},n=d.keys(e);for(var r=0,i=n.length;r<i;r++)t[e[n[r]]]=n[r];return t},d.functions=d.methods=function(e){var t=[];for(var n in e)d.isFunction(e[n])&&t.push(n);return t.sort()},d.extend=g(d.allKeys),d.extendOwn=d.assign=g(d.keys),d.findKey=function(e,t,n){t=m(t,n);var r=d.keys(e),i;for(var s=0,o=r.length;s<o;s++){i=r[s];if(t(e[i],i,e))return i}},d.pick=function(e,t,n){var r={},i=e,s,o;if(i==null)return r;d.isFunction(t)?(o=d.allKeys(i),s=v(t,n)):(o=N(arguments,!1,!1,1),s=function(e,t,n){return t in n},i=Object(i));for(var u=0,a=o.length;u<a;u++){var f=o[u],l=i[f];s(l,f,i)&&(r[f]=l)}return r},d.omit=function(e,t,n){if(d.isFunction(t))t=d.negate(t);else{var r=d.map(N(arguments,!1,!1,1),String);t=function(e,t){return!d.contains(r,t)}}return d.pick(e,t,n)},d.defaults=g(d.allKeys,!0),d.create=function(e,t){var n=y(e);return t&&d.extendOwn(n,t),n},d.clone=function(e){return d.isObject(e)?d.isArray(e)?e.slice():d.extend({},e):e},d.tap=function(e,t){return t(e),e},d.isMatch=function(e,t){var n=d.keys(t),r=n.length;if(e==null)return!r;var i=Object(e);for(var s=0;s<r;s++){var o=n[s];if(t[o]!==i[o]||!(o in i))return!1}return!0};var _=function(e,t,n,r){if(e===t)return e!==0||1/e===1/t;if(e==null||t==null)return e===t;e instanceof d&&(e=e._wrapped),t instanceof d&&(t=t._wrapped);var i=u.call(e);if(i!==u.call(t))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":if(+e!==+e)return+t!==+t;return+e===0?1/+e===1/t:+e===+t;case"[object Date]":case"[object Boolean]":return+e===+t}var s=i==="[object Array]";if(!s){if(typeof e!="object"||typeof t!="object")return!1;var o=e.constructor,a=t.constructor;if(o!==a&&!(d.isFunction(o)&&o instanceof o&&d.isFunction(a)&&a instanceof a)&&"constructor"in e&&"constructor"in t)return!1}n=n||[],r=r||[];var f=n.length;while(f--)if(n[f]===e)return r[f]===t;n.push(e),r.push(t);if(s){f=e.length;if(f!==t.length)return!1;while(f--)if(!_(e[f],t[f],n,r))return!1}else{var l=d.keys(e),c;f=l.length;if(d.keys(t).length!==f)return!1;while(f--){c=l[f];if(!d.has(t,c)||!_(e[c],t[c],n,r))return!1}}return n.pop(),r.pop(),!0};d.isEqual=function(e,t){return _(e,t)},d.isEmpty=function(e){return e==null?!0:S(e)&&(d.isArray(e)||d.isString(e)||d.isArguments(e))?e.length===0:d.keys(e).length===0},d.isElement=function(e){return!!e&&e.nodeType===1},d.isArray=f||function(e){return u.call(e)==="[object Array]"},d.isObject=function(e){var t=typeof e;return t==="function"||t==="object"&&!!e},d.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(e){d["is"+e]=function(t){return u.call(t)==="[object "+e+"]"}}),d.isArguments(arguments)||(d.isArguments=function(e){return d.has(e,"callee")}),typeof /./!="function"&&typeof Int8Array!="object"&&(d.isFunction=function(e){return typeof e=="function"||!1}),d.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},d.isNaN=function(e){return d.isNumber(e)&&e!==+e},d.isBoolean=function(e){return e===!0||e===!1||u.call(e)==="[object Boolean]"},d.isNull=function(e){return e===null},d.isUndefined=function(e){return e===void 0},d.has=function(e,t){return e!=null&&a.call(e,t)},d.noConflict=function(){return e._=t,this},d.identity=function(e){return e},d.constant=function(e){return function(){return e}},d.noop=function(){},d.property=b,d.propertyOf=function(e){return e==null?function(){}:function(t){return e[t]}},d.matcher=d.matches=function(e){return e=d.extendOwn({},e),function(t){return d.isMatch(t,e)}},d.times=function(e,t,n){var r=Array(Math.max(0,e));t=v(t,n,1);for(var i=0;i<e;i++)r[i]=t(i);return r},d.random=function(e,t){return t==null&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))},d.now=Date.now||function(){return(new Date).getTime()};var D={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},P=d.invert(D),H=function(e){var t=function(t){return e[t]},n="(?:"+d.keys(e).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(e){return e=e==null?"":""+e,r.test(e)?e.replace(i,t):e}};d.escape=H(D),d.unescape=H(P),d.result=function(e,t,n){var r=e==null?void 0:e[t];return r===void 0&&(r=n),d.isFunction(r)?r.call(e):r};var B=0;d.uniqueId=function(e){var t=++B+"";return e?e+t:t},d.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var j=/(.)^/,F={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},I=/\\|'|\r|\n|\u2028|\u2029/g,q=function(e){return"\\"+F[e]};d.template=function(e,t,n){!t&&n&&(t=n),t=d.defaults({},t,d.templateSettings);var r=RegExp([(t.escape||j).source,(t.interpolate||j).source,(t.evaluate||j).source].join("|")+"|$","g"),i=0,s="__p+='";e.replace(r,function(t,n,r,o,u){return s+=e.slice(i,u).replace(I,q),i=u+t.length,n?s+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?s+="'+\n((__t=("+r+"))==null?'':__t)+\n'":o&&(s+="';\n"+o+"\n__p+='"),t}),s+="';\n",t.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{var o=new Function(t.variable||"obj","_",s)}catch(u){throw u.source=s,u}var a=function(e){return o.call(this,e,d)},f=t.variable||"obj";return a.source="function("+f+"){\n"+s+"}",a},d.chain=function(e){var t=d(e);return t._chain=!0,t};var R=function(e,t){return e._chain?d(t).chain():t};d.mixin=function(e){d.each(d.functions(e),function(t){var n=d[t]=e[t];d.prototype[t]=function(){var e=[this._wrapped];return s.apply(e,arguments),R(this,n.apply(d,e))}})},d.mixin(d),d.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=n[e];d.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),(e==="shift"||e==="splice")&&n.length===0&&delete n[0],R(this,n)}}),d.each(["concat","join","slice"],function(e){var t=n[e];d.prototype[e]=function(){return R(this,t.apply(this._wrapped,arguments))}}),d.prototype.value=function(){return this._wrapped},d.prototype.valueOf=d.prototype.toJSON=d.prototype.value,d.prototype.toString=function(){return""+this._wrapped},typeof define=="function"&&define.amd&&define("underscore",[],function(){return d})}.call(this),function(e){var t=typeof self=="object"&&self.self==self&&self||typeof global=="object"&&global.global==global&&global;if(typeof define=="function"&&define.amd)define("backbone",["underscore","jquery","exports"],function(n,r,i){t.Backbone=e(t,i,n,r)});else if(typeof exports!="undefined"){var n=require("underscore"),r;try{r=require("jquery")}catch(i){}e(t,exports,n,r)}else t.Backbone=e(t,{},t._,t.jQuery||t.Zepto||t.ender||t.$)}(function(e,t,n,r){var i=e.Backbone,s=[].slice;t.VERSION="1.2.1",t.$=r,t.noConflict=function(){return e.Backbone=i,this},t.emulateHTTP=!1,t.emulateJSON=!1;var o=function(e,t,r){switch(e){case 1:return function(){return n[t](this[r])};case 2:return function(e){return n[t](this[r],e)};case 3:return function(e,i){return n[t](this[r],e,i)};case 4:return function(e,i,s){return n[t](this[r],e,i,s)};default:return function(){var e=s.call(arguments);return e.unshift(this[r]),n[t].apply(n,e)}}},u=function(e,t,r){n.each(t,function(t,i){n[i]&&(e.prototype[i]=o(t,i,r))})},a=t.Events={},f=/\s+/,l=function(e,t,r,i,s){var o=0,u;if(r&&typeof r=="object"){i!==void 0&&"context"in s&&s.context===void 0&&(s.context=i);for(u=n.keys(r);o<u.length;o++)t=e(t,u[o],r[u[o]],s)}else if(r&&f.test(r))for(u=r.split(f);o<u.length;o++)t=e(t,u[o],i,s);else t=e(t,r,i,s);return t};a.on=function(e,t,n){return c(this,e,t,n)};var c=function(e,t,n,r,i){e._events=l(h,e._events||{},t,n,{context:r,ctx:e,listening:i});if(i){var s=e._listeners||(e._listeners={});s[i.id]=i}return e};a.listenTo=function(e,t,r){if(!e)return this;var i=e._listenId||(e._listenId=n.uniqueId("l")),s=this._listeningTo||(this._listeningTo={}),o=s[i];if(!o){var u=this._listenId||(this._listenId=n.uniqueId("l"));o=s[i]={obj:e,objId:i,id:u,listeningTo:s,count:0}}return c(e,t,r,this,o),this};var h=function(e,t,n,r){if(n){var i=e[t]||(e[t]=[]),s=r.context,o=r.ctx,u=r.listening;u&&u.count++,i.push({callback:n,context:s,ctx:s||o,listening:u})}return e};a.off=function(e,t,n){return this._events?(this._events=l(p,this._events,e,t,{context:n,listeners:this._listeners}),this):this},a.stopListening=function(e,t,r){var i=this._listeningTo;if(!i)return this;var s=e?[e._listenId]:n.keys(i);for(var o=0;o<s.length;o++){var u=i[s[o]];if(!u)break;u.obj.off(t,r,this)}return n.isEmpty(i)&&(this._listeningTo=void 0),this};var p=function(e,t,r,i){if(!e)return;var s=0,o,u=i.context,a=i.listeners;if(!t&&!r&&!u){var f=n.keys(a);for(;s<f.length;s++)o=a[f[s]],delete a[o.id],delete o.listeningTo[o.objId];return}var l=t?[t]:n.keys(e);for(;s<l.length;s++){t=l[s];var c=e[t];if(!c)break;var h=[];for(var p=0;p<c.length;p++){var d=c[p];r&&r!==d.callback&&r!==d.callback._callback||u&&u!==d.context?h.push(d):(o=d.listening,o&&--o.count===0&&(delete a[o.id],delete o.listeningTo[o.objId]))}h.length?e[t]=h:delete e[t]}if(n.size(e))return e};a.once=function(e,t,r){var i=l(d,{},e,t,n.bind(this.off,this));return this.on(i,void 0,r)},a.listenToOnce=function(e,t,r){var i=l(d,{},t,r,n.bind(this.stopListening,this,e));return this.listenTo(e,i)};var d=function(e,t,r,i){if(r){var s=e[t]=n.once(function(){i(t,s),r.apply(this,arguments)});s._callback=r}return e};a.trigger=function(e){if(!this._events)return this;var t=Math.max(0,arguments.length-1),n=Array(t);for(var r=0;r<t;r++)n[r]=arguments[r+1];return l(v,this._events,e,void 0,n),this};var v=function(e,t,n,r){if(e){var i=e[t],s=e.all;i&&s&&(s=s.slice()),i&&m(i,r),s&&m(s,[t].concat(r))}return e},m=function(e,t){var n,r=-1,i=e.length,s=t[0],o=t[1],u=t[2];switch(t.length){case 0:while(++r<i)(n=e[r]).callback.call(n.ctx);return;case 1:while(++r<i)(n=e[r]).callback.call(n.ctx,s);return;case 2:while(++r<i)(n=e[r]).callback.call(n.ctx,s,o);return;case 3:while(++r<i)(n=e[r]).callback.call(n.ctx,s,o,u);return;default:while(++r<i)(n=e[r]).callback.apply(n.ctx,t);return}};a.bind=a.on,a.unbind=a.off,n.extend(t,a);var g=t.Model=function(e,t){var r=e||{};t||(t={}),this.cid=n.uniqueId(this.cidPrefix),this.attributes={},t.collection&&(this.collection=t.collection),t.parse&&(r=this.parse(r,t)||{}),r=n.defaults({},r,n.result(this,"defaults")),this.set(r,t),this.changed={},this.initialize.apply(this,arguments)};n.extend(g.prototype,a,{changed:null,validationError:null,idAttribute:"id",cidPrefix:"c",initialize:function(){},toJSON:function(e){return n.clone(this.attributes)},sync:function(){return t.sync.apply(this,arguments)},get:function(e){return this.attributes[e]},escape:function(e){return n.escape(this.get(e))},has:function(e){return this.get(e)!=null},matches:function(e){return!!n.iteratee(e,this)(this.attributes)},set:function(e,t,r){if(e==null)return this;var i;typeof e=="object"?(i=e,r=t):(i={})[e]=t,r||(r={});if(!this._validate(i,r))return!1;var s=r.unset,o=r.silent,u=[],a=this._changing;this._changing=!0,a||(this._previousAttributes=n.clone(this.attributes),this.changed={});var f=this.attributes,l=this.changed,c=this._previousAttributes;this.idAttribute in i&&(this.id=i[this.idAttribute]);for(var h in i)t=i[h],n.isEqual(f[h],t)||u.push(h),n.isEqual(c[h],t)?delete l[h]:l[h]=t,s?delete f[h]:f[h]=t;if(!o){u.length&&(this._pending=r);for(var p=0;p<u.length;p++)this.trigger("change:"+u[p],this,f[u[p]],r)}if(a)return this;if(!o)while(this._pending)r=this._pending,this._pending=!1,this.trigger("change",this,r);return this._pending=!1,this._changing=!1,this},unset:function(e,t){return this.set(e,void 0,n.extend({},t,{unset:!0}))},clear:function(e){var t={};for(var r in this.attributes)t[r]=void 0;return this.set(t,n.extend({},e,{unset:!0}))},hasChanged:function(e){return e==null?!n.isEmpty(this.changed):n.has(this.changed,e)},changedAttributes:function(e){if(!e)return this.hasChanged()?n.clone(this.changed):!1;var t=this._changing?this._previousAttributes:this.attributes,r={};for(var i in e){var s=e[i];if(n.isEqual(t[i],s))continue;r[i]=s}return n.size(r)?r:!1},previous:function(e){return e==null||!this._previousAttributes?null:this._previousAttributes[e]},previousAttributes:function(){return n.clone(this._previousAttributes)},fetch:function(e){e=n.extend({parse:!0},e);var t=this,r=e.success;return e.success=function(n){var i=e.parse?t.parse(n,e):n;if(!t.set(i,e))return!1;r&&r.call(e.context,t,n,e),t.trigger("sync",t,n,e)},I(this,e),this.sync("read",this,e)},save:function(e,t,r){var i;e==null||typeof e=="object"?(i=e,r=t):(i={})[e]=t,r=n.extend({validate:!0,parse:!0},r);var s=r.wait;if(i&&!s){if(!this.set(i,r))return!1}else if(!this._validate(i,r))return!1;var o=this,u=r.success,a=this.attributes;r.success=function(e){o.attributes=a;var t=r.parse?o.parse(e,r):e;s&&(t=n.extend({},i,t));if(t&&!o.set(t,r))return!1;u&&u.call(r.context,o,e,r),o.trigger("sync",o,e,r)},I(this,r),i&&s&&(this.attributes=n.extend({},a,i));var f=this.isNew()?"create":r.patch?"patch":"update";f==="patch"&&!r.attrs&&(r.attrs=i);var l=this.sync(f,this,r);return this.attributes=a,l},destroy:function(e){e=e?n.clone(e):{};var t=this,r=e.success,i=e.wait,s=function(){t.stopListening(),t.trigger("destroy",t,t.collection,e)};e.success=function(n){i&&s(),r&&r.call(e.context,t,n,e),t.isNew()||t.trigger("sync",t,n,e)};var o=!1;return this.isNew()?n.defer(e.success):(I(this,e),o=this.sync("delete",this,e)),i||s(),o},url:function(){var e=n.result(this,"urlRoot")||n.result(this.collection,"url")||F();if(this.isNew())return e;var t=this.get(this.idAttribute);return e.replace(/[^\/]$/,"$&/")+encodeURIComponent(t)},parse:function(e,t){return e},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(e){return this._validate({},n.defaults({validate:!0},e))},_validate:function(e,t){if(!t.validate||!this.validate)return!0;e=n.extend({},this.attributes,e);var r=this.validationError=this.validate(e,t)||null;return r?(this.trigger("invalid",this,r,n.extend(t,{validationError:r})),!1):!0}});var y={keys:1,values:1,pairs:1,invert:1,pick:0,omit:0,chain:1,isEmpty:1};u(g,y,"attributes");var b=t.Collection=function(e,t){t||(t={}),t.model&&(this.model=t.model),t.comparator!==void 0&&(this.comparator=t.comparator),this._reset(),this.initialize.apply(this,arguments),e&&this.reset(e,n.extend({silent:!0},t))},w={add:!0,remove:!0,merge:!0},E={add:!0,remove:!1};n.extend(b.prototype,a,{model:g,initialize:function(){},toJSON:function(e){return this.map(function(t){return t.toJSON(e)})},sync:function(){return t.sync.apply(this,arguments)},add:function(e,t){return this.set(e,n.extend({merge:!1},t,E))},remove:function(e,t){t=n.extend({},t);var r=!n.isArray(e);e=r?[e]:n.clone(e);var i=this._removeModels(e,t);return!t.silent&&i&&this.trigger("update",this,t),r?i[0]:i},set:function(e,t){t=n.defaults({},t,w),t.parse&&!this._isModel(e)&&(e=this.parse(e,t));var r=!n.isArray(e);e=r?e?[e]:[]:e.slice();var i,s,o,u,a,f=t.at;f!=null&&(f=+f),f<0&&(f+=this.length+1);var l=this.comparator&&f==null&&t.sort!==!1,c=n.isString(this.comparator)?this.comparator:null,h=[],p=[],d={},v=t.add,m=t.merge,g=t.remove,y=!l&&v&&g?[]:!1,b=!1;for(var E=0;E<e.length;E++){o=e[E];if(u=this.get(o))g&&(d[u.cid]=!0),m&&o!==u&&(o=this._isModel(o)?o.attributes:o,t.parse&&(o=u.parse(o,t)),u.set(o,t),l&&!a&&u.hasChanged(c)&&(a=!0)),e[E]=u;else if(v){s=e[E]=this._prepareModel(o,t);if(!s)continue;h.push(s),this._addReference(s,t)}s=u||s;if(!s)continue;i=this.modelId(s.attributes),y&&(s.isNew()||!d[i])&&(y.push(s),b=b||!this.models[E]||s.cid!==this.models[E].cid),d[i]=!0}if(g){for(var E=0;E<this.length;E++)d[(s=this.models[E]).cid]||p.push(s);p.length&&this._removeModels(p,t)}if(h.length||b){l&&(a=!0),this.length+=h.length;if(f!=null)for(var E=0;E<h.length;E++)this.models.splice(f+E,0,h[E]);else{y&&(this.models.length=0);var S=y||h;for(var E=0;E<S.length;E++)this.models.push(S[E])}}a&&this.sort({silent:!0});if(!t.silent){var x=f!=null?n.clone(t):t;for(var E=0;E<h.length;E++)f!=null&&(x.index=f+E),(s=h[E]).trigger("add",s,this,x);(a||b)&&this.trigger("sort",this,t),(h.length||p.length)&&this.trigger("update",this,t)}return r?e[0]:e},reset:function(e,t){t=t?n.clone(t):{};for(var r=0;r<this.models.length;r++)this._removeReference(this.models[r],t);return t.previousModels=this.models,this._reset(),e=this.add(e,n.extend({silent:!0},t)),t.silent||this.trigger("reset",this,t),e},push:function(e,t){return this.add(e,n.extend({at:this.length},t))},pop:function(e){var t=this.at(this.length-1);return this.remove(t,e)},unshift:function(e,t){return this.add(e,n.extend({at:0},t))},shift:function(e){var t=this.at(0);return this.remove(t,e)},slice:function(){return s.apply(this.models,arguments)},get:function(e){if(e==null)return void 0;var t=this.modelId(this._isModel(e)?e.attributes:e);return this._byId[e]||this._byId[t]||this._byId[e.cid]},at:function(e){return e<0&&(e+=this.length),this.models[e]},where:function(e,t){var r=n.matches(e);return this[t?"find":"filter"](function(e){return r(e.attributes)})},findWhere:function(e){return this.where(e,!0)},sort:function(e){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");return e||(e={}),n.isString(this.comparator)||this.comparator.length===1?this.models=this.sortBy(this.comparator,this):this.models.sort(n.bind(this.comparator,this)),e.silent||this.trigger("sort",this,e),this},pluck:function(e){return n.invoke(this.models,"get",e)},fetch:function(e){e=n.extend({parse:!0},e);var t=e.success,r=this;return e.success=function(n){var i=e.reset?"reset":"set";r[i](n,e),t&&t.call(e.context,r,n,e),r.trigger("sync",r,n,e)},I(this,e),this.sync("read",this,e)},create:function(e,t){t=t?n.clone(t):{};var r=t.wait;e=this._prepareModel(e,t);if(!e)return!1;r||this.add(e,t);var i=this,s=t.success;return t.success=function(e,t,n){r&&i.add(e,n),s&&s.call(n.context,e,t,n)},e.save(null,t),e},parse:function(e,t){return e},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(e){return e[this.model.prototype.idAttribute||"id"]},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(e,t){if(this._isModel(e))return e.collection||(e.collection=this),e;t=t?n.clone(t):{},t.collection=this;var r=new this.model(e,t);return r.validationError?(this.trigger("invalid",this,r.validationError,t),!1):r},_removeModels:function(e,t){var n=[];for(var r=0;r<e.length;r++){var i=this.get(e[r]);if(!i)continue;var s=this.indexOf(i);this.models.splice(s,1),this.length--,t.silent||(t.index=s,i.trigger("remove",i,this,t)),n.push(i),this._removeReference(i,t)}return n.length?n:!1},_isModel:function(e){return e instanceof g},_addReference:function(e,t){this._byId[e.cid]=e;var n=this.modelId(e.attributes);n!=null&&(this._byId[n]=e),e.on("all",this._onModelEvent,this)},_removeReference:function(e,t){delete this._byId[e.cid];var n=this.modelId(e.attributes);n!=null&&delete this._byId[n],this===e.collection&&delete e.collection,e.off("all",this._onModelEvent,this)},_onModelEvent:function(e,t,n,r){if((e==="add"||e==="remove")&&n!==this)return;e==="destroy"&&this.remove(t,r);if(e==="change"){var i=this.modelId(t.previousAttributes()),s=this.modelId(t.attributes);i!==s&&(i!=null&&delete this._byId[i],s!=null&&(this._byId[s]=t))}this.trigger.apply(this,arguments)}});var S={forEach:3,each:3,map:3,collect:3,reduce:4,foldl:4,inject:4,reduceRight:4,foldr:4,find:3,detect:3,filter:3,select:3,reject:3,every:3,all:3,some:3,any:3,include:2,contains:2,invoke:0,max:3,min:3,toArray:1,size:1,first:3,head:3,take:3,initial:3,rest:3,tail:3,drop:3,last:3,without:0,difference:0,indexOf:3,shuffle:1,lastIndexOf:3,isEmpty:1,chain:1,sample:3,partition:3};u(b,S,"models");var x=["groupBy","countBy","sortBy","indexBy"];n.each(x,function(e){if(!n[e])return;b.prototype[e]=function(t,r){var i=n.isFunction(t)?t:function(e){return e.get(t)};return n[e](this.models,i,r)}});var T=t.View=function(e){this.cid=n.uniqueId("view"),n.extend(this,n.pick(e,C)),this._ensureElement(),this.initialize.apply(this,arguments)},N=/^(\S+)\s*(.*)$/,C=["model","collection","el","id","attributes","className","tagName","events"];n.extend(T.prototype,a,{tagName:"div",$:function(e){return this.$el.find(e)},initialize:function(){},render:function(){return this},remove:function(){return this._removeElement(),this.stopListening(),this},_removeElement:function(){this.$el.remove()},setElement:function(e){return this.undelegateEvents(),this._setElement(e),this.delegateEvents(),this},_setElement:function(e){this.$el=e instanceof t.$?e:t.$(e),this.el=this.$el[0]},delegateEvents:function(e){e||(e=n.result(this,"events"));if(!e)return this;this.undelegateEvents();for(var t in e){var r=e[t];n.isFunction(r)||(r=this[r]);if(!r)continue;var i=t.match(N);this.delegate(i[1],i[2],n.bind(r,this))}return this},delegate:function(e,t,n){return this.$el.on(e+".delegateEvents"+this.cid,t,n),this},undelegateEvents:function(){return this.$el&&this.$el.off(".delegateEvents"+this.cid),this},undelegate:function(e,t,n){return this.$el.off(e+".delegateEvents"+this.cid,t,n),this},_createElement:function(e){return document.createElement(e)},_ensureElement:function(){if(!this.el){var e=n.extend({},n.result(this,"attributes"));this.id&&(e.id=n.result(this,"id")),this.className&&(e["class"]=n.result(this,"className")),this.setElement(this._createElement(n.result(this,"tagName"))),this._setAttributes(e)}else this.setElement(n.result(this,"el"))},_setAttributes:function(e){this.$el.attr(e)}}),t.sync=function(e,r,i){var s=k[e];n.defaults(i||(i={}),{emulateHTTP:t.emulateHTTP,emulateJSON:t.emulateJSON});var o={type:s,dataType:"json"};i.url||(o.url=n.result(r,"url")||F()),i.data==null&&r&&(e==="create"||e==="update"||e==="patch")&&(o.contentType="application/json",o.data=JSON.stringify(i.attrs||r.toJSON(i))),i.emulateJSON&&(o.contentType="application/x-www-form-urlencoded",o.data=o.data?{model:o.data}:{});if(i.emulateHTTP&&(s==="PUT"||s==="DELETE"||s==="PATCH")){o.type="POST",i.emulateJSON&&(o.data._method=s);var u=i.beforeSend;i.beforeSend=function(e){e.setRequestHeader("X-HTTP-Method-Override",s);if(u)return u.apply(this,arguments)}}o.type!=="GET"&&!i.emulateJSON&&(o.processData=!1);var a=i.error;i.error=function(e,t,n){i.textStatus=t,i.errorThrown=n,a&&a.call(i.context,e,t,n)};var f=i.xhr=t.ajax(n.extend(o,i));return r.trigger("request",r,f,i),f};var k={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};t.ajax=function(){return t.$.ajax.apply(t.$,arguments)};var L=t.Router=function(e){e||(e={}),e.routes&&(this.routes=e.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},A=/\((.*?)\)/g,O=/(\(\?)?:\w+/g,M=/\*\w+/g,_=/[\-{}\[\]+?.,\\\^$|#\s]/g;n.extend(L.prototype,a,{initialize:function(){},route:function(e,r,i){n.isRegExp(e)||(e=this._routeToRegExp(e)),n.isFunction(r)&&(i=r,r=""),i||(i=this[r]);var s=this;return t.history.route(e,function(n){var o=s._extractParameters(e,n);s.execute(i,o,r)!==!1&&(s.trigger.apply(s,["route:"+r].concat(o)),s.trigger("route",r,o),t.history.trigger("route",s,r,o))}),this},execute:function(e,t,n){e&&e.apply(this,t)},navigate:function(e,n){return t.history.navigate(e,n),this},_bindRoutes:function(){if(!this.routes)return;this.routes=n.result(this,"routes");var e,t=n.keys(this.routes);while((e=t.pop())!=null)this.route(e,this.routes[e])},_routeToRegExp:function(e){return e=e.replace(_,"\\$&").replace(A,"(?:$1)?").replace(O,function(e,t){return t?e:"([^/?]+)"}).replace(M,"([^?]*?)"),new RegExp("^"+e+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(e,t){var r=e.exec(t).slice(1);return n.map(r,function(e,t){return t===r.length-1?e||null:e?decodeURIComponent(e):null})}});var D=t.History=function(){this.handlers=[],n.bindAll(this,"checkUrl"),typeof window!="undefined"&&(this.location=window.location,this.history=window.history)},P=/^[#\/]|\s+$/g,H=/^\/+|\/+$/g,B=/#.*$/;D.started=!1,n.extend(D.prototype,a,{interval:50,atRoot:function(){var e=this.location.pathname.replace(/[^\/]$/,"$&/");return e===this.root&&!this.getSearch()},matchRoot:function(){var e=this.decodeFragment(this.location.pathname),t=e.slice(0,this.root.length-1)+"/";return t===this.root},decodeFragment:function(e){return decodeURI(e.replace(/%25/g,"%2525"))},getSearch:function(){var e=this.location.href.replace(/#.*/,"").match(/\?.+/);return e?e[0]:""},getHash:function(e){var t=(e||this).location.href.match(/#(.*)$/);return t?t[1]:""},getPath:function(){var e=this.decodeFragment(this.location.pathname+this.getSearch()).slice(this.root.length-1);return e.charAt(0)==="/"?e.slice(1):e},getFragment:function(e){return e==null&&(this._usePushState||!this._wantsHashChange?e=this.getPath():e=this.getHash()),e.replace(P,"")},start:function(e){if(D.started)throw new Error("Backbone.history has already been started");D.started=!0,this.options=n.extend({root:"/"},this.options,e),this.root=this.options.root,this._wantsHashChange=this.options.hashChange!==!1,this._hasHashChange="onhashchange"in window,this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!this.history&&!!this.history.pushState,this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(H,"/");if(this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var t=this.root.slice(0,-1)||"/";return this.location.replace(t+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;var r=document.body,i=r.insertBefore(this.iframe,r.firstChild).contentWindow;i.document.open(),i.document.close(),i.location.hash="#"+this.fragment}var s=window.addEventListener||function(e,t){return attachEvent("on"+e,t)};this._usePushState?s("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?s("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval));if(!this.options.silent)return this.loadUrl()},stop:function(){var e=window.removeEventListener||function(e,t){return detachEvent("on"+e,t)};this._usePushState?e("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&e("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),D.started=!1},route:function(e,t){this.handlers.unshift({route:e,callback:t})},checkUrl:function(e){var t=this.getFragment();t===this.fragment&&this.iframe&&(t=this.getHash(this.iframe.contentWindow));if(t===this.fragment)return!1;this.iframe&&this.navigate(t),this.loadUrl()},loadUrl:function(e){return this.matchRoot()?(e=this.fragment=this.getFragment(e),n.any(this.handlers,function(t){if(t.route.test(e))return t.callback(e),!0})):!1},navigate:function(e,t){if(!D.started)return!1;if(!t||t===!0)t={trigger:!!t};e=this.getFragment(e||"");var n=this.root;if(e===""||e.charAt(0)==="?")n=n.slice(0,-1)||"/";var r=n+e;e=this.decodeFragment(e.replace(B,""));if(this.fragment===e)return;this.fragment=e;if(this._usePushState)this.history[t.replace?"replaceState":"pushState"]({},document.title,r);else{if(!this._wantsHashChange)return this.location.assign(r);this._updateHash(this.location,e,t.replace);if(this.iframe&&e!==this.getHash(this.iframe.contentWindow)){var i=this.iframe.contentWindow;t.replace||(i.document.open(),i.document.close()),this._updateHash(i.location,e,t.replace)}}if(t.trigger)return this.loadUrl(e)},_updateHash:function(e,t,n){if(n){var r=e.href.replace(/(javascript:|#).*$/,"");e.replace(r+"#"+t)}else e.hash="#"+t}}),t.history=new D;var j=function(e,t){var r=this,i;e&&n.has(e,"constructor")?i=e.constructor:i=function(){return r.apply(this,arguments)},n.extend(i,r,t);var s=function(){this.constructor=i};return s.prototype=r.prototype,i.prototype=new s,e&&n.extend(i.prototype,e),i.__super__=r.prototype,i};g.extend=b.extend=L.extend=T.extend=D.extend=j;var F=function(){throw new Error('A "url" property or function must be specified')},I=function(e,t){var n=t.error;t.error=function(r){n&&n.call(t.context,e,r,t),e.trigger("error",e,r,t)}};return t}),define("app/events",["jquery","underscore","backbone"],function(e,t,n){"use strict";var r=t.extend({},n.Events);return r}),define("app/resizer",["jquery","jquery","underscore","backbone","app/events"],function(e,t,n,r,i){"use strict";var s=r.Model.extend({handlers:{},init:function(){var t=this;e(window).resize(function(){var n=t.getViewportWidth();t.resizeEvent(n,e(window).height())})},getViewportWidth:function(){return e(window).width()},resizeEvent:function(e,t){for(var n in this.handlers)this.handlers[n].handlerAction(n,this.handlers[n].handler,e,t),this.handlers[n].handler.trigger("oumpResizer")},addHandler:function(e,t,n){this.handlers[e]={handler:t,handlerAction:n}},removeHandler:function(e){delete this.handlers[e]},getSmartClass:function(e,t){switch(e){case"tiny":case"small":case"default":case"medium":case"wide":case"smart":return e}return t<461?"tiny":t>=461&&t<536?"small":t>=535&&t<651?e=="smart"?e:"default":t>650&&t<801?e=="smart"?e:"medium":e=="smart"?e:"wide"},getSmartWidth:function(e,t,n){var r=0,i=0,s=0,o=this.getViewportWidth();n!=undefined&&(o=n);if(isNaN(t)||!t)t=640;t>1024&&(t=1024);if(e===undefined||e==="none")e="default";switch(e){case"tiny":i=310,s=460;break;case"small":i=310,s=480;break;case"default":case"smart":i=310,s=640;break;case"medium":i=640,s=800;break;case"wide":i=800,s=1024;break;case"fixed":case"custom":t<=310?(i=0,s=310):o>310&&o<=460?(i=310,s=460):(i=460,s=t)}if(e=="smart"||e=="custom")if(t<=o){if(t>0&&t<=310)return 310;if(t>310&&t<=460)return this.getSmartWidth("small",t);if(t>460&&t<=640)return this.getSmartWidth("default",t);if(t>640&&t<=800)return this.getSmartWidth("medium",t);if(t>800)return this.getSmartWidth("wide",t)}else{if(o>0&&o<=310)return 310;if(o>310&&o<=460)return this.getSmartWidth("small",t);if(o>460&&o<=640)return this.getSmartWidth("default",t);if(o>640&&o<=800)return this.getSmartWidth("medium",t);if(o>800)return this.getSmartWidth("wide",t)}else{if(e=="fixed")return t<310?310:t;if(t<i||t>s)switch(e){case"tiny":case"small":case"default":case"medium":case"wide":return t<i?this.getSmartWidth(e,i):this.getSmartWidth(e,s)}}return t}});return s}),define("app/models/cue",["backbone","underscore"],function(e,t){"use strict";var n=e.Model.extend({defaults:{isActive:!1,text:"",id:"",startTime:null,endTime:null},initialize:function(){}});return n}),define("app/models/track",["backbone","underscore","app/models/cue"],function(e,t,n){"use strict";var r=e.Model.extend({defaults:{cues:{},srcLang:"",isDefault:!1,src:"",isLoaded:!1},initialize:function(){}});return r}),define("app/collections/tracks",["backbone","underscore","app/models/track"],function(e,t,n){"use strict";var r=e.Collection.extend({model:n});return r}),define("app/helpers/utilities",["backbone","underscore","jquery","app/models/track","app/models/cue","app/collections/tracks"],function(e,t,n,r,i,s){"use strict";function o(e){var t={},n,r;for(n=0;r=e.attributes[n];n++)u(t,r.name,r.value);for(n=0;r=e.childNodes[n];n++)r.nodeType==1&&(r.childNodes.length!=1||r.firstChild.nodeType!=3&&r.firstChild.nodeType!=4?u(t,r.nodeName,o(r)):u(t,r.nodeName,r.firstChild.nodeValue));return t}function u(e,t,n){e[t]?(e[t].constructor!=Array&&(e[t]=[e[t]]),e[t][e[t].length]=n):(t=="playlist"&&n.item!=undefined&&n.item.length==undefined&&(n.item=[n.item]),e[t]=n)}var a=t.extend({},{xmlToJsonObject:o,createTrackListFromRawTracks:function(e){var n=[];return t.each(e,function(e,t){e.type=="text/vtt"&&n.push(e)}),new s(t.map(n,function(e){var t=e.label.replace(/ /g,"_");return t=t.toLowerCase(),new r({isDefault:e.isDefaultTrack,kind:e.kind,label:e.label,customLabel:t,src:e.src,srcLang:e.srclang.toLowerCase(),type:e.type})}))},createTrackListFromCustomTracks:function(e,n,o){if(n!=undefined&&n.length>0){var u=new s;for(var f=0;f<n.length;f++)if(n[f].kind!=undefined&&n[f].srclang!=undefined&&n[f].kind==o){var l=n[f].label,c=l;n[f].label!=undefined&&(c=n[f].label.replace(/ /g,"_"),l=n[f].label),c=c.toLowerCase();var h=n[f].cues;switch(n[f].kind){case"chapters":var p=e.findWhere({srcLang:n[f].srclang,customLabel:c});break;default:var p=u.findWhere({srcLang:n[f].srclang})}if(p==undefined){u.add(new r({isDefault:!0,kind:n[f].kind,label:l,customLabel:c,src:"",srcLang:n[f].srclang,type:"text/vtt"}));switch(n[f].kind){case"chapters":var p=u.findWhere({srcLang:n[f].srclang,customLabel:c});break;default:var p=u.findWhere({srcLang:n[f].srclang})}}if(p&&h.length>0){var d=t.map(h,function(e,t){var n=e.cueId,r=a.parseTimestamp(e.startTime),s=a.parseTimestamp(e.endTime),o=e.text;return new i({startTime:r,endTime:s,text:o,cueId:n})});p.set("cues",d),p.set("isLoaded",!0)}}u.length>0&&(e=u)}return e},createAudioListFromRawTracks:function(e){var n=[];return t.each(e,function(e,t){switch(e.type){case"audio/mp3":case"audio/mp4":case"audio/m4a":case"audio/ogg":case"audio/opus":case"audio/wav":case"audio/webm":n.push(e)}}),new s(t.map(n,function(e){var t=e.label.replace(/ /g,"_");return t=t.toLowerCase(),new r({isDefault:e.isDefaultTrack,kind:e.kind,label:e.label,customLabel:t,src:e.src,srcLang:e.srclang.toLowerCase(),type:e.type})}))},initTrackFromSrc:function(e,t,n){var r=this;this.initFromSrc(e,t,function(e){e==null?n.call(null):r.loadTrackFromSrc(e,n)})},initAudioFromSrc:function(e,t,n){var r=this;this.initFromSrc(e,t,function(e){n(e)})},initFromSrc:function(e,n,r){var i=this,s=n.get("src"),o=n.get("kind"),u=n.get("label"),a=[],f=null;this.checkExistFile(s,function(f){if(f)r(n);else{switch(o.toLowerCase()){case"chapters":var l=t.filter(e,function(e){return e.get("src")!=s&&e.get("label")==u&&e.get("srcLang").toLowerCase()=="en"?s:null}),c=t.filter(e,function(e){return e.get("src")!=s&&e.get("label")==u&&e.get("srcLang").toLowerCase()!="en"?s:null});this.mergeByProperty(l,c,"cid");if(l.length>0){var h=l[0];a=l}else if(l.length>0){var h=c[0];a=c}else a=[];break;default:var l=t.filter(e,function(e){return e.get("src")!=s&&e.get("srcLang")=="en"?s:null}),c=t.filter(e,function(e){return e.get("src")!=s&&e.get("srcLang")!="en"?s:null});this.mergeByProperty(l,c,"cid");if(l.length>0){var h=l[0];a=l}else if(l.length>0){var h=c[0];a=c}else a=[]}a.length>0&&h?i.initFromSrc(a,h,r):r.call(null)}})},loadTrackFromSrc:function(e,r){if(e.get("kind")=="subtitles"){r(null,e),e.set("isLoaded",!0);return}n("body").append('<video id="oump-dummy-video-'+e.get("kind")+'" style="display:none" />');var s="metadata",o="transcripts, annotations, descriptions, scripts";o.indexOf(e.get("kind"))==-1&&(s=e.get("kind"));var u=n("#oump-dummy-video-"+e.get("kind")),a=n("<track />",{kind:s,src:e.get("src"),"default":"default",srclang:e.get("srcLang")});a.appendTo(u),a.on("load",function(){var n=t.map(u[0].textTracks[0].cues,function(t,n){var r=t.id==-1||e.get("kind")!="scripts"&&e.get("kind")!="annotations"&&e.get("kind")!="descriptions"&&e.get("kind")!="audiodescriptions"?n+1:t.id;return new i({startTime:t.startTime,endTime:t.endTime,text:t.text,cueId:r})});e.set("cues",n),e.set("isLoaded",!0),a.remove(),u.remove(),r(null,e)}),a.on("error",function(){r(null,!1)})},toHHMMSS:function(e){var t=parseInt(e,10),n=Math.floor(t/3600),r=Math.floor((t-n*3600)/60),i=t-n*3600-r*60,s="";return n>0&&(s=n+":"),r<10?s=s+"0"+r+":":s=s+r+":",i<10?s=s+"0"+i:s+=i,s},getParameterByName:function(e,t){t||(t=window.location.href),t=t.toLowerCase(),e=e.replace(/[\[\]]/g,"\\$&").toLowerCase();var n=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)"),r=n.exec(t);return r?r[2]?decodeURIComponent(r[2].replace(/\+/g," ")):"":null},getAbsoluteSrc:function(e,t){var n=e.split("/"),r=t.split("/");n.pop();for(var i=0;i<r.length;i++){if(r[i]==".")continue;r[i]==".."?n.pop():n.push(r[i])}return n.join("/")},createCircleLoading:function(e,t,r,i,s,o,u){if(n("#"+t+"_canvas").length>0)return;i=typeof i==undefined?10:parseInt(i);var a;switch(window.oump.browser){case"firefox":a=87;break;case"msie":a=69;break;default:a=96}var f=r.offsetWidth,l=r.offsetWidth;n("#"+t+"_progress_waiting_icon").height(r.offsetWidth);var c=document.createElement("canvas");c.id=t+"_canvas",c.width=f,c.height=l,c.style.cssText="width: "+f+"px",r.appendChild(c);var h=c.getContext("2d");h.lineWidth=5,h.strokeStyle="#85c3b8",h.shadowColor="black",h.shadowOffsetX=0,h.shadowOffsetY=0,h.shadowBlur=0,h.font="17px verdana";var p=Math.PI/2,d=Math.PI*2,v=0,m=[];m.push({x:f/2-.5,y:l/2-.5,radius:f/2-3,start:0,end:10*i,color:"#EEEEEE"});var g={animate:function(){v<=10*i+2?s[o]=setTimeout(function(){requestAnimationFrame(g.animate),g.drawAll(v),v+=1},a):u()},render:function(e,t){var n=t/(10*i),r=(e.end-e.start)/(10*i)*d*n-p;h.beginPath(),h.arc(e.x,e.y,e.radius,-p,r),h.strokeStyle=e.color,h.stroke(),h.fillStyle=e.color},drawAll:function(e){h.clearRect(0,0,c.width,c.height);for(var t=0;t<m.length;t++)this.render(m[t],e)}};n(window).resize(function(){var e=n(r).width();n("#"+t+"_progress_waiting_icon").height(e),n("#"+t+"_canvas").width(e)}),g.animate()},getFileName:function(e){return e?e.substring(e.lastIndexOf("/")+1):""},checkExistFile:function(e,t){var r=this;n.ajax({url:e,type:"HEAD",success:function(){t.call(r,!0)},error:function(){t.call(r,!1)}})},getFileSize:function(e,t){var r=this;n.ajax({url:e,type:"HEAD",success:function(e,n,i){var s=i.getResponseHeader("Content-Length");t.call(r,s)},error:function(){t.call(r,!1)}})},loadNormalContentFromSrc:function(e,t){n.ajax({url:e,type:"GET",success:function(e){t.call(this,e)},error:function(){t.call(this,!1)}})},getFullscreenEvent:function(){if(window.fullscreenEvent)return;var e;return document.requestFullscreen?e="fullscreenchange":document.msRequestFullscreen?e="MSFullscreenChange":document.mozRequestFullScreen?e="mozfullscreenchange":document.webkitRequestFullscreen?e="webkitfullscreenchange":document.webkitEnterFullscreen&&(e="webkitfullscreenchange"),document.exitFullscreen?e="fullscreenchange":document.msRequestFullscreen?e="MSFullscreenChange":document.mozCancelFullScreen?e="mozfullscreenchange":document.webkitExitFullscreen&&(e="webkitfullscreenchange"),window.fullscreenEvent=e,e},getPageVisibility:function(){var e,t;return typeof document.hidden!="undefined"?(t="hidden",e="visibilitychange"):typeof document.mozHidden!="undefined"?(t="mozHidden",e="mozvisibilitychange"):typeof document.msHidden!="undefined"?(t="msHidden",e="msvisibilitychange"):typeof document.webkitHidden!="undefined"&&(t="webkitHidden",e="webkitvisibilitychange"),{hidden:t,visibilityChange:e}},getDefaultLangFromTrack:function(e,t,n){var r="en";switch(n){case"chapter":var i=t.findWhere({srcLang:r,customLabel:e.get("currentChapterLabel")});break;default:var i=t.findWhere({srcLang:r})}return i?r:(t.models.every(function(i){var s=i.get("srcLang");switch(n){case"chapter":var o=t.findWhere({srcLang:s,customLabel:e.get("currentChapterLabel")});break;default:var o=t.findWhere({srcLang:s})}if(o)return r=s,!1}),r)},mergeByProperty:function(e,n,r){t.each(n,function(n){var i=t.find(e,function(e){return e[r]===n[r]});i?t.extend(i,n):e.push(n)})},removeSimpleXSS:function(e){if(e.match(/(<script.*>(.*)(<\/script>)?)/ig)||e.match(/<[^>]*\son[a-zA-Z]+=['"][^'"]*['"][^>]*>/ig))e=t.escape(e);return e},parseXML:function(e){if(window.DOMParser)return(new window.DOMParser).parseFromString(e,"text/xml");if(typeof window.ActiveXObject!="undefined"&&new window.ActiveXObject("Microsoft.XMLDOM")){var t=new window.ActiveXObject("Microsoft.XMLDOM");return t.async="false",t.loadXML(e),t}return null},loadSVG:function(e,t){typeof t=="undefined"&&(t="inline-block");try{setTimeout(function(){n(e).css("display","none"),n(e).css("display",t)},500)}catch(r){console.log("Svg not found")}},hostnameFromURL:function(e){var t=document.createElement("a");return t.href=e,t.protocol+"//"+t.hostname},parseTimestamp:function(e){var t=e.match(/^(?:([0-9]{2,}):)?([0-5][0-9]):([0-5][0-9][.,][0-9]{0,3})/);if(t==null)throw"Invalid timestamp format: "+e;var n=parseInt(t[1]||"0",10),r=parseInt(t[2],10),i=parseFloat(t[3].replace(",","."));return i+60*r+3600*n},ucFirst:function(e){return e.charAt(0).toUpperCase()+e.slice(1)},secondsToTime:function(e){var t=e.toString().split("."),n=t[0],r=".000";if(t[1]!=undefined)var r="."+t[1];var i=parseInt(n/3600)%24,s=parseInt(n/60)%60,o=n%60,u=(i<10?"0"+i:i)+":"+(s<10?"0"+s:s)+":"+(o<10?"0"+o+r:o+r);return u},getVttContent:function(e){var t="";for(var n=0;n<e.length;n++){var r=a.secondsToTime(e[n].get("startTime")),i=a.secondsToTime(e[n].get("endTime"));t+=e[n].get("cueId")+"\n",t+=r+" --> "+i+"\n",t+=e[n].get("text")+"\n\n"}return t},vttParser:function(e){var t=e.trim().replace("\r\n","\n").split(/[\r\n]/).map(function(e){return e.trim()}),n,r=[],s=null,o=null,u=null,a=null;for(var f=0;f<t.length;f++)if(t[f].indexOf("-->")>=0){var l=t[f].split(/[ \t]+-->[ \t]+/);if(l.length!=2)throw'Error when splitting "-->": '+t[f];o=this.parseTimestamp(l[0]),u=this.parseTimestamp(l[1]),s=t[f-1],a=t[f+1];for(var c=f+2;c<=f+20;c++){if(!t[c])break;a+="\n"+t[c]}s&&o>=0&&u>0&&(n=new i({startTime:o,endTime:u,text:a,cueId:s}),r.push(n))}return r},checkEpubformat:function(e){return e.get("epub")!=undefined&&e.get("epub")=="true"?!0:!1},renderStylesheet:function(e,t){n.when(n.get(e)).done(function(e){if(e!=undefined){var e=e.replace(/..\/img\//g,t);n("<style />").text(e).appendTo(n("head"))}})},escapeHtml:function(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")},convertFileSize:function(e,t){if(e==0)return"0 Byte";var n=1e3,r=t+1||3,i=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],s=Math.floor(Math.log(e)/Math.log(n)),o=parseFloat((e/Math.pow(n,s)).toFixed(r));return Math.round(o*10)/10+" "+i[s]},createUrl:function(e,t,n){return e=e||"",t=t||"",n=n||"",typeof t!="string"||typeof (e+t+n)!="string"?t:t.search("/")==-1?t:t.search("http")>-1?t:(t=e!=""?t.replace("./",""):t,this.cleanUrl(e+t+n))},cleanUrl:function(e){var t;return!e||typeof e!="string"||e.search("http")==-1?e:(t=e.match(/(.*)(:\/\/)(.*)/),t[1]||(t[1]=""),t[2]||(t[2]=""),t[3]?t[3]=t[3].replace(/\/(\/+)/g,"/"):t[3]="",e=t[1]+t[2]+t[3],e)}});return a}),define("app/models/api",["jquery","jquery","underscore","backbone","app/resizer","app/helpers/utilities"],function(e,t,n,r,i,s){"use strict";var o=r.Model.extend({exec:function(e,t){return this[e]&&this[e].call(this,t),this},play:function(){this.get("playerState")=="notactivated"&&this.trigger("oump_active_player"),this.get("playerState")=="pause"&&this.trigger("oumpPlay")},pause:function(){this.get("playerState")=="play"&&this.trigger("oumpPause")},stop:function(){this.trigger("oumpStop")},mute:function(){this.trigger("oumpMute")},unmute:function(){this.trigger("oumpUnmute")},volup:function(){this.trigger("oump_volup")},voldown:function(){this.trigger("oump_voldown")},fullscreen:function(){this.trigger("oump_fullscreen")},activeFeature:function(e){var t=e[0],n=e[1];if(typeof n!="boolean")return;var r=t+"Active";this.trigger("activeFeature",[r,n])},activeFeatureMode:function(e){var t=e[0],n=e[1];if(typeof n!="boolean")return;this.trigger("activeFeatureMode",[t,n])},activePlayer:function(){this.get("playerState")==="notactivated"&&this.trigger("oump_active_player")},loadTrack:function(e){if(e.id!=undefined){var t=!1,n,r="",i=this.get("activeLanguage");if(e.kind!=undefined){switch(e.kind){case"subtitles":n=this.get("closedCaptionsActive"),r="subtitles",t=!0;break;case"chapters":n=this.get("chapterActive"),r="chapters",t=!0;break;case"descriptions":r="textdescriptions",n=this.get("textDescriptionActive"),t=!0;break;case"audiodescriptions":r="audiodescriptions",n=this.get("audioDescriptionActive"),t=!0;break;case"annotations":r="annotations",n=this.get("annotationsActive"),t=!0;break;case"transcripts":r="transcripts",n=this.get("transcriptActive"),t=!0}t&&n&&(console.log("API load track for "+e.kind),this.set("apiTrackOptions",e),this.trigger("oump_load_tracks_"+r))}}},setTrack:function(e){if(e.id!=undefined){var t=!1,n,r="",i=this.get("activeLanguage");if(e.kind!=undefined){switch(e.kind){case"subtitles":n=this.get("closedCaptionsActive"),r="subtitles",t=!0;break;case"chapters":n=this.get("chapterActive"),r="chapters",t=!0;break;case"descriptions":r="textdescriptions",n=this.get("textDescriptionActive"),t=!0;break;case"audiodescriptions":r="audiodescriptions",n=this.get("audioDescriptionActive"),t=!0;break;case"annotations":r="annotations",n=this.get("annotationsActive"),t=!0;break;case"transcripts":r="transcripts",n=this.get("transcriptActive"),t=!0}t&&n&&(console.log("API update track for "+e.kind),this.set("apiTrackOptions",e),this.trigger("oump_set_tracks_"+r))}}},updateTrack:function(e){if(e.length>0){var t=this.get("features");for(var n=0;n<e.length;n++){var r=!1,i="",s=this.get("activeLanguage");if(e[n].kind!=undefined){switch(e[n].kind){case"subtitles":i="subtitles",t.hasTracksSubtitles=!0,r=!0;break;case"chapters":i="chapters",t.hasTracksChapters=!0,r=!0;break;case"descriptions":i="textdescriptions",t.hasTracksDescriptions=!0,r=!0;break;case"audiodescriptions":i="audiodescriptions",t.hasAudiodescriptions=!0,r=!0;break;case"annotations":i="annotations",t.hasTracksAnnotations=!0,r=!0;break;case"scripts":i="scripts",t.hasTracksScripts=!0,r=!0;break;case"transcripts":i="transcripts",t.hasTranscript=!0,r=!0}if(r){var o=e[n].srclang!=undefined?e[n].srclang:"en";console.log("API update track for "+e[n].kind),this.addTrack(e[n].kind,e[n].type,"",o,e[n].label,!1,null)}}}this.set("apiOptions",e),this.set("features",t)}}});return o}),define("app/models/baseModel",["jquery","jquery","underscore","backbone","app/resizer","app/helpers/utilities","app/models/api"],function(e,t,n,r,i,s,o){"use strict";var u=o.extend({defaults:{wwwroot:!1,player:"html5",provider:"open university",sourceflv:!1,sources:[],sources2:[],sources3:[],defaultSource:!1,flashSource:!1,flashPlayer:!1,trackDefault:!1,tracksCaptions:[],tracksChapters:[],tracksDescriptions:[],tracksMetadata:[],tracksTranscripts:[],tracksSubtitles:[],tracksAudiodescriptions:[],tracksAnnotations:[],tracksScripts:[],forceDefaultSettings:!0,isIE8:!1,isIE9:!1,id:!1,className:!1,title:!1,summary:!1,summaryShort:!1,copyright:!1,transcript:!1,transcripts:[],autoplay:!1,crossorigin:"anonymous",controls:"controls",loop:!1,muted:!1,poster:"",posterIsDefault:!0,preload:"metadata",sizing:"none",activeSizing:"none",aspect:"16:9",height:!1,orig_height:300,width:!1,orig_width:!1,activeWidth:!1,heightContainer:!1,widthContainer:!1,inlineContainer:!1,canPlay:{},features:{hasBasicControls:!0,hasPoster:!1,hasSources:!1,hasSummary:!1,hasTitle:!1,hasTracksCaptions:!1,hasTracksChapters:!1,hasTracksDescriptions:!1,hasAudiodescriptions:!1,hasTracksMetadata:!1,hasTracksTranscripts:!1,hasTracksSubtitles:!1,hasTranscript:!1,hasTracksAnnotations:!1,hasTracksScripts:!1,hasCopyright:!1,hasPlaylist:!1,hasShare:!0,hasAutoplay:!0,hasLanguage:!0,hasSettings:!0,hasDownload:!0},keystrokes:["playpause","stop","volup","voldown","mute","seekback","seekforwards","fullscreen","subtitle","nextsubtitle","jumpback","jumpforwards","start","end","nextmediaelement"],preventedKeys:[],tabs:{start:1,annotations:2,videonavigation:3,leftControls:4,playlist:12,chapters:22,transcripts:32,cc:42,settings:52,download:62,rightControls:72,mediaInfo:73,end:999},showCaptions:!1,volume:.5,oldVolume:.5,increment:1/8,duration:0,contextid:null,ratioFixed:!1,iOSBaseUrl:"",baseUrl:"",isFullscreen:!1,activeLanguage:"en",defaultLanguage:"en",disableTranscript:!1,html:"",showButtons:!1,isOtherProvider:!1,tracksLanguages:[],tracksLabels:[],currentChapterLabel:"Chapters",hasPlaylist:!1,playlistItem:undefined,renderStyle:"advance",timeoutid:{controlbar:null},activeQuality:!1,autoplayActive:!1,textDescriptionActive:!1,audioDescriptionActive:!1,annotationActive:!0,closedCaptionsActive:!1,chapterActive:!1,transcriptActive:!1,annotationsActive:!0,scriptsActive:!0,playlistActive:!1,mediaInfoActive:!0,downloadActive:!1,playerState:!1,autoPlayDuration:10,hasShare:!0,hasSummary:!1,hasTitle:!1},getSourceByType:function(e){var t=this.get("sources");for(var n=0,r=t.length;n<r;n++)if(t[n].kind==e)return t[n];return!1},addTrack:function(e,t,r,i,s,o,u){var a=e.toLowerCase(),f=!1;switch(a){case"captions":case"chapters":case"descriptions":case"audiodescriptions":case"subtitles":case"metadata":case"annotations":case"scripts":case"transcripts":var l={kind:a,type:t,src:r,srclang:i,label:s,isDefaultTrack:o},c="tracks"+e.charAt(0).toUpperCase()+e.slice(1),h=n.clone(this.get(c));for(var p=0,d=h.length;p<d;p++)h[p].src==l.src&&l.src&&(f=!0);f||(h.push(l),this.set(c,h),o&&this.get("trackDefault")==0&&this.set("trackDefault",l));break;default:}u!=null&&u.call(this)},addCaption:function(e,t,n,r,i){this.addTrack("captions",e,t,n,r,i)},addChapter:function(e,t,n,r,i){this.addTrack("chapters",e,t,n,r,i)},addDescription:function(e,t,n,r,i){this.addTrack("descriptions",e,t,n,r,i)},addAudioDescription:function(e,t,n,r,i){this.addTrack("audiodescriptions",e,t,n,r,i)},addSubtitle:function(e,t,n,r,i){this.addTrack("subtitles",e,t,n,r,i)},resizeEvent:function(t,n,r,s){var o=n.get("sizing"),u=n.get("width"),a=n.get("activeSizing");if(o=="custom"||o=="smart"){var f=new i;o=="custom"?r<u?a=f.getSmartClass(o,r):a=f.getSmartClass(o,u):a=f.getSmartClass(o,r),(a=="tiny"||a=="small")&&n.set("activeSizing",a)}var l=e("#"+t),c;l.removeClass("omp-tiny omp-small omp-default omp-medium omp-wide omp-smart"),c=l.attr("class"),l.addClass(c+" omp-"+a),n.trigger("oump_resize",{id:t})},checkExistDefaultSource:function(){var e=this.get("sources");for(var t=0,n=e.length;t<n;t++)if(e[t].isDefault)return!0;return!1},checkHasFeature:function(e){var t=this.get("features"),n=!1;switch(e){case"controls":n=t.hasBasicControls;break;case"sources":n=t.hasSources;break;case"chapters":n=t.hasTracksChapters;break;case"textdescriptions":n=t.hasTracksDescriptions;break;case"audiodescriptions":n=t.hasAudiodescriptions;break;case"metadata":n=t.hasMetadata;break;case"transcript":case"transcripts":n=t.hasTranscript;break;case"subtitles":n=t.hasTracksSubtitles;break;case"title":n=t.hasTitle;break;case"description":n=t.hasSummary;break;case"playlist":n=this.get("hasPlaylist")&&t.hasPlaylist;break;case"share":n=t.hasShare;break;case"fullscreen":n=t.hasFullscreen;break;case"annotation":n=t.hasTracksAnnotations;break;case"scripts":n=t.hasTracksScripts;break;case"quality":n=t.hasQuality;break;case"autoplay":n=t.hasAutoplay;break;case"language":n=t.hasLanguage;break;case"download":n=t.hasDownload;break;case"setting":case"settings":n=t.hasSettings;break;case"captions":n=t.hasTracksSubtitles;break;case"copyright":n=t.hasCopyright;break;case"mediainfo":n=t.hasCopyright||t.hasTitle||t.hasSummary||t.hasShare;break;case"poster":n=t.hasPoster;break;case"minimal":n=!this.checkHasFeature("poster")&&!this.checkHasFeature("annotation")&&!this.checkHasFeature("textdescriptions")&&!this.checkHasFeature("playlist")}return n},set:function(e,t,n){if(n&&n.useDefault==1)return r.Model.prototype.set.call(this,e,t,n);switch(e){case"playlistItem":if(t){var i,o=t.length;for(i=0;i<o;i++)t[i].hasOwnProperty("src")&&(t[i].src=s.createUrl(this.get("baseUrl"),t[i].src))}break;case"baseUrl":case"iOSBaseUrl":t.length>0&&(t+=t[t.length-1]=="/"?"":"/",t=t.trim());break;case"sourcemp4":case"sourcemp3":case"sourceflv":case"defaultSource":case"flashSource":t=s.createUrl(this.get("iOSBaseUrl"),t);break;case"poster":case"playlistSrc":t=s.createUrl(this.get("baseUrl"),t);break;case"sources":case"sources2":case"sources3":var i,o=t.length;for(i=0;i<o;i++)t[i].hasOwnProperty("src")&&(t[i].src=s.createUrl(this.get("iOSBaseUrl"),t[i].src));break;case"tracksCaptions":case"tracksChapters":case"tracksDescriptions":case"tracksMetadata":case"tracksTranscripts":case"tracksSubtitles":case"tracksAudiodescriptions":case"tracksAnnotations":case"tracksScripts":var i,o=t.length;for(i=0;i<o;i++)t[i].hasOwnProperty("src")&&(t[i].src=s.createUrl(this.get("baseUrl"),t[i].src));break;case"transcripts":var u,a;for(u in t)for(a in t[u])typeof t[u][a]=="string"&&(t[u][a]=s.createUrl(this.get("baseUrl"),t[u][a]));break;default:}return r.Model.prototype.set.call(this,e,t,n)},preventMyKeyHandler:function(e,t){var r=this.get("preventedKeys");switch(e){case"add":n.each(t,function(e){r.push(e)});break;case"remove":r=n.reject(r,function(e){return t.indexOf(e)>-1})}this.set("preventedKeys",r)},extractQuality:function(e){var t=e.split("/").slice(-1)[0],n=t.match(/[-_]?([0-9]+x[0-9]+)\./ig);return n?n=n[0].replace(/[-_.]/g,""):n=t,n}});return u}),define("app/models/video",["jquery","jquery","underscore","backbone","app/resizer","app/helpers/utilities","app/models/baseModel"],function(e,t,n,r,i,s,o){"use strict";var u=o.extend({defaults:n.extend({},o.prototype.defaults,{type:"video",sourcemp4:!1}),getDefaultSource:function(e){var t=!1,n=this.get("sources"),r=[],i=[];for(var s=0,o=n.length;s<o;s++){if(n[s].kind=="video/mp4")var u=r;else var u=i;n[s].resolution&&u.push(n[s].resolution)}r.sort(function(e,t){return e-t}),i.sort(function(e,t){return e-t});for(var s=0,o=n.length;s<o;s++)if(n[s].isDefault){t=n[s];break}if(t==0){var a="video/mp4";for(var s=0,o=n.length;s<o;s++)if(n[s].kind==a&&n[s].resolution&&r.length>0&&n[s].resolution==r[0]){t=n[s];break}}if(t==0)for(var s=0,o=n.length;s<o;s++){if(n[s].resolution&&i.length>0&&n[s].resolution==i[0]){t=n[s];break}break}return t==0&&n.length>0&&(t=n[0]),t==0?(this.set("defaultSource",""),""):(this.set("defaultSource",t.src),e?t:t.src)},addSource:function(e,t,r,i,o){if(e.substr(-4)==".xml")return;if(t===!1){var u=e.split("/").pop().replace(/\#(.*?)$/,"").replace(/\?(.*?)$/,"");u=u.split(".");switch(u[1]||""){case"mp4":case"m4v":t="video/mp4";break;case"webm":t="video/webm";break;case"ogg":case"ogv":t="video/ogg";break;case"flv":t="video/flash";break;case"swf":t="application/x-shockwave-flash"}}else if(t=="video/x-flv"||t=="video/x-fla"||t=="application/x-shockwave-flash"||t=="video/flv")t="video/flash";if(r===undefined||r===!1||r==="")r=this.extractQuality(e);if(i===undefined||i===!1||this.checkExistDefaultSource())i=!1;var a={src:e,kind:t,quality:r,isDefault:i,resolution:o},f=n.clone(this.get("sources")),l=!1;for(var c=0,h=f.length;c<h;c++)s.getFileName(f[c].src)==s.getFileName(a.src)&&(l=!0);l||(f.push(a),this.set("sources",f));for(var c=0,h=f.length;c<h;c++)if(f[c].kind=="video/flash"){this.set("flashSource",f[c].src);break}for(var c=0,h=f.length;c<h;c++)if(f[c].kind=="video/mp4"){this.set("flashSource",f[c].src);break}this.updateSources()},updateSources:function(){var e=this.get("isIE8"),t=!1,r=[],i=this.getDefaultSource(!0),s=i;i&&r.push(i),i=this.getSourceByType("video/mp4"),i&&i!=s&&r.push(i),i&&(this.set("sourcemp4",i.src),t=!0),e||(i=this.getSourceByType("video/ogg"),i&&i!=s&&r.push(i),i=this.getSourceByType("video/webm"),i&&i!=s&&r.push(i)),i=this.getSourceByType("video/flash"),i&&(r.push(i),this.set("sourceflv",i.src)),this.set("sources2",r);var o=[],u=this.get("canPlay"),a=n.clone(this.get("sources"));if(e||n.isEmpty(u))i=this.getSourceByType("video/flash"),o.push(i),i=this.getSourceByType("video/mp4"),o.push(i);else for(var f=0,l=a.length;f<l;f++)a[f].kind=="video/mp4"&&(u.mpeg4||u.h264)&&o.push(a[f]),a[f].kind=="video/ogg"&&u.ogg&&o.push(a[f]),a[f].kind=="video/webm"&&u.webm&&o.push(a[f]),a[f].kind=="video/flash"&&o.push(a[f]),a[f].kind=="video/m4v"&&u.m4v&&o.push(a[f]);this.set("sources3",o)},updateSubtitles:function(){if(this.get("isIE9")){var e=this.get("features");e.hasTracksSubtitles=!1,this.set("features",e)}}});return u}),define("app/collections/videos",["underscore","backbone","app/models/video"],function(e,t,n){"use strict";var r=t.Collection.extend({model:n});return r}),define("app/models/audio",["jquery","jquery","underscore","backbone","app/resizer","app/helpers/utilities","app/models/baseModel"],function(e,t,n,r,i,s,o){"use strict";var u=o.extend({defaults:n.extend({},o.prototype.defaults,{type:"audio",sourcemp3:!1}),getDefaultSource:function(e){var t=!1,n=this.get("sources"),r=[],i=[];for(var s=0,o=n.length;s<o;s++){if(n[s].kind=="audio/mp3")var u=r;else var u=i;n[s].resolution&&u.push(n[s].resolution)}r.sort(function(e,t){return e-t}),i.sort(function(e,t){return e-t});for(var s=0,o=n.length;s<o;s++)if(n[s].isDefault){t=n[s];break}if(t==0){var a="audio/mp3";for(var s=0,o=n.length;s<o;s++)if(n[s].kind==a){if(n[s].resolution&&r.length>0&&n[s].resolution==r[0]){t=n[s];break}break}}if(t==0)for(var s=0,o=n.length;s<o;s++){if(n[s].resolution&&i.length>0&&n[s].resolution==i[0]){t=n[s];break}break}return t==0&&(t=n[0]),this.set("defaultSource",t.src),e?t:t.src},addSource:function(e,t,r,i,o){if(e.substr(-4)==".xml")return;if(t===!1){var u=e.split("/").pop().replace(/\#(.*?)$/,"").replace(/\?(.*?)$/,"");u=u.split(".");switch(u[1]||""){case"mp3":t="audio/mp3";break;case"mp4":case"m4a":t="audio/mp4";break;case"m4a":t="audio/m4a";break;case"ogg":case"oga":t="audio/ogg";break;case"opus":t="audio/opus";break;case"wav":t="audio/wav";break;case"webm":case"weba":t="audio/webm"}}if(r===undefined||r===!1||r==="")r=this.extractQuality(e);if(i===undefined||i===!1||this.checkExistDefaultSource())i=!1;var a={src:e,kind:t,quality:r,isDefault:i,resolution:o},f=n.clone(this.get("sources")),l=!1;for(var c=0,h=f.length;c<h;c++)s.getFileName(f[c].src)==s.getFileName(a.src)&&(l=!0);l||(f.push(a),this.set("sources",f));for(var c=0,h=f.length;c<h;c++)if(f[c].kind=="audio/mp3"){this.set("flashSource",f[c].src);break}this.updateSources()},updateSources:function(){var e=this.get("isIE8"),t=!1,r=[],i=this.getDefaultSource(!0),s=i;i&&r.push(i);var i=this.getSourceByType("audio/mp3");i&&i!=s&&r.push(i),i&&(this.set("sourcemp3",i.src),t=!0),e||(i=this.getSourceByType("audio/mp4"),i&&i!=s&&r.push(i),i=this.getSourceByType("audio/m4a"),i&&i!=s&&r.push(i),i=this.getSourceByType("audio/ogg"),i&&i!=s&&r.push(i),i=this.getSourceByType("audio/webm"),i&&i!=s&&r.push(i),i=this.getSourceByType("audio/wav"),i&&i!=s&&r.push(i),i=this.getSourceByType("audio/opus"),i&&i!=s&&r.push(i),i=this.getSourceByType("audio/flac"),i&&i!=s&&r.push(i)),t||(i=this.getSourceByType("audio/flash"),i&&i!=s&&r.push(i)),this.set("sources2",r);var o=[],u=this.get("canPlay"),a=n.clone(this.get("sources"));if(e||n.isEmpty(u))i=this.getSourceByType("audio/mp3"),o.push(i);else for(var f=0,l=a.length;f<l;f++)a[f].kind=="audio/mp3"&&u.mp3&&o.push(a[f]),a[f].kind=="audio/mp4"&&u.mp4&&o.push(a[f]),a[f].kind=="audio/mpa"&&u.mpa&&o.push(a[f]),a[f].kind=="audio/ogg"&&u.ogg&&o.push(a[f]),a[f].kind=="audio/webm"&&u.webm&&o.push(a[f]),a[f].kind=="audio/wav"&&u.wav&&o.push(a[f]),a[f].kind=="audio/opus"&&u.opus&&o.push(a[f]),a[f].kind=="audio/flac"&&u.flac&&o.push(a[f]),a[f].kind=="video/mp4"&&u.mp4&&o.push(a[f]),a[f].kind=="audio/m4a"&&u.m4a&&o.push(a[f]);this.set("sources3",o)},updateSubtitles:function(){}});return u}),define("app/collections/audios",["underscore","backbone","app/models/audio"],function(e,t,n){"use strict";var r=t.Collection.extend({model:n});return r}),define("app/models/language",["backbone","underscore"],function(e,t){"use strict";var n=e.Model.extend({en:"English",fr:"French",es:"Spanish",de:"German",zh:"Chinese",pl:"Polish",pt:"Portuguese",ja:"Japanese",ko:"Korean",vi:"Vietnamese",ms:"Malay",cy:"Welsh"});return n}),define("text",["module"],function(e){"use strict";var t,n,r,i,s,o=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],u=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,a=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,f=typeof location!="undefined"&&location.href,l=f&&location.protocol&&location.protocol.replace(/\:/,""),c=f&&location.hostname,h=f&&(location.port||undefined),p={},d=e.config&&e.config()||{};t={version:"2.0.12",strip:function(e){if(e){e=e.replace(u,"");var t=e.match(a);t&&(e=t[1])}else e="";return e},jsEscape:function(e){return e.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:d.createXhr||function(){var e,t,n;if(typeof XMLHttpRequest!="undefined")return new XMLHttpRequest;if(typeof ActiveXObject!="undefined")for(t=0;t<3;t+=1){n=o[t];try{e=new ActiveXObject(n)}catch(r){}if(e){o=[n];break}}return e},parseName:function(e){var t,n,r,i=!1,s=e.indexOf("."),o=e.indexOf("./")===0||e.indexOf("../")===0;return s!==-1&&(!o||s>1)?(t=e.substring(0,s),n=e.substring(s+1,e.length)):t=e,r=n||t,s=r.indexOf("!"),s!==-1&&(i=r.substring(s+1)==="strip",r=r.substring(0,s),n?n=r:t=r),{moduleName:t,ext:n,strip:i}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(e,n,r,i){var s,o,u,a=t.xdRegExp.exec(e);return a?(s=a[2],o=a[3],o=o.split(":"),u=o[1],o=o[0],(!s||s===n)&&(!o||o.toLowerCase()===r.toLowerCase())&&(!u&&!o||u===i)):!0},finishLoad:function(e,n,r,i){r=n?t.strip(r):r,d.isBuild&&(p[e]=r),i(r)},load:function(e,n,r,i){if(i&&i.isBuild&&!i.inlineText){r();return}d.isBuild=i&&i.isBuild;var s=t.parseName(e),o=s.moduleName+(s.ext?"."+s.ext:""),u=n.toUrl(o),a=d.useXhr||t.useXhr;if(u.indexOf("empty:")===0){r();return}!f||a(u,l,c,h)?t.get(u,function(n){t.finishLoad(e,s.strip,n,r)},function(e){r.error&&r.error(e)}):n([o],function(e){t.finishLoad(s.moduleName+"."+s.ext,s.strip,e,r)})},write:function(e,n,r,i){if(p.hasOwnProperty(n)){var s=t.jsEscape(p[n]);r.asModule(e+"!"+n,"define(function () { return '"+s+"';});\n")}},writeFile:function(e,n,r,i,s){var o=t.parseName(n),u=o.ext?"."+o.ext:"",a=o.moduleName+u,f=r.toUrl(o.moduleName+u)+".js";t.load(a,r,function(n){var r=function(e){return i(f,e)};r.asModule=function(e,t){return i.asModule(e,f,t)},t.write(e,a,r,s)},s)}};if(d.env==="node"||!d.env&&typeof process!="undefined"&&process.versions&&!!process.versions.node&&!process.versions["node-webkit"])n=require.nodeRequire("fs"),t.get=function(e,t,r){try{var i=n.readFileSync(e,"utf8");i.indexOf("﻿")===0&&(i=i.substring(1)),t(i)}catch(s){r&&r(s)}};else if(d.env==="xhr"||!d.env&&t.createXhr())t.get=function(e,n,r,i){var s=t.createXhr(),o;s.open("GET",e,!0);if(i)for(o in i)i.hasOwnProperty(o)&&s.setRequestHeader(o.toLowerCase(),i[o]);d.onXhr&&d.onXhr(s,e),s.onreadystatechange=function(t){var i,o;s.readyState===4&&(i=s.status||0,i>399&&i<600?(o=new Error(e+" HTTP status: "+i),o.xhr=s,r&&r(o)):n(s.responseText),d.onXhrComplete&&d.onXhrComplete(s,e))},s.send(null)};else if(d.env==="rhino"||!d.env&&typeof Packages!="undefined"&&typeof java!="undefined")t.get=function(e,t){var n,r,i="utf-8",s=new java.io.File(e),o=java.lang.System.getProperty("line.separator"),u=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(s),i)),a="";try{n=new java.lang.StringBuffer,r=u.readLine(),r&&r.length()&&r.charAt(0)===65279&&(r=r.substring(1)),r!==null&&n.append(r);while((r=u.readLine())!==null)n.append(o),n.append(r);a=String(n.toString())}finally{u.close()}t(a)};else if(d.env==="xpconnect"||!d.env&&typeof Components!="undefined"&&Components.classes&&Components.interfaces)r=Components.classes,i=Components.interfaces,Components.utils["import"]("resource://gre/modules/FileUtils.jsm"),s="@mozilla.org/windows-registry-key;1"in r,t.get=function(e,t){var n,o,u,a={};s&&(e=e.replace(/\//g,"\\")),u=new FileUtils.File(e);try{n=r["@mozilla.org/network/file-input-stream;1"].createInstance(i.nsIFileInputStream),n.init(u,1,0,!1),o=r["@mozilla.org/intl/converter-input-stream;1"].createInstance(i.nsIConverterInputStream),o.init(n,"utf-8",n.available(),i.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),o.readString(n.available(),a),o.close(),n.close(),t(a.value)}catch(f){throw new Error((u&&u.path||"")+": "+f)}};return t}),define("text!templates/controls/media_info.html",[],function(){return'<% if (!showMinimal &&\n    (features.hasTitle || features.hasSummary  || features.hasCopyright)\n) { %>\n\n    <div class="omp-description">\n        <div class="omp-feature-title">\n            <div class="omp-description-title"><label><% if (title && (features.hasTitle)) { %><%= title %><% } %></label></div>\n            <div class="omp-description-icon">\n                <% if (features.hasSummary || features.hasCopyright ) { %>\n                <button class="omp-toggle-button down-toggle fixed-right-title" title="<%= labels.expand %>"\n                    aria-label="<%= labels.expand %>"\n                    tabindex="<%= tabs.mediaInfo %>"></button>\n                <% } %>\n            </div>\n        </div>\n        <div class="omp-feature-subheader omp-hidden">\n            <div id="<%= id %>_fd_description_contents" class="omp-description-contents">\n                <% if (features.hasShare && hasShare) { %>\n                    <div id="<%= id %>_feature_share" class="omp-feature-share">\n                        <div id="<%= id %>_share_title" class="omp-share-title">\n                            <span class="omp-share-img" title="<%= labels.share %>"></span>\n                            <button class="omp-share-btn"\n                                    id="<%= id %>_share_link"\n                                    aria-label="<%= labels.share %>"\n                                    tabindex="<%= tabs.mediaInfo %>"><%= labels.share %></button>\n                        </div>\n                        <div class="omp-share-content omp-hidden" id="<%= id %>_share_container">\n                            <textarea aria-label="<%= labels.shareCode %>"\n                                    tabindex="<%= tabs.mediaInfo %>" class="omp-share-content-text"\n                              id="<%= id %>_share_content"> <%= html %> </textarea>\n                        </div>\n                    </div>\n                <% } %>\n                <% if (features.hasCopyright === true && copyright !== false) { %>\n                    <div class="omp-copyright-content">\n                        <%= copyright %>\n                    </div>\n                <% } %>\n\n                <% if ( (hasSummary || features.hasSummary) && summary !== false) { %>\n                    <div class="omp-summary">\n                        <div class="omp-summary-content omp-hidden"><%= summary %></div>\n                        <button class="omp-summary-btn omp-show-btn more" id="<%= id %>_show_button"\n                                aria-label="<%= labels.showMore %>"\n                                tabindex="<%= tabs.mediaInfo %>"><%= labels.showMore %>\n                        </button>\n                    </div>\n                <% } %>\n            </div>\n        </div>\n    </div>\n</div>\n<% } else if (title !== false && (features.hasTitle )) { %>\n    <div class="omp-title simple"><%= title %></div><%\n} %>'}),define("app/views/media_info_view",["jquery","jquery","underscore","backbone","text!templates/controls/media_info.html"],function(e,t,n,r,i){"use strict";var s=r.View.extend({template:i,className:"omp-features-fixed",events:{"click .omp-summary-btn":"summaryButton","click .omp-toggle-button":"toggleButton","click .omp-share-btn":"shareButton","click .omp-share-img":"shareButton"},render:function(t,r){var i=n.template(this.template),s=this.model.toJSON();s.showMinimal=t=="minimal";var o=this.model.get("html"),u=i(s);return r||(r=e("#"+this.model.get("id")+"_f_mi")),this.$el.html(u),r.append(this.$el),r.find("a.glossary").each(function(){e(this).replaceWith(e(this).html())}),oump.externaladapter.init(r),this},toggleButton:function(){var t=e("#"+this.model.id+" .omp-features-fixed"),n=e("#"+this.model.id+"_feature_share"),r=this.model.get("html");t.find(".omp-toggle-button").attr("title",this.model.get("labels").expand),t.find(".omp-toggle-button").attr("aria-label",this.model.get("labels").expand),t.find(".omp-toggle-button").toggleClass("up-toggle"),t.find(".omp-toggle-button").hasClass("up-toggle")?(t.find(".omp-toggle-button").attr("title",this.model.get("labels").collapse),t.find(".omp-toggle-button").attr("aria-label",this.model.get("labels").collapse),this.model.trigger("title_expanded"),r||n.addClass("omp-hidden")):this.model.trigger("title_collapsed"),t.find(".omp-feature-subheader").toggleClass("omp-hidden")},summaryButton:function(){e("#"+this.model.id+"_show_button").html(this.model.get("labels").showMore),e(".omp-summary-btn").attr("aria-label",this.model.get("labels").showMore),e(".omp-summary-btn").toggleClass("less"),e(".omp-summary-btn").hasClass("less")&&(e("#"+this.model.id+"_show_button").html(this.model.get("labels").showLess),e(".omp-summary-btn").attr("aria-label",this.model.get("labels").showLess),this.model.trigger("show_more_clicked")),this.$el.find(".omp-summary-content").toggleClass("omp-hidden")},shareButton:function(){var t=this,n=this.model.get("id"),r=e("#"+n+"_share_link"),i=this.model.get("manifest"),s=e("#"+n+"_share_container"),o=i.split("/"),u=i.substring(i.indexOf(o[10]),i),a=this.model.get("html");if(a){var f=a.indexOf("url="),l=a.indexOf(".xml"),c=u+a.substring(f+5,l+4),h=a.substring(0,f+4)+c+a.substring(l+4,a.length),p=document.createElement("div");p.innerHTML=h;var d=p.childNodes[0].nodeValue;e("#"+n+"_share_container").toggleClass("omp-hidden"),e("#"+n+"_share_content").val(d),e("#"+n+"_share_content")[0].select(),e("#"+n+"_share_content")[0].setSelectionRange(0,9999),this.model.trigger("share_clicked")}}});return s}),define("app/helpers/hook/media_info_hook",["backbone","jquery","underscore","app/helpers/utilities","app/views/media_info_view"],function(e,t,n,r,i){"use strict";var s=function(e){this.dataModel=e._dataModel,this.isActive=this.dataModel.get("mediaInfoActive"),this.playerObject=e._playerObject,this.init()};return s.prototype=n.extend(s.prototype,e.Events),s.prototype=n.extend(s.prototype,{init:function(){this.mediaInfoView||(this.mediaInfoView=new i({model:this.dataModel}),!oump.ismobile||this.dataModel.get("isOtherProvider")===!0?this.mediaInfoView.render():(this.mediaInfoView.render("minimal"),t(this.playerObject).one("play",function(){this.mediaInfoView.render()}.bind(this))),this.initMediaInfoEvent())},initMediaInfoEvent:function(){this.$container=t("#"+this.dataModel.id+" .omp-features-fixed"),this.listenTo(this.dataModel,"change:mediaInfoActive",this.toggleActive.bind(this))},toggleActive:function(){this.isActive=this.dataModel.get("mediaInfoActive"),t("#"+this.dataModel.id+"_f_mi").toggleClass("omp-hidden",!this.isActive),this.$container.find(".omp-toggle-button.up-toggle").click()}}),s}),define("app/helpers/provider/provider",["backbone","underscore","app/helpers/utilities"],function(e,t,n){"use strict";var r=function(){};return r.prototype=t.extend(r.prototype,{rawData:undefined,setModel:function(e){this.model=e},setRawData:function(e){this.rawData=e},fetchBrief:function(e){var t=this;this.getSrc(),$.ajax({url:this.src,dataType:"json",success:function(t){e.call(this,t)},error:function(e,t,n){}})},fetchContent:function(e){var t=this;this.fetchBrief(function(n){var r=t.model.get("features");n.title&&!t.model.checkHasFeature("title")&&(t.model.set("title",n.title),r.hasTitle=!0),n.description&&!t.model.checkHasFeature("description")&&(t.model.set("summary",n.description),r.hasSummary=!0),n.thumbnail_url&&!t.model.checkHasFeature("poster")&&(r.hasPoster=!0,t.model.set("poster",n.thumbnail_url),t.model.set("providerPoster",n.thumbnail_url)),n.height&&n.width&&!t.model.get("ratioFixed")&&t.model.set("ratio",n.height/n.width),e.call(this)})},getHTML:function(e){var n=this,r=$("#"+n.model.get("id")).width(),i=this.rawData.title!=undefined&&this.rawData.title&&this.rawData.title.length?this.rawData.title:this.model.get("title")&&this.model.get("title").length!=undefined?this.model.get("title"):this.model.get("providerTitle");this.model.set("title",i);var s=this.rawData.description!=undefined&&this.rawData.description.length!=undefined&&this.rawData.description?this.rawData.description:this.model.get("summary")&&this.model.get("summary").length!=undefined?this.model.get("summary"):this.model.get("providerDescription");this.model.set("summary",s);var o=t.template(this.template)({id:this.model.get("id"),title:i,summary:s!=undefined&&s?111:"",width:r,embedUrl:this.getEmbedUrl(),kind:e,ratio:this.model.get("ratio"),tabs:this.model.get("tabs"),labels:this.model.get("labels")});return o},getSrc:function(){},resize:function(){var e=this.model.id,t=parseFloat(this.model.get("ratio")),n=$("#"+e+"_provider_contents .omp-provider-frame");n.css("height",n.width()*t)}}),r}),define("text!app/tpl/provider/provider.html",[],function(){return'<div class="omp-provider-content">\n    <div id="<%= id %>_provider_contents" class="omp-player-content">\n        <iframe\n            class="omp-provider-frame"\n            src="<%= embedUrl %>"\n            style="width:100% !important; height:<%= width * ratio %>px;" frameborder="0" scrolling="no"\n            webkitAllowFullScreen="true" mozallowfullscreen="true" allowFullScreen="true"></iframe>\n    </div>\n</div>\n\n<% if (kind != \'manifest\') { %>\n<div id="<%= id %>_features_dialog" class="omp-controlbar-row">\n    <div class="omp-features-wrapper">\n        <div class="omp-features-options" id="<%= id %>_f_options">\n            <div id="<%= id %>_f_mi">\n            </div>\n        </div>\n    </div>\n</div>\n\n<a id="<%= id %>_tab_end" href="#" class="omp-media-tab-end omp-hidden" tabindex="<%= tabs.end %>"\n   aria-label="<%= labels.exitMedia  %>"></a>\n<% } %>\n'}),define("app/helpers/provider/youtube",["backbone","underscore","app/helpers/utilities","app/helpers/provider/provider","text!app/tpl/provider/provider.html"],function(e,t,n,r,i){"use strict";var s=t.clone(r.prototype),o=function(){this.youtubeApiKey="AIzaSyBjh37giVNWJVJI43IIPm4GHuj8MqziTO8",this.template=i};return o.prototype=t.extend(s,{fetchBrief:function(e){this.getSrc(),$.ajax({url:this.src,dataType:"jsonp",success:function(t){if(t.items!=undefined&&t.items.length>0){var n=t.items[0].snippet,r;n.thumbnails.hasOwnProperty("maxres")?r="maxres":n.thumbnails.hasOwnProperty("high")?r="high":n.thumbnails.hasOwnProperty("medium")?r="medium":n.thumbnails.hasOwnProperty("standard")?r="standard":r="default";try{n.thumbnail_url=n.thumbnails[r].url,n.width=n.thumbnails[r].width,n.height=n.thumbnails[r].height}catch(i){}e.call(this,n)}else{var n={};e.call(this,n)}return},error:function(e,t,n){return}})},getMediaID:function(){if(!this.mediaID){var e=this.rawData.src!=undefined&&this.rawData.src.length!=undefined&&this.rawData.src.match(/(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/);if(e!=undefined&&e[1]!=undefined&&e[1])return e[1];return}return this.mediaID},getSrc:function(){if(!this.src){var e=this.getMediaID(),t="https://www.googleapis.com/youtube/v3/videos?part=snippet&id=";t+=e+"&key="+this.youtubeApiKey,this.src=t}return this.src},getEmbedUrl:function(){return"https://www.youtube.com/embed/"+this.getMediaID()+"?autoplay=1"}}),o}),define("app/helpers/provider/ted",["backbone","underscore","app/helpers/utilities","app/helpers/provider/provider","text!app/tpl/provider/provider.html"],function(e,t,n,r,i){"use strict";var s=t.clone(r.prototype),o=function(){this.template=i};return o.prototype=t.extend(s,{getMediaID:function(){if(!this.mediaID){var e=this.rawData.src!=undefined&&this.rawData.src.length!=undefined&&this.rawData.src.match(/(.*)ted.com\/(.*)/);return e!=undefined&&e[2]!=undefined&&e[2]?e[2]:""}return this.mediaID},getSrc:function(){if(!this.src){var e=this.getMediaID(),t="//www.ted.com/services/v1/oembed.json?url=https://embed-ssl.ted.com/";t+=e,this.src=t}return this.src},getEmbedUrl:function(){return"//embed-ssl.ted.com/"+this.getMediaID()}}),o}),define("app/helpers/provider/vimeo",["backbone","underscore","app/helpers/utilities","app/helpers/provider/provider","text!app/tpl/provider/provider.html"],function(e,t,n,r,i){"use strict";var s=t.clone(r.prototype),o=function(){this.template=i};return o.prototype=t.extend(s,{getMediaID:function(){if(!this.mediaID){var e=this.rawData.src!=undefined&&this.rawData.src.length!=undefined&&this.rawData.src.split("/");return e.length>1?e[e.length-1]:""}return this.mediaID},getSrc:function(){if(!this.src){var e=this.getMediaID(),t="https://vimeo.com/api/oembed.json?url=https://vimeo.com/";t+=e,this.src=t}return this.src},getEmbedUrl:function(){return"https://player.vimeo.com/video/"+this.getMediaID()+"?autoplay=true"}}),o}),define("app/helpers/provider/dailymotion",["backbone","underscore","app/helpers/utilities","app/helpers/provider/provider","text!app/tpl/provider/provider.html"],function(e,t,n,r,i){"use strict";var s=t.clone(r.prototype),o=function(){this.template=i};return o.prototype=t.extend(s,{fetchBrief:function(e){this.getSrc(),$.ajax({url:this.src,dataType:"jsonp",success:function(t){e.call(this,t);return},error:function(e,t,n){return}})},getMediaID:function(){if(!this.mediaID){var e=this.rawData.src!=undefined&&this.rawData.src.length!=undefined&&this.rawData.src.match(/(.*)dailymotion.com\/video\/(.*)/);return e!=undefined&&e[2]!=undefined&&e[2]?e[2]:""}return this.mediaID},getSrc:function(){if(!this.src){var e=this.getMediaID(),t="//www.dailymotion.com/services/oembed?format=json&url=http://www.dailymotion.com/video/";t+=e,this.src=t}return this.src},getEmbedUrl:function(){return"//www.dailymotion.com/embed/video/"+this.getMediaID()+"?autoplay=1"}}),o}),define("app/helpers/provider/slideshare",["backbone","underscore","app/helpers/utilities","app/helpers/provider/provider","text!app/tpl/provider/provider.html"],function(e,t,n,r,i){"use strict";var s=t.clone(r.prototype),o=function(){this.template=i};return o.prototype=t.extend(s,{fetchBrief:function(e){var t=this;this.getSrc(),$.ajax({url:this.src,dataType:"jsonp",success:function(n){var r=n.html.match(/<iframe.*?src="(.*?)"/);t.embedUrl=r[1],n.thumbnail_url=n.thumbnail.replace("/\\\\/g",""),e.call(this,n);return},error:function(e,t,n){return}})},getMediaID:function(){if(!this.mediaID){var e=this.rawData.src!=undefined&&this.rawData.src.length!=undefined&&this.rawData.src.match(/(.*)slideshare.net\/(.*)/);return e!=undefined&&e[2]!=undefined&&e[2]?this.mediaID=e[2]:""}return this.mediaID},getSrc:function(){if(!this.src){var e=this.getMediaID(),t="//www.slideshare.net/api/oembed/2?url=http://www.slideshare.net/";t+=e,t+="&format=json",this.src=t}return this.src},getEmbedUrl:function(){return this.embedUrl}}),o}),define("app/helpers/provider/sway",["backbone","underscore","app/helpers/utilities","app/helpers/provider/provider","text!app/tpl/provider/provider.html"],function(e,t,n,r,i){"use strict";var s=t.clone(r.prototype),o=function(){this.template=i};return o.prototype=t.extend(s,{fetchBrief:function(e){var t=this;this.getSrc(),$.ajax({url:oump.servicePath.getProxy(this.src),dataType:"json",success:function(t){e.call(this,t);return},error:function(e,t,n){return}})},getMediaID:function(){if(!this.mediaID){var e=this.rawData.src!=undefined&&this.rawData.src.length!=undefined&&this.rawData.src.match(/(.*)sway.com\/(.*)/);return e!=undefined&&e[2]!=undefined&&e[2]?e[2]:""}return this.mediaID},getSrc:function(){if(!this.src){var e=this.getMediaID();this.src=window.location.protocol+"//sway.com/api/v1.0/oembed?url=https://sway.com/"+e+"&format=json"}return this.src},getEmbedUrl:function(){return"//sway.com/s/"+this.getMediaID()+"/embed"}}),o}),define("app/helpers/provider/vzaar",["backbone","underscore","app/helpers/utilities","app/helpers/provider/provider","text!app/tpl/provider/provider.html"],function(e,t,n,r,i){"use strict";var s=t.clone(r.prototype),o=function(){this.template=i};return o.prototype=t.extend(s,{fetchBrief:function(e){var t=this;this.getSrc(),$.ajax({url:this.src,dataType:"jsonp",success:function(t){e.call(this,t);return},error:function(e,t,n){return}})},getMediaID:function(){if(!this.mediaID){var e=this.rawData.src!=undefined&&this.rawData.src.length!=undefined&&this.rawData.src.match(/(.*)vzaar.com\/videos\/(.*)/);return e!=undefined&&e[2]!=undefined&&e[2]?e[2]:""}return this.mediaID},getSrc:function(){if(!this.src){var e=this.getMediaID(),t="//vzaar.com/api/videos/";t+=e+".json",this.src=t}return this.src},getEmbedUrl:function(){return"//view.vzaar.com/"+this.getMediaID()+"/player?autoplay=true"}}),o}),define("app/helpers/provider/wirewax",["backbone","underscore","app/helpers/utilities","app/helpers/provider/provider","text!app/tpl/provider/provider.html"],function(e,t,n,r,i){"use strict";var s=t.clone(r.prototype),o=function(){this.template=i};return o.prototype=t.extend(s,{fetchBrief:function(e){var t=this;this.getSrc(),this.fetchToken(function(n){$.ajax({url:t.src,method:"GET",headers:{Authorization:"Bearer "+n.access_token},success:function(t,n){t.width=768,t.height=432,t.title=t.vidName,t.thumbnail_url=t.posterFrame,e.call(this,t)},error:function(e,t){}})})},getMediaID:function(){if(!this.mediaID){var e;try{if(this.rawData.src!=undefined&&this.rawData.src.length!=undefined)return e=this.rawData.src.split("/").slice(-1).pop(),e}catch(t){return""}return""}return this.mediaID},fetchToken:function(e){$.ajax({url:"//hobnob.wirewax.com/oauth/token",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Authorization:"Basic NDpaVnJERXRJSW5hbEl0SmhocEptYlRWWXltRGdiR3hQcw=="},data:{grant_type:"password",username:"myouacc@gmail.com",password:"Admin@123"},success:function(t,n){e.call(this,t)},error:function(e,t){var n="";e.status===0?n="Not connect.\n Verify Network.":e.status==404?n="Requested page not found. [404]":e.status==500?n="Internal Server Error [500].":t==="parsererror"?n="Requested JSON parse failed.":t==="timeout"?n="Time out error.":t==="abort"?n="Ajax request aborted.":n="Uncaught Error.\n"+e.responseText,oump.debug(n)}})},getSrc:function(){if(!this.src){var e=this.getMediaID(),t="//hobnob.wirewax.com/video/";t+=e,this.src=t}return this.src},getEmbedUrl:function(){return"//embed.wirewax.com/"+this.getMediaID()+"?autoStart=true"}}),o}),define("app/helpers/provider/oupodcast",["backbone","underscore","app/helpers/utilities","app/helpers/provider/provider","text!app/tpl/provider/provider.html"],function(e,t,n,r,i){"use strict";var s=t.clone(r.prototype),o=function(){this.template=i};return o.prototype=t.extend(s,{fetchBrief:function(e){var t=this;this.getSrc(),$.ajax({url:oump.servicePath.getProxy(this.src),success:function(r){var i,s=t.mediaID;r=n.parseXML(r),r=n.xmlToJsonObject(r.childNodes[0]),s==""&&(oump.isArray(r.channel.item)?i=r.channel.item[0]:i=r.channel.item),oump.isArray(r.channel.item)?r.channel.item.every(function(e,t){return e["jwplayer:sharing.link"].search(s)==-1?!0:(i=r.channel.item[t],!1)}):i=r.channel.item,i.description=i["media:description"],i.title=i["media:title"],i.thumbnail_url=i["media:thumbnail"].url,i.width=480,i.height=270;if(i.hasOwnProperty("media:content"))var o=i["media:content"]["oupod:iframe-oump"];else var o=i["media:group"]["media:content"][0]["oupod:iframe-oump"];var u=o.match(/<iframe.*?src="(.*?)"/);t.embedUrl=u[1],e.call(this,i)},error:function(e,t,n){}})},getMediaID:function(){if(this.mediaID)return this.mediaID;this.mediaID="";var e;if(this.rawData.src!=undefined&&this.rawData.src.length!=undefined)try{e=this.rawData.src.split("#");if(e.length>1)return this.mediaID=e.slice(-1).pop()}catch(t){}return""},getPageID:function(){if(this.pageID)return this.pageID;var e;this.pageID="";if(this.rawData.src!=undefined&&this.rawData.src.length!=undefined)try{e=this.rawData.src.split("#!"),e=e[0],e=e.split("podcast-"),e=e[1],this.pageID=e}catch(t){}return this.pageID},getSrc:function(){if(!this.src){var e=this.getMediaID(),t=this.getPageID(),n="http://podcast.open.ac.uk/feeds/";n+=t+"/rss2.xml",this.src=n}return this.src},getEmbedUrl:function(){return this.embedUrl}}),o}),define("app/helpers/external_consumer",["backbone","underscore","app/helpers/utilities","app/helpers/hook/media_info_hook","app/helpers/provider/youtube","app/helpers/provider/ted","app/helpers/provider/vimeo","app/helpers/provider/dailymotion","app/helpers/provider/slideshare","app/helpers/provider/sway","app/helpers/provider/vzaar","app/helpers/provider/wirewax","app/helpers/provider/oupodcast"],function(e,t,n,r,i,s,o,u,a,f,l,c,h){"use strict";var p=function(e){this.model=e.model,this.item=e.item,this.provider=e.provider,this.provider.setModel(this.model),this.provider.setRawData(this.item)};return p.prototype=t.extend(p.prototype,e.Events),p.prototype=t.extend(p.prototype,{fetchMediaBrief:function(e){this.provider.fetchBrief(e)},fetchMediaContent:function(e){this.provider.fetchContent(e)},renderMediaView:function(e){var t=this.provider.getHTML(e);if(t){var n=this.model.get("id");this.model.set("hasShare",!1);switch(e){case"manifest":$("#"+n+"_poster").replaceWith(t);break;default:$("#"+n).prepend(t),this.scrollToTop()}$(window).resize(this.provider.resize.bind(this.provider))}},scrollToTop:function(){var e=this.model.get("id");$("html,body").animate({scrollTop:$("#"+e+"_provider_contents").offset().top},1e3)}}),p.getProviderClass=function(e){var t=null;switch(e){case"oupodcast":t=h;break;case"wirewax":t=c;break;case"vzaar":t=l;break;case"sway":t=f;break;case"slideshare":t=a;break;case"ted":t=s;break;case"vimeo":t=o;break;case"dailymotion":t=u;break;case"youtube":case"khan":t=i;break;default:}return t},p}),define("app/common",["jquery","backbone","app/resizer","app/models/video","app/collections/videos","app/models/audio","app/collections/audios","app/helpers/utilities","app/models/language","app/helpers/external_consumer"],function(e,t,n,r,i,s,o,u,a,f){"use strict";var l=function(){var e=Math.floor(Math.random()*99999),t="omp-id-"+String(e);return t},c=function(e,t,n,r,i,s){var o=e.name.toLowerCase().replace("data-omp-","");switch(o){case"source":t.addSource(e.value,!1),n=r.hasSource=!0;break;case"controls":t.get("forceDefaultSettings")||t.set("controls","controls");break;case"autoplay":case"loop":case"muted":t.get("forceDefaultSettings")||t.set(o,"true");break;case"preload":t.get("forceDefaultSettings")||t.set(o,e.value);break;case"player":case"provider":case"poster":case"height":case"width":case"sizing":case"aspect":case"title":case"description":case"language":if(o=="width"||o=="height"){var u=parseFloat(e.value);u>0&&!isNaN(parseFloat(u))&&(t.set(o,u),t.set("orig_"+o,u)),t.get("orig_width")&&t.get("orig_height")&&(t.set("ratio",t.get("orig_height")/t.get("orig_width")),t.set("ratioFixed",!0))}else t.set(o,e.value),o=="sizing"&&(t.set("activeSizing",e.value.toLowerCase()),t.set("sizing",e.value.toLowerCase())),o=="poster"&&e.value!=""&&(t.set("posterIsDefault",!1),r.hasPoster=!0),o=="title"&&(r.hasTitle=!0),o=="description"&&(r.hasSummary=!0),o=="language"&&(t.set("activeLanguage",e.value),t.set("defaultLanguage",e.value));break;case"src":e.value!=""&&(s=="img"?(t.set("poster",e.value),t.set("posterIsDefault",!1),r.hasPoster=!0):(s=="video"||s=="audio")&&e.value.substr(e.value.lastIndexOf(".")+1)==="xml"&&(t.set("manifest",e.value),r.hasManifest=!0));break;case"manifest":e.value!=""&&s=="div"&&e.value.substr(e.value.lastIndexOf(".")+1)==="xml"&&(t.set("manifest",e.value),r.hasManifest=!0);break;case"disable-features":e.value!=""&&(i=e.value,t.set("disabledFeatures",i));break;case"renderstyle":t.set("renderStyle",e.value);break;case"timing":t.set("timing",e.value.toLowerCase());break;case"uilanguage":t.set("uilanguage",e.value.toLowerCase());break;case"custom-id":t.set("id",e.value.toLowerCase());break;case"epub":t.set("epub",e.value.toLowerCase());break;case"assetspath":t.set("assetspath",e.value.toLowerCase())}},h=t.Model.extend({defaults:{videos:new i,audios:new o,canPlayVideo:{},canPlayAudio:{}},init:function(){var e=document.createElement("video"),t,n={},r={};e.canPlayType&&(t=""!==e.canPlayType('video/mp4; codecs="mp4v.20.8"'),n.mpeg4=t,t=""!==(e.canPlayType("video/mp4")||e.canPlayType('video/mp4; codecs="avc1.42E01E"')||e.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')),n.h264=t,t=""!==e.canPlayType('video/ogg; codecs="theora"'),n.ogg=t,t=""!==e.canPlayType('video/webm; codecs="vp8, vorbis"'),n.webm=t,t=""!==e.canPlayType("video/x-m4v"),n.m4v=t||n.mpeg4||n.h264,t=""!==e.canPlayType("audio/mpeg"),r.mp3=t,t=""!==e.canPlayType('audio/mp4; codecs="mp4a.40.5"'),r.mp4=t,t=""!==e.canPlayType("audio/m4a"),r.mpa=t,t=""!==e.canPlayType('audio/ogg; codecs="vorbis"'),r.ogg=t,t=""!==e.canPlayType('audio/webm; codecs="vorbis"'),r.webm=t,t=""!==e.canPlayType("audio/wav"),r.wav=t,t=""!==e.canPlayType("audio/ogg; codecs=opus"),r.opus=t,t=""!==e.canPlayType("audio/flac"),r.flac=t,t=""!==e.canPlayType("audio/x-m4a"),r.m4a=t||r.mp4||r.mpa),this.set("canPlayVideo",n),this.set("canPlayAudio",r);var i=navigator.userAgent.toLowerCase(),s=function(e){return/version\/(\d+\.\d+)/i.test(i)&&RegExp.$1>=e?!0:!1},o;oump.browser=i.match(/msie|trident/i)!==null?"msie":i.match(/firefox/i)!==null&&(/fennec/i.test(i).$2?o=!0:!0)?i.match(/firefox\/3./i)!==null?"firefox3":"firefox":/chrom(?:(e)|(ium))\/(\d+\.\d+)/i.test(i)?"chrome":i.match(/opera/i)!==null&&typeof o!="undefined"&&!o&&s(10.5)||typeof o!="undefined"&&o&&s(12)?"opera":/maxthon\/(\d+\.\d+)/i.test(i)&&RegExp.$1>=3?"maxthon":i.match(/epiphany\/(\d+\.\d+)\.(\d+)/i)!==null&&(RegExp.$1>2.3||RegExp.$1>=2.3&&RegExp.$2>=6)?"safari":i.match(/safari/i)!==null?"safari":!1,/Edge/.test(navigator.userAgent)&&(oump.browserver="edge"),oump.isepub=!1,oump.ismobile="ontouchstart"in document.documentElement||!!navigator.msMaxTouchPoints||!!(i.match(/(iphone|ipod|ipad)/)||i.match(/(android)/)||i.match(/(iemobile)/)||i.match(/iphone/)||i.match(/ipad/)||i.match(/ipod/)||i.match(/blackberry/)||i.match(/bada/)),oump.isios=/iPad|iPhone|iPod/.test(navigator.platform),oump.isios8plus=oump.isios&&!!window.indexedDB,oump.isie10=i.indexOf("msie ")>0||!!navigator.userAgent.match(/Trident.*rv\:10\./),oump.istablet=oump.ismobile&&window.screen.availWidth>=530,oump.isphone=oump.ismobile&&window.screen.availWidth<530},harvestVideos:function(){var t=this;e("video[data-omp-type='video'], div[data-omp-type='video'], img[data-omp-type='video']").each(function(e,n){t.addMediaModel(n,"video",function(e){return e.get("epub")!=undefined&&e.get("epub")==="true"&&(oump.isepub=!0,oump.istablet=!0,oump.isphone=!1),e})})},harvestAudios:function(){var t=this;e("audio[data-omp-type='audio'], div[data-omp-type='audio'], img[data-omp-type='audio']").each(function(e,n){t.addMediaModel(n,"audio",function(e){return e.get("epub")!=undefined&&e.get("epub")&&(oump.isepub=!0,oump.istablet=!0,oump.isphone=!1),e})})},addMediaModel:function(t,i,o){var u=this,h=new n;switch(i){case"audio":var p=this.get("audios"),d=this.get("canPlayAudio"),v=new s;v.set("canPlay",d);break;case"video":var m=this.get("videos"),g=this.get("canPlayVideo"),v=new r;v.set("canPlay",g);default:}e(t).css("display: none;"),this.disabledFeatures=!1;var y=!1;v.on("all",oump.logger.log),v.set("dataTrack",t);var b={hasBasicControls:!0,hasPoster:!1,hasSources:!1,hasSummary:!1,hasTitle:!1,hasTracksCaptions:!1,hasTracksAnnotations:!1,hasTracksScripts:!1,hasTracksChapters:!1,hasTracksDescriptions:!1,hasTracksMetadata:!1,hasTracksTranscripts:!1,hasTracksSubtitles:!1,hasTranscript:!1,hasFullscreen:oump.isie10?!1:!0,hasAudiodescriptions:!1,hasCopyright:!1,hasPlaylist:!0,hasShare:!0,hasAutoplay:!0,hasLanguage:!0,hasSettings:!0,hasDownload:!0};v.set("wwwroot",oump.wwwroot),v.set("languages",new a);var w=t.tagName.toLowerCase(),E=[];v.set("baseUrl",e(t).attr("data-omp-base-url")||""),v.set("iOSBaseUrl",e(t).attr("data-omp-ios-base-url")||v.get("baseUrl")),(w==i||w=="div"||w=="span"||w=="img")&&e.each(t.attributes,function(n,r){c(r,v,y,b,this.disabledFeatures,w),v.get("id")||v.set("id",l()),e(t).attr("omp-id",v.get("id"));var i=r.name.toLowerCase().replace("data-omp-transcript-","");(i=="text"||i=="pdf"||i=="html"||i=="word")&&r.value&&(E[i]=E[i]||[],E[i][v.get("defaultLanguage")]=r.value)});var S=[];S.push(v.get("activeLanguage")),e.each(t.children,function(t,n){var r=n.tagName.toLowerCase();if(r=="div"||r=="span"){var s=e(n).attr("data-omp-name");switch(s){case"source":var o=e(n).attr("data-omp-src")!=undefined?e(n).attr("data-omp-src"):!1,a=e(n).attr("data-omp-type")!=undefined?e(n).attr("data-omp-type"):!1,f=e(n).attr("data-omp-label")!=undefined?e(n).attr("data-omp-label"):!1,l=e(n).attr("data-omp-default")!=undefined?e(n).attr("data-omp-default"):!1,c=e(n).attr("data-omp-resolution")!=undefined?e(n).attr("data-omp-resolution"):!1,h=e(n).attr("data-omp-player")!=undefined?e(n).attr("data-omp-player"):!1;h&&v.set("player",h);var p=e(n).attr("data-omp-provider")!=undefined?e(n).attr("data-omp-provider"):!1;p&&v.set("provider",p),v.addSource(o,a,f,l,c),u.featuresSet(v,b,i),y=!0;break;case"track":var d=e(n).attr("data-omp-src")!=undefined?e(n).attr("data-omp-src"):!1,m=e(n).attr("data-omp-srclang")!=undefined?e(n).attr("data-omp-srclang"):!1,g=e(n).attr("data-omp-kind")!=undefined?e(n).attr("data-omp-kind"):!1,w=e(n).attr("data-omp-type")!=undefined?e(n).attr("data-omp-type"):!1,x=e(n).attr("data-omp-label")!=undefined?e(n).attr("data-omp-label"):!1,l=e(n).attr("data-omp-default")!=undefined?!0:!1;v.addTrack(g,w,d,m,x,l,function(e){u.featuresSet(v,b,i)}),m=m.toLowerCase(),S.indexOf(m)==-1&&S.push(m),S.sort(function(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())}),v.set("tracksLanguages",S),g=="transcripts"&&(w=="text/vtt"||w=="text"||w=="pdf"||w=="html"||w=="word")&&d&&(E[w]=E[w]||[],E[w][m]=d);break;case"title":var T=e(n).html();T=typeof T=="object"?"":T.trim();if(T!=""){v.set("title",T);var N=v.get("disabledFeatures");b.hasTitle=!0,u.featuresSet(v,b,i)}break;case"description":var T=e(n).html();T=typeof T=="object"?"":T.trim(),T!=""&&(v.set("summary",T),b.hasSummary=!0,u.featuresSet(v,b,i));break;case"copyright":var T=e(n).html();T=typeof T=="object"?"":T.trim(),T!=""&&(v.set("copyright",T),b.hasCopyright=!0,u.featuresSet(v,b,i));break;case"manifest":v.set("manifest",e(n).attr("data-omp-manifest")),b.hasManifest=!0}}switch(r){case"source":var o=e(n).attr("data-omp-src")!=undefined?e(n).attr("data-omp-src"):e(n).attr("src")?e(n).attr("src"):!1,a=e(n).attr("type")!=undefined?e(n).attr("type"):!1,f=e(n).attr("data-omp-label")!=undefined?e(n).attr("data-omp-label"):!1,l=e(n).attr("data-omp-default")!=undefined?e(n).attr("data-omp-default"):!1,c=e(n).attr("data-omp-resolution")!=undefined?e(n).attr("data-omp-resolution"):!1,h=e(n).attr("data-omp-player")!=undefined?e(n).attr("data-omp-player"):!1;h&&v.set("player",h);var p=e(n).attr("data-omp-provider")!=undefined?e(n).attr("data-omp-provider"):!1;p&&v.set("provider",p),v.addSource(o,a,f,l,c),u.featuresSet(v,b,i),y=!0;break;case"track":var d=e(n).attr("src")!=undefined?e(n).attr("src"):!1,m=e(n).attr("srclang")!=undefined?e(n).attr("srclang"):!1,g=e(n).attr("kind")!=undefined?e(n).attr("kind"):!1,w=e(n).attr("data-omp-type")!=undefined?e(n).attr("data-omp-type"):!1,x=e(n).attr("label")!=undefined?e(n).attr("label"):!1;v.addTrack(g,w,d,m,x,l,function(e){u.featuresSet(v,b,i)}),m=m.toLowerCase(),S.indexOf(m)==-1&&S.push(m),S.sort(function(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())}),v.set("tracksLanguages",S)}}),v.set("transcripts",E),w==i&&e.each(t.attributes,function(e,t){var n=t.name.toLowerCase().replace("data-omp-","");switch(n){case"src":v.addSource(t.value,!1,!1),y=!0;break;case"contextid":v.set(n,parseInt(t.value,10))}});var x=0,T=v.get("sizing");T=="smart"?x=h.getSmartWidth(T,e(window).width()):x=h.getSmartWidth(T,v.get("width"));var N=h.getSmartClass(T,x);v.set("width",x),v.set("activeWidth",x),v.set("activeSizing",N),b.hasSummary&&v.set("summaryShort",v.get("summary").trunc(140,!0)),b.hasManifest||v.getDefaultSource();if(y||b.hasManifest){switch(i){case"audio":p.push(v);break;case"video":m.push(v);default:}v.set("features",b);if(i=="video"){var C=v.get("provider").toLowerCase(),k=f.getProviderClass(C),L={};k&&(L.provider=C,L.src=v.getDefaultSource(),v.set("externalConsumer",new f({model:v,item:L,provider:new k})),oump.ismobile||v.get("externalConsumer").fetchMediaContent(function(){}))}o.call(this,v)}},featuresSet:function(e,t,n){e.get("trackDefault")==0&&n=="video"&&(e.get("tracksSubtitles").length>0?e.get("tracksSubtitles")[0].isDefaultTrack=!0:e.get("tracksCaptions").length>0&&(e.get("tracksCaptions")[0].isDefaultTrack=!0)),e.get("sources3").length>1&&(t.hasSources=!0),n=="video"&&(e.get("tracksCaptions").length>0&&(t.hasTracksCaptions=!0),e.get("tracksSubtitles").length>0&&e.get("type")=="video"&&(t.hasTracksSubtitles=!0),e.get("tracksAudiodescriptions").length>0&&e.get("type")=="video"&&(t.hasAudiodescriptions=!0)),e.get("tracksAnnotations").length>0&&(t.hasTracksAnnotations=!0),e.get("tracksScripts").length>0&&(t.hasTracksScripts=!0),e.get("tracksChapters").length>0&&(t.hasTracksChapters=!0),e.get("tracksDescriptions").length>0&&(t.hasTracksDescriptions=!0),e.get("tracksMetadata").length>0&&(t.hasTracksMetadata=!0),e.get("tracksTranscripts").length>0&&(t.hasTracksTranscripts=!0,t.hasTranscript=!0);var r=e.get("disabledFeatures");if(r!=undefined&&r!==!1){var i=!1;r.indexOf("all")!=-1&&(i=!0);if(i||r.indexOf("controls")!=-1)t.hasBasicControls=!1;if(i||r.indexOf("sources")!=-1)t.hasSources=!1;if(i||r.indexOf("captions")!=-1)t.hasTracksCaptions=!1;if(i||r.indexOf("chapters")!=-1)t.hasTracksChapters=!1;if(i||r.indexOf("textdescriptions")!=-1)t.hasTracksDescriptions=!1;if(i||r.indexOf("audiodescriptions")!=-1)t.hasAudiodescriptions=!1;if(i||r.indexOf("metadata")!=-1)t.hasMetadata=!1;if(i||r.indexOf("transcript")!=-1)t.hasTranscript=!1;if(i||r.indexOf("subtitles")!=-1)t.hasTracksSubtitles=!1;if(i||r.indexOf("transcripts")!=-1)t.hasTranscript=!1;if(i||r.indexOf("title")!=-1)t.hasTitle=!1;if(i||r.indexOf("description")!=-1)t.hasSummary=!1;if(i||r.indexOf("playlist")!=-1)t.hasPlaylist=!1;if(i||r.indexOf("share")!=-1)t.hasShare=!1;if(i||r.indexOf("fullscreen")!=-1)t.hasFullscreen=!1;if(i||r.indexOf("annotation")!=-1)t.hasTracksAnnotations=!1;if(i||r.indexOf("scripts")!=-1)t.hasTracksScripts=!1;if(i||r.indexOf("quality")!=-1)t.hasQuality=!1;if(i||r.indexOf("autoplay")!=-1)t.hasAutoplay=!1;if(i||r.indexOf("language")!=-1)t.hasLanguage=!1;if(i||r.indexOf("download")!=-1)t.hasDownload=!1;if(i||r.indexOf("setting")!=-1)t.hasSettings=!1;if(i||r.indexOf("captions")!=-1)t.hasTracksSubtitles=!1;if(i||r.indexOf("copyright")!=-1)t.hasCopyright=!1;i&&(t.hasSettings=!1)}e.set("features",t)}});return h}),define("text!app/tpl/controls/playlist.html",[],function(){return'<!-- <div id="<%= id %>_fd_p" class="omp-playlist"> -->\n    <div class="omp-feature-header omp-header">\n        <!--<span class="omp-chapters-close"  id="<%= id %>_fd_p_close"></span>-->\n        <div class="omp-feature-title"><span><%= labels.playlist %></span>\n        <!--<i class="omp-toggle-button up-toggle"></i>-->\n        </div>\n    </div>\n    <% if(oump.isepub != undefined && oump.isepub === true) { %>\n        <div id="<%= id %>_fd_p_epub_contents" class="omp-playlist-contents">\n            <div id="<%= id %>_fd_p_video" class="omp-playlist-video">\n                <div class="content_empty">\n                    <span class="omp-warning-icon"></span><label class="omp-loading-content"><%= labels.playlistUnavailable %></label>\n                </div>\n            </div>\n        </div>\n    <% } else { %>\n        <div id="<%= id %>_fd_p_contents" class="omp-playlist-contents">\n            <div id="<%= id %>_fd_p_video" class="omp-playlist-video">\n                <ul id="<%= id %>_fd_p_list_video" class="omp-list-video">\n\n                </ul>\n            </div>\n\n        </div>\n    <% } %>\n\n\n<!-- </div> -->'}),define("text!app/tpl/controls/playlist_item.html",[],function(){return'    <button class="omp-video-img"\n		 tabindex="<%= tabs.playlist %>">\n		<div class="<%= item.kind != \'media\' ? \'omp-default-img\' :\'omp-hidden\' %>"></div>\n		<img class="<%= item.kind != \'media\' ? \'omp-hidden\' :\'\' %> " src="<%- item.poster %>" alt="<%- item.title %>">\n		<span class="omp-<%= item.type == \'audio\' ? \'audio\' :\'video\' %>-playicon"></span>\n        <div class="omp-time-length"><%= item.videolength %></div>\n    </button>\n    <div class ="omp-video-description">\n         <h1 onerror="" class="omp-video-title"> <%= item.title %></h1>\n         <p onerror=""><%= item.description %></p>\n    </div>'}),define("app/views/playlist_item_view",["jquery","backbone","underscore","text!app/tpl/controls/playlist_item.html","app/helpers/utilities"],function(e,t,n,r,i){"use strict";var s=t.View.extend({className:"omp-video-item",tagName:"li",events:{click:"onItemClick"},initialize:function(e){this.item=e.item,this.itemcontainer=e.container,this.tabs=e.tabs,this.id=e.mid,n.bindAll(this,"onItemClick")},render:function(){var e=this;this.item.poster=this.item.poster==undefined||!this.item.poster.length?"":this.item.poster,this.item.description=this.item.description==undefined||!this.item.description.length?"":this.item.description,this.item.title=this.item.title==undefined||!this.item.title.length?"":this.item.title,this.item.videolength=this.item.videolength==undefined||!this.item.videolength.length?"":this.item.videolength;var t=n.template(r)({item:this.item,tabs:this.tabs});return this.$el.html(t),this.$el.attr("data-position",parseInt(this.item.order)),setTimeout(function(){this.$el.find("a").attr("tabindex",-1),this.$el.find("svg").attr("tabindex",-1)}.bind(this),100),this.item.viewObj=this,this.undelegateEvents(),this.delegateEvents(),this.listenTo(this,"change:playlist_item_order",this.updateDataPosition),this.item.poster&&this.item.kind!="media"&&this.handlerLoadImg(),this.listenTo(this.itemcontainer,"playlist_view:resize",this.resize),setTimeout(function(){this.resize()}.bind(this),200),this},onItemClick:function(){this.trigger("playlist_item_view:click",this.item)},updateDataPosition:function(){this.$el.attr("data-position",parseInt(this.item.order))},handlerLoadImg:function(){var e=this,t=this.$el.find(".omp-video-img img"),n=this.$el.find(".omp-default-img");t.removeClass("omp-hidden"),n.addClass("omp-hidden"),t.on("error",function(){t.addClass("omp-hidden"),n.removeClass("omp-hidden")})},resize:function(){var t=this,n=e("#"+t.id).width(),r=e(window).width(),i="",s="",o="",u="",a="";n&&(n<=820&&n>535?(i="50%",s="170px",o="90px",u="14pt",a="18px"):n<=535&&n>=390?(i="50%",s="150px",o="80px",u="14pt",a="18px"):n<=389&&n>=320?(i=r<=386?"34%":"46%",s="100px",o="60px",u="10pt",a="16px"):(s=oump.ismobile?"100px":"190px",o=oump.ismobile?"60px":"100px",u=oump.ismobile?"10pt":"14pt",a=oump.ismobile?"16px":"18px"),t.$el.children(".omp-video-description").width(i),t.$el.children(".omp-video-img").find(".omp-time-length").css({"font-size":u,height:a}),t.$el.children(".omp-video-img").css({width:s,height:o}))}});return s}),define("text!app/tpl/controls/playlist_control_item.html",[],function(){return'<button  class="omp-<%= item.type == \'audio\' ? \'audio\' : \'video\' %>-playicon" tabindex="<%= tabIndex %>"\n		aria-label="<%- label %>"\n		title="<%- label %>"></button>\n<label class="omp-recommend-label"><%- label %></label>\n<img class="omp-media-recommend-img" src="<% if (item.hasOwnProperty(\'poster\')) { %> <%= item.poster %> <% } %>"\n     onerror="this.style.display = \'none\';">'}),define("app/views/playlist_control_item_view",["jquery","backbone","underscore","text!app/tpl/controls/playlist_control_item.html"],function(e,t,n,r){"use strict";return t.View.extend({events:{"load .omp-media-recommend-img":"onLoadImg",click:"onClick"},initialize:function(e){this.tabIndex=e.tabIndex,this.$el.addClass(e.selector),this.pos=e.pos,this.dataModel=e.dataModel,this.label=this.pos=="next"?this.dataModel.get("labels").next+" ":this.dataModel.get("labels").previous+" "},render:function(e){e.type=e.kind=="media"?"video":e.type;var t;return t=n.template(r)({item:e,label:this.label+e.type,tabIndex:this.tabIndex}),this.delegateEvents(),this.$el.html(t),this},onLoadImg:function(){this.$el.find(".omp-recommend-label").remove()},onClick:function(){this.trigger("playlist_item:click",this.pos)}})}),define("text!templates/controls/autoplay_message.html",[],function(){return'<div class="omp-autoplay-message" title="Autoplay Message">\n    <span class="omp-autoplay-message-content">\n    	<%=  labels.nextPlaylist %>\n    </span>\n</div>'}),define("app/views/playlist_control_view",["jquery","backbone","underscore","app/views/playlist_control_item_view","text!templates/controls/autoplay_message.html","app/helpers/utilities"],function(e,t,n,r,i,s){"use strict";return t.View.extend({isActive:!1,next:undefined,prev:undefined,timeoutID:{},className:"media_controls",initialize:function(t){this.dataModel=t.dataModel,this.mid=this.dataModel.id,this.duration=this.dataModel.get("autoPlayDuration"),this.playerObject=t.playerObject,this.playlistView=t.playlistView,this.$button=e("#"+this.mid+"_so_a"),this.activeProp="autoplayActive",this.hasnext=!1,this.waitingNext=!1},render:function(){return this.$play=e("#"+this.mid+"_m_playpause"),this.$progress=e("#"+this.mid+" .omp-media-wrapper .progress"),this.next=new r({selector:"omp-media-recommend-forward",tabIndex:this.dataModel.get("tabs").videonavigation,pos:"next",dataModel:this.dataModel}),this.prev=new r({selector:"omp-media-recommend-backward",tabIndex:this.dataModel.get("tabs").videonavigation,pos:"prev",dataModel:this.dataModel}),this.$el.find(".omp-autoplay-message").remove(),this.$el.append(n.template(i)({duration:this.duration,labels:this.dataModel.get("labels")})),this.initEvent(),this},renderItem:function(e,t){var n;n=this[t].render(e).$el,t=="next"&&(this.hasnext=!0,this.waitingNext&&this.renderLoadingUI()),n.toggle(this.isActive),this.$el.append(n)},removeItem:function(e){this[e].remove(),e=="next"&&(this.hasnext=!1)},clearTimeoutStatus:function(){clearTimeout(this.timeoutID.navigate),this.$progress.find("canvas").remove()},statusIsEnd:function(){this.playerObject.pause();var t=this.dataModel.get("labels");e("#"+this.dataModel.get("id")+"_clickable_overlay").css("z-index",-1);var n=this;setTimeout(function(){e(n.playerObject).on("timeupdate.playlist",function(){n.setActive(!1)})},100),oump.isphone?e("#"+n.mid+"_media_navigate").find("div.media_controls").hide():(n.next.$el.show(),n.prev.$el.show()),setTimeout(function(){oump.isphone||(n.hasnext?n.renderLoadingUI():n.waitingNext=!0)},200)},handleAutoplayMessage:function(){this.dataModel.get("autoplayActive")==1&&e("#"+this.mid+"_media_navigate").find("div.media_controls").find("div.omp-autoplay-message").show()},renderLoadingUI:function(){var e=this;s.createCircleLoading(this.dataModel.get("type"),this.mid,this.$progress[0],this.duration,this.timeoutID,"navigate",function(){e.dataModel.get("autoplayActive")&&e.onItemClick("next")}.bind(this)),this.handleAutoplayMessage(),this.waitingNext=!1},statusIsBeforeEnd:function(){e(this.playerObject).off("timeupdate.playlist"),this.next.$el.hide(),this.prev.$el.hide(),this.$el.find(".omp-autoplay-message").hide(),this.waitingNext=!1},setAutoplayActive:function(){this.$button.attr("omp-settings-toogle",this.dataModel.get(this.activeProp))},setActive:function(e){this.isActive=e,this.clearTimeoutStatus(),this.isActive?this.statusIsEnd():this.statusIsBeforeEnd()},initEvent:function(){var t=this;this.listenTo(this.playlistView,"playlist_control_item:render_item",this.renderItem.bind(this)),this.listenTo(this.playlistView,"playlist_control_item:remove_item",this.removeItem.bind(this)),this.listenTo(this.next,"playlist_item:click",this.onItemClick.bind(this)),this.listenTo(this.prev,"playlist_item:click",this.onItemClick.bind(this)),this.listenTo(this.dataModel,"change:"+this.activeProp,this.setAutoplayActive),e(this.playerObject).on("ended.playlist",function(){this.setActive(!0)}.bind(this)),window.oump.ismobile&&this.listenTo(this.dataModel,"change:isFullscreen",function(){this.setActive(this.playerObject.paused&&this.playerObject.currentTime==this.dataModel.get("duration"))}.bind(this)),this.dataModel.get("epub")!=undefined&&this.dataModel.get("epub")==="true"&&e(this.playerObject).on("timeupdate",function(e){if(t.dataModel.get("duration")==e.target.currentTime){var n=document.getElementById(t.dataModel.get("id")+"_video");n.style.height=t.dataModel.get("videoHeight")+"px",t.setActive(!0)}})},onItemClick:function(e){this.clearTimeoutStatus(),this.trigger("playlist_"+e+":click")}})}),define("app/views/playlist_view",["jquery","backbone","underscore","text!app/tpl/controls/playlist.html","app/views/playlist_item_view","app/views/playlist_control_view","app/helpers/utilities"],function(e,t,n,r,i,s,o){"use strict";var u=t.View.extend({className:"omp-playlist",attributes:{"omp-tab-feature-playlist":""},events:{},initialize:function(e){this.clicked=!1,this.model=e.model,this.items=this.model.get("currentPlaylist").fetchedItems,this.handleReload=e.handleReload,this.playerObject=e.playerObject,this.itemView=[]},renderItem:function(e){var t=this,r=this.$el.find("#"+this.model.get("id")+"_fd_p_list_video");t.itemView&&n.each(t.itemView,function(e){e.id=t.model.get("id")},t);var s=e.viewObj?e.viewObj:new i({item:e,tabs:this.model.get("tabs"),container:this,mid:this.model.get("id")});this.itemView.push(s),s.$el=s.render().$el,r.append(s.$el);var o=this.items=this.model.get("currentPlaylist").fetchedItems;this.getCurrentItem(this.model,o);while(parseInt(s.$el.attr("data-position"))<parseInt(s.$el.prev().attr("data-position")))s.$el.insertBefore(s.$el.prev());this.indexCurr==e.order?(e.isPlaying=!0,this.$elCurr=e.viewObj.$el,this.$elCurr.addClass("disable"),this.$elCurr.off("click")):e.viewObj.$el.removeClass("disable"),this.$elCurr?this.updatePrevNext(this.$elCurr.next(),this.$elCurr.prev()):this.updatePrevNext(o[0].viewObj.$el,[]),this.stopListening(s,"playlist_item_view:click",this.onItemClick),this.listenToOnce(s,"playlist_item_view:click",this.onItemClick)},updatePrevNext:function(e,t){this.trigger("playlist_control_item:remove_item","next"),e.length>0&&(this.indexNext=parseInt(e.get(0).getAttribute("data-position")),this.trigger("playlist_control_item:render_item",this.items[this.indexNext],"next")),this.trigger("playlist_control_item:remove_item","prev"),t.length>0&&(this.indexPrev=parseInt(t.get(0).getAttribute("data-position")),this.trigger("playlist_control_item:render_item",this.items[this.indexPrev],"prev"))},getCurrentItem:function(e,t){var r=e.get("manifest"),i=r.split("/"),s=i.length,o=i[s-1],u=i[s-3],a=i[s-7],f=i[s-4];n.each(t,function(e){var t=e.manifest,n=t.split("/"),i=n.length,s=n[i-3]==u?!0:!1,l=n[i-1]==o?!0:!1,c=n[i-7]==a?!0:!1,h=n[i-4]==f?!0:!1;r==t?this.indexCurr=e.order:s&&l&&c&&h&&(this.indexCurr=e.order)},this)},render:function(){e("#"+this.getID()+"_f_playlist_max").parent().hasClass("omp-hidden")&&e("#"+this.getID()+"_f_pl_max").parent().hasClass("omp-hidden")&&(this.model.get("tabs").playlist+=100),this.indexCurr=-1;var t=n.template(r)({id:this.getID(),labels:this.model.get("labels")});this.$el.attr("id",this.getID()+"_fd_p"),this.$el.html(t),this.playerObject!=undefined&&this.initControl();var i=this.items||[],s=i.length;return s>0&&n.each(i,function(e){this.renderItem(e)},this),this.stopListening(this,"playlist_view:push"),this.listenTo(this,"playlist_view:push",this.renderItem),this.resizeplaylistview(),this},onItemClick:function(e){this.clicked||(this.clicked=!0,this.handleReload(e))},resetClick:function(){this.clicked=!1},onPrevClick:function(){this.handleReload(this.items[this.indexPrev])},onNextClick:function(){this.handleReload(this.items[this.indexNext])},initControl:function(){this.controlView=new s({dataModel:this.model,playerObject:this.playerObject,playlistView:this});var t=e("#"+this.model.id+"_media_navigate");t.html(this.controlView.render().$el),this.listenTo(this.controlView,"playlist_next:click",this.onNextClick),this.listenTo(this.controlView,"playlist_prev:click",this.onPrevClick)},getID:function(){return this.model.get("id")},remove:function(){this.controlView&&this.controlView.remove()},resizeplaylistview:function(){var t=this;e(window).resize(function(){t.trigger("playlist_view:resize")})},attachPlayer:function(e){this.playerObject=e}});return u}),define("text!app/tpl/manifest/html5.html",[],function(){return'<<%= type %> style="display:none;"\r\n    data-omp-type="<%= type %>"\r\n    <% if (typeof player !== \'undefined\') { %>\r\n        data-omp-player = <%= player %> <%\r\n    } else { %>\r\n        data-omp-player="html5" <%\r\n    }\r\n    if (typeof autoplay !== \'undefined\') { %>\r\n        data-omp-autoplay <%\r\n    }\r\n    if (typeof loop !== \'undefined\') { %>\r\n        data-omp-loop <%\r\n    }\r\n    if (typeof muted !== \'undefined\') { %>\r\n        data-omp-muted <%\r\n    }\r\n    if (typeof width !== \'undefined\') { %>\r\n        data-omp-width = "<%= width %>" <%\r\n    }\r\n    if (typeof height !== \'undefined\') { %>\r\n        data-omp-height = "<%= height %>" <%\r\n    }\r\n\r\n    if (typeof language !== \'undefined\') { %>\r\n        data-omp-language = "<%= language %>" <%\r\n    }\r\n\r\n    if (typeof disable_features !== \'undefined\') { %>\r\n        data-omp-disable-features = "<%= disable_features %>" <%\r\n    }\r\n\r\n    if (typeof sizing !== \'undefined\') { %>\r\n        data-omp-sizing = "<%= sizing %>" <%\r\n    }\r\n\r\n    if (typeof baseurl !== \'undefined\') { %>\r\n        data-omp-base-url = "<%= baseurl %>" <%\r\n    }\r\n\r\n    if (typeof iosbaseurl !== \'undefined\') { %>\r\n        data-omp-ios-base-url = <%= iosbaseurl %> <%\r\n    }\r\n\r\n    if (typeof thumbnail_url !== \'undefined\' && typeof thumbnail_url != \'object\' ) { %>\r\n        data-omp-poster = "<%= thumbnail_url %>" <%\r\n    } %>\r\n\r\n>\r\n    <%\r\n    // ------------------------------------------------------\r\n    // source\r\n    // ------------------------------------------------------\r\n    %>\r\n\r\n    <%\r\n    var consumer_src = \'\';\r\n    if (typeof provider_name !== \'undefined\' &&\r\n        !_.isEmpty(provider_name) &&\r\n        (provider_name.toLowerCase() != \'ou\') &&\r\n        (provider_name.toLowerCase() != \'open university\')\r\n    ) {\r\n        if (typeof provider_url !== \'undefined\') {\r\n            consumer_src = provider_url;\r\n        }\r\n    }\r\n\r\n    var provider = \'\';\r\n    if (typeof provider_name !== \'undefined\') {\r\n        provider = provider_name;\r\n    }\r\n\r\n    %>\r\n\r\n    <%\r\n\r\n    if (consumer_src && provider) { %>\r\n        <source type="video/mp4" src="<%= consumer_src %>" data-omp-player="media"\r\n                data-omp-provider="<%= provider %>"\r\n        />\r\n    <% } else {\r\n        if (typeof sources != \'undefined\' && !_.isEmpty(sources.source)) {\r\n            if (Object.prototype.toString.call(sources.source) !== \'[object Array]\') {\r\n                sources.source = [sources.source];\r\n            }\r\n\r\n            var hasDefaultUrl = false;\r\n            sources.source.forEach(function(value, index) { %>\r\n                <% if (value.src == url) { %>\r\n                    <source type="<%= value.type %>" data-omp-src="<%= value.src %>"\r\n                            data-omp-label="<%= value.label %>"\r\n                            data-omp-default="default"\r\n                            data-omp-resolution="<%= value.resolution %>"\r\n                    />\r\n                <% hasDefaultUrl = true; } %>\r\n            <% });\r\n            sources.source.forEach(function(value, index) {\r\n                if (value.src != url) {\r\n                    if (hasDefaultUrl) { %>\r\n                        <source type="<%= value.type %>" data-omp-src="<%= value.src %>"\r\n                                data-omp-label="<%= value.label %>"\r\n                                data-omp-resolution="<%= value.resolution %>"\r\n                        /><%\r\n                    } else { %>\r\n                        <source type="<%= value.type %>" data-omp-src="<%= value.src %>"\r\n                                data-omp-label="<%= value.label %>"\r\n                                data-omp-default="<%= value.default %>"\r\n                                data-omp-resolution="<%= value.resolution %>"\r\n                        /> <%\r\n                    }\r\n                }\r\n            });\r\n        }\r\n    } %>\r\n\r\n    // ------------------------------------------------------\r\n    // tracks\r\n    // ------------------------------------------------------\r\n\r\n    <%\r\n    if (typeof tracks != \'undefined\' && !_.isEmpty(tracks.track)) {\r\n        if (Object.prototype.toString.call(tracks.track) !== \'[object Array]\') {\r\n            tracks.track = [tracks.track];\r\n        }\r\n\r\n        tracks.track.forEach(function (value, index) { %>\r\n            <%\r\n            if (value.kind == \'chapters\') {  %>\r\n                <div data-omp-name="track" data-omp-kind="chapters" data-omp-srclang="<%= value.srclang %>" data-omp-type="<%= value.type %>" data-omp-src="<%= value.src %>" data-omp-label="<%= value.label %>"></div> <%\r\n\r\n            } else if (value.kind == \'subtitles\') {  %>\r\n                <div data-omp-name="track" data-omp-kind="subtitles" data-omp-srclang="<%= value.srclang %>" data-omp-type="<%= value.type %>" data-omp-src="<%= value.src %>" data-omp-label="<%= value.label %>"></div><%\r\n\r\n            } else if (value.kind == \'transcripts\') {  %>\r\n\r\n                <div data-omp-name="track" data-omp-kind="transcripts" data-omp-srclang="<%= value.srclang %>"\r\n                     data-omp-type="<%= value.type %>"\r\n                     data-omp-src="<%= value.src %>" data-omp-label="<%= value.label %>"></div> <%\r\n\r\n            } else if (value.kind == \'descriptions\') {  %>\r\n                <div data-omp-name="track" data-omp-kind="descriptions" data-omp-srclang="<%= value.srclang %>"\r\n                     data-omp-type="<%= value.type %>"\r\n                     data-omp-src="<%= value.src %>" data-omp-label="<%= value.label %>"></div> <%\r\n            } else if (value.kind == \'annotations\') {  %>\r\n            <div data-omp-name="track" data-omp-kind="annotations" data-omp-srclang="<%= value.srclang %>"\r\n                 data-omp-type="<%= value.type %>"\r\n                 data-omp-src="<%= value.src %>" data-omp-label="<%= value.label %>"></div> <%\r\n            } else if (value.kind == \'audiodescriptions\') {  %>\r\n            <div data-omp-name="track" data-omp-kind="audiodescriptions" data-omp-srclang="<%= value.srclang %>"\r\n                 data-omp-type="<%= value.type %>"\r\n                 data-omp-src="<%= value.src %>" data-omp-label="<%= value.label %>"></div> <%\r\n            } %>\r\n        <% });\r\n    }\r\n    %>\r\n\r\n    <div data-omp-name="manifest" data-omp-manifest="<%= manifest %>"></div>\r\n\r\n    <div data-omp-name="title"><%= title %></div>\r\n    <div data-omp-name="summary">\r\n        <% if (typeof description !== \'undefined\') { %>\r\n            <%= description %> <%\r\n        } %>\r\n    </div>\r\n\r\n</<%= type %>>'}),define("app/views/media_view",["jquery","backbone","underscore","text!app/tpl/manifest/html5.html"],function(e,t,n,r){"use strict";var i=t.View.extend({events:{},initialize:function(e){this.item=e.item},render:function(){var t=this;if(this.item){t.item.title=t.item.title==undefined||!t.item.title.length?"":t.item.title;var i=n.template(r)(t.item);return t.setElement(e(i)),t}}});return i}),define("app/player",["require","backbone"],function(e,t){"use strict";var n=t.Model.extend({init:function(t){var n=t.get("player");t.get("isIE8")&&(n=t.get("flashPlayer")),n=="flowplayer"&&t.get("type")=="audio"&&(n="ouflash");switch(n){case"ouflash":e(["app/ouflash"],function(e){var n=new e;n.init(t)});break;case"media":e(["app/html5_consumer"],function(e){var n=new e;n.init(t)});break;case"html5":e(["app/html5"],function(e){var n=new e;n.init(t)});break;default:e(["app/ouflash"],function(e){var n=new e;n.init(t)})}}});return n}),define("text!templates/controls/placeholder.html",[],function(){return'\r\n<div <% if (id !== false) { %>id="<%= id %>"<% } %>\r\n     <% if (activeSizing == \'fixed\') { %>\r\n         class="omp-wrapper omp-fixed"\r\n     <% } else if (activeSizing == \'custom\') { %>\r\n         class="omp-wrapper omp-custom"\r\n     <% } else { %>\r\n         class="omp-wrapper omp-<%= activeSizing %>"\r\n     <% } %>\r\n\r\n     <% if ((sizing == \'fixed\') || (sizing == \'custom\') || (inlineContainer == true)) { %>\r\n        style="\r\n         <% if (inlineContainer == true) { %>\r\n            display: inline-block;\r\n         <% } %>\r\n         <% if (sizing == \'fixed\') { %>\r\n             width: <%= width %>px !important; max-width: 100%;\r\n         <% } else if (sizing == \'custom\') { %>\r\n             max-width: <%= width %>px !important;\r\n         <% } %>\r\n        "\r\n     <% } %>\r\n\r\n    <% if (typeof renderStyle != \'undefined\') { %>\r\n        data-renderstyle="<%= renderStyle %>"\r\n    <% } %>\r\n        data-end="end">\r\n\r\n    <% if ((sources3.length > 0) || (features.hasManifest)) { %>\r\n        <a class="omp-placeholder omp-space-btn" href="#<%= id %>_anchor" id="<%= id %>_anchor"\r\n            role="button" title="<%= labels.clickToStart  %>"\r\n           aria-label="<%= labels.clickOrPressToStart  %>"\r\n           tabindex="0">\r\n            <div class="omp-placeholder-image">\r\n                <div id="<%= id %>_default_background" class="omp-default-background"></div>\r\n                <div id="<%= id %>_video_lenghth" class="omp-placeholder-video-lenghth"><%= videolength %></div>\r\n                <img id="<%= id %>_placeholder_image" class="omp-hidden" src="<%= poster %>" alt=""/>\r\n\r\n                <div class="omp-placeholder-start omp-placeholder-<%= type %>">\r\n                    <button class="omp-placeholder-btn omp-space-btn" tabindex="0"\r\n                            aria-label="<%= labels.clickOrPressToStart  %>">\r\n                        <% if (type == \'audio\') { %>\r\n                            <i class="omp-placeholder-start-play-icon-audio"></i>\r\n                        <% } else {%>\r\n                            <i class="omp-placeholder-start-play-icon"></i>\r\n                        <% } %>\r\n                    </button>\r\n                    <div class="omp-placeholder-start-message"><%= labels.clickOrPressToStart  %></div>\r\n                </div>\r\n            </div>\r\n        </a>\r\n        <div class="omp-features-fixed">\r\n            <div class="omp-title simple"><% if (title !== false && (features.hasTitle)) { %> <%= title %> <% } %></div>\r\n        </div>\r\n    <% } else { %>\r\n        <div class="omp-placeholder-image">\r\n            <img src="<%= poster %>" alt=""/>\r\n        </div>\r\n    <% } %>\r\n\r\n    <!--[if lte IE 8]>\r\n        <div id="<%= id %>_ie8_fallback" class="omp-ie8-fallback omp-ie8-fallback-<%= type %>">\r\n        </div>\r\n    <![endif]-->\r\n    <!--[if IE 9]>\r\n        <div id="<%= id %>_ie9_check"></div>\r\n    <![endif]-->\r\n</div>'}),define("text!templates/controls/base.html",[],function(){return'\r\n<div id="<%= id %>"\r\n<% if (activeSizing == \'fixed\') { %>\r\nclass="omp-wrapper omp-fixed <% if(oump.browser == \'msie\') { %> ie<% } %>"\r\n<% } else if (activeSizing == \'custom\') { %>\r\nclass="omp-wrapper omp-custom <% if(oump.browser == \'msie\') { %> ie<% } %>"\r\n<% } else { %>\r\nclass="omp-wrapper omp-<%= activeSizing %> <% if(oump.browser == \'msie\') { %> ie<% } %>"\r\n<% } %>\r\n<% if (sizing == \'fixed\') { %>\r\nstyle="width: <%= width %>px !important;"\r\n<% } else if (sizing == \'custom\') {\r\nif (width < 328) {\r\n    width = 328;\r\n}\r\n%>\r\nstyle="max-width: <%= width %>px !important;"\r\n<% } %>\r\ndata-end="end"\r\n<% if (typeof renderStyle != \'undefined\') { %>\r\n    data-renderstyle="<%= renderStyle %>"\r\n<% } %>\r\n<% if (oump.ismobile) { %>\r\n    data-device="mobile"\r\n<% } %>\r\n\r\ntabindex="<%= tabs.start %>"\r\nrole="application"\r\n>\r\n\r\n<!--[if lte IE 8]>\r\n<div id="<%= id %>_ie8_fallback" class="omp-ie8-fallback omp-ie8-fallback-<%= type %>">\r\n</div>\r\n<![endif]-->\r\n\r\n<img id="<%= id %>_poster" src="<%= poster %>" style="width: 100%;" />\r\n\r\n<%\r\nvar _class = \'omp-controlbar\';\r\nif (!features.hasBasicControls && !features.hasSettings\r\n    && !features.hasTracksChapters && !features.hasTranscript && !features.hasPlaylist\r\n    && !features.hasDownload && !features.hasFullscreen && !features.hasTracksSubtitles\r\n) {\r\nvar _class = \'omp-controlbar-hidden\';\r\n}\r\n%>\r\n\r\n<div class="<%= _class %> <% if (oump.ismobile) { %>omp-transparent<% } %> <% if (oump.isphone) { %>omp-hidden<% } %>" id="<%= id %>_controlbar">\r\n    <div id="<%= id %>_progresswrap" class="omp-controlbar-row <% if (!features.hasBasicControls || oump.isphone) { %>omp-hidden<% } %>">\r\n        <div class="omp-progress-wrapper">\r\n            <div id="<%= id %>_p_control" class="omp-progress-control" title="<%= labels.progressBar %>" aria-label="<%= labels.progressBar %>">\r\n                <div id="<%= id %>_p_control_inner" class="omp-progress-control-inner">\r\n                    <div id="<%= id %>_p_bg" class="omp-progress-bg" title="<%= labels.progressBar %>" aria-label="<%= labels.progressBar %>"></div>\r\n                    <div id="<%= id %>_p_buffered" class="omp-progress-buffered"></div>\r\n                    <div id="<%= id %>_p_played" class="omp-progress-played" title="<%= labels.progressBar %>" aria-label="<%= labels.progressBar %>"></div>\r\n                    <div class="omp-progress-time">\r\n                        <div id="<%= id %>_p_time_line" class="omp-progress-time-line" aria-label="<%= labels.playCursor %>" title="<%= labels.playCursor %>">\r\n                            <a tabindex="-1" id="<%= id %>_p_time_line_tab" class="omp-progress-time-line-tab notabindex" onclick="javascript: return false;">\r\n                                <span class="omp-accesshide">Progress controller</span>\r\n                            </a>\r\n                            <div id="<%= id %>_p_time_outer"></div>\r\n                        </div>\r\n                        <div id="<%= id %>_p_time_txt" class="omp-progress-time-txt omp-hidden">00:00</div>\r\n                    </div>\r\n                    <% if (features.hasTracksChapters) { %>\r\n                    <div id="<%= id %>_p_chapters" class="omp-progress-chapters">\r\n                        <!-- TODO need more in model... -->\r\n                        <!--<button type="button" id="<%= id %>_p_chapter_1" class="omp-progress-chapter">\r\n                            <span class="omp-progress-chapter-title"><span>Chapter 1 title</span></span>\r\n                        </button>-->\r\n                    </div>\r\n                    <% } %>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <div class="omp-controlbar-row <% if (!features.hasBasicControls) { %>omp-hidden<% } %>" id="<%= id %>_controlbar_row">\r\n        <div class="omp-othercontrols-wrapper">\r\n            <div id="<%= id %>_controls_left" class="omp-controls-left <% if (!features.hasBasicControls) { %>omp-hidden<% } %>">\r\n                <div class="omp-inline w22">\r\n                    <button type="button" id="<%= id %>_m_playpause" class="omp-btn omp-play-small-icon"\r\n                            title="<%= labels.play %>" tabindex="<%= tabs.leftControls %>"\r\n                                aria-label="<%= labels.play %>">\r\n                    </button>\r\n                </div>\r\n                <div class="omp-inline w23">\r\n                    <button type="button" id="<%= id %>_m_stop" class="omp-btn omp-stop"\r\n                            title="<%= labels.stop %>" tabindex="<%= tabs.leftControls %>"\r\n                            aria-label="<%= labels.stop %>">\r\n                    </button>\r\n                </div>\r\n                <div class="omp-inline w24">\r\n                    <button type="button" id="<%= id %>_m_mute" class="omp-btn omp-mute"\r\n                            title="<%= labels.mute %>" tabindex="<%= tabs.leftControls %>"\r\n                            aria-label="<%= labels.mute %>">\r\n                    </button>\r\n                </div>\r\n\r\n                <div id="<%= id %>_p_volume_control" class="omp-inline omp-volume-controller"\r\n                     tabindex="<%= tabs.leftControls %>" title="<%= labels.volumeBar %>"\r\n                     aria-label="<%= labels.volumeBar %>">\r\n                    <div id="<%= id %>_p_volume_inner" class="omp-volume-progress-inner">\r\n                        <div id="<%= id %>_p_volume_bg" class="omp-volume-progress-bg" ></div>\r\n                        <div id="<%= id %>_p_volume_played" class="omp-volume-progress-played" ></div>\r\n                        <div class="omp-progress-time1" id="<%= id %>_volume_control_inner">\r\n                            <div id="<%= id %>_p_volume_time_line" class="omp-volume-progress-time-line" >\r\n                                <a tabindex="-1" href="" id="<%= id %>_p_volume_time_line_tab" class="omp-progress-volume-line-tab notabindex" onclick="javascript: return false;">\r\n                                    <span class="omp-accesshide">Progress controller</span>\r\n                                </a>\r\n                                <div id="<%= id %>_p_volume_outer"></div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                <div class="omp-inline">\r\n\r\n                </div>\r\n                <%\r\n                var class_omp_timer = \'omp-timer\';\r\n                if(oump.isepub != undefined && oump.isepub ) {\r\n                    class_omp_timer = \'omp-epub-timer\';\r\n                    if(oump.isios) {\r\n                        class_omp_timer = \'omp-timer\';\r\n                    }\r\n                }\r\n\r\n                %>\r\n                <div class="omp-inline">\r\n                        <span class="<%= class_omp_timer %>" title="<%= labels.lengthOfTime %>" aria-label="<%= labels.lengthOfTime %>">\r\n                            <span class="omp-accesshide">Timer</span>\r\n                            <span id="<%= id %>_timer_time">00:00</span> / <span id="<%= id %>_timer_length">00:00</span>\r\n                        </span>\r\n                </div>\r\n            </div>\r\n            <div id="<%= id %>_controls_right" class="omp-controls-right">\r\n                <% if (features.hasFullscreen == true) { %>\r\n                <div class="omp-inline omp-float-right omp-padright omp-hidden">\r\n                    <button type="button" id="<%= id %>_m_fullscreen" class="omp-btn omp-caption-fullscreen fixed-right-title"\r\n                            title="<%= labels.fullscreen %>" tabindex="<%= tabs.rightControls %>"\r\n                            aria-label="<%= labels.fullscreen %>">\r\n                    </button>\r\n                </div>\r\n                <% } %>\r\n                <div id="<%= id %>_options_controls" class="omp-inline omp-padright">\r\n                    <!-- setting goes here -->\r\n                    <div class="omp-mid">\r\n                        <% if (features.hasTranscript) { %>\r\n                        <div class="omp-inline">\r\n                            <button type="button" id="<%= id %>_f_transcript_mid" class="omp-btn" title="<%= labels.transcript %>">\r\n                                <span><%= labels.transcript %></span>\r\n                            </button>\r\n                        </div>\r\n                        <% }\r\n                        if (features.hasTracksDescriptions) { %>\r\n                        <div class="omp-inline">\r\n                            <button type="button" id="<%= id %>_f_ad_mid" class="omp-btn" title="<%= labels.audioDescription %>">\r\n                                AD\r\n                                <span class="omp-accesshide"><%= labels.audioDescription %></span>\r\n                            </button>\r\n                        </div>\r\n                        <% }\r\n                        if (features.hasTracksSubtitles) { %>\r\n                        <div class="omp-inline">\r\n                            <button type="button" id="<%= id %>_f_cc_mid" class="omp-btn" title="<%= labels.closedCaptions %>">\r\n                                <i class="fa fa-cc fa-lg"></i>\r\n                                <span class="omp-accesshide"><%= labels.closedCaptions %></span>\r\n                            </button>\r\n                        </div>\r\n                        <% }\r\n                        if (features.hasSources || features.hasTracksChapters || features.hasTranscript) {\r\n                        %>\r\n                        <div class="omp-inline">\r\n                            <button type="button" id="<%= id %>_f_options_mid" class="omp-btn" title="<%= labels.options %>">\r\n                                <i class="fa fa-cog fa-lg"></i>\r\n                                <span class="omp-accesshide"><%= labels.options %></span>\r\n                            </button>\r\n                        </div>\r\n                        <% } %>\r\n                    </div>\r\n                    <div class="omp-min">\r\n                        <%\r\n                        if (features.hasSources || features.hasTracksChapters || features.hasTranscript ||\r\n                            features.hasTracksDescriptions || features.hasTracksSubtitles) {\r\n                        %>\r\n                        <div class="omp-inline">\r\n                            <button type="button" id="<%= id %>_f_options_min" class="omp-btn omp-caption-settings" title="<%= labels.options %>">\r\n                            </button>\r\n                        </div>\r\n                        <% } %>\r\n                    </div>\r\n                </div>\r\n                <div id="<%= id %>_options_dialog" class="omp-options-dialog omp-hidden">\r\n                    <div id="<%= id %>_options_dialog_min" class="omp-min lightbox">\r\n                    </div>\r\n                    <div class="omp-mid">\r\n                        <% if (features.hasSources) { %>\r\n                        <div class="omp-right">\r\n                            <a id="<%= id %>_od_q_mid" href="" role="button">Quality (resolution)</a>\r\n                        </div>\r\n                        <% }\r\n                        if (features.hasTracksChapters) { %>\r\n                        <div class="omp-right">\r\n                            <a id="<%= id %>_od_c_mid" href="" role="button">Chapters</a>\r\n                        </div>\r\n                        <% } %>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n            <div class="omp-clearer"></div>\r\n        </div>\r\n    </div>\r\n</div>\r\n<div id="<%= id %>_features_dialog" class="omp-controlbar-row">\r\n        <div class="omp-features-wrapper">\r\n            <div class="omp-features-options" id="<%= id %>_f_options">\r\n                <div id="<%= id %>_f_mi">\r\n                </div>\r\n                <% if (features.hasTracksSubtitles) { %>\r\n                <div id="<%= id %>_fd_cc" class="omp-cc-options omp-hidden">\r\n                    <div class="omp-float-right omp-margin-left">\r\n                        <a id="<%= id %>_fd_cc_close" href="" role="button">Close</a>\r\n                    </div>\r\n                    <label for="<%= id %>_fd_cc_selector"><%= labels.audioDescription %></label>\r\n                    <select id="<%= id %>_fd_cc_selector">\r\n                        <option value="none">None</option>\r\n                        <% tracksSubtitles.forEach(function(tracksSubtitle, index) { %>\r\n                        <option value="<%= tracksSubtitle.srclang %>"><%= tracksSubtitle.label %></option>\r\n                        <% }); %>\r\n                    </select>\r\n                </div>\r\n                <% }\r\n\r\n                if (features.hasTracksChapters) { %>\r\n                <div id="<%= id %>_fd_c" class="omp-feature-chapters omp-chapters-section">\r\n                </div>\r\n                <% }\r\n                if (features.hasTranscript) { %>\r\n                <div id="<%= id %>_fd_t" class="omp-fd-transcript omp-hidden">\r\n\r\n                </div>\r\n                <% } %>\r\n                <% if (features.hasDownload) { %>\r\n                <div id="<%= id %>_fd_download" class="omp-fd-download omp-hidden">\r\n\r\n                </div>\r\n                <% } %>\r\n            </div>\r\n        </div>\r\n</div>\r\n<span id="<%= id %>_skip_media"></span>\r\n<div id="<%= id %>_audiodescription" ></div>\r\n\r\n<a id="<%= id %>_tab_end" href="#" class="omp-media-tab-end omp-hidden" tabindex="<%= tabs.end %>"\r\n   aria-label="<%= labels.exitMedia  %>"></a>\r\n\r\n</div>\r\n\r\n'}),define("text!templates/video/html5.html",[],function(){return'<div class="omp-media-wrapper" id="<%= id %>_media_wrapper">\r\n    <div id="<%= id %>_clickable_overlay" class="omp-hidden omp-clickable-overlay"></div>\r\n    <div id="<%= id %>_media_loader" class="omp-loader omp-hidden">\r\n\r\n    </div>\r\n    <video id="<%= id %>_video" style="width: 400px;"\r\n        <% if (defaultSource !== false) { %>src="<%= defaultSource %>"<% } %>\r\n        <% if (features.hasPoster && oump.ismobile) { %> poster="<%= poster %>" <% } %>\r\n    >\r\n        <% sources2.forEach(function(s, index) { %>\r\n            <% if (s.kind !== false) { %>\r\n                <source type="<%= s.kind %>" src="<%= s.src %>"/>\r\n            <% } %>\r\n        <% }); %>\r\n    </video>\r\n    <div id="<%= id %>_video_lenghth" class="omp-placeholder-video-lenghth omp-hidden"><%= videolength %></div>\r\n    <ul id="<%= id %>_progress_waiting_icon" class="progress">\r\n        <span id="<%= id %>_center_playicon" class="omp-<%= type %>-playicon omp-video-waiting-icon"></span>\r\n    </ul>\r\n    <!-- "Recommend backward/repeat/forward" -->\r\n    <div id = "<%= id %>_media_navigate" class="media_navigate">\r\n    </div>\r\n\r\n    <!-- end of "backward/repeat/forward" -->\r\n    <div class="quality-message-box" id="<%= id %>_quality_message_box"></div>\r\n</div>\r\n\r\n'}),define("text!templates/audio/html5.html",[],function(){return'<div class="omp-media-wrapper" id="<%= id %>_media_wrapper">\r\n    <% if (isMinimal){ %>\r\n      <audio id="<%= id %>_audio"\r\n         <% if (defaultSource !== false) { %>src="<%= defaultSource %>"<% } %> >\r\n     </audio>\r\n     <% if (oump.ismobile == true) { %> \r\n        <div id="<%= id %>_audio_background" class="omp-audio-background"></div>\r\n      <%  if (!oump.isphone) { %>\r\n          <span id="<%= id %>_center_playicon" class="omp-audio-playicon-minimal"></span>\r\n      <% } else { %>\r\n            <span id="<%= id %>_center_playicon" class="omp-<%= type %>-playicon"></span>\r\n      <% } %>\r\n    <% } %>\r\n   <% } else {%>\r\n    <div  id="<%= id %>_audio_background" class="omp-audio-background"></div>\r\n    <div id="<%= id %>_video_lenghth" class="omp-placeholder-audio-lenghth omp-hidden"><%= videolength %></div>\r\n    <img class="omp-hidden omp-audio-poster-default" src="<%= poster %>" alt="" />\r\n    <ul id="<%= id %>_progress_waiting_icon" class="progress">\r\n        <span id="<%= id %>_center_playicon" class="omp-<%= type %>-playicon omp-audio-waiting-icon"></span>\r\n    </ul>\r\n     <audio id="<%= id %>_audio"\r\n         <% if (defaultSource !== false) { %>src="<%= defaultSource %>"<% } %> >\r\n     </audio>\r\n     <div id = "<%= id %>_media_navigate" class="media_navigate">\r\n      </div>\r\n      <div id="<%= id %>_clickable_overlay" class="omp-hidden omp-clickable-overlay"></div>\r\n   <% } %>\r\n\r\n    <div class="quality-message-box" id="<%= id %>_quality_message_box"></div>\r\n</div>\r\n'}),define("text!templates/video/ouflash.html",[],function(){return'<% if (sourceflv) { %>\r\n\r\n<object type="application/x-shockwave-flash" data="<%= wwwroot %>/js/mediaplayer.swf"\r\n id="<%= id %>_video_ouflash" style="width:100%;margin-bottom:-5px;height:<%= computedheight %>px"\r\n>\r\n    <param name="autoplay" value="true"></param>\r\n    <param name="quality" value="high"></param>\r\n    <param name="flashvars" value="file=<%= sourceflv %>&autostart=true"></param>\r\n    <param name="allowscriptaccess" value="sameDomain"></param>\r\n    <param name="allowfullscreen" value="true"></param>\r\n    <param name="wmode" value="transparent"></param>\r\n    <p>[The video that should appear here can only be played on a computer that has Adobe Flash Player installed. Apologies.]</p>\r\n</object>\r\n\r\n<% } else if (sourcemp4) { %>\r\n\r\n<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width=400 height=330>\r\n    <param name="_cx" value="10583">\r\n    <param name="_cy" value="8731">\r\n    <param name="FlashVars" value="file=<%= sourcemp4 %>&amp;width=400&amp;height=330&autostart=true">\r\n    <param name="Movie" value="<%= wwwroot %>/js/mediaplayer.swf">\r\n    <param name="Src" value="<%= wwwroot %>/js/mediaplayer.swf">\r\n    <param name="WMode" value="Transparent">\r\n    <param name="Play" value="0">\r\n    <param name="Loop" value="-1">\r\n    <param name="Quality" value="High">\r\n    <param name="SAlign" value="LT">\r\n    <param name="Menu" value="-1">\r\n    <param name="Base" value="">\r\n    <param name="AllowScriptAccess" value="sameDomain">\r\n    <param name="Scale" value="NoScale">\r\n    <param name="DeviceFont" value="0">\r\n    <param name="EmbedMovie" value="0">\r\n    <param name="BGColor" value="">\r\n    <param name="SWRemote" value="">\r\n    <param name="MovieData" value="">\r\n    <param name="SeamlessTabbing" value="1">\r\n    <param name="Profile" value="0">\r\n    <param name="ProfileAddress" value="">\r\n    <param name="ProfilePort" value="0">\r\n    <param name="AllowNetworking" value="all">\r\n    <param name="AllowFullScreen" value="true">\r\n    <param name="AllowFullScreenInteractive" value="false">\r\n    <param name="IsDependent" value="0">\r\n    <param name="autoplay" value="true"></param>\r\n    <video id="<%= id %>_video_ouflash"\r\n           src="<%= sourcemp4 %>"\r\n           width="400"\r\n           height="300"\r\n           controls="controls"\r\n           preload="none"\r\n           autoplay="true">\r\n            [The video that should appear here can only be played on a computer that has Adobe Flash Player installed, or a device that supports MP4 format in HTML5 video. Apologies.]\r\n    </video>\r\n</object>\r\n\r\n<% } %>\r\n<script type="text/javascript">\r\n// Apparently this script is needed for some android versions that don\'t work with \'controls\'\r\nvar p = document.getElementById(\'<%= id %>_video_ouflash\');\r\nvar isAndroid = navigator.userAgent.toLowerCase().indexOf(\'android\') != -1;\r\nif (p && isAndroid) {\r\n    p.onclick = function() {\r\n        if (p.paused) {\r\n            p.play();\r\n        } else {\r\n            p.pause();\r\n        }\r\n    };\r\n}\r\n</script>\r\n'}),define("text!templates/audio/ouflash.html",[],function(){return'\r\n<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width=400 height=330>\r\n    <param name="_cx" value="10583">\r\n    <param name="_cy" value="8731">\r\n    <param name="FlashVars" value="file=<%= sourcemp3 %>&amp;width=400&amp;height=330">\r\n    <param name="Movie" value="<%= wwwroot %>/js/mediaplayer.swf">\r\n    <param name="Src" value="<%= wwwroot %>/js/mediaplayer.swf">\r\n    <param name="WMode" value="Transparent">\r\n    <param name="Play" value="0">\r\n    <param name="Loop" value="-1">\r\n    <param name="Quality" value="High">\r\n    <param name="SAlign" value="LT">\r\n    <param name="Menu" value="-1">\r\n    <param name="Base" value="">\r\n    <param name="AllowScriptAccess" value="sameDomain">\r\n    <param name="Scale" value="NoScale">\r\n    <param name="DeviceFont" value="0">\r\n    <param name="EmbedMovie" value="0">\r\n    <param name="BGColor" value="">\r\n    <param name="SWRemote" value="">\r\n    <param name="MovieData" value="">\r\n    <param name="SeamlessTabbing" value="1">\r\n    <param name="Profile" value="0">\r\n    <param name="ProfileAddress" value="">\r\n    <param name="ProfilePort" value="0">\r\n    <param name="AllowNetworking" value="all">\r\n    <param name="AllowFullScreen" value="true">\r\n    <param name="AllowFullScreenInteractive" value="false">\r\n    <param name="IsDependent" value="0">\r\n    <video id="<%= id %>_audio_ouflash"\r\n           src="<%= sourcemp3 %>"\r\n           controls="controls"\r\n           preload="none">\r\n            [Audio not working; needs Flash, or HTML5 MP3 support.]\r\n    </video>\r\n</object>\r\n<script type="text/javascript">\r\n// Apparently this script is needed for some android versions that don\'t work with \'controls\'\r\nvar p = document.getElementById(\'<%= id %>_audio_ouflash\');\r\nvar isAndroid = navigator.userAgent.toLowerCase().indexOf(\'android\') != -1;\r\nif (p && isAndroid) {\r\n    p.onclick = function() {\r\n        if (p.paused) {\r\n            p.play();\r\n        } else {\r\n            p.pause();\r\n        }\r\n    };\r\n}\r\n</script>\r\n'}),define("text!templates/manifest/html5.html",[],function(){return'<<%= type %> style="display:none;"\r\n    data-omp-type="<%= type %>"\r\n    <% if (typeof player !== \'undefined\') { %>\r\n        data-omp-player = <%= player %> <%\r\n    } else { %>\r\n        data-omp-player="html5" <%\r\n    }\r\n    if (typeof autoplay !== \'undefined\') { %>\r\n        data-omp-autoplay <%\r\n    }\r\n    if (typeof loop !== \'undefined\') { %>\r\n        data-omp-loop <%\r\n    }\r\n    if (typeof muted !== \'undefined\') { %>\r\n        data-omp-muted <%\r\n    }\r\n    if (typeof width !== \'undefined\') { %>\r\n        data-omp-width = "<%= width %>" <%\r\n    }\r\n    if (typeof height !== \'undefined\') { %>\r\n        data-omp-height = "<%= height %>" <%\r\n    }\r\n\r\n    if (typeof language !== \'undefined\') { %>\r\n        data-omp-language = "<%= language %>" <%\r\n    }\r\n\r\n    if (typeof disable_features !== \'undefined\') { %>\r\n        data-omp-disable-features = "<%= disable_features %>" <%\r\n    }\r\n\r\n    if (typeof sizing !== \'undefined\') { %>\r\n        data-omp-sizing = "<%= sizing %>" <%\r\n    }\r\n\r\n    if (typeof baseurl !== \'undefined\') { %>\r\n        data-omp-base-url = "<%= baseurl %>" <%\r\n    }\r\n\r\n    if (typeof iosbaseurl !== \'undefined\') { %>\r\n        data-omp-ios-base-url = <%= iosbaseurl %> <%\r\n    }\r\n\r\n    if (typeof thumbnail_url !== \'undefined\' && typeof thumbnail_url != \'object\' ) { %>\r\n        data-omp-poster = "<%= thumbnail_url %>" <%\r\n    } %>\r\n\r\n>\r\n    <%\r\n    // ------------------------------------------------------\r\n    // source\r\n    // ------------------------------------------------------\r\n    %>\r\n\r\n    <%\r\n    var consumer_src = \'\';\r\n    if (typeof provider_name !== \'undefined\' &&\r\n        !_.isEmpty(provider_name) &&\r\n        (provider_name.toLowerCase() != \'ou\') &&\r\n        (provider_name.toLowerCase() != \'open university\')\r\n    ) {\r\n        if (typeof provider_url !== \'undefined\') {\r\n            consumer_src = provider_url;\r\n        }\r\n    }\r\n\r\n    var provider = \'\';\r\n    if (typeof provider_name !== \'undefined\') {\r\n        provider = provider_name;\r\n    }\r\n\r\n    %>\r\n\r\n    <%\r\n\r\n    if (consumer_src && provider) { %>\r\n        <source type="video/mp4" src="<%= consumer_src %>" data-omp-player="media"\r\n                data-omp-provider="<%= provider %>"\r\n        />\r\n    <% } else {\r\n        if (typeof sources != \'undefined\' && !_.isEmpty(sources.source)) {\r\n            if (Object.prototype.toString.call(sources.source) !== \'[object Array]\') {\r\n                sources.source = [sources.source];\r\n            }\r\n\r\n            var hasDefaultUrl = false;\r\n            sources.source.forEach(function(value, index) { %>\r\n                <% if (value.src == url) { %>\r\n                    <source type="<%= value.type %>" data-omp-src="<%= value.src %>"\r\n                            data-omp-label="<%= value.label %>"\r\n                            data-omp-default="default"\r\n                            data-omp-resolution="<%= value.resolution %>"\r\n                    />\r\n                <% hasDefaultUrl = true; } %>\r\n            <% });\r\n            sources.source.forEach(function(value, index) {\r\n                if (value.src != url) {\r\n                    if (hasDefaultUrl) { %>\r\n                        <source type="<%= value.type %>" data-omp-src="<%= value.src %>"\r\n                                data-omp-label="<%= value.label %>"\r\n                                data-omp-resolution="<%= value.resolution %>"\r\n                        /><%\r\n                    } else { %>\r\n                        <source type="<%= value.type %>" data-omp-src="<%= value.src %>"\r\n                                data-omp-label="<%= value.label %>"\r\n                                data-omp-default="<%= value.default %>"\r\n                                data-omp-resolution="<%= value.resolution %>"\r\n                        /> <%\r\n                    }\r\n                }\r\n            });\r\n        }\r\n    } %>\r\n\r\n    // ------------------------------------------------------\r\n    // tracks\r\n    // ------------------------------------------------------\r\n\r\n    <%\r\n    if (typeof tracks != \'undefined\' && !_.isEmpty(tracks.track)) {\r\n        if (Object.prototype.toString.call(tracks.track) !== \'[object Array]\') {\r\n            tracks.track = [tracks.track];\r\n        }\r\n\r\n        tracks.track.forEach(function (value, index) { %>\r\n            <%\r\n            if (value.kind == \'chapters\') {  %>\r\n                <div data-omp-name="track" data-omp-kind="chapters" data-omp-srclang="<%= value.srclang %>" data-omp-type="<%= value.type %>" data-omp-src="<%= value.src %>" data-omp-label="<%= value.label %>"></div> <%\r\n\r\n            } else if (value.kind == \'subtitles\') {  %>\r\n                <div data-omp-name="track" data-omp-kind="subtitles" data-omp-srclang="<%= value.srclang %>" data-omp-type="<%= value.type %>" data-omp-src="<%= value.src %>" data-omp-label="<%= value.label %>"></div><%\r\n\r\n            } else if (value.kind == \'transcripts\') {  %>\r\n\r\n                <div data-omp-name="track" data-omp-kind="transcripts" data-omp-srclang="<%= value.srclang %>"\r\n                     data-omp-type="<%= value.type %>"\r\n                     data-omp-src="<%= value.src %>" data-omp-label="<%= value.label %>"></div> <%\r\n\r\n            } else if (value.kind == \'descriptions\') {  %>\r\n                <div data-omp-name="track" data-omp-kind="descriptions" data-omp-srclang="<%= value.srclang %>"\r\n                     data-omp-type="<%= value.type %>"\r\n                     data-omp-src="<%= value.src %>" data-omp-label="<%= value.label %>"></div> <%\r\n            } else if (value.kind == \'annotations\') {  %>\r\n            <div data-omp-name="track" data-omp-kind="annotations" data-omp-srclang="<%= value.srclang %>"\r\n                 data-omp-type="<%= value.type %>"\r\n                 data-omp-src="<%= value.src %>" data-omp-label="<%= value.label %>"></div> <%\r\n            } else if (value.kind == \'audiodescriptions\') {  %>\r\n            <div data-omp-name="track" data-omp-kind="audiodescriptions" data-omp-srclang="<%= value.srclang %>"\r\n                 data-omp-type="<%= value.type %>"\r\n                 data-omp-src="<%= value.src %>" data-omp-label="<%= value.label %>"></div> <%\r\n            } %>\r\n        <% });\r\n    }\r\n    %>\r\n\r\n    <div data-omp-name="manifest" data-omp-manifest="<%= manifest %>"></div>\r\n\r\n    <div data-omp-name="title"><%= title %></div>\r\n    <div data-omp-name="summary">\r\n        <% if (typeof description !== \'undefined\') { %>\r\n            <%= description %> <%\r\n        } %>\r\n    </div>\r\n\r\n</<%= type %>>'}),define("app/tpl",["text!templates/controls/placeholder.html","text!templates/controls/base.html","text!templates/video/html5.html","text!templates/audio/html5.html","text!templates/video/ouflash.html","text!templates/audio/ouflash.html","text!templates/manifest/html5.html"],function(e,t,n,r,i,s,o){"use strict";return{tplControlsPlaceholder:e,tplControlsBase:t,tplVideoHTML5:n,tplAudioHTML5:r,tplVideoOUFlash:i,tplAudioOUFlash:s,tplManifestHTML5:o}}),define("app/views/controls_placeholder",["jquery","jquery","underscore","backbone","app/tpl","app/helpers/utilities"],function(e,t,n,r,i,s){"use strict";var o=r.View.extend({template:i.tplControlsPlaceholder,initialize:function(){e(window).on("resize",this.updatePosterSize.bind(this)),this.listenTo(this.model,"change:ratio",this.updatePosterSize),this.listenTo(this.model,"change:title",this.onUpdateTitle),this.listenTo(this.model,"change:poster",this.onUpdatePoster)},render:function(){this.model.set("videolength",this.model.get("videolength")||"");var e=n.template(this.template),t=e(this.model.toJSON());return this.$el.html(t),this},showPoster:function(){var t=this.model.checkHasFeature("poster");this.$img=e("#"+this.model.get("id")+"_placeholder_image").toggleClass("omp-hidden",!t),this.$defaultBg=e("#"+this.model.get("id")).find(".omp-default-background").toggleClass("omp-hidden",t),this.$el=e("#"+this.model.get("id")),this.$img.error(this.onErrorImg.bind(this)),!this.model.get("ratioFixed")&&!t&&this.model.set("ratio",parseFloat(this.model.get("orig_height")/this.$el.width()).toFixed(3)),this.updatePosterSize()},onErrorImg:function(){this.$img.addClass("omp-hidden"),this.$defaultBg.removeClass("omp-hidden"),this.model.get("features").hasPoster=!1,this.updatePosterSize()},updatePosterSize:function(){var t=this.model.get("ratio"),n=this.model.checkHasFeature("minimal")&&!oump.isphone&&this.model.get("type")=="audio";t=parseFloat(t),t=n?70/580:t,n&&e("#"+this.model.get("id")).find(".omp-placeholder-start").addClass("minimal"),t>0?this.$defaultBg.height(this.$defaultBg.width()*t):this.$img.css("height","auto !important")},onUpdateTitle:function(){this.model.checkHasFeature("title")&&(this.$el.find(".omp-features-fixed .omp-title").html(this.model.get("title")),oump.externaladapter.init(this.$el))},onUpdatePoster:function(){if(this.model.get("poster")==""||typeof this.model.get("poster")=="object")return;this.$img.attr("src",this.model.get("poster")),this.showPoster()}});return o}),define("app/nls/labels",{root:!1,en:!0,fr:!0,es:!0,de:!0,zh:!0,pl:!0,pt:!0,ja:!0,ko:!0,vi:!0,ms:!0,cy:!0}),define("app/placeholder",["jquery","app/player","app/views/controls_placeholder","app/helpers/utilities","app/nls/labels"],function(e,t,n,r,i){var s={setup:function(s){var o=this;s.get("uilanguage")==undefined&&s.set("apiOptions",[]);var u=s.get("uilanguage")!=undefined&&s.get("uilanguage")?s.get("uilanguage"):"en";i[u]==undefined&&(u="en"),s.set("labelActive",!1),window.oump.defineOUMP(["require"],function(i){i(["app/nls/"+u+"/labels"],function(i){s.set("labelActive",!0),s.set("labels",i),s.get("renderStyle")==="advance"&&(s.get("provider")&&s.get("provider")!="OU"?e(".oucontent-media").each(function(){e(this).find(".oucontent-embedtemplate").length==0&&e(this).find(".oucontent-figure-text, .oucontent-longdesclink").remove()}):e(".oucontent-media.oucontent-audio-video").each(function(){e(this).find(".oucontent-embedtemplate").length==0&&e(this).find(".oucontent-figure-text, .oucontent-longdesclink").remove()}));var o=new n({model:s});if(o&&e("[omp-id="+s.get("id")+"]")){oump.ismobile?e("[omp-id="+s.get("id")+"]").replaceWith('<div id="'+s.id+'"></div>'):e("[omp-id="+s.get("id")+"]").replaceWith(o.render().el.childNodes),o.showPoster(),o.onUpdateTitle(),e("#"+s.get("id")).find("a.glossary").each(function(){e(this).replaceWith(e(this).html())}),s.get("renderStyle")==="compact"&&e("#"+s.get("id")).closest(".oucontent-media").addClass("omp"),document.getElementById(s.get("id")+"_ie8_fallback")&&(s.set("isIE8",!0),s.set("flashPlayer","ouflash")),s.updateSources(),document.getElementById(s.get("id")+"_ie9_check")&&(s.set("isIE9",!0),s.updateSubtitles());if(oump.ismobile){var u=new t;u.init(s);return}if(s.get("sources3").length>0||s.get("features").hasManifest){var a;oump.isios?a="block":a="flex",oump.browser!="msie"&&(r.loadSVG("#"+s.id+" .omp-placeholder-start-play-icon",a),r.loadSVG("#"+s.id+" .omp-placeholder-start-play-icon-audio",a)),oump.ismobile||(s.on("oump_active_player",function(){var e=new t;e.init(s),s.set("playerState","play")}),e("#"+s.get("id")+" a.omp-placeholder").add(".omp-placeholder-icon-wrapper").click(function(e){return e.stopPropagation(),s.trigger("oump_active_player"),!1}))}s.trigger("auto_duration",s.get("autoPlayDuration")),s.trigger("language_default",s.get("defaultLanguage")),s.trigger("language_number_items",s.get("tracksLanguages").length),s.trigger("quality_default",s.getDefaultSource()),window.tabOrder.attachView(e("#"+s.id),s)}})})}};return s}),define("text!app/tpl/controls/loading_view.html",[],function(){return'<% if (type === \'transcripts\') { %>\n<div class="loading_content">\n    <% if (state == \'error\') { %>\n    <span class="omp-warning-icon"></span>\n    <% } else  { %>\n    <span class="omp-loading-icon"></span>\n    <% } %>\n    <label class="omp-loading-content"><%= mess %></label>\n</div>\n<% } else if (type === \'quality\') { %>\n    <div style="text-align: center;">\n        <div class="omp-warning-icon-large"></div>\n        <div class="omp-loading-content-large"><%= mess %></div>\n        <div class="omp-close-wrapper">\n            <button class="omp-close-icon" id="<%= id %>_close_quality_message"\n                tabindex="<%= tabIndex %>"></button>\n        </div>\n    </div>\n<% } else  { %>\n    <div class="loading_content">\n        <div class="omp-feature-header omp-header">\n            <label><%=  type %></label>\n        </div>\n        <div class="omp-feature-subheader">\n            <div class="loading_content">\n                <% if (state == \'error\') { %>\n                <span class="omp-warning-icon"></span>\n                <% } else  { %>\n                <span class="omp-loading-icon"></span>\n                <% } %>\n                <label class="omp-loading-content"><%= mess %></label>\n            </div>\n        </div>\n    </div>\n<% } %>\n'}),define("app/views/loading_view",["jquery","backbone","underscore","app/helpers/utilities","text!app/tpl/controls/loading_view.html"],function(e,t,n,r,i){"use strict";var s=t.View.extend({initialize:function(e){this.dataModel=e.dataModel,this.type=e.type},render:function(e){var t;switch(e){case"error":t=this.dataModel.get("labels").contentUnavailable;break;case"quality_error":t=this.dataModel.get("labels").qualityUnavailable;break;default:t=this.dataModel.get("labels").loading}var r=n.template(i)({type:this.type,mess:t,state:e,id:this.dataModel.get("id"),tabIndex:this.dataModel.get("tabs").start});return this.$el.html(r),this}});return s}),define("app/helpers/hook/playlist_hook",["backbone","jquery","underscore","app/helpers/utilities","app/views/playlist_view","app/views/media_view","app/placeholder","app/helpers/external_consumer","app/views/loading_view"],function(e,t,n,r,i,s,o,u,a){"use strict";var f=function(e){this.dataModel=e._dataModel,this.playerObject=e._playerObject,this.isActive=this.dataModel.get("playlistActive"),this.listenToOnce(this,"create",this.initialize);var t=this;setTimeout(function(){t.trigger("create")},0)};return f.prototype=n.extend(f.prototype,e.Events),f.prototype=n.extend(f.prototype,{initialize:function(){this.fetchedItems=[],this.rawData=undefined,this.playlistView=undefined,this.dataModel.get("hasPlaylist")||this.removePlaylistView()},loadPlaylist:function(e){switch(e.loadby){case"manifest":default:var t=e.data.src,n=e.data.callback;oump.manifest.fetchSrc(t,function(r){this.rawData=r,e.fetchPlaylistItem?this.removePlaylistView():null,oump.manifest&&this.rawData&&(this.rawData.manifest=t,this.rawData.baseurl=this.rawData.iosbaseurl=oump.manifest.getBaseUrl("ou",t),this.dataModel.get("iOSBaseUrl")!=this.dataModel.get("baseUrl")&&(this.rawData.iosbaseurl=oump.manifest.getiOSBaseUrl("ou",{src:t,iosbaseurl:this.dataModel.get("iOSBaseUrl")}))),oump.manifest.setModelData(this.rawData,this.dataModel),n.call(this,this.rawData),this.isActive=this.dataModel.get("playlistActive"),e.fetchPlaylistItem?this.fetchPlaylistItem():null}.bind(this))}},fetchExternalPlaylist:function(e){var t=this;switch(e.loadby){case"playlistxml":default:var n=e.src,r=e.callback;oump.manifest.fetchSrc(n,function(e){e&&(t.resetPlaylistItems(),this.rawPlaylistItem=e.item),r&&r.call(this,e)}.bind(this))}},fetchPlaylistItem:function(){var e;try{typeof this.rawPlaylistItem!="undefined"?e=this.rawPlaylistItem:typeof rawData!="undefined"?e=this.rawData:e=this.dataModel.get("playlistItem"),e&&!oump.isArray(e)&&(e=[e])}catch(t){e=[]}this.dataModel.set("playlistItem",e),e=this.dataModel.get("playlistItem");var r=e!=undefined&&e.length!=undefined?e.length:0,i=this;if(r<=0){this.waitToFetchItem=!0;return}this.waitToFetchItem=!1,n.each(e,function(e,t){if(i.fetchedItems.length>0&&i.fetchedItems.some(function(t){if(t.manifest===e.src)return!0}))return;switch(e.kind){case"media":var n=e.provider.toLowerCase(),r=u.getProviderClass(n);if(r){var s=new u({model:this.dataModel,item:e,provider:new r});s.fetchMediaBrief(function(n){var r={index:t,poster:n.thumbnail_url,title:n.title,description:n.description,manifest:e.src,kind:e.kind,provider:e.provider,src:e.src,disable_features:e.disable_features};i.sortedPushFetchedItems(r),i.playlistView&&i.playlistView.trigger("playlist_view:push",r)})}break;case"manifest":default:var n=e.provider?e.provider.toLowerCase():"",o=e.src?e.src.replace("&amp;","&"):"";oump.manifest.fetchSrc(o,function(n){if(!n)return;var r=n,s=r.provider_name?r.provider_name.toLowerCase():"ou",a,f="";try{f=oump.manifest.getBaseUrl("ou",o)}catch(l){f=""}if(r)var c={index:t,title:r.title,description:r.description,manifest:o,kind:e.kind,type:r.type,provider:r.provider_name,videolength:r.length||""};r.thumbnail_url&&(r.thumbnail_url.search("http")>-1?c.poster=r.thumbnail_url:c.poster=f+"/"+r.thumbnail_url);if(s!="ou"&&s!="open university"&&s){var h=u.getProviderClass(s);if(h){e.provider=s,e.src=r.provider_url;var p=new u({model:null,item:e,provider:new h});p.fetchMediaBrief(function(e){if(!c.title||typeof c.title=="object")c.title=e.title;if(!c.description||typeof c.description=="object")c.description=e.description;if(!c.poster||typeof c.poster=="object")c.poster=e.thumbnail_url;i.sortedPushFetchedItems(c),i.playlistView&&i.playlistView.trigger("playlist_view:push",c)})}}else i.sortedPushFetchedItems(c),i.playlistView&&i.playlistView.trigger("playlist_view:push",c)})}},this)},handleReload:function(e){var r=this,i=!1,u=this.dataModel.get("type"),a=this.dataModel.get("id"),f=this.dataModel.get("width"),l=this.dataModel.get("height");window.stop!==undefined?window.stop():document.execCommand!==undefined&&document.execCommand("Stop",!1),this.dataModel.trigger("playlist_clickedonitems",e.title);switch(e.kind){case"media":e.manifest=e.src,this.handleReloadMedia(e,i);break;case"xml":default:this.loadPlaylist({loadby:"manifest",fetchPlaylistItem:!0,data:{src:e.manifest,callback:function(e){e&&e.playlist!=undefined&&(e.playlist.item!=undefined&&e.playlist.item.length>0||e.playlist.src)&&(i=!0,r.dataModel.get("features").hasPlaylist=!0,r.dataModel.set("hasPlaylist",!0)),window.oump.common.get(u+"s").remove(a),f&&e&&(e.width=f),delete oump.models[a],oump.resizer.removeHandler(a);var l=new s({item:e});if(l&&l.render()){var c=l.render().$el;window.oump.common.addMediaModel(c[0],r.dataModel.get("type"),function(s){oump.resizer.addHandler(s.get("id"),s,s.resizeEvent),i?r.resetPlaylistItems():null,t("#"+r.dataModel.id).empty(),t("#"+r.dataModel.id).replaceWith(c),r.dataModel=null,r.dataModel=window.oump.models[s.get("id")]=n.clone(s),oump.manifest.setModelData(e,r.dataModel),i||(r.dataModel.get("features").hasPlaylist=!0,r.dataModel.set("hasPlaylist",!0)),o.setup(s),s.set("currentPlaylist",r),r.showPlaylist(),r.listenToOnce(r,"play",r.playMedia),setTimeout(function(){r.trigger("play")},100)})}}}})}},toggleActive:function(){this.isActive=this.dataModel.get("playlistActive");var e=t("#"+this.getID()+" .omp-playlist-setting");e.attr("omp-settings-toogle",this.isActive),this.playlistView&&this.playlistView.$el.toggleClass("omp-hidden"),this.update()},update:function(){if(this.isActive){if(this.fetchedItems.length>0)return;this.createLoadingView(),(this.playlistView!=undefined||this.playlistView)&&this.loadPlaylist({loadby:"manifest",fetchPlaylistItem:!0,data:{src:this.dataModel.get("manifest"),callback:this.showPlaylist}})}},showPlaylist:function(){var e=this,n,r=0,s=2e4;n=setInterval(function(){r+=200;if(r>s){window.clearInterval(n);return}if(e.dataModel.get("labelActive")===!1)return;window.clearInterval(n),e.playlistView||(e.playlistView=new i({handleReload:e.handleReload.bind(e),model:e.dataModel,playerObject:e.playerObject}));var o=e.playlistView.render().$el;t("#"+e.getID()+"_tab_end").before(o),e.isActive?o.removeClass("omp-hidden"):o.addClass("omp-hidden")},200)},attachPlayer:function(e){this.stopListening(this.dataModel,"change:playlistActive"),this.listenTo(this.dataModel,"change:playlistActive",this.toggleActive),this.playerObject=e,this.playlistView&&this.playlistView.attachPlayer(e),this.showPlaylist();var n=this;this.dataModel.get("playlistSrc")!=undefined&&this.fetchExternalPlaylist({loadby:"playlistxml",src:this.dataModel.get("playlistSrc"),callback:function(){n.waitToFetchItem&&n.fetchPlaylistItem()}}),t(this.playerObject).on("ended",function(){n.fetchedItems.length<=0&&n.fetchPlaylistItem()})},removePlaylistView:function(){this.playlistView&&(this.playlistView.$el.remove(),this.playlistView.remove(),this.playlistView=undefined)},resetPlaylistItems:function(){this.fetchedItems=[],this.rawPlaylistItem=undefined,this.dataModel.set("playlistItem",undefined)},sortedPushFetchedItems:function(e){this.fetchedItems.push(e),this.fetchedItems.sort(function(e,t){return e.index>t.index?1:e.index<t.index?-1:0}),n.each(this.fetchedItems,function(e,t){e.order=t,e.viewObj&&e.viewObj.trigger("change:playlist_item_order")})},handleReloadMedia:function(e,n){var r=this,i=e.provider.toLowerCase(),s=u.getProviderClass(i);if(s){var o=new u({model:this.dataModel,item:e,provider:new s});t("#"+r.dataModel.id).empty();var a=e.disable_features,f=this.checkDisabledPlaylist(a,this.dataModel);f?this.dataModel.set("playlistActive",!0):this.dataModel.set("playlistActive",!1),o.fetchMediaContent(function(t){o.renderMediaView(),r.dataModel.set("manifest",e.manifest),n?r.resetPlaylistItems():null,r.playlistView.resetClick(),r.showPlaylist()})}},playMedia:function(){var e=this;setTimeout(function(){oump.ismobile||t("#"+e.dataModel.get("id")+"_anchor").trigger("click")},100)},getID:function(){return this.dataModel.get("id")},createLoadingView:function(){var e=this;this.loadingView=new a({dataModel:this.dataModel,type:"playlist"});var n=this.loadingView.render().$el;t("#"+this.dataModel.get("id")+"_fd_p").html(n)},checkDisabledPlaylist:function(e,t){var n=!0;return e!=undefined&&e.length!=undefined&&(e.indexOf("all")!=-1||e.indexOf("playlist")!=-1||!t.get("hasPlaylist"))&&(n=!1),n}}),f}),define("app/logger",["jquery","backbone"],function(e,t){"use strict";var n={log:[],playStatuses:{},maxTimes:{},finalTimes:{},threshold:10,logHelper:{}},r=t.Model.extend({init:function(t){n.logHelper=t,e(window).on("beforeunload",function(){for(var e in n.maxTimes)n.maxTimes.hasOwnProperty(e)&&(n.log.push(n.maxTimes[e]),n.log.push(n.finalTimes[e]));n.logHelper.sendData(n.log)}.bind(this))},log:function(t,r,i){if(["add","oumpPlayPause","playerPlay","playerPause","oumpStop","oumpUpdateVolumeChangeUI","change:isFullscreen","oumpSeeked","playerSeeked","oumpEnded","oumpLoadedMetadata","oumpTimeUpdate","title_expanded","title_collapsed","share_clicked","show_more_clicked","playlist_enabled","playlist_disabled","playlist_clickedonitems","transcript_enabled","transcript_disabled","transcript_interactive_enabled","transcript_interactive_disabled","transcript_print","transcript_copy","transcript_clicked","transcript_invalid","chapter_enabled","chapter_disabled","textdescription_enabled","textdescription_disabled","audiodescription_enabled","audiodescription_disabled","closedcaptions_enabled","closedcaptions_disabled","autoplay_disabled","autoplay_enabled","annotations_disabled","annotations_enabled","chapter_clicked","chapter_marker_enabled","chapter_marker_disabled","auto_duration","language_default","language_number_items","language_changed","quality_default","quality_selected","download_invalid","download_item"].indexOf(t)===-1)return;var s=this,o={event:"",eventData:{contextid:s.get("contextid"),other:{playerId:s.get("id"),type:s.get("type"),player:s.get("player"),timestamp:null,page:window.location.href,src:s.getDefaultSource(),browser:oump.browser,isMobile:oump.ismobile}}};o.eventData.other.timestamp=Math.floor(Date.now/1e3);switch(t){case"add":o.event="player_created";break;case"oumpPlayPause":s.get("id")in n.playStatuses||(n.playStatuses[s.get("id")]=!1);var u=n.playStatuses[s.get("id")];u?o.event="playback_suspended":o.event="playback_started",n.playStatuses[s.get("id")]=!u;break;case"playerPlay":n.playStatuses[s.get("id")]=!0,o.event="playback_started";break;case"playerPause":n.playStatuses[s.get("id")]=!1,o.event="playback_suspended";break;case"oumpStop":n.playStatuses[s.get("id")]=!1,o.event="playback_reset";break;case"oumpUpdateVolumeChangeUI":o.event="volume_updated",o.eventData.other.volume=r;break;case"change:isFullscreen":i?o.event="fullscreen_enabled":o.event="fullscreen_disabled";break;case"oumpSeeked":case"playerSeeked":o.event="playback_updated",o.eventData.other.time=Math.round(r);break;case"oumpEnded":n.playStatuses[s.get("id")]=!1,o.event="playback_ended";break;case"oumpLoadedMetadata":o.event="duration_updated",o.eventData.other.duration=Math.round(r);break;case"oumpTimeUpdate":var a=Math.round(r),f=o.eventData.other.playerId;n.finalTimes[f]||(o.eventData.other.time=0,n.finalTimes[f]=o,n.maxTimes[f]=o),o.eventData.other.time=a;if(a>n.maxTimes[f].eventData.other.time){var l=e.extend({},o);l.event="maxtime_updated",n.maxTimes[f]=l}o.event="finaltime_updated",n.finalTimes[f]=o;return;case"title_expanded":o.event="title_expanded";break;case"title_collapsed":o.event="title_collapsed";break;case"share_clicked":o.event="share_clicked";break;case"show_more_clicked":o.event="show_more_clicked";break;case"playlist_enabled":o.event="playlist_enabled";break;case"playlist_disabled":o.event="playlist_disabled";break;case"playlist_clickedonitems":o.event="playlist_clickedonitems",o.eventData.other.value=r;break;case"transcript_enabled":o.event="transcript_enabled";break;case"transcript_disabled":o.event="transcript_disabled";break;case"transcript_interactive_enabled":o.event="transcript_interactive_enabled";break;case"transcript_interactive_disabled":o.event="transcript_interactive_disabled";break;case"transcript_print":o.event="transcript_print";break;case"transcript_copy":o.event="transcript_copy";break;case"transcript_clicked":o.event="transcript_clicked";break;case"transcript_invalid":o.event="transcript_invalid";break;case"chapter_enabled":o.event="chapter_enabled";break;case"chapter_disabled":o.event="chapter_disabled";break;case"chapter_clicked":o.event="chapter_clicked",o.eventData.other.value=r;break;case"chapter_marker_enabled":o.event="chapter_marker_enabled";break;case"chapter_marker_disabled":o.event="chapter_marker_disabled";break;case"textdescription_enabled":o.event="textdescription_enabled";break;case"textdescription_disabled":o.event="textdescription_disabled";break;case"audiodescription_enabled":o.event="audiodescription_enabled";break;case"audiodescription_disabled":o.event="audiodescription_disabled";break;case"closedcaptions_enabled":o.event="closedcaptions_enabled";break;case"closedcaptions_disabled":o.event="closedcaptions_disabled";break;case"autoplay_disabled":o.event="autoplay_disabled";break;case"autoplay_enabled":o.event="autoplay_enabled";break;case"annotations_disabled":o.event="annotations_disabled";break;case"annotations_enabled":o.event="annotations_enabled";break;case"auto_duration":o.event="auto_duration",o.eventData.other.value=r;break;case"language_default":o.event="language_default",o.eventData.other.value=r;break;case"language_number_items":o.event="language_number_items",o.eventData.other.value=r;break;case"language_changed":o.event="language_changed",o.eventData.other.value=r;break;case"quality_default":o.event="quality_default",o.eventData.other.value=r;break;case"quality_selected":o.event="quality_selected",o.eventData.other.value=r;break;case"download_invalid":o.event="download_invalid",o.eventData.other.value=r;break;case"download_item":o.event="download_item",o.eventData.other.value=r;break;default:return}o.event!==""&&n.log.push(o);if(n.log.length>n.threshold){var c=n.log;n.log=[],n.logHelper.sendData(c)}},query:function(e){}});return r}),define("app/views/tab_order_view",["backbone","underscore","app/helpers/utilities"],function(e,t,n){"use strict";return e.View.extend({CONTROLBAR_DELAY_TIME:4e3,canSpaceActiveEl:".omp-space-btn",$entryPoint:$([]),$exitPoint:$([]),$next:$([]),$focus:$([]),$dropdownlist:$([]),pausedEvents:[],events:{},initialize:function(e){this.dataModel=e.dataModel,this.mid=this.dataModel.get("id"),this.isActive=!1,this.tabindexstatus="disable",this.$el=e.el,this.dataModel.on("oump_nextmediaelement",this.focusNextMedia.bind(this)),this.dataModel.on("oumpControlBarTerminated",this.controlBarTerminated.bind(this)),this.mediaActived=this.dataModel.get("playerState")!=="notactivated",this.update()},lookupDropdownList:function(){if(this.$focus.parent(".omp-select-list").length>0)return;this.$dropdownlist.addClass("omp-hidden"),this.$dropdownlist=$([]),this.$dropdownlist=this.$focus.parent().siblings(".omp-select-list"),this.$dropdownlist.length>0?this.dataModel.preventMyKeyHandler("add",["volup","voldown"]):this.dataModel.preventMyKeyHandler("remove",["volup","voldown"])},enterBeforeAction:function(){if(this.isFocus("select-arrow")){this.$next=this.$dropdownlist.find(".omp-st-selected");return}this.isFocus("setting-cog")&&(this.$next=this.$el.find(".omp-popup-settings-content .omp-menuitem").not(".omp-hidden").first().find("button").first()),this.isFocus("setting-item")&&(this.$next=this.$focus.closest(".omp-menuitem").next().find(".omp-settings-button").first(),this.$next.length==0&&(this.$next=$("#"+this.mid+"_f_download_max")),setTimeout(function(){this.focusNext()}.bind(this),100)),this.pause("click")},enterAction:function(){this.focusNext(),this.unpause("click")},tabBeforeAction:function(e){this.isFocus("$el")&&e.shiftKey&&!this.dataModel.get("isFullscreen")&&(this.disableTabindex(),this.$el.attr("tabindex",0),this.$entryPoint.attr("tabindex",-1),setTimeout(function(){this.$entryPoint.attr("tabindex",0),this.$exitPoint.attr("tabindex",0)}.bind(this),50)),this.isFocus("tab-end")&&!e.shiftKey&&(this.disableTabindex(),this.$tabendEl.attr("tabindex",0),this.$exitPoint.attr("tabindex",-1),setTimeout(function(){this.$entryPoint.attr("tabindex",0),this.$exitPoint.attr("tabindex",0)}.bind(this),50)),this.isFocus("fullscreen-button")&&!e.shiftKey&&this.dataModel.get("isFullscreen")&&(this.$next=$("#"+this.mid+"_m_playpause")),this.isFocus("setting-cog")&&e.shiftKey&&this.dataModel.trigger("oump_closepopup")},tabAction:function(e){if(this.focusNext())return;this.isFocus("setting-cog")&&this.dataModel.trigger("oump_closepopup"),this.lookupDropdownList(),e.shiftKey&&this.isFocus("$el")&&this.dataModel.get("isFullscreen")&&$("#"+this.mid+"_m_fullscreen").focus()},downBeforeAction:function(){this.$focus.hasClass("omp-select-button")&&(this.$next=this.$dropdownlist.find(".omp-st-selected"))},downAction:function(e){if(this.focusNext())return;this.$dropdownlist.length>0&&this.$dropdownlist.find(":focus").next().focus()},upBeforeAction:function(){this.$dropdownlist.find(":focus").is(":first-child")&&(this.$next=this.$dropdownlist.siblings().children().focus())},upAction:function(){this.focusNext()||this.$dropdownlist.length>0&&this.$dropdownlist.find(":focus").prev().focus()},spaceBeforeAction:function(e){var t=this.dataModel.get("preventedKeys");this.$focus.is(this.canSpaceActiveEl)&&(this.dataModel.preventMyKeyHandler("add",["playpause"]),this.isFocus("setting-cog")&&(this.$next=this.$el.find(".omp-popup-settings-content .omp-menuitem").not(".omp-hidden").first().find("button").first())),this.pause(["focusout","click"])},spaceAction:function(){this.dataModel.preventMyKeyHandler("remove",["playpause"]),this.unpause("focusout"),setTimeout(function(){this.unpause("click")}.bind(this),50),this.$focus.is(this.canSpaceActiveEl)&&(this.$focus.click(),this.focusNext()||setTimeout(function(){this.$focus.focus()}.bind(this),50))},keyBeforeAction:function(e){this.dataModel.get("isFullscreen")&&this.displayControlBar(),this.$focus=$(":focus");var t=e.keyCode||e.which;switch(t){case 9:this.tabBeforeAction(e);break;case 13:this.enterBeforeAction(e);break;case 38:this.upBeforeAction(),(this.$focus.parents(".omp-controlbar").length>0||this.$focus.parents(".omp-media-wrapper").length>0||this.$dropdownlist.length>0)&&e.preventDefault(),this.$focus.parents(".omp-controlbar").length==0&&this.dataModel.preventMyKeyHandler("add",["volup","voldown"]);break;case 40:this.downBeforeAction(),(this.$focus.parents(".omp-controlbar").length>0||this.$focus.parents(".omp-media-wrapper").length>0||this.$dropdownlist.length>0)&&e.preventDefault(),this.$focus.parents(".omp-controlbar").length==0&&this.dataModel.preventMyKeyHandler("add",["volup","voldown"]);break;case 32:e.preventDefault(),this.spaceBeforeAction(e)}},keyAction:function(e){this.$focus=$(":focus");var t=e.keyCode||e.which;switch(t){case 9:this.tabAction(e);break;case 13:this.enterAction();break;case 40:this.downAction();break;case 38:this.upAction();break;case 32:this.spaceAction();break;case 78:!e.isDefaultPrevented()&&e.shiftKey&&!this.dataModel.get("isFullscreen")&&this.focusNextMedia()}},clickBeforeAction:function(e){if(this.ispaused("click")){$(this).focus();return}this.setActive(!1),this.isFocus()?this.onFocusin():this.onFocusout(),this.isFocus()&&window.tabOrder.hasFocus(this.mid)},clickAction:function(e){if(this.ispaused("click")||!this.isFocus()){this.isFocus()||(this.$focus=this.$el),$(this).focus();return}this.isActive&&this.setActive(!1),this.disableTabindex(),this.$focus=$(e.target),this.$focus[0].hasAttribute("tabindex")||(this.$focus[0].tagName.toLowerCase()=="span"&&this.$focus.parent()[0].hasAttribute("tabindex")?this.$focus=$(e.target).parent():this.dataModel.get("isFullscreen")?this.$focus=$("#"+this.mid+"_m_playpause"):this.$focus=this.$el)},firstTabAction:function(e){var t=e.keyCode||e.which;t==9&&this.isFocus()&&(this.setActive(!0),this.lookupDropdownList(),this.displayControlBar(),this.$focus.focus())},preventAllDefaultKeyEvent:function(e){e.preventDefault()},fullscreenEvent:function(){var e=this;setTimeout(function(){this.displayControlBar(),$("#"+this.dataModel.id+"_m_fullscreen").focus(),this.dataModel.get("type")=="video"&&oump.browser=="firefox"&&(this.dataModel.get("isFullscreen")?$("#"+this.mid+"_clickable_overlay").on("click.taborder",function(){e.$focus=$("#"+e.mid+"_m_playpause")}):$("#"+this.mid+"_clickable_overlay").off("click.taborder"))}.bind(this),100)},setActive:function(e){this.isActive=e,this.$el.toggleClass("omp-tab-focus",this.isActive),this.dataModel.set("tabActive",this.isActive),this.update()},update:function(){this.undelegateEvents(),this.isActive?(this.events.keydown="keyBeforeAction",this.events.keyup="keyAction",this.listenTo(this.dataModel,"change:playerState",this.playerStateChanged.bind(this)),this.events.focusin="onFocusin",this.events.focusout="onFocusout"):(this.events.keyup="firstTabAction",this.events.keydown="preventAllDefaultKeyEvent",this.stopListening(this.dataModel,"change:playerState"),this.stopListening(this.dataModel,"change:isFullscreen")),this.listenTo(this.dataModel,"change:isFullscreen",this.fullscreenEvent.bind(this)),this.events.mousedown="clickBeforeAction",this.events.mouseup="clickAction",this.delegateEvents()},focusNextMedia:function(){this.trigger("change:activeView",this.dataModel)},onFocusin:function(e){oump.active=this.mid,this.mediaActived&&this.isActive&&this.enableTabindex(),window.tabOrder.hasFocus(this.mid)},onFocusout:function(e){if(this.ispaused("focusout"))return;this.tabindexstatus=="disable"&&(this.$entryPoint.attr("tabindex",0),this.$exitPoint.attr("tabindex",0)),this.disableTabindex(),oump.active=!1},playerStateChanged:function(){var e=this.dataModel.get("playerState"),t=this.dataModel.get("tabs").annotations;switch(e){case"pause":var n=$("[tabindex="+t+"]");n.length>0&&(this.$focus=n,this.$focus.get(0).focus(),this.dataModel.trigger("oump_closepopup"));break;case"play":this.$focus.attr("tabindex")==t&&$("#"+this.mid+"_m_playpause").focus()}},displayControlBar:function(){this.dataModel.trigger("oumpShowControlBar",{timeout:this.CONTROLBAR_DELAY_TIME})},controlBarTerminated:function(){this.dataModel.get("isFullscreen")&&(this.setActive(!1),this.$focus=$("#"+this.mid+"_m_playpause"))},disableTabindex:function(){if(this.tabindexstatus=="disable"||this.dataModel.get("isFullscreen"))return;this.tabindexstatus="disable",$("#"+this.dataModel.id+" [tabindex]").each(function(){$(this).hasClass("notabindex")||$(this).attr("tabindex-pending",$(this).attr("tabindex")).attr("tabindex","-1")}),this.$el.attr("tabindex-pending",this.$el.attr("tabindex")).attr("tabindex","-1")},enableTabindex:function(){if(this.tabindexstatus=="enable")return;this.tabindexstatus="enable",$("#"+this.dataModel.id+" [tabindex-pending]").each(function(){$(this).attr("tabindex",$(this).attr("tabindex-pending")).removeAttr("tabindex-pending")}),this.$el.attr("tabindex",this.$el.attr("tabindex-pending")).removeAttr("tabindex-pending"),this.$tabendEl=$("#"+this.mid+"_tab_end").attr("tabindex",this.dataModel.get("tabs").end),this.$el.attr("tabindex",this.dataModel.get("tabs").start)},attachEl:function(e){var t=this;this.$el=e,this.$el.focus(),this.setActive(this.isActive);if(this.dataModel.get("playerState")==="notactivated")return;this.mediaActived=!0,this.$el.find("[omp-tab-start]").focus(),this.$entryPoint=this.$el.prev(".omp-enter-media").attr("tabindex",0).attr("mid",this.mid).focusin(function(){t.$el.focus()}),this.$exitPoint=this.$el.next().next(".omp-exit-media").attr("tabindex",0).attr("mid",this.mid).focusin(function(){t.$el.focus()})},isLostFocus:function(){return $(":focus").closest(".omp-wrapper").attr("id")!=this.mid},isFocus:function(e){e=e||!1;var t=!1,n=$(":focus");switch(e){case"$el":t=n.attr("id")==this.mid;break;case"setting-cog":t=n.attr("id")==this.mid+"_f_settings";break;case"select-arrow":t=n.hasClass("omp-select-button");break;case"tab-end":t=n.attr("id")==this.mid+"_tab_end";break;case"fullscreen-button":t=n.attr("id")==this.mid+"_m_fullscreen";break;case"setting-item":t=n.hasClass("omp-settings-item");break;default:t=!this.isLostFocus()}return t},pause:function(e){var n=this;e=e||[],e=Object.prototype.toString.call(e)==="[object Array]"?e:[e],t.each(e,function(e){n.pausedEvents.push(e)})},unpause:function(e){return this.pausedEvents=t.reject(this.pausedEvents,function(t){return t.indexOf(e)>-1}),this},ispaused:function(e){return this.pausedEvents.indexOf(e)>-1},focusNext:function(){return this.$next.length>0?(this.$next.parent().removeClass("omp-hidden"),this.$next.focus(),this.$next=$([]),this.$focus=$(":focus"),this.lookupDropdownList(),!0):!1}})}),define("app/helpers/hook/tab_order_hook",["backbone","jquery","underscore","app/views/tab_order_view"],function(e,t,n,r){"use strict";var i=function(){var e=this;t("body").focus(),t(document).on("mousedown",function(t){for(var n in e.views)e.views[n].clickBeforeAction(t)}).on("click",function(t){for(var n in e.views)e.views[n].clickAction(t)})};return i.prototype=n.extend(i.prototype,e.Events),i.prototype=n.extend(i.prototype,{views:[],attachView:function(e,t){this.views[t.id]!=undefined?this.views[t.id].attachEl(e):this.views[t.id]=new r({el:e,dataModel:t}),this.listenTo(this.views[t.id],"change:activeView",this.setActive.bind(this))},setActive:function(e){var n=t(".omp-wrapper"),r=0,i=n.length,s,o;for(r;r<i;r++)if(n[r].id==e.id){r+1<i?s=n[r+1].id:s=n[0].id;break}o=t("#"+s+"_m_playpause"),o.length?o.focus():t("#"+s+" > a").focus(),oump.active=s,this.hasFocus(s)},hasFocus:function(e){for(var t in this.views){if(t==e)continue;this.views[t].onFocusout()}}}),i}),define("app/helpers/service_path_config",["jquery","backbone"],function(e,t){"use strict";return t.Model.extend({getProxy:function(e){return oump.wwwroot+"/classes/provideradapter.php?url="+e}})}),define("app/helpers/manifest",["jquery","app/helpers/utilities","app/helpers/external_consumer","app/helpers/provider/youtube"],function(e,t,n,r){"use strict";var i=function(){};return i.prototype=_.extend(i.prototype,{fetchSrc:function(n,r,i){var s=this;switch(this.getSrcType(n)){case!1:console.log("Can not detect source type");break;case"xml":e.ajax({type:"GET",async:!0,url:n,dataType:"xml",success:function(e){if(typeof i=="undefined"||i=="json")e=t.xmlToJsonObject(e.childNodes[0]);r.call(s,e)},error:function(){r.call(s,null)}});break;default:n=oump.servicePath.getManifestServicePath(n),e.ajax({type:"GET",async:!0,url:n,dataType:"xml",success:function(e){e=t.parseXML(e),e=t.xmlToJsonObject(e.childNodes[0]),r.call(s,e)},error:function(){return}})}},getSrcType:function(e){if(e==""||typeof e=="undefined")return!1;var t=e.split(".");return t[t.length-1]},setModelData:function(t,n,r){if(!t)return;t.baseurl&&typeof t.baseurl=="string"&&(n.set("baseUrl",t.baseurl),n.set("iOSBaseUrl",t.baseurl)),t.iosbaseurl&&typeof t.iosbaseurl=="string"&&n.set("iOSBaseUrl",t.iosbaseurl),t.disable_features&&typeof t.disable_features=="string"&&n.set("disabledFeatures",t.disable_features);var i=n.get("features"),s=n.get("disabledFeatures")||"",o=!1;s.indexOf("controls")!=-1&&s.indexOf("playlist")!=-1&&s.indexOf("chapters")!=-1&&s.indexOf("transcripts")!=-1&&s.indexOf("captions")!=-1&&s.indexOf("download")!=-1&&s.indexOf("setting")!=-1&&s.indexOf("fullscreen")!=-1&&(o=!0),s!=undefined&&s!==!1&&s.indexOf("all")!=-1&&(o=!0),n.set("type",t.type),n.set("manifest",t.manifest),n.set("videolength",!1),t.length!=undefined&&n.set("videolength",t.length),n.get("poster")==0&&t.thumbnail_url!=undefined&&typeof t.thumbnail_url!="object"&&(i.hasPoster=!0,n.set("poster",t.thumbnail_url)),t.provider_name!=undefined&&n.set("provider",t.provider_name),t.timing!=undefined&&n.set("timing",t.timing),t.uilanguage!=undefined&&n.set("uilanguage",t.uilanguage),t.assetspath!=undefined&&!_.isEmpty(t.assetspath)&&n.set("assetspath",t.assetspath),t.width!=undefined&&!_.isEmpty(t.width)&&(n.set("width",t.width),n.set("orig_width",t.width)),t.height!=undefined&&!_.isEmpty(t.height)&&(n.set("height",t.height),n.set("orig_height",t.height));if(t.sizing!=undefined&&!_.isEmpty(t.sizing)&&r!=undefined){var u=0,a=t.sizing;a=="smart"?u=r.getSmartWidth(a,e(window).width()):u=r.getSmartWidth(a,n.get("width"));var f=r.getSmartClass(a,u);n.set("width",u),n.set("activeWidth",u),n.set("activeSizing",f)}n.get("orig_height")&&n.get("orig_width")&&(n.set("ratio",parseFloat(n.get("orig_height")/n.get("orig_width"))),n.set("ratioFixed",!0)),t.sources!=undefined&&t.sources.source!=undefined&&(t.sources.source instanceof Array||(t.sources.source=[t.sources.source]),_.each(t.sources.source,function(e){n.addSource(e.src,e.type,e.label,!1,"")}.bind(this))),n.get("sources3").length>1?i.hasSources=!0:i.hasSources=!1;if(o)return;var l;t.html!=undefined&&s.indexOf("share")==-1&&(l=t.html,l=typeof t.html=="object"?"":l.trim(),l!=""&&(n.set("html",l),i.hasShare=!0)),t.description!=null&&n.get("summary")===!1&&s.indexOf("description")==-1&&(l=t.description,l=typeof t.description=="object"?"":l.trim(),l!=""&&(n.set("summary",l),n.set("summaryShort",l),i.hasSummary=!0)),n.get("title")==0&&t.title!=undefined&&s.indexOf("title")==-1&&(l=t.title,l=typeof t.title=="object"?"":l.trim(),l!=""&&(n.set("title",l),i.hasTitle=!0)),n.get("copyright")==0&&t.copyright!=undefined&&s.indexOf("copyright")==-1&&(l=t.copyright,l=typeof t.copyright=="object"?"":l.trim(),l!=""&&(n.set("copyright",l),i.hasCopyright=!0)),t.tracks!=undefined&&t.tracks.track!=undefined&&(t.tracks.track instanceof Array||(t.tracks.track=[t.tracks.track]),_.each(t.tracks.track,function(e){var t=!1;switch(e.kind){case"subtitles":s.indexOf("subtitles")==-1&&(i.hasTracksSubtitles=!0,t=!0);break;case"chapters":s.indexOf("chapters")==-1&&(i.hasTracksChapters=!0,t=!0);break;case"descriptions":s.indexOf("textdescriptions")==-1&&(i.hasTracksDescriptions=!0,t=!0);break;case"audiodescriptions":s.indexOf("audiodescriptions")==-1&&n.get("type")=="video"&&(i.hasAudiodescriptions=!0,t=!0);break;case"annotations":s.indexOf("annotation")==-1&&(i.hasTracksAnnotations=!0,t=!0);break;case"scripts":s.indexOf("scripts")==-1&&(i.hasTracksScripts=!0,t=!0);break;case"transcripts":s.indexOf("transcripts")==-1&&(i.hasTranscript=!0,t=!0)}t&&n.addTrack(e.kind,e.type,e.src,e.srclang,e.label,!1,null)}.bind(this))),n.set("showButtons",!1);if(t.provider_name!=undefined&&!_.isEmpty(t.provider_name))switch(t.provider_name.toLowerCase()){case"youtube":i.hasChapters=!1,i.hasTranscript=!1,i.hasSettings=!1,n.set("showButtons",!0)}n.set("hasPlaylist",!1),t.playlist!=undefined&&t.playlist&&s.indexOf("playlist")==-1?(t.playlist.item!=undefined&&t.playlist.item.length>0?(n.set("playlistItem",t.playlist.item),n.set("hasPlaylist",!0)):t.playlist.src!=undefined&&typeof t.playlist.src=="string"&&t.playlist.src!=""&&(n.set("playlistSrc",t.playlist.src),n.set("hasPlaylist",!0)),t.playlist.autoplay!=undefined&&t.playlist.autoplay&&e.inArray(t.playlist.autoplay.toLowerCase(),["true","false"])!=-1&&t.playlist.autoplay.toLowerCase()=="true"&&n.set("autoplayActive",t.playlist.autoplay),t.playlist["auto-play-duration"]!=undefined&&t.playlist["auto-play-duration"].match(/\d+/)&&n.set("autoPlayDuration",parseInt(t.playlist["auto-play-duration"].match(/\d+/)[0]))):n.set("hasPlaylist",!1),oump.isphone&&(i.hasAudiodescriptions=!1,i.hasTracksDescriptions=!1,i.hasTracksAnnotations=!1,i.hasTracksScripts=!1);if(s!=undefined&&s!==!1){s.indexOf("all")!=-1&&(o=!0);if(o||s.indexOf("controls")!=-1)i.hasBasicControls=!1;if(o||s.indexOf("sources")!=-1)i.hasSources=!1;if(o||s.indexOf("captions")!=-1)i.hasTracksCaptions=!1;if(o||s.indexOf("chapters")!=-1)i.hasTracksChapters=!1;if(o||s.indexOf("textdescriptions")!=-1)i.hasTracksDescriptions=!1;if(o||s.indexOf("audiodescriptions")!=-1)i.hasAudiodescriptions=!1;if(o||s.indexOf("metadata")!=-1)i.hasMetadata=!1;if(o||s.indexOf("transcript")!=-1)i.hasTranscript=!1;if(o||s.indexOf("subtitles")!=-1)i.hasTracksSubtitles=!1;if(o||s.indexOf("transcripts")!=-1)i.hasTranscript=!1;if(o||s.indexOf("title")!=-1)i.hasTitle=!1;if(o||s.indexOf("description")!=-1)i.hasSummary=!1;if(o||s.indexOf("playlist")!=-1)i.hasPlaylist=!1;if(o||s.indexOf("share")!=-1)i.hasShare=!1;if(o||s.indexOf("fullscreen")!=-1)i.hasFullscreen=!1;if(o||s.indexOf("annotation")!=-1)i.hasTracksAnnotations=!1;if(o||s.indexOf("quality")!=-1)i.hasQuality=!1;if(o||s.indexOf("autoplay")!=-1)i.hasAutoplay=!1;if(o||s.indexOf("language")!=-1)i.hasLanguage=!1;if(o||s.indexOf("download")!=-1)i.hasDownload=!1;if(o||s.indexOf("setting")!=-1)i.hasSettings=!1;if(o||s.indexOf("captions")!=-1)i.hasTracksSubtitles=!1;if(o||s.indexOf("copyright")!=-1)i.hasCopyright=!1;o&&(i.hasSettings=!1)}n.set("features",i)},getData:function(){var n=this;n.src=t.getParameterByName("url"),n.type=t.getParameterByName("format");var r=t.getParameterByName("mediaurl");return r&&(n.src+="& mediaurl="+r),n.type=="json"?e.getJSON(n.src):e.ajax({method:"GET",url:n.src,dataType:"xml"})},getBaseUrl:function(e,t){return!e||typeof e!="string"?"":(e=e.replace(" ",""),e=e.charAt(0).toUpperCase()+e.slice(1),this["get"+e+"BaseUrl"].call(this,t))},getiOSBaseUrl:function(e,t){return!e||typeof e!="string"?"":(e=e.replace(" ",""),e=e.charAt(0).toUpperCase()+e.slice(1),this["get"+e+"iOSBaseUrl"].call(this,t))},getOuBaseUrl:function(e){var t,n="";return t=e.split("/"),t=t.splice(0,t.length-3),n=t.join("/"),n},getOuiOSBaseUrl:function(e){var n,r,i="",s="";return e.src=t.cleanUrl(e.src),e.iosbaseurl=t.cleanUrl(e.iosbaseurl),n=e.src.split("/"),n=n.splice(0,n.length-3),n.splice(0,n.length-4),i=n.join("/"),r=e.iosbaseurl.split("/"),s=r.splice(0,r.length-5).join("/")+"/",s+i}}),i}),define("app/helpers/hook/ajax_hook",["jquery","underscore","app/helpers/utilities"],function(e,t,n){"use strict";var r=function(){this.ajaxTimeout=15e3,this.ajaxMaxResPerDomain=3,this.hijack()};return r.prototype=t.extend(r.prototype,{protecteddomains:["youtube/","youtu.be","i.ytimg","vzaar","slideshare","dailymotion"],hijack:function(){var r=e.ajax,i=this;e.xhrPool={},e.ajax=function(){var s=n.hostnameFromURL(arguments[0].url);if(arguments[0].url.length>0)for(var o=0;o<i.protecteddomains.length;o++){var u=i.protecteddomains[o];if(arguments[0].url.indexOf(u)>-1)return r.apply(e,arguments)}e.xhrPool[s]||(e.xhrPool[s]={},e.xhrPool[s].running={},e.xhrPool[s].waiting={});var a=t.keys(e.xhrPool[s].running).length,f=arguments[0]["ajax.request.id"];f||(f=(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase(),arguments[0]["ajax.request.id"]=f);if(a>=i.ajaxMaxResPerDomain){e.xhrPool[s].waiting[f]=arguments;return}return e.xhrPool[s].running[f]=arguments,r.apply(e,arguments)},e.ajaxSetup({timeout:this.ajaxTimeout}),e(window.document).ajaxComplete(function(){var r=n.hostnameFromURL(arguments[2].url),s=arguments[2]["ajax.request.id"];e.xhrPool[r].running=t.omit(e.xhrPool[r].running,s);var o=t.keys(e.xhrPool[r].running).length,u=t.keys(e.xhrPool[r].waiting).length;if(o<i.ajaxMaxResPerDomain&&u>0){var a=e.xhrPool[r].waiting[Object.keys(e.xhrPool[r].waiting)[0]],f=a[0]["ajax.request.id"];e.ajax.apply(e,a),e.xhrPool[r].waiting=t.omit(e.xhrPool[r].waiting,f)}})}}),r}),define("app/helpers/hook/external_adapter_hook",["underscore","require"],function(e,t){"use strict";var n=function(e){};return n.prototype=e.extend(n.prototype,{init:function(n){e.each(oump.dependency,function(e,r){switch(r){case"oumaths":n.find("span[data-ehash]").removeClass("filter_oumaths_selectable"),t([e],function(e){e.init()})}})}}),n}),function(e){typeof define=="function"&&define.amd?define("jqueryui",["jquery"],e):e(jQuery)}(function(e){function t(t,r){var i,s,o,u=t.nodeName.toLowerCase();return"area"===u?(i=t.parentNode,s=i.name,!t.href||!s||i.nodeName.toLowerCase()!=="map"?!1:(o=e("img[usemap='#"+s+"']")[0],!!o&&n(o))):(/^(input|select|textarea|button|object)$/.test(u)?!t.disabled:"a"===u?t.href||r:r)&&n(t)}function n(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return e.css(this,"visibility")==="hidden"}).length}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(t){var n=this.css("position"),r=n==="absolute",i=t?/(auto|scroll|hidden)/:/(auto|scroll)/,s=this.parents().filter(function(){var t=e(this);return r&&t.css("position")==="static"?!1:i.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return n==="fixed"||!s.length?e(this[0].ownerDocument||document):s},uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(n){return!!e.data(n,t)}}):function(t,n,r){return!!e.data(t,r[3])},focusable:function(n){return t(n,!isNaN(e.attr(n,"tabindex")))},tabbable:function(n){var r=e.attr(n,"tabindex"),i=isNaN(r);return(i||r>=0)&&t(n,!i)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(t,n){function o(t,n,i,s){return e.each(r,function(){n-=parseFloat(e.css(t,"padding"+this))||0,i&&(n-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(n-=parseFloat(e.css(t,"margin"+this))||0)}),n}var r=n==="Width"?["Left","Right"]:["Top","Bottom"],i=n.toLowerCase(),s={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+n]=function(t){return t===undefined?s["inner"+n].call(this):this.each(function(){e(this).css(i,o(this,t)+"px")})},e.fn["outer"+n]=function(t,r){return typeof t!="number"?s["outer"+n].call(this,t):this.each(function(){e(this).css(i,o(this,t,!0,r)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(n){return arguments.length?t.call(this,e.camelCase(n)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.fn.extend({focus:function(t){return function(n,r){return typeof n=="number"?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),r&&r.call(t)},n)}):t.apply(this,arguments)}}(e.fn.focus),disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(t!==undefined)return this.css("zIndex",t);if(this.length){var n=e(this[0]),r,i;while(n.length&&n[0]!==document){r=n.css("position");if(r==="absolute"||r==="relative"||r==="fixed"){i=parseInt(n.css("zIndex"),10);if(!isNaN(i)&&i!==0)return i}n=n.parent()}}return 0}}),e.ui.plugin={add:function(t,n,r){var i,s=e.ui[t].prototype;for(i in r)s.plugins[i]=s.plugins[i]||[],s.plugins[i].push([n,r[i]])},call:function(e,t,n,r){var i,s=e.plugins[t];if(!s)return;if(!r&&(!e.element[0].parentNode||e.element[0].parentNode.nodeType===11))return;for(i=0;i<s.length;i++)e.options[s[i][0]]&&s[i][1].apply(e.element,n)}};var r=0,i=Array.prototype.slice;e.cleanData=function(t){return function(n){var r,i,s;for(s=0;(i=n[s])!=null;s++)try{r=e._data(i,"events"),r&&r.remove&&e(i).triggerHandler("remove")}catch(o){}t(n)}}(e.cleanData),e.widget=function(t,n,r){var i,s,o,u,a={},f=t.split(".")[0];return t=t.split(".")[1],i=f+"-"+t,r||(r=n,n=e.Widget),e.expr[":"][i.toLowerCase()]=function(t){return!!e.data(t,i)},e[f]=e[f]||{},s=e[f][t],o=e[f][t]=function(e,t){if(!this._createWidget)return new o(e,t);arguments.length&&this._createWidget(e,t)},e.extend(o,s,{version:r.version,_proto:e.extend({},r),_childConstructors:[]}),u=new n,u.options=e.widget.extend({},u.options),e.each(r,function(t,r){if(!e.isFunction(r)){a[t]=r;return}a[t]=function(){var e=function(){return n.prototype[t].apply(this,arguments)},i=function(e){return n.prototype[t].apply(this,e)};return function(){var t=this._super,n=this._superApply,s;return this._super=e,this._superApply=i,s=r.apply(this,arguments),this._super=t,this._superApply=n,s}}()}),o.prototype=e.widget.extend(u,{widgetEventPrefix:s?u.widgetEventPrefix||t:t},a,{constructor:o,namespace:f,widgetName:t,widgetFullName:i}),s?(e.each(s._childConstructors,function(t,n){var r=n.prototype;e.widget(r.namespace+"."+r.widgetName,o,n._proto)}),delete s._childConstructors):n._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){var n=i.call(arguments,1),r=0,s=n.length,o,u;for(;r<s;r++)for(o in n[r])u=n[r][o],n[r].hasOwnProperty(o)&&u!==undefined&&(e.isPlainObject(u)?t[o]=e.isPlainObject(t[o])?e.widget.extend({},t[o],u):e.widget.extend({},u):t[o]=u);return t},e.widget.bridge=function(t,n){var r=n.prototype.widgetFullName||t;e.fn[t]=function(s){var o=typeof s=="string",u=i.call(arguments,1),a=this;return o?this.each(function(){var n,i=e.data(this,r);if(s==="instance")return a=i,!1;if(!i)return e.error("cannot call methods on "+t+" prior to initialization; "+"attempted to call method '"+s+"'");if(!e.isFunction(i[s])||s.charAt(0)==="_")return e.error("no such method '"+s+"' for "+t+" widget instance");n=i[s].apply(i,u);if(n!==i&&n!==undefined)return a=n&&n.jquery?a.pushStack(n.get()):n,!1}):(u.length&&(s=e.widget.extend.apply(null,[s].concat(u))),this.each(function(){var t=e.data(this,r);t?(t.option(s||{}),t._init&&t._init()):e.data(this,r,new n(s,this))})),a}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,n){n=e(n||this.defaultElement||this)[0],this.element=e(n),this.uuid=r++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),n!==this&&(e.data(n,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===n&&this.destroy()}}),this.document=e(n.style?n.ownerDocument:n.document||n),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,n){var r=t,i,s,o;if(arguments.length===0)return e.widget.extend({},this.options);if(typeof t=="string"){r={},i=t.split("."),t=i.shift();if(i.length){s=r[t]=e.widget.extend({},this.options[t]);for(o=0;o<i.length-1;o++)s[i[o]]=s[i[o]]||{},s=s[i[o]];t=i.pop();if(arguments.length===1)return s[t]===undefined?null:s[t];s[t]=n}else{if(arguments.length===1)return this.options[t]===undefined?null:this.options[t];r[t]=n}}return this._setOptions(r),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,e==="disabled"&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,n,r){var i,s=this;typeof t!="boolean"&&(r=n,n=t,t=!1),r?(n=i=e(n),this.bindings=this.bindings.add(n)):(r=n,n=this.element,i=this.widget()),e.each(r,function(r,o){function u(){if(!t&&(s.options.disabled===!0||e(this).hasClass("ui-state-disabled")))return;return(typeof o=="string"?s[o]:o).apply(s,arguments)}typeof o!="string"&&(u.guid=o.guid=o.guid||u.guid||e.guid++);var a=r.match(/^([\w:-]*)\s*(.*)$/),f=a[1]+s.eventNamespace,l=a[2];l?i.delegate(l,f,u):n.bind(f,u)})},_off:function(t,n){n=(n||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(n).undelegate(n),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function n(){return(typeof e=="string"?r[e]:e).apply(r,arguments)}var r=this;return setTimeout(n,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,n,r){var i,s,o=this.options[t];r=r||{},n=e.Event(n),n.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),n.target=this.element[0],s=n.originalEvent;if(s)for(i in s)i in n||(n[i]=s[i]);return this.element.trigger(n,r),!(e.isFunction(o)&&o.apply(this.element[0],[n].concat(r))===!1||n.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,n){e.Widget.prototype["_"+t]=function(r,i,s){typeof i=="string"&&(i={effect:i});var o,u=i?i===!0||typeof i=="number"?n:i.effect||n:t;i=i||{},typeof i=="number"&&(i={duration:i}),o=!e.isEmptyObject(i),i.complete=s,i.delay&&r.delay(i.delay),o&&e.effects&&e.effects.effect[u]?r[t](i):u!==t&&r[u]?r[u](i.duration,i.easing,s):r.queue(function(n){e(this)[t](),s&&s.call(r[0]),n()})}});var s=e.widget,o=!1;e(document).mouseup(function(){o=!1});var u=e.widget("ui.mouse",{version:"1.11.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(n){if(!0===e.data(n.target,t.widgetName+".preventClickEvent"))return e.removeData(n.target,t.widgetName+".preventClickEvent"),n.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(o)return;this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var n=this,r=t.which===1,i=typeof this.options.cancel=="string"&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;if(!r||i||!this._mouseCapture(t))return!0;this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){n.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)){this._mouseStarted=this._mouseStart(t)!==!1;if(!this._mouseStarted)return t.preventDefault(),!0}return!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return n._mouseMove(e)},this._mouseUpDelegate=function(e){return n._mouseUp(e)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),o=!0,!0},_mouseMove:function(t){if(this._mouseMoved){if(e.ui.ie&&(!document.documentMode||document.documentMode<9)&&!t.button)return this._mouseUp(t);if(!t.which)return this._mouseUp(t)}if(t.which||t.button)this._mouseMoved=!0;return this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),o=!1,!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}});e.widget("ui.draggable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){this.options.helper==="original"&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(e,t){this._super(e,t),e==="handle"&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){if((this.helper||this.element).is(".ui-draggable-dragging")){this.destroyOnClear=!0;return}this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),this._mouseDestroy()},_mouseCapture:function(t){var n=this.options;return this._blurActiveElement(t),this.helper||n.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(this._blockFrames(n.iframeFix===!0?"iframe":n.iframeFix),!0):!1)},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=e(this);return e("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var n=this.document[0];if(!this.handleElement.is(t.target))return;try{n.activeElement&&n.activeElement.nodeName.toLowerCase()!=="body"&&e(n.activeElement).blur()}catch(r){}},_mouseStart:function(t){var n=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return e(this).css("position")==="fixed"}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._normalizeRightBottom(),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(e){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top}},_mouseDrag:function(t,n){this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute");if(!n){var r=this._uiHash();if(this._trigger("drag",t,r)===!1)return this._mouseUp({}),!1;this.position=r.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var n=this,r=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(r=e.ui.ddmanager.drop(this,t)),this.dropped&&(r=this.dropped,this.dropped=!1),this.options.revert==="invalid"&&!r||this.options.revert==="valid"&&r||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,r)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){n._trigger("stop",t)!==!1&&n._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.focus(),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper),i=r?e(n.helper.apply(this.element[0],[t])):n.helper==="clone"?this.element.clone().removeAttr("id"):this.element;return i.parents("body").length||i.appendTo(n.appendTo==="parent"?this.element[0].parentNode:n.appendTo),r&&i[0]===this.element[0]&&this._setPositionRelative(),i[0]!==this.element[0]&&!/(fixed|absolute)/.test(i.css("position"))&&i.css("position","absolute"),i},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){typeof t=="string"&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),n=this.document[0];return this.cssPosition==="absolute"&&this.scrollParent[0]!==n&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition!=="relative")return{top:0,left:0};var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,n,r,i=this.options,s=this.document[0];this.relativeContainer=null;if(!i.containment){this.containment=null;return}if(i.containment==="window"){this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||s.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}if(i.containment==="document"){this.containment=[0,0,e(s).width()-this.helperProportions.width-this.margins.left,(e(s).height()||s.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}if(i.containment.constructor===Array){this.containment=i.containment;return}i.containment==="parent"&&(i.containment=this.helper[0].parentNode),n=e(i.containment),r=n[0];if(!r)return;t=/(scroll|auto)/.test(n.css("overflow")),this.containment=[(parseInt(n.css("borderLeftWidth"),10)||0)+(parseInt(n.css("paddingLeft"),10)||0),(parseInt(n.css("borderTopWidth"),10)||0)+(parseInt(n.css("paddingTop"),10)||0),(t?Math.max(r.scrollWidth,r.offsetWidth):r.offsetWidth)-(parseInt(n.css("borderRightWidth"),10)||0)-(parseInt(n.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(r.scrollHeight,r.offsetHeight):r.offsetHeight)-(parseInt(n.css("borderBottomWidth"),10)||0)-(parseInt(n.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=n},_convertPositionTo:function(e,t){t||(t=this.position);var n=e==="absolute"?1:-1,r=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*n+this.offset.parent.top*n-(this.cssPosition==="fixed"?-this.offset.scroll.top:r?0:this.offset.scroll.top)*n,left:t.left+this.offset.relative.left*n+this.offset.parent.left*n-(this.cssPosition==="fixed"?-this.offset.scroll.left:r?0:this.offset.scroll.left)*n}},_generatePosition:function(e,t){var n,r,i,s,o=this.options,u=this._isRootNode(this.scrollParent[0]),a=e.pageX,f=e.pageY;if(!u||!this.offset.scroll)this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()};return t&&(this.containment&&(this.relativeContainer?(r=this.relativeContainer.offset(),n=[this.containment[0]+r.left,this.containment[1]+r.top,this.containment[2]+r.left,this.containment[3]+r.top]):n=this.containment,e.pageX-this.offset.click.left<n[0]&&(a=n[0]+this.offset.click.left),e.pageY-this.offset.click.top<n[1]&&(f=n[1]+this.offset.click.top),e.pageX-this.offset.click.left>n[2]&&(a=n[2]+this.offset.click.left),e.pageY-this.offset.click.top>n[3]&&(f=n[3]+this.offset.click.top)),o.grid&&(i=o.grid[1]?this.originalPageY+Math.round((f-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,f=n?i-this.offset.click.top>=n[1]||i-this.offset.click.top>n[3]?i:i-this.offset.click.top>=n[1]?i-o.grid[1]:i+o.grid[1]:i,s=o.grid[0]?this.originalPageX+Math.round((a-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,a=n?s-this.offset.click.left>=n[0]||s-this.offset.click.left>n[2]?s:s-this.offset.click.left>=n[0]?s-o.grid[0]:s+o.grid[0]:s),o.axis==="y"&&(a=this.originalPageX),o.axis==="x"&&(f=this.originalPageY)),{top:f-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition==="fixed"?-this.offset.scroll.top:u?0:this.offset.scroll.top),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition==="fixed"?-this.offset.scroll.left:u?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]!==this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){this.options.axis!=="y"&&this.helper.css("right")!=="auto"&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),this.options.axis!=="x"&&this.helper.css("bottom")!=="auto"&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(t,n,r){return r=r||this._uiHash(),e.ui.plugin.call(this,t,[n,r,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),r.offset=this.positionAbs),e.Widget.prototype._trigger.call(this,t,n,r)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,n,r){var i=e.extend({},n,{item:r.element});r.sortables=[],e(r.options.connectToSortable).each(function(){var n=e(this).sortable("instance");n&&!n.options.disabled&&(r.sortables.push(n),n.refreshPositions(),n._trigger("activate",t,i))})},stop:function(t,n,r){var i=e.extend({},n,{item:r.element});r.cancelHelperRemoval=!1,e.each(r.sortables,function(){var e=this;e.isOver?(e.isOver=0,r.cancelHelperRemoval=!0,e.cancelHelperRemoval=!1,e._storedCSS={position:e.placeholder.css("position"),top:e.placeholder.css("top"),left:e.placeholder.css("left")},e._mouseStop(t),e.options.helper=e.options._helper):(e.cancelHelperRemoval=!0,e._trigger("deactivate",t,i))})},drag:function(t,n,r){e.each(r.sortables,function(){var i=!1,s=this;s.positionAbs=r.positionAbs,s.helperProportions=r.helperProportions,s.offset.click=r.offset.click,s._intersectsWith(s.containerCache)&&(i=!0,e.each(r.sortables,function(){return this.positionAbs=r.positionAbs,this.helperProportions=r.helperProportions,this.offset.click=r.offset.click,this!==s&&this._intersectsWith(this.containerCache)&&e.contains(s.element[0],this.element[0])&&(i=!1),i})),i?(s.isOver||(s.isOver=1,r._parent=n.helper.parent(),s.currentItem=n.helper.appendTo(s.element).data("ui-sortable-item",!0),s.options._helper=s.options.helper,s.options.helper=function(){return n.helper[0]},t.target=s.currentItem[0],s._mouseCapture(t,!0),s._mouseStart(t,!0,!0),s.offset.click.top=r.offset.click.top,s.offset.click.left=r.offset.click.left,s.offset.parent.left-=r.offset.parent.left-s.offset.parent.left,s.offset.parent.top-=r.offset.parent.top-s.offset.parent.top,r._trigger("toSortable",t),r.dropped=s.element,e.each(r.sortables,function(){this.refreshPositions()}),r.currentItem=r.element,s.fromOutside=r),s.currentItem&&(s._mouseDrag(t),n.position=s.position)):s.isOver&&(s.isOver=0,s.cancelHelperRemoval=!0,s.options._revert=s.options.revert,s.options.revert=!1,s._trigger("out",t,s._uiHash(s)),s._mouseStop(t,!0),s.options.revert=s.options._revert,s.options.helper=s.options._helper,s.placeholder&&s.placeholder.remove(),n.helper.appendTo(r._parent),r._refreshOffsets(t),n.position=r._generatePosition(t,!0),r._trigger("fromSortable",t),r.dropped=!1,e.each(r.sortables,function(){this.refreshPositions()}))})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,n,r){var i=e("body"),s=r.options;i.css("cursor")&&(s._cursor=i.css("cursor")),i.css("cursor",s.cursor)},stop:function(t,n,r){var i=r.options;i._cursor&&e("body").css("cursor",i._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,n,r){var i=e(n.helper),s=r.options;i.css("opacity")&&(s._opacity=i.css("opacity")),i.css("opacity",s.opacity)},stop:function(t,n,r){var i=r.options;i._opacity&&e(n.helper).css("opacity",i._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(e,t,n){n.scrollParentNotHidden||(n.scrollParentNotHidden=n.helper.scrollParent(!1)),n.scrollParentNotHidden[0]!==n.document[0]&&n.scrollParentNotHidden[0].tagName!=="HTML"&&(n.overflowOffset=n.scrollParentNotHidden.offset())},drag:function(t,n,r){var i=r.options,s=!1,o=r.scrollParentNotHidden[0],u=r.document[0];if(o!==u&&o.tagName!=="HTML"){if(!i.axis||i.axis!=="x")r.overflowOffset.top+o.offsetHeight-t.pageY<i.scrollSensitivity?o.scrollTop=s=o.scrollTop+i.scrollSpeed:t.pageY-r.overflowOffset.top<i.scrollSensitivity&&(o.scrollTop=s=o.scrollTop-i.scrollSpeed);if(!i.axis||i.axis!=="y")r.overflowOffset.left+o.offsetWidth-t.pageX<i.scrollSensitivity?o.scrollLeft=s=o.scrollLeft+i.scrollSpeed:t.pageX-r.overflowOffset.left<i.scrollSensitivity&&(o.scrollLeft=s=o.scrollLeft-i.scrollSpeed)}else{if(!i.axis||i.axis!=="x")t.pageY-e(u).scrollTop()<i.scrollSensitivity?s=e(u).scrollTop(e(u).scrollTop()-i.scrollSpeed):e(window).height()-(t.pageY-e(u).scrollTop())<i.scrollSensitivity&&(s=e(u).scrollTop(e(u).scrollTop()+i.scrollSpeed));if(!i.axis||i.axis!=="y")t.pageX-e(u).scrollLeft()<i.scrollSensitivity?s=e(u).scrollLeft(e(u).scrollLeft()-i.scrollSpeed):e(window).width()-(t.pageX-e(u).scrollLeft())<i.scrollSensitivity&&(s=e(u).scrollLeft(e(u).scrollLeft()+i.scrollSpeed))}s!==!1&&e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(r,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,n,r){var i=r.options;r.snapElements=[],e(i.snap.constructor!==String?i.snap.items||":data(ui-draggable)":i.snap).each(function(){var t=e(this),n=t.offset();this!==r.element[0]&&r.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:n.top,left:n.left})})},drag:function(t,n,r){var i,s,o,u,a,f,l,c,h,p,d=r.options,v=d.snapTolerance,m=n.offset.left,g=m+r.helperProportions.width,y=n.offset.top,b=y+r.helperProportions.height;for(h=r.snapElements.length-1;h>=0;h--){a=r.snapElements[h].left-r.margins.left,f=a+r.snapElements[h].width,l=r.snapElements[h].top-r.margins.top,c=l+r.snapElements[h].height;if(g<a-v||m>f+v||b<l-v||y>c+v||!e.contains(r.snapElements[h].item.ownerDocument,r.snapElements[h].item)){r.snapElements[h].snapping&&r.options.snap.release&&r.options.snap.release.call(r.element,t,e.extend(r._uiHash(),{snapItem:r.snapElements[h].item})),r.snapElements[h].snapping=!1;continue}d.snapMode!=="inner"&&(i=Math.abs(l-b)<=v,s=Math.abs(c-y)<=v,o=Math.abs(a-g)<=v,u=Math.abs(f-m)<=v,i&&(n.position.top=r._convertPositionTo("relative",{top:l-r.helperProportions.height,left:0}).top),s&&(n.position.top=r._convertPositionTo("relative",{top:c,left:0}).top),o&&(n.position.left=r._convertPositionTo("relative",{top:0,left:a-r.helperProportions.width}).left),u&&(n.position.left=r._convertPositionTo("relative",{top:0,left:f}).left)),p=i||s||o||u,d.snapMode!=="outer"&&(i=Math.abs(l-y)<=v,s=Math.abs(c-b)<=v,o=Math.abs(a-m)<=v,u=Math.abs(f-g)<=v,i&&(n.position.top=r._convertPositionTo("relative",{top:l,left:0}).top),s&&(n.position.top=r._convertPositionTo("relative",{top:c-r.helperProportions.height,left:0}).top),o&&(n.position.left=r._convertPositionTo("relative",{top:0,left:a}).left),u&&(n.position.left=r._convertPositionTo("relative",{top:0,left:f-r.helperProportions.width}).left)),!r.snapElements[h].snapping&&(i||s||o||u||p)&&r.options.snap.snap&&r.options.snap.snap.call(r.element,t,e.extend(r._uiHash(),{snapItem:r.snapElements[h].item})),r.snapElements[h].snapping=i||s||o||u||p}}}),e.ui.plugin.add("draggable","stack",{start:function(t,n,r){var i,s=r.options,o=e.makeArray(e(s.stack)).sort(function(t,n){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(n).css("zIndex"),10)||0)});if(!o.length)return;i=parseInt(e(o[0]).css("zIndex"),10)||0,e(o).each(function(t){e(this).css("zIndex",i+t)}),this.css("zIndex",i+o.length)}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,n,r){var i=e(n.helper),s=r.options;i.css("zIndex")&&(s._zIndex=i.css("zIndex")),i.css("zIndex",s.zIndex)},stop:function(t,n,r){var i=r.options;i._zIndex&&e(n.helper).css("zIndex",i._zIndex)}});var a=e.ui.draggable}),define("app/views/controls_base",["jquery","jquery","underscore","backbone","app/tpl"],function(e,t,n,r,i){"use strict";var s=r.View.extend({template:i.tplControlsBase,render:function(){var e=n.template(this.template),t=e(this.model.toJSON());return this.$el.html(t),this}});return s}),function(e,t){typeof define=="function"&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(n){t(e,n)}):typeof module=="object"&&module.exports?module.exports=t(e,require("jquery")):e.jQueryBridget=t(e,e.jQuery)}(window,function(t,n){function o(e,i,o){function a(t,n,r){var i,u="$()."+e+'("'+n+'")';return t.each(function(t,a){var f=o.data(a,e);if(!f){s(e+" not initialized. Cannot call methods, i.e. "+u);return}var l=f[n];if(!l||n.charAt(0)=="_"){s(u+" is not a valid method");return}var c=l.apply(f,r);i=i===undefined?c:i}),i!==undefined?i:t}function f(t,n){t.each(function(t,r){var s=o.data(r,e);s?(s.option(n),s._init()):(s=new i(r,n),o.data(r,e,s))})}o=o||n||t.jQuery;if(!o)return;i.prototype.option||(i.prototype.option=function(e){if(!o.isPlainObject(e))return;this.options=o.extend(!0,this.options,e)}),o.fn[e]=function(e){if(typeof e=="string"){var t=r.call(arguments,1);return a(this,e,t)}return f(this,e),this},u(o)}function u(e){if(!e||e&&e.bridget)return;e.bridget=o}var r=Array.prototype.slice,i=t.console,s=typeof i=="undefined"?function(){}:function(e){i.error(e)};return u(n||t.jQuery),o}),function(e,t){typeof define=="function"&&define.amd?define("get-size/get-size",[],function(){return t()}):typeof module=="object"&&module.exports?module.exports=t():e.getSize=t()}(window,function(){function t(e){var t=parseFloat(e),n=e.indexOf("%")==-1&&!isNaN(t);return n&&t}function n(){}function o(){var e={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0};for(var t=0;t<s;t++){var n=i[t];e[n]=0}return e}function u(e){var t=getComputedStyle(e);return t||r("Style returned "+t+". Are you running this code in a hidden iframe on Firefox? "+"See http://bit.ly/getsizebug1"),t}function l(){if(a)return;a=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var n=document.body||document.documentElement;n.appendChild(e);var r=u(e);c.isBoxSizeOuter=f=t(r.width)==200,n.removeChild(e)}function c(e){l(),typeof e=="string"&&(e=document.querySelector(e));if(!e||typeof e!="object"||!e.nodeType)return;var n=u(e);if(n.display=="none")return o();var r={};r.width=e.offsetWidth,r.height=e.offsetHeight;var a=r.isBorderBox=n.boxSizing=="border-box";for(var c=0;c<s;c++){var h=i[c],p=n[h],d=parseFloat(p);r[h]=isNaN(d)?0:d}var v=r.paddingLeft+r.paddingRight,m=r.paddingTop+r.paddingBottom,g=r.marginLeft+r.marginRight,y=r.marginTop+r.marginBottom,b=r.borderLeftWidth+r.borderRightWidth,w=r.borderTopWidth+r.borderBottomWidth,E=a&&f,S=t(n.width);S!==!1&&(r.width=S+(E?0:v+b));var x=t(n.height);return x!==!1&&(r.height=x+(E?0:m+w)),r.innerWidth=r.width-(v+b),r.innerHeight=r.height-(m+w),r.outerWidth=r.width+g,r.outerHeight=r.height+y,r}var r=typeof console=="undefined"?n:function(e){console.error(e)},i=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],s=i.length,a=!1,f;return c}),function(e,t){typeof define=="function"&&define.amd?define("ev-emitter/ev-emitter",t):typeof module=="object"&&module.exports?module.exports=t():e.EvEmitter=t()}(this,function(){function e(){}var t=e.prototype;return t.on=function(e,t){if(!e||!t)return;var n=this._events=this._events||{},r=n[e]=n[e]||[];return r.indexOf(t)==-1&&r.push(t),this},t.once=function(e,t){if(!e||!t)return;this.on(e,t);var n=this._onceEvents=this._onceEvents||{},r=n[e]=n[e]||[];return r[t]=!0,this},t.off=function(e,t){var n=this._events&&this._events[e];if(!n||!n.length)return;var r=n.indexOf(t);return r!=-1&&n.splice(r,1),this},t.emitEvent=function(e,t){var n=this._events&&this._events[e];if(!n||!n.length)return;var r=0,i=n[r];t=t||[];var s=this._onceEvents&&this._onceEvents[e];while(i){var o=s&&s[i];o&&(this.off(e,i),delete s[i]),i.apply(this,t),r+=o?0:1,i=n[r]}return this},e}),function(e,t){typeof define=="function"&&define.amd?define("unipointer/unipointer",["ev-emitter/ev-emitter"],function(n){return t(e,n)}):typeof module=="object"&&module.exports?module.exports=t(e,require("ev-emitter")):e.Unipointer=t(e,e.EvEmitter)}(window,function(t,n){function r(){}function i(){}var s=i.prototype=Object.create(n.prototype);s.bindStartEvent=function(e){this._bindStartEvent(e,!0)},s.unbindStartEvent=function(e){this._bindStartEvent(e,!1)},s._bindStartEvent=function(e,n){n=n===undefined?!0:!!n;var r=n?"addEventListener":"removeEventListener";t.navigator.pointerEnabled?e[r]("pointerdown",this):t.navigator.msPointerEnabled?e[r]("MSPointerDown",this):(e[r]("mousedown",this),e[r]("touchstart",this))},s.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},s.getTouch=function(e){for(var t=0;t<e.length;t++){var n=e[t];if(n.identifier==this.pointerIdentifier)return n}},s.onmousedown=function(e){var t=e.button;if(t&&t!==0&&t!==1)return;this._pointerDown(e,e)},s.ontouchstart=function(e){this._pointerDown(e,e.changedTouches[0])},s.onMSPointerDown=s.onpointerdown=function(e){this._pointerDown(e,e)},s._pointerDown=function(e,t){if(this.isPointerDown)return;this.isPointerDown=!0,this.pointerIdentifier=t.pointerId!==undefined?t.pointerId:t.identifier,this.pointerDown(e,t)},s.pointerDown=function(e,t){this._bindPostStartEvents(e),this.emitEvent("pointerDown",[e,t])};var o={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"],MSPointerDown:["MSPointerMove","MSPointerUp","MSPointerCancel"]};return s._bindPostStartEvents=function(e){if(!e)return;var n=o[e.type];n.forEach(function(e){t.addEventListener(e,this)},this),this._boundPointerEvents=n},s._unbindPostStartEvents=function(){if(!this._boundPointerEvents)return;this._boundPointerEvents.forEach(function(e){t.removeEventListener(e,this)},this),delete this._boundPointerEvents},s.onmousemove=function(e){this._pointerMove(e,e)},s.onMSPointerMove=s.onpointermove=function(e){e.pointerId==this.pointerIdentifier&&this._pointerMove(e,e)},s.ontouchmove=function(e){var t=this.getTouch(e.changedTouches);t&&this._pointerMove(e,t)},s._pointerMove=function(e,t){this.pointerMove(e,t)},s.pointerMove=function(e,t){this.emitEvent("pointerMove",[e,t])},s.onmouseup=function(e){this._pointerUp(e,e)},s.onMSPointerUp=s.onpointerup=function(e){e.pointerId==this.pointerIdentifier&&this._pointerUp(e,e)},s.ontouchend=function(e){var t=this.getTouch(e.changedTouches);t&&this._pointerUp(e,t)},s._pointerUp=function(e,t){this._pointerDone(),this.pointerUp(e,t)},s.pointerUp=function(e,t){this.emitEvent("pointerUp",[e,t])},s._pointerDone=function(){this.isPointerDown=!1,delete this.pointerIdentifier,this._unbindPostStartEvents(),this.pointerDone()},s.pointerDone=r,s.onMSPointerCancel=s.onpointercancel=function(e){e.pointerId==this.pointerIdentifier&&this._pointerCancel(e,e)},s.ontouchcancel=function(e){var t=this.getTouch(e.changedTouches);t&&this._pointerCancel(e,t)},s._pointerCancel=function(e,t){this._pointerDone(),this.pointerCancel(e,t)},s.pointerCancel=function(e,t){this.emitEvent("pointerCancel",[e,t])},i.getPointerPoint=function(e){return{x:e.pageX,y:e.pageY}},i}),function(e,t){typeof define=="function"&&define.amd?define("unidragger/unidragger",["unipointer/unipointer"],function(n){return t(e,n)}):typeof module=="object"&&module.exports?module.exports=t(e,require("unipointer")):e.Unidragger=t(e,e.Unipointer)}(window,function(t,n){function r(){}function i(){}var s=i.prototype=Object.create(n.prototype);s.bindHandles=function(){this._bindHandles(!0)},s.unbindHandles=function(){this._bindHandles(!1)};var o=t.navigator;return s._bindHandles=function(e){e=e===undefined?!0:!!e;var t;o.pointerEnabled?t=function(t){t.style.touchAction=e?"none":""}:o.msPointerEnabled?t=function(t){t.style.msTouchAction=e?"none":""}:t=r;var n=e?"addEventListener":"removeEventListener";for(var i=0;i<this.handles.length;i++){var s=this.handles[i];this._bindStartEvent(s,e),t(s),s[n]("click",this)}},s.pointerDown=function(e,t){if(e.target.nodeName=="INPUT"&&e.target.type=="range"){this.isPointerDown=!1,delete this.pointerIdentifier;return}this._dragPointerDown(e,t);var n=document.activeElement;n&&n.blur&&n.blur(),this._bindPostStartEvents(e),this.emitEvent("pointerDown",[e,t])},s._dragPointerDown=function(e,t){this.pointerDownPoint=n.getPointerPoint(t);var r=this.canPreventDefaultOnPointerDown(e,t);r&&e.preventDefault()},s.canPreventDefaultOnPointerDown=function(e){return e.target.nodeName!="SELECT"},s.pointerMove=function(e,t){var n=this._dragPointerMove(e,t);this.emitEvent("pointerMove",[e,t,n]),this._dragMove(e,t,n)},s._dragPointerMove=function(e,t){var r=n.getPointerPoint(t),i={x:r.x-this.pointerDownPoint.x,y:r.y-this.pointerDownPoint.y};return!this.isDragging&&this.hasDragStarted(i)&&this._dragStart(e,t),i},s.hasDragStarted=function(e){return Math.abs(e.x)>3||Math.abs(e.y)>3},s.pointerUp=function(e,t){this.emitEvent("pointerUp",[e,t]),this._dragPointerUp(e,t)},s._dragPointerUp=function(e,t){this.isDragging?this._dragEnd(e,t):this._staticClick(e,t)},s._dragStart=function(e,t){this.isDragging=!0,this.dragStartPoint=n.getPointerPoint(t),this.isPreventingClicks=!0,this.dragStart(e,t)},s.dragStart=function(e,t){this.emitEvent("dragStart",[e,t])},s._dragMove=function(e,t,n){if(!this.isDragging)return;this.dragMove(e,t,n)},s.dragMove=function(e,t,n){e.preventDefault(),this.emitEvent("dragMove",[e,t,n])},s._dragEnd=function(e,t){this.isDragging=!1,setTimeout(function(){delete this.isPreventingClicks}.bind(this)),this.dragEnd(e,t)},s.dragEnd=function(e,t){this.emitEvent("dragEnd",[e,t])},s.onclick=function(e){this.isPreventingClicks&&e.preventDefault()},s._staticClick=function(e,t){if(this.isIgnoringMouseUp&&e.type=="mouseup")return;var n=e.target.nodeName;(n=="INPUT"||n=="TEXTAREA")&&e.target.focus(),this.staticClick(e,t),e.type!="mouseup"&&(this.isIgnoringMouseUp=!0,setTimeout(function(){delete this.isIgnoringMouseUp}.bind(this),400))},s.staticClick=function(e,t){this.emitEvent("staticClick",[e,t])},i.getPointerPoint=n.getPointerPoint,i}),function(e,t){typeof define=="function"&&define.amd?define("draggabilly",["get-size/get-size","unidragger/unidragger"],function(n,r){return t(e,n,r)}):typeof module=="object"&&module.exports?module.exports=t(e,require("get-size"),require("unidragger")):e.Draggabilly=t(e,e.getSize,e.Unidragger)}(window,function(t,n,r){function s(){}function o(e,t){for(var n in t)e[n]=t[n];return e}function u(e){return e instanceof HTMLElement}function p(e,t){this.element=typeof e=="string"?i.querySelector(e):e,h&&(this.$element=h(this.element)),this.options=o({},this.constructor.defaults),this.option(t),this._create()}function v(e,t,n){return n=n||"round",t?Math[n](e/t)*t:e}var i=t.document,a=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame,f=0;a||(a=function(e){var t=(new Date).getTime(),n=Math.max(0,16-(t-f)),r=setTimeout(e,n);return f=t+n,r});var l=i.documentElement,c=typeof l.style.transform=="string"?"transform":"WebkitTransform",h=t.jQuery,d=p.prototype=Object.create(r.prototype);return p.defaults={},d.option=function(e){o(this.options,e)},d._create=function(){this.position={},this._getPosition(),this.startPoint={x:0,y:0},this.dragPoint={x:0,y:0},this.startPosition=o({},this.position);var e=getComputedStyle(this.element);e.position!="relative"&&e.position!="absolute"&&(this.element.style.position="relative"),this.enable(),this.setHandles()},d.setHandles=function(){this.handles=this.options.handle?this.element.querySelectorAll(this.options.handle):[this.element],this.bindHandles()},d.dispatchEvent=function(e,n,r){var i=[n].concat(r);this.emitEvent(e,i);var s=t.jQuery;if(s&&this.$element)if(n){var o=s.Event(n);o.type=e,this.$element.trigger(o,r)}else this.$element.trigger(e,r)},p.prototype._getPosition=function(){var e=getComputedStyle(this.element),t=this._getPositionCoord(e.left,"width"),n=this._getPositionCoord(e.top,"height");this.position.x=isNaN(t)?0:t,this.position.y=isNaN(n)?0:n,this._addTransformPosition(e)},p.prototype._getPositionCoord=function(e,t){if(e.indexOf("%")!=-1){var r=n(this.element.parentNode);return parseFloat(e)/100*r[t]}return parseInt(e,10)},d._addTransformPosition=function(e){var t=e[c];if(t.indexOf("matrix")!==0)return;var n=t.split(","),r=t.indexOf("matrix3d")===0?12:4,i=parseInt(n[r],10),s=parseInt(n[r+1],10);this.position.x+=i,this.position.y+=s},d.pointerDown=function(e,t){this._dragPointerDown(e,t),this._bindPostStartEvents(e),this.element.classList.add("is-pointer-down"),this.dispatchEvent("pointerDown",e,[t])},d.pointerMove=function(e,t){var n=this._dragPointerMove(e,t);this.dispatchEvent("pointerMove",e,[t,n]),this._dragMove(e,t,n)},d.dragStart=function(e,t){if(!this.isEnabled)return;this._getPosition(),this.measureContainment(),this.startPosition.x=this.position.x,this.startPosition.y=this.position.y,this.setLeftTop(),this.dragPoint.x=0,this.dragPoint.y=0,this.element.classList.add("is-dragging"),this.dispatchEvent("dragStart",e,[t]),this.animate()},d.measureContainment=function(){var e=this.options.containment;if(!e)return;var t=u(e)?e:typeof e=="string"?i.querySelector(e):this.element.parentNode,r=n(this.element),s=n(t),o=this.element.getBoundingClientRect(),a=t.getBoundingClientRect(),f=s.borderLeftWidth+s.borderRightWidth,l=s.borderTopWidth+s.borderBottomWidth,c=this.relativeStartPosition={x:o.left-(a.left+s.borderLeftWidth),y:o.top-(a.top+s.borderTopWidth)};this.containSize={width:s.width-f-c.x-r.width,height:s.height-l-c.y-r.height}},d.dragMove=function(e,t,n){if(!this.isEnabled)return;var r=n.x,i=n.y,s=this.options.grid,o=s&&s[0],u=s&&s[1];r=v(r,o),i=v(i,u),r=this.containDrag("x",r,o),i=this.containDrag("y",i,u),r=this.options.axis=="y"?0:r,i=this.options.axis=="x"?0:i,this.position.x=this.startPosition.x+r,this.position.y=this.startPosition.y+i,this.dragPoint.x=r,this.dragPoint.y=i,this.dispatchEvent("dragMove",e,[t,n])},d.containDrag=function(e,t,n){if(!this.options.containment)return t;var r=e=="x"?"width":"height",i=this.relativeStartPosition[e],s=v(-i,n,"ceil"),o=this.containSize[r];return o=v(o,n,"floor"),Math.min(o,Math.max(s,t))},d.pointerUp=function(e,t){this.element.classList.remove("is-pointer-down"),this.dispatchEvent("pointerUp",e,[t]),this._dragPointerUp(e,t)},d.dragEnd=function(e,t){if(!this.isEnabled)return;c&&(this.element.style[c]="",this.setLeftTop()),this.element.classList.remove("is-dragging"),this.dispatchEvent("dragEnd",e,[t])},d.animate=function(){if(!this.isDragging)return;this.positionDrag();var e=this;a(function(){e.animate()})},d.setLeftTop=function(){this.element.style.left=this.position.x+"px",this.element.style.top=this.position.y+"px"},d.positionDrag=function(){this.element.style[c]="translate3d( "+this.dragPoint.x+"px, "+this.dragPoint.y+"px, 0)"},d.staticClick=function(e,t){this.dispatchEvent("staticClick",e,[t])},d.enable=function(){this.isEnabled=!0},d.disable=function(){this.isEnabled=!1,this.isDragging&&this.dragEnd()},d.destroy=function(){this.disable(),this.element.style[c]="",this.element.style.left="",this.element.style.top="",this.element.style.position="",this.unbindHandles(),this.$element&&this.$element.removeData("draggabilly")},d._init=s,h&&h.bridget&&h.bridget("draggabilly",p),p}),define("app/base",["jquery","jqueryui","underscore","backbone","app/views/controls_base","draggabilly"],function(e,t,n,r,i,s){"use strict";var o={clicked:function(e,t,n){n&&n.addClass("omp-hidden"),e.hasClass("omp-hidden")?(e.removeClass("omp-hidden"),t.removeClass("omp-hidden")):t.hasClass("omp-hidden")?t.removeClass("omp-hidden"):t.addClass("omp-hidden")},closed:function(e){e.addClass("omp-hidden")},linkClicked:function(e){e.hasClass("omp-active")?e.removeClass("omp-active"):e.addClass("omp-active")},toogleChapterMarkers:function(t,n){var r=e("span[data-type=markers]");r.hasClass("omp-progress-chapter")?r.removeClass("omp-progress-chapter"):e("#"+t+"_fd_c").hasClass("omp-hidden")?r.removeClass("omp-progress-chapter"):r.addClass("omp-progress-chapter")},toHHMMSS:function(e){var t=parseInt(e,10),n=Math.floor(t/3600),r=Math.floor((t-n*3600)/60),i=t-n*3600-r*60,s="";return n>0&&(s=n+":"),r<10?s=s+"0"+r+":":s=s+r+":",i<10?s=s+"0"+i:s+=i,s},addCommonFunctionality:function(t,n){var r=e("#"+t+"_f_options_min"),i=e("#"+t+"_f_options_mid"),s=e("#"+t+"_options_dialog"),u=e("#"+t+"_od_cc_min"),a=e("#"+t+"_od_ad_min"),f=e("#"+t+"_od_q_min"),l=e("#"+t+"_od_t_min"),c=e("#"+t+"_od_c_min"),h=e("#"+t+"_od_q_mid"),p=e("#"+t+"_od_c_mid"),d=e("#"+t+"_features_dialog"),v=e("#"+t+"_fd_cc"),m=e("#"+t+"_fd_ad"),g=e("#"+t+"_fd_q"),y=e("#"+t+"_fd_c"),b=e("#"+t+"_fd_t"),w=e("#"+t+"_fd_show_description"),E=e("#"+t+"_fd_description_contents"),S=e("#"+t+"_fd_description_short_contents"),x=e("#"+t+"_fd_cc_close"),T=e("#"+t+"_fd_ad_close"),N=e("#"+t+"_fd_q_close"),C=e("#"+t+"_fd_c_close"),k=e("#"+t+"_fd_t_close"),L=e("#"+t+"_f_chapters_max"),A=e("#"+t+"_f_transcript_max"),O=e("#"+t+"_f_quality_max"),M=e("#"+t+"_f_ad_max"),_=e("#"+t+"_f_cc_max"),D=e("#"+t+"_f_transcript_mid"),P=e("#"+t+"_f_ad_mid"),H=e("#"+t+"_f_cc_mid"),B=e("#"+t+"_m_playpause"),j=n.get("tracksSubtitles"),F=!1,I=e("#"+t+"_language_selector");I.change(function(){var t=e(this).val();n.set("activeLanguage",t)}),r.click(function(e){s.hasClass("omp-hidden")?s.removeClass("omp-hidden"):s.addClass("omp-hidden")}),i.click(function(e){s.hasClass("omp-hidden")?s.removeClass("omp-hidden"):s.addClass("omp-hidden")}),a.click(function(e){return o.clicked(d,m,s),!1}),f.click(function(e){return o.clicked(d,g,s),!1}),c.click(function(e){return o.clicked(d,y,s),!1}),l.click(function(e){return o.clicked(d,b,s),!1}),h.click(function(e){return o.clicked(d,g,s),!1}),p.click(function(e){return o.clicked(d,y,s),!1}),D.click(function(){return o.clicked(d,b,!1),!1}),P.click(function(){return o.clicked(d,m,!1),!1}),O.click(function(){return o.clicked(d,g,!1),!1}),M.click(function(){return o.clicked(d,m,!1),!1}),w.click(function(e){return E.hasClass("omp-hidden")?(E.removeClass("omp-hidden"),S.addClass("omp-hidden"),w.html(labels.showLess),!1):(E.addClass("omp-hidden"),S.removeClass("omp-hidden"),w.html(labels.showMore),!1)}),x.click(function(e){return o.closed(v),B.focus(),!1}),T.click(function(e){return o.closed(m),B.focus(),!1}),N.click(function(e){return o.closed(g),B.focus(),!1})},mykeyhandler:function(e,t,n,r){var i="";if(e.defaultPrevented)return;if(oump.active&&oump.active!==t)return;if(o.mykeys===!1){for(var s=0,u=n.get("keystrokes").length;s<u;s++)s===0?i=r[n.get("keystrokes")[s]]:i=i+","+r[n.get("keystrokes")[s]];i=i.split(",");for(var s=0,u=i.length;s<u;s++){var a=i[s].replace("c","").replace("s",""),f=i[s].indexOf("c")===0?i[s].replace("c",""):!1,l=i[s].indexOf("s")===0?i[s].replace("s",""):!1;s===0?o.mykeys=[a]:o.mykeys.indexOf(a)===-1&&o.mykeys.push(a),f&&o.mykeysc.indexOf(f)===-1&&o.mykeysc.push(f),l&&o.mykeyss.indexOf(l)===-1&&o.mykeyss.push(l)}}if(o.mykeys.indexOf(e.which+"")===-1)return;if(o.mykeysc.indexOf(e.which+"")>-1&&e.ctrlKey){i="c"+e.which;var c="";for(c in r)if(r[c].search(i)!==-1){e.preventDefault(),n.get("preventedKeys").indexOf(c)==-1&&n.trigger("oump_"+c);return}}if(o.mykeyss.indexOf(e.which+"")>-1){if(e.shiftKey){i="s"+e.which;var c="";for(c in r)if(r[c].search(i)!==-1){e.preventDefault(),n.get("preventedKeys").indexOf(c)==-1&&n.trigger("oump_"+c);return}}}else{i=""+e.which;var c="";for(c in r)if(r[c].search(i)!==-1){e.preventDefault(),n.get("preventedKeys").indexOf(c)==-1&&n.trigger("oump_"+c);return}}console.log("Missing event in keylookup. a="+i+", e="+c+", key="+String.fromCharCode(e.which))},mykeys:!1,mykeyss:[],mykeysc:[],toggleFullScreen:function(t){var n=t.get("id"),r=e("#"+n+"_features_dialog"),i=e("#"+n+"_options_controls"),s=e("#"+n+"_options_dialog"),o=e("#"+n+"_m_playpause"),u=e("#"+n),a=e("#"+t.get("id")+"_video");t.get("isFullscreen")?(t.set("isFullscreen",!1),player.removeClass("omp-smart").addClass("omp-"+t.get("activeSizing")),t.get("sizing")==="fixed"?u.attr("style","width: "+t.get("width")+"px !important;"):t.get("sizing")==="custom"?u.attr("style","max-width: "+t.get("width")+"px !important;"):u.attr("style",""),r.removeClass("omp-hidden"),i.removeClass("omp-hidden"),a.removeAttr("controls"),u.removeClass("omp-fullscreen")):(t.set("isFullscreen",!0),u.removeClass("omp-"+t.get("activeSizing")).addClass("omp-smart").attr("style","width:100%"),r.addClass("omp-hidden"),i.addClass("omp-hidden"),s.addClass("omp-hidden"),a.attr("controls","true"),u.addClass("omp-fullscreen")),o.focus()},showControl:function(t,r){var i=t.get("labels"),s=t.get("isFullscreen"),o=i.pl+"-1;"+i.ch+"-1;"+i.tr+"-1;cc-0";r=r?r:"",r=r=="all"?o:r,i.pl=i.pl!="Pl"?"Pl":i.pl,i.ch=i.ch!="Ch"?"Ch":i.ch,i.tr=i.tr!="Tr"?"Tr":i.tr;var u=[i.pl,i.ch,i.tr,"cc"];for(var a=0;a<=u.length;a++)u[a]&&(e("#"+t.get("id")+"_f_"+u[a].toLowerCase()+"_icon").addClass("omp-hidden"),e("#"+t.get("id")+"_f_"+u[a].toLowerCase()+"_link").addClass("omp-hidden"),s?e("#"+t.get("id")+"_f_"+u[a].toLowerCase()+"_setting").addClass("omp-hidden"):e("#"+t.get("id")+"_f_"+u[a].toLowerCase()+"_setting").removeClass("omp-hidden"));if(r=="")return;var f=r.split(";");n.each(f,function(n){var n=n.split("-"),r=n[0],i=parseInt(n[1])==1;e("#"+t.get("id")+"_f_"+r.toLowerCase()+"_icon").toggleClass("omp-hidden",i),e("#"+t.get("id")+"_f_"+r.toLowerCase()+"_link").toggleClass("omp-hidden",!i),e("#"+t.get("id")+"_f_"+r.toLowerCase()+"_setting").addClass("omp-hidden")})}},u=r.Model.extend({init:function(t){var u=t.get("id"),a=new i({model:t}),f=e("#"+u),l=!0,c=t.get("labels");window.oump["timeout_"+t.id]=null;if(a&&f){f.replaceWith(a.render().el.childNodes);var h=e("#"+u+"_m_playpause"),p=e("#"+u+"_m_playpause > i"),d=e("#"+u+"_m_playpause > span"),v=e("#"+u+"_m_stop"),m=e("#"+u+"_m_mute"),g=e("#"+u+"_m_muteall"),y=e("#"+u+"_m_mute > i"),b=e("#"+u+"_m_mute > span"),w=e("#"+u+"_m_volume"),E=e("#"+u+"_m_volume_a"),S=e("#"+u+"_m_volume_bar"),x=e("#"+u+"_m_volume_0"),T=e("#"+u+"_m_volume_1"),N=e("#"+u+"_m_volume_2"),C=e("#"+u+"_m_volume_3"),k=e("#"+u+"_m_volume_4"),L=e("#"+u+"_m_volume_5"),A=e("#"+u+"_m_volume_6"),O=e("#"+u+"_m_volume_7"),M=e("#"+u+"_m_volume_8"),D=e("#"+u+"_m_fullscreen"),P=e("#"+u+"_m_fullscreen > i"),H=e("#"+u+"_p_buffered"),B=e("#"+u+"_p_played"),j=e("#"+u+"_p_time_line"),F=e("#"+u+"_p_time_txt"),I=e("#"+u+"_timer_time"),q=e("#"+u+"_timer_length"),R=e("#"+u+"_fd_cc_selector"),U=e("#"+u+"_quality_selector"),z=e("#"+u+"_p_bg"),W=e("#"+u+"_p_control"),X=e("#"+u+"_p_volume_control"),V=e("#"+u+"_p_volume_bg"),J=e("#"+u+"_p_volume_played"),K=V.width(),Q=e("#"+u+"_p_volume_time_line"),G=e("#"+u+"_p_volume_time_line_tab"),Y=e("#"+u+"_features_dialog"),Z=e("#"+u+"_options_controls"),et=e("#"+u+"_options_dialog"),tt=e("#"+u+"_progresswrap"),nt=z.width(),rt=parseInt(j.css("border-left-width")),it=Y.attr("class"),st=!1,ot=!1,ut={playpause:"32",stop:"83,115",volup:"38",voldown:"40",mute:"77,109",seekback:"37",seekforwards:"39",fullscreen:"70,102",subtitle:"86,118",nextsubtitle:"c86,c118",jumpback:"c37",jumpforwards:"c39",start:"36",end:"35",nextmediaelement:"s78,s110"},at=!1;o.addCommonFunctionality(u,t),S.width(t.get("volume")*100+"%"),n.extend(t,r.Events),h.click(function(e){e.stopPropagation(),t.trigger("oumpPlayPause"),h.removeClass("replay")}),v.click(function(e){e.stopPropagation(),t.trigger("oumpStop")}),e("#"+u).delegate(".progress","click",function(){h.click(),oump.ismobile&&e("#"+u+"_video_lenghth").addClass("omp-hidden")});if(!oump.isios){var ft=parseInt(V.offset().left)+parseInt(e(document.body).css("margin-left"))-4,lt=parseInt(z.offset().left)+parseInt(e(document.body).css("margin-left"))-rt/2,ct=lt+nt;m.click(function(e){e.stopPropagation();var n=t.get("volume");if(n<=0){n=t.get("oldVolume");if(typeof n=="undefined"||n==0)n=.5;t.set("volume",n),at=!0}if(at){var r=t.get("volume"),i=Math.round(r*100),s=V.width(),o=r*s;J.removeAttr("style"),J.attr("style","width: "+i+"%"),Q.css("left",o),t.trigger("oumpVolumeChange",n),at=!1}else{var o=Q.position();t.set("oldVolume",t.get("volume")),J.width("0"),Q.removeAttr("style"),t.trigger("oumpVolumeChange",0),at=!0}}),g.click(function(e){var n=0;t.trigger("oumpVolumeChange",n),t.trigger("oumpUpdateVolumeChangeUI",n),at=!0})}t.get("type")==="video"&&(D.parent().removeClass("omp-hidden"),D.click(function(n){n.stopPropagation(),e("#"+u).focus(),t.trigger("oumpToggleFullscreen")}));var ht=new s("#"+t.get("id")+"_p_time_line",{axis:"x",containment:"#"+t.get("id")+"_p_control_inner"});ht.on("dragStart",function(e,t,n){F.removeClass("omp-hidden")}),ht.on("dragMove",function(n,r,i){var s=parseInt(z.offset().left)+parseInt(e(document.body).css("margin-left"))-rt/2,u=z.width(),a=(j.offset().left+6-s)/u;a=a<0?0:a,a=a>1?1:a;if(a>=0&&a<=1){var f=Math.round(a*100),l=a*t.get("duration");F.attr("style","left:"+f+"%"),F.text(o.toHHMMSS(l)),I.text(o.toHHMMSS(l));var c=Math.round(l/t.get("duration")*100),f=Math.min(c,99);B.attr("style","width:"+f+"%"),oump.browser=="msie"?(window.clearTimeout(window.oump["timeout_"+t.id]),window.oump["timeout_"+t.id]=window.setTimeout(function(){lt<=r.clientX&&r.clientX<=ct&&t.trigger("oumpSeeking",l)},200)):lt<=r.clientX&&r.clientX<=ct&&t.trigger("oumpSeeking",l),t.set("isDrag",!0)}}),ht.on("dragEnd",function(e,n,r){F.addClass("omp-hidden");var i=z.width(),s=j.position().left,o=s/i;o=o<0?0:o,o=o>1?1:o,o>=0&&o<=1&&t.trigger("oumpSeeking",o*t.get("duration")),t.set("isDrag",!1)});var pt=new s("#"+t.get("id")+"_p_volume_time_line",{axis:"x",containment:"#"+t.get("id")+"_volume_control_inner"});t.set("movedVector",0),pt.on("dragStart",function(e,n,r){t.set("oldVolume",t.get("volume"))}),pt.on("dragMove",function(n,r,i){var s=V.width(),o=parseInt(V.offset().left)+parseInt(e(document.body).css("margin-left"))-rt/2,u=(Q.offset().left+6-o)/s;u=u<=0?0:u,u=u>=.95?.95:u,J.attr("style","width: "+u*s+"px"),t.trigger("oumpVolumeChange",u)}),pt.on("dragEnd",function(e,n,r){var i=Q.position().left,s=V.width(),o=i/s;o=o<=0?0:o,o=o>=.95?.95:o,i=i<0?0:i,i=i>s?s:i,J.attr("style","width: "+i+"px"),t.trigger("oumpVolumeChange",o),o>0&&t.set("oldVolume",o)}),W.click(function(n){var r=e(this).offset().left,i=n.clientX-r+e(window).scrollLeft(),s=z.width();if(n.defaultPrevented)return;var o=i/s;if(o>=0&&o<=1){var u=(o*100).toFixed(3);j.attr("style","left:"+u+"%"),F.attr("style","left:"+u+"%"),t.trigger("oumpSeeking",o*t.get("duration")),t.trigger("oumpSeeked",o*t.get("duration"))}return!1}),X.click(function(n){var r=e(this).offset().left,i=n.clientX-r+e(window).scrollLeft(),s=V.width(),o=i/K;if(o>=0&&o<=1){var u=Math.round(o*100);J.attr("style","width: "+u+"%");var a=K*u/100,f=J.position(),l=parseInt(f.left)+parseInt(a);Q.attr("style","left: "+l+"px"),at=!1,o<=.03&&(o=0,at=!0),t.trigger("oumpVolumeChange",o)}return!1}),R.change(function(n){var r=e("#"+u+"_fd_cc_selector option:selected");changedSource&&(t.trigger("oumpCaptionChange",{srclang:r.attr("value"),label:r.text()}),t.trigger("oumpUpdateCaptionUI",r.attr("value")!=="none")),e("#"+u+"_fd_cc_close").click()}),U.change(function(n){var r=e("#"+u+"_quality_selector option:selected");r&&t.trigger("oumpQualityChange",r.attr("value"))}),t.on("oumpUpdatePlayPauseUI",function(t){t?(p.removeClass("fa-play").addClass("fa-pause"),h.attr("title",c.pause),h.attr("aria-label",c.pause),d.html(c.pause),h.addClass("pause").removeClass("play").removeClass("replay"),ot=!1,e("#"+u+"_center_playicon").addClass("omp-hidden")):(p.removeClass("fa-pause").addClass("fa-play"),h.attr("title",c.play),h.attr("aria-label",c.play),h.removeClass("pause").addClass("play"),d.html(c.play),e("#"+u+"_center_playicon").removeClass("omp-hidden"),e("#"+u+"_center_playicon").attr("title",c.play))}),t.on("oumpStop",function(){t.trigger("oumpUpdatePlayPauseUI",!1),t.trigger("oumpTimeUpdate",0)}),t.on("oumpUpdateVolumeChangeUI",function(e){if(e<=0)S.width("0"),E.text("Volume muted"),w.attr("title","Volume muted"),y.removeClass("fa-volume-down").removeClass("fa-volume-up").addClass("fa-volume-off"),m.attr("title",c.unmute),b.text(c.unmute);else if(e>=.99){S.width("100%"),E.text("Volume 100%"),w.attr("title","Volume 100%"),y.removeClass("fa-volume-off").removeClass("fa-volume-down").addClass("fa-volume-up");var t=K*e,n=J.position(),r=parseInt(n.left)+parseInt(t);Q.css("left",r+"px"),m.attr("title",c.mute),b.text(c.mute)}else{S.width(e*100+"%"),E.text("Volume "+parseInt(e*100)+"%"),w.attr("title","Volume "+parseInt(e*100)+"%"),y.removeClass("fa-volume-off").removeClass("fa-volume-up").addClass("fa-volume-down"),m.attr("title",c.mute),b.text(c.mute);var i=Math.round(e*100);if(l){J.attr("style","width: "+i+"%");var t=K*e,n=J.position(),r=parseInt(n.left)+parseInt(t);Q.css("left",r+"px")}}l=!1}),t.on("oumpUpdateSlideVolumeUI",function(e){e<=100&&(e=e.toFixed(),e>=89&&(e=90),J.attr("style","width: "+e+"%"),Q.css("left",e+"%"))}),t.on("oumpShowControlBar",function(n){n=n||{};var r=n.timeout||1500,i=typeof n.showed=="undefined"?!0:n.showed,s=e("#"+u+"_"+t.get("type"));clearTimeout(t.get("timeoutid").controlbar);if(i){e("#"+u).css("cursor","default"),e("#"+u+" .omp-controlbar").removeClass("omp-hidden");if(r>-1)var o=setTimeout(function(){t.trigger("oumpShowControlBar",{showed:!1}),t.trigger("oumpControlBarTerminated")},r);t.get("timeoutid").controlbar=o}else t.get("isFullscreen")===!0&&!s.get(0).paused&&(e("#"+u).css("cursor","none"),e("#"+u+" .omp-controlbar").addClass("omp-hidden"),s.focus())}),t.on("oumpToggleFullscreen",function(){t.trigger("oumpToggleFullscreenUI")}),t.on("oumpToggleFullscreenUI",function(){if(t.get("isFullscreen"))D.attr("title",c.fullscreen),D.attr("aria-label",c.fullscreen),P.removeClass("fa-compress").addClass("fa-expand");else{D.attr("title",c.exitFullscreen),D.attr("aria-label",c.exitFullscreen),P.removeClass("fa-expand").addClass("fa-compress");var n=e("#"+u+"_fd_cc");n.hasClass("omp-hidden")||n.addClass("omp-hidden")}}),t.on("oumpTimeUpdate",function(e){if(e===0||t.get("duration")===0)B.removeAttr("style"),F.html("00:00"),j.removeAttr("style"),I.html("00:00");else if(ot)ot=!1;else{var n=o.toHHMMSS(e),r=(e/t.get("duration")*100).toFixed(3),i=Math.min(r,99);B.attr("style","width:"+i+"%"),t.get("isDrag")||(j.attr("style","left:"+i+"%"),I.html(n),F.html(n)),F.attr("style","left:"+i+"%")}}),t.on("oumpEnded",function(){t.trigger("oumpUpdatePlayPauseUI",!1),ot=!0;var e=t.get("labels");t.trigger("oumpTimeUpdate",0),h.addClass("replay"),h.attr("title",e.replay),h.attr("aria-label",e.replay)}),t.on("oumpLoadedMetadata",function(n){e.isNumeric(n)&&n>1&&(t.set("duration",n),q.html(o.toHHMMSS(n))),(isNaN(t.get("duration"))||t.get("duration")<=1)&&tt.addClass("omp-hidden")}),t.on("oumpProgress",function(e){H.attr("style","width:"+Math.round(e*100)+"%")});var dt;t.on("oumpResizer",function(n){var r=e("#"+t.get("id")).width(),i=t.get("labels"),s=[],a=[],f=0;s[0]="",s[1]="",s[2]="";if(dt==r)return;dt=r,t.checkHasFeature("playlist")&&t.get("hasPlaylist")&&(s[f]=i.pl,a[f]=i.playlist,f++),t.checkHasFeature("chapters")&&(s[f]=i.ch,a[f]=i.chapter,f++),t.checkHasFeature("transcripts")&&(s[f]=i.tr,a[f]=i.transcript,f++);for(var l=0;l<f;l++){var c=a[l]+"Active",h=s[l];t.get(c)?(e("#"+t.get("id")+"_f_"+h+"_max").addClass("omp-"+a[l]+"-icon-active"),e("#"+t.get("id")+"_f_"+h+"_max").attr("omp-settings-toogle",!0)):(e("#"+t.get("id")+"_f_"+h+"_max").removeClass("omp-"+a[l]+"-icon-active"),e("#"+t.get("id")+"_f_"+h+"_max").attr("omp-settings-toogle",!1))}r<=483?t.get("renderStyle")=="advance"?r<380&&!oump.isios?(e("#"+t.get("id")+"_f_cc_setting").removeClass("omp-hidden"),e("#"+t.get("id")+"_f_cc_icon").addClass("omp-hidden")):o.showControl(t,"cc-0"):r<=475?setTimeout(function(){o.showControl(t,""),t.get("isFullscreen")?e("#"+t.get("id")+"_f_cc_icon").removeClass("omp-hidden"):e("#"+t.get("id")+"_f_cc_icon").addClass("omp-hidden"),e("#"+u+"_f_settings").length==0&&t.get("renderStyle")=="compact"&&e("#"+t.get("id")+"_f_cc_icon").removeClass("omp-hidden")},0):i.playlist!="Playlist"?o.showControl(t,"cc-0"):o.showControl(t,i.pl+"-0;"+i.ch+"-0;"+i.tr+"-0;cc-0"):f>1&&r<580?(f==3&&(r<=530?r<=515?o.showControl(t,i.pl+"-0;"+i.ch+"-0;"+i.tr+"-0;cc-0"):setTimeout(function(){i.playlist!="Playlist"?o.showControl(t,i.pl+"-0;"+i.ch+"-0;"+i.tr+"-0;cc-0"):t.get("isFullscreen")?o.showControl(t,"cc-0"):o.showControl(t,i.pl+"-1;"+i.ch+"-0;"+i.tr+"-0;cc-0")},0):(e(".omp-links-icon").removeClass("omp-links-icon-tiny"),e(".omp-links-icon").removeClass("omp-links-icon-small"),o.showControl(t,i.pl+"-1;"+i.ch+"-1;"+i.tr+"-0;cc-0"))),f==2&&(r<510?r<490?o.showControl(t,s[0]+"-0;"+s[1]+"-0;cc-0"):o.showControl(t,s[0]+"-1;"+s[1]+"-0;cc-0"):o.showControl(t,s[0]+"-1;"+s[1]+"-1;cc-0"))):r<600?i.playlist!="Playlist"?o.showControl(t,i.pl+"-1;"+i.ch+"-1;"+i.tr+"-0;cc-0"):o.showControl(t,i.pl+"-1;"+i.ch+"-1;"+i.tr+"-1;cc-0"):o.showControl(t,"all"),document.webkitFullscreenElement||document.msFullscreenElement||document.mozFullScreenElement?e("#"+t.get("id")+"_f_options").addClass("omp-hidden"):e("#"+t.get("id")+"_f_options").removeClass("omp-hidden"),st&&t.get("isFullscreen")&&!document.fullscreenElement&&!document.mozFullScreenElement&&!document.webkitFullscreenElement&&!document.msFullscreenElement&&(t.trigger("oumpToggleFullscreenUI"),o.exitFS(t,Y,Z,it,st)),nt=z.width()}),t.on("oumpUpdateCaptionUI",function(n){var r=e("#"+t.id+"_f_cc_max"),i=e("#"+t.id+"_f_cc_max > span"),s=e("#"+t.id+"_f_cc_mid"),o=e("#"+t.id+"_f_cc_mid > span");n?r.hasClass("omp-highlight")||(r.attr("title",c.closedCaptionsOn).addClass("omp-highlight"),s.attr("title",c.closedCaptionsOn).addClass("omp-highlight")):r.hasClass("omp-highlight")&&(r.attr("title",c.closedCaptions).removeClass("omp-highlight"),s.attr("title",c.closedCaptions).removeClass("omp-highlight"))}),e("#"+u).on("keyup",function(e){if(e.which===9&&t.get("isFullscreen")&&(/firefox/.test(oump.browser)||/chrome/.test(oump.browser)))return;o.mykeyhandler(e,u,t,ut)}),/firefox/.test(oump.browser)&&e(".omp-btn").on("keydown keyup",function(e){if(e.which==ut.playpause){e.preventDefault();return}}),t.on("oump_playpause",function(){t.trigger("oumpPlayPause")}),t.on("oump_pause",function(){var n=t.get("type"),r=e("#"+u+"_"+n);r.get(0).paused||h.click()}),t.on("oump_stop",function(){v.click()}),t.on("oump_volup",function(){var e=parseFloat(t.get("volume"))*9;e=e.toFixed()*1+1;if(e>=9)return;e>8&&(e=9),e/=9,t.trigger("oumpVolumeChange",e),t.trigger("oumpUpdateSlideVolumeUI",e*100),t.get("isFullscreen")&&t.trigger("oumpShowControlBar")}),t.on("oump_voldown",function(){var e=t.get("volume")*9;e=e.toFixed()*1-1;if(e<0)return;e/=9,t.trigger("oumpVolumeChange",e),t.trigger("oumpUpdateSlideVolumeUI",e*100),t.get("isFullscreen")&&t.trigger("oumpShowControlBar")}),t.on("oump_mute",function(){m.click()}),t.on("oumpMute",function(){t.get("volume")>0&&m.click()}),t.on("oumpUnmute",function(){t.get("volume")==0&&m.click()}),t.on("oump_fullscreen",function(){if(oump.browser==="msie"||oump.hasOwnProperty("browserver")&&oump.browserver=="edge")if(!t.get("isFullscreen"))return;D.click()}),t.on("oump_subtitle",function(){var e={};t.get("showCaptions")?(e.srclang="none",t.set("showCaptions",!1)):(e.srclang=t.get("tracksSubtitles")[0].srclang,e.label=t.get("tracksSubtitles")[0].label,t.set("showCaptions",e.srclang)),t.trigger("oumpCaptionChange",e),t.trigger("oumpUpdateCaptionUI",e.srclang!=="none")}),t.on("oump_nextsubtitle",function(){if(t.get("showCaptions")){var e={},n=t.get("tracksSubtitles");if(n.length<2)return;for(var r=0,i=n.length;r<i;r++)if(n[r].srclang===t.get("showCaptions")){r+1<i?(e.srclang=n[r+1].srclang,e.label=n[r+1].label):(e.srclang=n[0].srclang,e.label=n[0].label);break}t.set("showCaptions",e.srclang),t.trigger("oumpCaptionChange",e)}}),oump.ismobile&&(e("#"+u+" .omp-controlbar").addClass("omp-mobile"),e("#"+u).delegate(".omp-audio-background, .omp-audio-playicon, .omp-audio-poster-default, .omp-audio-playicon-minimal","click",function(){h.click(),e("#"+u+"_video_lenghth").addClass("omp-hidden")}),oump.isios&&(t.trigger("oumpVolumeChange",1),t.trigger("oumpUpdateVolumeChangeUI",1),e("#"+u+"_p_volume_control").addClass("omp-hidden"),e("#"+u+"_m_mute").removeClass("omp-btn omp-mute")))}}});return u}),define("app/views/video_html5",["jquery","jquery","underscore","backbone","app/tpl"],function(e,t,n,r,i){"use strict";var s=r.View.extend({template:i.tplVideoHTML5,render:function(){this.model.set("videolength",this.model.get("videolength")||"");var e=n.template(this.template),t=e(this.model.toJSON());return this.$el.html(t),this}});return s}),define("app/views/audio_html5",["jquery","jquery","underscore","backbone","app/tpl","app/helpers/utilities"],function(e,t,n,r,i,s){"use strict";var o=r.View.extend({template:i.tplAudioHTML5,initialize:function(){e(window).on("resize",this.updatePosterSize.bind(this))},render:function(){var e=n.template(this.template);this.model.set("videolength",this.model.get("videolength")||"");var t=this.model.toJSON();t.isMinimal=this.model.checkHasFeature("minimal")&&!oump.isphone;var r=e(t);return this.$el.html(r),this},showPoster:function(){var t=this.model.id,n=this.model.checkHasFeature("poster");this.$img=e("#"+t+"_media_wrapper .omp-audio-poster-default").toggleClass("omp-hidden",!n),this.$defaultBg=e("#"+t+"_media_wrapper .omp-audio-background").toggleClass("omp-hidden",n),this.$el=e("#"+this.model.get("id")),this.$img.error(this.onErrorImg.bind(this)),this.updatePosterSize()},onErrorImg:function(){this.$img.addClass("omp-hidden"),this.$defaultBg.removeClass("omp-hidden"),this.model.get("features").hasPoster=!1,this.updatePosterSize()},updatePosterSize:function(){var e=this.model.get("ratio"),t=this.model.checkHasFeature("minimal")&&!oump.isphone;e=parseFloat(e),e=t?e*.3:e,e>0?oump.isphone?this.$defaultBg.height("100px"):this.$defaultBg.height(this.$defaultBg.width()*e):this.$img.css("height","auto !important")}});return o}),define("app/views/cue_view",["jquery","backbone","underscore","app/models/cue","app/helpers/utilities"],function(e,t,n,r,i){"use strict";var s=t.View.extend({className:"text-description",css:{top:0,left:0,width:"",height:"",padding:"5px",color:"black",font:"14px Arial, serif",opacity:1,"background-color":"rgba(140, 207, 226, 0.8)"},events:{},initialize:function(e){this.cue=e.cue,this.labels=e.labels?e.labels:null,this.listenTo(this.cue,"change:isActive",this.update);var t={};try{t=JSON.parse(this.cue.get("cueId"))}catch(r){}if(t.opacity){var s=parseInt(t.opacity.replace("%",""));t.opacity=s/100}this.css=n.extend({},this.css,t),this.cue.set("text",i.removeSimpleXSS(this.cue.get("text")))},update:function(){this.cue.get("isActive")?this.render():this.close()},render:function(){var e=this;return this.$el.html(this.cue.get("text")),this.labels&&e.$el.attr("title",e.labels.textDescription),this.$el.attr("id",this.cue.cid+"_text_description"),this.$el.css(this.css),this.trigger("cue_view:render",this),this},close:function(){this.trigger("cue_view:close",this),this.$el.remove()},destroy:function(){this.remove()}});return s}),define("app/views/track_view",["jquery","backbone","underscore"],function(e,t,n){"use strict";var r=t.View.extend({events:{},cueViews:{},initialize:function(e){this.track=e.track,this.cueViewClass=e.cueViewClass,this.labels=e.labels?e.labels:null,this.dataModel=e.hasOwnProperty("dataModel")?e.dataModel:null,this.initCueView()},render:function(e){var t;n.each(this.track.get("cues"),function(n){t=n.get("startTime")<=e&&n.get("endTime")>=e,n.set("isActive",t)})},initCueView:function(){var e=this.cueViewClass;n.each(this.track.get("cues"),function(t){this.cueViews[t.cid]=new e({cue:t,dataModel:this.dataModel,labels:this.labels}),this.listenTo(this.cueViews[t.cid],"cue_view:render",this.onRender),this.listenTo(this.cueViews[t.cid],"cue_view:close",this.onCloseACue)},this)},onCloseACue:function(e){this.trigger("track_view:cue_view:close_a_cue",e)},onRender:function(e){this.trigger("track_view:cue_view:render",e)},resetCues:function(){n.each(this.track.get("cues"),function(e){e.set("isActive",!1)},this)},destroy:function(){this.remove()},remove:function(){this.resetCues(),n.each(this.track.get("cues"),function(e){this.cueViews[e.cid]&&this.cueViews[e.cid].destroy(),this.cueViews[e.cid]=void 0},this)}});return r}),define("app/helpers/hook/text_description_hook",["backbone","underscore","app/models/track","app/views/cue_view","app/views/track_view","app/helpers/utilities","app/models/cue"],function(e,t,n,r,i,s,o){"use strict";var u=function(e){this.dataModel=e._dataModel,this.trackName="tracksDescriptions",this.activeProp="textDescriptionActive",this.$button=$("#"+this.dataModel.id+"_f_td"),this.init(e),this.loadTracks(),this.updateTracks()};return u.prototype=t.extend(u.prototype,e.Events),u.prototype=t.extend(u.prototype,{init:function(e){this.isActive=this.dataModel.get(this.activeProp),this.listenTo(this.dataModel,"change:"+this.activeProp,this.toggleActive),this.$video=$(e._playerObject),this.$video.normalSize={width:0,height:0},this.descriptionActiveCues={},this.listenTo(this.dataModel,"change:isFullscreen",this.onResize.bind(this)),this.trackList=s.createTrackListFromRawTracks(this.dataModel.get(this.trackName)),this.update()},loadTrackByLang:function(e,t){var n=this,r=this.trackList.findWhere({srcLang:e});if(!r){console.log("Can not find any track in "+e);var i=s.getDefaultLangFromTrack(this.dataModel,this.trackList),r=this.trackList.findWhere({srcLang:i});if(!r){console.log("Can not find any track ");return}}if(r.get("isLoaded"))return t(null,r);this.showLoading(),s.initTrackFromSrc(this.trackList.models,r,function(e,i){return n.closeLoading(),e?t(e,null):t(null,r)})},showLoading:function(){},closeLoading:function(){},showTrackView:function(){if(!this.isActive)return;var e=this.dataModel.get("activeLanguage"),t=this;!this.trackView||this.trackView.track.get("srcLang")!==e?this.loadTrackByLang(e,function(e,n){if(e)return console.log("Error",e);t.createTrackView(n),t.trackView.render(t.$video[0].currentTime)}):this.trackView.render(this.$video[0].currentTime)},createTrackView:function(e){this.destroyTrackView(),this.trackView=new i({track:e,cueViewClass:r,labels:this.dataModel.get("labels")}),this.listenTo(this.trackView,"track_view:cue_view:render",this.addView),this.listenTo(this.trackView,"track_view:cue_view:close_a_cue",this.closeACue)},destroyTrackView:function(){this.trackView&&t.isFunction(this.trackView.destroy)&&this.trackView.destroy(),this.trackView=void 0},closeTrackView:function(){this.trackView&&t.isFunction(this.trackView.close)&&this.trackView.close()},closeACue:function(e){delete this.descriptionActiveCues[e.cid]},updateView:function(e){var n=$("#"+this.dataModel.id+"_media_wrapper"),r=function(e){var t={width:this.$video.outerWidth(),height:this.$video.outerHeight()},r=this.$video.offset();this.dataModel.get("type")=="audio"&&(t={width:n.width(),height:n.height()},r=n.offset());if(r&&r.left==r.top&&r.top==0){var i={width:$(window).width(),height:$(window).height()},s=i.height/i.width,o=this.$video.normalSize.height/this.$video.normalSize.width;this.$video.normalSize.width!=0&&s!=o&&(s>o?(t={width:i.width,height:i.width*o},r={left:0,top:(i.height-t.height)/2}):(t={width:i.height/o,height:i.height},r={left:(i.width-t.width)/2,top:0}))}var u={width:parseInt(e.css.width,10),height:parseInt(e.css.height,10)},a={width:t.width*u.width/100,height:t.height*u.height/100},f={left:parseInt(e.css.left,10),top:parseInt(e.css.top,10)};if(r){var l={left:r.left+t.width*f.left/100,top:r.top+t.height*f.top/100};e.$el.outerHeight(a.height),e.$el.outerWidth(a.width),e.$el.offset(l)}};arguments.length==1?r.call(this,e):t.each(this.descriptionActiveCues,function(e){r.call(this,e)},this)},updatecss:function(e){var n=$("#"+this.dataModel.id+"_media_wrapper"),r=function(e){var t=$(window).width(),r={width:this.$video.outerWidth(),height:this.$video.outerHeight()};this.dataModel.get("type")=="audio"&&(r={width:n.width(),height:n.height()});var i={width:$(window).width(),height:$(window).height()},s="",o=parseInt(e.css["font-size"])?parseInt(e.css["font-size"]):parseInt(e.css.font.substring(0,4)),u=i.height/i.width,a=this.$video.normalSize.height/this.$video.normalSize.width;this.$video.normalSize.width!=0&&u!=a&&(u>a?(s=o/u,s=s>o?o:s):s=o),this.updatecssTextdescription(n,s,e),this.updatecssAnotation(n,s,e)};arguments.length==1?r.call(this,e):t.each(this.descriptionActiveCues,function(e){r.call(this,e)},this)},updatecssTextdescription:function(e,t,n){var r=e.find(".text-description").outerWidth();t&&r&&(e.find(".text-description").css("font-size",t),e.find(".text-description a").css("font-size",t));var i=parseInt(n.css.width);if(i){var s=e.find(".text-description").outerWidth();e.find(".text-description img").css("width",s*.85)}},updatecssAnotation:function(e,t,n){var r=e.find(".omp-fd-annotation").outerWidth();t&&r&&(e.find(".omp-fd-annotation").css("font-size",t),e.find(".omp-fd-annotation a").css("font-size",t));var i=parseInt(n.css.width);if(i){var s=e.find(".omp-fd-annotation").outerWidth();e.find(".omp-fd-annotation img").css("width",s*.85)}},addView:function(e){this.descriptionActiveCues[e.cid]=e,this.$video.parent().append(e.$el),this.updateView(e)},toggleActive:function(){this.isActive=this.dataModel.get(this.activeProp),this.update()},toggleActiveUI:function(){this.$button.attr("omp-settings-toogle",this.isActive)},update:function(){this.isActive?(this.showTrackView(),this.$video.on("timeupdate."+this.activeProp,$.proxy(this.onVideoTimeUpdate,this)),this.listenTo(this.dataModel,"change:activeLanguage",this.onLanguageChange),$(window).resize(this.onResize.bind(this))):(this.$video.off("timeupdate."+this.activeProp),this.stopListening(this.dataModel,"change:activeLanguage"),this.destroyTrackView(),$(window).off("resize",this.onResize.bind(this))),this.toggleActiveUI()},onResize:function(){this.isActive&&(this.updateView(),this.updatecss())},onLanguageChange:function(){this.showTrackView()},onVideoTimeUpdate:function(e){this.$video.normalSize.width==0&&(this.$video.normalSize={width:this.$video.width(),height:this.$video.height()},this.updateView());var t=e.target.currentTime;this.trackView&&this.trackView.render(t)},loadTracks:function(){var e=this;this.dataModel.on("oump_load_tracks_textdescriptions",function(){var t=e.dataModel.get("activeLanguage"),n=e.trackList.findWhere({srcLang:t}),r=e.dataModel.get("apiTrackOptions"),i="";n&&n.get("cues").length>0&&(i=s.getVttContent(n.get("cues"))),$("#"+r.id).val(i)})},updateTracks:function(){var e=this,n=e.dataModel.get("apiOptions");e.trackList=s.createTrackListFromCustomTracks(e.trackList,n,"transcripts"),this.dataModel.on("oump_set_tracks_textdescriptions",function(){var n=e.dataModel.get("activeLanguage"),r=e.trackList.findWhere({srcLang:n}),i=e.dataModel.get("apiTrackOptions"),u=[];if(r&&i.id!=undefined){var a=$("#"+i.id).val();if(a)var u=s.vttParser(a);if(u.length>0){var f=t.map(u,function(e,t){var n=e.get("cueId"),r=e.get("startTime"),i=e.get("endTime"),s=e.get("text");return new o({startTime:r,endTime:i,text:s,cueId:n})});$(".text-description").remove(),r.set("cues",f),e.createTrackView(r),e.trackView.render(e.$video[0].currentTime)}}})}}),u}),define("text!app/tpl/controls/transcript_content.html",[],function(){return'<div id="<%= id %>_video_transcript_track_<%= lang %>" data-lang="en" data-type="transcript-track">\n</div>'}),define("text!app/tpl/controls/transcript_content_item.html",[],function(){return'<button class="transcript-text" cueindex="<%= cueId - 1 %>" data-start-int="<%= startTime %>" tabindex="<%= tabs.transcripts %>">\n    <span data-type="transcript-text" class="ListTran">\n        <% if(showTime == \'true\') { %>\n            <%= toHHMMSS(startTime) %><br/>\n        <% } %>\n        <%= text %><br/>\n    </span>\n</button>'}),define("app/views/transcript_content_item_view",["jquery","backbone","underscore","text!app/tpl/controls/transcript_content_item.html","app/helpers/utilities"],function(e,t,n,r,i){"use strict";return t.View.extend({initialize:function(e){this.item=e.item,this.item.tabs=e.tabs,this.dataModel=e.dataModel},className:"omp-transcript-item",tagName:"p",events:{"click .transcript-text":"onClick","focusin .transcript-text":"scrollToItem"},render:function(){n.extend(this.item,i);var e=this.dataModel.get("timing")!=undefined?this.dataModel.get("timing"):"true";this.item.showTime=e;var t=n.template(r)(this.item);return this.$el.html(t),this},onClick:function(){this.trigger("transcript_item_view:click",this),this.dataModel.trigger("transcript_clicked")},hideItem:function(){this.$el.find("span").removeClass("active")},showItem:function(){this.$el.find("span").addClass("active")},scrollToItem:function(){var e=this.$el.find("span"),t=this.$el.parent();if(e.position()!=undefined){var n=t.scrollTop(),r=e.offset().top,i=t.offset().top;setTimeout(function(){t.scrollTop(n+r-i-30)},300)}}})}),define("app/views/transcript_content_view",["jquery","backbone","underscore","text!app/tpl/controls/transcript_content.html","app/views/transcript_content_item_view"],function(e,t,n,r,i){"use strict";return t.View.extend({initialize:function(e){this._dataModel=e.model,this._playerObject=e.playerObject,this._lang=e.lang,this.content=e.content,this.contentType=e.contentType,this._view=[],this._activeTranscripts=[],this._nextTranscript=[]},render:function(){switch(this.contentType){case"track":this.renderTrack();break;default:this.renderOtherFormat()}return this},renderOtherFormat:function(){return this.$el.addClass("omp-transcript-normal-content"),this.$el.html(this.content),this},renderTrack:function(){var e=this._cues=this.cueToJSON(n.clone(this.content.get("cues"))),t=n.template(r)({id:this._dataModel.id,lang:this._lang}),s;return this.setElement(t),s=this.$el,n.each(e,function(e,t){this._view[t]=new i({item:e,tabs:this._dataModel.get("tabs"),dataModel:this._dataModel}),s.append(this._view[t].render().$el),this.listenTo(this._view[t],"transcript_item_view:click",this.onItemClick)},this),this._dataModel.get("disableTranscript")==1&&s.children().css("pointer-events","none"),this},cueToJSON:function(e){var t,n=e.length;for(t=0;t<n;t++)e[t]=e[t].toJSON();return e},hide:function(){this.$el.hide(),this.resetTranscript()},show:function(e){this.$el.show(),e&&this.initTranscript()},resetTranscript:function(){var e,t=this._activeTranscripts.length;for(e=0;e<t;e++)this._view[this._activeTranscripts[e].index].hideItem();this._activeTranscripts=[],this._nextTranscript=[]},showNextTranscripts:function(){var e,t=this._nextTranscript.length;for(e=0;e<t;e++)this._view[this._nextTranscript[e].index].showItem()},showActiveTranscripts:function(){var e,t=this._activeTranscripts.length;for(e=0;e<t;e++)this._view[this._activeTranscripts[e].index].showItem();this.scrollToTranscript(this._activeTranscripts[0])},scrollToTranscript:function(e){typeof e!="undefined"&&(this._view[e.index].scrollToItem(),this._view[e.index].showItem())},isInActive:function(e,t){return this._activeTranscripts[e].end>=t},scrollToMedia:function(){var t;t=e("#"+this._dataModel.id+" .omp-media-wrapper"),e("html, body").animate({scrollTop:t.offset().top-100},1e3)},computeActiveTranscripts:function(e){var t=this._playerObject.currentTime,n=this._cues.length;while(e<n&&this._cues[e].startTime<=t+.2)t<=this._cues[e].endTime+.2&&(this.addNewActiveTranscript(e),this._view[e].showItem()),e++;return e},computeNextTranscripts:function(e){this._nextTranscript=[];var t=this._cues?this._cues.length:0;if(e>=t)return;var n=this._cues[e].startTime,t=this._cues.length;while(e<t&&this._cues[e].startTime<=n+.2)this._nextTranscript.push({index:e,start:this._cues[e].startTime,end:this._cues[e].endTime}),e++},computeTranscript:function(e){var t=this.computeActiveTranscripts(e);this.computeNextTranscripts(t)},updateOnTime:function(){var e=this._playerObject.currentTime;this.removeOutOfTimeTranscripts(),this._nextTranscript.length>0&&e>=this._nextTranscript[0].start&&(this.showNextTranscripts(),this.scrollToTranscript(this._nextTranscript[0]),this.addNextToActiveTranscripts())},onItemClick:function(e){var t=e.$el.children(".transcript-text"),n=t.attr("data-start-int"),r=t.attr("cueindex");n>=this._playerObject.duration&&(n=this._dataModel.get("duration"),r=this._cues.length-1),this._dataModel.trigger("oumpSeeking",n),this.initTranscript(r),this.scrollToMedia()},initTranscript:function(e){e=typeof e=="undefined"?0:parseInt(e),this.resetTranscript(),this.computeTranscript(e),this.showActiveTranscripts()},addNextToActiveTranscripts:function(){this._activeTranscripts=this._activeTranscripts.concat(this._nextTranscript);var e=this._nextTranscript[this._nextTranscript.length-1].index+1;this.computeNextTranscripts(e)},addNewActiveTranscript:function(e){this._activeTranscripts.push({start:this._cues[e].startTime,end:this._cues[e].endTime,index:e})},removeOutOfTimeTranscripts:function(){var e=this._playerObject.currentTime,t,n=this._activeTranscripts.length;for(t=0;t<n;t++){if(!this._activeTranscripts[t]){this.removeActiveTranscript(t);continue}this.isInActive(t,e)||(this._view[this._activeTranscripts[t].index].hideItem(),this.removeActiveTranscript(t))}},removeActiveTranscript:function(e){delete this._activeTranscripts.splice(e,1)},remove:function(){n.each(this._view,function(e,t){this._view[t].remove()},this)}})}),define("text!app/tpl/controls/transcript.html",[],function(){return'<div class="omp-feature-header omp-header">\n    <div class="omp-feature-title">\n        <!--<span class="omp-chapters-close"  id="<%= id %>_fd_t_close"></span>-->\n        <label><%= labels.transcript %></label>\n        <!--<i class="omp-toggle-button up-toggle"></i>-->\n    </div>\n</div>\n<div class="omp-feature-subheader">\n    <%  if (player == \'html5\') { %>\n    <div id="<%= id %>_t_interactive_mode" omp-settings-toogle="true" class="omp-interactive-toogle omp-hidden">\n        <div class="omp-description-toggle-checkbox" >\n            <button class="on" title="<%= labels.interactiveModeOn %>"\n                    aria-label="<%= labels.interactiveModeOn %>"\n                    tabindex="<%= tabs.transcripts %>"><%= labels.on %></button>\n            <button class="off" title="<%= labels.interactiveModeOff %>"\n                    aria-label="<%= labels.interactiveModeOff %>"\n                    tabindex="<%= tabs.transcripts %>"><%= labels.off %></button>\n            <span class="interactive-text"><%= labels.interactive %></span>\n        </div>\n    </div>\n    <% } %>\n    <%  if (!oump.ismobile) { %>\n    <div id="<%= id %>_transcript_options"  class="omp-transcript-options omp-hidden">\n        <button aria-label="<%= labels.printClick %>"\n                tabindex="<%= tabs.transcripts %>" id="<%= id %>_fd_t_print"\n            class="omp-print-button fixed-right-title" href="javascript:void(0)"\n            role="button"\n            title="<%= labels.printClick %>">\n            <span class="print-text"><%= labels.print %></span>\n        </button>\n        <button  aria-label="<%= labels.copyClick %>"\n                 tabindex="<%= tabs.transcripts %>" id="<%= id %>_fd_t_copy"\n            class="omp-copy-button fixed-right-title" href="javascript:void(0)" role="button"\n            title="<%= labels.copyClick %>">\n            <span class="copy-text"><%= labels.copy %></span>\n        </button>\n    </div>\n    <% } %>\n</div>\n\n<div id="<%= id %>_fd_t_contents" class="omp-transcript-contents omp-feature-content">\n</div>'}),function(e,t){typeof define=="function"&&define.amd?define("download",[],t):typeof exports=="object"?module.exports=t():e.download=t()}(this,function(){return function e(t,n,r){function g(e){var t=e.split(/[:;,]/),n=t[1],r=t[2]=="base64"?atob:decodeURIComponent,i=r(t.pop()),s=i.length,o=0,u=new Uint8Array(s);for(o;o<s;++o)u[o]=i.charCodeAt(o);return new h([u],{type:n})}function y(e,t){if("download"in l)return l.href=e,l.setAttribute("download",p),l.className="download-js-link",l.innerHTML="downloading...",f.body.appendChild(l),setTimeout(function(){l.click(),f.body.removeChild(l),t===!0&&setTimeout(function(){i.URL.revokeObjectURL(l.href)},250)},66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return e=e.replace(/^data:([\w\/\-\+]+)/,s),window.open(e)||confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=e),!0;var n=f.createElement("iframe");f.body.appendChild(n),t||(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,s)),n.src=e,setTimeout(function(){f.body.removeChild(n)},333)}var i=window,s="application/octet-stream",o=r||s,u=t,a=!n&&!r&&u,f=document,l=f.createElement("a"),c=function(e){return String(e)},h=i.Blob||i.MozBlob||i.WebKitBlob||c,p=n||"download",d,v,m;h=h.call?h.bind(i):Blob,String(this)==="true"&&(u=[u,o],o=u[0],u=u[1]);if(a&&a.length<2048){p=a.split("/").pop().split("?")[0],l.href=a;if(l.href.indexOf(a)!==-1){var m=new XMLHttpRequest;return m.open("GET",a,!0),m.responseType="blob",m.onload=function(t){e(t.target.response,p,s)},m.send(),m}}if(/^data\:[\w+\-]+\/[\w+\-]+[,;]/.test(u))return navigator.msSaveBlob?navigator.msSaveBlob(g(u),p):y(u);d=u instanceof h?u:new h([u],{type:o});if(navigator.msSaveBlob)return navigator.msSaveBlob(d,p);if(i.URL)y(i.URL.createObjectURL(d),!0);else{if(typeof d=="string"||d.constructor===c)try{return y("data:"+o+";base64,"+i.btoa(d))}catch(b){return y("data:"+o+","+encodeURIComponent(d))}v=new FileReader,v.onload=function(e){y(this.result)},v.readAsDataURL(d)}return!0}}),define("app/views/transcript_view",["jquery","backbone","underscore","text!app/tpl/controls/transcript.html","download","app/helpers/utilities"],function(e,t,n,r,i,s){"use strict";var o="This transcript has been copied to the clipboard. You can now paste it into another application.",u="This browser does not allow direct access to the clipboard.";return t.View.extend({events:{"click .omp-interactive-toogle .on":"onToggleOn","click .omp-interactive-toogle .off":"onToggleOff","click .omp-print-button":"onPrint","click .omp-copy-button":"onCopy","change .omp-transcript-download-options select":"onDownloadTranscript"},initialize:function(e){this.dataModel=e.dataModel,this.mid=this.dataModel.id,this.dataModel.on("activeFeatureMode",function(e){if(!this.dataModel.get("transcriptActive"))return;var t=e[0],n=e[1];t=="transcript"&&(n?this.onToggleOn():this.onToggleOff())}.bind(this))},render:function(){e("#"+this.dataModel.id+"_f_transcript_max").parent().hasClass("omp-hidden")&&e("#"+this.dataModel.id+"_f_tr_max").parent().hasClass("omp-hidden")&&(this.dataModel.get("tabs").transcripts+=100);var t=this.dataModel.toJSON();t.typeLabel={html:"HTML",word:"MS Word",text:"Plain text",pdf:"PDF","text/vtt":"Metadata"};var i=n.template(r)(t);return this.$el.html(i),e("#"+this.mid+"_fd_t").empty(),e("#"+this.mid+"_fd_t").append(this.$el),this},onToggleOn:function(){this.$el.find(".omp-interactive-toogle").attr("omp-settings-toogle",!0),e("#"+this.mid+"_fd_t_contents").children().children().css("pointer-events","auto"),this.trigger("toggleMode",!0),this.dataModel.trigger("transcript_interactive_enabled")},onToggleOff:function(){this.$el.find(".omp-interactive-toogle").attr("omp-settings-toogle",!1),e("#"+this.mid+"_fd_t_contents").children().children().css("pointer-events","none"),this.trigger("toggleMode",!1),this.dataModel.trigger("transcript_interactive_disabled")},onDownloadTranscript:function(t){var n=e(t.target).val(),r=this.dataModel.get("activeLanguage"),o;if(n!="none"){o=this.dataModel.get("transcripts")[n][r];if(oump.browser=="msie")i(s.getAbsoluteSrc(window.location.href,o));else{var u=e("#"+this.mid+"_fd_t_download");u.attr("href",o),u.get(0).click()}}e("#"+this.mid+'_fd_t_download_selector option[value="none"]').prop("selected",!0)},toggleModeUI:function(e){this.$el.find(".omp-interactive-toogle").toggleClass("omp-hidden",!e)},onPrint:function(){var t=window.open(),n=e("#"+this.mid+"_fd_t_contents").html();n=n.replace(/button/ig,"div");var r=this.dataModel.get("playerState");return r=="play"&&e("#"+this.mid+"_m_playpause").click(),e(t.document.body).html(n),t.document.close(),t.focus(),t.print(),this.dataModel.trigger("transcript_print"),!1},onCopy:function(){var t="",n=e("#"+this.mid+"_fd_t_contents").find(".omp-transcript-normal-content");n.length>0?n.each(function(){e(this).css("display")!="none"&&(t+=e(this).html())}):e("#"+this.mid+"_fd_t_contents").find("div").each(function(){e(this).css("display")!="none"&&(t+=e(this).html())}),t=t.replace(/(<([^>]+)>)/ig,""),t=t.trim(),this.dataModel.trigger("transcript_copy");if(window.clipboardData)window.clipboardData.setData("Text",t);else{var r=e("<textarea>");r.css({position:"absolute",left:"-1000px",top:"-1000px"}),r.text(t),e("body").append(r),r.select();try{document.execCommand("copy",!1,null)}catch(i){}r.remove()}return oump.ismobile&&oump.isios?alert(u):alert(o),!1}})}),define("app/helpers/hook/transcript_hook",["backbone","jquery","underscore","app/models/track","app/collections/tracks","app/helpers/utilities","app/views/transcript_content_view","app/views/transcript_view","app/views/loading_view","app/models/cue"],function(e,t,n,r,i,s,o,u,a,f){"use strict";var l=function(e){this.dataModel=e._dataModel,this.playerObject=e._playerObject,this.isActive=this.dataModel.get("transcriptActive"),this.isModeOn=!0,this._activeLang=this.dataModel.get("activeLanguage"),this.mid=this.dataModel.id,this.init(),this.loadTracks(),this.updateTracks()};return l.prototype=n.extend(l.prototype,e.Events),l.prototype=n.extend(l.prototype,{init:function(){this.destroyView(),this.normalList=this.dataModel.get("transcripts"),this.trackList=s.createTrackListFromRawTracks(this.dataModel.get("tracksTranscripts")),this.transcriptView=new u({dataModel:this.dataModel}),this.transcriptView.render(),this.listenTo(this.dataModel,"change:activeLanguage",this.changeTranscriptLanguage),this.listenTo(this.dataModel,"change:transcriptActive",this.toggleActive),this.listenTo(this.transcriptView,"toggleMode",this.toggleMode)},addTranscript:function(e){var t=this.dataModel.get("activeLanguage");this.createLoadingView(),this.loadTranscriptByLang(t,this.createTranscriptContent.bind(this),"track")},loadTranscriptByLang:function(e,t,n){var r=this,i=this.trackList.findWhere({srcLang:e});if(!i){var e=s.getDefaultLangFromTrack(this.dataModel,this.trackList,"transcripts"),i=this.trackList.findWhere({srcLang:e});if(!i){console.log("Can not find any transcript in vtt - start load with html... "),n=="track"&&this.loadTranscriptByHtml();return}}i.get("isLoaded")?t(i,e,"track"):s.initTrackFromSrc(this.trackList.models,i,function(r,i){return r?t(null):t(i,e,n)})},loadTranscriptByHtml:function(){var e=this,t=this.dataModel.get("transcripts"),n=t!=undefined&&t&&t["html"]!=undefined?Object.keys(t.html).length:0;if(n>0){this.trackList=this.createTrackListFromRawTracks(this.dataModel.get("tracksTranscripts"));var r=this.dataModel.get("activeLanguage"),i=this.trackList.findWhere({srcLang:r});if(!i){var r=s.getDefaultLangFromTrack(this.dataModel,this.trackList,"transcripts"),i=this.trackList.findWhere({srcLang:r});i||(console.log("Can not find any transcript in html"),callback(null,r,"html"))}i.get("isLoaded")?callback(i,r,"html"):this.initTrackFromSrc(this.trackList.models,i,function(t,n,r){e.createTranscriptContent(r,n,"html")})}else this.createLoadingView("error"),this.dataModel.trigger("transcript_invalid")},createTranscriptContent:function(e,n,r){if(!e&&r=="track"){this.loadTranscriptByHtml();return}if(!e)this.createLoadingView("error"),this.dataModel.trigger("transcript_invalid");else{this.transcriptContentView&&this.transcriptContentView.remove(),this.transcriptContentView=new o({model:this.dataModel,playerObject:this.playerObject,content:e,lang:n,contentType:r});var i=this.transcriptContentView.render().$el,s=t("#"+this.mid+"_fd_t_contents");s.append(i),s.find(".filter_transcript_box").length>0?s.find(".filter_transcript_box").attr("tabindex",this.dataModel.get("tabs").transcripts):s.find(".omp-transcript-normal-content").attr("tabindex",this.dataModel.get("tabs").transcripts),this.showTranscripView(n)}},callFunction:function(e,t){this.transcriptContentView&&this.transcriptContentView[e](t)},toggleMode:function(e){this.isModeOn=e,e?this.createTranscriptEvent():this.destroyTranscriptEvent()},showTranscripView:function(e){this.transcriptContentView?(this._activeLang=e,this.toggleMode(this.transcriptContentView.contentType=="track"&&this.isModeOn),this.transcriptView.toggleModeUI(this.transcriptContentView.contentType=="track"),this.callFunction("show",this.isModeOn),t("#"+this.mid+"_transcript_options").removeClass("omp-hidden"),this.destroyLoadingView()):this.addTranscript(e)},hideTranscripView:function(){var e=this.isModeOn;this.callFunction("hide"),this.toggleMode(!1),this.isModeOn=e},destroyView:function(){this.transcriptContentView&&this.transcriptContentView.remove()},changeTranscriptLanguage:function(){this.hideTranscripView(),this.createLoadingView("loading");var e=this.dataModel.get("activeLanguage");this.addTranscript(e)},toggleActive:function(){this.isActive=this.dataModel.get("transcriptActive");var e=t("#"+this.mid+" .omp-transcript-setting");e.attr("omp-settings-toogle",this.isActive),t("#"+this.mid+"_fd_t").toggleClass("omp-hidden"),this.update()},destroyTranscriptEvent:function(){t(this.playerObject).off("timeupdate.transcript"),this.stopListening(this.dataModel,"change:isPlayerStop"),this.stopListening(this.dataModel,"change:isDrag"),this.stopListening(this.dataModel,"change:seekTime"),this.callFunction("resetTranscript")},createTranscriptEvent:function(){var e=this;this.listenTo(this.dataModel,"change:seekTime",function(){e.callFunction("initTranscript")}),t(this.playerObject).on("timeupdate.transcript",function(){Math.floor(this.currentTime)==0&&e.callFunction("initTranscript"),e.callFunction("updateOnTime")}),this.callFunction("initTranscript")},update:function(){this.isActive?this.showTranscripView(this._activeLang):this.hideTranscripView()},destroyLoadingView:function(){t(".loading_content").remove()},createLoadingView:function(e){var n=this;t(".loading_content").remove(),this.loadingView=new a({dataModel:this.dataModel,type:"transcripts"});var r=this.loadingView.render(e).$el;t("#"+this.mid+"_fd_t_contents").append(r)},createTrackListFromRawTracks:function(e){var t=[];return n.each(e,function(e,n){e.type=="html"&&t.push(e)}),new i(n.map(t,function(e){var t=e.label.replace(/ /g,"_");return t=t.toLowerCase(),new r({isDefault:e.isDefaultTrack,kind:e.kind,label:e.label,customLabel:t,src:e.src,srcLang:e.srclang.toLowerCase(),type:e.type})}))},initTrackFromSrc:function(e,t,r){var i=this,o=t.get("src"),u=t.get("kind"),a=t.get("srcLang"),f=t.get("label"),l=[],c=null;s.loadNormalContentFromSrc(o,function(t){if(t)return r(null,a,t);var u=n.filter(e,function(e){return e.get("src")!=o&&e.get("srcLang")=="en"?o:null}),f=n.filter(e,function(e){return e.get("src")!=o&&e.get("srcLang")!="en"?o:null});s.mergeByProperty(u,f,"cid");if(u.length>0){var c=u[0];l=u}else if(u.length>0){var c=f[0];l=f}else l=[];if(!(l.length>0&&c))return r(null,a,null);i.initTrackFromSrc(l,c,r)})},updateTranscriptContent:function(e,n,r){if(!e)this.createLoadingView("error"),this.dataModel.trigger("transcript_invalid");else{t("#"+this.dataModel.get("id")+"_video_transcript_track_"+n).remove(),this.transcriptContentView[n]=new o({model:this.dataModel,playerObject:this.playerObject,content:e,lang:n,contentType:r});var i=this.transcriptContentView[n].render().$el;t("#"+this.mid+"_fd_t_contents").append(i),this.showTranscripView(n)}},loadTracks:function(){var e=this;this.dataModel.on("oump_load_tracks_transcripts",function(){var n=e.dataModel.get("activeLanguage"),r=e.trackList.findWhere({srcLang:n}),i=e.dataModel.get("apiTrackOptions"),o="";r&&r.get("cues").length>0&&(o=s.getVttContent(r.get("cues"))),t("#"+i.id).val(o)})},updateTracks:function(){var e=this,r=e.dataModel.get("apiOptions");e.trackList=s.createTrackListFromCustomTracks(e.trackList,r,"transcripts"),this.dataModel.on("oump_set_tracks_transcripts",function(){var r=e.dataModel.get("activeLanguage"),i=e.trackList.findWhere({srcLang:r}),o=e.dataModel.get("apiTrackOptions"),u=[];if(i&&o.id!=undefined){var a=t("#"+o.id).val();if(a)var u=s.vttParser(a);if(u.length>0){var l=n.map(u,function(e,t){var n=e.get("cueId"),r=e.get("startTime"),i=e.get("endTime"),s=e.get("text");return new f({startTime:r,endTime:i,text:s,cueId:n})});i.set("cues",l),e.updateTranscriptContent(i,r,"track")}}})}}),l}),define("text!app/tpl/controls/chapter.html",[],function(){return'<div class="omp-feature-header omp-header">\n    <!--<span class="omp-chapters-close"  id="<%= id %>_fd_c_close"></span>-->\n    <label><%= labels.chapters %></label>\n    <!--<i class="omp-toggle-button"></i>-->\n</div>\n\n<div class="omp-feature-subheader">\n    <div class="omp-feature-title">\n        <!--duynguyenp: Change select dropdowm to custom select div tag-->\n        <div id="<%= id %>_fd_t_chapter_selector" class="omp-dd-chapter-container">\n            <div class="omp-chapter-header" id="<%= id %>_chapter_header">\n                <div class="omp-selected-item" id="<%= id %>_chapter_selected_item"></div>\n                <button class="omp-chapter-button omp-select-button" tabindex="<%= tabs.chapters %>"\n                        title="<%= labels.chaptersClick %>"\n                        aria-label="<%= labels.chaptersClick %>"></button>\n                <% if(oump.isepub != undefined && oump.isepub ) { %>\n                <div style="float: right; margin-top: -25px">\n                    <button class="omp-chapter-button omp-select-button" tabindex="<%= tabs.chapters %>"\n                            title="<%= labels.chaptersClick %>"\n                            aria-label="<%= labels.chaptersClick %>"></button>\n\n                </div>\n                <% } %>\n            </div>\n            <div class="omp-chapter-list omp-select-list omp-hidden" id="<%= id %>_chapter_list">\n            </div>\n        </div>\n    </div>\n    <%  if (!isEmpty && player == \'html5\') { %>\n    <div class="Intbutton" id="<%= id %>_fd_c_status">\n        <div class="omp-interactive-toogle">\n            <div class="omp-description-toggle-checkbox" omp-settings-toogle="<%= isModeOn %>">\n                <button title="<%= labels.chapterMarkersOn %>" class="on fixed-right-title" tabindex="<%= tabs.chapters %>"\n                        aria-label="<%= labels.chapterMarkersOn %>"><%= labels.on %></button>\n                <button  title="<%= labels.chapterMarkersOff %>" class="off fixed-right-title" tabindex="<%= tabs.chapters %>"\n                         aria-label="<%= labels.chapterMarkersOff %>"><%= labels.off %></button>\n                <span class="interactive-text"><%= labels.chapterMarkers %></span>\n            </div>\n        </div>\n    </div>\n    <% } %>\n    <div class="omp-chapter-blank-space"></div>\n    <%  if (isEmpty) { %>\n    <div class="content_empty">\n        <span class="omp-warning-icon"></span><label class="omp-loading-content"><%= labels.contentUnavailable %></label>\n    </div>\n    <% } else { %>\n    <div class="omp-feature-chapter omp-feature-content" ></div>\n   <% } %>\n\n</div>\n'}),define("text!app/tpl/controls/chapter_item.html",[],function(){return'<div id="content-<%= id %>-<%= startTimeConvert.replace(/(:)/g, \'-\') %>" class="<%= index == 0 ? \'first_chapter\' : \'\' %>" title ="<%= text %>">\n    <button class="omp-chapter-title" tabindex="<%= tabs.chapters %>">\n        <% if (showTime == \'true\') { %>\n            <span id="time-<%= id %>-<%= startTimeConvert.replace(/(:)/g, \'-\') %>"><%= startTimeConvert %></span>\n            <span id="title-<%= id %>-<%= startTimeConvert.replace(/(:)/g, \'-\') %>" class="omp-feature-chapter-title"><%= text %></span>\n        <% } else { %>\n            <span id="title-<%= id %>-<%= startTimeConvert.replace(/(:)/g, \'-\') %>" class=""><%= text %></span>\n        <% } %>\n\n    </button>\n</div>'}),define("app/views/chapter_item_view",["jquery","backbone","underscore","app/helpers/utilities","text!app/tpl/controls/chapter_item.html"],function(e,t,n,r,i){"use strict";var s=t.View.extend({events:{"click .omp-chapter-title ":"onClick","focusin .omp-chapter-title ":"onFocusin"},initialize:function(e){this.dataModel=e.dataModel,this.cue=e.cue,this.index=e.index},render:function(){var e=this.dataModel.get("timing")!=undefined?this.dataModel.get("timing"):"true",t=n.template(i)({startTime:this.cue.get("startTime"),startTimeConvert:r.toHHMMSS(this.cue.get("startTime")),text:r.escapeHtml(this.cue.get("text")),index:this.index,id:this.dataModel.get("id"),tabs:this.dataModel.get("tabs"),showTime:e});return this.$el.html(t),this},onClick:function(){this.dataModel.trigger("oumpSeeking",this.cue.get("startTime")),this.dataModel.trigger("chapter_clicked",this.cue.get("text"))},onFocusin:function(t){var n=e(t.target),r=n.parent().parent().parent();this.dataModel.get("tabActive")&&this.scrollToItem(n,r)},scrollToItem:function(e,t){if(e.position()!=undefined){var n=t.scrollTop(),r=e.offset().top,i=t.offset().top;t.scrollTop(n+r-i-74)}}});return s}),define("text!app/tpl/controls/chapter_marker_item.html",[],function(){return'<span class="<% if (isModeOn) { %>omp-progress-chapter<% } %>" data-type="markers"  style="left: <%= percent %>%" data-start="<%= startTimeConvert %>">\n    <span class="<%= percent > 60 ? \'omp-progress-chapter-title-right\' : \'omp-progress-chapter-title\' %>">\n        <span><%= startTimeConvert %> <%= text %></span>\n    </span>\n</span>'}),define("app/views/chapter_marker_item_view",["jquery","backbone","underscore","app/helpers/utilities","text!app/tpl/controls/chapter_marker_item.html"],function(e,t,n,r,i){"use strict";var s=t.View.extend({events:{click:"onClick"},initialize:function(e){this.dataModel=e.dataModel,this.cue=e.cue,this.isModeOn=e.isModeOn},render:function(){var e=this.cue.get("text"),t=this.cue.get("startTime")/this.dataModel.get("duration")*100;e.length>50&&(e=e.substr(0,50)+"...");var s=this.dataModel.get("timing")==undefined||this.dataModel.get("timing")!="undefined"&&this.dataModel.get("timing")=="true"?r.toHHMMSS(this.cue.get("startTime")):"";if(t>100)var o=null;else var o=n.template(i)({startTime:this.cue.get("startTime"),percent:t,startTimeConvert:s,text:r.escapeHtml(e),isModeOn:this.isModeOn});return this.$el.html(o),this},onClick:function(e){e.stopPropagation(),this.dataModel.trigger("oumpSeeking",this.cue.get("startTime")),this.dataModel.trigger("chapter_clicked",this.cue.get("text"))}});return s}),define("text!app/tpl/controls/chapter_option_item.html",[],function(){return'<% if (currentChapterLabel == key ) { %>\n    <button class="omp-chapter-item omp-st-selected" data-item="<%= key %>"\n        tabindex="<%= tabs.chapters %>"> <%= label %> </button>\n<% }else { %>\n    <button class="omp-chapter-item" data-item="<%= key %>"\n        tabindex="<%= tabs.chapters %>"> <%= label %> </button>\n<% } %>\n'}),define("app/views/chapter_option_item_view",["jquery","backbone","underscore","app/helpers/utilities","text!app/tpl/controls/chapter_option_item.html"],function(e,t,n,r,i){"use strict";var s=t.View.extend({events:{click:"onClick"},initialize:function(e){this.dataModel=e.dataModel,this.label=e.label,this.index=e.index,this.key=e.key},render:function(){var e=n.template(i)({index:this.index,label:this.label,currentChapterLabel:this.dataModel.get("currentChapterLabel"),tabs:this.dataModel.get("tabs"),key:this.key});return this.setElement(e),this},onClick:function(){this.dataModel.set("currentChapterLabel",this.key)}});return s}),define("app/views/chapter_view",["jquery","backbone","underscore","app/helpers/utilities","text!app/tpl/controls/chapter.html","app/views/chapter_item_view","app/views/chapter_marker_item_view","app/views/chapter_option_item_view"],function(e,t,n,r,i,s,o,u){"use strict";var a=t.View.extend({initialize:function(e){this.dataModel=e.dataModel,this.track=e.track},render:function(){var t=this.dataModel.get("id"),r=this.dataModel.get("tracksLabels"),a=this.dataModel.get("currentChapterLabel"),f,l,c,h=this.$el.find(".omp-feature-chapter"),p=e("#"+t+"_p_chapters"),d=e("#"+t+"_chapter_list");if(this.track!=undefined){e("#"+t+" .omp-progress-chapters").html(""),n.each(this.track.get("cues"),function(e,t){f=new o({dataModel:this.dataModel,cue:e,isModeOn:this.isModeOn}),p.append(f.render().$el)},this),n.each(this.track.get("cues"),function(e,t){l=new s({dataModel:this.dataModel,cue:e,index:t}),h.append(l.render().$el)},this);var v=!1}else{var v=!0,m=e("#"+t+" span[data-type=markers]");m.removeClass("omp-progress-chapter")}d.html(""),n.each(r,function(n,r){var i=n.replace(/ /g,"_");i.toLowerCase(),i==a&&(e("#"+t+"_chapter_selected_item").attr("title",n),e("#"+t+"_chapter_selected_item").html(n)),c=new u({dataModel:this.dataModel,label:n,index:r,key:i}),d.append(c.render().$el)},this),e("#"+t+"_f_chapters_max").parent().hasClass("omp-hidden")&&e("#"+t+"_f_ch_max").parent().hasClass("omp-hidden")&&(this.dataModel.get("tabs").chapters+=100);var g=n.template(i)({id:t,isModeOn:this.isModeOn,player:this.dataModel.get("player"),isEmpty:v,tabs:this.dataModel.get("tabs"),labels:this.dataModel.get("labels")});return this.setElement(e(g)),this},initMarkerClick:function(){var t=this,n=t.dataModel.get("id");e("#"+n+" .omp-progress-chapter").each(function(t,r){e(this).click(function(){var t=e(this).data("start").replace(/(:)/g,"-"),r=e(".omp-feature-chapter"),i=e("#content-"+n+"-"+t);e("span").removeClass("active"),e("#time-"+n+"-"+t).addClass("active"),e("#title-"+n+"-"+t).addClass("active"),r.animate({scrollTop:i.offset().top-r.offset().top+r.scrollTop()-120})})})}});return a}),define("app/helpers/hook/chapter_hook",["backbone","underscore","app/models/track","app/helpers/utilities","app/views/chapter_view","app/views/loading_view","app/models/cue","app/collections/tracks"],function(e,t,n,r,i,s,o,u){"use strict";var a=function(e){this.dataModel=e._dataModel,this.isActive=this.dataModel.get("chapterActive"),this.isModeOn=this.dataModel.get("chapterActive"),this.id=this.dataModel.id,this.trackList=r.createTrackListFromRawTracks(this.dataModel.get("tracksChapters")),this.createChapterOptions(),this.update(),this.firstToggleActive(),this.loadTracks(),this.updateTracks()};return a.prototype=t.extend(a.prototype,e.Events),a.prototype=t.extend(a.prototype,{loadChapterByLang:function(e,t,n){var i=this,s=this.trackList.findWhere({srcLang:e,customLabel:t});if(!s){var o=r.getDefaultLangFromTrack(this.dataModel,this.trackList,"chapter"),s=this.trackList.findWhere({srcLang:o,customLabel:t});if(!s){console.log("Can not find any chapter ");return}}if(s.get("isLoaded"))return n(null,s);this.createLoadingView(),r.initTrackFromSrc(this.trackList.models,s,function(e,t){return e?n(e,null):n(null,t)})},showChapterView:function(){if(!this.isActive)return;var e=this.dataModel.get("activeLanguage"),t=this.dataModel.get("currentChapterLabel"),n=this;!this.chapterView||this.chapterView.track==undefined||this.chapterView.track!=undefined&&this.chapterView.track.get("srcLang")!==e||this.chapterView.track!=undefined&&this.chapterView.track.get("label")!==t?this.loadChapterByLang(e,t,function(e,t){n.createChapterView(t),n.chapterView.render()}):this.chapterView.render(),$("#"+this.dataModel.id+"_fd_c").removeClass("omp-hidden"),$("#"+this.dataModel.id).find(".omp-chapter-button").focus()},hideChapterView:function(){$("#"+this.dataModel.id+"_fd_c").addClass("omp-hidden")},createChapterView:function(e){var t=this;this.destroyChapterView(),this.chapterView=new i({dataModel:this.dataModel,track:e}),this.chapterView.isModeOn=this.isModeOn;var n=this.chapterView.render().$el;$("#"+this.id+"_fd_c").html(n);var r=$("#"+this.id+"_chapter_header"),s=$("#"+this.id+"_chapter_list");r.click(function(e){e.stopPropagation(),s.css("display")=="none"?(s.removeClass("omp-hidden"),s.children().first().focus()):s.addClass("omp-hidden")}),$(document).click(function(e){$(e.target).closest(r).length===0&&s.addClass("omp-hidden")}),this.toogleChapterMode()},createLoadingView:function(){var e=this;this.loadingView=new s({dataModel:this.dataModel,type:"chapters"});var t=this.loadingView.render().$el;$("#"+this.id+"_fd_c").html(t)},showChapterMakers:function(){var e=$("#"+this.id+" span[data-type=markers]");e.addClass("omp-progress-chapter"),this.dataModel.trigger("chapter_marker_enabled")},hideChapterMakers:function(){var e=$("#"+this.id+" span[data-type=markers]");e.removeClass("omp-progress-chapter"),this.dataModel.trigger("chapter_marker_disabled")},toogleChapterMode:function(){var e=this;$("#"+this.dataModel.id+"_fd_c .omp-interactive-toogle .on").click(function(){e.onToggleOn()}),$("#"+this.dataModel.id+"_fd_c .omp-interactive-toogle .off").click(function(){e.onToggleOff()}),this.dataModel.on("activeFeatureMode",function(e){if(!this.dataModel.get("chapterActive"))return;var t=e[0],n=e[1];t=="chapter"&&(n?this.onToggleOn():this.onToggleOff())}.bind(this))},onToggleOn:function(){$("#"+this.dataModel.id+"_fd_c .omp-interactive-toogle .off").parent().attr("omp-settings-toogle",!0),this.showChapterMakers(),this.isModeOn=this.chapterView.isModeOn=!0},onToggleOff:function(){$("#"+this.dataModel.id+"_fd_c .omp-interactive-toogle .on").parent().attr("omp-settings-toogle",!1),this.hideChapterMakers(),this.isModeOn=this.chapterView.isModeOn=!1},destroyChapterView:function(){this.chapterView&&t.isFunction(this.chapterView.destroy)&&this.chapterView.destroy(),this.chapterView=void 0},onLanguageChange:function(){this.isActive=!0,this.showChapterView()},onChapterChange:function(){this.isActive=!0,this.showChapterView()},toggleActive:function(){this.isActive=this.dataModel.get("chapterActive");var e=$("#"+this.id+" .omp-chapter-setting");e.attr("omp-settings-toogle",this.isActive),this.update()},createChapterOptions:function(){var e=[],n=this.dataModel.get("tracksChapters"),r=[];t.map(n,function(t){var n=t.kind.toLowerCase();if(n=="chapters"){var i=t.label.toLowerCase(),s=t.isDefaultTrack;s&&r.push(i),e.indexOf(i)==-1&&e.push(i)}});var i=e.length;if(i>0){e.sort(function(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())}),e.sort(),this.dataModel.set("tracksLabels",e);if(r.length>0)var s=r[0].replace(/ /g,"_");else var s=e[0].replace(/ /g,"_");this.dataModel.set("currentChapterLabel",s)}},update:function(){this.isActive?(this.showChapterView(),this.listenTo(this.dataModel,"change:currentChapterLabel",this.onChapterChange),this.listenTo(this.dataModel,"change:activeLanguage",this.onLanguageChange)):(this.hideChapterView(),this.stopListening(this.dataModel,"change:activeLanguage"),this.stopListening(this.dataModel,"change:currentChapterLabel")),this.stopListening(this.dataModel,"change:chapterActive"),this.listenTo(this.dataModel,"change:chapterActive",this.toggleActive)},firstToggleActive:function(){this.listenToOnce(this.dataModel,"change:chapterActive",function(){this.isModeOn=!0}.bind(this))},loadTracks:function(){var e=this;this.dataModel.on("oump_load_tracks_chapters",function(){var t=e.dataModel.get("activeLanguage"),n=e.dataModel.get("currentChapterLabel"),i=e.trackList.findWhere({srcLang:t,customLabel:n}),s=e.dataModel.get("apiTrackOptions"),o="";i&&i.get("cues").length>0&&(o=r.getVttContent(i.get("cues"))),$("#"+s.id).val(o)})},updateTracks:function(){var e=this,n=e.dataModel.get("apiOptions");e.trackList=r.createTrackListFromCustomTracks(e.trackList,n,"chapters"),this.dataModel.on("oump_set_tracks_chapters",function(){var n=e.dataModel.get("activeLanguage"),i=e.dataModel.get("currentChapterLabel"),s=e.trackList.findWhere({srcLang:n,customLabel:i}),u=e.dataModel.get("apiTrackOptions"),a=[];if(s&&u.id!=undefined){var f=$("#"+u.id).val();if(f)var a=r.vttParser(f);if(a.length>0){var l=t.map(a,function(e,t){var n=e.get("cueId"),r=e.get("startTime"),i=e.get("endTime"),s=e.get("text");return new o({startTime:r,endTime:i,text:s,cueId:n})});s.set("cues",l),e.createChapterView(s),e.chapterView.render()}}})}}),a}),define("text!app/tpl/controls/audio_description.html",[],function(){return'<%\n_.each(audio, function (item) {\n%>\n<audio  id ="<%= id %>_audiodescription-<%- item.srclang %>"\n	onloadstart="this.volume=<%= volume %>"\n	class="audio-hidden audiodescription" preload="none">\n	<source src="<%- item.src %>" type="<%- item.type  %>">\n</audio>\n<%\n});\n%>'}),define("app/views/audio_description_view",["jquery","backbone","underscore","text!app/tpl/controls/audio_description.html"],function(e,t,n,r){"use strict";var i=t.View.extend({initialize:function(e){this.item=e.model.get("audio"),this.id=e.model.get("id"),this.dataModel=e.model},render:function(){var t=n.template(r)({audio:this.item,id:this.id,volume:this.dataModel.get("volume")});return this.setElement(e(t)),this}});return i}),define("app/helpers/hook/audio_description_hook",["backbone","jquery","underscore","app/views/audio_description_view","app/helpers/utilities","app/models/track","app/views/cue_view","app/views/track_view","app/helpers/hook/text_description_hook","app/models/cue"],function(e,t,n,r,i,s,o,u,a,f){"use strict";var l=n.clone(a.prototype),c=function(e){this.dataModel=e._dataModel,this.hasAudio=!1,this.pauseVideo=!1,this.playing=!1,this.$button=t("#"+this.dataModel.id+"_f_ad");var n=this.dataModel.get("tracksAudiodescriptions");if(n){var r=n.filter(function(e){return e.type!="text/vtt"});this.audioList=i.createAudioListFromRawTracks(r),this.dataModel.set("audio",r)}this.init(e),this.loadTracks(),this.updateTracks()};return c.prototype=n.extend(c.prototype,e.Events),c.prototype=n.extend(l,{init:function(e){if(this.audioList){this.hasAudio=!0,this.isActive=this.dataModel.get(this.activeProp),this.activeProp="audioDescriptionActive",this.listenTo(this.dataModel,"change:"+this.activeProp,this.toggleActive),this.playerObject=e._playerObject,this.$video=t(e._playerObject),this.toggleButton(),this.id=this.dataModel.id,this.checkVtt=this.dataModel.get("tracksAudiodescriptions").filter(function(e){return e.type=="text/vtt"}),this.audiodescriptionView=new r({model:this.dataModel});var n=t("#"+this.id+"_audiodescription");n.append(this.audiodescriptionView.render().$el),this.trackList=i.createTrackListFromRawTracks(this.dataModel.get("tracksAudiodescriptions")),this.bindAudioDescriptionEvents(),this.dataModel.on("oumpStop",this.reset.bind(this)),this.$video.on("ended.auddes",this.reset.bind(this)),this.update()}},createDefaultTrack:function(e,t){var n=new s({isDefault:!1,kind:"audiodescriptions",label:"Audio description",customLabel:"Audio description",src:null,srcLang:e.get("srcLang"),type:"text/vtt"}),r=new f({startTime:0,endTime:this.playerObject.duration,text:"",cueId:'{"audio": "00:00:00.000"}'});return n.set("cues",[r]),n},bindAudioDescriptionEvents:function(){var e=this;this.listenTo(this.dataModel,"change:volume",function(){e.updateAudioDescriptionVolume(this.dataModel.get("volume"))}),this.listenTo(this.dataModel,"change:playerState",function(){e.dataModel.get("playerState")!="play"?e.pauseAudioDescription():e.playAudioDescription()}),this.listenTo(this.dataModel,"change:seekTime",function(){e.pauseAudioDescription(),e.playing=!1,e.activeCue&&e.activeCue.set("isActive",!1)})},createTrackView:function(e){this.destroyTrackView(),this.trackView=new u({track:e,cueViewClass:o}),this.listenTo(this.trackView,"track_view:cue_view:render",function(e){this.listenTo(this.dataModel,"change:activeLanguage",this.update),this.playing=!0,this.startAudioDescription(e.cue),this.activeCue=e.cue}.bind(this)),this.listenTo(this.trackView,"track_view:cue_view:close_a_cue",function(e){this.activeCue&&e.cue==this.activeCue&&(this.playing=!1,this.pauseAudioDescription())}.bind(this))},destroyTrackView:function(){this.trackView&&this.trackView.remove(),this.trackView=null},loadAudioByLang:function(e,t){var n=this,r=this.audioList.findWhere({srcLang:e});if(!r){console.log("Can not find any audio in "+e);var s=i.getDefaultLangFromTrack(this.dataModel,this.trackList),r=this.audioList.findWhere({srcLang:s});if(!r){console.log("Can not find any audio in "+s);return}}if(r.get("isLoaded"))return t(null,r);this.showLoading(),i.initAudioFromSrc(this.trackList.models,r,function(e){return n.closeLoading(),e?t(!1,e):t(!0,null)})},enablePlay:function(){if(!this.isActive)return;var e=this.dataModel.get("activeLanguage"),t=this;try{this.audioObject.pause()}catch(n){}t.loadAudioByLang(e,function(e,n){if(e)return console.log("Error",e);var r=t.trackList.findWhere({srcLang:n.get("srcLang")});r?r.get("isLoaded")?(t.audioObject=document.getElementById(t.id+"_audiodescription-"+n.get("srcLang")),t.createTrackView(r)):i.loadTrackFromSrc(r,function(){t.audioObject=document.getElementById(t.id+"_audiodescription-"+n.get("srcLang")),t.audioObject.load(),t.createTrackView(r)}):(t.destroyTrackView(),t.audioObject=document.getElementById(t.id+"_audiodescription-"+n.get("srcLang")),t.audioObject.load(),t.createTrackView(t.createDefaultTrack(n,t.audioObject)))})},startAudioDescription:function(e){if(this.isActive&&this.hasAudio&&this.audioObject&&this.playing){var t=this.playerObject.currentTime;if(e){var n=JSON.parse(e.get("cueId")),t=i.parseTimestamp(n.audio);t+=this.playerObject.currentTime-e.get("startTime"),this.audioObject.currentTime=t}this.$video[0].paused||this.playAudioDescription()}},playAudioDescription:function(){this.audioObject&&this.audioObject.paused&&this.playing&&this.playerObject.currentTime<this.audioObject.duration&&this.audioObject.play()},pauseAudioDescription:function(){this.audioObject&&this.audioObject.pause()},updateAudioDescriptionVolume:function(e){n.each(t("#"+this.id).find(".audiodescription"),function(t){t.volume=e}.bind(this))},toggleActive:function(){this.isActive=this.dataModel.get(this.activeProp),this.$button.attr("omp-settings-toogle",this.isActive),this.update()},toggleButton:function(){var e=this;this.$button.on("click","span",function(){e.dataModel.set(e.activeProp,t(this).hasClass("on")==1)})},update:function(){this.$video.off("timeupdate.auddes"),this.isActive?(this.enablePlay(),this.$video.on("timeupdate.auddes",this.onVideoTimeUpdate.bind(this)),this.listenTo(this.dataModel,"change:activeLanguage",this.update)):(this.stopListening(this.dataModel,"change:activeLanguage"),this.pauseAudioDescription(),this.destroyTrackView(),this.audioObject=null,this.playing=!1)},onVideoTimeUpdate:function(e){var t=e.target.currentTime;this.trackView&&this.trackView.render(t)},onLanguageChange:function(){this.update()},loadTracks:function(){var e=this;this.dataModel.on("oump_load_tracks_audiodescriptions",function(){var n=e.dataModel.get("activeLanguage"),r=e.trackList.findWhere({srcLang:n}),s=e.dataModel.get("apiTrackOptions"),o="";r&&r.get("cues").length>0&&(o=i.getVttContent(r.get("cues"))),t("#"+s.id).val(o)})},updateTracks:function(){var e=this,r=e.dataModel.get("apiOptions");e.trackList=i.createTrackListFromCustomTracks(e.trackList,r,"audiodescriptions"),this.dataModel.on("oump_set_tracks_audiodescriptions",function(){var r=e.dataModel.get("activeLanguage"),s=e.trackList.findWhere({srcLang:r}),o=e.dataModel.get("apiTrackOptions"),u=[];if(s&&o.id!=undefined){var a=t("#"+o.id).val();if(a)var u=i.vttParser(a);if(u.length>0){var l=n.map(u,function(e,t){var n=e.get("cueId"),r=e.get("startTime"),i=e.get("endTime"),s=e.get("text");return new f({startTime:r,endTime:i,text:s,cueId:n})});s.set("cues",l),e.update()}}})},reset:function(){this.trackView&&this.trackView.resetCues(),this.audioObject&&(this.audioObject.currentTime=0)}}),c}),define("text!app/tpl/controls/cue_view_ex.html",[],function(){return'<button class="omp-close-button" tabindex="<%= tabs.annotations %>" title="<%= labels.close %>"\n        aria-label="Close"></button>\n<%= text %>\n'}),define("app/views/cue_view_ex",["jquery","backbone","underscore","app/models/cue","app/views/cue_view","text!app/tpl/controls/cue_view_ex.html"],function(e,t,n,r,i,s){"use strict";var o=i.extend({className:"omp-fd-annotation",template:s,events:{"click a":"onLinkClick","click .omp-close-button":"onCloseClick",focus:"onFocus"},initialize:function(e){this.dataModel=e.dataModel,this.constructor.__super__.initialize.apply(this,arguments)},render:function(){this.constructor.__super__.render.call(this),this.tabs=this.dataModel.get("tabs"),this.labels=this.dataModel.get("labels");var e=n.template(this.template)({text:this.cue.get("text"),tabs:this.dataModel.get("tabs"),labels:this.labels});return this.$el.html(e),this.$el.css(this.css),this.$el.attr("tabindex",this.tabs.annotations),this.$el.attr("title",this.labels.anotationtitle),this.$el.find("a").attr("tabindex",this.tabs.annotations).attr("title",this.labels.openNewWindow),this.delegateEvents(),this},onCloseClick:function(t){t.preventDefault(),this.close(),window.clickCloseAnnotation=!0,setTimeout(function(){window.clickCloseAnnotation=!1},150),e("#"+this.dataModel.id).find(".omp-fd-annotation").length>0?e("#"+this.dataModel.id).find(".omp-fd-annotation").focus():e("#"+this.dataModel.id+"_m_playpause").focus()},onLinkClick:function(t){t.preventDefault(),window.open(e(t.target).closest("a").get(0).getAttribute("href")),this.dataModel.trigger("oump_pause")},onFocus:function(e){setTimeout(function(){window.clickCloseAnnotation||this.dataModel.trigger("oump_pause")}.bind(this),100)}});return o}),define("app/helpers/hook/annotation_hook",["backbone","underscore","app/models/track","app/views/cue_view_ex","app/views/track_view","app/helpers/utilities","app/helpers/hook/text_description_hook","app/models/cue"],function(e,t,n,r,i,s,o,u){"use strict";var a=t.clone(o.prototype),f=function(e){this.dataModel=e._dataModel,this.trackName="tracksAnnotations",this.activeProp="annotationsActive",this.$button=$("#"+this.dataModel.id+"_f_an"),this.init(e),this.loadTracks(),this.updateTracks()};return f.prototype=t.extend(f.prototype,e.Events),f.prototype=t.extend(a,{createTrackView:function(e){this.destroyTrackView(),this.trackView=new i({track:e,cueViewClass:r,dataModel:this.dataModel}),this.listenTo(this.trackView,"track_view:cue_view:render",this.addView),this.listenTo(this.trackView,"track_view:cue_view:close_a_cue",this.closeACue)},toggleActiveUI:function(){this.$button.attr("omp-settings-toogle",this.isActive)},loadTracks:function(){var e=this;this.dataModel.on("oump_load_tracks_annotations",function(){var t=e.dataModel.get("activeLanguage"),n=e.trackList.findWhere({srcLang:t}),r=e.dataModel.get("apiTrackOptions"),i="";n&&n.get("cues").length>0&&(i=s.getVttContent(n.get("cues"))),$("#"+r.id).val(i)})},updateTracks:function(){var e=this,n=e.dataModel.get("apiOptions");e.trackList=s.createTrackListFromCustomTracks(e.trackList,n,"annotations"),this.dataModel.on("oump_set_tracks_annotations",function(){var n=e.dataModel.get("activeLanguage"),r=e.trackList.findWhere({srcLang:n}),i=e.dataModel.get("apiTrackOptions"),o=[];if(r&&i.id!=undefined){var a=$("#"+i.id).val();if(a)var o=s.vttParser(a);if(o.length>0){var f=t.map(o,function(e,t){var n=e.get("cueId"),r=e.get("startTime"),i=e.get("endTime"),s=e.get("text");return new u({startTime:r,endTime:i,text:s,cueId:n})});$(".omp-fd-annotation").remove(),r.set("cues",f),e.createTrackView(r),e.trackView.render(e.$video[0].currentTime)}}})}}),f}),define("app/views/cue_view_scripts",["jquery","backbone","underscore","app/models/cue","app/helpers/utilities"],function(e,t,n,r,i){"use strict";var s=t.View.extend({className:"text-description",css:{top:0,left:0,width:"",height:"",padding:"5px",color:"black",font:"14px Arial, serif",opacity:1,"background-color":"rgba(140, 207, 226, 0.8)"},events:{},initialize:function(e){this.cue=e.cue,this.listenTo(this.cue,"change:isActive",this.update);var t={};try{t=JSON.parse(this.cue.get("cueId"))}catch(r){}if(t.opacity){var i=parseInt(t.opacity.replace("%",""));t.opacity=i/100}this.css=n.extend({},this.css,t),this.cue.set("text",this.cue.get("text"))},update:function(){this.cue.get("isActive")?this.render():this.close()},render:function(){return this.$el.html(this.cue.get("text")),this.$el.attr("title","Text Description"),this.$el.attr("id",this.cue.cid+"_text_description"),this.$el.css(this.css),this.trigger("cue_view:render",this),this},close:function(){this.trigger("cue_view:close",this),this.$el.remove()},destroy:function(){this.remove()}});return s}),define("app/helpers/hook/script_hook",["backbone","underscore","app/models/track","app/views/cue_view_scripts","app/views/track_view","app/helpers/utilities","app/helpers/hook/text_description_hook","app/models/cue"],function(e,t,n,r,i,s,o,u){"use strict";var a=t.clone(o.prototype),f=function(e){this.dataModel=e._dataModel,this.trackName="tracksScripts",this.activeProp="scriptsActive",this.$button=$("#"+this.dataModel.id+"_f_an"),this.init(e),this.loadTracks(),this.updateTracks()};return f.prototype=t.extend(f.prototype,e.Events),f.prototype=t.extend(a,{createTrackView:function(e){this.destroyTrackView(),this.trackView=new i({track:e,cueViewClass:r,dataModel:this.dataModel}),this.listenTo(this.trackView,"track_view:cue_view:render",this.addView),this.listenTo(this.trackView,"track_view:cue_view:close_a_cue",this.closeACue)},toggleActiveUI:function(){this.$button.attr("omp-settings-toogle",this.isActive)},loadTracks:function(){var e=this;this.dataModel.on("oump_load_tracks_scripts",function(){var t=e.dataModel.get("activeLanguage"),n=e.trackList.findWhere({srcLang:t}),r=e.dataModel.get("apiTrackOptions"),i="";n&&n.get("cues").length>0&&(i=s.getVttContent(n.get("cues"))),$("#"+r.id).val(i)})},updateTracks:function(){var e=this,n=e.dataModel.get("apiOptions");e.trackList=s.createTrackListFromCustomTracks(e.trackList,n,"scripts"),this.dataModel.on("oump_set_tracks_scripts",function(){var n=e.dataModel.get("activeLanguage"),r=e.trackList.findWhere({srcLang:n}),i=e.dataModel.get("apiTrackOptions"),o=[];if(r&&i.id!=undefined){var a=$("#"+i.id).val();if(a)var o=s.vttParser(a);if(o.length>0){var f=t.map(o,function(e,t){var n=e.get("cueId"),r=e.get("startTime"),i=e.get("endTime"),s=e.get("text");return new u({startTime:r,endTime:i,text:s,cueId:n})});$(".omp-fd-annotation").remove(),r.set("cues",f),e.createTrackView(r),e.trackView.render(e.$video[0].currentTime)}}})}}),f}),define("app/helpers/hook/base/base_setting_hook",["backbone","jquery","underscore","app/helpers/utilities","app/views/loading_view"],function(e,t,n,r,i){"use strict";var s=e.Model.extend({init:function(){if(!this.isActive)return;this.createSettingView()},initEvent:function(){this.linkControlEvents(),this.optionsControlEvents(),this.selectControlEvent(),this.settingButtonEvent(),this.onVideoClick();var e=this;t("#"+this.dataModel.id+"_controlbar").find("button").keyup(function(e){e.which!==13&&e.preventDefault()}),this.dataModel.on("activeFeature",function(t){var n=t[0],r=t[1];e.setActive(n,r)})},linkControlEvents:function(){var e,r,i=this;n.each(this.controls.links,function(n,s){n.click(function(){e=t(this).attr("omp-settings-toogle"),e=e!="true",r=t(this).attr("omp-settings-key"),r!="closedCaptionsActive"&&t("button").removeClass("omp-playlist-icon-active").removeClass("omp-chapter-icon-active").removeClass("omp-transcript-icon-active"),t(".omp-settings-toogle").attr("omp-settings-toogle","false"),t(this).attr("omp-settings-toogle",e);if(e){var n=r.toLowerCase().replace("active","_enabled");i.dataModel.trigger(n)}else{var n=r.toLowerCase().replace("active","_disabled");i.dataModel.trigger(n)}i.setActive(r,e)})}),n.each(this.controls.icons,function(n,s){n.click(function(){var n=e=t(this).attr("omp-settings-toogle");e=e!="true",r=t(this).attr("omp-settings-key"),t(".omp-settings-toogle").attr("omp-settings-toogle","false"),t("button").removeClass("omp-playlist-icon-active").removeClass("omp-chapter-icon-active").removeClass("omp-transcript-icon-active"),t(this).attr("omp-settings-toogle",e);if(n=="false"){var s=r.toLowerCase().replace("active","");t(this).addClass("omp-"+s+"-icon-active")}if(e){var o=r.toLowerCase().replace("active","_enabled");i.dataModel.trigger(o)}else{var o=r.toLowerCase().replace("active","_disabled");i.dataModel.trigger(o)}i.setActive(r,e)})})},optionsControlEvents:function(){var e,r,i=this;n.each(this.controls.options,function(n){n.click(function(){e=t(this).hasClass("on"),r=t(this).parent().attr("omp-settings-key"),t(this).parent().attr("omp-settings-toogle",e);if(e){var n=r.toLowerCase().replace("active","_enabled");i.dataModel.trigger(n)}else{var n=r.toLowerCase().replace("active","_disabled");i.dataModel.trigger(n)}i.setActive(r,e)})})},selectControlEvent:function(){var e,i,s=this;n.each(this.controls.selects,function(n){n.find(".omp-settings-header").click(function(e){e.stopPropagation(),n.closest(".omp-menuitem").siblings().find(".omp-settings-list").addClass("omp-hidden"),n.find(".omp-settings-list").toggleClass("omp-hidden"),t(this).toggleClass("omp-settings-header-bottom-border")}),n.find(".omp-settings-list .omp-settings-item").click(function(o){var u=this;i=n.attr("omp-settings-key"),e=t(this).attr("value"),i=="activeLanguage"&&s.dataModel.trigger("language_changed",e),i=="qualityActive"?(s.dataModel.trigger("quality_selected",e),r.checkExistFile(e,function(r){r?(n.find(".omp-st-selected-item").html(t(u).html()),n.find(".omp-st-selected").removeClass("omp-st-selected"),n.find(".omp-settings-list").addClass("omp-hidden"),t(u).addClass("omp-st-selected"),t("#"+s.dataModel.get("id")+"_quality_message_box").hide(),s.setActive(i,e)):s.createLoadingView("quality_error")})):(n.find(".omp-st-selected-item").html(t(this).html()),n.find(".omp-st-selected").removeClass("omp-st-selected"),n.find(".omp-settings-list").addClass("omp-hidden"),t(this).addClass("omp-st-selected"),s.setActive(i,e)),o.offsetY>0&&o.offsetX>0?t("#"+s.dataModel.id+"_setting_toolbox").addClass("omp-hidden"):t(this).parent().addClass("omp-hidden"),t("#"+s.dataModel.id+"_f_settings").removeClass("omp-active-setting")})})},settingButtonEvent:function(){var e=this,n=t("#"+this.dataModel.id+"_f_settings"),r=t("#"+this.dataModel.id+"_setting_toolbox");n.click(function(){r.toggleClass("omp-hidden"),n.toggleClass("omp-active-setting"),t(this).siblings("#"+e.dataModel.id+"_setting_toolbox").find(".omp-menuitem .omp-settings-list").addClass("omp-hidden")}),n.parent().siblings().children().on("focus",function(){n.siblings().addClass("omp-hidden"),n.hasClass("omp-active-setting")&&n.removeClass("omp-active-setting")}),t(document).mousedown(function(e){if(oump.ismobile){if(t(e.target).closest(n).length===0&&t(e.target).closest(".omp-popup-mobile-settings").length===0||t(e.target).hasClass("omp-st-ok-button"))r.addClass("omp-hidden"),n.removeClass("omp-active-setting")}else t(e.target).closest(n).length===0&&t(e.target).closest(r).length===0&&(r.addClass("omp-hidden"),n.removeClass("omp-active-setting"))}),this.dataModel.on("oump_closepopup",function(){n.removeClass("omp-active-setting"),r.addClass("omp-hidden")})},createSettingView:function(){this.settingView=new this.settingView({model:this.dataModel}),this.settingView.render()},createLoadingView:function(e){var n=this;this.loadingView=new i({dataModel:this.dataModel,type:"quality"});var r=this.loadingView.render(e).$el;t("#"+this.id+"_quality_message_box").html(r),t("#"+this.id+"_quality_message_box").show(),t("#"+this.id+"_close_quality_message").focus(),t("#"+this.dataModel.id+"_close_quality_message").click(function(){t("#"+n.id+"_quality_message_box").hide(),t("#"+n.id).focus()})},onVideoClick:function(){if(!oump.ismobile){var e=t("#"+this.dataModel.id+"_clickable_overlay"),n=t("#"+this.dataModel.id+"_m_playpause");e.removeClass("omp-hidden"),e.click(function(e){e.stopPropagation(),t("#"+this.dataModel.id+"_video").focus(),n.click()}.bind(this))}}});return s}),define("text!templates/controls/global_setting.html",[],function(){return'<div class="omp-max omp-global-setting">\r\n    <% if (hasPlaylist && features.hasPlaylist) { %>\r\n    <div class="omp-inline omp-max-link omp-settings-toogle" id="<%= id %>_f_pl_link">\r\n        <button type="button" id="<%= id %>_f_playlist_max"  class="omp-btn <%= showButtons != \'undefined\' && showButtons || sizing == \'fixed\' ? \'omp-fixed-link\' : \'omp-setting-link\' %> omp-space-btn omp-playlist-setting"\r\n                tabindex="<%= tabs.playlist %>" omp-tab-feature="playlist"\r\n                omp-settings-toogle="<%= playlistActive %>"\r\n                omp-settings-key="playlistActive"\r\n                aria-label="<%= labels.playlist %>">\r\n            <span id="<%= id %>_f_playlist_link"\r\n                  class="<% if (playlistActive) { %> omp-active <% } %>">\r\n                <%= labels.playlist %>\r\n            </span>\r\n        </button>\r\n    </div>\r\n    <% } %>\r\n\r\n    <% if (features.hasTracksChapters) { %>\r\n    <div class="omp-inline omp-max-link omp-settings-toogle" id="<%= id %>_f_ch_link">\r\n        <button type="button" id="<%= id %>_f_chapters_max"  class="omp-btn <%= sizing == \'fixed\' ? \'\' : \'omp-setting-link\' %> omp-space-btn omp-chapter-setting"\r\n                tabindex="<%= tabs.chapters %>" omp-tab-feature="chapter"\r\n                omp-settings-toogle="<%= chapterActive %>"\r\n                omp-settings-key="chapterActive"\r\n                aria-label="<%= labels.chapters %>">\r\n            <span id="<%= id %>_f_chapters_link"\r\n                  class="<% if (chapterActive) { %> omp-active <% } %>">\r\n                <%= labels.chapters %>\r\n            </span>\r\n        </button>\r\n    </div>\r\n    <% } %>\r\n\r\n    <% if (features.hasTranscript) { %>\r\n    <div class="omp-inline omp-max-link omp-settings-toogle" id="<%= id %>_f_tr_link">\r\n        <button type="button" id="<%= id %>_f_transcript_max" class="omp-btn <%= sizing == \'fixed\' ? \'\' : \'omp-setting-link\' %> omp-space-btn omp-transcript-setting"\r\n                tabindex="<%= tabs.transcripts %>" omp-tab-feature="transcript"\r\n                omp-settings-toogle="<%= transcriptActive %>"\r\n                omp-settings-key="transcriptActive"\r\n                aria-label="<%= labels.transcript %>">\r\n            <span id="<%= id %>_f_transcript_link"\r\n                  class="<% if (transcriptActive) { %> omp-active <% } %>">\r\n                <%= labels.transcript %>\r\n            </span>\r\n        </button>\r\n    </div>\r\n    <% } %>\r\n\r\n    <% if (hasPlaylist && features.hasPlaylist) { %>\r\n    <div class="omp-inline omp-links-icon omp-hidden " id="<%= id %>_f_pl_icon">\r\n        <button type="button" id="<%= id %>_f_pl_max"  class="omp-btn omp-setting-link omp-space-btn  omp-playlist-setting"\r\n                tabindex="<%= tabs.playlist %>" omp-tab-feature="playlist"\r\n                omp-settings-toogle="<%= playlistActive %>"\r\n                omp-settings-key="playlistActive"\r\n                title="<%= labels.playlist %>"\r\n                aria-label="<%= labels.playlist %>">\r\n            <span  class=""><%= labels.pl %></span>\r\n        </button>\r\n    </div>\r\n    <% } %>\r\n\r\n    <% if (features.hasTracksChapters) { %>\r\n    <div class="omp-inline omp-links-icon omp-hidden " id="<%= id %>_f_ch_icon">\r\n        <button type="button" id="<%= id %>_f_ch_max"  class="omp-btn omp-setting-link omp-space-btn omp-chapter-setting"\r\n                tabindex="<%= tabs.chapters %>" omp-tab-feature="chapter"\r\n                omp-settings-toogle="<%= chapterActive %>"\r\n                omp-settings-key="chapterActive"\r\n                title="<%= labels.chapters %>"\r\n                aria-label="<%= labels.chapters %>"><span class=""><%= labels.ch %></span>\r\n        </button>\r\n    </div>\r\n    <% } %>\r\n\r\n    <% if (features.hasTranscript) { %>\r\n    <div class="omp-inline omp-links-icon omp-hidden " id="<%= id %>_f_tr_icon">\r\n        <button type="button" id="<%= id %>_f_tr_max" class="omp-btn omp-setting-link omp-space-btn omp-transcript-setting"\r\n                tabindex="<%= tabs.transcripts %>" omp-tab-feature="transcript"\r\n                omp-settings-toogle="<%= transcriptActive %>"\r\n                omp-settings-key="transcriptActive"\r\n                title="<%= labels.transcript %>"\r\n                aria-label="<%= labels.transcript %>"><span class=""><%= labels.tr %></span>\r\n        </button>\r\n    </div>\r\n    <% } %>\r\n\r\n    <% if (features.hasTracksSubtitles && player == \'html5\') { %>\r\n    <div class="omp-inline w31" id="<%= id %>_f_cc_icon">\r\n        <button type="button" id="<%= id %>_f_cc_max"\r\n                class="omp-btn omp-setting-link omp-caption-icon omp-space-btn fixed-right-title\r\n                    <% if (closedCaptionsActive) { %> omp-highlight <% } %>"\r\n                title="<%= labels.closedCaptions %>" tabindex="<%= tabs.cc %>"\r\n                omp-settings-toogle="<%= closedCaptionsActive %>"\r\n                omp-settings-key="closedCaptionsActive"\r\n                aria-label="<%= labels.closedCaptions %>">\r\n            <span id="<%= id %>_f_cc_link"></span>\r\n        </button>\r\n    </div>\r\n    <% } %>\r\n\r\n    <div class="omp-inline omp-hidden">\r\n        <button type="button" id="<%= id %>_f_mi_max" class="omp-btn omp-setting-link omp-space-btn"\r\n                title="Media info" tabindex="<%= tabs.mediaInfo %>"\r\n                omp-settings-toogle="<%= mediaInfoActive %>"\r\n                omp-settings-key="mediaInfoActive"\r\n                aria-label="Media info">\r\n            <span id="<%= id %>_f_mi_link"\r\n                  class="<% if (mediaInfoActive) { %> omp-active <% } %>">\r\n                Media info\r\n            </span>\r\n        </button>\r\n    </div>\r\n\r\n     <% if (features.hasSettings && (renderStyle == \'advance\' || (renderStyle == \'compact\'  && features.hasAudiodescriptions && !oump.ismobile))) { %>\r\n    <div class="omp-inline omp-inline-settings w21 ">\r\n\r\n        <button type="button" id="<%= id %>_f_settings" class="omp-btn omp-caption-settings omp-space-btn fixed-right-title"\r\n                title="<%= labels.settings %>" tabindex="<%= tabs.settings %>" omp-tab-feature="setting"\r\n                aria-label="<%= labels.settings %>">\r\n        </button>\r\n        <%\r\n        var class_popup_mobile_settings = \'omp-popup-mobile-settings\';\r\n        if(oump.isepub != undefined && oump.isepub ) {\r\n            if(!oump.isios) {\r\n                class_popup_mobile_settings = \'omp-popup-mobile-settings-calibre\';\r\n            }\r\n        }\r\n\r\n        %>\r\n         <div id="<%= id %>_setting_toolbox" class="dropdown-content omp-hidden " >\r\n            <div class="<%= !oump.ismobile ? \'omp-popup-settings\' : \'lightbox\'  %>" omp-popup-expanded="true">\r\n                <div class="<%= !oump.ismobile ? \'omp-popup-settings-content\' : class_popup_mobile_settings %>">\r\n                    <div class="omp-menu" id="omp-main-menu-id">\r\n                        <!-- linhnguyenk -->\r\n                        <% if (features.hasTracksDescriptions && player == \'html5\') { %>\r\n                        <div class="omp-menuitem">\r\n                            <div class="omp-menuitem-label"><%= labels.textDescription %></div>\r\n                            <div class="omp-menuitem-content">\r\n                                <div id="<%= id %>_f_td" class="omp-setting-options\r\n                                        omp-text-description-toggle-checkbox"\r\n                                     omp-settings-key="textDescriptionActive"\r\n                                     omp-settings-toogle="<%= textDescriptionActive %>">\r\n                                    <button class="on fixed-right-title" tabindex="<%= tabs.settings %>"\r\n                                            title="<%= labels.textDescriptionTurnOn %>"\r\n                                            aria-label="<%= labels.textDescriptionTurnOn %>"><%= labels.on %></button>\r\n                                    <button class="off fixed-right-title" tabindex="<%= tabs.settings %>"\r\n                                            title="<%= labels.textDescriptionTurnOff %>"\r\n                                            aria-label="<%= labels.textDescriptionTurnOff %>"><%= labels.off %></button>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <% } %>\r\n\r\n                        <% if (features.hasAudiodescriptions && !oump.ismobile && player == \'html5\') { %>\r\n                        <div class="omp-menuitem">\r\n                            <div class="omp-menuitem-label"><%= labels.audioDescription %></div>\r\n                            <div class="omp-menuitem-content">\r\n                                <div id="<%= id %>_f_ad" class="omp-setting-options omp-audio-description-toggle-checkbox"\r\n                                     omp-settings-key="audioDescriptionActive"\r\n                                     omp-settings-toogle="<%= audioDescriptionActive %>">\r\n                                    <button class="on fixed-right-title" tabindex="<%= tabs.settings %>"\r\n                                            title="<%= labels.audioDescriptionTurnOn %>"\r\n                                            aria-label="<%= labels.audioDescriptionTurnOn %>"><%= labels.on %></button>\r\n                                    <button class="off fixed-right-title" tabindex="<%= tabs.settings %>"\r\n                                            title="<%= labels.audioDescriptionTurnOff %>"\r\n                                            aria-label="<%= labels.audioDescriptionTurnOff %>"><%= labels.off %></button>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <% } %>\r\n\r\n\r\n                        <% if (features.hasTracksSubtitles && player == \'html5\') { %>\r\n                        <div class="omp-menuitem omp-hidden" id="<%= id %>_f_cc_setting">\r\n                            <div class="omp-menuitem-label"><%= labels.closedCaptions %></div>\r\n                            <div class="omp-menuitem-content">\r\n                                <div id="<%= id %>_f_cc" class="omp-setting-options omp-captions-settings omp-captions-toggle-checkbox"\r\n                                     omp-settings-key="closedCaptionsActive"\r\n                                     omp-settings-toogle="<%= closedCaptionsActive %>">\r\n                                    <button class="on fixed-right-title" tabindex="<%= tabs.settings %>"\r\n                                            title="<%= labels.closedCaptionsTurnOn %>"\r\n                                            aria-label="<%= labels.closedCaptionsTurnOn %>"><%= labels.on %></button>\r\n                                    <button class="off fixed-right-title" tabindex="<%= tabs.settings %>"\r\n                                            title="<%= labels.closedCaptionsTurnOff %>"\r\n                                            aria-label="<%= labels.closedCaptionsTurnOff %>"><%= labels.off %></button>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <% } %>\r\n\r\n                        <% if (hasPlaylist && features.hasPlaylist) { %>\r\n                        <div class="omp-menuitem omp-hidden" id="<%= id %>_f_pl_setting">\r\n                            <div class="omp-menuitem-label"><%= labels.playlist %></div>\r\n                            <div class="omp-menuitem-content">\r\n                                <div id="<%= id %>_f_p" class="omp-setting-options omp-playlist-toggle-checkbox omp-playlist-setting omp-settings-toogle"\r\n                                     omp-settings-key="playlistActive"\r\n                                     omp-settings-toogle="<%= playlistActive %>">\r\n                                    <button class="on fixed-right-title" tabindex="<%= tabs.settings %>"\r\n                                            title="<%= labels.playlistTurnOn %>"\r\n                                            aria-label="<%= labels.playlistTurnOn %>"><%= labels.on %></button>\r\n                                    <button class="off fixed-right-title" tabindex="<%= tabs.settings %>"\r\n                                            title="<%= labels.playlistTurnOff %>"\r\n                                            aria-label="<%= labels.playlistTurnOff %>"><%= labels.off %></button>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <% } %>\r\n\r\n                        <% if (features.hasTracksChapters) { %>\r\n                        <div class="omp-menuitem omp-hidden" id="<%= id %>_f_ch_setting" tabindex="0">\r\n                            <div class="omp-menuitem-label"><%= labels.chapters %></div>\r\n                            <div class="omp-menuitem-content">\r\n                                <div id="<%= id %>_f_c" class="omp-setting-options omp-chapters-toggle-checkbox omp-chapter-setting omp-settings-toogle"\r\n                                     omp-settings-key="chapterActive"\r\n                                     omp-settings-toogle="<%= chapterActive %>">\r\n                                    <button class="on fixed-right-title" tabindex="<%= tabs.settings %>"\r\n                                            title="<%= labels.chapterTurnOn %>"\r\n                                            aria-label="<%= labels.chapterTurnOn %>"><%= labels.on %></button>\r\n                                    <button class="off fixed-right-title" tabindex="<%= tabs.settings %>"\r\n                                            title="<%= labels.chapterTurnOff %>"\r\n                                            aria-label="<%= labels.chapterTurnOff %>"><%= labels.off %></button>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <% } %>\r\n\r\n                        <% if (features.hasTranscript) { %>\r\n                        <div class="omp-menuitem omp-hidden" id="<%= id %>_f_tr_setting">\r\n                            <div class="omp-menuitem-label"><%= labels.transcript %></div>\r\n                            <div class="omp-menuitem-content">\r\n                                <div id="<%= id %>_f_t" class="omp-setting-options omp-transcript-toggle-checkbox omp-transcript-setting omp-settings-toogle"\r\n                                     omp-settings-key="transcriptActive"\r\n                                     omp-settings-toogle="<%= transcriptActive %>">\r\n                                    <button class="on fixed-right-title" tabindex="<%= tabs.settings %>"\r\n                                            title="<%= labels.transcriptTurnOn %>"\r\n                                            aria-label="<%= labels.transcriptTurnOn %>"><%= labels.on %></button>\r\n                                    <button class="off fixed-right-title" tabindex="<%= tabs.settings %>"\r\n                                            title="<%= labels.transcriptTurnOff %>"\r\n                                            aria-label="<%= labels.transcriptTurnOff %>"><%= labels.off %></button>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <% } %>\r\n\r\n                        <% if (features.hasAutoplay && player == \'html5\' && hasPlaylist && features.hasPlaylist) { %>\r\n                        <!-- linhnguyenk -->\r\n                        <div class="omp-menuitem" tabindex="0">\r\n                            <div class="omp-menuitem-label"><%= labels.autoplay %></div>\r\n                            <div class="omp-menuitem-content">\r\n                                <div id="<%= id %>_so_a" class="omp-setting-options omp-autoplay-toggle-checkbox"\r\n                                     omp-settings-key="autoplayActive"\r\n                                     omp-settings-toogle="<%= autoplayActive %>">\r\n                                    <button class="on fixed-right-title" tabindex="<%= tabs.settings %>"\r\n                                            title="<%= labels.autoplayTurnOn %>"\r\n                                            aria-label="<%= labels.autoplayTurnOn %>"><%= labels.on %></button>\r\n                                    <button class="off fixed-right-title" tabindex="<%= tabs.settings %>"\r\n                                            title="<%= labels.autoplayTurnOff %>"\r\n                                            aria-label="<%= labels.autoplayTurnOff %>"><%= labels.off %></button>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <% } %>\r\n\r\n                        <% if (features.hasTracksAnnotations && player == \'html5\') { %>\r\n                        <div class="omp-menuitem">\r\n                            <div class="omp-menuitem-label"><%= labels.annotations %></div>\r\n                            <div class="omp-menuitem-content">\r\n                                <div id="<%= id %>_f_an" class="omp-setting-options omp-annotations-toggle-checkbox"\r\n                                     omp-settings-key="annotationsActive"\r\n                                     omp-settings-toogle="<%= annotationsActive %>">\r\n                                    <button class="on fixed-right-title" tabindex="<%= tabs.settings %>"\r\n                                            title="<%= labels.annotationsTurnOn %>"\r\n                                            aria-label="<%= labels.annotationsTurnOn %>"><%= labels.on %></button>\r\n                                    <button class="off fixed-right-title" tabindex="<%= tabs.settings %>"\r\n                                            title="<%= labels.annotationsTurnOff %>"\r\n                                            aria-label="<%= labels.annotationsTurnOff %>"><%= labels.off %></button>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <% } %>\r\n\r\n                        <% if (features.hasSources && player == \'html5\') { %>\r\n                        <div class="omp-menuitem">\r\n                            <div class="omp-menuitem-label"><%= labels.quality %></div>\r\n                            <div class="omp-menuitem-content">\r\n                                <div class="omp-quality-dropdown" id="<%= id %>_f_q"\r\n                                     omp-settings-key="qualityActive">\r\n                                    <div class="omp-dd-settings-container">\r\n                                        <div class="omp-settings-header">\r\n                                            <div  class="omp-st-selected-item"\r\n                                                  omp-settings-toogle="<%= sources3[0].src %>" title="<%= labels.default %> <%= labels.quality %> <%= sources3[0].quality %>"  >\r\n                                                <% sources3.forEach(function(s, index) { %>\r\n                                                <% if (s.kind !== false) { %>\r\n                                                <% if (s.src == defaultSource) { %><%= s.quality %> (<%= labels.default %>)<% } %>\r\n                                                <% } %>\r\n                                                <% }); %>\r\n                                            </div>\r\n                                            <button class="omp-settings-button omp-select-button fixed-right-title"\r\n                                                    title="<%= labels.clickSelectQuality %>"\r\n                                                    tabindex="<%= tabs.settings %>"\r\n                                                    aria-label="<%= labels.clickSelectQuality %>"></button>\r\n                                        </div>\r\n                                        <div class="omp-settings-list omp-select-list omp-settings-quality">\r\n                                            <% sources3.forEach(function(s, index) { %>\r\n                                            <% if (s.kind !== false) { %>\r\n                                            <button class="omp-settings-item <%= s.src == defaultSource ? \'omp-st-selected\' : \'\' %>"\r\n                                                    value="<%= s.src %>"\r\n                                                    tabindex="<%= tabs.settings %>">\r\n                                                <%= s.quality %>\r\n                                                <% if (s.src == defaultSource) { %> (<%= labels.default %>)<% } %>\r\n                                            </button>\r\n                                            <% } %>\r\n                                            <% }); %>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <% } %>\r\n                        <%  if (features.hasLanguage) { %>\r\n                        <div class="omp-menuitem">\r\n                            <div class="omp-menuitem-label"><%= labels.language %></div>\r\n                            <% cnt = 0; tracksLanguages.forEach(function(lang, index) { cnt ++; }) %>\r\n                            <div class="omp-menuitem-content">\r\n                                <div class="omp-language-dropdown" id="<%= id %>_f_l"\r\n                                     omp-settings-key="activeLanguage">\r\n                                    <div class="omp-dd-settings-container">\r\n                                        <% if(cnt > 1) { %>\r\n                                        <div class="omp-settings-header ">\r\n                                            <div class="omp-st-selected-item" title="<%= labels.default %> <%= labels.language %> <%= languages[defaultLanguage] %>">\r\n                                                <%= languages[defaultLanguage] + \' (\' +  labels.default + \' )\' %>\r\n                                            </div>\r\n                                            <button class="omp-settings-button omp-select-button fixed-right-title omp-lang"\r\n                                                    title="<%= labels.clickSelectLanguage %>"\r\n                                                    tabindex="<%= tabs.settings %>"\r\n                                                    aria-label="<%= labels.clickSelectLanguage %>"></button>\r\n                                        </div>\r\n                                        <div class="omp-settings-list omp-select-list <%= cnt <= 1 ? \'omp-settings-quality\' : \'omp-settings-language\' %> omp-hidden">\r\n                                            <% tracksLanguages.forEach(function(lang, index) { %>\r\n                                            <button class="omp-settings-item <%= cnt <= 1 ? \'\' : \'omp-settings-item-language\' %>\r\n                                                    <% if (lang == activeLanguage) { %>omp-st-selected <% } %>"\r\n                                                    value="<%= lang %>"\r\n                                                    tabindex="<%= tabs.settings %>">\r\n                                                <%= languages[lang] %><% if (lang == defaultLanguage) { %> (<%= labels.default %>)<% } %>\r\n                                            </button>\r\n                                            <% }); %>\r\n                                        </div>\r\n                                        <% } else { %>\r\n                                            <div class="omp-menuitem-value">\r\n                                                <%= languages[defaultLanguage] + \' (\' +  labels.default + \' )\' %>\r\n                                            </div>\r\n                                        <% } %>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <% } %>\r\n                        <%  if (oump.ismobile) { %>\r\n                        <!--Close button-->\r\n                        <div class="omp-menuitem">\r\n                            <div class="omp-menuitem-label">\r\n                                <button class="omp-st-ok-button" title="<%= labels.close %>"><%= labels.close %></button>\r\n                            </div>\r\n                            <div class="omp-menuitem-content"><br/></div>\r\n                        </div>\r\n                        <% } %>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <% } %>\r\n\r\n    <% if (features.hasSources && features.hasDownload && player != \'media\') { %>\r\n    <div class="omp-inline omp-download-setting w23" id="<%= id %>_f_d_max">\r\n        <button type="button" id="<%= id %>_f_download_max" class="omp-btn omp-download-setting omp-download-icon omp-space-btn\r\n        fixed-right-title"\r\n                tabindex="<%= tabs.download %>"\r\n                omp-settings-toogle="<%= downloadActive %>"\r\n                omp-settings-key = "downloadActive"\r\n                data-type="media"\r\n                data-src="<%= sources3[0].src %>"\r\n                data-index="0"\r\n                title="<%= labels.download %>"\r\n                aria-label="<%= labels.download %>">\r\n        </button>\r\n        <a href="" download="true" id="<%= id %>_fd_t_download" class="notabindex" hidden="hidden" tabindex="-1"></a>\r\n    </div>\r\n    <% } %>\r\n</div>'}),define("app/views/global_setting_view",["jquery","jquery","underscore","backbone","text!templates/controls/global_setting.html","app/models/language"],function(e,t,n,r,i,s){"use strict";return r.View.extend({template:i,render:function(t){this.model.set("languages",new s);var r=n.template(this.template);return this.$el.html(r(this.model.toJSON())),t||(t=e("#"+this.model.id+"_options_controls")),t.append(this.$el.html()),this}})}),define("app/helpers/hook/global_setting_hook",["backbone","jquery","underscore","app/helpers/hook/base/base_setting_hook","app/views/global_setting_view"],function(e,t,n,r,i){"use strict";return r.extend({isActive:!0,controls:{},activeSettings:{},fsHideControls:["links:$playlistActive","links:$transcriptActive","links:$chapterActive","links:$downloadActive","icons:$transcriptActive","icons:$chapterActive","icons:$playlistActive","hiddenDivs:$downloadContainer"],toggleMatrix:{on:{playlistActive:["chapterActive:off","downloadActive:off","transcriptActive:off","mediaInfoActive:on"],chapterActive:["playlistActive:off","downloadActive:off","transcriptActive:off","mediaInfoActive:on"],transcriptActive:["playlistActive:off","downloadActive:off","mediaInfoActive:off","chapterActive:off"],downloadActive:["playlistActive:off","chapterActive:off","transcriptActive:off","mediaInfoActive:off"]},off:{transcriptActive:["mediaInfoActive:on"],downloadActive:["mediaInfoActive:on"]}},initialize:function(e){this.dataModel=e,this.settingView=i,this.constructor.__super__.init.apply(this),this.initEvent()},setActive:function(e,t){this.dataModel.set(e,t);if(e=="downloadActive"&&this.dataModel.get("forceDownload")){this.dataModel.set("downloadActive",!0);return}var r=this,i=t?"on":"off";n.each(r.toggleMatrix[i],function(t,i){i==e&&n.each(t,function(e){var t=e.split(":");r.dataModel.set(t[0],t[1]=="on")})})},initEvent:function(){var e="#"+this.dataModel.get("id");this.controls={links:{$playlistActive:t(e+"_f_playlist_max"),$chapterActive:t(e+"_f_chapters_max"),$transcriptActive:t(e+"_f_transcript_max"),$closedCaptionsActive:t(e+"_f_cc_max"),$mediaInfoActive:t(e+"_f_mi_max"),$downloadActive:t(e+"_f_download_max")},icons:{$playlistActive:t(e+"_f_pl_max"),$chapterActive:t(e+"_f_ch_max"),$transcriptActive:t(e+"_f_tr_max")},options:{$textDescriptionActive:t(e+"_f_td button"),$audioDescriptionActive:t(e+"_f_ad button"),$autoplayActive:t(e+"_so_a button"),$annotationActive:t(e+"_f_an button"),$closedCaptionsActive:t(e+"_f_cc button"),$chapterActive:t(e+"_f_c button"),$transcriptActive:t(e+"_f_t button"),$playlistActive:t(e+"_f_p button")},selects:{$activeLanguage:t(e+"_f_l"),$activeQuality:t(e+"_f_q")},hiddenDivs:{$downloadContainer:t(e+"_f_d_max")}},this.constructor.__super__.initEvent.call(this),this.listenTo(this.dataModel,"change:isFullscreen",this.onResize),t("body").on("focus",".omp-download-setting",function(){this.dataModel.trigger("oump_closepopup")}.bind(this)),t("body").on("focus",".omp-caption-fullscreen",function(){this.dataModel.trigger("oump_closepopup")}.bind(this)),this.listenTo(this.dataModel,"change:isFullscreen",this.toggleFullscreen)},onResize:function(){var e=this;n.each(e.fsHideControls,function(t){var n=t.split(":");e.controls[n[0]][n[1]].toggle(!e.dataModel.get("isFullscreen"))})},toggleFullscreen:function(){this.dataModel.get("isFullscreen")?t("#"+this.dataModel.get("id")+"_f_options").addClass("omp-hidden"):t("#"+this.dataModel.get("id")+"_f_options").removeClass("omp-hidden")}})}),define("app/helpers/hook/caption_hook",["backbone","underscore","app/models/track","app/helpers/utilities","app/models/cue"],function(e,t,n,r,i){"use strict";var s=function(e){this.dataModel=e._dataModel,this.playerObject=e._playerObject,this.isActive=this.dataModel.get("closedCaptionsActive"),this.id=this.dataModel.id,this.dataModel.on("oump_update_feature_controls",this.updateFeatureControls.bind(this)),this.dataModel.on("oump_resize",this.resize.bind(this)),this.trackList=r.createTrackListFromRawTracks(this.dataModel.get("tracksSubtitles")),this.update(),this.loadTracks(),this.updateTracks(),this.resize({id:this.id})};return s.prototype=t.extend(s.prototype,e.Events),s.prototype=t.extend(s.prototype,{loadCaptionByLang:function(e,t){var n=this,i=this.trackList.findWhere({srcLang:e});if(!i){var s=r.getDefaultLangFromTrack(this.dataModel,this.trackList,"caption"),i=this.trackList.findWhere({srcLang:s});if(!i){console.log("Can not find any caption ");return}}if(i.get("isLoaded"))return t(null,i);r.initTrackFromSrc(this.trackList.models,i,function(e,n){return e?t(e,null):t(null,n)})},showCaptionView:function(){var e=this;if(!this.isActive)return;var t=this.dataModel.get("activeLanguage");this.loadCaptionByLang(t,function(t,n){if(t)return console.log("Error",t);e.dataModel.trigger("oumpCaptionChange",{srclang:n.get("srcLang"),label:n.get("label")})})},onLanguageChange:function(){this.isActive=!0,this.showCaptionView()},toggleActive:function(){this.isActive=this.dataModel.get("closedCaptionsActive"),this.dataModel.trigger("oumpUpdateCaptionUI",this.isActive);var e=$("#"+this.id+" .omp-captions-settings");e.attr("omp-settings-toogle",this.isActive),this.update()},update:function(){this.isActive?(this.showCaptionView(),this.stopListening(this.dataModel,"change:activeLanguage"),this.listenTo(this.dataModel,"change:activeLanguage",this.onLanguageChange)):(this.dataModel.trigger("oumpCaptionChange",{srclang:"none",label:"None"}),this.stopListening(this.dataModel,"change:activeLanguage")),this.stopListening(this.dataModel,"change:closedCaptionsActive"),this.listenTo(this.dataModel,"change:closedCaptionsActive",this.toggleActive)},loadTracks:function(){var e=this;this.dataModel.on("oump_load_tracks_subtitles",function(){var n=document.getElementsByTagName("video")[0],s=e.dataModel.get("activeLanguage"),o=e.trackList.findWhere({srcLang:s}),u=e.dataModel.get("apiTrackOptions"),a="",f;if(e.playerObject.textTracks)for(var l=0;l<e.playerObject.textTracks.length;l++)if(e.playerObject.textTracks[l].kind=="subtitles"&&e.playerObject.textTracks[l].language==s)var f=e.playerObject.textTracks[l].cues;if(f.length>0){var c=t.map(f,function(e,t){var n=t+1,r=e.startTime,s=e.endTime,o=e.text;return new i({startTime:r,endTime:s,text:o,cueId:n})});o.set("cues",c),o&&o.get("cues").length>0&&(a=r.getVttContent(o.get("cues"))),$("#"+u.id).val(a)}})},updateTracks:function(){var e=this,n=e.dataModel.get("apiOptions"),i=e.dataModel.get("activeLanguage");if(n!=undefined){for(var s=0;s<n.length;s++)if(n[s].kind!=undefined&&n[s].srclang!=undefined&&n[s].kind=="subtitles"){var o=n[s].cues;document.getElementById(e.dataModel.get("id")+"_video_track_"+i).remove();var u=document.getElementById(e.dataModel.get("id")+"_video"),a;a=u.addTextTrack("subtitles",n[s].label,n[s].srclang);if(o.length>0)var f=t.map(o,function(e,t){var n=r.parseTimestamp(e.startTime),i=r.parseTimestamp(e.endTime),s=e.text,o=new VTTCue(n,i,s);a.addCue(o)})}e.trackList=r.createTrackListFromCustomTracks(e.trackList,n,"subtitles")}this.dataModel.on("oump_set_tracks_subtitles",function(){if(e.playerObject.textTracks)for(var n=0;n<e.playerObject.textTracks.length;n++)if(e.playerObject.textTracks[n].kind=="subtitles"&&e.playerObject.textTracks[n].language==i){var s=e.playerObject.textTracks[n].cues;if(s)while(s.length>0)e.playerObject.textTracks[n].removeCue(s[0])}var o=document.getElementById(e.dataModel.get("id")+"_video_track_"+i).track,u=e.dataModel.get("apiTrackOptions");if(o&&u.id!=undefined){var a=o.activeCues[0],s=o.cues,f=$("#"+u.id).val();a!=undefined&&o.removeCue(a);if(f)var s=r.vttParser(f);if(s.length>0)var l=t.map(s,function(e,t){var n=e.get("cueId"),r=e.get("startTime"),i=e.get("endTime"),s=e.get("text"),u=new VTTCue(r,i,s);o.addCue(u)})}})},updateFeatureControls:function(){this.dataModel.trigger("oumpCheckCaptionActive")},resize:function(e){var t="smart",n=$("#"+e.id+"_"+oump.models[e.id].get("type")).width();n<461?t="tiny":n>=461&&n<536?t="small":n>=535&&n<651?t="default":n>650&&n<801?t="medium":t="wide",$("#"+e.id).addClass("omp-cc-"+t)}}),s}),define("text!app/tpl/controls/download.html",[],function(){return'<div class="omp-feature-header omp-header">\n    <label><%= labels.downloads %></label>\n</div>\n\n<div class="omp-feature-download">\n    <div class="omp-download-intro">\n        <%= labels.downloadIntro %>\n    </div>\n    <div class="omp-download-err" id="<%= id %>_error_message">\n        <span class="omp-warning-icon"></span>\n        <label class="omp-loading-content"><%= labels.fileUnavailable %></label>\n    </div>\n</div>\n<div class="omp-download-content">\n    <% sources.forEach(function(s, index) { %>\n        <% if (s.kind !== false) { %>\n        <div class="omp-download-content-left omp-download-<%= type %>" data-type="media"\n             data-src="<%= s.src %>" data-index="<%= index %>">\n            <button class="omp-download-button" data-type="media" data-src="<%= s.src %>"\n                    data-index="<%= index %>" tabindex="<%= tabIndex %>" aria-label="<%= s.quality %>">\n                <span class="omp-download-label"><%= s.quality %></span>\n            </button>\n        </div>\n        <% } %>\n    <% }); %>\n\n    <div class="omp-line"></div>\n    <% Object.keys(downloadFiles).forEach(function(t, v) { %>\n        <div class="omp-download-content-left omp-download-<%= t %>" omp-download-transcript="true" data-type="<%= t %>" data-index="<%= v %>" >\n            <button class="omp-download-button" data-type="<%= t %>" data-index="<%= v %>"\n                    tabindex="<%= tabIndex %>"\n                    alt="<%= t %> Document"\n                    aria-label="<%= t %> <%= labels.document %>">\n                <span class="omp-download-label"><%= t %> <%= labels.document %></span>\n            </button>\n        </div>\n    <% }); %>\n\n</div>\n'}),define("app/views/download_view",["jquery","backbone","underscore","app/helpers/utilities","download","text!app/tpl/controls/download.html"],function(e,t,n,r,i,s){"use strict";var o=t.View.extend({events:{"click .omp-download-button":"onDownload"},initialize:function(e){this.dataModel=e.dataModel,this.downloadFiles=e.downloadFiles,this.sources=e.sources},render:function(){var t=this.dataModel.get("id"),r=!(this.sources.length+Object.keys(this.downloadFiles).length>1);if(r){var i=e("#"+t+"_f_download_max");this.onDownload(i)}else{var o=n.template(s)({id:t,downloadFiles:this.downloadFiles,sources:this.sources,type:this.dataModel.get("type"),tabIndex:this.dataModel.get("tabs").download,labels:this.dataModel.get("labels")});this.setElement(e(o))}return this.delegateEvents(),this},updateFilesize:function(){var t=this;n.each(this.sources,function(n,i){r.getFileSize(n.src,function(n){n=n?n:0,n=r.convertFileSize(n),e("#"+t.dataModel.id+" .omp-download-"+t.dataModel.get("type")).find('.omp-download-button[data-index="'+i+'"]').append('<span class="omp-filesize">('+n+")</span>")})}),n.each(this.downloadFiles,function(n,i){r.getFileSize(r.createUrl(t.dataModel.get("baseUrl"),n.src),function(n){n=n?n:0,n=r.convertFileSize(n),e("#"+t.dataModel.id+' .omp-download-button[data-type="'+i+'"]').append('<span class="omp-filesize">('+n+")</span>")})})},onDownload:function(t){var n=this,s=e(t.currentTarget).data("type")?e(t.currentTarget).data("type"):t.data("type"),o=e(t.currentTarget).data("index")?e(t.currentTarget).data("index"):0,u;switch(s){case"pdf":case"text":case"html":case"word":u=r.createUrl(n.dataModel.get("baseUrl"),n.downloadFiles[s].src);break;case"media":u=e(t.currentTarget).data("src")?e(t.currentTarget).data("src"):t.data("src");default:}return e(".omp-download-err").hide(),r.checkExistFile(u,function(t){if(t){if(oump.browser=="msie"||oump.isios){var r=e("#"+n.dataModel.get("id")+"_fd_t_download");r.attr("download",u.substr(u.lastIndexOf("/")+1)),r.attr("href",u+"?forcedownload=1"),r.get(0).click()}else switch(s){case"media":var o=u.match(/\.([^\.]+)$/);if(o)if(o[1].toLowerCase()=="mp4"){var r=e("#"+n.dataModel.get("id")+"_fd_t_download");r.attr("download",u.substr(u.lastIndexOf("/")+1)),r.attr("href",u+"?forcedownload=1"),r.get(0).click()}else i(u);break;default:i(u)}n.dataModel.trigger("download_item",u)}else e(".omp-download-err").hide(),e("#"+n.dataModel.get("id")+"_error_message").show(),n.dataModel.trigger("download_invalid",u)}),!1}});return o}),define("app/helpers/hook/download_hook",["backbone","underscore","app/helpers/utilities","app/views/download_view","app/views/loading_view"],function(e,t,n,r,i){"use strict";var s=function(e){this.dataModel=e._dataModel,this.isActive=this.dataModel.get("downloadActive"),this.id=this.dataModel.id,this.update()};return s.prototype=t.extend(s.prototype,e.Events),s.prototype=t.extend(s.prototype,{downloadFiles:[],showDownloadView:function(){if(!this.isActive)return;var e=this,t=this.dataModel.get("sources3");this.createLoadingView(),this.initDownloadFile();var n=!(t.length+Object.keys(this.downloadFiles).length>1);this.destroyDownloadView(),this.downloadView=new r({dataModel:this.dataModel,downloadFiles:this.downloadFiles,sources:t});var i=this.downloadView.render().$el;this.dataModel.set("forceDownload",n),n||($("#"+this.dataModel.id+"_f_download_max").removeClass("omp-download-icon").addClass("omp-download-icon-active"),$(".omp-download-err").hide(),$("#"+this.dataModel.id+"_fd_download").html(i).removeClass("omp-hidden"),this.downloadView.updateFilesize())},hideDownloadView:function(){$("#"+this.dataModel.id+"_f_download_max").removeClass("omp-download-icon-active").addClass("omp-download-icon"),$("#"+this.dataModel.id+"_fd_download").addClass("omp-hidden")},destroyDownloadView:function(){this.downloadView&&t.isFunction(this.downloadView.destroy)&&this.downloadView.destroy(),this.downloadView=void 0},createLoadingView:function(){var e=this;this.loadingView=new i({dataModel:this.dataModel,type:"download"});var t=this.loadingView.render().$el;$("#"+this.dataModel.id+"_fd_download").html(t)},initDownloadFile:function(){var e=this;this.downloadFiles={};var t=this.dataModel.get("dataTrack"),n=this.dataModel.get("attrSrc"),r=this.dataModel.get("activeLanguage");t!=undefined&&$.each(t.children,function(t,n){var i=n.tagName.toLowerCase();switch(i){case"track":var s=$(n).attr("data-omp-type"),o=$(n).attr("kind"),u=$(n).attr("src"),a=$(n).attr("srclang");break;case"div":case"span":var s=$(n).attr("data-omp-type"),o=$(n).attr("data-omp-kind"),u=$(n).attr("data-omp-src"),a=$(n).attr("data-omp-srclang"),f=$(n).attr("data-omp-label");default:}o=="transcripts"&&a==r&&(s=="text"||s=="pdf"||s=="html"||s=="word")&&u&&(e.downloadFiles[s]=e.downloadFiles[s]||[],e.downloadFiles[s].src=u,e.downloadFiles[s].label=f)}),n!=undefined&&$.each(n,function(t,n){var r=n.name.toLowerCase().replace("data-omp-transcript-",""),i=n.value;(r=="text"||r=="pdf"||r=="html"||r=="word")&&i&&(e.downloadFiles[r]={src:i||[],label:r})})},toggleActive:function(){this.isActive=this.dataModel.get("downloadActive");var e=$("#"+this.dataModel.id+" .omp-download-setting");e.attr("omp-settings-toogle",this.isActive),this.update()},update:function(){this.isActive?this.showDownloadView():this.hideDownloadView(),this.stopListening(this.dataModel,"change:downloadActive"),this.listenTo(this.dataModel,"change:downloadActive",this.toggleActive),this.dataModel.get("forceDownload")?this.stopListening(this.dataModel,"change:activeLanguage"):(this.stopListening(this.dataModel,"change:activeLanguage"),this.listenTo(this.dataModel,"change:activeLanguage",this.toggleActive))}}),s}),define("app/mobile",["jquery","app/helpers/utilities"],function(e,t){"use strict";var n=function(e,t){this.dataModel=e,this.playerObject=t,this.id=this.dataModel.get("id"),this.enterFullscreen=!1,this.fullscreenEvent=!1,this.exitFullscreen=!1,this.type=this.dataModel.get("type")};return n.prototype.handleUI=function(){e("#"+this.dataModel.get("id")+" .omp-controlbar").addClass("omp-mobile"),oump.isphone&&e("#"+this.dataModel.get("id")+" .omp-controlbar").addClass("omp-hidden"),e("#"+this.dataModel.get("id")+"_f_chapters_link").addClass("omp-mobile"),e("#"+this.dataModel.get("id")+"_f_transcript_link").addClass("omp-mobile"),e("#"+this.dataModel.get("id")+"_features_dialog").addClass("omp-mobile"),e("#"+this.dataModel.get("id")).addClass("omp-mobile-wide")},n.prototype.handleFullScreen=function(){var e=this;e.playerObject.webkitRequestFullscreen?(e.enterFullscreen=e.playerObject.webkitRequestFullscreen,e.fullscreenEvent="webkitfullscreenchange"):e.playerObject.webkitEnterFullscreen&&(e.enterFullscreen=e.playerObject.webkitEnterFullscreen,e.fullscreenEvent="webkitfullscreenchange"),e.playerObject.webkitExitFullscreen&&(e.exitFullscreen=e.playerObject.webkitExitFullscreen,e.fullscreenEvent="webkitfullscreenchange"),e.playerObject.addEventListener("webkitendfullscreen",function(){e.dataModel.trigger("oump_update_feature_controls"),e.dataModel.set("playerState","paused")},!1),e.playerObject.addEventListener("webkitfullscreenchange",function(t){document.webkitIsFullScreen||setTimeout(function(){e.playerObject.pause()},0)},!1)},n.prototype.videoShowControllPlayer=function(){e("#"+this.dataModel.get("id")+"_m_playpause").addClass("pause"),e("#"+this.dataModel.get("id")+"_progresswrap").removeClass("omp-hidden"),e("#"+this.dataModel.get("id")+"_controls_left").removeClass("omp-hidden"),e("#"+this.dataModel.get("id")+"_m_fullscreen").parent().removeClass("omp-hidden"),e("#"+this.dataModel.get("id")+"_options_controls").removeClass("omp-hidden"),e("#"+this.dataModel.get("id")+"_fd_c").removeClass("omp-hidden")},n.prototype.videoHideControllPlayer=function(){e("#"+this.dataModel.get("id")+"_progresswrap").addClass("omp-hidden"),e("#"+this.dataModel.get("id")+"_controls_left").addClass("omp-hidden"),e("#"+this.dataModel.get("id")+"_m_fullscreen").parent().addClass("omp-hidden"),e("#"+this.dataModel.get("id")+"_options_controls").addClass("omp-hidden"),e("#"+this.dataModel.get("id")+"_fd_c").addClass("omp-hidden"),e("#"+this.dataModel.get("id")+"_controlbar").addClass("omp-hidden")},n.prototype.audioShowControllPlayer=function(){e("#"+this.dataModel.get("id")+"_progresswrap").removeClass("omp-hidden"),e("#"+this.dataModel.get("id")+"_options_controls").removeClass("omp-hidden"),e("#"+this.dataModel.get("id")+"_f_options").removeClass("omp-hidden")},n.prototype.handleaudioForIOS=function(){e("#"+this.dataModel.get("id")+"_controlbar").removeClass("omp-hidden"),e("#"+this.dataModel.get("id")+"_progresswrap").removeClass("omp-hidden"),e("#"+this.dataModel.get("id")+"_controls_right").addClass("omp-hidden")},n.prototype.handleaudioForAndroid=function(){oump.isphone||e("#"+this.dataModel.get("id")+"_controlbar").removeClass("omp-hidden"),e("#"+this.dataModel.get("id")+"_progresswrap").removeClass("omp-hidden"),e("#"+this.dataModel.get("id")+"_controls_right").addClass("omp-hidden"),e("#"+this.dataModel.get("id")+"_m_mute").removeClass("omp-mute"),e("#"+this.dataModel.get("id")+"_p_volume_control").addClass("omp-hidden")},n.prototype.audioHideControllPlayer=function(){e("#"+this.dataModel.get("id")+"_progresswrap").addClass("omp-hidden"),e("#"+this.dataModel.get("id")+"_options_controls").addClass("omp-hidden"),e("#"+this.dataModel.get("id")+"_f_options").addClass("omp-hidden")},n.prototype.handleiOS=function(){var t=this;e("#"+t.dataModel.get("id")+"_m_mute").removeClass("omp-mute"),e("#"+this.id+"_video_lenghth").removeClass("omp-hidden"),e("#"+this.dataModel.get("id")+"_video_lenghth").css("bottom","3px"),e("#"+t.dataModel.get("id")+"_p_volume_control").removeClass("omp-inline omp-volume-controller"),t.dataModel.get("type")=="audio"?e(t.playerObject).on("play",function(){oump.istablet?t.dataModel.checkHasFeature("minimal")&&(e("#"+t.dataModel.get("id")+"_audio_background").addClass("omp-hidden"),e("#"+t.dataModel.get("id")+"_center_playicon").remove()):t.handleaudioForIOS()}):(e(t.playerObject).on("play",function(){oump.istablet?t.dataModel.trigger("oumpUpdatePlayPauseUI",!0):t.enterFullscreen.call(t.playerObject)}),e(t.playerObject).on("pause",function(){oump.istablet?t.dataModel.trigger("oumpUpdatePlayPauseUI",!1):e("#"+t.dataModel.get("id")+"_center_playicon").removeClass("omp-hidden")}))},n.prototype.handleAndroid=function(){var t=this;e("#"+this.id+"_video_lenghth").removeClass("omp-hidden"),e("#"+this.dataModel.get("id")+"_video_lenghth").css("bottom","3px"),t.dataModel.get("type")=="audio"?e(t.playerObject).on("play",function(){oump.istablet?t.dataModel.checkHasFeature("minimal")&&(e("#"+t.dataModel.get("id")+"_audio_background").addClass("omp-hidden"),e("#"+t.dataModel.get("id")+"_center_playicon").remove(),t.handleaudioForAndroid()):t.handleaudioForAndroid()}):(e(t.playerObject).on("play",function(e){oump.istablet||(t.enterFullscreen.call(t.playerObject),t.videoHideControllPlayer())}),e(t.playerObject).on("pause",function(){oump.istablet||(e("#"+t.dataModel.get("id")+"_center_playicon").removeClass("omp-hidden"),e("#"+t.dataModel.get("id")+"_controlbar").addClass("omp-hidden"))}))},n.prototype.handleLock=function(){var e=this,n=t.getPageVisibility();typeof document.addEventListener=="undefined"||typeof document[n.hidden]=="undefined"?e.dataModel.trigger("oumpUpdatePlayPauseUI",!e.playerObject.paused):document.addEventListener(n.visibilityChange,function(){document[n.hidden]?e.playerObject.paused||e.dataModel.trigger("oump_playpause"):e.dataModel.get("playerState")=="play"&&e.playerObject.paused&&e.dataModel.trigger("oump_playpause")},!1)},n.prototype.handlePlayer=function(){var t=this;t.handleFullScreen(),t.handleLock(),t.handleUI(),oump.isios?t.handleiOS():t.handleAndroid(),e(window).resize(function(){oump.isphone&&(t.type=="video"?t.videoHideControllPlayer():oump.istablet||(oump.isios?t.handleaudioForIOS():t.handleaudioForAndroid()))}),e("#"+t.dataModel.get("id")+"_m_fullscreen").on("click",function(){t.enterFullscreen.call(t.playerObject)})},n}),define("app/html5",["jquery","app/base","app/views/video_html5","app/views/audio_html5","app/collections/tracks","app/helpers/hook/text_description_hook","app/helpers/hook/transcript_hook","app/helpers/hook/chapter_hook","app/helpers/hook/audio_description_hook","app/helpers/hook/media_info_hook","app/helpers/hook/annotation_hook","app/helpers/hook/script_hook","app/helpers/hook/global_setting_hook","app/helpers/hook/caption_hook","app/helpers/hook/download_hook","app/helpers/utilities","app/mobile","app/views/loading_view"],function(e,t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g){"use strict";var y={mediaerror:function(t,n,r){var i=!1;n.pause(),oump.logger.log({type:"error",page:n.baseURI,item:"media",msg:"media load error code: "+t.target.error.code+" src: "+n.src,datetime:Date()});if(e("#"+r.get("id")+"_quality_selector option:not([disabled])").length<2&&n.src===r.get("defaultSource")){e(n).replaceWith('<img src="'+oump.wwwroot+'/img/error.jpg" style="width: 100%;" /><p class="omp-error">'+"Sorry, the media player cannot play the source provided ("+n.src+").</p>"),e(".omp-controlbar").addClass("omp-hidden");return}n.src!==r.get("defaultSource")?(e("#"+r.get("id")+"_quality_selector option").each(function(t,s){if(e(s).attr("disabled")==="disabled")return!0;e(s).attr("value")===n.src&&(e(s).attr("disabled","disabled"),e(s).removeAttr("selected")),e(s).attr("value")===r.get("defaultSource")&&(e(s).attr("selected","selected"),i=r.get("defaultSource"))}),n.src=i,n.load(),n.play()):(e("#"+r.get("id")+"_quality_selector option").each(function(t,s){if(e(s).attr("disabled")==="disabled")return!0;e(s).attr("value")===n.src&&(e(s).attr("disabled","disabled"),e(s).removeAttr("selected")),i||e(s).attr("value")!==n.src&&(e(s).attr("selected","selected"),i=e(s).attr("value"),r.set("defaultSource",i))}),n.src=i,n.load(),n.play())},addsubtitles:function(e,t){var n=e.get("tracksSubtitles");if(!n)return;for(var r=0;r<n.length;r++){var i=document.createElement("track");i.id=e.get("id")+"_video_track_"+n[r].srclang,i.kind="subtitles",i.label=n[r].label,i.srclang=n[r].srclang,i.src=n[r].src,n[r].trackDefault&&(i.trackDefault="default"),t.appendChild(i)}if(t.textTracks)for(var r=0;r<t.textTracks.length;r++)t.textTracks[r].kind==="subtitles"&&(t.textTracks[r].mode="hidden")},trackShowing:function(e){var t=e.textTracks;if(t!=undefined){var n=!1;for(var r=0;r<t.length;r++)if(t[r].mode===2||t[r].mode==="showing")n=!0}return n},createErrorView:function(t){var n=new g({dataModel:t,type:"quality"}),r=n.render("quality_error").$el;e("#"+t.id+"_quality_message_box").html(r),e("#"+t.id+"_quality_message_box").show(),e("#"+t.id+"_close_quality_message").focus(),e("#"+t.id+"_close_quality_message").one("click",function(){e("#"+t.id+"_quality_message_box").hide(),e("#"+t.id).focus()})}},b=t.extend({init:function(t){this.constructor.__super__.init.apply(this,arguments);var i=!1,v=!1,g=t.get("id"),b=t.get("type"),w=!1,E=!1,S=!1,x=!1,T=!1,N=!1,C=!1,k=!1;e("#"+g+"_color .cl_change_color").click(function(){var e=window.getComputedStyle(this,null).getPropertyValue("background-color"),t=document.getElementsByClassName("omp-progress-chapter");for(var n=0;n<t.length;n++)t[n].style.backgroundColor=e}),b==="video"&&(i=new n({model:t})),b==="audio"&&(i=new r({model:t}));if(i&&e("#"+g+"_poster")){e("#"+g+"_poster").replaceWith(i.render().el.childNodes),b==="audio"&&i.showPoster(),v=e("#"+g+"_"+b)[0];if(v){v.volume=t.get("volume"),e(v).on("loadstart",function(t){oump.isios||e("#"+g+"_media_loader").removeClass("omp-hidden")}),e(v).on("loadeddata",function(e){}),e(v).on("canplay",function(t){e("#"+g+"_media_loader").addClass("omp-hidden")}),oump.ismobile&&e(v).one("play",function(n){e(this).removeAttr("poster"),e("#"+g+" .omp-controlbar").removeClass("omp-transparent"),t.set("videoHeight",e("#"+t.get("id")+"_video").height())}),e(v).on("timeupdate",function(e){t.trigger("oumpTimeUpdate",e.target.currentTime),t.get("epub")!=undefined&&t.get("epub")==="true"&&t.get("duration")==e.target.currentTime&&t.trigger("oumpEnded")}),e(v).on("ended",function(e){v.pause(),t.trigger("oumpEnded"),t.trigger("oumpShowControlBar")}),t.checkHasFeature("mediainfo")&&new f({_dataModel:t,_playerObject:v}),t.checkHasFeature("download")&&new d({_dataModel:t});if(oump.ismobile){var L=new m(t,v);L.handlePlayer()}new h(t),t.checkHasFeature("playlist")&&t.get("currentPlaylist").attachPlayer(v),e(v).on("loadedmetadata",function(e){t.trigger("oumpLoadedMetadata",e.target.duration),b==="video"&&(oump.isios,w||(y.addsubtitles(t,v),w=!0),!oump.ismobile&&t.checkHasFeature("audiodescriptions")&&!C&&(new a({_dataModel:t,_playerObject:v}),C=!0),!T&&t.checkHasFeature("subtitles")&&(new p({_dataModel:t,_playerObject:v}),T=!0)),!k&&t.checkHasFeature("chapters")&&(new u({_dataModel:t}),k=!0),!E&&t.checkHasFeature("transcripts")&&(new o({_dataModel:t,_playerObject:v}),E=!0),!S&&t.checkHasFeature("annotation")&&(new l({_dataModel:t,_playerObject:v}),S=!0),!x&&t.checkHasFeature("scripts")&&(new c({_dataModel:t,_playerObject:v}),x=!0),!N&&t.checkHasFeature("textdescriptions")&&(new s({_dataModel:t,_playerObject:v}),N=!0)}),e(v).on("progress",function(e){var n=this.buffered.length-1;if(n<0)var r=this.duration;else var r=this.buffered.end(n);var i=this.duration;i>0&&r>0&&t.trigger("oumpProgress",r/i)}),e(v).on("error",function(e){y.createErrorView(t)}),e(v).on("volumechange",function(e){var n;e.target.muted?n=0:n=e.target.volume,t.trigger("oumpUpdateVolumeChangeUI",n)}),t.on("oumpCaptionChange",function(e){if(!v.textTracks){oump.logger.log({type:"error",page:v.baseURI,item:"subtitles",msg:"textTracks not loaded properly for "+v.src,datetime:Date()});return}var t=!1;for(var n=0;n<v.textTracks.length;n++)v.textTracks[n].kind=="subtitles"&&v.textTracks[n].language==e.srclang&&v.textTracks[n].label==e.label?(v.textTracks[n].mode===0?v.textTracks[n].mode=2:v.textTracks[n].mode="showing",t=!0):v.textTracks[n].mode===2?v.textTracks[n].mode=0:v.textTracks[n].mode="hidden"}),t.on("oumpCaptionUpdate",function(){if(!v.textTracks)return;var t=!1;for(var n=0;n<v.textTracks.length;n++)if(v.textTracks[n].kind=="subtitles"){var r=v.textTracks[n].language;v.textTracks[n].mode===2||v.textTracks[n].mode==="showing"?(e("#"+g+'_fd_cc_selector option[value="'+r+'"]').attr("selected","selected"),t=!0):e("#"+g+'_fd_cc_selector option[value="'+r+'"]').removeAttr("selected")}}),t.on("oumpCheckCaptionActive",function(){this.trigger("oumpUpdateCaptionUI",y.trackShowing(v))}),t.on("oumpQualityChange",function(t){v.src=t,v.load(),e(v).one("loadedmetadata",function(){setTimeout(function(){e("#"+g+"_m_stop").click(),e("#"+g+"_m_playpause").click()},200)})}),t.on("oumpPlayPause",function(){if(v.paused){t.set("playerState","play");var n,r;for(n in oump.models)r=e("#"+n+"_"+oump.models[n].get("type"))[0],n!==g&&r&&r.readyState===4&&!r.paused&&oump.models[n].trigger("oumpPause");v.play(),t.trigger("oumpUpdatePlayPauseUI",!0),t.trigger("oumpShowControlBar")}else v.pause(),t.set("playerState","pause"),t.trigger("oumpUpdatePlayPauseUI",!1),t.trigger("oumpShowControlBar",{timeout:-1})}),t.on("oumpStop",function(){v.pause(),v.currentTime=0,t.set("seekTime",0),t.set("playerState","pause")}),t.on("oumpVolumeChange",function(e){e=parseFloat(e),e=e.toFixed(3),e=e<=0?0:e,e=e>=1?.99:e,this.set("volumePercent",e*100),this.set("volume",e),v.volume=e}),t.on("oumpSeeking",function(e){v&&(e=e<0?0:e,e=e>v.duration?v.duration:e,v.currentTime=e,t.set("seekTime",e))});var A=!1,O=!1,M=!1;v.requestFullscreen?(A=v.requestFullscreen,O="fullscreenchange"):v.msRequestFullscreen?(A=v.msRequestFullscreen,O="MSFullscreenChange"):v.mozRequestFullScreen?(A=v.mozRequestFullScreen,O="mozfullscreenchange"):v.webkitRequestFullscreen?(A=v.webkitRequestFullscreen,O="webkitfullscreenchange"):v.webkitEnterFullscreen&&(A=v.webkitEnterFullscreen,O="webkitfullscreenchange"),v.exitFullscreen||v.requestFullscreen?(M=v.exitFullscreen,O="fullscreenchange"):v.msRequestFullscreen?(A=v.msRequestFullscreen,O="MSFullscreenChange"):v.mozCancelFullScreen?(M=v.mozCancelFullScreen,O="mozfullscreenchange"):v.webkitExitFullscreen&&(M=document.webkitExitFullscreen,O="webkitfullscreenchange");if(t.get("type")==="video"&&!oump.ismobile){var _=e("#"+t.get("id")+"_media_wrapper");e("#"+t.get("id")+"_m_fullscreen").on("click",function(){A!==!1&&(t.get("isFullscreen")?(e("#"+t.get("id")+"_f_options").removeClass("omp-hidden"),O==="mozfullscreenchange"?document.mozCancelFullScreen():O==="MSFullscreenChange"?document.msExitFullscreen():O=="webkitfullscreenchange"?document.webkitExitFullscreen():oump.browserver=="edge"?document.exitFullscreen():M.call(v)):(e("#"+t.get("id")+"_f_options").addClass("omp-hidden"),O==="mozfullscreenchange"?v.parentNode.mozRequestFullScreen():O==="MSFullscreenChange"?v.parentNode.msRequestFullscreen():oump.browser=="safari"||oump.browserver=="edge"?A.call(v.parentNode):A.call(v.parentNode)),e("#"+t.get("id")+"_m_fullscreen").toggleClass("omp-caption-fullscreen-active"))}.bind(this)),O?e(document).on(O,function(n){setTimeout(function(){t.trigger("oumpResizer")},200);var r,i=e("#"+t.get("id")+"_video"),s=e("#"+t.get("id"));switch(n.type){case"fullscreenchange":r=document.fullscreenElement,r?_.append(e("#"+t.get("id")+"_controlbar")):_.after(_.children("div.omp-controlbar"));break;case"MSFullscreenChange":r=document.msFullscreenElement,r?(_.append(e("#"+t.get("id")+"_controlbar")),e(v.parentNode).addClass("ie-fullscreen")):(_.after(_.children("div.omp-controlbar")),e(v.parentNode).removeClass("ie-fullscreen"));break;case"mozfullscreenchange":r=document.mozFullScreenElement,r?_.append(e("#"+t.get("id")+"_controlbar")):(_.after(_.children("div.omp-controlbar")),i.removeClass("omp-margin-auto"),e(window).trigger("resize"));break;case"webkitfullscreenchange":r=document.webkitFullscreenElement,r?(e(".omp-wrapper").css("z-index","0"),_.append(e("#"+t.get("id")+"_controlbar"))):(_.after(_.children("div.omp-controlbar")),i.removeClass("omp-margin-auto"),e(window).trigger("resize"),e(".omp-wrapper").css("z-index","auto"))}var o=e("#"+g+"_m_playpause");r===null||r!==v&&r!==v.parentNode?(oump.browser!="safari"&&i.removeClass("omp-margin-auto"),s.removeClass("fullscreen"),e(v).removeAttr("controls"),t.trigger("oumpToggleFullscreenUI"),t.trigger("oumpUpdateCaptionUI",y.trackShowing(v)),t.set("isFullscreen",!1),e("#"+t.get("id")+"_m_fullscreen").removeClass("omp-caption-fullscreen-active"),e("#"+g).css("cursor",""),e("#"+g).off("mousemove"),o.off("keydown"),e(v).off("blur"),e(v).off("playing pause seeked"),t.trigger("oumpShowControlBar")):(oump.browser!="safari"&&i.addClass("omp-margin-auto"),s.addClass("fullscreen"),t.set("isFullscreen",!0),e("#"+g+" .omp-controlbar").hover(function(){t.trigger("oumpShowControlBar")}),e("#"+g).mousemove(function(){(!i.get(0).paused||Math.floor(i.get(0).currentTime)==Math.floor(i.get(0).duration)||i.get(0).currentTime==0)&&t.trigger("oumpShowControlBar")}),oump.ismobile||o.focus(),e(v).on("playing",function(){t.trigger("playerPlay")}),e(v).on("pause",function(){t.trigger("playerPause")}),e(v).on("seeked",function(e){t.trigger("playerSeeked",e.target.currentTime)}))}):window.setInterval(function(){t.trigger("oumpUpdateCaptionUI",y.trackShowing(v))},1e3)}t.get("type")==="video"&&window.oump.ismobile&&e(document).on(O,function(e){t.trigger("oumpUpdatePlayPauseUI",!v.paused)}),t.on("oump_seekback",function(){this.trigger("oumpSeeking",v.currentTime-1),t.get("isFullscreen")&&t.trigger("oumpShowControlBar")}),t.on("oump_seekforwards",function(){this.trigger("oumpSeeking",v.currentTime+1),t.get("isFullscreen")&&t.trigger("oumpShowControlBar")}),t.on("oump_jumpback",function(){var e=v.currentTime-v.duration/10;this.trigger("oumpSeeking",e)}),t.on("oump_jumpforwards",function(){var e=v.currentTime+v.duration/10;this.trigger("oumpSeeking",e)}),t.on("oump_start",function(){this.trigger("oumpSeeking",0)}),t.on("oump_end",function(){this.trigger("oump_seeking",v.duration-1)}),t.on("oumpPause",function(){v.paused||this.trigger("oumpPlayPause")}),t.on("oumpPlay",function(){v.paused&&this.trigger("oumpPlayPause")}),e(v).click(function(n){n.stopPropagation();if(t.get("isFullscreen")&&/firefox/.test(oump.browser))return;e("#"+g+"_video_lenghth").addClass("omp-hidden"),e("#"+g+"_m_playpause").click()}),oump.ismobile||e("#"+g+"_m_playpause").click(),setTimeout(function(){e("#"+g).focus()},50),t.on("change:qualityActive",function(){this.trigger("oumpQualityChange",this.get("qualityActive"))}),t.trigger("oumpResizer")}}window.tabOrder.attachView(e("#"+g),t)}});return b}),define("text!templates/controls/base_custom.html",[],function(){return'\n<div id="<%= id %>"\n<% if (activeSizing == \'fixed\') { %>\nclass="omp-wrapper omp-fixed <% if(oump.browser == \'msie\') { %> ie<% } %>"\n<% } else if (activeSizing == \'custom\') { %>\nclass="omp-wrapper omp-custom <% if(oump.browser == \'msie\') { %> ie<% } %>"\n<% } else { %>\nclass="omp-wrapper omp-<%= activeSizing %> <% if(oump.browser == \'msie\') { %> ie<% } %>"\n<% } %>\n<% if (sizing == \'fixed\') {\n    var parentWidth = $(\'#\' + id)[0].parentNode.offsetWidth;\n    if (parentWidth < width) {\n        width = parentWidth;\n    } %>\nstyle="width: <%= width %>px !important;"\n<% } else if (sizing == \'custom\') { %>\nstyle="max-width: <%= width %>px !important;"\n<% } %>\n<% if (oump.ismobile) { %>\n    data-device="mobile"\n<% } %>\ndata-end="end"\ntabindex="<%= tabs.start %>"\n>\n\n<!--[if lte IE 8]>\n<div id="<%= id %>_ie8_fallback" class="omp-ie8-fallback omp-ie8-fallback-<%= type %>">\n</div>\n<![endif]-->\n\n\n\n<a href="#<%= id %>_skip_media" class="omp-accesshide omp-skipmedia">\n    Skip <%= type %>: <% if (title != undefined && title !== false) { %><%= title.replace(/(<([^>]+)>)/ig,"") %><% } %>\n</a>\n\n<img id="<%= id %>_poster" src="<%= poster %>" style="width: 100%; display: none;" />\n\n<%\nvar _class = \'omp-controlbar\';\nif ( (isOtherProvider && (!features.hasPlaylist || !hasPlaylist)) ||\n    (!features.hasTracksChapters && !features.hasTranscript && (!features.hasPlaylist || !hasPlaylist))) {\nvar _class = \'omp-controlbar-hidden\';\n}\n%>\n\n<div class="<%= _class %> custom_player <% if (oump.ismobile) { %>omp-transparent<% } %> <% if (oump.isphone) { %>omp-hidden<% } %>" id="<%= id %>_controlbar">\n\n    <div class="omp-controlbar-row" id="<%= id %>_controlbar_row">\n        <div class="omp-othercontrols-wrapper">\n            <div id="<%= id %>_controls_left" class="omp-controls-left <% if (!features.hasBasicControls || oump.isphone) { %>omp-hidden<% } %>">\n\n            </div>\n            <div id="<%= id %>_controls_right" class="omp-controls-right">\n                <% if (hasPlaylist && features.hasPlaylist) { %>\n                <div class="omp-inline ">\n                    <button type="button" id="<%= id %>_f_playlist_max"  class="omp-btn omp-settings-toogle <%= showButtons != \'undefined\' && showButtons ? \'\' : \'omp-setting-link\' %>  omp-playlist-custom-setting"\n                            tabindex="<%= tabs.settings %>" omp-tab-feature="playlist"\n                            omp-settings-toogle="<%= playlistActive %>"\n                            omp-settings-key="playlistActive"\n                            aria-label="<%= labels.playlist %>">\n							<span id="<%= id %>_f_playlist_link"\n                                  class="<% if (playlistActive) { %> omp-active <% } %>">\n								<%= labels.playlist %>\n							</span>\n                    </button>\n                </div>\n                <% } %>\n\n                <% if (features.hasTracksChapters) { %>\n                <div class="omp-inline <%= showButtons != \'undefined\' && showButtons ? \'omp-hidden\' : \'\' %> " id="<%= id %>_f_ch_link">\n                    <button type="button" id="<%= id %>_f_chapters_max"  class="omp-settings-toogle omp-chapter-custom-setting"\n                            tabindex="<%= tabs.settings %>" omp-tab-feature="chapter"\n                            omp-settings-toogle="<%= chapterActive %>"\n                            omp-settings-key="chapterActive"\n                            aria-label="<%= labels.chapters %>">\n                    <span id="<%= id %>_f_chapters_link"\n                          class="<% if (chapterActive) { %> omp-active <% } %>">\n                        <%= labels.chapters %>\n                    </span>\n                    </button>\n                </div>\n                <% } %>\n\n                <% if (features.hasTranscript) { %>\n                <div class="omp-inline <%= showButtons != \'undefined\' && showButtons ? \'omp-hidden\' : \'\' %>" id="<%= id %>_f_tr_link">\n                    <button type="button" id="<%= id %>_f_transcript_max" class="omp-btn omp-settings-toogle omp-transcript-custom-setting"\n                            tabindex="<%= tabs.settings %>" omp-tab-feature="transcript"\n                            omp-settings-toogle="<%= transcriptActive %>"\n                            omp-settings-key="transcriptActive"\n                            aria-label="<%= labels.transcript %>">\n                    <span id="<%= id %>_f_transcript_link"\n                          class="<% if (transcriptActive) { %> omp-active <% } %>">\n                        <%= labels.transcript %>\n                    </span>\n                    </button>\n                </div>\n                <% } %>\n\n                <div id="<%= id %>_options_dialog" class="omp-options-dialog omp-hidden">\n                    <div id="<%= id %>_options_dialog_min" class="omp-min lightbox">\n                    </div>\n                </div>\n            </div>\n            <div class="omp-clearer"></div>\n        </div>\n    </div>\n</div>\n<div id="<%= id %>_features_dialog" class="omp-controlbar-row">\n    <div class="omp-features-wrapper">\n        <div class="omp-features-options" id="<%= id %>_f_options">\n            <div id="<%= id %>_f_mi">\n            </div>\n            <% if (features.hasTracksSubtitles) { %>\n            <div id="<%= id %>_fd_cc" class="omp-cc-options omp-hidden">\n                <div class="omp-float-right omp-margin-left">\n                    <a id="<%= id %>_fd_cc_close" href="" role="button">Close</a>\n                </div>\n                <label for="<%= id %>_fd_cc_selector"><%= labels.closedCaptions %></label>\n                <select id="<%= id %>_fd_cc_selector">\n                    <option value="none">None</option>\n                    <% tracksSubtitles.forEach(function(tracksSubtitle, index) { %>\n                    <option value="<%= tracksSubtitle.srclang %>"><%= tracksSubtitle.label %></option>\n                    <% }); %>\n                </select>\n            </div>\n            <% } %>\n\n            <%if (features.hasTracksChapters) { %>\n            <div id="<%= id %>_fd_c" class="omp-feature-chapters omp-chapters-section">\n            </div>\n            <% } %>\n\n            <% if (features.hasTranscript) { %>\n            <div id="<%= id %>_fd_t" class="omp-fd-transcript omp-hidden" >\n\n            </div>\n            <% } %>\n\n            <% if (features.hasDownload) { %>\n            <div id="<%= id %>_fd_download" class="omp-fd-download omp-hidden"></div>\n            <% } %>\n        </div>\n    </div>\n</div>\n<span id="<%= id %>_skip_media"></span>\n<div id="<%= id %>_audiodescription" ></div>\n\n<a id="<%= id %>_tab_end" href="#" class="omp-media-tab-end omp-hidden" tabindex="<%= tabs.end %>"\n   aria-label="<%= labels.exitMedia  %>"></a>\n</div>\n'}),define("app/views/controls_base_custom",["jquery","jquery","underscore","backbone","text!templates/controls/base_custom.html"],function(e,t,n,r,i){"use strict";var s=r.View.extend({template:i,render:function(){var e=n.template(this.template),t=e(this.model.toJSON());return this.$el.html(t),this}});return s}),define("app/base_custom",["jquery","jqueryui","underscore","backbone","app/views/controls_base_custom","draggabilly"],function(e,t,n,r,i,s){"use strict";var o=r.Model.extend({init:function(t){var n=t.get("id"),r=new i({model:t}),s=e("#"+n),o=!0;window.oump["timeout_"+t.id]=null,r&&s&&s.replaceWith(r.render().el.childNodes)}});return o}),define("app/html5_consumer",["backbone","underscore","app/helpers/utilities","app/html5","app/helpers/external_consumer","app/base_custom","app/helpers/hook/media_info_hook","app/helpers/hook/global_setting_hook","app/helpers/hook/transcript_hook","app/helpers/hook/chapter_hook","app/helpers/hook/download_hook"],function(e,t,n,r,i,s,o,u,a,f,l){"use strict";var c=s.extend({init:function(e){this.dataModel=e,this.dataModel.set("hasShare",!1),this.dataModel.set("showButtons",!0);var t=$("#"+this.dataModel.get("id"));e.get("currentPlaylist").attachPlayer(null),window.tabOrder.attachView(t,e),this.dataModel.set("isOtherProvider",!0),this.constructor.__super__.init.apply(this,arguments),this.dataModel.get("externalConsumer").fetchMediaContent(function(){this.dataModel.get("externalConsumer").renderMediaView("manifest"),new o({_dataModel:e,_playerObject:{}})}.bind(this)),new u(this.dataModel)}});return c}),define("app/views/video_ouflash",["jquery","jquery","underscore","backbone","app/tpl"],function(e,t,n,r,i){"use strict";var s=r.View.extend({template:i.tplVideoOUFlash,render:function(){var e=n.template(this.template),t=this.model.toJSON();t.computedheight=this.computeHeight();var r=e(t);return this.$el.html(r),this},computeHeight:function(){var t=this.model.id;if(this.model.get("orig_width"))var n=this.model.get("orig_height")/this.model.get("orig_width");else n=.825;var r=e("#"+t)[0].offsetWidth;return r*n}});return s}),define("app/views/audio_ouflash",["jquery","jquery","underscore","backbone","app/tpl"],function(e,t,n,r,i){"use strict";var s=r.View.extend({template:i.tplAudioOUFlash,render:function(){var e=n.template(this.template),t=e(this.model.toJSON());return this.$el.html(t),this}});return s}),define("app/ouflash",["jquery","jquery","underscore","backbone","app/events","app/base_custom","app/views/video_ouflash","app/views/audio_ouflash","app/helpers/hook/media_info_hook","app/helpers/hook/global_setting_hook","app/helpers/hook/transcript_hook","app/helpers/hook/chapter_hook","app/helpers/hook/download_hook"],function(e,t,n,r,i,s,o,u,a,f,l,c,h){"use strict";var p=s.extend({init:function(t){this.constructor.__super__.init.apply(this,arguments);var n=!1;t.get("type")=="video"&&(n=new o({model:t})),t.get("type")=="audio"&&(n=new u({model:t})),n&&e("#"+t.get("id")+"_poster")&&(e("#"+t.get("id")+"_poster").replaceWith(n.render().el.childNodes),t.checkHasFeature("mediainfo")&&new a({_dataModel:t,_playerObject:{}}),new f(t),t.checkHasFeature("download")&&new h({_dataModel:t}),t.checkHasFeature("chapters")&&new c({_dataModel:t}),t.checkHasFeature("transcripts")&&new l({_dataModel:t,_playerObject:{}}),t.get("currentPlaylist").attachPlayer(null),window.tabOrder.attachView(e("#"+t.get("id")),t))}});return p}),define("app/nls/en/labels",{play:"Play",stop:"Stop",mute:"Mute",unmute:"Unmute",pause:"Pause",replay:"Replay",volumeBar:"Volume Bar – Use UP or DOWN key to adjust volume",lengthOfTime:"Length of Time",fullscreen:"Fullscreen",exitFullscreen:"Exit Fullscreen",options:"Options",playlist:"Playlist",pl:"Pl",chapters:"Chapters",ch:"Ch",transcript:"Transcript",tr:"Tr",download:"Download",downloads:"Downloads",settings:"Settings",autoplay:"Autoplay",annotations:"Annotations",quality:"Quality",language:"Language","default":"Default",close:"Close",on:"On",off:"Off",next:" Next",previous:"Previous",expand:"Expand",collapse:"Collapse",share:"Share",shareCode:"Share code",showMore:"Show more",showLess:"Show less",document:"Document",progressBar:"Progress Bar",playCursor:"Play Cursor",closedCaptions:"Closed Captions (Subtitles)",closedCaptionsOn:"Closed Captions (Subtitles) on",closedCaptionsTurnOn:"Click to turn on closed captions (subtitles)",closedCaptionsTurnOff:"Click to turn off closed captions (subtitles)",textDescription:"Text Description",textDescriptionTurnOn:"Click to turn on text description mode",textDescriptionTurnOff:"Click to turn off text description mode",audioDescription:"Audio description",audioDescriptionTurnOn:"Click to turn on audio description mode",audioDescriptionTurnOff:"Click to turn off audio description mode",playlistTurnOn:"Click to turn on playlist mode",playlistTurnOff:"Click to turn off playlist mode",chapterTurnOn:"Click to turn on chapter mode",chapterTurnOff:"Click to turn off chapter mode",transcriptTurnOn:"Click to turn on transcript mode",transcriptTurnOff:"Click to turn off transcript mode",autoplayTurnOn:"Click to turn on autoplay mode",autoplayTurnOff:"Click to turn off autoplay mode",annotationsTurnOn:"Click to turn on annotations mode",annotationsTurnOff:"Click to turn off annotations mode",clickSelectQuality:"Click to select another quality",clickSelectLanguage:"Click to select another language",clickToStart:"Click to start the media player",clickOrPressToStart:"Click or press enter to start the media player",interactive:"Interactive",interactiveModeOn:"Click to turn on interactive mode",interactiveModeOff:"Click to turn off interactive mode",print:"Print",printClick:"Click to print transcript",copy:"Copy",copyClick:"Click to copy transcript",chaptersClick:"Click to select other chapter type",downloadIntro:"You can download these files for use offline or on mobile device.",fileUnavailable:"We’re sorry for the inconvenience, this file is unavailable.",contentUnavailable:"We’re sorry for the inconvenience, this content is unavailable.",qualityUnavailable:"We’re sorry for the inconvenience, this quality is unavailable.",nextPlaylist:"Next playlist item starting shortly",chapterMarkers:"Chapter markers",chapterMarkersOn:"Click to turn on chapter markers",chapterMarkersOff:"Click to turn off chapter markers",loading:"Please wait a moment, this content is loading...",playlistUnavailable:"Content not available in this format, please return to website.",anotationtitle:"Annotations",exitMedia:"Exit media player",openNewWindow:"Press enter to open in new window"}),define("app/nls/fr/labels",{play:"Play",stop:"Stop",mute:"Mute",unmute:"Unmute",pause:"Pause",replay:"Replay",volumeBar:"Volume Bar – Use UP or DOWN key to adjust volume",lengthOfTime:"Length of Time",fullscreen:"Fullscreen",exitFullscreen:"Exit Fullscreen",options:"Options",playlist:"Playlist",pl:"Pl",chapters:"Chapters",ch:"Ch",transcript:"Transcript",tr:"Tr",download:"Download",downloads:"Downloads",settings:"Settings",autoplay:"Autoplay",annotations:"Annotations",quality:"Quality",language:"Language","default":"Default",close:"Close",on:"On",off:"Off",next:" Next",previous:"Previous",expand:"Expand",collapse:"Collapse",share:"Share",shareCode:"Share code",showMore:"Show more",showLess:"Show less",document:"Document",progressBar:"Progress Bar",playCursor:"Play Cursor",closedCaptions:"Closed Captions (Subtitles)",closedCaptionsOn:"Closed Captions (Subtitles) on",closedCaptionsTurnOn:"Click to turn on closed captions (subtitles)",closedCaptionsTurnOff:"Click to turn off closed captions (subtitles)",textDescription:"Text Description",textDescriptionTurnOn:"Click to turn on text description mode",textDescriptionTurnOff:"Click to turn off text description mode",audioDescription:"Audio description",audioDescriptionTurnOn:"Click to turn on audio description mode",audioDescriptionTurnOff:"Click to turn off audio description mode",playlistTurnOn:"Click to turn on playlist mode",playlistTurnOff:"Click to turn off playlist mode",chapterTurnOn:"Click to turn on chapter mode",chapterTurnOff:"Click to turn off chapter mode",transcriptTurnOn:"Click to turn on transcript mode",transcriptTurnOff:"Click to turn off transcript mode",autoplayTurnOn:"Click to turn on autoplay mode",autoplayTurnOff:"Click to turn off autoplay mode",annotationsTurnOn:"Click to turn on annotations mode",annotationsTurnOff:"Click to turn off annotations mode",clickSelectQuality:"Click to select another quality",clickSelectLanguage:"Click to select another language",clickToStart:"Click to start the media player",clickOrPressToStart:"Click or press enter to start the media player",interactive:"Interactive",interactiveModeOn:"Click to turn on interactive mode",interactiveModeOff:"Click to turn off interactive mode",print:"Print",printClick:"Click to print transcript",copy:"Copy",copyClick:"Click to copy transcript",chaptersClick:"Click to select other chapter type",downloadIntro:"You can download these files for use offline or on mobile device.",fileUnavailable:"We’re sorry for the inconvenience, this file is unavailable.",contentUnavailable:"We’re sorry for the inconvenience, this content is unavailable.",qualityUnavailable:"We’re sorry for the inconvenience, this quality is unavailable.",nextPlaylist:"Next playlist item starting shortly",chapterMarkers:"Chapter markers",chapterMarkersOn:"Click to turn on chapter markers",chapterMarkersOff:"Click to turn off chapter markers",loading:"Please wait a moment, this content is loading...",playlistUnavailable:"Content not available in this format, please return to website.",anotationtitle:"Annotations",exitMedia:"Exit media player",openNewWindow:"Press enter to open in new window"}),define("app/nls/es/labels",{play:"Play",stop:"Stop",mute:"Mute",unmute:"Unmute",pause:"Pause",replay:"Replay",volumeBar:"Volume Bar – Use UP or DOWN key to adjust volume",lengthOfTime:"Length of Time",fullscreen:"Fullscreen",exitFullscreen:"Exit Fullscreen",options:"Options",playlist:"Playlist",pl:"Pl",chapters:"Chapters",ch:"Ch",transcript:"Transcript",tr:"Tr",download:"Download",downloads:"Downloads",settings:"Settings",autoplay:"Autoplay",annotations:"Annotations",quality:"Quality",language:"Language","default":"Default",close:"Close",on:"On",off:"Off",next:" Next",previous:"Previous",expand:"Expand",collapse:"Collapse",share:"Share",shareCode:"Share code",showMore:"Show more",showLess:"Show less",document:"Document",progressBar:"Progress Bar",playCursor:"Play Cursor",closedCaptions:"Closed Captions (Subtitles)",closedCaptionsOn:"Closed Captions (Subtitles) on",closedCaptionsTurnOn:"Click to turn on closed captions (subtitles)",closedCaptionsTurnOff:"Click to turn off closed captions (subtitles)",textDescription:"Text Description",textDescriptionTurnOn:"Click to turn on text description mode",textDescriptionTurnOff:"Click to turn off text description mode",audioDescription:"Audio description",audioDescriptionTurnOn:"Click to turn on audio description mode",audioDescriptionTurnOff:"Click to turn off audio description mode",playlistTurnOn:"Click to turn on playlist mode",playlistTurnOff:"Click to turn off playlist mode",chapterTurnOn:"Click to turn on chapter mode",chapterTurnOff:"Click to turn off chapter mode",transcriptTurnOn:"Click to turn on transcript mode",transcriptTurnOff:"Click to turn off transcript mode",autoplayTurnOn:"Click to turn on autoplay mode",autoplayTurnOff:"Click to turn off autoplay mode",annotationsTurnOn:"Click to turn on annotations mode",annotationsTurnOff:"Click to turn off annotations mode",clickSelectQuality:"Click to select another quality",clickSelectLanguage:"Click to select another language",clickToStart:"Click to start the media player",clickOrPressToStart:"Click or press enter to start the media player",interactive:"Interactive",interactiveModeOn:"Click to turn on interactive mode",interactiveModeOff:"Click to turn off interactive mode",print:"Print",printClick:"Click to print transcript",copy:"Copy",copyClick:"Click to copy transcript",chaptersClick:"Click to select other chapter type",downloadIntro:"You can download these files for use offline or on mobile device.",fileUnavailable:"We’re sorry for the inconvenience, this file is unavailable.",contentUnavailable:"We’re sorry for the inconvenience, this content is unavailable.",qualityUnavailable:"We’re sorry for the inconvenience, this quality is unavailable.",nextPlaylist:"Next playlist item starting shortly",chapterMarkers:"Chapter markers",chapterMarkersOn:"Click to turn on chapter markers",chapterMarkersOff:"Click to turn off chapter markers",loading:"Please wait a moment, this content is loading...",playlistUnavailable:"Content not available in this format, please return to website.",anotationtitle:"Annotations",exitMedia:"Exit media player",openNewWindow:"Press enter to open in new window"}),define("app/nls/de/labels",{play:"Play",stop:"Stop",mute:"Mute",unmute:"Unmute",pause:"Pause",replay:"Replay",volumeBar:"Volume Bar – Use UP or DOWN key to adjust volume",lengthOfTime:"Length of Time",fullscreen:"Fullscreen",exitFullscreen:"Exit Fullscreen",options:"Options",playlist:"Playlist",pl:"Pl",chapters:"Chapters",ch:"Ch",transcript:"Transcript",tr:"Tr",download:"Download",downloads:"Downloads",settings:"Settings",autoplay:"Autoplay",annotations:"Annotations",quality:"Quality",language:"Language","default":"Default",close:"Close",on:"On",off:"Off",next:" Next",previous:"Previous",expand:"Expand",collapse:"Collapse",share:"Share",shareCode:"Share code",showMore:"Show more",showLess:"Show less",document:"Document",progressBar:"Progress Bar",playCursor:"Play Cursor",closedCaptions:"Closed Captions (Subtitles)",closedCaptionsOn:"Closed Captions (Subtitles) on",closedCaptionsTurnOn:"Click to turn on closed captions (subtitles)",closedCaptionsTurnOff:"Click to turn off closed captions (subtitles)",textDescription:"Text Description",textDescriptionTurnOn:"Click to turn on text description mode",textDescriptionTurnOff:"Click to turn off text description mode",audioDescription:"Audio description",audioDescriptionTurnOn:"Click to turn on audio description mode",audioDescriptionTurnOff:"Click to turn off audio description mode",playlistTurnOn:"Click to turn on playlist mode",playlistTurnOff:"Click to turn off playlist mode",chapterTurnOn:"Click to turn on chapter mode",chapterTurnOff:"Click to turn off chapter mode",transcriptTurnOn:"Click to turn on transcript mode",transcriptTurnOff:"Click to turn off transcript mode",autoplayTurnOn:"Click to turn on autoplay mode",autoplayTurnOff:"Click to turn off autoplay mode",annotationsTurnOn:"Click to turn on annotations mode",annotationsTurnOff:"Click to turn off annotations mode",clickSelectQuality:"Click to select another quality",clickSelectLanguage:"Click to select another language",clickToStart:"Click to start the media player",clickOrPressToStart:"Click or press enter to start the media player",interactive:"Interactive",interactiveModeOn:"Click to turn on interactive mode",interactiveModeOff:"Click to turn off interactive mode",print:"Print",printClick:"Click to print transcript",copy:"Copy",copyClick:"Click to copy transcript",chaptersClick:"Click to select other chapter type",downloadIntro:"You can download these files for use offline or on mobile device.",fileUnavailable:"We’re sorry for the inconvenience, this file is unavailable.",contentUnavailable:"We’re sorry for the inconvenience, this content is unavailable.",qualityUnavailable:"We’re sorry for the inconvenience, this quality is unavailable.",nextPlaylist:"Next playlist item starting shortly",chapterMarkers:"Chapter markers",chapterMarkersOn:"Click to turn on chapter markers",chapterMarkersOff:"Click to turn off chapter markers",loading:"Please wait a moment, this content is loading...",playlistUnavailable:"Content not available in this format, please return to website.",anotationtitle:"Annotations",exitMedia:"Exit media player",openNewWindow:"Press enter to open in new window"}),define("app/nls/zh/labels",{play:"Play",stop:"Stop",mute:"Mute",unmute:"Unmute",pause:"Pause",replay:"Replay",volumeBar:"Volume Bar – Use UP or DOWN key to adjust volume",lengthOfTime:"Length of Time",fullscreen:"Fullscreen",exitFullscreen:"Exit Fullscreen",options:"Options",playlist:"Playlist",pl:"Pl",chapters:"Chapters",ch:"Ch",transcript:"Transcript",tr:"Tr",download:"Download",downloads:"Downloads",settings:"Settings",autoplay:"Autoplay",annotations:"Annotations",quality:"Quality",language:"Language","default":"Default",close:"Close",on:"On",off:"Off",next:" Next",previous:"Previous",expand:"Expand",collapse:"Collapse",share:"Share",shareCode:"Share code",showMore:"Show more",showLess:"Show less",document:"Document",progressBar:"Progress Bar",playCursor:"Play Cursor",closedCaptions:"Closed Captions (Subtitles)",closedCaptionsOn:"Closed Captions (Subtitles) on",closedCaptionsTurnOn:"Click to turn on closed captions (subtitles)",closedCaptionsTurnOff:"Click to turn off closed captions (subtitles)",textDescription:"Text Description",textDescriptionTurnOn:"Click to turn on text description mode",textDescriptionTurnOff:"Click to turn off text description mode",audioDescription:"Audio description",audioDescriptionTurnOn:"Click to turn on audio description mode",audioDescriptionTurnOff:"Click to turn off audio description mode",playlistTurnOn:"Click to turn on playlist mode",playlistTurnOff:"Click to turn off playlist mode",chapterTurnOn:"Click to turn on chapter mode",chapterTurnOff:"Click to turn off chapter mode",transcriptTurnOn:"Click to turn on transcript mode",transcriptTurnOff:"Click to turn off transcript mode",autoplayTurnOn:"Click to turn on autoplay mode",autoplayTurnOff:"Click to turn off autoplay mode",annotationsTurnOn:"Click to turn on annotations mode",annotationsTurnOff:"Click to turn off annotations mode",clickSelectQuality:"Click to select another quality",clickSelectLanguage:"Click to select another language",clickToStart:"Click to start the media player",clickOrPressToStart:"Click or press enter to start the media player",interactive:"Interactive",interactiveModeOn:"Click to turn on interactive mode",interactiveModeOff:"Click to turn off interactive mode",print:"Print",printClick:"Click to print transcript",copy:"Copy",copyClick:"Click to copy transcript",chaptersClick:"Click to select other chapter type",downloadIntro:"You can download these files for use offline or on mobile device.",fileUnavailable:"We’re sorry for the inconvenience, this file is unavailable.",contentUnavailable:"We’re sorry for the inconvenience, this content is unavailable.",qualityUnavailable:"We’re sorry for the inconvenience, this quality is unavailable.",nextPlaylist:"Next playlist item starting shortly",chapterMarkers:"Chapter markers",chapterMarkersOn:"Click to turn on chapter markers",chapterMarkersOff:"Click to turn off chapter markers",loading:"Please wait a moment, this content is loading...",playlistUnavailable:"Content not available in this format, please return to website.",anotationtitle:"Annotations",exitMedia:"Exit media player",openNewWindow:"Press enter to open in new window"}),define("app/nls/pl/labels",{play:"Play",stop:"Stop",mute:"Mute",unmute:"Unmute",pause:"Pause",replay:"Replay",volumeBar:"Volume Bar – Use UP or DOWN key to adjust volume",lengthOfTime:"Length of Time",fullscreen:"Fullscreen",exitFullscreen:"Exit Fullscreen",options:"Options",playlist:"Playlist",pl:"Pl",chapters:"Chapters",ch:"Ch",transcript:"Transcript",tr:"Tr",download:"Download",downloads:"Downloads",settings:"Settings",autoplay:"Autoplay",annotations:"Annotations",quality:"Quality",language:"Language","default":"Default",close:"Close",on:"On",off:"Off",next:" Next",previous:"Previous",expand:"Expand",collapse:"Collapse",share:"Share",shareCode:"Share code",showMore:"Show more",showLess:"Show less",document:"Document",progressBar:"Progress Bar",playCursor:"Play Cursor",closedCaptions:"Closed Captions (Subtitles)",closedCaptionsOn:"Closed Captions (Subtitles) on",closedCaptionsTurnOn:"Click to turn on closed captions (subtitles)",closedCaptionsTurnOff:"Click to turn off closed captions (subtitles)",textDescription:"Text Description",textDescriptionTurnOn:"Click to turn on text description mode",textDescriptionTurnOff:"Click to turn off text description mode",audioDescription:"Audio description",audioDescriptionTurnOn:"Click to turn on audio description mode",audioDescriptionTurnOff:"Click to turn off audio description mode",playlistTurnOn:"Click to turn on playlist mode",playlistTurnOff:"Click to turn off playlist mode",chapterTurnOn:"Click to turn on chapter mode",chapterTurnOff:"Click to turn off chapter mode",transcriptTurnOn:"Click to turn on transcript mode",transcriptTurnOff:"Click to turn off transcript mode",autoplayTurnOn:"Click to turn on autoplay mode",autoplayTurnOff:"Click to turn off autoplay mode",annotationsTurnOn:"Click to turn on annotations mode",annotationsTurnOff:"Click to turn off annotations mode",clickSelectQuality:"Click to select another quality",clickSelectLanguage:"Click to select another language",clickToStart:"Click to start the media player",clickOrPressToStart:"Click or press enter to start the media player",interactive:"Interactive",interactiveModeOn:"Click to turn on interactive mode",interactiveModeOff:"Click to turn off interactive mode",print:"Print",printClick:"Click to print transcript",copy:"Copy",copyClick:"Click to copy transcript",chaptersClick:"Click to select other chapter type",downloadIntro:"You can download these files for use offline or on mobile device.",fileUnavailable:"We’re sorry for the inconvenience, this file is unavailable.",contentUnavailable:"We’re sorry for the inconvenience, this content is unavailable.",qualityUnavailable:"We’re sorry for the inconvenience, this quality is unavailable.",nextPlaylist:"Next playlist item starting shortly",chapterMarkers:"Chapter markers",chapterMarkersOn:"Click to turn on chapter markers",chapterMarkersOff:"Click to turn off chapter markers",loading:"Please wait a moment, this content is loading...",playlistUnavailable:"Content not available in this format, please return to website.",anotationtitle:"Annotations",exitMedia:"Exit media player",openNewWindow:"Press enter to open in new window"}),define("app/nls/pt/labels",{play:"Play",stop:"Stop",mute:"Mute",unmute:"Unmute",pause:"Pause",replay:"Replay",volumeBar:"Volume Bar – Use UP or DOWN key to adjust volume",lengthOfTime:"Length of Time",fullscreen:"Fullscreen",exitFullscreen:"Exit Fullscreen",options:"Options",playlist:"Playlist",pl:"Pl",chapters:"Chapters",ch:"Ch",transcript:"Transcript",tr:"Tr",download:"Download",downloads:"Downloads",settings:"Settings",autoplay:"Autoplay",annotations:"Annotations",quality:"Quality",language:"Language","default":"Default",close:"Close",on:"On",off:"Off",next:" Next",previous:"Previous",expand:"Expand",collapse:"Collapse",share:"Share",shareCode:"Share code",showMore:"Show more",showLess:"Show less",document:"Document",progressBar:"Progress Bar",playCursor:"Play Cursor",closedCaptions:"Closed Captions (Subtitles)",closedCaptionsOn:"Closed Captions (Subtitles) on",closedCaptionsTurnOn:"Click to turn on closed captions (subtitles)",closedCaptionsTurnOff:"Click to turn off closed captions (subtitles)",textDescription:"Text Description",textDescriptionTurnOn:"Click to turn on text description mode",textDescriptionTurnOff:"Click to turn off text description mode",audioDescription:"Audio description",audioDescriptionTurnOn:"Click to turn on audio description mode",audioDescriptionTurnOff:"Click to turn off audio description mode",playlistTurnOn:"Click to turn on playlist mode",playlistTurnOff:"Click to turn off playlist mode",chapterTurnOn:"Click to turn on chapter mode",chapterTurnOff:"Click to turn off chapter mode",transcriptTurnOn:"Click to turn on transcript mode",transcriptTurnOff:"Click to turn off transcript mode",autoplayTurnOn:"Click to turn on autoplay mode",autoplayTurnOff:"Click to turn off autoplay mode",annotationsTurnOn:"Click to turn on annotations mode",annotationsTurnOff:"Click to turn off annotations mode",clickSelectQuality:"Click to select another quality",clickSelectLanguage:"Click to select another language",clickToStart:"Click to start the media player",clickOrPressToStart:"Click or press enter to start the media player",interactive:"Interactive",interactiveModeOn:"Click to turn on interactive mode",interactiveModeOff:"Click to turn off interactive mode",print:"Print",printClick:"Click to print transcript",copy:"Copy",copyClick:"Click to copy transcript",chaptersClick:"Click to select other chapter type",downloadIntro:"You can download these files for use offline or on mobile device.",fileUnavailable:"We’re sorry for the inconvenience, this file is unavailable.",contentUnavailable:"We’re sorry for the inconvenience, this content is unavailable.",qualityUnavailable:"We’re sorry for the inconvenience, this quality is unavailable.",nextPlaylist:"Next playlist item starting shortly",chapterMarkers:"Chapter markers",chapterMarkersOn:"Click to turn on chapter markers",chapterMarkersOff:"Click to turn off chapter markers",loading:"Please wait a moment, this content is loading...",playlistUnavailable:"Content not available in this format, please return to website.",anotationtitle:"Annotations",exitMedia:"Exit media player",openNewWindow:"Press enter to open in new window"}),define("app/nls/ja/labels",{play:"Play",stop:"Stop",mute:"Mute",unmute:"Unmute",pause:"Pause",replay:"Replay",volumeBar:"Volume Bar – Use UP or DOWN key to adjust volume",lengthOfTime:"Length of Time",fullscreen:"Fullscreen",exitFullscreen:"Exit Fullscreen",options:"Options",playlist:"Playlist",pl:"Pl",chapters:"Chapters",ch:"Ch",transcript:"Transcript",tr:"Tr",download:"Download",downloads:"Downloads",settings:"Settings",autoplay:"Autoplay",annotations:"Annotations",quality:"Quality",language:"Language","default":"Default",close:"Close",on:"On",off:"Off",next:" Next",previous:"Previous",expand:"Expand",collapse:"Collapse",share:"Share",shareCode:"Share code",showMore:"Show more",showLess:"Show less",document:"Document",progressBar:"Progress Bar",playCursor:"Play Cursor",closedCaptions:"Closed Captions (Subtitles)",closedCaptionsOn:"Closed Captions (Subtitles) on",closedCaptionsTurnOn:"Click to turn on closed captions (subtitles)",closedCaptionsTurnOff:"Click to turn off closed captions (subtitles)",textDescription:"Text Description",textDescriptionTurnOn:"Click to turn on text description mode",textDescriptionTurnOff:"Click to turn off text description mode",audioDescription:"Audio description",audioDescriptionTurnOn:"Click to turn on audio description mode",audioDescriptionTurnOff:"Click to turn off audio description mode",playlistTurnOn:"Click to turn on playlist mode",playlistTurnOff:"Click to turn off playlist mode",chapterTurnOn:"Click to turn on chapter mode",chapterTurnOff:"Click to turn off chapter mode",transcriptTurnOn:"Click to turn on transcript mode",transcriptTurnOff:"Click to turn off transcript mode",autoplayTurnOn:"Click to turn on autoplay mode",autoplayTurnOff:"Click to turn off autoplay mode",annotationsTurnOn:"Click to turn on annotations mode",annotationsTurnOff:"Click to turn off annotations mode",clickSelectQuality:"Click to select another quality",clickSelectLanguage:"Click to select another language",clickToStart:"Click to start the media player",clickOrPressToStart:"Click or press enter to start the media player",interactive:"Interactive",interactiveModeOn:"Click to turn on interactive mode",interactiveModeOff:"Click to turn off interactive mode",print:"Print",printClick:"Click to print transcript",copy:"Copy",copyClick:"Click to copy transcript",chaptersClick:"Click to select other chapter type",downloadIntro:"You can download these files for use offline or on mobile device.",fileUnavailable:"We’re sorry for the inconvenience, this file is unavailable.",contentUnavailable:"We’re sorry for the inconvenience, this content is unavailable.",qualityUnavailable:"We’re sorry for the inconvenience, this quality is unavailable.",nextPlaylist:"Next playlist item starting shortly",chapterMarkers:"Chapter markers",chapterMarkersOn:"Click to turn on chapter markers",chapterMarkersOff:"Click to turn off chapter markers",loading:"Please wait a moment, this content is loading...",playlistUnavailable:"Content not available in this format, please return to website.",anotationtitle:"Annotations",exitMedia:"Exit media player",openNewWindow:"Press enter to open in new window"}),define("app/nls/ko/labels",{play:"Play",stop:"Stop",mute:"Mute",unmute:"Unmute",pause:"Pause",replay:"Replay",volumeBar:"Volume Bar – Use UP or DOWN key to adjust volume",lengthOfTime:"Length of Time",fullscreen:"Fullscreen",exitFullscreen:"Exit Fullscreen",options:"Options",playlist:"Playlist",pl:"Pl",chapters:"Chapters",ch:"Ch",transcript:"Transcript",tr:"Tr",download:"Download",downloads:"Downloads",settings:"Settings",autoplay:"Autoplay",annotations:"Annotations",quality:"Quality",language:"Language","default":"Default",close:"Close",on:"On",off:"Off",next:" Next",previous:"Previous",expand:"Expand",collapse:"Collapse",share:"Share",shareCode:"Share code",showMore:"Show more",showLess:"Show less",document:"Document",progressBar:"Progress Bar",playCursor:"Play Cursor",closedCaptions:"Closed Captions (Subtitles)",closedCaptionsOn:"Closed Captions (Subtitles) on",closedCaptionsTurnOn:"Click to turn on closed captions (subtitles)",closedCaptionsTurnOff:"Click to turn off closed captions (subtitles)",textDescription:"Text Description",textDescriptionTurnOn:"Click to turn on text description mode",textDescriptionTurnOff:"Click to turn off text description mode",audioDescription:"Audio description",audioDescriptionTurnOn:"Click to turn on audio description mode",audioDescriptionTurnOff:"Click to turn off audio description mode",playlistTurnOn:"Click to turn on playlist mode",playlistTurnOff:"Click to turn off playlist mode",chapterTurnOn:"Click to turn on chapter mode",chapterTurnOff:"Click to turn off chapter mode",transcriptTurnOn:"Click to turn on transcript mode",transcriptTurnOff:"Click to turn off transcript mode",autoplayTurnOn:"Click to turn on autoplay mode",autoplayTurnOff:"Click to turn off autoplay mode",annotationsTurnOn:"Click to turn on annotations mode",annotationsTurnOff:"Click to turn off annotations mode",clickSelectQuality:"Click to select another quality",clickSelectLanguage:"Click to select another language",clickToStart:"Click to start the media player",clickOrPressToStart:"Click or press enter to start the media player",interactive:"Interactive",interactiveModeOn:"Click to turn on interactive mode",interactiveModeOff:"Click to turn off interactive mode",print:"Print",printClick:"Click to print transcript",copy:"Copy",copyClick:"Click to copy transcript",chaptersClick:"Click to select other chapter type",downloadIntro:"You can download these files for use offline or on mobile device.",fileUnavailable:"We’re sorry for the inconvenience, this file is unavailable.",contentUnavailable:"We’re sorry for the inconvenience, this content is unavailable.",qualityUnavailable:"We’re sorry for the inconvenience, this quality is unavailable.",nextPlaylist:"Next playlist item starting shortly",chapterMarkers:"Chapter markers",chapterMarkersOn:"Click to turn on chapter markers",chapterMarkersOff:"Click to turn off chapter markers",loading:"Please wait a moment, this content is loading...",playlistUnavailable:"Content not available in this format, please return to website.",anotationtitle:"Annotations",exitMedia:"Exit media player",openNewWindow:"Press enter to open in new window"}),define("app/nls/vi/labels",{play:"Play",stop:"Stop",mute:"Mute",unmute:"Unmute",pause:"Pause",replay:"Replay",volumeBar:"Volume Bar – Use UP or DOWN key to adjust volume",lengthOfTime:"Length of Time",fullscreen:"Fullscreen",exitFullscreen:"Exit Fullscreen",options:"Options",playlist:"Playlist",pl:"Pl",chapters:"Chapters",ch:"Ch",transcript:"Transcript",tr:"Tr",download:"Download",downloads:"Downloads",settings:"Settings",autoplay:"Autoplay",annotations:"Annotations",quality:"Quality",language:"Language","default":"Default",close:"Close",on:"On",off:"Off",next:" Next",previous:"Previous",expand:"Expand",collapse:"Collapse",share:"Share",shareCode:"Share code",showMore:"Show more",showLess:"Show less",document:"Document",progressBar:"Progress Bar",playCursor:"Play Cursor",closedCaptions:"Closed Captions (Subtitles)",closedCaptionsOn:"Closed Captions (Subtitles) on",closedCaptionsTurnOn:"Click to turn on closed captions (subtitles)",closedCaptionsTurnOff:"Click to turn off closed captions (subtitles)",textDescription:"Text Description",textDescriptionTurnOn:"Click to turn on text description mode",textDescriptionTurnOff:"Click to turn off text description mode",audioDescription:"Audio description",audioDescriptionTurnOn:"Click to turn on audio description mode",audioDescriptionTurnOff:"Click to turn off audio description mode",playlistTurnOn:"Click to turn on playlist mode",playlistTurnOff:"Click to turn off playlist mode",chapterTurnOn:"Click to turn on chapter mode",chapterTurnOff:"Click to turn off chapter mode",transcriptTurnOn:"Click to turn on transcript mode",transcriptTurnOff:"Click to turn off transcript mode",autoplayTurnOn:"Click to turn on autoplay mode",autoplayTurnOff:"Click to turn off autoplay mode",annotationsTurnOn:"Click to turn on annotations mode",annotationsTurnOff:"Click to turn off annotations mode",clickSelectQuality:"Click to select another quality",clickSelectLanguage:"Click to select another language",clickToStart:"Click to start the media player",clickOrPressToStart:"Click or press enter to start the media player",interactive:"Interactive",interactiveModeOn:"Click to turn on interactive mode",interactiveModeOff:"Click to turn off interactive mode",print:"Print",printClick:"Click to print transcript",copy:"Copy",copyClick:"Click to copy transcript",chaptersClick:"Click to select other chapter type",downloadIntro:"You can download these files for use offline or on mobile device.",fileUnavailable:"We’re sorry for the inconvenience, this file is unavailable.",contentUnavailable:"We’re sorry for the inconvenience, this content is unavailable.",qualityUnavailable:"We’re sorry for the inconvenience, this quality is unavailable.",nextPlaylist:"Next playlist item starting shortly",chapterMarkers:"Chapter markers",chapterMarkersOn:"Click to turn on chapter markers",chapterMarkersOff:"Click to turn off chapter markers",loading:"Please wait a moment, this content is loading...",playlistUnavailable:"Content not available in this format, please return to website.",anotationtitle:"Annotations",exitMedia:"Exit media player",openNewWindow:"Press enter to open in new window"}),define("app/nls/ms/labels",{play:"Play",stop:"Stop",mute:"Mute",unmute:"Unmute",pause:"Pause",replay:"Replay",volumeBar:"Volume Bar – Use UP or DOWN key to adjust volume",lengthOfTime:"Length of Time",fullscreen:"Fullscreen",exitFullscreen:"Exit Fullscreen",options:"Options",playlist:"Playlist",pl:"Pl",chapters:"Chapters",ch:"Ch",transcript:"Transcript",tr:"Tr",download:"Download",downloads:"Downloads",settings:"Settings",autoplay:"Autoplay",annotations:"Annotations",quality:"Quality",language:"Language","default":"Default",close:"Close",on:"On",off:"Off",next:" Next",previous:"Previous",expand:"Expand",collapse:"Collapse",share:"Share",shareCode:"Share code",showMore:"Show more",showLess:"Show less",document:"Document",progressBar:"Progress Bar",playCursor:"Play Cursor",closedCaptions:"Closed Captions (Subtitles)",closedCaptionsOn:"Closed Captions (Subtitles) on",closedCaptionsTurnOn:"Click to turn on closed captions (subtitles)",closedCaptionsTurnOff:"Click to turn off closed captions (subtitles)",textDescription:"Text Description",textDescriptionTurnOn:"Click to turn on text description mode",textDescriptionTurnOff:"Click to turn off text description mode",audioDescription:"Audio description",audioDescriptionTurnOn:"Click to turn on audio description mode",audioDescriptionTurnOff:"Click to turn off audio description mode",playlistTurnOn:"Click to turn on playlist mode",playlistTurnOff:"Click to turn off playlist mode",chapterTurnOn:"Click to turn on chapter mode",chapterTurnOff:"Click to turn off chapter mode",transcriptTurnOn:"Click to turn on transcript mode",transcriptTurnOff:"Click to turn off transcript mode",autoplayTurnOn:"Click to turn on autoplay mode",autoplayTurnOff:"Click to turn off autoplay mode",annotationsTurnOn:"Click to turn on annotations mode",annotationsTurnOff:"Click to turn off annotations mode",clickSelectQuality:"Click to select another quality",clickSelectLanguage:"Click to select another language",clickToStart:"Click to start the media player",clickOrPressToStart:"Click or press enter to start the media player",interactive:"Interactive",interactiveModeOn:"Click to turn on interactive mode",interactiveModeOff:"Click to turn off interactive mode",print:"Print",printClick:"Click to print transcript",copy:"Copy",copyClick:"Click to copy transcript",chaptersClick:"Click to select other chapter type",downloadIntro:"You can download these files for use offline or on mobile device.",fileUnavailable:"We’re sorry for the inconvenience, this file is unavailable.",contentUnavailable:"We’re sorry for the inconvenience, this content is unavailable.",qualityUnavailable:"We’re sorry for the inconvenience, this quality is unavailable.",nextPlaylist:"Next playlist item starting shortly",chapterMarkers:"Chapter markers",chapterMarkersOn:"Click to turn on chapter markers",chapterMarkersOff:"Click to turn off chapter markers",loading:"Please wait a moment, this content is loading...",playlistUnavailable:"Content not available in this format, please return to website.",anotationtitle:"Annotations",exitMedia:"Exit media player",openNewWindow:"Press enter to open in new window"}),define("app/nls/cy/labels",{play:"Play",stop:"Stop",mute:"Mute",unmute:"Unmute",pause:"Pause",replay:"Replay",volumeBar:"Volume Bar – Use UP or DOWN key to adjust volume",lengthOfTime:"Length of Time",fullscreen:"Fullscreen",exitFullscreen:"Exit Fullscreen",options:"Options",playlist:"Playlist",pl:"Pl",chapters:"Chapters",ch:"Ch",transcript:"Transcript",tr:"Tr",download:"Download",downloads:"Downloads",settings:"Settings",autoplay:"Autoplay",annotations:"Annotations",quality:"Quality",language:"Language","default":"Default",close:"Close",on:"On",off:"Off",next:" Next",previous:"Previous",expand:"Expand",collapse:"Collapse",share:"Share",shareCode:"Share code",showMore:"Show more",showLess:"Show less",document:"Document",progressBar:"Progress Bar",playCursor:"Play Cursor",closedCaptions:"Closed Captions (Subtitles)",closedCaptionsOn:"Closed Captions (Subtitles) on",closedCaptionsTurnOn:"Click to turn on closed captions (subtitles)",closedCaptionsTurnOff:"Click to turn off closed captions (subtitles)",textDescription:"Text Description",textDescriptionTurnOn:"Click to turn on text description mode",textDescriptionTurnOff:"Click to turn off text description mode",audioDescription:"Audio description",audioDescriptionTurnOn:"Click to turn on audio description mode",audioDescriptionTurnOff:"Click to turn off audio description mode",playlistTurnOn:"Click to turn on playlist mode",playlistTurnOff:"Click to turn off playlist mode",chapterTurnOn:"Click to turn on chapter mode",chapterTurnOff:"Click to turn off chapter mode",transcriptTurnOn:"Click to turn on transcript mode",transcriptTurnOff:"Click to turn off transcript mode",autoplayTurnOn:"Click to turn on autoplay mode",autoplayTurnOff:"Click to turn off autoplay mode",annotationsTurnOn:"Click to turn on annotations mode",annotationsTurnOff:"Click to turn off annotations mode",clickSelectQuality:"Click to select another quality",clickSelectLanguage:"Click to select another language",clickToStart:"Click to start the media player",clickOrPressToStart:"Click or press enter to start the media player",interactive:"Interactive",interactiveModeOn:"Click to turn on interactive mode",interactiveModeOff:"Click to turn off interactive mode",print:"Print",printClick:"Click to print transcript",copy:"Copy",copyClick:"Click to copy transcript",chaptersClick:"Click to select other chapter type",downloadIntro:"You can download these files for use offline or on mobile device.",fileUnavailable:"We’re sorry for the inconvenience, this file is unavailable.",contentUnavailable:"We’re sorry for the inconvenience, this content is unavailable.",qualityUnavailable:"We’re sorry for the inconvenience, this quality is unavailable.",nextPlaylist:"Next playlist item starting shortly",chapterMarkers:"Chapter markers",chapterMarkersOn:"Click to turn on chapter markers",chapterMarkersOff:"Click to turn off chapter markers",loading:"Please wait a moment, this content is loading...",playlistUnavailable:"Content not available in this format, please return to website.",anotationtitle:"Annotations",exitMedia:"Exit media player",openNewWindow:"Press enter to open in new window"}),define("app/helpers/log/moodle",["jquery","backbone"],function(e,t){"use strict";var n=t.Model.extend({sendData:function(e){require(["core/ajax"],function(t){var n;n=JSON.stringify(e);var r=t.call([{methodname:"local_oump_external_create_events",args:{events:n}}]);r[0].fail(function(e){window.console.error("Log request failed "+e.message)})})}});return n}),define("app/helpers/log/null",["jquery","backbone"],function(e,t){"use strict";var n=t.Model.extend({sendData:function(e){return}});return n}),define("app/harvester",["jquery","jquery","app/common","app/resizer","app/helpers/hook/playlist_hook","app/placeholder","app/logger",oump.logHelper,"app/helpers/hook/tab_order_hook","app/helpers/service_path_config","app/helpers/manifest","app/helpers/utilities","app/helpers/hook/ajax_hook","app/helpers/hook/external_adapter_hook","app/html5","app/html5_consumer","app/ouflash","app/nls/en/labels","app/nls/fr/labels","app/nls/es/labels","app/nls/de/labels","app/nls/zh/labels","app/nls/pl/labels","app/nls/pt/labels","app/nls/ja/labels","app/nls/ko/labels","app/nls/vi/labels","app/nls/ms/labels","app/nls/cy/labels","app/helpers/log/moodle","app/helpers/log/null"],function(e,t,n,r,i,s,o,u,a,f,l,c,h,p){return oump.harvest=function(){if(oump.harvesting)return;oump.harvesting=!0,window.tabOrder==undefined&&(window.tabOrder=new a),new h,oump.resizer==undefined&&(oump.resizer=new r,oump.resizer.init()),oump.externaladapter==undefined&&(oump.externaladapter=new p);var e=new n;e.init();if(oump.logger==undefined){var t=new u;oump.logger=new o,oump.logger.init(t)}return oump.servicePath==undefined&&(oump.servicePath=new f),oump.manifest==undefined&&(oump.manifest=new l),e.harvestVideos(),e.get("videos").each(function(e){if(e.get("playerState")!=0)return;e.set("playerState","notactivated"),oump.models[e.get("id")]=e;if(c.checkEpubformat(e)){var t="";e.get("assetspath")!=undefined&&(t=e.get("assetspath")),c.renderStylesheet("omp.css",t),c.renderStylesheet("font-awesome.min.css",t)}else oump.appendStylesheet("omp_css","/css/omp.css"),oump.appendStylesheet("fontawesome_css","/css/font-awesome/css/font-awesome.min.css");e.set("currentPlaylist",new i({_dataModel:e})),e.get("features").hasManifest?oump.manifest.fetchSrc(e.get("manifest"),function(t){t!=null&&(t.manifest=e.get("manifest"),oump.manifest.setModelData(t,e,oump.resizer)),s.setup(e),oump.resizer.addHandler(e.get("id"),e,e.resizeEvent)}):(s.setup(e),oump.resizer.addHandler(e.get("id"),e,e.resizeEvent))},this),e.harvestAudios(),e.get("audios").each(function(e){if(e.get("playerState")!=0)return;e.set("playerState","notactivated"),oump.models[e.get("id")]=e,e.set("currentPlaylist",new i({_dataModel:e})),e.get("features").hasManifest?oump.manifest.fetchSrc(e.get("manifest"),function(t){t!=null&&(t.manifest=e.get("manifest"),oump.manifest.setModelData(t,e)),s.setup(e),oump.resizer.addHandler(e.get("id"),e,e.resizeEvent)}):(s.setup(e),oump.resizer.addHandler(e.get("id"),e,e.resizeEvent));if(c.checkEpubformat(e)){var t="";e.get("assetspath")!=undefined&&(t=e.get("assetspath")),c.renderStylesheet("omp.css",t),c.renderStylesheet("font-awesome.min.css",t)}else oump.appendStylesheet("omp_css","/css/omp.css"),oump.appendStylesheet("fontawesome_css","/css/font-awesome/css/font-awesome.min.css")},this),oump.harvesting=!1,e},{init:function(){oump.common=oump.harvest()}}}),define("app/views/manifest_html5",["jquery","jquery","underscore","backbone","app/tpl"],function(e,t,n,r,i){"use strict";var s=r.View.extend({template:i.tplManifestHTML5,render:function(t){var r=n.template(this.template),i=r(this.model);return t||(t=e("body").append("<div id='temp_div'></div>").children("div#temp_div")),t.replaceWith(i),this}});return s}),define("app/oembed",["app/harvester","jquery","app/helpers/manifest","app/views/manifest_html5","app/helpers/utilities"],function(e,t,n,r,i){if(i.getParameterByName("oembed")=="true"){var s=new n;s.getData().done(function(t,n,o){s.type=="xml"?t=i.xmlToJsonObject(t.childNodes[0]):t=t.manifest,t.manifest=s.src,t.baseurl=s.src.split("/",s.src.split("/").length-3).join("/");var u=new r({model:t});u.render(),e.init()})}else e.init()}),window.oump.defineOUMP(["require"],function(e){e(["app/oembed"],function(e){})}),define("oump",function(){});