webpackJsonp([1],[function(e,t,i){var n,s;n=[i(995),i(635)],s=function(e,t){"use strict";t.start()}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";function n(){var e=r.default.initial(arguments).concat({escape:!0});return new l.default.SafeString(u.default.apply(u.default,e))}var s=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var a=i(2),r=s(a),o=i(3),l=s(o),c=i(7),u=s(c);t.default=n,e.exports=t.default},,function(e,t,i){e.exports=i(990)},,,,function(e,t,i){
var n,s;n=[i(88)],s=function(e){"use strict";return function(){return e.t.apply(e,arguments)}}.apply(t,n),!(void 0!==s&&(e.exports=s))},,function(e,t,i){var n,s;n=[i(19),i(435),i(210),i(470),i(467),i(76),i(438)],s=function(e,t,i,n,s,a,r){"use strict";var o=e.Model.extend({defaults:function(){var e=new n({machineIdentifier:"myPlex"},{parent:this});return{authorized:!1,multiserver:!1,multiplayer:!1,isCastApiAvailable:!1,isCastDeviceAvailable:!1,isWaitingForServers:!1,history:[],forwardHistory:[],announcements:new t,
inputActivity:new r,players:new s([],{parent:this}),servers:new i([],{parent:this}),cloudServer:e,primaryServer:null,user:new a({},{server:e,parent:this})}}});return new o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t){"use strict";function i(e,t,i){return e===t?i.fn(this):i.inverse(this)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(2),a=n(s),r=i(38),o=n(r),l={
_map:{},register:function(e,t){(0,o.default)(a.default.isFunction(t),'The "'+e+'" command must be a function'),this._map[e]=t},registerAll:function(e){var t=this;a.default.each(e,function(e,i){t.register(i,e)})},reset:function(){this._map={}},execute:function(e){var t=this._map[e];if((0,o.default)(t,'The "'+e+'" command has not been registered'),t){for(var i=arguments.length,n=Array(i>1?i-1:0),s=1;i>s;s++)n[s-1]=arguments[s];return t.apply(void 0,n)}}};t.default=l,e.exports=t.default},,function(e,t,i){
"use strict";function n(e,t){var i=l.default.partials[e],n=r.default.extend({},t.hash.context||this,t.hash);return new l.default.SafeString(i(n))}var s=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var a=i(2),r=s(a),o=i(3),l=s(o);t.default=n,e.exports=t.default},,function(e,t,i){var n,s;n=[i(2),i(300),i(16)],s=function(e,t,i){"use strict";function n(t,i){e.isArray(i)?e.each(i,t):t(i)}function s(t){return e.reduce(t,function(e,t){var n=t.split("="),s=n[0],a=n[1];try{s=decodeURIComponent(s),
a=void 0===a?null:decodeURIComponent(a),e.hasOwnProperty(s)?Array.isArray(e[s])?e[s].push(a):e[s]=[e[s],a]:e[s]=a}catch(r){i.warn("Unable to decode query string at "+s)}return e},{})}var a=new t(!1,"",!0),r={parseXML:function(e){var t=a.parseXmlString(e);return t?(t.getElementsByTagName("parsererror").length&&i.warn("parseXML: Errors found while parsing XML document"),a.xml2json(t)):null},replaceXMLElementNames:function(t,i,n){e.isArray(i)||(i=[i]);var s=i.join("|"),a=new RegExp("<("+s+")","g"),r=new RegExp("</("+s+")>","g");
return t=t.replace(a,"<"+n+' elementName="$1"'),t=t.replace(r,"</"+n+">")},parseEncodedString:function(e,t){function i(t){if(e.hasOwnProperty(t)){var i=e[t];if(null==i)e[t]="";else try{e[t]=decodeURIComponent(i)}catch(n){}}}e&&n(i,t)},parseInteger:function(e,t){function i(t){if(e.hasOwnProperty(t)){var i=e[t];null==i||""===i?e[t]=0:e[t]=parseInt(i,10)}}e&&n(i,t)},parseFloat:function(e){function t(t,i){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e,t){
function i(t){if(e.hasOwnProperty(t)){var i=e[t];null===i||""===i?e[t]=0:e[t]=parseFloat(i)}}e&&n(i,t)}),parseBoolean:function(e,t){function i(t){if(e.hasOwnProperty(t)){var i=e[t];e[t]=1===Number(i)||"true"===i}}e&&n(i,t)},parseArray:function(t,i){function s(i){if(t.hasOwnProperty(i)){var n=t[i];e.isArray(n)||(t[i]=[n])}else t[i]=[]}t&&n(s,i)},parseQueryString:function(t,i,a){function r(i){if(t.hasOwnProperty(i)){var n=t[i];if(!e.isObject(n))return e.isString(n)&&(n=n.trim().replace(/^(\?|#)/,""))?void(t[i]=s(n.split(a))):void(t[i]={});
}}t&&(a||(a="&"),n(r,i))}};return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},,function(e,t,i){var n,s;n=[i(37)],s=function(e){"use strict";var t=new e({"interface":["get","save","populate"]});return t}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(6)],s=function(e,t){"use strict";var i=t.CollectionView.extend({appendHtml:function(e,i,n){return this.sorted?this.sortedAppendHtml.apply(this,arguments):this.reversed?this.reversedAppendHtml.apply(this,arguments):t.CollectionView.prototype.appendHtml.apply(this,arguments);
},sortedAppendHtml:function(e,t,i){if(e.isBuffering){var n=e.elBuffer.childNodes;n.length<=i?e.elBuffer.appendChild(t.el):e.elBuffer.insertBefore(t.el,n[i]),e._bufferedChildren.push(t)}else{var s=e.itemViewContainer?e.$(e.itemViewContainer):e.$el,a=s.children();a.size()<=i?s.append(t.el):a.eq(i).before(t.el)}},reversedAppendHtml:function(e,t,i){if(e.isBuffering)e.elBuffer.insertBefore(t.el,e.elBuffer.firstChild),e._bufferedChildren.push(t);else{var n=e.itemViewContainer?e.$(e.itemViewContainer):e.$el;
n.prepend(t.el)}},measureList:function(){if(this.children.length){var t=this.children._views,i=t[e.first(e.keys(t))];e.defer(e.bind(function(){this.itemWidth=i.$el.outerWidth(!0),this.itemHeight=i.$el.outerHeight(!0),this.itemMarginRight=parseInt(i.$el.css("margin-right"),10),this.itemMarginBottom=parseInt(i.$el.css("margin-bottom"),10),this.triggerMethod("measure",this)},this))}},getViewForModel:function(e){var t=this.children._indexByModel[e.cid];return this.children._views[t]},reorder:function(){
var t=this.children,i=this.collection.models,n=e.map(i,function(e,i){var n=t.findByModel(e);return n._index=i,n.el});this.$el.append(n)},onCollectionRendered:function(){this.measure&&this.measureList()}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},,,function(e,t,i){var n,s,a=i(953).default;n=[i(2),i(95)],s=function(e,t){"use strict";function i(e){return!0}function n(t){return e.isObject(t)&&!e.isArray(t)}function s(n,s){s||(s={});var a=e.defaults(s,{typeName:n,parse:e.bind(t.parseType,t,n),
stringify:e.bind(t.stringifyType,t,n)});return a.validate=s.validate?r(s.validate):i,a.required=function(){var t=e.extend({},a,{validate:function(e){return null==e?!1:a.validate(e)}});return t},a}function r(e){return function(t){return null==t?!0:e(t)}}var o=["boolean","integer","float","string","object","array"],l={any:s("any"),"boolean":s("boolean",{validate:e.isBoolean}),integer:s("integer",{validate:a}),"float":s("float",{validate:e.isNumber}),string:s("string",{validate:e.isString}),object:s("object",{
validate:n}),array:s("array",{validate:e.isArray}),list:s("list",{validate:e.isArray}),encodedString:s("encodedString",{validate:e.isString}),queryString:s("queryString",{validate:n}),instanceOf:function(e){return s("instanceOf",{validate:function(t){return t instanceof e}})},oneOf:function(){var t=e.toArray(arguments);return s("oneOf",{validate:function(i){return e.contains(t,i)}})},oneOfType:function(){var t=e.toArray(arguments);return s("oneOfType",{validate:function(i){return e.some(t,function(e){
return e.validate(i)})}})},custom:function(e){return s("custom",{validate:e})},getAttrTypeFor:function(e){if(null==e)return l.any;for(var t=0,i=o.length;i>t;t++){var n=o[t],s=l[n];if(s.validate(e))return s}return l.any}};return l}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1157),i(2),i(4),i(31)],s=function(e,t,i,n){"use strict";var s=n.extend({className:"confirm-modal modal modal-sm fade",template:e,ui:{doubleConfirmMessage:".double-confirm-message",confirmBtn:".confirm-btn"
},events:t.extend({"click .confirm-btn":"onConfirm"},n.prototype.events),whitelistedOptions:["title","message","confirmLabel","cancelLabel","hasDanger","hideCancel"],initialize:function(e){n.prototype.initialize.apply(this,arguments),this.async=e.async,this.data=t.pick(e,this.whitelistedOptions),this.promise=i.Deferred()},serializeData:function(){return t.defaults(this.data,{confirmLabel:"Yes",cancelLabel:"No"})},onRender:function(){n.prototype.onRender.apply(this,arguments),setTimeout(t.bind(function(){
this.ui.confirmBtn.focus()},this),this.focusDelay)},onHide:function(e){n.prototype.onHide.apply(this,arguments),this.promise.reject()},onConfirm:function(e){if(e.preventDefault(),this.options.requireDoubleConfirm&&!this.hasConfirmedOnce){this.hasConfirmedOnce=!0;var t=this.options.doubleConfirmMessage,i=this.options.doubleConfirmLabel;return t&&this.ui.doubleConfirmMessage.text(t),void(i&&this.ui.confirmBtn.text(i))}this.promise.resolve(),this.async?this.ui.confirmBtn.addClass("active"):this.hide();
}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(19),i(4),i(95),i(38),i(14),i(16),i(115),i(21),i(120)],s=function(e,t,i,n,s,a,r,o,l,c){"use strict";var u=t.Model.extend({mixins:[o],name:"AbstractModel",responseType:c.xml,hasInitialRelations:!1,_context:["parent"],cache:null,cacheKey:function(e){return e[this.idAttribute]},constructor:function(i,n){i||(i={}),n||(n={});var s=function(){};if(this.initialize!==t.Model.prototype.initialize&&(s=this.initialize,this.initialize=function(){}),
e.each(this.getContext(),function(e){var t=this.findOption(n,e);void 0!==t&&(this[e]=t)},this),!this.cache||this.findOption(n,"skipCache"))return t.Model.prototype.constructor.apply(this,arguments),this._initRelations(n),this._initDerived(n),s.apply(this,arguments),void(this.initialize=s);var a=this.findOption(n,"onlyIfCached"),r=this.cache.getItemCacheKey(this,i),o=this.cache.get(r);if(o){if(this.uninitialize(),!a){var l=this.preserveCachedAttributes&&this.preserveCachedAttributes(n.url);o.preserveCachedRelations=l,
n.parse?i=o.parse(i):e.extend(i,o._getRelations(this.syncedRelations,i)),l?o.set(o._removePreservedAttrs(o,i)):o.set(i),o.preserveCachedRelations=!1}return e.each(this.getContext(),function(e){o.setContext(e,this[e]||o[e])},this),n.collection&&(o.collection=n.collection),o}return a?{}:(t.Model.prototype.constructor.apply(this,arguments),this._initRelations(n),this._initDerived(n),s.apply(this,arguments),this.initialize=s,void this.cache.store(this,r))},uninitialize:function(){this.stopListening();
},findOption:function(e,t){return e[t]||e.collection&&e.collection[t]},getContext:function(){if(!this.context)return this._context;var t=e.result(this,"context");return this._context.concat(t)},setContext:function(t,i){if(this[t]=i,"parent"!==t){var n=e.extend({},this.sessionRelations,this.syncedRelations);e.each(n,function(e,n){var s=this.get(n);s&&s.setContext(t,i)},this)}},getScopedKey:function(t){return null!=t&&e.isFunction(this.cacheKey)?this.cacheKey(this.attributes)+"!"+t:t},toJSON:function(){
function t(e,t){var i=this.get(t);i&&(p[t]=i.toJSON(n))}var n=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],s=this.syncedAttrs,a=this.sessionRelations,r=this.syncedRelations,o=this.attributes,l={};for(var c in o){var u=a&&e.has(a,c),d=r&&e.has(r,c),h=n.syncedOnly&&(!s||!e.has(s,c));u||d||h||(l[c]=o[c])}var p=i.extend(!0,{},l);return n.syncedOnly||e.each(a,t,this),e.each(r,t,this),p},clone:function(){var t=e.extend(e.pick(this,this.getContext()),{skipCache:!0});return new this.constructor(this.toJSON(),t)||null;
},copy:function(t){s(t instanceof this.constructor,"Only a model of the same type may be copied");var i=t.toJSON();return e.extend(i,this._getRelations(this.sessionRelations,i,{parse:!0}),this._getRelations(this.syncedRelations,i,{parse:!0})),this.set(i)},restoreDefaults:function(t){var i={};return e.each(this.attributes,function(t,n){this.derivedAttrs&&e.has(this.derivedAttrs,n)||(i[n]=void 0)},this),e.extend(i,this._getRelations(this.sessionRelations,{},{reset:!0}),this._getRelations(this.syncedRelations,{},{
reset:!0}),e.result(this,"defaults"),t),this.set(i)},set:function(e,i,n){return t.Model.prototype.set.apply(this,arguments)},validate:function(t,i){var n=e.extend({},this.sessionAttrs,this.syncedAttrs,this.sessionRelations,this.syncedRelations),a=this._validateTypes(t,n);return a&&s(!1,a),a},parse:function(e,t){return t&&t.save?this.attributes:this.convert(e)},convert:function(t){var i,n=t,s=e.result(this,"responseType");e.isString(n)&&(i=!0,e.isFunction(this.augmentResponseText)&&(n=this.augmentResponseText(n,s)),
n=s.parse(n)),e.isFunction(this.augmentResponse)&&(n=this.augmentResponse(n)),i&&this.rootPropertyName&&e.has(n,this.rootPropertyName)&&(n=n[this.rootPropertyName]);var a=e.keys(this.sessionAttrs),r=e.keys(this.syncedAttrs),o=e.pick(n,a,r);return e.each(r,function(t){if(s===c.xml){var i,n=this.syncedAttrs[t],a=n;a.typeName||(a=n.type,i=e.omit(n,"type")),e.has(o,t)&&(o[t]=a.parse(o[t],i))}if(!e.has(o,t)){var r=e.result(this,"defaults");o[t]=r&&e.has(r,t)?r[t]:void 0}},this),e.extend(o,this._getRelations(this.syncedRelations,n,{
parse:!0})),o},save:function(n,s,a){var r;null==n||"object"==typeof n?(r=n,a=s):(r={})[n]=s;var o=e.extend({save:!0},a),l=e.extend(this.getSaveParams(r),o.data);if(e.isEmpty(l))return o.success&&o.success(this),i.Deferred().resolve(this);o.data=l;var c=o.success;return o.success=function(e,t,i){e.cache&&e.cache.store(e),c&&c(e,t,i)},t.Model.prototype.save.call(this,r,o)},sync:function(i,n,s){var r=s?e.clone(s):{};if("create"===i||"update"===i){var o=r.data,l=r.url||e.result(this,"saveUrl")||e.result(this,"syncUrl")||e.result(this,"url");
r.url=a.join(l,o),r.data=""}return t.Model.prototype.sync.call(this,i,n,r)},getSaveParams:function(t){var i=this._getSaveAttrs(t),n=e.reduce(i,function(t,i,n){var s=i.definition,a=i.value,r=n;if(!s)return t[r]=a,t;var o=s.relationClass;if(o){var l,c=o.prototype.model;l=c&&c.prototype?c.prototype.rootPropertyName:a.rootPropertyName,a=a.getSaveParams(),l&&(r=l)}else{var u,d;e.has(s,"type")?(u=s.type,d=e.omit(s,"type")):u=s,a=u.stringify(a,d)}return t[r]=a,t},{},this);return n},startCapturingChangeEvents:function(){
if(this.releaseCapturedChangeEvents)return void s(!1,this.name+" is already capturing events");var t=this.set,i=[];this.set=function(n,s,a){var r,o=e.extend({},a,{silent:!0});return"object"==typeof n?(r=n,a=s):(r={})[n]=s,e.each(r,function(e,n){this.get(n)!==e&&(i.push({key:n,value:e}),t.call(this,n,e,o))},this),e.each(this._derivedListeners,function(e){var n=e.key,s=this.derivedAttrs[n],a=s.call(this);this.get(n)!==a&&(i.push({key:n,value:a}),t.call(this,n,a,o))},this),this},this.releaseCapturedChangeEvents=function(){
this.set=t,this.releaseCapturedChangeEvents=null,this.discardCapturedChangeEvents=null,e.each(i,function(e){this.trigger("change:"+e.key,this,e.value)},this),e.isEmpty(i)||this.trigger("change",this,{})},this.discardCapturedChangeEvents=function(){this.set=t,this.releaseCapturedChangeEvents=null,this.discardCapturedChangeEvents=null,i.length=0}},spyOnGet:function(t){var i=[],n=this.get;return this.get=function(t){i.push("change:"+t);var s=this.sessionRelations&&e.has(this.sessionRelations,t),a=this.syncedRelations&&e.has(this.syncedRelations,t);
return(s||a)&&i.push("change:"+t+".change"),n.apply(this,arguments)},t.call(this),this.get=n,i},_removePreservedAttrs:function(t,i){var n=e.reduce(i,function(i,n,s){var a=t.get(s);return e.isObject(a)||e.isUndefined(n)||(i[s]=n),i},{});return n},_initRelations:function(t){var i=e.extend({},this.sessionRelations,this.syncedRelations);e.each(i,function(t,i){this._initRelation(t,i);var n=e.bind(this._initRelation,this,t,i);this.on("change:"+i,n)},this),this.hasInitialRelations=!0,this.set(this._getRelations(this.sessionRelations,this.attributes)),
t.parse||this.set(this._getRelations(this.syncedRelations,this.attributes))},_initRelation:function(e,t){var i=this._resolveRelationDefinition(e),n=i.relationClass,s=this.get(t),a=this.previous(t),r=s&&s instanceof n,o=a&&a instanceof n;o&&this.stopListening(a),r&&this._forwardRelationEvents(s,t)},_resolveRelationDefinition:function(t){return e.isFunction(t)?t.call(this):t},_getRelations:function(i,a,r){a||(a={}),r||(r={});var o={};return e.each(i,function(i,l){var c=this._resolveRelationDefinition(i),u=c.relationClass;
s(u,this.name+" requires a `relationClass` for the "+l+" relation");var d=l;r.parse&&!e.has(a,l)&&e.has(c,"rootPropertyName")&&(d=c.rootPropertyName);var h=r.reset?null:this.get(l),p=h instanceof u,f=u.prototype instanceof t.Collection,m={parse:r.parse},g=a[d];if(g instanceof u)return void(o[l]=g);if(!g&&c.deferred)return void(this.preserveCachedRelations||(o[l]=void 0));if(f?g=n.parseArray(g):g||(g={}),p)f?h.set(g,{parse:m.parse,remove:!this.preserveCachedRelations}):(m.parse&&(g=h.parse(g)),this.preserveCachedRelations&&(g=this._removePreservedAttrs(h,g)),
h.set(g));else{e.each(this.getContext(),function(e){m[e]=this[e]},this);var v=c.options;e.isFunction(v)&&(v=v.call(this,a)),e.extend(m,{parent:this},v),h=new u(g,m)}o[l]=h},this),o},_forwardRelationEvents:function(t,i){var n=["sync","request","sort","invalid","error","add","remove"];this.listenTo(t,"all",function(){var s=e.toArray(arguments),a=s[0];"change"!==a&&(s[0]="change:"+i+"."+a,this.trigger.apply(this,s),e.contains(n,a)||(this.trigger("change:"+i+".change",this,t),this.trigger("change",this)));
})},_initDerived:function(){e.each(this.derivedAttrs,this._setDerived,this)},_setDerived:function(t,i){var n=this.spyOnGet(function(){var e=this.set;this.set=function(){s(!1,this.name+" blocked `set` in the "+i+" attribute. Derived attributes are read-only.")};var n=t.call(this);this.set=e,this.set(i,n)});e.each(n,function(e){this._addDerivedListener(i,e,t)},this)},_addDerivedListener:function(t,i,n){this._derivedListeners||(this._derivedListeners=[]);var s={key:t,name:i,callback:e.bind(this._setDerived,this,n,t)
},a=e.findWhere(this._derivedListeners,{key:t,name:s.name});a||(this._derivedListeners.push(s),this.on(s.name,s.callback))},_getSaveAttrs:function(t){var i;if(t)i=e.reduce(t,function(e,t,i){return e[i]={definition:this.syncedAttrs[i],value:t},e},{},this);else{var n=e.extend({},this.syncedAttrs,this.syncedRelations);i=e.reduce(n,function(t,i,n){var s=this._resolveRelationDefinition(i),a=s.save;return e.isFunction(a)&&(a=a.call(this)),a&&(t[n]={definition:s,value:this.get(n)}),t},{},this)}return i},
_validateTypes:function(i,n){var s=e.keys(i),a=e.reduce(s,function(s,a){if(this.derivedAttrs&&e.has(this.derivedAttrs,a))return s;if(!e.has(n,a))return s.push(this.name+" received an unknown attribute: "+a+". All attributes must be defined in `sessionAttrs`, `syncedAttrs`, `sessionRelations`, or `syncedRelations`."),s;var r,o=i[a],c=this._resolveRelationDefinition(n[a]),u=c.relationClass;r=u?this.hasInitialRelations?l.instanceOf(u):u.prototype instanceof t.Collection?l.oneOfType(l.array,l.object):l.object:c.type?c.type:c;
var d=r.validate;return d?d(o)||s.push(a+" of type "+r.typeName+" has an invalid value: "+JSON.stringify(o)):s.push(a+" has an unknown type. Specify the type in the attribute definition or use attrTypes.any as a wildcard type."),s},[],this);return a.length>0?a.join("\n"):void 0}});return u}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(19),i(4),i(15),i(38),i(14),i(149),i(115)],s=function(e,t,i,n,s,a,r,o){"use strict";var l=t.Model.extend({mixins:[o],cache:new r,constructor:function(i,n){
i||(i={}),n||(n={}),this.server=this.findOption(n,"server"),this.section=this.findOption(n,"section"),this.channel=this.findOption(n,"channel"),this.device=this.findOption(n,"device"),this.parent=this.findOption(n,"parent");var s=this.findOption(n,"skipCache");if(s)return void t.Model.prototype.constructor.apply(this,arguments);var a=this.cache.getItemCacheKey(this,i),r=this.cache.get(a);if(r)return n.parse&&(i=r.parse(i)),this.preserveCachedAttributes&&this.preserveCachedAttributes(n.url)?e.each(i,function(t,i){
e.isUndefined(r.get(i))&&!e.isUndefined(t)&&r.set(i,t)}):r.set(i),r.server=this.server||r.server,r.section=this.section||r.section,r.channel=this.channel||r.channel,r.device=this.device||r.device,r.parent=this.parent||r.parent,n.collection&&(r.collection=n.collection),r;var o=this.findOption(n,"onlyIfCached");return o?{}:(t.Model.prototype.constructor.apply(this,arguments),void this.cache.store(this,a))},findOption:function(e,t){return e[t]||e.collection&&e.collection[t]},clone:function(){var e={
server:this.server,section:this.section,channel:this.channel,parent:this.parent,skipCache:!0};return new this.constructor(this.attributes,e)||null},convert:function(t){var i=e.isObject(t)?t:n.parseXML(t);return i},parse:function(t,i){var n=this.convert(t);return this.whitelistedAttrs&&(n=e.pick(n,this.whitelistedAttrs)),n},save:function(n,s,r){var o,l,c,u=this.attributes;null==n||"object"==typeof n?(o=n,r=s):(o={})[n]=s,r=e.extend({validate:!0},r);var d=this.getSaveParams(o,r);if(e.extend(d,r.data),
o&&!r.wait){if(!this.set(o,r))return!1}else if(!this._validate(o,r))return!1;if(o&&r.wait&&(this.attributes=e.extend({},u,o)),e.isEmpty(d)&&!r.force)return r.success&&r.success(this),i.Deferred().resolve(this);void 0===r.parse&&(r.parse=!0);var h=this,p=r.success;r.success=function(t){if(h.attributes=u,t){var i=h.parse(t,r);if(r.wait&&(i=e.extend(o||{},i)),e.isObject(i)&&!h.set(i,r))return!1;h.cache.store(h)}p&&p(h,t,r),h.trigger("sync",h,t,r)},t.wrapError(this,r),l=this.isNew()?"create":r.patch?"patch":"update",
"patch"===l&&(r.attrs=o);var f=e.result(this,"saveUrl")||e.result(this,"url");return e.isEmpty(d)||(r.url=a.join(f,d)),r.data="",c=this.sync(l,this,r),o&&r.wait&&(this.attributes=u),c},getSaveParams:function(e,t){return this.isNew()?e||this.toJSON():this.changedAttributes(e)||{}},getScopedKey:function(t){return null!=t&&e.isFunction(this.cacheKey)?this.cacheKey(this.attributes)+"!"+t:t},restoreDefaults:function(t){var i=e.result(this,"defaults");if(!i)return this.clear(t);var n,s=this.attributes;for(n in s)n in i||this.unset(n,t);
return this.set(i,t),this},startCapturingChangeEvents:function(){if(this.releaseCapturedChangeEvents)return void s(!1,"This model is already capturing events");var t=this.set,i={};this.set=function(n,s,a){var r;"object"==typeof n?(r=n,a=s):(r={})[n]=s;var o=e.extend({},a,{silent:!0}),l=t.call(this,r,o);return e.extend(i,this.changed),l},this.releaseCapturedChangeEvents=function(){e.each(i,function(e,t){this.trigger("change:"+t,this,e)},this),e.isEmpty(i)||this.trigger("change",this,{}),i={},this.set=t,
this.releaseCapturedChangeEvents=null}}});return l.extend=function(){var e=t.Model.extend.apply(this,arguments);return e.prototype.cache=new r,e},l}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";function n(e){var t=g.get(e);if(!t)return[];var i=c.default.compact(c.default.map(m,function(e){return t.hasOwnProperty(e)?g.get(t[e]):void 0}));return i.unshift(t),i}function s(e){var t=g.get(e);if(t){var i=t.grandchild||t.child;return i?g.get(i):t}}function a(e){var t=s(e);return t?t.typeString!==e:!1;
}var r=i(961).default,o=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var l=i(2),c=o(l),u=i(99),d=o(u),h=i(7),p=o(h),f=["id","typeString"],m=["grandparent","parent","child","grandchild"],g=(0,d.default)(f,[{id:1,typeString:"movie",title:function(){return(0,p.default)("Movie")},plural:function(){return(0,p.default)("Movies")},element:"video"},{id:2,typeString:"show",title:function(){return(0,p.default)("Show")},plural:function(){return(0,p.default)("Shows")},element:"directory",child:3,
grandchild:4},{id:3,typeString:"season",title:function(){return(0,p.default)("Season")},plural:function(){return(0,p.default)("Seasons")},element:"directory",parent:2,child:4},{id:4,typeString:"episode",title:function(){return(0,p.default)("Episode")},plural:function(){return(0,p.default)("Episodes")},element:"video",grandparent:2,parent:3},{id:5,typeString:"trailer",title:function(){return(0,p.default)("Trailer")},plural:function(){return(0,p.default)("Trailers")},element:"video"},{id:6,typeString:"comic",
title:function(){return(0,p.default)("Comic")},plural:function(){return(0,p.default)("Comics")},element:"photo"},{id:7,typeString:"person",title:function(){return(0,p.default)("Person")},plural:function(){return(0,p.default)("People")},element:"directory"},{id:8,typeString:"artist",title:function(){return(0,p.default)("Artist")},plural:function(){return(0,p.default)("Artists")},element:"directory",child:9,grandchild:10},{id:9,typeString:"album",title:function(){return(0,p.default)("Album")},plural:function(){
return(0,p.default)("Albums")},element:"directory",parent:8,child:10},{id:10,typeString:"track",title:function(){return(0,p.default)("Track")},plural:function(){return(0,p.default)("Tracks")},element:"audio",grandparent:8,parent:9},{id:11,typeString:"picture",title:function(){return(0,p.default)("Picture")},plural:function(){return(0,p.default)("Pictures")},element:"photo"},{id:12,typeString:"clip",title:function(){return(0,p.default)("Clip")},plural:function(){return(0,p.default)("Clips")},element:"video"
},{id:13,typeString:"photo",title:function(){return(0,p.default)("Photo")},plural:function(){return(0,p.default)("Photos")},element:"photo",parent:14},{id:14,typeString:"photoAlbum",title:function(){return(0,p.default)("Photo Album")},plural:function(){return(0,p.default)("Photo Albums")},element:"directory",child:13},{id:15,typeString:"playlist",title:function(){return(0,p.default)("Playlist")},plural:function(){return(0,p.default)("Playlists")},element:"directory"},{id:16,typeString:"playlistFolder",
title:function(){return(0,p.default)("Playlist")},plural:function(){return(0,p.default)("Playlists")},element:"directory",child:15},{id:1001,typeString:"userPlaylistItem",title:function(){return(0,p.default)("Clip")},plural:function(){return(0,p.default)("Clips")},element:"video"}]);t.default=r({},g,{getRelatedMediaTypes:n,getChildMediaType:s,typeHasChildMedia:a}),e.exports=t.default},function(e,t,i){var n,s;n=[i(2),i(4),i(12),i(7),i(14),i(533),i(47),i(16)],s=function(e,t,i,n,s,a,r,o){"use strict";
var l={capabilities:"protocols=http-live-streaming,http-mp4-streaming,http-streaming-video,http-streaming-video-720p,http-mp4-video,http-mp4-video-720p;videoDecoders=h264{profile:high&resolution:1080&level:51};audioDecoders=mp3,aac{bitrate:160000}",serverTimelineDelay:1e4,pingDelay:3e4,playbackDelay:1e3,timeline:function(i,n){var a=i.item,r=i.media,l=i.part,c=a.get("ratingKey"),u=a.get("type");if(!c)return t.Deferred().resolve().promise();var d={ratingKey:c,key:a.get("key"),state:i.state};if(i.continuing&&(d.continuing="1"),
a.get("playQueueItemID")&&(d.playQueueItemID=a.get("playQueueItemID")),!("photo"===u||r&&l))return t.Deferred().resolve().promise();if("photo"!==u){var h=a.get("viewOffset")||0,p=r.duration;if(e.isNumber(i.position)&&(h=i.position,h=this.getAbsoluteOffset(r,l,h)),p||e.isNumber(i.duration)&&(p=i.duration,r.duration=p),!p)return t.Deferred().resolve().promise();h>p&&(h=p),d.time=h,d.duration=p,"track"!==u&&a.isLibraryItem()&&this.setViewOffset(a,h,p)}var f="timeline: "+d.state;null!=d.time&&(f+=", "+d.time+"/"+d.duration),
o(f);var m=s.join("/:/timeline",d);return n=e.extend(a.server.getXHROptions(m),n),t.ajax(n)},setViewOffset:function(e,t,i){1!==e.get("extraType")&&(6e4>t||(t>.9*i?(e.set("viewOffset",0),e.set("viewCount",1)):e.set("viewOffset",t)))},ping:function(e,i){if(!i)return t.Deferred().resolve().promise();o("ping transcoder");var n;return n=e.supports("universalTranscoder")?"/video/:/transcode/universal/ping?session="+i:"/video/:/transcode/segmented/ping?session="+i,t.ajax(e.getXHROptions(n))},stop:function(i,n,s){
if(!n)return t.Deferred().resolve().promise();o("stop transcoder");var a;return a=i.supports("universalTranscoder")?"/video/:/transcode/universal/stop?session="+n:"/video/:/transcode/segmented/stop?session="+n,s=e.extend(i.getXHROptions(a),s),t.ajax(s)},getMediaIndex:function(t,i){var n=t.get("Media"),s=e.indexOf(n,e.findWhere(n,{id:i}));return s},getPartIndex:function(t,i){var n=t.Part,s=e.indexOf(n,e.findWhere(n,{key:i}));return s},getPartCount:function(e){return e?e.Part.length:0},getStreams:function(t,i){
var n=[];if(t){var s=e.first(t.Part);s&&s.Stream&&n.push.apply(n,e.where(s.Stream,i))}return n},getSelectedVideo:function(t){var i=r.get("video"),n=this.getStreams(t,{streamType:i.id});return e.first(n)},getSelectedAudio:function(t){var i=r.get("audio"),n=this.getStreams(t,{streamType:i.id,selected:!0});return e.first(n)},getSelectedSubtitles:function(t){var i=r.get("subtitles"),n=this.getStreams(t,{streamType:i.id,selected:!0}),s=e.first(n);return s&&s.id>0?s:void 0},selectStream:function(t,i,n){
if(t){var s=this.getStreams(t,{streamType:i.id});e.each(s,function(e){e.selected=e.id===n})}},getMissingParts:function(t){var i=[];return e.isArray(t)||(t=[t]),e.each(t,function(t){var n=t.Part;n&&e.each(n,function(e){(e.exists===!1||e.accessible===!1)&&i.push(e)})}),i},getRelativeOffset:function(e,t,i){var n=i;if(e.Part.length>1)for(var s=0,a=e.Part.length;a>s;s++){var r=e.Part[s];if(!r.duration)break;if(t.key===r.key)break;n-=r.duration}return n},getAbsoluteOffset:function(e,t,i){var n=i;if(e.Part.length>1)for(var s=0,a=e.Part.length;a>s;s++){
var r=e.Part[s];if(!r.duration)break;if(t.key===r.key)break;n+=r.duration}return n},getPartByAbsoluteOffset:function(t,i){var n;if(t.Part.length>1)for(var s=0,a=0,r=t.Part.length;r>a&&(n=t.Part[a],n.duration)&&(s+=n.duration,!(s>i));a++);else n=e.first(t.Part);return n},getScreenshotIndex:function(t,i){if(t.indexes){var n=t.indexes.split(",");if(n.length)return e.indexOf(n,i)>-1?i:n[0]}},getScreenshotUrl:function(e,t,i){var n=this.getPartByAbsoluteOffset(e,t);if(i=this.getScreenshotIndex(n,i)){var s=this.getRelativeOffset(e,n,t);
return n.key.replace(/[^\/]*$/,"")+"indexes/"+i+"/"+s}},getSeasonIndex:function(e){var t=e.seasonPrefix||"S{1}",i=e.seasonIndex;return i>1e3?i:(e.noLeadingZero||(i=a(i)),n(t,i))},getSeasonEpisodeIndex:function(e){var t=e.seasonPrefix||"S{1}",s=e.episodePrefix||"E{1}",r=e.seasonIndex,o=e.episodeIndex;return o>0&&1e3>r?(e.noLeadingZero||(r=a(r),o=a(o)),n(t,r)+n(s,o)):e.date?i(e.date).format("M/D/YY"):""},getEpisodeIndex:function(e){var t=e.episodePrefix||"E{1}",s=e.episodeIndex||0;return s>0?(e.noLeadingZero||(s=a(s)),
n(t,s)):e.date?i(e.date).format("M/D/YY"):""},isMediaAnalysisRequired:function(t){var i=t?e.first(t.get("Media")):null;return!(!i||i.container)},getPercentWatched:function(e,t){return e>t?50:0>=e||0>=t?0:Math.round(e/t*100)},isWatched:function c(e){var c=!1,t=e.get("type");return"show"===t||"season"===t?c=e.get("viewedLeafCount")===e.get("leafCount"):("episode"===t||"movie"===t)&&(c=e.get("viewCount")&&!e.get("viewOffset")),c}};return l}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;
n=[i(2),i(19),i(4),i(14),i(115),i(120)],s=function(e,t,i,n,s,a){"use strict";var r=t.Collection.extend({mixins:[s],responseType:a.xml,instanceOptions:["url","path","pageStart","pageSize","persistInCache","skipCache"],_context:["parent"],cache:null,cacheKey:function(){return e.result(this,"url")},constructor:function(n,s){s||(s={}),e.each(this.getContext(),function(e){var t=s[e];void 0!==t&&this.setContext(e,t)},this);var a=e.result(this,"instanceOptions");if(e.each(a,function(t){e.has(s,t)&&(this[t]=s[t]);
},this),(null!=this.pageStart||null!=this.pageSize)&&(this.pageStart||(this.pageStart=0),this.pageSize||(this.pageSize=0)),s.populated&&this.resetPopulatePromise(i.Deferred().resolve().promise()),!this.cache||this.skipCache)return void t.Collection.prototype.constructor.apply(this,arguments);this.initialize.apply(this,arguments);var r=this.cache.getItemCacheKey(this),o=this.cache.get(r);return this.uninitialize(),o?o:s.onlyIfCached?{}:(t.Collection.prototype.constructor.apply(this,arguments),void this.cache.store(this,r));
},uninitialize:function(){this.stopListening()},getContext:function(){if(!this.context)return this._context;var t=e.result(this,"context");return this._context.concat(t)},setContext:function(e,t){this[e]=t,this.each(function(i){i.setContext(e,t)})},sync:function(){return this.cache&&this.cache.store(this),t.sync.apply(this,arguments)},syncUrl:function(){var t="";if(this.url&&(t=e.result(this,"url")),this.path&&(t=n.join([t,e.result(this,"path")])),null!=this.pageStart||null!=this.pageSize){var i={
"X-Plex-Container-Start":this.pageStart||0,"X-Plex-Container-Size":this.pageSize||0};t=n.join(t,i)}return t},parse:function(e,t){return this.convert(e)},convert:function(t){var i=t;if(e.isString(i)){var n=e.result(this,"responseType");e.isFunction(this.augmentResponseText)&&(i=this.augmentResponseText(i,n)),i=n.parse(i)}if(e.isFunction(this.augmentResponse)&&(i=this.augmentResponse(i)),e.isArray(i))return i;var s=this.model.prototype.rootPropertyName;if(!s)return i;var a=i[s];return a?(e.isArray(a)||(a=[a]),
a):[]},clone:function(t){t||(t=this.models);var i=e.result(this,"instanceOptions"),n=e.extend(e.pick(this,i),e.pick(this,this.getContext()),{skipCache:!0,persistInCache:!1});return new this.constructor(t,n)||null},cloneDeep:function(t){t||(t=this.models);var i=e.map(t,function(e){return e.clone()});return this.clone(i)},clear:function(t){t=e.extend({silent:!0},t),this.abortPendingPopulate(),this.resetPopulatePromise(null),this.reset([],t)},getSaveParams:function(){return this.map(function(e){return e.getSaveParams();
})}});return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(20)],s=function(e,t){"use strict";function i(t,i){var n=e.invert(t);return e.reduce(t,function(e,t){return e[t]=i[n[t]],e},{})}var n=t.extend({types:{VIDEO:"video",MUSIC:"music",PHOTO:"photo"},elements:{VIDEO:"video",MUSIC:"audio",PHOTO:"photo"},streams:{VIDEO:"video",MUSIC:"audio",PHOTO:"photo"},states:{STOPPED:"stopped",PAUSED:"paused",PLAYING:"playing",BUFFERING:"buffering",ERROR:"error"},castStates:{ERROR:"IDLE",
STOPPED:"IDLE",PAUSED:"PAUSED",PLAYING:"PLAYING",BUFFERING:"BUFFERING"},initialize:function(){this.typeByElement=i(this.elements,this.types),this.elementByType=i(this.types,this.elements),this.typeByStream=i(this.streams,this.types),this.streamByType=i(this.types,this.streams),this.statebyCastState=i(this.castStates,this.states),this.castStateByState=i(this.states,this.castStates)},getTypeByElement:function(e){return this.typeByElement[e]},getElementByType:function(e){return this.elementByType[e];
},getTypeByStream:function(e){return this.typeByStream[e]},getStreamByType:function(e){return this.streamByType[e]},getStateByCastState:function(e){return this.statebyCastState[e]},getCastStateByState:function(e){return this.castStateByState[e]}});return new n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(19),i(4),i(15),i(14),i(222),i(115)],s=function(e,t,i,n,s,a,r){"use strict";var o=t.Collection.extend({mixins:[r],cache:new a,constructor:function(e,n){if(n||(n={}),
this.server=n.server,this.section=n.section,this.channel=n.channel,this.device=n.device,this.parent=n.parent,this.allowInCache=n.allowInCache,this.persistInCache=n.persistInCache,this.skipCache=n.skipCache,n.url&&(this.url=n.url),n.path&&(this.path=n.path),(null!=n.pageStart||null!=n.pageSize)&&(this.pageStart=n.pageStart||0,this.pageSize=n.pageSize||0),n.populated&&this.resetPopulatePromise(i.Deferred().resolve().promise()),!n.allowInCache&&!n.persistInCache)return void t.Collection.prototype.constructor.apply(this,arguments);
this.initialize.apply(this,arguments);var s=this.cache.getItemCacheKey(this),a=this.cache.get(s);return this.uninitialize(),n.onlyIfCached&&(a||(a={})),a?a:(t.Collection.prototype.constructor.apply(this,arguments),void this.cache.store(this,s))},uninitialize:function(){this.stopListening()},sync:function(){return(this.allowInCache||this.persistInCache)&&this.cache.store(this),t.sync.apply(this,arguments)},syncUrl:function(){var t="";if(this.url&&(t=e.result(this,"url")),this.path&&(t=s.join([t,e.result(this,"path")])),
null!=this.pageStart||null!=this.pageSize){var i=this.pageStart||0,n=this.pageSize||0,a={};a["X-Plex-Container-Start"]=i,a["X-Plex-Container-Size"]=n,t=s.join(t,a)}return t},convert:function(t,i){var s=e.isObject(t)?t:n.parseXML(t);if(!i)return s;var a=s[i];return a?(e.isArray(a)||(a=[a]),a):[]},clone:function(e){var t={server:this.server,section:this.section,parent:this.parent,url:this.url};return e||(e=this.models),new this.constructor(e,t)},cloneDeep:function(e){return e||(e=this.map(function(e){
return e.clone()})),this.clone(e)},clear:function(t){t=e.extend({silent:!0},t),this.abortPendingPopulate(),this.resetPopulatePromise(null),this.reset([],t)}});return o.extend=function(){var e=t.Collection.extend.apply(this,arguments);return e.prototype.cache=new a,e},o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(97),i(96),i(43)],s=function(e,t,i){"use strict";var n=i.extend({background:!0,setup:function(e){this.minSize=!0,this.type=e.type,this.modelAttribute=e.modelAttribute||"thumb",
e.placeholder!==!1&&(this.model&&this.model.get("isFolder")?this.placeholderClass=t.folder:e.placeholderClass||(this.placeholderClass=t[this.type])),i.prototype.setup.apply(this,arguments)},setDimensions:function(t){t.width?t.height=e.getPosterHeight(this.type,t.width):t.height&&(t.width=e.getPosterWidth(this.type,t.height)),i.prototype.setDimensions.call(this,t)},setModel:function(e,n){i.prototype.setModel.apply(this,arguments),this.model&&this.model.get("isFolder")&&(this.placeholderClass=t.folder);
}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(6),i(5)],s=function(e,t,i,n){"use strict";var s=0,a=[],r=i.Layout.extend({className:"modal fade",focusDelay:200,animationDelay:500,events:{"hide.bs.modal":"onHide"},initialize:function(e){this.once("render",function(){s+=1,n.trigger("anyModalOpen")}),this.once("close",function(){s-=1,0===s&&n.trigger("allModalsClosed")})},hide:function(){this.isClosed||this.isHidden||this.$el.modal("hide")},onRender:function(){
this.rerender||(this.isForced?this.$el.modal({backdrop:"static",keyboard:!1}):(this.listenTo(n,"shortcut:escape",e.bind(function(){a[0]===this&&this.hide()},this)),this.listenToOnce(this,"close",function(){var e=a.indexOf(this);-1!==e&&a.splice(e,1)}),a.unshift(this),this.$el.modal()),t(":focus").blur())},onHide:function(t){this.isHidden=!0,e.each(this.panes,function(e,t){var i=e.constructor.onModalClose;i&&i.apply(this)},this),setTimeout(e.bind(function(){n.trigger("hide:modal",this),this.trigger("close");
},this),this.animationDelay)}});return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t){"use strict";function i(e){return encodeURIComponent(e||"")}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i,e.exports=t.default},,function(e,t,i){var n,s;n=[i(42)],s=function(e){"use strict";var t={isHostedHttps:"https:"===window.location.protocol,hasConsole:!!(window.console&&window.console.log&&window.console.log.call),hasWebSocket:!!window.WebSocket,hasEventSource:!!window.EventSource,
hasReplaceState:!(!window.history||!window.history.replaceState),hasFileUpload:!!(window.File&&window.FileList&&window.FileReader),hasMediaSource:!(!window.MediaSource&&!window.WebKitMediaSource),hasObjectUrl:function(){var t="ie"===e.id&&11===parseInt(e.version,10);return t||e.presto?!1:!!(window.URL&&window.URL.createObjectURL&&window.URL.revokeObjectURL)}(),hasBlob:function(){try{return!!new Blob}catch(e){return!1}}(),hasFullscreen:function(){var e=document.createElement("div");return!!(e.requestFullScreen||e.webkitRequestFullScreen||e.mozRequestFullScreen||e.msRequestFullscreen);
}(),hasCanvas:function(){var e=document.createElement("canvas");return!(!e.getContext||!e.getContext("2d"))}(),hasTouchScreen:!!("ontouchstart"in window),hasPageVisibility:function(){return document.hidden===!0||document.hidden===!1}(),hasWebKitPageVisibility:function(){return document.webkitHidden===!0||document.webkitHidden===!1}(),isChromeApp:!(!window.chrome||!window.chrome.storage)};return t}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i,i(2),i(4),i(7),i(15),i(14),i(26),i(25),i(47),i(160),i(93),i(24),i(196),i(443)],
s=function(e,t,n,s,a,r,o,l,c,u,d,h,p,f){"use strict";var m=h.extend({idAttribute:"ratingKey",defaults:{title:"",titleSort:"",tagline:"",rating:0,summary:"",year:"",studio:"",contentRating:"",originallyAvailableAt:"",originallyAvailableAtPlaceholder:"YYYY-MM-DD",originalTitle:"",thumb:"",parentThumb:"",grandparentThumb:"",banner:"",art:"",parentArt:"",grandparentArt:"",primaryExtraKey:""},omittedSaveAttrs:["updatedAt","thumb","banner","art","Media","Location"],tagAttrs:["Collection","Director","Writer","Genre","Mood","Country","Label","Similar"],
subcollections:["Media","Field","Role","Location","Chapter"],metadataElementNames:["Directory","Video","Track","Photo","Hub"],url:function(){return this.get("key")},urlRoot:function(){return this.get("key")},firstItemUrl:function(){return this.url()},singleMetadataModel:function(){return this},cacheKey:function(e){e.identifier&&!this.isLibraryItem(e)&&(e=this.normalizeKey(e));var t=this.normalizeChildrenKey(e.key);return this.server&&this.server.getScopedKey(t.key)},preserveCachedAttributes:function(e){
return/\/(hubs\/[\/\w]*|allLeaves|children|library\/sections\/\d+\/\w+)(\?.*)?$/.test(e)},initialize:function(e,t){this.listenTo(this,"socket:timeline",function(e){e.state===d.PROCESSED?(this.fetch({data:{includeExtras:"1",includeRelated:"1",includeRelatedCount:"5",includeConcerts:"1",includeOnDeck:"1",includeChapters:"1"}}),this.refreshChildren()):e.state===d.DELETED&&this.trigger("destroy",this,this.collection)})},convert:function(e){t.isString(e)&&(e=a.replaceXMLElementNames(e,this.metadataElementNames,"Metadata"));
var i=t.isObject(e)?e:a.parseXML(e);if(!i.ratingKey&&!i.key&&!i.id){var n=i.Metadata||i;n.identifier=i.identifier,n.mediaTagPrefix=i.mediaTagPrefix,n.mediaTagVersion=i.mediaTagVersion,n.allowSync=i.allowSync,n.librarySectionID=i.librarySectionID,n.librarySectionUUID=i.librarySectionUUID,i=n}a.parseBoolean(i,["allowSync","selected"]),a.parseInteger(i,["index","parentIndex","absoluteIndex","duration","viewOffset","viewCount","leafCount","viewedLeafCount","extraType","lastViewedAt","addedAt","updatedAt","playlistID","generatorID","generatorType","syncItemId"]),
a.parseFloat(i,["rating","userRating"]),a.parseArray(i,this.subcollections),a.parseArray(i,this.tagAttrs);var s=i.Media;return t.each(s,function(e){a.parseBoolean(e,["indirect","optimizedForStreaming","premium"]),a.parseInteger(e,["id","duration","width","height","bitrate","audioChannels","proxyType"]),a.parseArray(e,"Part");var i=e.Part;t.each(i,function(e){a.parseBoolean(e,"optimizedForStreaming"),a.parseInteger(e,["id","duration","size"]),a.parseEncodedString(e,"file"),a.parseArray(e,"Stream"),
e.exists="0"!==e.exists,e.accessible="0"!==e.accessible;var i=e.Stream;t.each(i,function(e){a.parseBoolean(e,"selected"),a.parseInteger(e,["id","index","streamType","duration","width","height","bitrate","bitDepth","samplingRate","channels"])})})}),i},parse:function(e){var n=this.convert(e);if(!n.key)return n;this.isLibraryItem(n)||(n=this.normalize(n)),"photo"===n.type&&/\/children$/.test(n.key)&&(n.type="photoAlbum"),"photoalbum"===n.type&&(n.type="photoAlbum"),n.isFolder=/\/folder\?parent\=/.test(n.key),
n.isExtra=!!n.extraType;var a=i(40),r=i(193);this.parseChildren(n,a),this.parseExtras(n,a),this.parseRelated(n,r),this.parseOverlays(n),this.parsePopularLeaves(n,a),this.parseConcerts(n,f),this.parseOnDeck(n),null!=n.viewedLeafCount&&(n.unviewedLeafCount=n.leafCount-n.viewedLeafCount);var l=n.Media,u=c.get("subtitles");return t.each(l,function(e){var i=t.first(e.Part);if(i&&i.Stream){var n=i.Stream,a=o.getStreams(e,{streamType:u.id,selected:!0}),r={id:0,streamType:u.id,language:s("None")};a.length||(r.selected=!0),
n.unshift(r)}}),t.defaults(n,this.defaults),n},parseChildren:function(e,t){var i=this.normalizeChildrenKey(e.key);if(i.hasChildren&&(e.key=i.key,!this.get("children"))){var n=i.previousKey;"album"===e.type&&(n=r.join(n,{includeRelated:1}));var s=new t([],{server:this.server,section:this.section,parent:this,url:n});this.set("children",s)}},parsePopularLeaves:function(e,t){if(!e.PopularLeaves)return void this.unset("popularLeaves");var i=this.get("popularLeaves"),n=[],s=!1;e.PopularLeaves.size>0&&(n=e.PopularLeaves,
s=!0),i?i.set(n,{parse:s}):(i=new t(n,{server:this.server,section:this.section,parent:this,url:e.PopularLeaves.key,populated:!0,parse:s}),this.set("popularLeaves",i)),delete e.PopularLeaves},parseExtras:function(e,t){if(!e.Extras)return void this.unset("extras");var i,n,s=this.get("extras");e.Extras.size>0?(i=e.Extras,n=!0):(i=[],n=!1),s?s.set(i,{parse:n}):(s=new t(i,{server:this.server,section:this.section,parent:this,url:e.key+"/extras",populated:!0,parse:n}),this.set("extras",s)),delete e.Extras;
},parseRelated:function(e,t){if(!e.Related)return void this.unset("related");var i,n,s=this.get("related");e.Related.Metadata?(i=e.Related,n=!0):(i=[],n=!1),s?s.reset(i,{parse:n}):(s=new t(i,{server:this.server,section:this.section,parent:this,populated:!0,parse:n}),this.set("related",s)),delete e.Related},parseOverlays:function(e){if(!e.Overlay)return void this.unset("overlays");var i=this.get("overlays"),n=t.isArray(e.Overlay)?e.Overlay:[e.Overlay],s=!0;i?i.reset(n,{parse:s}):(i=new p(n,{server:this.server,
section:this.section,parent:this,populated:!0,parse:s}),this.set("overlays",i)),delete e.Overlay},parseConcerts:function(e){if(!e.Concert)return void this.unset("concerts");var i=this.get("concerts"),n=t.isArray(e.Concert)?e.Concert:[e.Concert],s=!0;i?i.reset(n,{parse:s}):(i=new f(n,{server:this.server,section:this.section,parent:this,populated:!0,parse:s}),this.set("concerts",i)),delete e.Concert},parseOnDeck:function(e){if(e.OnDeck){var t=this.get("onDeck"),i=!0,n=e.OnDeck.Metadata;t?t.set(n,{parse:i
}):(t=new m(n,{server:this.server,section:this.section,parse:i}),this.set("onDeck",t)),delete e.OnDeck}},normalize:function(e){return e=this.normalizeKey(e),e=this.normalizeType(e),e=this.normalizeMetadata(e)},normalizeChildrenKey:function(e){var t=/(.*)\/children$/.exec(e),i=e;return t&&(e=t[1]),{key:e,previousKey:i,hasChildren:!!t}},normalizeKey:function(e){var t=e.key.split("/");return 1===t.length&&e.containerKey&&(e.hasInvalidKey=!0,e.originalKey=e.key,e.key=e.containerKey+"/"+e.key),e.ratingKey||(e.ratingKey=e.originalKey||e.key),
e},normalizeType:function(e){return e.mediaType&&!e.type&&(e.type=e.mediaType,delete e.mediaType),e.elementName&&!e.type&&(e.type=e.elementName.toLowerCase()),/image/i.test(e.type)?e.type="photo":/(movie|episode|video)/i.test(e.type)&&(e.type="clip"),l.get(e.type)||(e.type="channelDirectory"),e},normalizeMetadata:function(e){return e.label?(e.title=e.label,delete e.label):e.artist&&(e.track?(e.title=e.track,e.originalTitle=e.artist,e.parentTitle=e.album,e.grandparentTitle=e.albumArtist):e.album?(e.title=e.album,
e.parentTitle=e.artist):e.title=e.artist,delete e.track,delete e.album,delete e.albumArtist,delete e.artist),e.totalTime&&(e.duration=e.totalTime,delete e.totalTime),e},refreshChildren:function(){var e=this.get("children");if(e&&e.populatePromise){var t=e.fetch();t.always(function(){e.invoke("refreshChildren")})}},resolveIndirect:function(e,i){var s=n.Deferred();if(!e||!i)return s.reject(this).promise();if(!e.indirect)return s.resolve(this).promise();if(i.postURL)return this.resolvePostUrl(e,i);var a=i.key;
this.server.get("cloud")&&(a=this.server.swizzleNodeUrl(i.key));var r=n.ajax(this.server.getXHROptions(a));return r.done(t.bind(function(t,n,a){this.mergeIndirectResponse(t,e,i)?s.resolve(this):s.reject(this)},this)),r.fail(t.bind(function(){s.reject(this)},this)),s.promise()},resolvePostUrl:function(e,i){var s=n.Deferred(),a=this.server.get("isFullServer")?this.server:this.server.parent.get("primaryServer");if(!a||!a.get("isConnected"))return s.reject(this).promise();var r=a.getXHROptions("/system/proxy");
r.headers=r.headers||{},r.headers["X-Plex-Url"]=i.postURL;var o=n.ajax(r);return o=o.then(t.bind(function(e,t,s){var a=i.key+"&postURL="+encodeURIComponent(i.postURL),r=s.getAllResponseHeaders()+"\r\n"+e;this.server.get("cloud")&&(a=this.server.swizzleNodeUrl(a));var o=this.server.getXHROptions(a);return o.type="POST",o.data=r,n.ajax(o)},this)),o.done(t.bind(function(t,n,a){this.mergeIndirectResponse(t,e,i)?s.resolve(this):s.reject(this)},this)),o.fail(t.bind(function(){s.reject(this)},this)),s.promise();
},mergeIndirectResponse:function(e,i,n){var s=a.parseXML(e);if(!(s&&s.Video&&s.Video.Media&&s.Video.Media.Part))return!1;var r=this.parse(s.Video),o=t.first(r.Media),l=t.first(o.Part);if(o.Part.length>1){var c=t.indexOf(i.Part,n);c<o.Part.length&&(l=o.Part[c])}if(!o||!l)return!1;if(o.indirect=!1,t.extend(i,t.omit(o,"Part")),t.extend(n,l),s.httpHeaders){for(var u,d=new RegExp("([^=]+)=([^&]+)&?","g"),h={};u=d.exec(s.httpHeaders);)u[1]in h?(t.isArray(h[u[1]])||(h[u[1]]=[h[u[1]]]),h[u[1]].push(u[2])):h[u[1]]=u[2];
this.set("indirectHttpHeaders",h,{silent:!0})}return!0},getSaveParams:function(e,i){return t.each(e.Field,function(t){e[t.name+".locked"]=t.locked}),delete e.Field,t.each(this.tagAttrs,function(i){i in e&&(t.isEmpty(e[i])?e[u(i)+"[]"]="":t.each(e[i],function(t,n){e[u(i)+"["+n+"].tag.tag"]=t.tag}),delete e[i])}),e},batchAdd:function(e,i,s){var a=t.map(e,function(e){return e.get("ratingKey")}),r="/library/metadata/"+a.join(",")+"/"+i+"/add?tag="+encodeURIComponent(s),o=t.extend(this.server.getXHROptions(r),{
type:"PUT"});return n.ajax(o)},getDownloadUrl:function(){var e=t.first(this.get("Media"));if(e){var i=t.first(e.Part);if(i&&i.key)return this.server.resolveUrl(i.key,{appendToken:!0})}return""},getFilepath:function(){var e=t.first(this.get("Media"));if(e){var i=t.first(e.Part);if(i)return i.file}return null},getLocation:function(){var e=t.first(this.get("Location"));return e?e.path:this.getFilepath()},getMediaKey:function(){var e=t.first(this.get("Media")),i=this.get("key");if(e){var n=t.first(e.Part);
if(n)return n.key}return i},isLibraryItem:function(e){var t=e?e.identifier:this.get("identifier");if(t)return"com.plexapp.plugins.library"===t;var i=e?e.key:this.get("key");return/^(\/sync\/[A-Za-z0-9-\/]*)?\/library\//.test(i)},isPlexMusicItem:function(){var e=this.section;return e&&"com.plexapp.agents.plexmusic"===e.get("agent")}});return m}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t){"use strict";function i(e,t,i){return e!==t?i.fn(this):i.inverse(this)}Object.defineProperty(t,"__esModule",{
value:!0}),t.default=i,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(2),a=n(s),r=i(20),o=n(r),l=i(33),c=n(l),u=o.default.extend({mixins:c.default,initialize:function(){var e=this,t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];t.interface&&(this.interface=t.interface),t.props&&(this.props=t.props),a.default.each(this.interface,function(t){e[t]=a.default.bind(e._proxy,e,t)})},_proxy:function(e){for(var t=this.getInstance(),i=arguments.length,n=Array(i>1?i-1:0),s=1;i>s;s++)n[s-1]=arguments[s];
return t[e].apply(t,n)},register:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];this.hasInstance()&&!t.ignorePrevious&&(this._previousInstance=this.getInstance()),this._instance=e,t.silent||this.trigger("change:instance",e)},registerOnce:function(e){if(!this.hasInstance()){var t=e();this.register(t.instance||t,t.options||void 0)}},restorePrevious:function(){this._previousInstance&&this.register(this._previousInstance)},getInstance:function(){if(this.hasInstance())return this._instance;
throw new Error("Nothing has been registered to this adapter.")},hasInstance:function(){return null!=this._instance},prop:function(e){if(a.default.contains(this.props,e))return this.getInstance()[e];throw new Error("The "+e+" property has not been defined for this adapter")}});t.default=u,e.exports=t.default},,function(e,t,i){var n,s;n=[i(2),i(19)],s=function(e,t){"use strict";var i=t.Model.extend({defaults:e.extend({allowFlash:!1,allowServerUpdates:!1,shouldFilterPublicMediaServerConnections:!1,
allowHttpsMediaServerConnections:!1,allowLoopbackDiscovery:!1,allowMixedContent:!1,allowBaseImagePreloading:!0,allowBaseImageBlobs:!0,emulateCNP:!1,heartbeatInterval:1e4,allowManualServers:!1,proxied:!1,cssPath:"",requireSignIn:!0,myPlexScheme:"https",myPlexUrl:"plex.tv",requiresPlexPass:!1,myPlexAccessToken:null,alerts:null,primaryServer:null},window.PLEXWEB)});return new i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(15),i(429),i(29),i(35)],s=function(e,t,i,n,s){"use strict";
var a=n.extend({mixins:i,model:s,metadataElementNames:["Directory","Video","Track","Photo","Hub"],collectionProperties:["key","totalSize","viewGroup","allowSync","title","grandparentTitle","art"],url:function(){var t=this.section||this.parent;return t?e.result(t,"url"):""},initialize:function(e,t){t||(t={}),this.allowAllLeaves=t.allowAllLeaves,this.populatedRange={start:0,end:0}},parse:function(i){var n=this.convert(this.mergeElements(i));null==n.totalSize&&(n.totalSize=n.size),t.parseInteger(n,"totalSize"),
t.parseBoolean(n,"allowSync"),t.parseArray(n,"Metadata"),e.each(this.collectionProperties,function(e){var t=this[e],i=n[e],s=this.section?this.section.get("currentSubset").id:null,a=s&&"all"!==s&&"folder"!==s;a&&"totalSize"===e&&i>200&&(i=200),"totalSize"===e&&this.totalSizeAdjustment&&(i+=this.totalSizeAdjustment),void 0!==i&&t!==i&&(this[e]=i,this.trigger("change:"+e,this,i))},this);var s=n.Metadata,a=e.result(this,"url");return e.each(s,function(e){e.containerKey=a,n.identifier&&(e.identifier=n.identifier),
n.mediaTagPrefix&&(e.mediaTagPrefix=n.mediaTagPrefix),n.mediaTagVersion&&(e.mediaTagVersion=n.mediaTagVersion)}),this.allowAllLeaves?s:e.reject(s,function(e){var t=/\/allLeaves$/.test(e.key);return t&&this.totalSize&&(this.totalSize-=1,this.totalSizeAdjustment||(this.totalSizeAdjustment=0),this.totalSizeAdjustment-=1),t},this)},mergeElements:function(i){if(e.isString(i))i=t.replaceXMLElementNames(i,this.metadataElementNames,"Metadata");else if(e.isObject(i)&&!i.Metadata){var n=e.compact(e.pick(i,this.metadataElementNames));
i.Metadata=e.flatten(n,!0)}return i},remove:function(e,t){n.prototype.remove.apply(this,arguments),i.remove.apply(this,arguments)},clear:function(e){this.totalSize=null,this.trigger("change:totalSize",this,null),delete this.totalSizeAdjustment,this.populatedRange={start:0,end:0},n.prototype.clear.apply(this,arguments)},splitByType:function(){var e={};return this.each(function(t){var i=t.get("type");e.hasOwnProperty(i)?e[i].push(t):e[i]=[t]}),e},filterByType:function(e){var t=this.filter(function(t){
return t.get("type")===e});return this.clone(t)}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";function n(e){return function(){return e.apply(this,r.default.initial(arguments))}}var s=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var a=i(2),r=s(a);t.default=n,e.exports=t.default},function(e,t,i){var n,s;n=[i(2),i(20)],s=function(e,t){"use strict";var i=/version\/(\d+(\.\d+)?)/i,n=/(?:chrome|crios|gfibertv)[\/-](\d+(\.\d+)?)/i,s=/firefox[ \/](\d+(\.\d+)?)/i,a=/(msie |rv:)(\d+(\.\d+)?)/i,r=/(?:applewebkit|safari)\/(\d+(\.\d+)?)/i,o=function(e){
var t=/\(.* ([^\)]+)\)$/.exec(e);return t&&t[1]||void 0},l=t.extend({browsers:[{id:"konvergo",name:"Plex Media Player",webkit:!0,regex:/plexmediaplayer/i,versionRegex:/plexmediaplayer (\d+\.\d+\.\d+)/i},{id:"anvergo",name:"Anvergo",webkit:!0,regex:/Anvergo/,versionRegex:/Anvergo.*-(.*)/i},{id:"wiiu",name:"Wii U",regex:/wiiu/i,versionRegex:r},{id:"ps3",name:"Unknown Browser",regex:/\(PLAYSTATION 3 \d\./},{id:"ps3",name:"Unknown Browser",regex:/\(PlayStation 4 \d\./},{id:"ps3",name:"Mystery 3",webkit:!0,
regex:/\(PlayStation 3\)/,versionRegex:r},{id:"ps4",name:"Mystery 4",webkit:!0,regex:/\(PlayStation 4\)/,versionRegex:r},{id:"edge",name:"Microsoft Edge",regex:/edge/i,versionRegex:/edge\/(\d+(\.\d+)?)/i},{id:"ie",name:"Internet Explorer",msie:!0,regex:/(msie|trident)/i,versionRegex:a,versionMatchIndex:2},{id:"opera",name:"Opera",presto:!0,regex:/opera/i,versionRegex:i},{id:"opera",name:"Opera",webkit:!0,regex:/OPR\//,versionRegex:/OPR\/\s?(\d+(\.\d+)?)/},{id:"chrome",name:"Chrome",webkit:!0,regex:/(chrome|crios|gfiber)/i,
versionRegex:n},{id:"firefox",name:"Firefox",gecko:!0,regex:/firefox/i,versionRegex:s},{id:"safari",name:"Safari",webkit:!0,regex:/os x.+safari/i,versionRegex:i},{id:"safari",name:"Safari",webkit:!0,regex:/applewebkit.+version/i,versionRegex:/applewebkit.+version\/(\d+(\.\d+)?)/i},{id:"safari",name:"Safari",webkit:!0,regex:/applewebkit/i,versionRegex:/(?:applewebkit|safari)\/(\d+(\.\d+)?)/i}],platforms:[{id:"netcast",name:"NetCast",tv:!0,predicate:function(e){return/netcast/i.test(e)&&!/web[o0]s/i.test(e);
}},{id:"webos",name:"webOS",tv:!0,predicate:function(e){var t=/web[o0]s/i.test(e)&&/large screen/i.test(e);return this.version(e)?t:!1},version:function(e){try{return JSON.parse(window.PalmSystem.deviceInfo).platformVersion}catch(t){}}},{id:"weboshybrid",name:"webOS",tv:!0,predicate:function(e){var t=/web[o0]s/i.test(e)&&/large screen/i.test(e);return!(!t||!window.NetCastGetMouseOnOff)}},{id:"blackberry",name:"Blackberry",mobile:!0,regex:/BlackBerry|RIM|BB10/},{id:"ps3",name:"PlayStation 3",tv:!0,
regex:/P(lay)?S(tation )?3/,version:function(e){return window.WM_devSettings?window.WM_devSettings.version:void 0}},{id:"ps4",name:"PlayStation 4",tv:!0,regex:/P(lay)?S(tation )?4/,version:function(e){return window.WM_devSettings?window.WM_devSettings.version:void 0}},{id:"wiiu",name:"Wii U",tv:!0,regex:/Nintendo WiiU/},{id:"smarthub",name:"SmartHub",tv:!0,regex:/smarthub/i},{id:"sta",name:"Smart TV Alliance",tv:!0,version:function c(t){var c,i;if(/SmartTvA/.test(t))i=/SmartTvA\/(\d+\.\d+)/.exec(t),
c=i&&i[1]||c;else{var n=[/Linux i686.+Chromium\/18/,/nettv\/4.2/i,/toshiba-dtv/i,/viera/i],s=[/nettv\/4/i],a=[/nettv/i],r=function(e){return e.test(t)};e.some(n,r)?c="2.0":e.some(s,r)?c="1.0":e.some(a,r)&&(c="0.0")}return c},predicate:function(e){return void 0!==this.version(e)}},{id:"tivo",name:"TiVo",tv:!0,regex:/TiVo/,version:function(e){var t=/TCD[^,]+/.exec(e);return t&&t[0]||void 0}},{id:"viziomtk",name:"Vizio MTK",tv:!0,predicate:function(e){return/opera/i.test(e)&&"undefined"!=typeof iMTK_JSP;
}},{id:"viziosigma",name:"Vizio Sigma",tv:!0,predicate:function(e){return/opera/i.test(e)&&/vizio/i.test(e)},version:function(e){var t=/\/([^\s]+) \(Vizio/.exec(e);return t&&t[1]||void 0}},{id:"operatvstore",name:"Opera TV Store",tv:!0,predicate:function(e){var t=/Opera TV Store/.test(e),i=/TV Store/.test(e)&&/OMI\//.test(e);return t||i}},{id:"operatv",name:"Opera TV",tv:!0,regex:/opera\/\d+\.\d+ \(linux (mips|arm)/i},{id:"googlefiber",name:"Google Fiber",tv:!0,regex:/gfibertv/i},{id:"ios",name:"iOS",
mobile:!0,regex:/(iphone|ipad|ipod)/i},{id:"android",name:"Android",mobile:!0,regex:/android/i},{id:"windowsphone",name:"Windows Phone",mobile:!0,regex:/windows phone/i},{id:"webos",name:"webOS",mobile:!0,predicate:function(e){return/web[o0]s/i.test(e)&&!/large screen/i.test(e)}},{id:"openelec-rpi2",name:"OpenELEC (Raspberry Pi)",tv:!0,regex:/plexmediaplayer.*openelec-rpi2/i,version:o},{id:"openelec",name:"OpenELEC",tv:!0,regex:/plexmediaplayer.*openelec/i,version:o},{id:"linuxkonvergo",name:"Linux",
tv:!0,regex:/plexmediaplayer.*linux/i,version:o},{id:"osxkonvergo",name:"OSX",tv:!0,regex:/plexmediaplayer.*mac/i,version:o},{id:"windowskonvergo",name:"Windows",tv:!0,regex:/plexmediaplayer.*win/i,version:o},{id:"linux",name:"Linux",context:"platform",regex:/linux/i},{id:"osx",name:"OSX",context:"platform",regex:/mac/i},{id:"windows",name:"Windows",context:"platform",regex:/win/i}],id:"unknown",name:"Unknown Browser",platform:"Unknown Platform",version:"0",platformVersion:"0",platformModifierKey:"ctrl",
webkit:!1,gecko:!1,msie:!1,presto:!1,constructor:function(e){var t="",i="";e?(t=e.userAgent,i=e.platform):null!=navigator&&(t=navigator.userAgent,i=navigator.platform),this.detect({userAgent:t,platform:i})},detect:function(t){var i,n=this.runTests(this.browsers,t),s=this.runTests(this.platforms,t);n&&(this.id=n.id,this.name=n.name,this.version=this.getVersion(t.userAgent,n.versionRegex,n.versionMatchIndex||1),this.webkit=!!n.webkit,this.gecko=!!n.gecko,this.msie=!!n.msie,this.presto=!!n.presto),s&&(i=e.isFunction(s.version)?s.version(t.userAgent):s.version,
this.platform=s.name,this.platformID=s.id,this.platformVersion=i||this.platformVersion,this.mobile=!!s.mobile,this.tv=!!s.tv,("OSX"===s.name||"iOS"===s.name)&&(this.platformModifierKey="command"))},runTests:function(e,t){for(var i,n,s,a=0;n!==!0&&(s=e[a++]);)i=t[s.context||"userAgent"],s.regex?n=s.regex.test(i):s.predicate&&(n=s.predicate(i));return s},getVersion:function(e,t,i){var n=e.match(t);return n&&n.length>i&&n[i]||"0"},toJSON:function(){var t={};for(var i in this)e.has(this,i)&&this[i]&&(t[i]=this[i]);
return t}});return new l}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(6),i(34),i(165),i(512),i(9),i(39),i(135)],s=function(e,t,i,n,s,a,r,o,l){"use strict";var c="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",u=i.ItemView.extend({tagName:"img",background:!1,backgroundSize:"",cache:new a,initialize:function(t){t||(t={}),e.bindAll(this,"onLoad","onError","loadImage"),this.pixelRatio=window.overridePixelRatio||window.devicePixelRatio||1,
this.url=t.url,this.server=t.server,this.placeholder=t.placeholder,this.placeholderClass=t.placeholderClass,this.modelAttribute=t.modelAttribute,this.ignoreAttributeChanges=t.ignoreAttributeChanges,this.exposeUrl=t.exposeUrl,this.resetOnError=t.resetOnError,this.emptyImage=t.explicitEmpty?"url("+c+")":"",t.background&&(this.background=t.background),t.backgroundSize&&(this.backgroundSize=t.backgroundSize),t.format&&(this.format=t.format),t.quality&&(this.quality=t.quality),e.isFunction(t.getUrl)&&(this.getUrl=t.getUrl),
this.allowBaseImageBlobs=o.get("allowBaseImageBlobs"),this.allowBaseImagePreloading=o.get("allowBaseImagePreloading"),this.setup(t)},setup:function(e){this.setDimensions(e),this.setFilters(e.filters),this.setModel(e.model,e)},setDimensions:function(e){e.width&&e.height&&(this.transcode=!0,this.width=e.width,this.height=e.height)},setFilters:function(e){this.filters=e||void 0},hasFilters:function(){return void 0!==this.filters},setModel:function(e,t){t||(t={}),this.stopListening(),this.src=null,this.model=e,
e&&(this.server||(this.server=e.server),t.url||this.modelAttribute&&(this.url=this.getUrl(e.get(this.modelAttribute)),this.ignoreAttributeChanges||this.listenTo(e,"change:"+this.modelAttribute,this.onChange)))},setElement:function(e){i.ItemView.prototype.setElement.apply(this,arguments),this.render({force:!0})},getUrl:function(e){return e},getTranscodeUrl:function(e){return this.server&&this.transcode?s.image(this.server,e,{fallbackServer:l.hasInstance()?l.get("primaryServer"):null,width:this.width*this.pixelRatio,
height:this.height*this.pixelRatio,minSize:this.minSize,filters:this.filters,format:this.format,quality:this.quality}):e},render:function(e){return e||(e={}),this.url||this.placeholder||this.placeholderClass?this.src?(e.force&&this.showImage(this.src),this):(this.isPlaceholderRendered&&this.url||this.showPlaceholder(),this.url&&this.load(this.url,this.transcode).then(this.onLoad,this.onError,this.onLoad),this):this},showPlaceholder:function(){return this.isPlaceholderRendered=!0,this.$el.removeClass("loaded"),
this.placeholderClass?(this.$el.addClass(this.placeholderClass),void this.$el.css("background-image",this.emptyImage)):this.placeholder?void this.showImage(this.placeholder):void(this.background?this.$el.css("background-image",this.emptyImage):this.showImage(c))},showImage:function(e){return this.background?void this.showBackgroundImage(e):void this.$el.attr("src",e).removeAttr("width").removeAttr("height")},showBackgroundImage:function(e){this.$el.css("background-image","url("+e+")")},load:function(e){
if(!e)return t.Deferred().reject().promise();if(e=this.getTranscodeUrl(e),this.exposeUrl&&this.$el.attr("data-image-url",e),this.allowBaseImageBlobs&&n.hasBlob&&n.hasObjectUrl){var i=this.loadBlob(e);return i=i.then(this.loadImage,null,this.loadImage)}return this.allowBaseImagePreloading?this.loadImage(e):t.Deferred().resolve(e).promise()},loadBlob:function(i){var n=t.Deferred();this.cancel();var s=this.cache.getBlobUrl(i);if(s)return n.resolve(s),n.promise();var a=this.cache.getPlaceholder(i);a&&n.notify(a,!0);
var r=new XMLHttpRequest;return r.open("GET",i,!0),r.responseType="arraybuffer",this.xhr=r,r.onreadystatechange=e.bind(function(){if(4===r.readyState)if(r.onreadystatechange=null,this.xhr=null,200===r.status){var e=new Blob([r.response],{type:"image/jpeg"}),t=window.URL.createObjectURL(e);this.cache.store({url:i,blobUrl:t}),n.resolve(t)}else n.reject()},this),r.send(),n.promise()},loadImage:function(e,i){var n=t.Deferred(),s=new Image;return s.onload=function(){s.onload=s.onabort=s.onerror=null,i?n.notify(e,s.width,s.height):n.resolve(e,s.width,s.height);
},s.onabort=s.onerror=function(){s.onload=s.onabort=s.onerror=null,n.reject()},s.src=e,n.promise()},cancel:function(){this.xhr&&(this.xhr.onreadystatechange=null,this.xhr.abort(),this.xhr=null)},onLoad:function(e,t,i){if(this.backgroundSize){var n=t&&t>this.width||i&&i>this.height?this.backgroundSize:"auto";this.$el[0].style.backgroundSize=n}this.src=e,this.placeholderClass&&this.$el.removeClass(this.placeholderClass),this.$el.addClass("loaded"),this.showImage(e),this.trigger("load",e,t,i)},onError:function(){
this.resetOnError&&this.showPlaceholder(),this.trigger("error")},onClose:function(){this.cancel()},onChange:function(e,t){return t=this.getUrl(t),this.url===t?this:(this.url=t,this.src=null,void this.render())}});return u}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(37),a=n(s),r=new a.default({"interface":["get","set","remove","clear"]});t.default=r,e.exports=t.default},function(e,t,i){"use strict";
var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(2),a=n(s),r=i(38),o=n(r),l=i(21),c=n(l),u=i(434),d=n(u),h=i(507),p=n(h),f=d.default.extend({name:"UserStorageModel",storageKey:"users",sessionAttrs:{activeUserID:c.default.integer},syncedRelations:{users:{relationClass:p.default}},initialize:function(){var e=arguments,t=this;this.debouncedSave=a.default.debounce(function(){(0,o.default)(!e.length,"Set attributes before using `debouncedSave` so the model is immediately updated. Otherwise, race conditions may occur."),
t.save()},2e3)},getActiveUser:function(){var e=this.get("users"),t=this.get("activeUserID");return t?e.get(t):void 0},clearActiveUser:function(){var e=this.getActiveUser();return e&&e.clearSensitiveAttributes(),this.unset("activeUserID"),this.save()},getActiveServers:function(){var e=this.getActiveUser();return e?e.get("servers"):void 0}});t.default=new f,e.exports=t.default},function(e,t,i){var n,s;n=[i(2),i(26),i(158),i(16)],s=function(e,t,i,n){"use strict";var s=e.extend({},i,{type:"video",qualities:{
bitrate:[64,96,208,320,720,1500,2e3,3e3,4e3,8e3,1e4,12e3,2e4],videoResolution:["220x128","220x128","284x160","420x240","576x320","720x480","1280x720","1280x720","1280x720","1920x1080","1920x1080","1920x1080","1920x1080"],videoQuality:[10,20,30,30,40,60,60,75,100,60,75,90,100]},getAvailableQualitiesFor:function(e,i,n){if(!e||!i)return[];var s=i.get("transcoderVideo"),a=i.get("transcoderVideoRemuxOnly"),r=t.getSelectedVideo(e),o=!(!r||!r.bitrate),l=!!e.videoResolution;if(!s||a||!o&&!l)return[];var c=o?this.getAvailableQualitiesBelowBitrate(r.bitrate,n):this.getAvailableQualitiesBelowResolution(e.videoResolution,n);
return c},getAvailableQualitiesBelowBitrate:function(e,t){return t||(t={}),t.comparator=function(t){var i=this.qualities.bitrate[t];return i>=e},this.getAvailableQualities(t)},getAvailableQualitiesBelowResolution:function(e,t){t||(t={});var i=this.getHeightFromResolution(e);return t.comparator=function(e){var t=this.qualities.videoResolution[e],n=this.getHeightFromResolution(this.getResolutionFromSize(t));return n>=i},this.getAvailableQualities(t)},getNearestIndexToBitrate:function(e){return this.getNearestIndex(this.qualities.bitrate,e);
},getMinimumQuality:function(e,t){var i=e===s.ORIGINAL?Number.MAX_VALUE:e,n=t===s.ORIGINAL?Number.MAX_VALUE:t;return n>i?e:t},getMaximumQuality:function(e,t){return this.getMinimumQuality(e,t)===e?t:e}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(7),a=n(s),r=i(99),o=n(r),l=["id","typeString"],c=(0,o.default)(l,[{id:1,typeString:"video",key:"videoStreamID",title:function(){return(0,a.default)("Video");
}},{id:2,typeString:"audio",key:"audioStreamID",title:function(){return(0,a.default)("Audio")}},{id:3,typeString:"subtitles",key:"subtitleStreamID",title:function(){return(0,a.default)("Subtitles")}}]);t.default=c,e.exports=t.default},function(e,t,i){var n,s;n=[i(1119),i(4),i(2),i(12),i(6),i(7),i(5),i(26),i(94),i(78),i(122),i(17),i(11),i(252),i(50),i(810),i(61),i(103),i(71)],s=function(e,t,i,n,s,a,r,o,l,c,u,d,h,p,f,m,g,v,y){"use strict";var b=s.Layout.extend({mixins:[p],tagName:"li",className:"striped-list-item media-list-item",
template:e,visible:!1,ui:{container:".media-list-inner-item",actions:".media-actions",dropdown:".media-actions-dropdown"},regions:{rating:".media-rating",progress:".media-progress"},events:{"mouseenter > a":"onMouseEnter","mouseleave > a":"onMouseLeave","mousedown > a":"onMouseDown","click > a":"onClick","click .play-btn":"onPlayClick","click .play-unwatched-btn":"onPlayUnwatchedClick","click .edit-btn":"onEditClick","click .more-btn":"onMoreClick","click .media-title-link":"onTitleClick","hide.bs.dropdown .media-actions-dropdown":"onDropdownHide"
},onlyAfterRender:["select","deselect"],initialize:function(e){i.bindAll(this,"onResize"),this.skipFirstRender=e.skipFirstRender,this.continuousPlay=e.continuousPlay;var t;this.model&&(t=this.model.get("type")),t||(t=e.type),this.type=t,this.sort=e.sort,this.$el.addClass(t),this.sort&&/^(?:addedAt|originallyAvailableAt|rating|mediaHeight|duration)$/.test(this.sort)&&this.$el.addClass("show-sort"),this.parentMediaActions=e.mediaActions;var n=this.model&&this.model.server||this.parentMediaActions&&this.parentMediaActions.server;
this.mediaActions=new f({},{item:this.model,type:t,server:n}),this.listenTo(this.mediaActions,{"change:showPlay":this.onActionsChange,"change:showEdit":this.onActionsChange,"change:showListDropdown":this.onActionsChange}),r.trigger("content.subscribe:resize",this.onResize)},serializeData:function(){this.shared=this.model.server.get("shared"),this.synced=!this.model.server.get("isFullServer"),this.multiuser=this.model.server.get("multiuser");var e=this.model.toJSON(),t="#!/server/"+encodeURIComponent(this.model.server.id);
if(e.isFolder)t+="/section/"+encodeURIComponent(this.model.section.id)+"/folder/"+encodeURIComponent(e.key);else if(e.isChannel){var i=this.model.channel,n=i.id?i.id:i.get("identifier");t+="/channel/"+encodeURIComponent(n),t+="clip"===e.type?"/details/"+encodeURIComponent(e.key):"/"+encodeURIComponent(e.key)}else"userPlaylistItem"===e.type?t="#!/playlist/"+e.playlist+"/details/"+e.id:t+="/details/"+encodeURIComponent(e.key);return{item:e,url:t,selected:this.model.selected,showActions:this.showActions(),
sort:this.sort}},render:function(){return this.model?this.skipFirstRender?(this.skipFirstRender=!1,this):(this.visible=!0,void s.Layout.prototype.render.apply(this,arguments)):this},show:function(){this.model&&!this.visible&&(this.image&&this.image.setModel(this.model),this.mediaActions&&this.mediaActions.setParent({item:this.model}),this.visible=!0,this.render())},hide:function(){this.model&&this.visible&&(this.image&&this.image.cancel(),this.visible=!1,this.stopListening(this.model),this.$el.empty());
},select:function(){this.ui.container.addClass("selected")},deselect:function(){this.ui.container.removeClass("selected")},getPosterUrl:function(e){return"show"===this.type?this.model.get("grandparentThumb")||this.model.get("parentThumb")||e:e||this.model.get("parentThumb")||this.model.get("grandparentThumb")},showActions:function(){return this.mediaActions&&(this.mediaActions.get("showPlay")||this.mediaActions.get("showEdit")||this.mediaActions.get("showListDropdown"))},canPlaySiblings:function(){
return this.model.get("isExtra")?!1:/^(track|photo|clip|userPlaylistItem)$/.test(this.type)},bindings:{".play-btn":{model:"mediaActions",modelAttribute:"showPlay",manual:!0,autohide:!0},".play-unwatched-btn":{model:"mediaActions",modelAttribute:"showPlayUnwatched",manual:!0,autohide:!0},".edit-btn":{model:"mediaActions",modelAttribute:"showEdit",manual:!0,autohide:!0},".more-btn":{model:"mediaActions",modelAttribute:"showListDropdown",manual:!0,autohide:!0},".unwatched-icon":{modelAttribute:"viewCount",
modelListeners:["viewCount","viewOffset"],manual:!0,autohide:function(){if(!this.bypassShowUnwatchedIconsSetting&&!d.get("showUnwatchedIcons"))return!1;if(!/^(movie|episode|userPlaylistItem)$/.test(this.model.get("type")))return!1;if(this.model.get("isFolder"))return!1;if(this.shared&&!this.multiuser)return!1;var e=this.model.get("viewCount"),t=this.model.get("viewOffset");return e?t:!0},formatter:function(e,t){var i=this.model.get("viewOffset");i&&t.toggleClass("unwatched-icon-partial",!0)}},".media-title":{
modelAttribute:"title",modelListeners:["title","parentTitle","grandparentTitle"],isHtml:!0,formatter:function(e){var t=this.model.get("grandparentTitle")||this.model.get("parentTitle")||e,n=this.model.get("type");return/^(season|episode|album|track)$/.test(n)&&!this.model.get("isChannel")?'<span class="btn-metadata-link media-title-link">'+i.escape(t)+"</span>":t}},".media-subtitle-1":{modelAttribute:"year",modelListeners:["title","parentTitle","grandparentTitle","year"],autohide:!0,formatter:function(e){
var t;if("userPlaylistItem"===this.model.get("type"))this.model.get("recommender")&&(t=a("from {1}",this.model.get("recommender")));else{var i=this.model.get("grandparentTitle")||this.model.get("parentTitle");t=i?this.model.get("title"):e}return this.$el.toggleClass("show-subtitle",!!t),t}},".media-subtitle-2":{modelAttribute:"index",modelListeners:["index","message"],autohide:!0,formatter:function(e){var t=this.model.get("type");return"userPlaylistItem"===t?this.model.get("message"):"episode"===t?o.getSeasonEpisodeIndex({
seasonIndex:this.model.get("parentIndex"),episodePrefix:" \xb7 E{1}",episodeIndex:e,date:this.model.get("originallyAvailableAt"),noLeadingZero:!0}):void 0}},".media-context":{modelAttribute:"sourceTitle",manual:!0,formatter:function(e,t){var i=!!this.model.get("librarySectionID"),n=i?this.model.server.get("friendlyName"):e;t.toggleClass("multiserver-only",i),t.text(n)}},".media-added-at":{modelAttribute:"addedAt",autohide:!0,formatter:function(e){var t=Math.min(e,n().unix());return n.unix(t).fromNow();
}},".media-available-at":{modelAttribute:"originallyAvailableAt",autohide:!0,formatter:function(e){return l(e)}},".media-resolution":{modelAttribute:"Media",autohide:!0,formatter:function(e){return e&&e.length?u(e[0].videoResolution):""}},".media-duration":{modelAttribute:"duration",autohide:!0,formatter:function(e){return c(e)}}},onRender:function(){this.image&&this.image.setElement(this.ui.poster),("rating"===this.sort||this.showRating)&&this.rating.show(new g({model:this.model,disabled:!0})),this.progress&&this.progress.show(new m({
model:this.model}))},onClose:function(){this.image&&this.image.close(),this.dropdown&&this.dropdown.close(),r.trigger("content.unsubscribe:resize",this.onResize)},onResize:function(e){this.containerSize=e,this.mediaActions&&this.mediaActions.stopListening()},onActionsChange:function(e){if(this.isRendered){var t=!this.showActions();this.ui.container.toggleClass("hide-actions",t),this.ui.actions.toggleClass("hidden",t)}},onClick:function(e){this.stopTrackingSelecting(e,function(){var t=this.model.get("type");
if(/^(track|photo)$/.test(t)){e.preventDefault();var i={item:this.model,siblings:this.canPlaySiblings()};"photo"===t&&(i.autoplay=!1),h.execute("playMedia",i)}})},onPlayClick:function(e){e.preventDefault(),e.stopImmediatePropagation(),h.execute("playMedia",{item:this.model,continuous:this.continuousPlay,siblings:this.canPlaySiblings()})},onPlayUnwatchedClick:function(e){e.preventDefault(),e.stopImmediatePropagation(),h.execute("playMedia",{item:this.model,unwatched:!0,siblings:this.canPlaySiblings()
})},onEditClick:function(e){e.preventDefault(),e.stopImmediatePropagation();var n=t(e.currentTarget),s=n.hasClass("btn-loading")?n:this.$el;if(!s.hasClass("active")){s.addClass("active");var a=this.model.fetch();a.done(i.bind(function(){r.trigger("show:modal",new y({mediaActions:this.mediaActions}))},this)),a.always(i.bind(function(){s.removeClass("active")},this))}},onMoreClick:function(e){e.preventDefault(),e.stopImmediatePropagation(),t(".media-actions-dropdown").trigger("hide.bs.dropdown"),this.dropdown=new v({
model:this.model,mediaActions:this.mediaActions}),this.ui.dropdown.append(this.dropdown.render().el),this.ui.dropdown.addClass("open"),this.$el.addClass("force-hover on-top");var i=t(e.currentTarget),n=this.ui.actions.position().top,s=this.dropdown.getPosition(i,this.containerSize,n);this.ui.dropdown.css(s)},onTitleClick:function(e){e.preventDefault(),e.stopImmediatePropagation(),r.trigger("navigate","details",{serverID:this.model.server.id,key:this.model.get("grandparentKey")||this.model.get("parentKey")
})},onDropdownHide:function(e){this.dropdown&&(this.dropdown.close(),this.dropdown=null,this.$el.removeClass("force-hover on-top"))}});return b}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(14),i(30)],s=function(e,t){"use strict";var i=t.extend({getUrl:function(t){return t?e.join(t,{size:this.width*this.pixelRatio}):t}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(7),i(77),i(25),i(56),i(24),i(9)],s=function(e,t,i,n,s,a,r){"use strict";
function o(e){return e.get("unviewedLeafCount")>0}function l(e){var t=e.get("viewCount"),i=e.get("viewOffset");return!(t&&!i)}function c(e){return!e||e.get("isFolder")?!1:!n.get(e.get("type")).child}function u(e){return!o(e)}function d(e){return!l(e)}var h={movie:{showAddToPlaylist:!0,showAnalyze:!0,showDelete:!0,showDeleteVersions:!0,showDownload:!0,showEdit:!0,showFixMatch:!0,showInfo:!0,showMarkUnwatched:!0,showMarkWatched:!0,showMatch:!0,showPlay:!0,showPlayVersion:!0,showPlayTrailer:!0,showQueue:!0,
showRefresh:!0,showSplitApart:!0,showSync:!0,showConvert:!0,showUnmatch:!0},show:{showAddToPlaylist:!0,showEdit:!0,showDelete:!0,showFixMatch:!0,showMarkUnwatched:!0,showMarkWatched:!0,showMatch:!0,showPlayAll:!0,showPlayUnwatched:!0,showQueue:!0,showRefresh:!0,showSelect:!0,showShuffle:!0,showSplitApart:!0,showSync:!0,showConvert:!0,showUnmatch:!0},season:{showAddToPlaylist:!0,showEdit:!0,showDelete:!0,showMarkUnwatched:!0,showMarkWatched:!0,showPlayAll:!0,showPlayUnwatched:!0,showQueue:!0,showSelect:!0,
showShuffle:!0,showSync:!0,showConvert:!0},episode:{showAddToPlaylist:!0,showAnalyze:!0,showDelete:!0,showDeleteVersions:!0,showDownload:!0,showEdit:!0,showInfo:!0,showMarkUnwatched:!0,showMarkWatched:!0,showPlay:!0,showPlayVersion:!0,showQueue:!0,showRefresh:!0,showSync:!0,showConvert:!0},artist:{showAddToPlaylist:!0,showEdit:!0,showDelete:!0,showFixMatch:!0,showMatch:!0,showPlay:!0,showPlayMixRadio:!0,showQueue:!0,showRefresh:!0,showSelect:!0,showShuffle:!0,showSplitApart:!0,showSync:!0,showUnmatch:!0
},album:{showAddToPlaylist:!0,showEdit:!0,showDelete:!0,showFixMatch:!0,showMatch:!0,showPlay:!0,showQueue:!0,showRefresh:!0,showSelect:!0,showShuffle:!0,showSplitApart:!0,showSync:!0,showUnmatch:!0},track:{showAddToPlaylist:!0,showAnalyze:!0,showDelete:!0,showDownload:!0,showEdit:!0,showInfo:!0,showPlayMix:!0,showPlayMusicVideo:!0,showQueue:!0,showSelect:!0,showSync:!0},photoAlbum:{showAddToPlaylist:!0,showEdit:!0,showPlay:!0,showShuffle:!0,showSync:!0},photo:{showAddToPlaylist:!0,showAnalyze:!0,
showDelete:!0,showDownload:!0,showEdit:!0,showInfo:!0,showSync:!0},clip:{showInfo:!0,showPlay:!0,showPlayVersion:!0,showShare:!0,showWatchLater:!0},userPlaylistItem:{showDeleteFromUserPlaylist:!0,showInfo:!0,showMarkUnwatched:!0,showMarkWatched:!0,showPlay:!0,showShare:!0,showSync:!0,showWatchLater:!0},playlist:{showDelete:!0,showEdit:!0,showPlay:!0,showQueue:!0,showShuffle:!0,showSync:!0},movieSection:{showAddToCollection:!0,showAddToPlaylist:!0,showAnalyze:!0,showEdit:!0,showMarkUnwatched:!0,showMarkWatched:!0,
showMerge:!0,showPlay:!0,showRefresh:!0,showSelect:!0,showShuffle:!0,showSync:!0,showConvert:!0,showDelete:!0},showSection:{showAddToCollection:!0,showAddToPlaylist:!0,showEdit:!0,showMarkUnwatched:!0,showMarkWatched:!0,showMerge:!0,showPlay:!0,showRefresh:!0,showSelect:!0,showShuffle:!0,showSync:!0,showConvert:!0,showDelete:!0},seasonSection:{showAddToPlaylist:!0,showEdit:!0,showMarkUnwatched:!0,showMarkWatched:!0,showMerge:!0,showPlay:!0,showRefresh:!0,showSelect:!0,showShuffle:!0,showSync:!0,showConvert:!0,
showDelete:!0},episodeSection:{showAddToPlaylist:!0,showAnalyze:!0,showMarkUnwatched:!0,showMarkWatched:!0,showPlay:!0,showRefresh:!0,showSelect:!0,showShuffle:!0,showSync:!0,showConvert:!0,showDelete:!0},artistSection:{showAddToCollection:!0,showAddToPlaylist:!0,showEdit:!0,showMerge:!0,showPlay:!0,showQueue:!0,showRefresh:!0,showSelect:!0,showShuffle:!0,showSync:!0,showDelete:!0},albumSection:{showAddToPlaylist:!0,showEdit:!0,showMerge:!0,showPlay:!0,showQueue:!0,showRefresh:!0,showSelect:!0,showShuffle:!0,
showSync:!0,showDelete:!0},trackSection:{showAddToPlaylist:!0,showEdit:!0,showPlay:!0,showQueue:!0,showRefresh:!0,showSelect:!0,showShuffle:!0,showSync:!0,showDelete:!0},photoSection:{showAddToPlaylist:!0,showAnalyze:!0,showPlay:!0,showSelect:!0,showShuffle:!0,showSync:!0,showDelete:!0}},p={showListDropdown:["showShuffle","showQueue","showRefresh","showSync","showDownload","showWatchLater","showShare","showInfo"]},f=a.extend({initialize:function(e,t){t||(t={}),this.item=t.item,this.playQueue=t.playQueue,
this.parent=this.item||this.section,this.showAdvanced=t.showAdvanced,this.user=r.get("user"),this.signedIn=this.user.get("signedIn"),this.devices=this.user.get("devices"),this.setDefaults(t.type),this.listenToParent(),this.listenTo(r,"change:primaryPlayer",this.onPrimaryPlayerChange),this.listenTo(this.user,{"change:signedIn":this.onSignedInChange,"change:providers.change":this.onUserProvidersChange}),this.listenTo(this.devices,"reset",this.onDevicesChange),this.listenTo(this,{"change:selecting":this.onSelectingChange,
"change:selectedItems":this.onSelectedItemsChange})},setDefaults:function(t){t&&t!==this.type&&(this.type=t,this.section&&(t+="Section"),this.defaults=e.clone(h[t]||{}),this.defaults.selecting=!1,this.defaults.selectedItems=[],this.clear().set(this.defaults))},setParent:function(e){this.parent&&this.stopListening(this.parent),this.server&&this.stopListening(this.server),this.playQueues&&this.stopListening(this.playQueues),this.item=e.item,this.section=e.section,this.parent=this.item||this.section,
this.listenToParent()},listenToParent:function(){if(this.section){var e=this.parent.get("currentType");e&&this.setDefaults(e.get("typeString")),this.listenTo(this.parent,{"change:currentType":this.onCurrentTypeChange,"change:allowSync":this.onAllowSyncChange})}else this.item&&(this.setDefaults(this.item.get("type")),this.listenTo(this.parent,{"change:primaryExtraKey":this.onPrimaryExtraChange,"change:unviewedLeafCount":this.onViewStateChange,"change:viewOffset":this.onViewStateChange,"change:viewCount":this.onViewStateChange
}),this.showAdvanced&&this.listenTo(this.parent,{"change:guid":this.onGuidChange,"change:Media":this.onMediaChange}));this.parent&&(this.server=this.parent.server,this.shared=this.server.get("shared"),this.synced=!this.server.get("isFullServer"),this.multiuser=this.server.get("multiuser"),this.playQueues=this.server.get("playQueueManager"),this.listenTo(this.server,"change:shared",this.onServerSharedChange),this.listenTo(this.playQueues,"change",this.onPlayQueuesChange)),this.updateAll()},updateAll:function(){
this.updateAction("showPlay",this.canPlay),this.updateAction("showPlayAll",this.canPlay),this.updateAction("showPlayUnwatched",this.canPlay),this.updateAction("showPlayVersion",this.canPlayVersion),this.updateAction("showPlayMix",this.canPlayMix),this.updateAction("showPlayMixRadio",this.canPlayMixRadio),this.updateAction("showPlayTrailer",this.canPlayPrimaryExtra),this.updateAction("showPlayMusicVideo",this.canPlayPrimaryExtra),this.updateAction("showShuffle",this.canPlay,{shuffle:!0}),this.updateAction("showQueue",this.isMedia),
this.updateAction("showEdit",this.canEdit),this.updateAction("showRefresh",this.canRefresh),this.updateAction("showSync",this.canSync),this.updateAction("showConvert",this.canConvert),this.updateAction("showDownload",this.canDownload),this.updateAction("showAddToPlaylist",this.canAddToPlaylist),this.updateAction("showWatchLater",this.canWatchLater),this.updateAction("showShare",this.canShare),this.updateAction("showDelete",this.canDelete),this.updateAction("showDeleteVersions",this.canDeleteVersions),
this.updateAction("showInfo",this.isMedia),this.updateAction("showMarkWatched",this.canMarkWatched),this.updateAction("showMarkUnwatched",this.canMarkUnwatched),this.showAdvanced&&(this.updateAction("showSelect",this.canMultiSelect),this.updateAction("showAnalyze",this.canMultiAction),this.updateAction("showMerge",this.canMultiAction),this.updateAction("showAddToCollection",this.canMultiAction),this.updateAction("showMatch",this.canMatch),this.updateAction("showFixMatch",this.canFixMatch),this.updateAction("showUnmatch",this.canUnmatch),
this.updateAction("showSplitApart",this.canSplitApart)),this.updateCanQueue(),this.updateDropdown("showListDropdown")},updateAction:function(e,t,i){var n=this.defaults?this.defaults[e]:!1;this.set(e,t.call(this,n,i))},updateCanQueue:function(){var t=this.parent&&this.playQueues.getFor(this.parent),i=t&&t.get("shuffled"),n=!0,s=r.get("primaryPlayer");if(s){var a=s.get("protocolCapabilities");n=e(a).contains("playqueues")}this.set("canQueue",!(!t||!n||i))},updateDropdown:function(t){var i=p[t],n=e.map(i,function(e){
return this.get(e)},this);this.set(t,e.some(n))},canPlay:function(e,t){return e?this.parent&&!this.playQueues.canCreateFor(this.parent,t)?!1:!this.item||!this.item.get("isFolder")&&!this.item.get("hasInvalidKey"):!1},canPlayVersion:function(e,t){return e&&this.item?this.item.get("Media").length>1:!1},canPlayMix:function(e){if(!e||!this.item)return!1;var t=this.item.get("related");return!(!t||!t.findWhere({browse:!1}))},canPlayMixRadio:function(t){if(!t||!this.item)return!1;var i=this.item.server.get("radioProviders");
if(!i||!e.contains(i,"mixradio"))return!1;var n=this.user.get("providers");if(!n||!n.get("mixradio"))return!1;var s=this.item.get("related");return s&&s.findWhere({browse:!1})?!0:!1},canPlayPrimaryExtra:function(e){return e&&this.item?!!this.item.get("primaryExtraKey"):!1},canAddToPlaylist:function(t){if(!t||!this.server)return!1;if(this.playQueue&&this.playQueue.get("isRadio"))return!1;var i,n=this.server.supports("playlists"),s=this.parent&&this.parent.get("currentSubset");if(s){var a=this.get("selectedItems"),r=e.some(a,function(e){
return e.get("isFolder")});i=("all"===s.id||a&&a.length>0)&&!r}else i=this.item&&this.item.isLibraryItem();return n&&i},canRefresh:function(t){if(!t||this.synced)return!1;var i=this.getActionTargets(),n=e.every(i,function(e){var t=this.shared&&e.get("isPlaylist"),i=e.get("isSection"),n=!this.shared&&(i||e.isLibraryItem()&&!e.get("isFolder"));return t||n},this);return n},canDownload:function(e){return this.playQueue&&this.playQueue.get("isRadio")?!1:this.canRefresh(e)},canEdit:function(e){if(!e||!this.canRefresh(e))return!1;
var t=this.getActionTargets();return t&&t.length>1&&!t[0].server.supports("batchEdit")?!1:!0},canMultiSelect:function(e){return e?!this.shared||this.multiuser:!1},canMultiAction:function(e){return e?this.item?this.canEdit(e):!this.shared&&!this.synced&&this.section:!1},canMarkWatched:function(e){if(!e)return!1;if(!this.item&&!this.section)return!1;if(!this.canMultiSelect(e)&&!c(this.item))return!1;var t=this.getActionTargets();if(!t)return!1;var i=t[0];return i.get("isSection")||i.get("isFolder")?!1:this.hasUnwatched();
},canMarkUnwatched:function(e){if(!e)return!1;if(!this.canMultiSelect(e)&&!c(this.item))return!1;var t=this.getActionTargets();if(!t)return!1;var i=t[0];return i.get("isSection")||i.get("isFolder")?!1:this.hasWatched()},canMatch:function(e){return this.canEdit(e)&&!this.canUnmatch(e)},canFixMatch:function(e){return this.canEdit(e)&&this.canUnmatch(e)},canUnmatch:function(e){if(!e||!this.item||this.shared||this.synced)return!1;var t=this.item.get("guid");return!(!t||/(local|none)\:\/\//.test(t))},
canSplitApart:function(t){if(!t||!this.item||this.shared||this.synced)return!1;var i;if("movie"===this.type){var n=this.item.get("Media");i=e.filter(n,function(e){return!e.proxyType})}else i=this.item.get("Location");return i.length>1&&this.server.supports("splitApart")},canSync:function(e){if(!e||!this.parent||this.synced)return!1;var t=this.devices.filterSyncDevices(this.item);if(!t.length)return!1;var i=this.shared?"sharedSync":"sync",n=this.server.supports(i);if(!n||this.parent.get("isFolder"))return!1;
var s;if(this.shared){var a=this.section||this.item.section;s=a&&a.get("allowSync")}else s=this.parent.get("allowSync")||this.parent.collection&&this.parent.collection.allowSync;return!!s},canConvert:function(e){if(!e||!this.parent||this.shared||this.synced)return!1;var t=this.server.supports("streamReady"),i=this.server.get("transcoderVideo");return!(!t||!i||this.parent.get("isFolder"))},canWatchLater:function(e){if(!e||!this.item)return!1;var t="video"===n.getChildMediaType(this.type).element,i=!!this.item.get("url"),s=!this.item.get("playlist")||"queue"!==this.item.get("playlist");
return this.signedIn&&this.user.get("queueUid")&&t&&i&&s},canShare:function(e){return e&&this.signedIn&&!this.user.get("restricted")},canDelete:function(t){if(!t)return!1;if(this.item&&!this.item.get("isSection"))return this.canDeleteSingleItem(this.item);if(!this.canMultiSelect(t))return!1;var i=this.getActionTargets();return i?e.every(i,this.canDeleteSingleItem,this):!1},canDeleteSingleItem:function(e){if(!e||this.synced||e.get("isSection"))return!1;if(!c(e)&&!e.server.supports("compositeDelete"))return!1;
var t=!(!e.isLibraryItem()||!this.server.get("allowMediaDeletion")||this.shared),i=e.get("playlistType");return t||i},canDeleteVersions:function(t){if(!t||!this.item||this.shared||this.synced)return!1;if(!this.server.get("allowMediaDeletion"))return!1;var i=this.item.get("Media"),n=e.filter(i,function(e){return!!e.proxyType});return!!n.length},isMedia:function(e){if(!e)return!1;if(this.playQueue&&this.playQueue.get("isRadio"))return!1;if(!this.item)return!0;var t="photo"===this.type&&!this.item.isLibraryItem();
return!t&&!this.item.get("isFolder")},shouldStartTrackingSelecting:function(e){var t=this.canMultiSelect(this.get("showSelect")),i=e.metaKey||e.ctrlKey||e.shiftKey;return t&&(i||this.get("selecting"))},selectItems:function(t,i){if(0!==t.length){var n=this.get("selectedItems"),s=e.bind(this.updateAll,this),a=e.filter(t,function(t){return!e.contains(n,t)});e.each(a,function(e){e.selected=!0,n.push(e),this.listenTo(e,{"change:viewCount":s,"change:viewOffset":s,"change:unviewedLeafCount":s,"change:viewedLeafCount":s
})},this);var r=this.sortSelectedItems(n,i);this.set("selectedItems",r),this.trigger("change:selectedItems",this,r)}},sortSelectedItems:function(t,i){var n=i&&i.superset;return n?e.sortBy(t,function(e){return n.indexOf(e)}):e.clone(t)},deselectItems:function(t,i){if(0!==t.length){var n=this.get("selectedItems");e.each(t,function(t){var i=e.indexOf(n,t);-1!==i&&(t.selected=!1,n.splice(i,1),this.stopListening(t))},this),n.length||this.set("selecting",!1),this.trigger("change:selectedItems",this,n)}
},selectItem:function(e,t){this.selectItems([e],t)},deselectItem:function(e,t){this.deselectItems([e],t)},deselectAll:function(){var t=this.get("selectedItems");t&&0!==t.length&&(e.each(t,function(e){e.selected=!1}),t.length=0,this.trigger("change:selectedItems",this,t))},getActionTargets:function(){var e=this.get("selectedItems");return e&&e.length>0?e:this.parent?[this.parent]:void 0},getActionTargetsTitle:function(){var e=this.getActionTargets();if(1===e.length){var i=e[0];return i.get("isSection")?i.getSyncTitle():i.get("title");
}return 2===e.length?t("{1} and {2}",e[0].get("title"),e[1].get("title")):3===e.length?t("{1}, {2}, and {3}",e[0].get("title"),e[1].get("title"),e[2].get("title")):t("{1}, {2}, and {3} others",e[0].get("title"),e[1].get("title"),e.length-2)},hasWatched:function(){var t=this.getActionTargets(),i=t[0].get("type"),n="show"===i||"season"===i;return e.some(t,n?u:d)},hasUnwatched:function(){var t=this.getActionTargets(),i=t[0].get("type"),n="show"===i||"season"===i;return e.some(t,n?o:l)},hasSelectedItems:function(){
var e=this.get("selectedItems");return e&&e.length},onPrimaryPlayerChange:function(){this.updateCanQueue()},onSignedInChange:function(e,t){this.signedIn=t,this.updateAction("showWatchLater",this.canWatchLater),this.updateAction("showShare",this.canShare),this.updateDropdown("showListDropdown")},onUserProvidersChange:function(e,t){this.updateAction("showPlayMixRadio",this.canPlayMixRadio)},onCurrentTypeChange:function(e,t){this.deselectAll(),this.setDefaults(t.get("typeString")),this.updateAll()},
onAllowSyncChange:function(){this.updateAction("showSync",this.canSync)},onPrimaryExtraChange:function(){this.updateAction("showPlayTrailer",this.canPlayPrimaryExtra),this.updateAction("showPlayMusicVideo",this.canPlayPrimaryExtra)},onViewStateChange:function(){this.updateAction("showMarkWatched",this.canMarkWatched),this.updateAction("showMarkUnwatched",this.canMarkUnwatched)},onGuidChange:function(){this.updateAction("showUnmatch",this.canUnmatch),this.updateAction("showMatch",this.canMatch),this.updateAction("showFixMatch",this.canFixMatch);
},onMediaChange:function(){this.updateAction("showDeleteVersions",this.canDeleteVersions)},onServerSharedChange:function(e,t){this.shared=t,this.updateAll()},onPlayQueuesChange:function(){var e=this.parent&&this.playQueues.getFor(this.parent);this.playQueue&&this.playQueue.off("change:hasUpNext"),e&&e.on("change:hasUpNext",this.updateCanQueue,this),this.playQueue=e,this.updateCanQueue()},onDevicesChange:function(){this.updateAction("showSync",this.canSync)},onSelectingChange:function(e,t){t||this.deselectAll();
},onSelectedItemsChange:function(e,t){this.set("selecting",!(!t||!t.length)),this.updateAll()}});return f}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(19),i(6),i(7),i(5),i(28),i(25),i(113),i(52),i(11),i(9),i(130)],s=function(e,t,i,n,s,a,r,o,l,c,u,d){"use strict";var h=i.Layout.extend({mixins:l,posterWidth:250,ui:{poster:".item-poster"},regions:{rating:".rating-container",summary:".summary-container",audio:".item-audio",subtitles:".item-subtitles",studio:".studio-flag-container",
contentRating:".content-rating-flag-container",videoResolution:".video-audio-flags-container",audioCodec:".video-audio-flags-container",audioChannels:".video-audio-flags-container",poster:".details-poster-container",list:".details-list-region"},events:{"click .details-poster-container > .play-btn":"onPlayClick","click .item-unavailable-btn":"onUnavailableClick"},initialize:function(i){e.bindAll(this,"onResize","onScroll"),this.mediaActions=i.mediaActions,this.collection=this.model.get("children"),
this.shared=this.model.server.get("shared"),this.synced=!this.model.server.get("isFullServer"),this.multiuser=this.model.server.get("multiuser"),this.progress=new t.Model({loading:!1,failed:!1}),this.listenTo(u,"change:primaryPlayer",this.onPrimaryPlayerChange),this.pageSize&&(s.trigger("content.subscribe:resize",this.onResize),s.trigger("content.subscribe:scroll",this.onScroll)),this.mirror()},serializeData:function(){var e=this.model.server.get("playQueueManager"),t=this.model.get("grandparentKey"),i=this.model.get("parentKey");
return{serverID:this.model.server.id,grandparentKey:i?encodeURIComponent(t):null,parentKey:i?encodeURIComponent(i):null,canPlay:e.canCreateFor(this.model),limited:this.shared||this.synced}},mirror:function(){if(this.allowMirror){var e;e=this.model.get("isPlaylist")?this.model.get("playlistType"):r.getChildMediaType(this.model.get("type")).element;var t=a.getTypeByElement(e),i=o.getInstance(t,{isPassive:!0});i&&i.mirror({item:this.model})}},populatePage:function(){this.progress.set("loading",!0);var t=this.collection.populateRange({
start:0,end:this.collection.length+this.pageSize,scope:"page"});return t.always(e.bind(function(){this.progress.set("loading",!1)},this)),t},onRender:function(){if(this.collection&&this.ListConstructor){var t;t=this.pageSize?this.populatePage():this.collection.fetch({scope:"page"}),t.fail(e.bind(function(){s.trigger("show:alert",{type:"error",message:n("There was a problem loading these items.")}),this.progress.set("failed",!0)},this)),this.list.append(new this.ListConstructor({model:this.model,mediaActions:this.mediaActions,
collection:this.collection,itemViewOptions:this.listItemViewOptions}))}this.starRatingView&&this.rating.show(this.starRatingView),this.audioDropdown&&this.audio.append(this.audioDropdown),this.subtitlesDropdown&&this.subtitles.append(this.subtitlesDropdown),this.posterImage&&this.posterImage.setElement(this.ui.poster),this.studioFlag&&this.studio.show(this.studioFlag),this.contentRatingFlag&&this.contentRating.show(this.contentRatingFlag),this.videoResolutionFlag&&this.videoResolution.append(this.videoResolutionFlag),
this.audioCodecFlag&&this.audioCodec.append(this.audioCodecFlag),this.audioChannelsFlag&&this.audioChannels.append(this.audioChannelsFlag),this.summaryView&&this.summary.append(this.summaryView)},onClose:function(){this.posterImage&&this.posterImage.close(),this.pageSize&&(s.trigger("content.unsubscribe:resize",this.onResize),s.trigger("content.unsubscribe:scroll",this.onScroll))},onPrimaryPlayerChange:function(e,t){t&&this.mirror()},onPlayClick:function(e){e.preventDefault(),c.execute("playMedia",{
item:this.model})},onUnavailableClick:function(e){e.preventDefault(),s.trigger("show:modal",new d({model:this.model}))},onResize:function(e){this.containerSize=e},onScroll:function(e){if(!this.progress.get("loading")){var t=this.model.get("children"),i=e.scrollHeight-this.containerSize.innerHeight,n=i-e.scrollTop<10,s=t.length<t.totalSize;n&&s&&this.populatePage()}}});return h}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(26),i(94),i(78),i(544)],s=function(e,t,i,n,s){
"use strict";var a={tagsRenderer:s,tagsRendererOptions:{},defaultBindings:{".item-title":{modelAttribute:"title"},".item-year":{modelAttribute:"year"},".item-progress":{modelAttribute:"viewOffset",manual:!0,formatter:function(e,i){var n=this.model.get("duration"),s=t.getPercentWatched(e,n);s&&i.css("width",s+"%"),i.parent().toggleClass("hidden",!s)}},".item-duration":{modelAttribute:"duration",autohide:!0,formatter:function(e){return e?n(e):0}},".item-unwatched-label":{modelAttribute:"viewCount",
modelListeners:["viewCount","viewOffset"],manual:!0,autohide:function(e){if(this.shared&&!this.multiuser)return!1;var t=this.model.get("viewOffset");return!e&&!t}},".item-unavailable-btn":{modelAttribute:"Media",manual:!0,autohide:function(e){var i=t.getMissingParts(e);return!!i.length}},".item-available-at":{modelAttribute:"originallyAvailableAt",autohide:!0,formatter:function(e){return i(e)}},".item-tagline":{modelAttribute:"tagline",autohide:!0},".item-genre":{modelAttribute:"Genre",autohide:!0,
isHtml:!0,formatter:function(t){if(!t||!t.length)return"";var i=this.tagsRenderer(e.extend({},this.tagsRendererOptions,{model:this.model,key:"genre",tags:t,maxLen:50,maxTags:2}));return i}},".item-director":{modelAttribute:"Director",manual:!0,autohide:!0,formatter:function(t,i){if(!t||!t.length)return"";var n=this.tagsRenderer(e.extend({},this.tagsRendererOptions,{model:this.model,key:"director",tags:t,maxLen:50,maxTags:3}));return i.find(".metadata-tag-list").html(n),n}},".item-writer":{modelAttribute:"Writer",
manual:!0,autohide:!0,formatter:function(t,i){if(!t||!t.length)return"";var n=this.tagsRenderer(e.extend({},this.tagsRendererOptions,{model:this.model,key:"writer",tags:t,maxLen:50,maxTags:3}));return i.find(".metadata-tag-list").html(n),n}},".item-cast":{modelAttribute:"Role",manual:!0,autohide:!0,formatter:function(t,i){if(!t||!t.length)return"";var n=this.tagsRenderer(e.extend({},this.tagsRendererOptions,{model:this.model,key:"actor",tags:t,maxLen:50,maxTags:5}));return i.find(".metadata-tag-list").html(n),
n}},".item-summary":{modelAttribute:"summary",autohide:!0},".item-content-rating":{modelAttribute:"contentRating",autohide:!0},".media-count-badge":{modelAttribute:"Media",formatter:function(e){return e.length},autohide:function(e){return e>1}},".details-unwatched-count-badge":{modelAttribute:"unviewedLeafCount",autohide:function(e){return this.shared&&!this.multiuser?!1:!!e}},".content-rating-flag-container":{modelAttribute:"contentRating",manual:!0,autohide:!0},".studio-flag-container":{modelAttribute:"studio",
manual:!0,autohide:!0}}};return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(2),a=n(s),r=i(19),o=n(r),l=i(38),c=n(l),u=i(14),d=n(u),h=i(34),p=n(h),f=i(149),m=n(f),g=i(91),v=n(g),y=i(17),b=n(y),w=i(112),x=n(w),S=i(16),C=n(S),k=i(11),P=n(k),A=i(39),I=n(A),_=i(21),T=n(_),D=i(143),E=n(D),M=i(23),R=n(M),O=i(197),L=n(O),N=i(462),F=n(N),U=i(74),z=n(U),B=i(449),j=n(B),V=i(145),H=n(V),W=i(75),$=n(W),Q=i(66),q=n(Q),K=i(478),Y=n(K),G=i(480),X=n(G),J=i(65),Z=n(J),ee=i(476),te=n(ee),ie=i(482),ne=n(ie),se=i(481),ae=n(se),re={
PENDING:"pending",CONNECTED:"connected",UNAVAILABLE:"unavailable",UNAUTHORIZED:"unauthorized"},oe={PENDING:"pending",RESOLVED:"resolved",REJECTED:"rejected"},le={SECONDARY:"secondary"},ce=T.default.boolean.required(),ue=R.default.extend({mixins:[E.default],name:"ServerModel",idAttribute:"machineIdentifier",connectionTestTimeout:1e4,cache:new m.default,persistInCache:!0,sessionAttrs:{connectionTestResult:T.default.oneOf(re.PENDING,re.CONNECTED,re.UNAVAILABLE,re.UNAUTHORIZED).required(),promiseState:T.default.oneOf(oe.PENDING,oe.RESOLVED,oe.REJECTED).required(),
sections:T.default.instanceOf(F.default).required(),playlists:T.default.instanceOf(j.default).required(),playQueueManager:T.default.instanceOf(L.default).required(),isShared:ce,isBundled:ce,isCloud:ce,isMerged:ce,cloudAccount:T.default.instanceOf(Y.default).required(),update:T.default.instanceOf(X.default),settings:T.default.instanceOf(Z.default).required(),alerts:T.default.instanceOf(te.default).required(),transcodeJobs:T.default.instanceOf(ne.default).required(),sessions:T.default.instanceOf(ae.default).required(),
superToken:T.default.string,accessToken:T.default.string,sourceTitle:T.default.string,publicAddressMatches:T.default.boolean,httpsRequired:T.default.boolean,presence:T.default.boolean,home:T.default.boolean,synced:T.default.boolean,createdAt:T.default.integer,lastSeenAt:T.default.integer},sessionRelations:{activeConnection:{relationClass:$.default,deferred:!0},connections:{relationClass:H.default,options:function(){return{server:this}}}},syncedAttrs:{machineIdentifier:T.default.string,friendlyName:T.default.string,
startState:T.default.string,version:T.default.string,platform:T.default.string,platformVersion:T.default.string,serverClass:T.default.oneOf(le.SECONDARY),sync:T.default.boolean,multiuser:T.default.boolean,myPlex:T.default.boolean,myPlexMappingState:T.default.string,myPlexSigninState:T.default.string,myPlexSubscription:T.default.boolean,myPlexUsername:T.default.string,transcoderPhoto:T.default.boolean,transcoderAudio:T.default.boolean,transcoderVideo:T.default.boolean,transcoderVideoRemuxOnly:T.default.boolean,
transcoderSubtitles:T.default.boolean,transcoderActiveVideoSessions:T.default.integer,allowMediaDeletion:T.default.boolean,allowCameraUpload:T.default.boolean,allowChannelAccess:T.default.boolean,allowSync:T.default.boolean,updatedAt:T.default.integer,radioProviders:T.default.list},derivedAttrs:{debugName:function(){var e=this.get("machineIdentifier"),t=this.get("friendlyName");return t||(e?"["+e+"]":"[Anonymous]")},shortVersion:function(){var e=this.get("version"),t=/(\d+\.){2,3}\d+/.exec(e);return a.default.first(t)||e;
},isConnected:function(){return this.get("connectionTestResult")===re.CONNECTED},isUnavailable:function(){return this.get("connectionTestResult")===re.UNAVAILABLE},isUnauthorized:function(){return this.get("connectionTestResult")===re.UNAUTHORIZED},isResolved:function(){return this.get("promiseState")===oe.RESOLVED},isRejected:function(){return this.get("promiseState")===oe.REJECTED},isRelayed:function(){var e=this.get("activeConnection");return!(!e||!e.get("isRelayed"))},isSecure:function(){var e=this.get("activeConnection");
return!(!e||!e.get("isSecure"))},isFullServer:function(){return!this.get("isCloud")&&!this.get("synced")&&this.get("serverClass")!==le.SECONDARY},isFullOwnedServer:function(){return this.get("isFullServer")&&!this.get("isShared")},isCloudSync:function(){return"cloudsync"===this.get("platform")},shared:function(){return this.get("isShared")},bundled:function(){return this.get("isBundled")},cloud:function(){return this.get("isCloud")},merged:function(){return this.get("isMerged")},connected:function(){
var e=this.get("connectionTestResult")===re.PENDING;return e?null:this.get("isConnected")},available:function(){var e=this.get("connectionTestResult")===re.PENDING;return e?null:!this.get("isUnavailable")},authorized:function(){var e=this.get("connectionTestResult")===re.PENDING;return e?null:this.get("isResolved")},relayed:function(){return this.get("isRelayed")}},defaults:function(){return{connectionTestResult:re.PENDING,promiseState:oe.PENDING,sections:new F.default([],{server:this}),playlists:new j.default({},{
server:this}),playQueueManager:new L.default({server:this}),cloudAccount:new Y.default({},{server:this}),update:I.default.get("allowServerUpdates")?new X.default({},{server:this}):null,settings:new Z.default([],{server:this}),alerts:new te.default([],{server:this}),transcodeJobs:new ne.default([],{server:this}),sessions:new ae.default([],{server:this}),isShared:!1,isBundled:!1,isCloud:!1,isMerged:!1}},url:function de(){var e=arguments.length<=0||void 0===arguments[0]?this.get("activeConnection"):arguments[0];
(0,c.default)(e,"An active or manual connection is required for a server url");var de=a.default.result(e,"url");return/\/$/.test(de)||(de+="/"),de},initialize:function(){this._reset(),this.listenTo(this,"change:machineIdentifier",this.onMachineIdentifierChange),this.listenTo(this.get("connections"),{remove:this.onConnectionRemove,reset:this.onConnectionsReset})},fetch:function(){return o.default.Model.prototype.fetch.apply(this,arguments)},resolveUrl:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];
if(/^\w+:\/\//.test(e))return e;var i=t.useLoopback?"http://127.0.0.1:32400/":this.url(t.connection),n=this.get("accessToken"),s={};return t.appendToken&&n&&(s["X-Plex-Token"]=n),d.default.join([i,e],s)},swizzleUrl:function(e,t){var i=e.match(/^\w+:\/\/.+?(\/.+)$/),n=i?i[1]:e;return this.resolveUrl(n,t)},getXHROptions:function(e){return{url:this.resolveUrl(e),dataType:"text",headers:this.getHeaders()}},getHeaders:function(){var e=x.default.getInstance(),t=a.default.clone(e),i=this.get("accessToken");
i&&(t["X-Plex-Token"]=i);var n=b.default.get("language");return n&&(t["Accept-Language"]=n),t},addConnection:function(e){e.sources||(e.sources=[{id:"internal"}]);var t=this.get("connections"),i=new $.default(e),n=t.get(i.id);if(n){var s=n.get("sources");return s.set(e.sources,{remove:!1}),n}return t.add(e)},removeSource:function(e){for(var t=this.get("connections"),i=t.length-1;i>=0;){var n=t.at(i),s=n.get("sources");s.remove(e),i--}},testAllConnections:function(){var e=this,t=this.get("connections");
return(0,C.default)("[Connections] Testing all %s connection(s) for %s",t.length,this.get("debugName")),this._reset(),t.each(function(t){e.testConnection(t)}),this.populatePromise},testOnlyUntestedConnections:function(){var e=this,t=this.get("connections");return t.each(function(t){t.get("isUntested")&&e.testConnection(t)}),this.populatePromise},testConnection:function(e){var t={server:this,connection:e};this.get("promiseState")===oe.REJECTED&&this._reset();var i=P.default.execute("testServerConnection",t).done(this.onConnectionTestSuccess.bind(this)).fail(this.onConnectionTestError.bind(this));
return i},abortAllConnectionTests:function(){var e=this,t=this.get("connections");(0,C.default)("[Connections] Aborting all pending connection tests for",this.get("debugName")),t.each(function(t){e.abortConnectionTest(t)})},abortConnectionTest:function(e){var t=e.get("currentTest");t&&"pending"===t.state()&&((0,C.default)("[Connections] Aborting pending connection test for %s at %s",this.get("debugName"),e.id),e.set("testState",$.default.testStates.ABORTED),t.abort())},populateIdentity:function(e){
var t=this;if(this._identityPromise)return this._identityPromise;var i=P.default.execute("populateServerIdentity",{server:this,connection:e});return i.done(function(e){t.set("machineIdentifier",e)}),this._identityPromise=i,i},updateCacheKey:function(){var e=this.get("debugName"),t=this.cacheKey(this.attributes),i=this.cache.get(t);if(i){var n=i.get("debugName");C.default.warn("[Identity] %s and %s (cached) collide %s",e,n),i.get("isConnected")||!this.get("isConnected")?((0,C.default)("[Identity] Merging %s into %s (cached) %s",e,n),
i.merge(this)):((0,C.default)("[Identity] Merging %s (cached) into %s",n,e),this.merge(i),this.cache.store(this,t))}else this.cache.store(this,t)},merge:function(e){var t=this;e.set("isMerged",!0),e.get("isBundled")&&this.set("isBundled",!0),e.get("connections").each(function(e){t.addConnection(e.toJSON())}),this.collection&&(this.collection.remove(e.cid,{silent:!0}),this.collection._byId[this.id]=this,this.collection.trigger("remove",e,this)),this.cache.remove(e)},supports:function(e){var t=q.default[e];
return null!=t?this.isVersionOrNewer(t):!1},isVersionOrNewer:function(e){var t=this.get("shortVersion");if(!e||!t)return!0;for(var i=e.split("."),n=t.split("."),s=0,a=i.length;a>s;s++)if(s<n.length){var r=parseInt(i[s],10),o=parseInt(n[s],10);if(o>r)return!0;if(r>o)return!1}return!0},getSectionForItem:function(e){if(e.section)return e.section;if(e.get("isSection"))return e;var t=e.get("librarySectionID");if(t){var i=new z.default({key:e.get("librarySectionID")},{server:e.server,onlyIfCached:!0});return i;
}return e.parent?this.getSectionForItem(e.parent):void 0},canAllowHttpFallback:function(){if(!this.get("isFullServer"))return!1;if(p.default.isHostedHttps&&!I.default.get("allowMixedContent"))return!1;var e=b.default.get("allowHttpFallback"),t=e===v.default.ALWAYS,i=e===v.default.SAME_NETWORK,n=t||i&&this.get("publicAddressMatches");return!!n},canBePrimary:function(e){return this.get("isFullServer")&&this.isVersionOrNewer(e)},hasOtherLoopbackServer:function(){return!!this.collection&&this.collection.hasLoopbackServer();
},hasLocalConnection:function(){var e=this.get("activeConnection");return e&&e.get("isPrivate")},hasLoopbackConnection:function(){var e=this.get("activeConnection");return e&&e.get("isLoopback")},hasSecureConnection:function(){return this.get("isSecure")},authenticate:function(e){this._resolve({accessToken:e})},deauthenticate:function(){this._reject({accessToken:null})},_reset:function(){this.startCapturingChangeEvents(),this.set("promiseState",oe.PENDING),this._resetPopulate(),this.releaseCapturedChangeEvents();
},_resolve:function(e){var t=this.get("connections").getBestConnection();t!==this.get("activeConnection")&&C.default.info("[Connections] Active connection to %s is %s",this.get("debugName"),t.id);var i=a.default.extend({connectionTestResult:re.CONNECTED,promiseState:oe.RESOLVED,activeConnection:t},e);this.startCapturingChangeEvents(),this.set(i),this._resolvePopulate(),this.releaseCapturedChangeEvents()},_reject:function(e){var t=this.get("connections");t.hasOnlyFailedConnections()&&C.default.warn("[Connections] All connections to %s failed",this.get("debugName"));
var i=t.findWhere({isUnauthorized:!0})?re.UNAUTHORIZED:re.UNAVAILABLE,n=a.default.extend({connectionTestResult:i,promiseState:oe.REJECTED},e);this.startCapturingChangeEvents(),this.set(n),this._rejectPopulate(),this.releaseCapturedChangeEvents()},_checkActiveConnection:function(){var e=this.get("activeConnection"),t=this.get("connections");if(e&&!t.contains(e)){var i=t.getBestConnection();i?this.set("activeConnection",i):this.testAllConnections()}},onMachineIdentifierChange:function(e,t){this.collection?this.listenToOnce(this.collection,"change:machineIdentifier",function(){
this.updateCacheKey()}):this.updateCacheKey()},onConnectionRemove:function(e,t){t.length?this._checkActiveConnection():(this.trigger("change:connections.remove",e,t),this.trigger("change:connections.change",this,t),this.trigger("destroy",this,this.collection))},onConnectionsReset:function(e,t){e.length?this._checkActiveConnection():(this.trigger("change:connections.reset",e,t),this.trigger("change:connections.change",this,e),this.trigger("destroy",this,this.collection))},onConnectionTestSuccess:function(e,t){
if(this._resolve(t),I.default.get("allowLoopbackDiscovery")){var i=this.get("connections"),n=this.get("activeConnection"),s=n.get("isPrivate"),a=!!i.findWhere({isLoopback:!0});!s||a||this.hasOtherLoopbackServer()||((0,C.default)("[Connections] Adding possible loopback connection for",this.get("debugName")),this.addConnection(n.getLoopbackAttributes()))}},onConnectionTestError:function(e,t){var i=this;if(!e.get("isAborted")){if(e.get("isHttps")&&!e.get("isUnauthorized"))if(this.canAllowHttpFallback()){
var n=this.addConnection({scheme:"http",address:e.get("address"),port:e.get("port"),isFallback:!0});(0,C.default)("[Connections] Added insecure fallback connection for %s at %s",this.get("debugName"),n.id)}else C.default.warn("[Connections] Prevented fallback to insecure connection for ",this.get("debugName"));var s=this.get("connections");!this.id&&e.get("isUnauthorized")&&this.populateIdentity(e),s.hasOnlyFailedConnections()&&(this.id||!this._identityPromise?this._reject():this._identityPromise.always(function(){
s.hasOnlyFailedConnections()&&i._reject()}))}}},{connectionTestResults:re,promiseStates:oe,serverClasses:le});t.default=ue,e.exports=t.default},function(e,t,i){var n,s;n=[i(2),i(4),i(6),i(5),i(68),i(9),i(35),i(192),i(193)],s=function(e,t,i,n,s,a,r,o){"use strict";var l,c=!1,u=i.Controller.extend({populateView:function(e){e||(e={}),n.trigger("show:loading",{navigating:!0}),l&&"pending"===l.state()&&(c=!0),s.abortAll("page");var i={options:e},a=this.populateServer(e.serverID,i);return e.primaryServer&&(a=this.populatePrimaryServer(a,i)),
e.sectionID&&(a=this.populateSection(e,a,i)),e.key&&(a=this.populateMetadata(e,a,i)),e.channelID&&(a=this.populateChannel(e,a,i)),e.channelKey&&(a=this.populateChannelMetadata(e,a,i)),a=a.then(function(){return t.Deferred().resolve(i)},function(e){return c?c=!1:n.trigger("navigate","unauthorized",{result:i,silent:!0}),t.Deferred().reject(i)}),l=a,a},populateServer:function(e,i){var s=a.get("servers");if(!e)return s.populateAnyServer();var r;if(/^transient/.test(e)){var o=a.get("transientServer");if(!o||o.id!==e)return n.trigger("navigate:refresh:dashboard"),
t.Deferred().reject().promise();r=t.Deferred().resolve(o).promise()}else r=s.populateServer(e);return r.always(function(e){i.server=e}),r},populatePrimaryServer:function(e,i){return e=e.then(function(){function e(t,s){a.off("change:primaryServer",e),s?(i.server=s,n.resolve()):n.reject()}var n=t.Deferred(),s=a.get("primaryServer");return s?(i.server=s,n.resolve().promise()):s===!1?n.reject().promise():(a.on("change:primaryServer",e),n.promise())})},populateSection:function(e,i,n){return i=i.then(function(){
return n.server.get("sections").populate()}),i=i.then(function(i){var s=n.item,a=e.sectionID;if(s&&(a=s.get("librarySectionID"),!a||!n.server.get("isFullServer")))return t.Deferred().resolve();var r=i.get(a);if(!r)return t.Deferred().reject();if(n.section=r,s){s.section=r;var o=function(e){e&&(e.section=r,e.each(function(e){e.section=r}))};o(s.get("children")),o(s.get("extras"))}return t.Deferred().resolve(r)})},populateMetadata:function(t,i,n){return i=i.then(function(){var i=new r({key:t.key},{
server:n.server});return n.item=i,i.fetch({scope:"page",data:e.extend({checkFiles:"1",includeExtras:"1",includeRelated:"1",includeRelatedCount:"0",includeOnDeck:"1",includeChapters:"1"},t.populateData)})}),i=this.populateSection(t,i,n)},populateChannel:function(e,t,i){return t=t.then(function(){var t=e.channelID,n={};/^\/\w+\//.test(t)?n.key=t:n.identifier=t;var s=new o(n,{server:i.server});return i.channel=s,s.fetch({scope:"page"})})},populateChannelMetadata:function(e,t,i){return t=t.then(function(){
var t=new o({key:e.channelKey},{server:i.server,channel:i.channel});return i.channelItem=t,t.fetch({scope:"page"})})}});return u}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(19),i(6),i(5),i(9),i(72)],s=function(e,t,i,n,s,a){"use strict";var r=i.AppRouter.extend({initialize:function(){this.uniqueRoutes=e.uniq(e.values(this.appRoutes)),this.fragments=e.invert(this.appRoutes),this.listenTo(this,"route",this.onRoute),this.listenTo(n,"navigate",this.onNavigate)},resolveUrlFragment:function(t,i){
var n=t.match(/:\w+/g);return n&&e.each(n,function(e){var n=e.slice(1),s=i[n];if(null==s){var a=new RegExp("\\([^\\)]*"+e+"[^\\)]*\\)","g");t=t.replace(a,"")}else t=t.replace(e,encodeURIComponent(s))}),t.replace(/\(|\)/g,"")},onRoute:function(i){var n=s.get("history"),r=s.get("forwardHistory"),o=t.history.getFragment();o===r[0]?n.push(r.shift()):o!==e.last(n)&&(n.push(o),r.splice(0)),a.trackView(i),s.trigger("change:history",s,n)},onNavigate:function(t,i){if(-1!==e.indexOf(this.uniqueRoutes,t)){i||(i={});
var n=!1;if(null!=i.silent&&(n=i.silent,delete i.silent),null==i.trigger&&(i.trigger=!0),n)this.controller[t].apply(this.controller,e.values(i));else{var s=this.resolveUrlFragment(this.fragments[t],i);this.navigate(s,{trigger:i.trigger,replace:i.replace})}}}});return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n;n=function(){"use strict";return{NORMAL:0,LOCAL:42,CLOUD:43}}.call(t,i,t,e),!(void 0!==n&&(e.exports=n))},function(e,t,i){"use strict";function n(e){if(0>=e||!r.default.isNumber(e))return"0:00";
var t=l.default.duration(e),i=t.seconds(),n=t.minutes(),s=t.hours()+24*t.days(),a="";return a=10>i?":0"+i:":"+i,a=10>n&&s>0?"0"+n+a:n+a,s>0&&(a=s+":"+a),a}var s=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var a=i(2),r=s(a),o=i(12),l=s(o);t.default=n,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(232),a=n(s),r=i(41),o=n(r);t.default=(0,o.default)(a.default),e.exports=t.default},function(e,t,i){var n,s;n=[i(2),i(4)],
s=function(e,t){"use strict";function i(i){return i=e.isArray(i)?i:e.toArray(arguments),t.when.apply(t,e.map(i,s))}function n(i){if(!i.length)return t.Deferred().reject().promise();var n=t.Deferred(),s=i.length;return e.each(i,function(e){e.done(function(){s--,n.resolveWith(this,arguments)}).fail(function(){s--,0===s&&n.reject()})}),n.promise()}function s(e){var i=t.Deferred();return e.always(function(){i.resolve.apply(i,arguments)}),i.promise()}function a(i){var n=t.Deferred();return i.done(function(){
var t=arguments;e.defer(function(){n.resolve.apply(n,t)})}),i.fail(function(){var t=arguments;e.defer(function(){n.reject.apply(n,t)})}),n.promise()}var r={whenEach:i,whenFirstSucceed:n,alwaysResolve:s,deferOneTick:a};return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(7),a=n(s),r=i(99),o=n(r),l=["key","typeID","typeString"],c=(0,o.default)(l,[{key:"movies",typeID:"1",typeString:"movie",title:function(){
return(0,a.default)("Movies")},defaultAgent:"com.plexapp.agents.imdb",defaultLanguage:"en",defaultScanner:"Plex Movie Scanner",sectionTypeIcon:"plex-icon-film"},{key:"tv",typeID:"2",typeString:"show",title:function(){return(0,a.default)("TV Shows")},defaultAgent:"com.plexapp.agents.thetvdb",defaultLanguage:"en",defaultScanner:"Plex Series Scanner",sectionTypeIcon:"plex-icon-display"},{key:"music",typeID:"8",typeString:"artist",title:function(){return(0,a.default)("Music")},defaultAgent:"com.plexapp.agents.lastfm",
defaultLanguage:"en",defaultScanner:"Plex Music Scanner",sectionTypeIcon:"plex-icon-music",exclusiveAgents:["com.plexapp.agents.plexmusic"],exclusiveScanners:["Plex Premium Music Scanner"]},{key:"photos",typeID:"13",typeString:"photo",title:function(){return(0,a.default)("Photos")},defaultAgent:"com.plexapp.agents.none",defaultLanguage:"xn",defaultScanner:"Plex Photo Scanner",sectionTypeIcon:"plex-icon-picture"},{key:"videos",typeID:"1",typeString:"movie",title:function(){return(0,a.default)("Home Videos");
},defaultAgent:"com.plexapp.agents.none",defaultLanguage:"xn",defaultScanner:"Plex Video Files Scanner",sectionTypeIcon:"plex-icon-facetime-video"}]);t.default=c,e.exports=t.default},function(e,t,i){var n,s;n=[i(1014),i(4),i(2),i(134),i(11)],s=function(e,t,i,n,s){"use strict";var a=n.extend({tagName:"span",className:"rating star-rating",template:e,disabled:!0,modelEvents:{"change:rating":"onRatingChange","change:userRating":"onRatingChange"},events:i.extend({mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",
mousemove:"onMouseMove"},n.prototype.events),initialize:function(e){n.prototype.initialize.apply(this,arguments);var t=this.model.server.get("shared")&&!this.model.server.get("multiuser");this.disabled=e.disabled||t,this.passive=e.passive,this.updateRating()},updateRating:function(){this.metadataRating=this.model.get("rating")||0,this.userRating=this.model.get("userRating"),this.setValue(this.userRating>0?this.userRating:this.metadataRating)},normalizeRating:function(e){return Math.round(e/2)},serializeData:function(){
var e=this.normalizeRating(this.currentValue);return{stars:[e>0,e>1,e>2,e>3,e>4]}},getValueForPosition:function(e){var t=this.$el,i=e-t.offset().left,n=i/t.width();return n=Math.min(Math.max(n,0),1),n=2*Math.ceil(5*n)},persistValue:function(){var e=this.currentValue||-1;s.execute("rate",{item:this.model,rating:e,passive:this.passive}),this.updateRating(),this.render()},displayValue:function(e){this.$el.data("value",e);var i=this.normalizeRating(e),n=this.$(".star-icon");n.each(function(e){var n=i>e;
t(this).toggleClass("star",n).toggleClass("dislikes",!n)}),this.$el.toggleClass("unrated",!e)},onRender:function(){n.prototype.onRender.apply(this,arguments),this.$el.toggleClass("unrated",!this.currentValue),this.$el.toggleClass("user-rating",this.userRating>0),this.$el.toggleClass("disabled",this.disabled)},onRatingChange:function(e,t){this.updateRating(),this.render()},onMouseEnter:function(e){this.disabled||(this.$el.addClass("user-rating"),this.$el.removeClass("unrated"))},onMouseLeave:function(e){
this.disabled||this.render()},onMouseMove:function(e){if(!this.disabled)if(this.dragging)this.updateForPosition(e.pageX);else{var t=this.getValueForPosition(e.pageX);this.displayValue(t)}},onDragComplete:function(){this.disabled||this.persistValue()}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1055),i(2),i(4),i(6),i(7),i(5)],s=function(e,t,i,n,s,a){"use strict";var r=n.ItemView.extend({className:"summary",template:e,ui:{summary:".metadata-summary",divider:".summary-divider",
dividerBtn:".summary-divider-btn"},events:{"click .summary-divider-btn":"onMoreSummaryClick"},onlyAfterRender:["onDeferredRender","updateDividerBtnVisibility"],bindings:{".item-summary":{modelAttribute:"summary",autohide:!0,isHtml:!0,formatter:function(e){this.$el.toggleClass("hidden",!e),this.updateDividerBtnVisibility();var n=t.map(t.compact(e.split("\n")),function(e){return i.trim(t.escape(e))});return n.length?"<p>"+n.join("</p><p>")+"</p>":void 0}}},initialize:function(){this.listenTo(a,"resize",this.onResize),
this.listenTo(this.model,"change:summary",this.onSummaryChange)},updateDividerBtn:function(e){var t=s(e?"More":"Less");this.ui.dividerBtn.html(t)},updateDividerBtnVisibility:function(){if(this.originalHeight){var e=this.ui.summary.prop("scrollHeight");e<=this.originalHeight?this.ui.divider.addClass("hidden"):(this.updateDividerBtn(!this.expanded),this.ui.divider.removeClass("hidden"))}},onRender:function(){t.defer(t.bind(this.onDeferredRender,this))},onDeferredRender:function(){this.expanded=!1;var e=this.ui.summary.prop("scrollHeight"),t=this.ui.summary.prop("clientHeight");
this.originalHeight=t,e>t&&(this.ui.summary.css("max-height",t+"px"),this.ui.divider.removeClass("hidden"))},onResize:function(){this.isClosed||this.updateDividerBtnVisibility()},onMoreSummaryClick:function(){var e=this.ui.summary.prop("scrollHeight")+100;this.expanded?(this.ui.summary.css("max-height",this.originalHeight+"px"),this.expanded=!1):(this.ui.summary.css("max-height",e+"px"),this.expanded=!0),this.updateDividerBtn(!this.expanded)},onSummaryChange:function(){this.originalHeight&&(this.expanded&&this.ui.summary.css("max-height",this.originalHeight+"px"),
this.onDeferredRender())}});return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1159),i(2),i(4),i(7),i(5),i(15),i(14),i(60),i(25),i(11),i(74),i(756),i(759),i(762),i(764),i(758),i(31),i(173),i(167)],s=function(e,t,i,n,s,a,r,o,l,c,u,d,h,p,f,m,g,v,y){"use strict";var b=g.extend({mixins:[y],name:"editSectionModal",className:"edit-section-modal modal modal-lg fade",template:e,panes:{type:{constructor:f,nextPane:"folders",dependentPanes:["folders"]},folders:{constructor:h,nextPane:"create",
dependentPanes:["create","advanced"]},create:{constructor:p,nextPane:"advanced"},advanced:{constructor:d},error:{constructor:m}},panesModel:"tempModel",ui:{sidebar:".modal-nav-list",createBtn:".create-btn",saveBtn:".save-btn",message:".form-message",headerSectionType:".section-type-title"},regions:{paneRegion:".pane-region"},events:t.extend({"click .change-pane-btn":"onChangePaneClick","click .save-btn":"onSaveClick","click .delete-btn":"onDeleteClick","submit .edit-section-type-form":"onGeneralFormSubmit"
},g.prototype.events),onlyAfterRender:["showPane","updateMessage","updateSectionTitle","updateSectionTitleDestabilized","updateSaveBtn"],initialize:function(e){g.prototype.initialize.apply(this,arguments),this.server=e.server,this.redirect=e.redirect,this.model?this.tempModel=this.model.clone():this.tempModel=new u({},{server:this.server,collection:this.server.get("sections")}),this.listenTo(this.tempModel,"change:type",this.onSectionTypeChange),this.showPane(e.selectedPane||"type"),this.tempModel.isNew()&&e.seedAttrs&&this.tempModel.set(this.tempModel.parse(e.seedAttrs));
},serializeData:function(){var e=this.tempModel,t=e.isNew(),i={add:t,edit:!t,section:e&&e.toJSON(),selectedPane:this.selectedPane};return i},updateMessage:function(e){this.ui.message.text(e||"")},updateSaveBtn:function w(){var e=this.ui.saveBtn,i=this.panes[this.selectedPane],w=t.bind(function(t){var n=i.nextPane,s=this.tempModel.isNew(),a=!i.constructor.prototype.validate||0===i.constructor.prototype.validate(this.tempModel).length,r=!this.getReachablePanes().isAnyInvalid;this.ui.createBtn.toggleClass("hidden",!t);
var o,l=r||s&&a;o=n,t||"create"!==n||(o=!1),r&&(o=!1),t&&"create"===n&&(o=!0),t&&"advanced"===n&&(o=!0),e.toggleClass("save",!o),e.toggleClass("next",!!o),e.toggleClass("disabled",!l)},this),n="music"===this.tempModel.get("type")&&this.tempModel.server.supports("premiumMusic");n?this.paneRegion.currentView.populateAgents().then(function(e){var t=e.findWhere({identifier:"com.plexapp.agents.plexmusic"});w(t)}):w(!1)},updateSectionTitle:function(){var e=o.get(this.tempModel.get("type"));if(e){this.updateSectionTitleDestabilized();
var t=n(e.title,{escape:!0});this.ui.headerSectionType.html(t)}},updateSectionTitleDestabilized:function(){this.ui.headerSectionType.addClass("section-type-title-unstable"),this.ui.headerSectionType.triggerReflow(),this.ui.headerSectionType.removeClass("section-type-title-unstable")},save:function(){var e=this.ui.saveBtn;this.updateMessage(""),e.addClass("active");var i=this.saveModel();i.always(function(){e.removeClass("active")}),i.fail(t.bind(function(e){503===e.status?s.trigger("show:modal",new v({
model:this.server})):this.updateMessage(n("Your changes could not be saved."))},this)),i.then(t.bind(function(){if(!this.redirect)return void this.hide();var e={serverID:this.model.server.id,sectionID:this.model.id};return"artist"!==this.model.get("type")?(s.trigger("navigate","section",e),void this.hide()):(e.type=l.get("album").id,e.sortKey="addedAt",e.sortDirection="desc",this.hide(),void s.trigger("navigate","sectionType",e))},this))},saveModel:function(){var e;return this.tempModel.isNew()?(e=this.tempModel.save(),
e=e.then(t.bind(function(e,t,i){var n=a.parseXML(e);if(201===i.status){if(n.Directory&&(n=n.Directory),!n.key){var s=i.getResponseHeader("Location");s&&(n.key=s.substring(s.lastIndexOf("/")+1))}var r=this.server;return r.supports("advancedFilters")&&(n.filters=!0),this.model=new u(n,{parse:!0,server:this.server}),r.get("sections").add(this.model),i}},this))):(this.model.copy(this.tempModel),e=this.model.save()),e=e.then(t.bind(this.saveSettings,this)),e=e.then(t.bind(this.saveAgentSettings,this));
},saveSettings:function(){var e=i.Deferred().resolve(this.model).promise();if(!this.server.supports("sectionSettings"))return e;var n=this.tempModel.settings;if(!n)return e;var s=this.getSettingsChanges(n);if(t.isEmpty(s))return e;var a=n.first(),o=a.getSaveParams(s),l=r.join(["/library/sections/",this.model.id,"/prefs"],o),c=t.extend(this.server.getXHROptions(l),{type:"PUT"});return i.ajax(c).promise().then(function(){return e})},saveAgentSettings:function(){var e=i.Deferred().resolve(this.model).promise(),n=this.tempModel.agentSettings;
if(!this.tempModel.agentSettings)return e;var s=this.getSettingsChanges(n);if(t.isEmpty(s))return e;var a=n.first(),o=a.getSaveParams(s),l=t.result(n,"url"),c=r.join([l,"/set"],o),u=a.server.getXHROptions(c);return i.ajax(u).promise().then(function(){return e})},getSettingsChanges:function(e){var t=e.filter(function(e){return e.changedAttributes()}).reduce(function(e,t){var i=t.get("value");return"bool"===t.get("type")&&(i=i?"1":"0"),e[t.get("id")]=i,e},{});return t},onPaneShow:function(e,t){this.listenTo(t,"valid",this.updateSaveBtn),
this.listenTo(t,"invalid",this.updateSaveBtn),this.updateSaveBtn()},onPaneHide:function(e,t){this.stopListening(t,"valid",this.updateSaveBtn),this.stopListening(t,"invalid",this.updateSaveBtn)},onChangePaneClick:function(e){e.preventDefault();var t=this.$(e.currentTarget);t.isDisabled()||this.showPane(t.data("pane"))},onSaveClick:function(e){e.preventDefault();var t=this.ui.saveBtn;if(!t.isDisabled())if(t.hasClass("next")){var i=this.panes[this.selectedPane].nextPane;i&&!this.ui.sidebar.find("."+i+"-btn").isDisabled()&&this.showPane(i);
}else this.save()},onDeleteClick:function(e){e.preventDefault();var t=c.execute("deleteSection",{section:this.model});t.done(function(){s.trigger("navigate","dashboard")})},onGeneralFormSubmit:function(e){this.onSaveClick(e)},onSectionTypeChange:function(){this.updateSaveBtn()}});return b}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(31)],s=function(e,t,i){"use strict";var n=i.extend({className:"select-modal modal modal-sm fade",events:e.extend({"click a":"onClick"
},i.prototype.events),initialize:function(){i.prototype.initialize.apply(this,arguments),this.promise=t.Deferred()},onRender:function(){i.prototype.onRender.apply(this,arguments)},onHide:function(e){i.prototype.onHide.apply(this,arguments),this.promise.reject()},onClick:function(e){e.preventDefault(),this.promise.resolve(t(e.currentTarget).data("value")),this.hide()}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(29),i(479)],s=function(e,t,i){"use strict";var n=t.extend({
model:i,url:"/:/prefs",initialize:function(e,t){this.server.on("socket:setting",function(e){var t=this.get(e.id);t&&(e=t.parse(e),t.set("value",e.value),"FriendlyName"===e.id&&e.value?this.server.set("friendlyName",e.value):"allowMediaDeletion"===e.id&&this.server.set("allowMediaDeletion",e.value))},this)},parse:function(t){var i=this.convert(t,"Setting");return e.filter(i,function(e){return e.id})}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{
value:!0});var i={linkedYearMetadata:"0.9.14.0",streamReady:"0.9.14.0",allPartsStreamSelection:"0.9.12.5",sharedChannels:"0.9.12.5",shortenTranscodeURL:"0.9.12.5",companionProxy:"0.9.12.5",editSimilarArtists:"0.9.12.2",neuterRedirect:"0.9.12.0",audioAsVideo:"0.9.12.0",compositeDelete:"0.9.12.0",batchEdit:"0.9.12.0",premiumMusic:"0.9.12.0",transientToken:"0.9.12.0",softSubtitles:"0.9.12.0",sharedSyncStatus:"0.9.11.14",reachability:"0.9.11.14",photoPlayQueues:"0.9.11.12",publicNowPlaying:"0.9.11.3",
labels:"0.9.11.2",updater:"0.9.11.1",playItemsBatchAdd:"0.9.9.16",playlists:"0.9.9.13",imageFilters:"0.9.9.13",hubFilterSigns:"0.9.9.12",cancelAllUpdates:"0.9.9.10",playQueues:"0.9.9.6",sectionSettings:"0.9.9.6",hubFilters:"0.9.9.2",streamingMKV:"0.9.9.16",chunkedHTTP:"0.9.9.3",sharedSync:"0.9.9.3",dash:"0.9.8.6",specificMediaDeletion:"0.9.7.23",sharedSettings:"0.9.7.23",syncNotifications:"0.9.7.23",universalMusicTranscoder:"0.9.8.3",universalTranscoder:"0.9.7.17",sync:"0.9.7.10",artworkUpload:"0.9.7.9",
firstRunPref:"0.9.7.3",timelineState:"0.9.7.2",cleanBundles:"0.9.7.0",advancedFilters:"0.9.7.0",search:"0.9.7.0",merge:"0.9.7.0",splitApart:"0.9.7.0"};t.default=i,e.exports=t.default},function(e,t,i){var n;n=function(){"use strict";var e={waitingRegex:/^(transcoded|downloaded|directplay|processed)$/,processingRegex:/^(pending|transcoding|downloading)$/,failedRegex:/^(failed|error)$/,addVersionHeader:function(e,t){return t||(t={}),t.headers||(t.headers={}),t.headers["X-Plex-Sync-Version"]=e,t},addVersionHeaderForDevice:function(e,t){
var i=e&&e.get("SyncList");return i&&i.version?this.addVersionHeader(i.version,t):t},getSyncStateFromPart:function(e){return e.transcodeState||e.syncState},getSyncStateContextFromPart:function(e){return e.transcodeStateContext||e.syncStateContext}};return e}.call(t,i,t,e),!(void 0!==n&&(e.exports=n))},function(e,t,i){var n,s;n=[i(2),i(4),i(20)],s=function(e,t,i){"use strict";var n=i.extend({initialize:function(){e.bindAll(this,"onAjaxSend"),this.requests=[],this.byId={}},startListening:function(){
t(document).on("ajaxSend",this.onAjaxSend)},stopListening:function(){t(document).off("ajaxSend",this.onAjaxSend)},abortAll:function(e){for(var t=this.requests.length-1;t>-1;t--){var i=this.requests[t];(null==e||e===i.settings.scope)&&this.abort(i)}},abort:function(t){var i=e.isString(t)?this.byId[t]:t;i&&(i.xhr.aborting=!0,i.xhr.abort(),this.remove(i))},store:function(t,i){var n=e.uniqueId("r");t.rid=n;var s={xhr:t,settings:i};return this.requests.push(s),this.byId[n]=s,s},remove:function(t){var i=e.indexOf(this.requests,t);
i>-1&&this.requests.splice(i,1),this.byId.hasOwnProperty(t.xhr.rid)&&delete this.byId[t.xhr.rid]},onAjaxSend:function(t,i,n){if(!n.skipCorsWithRedirect){var s=this.store(i,n);i.always(e.bind(function(){i.aborting||this.remove(s)},this))}}});return new n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(86),i(553)],s=function(e,t){"use strict";var i=t.extend({className:"container",template:e});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1121),i(2),i(4),i(48),i(30)],
s=function(e,t,i,n,s){"use strict";var a=n.extend({className:"poster-item media-tile-list-item",template:e,ui:{container:".media-poster-container",poster:".media-poster",actions:".media-poster-actions",dropdown:".media-actions-dropdown",subtitle1Fill:".media-subtitle-1-fill",subtitle2Fill:".media-subtitle-2-fill"},initialize:function(e){n.prototype.initialize.apply(this,arguments),this.model&&this.createImageView()},createImageView:function(){var e=this.type,t=150;"episode"===e?e="show":("clip"===e||"userPlaylistItem"===e)&&(t=250),
this.image=new s({model:this.model,type:e,getUrl:this.getPosterUrl,width:t})},updateDim:function(){var e=this.model.get("mediaState"),t=this.model.get("metadataState"),i=t&&"created"!==t||e,n=!!this.model.get("deletedAt");i||n?this.$el.addClass("dim"):this.$el.removeClass("dim")},bindings:t.extend({},n.prototype.bindings,{".media-subtitle-1":{modelAttribute:"year",modelListeners:["title","year"],autohide:!0,formatter:function(e){var t=n.prototype.bindings[".media-subtitle-1"].formatter.apply(this,arguments);
return"userPlaylistItem"!==this.model.get("type")&&this.ui.subtitle1Fill.toggleClass("hidden",!!t),t}},".media-subtitle-2":{modelAttribute:"index",modelListeners:["index","message"],autohide:!0,formatter:function(e){var t=n.prototype.bindings[".media-subtitle-2"].formatter.apply(this,arguments);return"episode"===this.model.get("type")&&this.ui.subtitle2Fill.toggleClass("hidden",!!t),t}},".media-count-badge":{modelAttribute:"Media",formatter:function(e){return e.length},autohide:function(e){return/^(clip|userPlaylistItem)$/.test(this.model.get("type"))?!1:e>1;
}},".unwatched-count-badge":{modelAttribute:"unviewedLeafCount",autohide:function(e){return this.shared&&!this.multiuser?!1:/^(artist|album)$/.test(this.model.get("type"))?!1:!!e}},".analyzing-icon":{modelAttribute:"mediaState",manual:!0,autohide:!0,formatter:function(e,t){return this.updateDim(),e}},".matching-icon":{modelAttribute:"metadataState",manual:!0,autohide:!0,formatter:function(e,t){return this.updateDim(),"matching"===e}},".metadata-icon":{modelAttribute:"metadataState",manual:!0,autohide:!0,
formatter:function(e,t){return this.updateDim(),"processing"===e||"loading"===e}},".trash-icon":{modelAttribute:"deletedAt",manual:!0,autohide:!0,formatter:function(e,t){return this.updateDim(),e}}})});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1158),i(2),i(4),i(12),i(7),i(5),i(11),i(446),i(750),i(268),i(753),i(749),i(751),i(31),i(167)],s=function(e,t,i,n,s,a,r,o,l,c,u,d,h,p,f){"use strict";var m={movie:["general","tags","sharing","poster","art","info"],show:["general","tags","sharing","poster","banner","art"],
season:["general","poster","art","info"],episode:["general","tags","poster","art","info"],artist:["general","tags","poster","art"],album:["general","tags","sharing","poster","art","info"],track:["general","tags","info"],photoAlbum:["general","poster","art"],photo:["general","sharing","info"],playlist:["general"]},g=["poster","art","banner","info"],v=p.extend({mixins:[f],name:"editMetadataModal",className:"edit-metadata-modal modal modal-lg fade",template:e,panes:{general:{constructor:l},tags:{constructor:c
},poster:{constructor:d},art:{constructor:d},banner:{constructor:d},sharing:{constructor:u},info:{constructor:h}},panesModel:"tempModel",events:t.extend({"click .change-pane-btn":"onChangePaneClick","click .save-btn":"onFormSubmit","submit .edit-metadata-form":"onFormSubmit"},p.prototype.events),ui:{saveBtn:".save-btn",message:".form-message",navPane:".modal-nav-pane",loadingIndicator:".modal-body-pane .loading-inline"},regions:{paneRegion:".pane-region"},onlyAfterRender:["saveChanges","showPane","showNav"],
initialize:function(e){p.prototype.initialize.apply(this,arguments);var n,r,l,c=e.mediaActions;if(c?(l=c.getActionTargets(),l[0].get("isPlaylist")||!c.server.supports("batchEdit")?n=l[0]:(n=new o(1===l.length?l[0].attributes:{},{mediaActions:c}),r=n.populate())):(n=e.model,l=[n]),this.model=n,this.tempModel=n.clone(),!r){var u=i.Deferred();u.resolve(),r=u.promise()}r=r.done(t.bind(function(){this.tempModel.set(n.attributes),1===l.length&&this.tempModel.set("key",l[0].get("key")),this.showNav(),this.showPane(e.selectedPane||"general"),
this.listenTo(a,"shortcut:save",this.saveChanges)},this)),r.fail(t.bind(function(){this.ui.message.text(s("There was an error editing this item")),this.ui.loadingIndicator.addClass("hidden")},this))},serializeData:function(){var e=m[this.model.get("type")]||m.movie;this.model.isSingleMetadataModel&&!this.model.isSingleMetadataModel()&&(e=t.difference(e,g));var i=t.reduce(e,function(e,t){return e[t]=!0,e},{}),n=t.escape(s("Edit {1}",this.model.get("aggregateTitle")||this.model.get("title"))),a={item:this.model.toJSON(),
panes:i,selectedPane:this.selectedPane,paneTitle:n};return a},paneConstructorArg:function(){return{type:this.selectedPane}},invalidChangedAttrs:function(e){var i=[];if("track"===this.tempModel.get("type")){var s=t(e),a=s.has("artist.id")||s.has("artist.title")||s.has("album.id")||s.has("album.title"),r=e["album.id"]||e["album.title"],o=e["artist.id"]||e["artist.title"],l=!a||o&&r;l||(o||i.push("grandparentTitle"),r||i.push("parentTitle"))}if(t.has(e,"originallyAvailableAt")){var c=e.originallyAvailableAt;
/^\d{4}$/.test(c)&&(e.originallyAvailableAt+="-01-01",c=e.originallyAvailableAt),""===c||n(c,"YYYY-MM-DD",!0).isValid()||i.push("originallyAvailableAt")}return i},markInvalid:function(e){this.paneRegion.currentView.markInvalid(e)},showNav:function(){this.ui.navPane.removeClass("hidden")},saveChanges:function(){var e=this.ui.saveBtn,n=this.ui.message;if(!e.isDisabled()){n.text(""),this.paneRegion.currentView.flushChanges();var a=t.reduce(this.model.changedAttributes(this.tempModel.attributes),function(e,t,i){
return/^original\./.test(i)?e:(e[i]=t,e)},{}),o=this.invalidChangedAttrs(a);if(o.length)return void this.markInvalid(o);e.addClass("active");var l=[];t.isEmpty(a)||(t.each(["artwork:poster","artwork:banner","artwork:art"],function(e){var t=a[e];t&&(l.push(r.execute("changeArtwork",{item:this.model.singleMetadataModel(),artworkType:e.replace("artwork:",""),artworkRatingKey:t})),delete a[e])},this),l.push(this.model.save(a)));var c=i.when.apply(i,l);c.done(t.bind(function(){this.hide()},this)),c.fail(function(){
n.text(s("Your changes could not be saved."))}),c.always(function(){e.removeClass("active")})}},onPaneShow:function(e,t){this.listenTo(t,"focusSubmit",function(){this.ui.saveBtn.focus()})},onPaneHide:function(e,t){t.flushChanges(),this.stopListening(t)},onFormSubmit:function(e){e.preventDefault(),this.saveChanges()}});return v}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(37)],s=function(e){"use strict";var t=e.extend({"interface":["enable","disable","set","trackView","trackEvent"],
register:function(e){this._Analytics=e},init:function(e,t){return this._instance=new this._Analytics(e,t),this._instance}});return new t}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(37)],s=function(e){"use strict";var t=new e({"interface":["enable","disable","set","trackEvent"]});return t}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(2),a=n(s),r=i(60),o=n(r),l=i(244),c=n(l),u=i(25),d=n(u),h=i(21),p=n(h),f=i(23),m=n(f),g=i(149),v=n(g),y=i(452),b=n(y),w=i(142),x=n(w),S=i(463),C=n(S),k=i(461),P=n(k),A=i(204),I=n(A),_=i(454),T=n(_),D=i(457),E=n(D),M=i(205),R=n(M),O=i(206),L=n(O),N=i(456),F=n(N),U=i(203),z=n(U),B=i(459),j=n(B),V=m.default.extend({
name:"SectionModel",context:["server"],idAttribute:"key",rootPropertyName:"Directory",cache:new v.default,persistInCache:!0,cacheKey:function(e){return this.server&&this.server.getScopedKey(e.key)},url:function H(){if(this.isNew())return a.default.result(this,"urlRoot")||a.default.result(this.collection,"url");var e=a.default.isNaN(parseInt(this.id,10)),H=e?this.id:"/library/sections/"+this.id;return H},sessionAttrs:{isSection:p.default.boolean,currentFilters:p.default.array,currentFolderKey:p.default.string,
items:p.default.instanceOf(b.default)},syncedAttrs:{key:p.default.oneOfType(p.default.string,p.default.integer),uuid:p.default.string,thumb:p.default.string,art:p.default.string,createdAt:p.default.integer,updatedAt:p.default.integer,allowAdvancedFilters:p.default.boolean,allowSync:p.default.boolean,refreshing:p.default.boolean,name:{type:p.default.string,save:!0},title:{type:p.default.string,save:!0},type:{type:p.default.string,save:!0},agent:{type:p.default.string,save:!0},scanner:{type:p.default.string,
save:!0},language:{type:p.default.string,save:!0},importFromiTunes:{type:p.default.string,save:!0}},syncedRelations:{locations:function(){return{relationClass:j.default,rootPropertyName:"Location",options:{section:this},save:!0}}},sessionRelations:{currentSubset:function(){return{relationClass:x.default,options:{section:this}}},currentFirstCharacter:function(){return{relationClass:z.default,deferred:!0}},currentType:function(){return{relationClass:I.default,deferred:!0}},currentSort:function(){return{
relationClass:L.default,deferred:!0}},types:function(){return{relationClass:P.default,options:{section:this}}},subsets:function(){return{relationClass:C.default,options:{section:this}}},filters:function(){var e=this.get("allowAdvancedFilters")?T.default:E.default;return{relationClass:e,options:{section:this}}},sorts:function(){return{relationClass:R.default,options:{section:this}}},firstCharacters:function(){return{relationClass:F.default,options:{section:this}}}},defaults:function(){var e={server:this.server,
section:this},t=new b.default([],e);return{items:t,isSection:!0,currentType:null,currentFilters:[],currentSort:null,currentFirstCharacter:null,currentFolderKey:null,currentSubset:c.default.get("all")}},initialize:function(e){var t=this;this.server.get("shared")||this.listenTo(this,"change:items.change:allowSync",function(e,i){t.set("allowSync",i)}),this.updateMediaTypes(this,e.type),this.listenTo(this,"change:type",this.updateMediaTypes),this.set({currentType:this.get("types").at(0)})},augmentResponse:function(e){
return e.allowAdvancedFilters=!!e.filters,delete e.filters,e},getSectionType:function(){var e=this.get("type");return o.default.get(e)},getSaveParams:function(e){var t=m.default.prototype.getSaveParams.apply(this,arguments);if("type"in t){var i=o.default.get(t.type);i&&(t.type=i.typeString)}return"title"in t&&(t.name=t.title,delete t.title),a.default.isObject(t.type)&&(t.type=t.type.typeString),"Location"in t&&(t.location=a.default.pluck(t.Location,"path"),delete t.Location),t},getSyncTitle:function(e){
var t=this.get("title"),i=[],n=this.get("currentSubset"),s=this.get("currentFilters");return e?(a.default.each(e,function(e){i.push(e.get("title"))}),t+": "+i.join(", ")):"all"!==n.id?t+": "+n.get("title"):s.length?(a.default.each(s,function(e){i.push(e.titles.join(", "))}),t+": "+i.join(",")):t},setAgentAndScanner:function(e,t,i,n){var s=e.defaultAgent,a=e.defaultScanner;if(n){var r=e.exclusiveAgents,o=e.exclusiveScanners,l=t.hasExclusiveAgent(r),c=i.hasExclusiveScanner(o);l&&(s=r[0]),c&&(a=o[0]);
}this.set({agent:s,scanner:a})},updateMediaTypes:function(e,t){var i=d.default.getRelatedMediaTypes(t);this.get("types").reset(i)}});t.default=V,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(2),a=n(s),r=i(38),o=n(r),l=i(245),c=n(l),u=i(21),d=n(u),h=i(23),p=n(h),f=i(471),m=n(f),g={UNTESTED:"untested",PENDING:"pending",CONNECTED:"connected",UNAUTHORIZED:"unauthorized",UNAVAILABLE:"unavailable",ABORTED:"aborted"},v=d.default.boolean.required(),y=p.default.extend({
name:"ConnectionModel",context:["server"],idAttribute:"uri",sessionAttrs:{currentTest:d.default.custom(function(e){return a.default.isFunction(e.abort)}),testState:d.default.oneOf(g.UNTESTED,g.PENDING,g.CONNECTED,g.UNAUTHORIZED,g.UNAVAILABLE,g.ABORTED).required(),isBundled:v,isFallback:v,isRelayed:v,currentReachabilityTest:d.default.custom(function(e){return a.default.isFunction(e.abort)}),isPossiblyCrossNetworkProtected:d.default.boolean.required()},sessionRelations:{sources:{relationClass:m.default
}},syncedAttrs:{uri:d.default.string,scheme:d.default.string,address:d.default.string,port:d.default.string},derivedAttrs:{isUntested:function(){return this.get("testState")===g.UNTESTED},isPending:function(){return this.get("testState")===g.PENDING},isConnected:function(){return this.get("testState")===g.CONNECTED},isUnauthorized:function(){return this.get("testState")===g.UNAUTHORIZED},isUnavailable:function(){return this.get("testState")===g.UNAVAILABLE},isFailed:function(){return this.get("isUnauthorized")||this.get("isUnavailable");
},isAborted:function(){return this.get("testState")===g.ABORTED},isLoopback:function(){var e=this.get("address");return"localhost"===e||c.default.isLoopbackAddress(e)},isPrivate:function(){return this.get("isLoopback")||c.default.isPrivateAddress(this.get("address"))},isHttps:function(){return"https"===this.get("scheme")},isSecure:function(){return this.get("isLoopback")||this.get("isHttps")},isPlexDirect:function(){return/\.plex\.direct:/.test(this.get("uri"))}},defaults:{testState:g.UNTESTED,isBundled:!1,
isFallback:!1,isRelayed:!1,isPossiblyCrossNetworkProtected:!1},url:function(){return this.get("uri")},constructor:function(e,t){var i=a.default.clone(e);a.default.isObject(e)&&!e.uri&&((0,o.default)(e.scheme&&e.address,"A server connection requires either a uri or a scheme and address"),i.uri=e.scheme+"://"+e.address,e.port&&(i.uri+=":"+e.port)),p.default.prototype.constructor.call(this,i,t)},initialize:function(){this.listenTo(this.get("sources"),"remove reset",this.onSourcesChange)},augmentResponse:function(e){
var t=e.protocol;return t?a.default.extend({},e,{scheme:t}):e},getAddressFromUri:function(){var e=document.createElement("a");return e.href=this.get("uri"),e.hostname},getIpAddressFromPlexDirectAddress:function(){var e=this.get("address");if(/\.plex\.direct$/.test(e)){var t=e.indexOf(".");t>0&&(e=e.substring(0,t),e=e.replace(/\-/g,"."))}return e},getLoopbackAttributes:function(){var e={scheme:"http",address:"127.0.0.1",port:this.get("port")};return e},onSourcesChange:function(){this.get("sources").length||this.trigger("destroy",this,this.collection);
}},{testStates:g});t.default=y,e.exports=t.default},function(e,t,i){"use strict";var n=i(294).default,s=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var a=i(2),r=s(a),o=i(4),l=s(o),c=i(19),u=s(c),d=i(301),h=s(d),p=i(44),f=s(p),m=i(17),g=s(m),v=i(143),y=s(v),b=i(21),w=s(b),x=i(23),S=s(x),C=i(45),k=s(C),P=i(221),A=s(P),I=i(220),_=s(I),T=i(216),D=s(T),E=i(219),M=s(E),R=i(492),O=s(R),L=i(214),N=s(L),F=i(494),U=s(F),z=i(496),B=s(z),j=i(500),V=s(j),H=i(495),W=s(H),$={PENDING:"pending",
LOCKED:"locked",UNLOCKED:"unlocked"},Q=S.default.extend({mixins:[y.default],name:"UserModel",context:["server"],url:"/users/account",sessionAttrs:{isSignedIn:w.default.boolean.required(),hasInvalidToken:w.default.boolean.required(),lastPrimaryServerID:w.default.string,lockState:w.default.oneOf($.PENDING,$.LOCKED,$.UNLOCKED).required(),devices:w.default.instanceOf(O.default).required(),homeUsers:w.default.instanceOf(N.default).required(),friends:w.default.instanceOf(U.default).required(),invites:w.default.instanceOf(B.default).required(),
sentInvites:w.default.instanceOf(B.default).required(),socialNetworks:w.default.instanceOf(V.default).required(),homeDetails:w.default.instanceOf(W.default).required()},syncedAttrs:{id:w.default.integer,authenticationToken:w.default.string,username:w.default.string,email:w.default.string,title:w.default.string,thumb:w.default.string,pin:w.default.string,home:w.default.boolean,restricted:w.default.boolean,guest:w.default.boolean,homeSize:w.default.integer,maxHomeSize:w.default.integer,queueUid:w.default.string,
queueEmail:w.default.string,hasAllEntitlements:w.default.boolean},syncedRelations:{subscription:{relationClass:A.default},roles:{relationClass:_.default},entitlements:{relationClass:D.default},providers:{relationClass:M.default}},derivedAttrs:{isLocked:function(){return this.get("lockState")===$.LOCKED},isUnlocked:function(){return this.get("lockState")===$.UNLOCKED},isFullUser:function(){return!!this.get("username")},isEmployee:function(){return!!this.get("roles").get("employee")},isNinja:function(){
return this.get("isEmployee")||!!this.get("roles").get("ninja")},hasPlexPass:function(){return this.get("subscription").get("active")},signedIn:function(){return this.get("isSignedIn")},locked:function(){var e=this.get("lockState");return e===$.LOCKED?!0:e===$.UNLOCKED?!1:null}},defaults:function(){var e={server:this.server,parent:this};return{isSignedIn:!1,hasInvalidToken:!1,lockState:$.PENDING,devices:new O.default([],e),homeUsers:new N.default([],e),friends:new U.default([],e),invites:new B.default([],e),
sentInvites:new B.default([],r.default.extend({subset:"requested"},e)),socialNetworks:new V.default([],e),homeDetails:new W.default({},e)}},initialize:function(e,t){this._resetPopulate(),this.onHomeUsersChange(this,this.get("homeUsers")),this.listenTo(this,"change:homeUsers",this.onHomeUsersChange),this.listenTo(this.server,{"change:isConnected":this.onServerConnectedChange,"change:isUnavailable":this.onServerUnavailableChange})},fetch:function(){return u.default.Model.prototype.fetch.apply(this,arguments);
},augmentResponse:function(e){var t=e.roles,i=e.entitlements,n=e.providers,s=r.default.extend({},e,{roles:t&&t.role,hasAllEntitlements:i&&i.all,entitlements:i&&i.entitlement,providers:n&&n.provider});return s},signInWithStoredToken:function(){var e=this,t=f.default.get("myPlexAccessToken");t.done(function(t){var i={headers:n({},"X-Plex-Token",t)},s=r.default.extend(e.server.getXHROptions(r.default.result(e,"url")),i),a=l.default.ajax(s);a.done(function(t){var n=e.get("homeDetails"),s=n.fetch(i);s.always(function(){
var i=e.parse(t),s=e.get("lockState");if(s!==$.UNLOCKED){var a=g.default.get("autoLogin"),r=!!i.guest&&!n.get("guestEnabled"),o=!!i.home&&(!a||r);s=o?$.LOCKED:$.UNLOCKED}e.signIn(i,{lockState:s})})}),a.fail(function(t){var i=401===t.status||422===t.status;e.signOut({hasInvalidToken:i}),e.server.testAllConnections(),i&&e.clearAccessToken()})}),t.fail(function(){e.signOut()})},signIn:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],n=r.default.isString(e)?this.parse(e):e,s=n.authenticationToken,a=r.default.extend({
isSignedIn:!0},n,t);return this._resolve(a,i),f.default.set("myPlexAccessToken",s)},signOut:function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return this._reject(e),l.default.Deferred().resolve().promise()},activateStoredUser:function(e){k.default.set("activeUserID",e);var t=k.default.getActiveUser();if(t){var i=t.get("lastPrimaryServerID");this.set("lastPrimaryServerID",i)}},clearAccessToken:function(){window.PLEXWEB&&window.PLEXWEB.myPlexAccessToken&&delete window.PLEXWEB.myPlexAccessToken;
var e=f.default.remove("myPlexAccessToken");return e=e.then(function(){return k.default.clearActiveUser()})},hashPIN:function(e){var t=arguments.length<=1||void 0===arguments[1]?this.get("authenticationToken"):arguments[1];return h.default.SHA256_hash(e+t)},hasEntitlement:function(e){var t=this.get("hasAllEntitlements"),i=this.get("entitlements");return!(!t&&!i.get(e))},hasHome:function(){return!!this.get("pin")||this.get("homeUsers").length>1},isFullUser:function(){return this.get("isFullUser")},
isEmployee:function(){return this.get("isEmployee")},isNinja:function(){return this.get("isNinja")},hasPlexPass:function(){return this.get("hasPlexPass")},_resolve:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];this.startCapturingChangeEvents(),this.activateStoredUser(e.id),this.set(e),this._resolvePopulate(),this.server.authenticate(e.authenticationToken),t.silent?this.discardCapturedChangeEvents():this.releaseCapturedChangeEvents()},_reject:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];
this.startCapturingChangeEvents(),this.restoreDefaults(e),this._rejectPopulate(),this.server.deauthenticate(),t.silent?this.discardCapturedChangeEvents():this.releaseCapturedChangeEvents()},onHomeUsersChange:function(e,t){var i=e.previous("homeUsers");i&&this.stopListening(i),this.listenTo(this.get("homeUsers"),"reset add remove",this.onHomeUsersUpdate)},onHomeUsersUpdate:function(){this.set("homeSize",this.get("homeUsers").length),this.get("homeDetails").fetch()},onServerConnectedChange:function(e,t){
t&&this.signInWithStoredToken()},onServerUnavailableChange:function(e,t){t&&this.signOut({lockState:this.get("lockState")})}},{lockStates:$});t.default=Q,e.exports=t.default},function(e,t,i){var n,s;n=[i(2),i(19),i(14),i(7),i(26),i(25),i(194)],s=function(e,t,i,n,s,a,r){"use strict";var o={uri:function(t,i){var n=i&&i.items;if(n&&n.length){if(n.length>1)return this.getBatchLibraryMetadataURI(n,i);t||(t=e.first(n))}return t.get("isSection")?this.getSectionURI(t,i):t.get("isPlaylist")?this.getPlaylistURI(t,i):t.get("isChannel")?this.getChannelURI(t,i):this.getLibraryMetadataURI(t,i);
},getSectionURI:function(t,n){var s,r=e.result(t,"url"),o=t.get("currentSubset"),l=t.get("currentFolderKey"),c=t.get("currentType");if("folder"===o.id)s=l?l:i.join([r,"all"]);else{var u=t.get("items").getFilterUrlParams().slice(0),d=u.indexOf("unwatchedLeaves=1");if(d>-1){var h=a.getChildMediaType(t.get("type")).typeString;u.splice(d,1,h+".unwatched=1")}c&&u.push("sourceType="+c.id);var p=u.length?"?"+u.join("&"):"";s=r+"/"+o.id+p}return this._resolveURI({prefix:"library",parts:[t.get("uuid"),"directory",s]
})},getBatchLibraryMetadataURI:function(t,i){var n=this._getSectionInfo(e.first(t)),s=e.map(t,function(e){return e.get("ratingKey")}),a="/library/metadata/"+s.join(",");return this._resolveURI({prefix:"library",parts:[n.sectionUUID,"directory",a]})},getLibraryMetadataURI:function(n,s){s||(s={});var a,o=this._getSectionInfo(n),l=e.result(n,"url");return s.excludeSeedItem&&(l=i.join(l,{excludeSeedItem:1})),a=n instanceof t.Collection||n instanceof r?"directory":"item",this._resolveURI({prefix:"library",
parts:[o.sectionUUID,a,l]})},getPlaylistURI:function(e,t){return this._resolveURI({prefix:"playlist",parts:["",e.get("guid")]})},getChannelURI:function(t,i){i||(i={});var n=e.result(t,"url"),s=t.get("items").length?"directory":"item";return this._resolveURI({prefix:"channel",parts:[t.channel.get("identifier"),s,n]})},title:function(t,i){var n=i&&i.items;if(n&&n.length){if(n.length>1)return this.getBatchLibraryMetadataTitle(n,i);t=e.first(n)}return t.get("isSection")?this.getSectionTitle(t,i):this.getLibraryMetadataTitle(t,i);
},getSectionTitle:function(t){var i=t.get("title"),n=t.get("currentSubset"),s=t.get("currentFilters");if("all"!==n.id)return i+": "+n.get("title");if(!s.length)return i;var a=e.flatten(e.map(s,function(e){return e.titles}));return i+": "+a.join(", ")},getBatchLibraryMetadataTitle:function(t){var i=e.map(t,function(e){return e.get("title")}),s=i.length;return 2===s?n("{1} and {2}",i[0],i[1]):3===s?n("{1}, {2}, and {3}",i[0],i[1],i[2]):s>3?n("{1}, {2}, and {3} others",i[0],i[1],i.length-2):void 0},
getLibraryMetadataTitle:function(e){var t=e.get("grandparentTitle")||e.get("parentTitle"),i=e.get("title");if(t&&(i=t+" - "+i),"episode"===e.get("type")){var n=s.getSeasonEpisodeIndex({seasonIndex:e.get("parentIndex"),episodePrefix:" E{1}",episodeIndex:e.get("index"),date:e.get("originallyAvailableAt"),noLeadingZero:!0});i+=" ("+n+")"}return i},_resolveURI:function(t){var i=t.parts,n=e.map(i,function(e){return e?encodeURIComponent(e):""});return t.prefix+"://"+n.join("/")},_getSectionInfo:function(t){
var i=t.get("librarySectionUUID"),n=t.get("librarySectionID");if(!i||!n){var s=t.server.getSectionForItem(t);e.isEmpty(s)||(i=s.get("uuid"),n=s.id)}return{sectionUUID:i,sectionID:n}}};return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";function n(e){var t=r.default.duration(e),i=t.hours()+24*t.days(),n=t.minutes(),s=t.seconds();return i&&n?(0,l.default)("{1} hr {2} min",i,n):i?(0,l.default)("{1} hr",i):n?(0,l.default)("{1} min",n):s>0?(0,l.default)("{1} sec",s):""}var s=i(8).default;
Object.defineProperty(t,"__esModule",{value:!0});var a=i(12),r=s(a),o=i(7),l=s(o);t.default=n,e.exports=t.default},function(e,t,i){var n;n=function(){"use strict";var e={languages:{aa:"Afaraf",af:"Afrikaans",ab:"Abkhazian",ak:"Akan",sq:"Shqip",am:"Amharic",ar:"\u0627\u0644\u0639\u0631\u0628\u064a\u0629",an:"Aragon\xe9s",hy:"\u0540\u0561\u0575\u0565\u0580\u0565\u0576",as:"Assamese",av:"\u0430\u0432\u0430\u0440 \u043c\u0430\u0446\u04c0",ae:"avesta",ay:"aymar aru",az:"az\u0259rbaycan dili",ba:"\u0431\u0430\u0448\u04a1\u043e\u0440\u0442 \u0442\u0435\u043b\u0435",
bm:"bamanankan",eu:"euskara",be:"\u0411\u0435\u043b\u0430\u0440\u0443\u0441\u043a\u0430\u044f",bn:"Bengali",bh:"\u092d\u094b\u091c\u092a\u0941\u0930\u0940",bi:"Bislama",bs:"bosanski jezik",br:"brezhoneg",bg:"\u0431\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438 \u0435\u0437\u0438\u043a",my:"Burmese",ca:"Catal\xe0",ch:"Chamoru",ce:"\u043d\u043e\u0445\u0447\u0438\u0439\u043d \u043c\u043e\u0442\u0442",cu:"\u0469\u0437\u044b\u043a\u044a \u0441\u043b\u043e\u0432\u0463\u043d\u044c\u0441\u043a\u044a",cv:"\u0447\u04d1\u0432\u0430\u0448 \u0447\u04d7\u043b\u0445\u0438",
kw:"Kernewek",co:"corsu",cr:"\u14c0\u1426\u1403\u152d\u140d\u140f\u1423",dv:"Divehi",dz:"\u0f62\u0fab\u0f7c\u0f44\u0f0b\u0f41",en:"English","en-GB":"English (UK)",eo:"Esperanto",et:"eesti",ee:"E\u028begbe",fo:"f\xf8royskt",fj:"vosa Vakaviti",fy:"Frysk",ff:"Fulfulde",ka:"\u10e5\u10d0\u10e0\u10d7\u10e3\u10da\u10d8",gd:"G\xe0idhlig",ga:"Gaeilge",gl:"Galego",gv:"Gaelg",gn:"Ava\xf1e&apos;\u1ebd",gu:"\u0a97\u0ac1\u0a9c\u0ab0\u0abe\u0aa4\u0ac0",ht:"Krey\xf2l ayisyen",ha:"\u0647\u064e\u0648\u064f\u0633\u064e",
hz:"Otjiherero",hi:"\u0939\u093f\u0928\u094d\u0926\u0940",ho:"Hiri Motu",hr:"hrvatski",ig:"As\u1ee5s\u1ee5 Igbo",is:"\xcdslenska",io:"Ido",ii:"\ua188\ua320\ua4bf Nuosuhxop",iu:"\u1403\u14c4\u1483\u144e\u1450\u1466",ie:"Interlingue",ia:"Interlingua",id:"Bahasa Indonesia",ik:"I\xf1upiaq",jv:"basa Jawa",kl:"kalaallisut",kn:"\u0c95\u0ca8\u0ccd\u0ca8\u0ca1",ks:"\u0915\u0936\u094d\u092e\u0940\u0930\u0940",kr:"Kanuri",kk:"\u049a\u0430\u0437\u0430\u049b \u0442\u0456\u043b\u0456",km:"Khmer",ki:"G\u0129k\u0169y\u0169",
rw:"Ikinyarwanda",ky:"\u043a\u044b\u0440\u0433\u044b\u0437 \u0442\u0438\u043b\u0438",kv:"\u043a\u043e\u043c\u0438 \u043a\u044b\u0432",kg:"KiKongo",kj:"Kuanyama",ku:"Kurd\xee",lo:"Lao",la:"latine",lv:"latvie\u0161u valoda",li:"Limburgs",ln:"Ling\xe1la",lt:"lietuvi\u0173 kalba",lb:"L\xebtzebuergesch",lu:"Luba-Katanga",lg:"Luganda",mk:"\u043c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438 \u0458\u0430\u0437\u0438\u043a",mh:"Kajin M\u0327aje\u013c",ml:"Malayalam",mi:"te reo M\u0101ori",mr:"\u092e\u0930\u093e\u0920\u0940",
ms:"bahasa Melayu",mg:"Malagasy fiteny",mt:"Malti",mo:"Moldavian",mn:"\u043c\u043e\u043d\u0433\u043e\u043b",na:"Ekakair\u0169 Naoero",nv:"Din\xe9 bizaad",nr:"isiNdebele (North)",nd:"isiNdebele (South)",ng:"Owambo",ne:"\u0928\u0947\u092a\u093e\u0932\u0940",nn:"Norsk nynorsk",nb:"Norsk bokm\xe5l",ny:"chiChe\u0175a",oc:"Occitan",oj:"\u140a\u14c2\u1511\u14c8\u142f\u14a7\u140e\u14d0",or:"Oriya",om:"Afaan Oromoo",os:"\u0438\u0440\u043e\u043d \xe6\u0432\u0437\u0430\u0433",pa:"\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40",
pi:"\u092a\u093e\u0934\u093f",ps:"\u067e\u069a\u062a\u0648",qu:"Runa Simi",rm:"rumantsch grischun",ro:"rom\xe2n\u0103",rn:"kiRundi",sg:"y\xe2ng\xe2 t\xee s\xe4ng\xf6",sa:"\u0938\u0902\u0938\u094d\u0915\u0943\u0924\u092e\u094d",sr:"\u0441\u0440\u043f\u0441\u043a\u0438 \u0458\u0435\u0437\u0438\u043a",si:"Sinhala",sk:"sloven\u010dina",sl:"Sloven\u0161\u010dina",se:"Davvis\xe1megiella",sm:"gagana fa&apos;a Samoa",sn:"chiShona",sd:"\u0938\u093f\u0928\u094d\u0927\u0940",so:"Soomaaliga",st:"Sesotho",sc:"sardu",
ss:"SiSwati",su:"Basa Sunda",sw:"Kiswahili",ty:"Reo Tahiti",ta:"\u0ba4\u0bae\u0bbf\u0bb4\u0bcd",tt:"\u0442\u0430\u0442\u0430\u0440\u0447\u0430",te:"Telugu",tg:"\u0442\u043e\u04b7\u0438\u043a\u04e3",tl:"Wikang Tagalog",th:"\u0e44\u0e17\u0e22",bo:"\u0f56\u0f7c\u0f51\u0f0b\u0f61\u0f72\u0f42",ti:"Tigrinya",to:"faka Tonga",tn:"Setswana",ts:"Xitsonga",tk:"T\xfcrkmen",tw:"Twi",ug:"Uy\u01a3urq\u0259",uk:"\u0443\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430",ur:"\u0627\u0631\u062f\u0648",uz:"O&apos;zbek",
ve:"Tshiven\u1e13a",vi:"Ti\u1ebfng Vi\u1ec7t",vo:"Volap\xfck",cy:"Cymraeg",wa:"Walon",wo:"Wollof",xh:"isiXhosa",yi:"\u05d9\u05d9\u05b4\u05d3\u05d9\u05e9",yo:"Yor\xf9b\xe1",za:"Sa\u026f cue\u014b\u0185",zu:"isiZulu",pb:"Portugu\xeas (Brasil)",fr:"Fran\xe7ais","fr-CA":"Fran\xe7ais Canadien",de:"Deutsch",sv:"Svenska",no:"Norsk",da:"Dansk",fi:"Suomeksi",nl:"Nederlands",it:"Italiano",es:"Espa\xf1ol","es-419":"Espa\xf1ol (Latinoam\xe9rica)",pl:"Polski",hu:"Magyar",el:"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac",
tr:"T\xfcrk\xe7e",zh:"\u4e2d\u6587","zh-TW":"\u81fa\u8a9e",ru:"\u0440\u0443\u0441\u0441\u043a\u0438\u0439 \u044f\u0437\u044b\u043a",he:"\u05e2\u05d1\u05e8\u05d9\u05ea",ja:"\u65e5\u672c\u8a9e",pt:"Portugu\xeas","pt-BR":"Portugu\xeas Brasileiro",ko:"\ud55c\uad6d\uc5b4",cs:"\u010de\u0161tina",fa:"\u0641\u0627\u0631\u0633\u06cc",xx:"Unknown",xn:"None"},getLanguageName:function(e){return this.languages[e]||""},parseHeader:function(e){return e&&e.match(/[a-zA-z\-]{2,10}/g)||[]},closestLanguage:function(t){
var i,n;t=t||[];for(var s=0,a=t.length;a>s&&(n=t[s],"xx"!==n&&"xn"!==n&&(e.languages[n]?i=n:n.indexOf("-")>0&&(i=e.closestLanguage([n.split("-")[0]]))),!i);s++);return i}};return e}.call(t,i,t,e),!(void 0!==n&&(e.exports=n))},function(e,t,i){var n,s;n=[i(6)],s=function(e){"use strict";var t=e.Layout.extend({regions:{content:".content"}});return t}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(6),i(159)],s=function(e,t,i){"use strict";var n={selectable:!0,events:{mousedown:"onMouseDown",
mouseup:"onMouseUp",mouseleave:"onMouseUp"},itemEvents:{select:"onItemSelect",autoselect:"onItemAutoselect"},itemViewOptions:function(){return{mediaActions:this.parentMediaActions||this.mediaActions}},initialize:function(e){e.mediaActions&&(this.mediaActions=e.mediaActions,this.listenTo(this.mediaActions,{"change:selectedItems":this.onMediaActionsSelectedItemsChange,"change:selecting":this.onMediaActionsSelectingChange}),this.shiftRange={start:-1,end:-1})},isViewSelected:function(t){var i=this.mediaActions.get("selectedItems");
if(0===i.length)return!1;var n=t.model,s=e.indexOf(i,n);if(-1!==s)return!0;var a=n.get("children"),r=a&&a.length&&a.every(function(e){return e.selected});return r?!0:!1},singleSelect:function(e){this.shiftRange.end=-1;var t=e.model;this.isViewSelected(e)?(this.shiftRange.start=-1,this.deselectItem(t),e.deselect()):(this.shiftRange.start=this.collection.indexOf(t),this.previousCollectionOffset=this.collection.populatedRange?this.collection.populatedRange.start:0,this.selectItem(t),e.select())},multiSelect:function(t){
if(this.getViewForModel){var n=this.collection.indexOf(t.model),s=this.collection.populatedRange.start,a=this.previousCollectionOffset-s,r=[],o=[];if(this.previousCollectionOffset=s,this.shiftRange.start<0)this.shiftRange.start=n,r.push(t.model),t.select();else if(this.shiftRange.end<0)this.shiftRange.start+=a,this.shiftRange.end=n,i.each(this.shiftRange,function(e){var t=this.collection.at(e);if(t){r.push(t);var i=this.getViewForModel(t);i&&i.select()}},this);else{i.each(this.shiftRange,function(e){
var t=this.collection.at(e);t&&o.push(t)},this),this.shiftRange.start+=a,this.shiftRange.end=n,i.each(this.shiftRange,function(e){var t=this.collection.at(e);if(t){r.push(t);var i=this.getViewForModel(t);i&&i.select()}},this);var l=[o].concat(r);o=e.without.apply(e,l),e.each(o,function(e){var t=this.getViewForModel(e);t&&t.deselect()},this)}this.mediaActions.selectItems(r,{superset:this.collection}),this.mediaActions.deselectItems(o,{superset:this.collection})}},selectItem:function(e){this.mediaActions.selectItem(e,{
superset:this.collection})},deselectItem:function(e){this.mediaActions.deselectItem(e,{superset:this.collection})},forwardItemViewEvents:function(i){this.stopListening(i,"all"),this.listenTo(i,"all",function(n){var s=Array.prototype.slice.call(arguments);s[0]="itemview:"+n,s.splice(1,0,i);var a=t.normalizeMethods.call(this,this.itemEvents);"undefined"!=typeof a&&e.isFunction(a[n])&&a[n].apply(this,s),t.triggerMethod.apply(this,s)},this)},onMediaActionsSelectedItemsChange:function(e,t){this.getViewForModel&&(t&&t.length||(this.shiftRange.start=-1,
this.shiftRange.end=-1,this.collection.each(function(e){var t=this.getViewForModel(e);t&&t.deselect&&t.deselect()},this)))},onMediaActionsSelectingChange:function(e){this.$el.toggleClass("hide-actions",e)},onClose:function(){this.mediaActions&&this.mediaActions.deselectAll()},onMouseDown:function(e,t){this.isMouseDown=!0},onMouseUp:function(e,t){this.isMouseDown=!1},onItemSelect:function(e,t,i){this.selectable&&(i||(i={}),i.multiSelect?this.multiSelect(t):this.singleSelect(t))},onItemAutoselect:function(e,t,i){
this.isMouseDown&&this.onItemSelect.apply(this,arguments)},onItemRemoved:function(e){e.model.selected&&(this.deselectItem(e.model),e.deselect())}};return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2)],s=function(e){"use strict";var t={currentState:null,enterState:function(t){if(t!==this.currentState){var i=this.currentState,n=this.states[t];if(!n)throw new Error("The state machine is unable to enter undefined state: "+t);if(i){var s=this.states[i];if(e.isFunction(s.onExit)){
var a=s.onExit.call(this);if(a===!1)return}}if(this.currentState=t,e.isFunction(n.onEnter)){var r=n.onEnter.apply(this,e.rest(arguments));if(r===!1)return void(this.currentState=i)}this.triggerMethod("stateMachineChange",{from:i,to:t})}},enterNextState:function(){var e;if(this.currentState){var t=this.states[this.currentState];e=t.nextState}else{if(!this.initialState)throw new Error("An initial state must be defined for the state machine");e=this.initialState}e?this.enterState(e):this.triggerMethod("stateMachineComplete");
}};return t}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1192),i(2),i(4),i(7),i(5),i(15),i(11),i(9),i(213),i(146),i(671),i(31),i(885),i(893),i(884),i(888),i(892),i(889),i(49)],s=function(e,t,i,n,s,a,r,o,l,c,u,d,h,p,f,m,g,v,y){"use strict";var b=d.extend({name:"editFriendModal",className:"edit-friend-modal modal modal-lg fade",template:e,panes:{username:p,general:f,ownedServer:m,sharedServer:g,restrictions:v},ui:{poster:".modal-poster",title:".modal-title",message:".form-message",
nextBtn:".next-btn",submitBtn:".submit-btn"},regions:{nav:".modal-nav-pane",body:".modal-body-pane"},events:t.extend({"submit #share-server-form":"onSubmit"},d.prototype.events),initialize:function(e){d.prototype.initialize.apply(this,arguments),e||(e={}),this.type=e.type||"friend",this.isAdmin=e.isAdmin,this.defaultPaneType=e.defaultPaneType,this.defaultPaneID=e.defaultPaneID,"home"===this.type&&this.initHomeUser(e),this.initModel(e),this.initServerOverviews(e),this.initServerShares(e),this.image=new y({
model:this.model,type:"friend",width:40}),this.listenTo(this.body,"show",this.onShowPane)},initHomeUser:function(e){if(this.homeUser=e.homeUser,this.homeUser){var t=o.get("user"),i=t.get("friends");this.model=i.findWhere({id:e.homeUser.id}),this.tempHomeUser=this.homeUser.clone()}else this.tempHomeUser=new c({admin:!1},{server:o.get("user").server})},initModel:function(e){this.model?this.tempModel=this.model.cloneDeep():(this.tempModel=new l({},{server:o.get("user").server}),this.tempModel.parseServers({
Server:[]}))},initServerOverviews:function(e){var i=o.get("servers"),n=o.get("user"),s=this.tempModel.get("serverOverviews");s||(s=new u([],{server:n.server,parent:this.tempModel}),this.tempModel.set("serverOverviews",s));var a=i.filter(function(e){var t=!e.get("shared")&&!e.get("cloud"),i=e.get("isFullServer")||e.get("isCloudSync");return e.id&&t&&i});t.each(a,function(e){var t=s.add({machineIdentifier:e.id,name:e.get("friendlyName")});t.populate()})},initServerShares:function(e){var t=this.tempModel.get("serverShares");
t.each(function(e){e.populate()})},serializeData:function(){return{type:this.type,title:this.tempModel.get("title")}},showNextPane:function(e){var t,i={};if(e||(e=this.tempModel.isNew()?"username":this.defaultPaneType||"general"),"ownedServer"===e||"sharedServer"===e){var n,s;if("ownedServer"===e?(n=this.tempModel.get("serverOverviews"),s="serverOverview"):(n=this.tempModel.get("serverShares"),s="serverShare"),n.length){var a;this.defaultPaneID&&(a=n.findWhere({machineIdentifier:this.defaultPaneID
})),a||(a=n.first()),t=a.id,i[s]=a}else e="general"}t||(t=e),this.showPane(e,t,i)},showPane:function(e,i,n){this.currentPane&&(this.currentPane.flushChanges(),this.stopListening(this.currentPane),"username"===this.currentPane.paneID&&(this.ui.title.text(this.tempModel.get("username")||this.tempModel.get("title")),this.findExistingFriend()));var s=this.panes[e],a=new s(t.extend({paneID:i,model:this.tempModel,homeUser:this.tempHomeUser,type:this.type,isAdmin:this.isAdmin},n));return this.listenTo(a,{
"change:pane":this.onChangePane,"change:errorMessage":this.onErrorMessageChange,"enable:submit":this.onEnableSubmit,"destroy:homeUser":this.onHomeUserDestroy,"destroy:friend":this.onFriendDestroy,"destroy:serverShare":this.onServerShareDestroy,"disable:guest":this.onGuestDisable}),this.currentPane=a,this.nav.currentView.selectItem(i),this.body.show(a),a},getSubmitBtn:function(){return this.currentPane&&"username"===this.currentPane.paneID?this.ui.nextBtn:this.ui.submitBtn},findExistingFriend:function(){
var e,t=o.get("user"),i=t.get("friends"),n=this.tempModel.get("username");if(this.tempModel.get("restricted")?e=i.findWhere({restricted:!0,title:n}):(e=i.findWhere({username:n}),e||(e=i.findWhere({email:n}))),e){var s=this.tempModel.get("serverOverviews");this.model=e,this.tempModel=e.cloneDeep(),this.tempModel.set("serverOverviews",s),this.initServerShares(),this.image.setModel(this.model),this.image.render(),this.nav.currentView.setModel(this.tempModel)}},sendRequests:function(){var e=this.tempHomeUser&&this.tempHomeUser.isNew(),r=!e&&this.tempModel.isNew(),l=[];
l.push(this.sendFriendInvite()),l.push(this.sendHomeInvite());var c=i.when.apply(i,l);return c=c.then(t.bind(function(){return Array.prototype.push.apply(l,this.sendServerShareInvites()),this.tempModel.isNew()||l.push(this.tempModel.save({},{parse:!1})),this.tempHomeUser&&!e&&l.push(this.tempHomeUser.save()),i.when.apply(i,l)},this)),c.done(t.bind(function(){var e=o.get("user");e.get("friends").fetch(),"home"===this.type&&e.get("homeUsers").fetch(),this.tempModel.get("restricted")||e.get("sentInvites").fetch(),
this.hide()},this)),c.fail(t.bind(function(i){var o=a.parseXML(i.responseText),l=o&&o.status;t.isString(l)||(l=n(e?"This user could not be added to your home.":r?"An invite could not be sent to this user.":"Your changes could not be saved.")),s.trigger("show:alert",{type:"error",message:l})},this)),c},sendFriendInvite:function(){if("friend"===this.type){var e=this.tempModel.get("serverShares").getActiveCount();return this.tempModel.isNew()&&!e?this.tempModel.save({user:this.tempModel.get("username")
}):void 0}},sendHomeInvite:function(){if("home"===this.type&&this.tempHomeUser.isNew()){var e=this.tempHomeUser.save();return e.done(t.bind(function(){if(this.tempHomeUser.get("restricted")){this.tempModel.set("id",this.tempHomeUser.id);var e=o.get("user");e.set("home",!0)}this.showHomeWarnings()},this)),e}},showHomeWarnings:function(){r.execute("showHomeWarningsModal")},sendServerShareInvites:function(){var e=this.model&&this.model.get("serverShares").filterByOwned(),i=this.tempModel.get("serverShares").filterByOwned(),n=e?e.pluck("machineIdentifier"):[],s=i?i.pluck("machineIdentifier"):[],a=t.union(n,s),o=[];
return t.each(a,function(t){var n=e&&e.findWhere({machineIdentifier:t}),s=i&&i.findWhere({machineIdentifier:t}),a=n&&n.isActive(),l=s&&s.isActive();l?o.push(r.execute("shareServer",{user:this.tempModel,serverShare:s})):a&&o.push(n.destroy({wait:!0}))},this),o},onRender:function(){d.prototype.onRender.apply(this,arguments),this.image.setElement(this.ui.poster);var e=new h({model:this.tempModel});this.listenTo(e,"change:pane",this.onChangePane),this.nav.show(e),this.showNextPane()},onClose:function(){
this.image.close()},onChangePane:function(e,t,i){t||(t=e),this.showPane(e,t,i)},onShowPane:function(){var e="username"===this.currentPane.paneID;this.nav.currentView.toggleDisabled(e),this.ui.nextBtn.toggleClass("hidden",!e),this.ui.submitBtn.toggleClass("hidden",e)},onErrorMessageChange:function(e){this.ui.message.text(e)},onEnableSubmit:function(e){this.getSubmitBtn().toggleClass("disabled",!e)},onHomeUserDestroy:function(){if(this.homeUser){var e=r.execute("removeHomeUser",{homeUser:this.homeUser
});e.done(t.bind(this.hide,this))}},onFriendDestroy:function(){if(this.model){var e=r.execute("removeFriend",{friend:this.model});e.done(t.bind(this.hide,this))}},onServerShareDestroy:function(e){var i=r.execute("removeServerShare",{serverShare:e});i.done(t.bind(function(){var t=this.model.get("serverShares");t.remove(e.id),this.showNextPane("general")},this))},onGuestDisable:function(){var e=r.execute("toggleGuest",{user:o.get("user"),enable:!1});e.done(t.bind(this.hide,this))},onSubmit:function(e){
e.preventDefault();var i=this.getSubmitBtn();if(!i.isDisabled()){if("username"===this.currentPane.paneID)return void this.showNextPane("ownedServer");i.addClass("active"),this.currentPane.flushChanges(),this.sendRequests().fail(t.bind(function(){this.ui.submitBtn.removeClass("active")},this))}}});return b}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1256),i(2),i(6),i(7)],s=function(e,t,i,n){"use strict";var s=i.Layout.extend({className:"form-group",template:e,isDisabled:!0,
isActive:!1,ui:{submitBtn:".submit-btn",message:".form-message"},events:{"change #server-settings-form input[name]":"onInputChange","keyup #server-settings-form input[type=text]":"onInputChange","change #server-settings-form select[name]":"onInputChange","submit #server-settings-form":"onSubmit"},initialize:function(e){this.changes=e.changes},serializeData:function(){return t.where(this.collection.toJSON(),{group:this.options.group,hidden:!1})},enable:function(){this.isDisabled=!1,this.ui.submitBtn.removeClass("disabled"),
this.ui.message.text("")},updateModel:function(e,t){var i=this.collection.get(e);return i?i.set("value",t):void 0},onRender:function(){t.isEmpty(this.changes)||this.enable()},onInputChange:function(e){var t=e.currentTarget,i=t.name,n=t.value,s=t.value;if(i){"checkbox"===t.type&&(s=t.checked,s||(n="0"));var a=this.updateModel(i,s);a&&(this.changes[t.name]=n,this.enable())}},onSubmit:function(e){e.preventDefault(),this.trigger("save")},onBeforeSave:function(){this.isActive=!0,this.ui.submitBtn.addClass("active");
},onAfterSave:function(e){var t;this.isActive=!1,this.ui.submitBtn.removeClass("active"),e?(this.isDisabled=!0,this.ui.submitBtn.addClass("disabled"),t=n("Your changes have been saved.")):t=n("Your changes could not be saved."),this.ui.message.text(t)}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t){var i=Object;e.exports={create:i.create,getProto:i.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:i.getOwnPropertyDescriptor,setDesc:i.defineProperty,setDescs:i.defineProperties,
getKeys:i.keys,getNames:i.getOwnPropertyNames,getSymbols:i.getOwnPropertySymbols,each:[].forEach}},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){function a(e,t){var n,s,a="";return a+=' <h2 class="text-muted">',(s=i.subtitle)?n=s.call(e,{hash:{},data:t}):(s=e&&e.subtitle,n=typeof s===u?s.call(e,{hash:{},data:t}):s),(n||0===n)&&(a+=n),a+="</h2> "}function r(e,t){var n,s,a="";return a+=" <p>",(s=i.message)?n=s.call(e,{hash:{},data:t}):(s=e&&e.message,n=typeof s===u?s.call(e,{
hash:{},data:t}):s),(n||0===n)&&(a+=n),a+="</p> "}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var o,l,c="",u="function",d=this;return c+='<div class="row row-padded"> <div class="col-md-8 col-md-offset-2"> <h1>',(l=i.title)?o=l.call(t,{hash:{},data:s}):(l=t&&t.title,o=typeof l===u?l.call(t,{hash:{},data:s}):l),(o||0===o)&&(c+=o),c+="</h1> ",o=i.if.call(t,t&&t.subtitle,{hash:{},inverse:d.noop,fn:d.program(1,a,s),data:s}),(o||0===o)&&(c+=o),c+=" ",o=i.if.call(t,t&&t.message,{
hash:{},inverse:d.noop,fn:d.program(3,r,s),data:s}),(o||0===o)&&(c+=o),c+=" </div> </div>"})},function(e,t,i){var n,s;/**!
	 * Sortable
	 * @author	RubaXa   <trash@rubaxa.org>
	 * @license MIT
	 */
!function(a){"use strict";n=a,s="function"==typeof n?n.call(t,i,t,e):n,!(void 0!==s&&(e.exports=s))}(function(){"use strict";function e(e,t){this.el=e,this.options=t=g({},t),e[R]=this;var n={group:Math.random(),sort:!0,disabled:!1,store:null,handle:null,scroll:!0,scrollSensitivity:30,scrollSpeed:10,draggable:/[uo]l/i.test(e.nodeName)?"li":">*",ghostClass:"sortable-ghost",ignore:"a, img",filter:null,animation:0,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,
dataIdAttr:"data-id",delay:0};for(var s in n)!(s in t)&&(t[s]=n[s]);var r=t.group;r&&"object"==typeof r||(r=t.group={name:r}),["pull","put"].forEach(function(e){e in r||(r[e]=!0)}),t.groups=" "+r.name+(r.put.join?" "+r.put.join(" "):"")+" ";for(var o in this)"_"===o.charAt(0)&&(this[o]=i(this,this[o]));a(e,"mousedown",this._onTapStart),a(e,"touchstart",this._onTapStart),a(e,"dragover",this),a(e,"dragenter",this),V.push(this._onDragOver),t.store&&this.sort(t.store.get(this))}function t(e){b&&b.state!==e&&(l(b,"display",e?"none":""),
!e&&b.state&&w.insertBefore(b,v),b.state=e)}function i(e,t){var i=j.call(arguments,2);return t.bind?t.bind.apply(t,[e].concat(i)):function(){return t.apply(e,i.concat(j.call(arguments)))}}function n(e,t,i){if(e){i=i||L,t=t.split(".");var n=t.shift().toUpperCase(),s=new RegExp("\\s("+t.join("|")+")\\s","g");do if(">*"===n&&e.parentNode===i||(""===n||e.nodeName.toUpperCase()==n)&&(!t.length||((" "+e.className+" ").match(s)||[]).length==t.length))return e;while(e!==i&&(e=e.parentNode))}return null}function s(e){
e.dataTransfer.dropEffect="move",e.preventDefault()}function a(e,t,i){e.addEventListener(t,i,!1)}function r(e,t,i){e.removeEventListener(t,i,!1)}function o(e,t,i){if(e)if(e.classList)e.classList[i?"add":"remove"](t);else{var n=(" "+e.className+" ").replace(M," ").replace(" "+t+" "," ");e.className=(n+(i?" "+t:"")).replace(M," ")}}function l(e,t,i){var n=e&&e.style;if(n){if(void 0===i)return L.defaultView&&L.defaultView.getComputedStyle?i=L.defaultView.getComputedStyle(e,""):e.currentStyle&&(i=e.currentStyle),
void 0===t?i:i[t];t in n||(t="-webkit-"+t),n[t]=i+("string"==typeof i?"":"px")}}function c(e,t,i){if(e){var n=e.getElementsByTagName(t),s=0,a=n.length;if(i)for(;a>s;s++)i(n[s],s);return n}return[]}function u(e){e.draggable=!1}function d(){U=!1}function h(e,t){var i=e.lastElementChild,n=i.getBoundingClientRect();return t.clientY-(n.top+n.height)>5&&i}function p(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,i=t.length,n=0;i--;)n+=t.charCodeAt(i);return n.toString(36)}function f(e){for(var t=0;e&&(e=e.previousElementSibling);)"TEMPLATE"!==e.nodeName.toUpperCase()&&t++;
return t}function m(e,t){var i,n;return function(){void 0===i&&(i=arguments,n=this,setTimeout(function(){1===i.length?e.call(n,i[0]):e.apply(n,i),i=void 0},t))}}function g(e,t){if(e&&t)for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}var v,y,b,w,x,S,C,k,P,A,I,_,T,D,E={},M=/\s+/g,R="Sortable"+(new Date).getTime(),O=window,L=O.document,N=O.parseInt,F=!!("draggable"in L.createElement("div")),U=!1,z=function(e,t,i,n,s,a,r){var o=L.createEvent("Event"),l=(e||t[R]).options,c="on"+i.charAt(0).toUpperCase()+i.substr(1);
o.initEvent(i,!0,!0),o.item=n||t,o.from=s||t,o.clone=b,o.oldIndex=a,o.newIndex=r,l[c]&&l[c].call(e,o),t.dispatchEvent(o)},B=Math.abs,j=[].slice,V=[],H=m(function(e,t,i){if(i&&t.scroll){var n,s,a,r,o=t.scrollSensitivity,l=t.scrollSpeed,c=e.clientX,u=e.clientY,d=window.innerWidth,h=window.innerHeight;if(C!==i&&(S=t.scroll,C=i,S===!0)){S=i;do if(S.offsetWidth<S.scrollWidth||S.offsetHeight<S.scrollHeight)break;while(S=S.parentNode)}S&&(n=S,s=S.getBoundingClientRect(),a=(B(s.right-c)<=o)-(B(s.left-c)<=o),
r=(B(s.bottom-u)<=o)-(B(s.top-u)<=o)),a||r||(a=(o>=d-c)-(o>=c),r=(o>=h-u)-(o>=u),(a||r)&&(n=O)),(E.vx!==a||E.vy!==r||E.el!==n)&&(E.el=n,E.vx=a,E.vy=r,clearInterval(E.pid),n&&(E.pid=setInterval(function(){n===O?O.scrollTo(O.pageXOffset+a*l,O.pageYOffset+r*l):(r&&(n.scrollTop+=r*l),a&&(n.scrollLeft+=a*l))},24)))}},30);return e.prototype={constructor:e,_onTapStart:function(e){var t=this,i=this.el,s=this.options,a=e.type,r=e.touches&&e.touches[0],o=(r||e).target,l=o,c=s.filter;if(!("mousedown"===a&&0!==e.button||s.disabled)&&(o=n(o,s.draggable,i))){
if(A=f(o),"function"==typeof c){if(c.call(this,e,o,this))return z(t,l,"filter",o,i,A),void e.preventDefault()}else if(c&&(c=c.split(",").some(function(e){return e=n(l,e.trim(),i),e?(z(t,e,"filter",o,i,A),!0):void 0})))return void e.preventDefault();(!s.handle||n(l,s.handle,i))&&this._prepareDragStart(e,r,o)}},_prepareDragStart:function(e,t,i){var n,s=this,r=s.el,o=s.options,l=r.ownerDocument;i&&!v&&i.parentNode===r&&(T=e,w=r,v=i,x=v.nextSibling,_=o.group,n=function(){s._disableDelayedDrag(),v.draggable=!0,
o.ignore.split(",").forEach(function(e){c(v,e.trim(),u)}),s._triggerDragStart(t)},a(l,"mouseup",s._onDrop),a(l,"touchend",s._onDrop),a(l,"touchcancel",s._onDrop),o.delay?(a(l,"mousemove",s._disableDelayedDrag),a(l,"touchmove",s._disableDelayedDrag),s._dragStartTimer=setTimeout(n,o.delay)):n())},_disableDelayedDrag:function(){var e=this.el.ownerDocument;clearTimeout(this._dragStartTimer),r(e,"mousemove",this._disableDelayedDrag),r(e,"touchmove",this._disableDelayedDrag)},_triggerDragStart:function(e){
e?(T={target:v,clientX:e.clientX,clientY:e.clientY},this._onDragStart(T,"touch")):F?(a(v,"dragend",this),a(w,"dragstart",this._onDragStart)):this._onDragStart(T,!0);try{L.selection?L.selection.empty():window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(){w&&v&&(o(v,this.options.ghostClass,!0),e.active=this,z(this,w,"start",v,w,A))},_emulateDragOver:function(){if(D){l(y,"display","none");var e=L.elementFromPoint(D.clientX,D.clientY),t=e,i=" "+this.options.group.name,n=V.length;
if(t)do{if(t[R]&&t[R].options.groups.indexOf(i)>-1){for(;n--;)V[n]({clientX:D.clientX,clientY:D.clientY,target:e,rootEl:t});break}e=t}while(t=t.parentNode);l(y,"display","")}},_onTouchMove:function(e){if(T){var t=e.touches?e.touches[0]:e,i=t.clientX-T.clientX,n=t.clientY-T.clientY,s=e.touches?"translate3d("+i+"px,"+n+"px,0)":"translate("+i+"px,"+n+"px)";D=t,l(y,"webkitTransform",s),l(y,"mozTransform",s),l(y,"msTransform",s),l(y,"transform",s),e.preventDefault()}},_onDragStart:function(e,t){var i=e.dataTransfer,n=this.options;
if(this._offUpEvents(),"clone"==_.pull&&(b=v.cloneNode(!0),l(b,"display","none"),w.insertBefore(b,v)),t){var s,r=v.getBoundingClientRect(),o=l(v);y=v.cloneNode(!0),l(y,"top",r.top-N(o.marginTop,10)),l(y,"left",r.left-N(o.marginLeft,10)),l(y,"width",r.width),l(y,"height",r.height),l(y,"opacity","0.8"),l(y,"position","fixed"),l(y,"zIndex","100000"),w.appendChild(y),s=y.getBoundingClientRect(),l(y,"width",2*r.width-s.width),l(y,"height",2*r.height-s.height),"touch"===t?(a(L,"touchmove",this._onTouchMove),
a(L,"touchend",this._onDrop),a(L,"touchcancel",this._onDrop)):(a(L,"mousemove",this._onTouchMove),a(L,"mouseup",this._onDrop)),this._loopId=setInterval(this._emulateDragOver,150)}else i&&(i.effectAllowed="move",n.setData&&n.setData.call(this,i,v)),a(L,"drop",this);setTimeout(this._dragStarted,0)},_onDragOver:function(e){var i,s,a,r=this.el,o=this.options,c=o.group,u=c.put,p=_===c,f=o.sort;if(void 0!==e.preventDefault&&(e.preventDefault(),!o.dragoverBubble&&e.stopPropagation()),_&&!o.disabled&&(p?f||(a=!w.contains(v)):_.pull&&u&&(_.name===c.name||u.indexOf&&~u.indexOf(_.name)))&&(void 0===e.rootEl||e.rootEl===this.el)){
if(H(e,o,this.el),U)return;if(i=n(e.target,o.draggable,r),s=v.getBoundingClientRect(),a)return t(!0),void(b||x?w.insertBefore(v,b||x):f||w.appendChild(v));if(0===r.children.length||r.children[0]===y||r===e.target&&(i=h(r,e))){if(i){if(i.animated)return;g=i.getBoundingClientRect()}t(p),r.appendChild(v),this._animate(s,v),i&&this._animate(g,i)}else if(i&&!i.animated&&i!==v&&void 0!==i.parentNode[R]){k!==i&&(k=i,P=l(i));var m,g=i.getBoundingClientRect(),S=g.right-g.left,C=g.bottom-g.top,A=/left|right|inline/.test(P.cssFloat+P.display),I=i.offsetWidth>v.offsetWidth,T=i.offsetHeight>v.offsetHeight,D=(A?(e.clientX-g.left)/S:(e.clientY-g.top)/C)>.5,E=i.nextElementSibling;
U=!0,setTimeout(d,30),t(p),m=A?i.previousElementSibling===v&&!I||D&&I:E!==v&&!T||D&&T,m&&!E?r.appendChild(v):i.parentNode.insertBefore(v,m?E:i),this._animate(s,v),this._animate(g,i)}}},_animate:function(e,t){var i=this.options.animation;if(i){var n=t.getBoundingClientRect();l(t,"transition","none"),l(t,"transform","translate3d("+(e.left-n.left)+"px,"+(e.top-n.top)+"px,0)"),t.offsetWidth,l(t,"transition","all "+i+"ms"),l(t,"transform","translate3d(0,0,0)"),clearTimeout(t.animated),t.animated=setTimeout(function(){
l(t,"transition",""),l(t,"transform",""),t.animated=!1},i)}},_offUpEvents:function(){var e=this.el.ownerDocument;r(L,"touchmove",this._onTouchMove),r(e,"mouseup",this._onDrop),r(e,"touchend",this._onDrop),r(e,"touchcancel",this._onDrop)},_onDrop:function(t){var i=this.el,n=this.options;clearInterval(this._loopId),clearInterval(E.pid),clearTimeout(this.dragStartTimer),r(L,"drop",this),r(L,"mousemove",this._onTouchMove),r(i,"dragstart",this._onDragStart),this._offUpEvents(),t&&(t.preventDefault(),!n.dropBubble&&t.stopPropagation(),
y&&y.parentNode.removeChild(y),v&&(r(v,"dragend",this),u(v),o(v,this.options.ghostClass,!1),w!==v.parentNode?(I=f(v),z(null,v.parentNode,"sort",v,w,A,I),z(this,w,"sort",v,w,A,I),z(null,v.parentNode,"add",v,w,A,I),z(this,w,"remove",v,w,A,I)):(b&&b.parentNode.removeChild(b),v.nextSibling!==x&&(I=f(v),z(this,w,"update",v,w,A,I),z(this,w,"sort",v,w,A,I))),e.active&&z(this,w,"end",v,w,A,I)),w=v=y=x=b=S=C=T=D=k=P=_=e.active=null,this.save())},handleEvent:function(e){var t=e.type;"dragover"===t||"dragenter"===t?v&&(this._onDragOver(e),
s(e)):("drop"===t||"dragend"===t)&&this._onDrop(e)},toArray:function(){for(var e,t=[],i=this.el.children,s=0,a=i.length,r=this.options;a>s;s++)e=i[s],n(e,r.draggable,this.el)&&t.push(e.getAttribute(r.dataIdAttr)||p(e));return t},sort:function(e){var t={},i=this.el;this.toArray().forEach(function(e,s){var a=i.children[s];n(a,this.options.draggable,i)&&(t[e]=a)},this),e.forEach(function(e){t[e]&&(i.removeChild(t[e]),i.appendChild(t[e]))})},save:function(){var e=this.options.store;e&&e.set(this)},closest:function(e,t){
return n(e,t||this.options.draggable,this.el)},option:function(e,t){var i=this.options;return void 0===t?i[e]:void(i[e]=t)},destroy:function(){var e=this.el;e[R]=null,r(e,"mousedown",this._onTapStart),r(e,"touchstart",this._onTapStart),r(e,"dragover",this),r(e,"dragenter",this),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(e){e.removeAttribute("draggable")}),V.splice(V.indexOf(this._onDragOver),1),this._onDrop(),this.el=e=null}},e.utils={on:a,off:r,css:l,find:c,bind:i,is:function(e,t){
return!!n(e,t,e)},extend:g,throttle:m,closest:n,toggleClass:o,index:f},e.version="1.2.0",e.create=function(t,i){return new e(t,i)},e})},function(e,t,i){var n,s;n=[i(37)],s=function(e){"use strict";var t=new e({"interface":["getLanguages","load","t"]});return t}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(19),i(16),i(44),i(38),i(34)],s=function(e,t,i,n,s,a,r){"use strict";function o(t,i){return t?e.reduce(i,function(e,i,n){return t[n]!==i&&(e[n]=i),e},{}):i}function l(e,t){
var i;try{i=e._getStorageKey()}catch(s){i="no storageKey"}n.error("StorageModel ("+i+") "+t)}var c=i.Model.extend({save:function(t,n,s){var a,r=this.attributes;if(null==t||"object"==typeof t?(a=t,s=n):(a={})[t]=n,s=e.extend({validate:!0},s),a&&!s.wait){if(!this.set(a,s))return!1}else if(!this._validate(a,s))return!1;a&&s.wait&&(this.attributes=e.extend({},r,a)),void 0===s.parse&&(s.parse=!0);var l=this,c=s.success;s.success=function(){l.attributes=r,c&&c(l,r,s),l.trigger("sync",l,r,s)},i.wrapError(this,s);
var u=this._getStorage(),d=this._getStorageKey(),h=this.attributes;u.getInstance().persistDefaults||(h=o(e.result(this,"defaults"),h));var p=this.serialize(h),f=u.set(d,p);return f.done(s.success).fail(s.error),a&&s.wait&&(this.attributes=r),f},populate:function(){return this.populatePromise||(this.populatePromise=this.fetch.apply(this,arguments)),this.populatePromise},fetch:function(t){t=t?e.clone(t):{},void 0===t.parse&&(t.parse=!0);var n=this,s=t.success;t.success=function(e){return n.set(n.parse(e,t),t)?(s&&s(n,e,t),
void n.trigger("sync",n,e,t)):!1},i.wrapError(this,t);var a=this._getStorage().get(this._getStorageKey());return a.done(t.success).fail(t.error),this.populatePromise=a,a},destroy:function u(t){t=t?e.clone(t):{};var n=this,s=t.success,u=function(){n.trigger("destroy",n,n.collection,t)};t.success=function(e){t.wait&&u(),s&&s(n,e,t),n.trigger("sync",n,e,t)},i.wrapError(this,t);var a=this._getStorage().remove(this._getStorageKey());return a.done(t.success).fail(t.error),t.wait||u(),a},serialize:function(e){
var t="";try{t=JSON.stringify(e)}catch(i){l(this,"serialization error: "+i.message)}return t},parse:function(t){var i;if(null==t)return i;if(e.isObject(t))return t;try{i=JSON.parse(t)}catch(n){var s=e.isString(t)?t.substring(0,50):"no response";l(this,"parse error: "+n.message+" ("+s+")")}return i},sync:function(){throw new Error("storage model doesn`t allow syncing to server")},startCapturingChangeEvents:function(){if(this.releaseCapturedChangeEvents)return void a(!1,"This model is already capturing events");
var t=this.set,i={};this.set=function(n,s,a){var r;"object"==typeof n?(r=n,a=s):(r={})[n]=s;var o=e.extend({},a,{silent:!0}),l=t.call(this,r,o);return e.extend(i,this.changed),l},this.releaseCapturedChangeEvents=function(){e.each(i,function(e,t){this.trigger("change:"+t,this,e)},this),e.isEmpty(i)||this.trigger("change",this,{}),i={},this.set=t,this.releaseCapturedChangeEvents=null}},_getStorageKey:function(){var t=e.result(this,"storageKey");if(!t)throw new Error("storageKey is required");return t;
},_getStorage:function(){return s}});return c}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(20)],s=function(e,t){"use strict";var i=t.extend({initialize:function(){this._entries=[]},wrapAll:function(t,i,n){e.each(t,function(e){this.wrap(e,i,n)},this)},wrap:function(t,i,n){n[t]=e.wrap(n[t],e.bind(function(t){var s=e.toArray(arguments).slice(1);return i.call(n)?t.apply(n,s):void this.add({fn:t,args:s,context:n})},this))},add:function(e){this._entries.push(e)},process:function(){
e.each(this._entries,function(e){var t=e.context||this;e.fn.apply(t,e.args)},this),this.clear()},clear:function(){this._entries.length=0}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n;n=function(){"use strict";var e={NEVER:"never",SAME_NETWORK:"samenetwork",ALWAYS:"always"};return e.settings=[{value:e.NEVER,title:"Never"},{value:e.SAME_NETWORK,title:"On same network as server"},{value:e.ALWAYS,title:"Always"}],e}.call(t,i,t,e),!(void 0!==n&&(e.exports=n))},function(e,t,i){
var n;n=function(){"use strict";var e={AUTO:"auto",AVOID:"avoid",ALWAYS:"always",NEVER:"never"};return e.settings=[{value:e.AUTO,title:"Automatic"},{value:e.AVOID,title:"Only image formats"},{value:e.ALWAYS,title:"Always"}],e}.call(t,i,t,e),!(void 0!==n&&(e.exports=n))},function(e,t,i){var n;n=function(){"use strict";var e={CREATED:0,PROGRESS:1,MATCHING:2,DOWNLOADING_METADATA:3,LOADING_METADATA:4,PROCESSED:5,ANALYZING:6,DELETED:9};return e}.call(t,i,t,e),!(void 0!==n&&(e.exports=n))},function(e,t,i){
"use strict";function n(e){var t=arguments.length<=1||void 0===arguments[1]?"MMMM D, YYYY":arguments[1];return e?(0,r.default)(e).format(t):""}var s=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var a=i(12),r=s(a);t.default=n,e.exports=t.default},function(e,t,i){var n,s;n=[i(2),i(300),i(16)],s=function(e,t,i){"use strict";var n=new t(!1,"",!0),s=["Directory","Video","Track","Photo","Playlist","Hub"],a={parseType:function(e,t,i){var n=this.getByType("parse",e,this._parseTypeMap);return n?n(t,i):t;
},stringifyType:function(t,i,n){if(e.isString(i))return i;if(null==i)return"";var s=this.getByType("stringify",t,this._stringifyTypeMap);return s?s(i,n):i},getByType:function(t,i,n){if(n&&e.has(n,i))return n[i];var s=i.charAt(0).toUpperCase()+i.slice(1),a=t+s;return e.has(this,a)?(n[i]=this[a],this[a]):void 0},parseBoolean:function(e){return 1===Number(e)||"true"===e},stringifyBoolean:function(e){return e?"1":"0"},parseInteger:function(e){return null==e||""===e?0:parseInt(e,10)},parseFloat:function(e){
function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e){return null==e||""===e?0:parseFloat(e)}),parseString:function(e){return null==e?"":e.toString()},parseEncodedString:function(e){if(null==e)return"";try{return decodeURIComponent(e)}catch(t){return i.warn("[Parser] Unable to parse encoded string"),e}},parseArray:function(t){return t?e.isArray(t)?t:[t]:[]},parseList:function(t){return t?e.isArray(t)?t:t.split(","):[]},stringifyList:function(e){
return e.join(",")},parseQueryString:function(t,n){if(n||(n={}),e.isObject(t))return t;if(!e.isString(t))return{};if(t=t.trim().replace(/^(\?|#)/,""),!t)return{};var s=n.separator||"&";return e.reduce(t.split(s),function(e,t){var n=t.split("="),s=n[0],a=n[1];try{s=decodeURIComponent(s),a=void 0===a?null:decodeURIComponent(a),e.hasOwnProperty(s)?Array.isArray(e[s])?e[s].push(a):e[s]=[e[s],a]:e[s]=a}catch(r){i.warn("[Parser] Unable to decode query string at "+s)}return e},{})},stringifyQueryString:function(t,i){
i||(i={});var n=i.separator||"&",s=e.map(e.keys(t),function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])});return s.join(n)},parseJSON:function(t){try{return JSON.parse(t)}catch(n){var s=e.isString(t)?t.substring(0,50):"no response";return i.warn("[Parser] Unable to parse JSON: "+n.message+" ("+s+")"),{}}},parseXML:function(e){var t=n.parseXmlString(e);return t?(t.getElementsByTagName("parsererror").length&&i.warn("parseXML: Errors found while parsing XML document"),n.xml2json(t)):null;
},replaceXMLElementNames:function(t,i,n){e.isArray(i)||(i=[i]);var s=i.join("|"),a=new RegExp("<("+s+")","g"),r=new RegExp("</("+s+")>","g");return t=t.replace(a,"<"+n+' elementName="$1"'),t=t.replace(r,"</"+n+">")},replaceMetadataXMLElementNames:function(e){return this.replaceXMLElementNames(e,s,"Metadata")},reset:function(){this._parseTypeMap={json:this.parseJSON,xml:this.parseXML},this._stringifyTypeMap={}}};return a.reset(),a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n;n=function(){
"use strict";var e="placeholder-standard",t="placeholder-square",i="placeholder-widescreen",n="placeholder-folder",s="placeholder-friend",a={movie:e,show:e,season:e,episode:i,artist:t,album:t,track:t,photo:t,photoAlbum:t,clip:i,userPlaylistItem:i,playlist:t,playlistFolder:t,channel:t,channelDirectory:t,folder:n,friend:s,device:t,poster:e,art:i,banner:i};return a}.call(t,i,t,e),!(void 0!==n&&(e.exports=n))},function(e,t,i){var n;n=function(){"use strict";var e={sizes:{movie:"portrait",show:"portrait",
season:"portrait",episode:"landscape",artist:"square",album:"square",track:"square",photo:"square",photoAlbum:"square",clip:"landscape",playlist:"square",playlistFolder:"square",userPlaylistItem:"landscape",channel:"square",channelDirectory:"square",folder:"portrait",friend:"square",poster:"portrait",art:"landscape",banner:"banner"},ratios:{portrait:1/1.5,square:1,landscape:16/9,banner:5.2},getRatioByType:function(e){return this.ratios[this.sizes[e]]},getPosterWidthUsingRatio:function(e,t){return Math.round(this.ratios[e]*t);
},getPosterHeightUsingRatio:function(e,t){return Math.round(this.ratios[e]&t)},getPosterWidth:function(e,t){return Math.round(t*this.getRatioByType(e))},getPosterHeight:function(e,t){return Math.round(t/this.getRatioByType(e))}};return e}.call(t,i,t,e),!(void 0!==n&&(e.exports=n))},function(e,t){"use strict";function i(e,t,i){return null==i&&(i=e+"s"),1===t?e:i}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i,e.exports=t.default},function(e,t,i){"use strict";function n(e){var t=o.default.clone(e);
return t.title=o.default.result(t,"title"),t.hasOwnProperty("plural")&&(t.plural=o.default.result(t,"plural")),t}function s(e,t){function i(e){for(var t in a){var i=a[t],s=i[e];if(s)return n(s)}c.default.warn("No type was found for "+e)}function s(){return t.map(function(e){return n(e)})}var a={};return e.forEach(function(e){a[e]=t.reduceRight(function(t,i){var n=i[e];return null!=n&&(t[n]=i),t},{})}),{get:i,getAll:s}}var a=i(8).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;
var r=i(2),o=a(r),l=i(16),c=a(l);e.exports=t.default},function(e,t,i){var n,s;n=[i(29),i(656)],s=function(e,t){"use strict";var i=e.extend({model:t,url:"/status/sessions/background",parse:function(e){return this.convert(e,"TranscodeJob")}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(15),i(24),i(659)],s=function(e,t,i,n,s){"use strict";var a=n.extend({whitelistedAttrs:["id","type","title","composite","target","targetTagID","locationID","Status","MediaSettings","Policy","Location","Device"],
saveAttrs:["type","title","target","targetTagID","locationID","MediaSettings","Policy","Location","Device"],defaultCounts:{video:5,audio:50,photo:50},warningCounts:{video:10,audio:100,photo:100},defaults:function(){return{type:42,locationID:-1,Status:{},MediaSettings:{},Policy:{},Location:{},Device:{},metadataItems:new s([],{parent:this,server:this.server})}},urlRoot:function(){var e=this.playlistID||this.parent.id;return"/playlists/"+e+"/items"},cacheKey:function(e){return this.server&&this.server.getScopedKey(e.id);
},isDirectory:function(){var e=this.get("Location");return e.uri?/(playlist\:\/\/|library\:\/\/([\w-]+)\/directory\/)/.test(e.uri):void 0},initialize:function(e,t){this.playlistID=t.playlistID},convert:function(t){var n=e.isObject(t)?t:i.parseXML(t);return n.Item&&(n=n.Item),i.parseInteger(n,["id","version","targetTagID","locationID"]),n.Status&&i.parseInteger(n.Status,["itemsCount","itemsCompleteCount","itemsSuccessfulCount","itemsFailedCount","itemsDisabledCount","totalSize"]),n.Policy&&(i.parseInteger(n.Policy,"value"),
i.parseBoolean(n.Policy,"unwatched")),n.MediaSettings&&i.parseInteger(n.MediaSettings,["maxVideoBitrate","videoQuality"]),n},parse:function(t){var i=this.convert(t);return i=e.pick(i,this.whitelistedAttrs)},cloneDeep:function(){var e=this.toJSON(),i={server:this.server,section:this.section,channel:this.channel,device:this.device,parent:this.parent,skipCache:!0};return new this.constructor(t.extend(!0,{},e),i)||null},getSaveParams:function(t,i){if(e.isEmpty(t)){var s=this.pick(this.saveAttrs),a=s.Policy;
return e.isBoolean(a.unwatched)&&(a.unwatched=a.unwatched?1:0),s.targetTagID&&(delete s.MediaSettings,delete s.Device),{Item:s}}return n.prototype.getSaveParams.apply(this,arguments)},setPolicyDefaultsFor:function(t){var i={scope:this.isDirectory()?"count":"all",unwatched:!1};return"count"===i.scope&&(i.value=this.defaultCounts[t]),e.defaults(this.get("Policy"),i),this},shouldShowPolicyWarning:function(e,t){var i=this.get("Policy").scope;return"count"===i?t>this.warningCounts[e]:"all"===i?this.isDirectory():!1;
}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(222),i(27),i(663)],s=function(e,t,i,n){"use strict";var s=i.extend({name:"AgentCollection",context:["server","mediaTypeID","primaryAgentID","relatedAgentID"],model:n,cache:new t,cacheKey:function(){var t=e.result(this,"url");return this.server&&this.server.getScopedKey(t)},url:function(){var e="/system/agents";return this.primaryAgentID?e+"/contributors?mediaType="+this.mediaTypeID+"&primaryAgent="+this.primaryAgentID:this.relatedAgentID?e+"/"+this.relatedAgentID+"/config/"+this.mediaTypeID:this.mediaTypeID?e+"?mediaType="+this.mediaTypeID:e;
},hasExclusiveAgent:function(t){return!!e.intersection(this.pluck("identifier"),t).length}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1058),i(2),i(4),i(6),i(7),i(5),i(14),i(25),i(11),i(35),i(50),i(284),i(106),i(132),i(130),i(131),i(133)],s=function(e,t,i,n,s,a,r,o,l,c,u,d,h,p,f,m,g){"use strict";var v=n.ItemView.extend({tagName:"ul",className:"dropdown-menu",template:e,ui:{divider:".divider"},events:{"click .play-version-btn":"onPlayVersionClick","click .play-all-btn":"onPlayAllClick",
"click .play-shuffled-btn":"onPlayShuffledClick","click .play-next-btn":"onPlayNextClick","click .add-to-up-next-btn":"onAddToUpNextClick","click .play-mix-btn":"onPlayMixClick","click .play-primary-extra-btn":"onPlayPrimaryExtraClick","click .add-to-playlist-btn":"onAddToPlaylistClick","click .refresh-btn":"onRefreshClick","click .sync-btn":"onSyncClick","click .convert-btn":"onConvertClick","click .mark-watched-btn":"onMarkWatchedClick","click .mark-unwatched-btn":"onMarkUnwatchedClick","click .watch-later-btn":"onWatchLaterClick",
"click .share-btn":"onShareClick","click .recommend-btn":"onRecommendClick","click .delete-btn":"onDeleteClick","click .info-btn":"onInfoClick"},initialize:function(e){this.mediaType=o.get(this.model.get("type")),this.mediaActions=new u({},{item:this.model}),i(".dropdown.open .dropdown-toggle").dropdown("toggle")},serializeData:function(){var e,t;if(this.mediaActions.get("showDownload")){e=this.model.getDownloadUrl();var i=this.model.getFilepath();i&&(t=r.getLastSegment(i))}return{downloadUrl:e,downloadName:t
}},getPosition:function(e,t,i){var n=e.position().left;return e.offset().top+this.$el.outerHeight()>t.offset.top+t.outerHeight&&(i-=this.$el.height()-e.height()),e.offset().left+this.$el.outerWidth()>t.offset.left+t.width&&(n-=this.$el.width()-e.outerWidth()),{top:i,left:n}},bindingsModel:"mediaActions",bindings:{".play-version-btn":{modelAttribute:"showPlayVersion",manual:!0,autohide:!0},".play-all-btn":{modelAttribute:"showPlayAll",manual:!0,autohide:!0},".play-shuffled-btn":{modelAttribute:"showShuffle",
manual:!0,autohide:!0},".play-next-btn, .add-to-up-next-btn":{modelAttribute:"showQueue",modelListeners:["showQueue","canQueue"],manual:!0,autohide:!0,formatter:function(e,t){return t.toggleClass("disabled",!this.mediaActions.get("canQueue")),e}},".play-mix-btn":{modelAttribute:"showPlayMix",manual:!0,autohide:!0,formatter:function(e,t){if(e){var i=this.model.get("related"),n=i.findWhere({browse:!1}),a=n.get("title");a&&t.text(s("Play {1}",a))}return e}},".play-trailer-btn":{modelAttribute:"showPlayTrailer",
manual:!0,autohide:!0},".play-music-video-btn":{modelAttribute:"showPlayMusicVideo",manual:!0,autohide:!0},".add-to-playlist-btn":{modelAttribute:"showAddToPlaylist",manual:!0,autohide:!0},".refresh-btn":{modelAttribute:"showRefresh",manual:!0,autohide:!0},".mark-watched-btn":{modelAttribute:"showMarkWatched",manual:!0,autohide:!0},".mark-unwatched-btn":{modelAttribute:"showMarkUnwatched",manual:!0,autohide:!0},".sync-btn":{modelAttribute:"showSync",manual:!0,autohide:!0},".convert-btn":{modelAttribute:"showConvert",
manual:!0,autohide:!0},".download-btn":{modelAttribute:"showDownload",manual:!0,autohide:!0},".watch-later-btn":{modelAttribute:"showWatchLater",manual:!0,autohide:!0},".share-btn, .recommend-btn":{modelAttribute:"showShare",manual:!0,autohide:!0},".delete-btn":{modelAttribute:"showDelete",manual:!0,autohide:!0},".info-btn":{modelAttribute:"showInfo",manual:!0,autohide:!0}},onRender:function(){var e=this.ui.divider,t=e.prevAll(":not(:has(.hidden))").length,i=e.nextAll(":not(:has(.hidden))").length;
e.toggleClass("hidden",!t||!i)},onClose:function(){this.mediaActions.stopListening()},onPlayVersionClick:function(e){e.preventDefault(),a.trigger("show:modal",new d({model:this.model}))},onPlayAllClick:function(e){e.preventDefault(),l.execute("playMedia",{item:this.model})},onPlayShuffledClick:function(e){e.preventDefault(),l.execute("playMedia",{item:this.model,shuffle:!0})},onPlayPrimaryExtraClick:function(e){e.preventDefault();var i=this.model.server.getSectionForItem(this.model);if(!t.isEmpty(i)){
var n=new c({key:this.model.get("primaryExtraKey"),type:"clip",librarySectionUUID:i.get("uuid")},{server:this.model.server,section:this.model.section});l.execute("playMedia",{item:n})}},onPlayNextClick:function(e){return e.preventDefault(),i(e.currentTarget).isDisabled()?void e.stopImmediatePropagation():void l.execute("queueMedia",{item:this.model,next:!0})},onAddToUpNextClick:function(e){return e.preventDefault(),i(e.currentTarget).isDisabled()?void e.stopImmediatePropagation():void l.execute("queueMedia",{
item:this.model,next:!1})},onPlayMixClick:function(e){e.preventDefault();var t=this.model.get("related"),i=t.findWhere({browse:!1});i.set("type","track"),l.execute("playMedia",{item:i})},onAddToPlaylistClick:function(e){return e.preventDefault(),i(e.currentTarget).isDisabled()?void e.stopImmediatePropagation():void a.trigger("show:modal",new h({model:this.model,items:this.mediaActions.getActionTargets(),title:this.mediaActions.getActionTargetsTitle()}))},onRefreshClick:function(e){e.preventDefault(),
l.execute("refreshMetadata",{items:this.mediaActions.getActionTargets()})},onMarkWatchedClick:function(e){e.preventDefault(),l.execute("markWatched",{item:this.model})},onMarkUnwatchedClick:function(e){e.preventDefault(),l.execute("markUnwatched",{item:this.model})},onSyncClick:function(e){e.preventDefault(),l.execute("showSyncModal",{item:this.model})},onConvertClick:function(e){e.preventDefault(),a.trigger("show:modal",new g({item:this.model}))},onWatchLaterClick:function(e){e.preventDefault(),
l.execute("watchLater",{item:this.model})},onShareClick:function(e){e.preventDefault(),a.trigger("show:modal",new p({model:this.model}))},onRecommendClick:function(e){e.preventDefault(),a.trigger("show:modal",new m({model:this.model}))},onDeleteClick:function(e){e.preventDefault(),this.model.get("playlistType")?l.execute("deletePlaylist",{item:this.model}):l.execute("deleteItems",{item:this.model,skipRedirect:!0})},onInfoClick:function(e){e.preventDefault(),a.trigger("show:modal",new f({model:this.model
}))}});return v}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1066),i(2),i(4),i(6),i(9)],s=function(e,t,i,n,s){"use strict";var a=n.ItemView.extend({id:"primary-server-dropdown",tagName:"span",className:"dropdown",template:e,collectionEvents:{"change:friendlyName":"render","change:authorized":"onServerAuthorizedChange"},events:{"click .dropdown-menu a":"onServerClick"},initialize:function(e){e||(e={}),this.showSharedServers=e.showSharedServers,this.model=s.get("primaryServer"),
this.collection=s.get("servers"),this.listenTo(s,"change:primaryServer",this.render)},serializeData:function(){var e=this.collection.reduce(function(e,t){var i=t.get("shared"),n=t.get("sections");if(i&&!(this.showSharedServers&&n&&n.findWhere({allowSync:!0})))return e;var s=t.toJSON();return!s.authorized||s.cloud||s.synced||e.push(s),e},[],this);return{showDropdown:e.length>1,servers:e,currentServer:this.model?this.model.toJSON():null}},onServerAuthorizedChange:function(e,t){t&&this.render()},onServerClick:function(e){
e.preventDefault();var t=i(e.currentTarget).data("id"),n=this.collection.get(t);n&&s.set("primaryServer",n)}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(6),i(14),i(60),i(102),i(667),i(259),i(664),i(65)],s=function(e,t,i,n,s,a,r,o,l,c){"use strict";var u=i.Layout.extend({ui:{formGroup:".form-group"},onlyAfterRender:["showValidationResult"],serializeData:function(){var e={};return this.model.isNew()?e.add=!0:e.edit=!0,e.section=this.model.toJSON(),e},
showValidationResult:function(t){var i=this.ui.formGroup;i.removeClass("has-error"),e.each(t,function(e){i.filter("."+e+"-group").addClass("has-error")}),this.trigger(t.length?"invalid":"valid")},createMenuOptions:function(t,i){return e.map(t,function(e){return'<option value="'+e.value+'"'+(e.value===i?" selected":"")+">"+e.label+"</option>"}).join("\n")},getSectionType:function(){if(this.model.sectionType)return this.model.sectionType;var e=this.model.get("type"),t=s.get(e);return"movie"===e&&"com.plexapp.agents.none"===this.model.get("agent")&&(t=s.get("videos")),
this.model.sectionType=t,t},setSectionType:function(e){this.model.sectionType=e},populateAgents:function(){var e=this.getSectionType();return e?(this.model.agents||(this.model.agents=new a([],{server:this.model.server,mediaTypeID:e.typeID})),this.model.agents.populate().then(function(e){return e})):t.Deferred().reject().promise()},populateScanners:function(){var e=this.getSectionType();return e?(this.model.scanners||(this.model.scanners=new r([],{server:this.model.server,sectionTypeID:e.typeID})),
this.model.scanners.populate().then(function(e){return e})):t.Deferred().reject().promise()},populateAgentsProxy:function(){var e=this.getSectionType().exclusiveAgents,i=new o(this.model.agents,e,this.model.get("agent"));return this.model.agentsProxy=i,t.Deferred().resolve(i).promise()},populateScannersProxy:function(){var e=this.getSectionType().exclusiveScanners,i=new l(this.model.scanners,e,this.model.get("scanner"));return this.model.scannersProxy=i,t.Deferred().resolve(i).promise()},populateSectionSettings:function(){
if(!this.model.server.supports("sectionSettings"))return t.Deferred().resolve().promise();if(!this.model.settings){var e=new c([],{server:this.model.server});if(this.model.isNew()){var i={type:this.getSectionType().typeID,agent:this.model.get("agent")};e.url=n.join(["/library/sections/prefs"],i)}else e.url=n.join(["/library/sections/",this.model.id,"/prefs"]);this.model.settings=e}var s=this.model.settings.populate();return s},populateSectionAgentSettings:function(){if(!this.model.agentSettings){
var e=new c([],{server:this.model.server,url:n.join(["/:/plugins/",this.model.get("agent"),"/prefs"])});this.model.agentSettings=e}var t=this.model.agentSettings.populate();return t},onModalClose:function(){this.model.scanners=null,this.model.scannersProxy=null,this.model.agents=null,this.model.agentsProxy=null,this.model.settings=null}});return u}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1153),i(2),i(4),i(19),i(7),i(5),i(25),i(200),i(118),i(819),i(64)],s=function(e,t,i,n,s,a,r,o,l,c,u){
"use strict";var d=u.extend({name:"addToPlaylistModal",className:"add-to-playlist-modal select-modal modal modal-sm fade",template:e,ui:{addBtn:".add-btn",newPlaylist:".message"},regions:{list:".playlists-container"},events:t.extend({"click .playlist":"onPlaylistClick","keyup .message":"onNewPlaylistKeyUp","click .message":"onNewPlaylistClick","click .add-btn":"onAddClick"},u.prototype.events),initialize:function(e){u.prototype.initialize.apply(this,arguments),this.items=e.items,this.title=e.title,
(!this.items||1===this.items.length&&this.items[0]===this.model)&&(this.ignoreTargets=!0),this.model.get("playQueueID")?this.leafType=this.model.get("mediaType"):this.leafType=r.getChildMediaType(this.model.get("type")).element,this.smart=this.model.get("isSection")&&this.ignoreTargets,this.playlists=new o([],{filterOptions:new n.Model({currentType:this.leafType,onlyDumb:!0}),server:this.model.server,allowInCache:!0}),this.loading=!0,this.playlists.populate().always(this.whenRendered(this.onPopulated));
},serializeData:function(){return{loading:this.loading,showExisting:!this.smart,hasPlaylists:this.playlists.length>0}},toggleAddButton:function(){var e=this.ui.newPlaylist.val().trim();this.ui.addBtn.toggleClass("disabled",!e)},suggestTitleIfEmpty:function(){""===this.ui.newPlaylist.val()&&(this.ui.newPlaylist.val(this.title),this.ui.newPlaylist.select(),this.toggleAddButton())},_addToPlaylist:function(e){this.ui.addBtn.addClass("active");var i,n=this.model.server;this.ignoreTargets||(i=n.supports("playItemsBatchAdd")?this.items:t.first(this.items));
var r=e.addContent(this.model,{items:i});return r.done(this.whenRendered(this.hide)),r.fail(this.whenRendered(function(){this.ui.addBtn.removeClass("active"),a.trigger("show:alert",{type:"error",message:s("There was a problem adding to the playlist.")})})),r},_createPlaylist:function(){var e=this.ui.newPlaylist.val().trim();if(e){var i=new l({title:e,playlistType:this.leafType,smart:this.smart},{server:this.model.server}),n=this._addToPlaylist(i);n.then(t.bind(function(){a.trigger("navigate","playlist",{
serverID:i.server.id,key:i.get("ratingKey")}),this.playlists.clear()},this))}},onRender:function(){u.prototype.onRender.apply(this,arguments),this.smart&&setTimeout(this.whenRendered(function(){this.ui.newPlaylist.focus(),this.suggestTitleIfEmpty()}),this.focusDelay)},onPopulated:function(){this.loading=!1,this.render(),this.list.show(new c({collection:this.playlists}))},onNewPlaylistKeyUp:function(e){this.toggleAddButton(),13===e.keyCode&&this._createPlaylist()},onNewPlaylistClick:function(){this.suggestTitleIfEmpty();
},onPlaylistClick:function(e){e.preventDefault();var t=i(e.currentTarget),n=t.data("id"),s=this.playlists.get(n);this._addToPlaylist(s)},onAddClick:function(e){e.preventDefault(),this.ui.addBtn.isDisabled()||this._createPlaylist()}});return d}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1204),i(2),i(4),i(9),i(39),i(31),i(897),i(895),i(894)],s=function(e,t,i,n,s,a,r,o,l){"use strict";var c=a.extend({name:"userSelectModal",className:"user-select-modal modal modal-transparent fade",
template:e,transparent:!0,panes:{users:r,pin:o},regions:{content:".modal-content",alertBar:".modal-alert"},initialize:function(e){a.prototype.initialize.apply(this,arguments),this.options=e,this.isForced=e.isForced,this.user=n.get("user"),this.promise=i.Deferred()},showPane:function(e,i){this.currentPane&&this.stopListening(this.currentPane);var n=this.panes[e],s=new n(t.extend({},this.options,i));return this.listenTo(s,{"change:pane":this.onChangePane,resolve:this.onResolve,reject:this.onReject}),
this.currentPane=s,this.content.show(s),s},showAlertBar:function(){var e=s.get("alerts");s.set("alerts",null);var i=new l({alert:t.first(e)});this.alertBar.show(i)},onRender:function(){a.prototype.onRender.apply(this,arguments),this.model?this.showPane("pin",{focusDelay:this.focusDelay}):this.showPane("users"),this.showAlertBar()},onHide:function(e){a.prototype.onHide.apply(this,arguments),"pending"===this.promise.state()&&this.promise.reject()},onChangePane:function(e,t){this.showPane(e,t)},onResolve:function(e){
this.promise.resolve(e),this.hide()},onReject:function(){this.promise.reject(),this.hide()}});return c}.apply(t,n),!(void 0!==s&&(e.exports=s))},,,function(e,t,i){!function(t,n){e.exports=n(i(2),i(19))}(this,function(e,t){function i(i){return{underscore:e,backbone:t}[i]}var n=function(e){function t(e){var i=t.cache[e];if(!i){var n={};i=t.cache[e]={id:e,exports:n},t.modules[e].call(n,i,n)}return i.exports}return t.cache=[],t.modules=[function(e,n){function s(e,t){this._superset=e,this._filtered=new o(e,t),
this._sorted=new l(this._filtered,t),this._paginated=new c(this._sorted,t),u(this._paginated,this),d.call(this,this._filtered,f),d.call(this,this._sorted,g),d.call(this,this._paginated,y),this.initialize(t)}var a=i("underscore"),r=i("backbone"),o=t(2),l=t(5),c=t(4),u=t(1),d=t(7),h={superset:function(){return this._superset},getFilteredLength:function(){return this._filtered.length},removeTransforms:function(){return this._filtered.resetFilters(),this._sorted.removeSort(),this._paginated.removePagination(),
this},destroy:function(){this.stopListening(),this._filtered.destroy(),this._sorted.destroy(),this._paginated.destroy(),this.length=0,this.trigger("obscura:destroy")}},p=["filterBy","removeFilter","resetFilters","refilter","hasFilter","getFilters"],f=["filtered:add","filtered:remove","filtered:reset"],m=["setSort","reverseSort","removeSort"],g=["sorted:add","sorted:remove"],v=["setPerPage","setPage","getPerPage","getNumPages","getPage","hasNextPage","hasPrevPage","nextPage","prevPage","movePage","removePagination","firstPage","lastPage"],y=["paginated:change:perPage","paginated:change:page","paginated:change:numPages"],b=["add","create","remove","set","reset","sort","parse","sync","fetch","push","pop","shift","unshift"];
a.each(p,function(e){h[e]=function(){var t=o.prototype[e].apply(this._filtered,arguments);return t===this._filtered?this:t}}),a.each(v,function(e){h[e]=function(){var t=c.prototype[e].apply(this._paginated,arguments);return t===this._paginated?this:t}}),a.each(m,function(e){h[e]=function(){var t=l.prototype[e].apply(this._sorted,arguments);return t===this._sorted?this:t}}),a.each(b,function(e){h[e]=function(){throw new Error("Backbone.Obscura: Unsupported method: "+e+"called on read-only proxy")};
}),a.extend(s.prototype,h,r.Events),s=r.Collection.extend(s.prototype),s.FilteredCollection=o,s.SortedCollection=l,s.PaginatedCollection=c,e.exports=s},function(e,t){function n(e,t){function i(){t.length=e.length}function n(i){var n=s.toArray(arguments),a="change"===i||"change:"===i.slice(0,7);"reset"===i&&(t.models=e.models),s.contains(o,i)?(s.contains(["add","remove","destroy"],i)?n[2]=t:s.contains(["reset","sort"],i)&&(n[1]=t),t.trigger.apply(this,n)):a&&t.contains(n[1])&&t.trigger.apply(this,n);
}var l={};return s.each(s.functions(a.Collection.prototype),function(t){s.contains(r,t)||(l[t]=function(){return e[t].apply(e,arguments)})}),s.extend(t,a.Events,l),t.listenTo(e,"all",i),t.listenTo(e,"all",n),t.models=e.models,i(),t}var s=i("underscore"),a=i("backbone"),r=["_onModelEvent","_prepareModel","_removeReference","_reset","add","initialize","sync","remove","reset","set","push","pop","unshift","shift","sort","parse","fetch","create","model","off","on","listenTo","listenToOnce","bind","trigger","once","stopListening"],o=["add","remove","reset","sort","destroy","sync","request","error"];
e.exports=n},function(e,n){function s(){this._filterResultCache={}}function a(e){for(var t in this._filterResultCache)this._filterResultCache.hasOwnProperty(t)&&delete this._filterResultCache[t][e]}function r(e,t){this._filters[e]&&a.call(this,e),this._filters[e]=t,this.trigger("filtered:add",e)}function o(e){delete this._filters[e],a.call(this,e),this.trigger("filtered:remove",e)}function l(e){this._filterResultCache[e.cid]||(this._filterResultCache[e.cid]={});var t=this._filterResultCache[e.cid];
for(var i in this._filters)if(this._filters.hasOwnProperty(i)&&(t.hasOwnProperty(i)||(t[i]=this._filters[i].fn(e)),!t[i]))return!1;return!0}function c(e){e||(e={});var t=[];this._superset&&(t=this._superset.filter(v.bind(l,this))),e.reset?this._collection.reset(t):this._collection.set(t),this.length=this._collection.length}function u(){c.call(this,{reset:!0})}function d(){var e=!(!this._superset||!this._superset.comparator);c.call(this,{reset:e})}function h(e){if(this._filterResultCache[e.cid]={},
l.call(this,e)){if(!this._collection.get(e.cid)){for(var t=this.superset().indexOf(e),i=null,n=t-1;n>=0;n-=1)if(this.contains(this.superset().at(n))){i=this.indexOf(this.superset().at(n))+1;break}i=i||0,this._collection.add(e,{at:i})}}else this._collection.get(e.cid)&&this._collection.remove(e);this.length=this._collection.length}function p(e){this._filterResultCache[e.cid]={},l.call(this,e)||this._collection.get(e.cid)&&this._collection.remove(e)}function f(e,t,i){"change:"===e.slice(0,7)&&p.call(this,arguments[1]);
}function m(e){this.contains(e)&&this._collection.remove(e),this.length=this._collection.length}function g(e){this._superset=e,this._collection=new y.Collection(e.toArray()),b(this._collection,this),this.resetFilters(),this.listenTo(this._superset,"reset",u),this.listenTo(this._superset,"sort",d),this.listenTo(this._superset,"add change",h),this.listenTo(this._superset,"remove",m),this.listenTo(this._superset,"all",f)}var v=i("underscore"),y=i("backbone"),b=t(1),w=t(3),x={defaultFilterName:"__default",
filterBy:function(e,t){return t||(t=e,e=this.defaultFilterName),r.call(this,e,w(t)),c.call(this),this},removeFilter:function(e){return e||(e=this.defaultFilterName),o.call(this,e),c.call(this),this},resetFilters:function(){return this._filters={},s.call(this),this.trigger("filtered:reset"),c.call(this),this},superset:function(){return this._superset},refilter:function(e){return"object"==typeof e&&e.cid?h.call(this,e):(s.call(this),c.call(this)),this},getFilters:function(){return v.keys(this._filters);
},hasFilter:function(e){return v.contains(this.getFilters(),e)},destroy:function(){this.stopListening(),this._collection.reset([]),this._superset=this._collection,this.length=0,this.trigger("filtered:destroy")}};v.extend(g.prototype,x,y.Events),e.exports=g},function(e,t){function n(e,t){return function(i){return i.get(e)===t}}function s(e,t){return function(i){return t(i.get(e))}}function a(e,t){return l.isArray(t)||(t=null),{fn:e,keys:t}}function r(e){var t=l.keys(e),i=l.map(t,function(t){var i=e[t];
return l.isFunction(i)?s(t,i):n(t,i)}),r=function(e){for(var t=0;t<i.length;t++)if(!i[t](e))return!1;return!0};return a(r,t)}function o(e,t){return l.isFunction(e)?a(e,t):l.isObject(e)?r(e):void 0}var l=i("underscore");e.exports=o},function(e,n){function s(){var e=this.getPage()*this.getPerPage(),t=e+this.getPerPage();return[e,t]}function a(){var e=s.call(this);this._collection.reset(this.superset().slice(e[0],e[1]))}function r(){var e=(this._totalPages,this.superset().length),t=this.getPerPage(),i=e%t===0?e/t:Math.floor(e/t)+1,n=this._totalPages!==i;
return this._totalPages=i,n&&this.trigger("paginated:change:numPages",{numPages:i}),this.getPage()>=i?(this.setPage(i-1),!0):void 0}function o(){r.call(this)||a.call(this)}function l(e,t){for(var i=d.max([e.length,t.length]),n=0,s=0;i>n;n+=1,s+=1)if(e[n]!==t[s])if(t[n-1]===e[n])s-=1;else{if(t[n+1]!==e[n])return e[n];s+=1}}function c(e,t,i){if(!r.call(this)){var n=s.call(this),a=n[0],o=n[1],c=l(this.superset().slice(a,o),this._collection.toArray()),u=l(this._collection.toArray(),this.superset().slice(a,o));
u&&this._collection.remove(u),c&&this._collection.add(c,{at:this.superset().indexOf(c)-a})}}function u(e,t){this._superset=e,this._collection=new h.Collection(e.toArray()),this._page=0,this.setPerPage(t&&t.perPage?t.perPage:null),p(this._collection,this),this.listenTo(this._superset,"add remove",c),this.listenTo(this._superset,"reset sort",o)}var d=i("underscore"),h=i("backbone"),p=t(1),f={removePagination:function(){return this.setPerPage(null),this},setPerPage:function(e){return this._perPage=e,
o.call(this),this.setPage(0),this.trigger("paginated:change:perPage",{perPage:e,numPages:this.getNumPages()}),this},setPage:function(e){var t=0,i=this.getNumPages()-1;return e=e>t?e:t,e=i>e?e:i,e=0>e?0:e,this._page=e,a.call(this),this.trigger("paginated:change:page",{page:e}),this},getPerPage:function(){return this._perPage||this.superset().length||1},getNumPages:function(){return this._totalPages},getPage:function(){return this._page},hasNextPage:function(){return this.getPage()<this.getNumPages()-1;
},hasPrevPage:function(){return this.getPage()>0},nextPage:function(){return this.movePage(1),this},prevPage:function(){return this.movePage(-1),this},firstPage:function(){this.setPage(0)},lastPage:function(){this.setPage(this.getNumPages()-1)},movePage:function(e){return this.setPage(this.getPage()+e),this},superset:function(){return this._superset},destroy:function(){this.stopListening(),this._collection.reset([]),this._superset=this._collection,this._page=0,this._totalPages=0,this.length=0,this.trigger("paginated:destroy");
}};d.extend(u.prototype,f,h.Events),e.exports=u},function(e,n){function s(e){return d.isFunction(e)?e:function(t){return t.get(e)}}function a(e){return this._comparator?this._reverse?f(this._collection.toArray(),e,s(this._comparator)):d.sortedIndex(this._collection.toArray(),e,s(this._comparator)):this._superset.indexOf(e)}function r(e){var t=a.call(this,e);this._collection.add(e,{at:t})}function o(e){this.contains(e)&&this._collection.remove(e)}function l(e){this.contains(e)&&this._collection.indexOf(e)!==a.call(this,e)&&(this._collection.remove(e),
r.call(this,e))}function c(){if(!this._comparator)return void this._collection.reset(this._superset.toArray());var e=this._superset.sortBy(this._comparator);this._collection.reset(this._reverse?e.reverse():e)}function u(e){this._superset=e,this._reverse=!1,this._comparator=null,this._collection=new h.Collection(e.toArray()),p(this._collection,this),this.listenTo(this._superset,"add",r),this.listenTo(this._superset,"remove",o),this.listenTo(this._superset,"change",l),this.listenTo(this._superset,"reset",c);
}var d=i("underscore"),h=i("backbone"),p=t(1),f=t(6),m={setSort:function(e,t){return this._reverse="desc"===t?!0:!1,this._comparator=e,c.call(this),e?this.trigger("sorted:add"):this.trigger("sorted:remove"),this},reverseSort:function(){return this._reverse=!this._reverse,c.call(this),this},removeSort:function(){return this.setSort(),this},superset:function(){return this._superset},destroy:function(){this.stopListening(),this._collection.reset([]),this._superset=this._collection,this.length=0,this.trigger("sorted:destroy");
}};d.extend(u.prototype,m,h.Events),e.exports=u},function(e,t){function n(e){return a.isFunction(e)?e:function(t){return t[e]}}function s(e,t,i,s){i=null==i?a.identity:n(i);for(var r=i.call(s,t),o=0,l=e.length;l>o;){var c=o+l>>>1;i.call(s,e[c])<r?l=c:o=c+1}return o}var a=i("underscore");e.exports=s},function(e,t){function n(e,t){s.each(t,function(t){this.listenTo(e,t,function(){var e=s.toArray(arguments);e.unshift(t),this.trigger.apply(this,e)})},this)}var s=i("underscore");e.exports=n}],t(0)}();return n;
})},,function(e,t,i){var n,s;n=[i(37)],s=function(e){"use strict";var t=new e({props:["X-Plex-Product","X-Plex-Version","X-Plex-Client-Identifier","X-Plex-Platform","X-Plex-Platform-Version","X-Plex-Device","X-Plex-Device-Name"]});return t}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(7),i(5),i(37),i(16),i(9)],s=function(e,t,i,n,s,a){"use strict";var r=n.extend({initialize:function(){this.controllers=[]},register:function(e){this.controllers.push(e)},getInstance:function(n,r){
r||(r={});var o,l=a.get("primaryPlayer");o=l&&!r.forceLocal?l.get("protocol")||"legacy":"local";var c=e.find(this.controllers,function(e){var t=o===e.protocol,i=n===e.type||"*"===e.type;return t&&i});if(c)return c.create(n,r);if(r.forceLocal)throw new Error("No player controller found for: "+n);return s.warn("A player did not match the protocol ("+o+") and type ("+n+")."),i.trigger("show:alert",{type:"error",message:t("Playback of this media is not supported with the selected player.")}),this.getInstance(n,{
forceLocal:!0})}});return new r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(37),a=n(s),r=new a.default({"interface":["get","set","remove","clear"]});t.default=r,e.exports=t.default},function(e,t,i){var n,s;n=[i(2),i(4),i(19),i(68)],s=function(e,t,i,n){"use strict";var s={hasPendingPopulate:function(){return!!this.populatePromise&&"pending"===this.populatePromise.state()},populate:function(){return this.populatePromise?this.populatePromise:this.fetch.apply(this,arguments);
},fetch:function(){var n,s=t.Deferred();if(this.hasPendingPopulate())return this.populatePromise;n=this._fetch?this._fetch.apply(this,arguments):this instanceof i.Collection?i.Collection.prototype.fetch.apply(this,arguments):i.Model.prototype.fetch.apply(this,arguments);var a=s.promise();return a.rid=n.rid,this.populatePromise=a,n.done(e.bind(function(e){this.populatePromise=t.Deferred().resolveWith(this,[this]).promise(),s.resolveWith(this,[this,e])},this)),n.fail(e.bind(function(e){this.populatePromise=null,
s.rejectWith(this,[this,e])},this)),a},abortPendingPopulate:function(){return this.hasPendingPopulate()&&n.abort(this.populatePromise.rid),this.populatePromise},resetPopulatePromise:function(e){return this.hasPendingPopulate()||(this.populatePromise=e),this.populatePromise}};return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(28),i(26),i(72),i(212),i(469)],s=function(e,t,i,n,s,a,r){"use strict";var o={playbackDuration:0,modelDefaults:function(){var t=e.omit(this.model.defaults,["item","playQueue","transcodeServer","state","stopped","paused","playing","buffering","error","volume","shuffled","repeatAll","slideshowState","slideshowPlaying","slideshowPaused"]),i=this.model.get("playQueue"),n=!!this.previousItem,s=!!this.nextItem&&!this.currentItem.get("isAdvertisement");
return this.webRadioUsage&&s&&(s=this.webRadioUsage.get("canSkipNext")),e.extend(t,{item:this.currentItem,type:this.type,canRepeat:!0,canSkipPrevious:n,canSkipNext:s,canShuffle:i&&!i.get("hasUpNext"),shuffled:i&&i.get("shuffled")})},modelOverrides:function(){var e={};this.webRadioUsage&&!this.webRadioUsage.get("canSkipNext")&&(e.canSkipNext=!1);var t=this.model.get("playQueue");t.get("isRadio")&&(t.get("allowSeek")||(e.canSeek=!1),t.get("allowRepeat")||(e.canRepeat=!1,e.showPlayQueue=!1),t.get("allowShuffle")||(e.canShuffle=!1,
e.showPlayQueue=!1),t.get("allowSkipPrevious")||(e.canSkipPrevious=!1,e.showPlayQueue=!1));var i=this.currentItem.get("advertisement");return i&&(e.canSkipPrevious=!1,e.canSkipNext=!1,e.canSeek=!1,e.showPlayQueue=!1),e},initialize:function(i){this.stoppedSessions={},this.stop=e.wrap(this.stop,e.bind(function(e){return!this.model||this.model.get("stopped")?t.Deferred().resolve().promise():e.apply(this,[].slice.call(arguments,1))},this)),this.seekBackward=e.bind(this.seek,this,-1e4,0,0),this.seekForward=e.bind(this.seek,this,3e4,0,3e3);
},request:function(t){return this.pendingRequests||(this.pendingRequests=[]),this.pendingRequests.push(t),t.always(e.bind(function(){var i=e.indexOf(this.pendingRequests,t);this.pendingRequests.splice(i,1)},this)),t},waitForRequests:function(){return t.when.apply(t,this.pendingRequests)},reset:function(t){this.currentItem&&(this.timeline({state:i.states.STOPPED,continuing:!0}),this.stopTimeline(),this.stopSession()),this.currentItem=t,this.previousItem=this.getPreviousItem(t),this.nextItem=this.getNextItem(t),
this.setRadioPolicy();var n=e.extend(e.result(this,"modelDefaults"),this.modelOverrides());return this.model.set(n),t},getItemAtOffset:function(e,t,i){t||(t=this.model.get("item")),i||(i={});var n=this.model.get("playQueue");if(!t||!n)return null;var s=n.get("collection"),a=s.findWhere({ratingKey:t.get("ratingKey")}),r=s.indexOf(a),o=r+e,l=i.loop&&s.length>1||this.model.get("repeatAll");return o>=0&&o<s.length?s.at(o):l?(o=(o+s.length)%s.length,s.at(o)):null},getPreviousItem:function(e,t){return this.getItemAtOffset(-1,e,t);
},getNextItem:function(e,t){return this.getItemAtOffset(1,e,t)},mirror:function(){},play:function(){},pause:function(){},playPause:function(){this.model.get("state")===i.states.PAUSED?this.play():this.pause()},setPosition:function(e,t){},canSeek:function(e){return this.model.get("canSeek")?e!==this.model.get("position")&&e<=this.model.get("duration")&&e>=0:!1},seek:function(e,t,i,n){var s=this.model.get("position")+e,a=0+(t>=0?t:0),r=this.model.get("duration")-(i>=0?i:0);s=Math.max(a,Math.min(s,r)),
this.setPosition(s,n)},setVolume:function(e){},decreaseVolume:function(){var e=this.model.get("volume");this.setVolume(Math.round(Math.max(e-10,0)))},increaseVolume:function(){var e=this.model.get("volume");this.setVolume(Math.round(Math.min(e+10,100)))},skipPrevious:function(){return this.model.get("canSkipPrevious")&&this.previousItem?this.reset(this.previousItem):!1},skipNext:function(e){if(!e||!e.organic){if(!this.model.get("canSkipNext"))return!1;this.webRadioUsage&&!this.currentItem.get("advertisement")&&this.webRadioUsage.registerSkip();
}if(!this.nextItem)return!1;var t=this.model.get("playQueue");if(t.get("isRadio")){var i=this.nextItem,n=this.getNextItem(i),s=n&&this.getNextItem(n);n&&s||this.refreshPlayQueue()}return this.reset(this.nextItem)},skipTo:function(e){var t=this.model.get("item");if(t&&t.get("key")===e)return!1;var i=this.model.get("playQueue"),n=i&&i.get("collection");if(!n)return!1;var s=n.findWhere({key:e});return this.reset(s)},toggleShuffle:function(){var e=this.model.get("playQueue");this.model.get("canShuffle")&&e&&e.toggleShuffle();
},nextRepeat:function(){var t=this.model.get("playQueue");if(this.model.get("canRepeat")&&t){var i=!this.model.get("repeatAll")&&!this.model.get("repeatItem"),n=this.model.get("repeatAll")&&!this.model.get("repeatItem");t.setRepeatAll(i).done(e.bind(function(){this.model.set({repeatAll:i,repeatItem:n})},this))}},removeItem:function(e){return this.model.get("playQueue").removeItem(e)},moveItem:function(e,t){return this.model.get("playQueue").moveItem(e,t)},refreshPlayQueue:function(){var e=this.model.get("playQueue");
e&&e.fetch()},stop:function(e){e&&e.silent||this.model.set("state",i.states.STOPPED);var t=this.model.get("item"),n=t.server.get("playQueueManager");if(n){var s=this.model.get("playQueue"),a=n.getFor(t);a&&s&&a===s&&n.remove(s.get("mediaType"))}this.stopListening(),this.webRadioUsage&&(this.stopListening(this.webRadioUsage),this.webRadioUsage.stop())},timeline:function(i){return i||(i={}),e.defaults(i,this.model.attributes),this.companion||!i.item?t.Deferred().resolve().promise():this.request(n.timeline(i));
},startTimeline:function(){this.companion||this.serverTimelineInterval||(this.serverTimelineInterval=setInterval(e.bind(this.timeline,this),n.serverTimelineDelay))},stopTimeline:function(){this.serverTimelineInterval=clearInterval(this.serverTimelineInterval),this.trackPlaybackEvent()},updatePlayQueue:function(){var e=this.model.get("playQueue");return e&&e.get("playQueueSelectedItemID")!==this.model.get("item").get("playQueueItemID")?e.fetch():t.Deferred().resolve().promise()},ping:function(){return this.companion?t.Deferred().resolve().promise():this.request(n.ping(this.model.get("transcodeServer"),this.session));
},startPing:function(){var t=this.model.get("directPlay"),s=!this.companion&&this.type!==i.types.PHOTO;!s||t||this.pingInterval||(this.pingInterval=setInterval(e.bind(this.ping,this),n.pingDelay))},stopPing:function(){this.pingInterval=clearInterval(this.pingInterval)},stopSession:function(s){var a=this.session,r=a||e.uniqueId("no-session-"),o=s&&s.xhrOptions||{};if(this.stoppedSessions.hasOwnProperty(r))return this.stoppedSessions[r];this.subcontroller&&this.subcontroller.stop(s);var l;return l=a&&this.type!==i.types.PHOTO&&!this.model.get("directPlay")?this.request(n.stop(this.model.get("transcodeServer"),a,o)):t.Deferred().resolve().promise(),
this.stoppedSessions[r]=l,l},startPlaybackTracking:function(){this.companion||this.playbackInterval||(this.playbackInterval=setInterval(e.bind(function(){this.playbackDuration++},this),n.playbackDelay))},stopPlaybackTracking:function(){this.playbackInterval=clearInterval(this.playbackInterval)},trackPlaybackEvent:function(){if(!this.companion){a.incPlaybackCount();var e=this.model.get("item"),t=e.get("identifier");!t&&e.parent&&(t=e.parent.get("identifier")),s.trackEvent({eventCategory:"Playback",
eventAction:e.get("type"),eventLabel:t,eventValue:this.playbackDuration}),this.playbackDuration=0}},setRadioPolicy:function(){var t=this.model.get("playQueue");if(this.webRadioUsage){if(this.webRadioUsage.get("playQueue")===t)return;this.stopListening(this.webRadioUsage),this.webRadioUsage.stop(),this.webRadioUsage=null}if(this.webRadioAdvertisementTimeout&&(this.webRadioAdvertisementTimeout=clearTimeout(this.webRadioAdvertisementTimeout)),t&&t.get("isRadio")){var i=e.extend(e.pick(t.attributes,r.playQueueAttributes),{
playQueue:t});this.webRadioUsage=new r(i),this.listenTo(this.webRadioUsage,"change",function(e){var t=e.changedAttributes();t&&this.model.set(t)});var n=this.currentItem;n.get("advertisement")&&n.get("allowSkipAfter")&&(this.webRadioAdvertisementTimeout=setTimeout(e.bind(function(){this.model.set("canSkipNext",!!this.nextItem)},this),1e3*n.get("allowSkipAfter")))}},previousChapter:function(){var e=Math.max(this.model.get("lastSeekPosition"),this.model.get("position")),t=this.getPreviousChapterTime(e-5e3);
void 0!==t&&this.setPosition(t)},nextChapter:function(){var e=Math.max(this.model.get("lastSeekPosition"),this.model.get("position")),t=this.getNextChapterTime(e);void 0!==t&&this.setPosition(t)},getPreviousChapterTime:function(e){var t=this.model.get("item"),i=t.get("Chapter");if(i&&i.length){for(var n=i.length-1;n>=0;n--){var s=i[n],a=parseInt(s.startTimeOffset,10);if(e>a)return a}return 0}},getNextChapterTime:function(e){var t=this.model.get("item"),i=t.get("Chapter");if(i&&i.length)for(var n=0;n<i.length;n++){
var s=i[n],a=parseInt(s.startTimeOffset,10);if(a>e)return a}},stepBackward:function(){var e=this.model.get("item"),t=e.get("Chapter");t&&t.length?this.previousChapter():this.seek(-6e5,0,0)},stepForward:function(){var e=this.model.get("item"),t=e.get("Chapter");t&&t.length?this.nextChapter():this.seek(6e5,0,3e3)}};return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(5),i(29),i(192)],s=function(e,t,i,n){"use strict";var s=i.extend({model:n,url:function(){return"/channels/"+this.subset;
},initialize:function(e,i){this.subset=i.subset||"all",this.listenTo(t,"clear:channels",this.clear)},parse:function(t){e.isString(t)&&(t=t.replace(/<(\/?)(Directory|Video|Track|Photo)/g,"<$1Channel"));var i=this.convert(t);return this.viewGroup=i.viewGroup,i.Channel},sortByTitle:function(e){return e.get("title").toLowerCase()},sortByLastAccess:function(e){return-e.get("lastAccessedAt")},filterByType:function(e){var t=this.filter(function(t){return t.get("type")===e});return this.clone(t)}});return s;
}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(14),i(77),i(67),i(24),i(40),i(15)],s=function(e,t,i,n,s,a,r,o){"use strict";var l=a.extend({idAttribute:"ratingKey",whitelistedAttrs:["guid","addedAt","composite","duration","key","leafCount","playlistType","ratingKey","smart","summary","title","type","allowSync"],defaults:function(){return{children:new r([],{server:this.server,parent:this,url:function(){var e,t="/playlists/"+this.parent.id+"/items";return"audio"===this.parent.get("playlistType")&&(e={
includeRelated:1}),i.join(t,e)}})}},urlRoot:"/playlists",saveUrl:function(){return"/library/metadata/"+this.id},cacheKey:function(e){return e.key?this.server&&this.server.getScopedKey(e.key):void 0},initialize:function(){this.listenToOnce(this.get("children"),"add",function(e){this.set("art",e.get("art"))})},sync:function(e,t,i){var n=s.addVersionHeader(2,i);return a.prototype.sync.call(this,e,t,n)},parse:function(e){var t=this.convert(e);return t.Playlist&&(t=t.Playlist),o.parseInteger(t,["duration","leafCount","addedAt"]),
o.parseBoolean(t,["smart","allowSync"]),t.isPlaylist=!0,t},findItem:function(e){return this.get("children").findWhere({playlistItemID:e})},moveItem:function(n,s){var a=s?{after:s}:{},r=i.join([e.result(this,"url"),"/items/",n,"/move"],a),o=e.extend(this.server.getXHROptions(r),{type:"PUT"}),l=t.ajax(o),c=this.get("children"),u=this.findItem(n);c.remove(u);var d=this.findItem(s),h=d?c.indexOf(d)+1:0;return c.add(u,{at:h}),l},removeItem:function(n){n=n.toString();var s=i.join([e.result(this,"url"),"/items/",n]),a=e.extend(this.server.getXHROptions(s),{
type:"DELETE"}),r=t.ajax(a);r.then(e.bind(function(e){this.set(this.parse(e))},this));var o=this.get("children"),l=this.findItem(n);return o.remove(l),r},addContent:function(s,a){var r=this.isNew()?"POST":"PUT",o=[e.result(this,"url")],l={};this.isNew()?(l.type=this.get("playlistType"),l.title=this.get("title"),l.smart=this.get("smart")?1:0):o.push("/items"),s.get("playQueueID")?l.playQueueID=s.get("playQueueID"):l.uri=n.uri(s,a);var c=i.join(o,l),u=e.extend(s.server.getXHROptions(c),{type:r}),d=t.ajax(u);
return d.then(e.bind(function(e){this.set(this.parse(e))},this)),d.promise()},isLibraryItem:function(){return!0},isPlexMusicItem:function(){return!1}});return l}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(21),a=n(s),r=i(23),o=n(r),l=i(202),c=n(l),u=o.default.extend({name:"FilterModel",context:["server","section","type","standalone"],idAttribute:"filter",rootPropertyName:"Directory",defaults:{advanced:!1
},syncedAttrs:{filter:a.default.string,filterType:a.default.string,key:a.default.string,title:a.default.string,advanced:a.default.boolean},syncedRelations:{options:{relationClass:c.default}}});t.default=u,e.exports=t.default},function(e,t,i){var n,s;n=[i(2),i(95)],s=function(e,t){"use strict";function i(i,n){n||(n={});var s=e.defaults(n,{typeName:i,parse:e.bind(t.parseType,t,i)});return s}var n={xml:i("xml"),json:i("json"),text:i("text")};return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){
"use strict";function n(e){if(!e)return"";if(60>e)return 1===e?(0,r.default)("{1} second left",e):(0,r.default)("{1} seconds left",e);var t=Math.ceil(e/60);return 1===t?(0,r.default)("{1} minute left",t):(0,r.default)("{1} minutes left",t)}var s=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var a=i(7),r=s(a);t.default=n,e.exports=t.default},function(e,t,i){"use strict";function n(e){if(!e)return"";if("8k"===e)return"8K";if("4k"===e)return"4K";var t=parseInt(e,10);return r.default.isNaN(t)?e.toUpperCase():e+"p";
}var s=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var a=i(2),r=s(a);t.default=n,e.exports=t.default},function(e,t){"use strict";function i(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i,e.exports=t.default},function(e,t,i){var n,s;n=[i(43)],s=function(e){"use strict";var t=e.extend({setup:function(e){if(e.className&&this.$el.addClass(e.className),this.model=e.model,this.server=e.model.server,e.flag){var t=this.model.get("Media");
this.flag=e.flag,t&&t.length&&(this.path=t[0][this.flag]),this.ignoreAttributeChanges||this.listenTo(this.model,"change:Media",this.onMediaChange)}else this.flag=e.modelAttribute,this.path=this.model.get(this.flag),this.ignoreAttributeChanges||this.listenTo(this.model,"change:"+this.flag,this.onChange);this.prefix=this.model.get("mediaTagPrefix"),this.version=this.model.get("mediaTagVersion"),this.path&&(this.url=this.getUrl(this.path)),this.setDimensions(e)},getUrl:function(e){return this.prefix+this.flag+"/"+encodeURIComponent(e)+"?t="+this.version;
},onMediaChange:function(e,t){this.onChange(e,t&&t.length?t[0][this.flag]:null)}});return t}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(56),i(29),i(654)],s=function(e,t,i){"use strict";var n=t.extend({model:i,url:"/playlists?type="+e.LOCAL,parse:function(e){return this.convert(e,"Playlist")}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1024),i(2),i(6),i(5)],s=function(e,t,i,n){"use strict";var s=i.ItemView.extend({className:"alert-bar",
template:e,events:{"click .close-btn":"onCloseClick"},initialize:function(e){this.alert=e.alert,this.alert&&this.$el.addClass(this.alert.type)},hide:function(){n.trigger("hide:bar","alertbar")},serializeData:function(){return this.alert},onCloseClick:function(e){e.preventDefault(),this.hide()}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1046),i(2),i(6),i(5),i(17),i(11),i(50),i(704),i(718),i(733),i(737),i(736),i(732),i(730),i(729),i(734),i(731),i(735),i(738)],
s=function(e,t,i,n,s,a,r,o,l,c,u,d,h,p,f,m,g,v,y){"use strict";var b={movie:c,show:u,season:d,episode:h,artist:p,album:f,photoAlbum:m,clip:g,userPlaylistItem:g,playlist:v},w={playlist:{blur:5,saturation:50}},x=i.Layout.extend({className:"details-container",template:e,regions:{details:".row"},events:{"click .pivot-link":"onPivotClick"},initialize:function(){var e=this.model.get("grandparentTheme")||this.model.get("parentTheme")||this.model.get("theme"),i=this.model.get("type"),c={};t(w).has(i)&&(c=w[i]),
this.mediaActions=new r({},{item:this.model,type:i,showAdvanced:!0}),this.once("render",t.bind(function(){n.trigger("show:background",{model:this.model,imageFilters:c}),n.trigger("show:bar","actionbar",new o({model:this.model,mediaActions:this.mediaActions})),this.model.isLibraryItem()&&n.trigger("show:bar","breadcrumbbar",new l({model:this.model}))},this)),e&&s.get("playThemeMusic")&&a.execute("playSound",{key:this.model.get("key"),url:this.model.server.resolveUrl(e,{appendToken:!0}),volume:50,autoLoad:!0,
autoPlay:!0,background:!0})},onRender:function(){var e,i=this.model.get("type");if(t(b).has(i)){var n=b[i];e=new n({model:this.model,mediaActions:this.mediaActions})}else e=new y({model:this.model});this.details.append(e,this.$el)},onClose:function(){n.trigger("hide:bar","actionbar"),this.model.isLibraryItem()&&n.trigger("hide:bar","breadcrumbbar")},onPivotClick:function(e){var t=this.model.section;if(t){var i=t.get("items");i.scrollPosition=0}}});return x}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(14),i(43),i(96)],s=function(e,t,i){"use strict";var n=t.extend({background:!0,setup:function(t){this.model=t.model,t.noPlaceholder||(this.placeholderClass=i.playlist);var n={width:(t.width||t.height||256)*this.pixelRatio,height:(t.height||t.width||256)*this.pixelRatio,rows:t.rows||2,cols:t.columns||2,border:t.border||0,media:t.media||"thumb",repeat:t.unique?0:1},s=e.join(this.model.get("composite"),n);this.url=this.model.server.resolveUrl(s,{appendToken:!0})}});return n;
}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1156),i(2),i(4),i(7),i(5),i(14),i(31)],s=function(e,t,i,n,s,a,r){"use strict";var o=r.extend({name:"channelSettingsModal",className:"channel-settings-modal modal fade",template:e,ui:{submitBtn:".submit-btn"},events:t.extend({"change input[name]":"onInputChange","change select[name]":"onInputChange","submit #channel-settings-form":"onSubmit"},r.prototype.events),initialize:function(){r.prototype.initialize.apply(this,arguments),
this.changes={}},serializeData:function(){var e=this.model.get("title")||this.model.get("name");return{title:e?e:"Preferences...",settings:this.collection.toJSON()}},onInputChange:function(e){var t=e.currentTarget,i=t.value;"checkbox"===t.type&&(i=t.checked),this.changes[t.name]=i},onSubmit:function(e){if(e.preventDefault(),t.isEmpty(this.changes))return void this.hide();var r=this.ui.submitBtn;if(!r.hasClass("active")){r.addClass("active");var o=this.collection.first(),l=o.getSaveParams(this.changes),c=t.result(this.collection,"url"),u=a.join([c,"/set"],l),d=i.ajax(o.server.getXHROptions(u));
d.done(t.bind(function(){this.hide()},this)),d.fail(t.bind(function(){s.trigger("show:alert",{type:"error",message:n("There was a problem saving these settings.")})},this)),d.always(function(){r.removeClass("active")})}}});return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1166),i(2),i(4),i(514),i(532),i(542),i(14),i(9),i(31),i(11),i(50)],s=function(e,t,i,n,s,a,r,o,l,c,u){"use strict";function d(e){var i=t.reject(e,function(e){return 0===e.id}),n=t.sortBy(i,"streamType");
return t.map(n,function(e){return v(e,"streamType")})}function h(e){return t.map(e.get("Media"),function(e){return t.extend(v(e,"Part"),{Part:t.map(e.Part,function(e){return t.extend(v(e,"Stream"),{file:e.file,exists:e.exists,accessible:e.accessible,Stream:d(e.Stream)})})})})}var p=["id","key","index","videoCodec","audioCodec","audioChannels","default","selected","languageCode","codecID","accessible","exists"],f={size:s.formatBytes,duration:n.formatPlayerTime,codec:a.toUpperCase,format:a.toUpperCase,
container:a.toUpperCase,videoResolution:s.formatResolution,channels:s.formatAudioChannels,level:s.formatVideoLevel,bitrateMode:a.toUpperCase,accessible:a.formatBoolean,exists:a.formatBoolean,optimizedForStreaming:a.formatBoolean,file:r.getLastSegment},m={optimizedForStreaming:"Web Optimized",has64bitOffsets:"Has 64bit Offsets",cabac:"CABAC",postURL:"URL"},g={frameRate:" fps",dialogNorm:" dB",bitrate:" kbps",samplingRate:" Hz"},v=function(e,i){var n={properties:[]};for(var s in e)if(s!==i&&-1===t.indexOf(p,s)){
var r=m[s],o=e[s];f[s]&&(o=f[s](o)),o&&(g[s]&&(o+=g[s]),r||(r=a.formatPropertyLabel(s)),n.properties.push({name:r,value:o}))}return i&&e&&(n[i]=e[i]),n},y=l.extend({name:"mediaInfoModal",className:"media-info-modal modal modal-lg fade",template:e,ui:{scroller:".modal-body-scroll",files:".files > ul",stickyProps:".media > .props, .part > .props"},events:t.extend({"click .delete-btn":"onDeleteClick"},l.prototype.events),modelEvents:{"change:Media":"onMediaChange"},initialize:function(e){l.prototype.initialize.apply(this,arguments),
this.bindAllWhenRendered("onMediaChange","onScroll"),this.loading=!1,this.media=h(this.model),this.mediaActions=new u({},{item:this.model}),this.hasStreams()||(this.loading=!0,this.model.fetch().always(this.whenRendered(function(){this.model.changed.hasOwnProperty("Media")||this.updateMedia()})))},serializeData:function(){var e=this.model.get("key"),t=o.get("user"),i=this.model.server;return this.model.isLibraryItem()&&(e=r.join(e,{checkFiles:1,includeExtras:1})),{key:e,url:this.model.server.resolveUrl(e,{
appendToken:!0}),media:this.media,hasFiles:this.hasFiles(),hasStreams:this.hasStreams()||this.loading,showDeleteFile:i.supports("specificMediaDeletion"),showFilepath:!i.get("shared")||t.isNinja(),loading:this.loading}},updateMedia:function(){this.loading=!1,this.rerender=!0,this.ui.scroller.off("scroll",this.onScroll),this.media=h(this.model),this.render()},hasFiles:function(){return!!t.chain(this.media).pluck("Part").flatten().pluck("file").compact().size().value()},hasStreams:function(){return!!t.chain(this.media).pluck("Part").flatten().pluck("Stream").flatten().size().value();
},bindingsModel:"mediaActions",bindings:{".delete-btn":{modelAttribute:"showDelete",manual:!0,autohide:!0}},onRender:function(){l.prototype.onRender.apply(this,arguments),this.ui.scroller.on("scroll",this.onScroll),this.$el.tooltip({selector:".files .label",placement:"bottom"})},onClose:function(){this.ui.scroller.off("scroll",this.onScroll)},onMediaChange:function(){return this.isHidden?void 0:this.model.get("Media").length?void this.updateMedia():void this.hide()},onDeleteClick:function(e){e.preventDefault(),
c.execute("deleteMediaItem",{item:this.model,index:i(e.currentTarget).data("media-item")})},onScroll:function(){var e=this.ui.scroller.scrollTop(),t=this.ui.scroller.offset().top;return this.ui.files.length&&(t+=parseInt(this.ui.files.css("margin-bottom"),10)),0>t?void setTimeout(this.onScroll,500):void this.ui.stickyProps.each(function(){var n=i(this),s=n.parent().height()-n.height(),a=e-this.parentNode.offsetTop,r=Math.min(Math.max(a,0),s);r&&r===a?(n.addClass("sticky"),n.css("top",t)):(n.removeClass("sticky"),
n.css("top",r))})}});return y}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1169),i(4),i(2),i(11),i(9),i(31),i(64),i(855)],s=function(e,t,i,n,s,a,r,o){"use strict";var l=r.extend({name:"recommendModal",className:"recommend-modal select-modal modal modal-sm fade",template:e,playlistIDs:null,ui:{sendBtn:".send-btn",messageContainer:".message-container",message:".message"},regions:{list:".friends-container"},events:i.extend({"click .friend":"onFriendClick","click .friends-btn":"onFriendsClick",
"click .send-btn":"onSendClick"},a.prototype.events),initialize:function(){r.prototype.initialize.apply(this,arguments);var e=s.get("user");this.collection=e.get("friends").filterByUnrestricted(),this.playlistIDs=[]},serializeData:function(){return{hasFriends:!!this.collection.length}},onRender:function(){r.prototype.onRender.apply(this,arguments),this.list.show(new o({collection:this.collection}))},onClose:function(){this.collection.destroy()},onFriendClick:function(e){e.preventDefault();var n=t(e.currentTarget),s=n.data("id");
n.hasClass("selected")?this.playlistIDs.splice(i.indexOf(this.playlistIDs,s),1):this.playlistIDs.push(s),n.toggleClass("selected"),this.playlistIDs.length?(this.ui.sendBtn.removeClass("disabled"),this.ui.messageContainer.removeClass("invisible")):(this.ui.sendBtn.addClass("disabled"),this.ui.messageContainer.addClass("invisible"))},onFriendsClick:function(e){this.hide()},onSendClick:function(e){e.preventDefault();var t=this.ui.sendBtn;if(!t.isDisabled()){t.addClass("active");var s={item:this.model,
playlistIDs:this.playlistIDs,message:this.ui.message.val()},a=n.execute("recommend",s);a.done(i.bind(this.onSendSuccess,this)),a.fail(i.bind(this.onSendError,this))}},onSendSuccess:function(){this.hide()},onSendError:function(){this.ui.sendBtn.removeClass("active")}});return l}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1174),i(4),i(2),i(11),i(9),i(31),i(64)],s=function(e,t,i,n,s,a,r){"use strict";var o=r.extend({name:"shareModal",className:"share-modal select-modal modal modal-sm fade",
template:e,linkedNetworks:null,networkIDs:null,maxLength:null,ui:{shareBtn:".share-btn",messageContainer:".message-container",charactersRemaining:".characters-remaining",message:".message"},events:i.extend({"click .network":"onNetworkClick","keyup .message":"onMessageKeyUp","click .share-btn":"onShareClick"},a.prototype.events),initialize:function(){r.prototype.initialize.apply(this,arguments),this.user=s.get("user"),this.socialNetworks=this.user.get("socialNetworks"),this.linkedNetworks=this.socialNetworks.where({
linked:!0}),this.autoSelect=1===this.linkedNetworks.length,this.networkIDs=[]},serializeData:function(){for(var e=[],t=0,i=this.linkedNetworks.length;i>t;t++)e.push(this.linkedNetworks[t].toJSON());return{networks:e,accountUrl:this.user.server.get("accountUrl"),autoSelect:this.autoSelect}},calculateMaxLength:function(){var e=null,t=this.socialNetworks;i.each(this.networkIDs,function(i){var n=t.get(i),s=n.get("maxLength")||null;(null===e||e>s)&&(e=s)}),this.maxLength=e,this.calculateCharactersRemaining();
},calculateCharactersRemaining:function(){var e=this.ui.message.val(),t=this.maxLength-e.length;return null===this.maxLength?void this.ui.charactersRemaining.addClass("hidden"):(0>t?(this.ui.charactersRemaining.addClass("error").removeClass("hidden"),this.ui.shareBtn.addClass("disabled")):(this.ui.charactersRemaining.removeClass("error hidden"),this.ui.shareBtn.removeClass("disabled")),void this.ui.charactersRemaining.text(this.maxLength-e.length))},onRender:function(){r.prototype.onRender.apply(this,arguments),
this.autoSelect&&(this.networkIDs.push(this.linkedNetworks[0].id),this.calculateMaxLength())},onNetworkClick:function(e){e.preventDefault();var n=t(e.currentTarget),s=n.data("id");n.hasClass("selected")?this.networkIDs.splice(i.indexOf(this.networkIDs,s),1):this.networkIDs.push(s),n.toggleClass("selected"),this.networkIDs.length?(this.ui.shareBtn.removeClass("disabled"),this.ui.messageContainer.removeClass("invisible")):(this.ui.shareBtn.addClass("disabled"),this.ui.messageContainer.addClass("invisible")),
this.calculateMaxLength()},onMessageKeyUp:function(e){this.calculateCharactersRemaining()},onShareClick:function(e){e.preventDefault();var t=this.ui.shareBtn;if(!t.isDisabled()){t.addClass("active");var s={item:this.model,networkIDs:this.networkIDs,message:this.ui.message.val()},a=n.execute("share",s);a.done(i.bind(this.onShareSuccess,this)),a.fail(i.bind(this.onShareError,this))}},onShareSuccess:function(){this.hide()},onShareError:function(){this.ui.shareBtn.removeClass("active")}});return o}.apply(t,n),
!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1183),i(4),i(82),i(125),i(258),i(257),i(31),i(877),i(876),i(878),i(873)],s=function(e,t,i,n,s,a,r,o,l,c,u){"use strict";var d=r.extend({mixins:[i],name:"convertModal",className:"convert-modal modal fade",template:e,regions:{bodyRegion:".modal-body-region"},initialize:function(e){r.prototype.initialize.apply(this,arguments),this.server=this.model?this.model.server:e.item.server;var t={server:this.server,allowInCache:!0};this.playlists=new n([],t),
this.targets=new s([],t),this.profiles=new a([],t)},initialState:"loading",states:{loading:{nextState:"form",onEnter:function(){this.bodyRegion.show(new o),this.listenForStateRequests();var e=t.when(this.playlists.populate(),this.targets.populate(),this.profiles.populate(),this.server.get("sections").populate());e.done(this.whenRendered(function(){this.playlist=this.playlists.first(),this.playlist?this.enterNextState():this.enterState("error")})),e.fail(this.whenRendered(function(){this.enterState("error");
}))}},form:{nextState:"success",onEnter:function(){this.bodyRegion.show(new l({model:this.model,item:this.options.item,items:this.options.items,playlist:this.playlist,targets:this.targets,profiles:this.profiles})),this.listenForStateRequests()}},success:{onEnter:function(){this.model?this.hide():(this.bodyRegion.show(new c({server:this.server})),this.listenForStateRequests())}},error:{onEnter:function(e){this.bodyRegion.show(new u({status:e})),this.listenForStateRequests()}}},listenForStateRequests:function(){
this.bodyRegion&&this.bodyRegion.currentView&&this.listenTo(this.bodyRegion.currentView,{"request:state":this.enterState,"request:nextState":this.enterNextState})},onRender:function(){r.prototype.onRender.apply(this,arguments),this.enterNextState()},onStateMachineComplete:function(){this.hide()}});return d}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1229),i(2),i(4),i(6)],s=function(e,t,i,n){"use strict";var s=n.ItemView.extend({className:"player-slider",template:e,dragging:!1,
ui:{thumb:".player-slider-thumb",track:".player-slider-track",progress:".player-slider-progress"},events:{mousedown:"onMouseDown",touchstart:"onTouchStart"},onlyAfterRender:["displayValue"],initialize:function(e){t.bindAll(this,"onMouseMove","onMouseUp","onTouchMove","onTouchEnd"),this.$document=i(document),this.currentValue=e.value||0},startDragging:function(){this.dragging=!0,this.$el.addClass("active")},stopDragging:function(){this.dragging=!1,this.$el.removeClass("active"),this.triggerMethod("dragComplete");
},updateForPosition:function(e,t){var i=this.getValueForPosition(e);this.setValue(i)&&this.displayValue(i,t)},getValueForPosition:function(e){var t=this.ui.track,i=e-t.offset().left,n=i/t.width();return n=Math.min(Math.max(n,0),1),n=Math.round(100*n)},setValue:function(e){return this.currentValue=e,this.trigger("change:value",e),!0},displayValue:function(e,t){this.ui.thumb.css("left",e+"%"),this.ui.progress.css("width",e+"%"),this.$el.data("value",e)},onRender:function(){this.displayValue(this.currentValue);
},onClose:function(){this.$document.off("mousemove",this.onMouseMove),this.$document.off("mouseup",this.onMouseUp),this.$document.off("touchmove",this.onTouchMove),this.$document.off("touchend",this.onTouchEnd)},onMouseDown:function(e){e.preventDefault(),this.$document.on("mousemove",this.onMouseMove),this.$document.on("mouseup",this.onMouseUp),this.startDragging(),this.setValue(this.getValueForPosition(e.pageX))},onTouchStart:function(e){this.$document.on("touchmove",this.onTouchMove),this.$document.on("touchend",this.onTouchEnd),
this.startDragging();var t=e.originalEvent.touches[0];t&&this.updateForPosition(t.pageX)},onMouseMove:function(e){e.preventDefault(),this.updateForPosition(e.pageX)},onTouchMove:function(e){e.preventDefault();var t=e.originalEvent.touches[0];t&&this.updateForPosition(t.pageX)},onMouseUp:function(e){e.preventDefault(),this.$document.off("mousemove",this.onMouseMove),this.$document.off("mouseup",this.onMouseUp),this.updateForPosition(e.pageX),this.stopDragging()},onTouchEnd:function(e){this.$document.off("touchmove",this.onTouchMove),
this.$document.off("touchend",this.onTouchEnd);var t=e.originalEvent.touches[0];t&&this.updateForPosition(t.pageX),this.stopDragging()}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(37),a=n(s),r=new a.default({"interface":["get","on"]});t.default=r,e.exports=t.default},function(e,t,i){var n,s;n=[i(37)],s=function(e){"use strict";var t=new e({"interface":["init","enable","disable","set","capture"]
});return t}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(37)],s=function(e){"use strict";var t=new e({props:["shortcuts"]});return t}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(37)],s=function(e){"use strict";var t=new e({props:["capabilities","video","music","photo"]});return t}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(4),a=n(s),r=i(20),o=n(r),l=i(16),c=n(l),u=o.default.extend({
getStorage:function(){},get:function(e){var t=this;return this._catchStorageError(function(i){var n=window.PLEXWEB,s=n&&e in n?n[e]:i.getItem(e);if(null==s)throw new Error(e+" is not in "+t.storageName);return s})},set:function(e,t){var i=this;return this._catchStorageError(function(n){if(!e)throw new Error("Unable to set value in "+i.storageName+" without a key");if(null==t)throw new Error("Unable to set null or undefined value for "+e+" in "+i.storageName+". Use the remove function.");return n.setItem(e,t);
})},remove:function(e){return this._catchStorageError(function(t){return t.removeItem(e)})},clear:function(){return this._catchStorageError(function(e){return e.clear()})},_catchStorageError:function(e){var t=a.default.Deferred();try{t.resolve(e(this.getStorage()))}catch(i){c.default.warn(i.message),t.reject(i)}return t.promise()}});t.default=u,e.exports=t.default},function(e,t,i){var n,s;n=[i(29),i(141)],s=function(e,t){"use strict";var i=e.extend({model:t});return i}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(2),i(15),i(35)],s=function(e,t,i){"use strict";var n=i.extend({idAttribute:"playQueueItemID",propagatedAttributes:["viewOffset","viewCount"],cacheKey:function(e){return this.server&&this.server.getScopedKey(e.playQueueItemID)},convert:function(){var e=i.prototype.convert.apply(this,arguments);return t.parseBoolean(e,"advertisement"),t.parseInteger(e,"allowSkipAfter"),e},initialize:function(t,n){i.prototype.initialize.apply(this,arguments),this.listenTo(this,"change",function(){
var t=this.changedAttributes(),n=e.intersection(e.keys(t),this.propagatedAttributes);e.each(n,function(t){var n=new i({key:this.get("key")},{server:this.server,onlyIfCached:!0});e.isEmpty(n)||n.set(t,this.get(t))},this)})}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(2),a=n(s),r=i(7),o=n(r),l=i(21),c=n(l),u=i(23),d=n(u),h=["all","recentlyAdded","recentlyViewed","recentlyViewedShows","onDeck","newest","folder"],p=d.default.extend({
name:"SectionSubsetModel",context:["server","section"],idAttribute:"key",rootPropertyName:"Directory",sessionAttrs:{selected:c.default.boolean},syncedAttrs:{key:c.default.string,title:c.default.string,secondary:c.default.boolean},derivedAttrs:{primary:function(){return!this.get("secondary")&&a.default.contains(h,this.get("key"))}},defaults:{selected:!1},augmentResponse:function(e){return"all"===e.key&&(e.title=(0,o.default)("All")),e}},{whitelistedPrimaryKeySubsets:h});t.default=p,e.exports=t.default;
},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(4),a=n(s),r=i(38),o=n(r),l={fetch:function(){return(0,o.default)(!1,"A model or collection with a controlled populate promise cannot be fetched directly"),this.populatePromise},hasPendingPopulate:function(){return!!this.populatePromise&&"pending"===this.populatePromise.state()},_resetPopulate:function(){return this.hasPendingPopulate()||(this._populateDeferred=a.default.Deferred(),this.populatePromise=this._populateDeferred.promise()),
this.populatePromise},_resolvePopulate:function(){return"resolved"===this.populatePromise.state()?this.populatePromise:("rejected"===this.populatePromise.state()&&this._resetPopulate(),this._populateDeferred.resolveWith(this,[this]),this.populatePromise)},_rejectPopulate:function(){return"rejected"===this.populatePromise.state()?this.populatePromise:("resolved"===this.populatePromise.state()&&this._resetPopulate(),this._populateDeferred.rejectWith(this,[this]),this.populatePromise)}};t.default=l,
e.exports=t.default},function(e,t,i){var n,s;n=[i(25),i(29),i(141)],s=function(e,t,i){"use strict";var n=t.extend({model:i,windowSize:{audio:13,video:8},initialize:function(e,t){if(e)throw new Error("Models cannot be passed directly to an UpNextCollection.");this.collection=this.parent.get("playQueue").get("collection"),this.listenTo(this.collection,"reset sync",this._filter),this.listenTo(this.parent,"change:item",this._filter),this.listenTo(this.parent,"change:repeatAll change:repeatItem",this._filter),
this._filter()},_filter:function(){var t=this.parent.get("item"),i=this.collection.findWhere({ratingKey:t.get("ratingKey")}),n=this.collection.indexOf(i),s=e.getChildMediaType(t.get("type")).element,a=this.windowSize[s],r=this.collection.reject(function(e){return e.get("advertisement")}).slice(n+1,n+a);if(this.parent.get("repeatAll")){var o=Math.max(a-r.length,0),l=this.collection.slice(0,Math.min(n,o));r=r.concat(l)}this.set(r)}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){
"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(2),a=n(s),r=i(27),o=n(r),l=i(75),c=n(l),u=i(39),d=n(u),h=function(e,t){return!e.get("isLoopback")&&t.get("isLoopback")?t:!t.get("isLoopback")&&e.get("isLoopback")?e:!e.get("isPrivate")&&t.get("isPrivate")?t:!t.get("isPrivate")&&e.get("isPrivate")?e:!e.get("isHttps")&&t.get("isHttps")?t:!t.get("isHttps")&&e.get("isHttps")?e:e},p=o.default.extend({name:"ConnectionCollection",context:["server"],model:c.default,getBestConnection:function(){
var e=d.default.get("allowHttpsMediaServerConnections"),t=!this.server||this.server.get("isCloud")||e,i=this.filter(function(e){return e.get("isConnected")&&(t||!e.get("isHttps"))});return i.length?a.default.reduce(i,h):void 0},hasBetterConnectionCandidates:function(){var e=this.server&&this.server.get("activeConnection");return this.some(function(t){var i=t.get("isUntested")||t.get("isPending"),n=e?t!==e&&h(t,e)===t:!0;return i&&n})},hasOnlyFailedConnections:function(){return this.every(function(e){
return e.get("isFailed")})}});t.default=p,e.exports=t.default},function(e,t,i){var n,s;n=[i(2),i(15),i(24)],s=function(e,t,i){"use strict";var n=i.extend({urlRoot:"/api/home/users",whitelistedAttrs:["id","admin","protected","restricted","guest","title","username","email","thumb"],convert:function(i){var n=e.isObject(i)?i:t.parseXML(i);return n.User&&(n=n.User),t.parseInteger(n,"id"),t.parseBoolean(n,["admin","protected","restricted","guest"]),n},parse:function(t){var i=this.convert(t);return i=e.pick(i,this.whitelistedAttrs);
},getSaveParams:function(t,n){if(e.isEmpty(t)){var s={};return this.get("restricted")?s.title=this.get("title"):this.isNew()&&(s.invitedEmail=this.get("username")),s}return i.prototype.getSaveParams.apply(this,arguments)}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(67),i(101)],s=function(e,t,i){"use strict";var n=i.extend({whitelistedAttrs:["id","version","metadataType","contentType","title","rootTitle","machineIdentifier","clientIdentifier","Server","Status","MediaSettings","Policy","Location"],
saveAttrs:["version","metadataType","title","rootTitle","machineIdentifier","MediaSettings","Policy","Location"],defaults:function(){return{Status:{},MediaSettings:{},Policy:{},Location:{},Device:{}}},urlRoot:function(){var e=this.get("clientIdentifier");return e?"/devices/"+e+"/sync_items":void 0},sync:function(e,n,s){var a=t.addVersionHeaderForDevice(this.device,s);return i.prototype.sync.call(this,e,n,a)},getSaveParams:function(t,n){if(e.isEmpty(t)){var s=this.pick(this.saveAttrs),a=s.Policy;return e.isBoolean(a.unwatched)&&(a.unwatched=a.unwatched?1:0),
{SyncItem:s}}return i.prototype.getSaveParams.apply(this,arguments)}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(20),i(5),i(16),i(33)],s=function(e,t,i,n,s){"use strict";var a=t.extend({mixins:s,maxCycles:3,maxSize:50,isListening:!1,initialize:function(){this._cache={},this.size=0,this.cycles=[],this.cycle()},startListening:function(){this.isListening||(this.isListening=!0,this.listenTo(i,{"cycle:cache":this.cycle,"clearWhere:cache":this.clearWhere,"clearAll:cache":this.clearAll,
"clearCycles:cache":this.clearCycles}))},get:function(t){var i=this._cache[t];return i&&i._cacheCycle&&this.setItemCycle(i,t,e.first(this.cycles)),i},store:function(t,i){i||(i=this.getItemCacheKey(t)),this.remove(t),i&&(this.startListening(),t._cacheKey=i,this._cache[i]=t,this.size++,t.persistInCache||this.setItemCycle(t,i,e.first(this.cycles)))},getItemCacheKey:function(t){return e.result(t,"cacheKey")},setItemCycle:function(e,t,i){var n=e._cacheCycle;n&&n.hasOwnProperty(t)&&delete n[t],e._cacheCycle=i,
i[t]=e},cycle:function(){this.size>this.maxSize&&(n.warn("Cache overflow, size: "+this.size),e.each(this.cycles.slice(1),this.removeCycle,this)),this.cycles.unshift({}),this.cycles.length>Math.max(this.maxCycles,1)&&this.removeCycle(e.last(this.cycles))},remove:function(e){if(e&&e._cacheKey){var t=e._cacheKey;this._cache.hasOwnProperty(t)&&(delete this._cache[t],this.size--),e._cacheCycle&&(e._cacheCycle.hasOwnProperty(t)&&delete e._cacheCycle[t],delete e._cacheCycle),delete e._cacheKey}},removeCycle:function(t){
e.each(e.values(t),this.remove,this);var i=e.indexOf(this.cycles,t);this.cycles.splice(i,1)},clearWhere:function(t){var i=e.where(e.values(this._cache),t);e.each(i,this.remove,this)},clearAll:function(){e.each(e.values(this._cache),this.remove,this),this.cycles.length=0,this.cycle(),this.stopListening(),this.isListening=!1},clearCycles:function(){for(var e=this.cycles;e.length;)this.removeCycle(e[e.length-1]);this.cycle()}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;
n=[i(2),i(148)],s=function(e,t){"use strict";var i=t.extend({maxCycles:5,maxSize:100,getItemCacheKey:function(t,i){return e.isFunction(t.cacheKey)?(i||(i=t.toJSON()),t.cacheKey(i)):void 0}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";function n(e){return 54e5>=e?(0,r.default)(e):864e5>=e?(0,l.default)(e):6048e5>=e?(0,u.default)(e):(0,h.default)(e)}var s=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var a=i(226),r=s(a),o=i(78),l=s(o),c=i(225),u=s(c),d=i(224),h=s(d);
t.default=n,e.exports=t.default},function(e,t,i){"use strict";function n(e){return e?r.default.unix(e).fromNow():""}var s=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var a=i(12),r=s(a);t.default=n,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(231),a=n(s),r=i(41),o=n(r);t.default=(0,o.default)(a.default),e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{
value:!0});var s=i(239),a=n(s),r=i(41),o=n(r);t.default=(0,o.default)(a.default),e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(163),a=n(s),r=i(41),o=n(r);t.default=(0,o.default)(a.default),e.exports=t.default},function(e,t,i){"use strict";function n(e){return e=parseInt(e,10),e?2>e?(0,r.default)("Mono"):3>e?(0,r.default)("Stereo"):(e-1).toString()+".1":""}var s=i(8).default;Object.defineProperty(t,"__esModule",{value:!0
});var a=i(7),r=s(a);t.default=n,e.exports=t.default},function(e,t){"use strict";function i(e){return e?"dca"===e?"DTS":e.toUpperCase():""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i,e.exports=t.default},function(e,t){"use strict";function i(e,t){var i=parseInt(Math.floor(Math.log(e)/Math.log(1e3)),10);return(e/Math.pow(1e3,i)).toFixed(t)+" "+n[i+1]}Object.defineProperty(t,"__esModule",{value:!0});var n=["bps","kbps","Mbps","Gbps","Tbps"];t.default=i,e.exports=t.default},function(e,t,i){
var n,s;n=[i(2),i(16)],s=function(e,t){"use strict";var i={ORIGINAL:-1,qualities:{},getQualityByIndex:function(t){if(0>t)return{index:this.ORIGINAL};var i={index:t};return e.each(this.qualities,function(n,s){i[s]=e.result(this.qualities,s)[t]},this),i},getQualityCount:function(){var t=e.first(e.keys(this.qualities));return e.result(this.qualities,t).length},getQualityAttribute:function(e){var t;return t=e.isLibraryItem()?e.server.hasLocalConnection()?"localQuality":"remoteQuality":"channelQuality",
"video"!==this.type?this.type+"!"+t:t},getSyncQualityAttribute:function(){return"syncQuality!"+this.type},getCurrentQuality:function(i,n){var s=this.getQualityAttribute(i),a=n.get(s);return a>=this.getQualityCount()&&(t.warn("Quality index "+a+" is out of bounds"),a=n.defaults[s],n.save(s,a)),e.extend(this.getQualityByIndex(a),{attribute:s})},getAvailableQualities:function(e){e||(e={});var t=e.lowestQualityIndex,i=e.highestQualityIndex,n=e.comparator,s=[];i===this.ORIGINAL&&(i=void 0);for(var a=0,r=this.getQualityCount();r>a;a++)if(!(t&&t>a)){
if(i&&a>i)return s;if(n&&n.call(this,a))return s;s.push(this.getQualityByIndex(a))}return s},getResolutionFromSize:function(e){var t=e.split("x"),i=parseInt(t[1],10);return i>2560?"8k":i>1100?"4k":i>720?"1080":i>576?"720":i>480?"576":i>360?"480":"sd"},getHeightFromResolution:function(e){switch(e){case"8k":return 5120;case"4k":return 2560;case"1080":return 1080;case"720":return 720;case"576":return 576;case"480":return 480;case"sd":return 360;default:return 360}},getNearestIndex:function(e,t){if(!t)return this.ORIGINAL;
var i=e.indexOf(t);if(0>i){i=0;for(var n=0,s=e.length;s>n;n++){var a=e[n];if(a>t)break;i=n}}return i}};return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2)],s=function(e){"use strict";function t(t){var i=e.clone(t);return"undefined"!=typeof i.last?(i.end=i.last+1,i.size=i.end-i.start):"undefined"!=typeof i.size?(i.end=i.start+i.size,i.last=i.end-1):"undefined"!=typeof i.end&&(i.last=i.end-1,i.size=i.end-i.start),i}function i(i,n){return e.filter(e.map(i,t),function(e){
return n?e.size>=0:e.size>0})}var n={augment:t,difference:function(e,n,s){e=t(e),n=t(n);var a=[{start:e.start,last:Math.min(e.last,n.start-1)},{start:Math.max(e.start,n.end),last:e.last}];return i(a,s)},union:function(e,n,s){if(e=t(e),n=t(n),e.start>n.start){var a=e;e=n,n=a}var r=[e];return n.start<=e.end?r[0].last=Math.max(n.last,e.last):r.push(n),i(r,s)},degap:function(e,i){var n=t(e);return i=t(i),i.size?(n.start>i.end&&(n={start:i.end,end:n.end}),n.end<i.start&&(n={start:n.start,end:i.start}),
t(n)):n},each:function(e,i,n){e=t(e);for(var s=Math.min(e.start,e.end),a=Math.max(e.start,e.end);a>=s;s++)i.call(n,s)},roundByPage:function(e,i){return e=t(e),t({start:Math.floor(e.start/i)*i,end:Math.ceil(e.end/i)*i})}};return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t){"use strict";function i(e){return e?e.charAt(0).toLowerCase()+e.slice(1):""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i,e.exports=t.default},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{
value:!0});var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n={encode:function(e){var t="",n=void 0,s=void 0,a="",r=void 0,o=void 0,l=void 0,c="",u=0;do n=e.charCodeAt(u++),s=e.charCodeAt(u++),a=e.charCodeAt(u++),r=n>>2,o=(3&n)<<4|s>>4,l=(15&s)<<2|a>>6,c=63&a,isNaN(s)?l=c=64:isNaN(a)&&(c=64),t=t+i.charAt(r)+i.charAt(o)+i.charAt(l)+i.charAt(c),n=s=a="",r=o=l=c="";while(u<e.length);return t},decode:function(e){var t="",n=void 0,s=void 0,a="",r=void 0,o=void 0,l=void 0,c="",u=0,d=/[^A-Za-z0-9\+\/\=]/g;
if(d.exec(e))throw new Error('There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, "+", "/", and "="\nExpect errors in decoding.');e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");do r=i.indexOf(e.charAt(u++)),o=i.indexOf(e.charAt(u++)),l=i.indexOf(e.charAt(u++)),c=i.indexOf(e.charAt(u++)),n=r<<2|o>>4,s=(15&o)<<4|l>>2,a=(3&l)<<6|c,t+=String.fromCharCode(n),64!==l&&(t+=String.fromCharCode(s)),64!==c&&(t+=String.fromCharCode(a)),n=s=a="",r=o=l=c="";while(u<e.length);
return unescape(t)}};t.default=n,e.exports=t.default},function(e,t){"use strict";function i(){return Math.random().toString(36).substr(2)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i,e.exports=t.default},function(e,t){"use strict";function i(e,t){if(!e)return"";if(e.length>t){for(var i=e.substring(0,t-3);/\S/.test(i.charAt(i.length-1))===!1&&i.length>1;)i=i.slice(0,-1);return i+"..."}return e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i,e.exports=t.default},function(e,t){
"use strict";function i(e,t,i){if(!e)return"";if(e.length>t){i=i||Math.floor((t-3)/2);var n=t-3-i;return e.substr(0,i)+"..."+e.substr(e.length-n)}return e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i,e.exports=t.default},function(e,t,i){var n,s;n=[i(2),i(14),i(26),i(16)],s=function(e,t,i,n){"use strict";var s={extensions:{dash:".mpd",hls:".m3u8",http:""},logParams:function(t,i){n.group("Transcoder: "+t+" options"),e.keys(i).forEach(function(e){return n(e+": "+i[e])}),n.groupEnd()},
serializeParams:function(i,n){var s,a={},r={},o=/^X-Plex/;return e.each(i,function(e,t){o.test(t)?r[t]=e:a[t]=e}),a=t.stringifyParams(a),r=t.stringifyParams(r),s=a&&r?a+"&"+r:a||r},image:function(t,i,n){if(!i)return"";var s=n.fallbackServer,a=!1;if(s&&s.get("isConnected"))if(t.get("cloud"))a=!0;else if(!t.get("isFullServer")){var r=!t.get("activeConnection").get("isPrivate"),o=s.get("activeConnection").get("isPrivate");a=r||o}var l=a?s:t,c=l.id===t.id;t.get("cloud")&&(i=a?s.resolveUrl(i,{appendToken:!0
}):t.resolveUrl(i,{appendToken:!0,connection:{scheme:"https",address:"node.plexapp.com",port:"32443"}}));var u={url:t.resolveUrl(i,{useLoopback:c,appendToken:!0}),width:Math.round(parseFloat(n.width)),height:Math.round(parseFloat(n.height))};n.minSize&&(u.minSize=1),n.format&&(u.format=n.format),n.quality&&(u.quality=n.quality),n.filters&&e.each(n.filters,function(e,t){void 0!==e&&(u[t]=e)});var d="/photo/:/transcode?"+this.serializeParams(u,l);return l.resolveUrl(d,{appendToken:!0})},music:function(t,i,n){
var s=e.first(i.get("Media"));if(s){var a=e.first(s.Part);if(a){var r,o;return t.supports("universalMusicTranscoder")?(r=e.extend({path:t.resolveUrl(i.get("key"),{useLoopback:!0}),mediaIndex:0,partIndex:0},n),o="/music/:/transcode/universal/start.mp3"):(r={identifier:i.get("identifier"),url:t.resolveUrl(a.key,{useLoopback:!0}),format:"mp3",audioCodec:"libmp3lame",audioBitrate:320,audioSamples:44100},o="/music/:/transcode/generic.mp3"),this.logParams("Music",r),r=e.extend(r,t.getHeaders()),t.resolveUrl(o+"?"+this.serializeParams(r,t));
}}},video:function(t,n,s,a,r){r||(r={});var o=t.id===n.server.id,l=n.server.get("cloud")?t:n.server,c=e.extend({path:l.resolveUrl(n.get("key"),{useLoopback:o,appendToken:!o}),mediaIndex:i.getMediaIndex(n,s.id),partIndex:i.getPartIndex(s,a.key),protocol:"hls",offset:0,fastSeek:1,directPlay:0,directStream:1,subtitleSize:100,audioBoost:100},r);c.path=c.path.replace(/^http[s]?:\/\/node.plexapp.com:[\d]+\//,t.url()),this.logParams("Video",c);var u=n.get("indirectHttpHeaders");u&&(c.httpCookies=u.Cookie,
c.userAgent=u["User-Agent"]),c=e.extend(c,t.getHeaders());var d=this.extensions[c.protocol],h="/video/:/transcode/universal/start"+d;return t.resolveUrl(h+"?"+this.serializeParams(c,t))}};return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1e3),i(6),i(34)],s=function(e,t,i){"use strict";var n=t.ItemView.extend({className:"circle-progress",template:e,size:30,lineWidth:5,strokeColor:"#cc7b19",hasSize:!1,ui:{canvas:".circle-progress-bar"},bindings:{".circle-progress-text":{
modelAttribute:"text"}},modelEvents:{"change:progress":"onProgressChange"},initialize:function(e){this.size=e.size||this.size,this.lineWidth=e.lineWidth||this.lineWidth,this.strokeColor=e.strokeColor||this.strokeColor,this.size&&(this.$el.width(this.size),this.$el.height(this.size))},drawProgressBar:function(){if(this.progressCanvas&&this.progressContext){this.hasSize||(this.progressCanvas.width=this.size,this.progressCanvas.height=this.size,this.hasSize=!0);var e=this.model.get("progress"),t=e/100;
this.progressContext.lineWidth=this.lineWidth,this.progressContext.strokeStyle=this.strokeColor;var i=this.progressCanvas.width/2,n=this.progressCanvas.height/2,s=i-this.lineWidth,a=-Math.PI/2,r=a+t*Math.PI*2;this.progressContext.clearRect(0,0,this.progressCanvas.width,this.progressCanvas.height),this.progressContext.beginPath(),this.progressContext.arc(i,n,s,a,r,!1),this.progressContext.stroke(),this.progressContext.closePath()}},onRender:function(){this.progressCanvas=this.ui.canvas[0],i.hasCanvas&&(this.progressContext=this.progressCanvas.getContext("2d"),
this.drawProgressBar())},onProgressChange:function(){this.drawProgressBar()}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2)],s=function(e){"use strict";function t(e,t){var i=t.constructor.prototype.validate;return i?i(e):[]}function i(e){var i=this.panes[e],n=a.call(this,i);return 0===t.call(this,n,i).length}function n(e,t){return e.concat(this.panes[t].dependentPanes||[])}function s(){var t=this.$(".change-pane-btn");t.addClass("disabled").removeClass("selected"),
e.each(this.getReachablePanes(),function(e){t.filter("."+e+"-btn").removeClass("disabled")},this),t.filter("."+this.selectedPane+"-btn").addClass("selected")}function a(e){return this[e.model]||this[this.panesModel]||this.model}var r={showPane:function(t){if(t!==this.selectedPane){var i=this.paneRegion.currentView;i&&(this.stopListening(i,"valid",s),this.stopListening(i,"invalid",s),this.$el.removeClass("pane-"+this.selectedPane),this.onPaneHide&&this.onPaneHide(this.selectedPane,i)),this.selectedPane=t;
var n=this.panes[t],r=n.constructor,o=this.paneConstructorArg?this.paneConstructorArg():{},l=new r(e.extend(o,{model:a.call(this,n)}));if(l.onModalClose){this._paneOnModalCloseCallbacks||this.listenToOnce(this,"close",function(){e.each(this._paneOnModalCloseCallbacks,function(e){e[1].call(e[0])},this),this._paneOnModalCloseCallbacks=null});var c=this._paneOnModalCloseCallbacks||[];c.push([l,l.onModalClose]),this._paneOnModalCloseCallbacks=e.uniq(c,function(e){return e[1]})}this.listenTo(l,"valid",s),
this.listenTo(l,"invalid",s),s.call(this),this.onPaneShow&&this.onPaneShow(t,l),this.$el.addClass("pane-"+t),this.paneRegion.show(l),s.call(this)}},getReachablePanes:function(){for(var t,s,a=e.reduce(this.panes,function(t,i){return e.union(t,i.dependentPanes||[])},[]),r=e.filter(e.keys(this.panes),function(t){return!e.contains(a,t)}),o=r;o.length;)t=e.filter(o,i,this),s=s||t.length!==o.length,o=e.reduce(t,n,[],this),r=r.concat(o);return r.isAnyInvalid=s,r},onChangePaneClick:function(e){e.preventDefault();
var t=this.$(e.currentTarget);t.isDisabled()||this.showPane(t.data("pane"))}};return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1040),i(2),i(4),i(6),i(7),i(5),i(9),i(40),i(275)],s=function(e,t,i,n,s,a,r,o,l){"use strict";var c=n.Layout.extend({className:"dashboard-container hidden",template:e,ui:{previousBtn:".previous-btn",nextBtn:".next-btn",list:".dashboard-list-container"},regions:{list:".dashboard-list-container"},events:{"click .previous-btn":"onPreviousClick",
"click .next-btn":"onNextClick"},onlyAfterRender:["onResize","onCollectionChange"],initialize:function(e){this.key=e.key,this.label=s("onDeck"===e.key?"On Deck":"Recently Added"),this.listenTo(a,{resize:this.onResize,"dashboard:update":this.onDashboardUpdate}),this.listenTo(r,"change:primaryServer",this.setup),this.setup()},setup:function(){var e=r.get("primaryServer");this.$el.addClass("hidden"),this.list.close(),!e||e.get("shared")&&!e.get("multiuser")||(this.collection=new o([],{server:e,url:"/library/"+this.key
}),this.listenTo(this.collection,"sync add remove",t.debounce(this.onCollectionChange)),this.collection.fetch({reset:!0,scope:"page"}))},serializeData:function(){return{label:this.label}},onResize:function(){this.list.currentView&&this.list.currentView.measureList&&this.list.currentView.measureList()},onDashboardUpdate:function(){("onDeck"===this.key||"recentlyAdded"===this.key)&&this.collection&&this.collection.fetch({scope:"page"})},onCollectionChange:function(){this.collection.length?this.list.currentView?this.listView.reorder():(this.$el.removeClass("hidden"),
this.listView=new l({collection:this.collection,$container:this.$el,continuousPlay:!0,sorted:!0}),this.listenTo(this.listView,"scroll",this.onListScroll),this.list.show(this.listView)):(this.$el.addClass("hidden"),this.list.currentView&&(this.list.close(),this.stopListening(this.listView,"scroll",this.onListScroll)))},onListScroll:function(e,t,i){this.ui.previousBtn.toggleClass("disabled",1>=t),this.ui.nextBtn.toggleClass("disabled",t>=e.pages),this.ui.list.css("transform","translate("+i+"px, 0)");
},onPreviousClick:function(e){e.preventDefault(),this.ui.previousBtn.isDisabled()||this.list.currentView.previous()},onNextClick:function(e){e.preventDefault(),this.ui.nextBtn.isDisabled()||this.list.currentView.next()}});return c}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1071),i(2),i(4),i(6),i(26),i(47),i(11)],s=function(e,t,i,n,s,a,r){"use strict";var o=n.ItemView.extend({tagName:"span",className:"dropdown",template:e,modelEvents:{"change:Media":"render","change:streams":"render"
},events:{"click .dropdown-menu a":"onStreamClick"},initialize:function(e){this.streamType=a.get(e.type),this.disabled=e.disabled},serializeData:function(){var e=this.model.server.get("multiuser"),i=this.model.server.get("shared"),n=t.first(this.model.get("Media")),a=s.getStreams(n,{streamType:this.streamType.id}),r=s.getStreams(n,{streamType:this.streamType.id,selected:!0}),o=t.first(r);return{showDropdown:!this.disabled&&a.length>1&&(!i||e),type:this.streamType.typeString,streams:a,selectedStream:o
}},onRender:function(){this.$el.attr("id",this.streamType.typeString+"-dropdown")},onStreamClick:function(e){e.preventDefault();var t=i(e.currentTarget),n=t.data("id");r.execute("selectStream",{item:this.model,streamType:this.streamType,streamID:n})}});return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(19),i(6),i(5),i(159),i(241),i(81),i(548),i(375)],s=function(e,t,i,n,s,a,r,o){"use strict";var l=o.extend({mixins:r,paginated:!0,scrollPosition:0,scrollDirection:"down",
mergeDelay:5e3,viewsByModel:{},initialize:function(t){o.prototype.initialize.apply(this,arguments),e.bindAll(this,"onResize","onScroll"),this.mediaActions=t.mediaActions,r.initialize.apply(this,arguments),null!=t.paginated&&(this.paginated=t.paginated),this.channelName=t.channelName||"content",this.sizeProperty=this.paginated?"totalSize":"length",this.initializingScrollPosition=!0,this.merge=e.throttle(e.bind(this.merge,this),this.mergeDelay),this.collection.scrollPosition&&(this.restoringScrollPosition=!0,
this.scrollPosition=this.collection.scrollPosition),this.listenTo(this.collection,"reset",this.onCollectionReset),this.listenTo(this.collection,"add",this.onCollectionAdd),this.listenTo(this.collection,"remove",this.onCollectionRemove),n.trigger(this.channelName+".subscribe:resize",this.onResize),n.trigger(this.channelName+".subscribe:scroll",this.onScroll),n.trigger("start:scrollListener")},getLockIndexes:function(){var t,i=this.getVisibleBounds(),n=this.getLockBounds(),s=this.getIndexBounds(),a=e.range(i.from,i.to+1),r=e.range(i.to+1,n.to+1),o=e.range(i.from-1,n.from-1,-1);
return"down"===this.scrollDirection?(o.reverse(),t=a.concat(r,o)):(a.reverse(),o.reverse(),t=a.concat(o,r)),e.filter(t,function(e){return e>=s.from&&e<=s.to},this)},getVisibleBounds:function(){if(this.itemHeight&&this.itemsPerRow&&this.itemsPerPage){var e=Math.floor(this.scrollPosition/this.itemHeight)*this.itemsPerRow;return e>this.getTotalSize()&&(this.scrollPosition=0,e=0),{from:e,to:e+this.itemsPerPage-1+2*this.itemsPerRow}}return{from:0,to:0}},getLockBounds:function(){var e=this.getPageSize(),t=this.getVisibleBounds();
return{from:t.from-e,to:t.to+e}},prepareCells:function(t){var i=this.getIndexBounds();this.pool.filter(function(e){return i.from<=e.id&&i.to>=e.id},this);var n=e.reject(t,this.getModelForId,this);if(n.length){if(this.collection.populatePromise&&"pending"===this.collection.populatePromise.state())return void this.collection.populatePromise.done(e.bind(this.prepareCells,this,t));var a=s.roundByPage({start:e.min(n),last:e.max(n)},2*this.getPageSize());a.reloadThreshold=a.size;var r=this.collection.populateRange(a);
this.trigger("change:loading",!0,{prepend:"up"===this.scrollDirection}),r.always(e.bind(function(){this.trigger("change:loading",!1)},this))}},moveCell:function(e){if(e.updatedCSS||(e.view.$el.css({position:"absolute"}),e.updatedCSS=!0),this.itemWidth&&this.itemsPerRow){var t=e.id%this.itemsPerRow,i=Math.floor(e.id/this.itemsPerRow);e.view.$el.translate(t*this.itemWidth,i*this.itemHeight),e.movedToIndex=e.id}},moveElement:function(){},createCellView:function(n){var s=i.getOption(this,"itemViewOptions");
e.isFunction(s)&&(s=s.call(this,n)),s=e.clone(s),s.model=this.getModelForId(n.id),s.mediaActions=this.mediaActions,n.el&&(s.el=n.el);var a=i.getOption(this,"itemView");a._ensureElementExtension||(a._ensureElementExtension=a.extend({_ensureElement:function(){var i=this.el?e.result(this,"el"):t.$("<"+e.result(this,"tagName")+">");this.setElement(i,!1);var n=e.extend({},e.result(this,"attributes"));this.id&&(n.id=e.result(this,"id")),this.className&&(n.class=e.result(this,"className")),this.$el.attr(n);
}}));var r=new a._ensureElementExtension(s);return n.el||(this.$el.append(r.$el),n.el=r.el),this.forwardItemViewEvents(r),r.remove=function(){return this.stopListening(),this.$el.unbind(),this.$el.empty(),this},r},getPageSize:function(){return this.itemsPerPage||1},clearAllReusedCells:function(){this.pool.each(function(e){var t=e.filledWithIndex===e.id,i=-1===e.filledWithIndex;t||i||(this.clearCell(e),e.filledWithIndex=-1)},this)},getTotalSize:function(){return this.collection[this.sizeProperty]||0;
},fillCell:function(e){var t=this.getModelForId(e.id);return t&&t===e.view.model&&!e.view.isClosed?!0:(this.clearCell(e),t?(e.view=this.createCellView(e),e.view.render(),this.indexViewByModel(e.view),!0):!1)},clearCell:function(e){var t=e.view;t.model&&delete this.viewsByModel[t.model.cid],t.isClosed||t.close()},getIndexBounds:function(){return{from:0,to:this.getTotalSize()-1}},getModelForId:function(e){return this.collection.at(e-this.collection.populatedRange.start)},getViewForModel:function(e){
return this.viewsByModel[e.cid]},indexViewByModel:function(e){this.viewsByModel[e.model.cid]=e},render:function(){this.updateHeight(),this.restoringScrollPosition||(o.prototype.render.apply(this,arguments),this.clearAllReusedCells())},updateHeight:function(){this.recalculateHeight&&(this.recalculateHeight=!1,this.listHeight=Math.ceil(this.getIndexBounds().to/this.itemsPerRow)*this.itemHeight-this.itemMarginBottom,this.$el.css("height",this.listHeight),this.initScrolling())},itemViewOptions:function(){
var t,i,n=this.collection.section;if(n){var s=n.get("currentType"),a=this.collection.getSort();if(t=s&&s.get("typeString"),a){var r=a.split(":");r.length&&(i=e.first(r))}}else t="clip";return{type:t,sort:i}},measureItem:function(){var t=this.createCellView({id:this.collection.populatedRange.start});t.model||(this.remeasureItem=!0),t.render(),t.$el.css("visibility","hidden");var i=t.$el.appendTo(this.$el);e.defer(e.bind(function(){this.itemWidth=i.outerWidth(!0),this.itemHeight=i.outerHeight(!0),this.itemMarginRight=parseInt(i.css("margin-right"),10),
this.itemMarginBottom=parseInt(i.css("margin-bottom"),10),t.close(),t.$el.remove(),this.measureContainer(),this.render()},this))},measureContainer:function(){var e=parseInt(this.$el.css("margin-top"),10),t=parseInt(this.$el.css("margin-bottom"),10);this.containerWidth=this.$el.width(),this.containerHeight=this.containerSize.height-e-t,this.itemsPerRow=Math.floor(this.containerWidth/this.itemWidth),this.itemsPerColumn=Math.floor((this.containerHeight+this.itemMarginBottom)/this.itemHeight),this.itemsPerPage=this.itemsPerRow*this.itemsPerColumn,
this.itemsPadding=this.itemsPerRow*Math.max(this.itemsPerColumn,2),this.itemsPerPageWithPadding=2*this.itemsPadding+this.itemsPerPage,this.itemHeight&&(this.recalculateHeight=!0)},scrollToIndex:function(e){var t=Math.floor(e/this.itemsPerRow),i=t*this.itemHeight;this.restrictScrollDirection=!0,n.trigger("update:scrollPosition",i)},merge:function(){if(!this.isClosed){var t=this.collection.populatedRange,i=t.start,n=t.end>this.itemsPerPageWithPadding?t.end:this.itemsPerPageWithPadding;if(n){if(i>0)return this.scrollDirection="up",
void this.collection.populateRange({start:0,size:i});this.collection.pageStart=i,this.collection.pageSize=n;var s=this.collection.fetch();s.done(e.bind(function(){this.collection.length<n&&(n=this.collection.length),this.collection.populatedRange={start:t.start,end:t.start+n,size:n},this.collection.scrollPosition=this.scrollPosition,this.onCollectionReset()},this))}}},initScrolling:function(){this.initializingScrollPosition&&(this.restrictScrollDirection=!0,this.initializingScrollPosition=!1,this.restoringScrollPosition=!1,
this.collection.scrollPosition?n.trigger("update:scrollPosition",this.collection.scrollPosition):this.containerScrollPosition.scrollTop>0&&n.trigger("update:scrollPosition",0))},onDeselectAll:function(t){e.each(t,function(e){this.pool.each(function(t){t.view.model===e&&t.view.deselect()},this)},this)},onClose:function(){o.prototype.onClose.apply(this,arguments),r.onClose.apply(this,arguments),n.trigger("stop:scrollListener"),n.trigger(this.channelName+".unsubscribe:resize",this.onResize),n.trigger(this.channelName+".unsubscribe:scroll",this.onScroll),
this.collection.scrollPosition=this.scrollPosition},onCollectionReset:function(t,i){a.cancel(this.cid),this.pool.each(function(e){e.id=e.filledWithIndex=this.collection.indexOf(e.view.model)},this),this.pool.reindex(),i&&i.previousModels&&e.each(i.previousModels,this.onCollectionRemove,this),this.initializingScrollPosition=!0,this.measureItem(),this.render(),this.getTotalSize()||this.trigger("change:loading",!1)},onCollectionAdd:function(e){this.remeasureItem&&(this.remeasureItem=!1,this.measureItem(e));
},onCollectionRemove:function(e){var t=this.pool.findByModel(e),i=t&&t.view||{model:e,deselect:function(){}};this.triggerMethod("item:removed",i)},onResize:function(e){this.containerSize=e,this.measureItem(),this.scrollDirection=this.containerWidth>this.$el.width()?"up":"down",this.render()},onScroll:function(e){this.containerScrollPosition=e,this.restoringScrollPosition||(this.itemWidth||this.measureItem(),0!==this.containerScrollPosition.scrollTop&&this.containerScrollPosition.scrollTop<this.scrollPosition?this.scrollDirection="up":this.scrollDirection="down",
this.restrictScrollDirection&&(this.scrollDirection="down",this.restrictScrollDirection=!1),this.scrollPosition=this.containerScrollPosition.scrollTop,this.render())}});return l}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1118),i(2),i(48),i(30)],s=function(e,t,i,n){"use strict";var s=i.extend({className:"striped-list-item media-list-item media-details-list-item",template:e,ui:t.extend({poster:".media-poster"},i.prototype.ui),initialize:function(e){i.prototype.initialize.apply(this,arguments),
this.model&&this.createImageView()},createImageView:function(){var e=this.type;"episode"===e&&(e="show"),this.image=new n({model:this.model,type:e,getUrl:this.getPosterUrl,height:150})},bindings:t.extend({},i.prototype.bindings,{".media-count-badge":{modelAttribute:"Media",formatter:function(e){return e&&e.length||0},autohide:function(e){return/^(clip|userPlaylistItem)$/.test(this.model.get("type"))?!1:e>1}},".unwatched-count-badge":{modelAttribute:"unviewedLeafCount",autohide:function(e){return this.shared&&!this.multiuser?!1:/^(artist|album)$/.test(this.model.get("type"))?!1:!!e;
}},".media-tagline":{modelAttribute:"tagline",autohide:!0},".media-summary":{modelAttribute:"summary",autohide:!0}})});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(81),i(18)],s=function(e,t){"use strict";var i=t.extend({mixins:[e],onAddChild:function(e){this.forwardItemViewEvents(e)}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1164),i(2),i(31)],s=function(e,t,i){"use strict";var n=i.extend({name:"libraryFailureModal",className:"confirm-modal modal modal-sm fade",
template:e,events:t.extend({"click .confirm-btn":"hide"},i.prototype.events),serializeData:function(){return{serverID:this.model.id,isSignedIn:"ok"===this.model.get("myPlexSigninState"),hasPlexPass:this.model.get("myPlexSubscription")}}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(19),i(6),i(5),i(28),i(26),i(17),i(113),i(11),i(9),i(209),i(1280)],s=function(e,t,i,n,s,a,r,o,l,c,u,d){"use strict";var h=n.Layout.extend({events:{fullscreenchange:"onFullscreenChange",
webkitfullscreenchange:"onFullscreenChange",mousewheel:"onMouseWheel"},shortcutListeners:function(){return{"shortcut:playPause":this.getListenerFor("playPause"),"shortcut:seekBackward":this.getListenerFor("seekBackward"),"shortcut:seekForward":this.getListenerFor("seekForward"),"shortcut:stepBackward":this.getListenerFor("stepBackward"),"shortcut:stepForward":this.getListenerFor("stepForward"),"shortcut:decreaseVolume":this.getListenerFor("decreaseVolume"),"shortcut:increaseVolume":this.getListenerFor("increaseVolume"),
"shortcut:skipPrevious":this.getListenerFor("skipPrevious"),"shortcut:skipNext":this.getListenerFor("skipNext"),"shortcut:toggleFullScreen":this.getListenerFor("toggleFullScreen"),"shortcut:stop":this.getListenerFor("stop")}},initialize:function(i){var n=i.playerModelClass||d;if(this.controller=i.controller,this.isNew=!i.controller,this.type=i.type,this.media=i.media,this.offset=i.offset,this.autoplay=i.autoplay,this.$el.addClass(this.type),this.isNew){var s=u.get("primaryPlayer");this.controller=l.getInstance(this.type),
!this.model&&this.playQueue&&(this.model=this.playQueue.get("selectedItem")),this.playQueue=i.playQueue,this.playerModel=new n({item:this.model,playQueue:this.playQueue,volume:this.volumeSettingsKey?o.get(this.volumeSettingsKey):o.getInstance().defaults.volume,friendlyName:s?s.get("friendlyName"):null})}else this.model=this.controller.model.get("item"),this.playQueue=this.controller.model.get("playQueue"),this.playerModel=this.controller.model;this.throttledPersistResumePlayQueue=e.throttle(e.bind(this.persistPlayQueue,this),1e3),
this.$document=t(document),this.$document.on("MSFullscreenChange",e.bind(this.onFullscreenChange,this)),this.$document.on("mozfullscreenchange",e.bind(this.onFullscreenChange,this))},addListeners:function(){this.listenTo(i.history,"route",this.onRouteChange),this.listenTo(u,"change:primaryPlayer",this.onPrimaryPlayerChange),this.listenTo(this.playerModel,{"change:item":this.onPlayerItemChange,"change:state":this.onPlayerStateChange,"change:volume":this.onPlayerVolumeChange,"change:finished":this.onPlayerFinishedChange,
"change:position":this.onPlayerPositionChange}),this.controlsView&&this.listenTo(this.controlsView,{play:this.getListenerFor("play"),pause:this.getListenerFor("pause"),"change:position":this.getListenerFor("setPosition"),"change:volume":this.getListenerFor("setVolume"),enterFullscreen:this.enterFullscreen,exitFullscreen:this.exitFullscreen,previous:this.getListenerFor("skipPrevious"),next:this.getListenerFor("skipNext"),skip:this.getListenerFor("skipTo"),remove:this.getListenerFor("removeItem"),move:this.getListenerFor("moveItem"),
minimize:this.getListenerFor("minimize"),maximize:this.getListenerFor("maximize"),toggleShuffle:this.getListenerFor("toggleShuffle"),nextRepeat:this.getListenerFor("nextRepeat"),stop:this.getListenerFor("stop"),"navigate:grandparent":this.getListenerFor("navigateToGrandparent"),"navigate:item":this.getListenerFor("navigateToItem")}),this.listenTo(s,e.result(this,"shortcutListeners"))},startPlayback:function(e){e||(e={}),this.controller.load({model:this.playerModel,autoplay:e.autoplay,silent:this.isNowPlaying(),
offset:e.offset})},continuePlayback:function(){},updatePageTitle:function(){var e=this.playerModel.get("state");if(e===a.states.STOPPED)return void(document.title="Plex");var t,i=this.playerModel.get("item"),n=i.get("type");if("episode"===n){var s=r.getSeasonEpisodeIndex({seasonIndex:i.get("parentIndex"),episodePrefix:" \xb7 E{1}",episodeIndex:i.get("index"),date:i.get("originallyAvailableAt"),noLeadingZero:!0});t=i.get("grandparentTitle")+" - "+s}else if("track"===n){var o=i.get("originalTitle")||i.get("grandparentTitle");
!o&&i.parent&&(o=i.parent.get("parentTitle")||i.parent.get("title")),t=o?o+" - "+i.get("title"):i.get("title")}else t=i.get("title");e===a.states.PLAYING||e===a.states.BUFFERING?document.title="\u25b6 "+t:document.title=t},getListenerFor:function(t){return e.isFunction(this[t])?this[t]:e.bind(this.controller[t],this.controller)},minimize:function(){this.isSwitchingPlayers=!0,c.execute("playMedia",{item:this.model,controller:this.controller,useMiniPlayer:!0,isSwitchingPlayers:!0})},maximize:function(){
this.isSwitchingPlayers=!0,c.execute("playMedia",{item:this.model,controller:this.controller,isSwitchingPlayers:!0})},enterFullscreen:function(){var e=this.el.requestFullScreen||this.el.webkitRequestFullScreen||this.el.mozRequestFullScreen||this.el.msRequestFullscreen;e.call(this.el)},exitFullscreen:function(){var e=document.cancelFullScreen||document.webkitCancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen;e.call(document)},toggleFullScreen:function(){this.playerModel.get("showEnterFullscreen")?this.enterFullscreen():this.exitFullscreen();
},stop:function(){this.controller.stop(),s.trigger("hide:player",this)},navigateToGrandparent:function(){var e=this.getNavigationGrandparentKey();this.navigateToLibraryItem(e)||this.navigateToChannelItem()},navigateToItem:function(){var e=this.getNavigationKey();this.navigateToLibraryItem(e)||this.navigateToChannelItem(e)},navigateToLibraryItem:function(e){return e&&this.model.isLibraryItem()?(s.trigger("navigate","details",{serverID:this.model.server.id,key:e}),!0):!1},navigateToChannelItem:function(e){
var t=this.model.channel;return t?(s.trigger("navigate","channel",{serverID:this.model.server.id,channelID:t.id?t.id:t.get("identifier"),key:e}),!0):!1},getNavigationGrandparentKey:function(){var e=this.model.get("grandparentKey");if(!e&&this.model.parent&&(e=this.model.parent.get("parentKey")),e)return e;var t=this.model.get("parentKey");return!t&&this.model.parent&&(t=this.model.parent.get("key")),t},getNavigationKey:function(){return this.model.get("key")},isNowPlaying:function(){var e=u.get("primaryPlayer");
if(!e)return!1;var t=e.get("nowPlaying");return!!t.get(this.model.get("ratingKey"))},canAutoplay:function(e){return e!==a.states.PAUSED},persistPlayQueue:function(){var e=this.playerModel;if(e){var t=e.get("state");return t===a.states.STOPPED?void c.execute("persistPlayQueue",null):void c.execute("persistPlayQueue",{playQueue:this.playQueue,position:e.get("position"),autoplay:!1})}},onRender:function(){this.isNew?this.startPlayback({autoplay:this.canAutoplay()&&this.autoplay,offset:this.offset}):this.continuePlayback();
},onClose:function(){if(this.$document.off("MSFullscreenChange"),this.$document.off("mozfullscreenchange"),!this.isSwitchingPlayers&&(this.controller.stop(),!this.controller.model)){var e=this.model.server.get("playQueueManager"),t=e.getFor(this.model);t===this.playQueue&&e.remove(t.get("mediaType"))}},onRouteChange:function(){this.isMini||s.trigger("hide:player",this)},onPrimaryPlayerChange:function(e,t){var i=this.playerModel.get("state"),n=this.playerModel.get("position"),s=this.controller.mediaElement;
this.playerModel.set("ready",!1),this.playerModel.set("friendlyName",t?t.get("friendlyName"):null),this.controller.stop(),this.controller=l.getInstance(this.type),this.stopListening(),this.addListeners(),this.startPlayback({offset:n,autoplay:this.canAutoplay(i),mediaElement:s})},onPlayerItemChange:function(e,t){this.playQueue.set("selectedItem",t),this.model=this.playQueue.get("selectedItem"),this.updatePageTitle()},onPlayerStateChange:function(e,t){this.updatePageTitle(),this.persistPlayQueue()},
onPlayerVolumeChange:function(e,t){this.volumeSettingsKey&&o.save(this.volumeSettingsKey,t)},onPlayerFinishedChange:function(e,t){if(t){var i=a.getElementByType(this.type);this.model.server.get("playQueueManager").remove(i),s.trigger("hide:player",this)}},onPlayerPositionChange:function(e,t){this.throttledPersistResumePlayQueue()},onFullscreenChange:function(){var e=!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement);this.playerModel.set("showEnterFullscreen",!e),
this.playerModel.set("showExitFullscreen",e)},onMouseWheel:function(e){e.deltaY>0?s.trigger("shortcut:increaseVolume"):e.deltaY<0&&s.trigger("shortcut:decreaseVolume")}});return h}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(174)],s=function(e,t){"use strict";var i=t.extend({className:"player mini-player",isMini:!0,regions:{controls:".mini-player-controls"},shortcutListeners:function(){var i=t.prototype.shortcutListeners.apply(this,arguments);return e.omit(i,"shortcut:stop");
}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1227),i(6),i(57),i(7),i(30),i(61),i(698),i(695),i(290),i(134),i(743),i(264)],s=function(e,t,i,n,s,a,r,o,l,c,u,d){"use strict";var h=t.Layout.extend({className:"mini-controls",template:e,muted:!1,mutedVolume:0,ui:{poster:".media-poster",previousBtn:".previous-btn",nextBtn:".next-btn",volumeBtn:".volume-btn",shuffleBtn:".shuffle-btn",repeatBtn:".repeat-btn",scrubPreview:".mini-player-scrub-preview",dropdown:"#player-actions-dropdown"
},regions:{rating:".rating-container",dropdown:"#player-actions-dropdown",seekBar:".seek-bar-container",volume:".player-volume-slider-container",playQueue:".player-play-queue-container"},modelEvents:{"change:item":"onItemChange","change:volume":"onVolumeChange","change:canSkipNextMessage":"onCanSkipNextMessageChange"},events:{"click .volume-btn":"onVolumeClick"},triggers:{"click .play-btn":{event:"play",preventDefault:!0},"click .pause-btn":{event:"pause",preventDefault:!0},"click .previous-btn":{
event:"previous",preventDefault:!0},"click .next-btn":{event:"next",preventDefault:!0},"click .shuffle-btn":{event:"toggleShuffle",preventDefault:!0},"click .repeat-btn":{event:"nextRepeat",preventDefault:!0},"click .maximize-btn":{event:"maximize",preventDefault:!0},"click .stop-btn":{event:"stop",preventDefault:!0},"click .media-poster-container":{event:"navigate:item",preventDefault:!0},"click .grandparent-title":{event:"navigate:grandparent",preventDefault:!0},"click .item-title":{event:"navigate:item",
preventDefault:!0}},onlyAfterRender:["onVolumeChange","onCanShuffleChange","onShuffledChange","onCanRepeatChange","onRepeatChange","updateRadioStyling"],initialize:function(e){var t=this.model.get("item");this.image=new s({model:t,type:t.get("type"),getUrl:this.getPosterUrl,height:80,exposeUrl:!0}),this.seekBarView=new l({model:this.model}),this.playQueueDropdown=new d({model:this.model,collection:e.upNextCollection}),this.volumeSlider=new c({className:"player-volume-slider player-slider",value:this.model.get("volume")
}),this.listenTo(this.model,{"change:canShuffle":this.onCanShuffleChange,"change:shuffled":this.onShuffledChange,"change:canRepeat":this.onCanRepeatChange,"change:repeatAll change:repeatItem":this.onRepeatChange}),this.listenTo(this.image,"load",this.onPosterLoad),this.listenTo(this.seekBarView,"change:value",this.onSeekBarValueChange),this.listenTo(this.seekBarView,"hover",this.onSeekBarHover),this.listenTo(this.volumeSlider,"change:value",this.onVolumeSliderValueChange),this.listenTo(this.playQueueDropdown,{
"itemview:skip":this.onSkip,"itemview:remove":this.onRemove,move:this.onMove})},getPosterUrl:function(e){return e=e||this.model.get("parentThumb")||this.model.get("grandparentThumb"),e||(this.model.parent?e=this.model.parent.get("thumb"):this.model.channel&&(e=this.model.channel.get("thumb"))),e},updatePosterTitle:function(e){var t=e.get("parentTitle")||e.get("title");this.ui.poster.attr({"data-image-title":t,"data-title":e.get("title"),"data-parent-title":e.get("parentTitle"),"data-grandparent-title":e.get("originalTitle")||e.get("grandparentTitle")
})},updateVolumeBtn:function(e){var t=this.ui.volumeBtn;e>50?(this.muted=!1,t.addClass("high"),t.removeClass("low mute")):50>=e&&e>0?(this.muted=!1,t.addClass("low"),t.removeClass("high mute")):(this.muted=!0,t.addClass("mute"),t.removeClass("high low"))},updateShuffleBtn:function(e,t){this.ui.shuffleBtn.toggleClass("disabled",!e),this.ui.shuffleBtn.toggleClass("selected",!!t)},updateRepeatBtn:function(e,t,i){var n=this.ui.repeatBtn;n.toggleClass("disabled",!e),i&&!t?(n.addClass("one"),n.addClass("selected")):t&&!i?(n.removeClass("one"),
n.addClass("selected")):(n.removeClass("one"),n.removeClass("selected"))},updateRatingView:function(e){if("track"===e.get("type")){var t,i=e.isLibraryItem(),n=this.model.get("playQueue"),s=n&&n.get("isRadio"),l=e.get("advertisement");l?t=o:s?t=r:i&&(t=a),t&&this.rating.show(new t({model:e}))}},updateMoreActionsDropdown:function(){var e=this.model.get("item"),t=this.model.get("playQueue");return t&&t.get("isRadio")?void this.ui.dropdown.addClass("hidden"):(this.ui.dropdown.removeClass("hidden"),void this.dropdown.append(new u({
model:e,playQueue:t})))},updateControlTooltips:function(){var e=this.model.get("item"),t=e.get("advertisement")?n("Your mix will resume shortly."):this.model.get("canSkipNextMessage");this.ui.nextBtn.attr({title:t,"data-original-title":t}),this.$el.tooltip({selector:".next-btn",container:"body",placement:"top"})},updateRadioStyling:function(){var e=this.model.get("playQueue");this.$el.toggleClass("mixradio","mixradio"===e.get("stationService"))},bindings:{".grandparent-title":{modelAttribute:"item",
autohide:!0,formatter:function(e,t){var i=this.model.get("playQueue");t.toggleClass("clickable",!i.get("isRadio"));var n=e.get("originalTitle")||e.get("grandparentTitle");return n?n:(e.channel?n=e.channel.get("title"):e.parent&&(n=e.parent.get("parentTitle")||e.parent.get("title")),n)}},".item-title":{modelAttribute:"item",autohide:!0,formatter:function(e,t){var i=this.model.get("playQueue");return t.toggleClass("clickable",!i.get("isRadio")),e.get("title")}},".previous-btn":{modelAttribute:"canSkipPrevious",
manual:!0,formatter:function(e,t){t.toggleClass("disabled",!e)}},".play-btn":{modelAttribute:"paused",modelListeners:["paused","canPlayPause"],manual:!0,autohide:!0,formatter:function(e,t){return t.toggleClass("disabled",!this.model.get("canPlayPause")),e}},".pause-btn":{modelAttribute:"paused",modelListeners:["paused","canPlayPause"],manual:!0,autohide:!0,formatter:function(e,t){return t.toggleClass("disabled",!this.model.get("canPlayPause")),!e}},".stop-btn":{modelAttribute:"canStop",manual:!0,
autohide:!0},".next-btn":{modelAttribute:"canSkipNext",manual:!0,formatter:function(e,t){t.toggleClass("disabled",!e)}},".shuffle-btn":{modelAttribute:"showShuffle",manual:!0,autohide:!0},".repeat-btn":{modelAttribute:"showRepeat",manual:!0,autohide:!0},".seek-bar-container":{modelAttribute:"showSeekBar",manual:!0,autohide:!0},".player-position":{modelAttribute:"position",formatter:function(e){return i(e)}},".player-duration":{modelAttribute:"duration",formatter:function(e){return e?i(e):!1}},".volume-btn":{
modelAttribute:"canSetVolume",manual:!0,autohide:!0,formatter:function(e,t){return this.$el.toggleClass("show-volume",e),e}},".maximize-btn":{modelAttribute:"showMaximize",manual:!0,autohide:!0},".media-poster-container":{modelAttribute:"playQueue",manual:!0,formatter:function(e,t){t.toggleClass("clickable",!e.get("isRadio"))}}},onRender:function(){var e=this.model.get("item");this.updatePosterTitle(e),this.updateRatingView(e),this.image.setElement(this.ui.poster),this.updateControlTooltips(),this.updateMoreActionsDropdown(),
this.seekBar.append(this.seekBarView),this.volume.show(this.volumeSlider),this.playQueue.show(this.playQueueDropdown),this.updateShuffleBtn(this.model.get("canShuffle"),this.model.get("shuffled")),this.updateRepeatBtn(this.model.get("canRepeat"),this.model.get("repeatAll"),this.model.get("repeatItem")),this.updateVolumeBtn(this.model.get("volume")),this.updateRadioStyling()},onClose:function(){this.image.close()},onItemChange:function(e,t){this.image.src=null,this.image.setModel(t),this.image.render(),
this.updatePosterTitle(t),this.updateRatingView(t),this.updateControlTooltips(),this.updateMoreActionsDropdown(),this.updateRadioStyling()},onCanSkipNextMessageChange:function(){this.updateControlTooltips()},onVolumeChange:function(e,t){this.volumeSlider.displayValue(t),this.updateVolumeBtn(t)},onCanShuffleChange:function(e,t){this.updateShuffleBtn(t,e.get("shuffled"))},onShuffledChange:function(e,t){this.updateShuffleBtn(e.get("canShuffle"),t)},onCanRepeatChange:function(e,t){this.updateRepeatBtn(t,this.model.get("repeatAll"),this.model.get("repeatItem"));
},onRepeatChange:function(e,t){this.updateRepeatBtn(e.get("canRepeat"),this.model.get("repeatAll"),this.model.get("repeatItem"))},onPosterLoad:function(e){this.trigger("load:poster",e)},onSeekBarValueChange:function(e){this.trigger("change:position",e)},onSeekBarHover:function(e){e?(this.ui.scrubPreview.removeClass("hidden"),this.ui.scrubPreview.text(i(e.time)),this.ui.scrubPreview.css("left",e.position-this.ui.scrubPreview.width()/2+"px")):this.ui.scrubPreview.addClass("hidden")},onVolumeSliderValueChange:function(e){
this.trigger("change:volume",e)},onVolumeClick:function(e){e.preventDefault(),this.muted?(this.mutedVolume>0?this.trigger("change:volume",this.mutedVolume):this.trigger("change:volume",100),this.muted=!1,this.mutedVolume=0):(this.muted=!0,this.mutedVolume=this.model.get("volume"),this.trigger("change:volume",0))},onSkip:function(e,t){this.trigger("skip",t)},onRemove:function(e,t){this.trigger("remove",t)},onMove:function(e,t){this.trigger("move",e,t)}});return h}.apply(t,n),!(void 0!==s&&(e.exports=s));
},,,function(e,t,i){"use strict";function n(e,t){this.helpers=e||{},this.partials=t||{},s(this)}function s(e){e.registerHelper("helperMissing",function(e){if(2!==arguments.length)throw new o("Missing helper: '"+e+"'")}),e.registerHelper("blockHelperMissing",function(t,i){var n=i.inverse||function(){},s=i.fn;return h(t)&&(t=t.call(this)),t===!0?s(this):t===!1||null==t?n(this):d(t)?t.length>0?e.helpers.each(t,i):n(this):s(t)}),e.registerHelper("each",function(e,t){var i,n=t.fn,s=t.inverse,a=0,r="";if(h(e)&&(e=e.call(this)),
t.data&&(i=g(t.data)),e&&"object"==typeof e)if(d(e))for(var o=e.length;o>a;a++)i&&(i.index=a,i.first=0===a,i.last=a===e.length-1),r+=n(e[a],{data:i});else for(var l in e)e.hasOwnProperty(l)&&(i&&(i.key=l,i.index=a,i.first=0===a),r+=n(e[l],{data:i}),a++);return 0===a&&(r=s(this)),r}),e.registerHelper("if",function(e,t){return h(e)&&(e=e.call(this)),!t.hash.includeZero&&!e||r.isEmpty(e)?t.inverse(this):t.fn(this)}),e.registerHelper("unless",function(t,i){return e.helpers.if.call(this,t,{fn:i.inverse,
inverse:i.fn,hash:i.hash})}),e.registerHelper("with",function(e,t){return h(e)&&(e=e.call(this)),r.isEmpty(e)?void 0:t.fn(e)}),e.registerHelper("log",function(t,i){var n=i.data&&null!=i.data.level?parseInt(i.data.level,10):1;e.log(n,t)})}function a(e,t){m.log(e,t)}var r=i(181),o=i(180).default,l="1.3.0";t.VERSION=l;var c=4;t.COMPILER_REVISION=c;var u={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:">= 1.0.0"};t.REVISION_CHANGES=u;var d=r.isArray,h=r.isFunction,p=r.toString,f="[object Object]";
t.HandlebarsEnvironment=n,n.prototype={constructor:n,logger:m,log:a,registerHelper:function(e,t,i){if(p.call(e)===f){if(i||t)throw new o("Arg not supported with multiple helpers");r.extend(this.helpers,e)}else i&&(t.not=i),this.helpers[e]=t},registerPartial:function(e,t){p.call(e)===f?r.extend(this.partials,e):this.partials[e]=t}};var m={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(e,t){if(m.level<=e){var i=m.methodMap[e];"undefined"!=typeof console&&console[i]&&console[i].call(console,t);
}}};t.logger=m,t.log=a;var g=function(e){var t={};return r.extend(t,e),t};t.createFrame=g},function(e,t){"use strict";function i(e,t){var i;t&&t.firstLine&&(i=t.firstLine,e+=" - "+i+":"+t.firstColumn);for(var s=Error.prototype.constructor.call(this,e),a=0;a<n.length;a++)this[n[a]]=s[n[a]];i&&(this.lineNumber=i,this.column=t.firstColumn)}var n=["description","fileName","lineNumber","message","name","number","stack"];i.prototype=new Error,t.default=i},function(e,t,i){"use strict";function n(e){return l[e]||"&amp;";
}function s(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}function a(e){return e instanceof o?e.toString():e||0===e?(e=""+e,u.test(e)?e.replace(c,n):e):""}function r(e){return e||0===e?p(e)&&0===e.length?!0:!1:!0}var o=i(302).default,l={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},c=/[&<>"'`]/g,u=/[&<>"'`]/;t.extend=s;var d=Object.prototype.toString;t.toString=d;var h=function(e){return"function"==typeof e};h(/x/)&&(h=function(e){return"function"==typeof e&&"[object Function]"===d.call(e);
});var h;t.isFunction=h;var p=Array.isArray||function(e){return e&&"object"==typeof e?"[object Array]"===d.call(e):!1};t.isArray=p,t.escapeExpression=a,t.isEmpty=r},function(e,t){!function(){for(var e=0,t=["ms","moz","webkit","o"],i=0;i<t.length&&!window.requestAnimationFrame;++i)window.requestAnimationFrame=window[t[i]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[t[i]+"CancelAnimationFrame"]||window[t[i]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t,i){
var n=(new Date).getTime(),s=Math.max(0,16-(n-e)),a=window.setTimeout(function(){t(n+s)},s);return e=n+s,a}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(e){clearTimeout(e)})}()},function(e,t,i){var n,s,n,a,n,r,o;(function(l){!function(a,r){n=r,!(s="function"==typeof n?n.call(t,i,t,e):n)}(this,function(){var e=function(e,t){this.items=e,this.settings=t||{diacritics:!0}};e.prototype.tokenize=function(e){if(e=n(String(e||"").toLowerCase()),!e||!e.length)return[];var t,i,a,o,l=[],c=e.split(/ +/);
for(t=0,i=c.length;i>t;t++){if(a=s(c[t]),this.settings.diacritics)for(o in r)r.hasOwnProperty(o)&&(a=a.replace(new RegExp(o,"g"),r[o]));l.push({string:c[t],regex:new RegExp(a,"i")})}return l},e.prototype.iterator=function(e,t){var i;i=a(e)?Array.prototype.forEach||function(e){for(var t=0,i=this.length;i>t;t++)e(this[t],t,this)}:function(e){for(var t in this)this.hasOwnProperty(t)&&e(this[t],t,this)},i.apply(e,[t])},e.prototype.getScoreFunction=function(e,t){var i,n,s,a;i=this,e=i.prepareSearch(e,t),
s=e.tokens,n=e.options.fields,a=s.length;var r=function(e,t){var i,n;return e?(e=String(e||""),n=e.search(t.regex),-1===n?0:(i=t.string.length/e.length,0===n&&(i+=.5),i)):0},o=function(){var e=n.length;return e?1===e?function(e,t){return r(t[n[0]],e)}:function(t,i){for(var s=0,a=0;e>s;s++)a+=r(i[n[s]],t);return a/e}:function(){return 0}}();return a?1===a?function(e){return o(s[0],e)}:"and"===e.options.conjunction?function(e){for(var t,i=0,n=0;a>i;i++){if(t=o(s[i],e),0>=t)return 0;n+=t}return n/a}:function(e){
for(var t=0,i=0;a>t;t++)i+=o(s[t],e);return i/a}:function(){return 0}},e.prototype.getSortFunction=function(e,i){var n,s,a,r,o,l,c,u,d,h,p;if(a=this,e=a.prepareSearch(e,i),p=!e.query&&i.sort_empty||i.sort,d=function(e,t){return"$score"===e?t.score:a.items[t.id][e]},o=[],p)for(n=0,s=p.length;s>n;n++)(e.query||"$score"!==p[n].field)&&o.push(p[n]);if(e.query){for(h=!0,n=0,s=o.length;s>n;n++)if("$score"===o[n].field){h=!1;break}h&&o.unshift({field:"$score",direction:"desc"})}else for(n=0,s=o.length;s>n;n++)if("$score"===o[n].field){
o.splice(n,1);break}for(u=[],n=0,s=o.length;s>n;n++)u.push("desc"===o[n].direction?-1:1);return l=o.length,l?1===l?(r=o[0].field,c=u[0],function(e,i){return c*t(d(r,e),d(r,i))}):function(e,i){var n,s,a;for(n=0;l>n;n++)if(a=o[n].field,s=u[n]*t(d(a,e),d(a,i)))return s;return 0}:null},e.prototype.prepareSearch=function(e,t){if("object"==typeof e)return e;t=i({},t);var n=t.fields,s=t.sort,r=t.sort_empty;return n&&!a(n)&&(t.fields=[n]),s&&!a(s)&&(t.sort=[s]),r&&!a(r)&&(t.sort_empty=[r]),{options:t,query:String(e||"").toLowerCase(),
tokens:this.tokenize(e),total:0,items:[]}},e.prototype.search=function(e,t){var i,n,s,a,r=this;return n=this.prepareSearch(e,t),t=n.options,e=n.query,a=t.score||r.getScoreFunction(n),e.length?r.iterator(r.items,function(e,s){i=a(e),(t.filter===!1||i>0)&&n.items.push({score:i,id:s})}):r.iterator(r.items,function(e,t){n.items.push({score:1,id:t})}),s=r.getSortFunction(n,t),s&&n.items.sort(s),n.total=n.items.length,"number"==typeof t.limit&&(n.items=n.items.slice(0,t.limit)),n};var t=function(e,t){return"number"==typeof e&&"number"==typeof t?e>t?1:t>e?-1:0:(e=o(String(e||"")),
t=o(String(t||"")),e>t?1:t>e?-1:0)},i=function(e,t){var i,n,s,a;for(i=1,n=arguments.length;n>i;i++)if(a=arguments[i])for(s in a)a.hasOwnProperty(s)&&(e[s]=a[s]);return e},n=function(e){return(e+"").replace(/^\s+|\s+$|/g,"")},s=function(e){return(e+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")},a=Array.isArray||l&&l.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},r={a:"[a\xc0\xc1\xc2\xc3\xc4\xc5\xe0\xe1\xe2\xe3\xe4\xe5\u0100\u0101\u0105\u0104]",c:"[c\xc7\xe7\u0107\u0106\u010d\u010c]",
d:"[d\u0111\u0110\u010f\u010e]",e:"[e\xc8\xc9\xca\xcb\xe8\xe9\xea\xeb\u011b\u011a\u0112\u0113\u0119\u0118]",i:"[i\xcc\xcd\xce\xcf\xec\xed\xee\xef\u012a\u012b]",l:"[l\u0142\u0141]",n:"[n\xd1\xf1\u0148\u0147\u0144\u0143]",o:"[o\xd2\xd3\xd4\xd5\xd5\xd6\xd8\xf2\xf3\xf4\xf5\xf6\xf8\u014c\u014d]",r:"[r\u0159\u0158]",s:"[s\u0160\u0161\u015b\u015a]",t:"[t\u0165\u0164]",u:"[u\xd9\xda\xdb\xdc\xf9\xfa\xfb\xfc\u016f\u016e\u016a\u016b]",y:"[y\u0178\xff\xfd\xdd]",z:"[z\u017d\u017e\u017c\u017b\u017a\u0179]"},o=function(){
var e,t,i,n,s="",a={};for(i in r)if(r.hasOwnProperty(i))for(n=r[i].substring(2,r[i].length-1),s+=n,e=0,t=n.length;t>e;e++)a[n.charAt(e)]=i;var o=new RegExp("["+s+"]","g");return function(e){return e.replace(o,function(e){return a[e]}).toLowerCase()}}();return e}),function(s,r){n=r,!(a="function"==typeof n?n.call(t,i,t,e):n)}(this,function(){var e={};e.mixin=function(e){e.plugins={},e.prototype.initializePlugins=function(e){var i,n,s,a=this,r=[];if(a.plugins={names:[],settings:{},requested:{},loaded:{}
},t.isArray(e))for(i=0,n=e.length;n>i;i++)"string"==typeof e[i]?r.push(e[i]):(a.plugins.settings[e[i].name]=e[i].options,r.push(e[i].name));else if(e)for(s in e)e.hasOwnProperty(s)&&(a.plugins.settings[s]=e[s],r.push(s));for(;r.length;)a.require(r.shift())},e.prototype.loadPlugin=function(t){var i=this,n=i.plugins,s=e.plugins[t];if(!e.plugins.hasOwnProperty(t))throw new Error('Unable to find "'+t+'" plugin');n.requested[t]=!0,n.loaded[t]=s.fn.apply(i,[i.plugins.settings[t]||{}]),n.names.push(t)},
e.prototype.require=function(e){var t=this,i=t.plugins;if(!t.plugins.loaded.hasOwnProperty(e)){if(i.requested[e])throw new Error('Plugin has circular dependency ("'+e+'")');t.loadPlugin(e)}return i.loaded[e]},e.define=function(t,i){e.plugins[t]={name:t,fn:i}}};var t={isArray:Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}};return e}),function(l,c){r=[i(4),s,a],n=c,o="function"==typeof n?n.apply(t,r):n,!(void 0!==o&&(e.exports=o))}(this,function(e,t,i){"use strict";
var n=function(e,t){if("string"!=typeof t||t.length){var i="string"==typeof t?new RegExp(t,"i"):t,n=function(e){var t=0;if(3===e.nodeType){var s=e.data.search(i);if(s>=0&&e.data.length>0){var a=e.data.match(i),r=document.createElement("span");r.className="highlight";var o=e.splitText(s),l=(o.splitText(a[0].length),o.cloneNode(!0));r.appendChild(l),o.parentNode.replaceChild(r,o),t=1}}else if(1===e.nodeType&&e.childNodes&&!/(script|style)/i.test(e.tagName))for(var c=0;c<e.childNodes.length;++c)c+=n(e.childNodes[c]);
return t};return e.each(function(){n(this)})}},s=function(){};s.prototype={on:function(e,t){this._events=this._events||{},this._events[e]=this._events[e]||[],this._events[e].push(t)},off:function(e,t){var i=arguments.length;return 0===i?delete this._events:1===i?delete this._events[e]:(this._events=this._events||{},void(e in this._events!=!1&&this._events[e].splice(this._events[e].indexOf(t),1)))},trigger:function(e){if(this._events=this._events||{},e in this._events!=!1)for(var t=0;t<this._events[e].length;t++)this._events[e][t].apply(this,Array.prototype.slice.call(arguments,1));
}},s.mixin=function(e){for(var t=["on","off","trigger"],i=0;i<t.length;i++)e.prototype[t[i]]=s.prototype[t[i]]};var a=/Mac/.test(navigator.userAgent),r=65,o=13,l=27,c=37,u=38,d=80,h=39,p=40,f=78,m=8,g=46,v=16,y=a?91:17,b=a?18:17,w=9,x=1,S=2,C=!/android/i.test(window.navigator.userAgent)&&!!document.createElement("form").validity,k=function(e){return"undefined"!=typeof e},P=function(e){return"undefined"==typeof e||null===e?null:"boolean"==typeof e?e?"1":"0":e+""},A=function(e){return(e+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");
},I=function(e){return(e+"").replace(/\$/g,"$$$$")},_={};_.before=function(e,t,i){var n=e[t];e[t]=function(){return i.apply(e,arguments),n.apply(e,arguments)}},_.after=function(e,t,i){var n=e[t];e[t]=function(){var t=n.apply(e,arguments);return i.apply(e,arguments),t}};var T=function(e){var t=!1;return function(){t||(t=!0,e.apply(this,arguments))}},D=function(e,t){var i;return function(){var n=this,s=arguments;window.clearTimeout(i),i=window.setTimeout(function(){e.apply(n,s)},t)}},E=function(e,t,i){
var n,s=e.trigger,a={};e.trigger=function(){var i=arguments[0];return-1===t.indexOf(i)?s.apply(e,arguments):void(a[i]=arguments)},i.apply(e,[]),e.trigger=s;for(n in a)a.hasOwnProperty(n)&&s.apply(e,a[n])},M=function(e,t,i,n){e.on(t,i,function(t){for(var i=t.target;i&&i.parentNode!==e[0];)i=i.parentNode;return t.currentTarget=i,n.apply(this,[t])})},R=function(e){var t={};if("selectionStart"in e)t.start=e.selectionStart,t.length=e.selectionEnd-t.start;else if(document.selection){e.focus();var i=document.selection.createRange(),n=document.selection.createRange().text.length;
i.moveStart("character",-e.value.length),t.start=i.text.length-n,t.length=n}return t},O=function(e,t,i){var n,s,a={};if(i)for(n=0,s=i.length;s>n;n++)a[i[n]]=e.css(i[n]);else a=e.css();t.css(a)},L=function(t,i){if(!t)return 0;var n=e("<test>").css({position:"absolute",top:-99999,left:-99999,width:"auto",padding:0,whiteSpace:"pre"}).text(t).appendTo("body");O(i,n,["letterSpacing","fontSize","fontFamily","fontWeight","textTransform"]);var s=n.width();return n.remove(),s},N=function(e){var t=null,i=function(i,n){
var s,a,r,o,l,c,u,d;i=i||window.event||{},n=n||{},i.metaKey||i.altKey||(n.force||e.data("grow")!==!1)&&(s=e.val(),i.type&&"keydown"===i.type.toLowerCase()&&(a=i.keyCode,r=a>=97&&122>=a||a>=65&&90>=a||a>=48&&57>=a||32===a,a===g||a===m?(d=R(e[0]),d.length?s=s.substring(0,d.start)+s.substring(d.start+d.length):a===m&&d.start?s=s.substring(0,d.start-1)+s.substring(d.start+1):a===g&&"undefined"!=typeof d.start&&(s=s.substring(0,d.start)+s.substring(d.start+1))):r&&(c=i.shiftKey,u=String.fromCharCode(i.keyCode),
u=c?u.toUpperCase():u.toLowerCase(),s+=u)),o=e.attr("placeholder"),!s&&o&&(s=o),l=L(s,e)+4,l!==t&&(t=l,e.width(l),e.triggerHandler("resize")))};e.on("keydown keyup update blur",i),i()},F=function(i,n){var s,a,r,o,l=this;o=i[0],o.selectize=l;var c=window.getComputedStyle&&window.getComputedStyle(o,null);if(r=c?c.getPropertyValue("direction"):o.currentStyle&&o.currentStyle.direction,r=r||i.parents("[dir]:first").attr("dir")||"",e.extend(l,{order:0,settings:n,$input:i,tabIndex:i.attr("tabindex")||"",
tagType:"select"===o.tagName.toLowerCase()?x:S,rtl:/rtl/i.test(r),eventNS:".selectize"+ ++F.count,highlightedValue:null,isOpen:!1,isDisabled:!1,isRequired:i.is("[required]"),isInvalid:!1,isLocked:!1,isFocused:!1,isInputHidden:!1,isSetup:!1,isShiftDown:!1,isCmdDown:!1,isCtrlDown:!1,ignoreFocus:!1,ignoreBlur:!1,ignoreHover:!1,hasOptions:!1,currentResults:null,lastValue:"",caretPos:0,loading:0,loadedSearches:{},$activeOption:null,$activeItems:[],optgroups:{},options:{},userOptions:{},items:[],renderCache:{},
onSearchChange:null===n.loadThrottle?l.onSearchChange:D(l.onSearchChange,n.loadThrottle)}),l.sifter=new t(this.options,{diacritics:n.diacritics}),l.settings.options){for(s=0,a=l.settings.options.length;a>s;s++)l.registerOption(l.settings.options[s]);delete l.settings.options}if(l.settings.optgroups){for(s=0,a=l.settings.optgroups.length;a>s;s++)l.registerOptionGroup(l.settings.optgroups[s]);delete l.settings.optgroups}l.settings.mode=l.settings.mode||(1===l.settings.maxItems?"single":"multi"),"boolean"!=typeof l.settings.hideSelected&&(l.settings.hideSelected="multi"===l.settings.mode),
l.initializePlugins(l.settings.plugins),l.setupCallbacks(),l.setupTemplates(),l.setup()};return s.mixin(F),i.mixin(F),e.extend(F.prototype,{setup:function(){var t,i,n,s,r,o,l,c,u,d=this,h=d.settings,p=d.eventNS,f=e(window),m=e(document),g=d.$input;if(l=d.settings.mode,c=g.attr("class")||"",t=e("<div>").addClass(h.wrapperClass).addClass(c).addClass(l),i=e("<div>").addClass(h.inputClass).addClass("items").appendTo(t),n=e('<input type="text" autocomplete="off" />').appendTo(i).attr("tabindex",g.is(":disabled")?"-1":d.tabIndex),
o=e(h.dropdownParent||t),s=e("<div>").addClass(h.dropdownClass).addClass(l).hide().appendTo(o),r=e("<div>").addClass(h.dropdownContentClass).appendTo(s),d.settings.copyClassesToDropdown&&s.addClass(c),t.css({width:g[0].style.width}),d.plugins.names.length&&(u="plugin-"+d.plugins.names.join(" plugin-"),t.addClass(u),s.addClass(u)),(null===h.maxItems||h.maxItems>1)&&d.tagType===x&&g.attr("multiple","multiple"),d.settings.placeholder&&n.attr("placeholder",h.placeholder),!d.settings.splitOn&&d.settings.delimiter){
var w=d.settings.delimiter.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");d.settings.splitOn=new RegExp("\\s*"+w+"+\\s*")}g.attr("autocorrect")&&n.attr("autocorrect",g.attr("autocorrect")),g.attr("autocapitalize")&&n.attr("autocapitalize",g.attr("autocapitalize")),d.$wrapper=t,d.$control=i,d.$control_input=n,d.$dropdown=s,d.$dropdown_content=r,s.on("mouseenter","[data-selectable]",function(){return d.onOptionHover.apply(d,arguments)}),s.on("mousedown click","[data-selectable]",function(){return d.onOptionSelect.apply(d,arguments);
}),M(i,"mousedown","*:not(input)",function(){return d.onItemSelect.apply(d,arguments)}),d.settings.manualInputWidth||N(n),i.on({mousedown:function(){return d.onMouseDown.apply(d,arguments)},click:function(){return d.onClick.apply(d,arguments)}}),n.on({mousedown:function(e){e.stopPropagation()},keydown:function(){return d.onKeyDown.apply(d,arguments)},keyup:function(){return d.onKeyUp.apply(d,arguments)},keypress:function(){return d.onKeyPress.apply(d,arguments)},resize:function(){d.positionDropdown.apply(d,[]);
},blur:function(){return d.onBlur.apply(d,arguments)},focus:function(){return d.ignoreBlur=!1,d.onFocus.apply(d,arguments)},paste:function(){return d.onPaste.apply(d,arguments)}}),g.parents().last().find('label[for="'+g.attr("id")+'"]').on("click",function(){d.onClick.apply(d,arguments)}),m.on("keydown"+p,function(e){d.isCmdDown=e[a?"metaKey":"ctrlKey"],d.isCtrlDown=e[a?"altKey":"ctrlKey"],d.isShiftDown=e.shiftKey}),m.on("keyup"+p,function(e){e.keyCode===b&&(d.isCtrlDown=!1),e.keyCode===v&&(d.isShiftDown=!1),
e.keyCode===y&&(d.isCmdDown=!1)}),m.on("mousedown"+p,function(e){if(d.isFocused){if(e.target===d.$dropdown[0]||e.target.parentNode===d.$dropdown[0])return!1;d.$control.has(e.target).length||e.target===d.$control[0]||d.blur(e.target)}}),f.on(["scroll"+p,"resize"+p].join(" "),function(){d.isOpen&&d.positionDropdown.apply(d,arguments)}),f.on("mousemove"+p,function(){d.ignoreHover=!1}),this.revertSettings={$children:g.children().detach(),tabindex:g.attr("tabindex")},g.attr("tabindex",-1).hide().after(d.$wrapper),
e.isArray(h.items)&&(d.setValue(h.items),delete h.items),C&&g.on("invalid"+p,function(e){e.preventDefault(),d.isInvalid=!0,d.refreshState()}),d.updateOriginalInput(),d.refreshItems(),d.refreshState(),d.updatePlaceholder(),d.isSetup=!0,g.is(":disabled")&&d.disable(),d.on("change",this.onChange),g.data("selectize",d),g.addClass("selectized"),d.trigger("initialize"),h.preload===!0&&d.onSearchChange("")},setupTemplates:function(){var t=this,i=t.settings.labelField,n=t.settings.optgroupLabelField,s={optgroup:function(e){
return'<div class="optgroup">'+e.html+"</div>"},optgroup_header:function(e,t){return'<div class="optgroup-header">'+t(e[n])+"</div>"},option:function(e,t){return'<div class="option">'+t(e[i])+"</div>"},item:function(e,t){return'<div class="item">'+t(e[i])+"</div>"},option_create:function(e,t){return'<div class="create">Add <strong>'+t(e.input)+"</strong>&hellip;</div>"}};t.settings.render=e.extend({},s,t.settings.render)},setupCallbacks:function(){var e,t,i={initialize:"onInitialize",change:"onChange",
item_add:"onItemAdd",item_remove:"onItemRemove",clear:"onClear",option_add:"onOptionAdd",option_remove:"onOptionRemove",option_clear:"onOptionClear",optgroup_add:"onOptionGroupAdd",optgroup_remove:"onOptionGroupRemove",optgroup_clear:"onOptionGroupClear",dropdown_open:"onDropdownOpen",dropdown_close:"onDropdownClose",type:"onType",load:"onLoad",focus:"onFocus",blur:"onBlur"};for(e in i)i.hasOwnProperty(e)&&(t=this.settings[i[e]],t&&this.on(e,t))},onClick:function(e){var t=this;t.isFocused||(t.focus(),
e.preventDefault())},onMouseDown:function(t){var i=this,n=t.isDefaultPrevented();e(t.target);if(i.isFocused){if(t.target!==i.$control_input[0])return"single"===i.settings.mode&&t.target!==i.$control[0]?i.isOpen?i.close():i.open():n||i.setActiveItem(null),!1}else n||window.setTimeout(function(){i.focus()},0)},onChange:function(){this.$input.trigger("change")},onPaste:function(t){var i=this;i.isFull()||i.isInputHidden||i.isLocked?t.preventDefault():i.settings.splitOn&&setTimeout(function(){for(var t=e.trim(i.$control_input.val()||"").split(i.settings.splitOn),n=0,s=t.length;s>n;n++)i.createItem(t[n]);
},0)},onKeyPress:function(e){if(this.isLocked)return e&&e.preventDefault();var t=String.fromCharCode(e.keyCode||e.which);return this.settings.create&&"multi"===this.settings.mode&&t===this.settings.delimiter?(this.createItem(),e.preventDefault(),!1):void 0},onKeyDown:function(e){var t=(e.target===this.$control_input[0],this);if(t.isLocked)return void(e.keyCode!==w&&e.preventDefault());switch(e.keyCode){case r:if(t.isCmdDown)return void t.selectAll();break;case l:return void(t.isOpen&&(e.preventDefault(),
e.stopPropagation(),t.close()));case f:if(!e.ctrlKey||e.altKey)break;case p:if(!t.isOpen&&t.hasOptions)t.open();else if(t.$activeOption){t.ignoreHover=!0;var i=t.getAdjacentOption(t.$activeOption,1);i.length&&t.setActiveOption(i,!0,!0)}return void e.preventDefault();case d:if(!e.ctrlKey||e.altKey)break;case u:if(t.$activeOption){t.ignoreHover=!0;var n=t.getAdjacentOption(t.$activeOption,-1);n.length&&t.setActiveOption(n,!0,!0)}return void e.preventDefault();case o:return void(t.isOpen&&t.$activeOption&&(t.onOptionSelect({
currentTarget:t.$activeOption}),e.preventDefault()));case c:return void t.advanceSelection(-1,e);case h:return void t.advanceSelection(1,e);case w:return void(t.settings.selectOnTab&&t.isOpen&&t.$activeOption?(t.onOptionSelect({currentTarget:t.$activeOption}),t.settings.allowCreateEmpty&&1===t.settings.maxItems||t.isFull()||e.preventDefault()):t.settings.create&&t.createItem()&&e.preventDefault());case m:return void t.deleteSelection(e,!0);case g:return void t.deleteSelection(e)}return!t.isFull()&&!t.isInputHidden||(a?e.metaKey:e.ctrlKey)?void 0:void e.preventDefault();
},onKeyUp:function(e){var t=this;if(t.isLocked)return e&&e.preventDefault();var i=t.$control_input.val()||"";t.lastValue!==i&&(t.lastValue=i,t.onSearchChange(i),t.refreshOptions(),t.trigger("type",i))},onSearchChange:function(e){var t=this,i=t.settings.load;i&&(t.loadedSearches.hasOwnProperty(e)||(t.loadedSearches[e]=!0,t.load(function(n){i.apply(t,[e,n])})))},onFocus:function(e){var t=this,i=t.isFocused;return t.isDisabled?(t.blur(),e&&e.preventDefault(),!1):void(t.ignoreFocus||(t.isFocused=!0,"focus"===t.settings.preload&&t.onSearchChange(""),
i||t.trigger("focus"),t.$activeItems.length||(t.showInput(),t.setActiveItem(null),t.refreshOptions(!!t.settings.openOnFocus)),t.refreshState()))},onBlur:function(e,t){var i=this;if(i.isFocused&&(i.isFocused=!1,!i.ignoreFocus))return i.ignoreBlur||document.activeElement!==i.$dropdown_content[0]?void setTimeout(function(){var e=function(){i.close(),i.setTextboxValue(""),i.setActiveItem(null),i.setActiveOption(null),i.setCaret(i.items.length),i.refreshState(),(t||document.body).focus(),i.ignoreFocus=!1,
i.trigger("blur")};i.ignoreFocus=!0,i.settings.selectOnBlur&&i.$activeOption&&1===i.$activeOption.not(".create").length?(i.addItem(i.$activeOption.not(".create").data("value")),e()):i.settings.create&&i.settings.createOnBlur?i.createItem(null,!1,e):e()}):(i.ignoreBlur=!0,void i.onFocus(e))},onOptionHover:function(e){this.ignoreHover||this.setActiveOption(e.currentTarget,!1)},onOptionSelect:function(t){var i,n,s=this;t.preventDefault&&(t.preventDefault(),t.stopPropagation()),n=e(t.currentTarget),n.hasClass("create")?s.createItem(null,function(){
s.settings.closeAfterSelect&&s.close()}):(i=n.attr("data-value"),"undefined"!=typeof i&&(s.lastQuery=null,s.setTextboxValue(""),s.addItem(i),s.settings.closeAfterSelect?s.close():!s.settings.hideSelected&&t.type&&/mouse/.test(t.type)&&s.setActiveOption(s.getOption(i))))},onItemSelect:function(e){var t=this;t.isLocked||"multi"===t.settings.mode&&(e.preventDefault(),t.setActiveItem(e.currentTarget,e))},load:function(e){var t=this,i=t.$wrapper.addClass(t.settings.loadingClass);t.loading++,e.apply(t,[function(e){
t.loading=Math.max(t.loading-1,0),e&&e.length&&(t.addOption(e),t.refreshOptions(t.isFocused&&!t.isInputHidden)),t.loading||i.removeClass(t.settings.loadingClass),t.trigger("load",e)}])},setTextboxValue:function(e){var t=this.$control_input,i=t.val()!==e;i&&(t.val(e).triggerHandler("update"),this.lastValue=e)},getValue:function(){return this.tagType===x&&this.$input.attr("multiple")?this.items:this.items.join(this.settings.delimiter)},setValue:function(e,t){var i=t?[]:["change"];E(this,i,function(){
this.clear(t),this.addItems(e,t)})},setActiveItem:function(t,i){var n,s,a,r,o,l,c,u,d=this;if("single"!==d.settings.mode){if(t=e(t),!t.length)return e(d.$activeItems).removeClass("active"),d.$activeItems=[],void(d.isFocused&&d.showInput());if(n=i&&i.type.toLowerCase(),"mousedown"===n&&d.isShiftDown&&d.$activeItems.length){for(u=d.$control.children(".active:last"),r=Array.prototype.indexOf.apply(d.$control[0].childNodes,[u[0]]),o=Array.prototype.indexOf.apply(d.$control[0].childNodes,[t[0]]),r>o&&(c=r,
r=o,o=c),s=r;o>=s;s++)l=d.$control[0].childNodes[s],-1===d.$activeItems.indexOf(l)&&(e(l).addClass("active"),d.$activeItems.push(l));i.preventDefault()}else"mousedown"===n&&d.isCtrlDown||"keydown"===n&&this.isShiftDown?t.hasClass("active")?(a=d.$activeItems.indexOf(t[0]),d.$activeItems.splice(a,1),t.removeClass("active")):d.$activeItems.push(t.addClass("active")[0]):(e(d.$activeItems).removeClass("active"),d.$activeItems=[t.addClass("active")[0]]);d.hideInput(),this.isFocused||d.focus()}},setActiveOption:function(t,i,n){
var s,a,r,o,l,c=this;c.$activeOption&&c.$activeOption.removeClass("active"),c.$activeOption=null,t=e(t),t.length&&(c.$activeOption=t.addClass("active"),(i||!k(i))&&(s=c.$dropdown_content.height(),a=c.$activeOption.outerHeight(!0),i=c.$dropdown_content.scrollTop()||0,r=c.$activeOption.offset().top-c.$dropdown_content.offset().top+i,o=r,l=r-s+a,r+a>s+i?c.$dropdown_content.stop().animate({scrollTop:l},n?c.settings.scrollDuration:0):i>r&&c.$dropdown_content.stop().animate({scrollTop:o},n?c.settings.scrollDuration:0)));
},selectAll:function(){var e=this;"single"!==e.settings.mode&&(e.$activeItems=Array.prototype.slice.apply(e.$control.children(":not(input)").addClass("active")),e.$activeItems.length&&(e.hideInput(),e.close()),e.focus())},hideInput:function(){this.setTextboxValue(""),this.$control_input.css({opacity:0}),this.settings.manualInputWidth||this.$control_input.css({position:"absolute",left:this.rtl?1e4:-1e4}),this.isInputHidden=!0},showInput:function(){this.$control_input.css({opacity:1}),this.settings.manualInputWidth||this.$control_input.css({
position:"relative",left:0}),this.isInputHidden=!1},focus:function(){var e=this;e.isDisabled||(e.ignoreFocus=!0,e.$control_input[0].focus(),window.setTimeout(function(){e.ignoreFocus=!1,e.onFocus()},0))},blur:function(e){this.$control_input[0].blur(),this.onBlur(null,e)},getScoreFunction:function(e){return this.sifter.getScoreFunction(e,this.getSearchOptions())},getSearchOptions:function(){var e=this.settings,t=e.sortField;return"string"==typeof t&&(t=[{field:t}]),{fields:e.searchField,conjunction:e.searchConjunction,
sort:t}},search:function(t){var i,n,s,a=this,r=a.settings,o=this.getSearchOptions();if(r.score&&(s=a.settings.score.apply(this,[t]),"function"!=typeof s))throw new Error('Selectize "score" setting must be a function that returns a function');if(t!==a.lastQuery?(a.lastQuery=t,n=a.sifter.search(t,e.extend(o,{score:s})),a.currentResults=n):n=e.extend(!0,{},a.currentResults),r.hideSelected)for(i=n.items.length-1;i>=0;i--)-1!==a.items.indexOf(P(n.items[i].id))&&n.items.splice(i,1);return n},refreshOptions:function(t){
var i,s,a,r,o,l,c,u,d,h,p,f,m,g,v,y;"undefined"==typeof t&&(t=!0);var b=this,w=e.trim(b.$control_input.val()),x=b.search(w),S=b.$dropdown_content,C=b.$activeOption&&P(b.$activeOption.attr("data-value"));for(r=x.items.length,"number"==typeof b.settings.maxOptions&&(r=Math.min(r,b.settings.maxOptions)),o={},l=[],i=0;r>i;i++)for(c=b.options[x.items[i].id],u=b.render("option",c),d=c[b.settings.optgroupField]||"",h=e.isArray(d)?d:[d],s=0,a=h&&h.length;a>s;s++)d=h[s],b.optgroups.hasOwnProperty(d)||(d=""),
o.hasOwnProperty(d)||(o[d]=[],l.push(d)),o[d].push(u);for(this.settings.lockOptgroupOrder&&l.sort(function(e,t){var i=b.optgroups[e].$order||0,n=b.optgroups[t].$order||0;return i-n}),p=[],i=0,r=l.length;r>i;i++)d=l[i],b.optgroups.hasOwnProperty(d)&&o[d].length?(f=b.render("optgroup_header",b.optgroups[d])||"",f+=o[d].join(""),p.push(b.render("optgroup",e.extend({},b.optgroups[d],{html:f})))):p.push(o[d].join(""));if(S.html(p.join("")),b.settings.highlight&&x.query.length&&x.tokens.length)for(i=0,
r=x.tokens.length;r>i;i++)n(S,x.tokens[i].regex);if(!b.settings.hideSelected)for(i=0,r=b.items.length;r>i;i++)b.getOption(b.items[i]).addClass("selected");m=b.canCreate(w),m&&(S.prepend(b.render("option_create",{input:w})),y=e(S[0].childNodes[0])),b.hasOptions=x.items.length>0||m,b.hasOptions?(x.items.length>0?(v=C&&b.getOption(C),v&&v.length?g=v:"single"===b.settings.mode&&b.items.length&&(g=b.getOption(b.items[0])),g&&g.length||(g=y&&!b.settings.addPrecedence?b.getAdjacentOption(y,1):S.find("[data-selectable]:first"))):g=y,
b.setActiveOption(g),t&&!b.isOpen&&b.open()):(b.setActiveOption(null),t&&b.isOpen&&b.close())},addOption:function(t){var i,n,s,a=this;if(e.isArray(t))for(i=0,n=t.length;n>i;i++)a.addOption(t[i]);else(s=a.registerOption(t))&&(a.userOptions[s]=!0,a.lastQuery=null,a.trigger("option_add",s,t))},registerOption:function(e){var t=P(e[this.settings.valueField]);return!t||this.options.hasOwnProperty(t)?!1:(e.$order=e.$order||++this.order,this.options[t]=e,t)},registerOptionGroup:function(e){var t=P(e[this.settings.optgroupValueField]);
return t?(e.$order=e.$order||++this.order,this.optgroups[t]=e,t):!1},addOptionGroup:function(e,t){t[this.settings.optgroupValueField]=e,(e=this.registerOptionGroup(t))&&this.trigger("optgroup_add",e,t)},removeOptionGroup:function(e){this.optgroups.hasOwnProperty(e)&&(delete this.optgroups[e],this.renderCache={},this.trigger("optgroup_remove",e))},clearOptionGroups:function(){this.optgroups={},this.renderCache={},this.trigger("optgroup_clear")},updateOption:function(t,i){var n,s,a,r,o,l,c,u=this;if(t=P(t),
a=P(i[u.settings.valueField]),null!==t&&u.options.hasOwnProperty(t)){if("string"!=typeof a)throw new Error("Value must be set in option data");c=u.options[t].$order,a!==t&&(delete u.options[t],r=u.items.indexOf(t),-1!==r&&u.items.splice(r,1,a)),i.$order=i.$order||c,u.options[a]=i,o=u.renderCache.item,l=u.renderCache.option,o&&(delete o[t],delete o[a]),l&&(delete l[t],delete l[a]),-1!==u.items.indexOf(a)&&(n=u.getItem(t),s=e(u.render("item",i)),n.hasClass("active")&&s.addClass("active"),n.replaceWith(s)),
u.lastQuery=null,u.isOpen&&u.refreshOptions(!1)}},removeOption:function(e,t){var i=this;e=P(e);var n=i.renderCache.item,s=i.renderCache.option;n&&delete n[e],s&&delete s[e],delete i.userOptions[e],delete i.options[e],i.lastQuery=null,i.trigger("option_remove",e),i.removeItem(e,t)},clearOptions:function(){var e=this;e.loadedSearches={},e.userOptions={},e.renderCache={},e.options=e.sifter.items={},e.lastQuery=null,e.trigger("option_clear"),e.clear()},getOption:function(e){return this.getElementWithValue(e,this.$dropdown_content.find("[data-selectable]"));
},getAdjacentOption:function(t,i){var n=this.$dropdown.find("[data-selectable]"),s=n.index(t)+i;return s>=0&&s<n.length?n.eq(s):e()},getElementWithValue:function(t,i){if(t=P(t),"undefined"!=typeof t&&null!==t)for(var n=0,s=i.length;s>n;n++)if(i[n].getAttribute("data-value")===t)return e(i[n]);return e()},getItem:function(e){return this.getElementWithValue(e,this.$control.children())},addItems:function(t,i){for(var n=e.isArray(t)?t:[t],s=0,a=n.length;a>s;s++)this.isPending=a-1>s,this.addItem(n[s],i);
},addItem:function(t,i){var n=i?[]:["change"];E(this,n,function(){var n,s,a,r,o,l=this,c=l.settings.mode;return t=P(t),-1!==l.items.indexOf(t)?void("single"===c&&l.close()):void(l.options.hasOwnProperty(t)&&("single"===c&&l.clear(i),"multi"===c&&l.isFull()||(n=e(l.render("item",l.options[t])),o=l.isFull(),l.items.splice(l.caretPos,0,t),l.insertAtCaret(n),(!l.isPending||!o&&l.isFull())&&l.refreshState(),l.isSetup&&(a=l.$dropdown_content.find("[data-selectable]"),l.isPending||(s=l.getOption(t),r=l.getAdjacentOption(s,1).attr("data-value"),
l.refreshOptions(l.isFocused&&"single"!==c),r&&l.setActiveOption(l.getOption(r))),!a.length||l.isFull()?l.close():l.positionDropdown(),l.updatePlaceholder(),l.trigger("item_add",t,n),l.updateOriginalInput({silent:i})))))})},removeItem:function(e,t){var i,n,s,a=this;i="object"==typeof e?e:a.getItem(e),e=P(i.attr("data-value")),n=a.items.indexOf(e),-1!==n&&(i.remove(),i.hasClass("active")&&(s=a.$activeItems.indexOf(i[0]),a.$activeItems.splice(s,1)),a.items.splice(n,1),a.lastQuery=null,!a.settings.persist&&a.userOptions.hasOwnProperty(e)&&a.removeOption(e,t),
n<a.caretPos&&a.setCaret(a.caretPos-1),a.refreshState(),a.updatePlaceholder(),a.updateOriginalInput({silent:t}),a.positionDropdown(),a.trigger("item_remove",e,i))},createItem:function(t,i){var n=this,s=n.caretPos;t=t||e.trim(n.$control_input.val()||"");var a=arguments[arguments.length-1];if("function"!=typeof a&&(a=function(){}),"boolean"!=typeof i&&(i=!0),!n.canCreate(t))return a(),!1;n.lock();var r="function"==typeof n.settings.create?this.settings.create:function(e){var t={};return t[n.settings.labelField]=e,
t[n.settings.valueField]=e,t},o=T(function(e){if(n.unlock(),!e||"object"!=typeof e)return a();var t=P(e[n.settings.valueField]);return"string"!=typeof t?a():(n.setTextboxValue(""),n.addOption(e),n.setCaret(s),n.addItem(t),n.refreshOptions(i&&"single"!==n.settings.mode),void a(e))}),l=r.apply(this,[t,o]);return"undefined"!=typeof l&&o(l),!0},refreshItems:function(){this.lastQuery=null,this.isSetup&&this.addItem(this.items),this.refreshState(),this.updateOriginalInput()},refreshState:function(){var e,t=this;
t.isRequired&&(t.items.length&&(t.isInvalid=!1),t.$control_input.prop("required",e)),t.refreshClasses()},refreshClasses:function(){var t=this,i=t.isFull(),n=t.isLocked;t.$wrapper.toggleClass("rtl",t.rtl),t.$control.toggleClass("focus",t.isFocused).toggleClass("disabled",t.isDisabled).toggleClass("required",t.isRequired).toggleClass("invalid",t.isInvalid).toggleClass("locked",n).toggleClass("full",i).toggleClass("not-full",!i).toggleClass("input-active",t.isFocused&&!t.isInputHidden).toggleClass("dropdown-active",t.isOpen).toggleClass("has-options",!e.isEmptyObject(t.options)).toggleClass("has-items",t.items.length>0),
t.$control_input.data("grow",!i&&!n)},isFull:function(){return null!==this.settings.maxItems&&this.items.length>=this.settings.maxItems},updateOriginalInput:function(e){var t,i,n,s,a=this;if(e=e||{},a.tagType===x){for(n=[],t=0,i=a.items.length;i>t;t++)s=a.options[a.items[t]][a.settings.labelField]||"",n.push('<option value="'+A(a.items[t])+'" selected="selected">'+A(s)+"</option>");n.length||this.$input.attr("multiple")||n.push('<option value="" selected="selected"></option>'),a.$input.html(n.join(""));
}else a.$input.val(a.getValue()),a.$input.attr("value",a.$input.val());a.isSetup&&(e.silent||a.trigger("change",a.$input.val()))},updatePlaceholder:function(){if(this.settings.placeholder){var e=this.$control_input;this.items.length?e.removeAttr("placeholder"):e.attr("placeholder",this.settings.placeholder),e.triggerHandler("update",{force:!0})}},open:function(){var e=this;e.isLocked||e.isOpen||"multi"===e.settings.mode&&e.isFull()||(e.focus(),e.isOpen=!0,e.refreshState(),e.$dropdown.css({visibility:"hidden",
display:"block"}),e.positionDropdown(),e.$dropdown.css({visibility:"visible"}),e.trigger("dropdown_open",e.$dropdown))},close:function(){var e=this,t=e.isOpen;"single"===e.settings.mode&&e.items.length&&e.hideInput(),e.isOpen=!1,e.$dropdown.hide(),e.setActiveOption(null),e.refreshState(),t&&e.trigger("dropdown_close",e.$dropdown)},positionDropdown:function(){var e=this.$control,t="body"===this.settings.dropdownParent?e.offset():e.position();t.top+=e.outerHeight(!0),this.$dropdown.css({width:e.outerWidth(),
top:t.top,left:t.left})},clear:function(e){var t=this;t.items.length&&(t.$control.children(":not(input)").remove(),t.items=[],t.lastQuery=null,t.setCaret(0),t.setActiveItem(null),t.updatePlaceholder(),t.updateOriginalInput({silent:e}),t.refreshState(),t.showInput(),t.trigger("clear"))},insertAtCaret:function(t){var i=Math.min(this.caretPos,this.items.length);0===i?this.$control.prepend(t):e(this.$control[0].childNodes[i]).before(t),this.setCaret(i+1)},deleteSelection:function(t,i){var n,s,a,r,o,l,c,u,d,h=this;
if(a=i||void 0===i&&t&&t.keyCode===m?-1:1,r=R(h.$control_input[0]),h.$activeOption&&!h.settings.hideSelected&&(c=h.getAdjacentOption(h.$activeOption,-1).attr("data-value")),o=[],h.$activeItems.length){for(d=h.$control.children(".active:"+(a>0?"last":"first")),l=h.$control.children(":not(input)").index(d),a>0&&l++,n=0,s=h.$activeItems.length;s>n;n++)o.push(e(h.$activeItems[n]).attr("data-value"));t&&(t.preventDefault(),t.stopPropagation())}else(h.isFocused||"single"===h.settings.mode)&&h.items.length&&(0>a&&0===r.start&&0===r.length?o.push(h.items[h.caretPos-1]):a>0&&r.start===h.$control_input.val().length&&o.push(h.items[h.caretPos]));
if(!o.length||"function"==typeof h.settings.onDelete&&h.settings.onDelete.apply(h,[o])===!1)return!1;for("undefined"!=typeof l&&h.setCaret(l);o.length;)h.removeItem(o.pop());return h.showInput(),h.positionDropdown(),h.refreshOptions(!0),c&&(u=h.getOption(c),u.length&&h.setActiveOption(u)),!0},advanceSelection:function(e,t){var i,n,s,a,r,o,l=this;0!==e&&(l.rtl&&(e*=-1),i=e>0?"last":"first",n=R(l.$control_input[0]),l.isFocused&&!l.isInputHidden?(a=l.$control_input.val().length,r=0>e?0===n.start&&0===n.length:n.start===a,
r&&!a&&l.advanceCaret(e,t)):(o=l.$control.children(".active:"+i),o.length&&(s=l.$control.children(":not(input)").index(o),l.setActiveItem(null),l.setCaret(e>0?s+1:s))))},advanceCaret:function(e,t){var i,n,s=this;0!==e&&(i=e>0?"next":"prev",s.isShiftDown?(n=s.$control_input[i](),n.length&&(s.hideInput(),s.setActiveItem(n),t&&t.preventDefault())):s.setCaret(s.caretPos+e))},setCaret:function(t){var i=this;if(t="single"===i.settings.mode?i.items.length:Math.max(0,Math.min(i.items.length,t)),!i.isPending){
var n,s,a,r;for(a=i.$control.children(":not(input)"),n=0,s=a.length;s>n;n++)r=e(a[n]).detach(),t>n?i.$control_input.before(r):i.$control.append(r)}i.caretPos=t},lock:function(){this.close(),this.isLocked=!0,this.refreshState()},unlock:function(){this.isLocked=!1,this.refreshState()},disable:function(){var e=this;e.$input.prop("disabled",!0),e.$control_input.prop("disabled",!0).prop("tabindex",-1),e.isDisabled=!0,e.lock()},enable:function(){var e=this;e.$input.prop("disabled",!1),e.$control_input.prop("disabled",!1).prop("tabindex",e.tabIndex),
e.isDisabled=!1,e.unlock()},destroy:function(){var t=this,i=t.eventNS,n=t.revertSettings;t.trigger("destroy"),t.off(),t.$wrapper.remove(),t.$dropdown.remove(),t.$input.html("").append(n.$children).removeAttr("tabindex").removeClass("selectized").attr({tabindex:n.tabindex}).show(),t.$control_input.removeData("grow"),t.$input.removeData("selectize"),e(window).off(i),e(document).off(i),e(document.body).off(i),delete t.$input[0].selectize},render:function(e,t){var i,n,s="",a=!1,r=this,o=/^[\t \r\n]*<([a-z][a-z0-9\-_]*(?:\:[a-z][a-z0-9\-_]*)?)/i;
return("option"===e||"item"===e)&&(i=P(t[r.settings.valueField]),a=!!i),a&&(k(r.renderCache[e])||(r.renderCache[e]={}),r.renderCache[e].hasOwnProperty(i))?r.renderCache[e][i]:(s=r.settings.render[e].apply(this,[t,A]),("option"===e||"option_create"===e)&&(s=s.replace(o,"<$1 data-selectable")),"optgroup"===e&&(n=t[r.settings.optgroupValueField]||"",s=s.replace(o,'<$1 data-group="'+I(A(n))+'"')),("option"===e||"item"===e)&&(s=s.replace(o,'<$1 data-value="'+I(A(i||""))+'"')),a&&(r.renderCache[e][i]=s),
s)},clearCache:function(e){var t=this;"undefined"==typeof e?t.renderCache={}:delete t.renderCache[e]},canCreate:function(e){var t=this;if(!t.settings.create)return!1;var i=t.settings.createFilter;return(e.length||t.settings.allowCreateEmpty)&&("function"!=typeof i||i.apply(t,[e]))&&("string"!=typeof i||new RegExp(i).test(e))&&(!(i instanceof RegExp)||i.test(e))}}),F.count=0,F.defaults={options:[],optgroups:[],plugins:[],delimiter:",",splitOn:null,persist:!0,diacritics:!0,create:!1,createOnBlur:!1,
selectOnBlur:!1,createFilter:null,highlight:!0,openOnFocus:!0,maxOptions:1e3,maxItems:null,hideSelected:null,addPrecedence:!1,selectOnTab:!1,preload:!1,allowEmptyOption:!1,allowCreateEmpty:!1,closeAfterSelect:!1,scrollDuration:60,loadThrottle:300,loadingClass:"loading",manualInputWidth:!1,dataAttr:"data-data",optgroupField:"optgroup",valueField:"value",labelField:"text",optgroupLabelField:"label",optgroupValueField:"value",lockOptgroupOrder:!1,sortField:"$order",searchField:["text"],searchConjunction:"and",
mode:null,wrapperClass:"selectize-control",inputClass:"selectize-input",dropdownClass:"selectize-dropdown",dropdownContentClass:"selectize-dropdown-content",dropdownParent:null,copyClassesToDropdown:!0,render:{}},e.fn.selectize=function(t){var i=e.fn.selectize.defaults,n=e.extend({},i,t),s=n.dataAttr,a=n.labelField,r=n.valueField,o=n.optgroupField,l=n.optgroupLabelField,c=n.optgroupValueField,u=function(t,i){var o,l,c,u,d=t.attr(s);if(d)for(i.options=JSON.parse(d),o=0,l=i.options.length;l>o;o++)i.items.push(i.options[o][r]);else{
var h=e.trim(t.val()||"");if(!n.allowEmptyOption&&!h.length)return;for(c=h.split(n.delimiter),o=0,l=c.length;l>o;o++)u={},u[a]=c[o],u[r]=c[o],i.options.push(u);i.items=c}},d=function(t,i){var u,d,h,p,f=i.options,m={},g=function(e){var t=s&&e.attr(s);return"string"==typeof t&&t.length?JSON.parse(t):null},v=function(t,s){t=e(t);var l=P(t.attr("value"));if(l||n.allowEmptyOption)if(m.hasOwnProperty(l)){if(s){var c=m[l][o];c?e.isArray(c)?c.push(s):m[l][o]=[c,s]:m[l][o]=s}}else{var u=g(t)||{};u[a]=u[a]||t.text(),
u[r]=u[r]||l,u[o]=u[o]||s,m[l]=u,f.push(u),t.is(":selected")&&i.items.push(l)}},y=function(t){var n,s,a,r,o;for(t=e(t),a=t.attr("label"),a&&(r=g(t)||{},r[l]=a,r[c]=a,i.optgroups.push(r)),o=e("option",t),n=0,s=o.length;s>n;n++)v(o[n],a)};for(i.maxItems=t.attr("multiple")?null:1,p=t.children(),u=0,d=p.length;d>u;u++)h=p[u].tagName.toLowerCase(),"optgroup"===h?y(p[u]):"option"===h&&v(p[u])};return this.each(function(){if(!this.selectize){var s,a=e(this),r=this.tagName.toLowerCase(),o=a.attr("placeholder")||a.attr("data-placeholder");
o||n.allowEmptyOption||(o=a.children('option[value=""]').text());var l={placeholder:o,options:[],optgroups:[],items:[]};"select"===r?d(a,l):u(a,l),s=new F(a,e.extend(!0,{},i,l,t))}})},e.fn.selectize.defaults=F.defaults,e.fn.selectize.support={validity:C},F.define("remove_button",function(t){if("single"!==this.settings.mode){t=e.extend({label:"&times;",title:"Remove",className:"remove",append:!0},t);var i=this,n='<a href="javascript:void(0)" class="'+t.className+'" tabindex="-1" title="'+A(t.title)+'">'+t.label+"</a>",s=function(e,t){
var i=e.search(/(<\/[^>]+>\s*)$/);return e.substring(0,i)+t+e.substring(i)};this.setup=function(){var a=i.setup;return function(){if(t.append){var r=i.settings.render.item;i.settings.render.item=function(e){return s(r.apply(this,arguments),n)}}a.apply(this,arguments),this.$control.on("click","."+t.className,function(t){if(t.preventDefault(),!i.isLocked){var n=e(t.currentTarget).parent();i.setActiveItem(n),i.deleteSelection()&&i.setCaret(i.items.length)}})}}()}}),F.define("restore_on_backspace",function(e){
var t=this;e.text=e.text||function(e){return e[this.settings.labelField]},this.onKeyDown=function(){var i=t.onKeyDown;return function(t){var n,s;return t.keyCode===m&&""===this.$control_input.val()&&!this.$activeItems.length&&(n=this.caretPos-1,n>=0&&n<this.items.length)?(s=this.options[this.items[n]],this.deleteSelection(t,!0)&&(this.setTextboxValue(e.text.apply(this,[s])),this.refreshOptions(!0)),void t.preventDefault()):i.apply(this,arguments)}}()}),F.define("restore_on_focus",function(e){var t=this;
e.text=e.text||function(e){return e[this.settings.labelField]};var i=t.onFocus;this.onFocus=function(t){return function(t){var n=this.caretPos-1;if(n>=0&&n<this.items.length){var s=this.options[this.items[n]],a=e.text.call(this,s);this.removeItem(s[this.settings.valueField]),this.setTextboxValue(a),this.refreshOptions(!0)}return i.apply(this,arguments)}}()}),F})}).call(t,i(4))},function(e,t,i){"use strict";function n(e,t){if(!t)return e;(0,y.default)(g.default.isArray(t),"An adapter interface must be an array of method names");
var i={};return t.forEach(function(t){i[t]=function(){return e[t].apply(e,arguments)}}),i}function s(e,t){if(e.hasOwnProperty(t)){var i=e[t];i&&g.default.isFunction(i.destroy)&&i.destroy(),delete e[t]}}function a(e){for(var t in e)s(e,t)}function r(e,t,i){(0,y.default)(void 0!==t,"An implementation for "+e+" must be provided when registering"),b[e]=n(t,i)}function o(e,t,i){b.hasOwnProperty(e)||r(e,t,i)}function l(e){g.default.each(e,function(e,t){var i=void 0,n=void 0;g.default.isArray(e)?(i=e[0],
n=e[1]):i=e,r(t,i,n)})}function c(e,t,i){b.hasOwnProperty(e)&&(w[e]=b[e]),r(e,t,i)}function u(e){w.hasOwnProperty(e)&&(s(b,e),r(e,w[e]),delete w[e])}function d(){a(b),a(w)}function h(e){return(0,y.default)(b.hasOwnProperty(e),"An implementation for "+e+" has not been registered"),b[e]}function p(e){var t=h(e);if(g.default.isFunction(t)){for(var i=arguments.length,n=Array(i>1?i-1:0),s=1;i>s;s++)n[s-1]=arguments[s];return t.apply(void 0,n)}(0,y.default)(void 0===t,e+" is not a function. Use `resolve` instead of `execute`.");
}var f=i(8).default;Object.defineProperty(t,"__esModule",{value:!0}),t.register=r,t.registerOnce=o,t.registerAll=l,t.swapIn=c,t.swapOut=u,t.reset=d,t.resolve=h,t.execute=p;var m=i(2),g=f(m),v=i(38),y=f(v),b={},w={}},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(37),a=n(s),r=new a.default({"interface":["load","stop","canPause"]});t.default=r,e.exports=t.default},function(e,t,i){var n,s;n=[i(37)],s=function(e){"use strict";var t=new e({props:["name","taskThrottle","showPhotoBackground","showLandingViewBlurredBackground","useExtraAnimations"]
});return t}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(37)],s=function(e){"use strict";var t=new e({"interface":["get","set","remove","clear"]});return t}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(7),i(20),i(28),i(26),i(90),i(42),i(47),i(16),i(185)],s=function(e,t,i,n,s,a,r,o,l,c){"use strict";var u=i.extend({readyEvent:"loadedmetadata",wrapped:["play","pause","setVolume","setPosition","resume","stop"],initialize:function(t){e.bindAll(this,"onReady","onWaiting","onStalled","onPlaying","onProgress","onTime","onPause","onVolume","onEnded","onError"),
this.type=t,this.backlog=new a,this.backlog.wrapAll(this.wrapped,function(){return!!this.mediaElement},this)},setMediaSrc:function(e,t){this.mediaElement.setAttribute("src",e)},removeMediaSrc:function(){this.mediaElement.setAttribute("src","")},addMediaListeners:function(){var e=this.mediaElement;e.addEventListener(this.readyEvent,this.onReady),e.addEventListener("waiting",this.onWaiting),e.addEventListener("stalled",this.onStalled),e.addEventListener("playing",this.onPlaying),e.addEventListener("progress",this.onProgress),
e.addEventListener("timeupdate",this.onTime),e.addEventListener("pause",this.onPause),e.addEventListener("volumechange",this.onVolume),e.addEventListener("ended",this.onEnded),e.addEventListener("error",this.onError)},removeMediaListeners:function(){var e=this.mediaElement;e.removeEventListener(this.readyEvent,this.onReady),e.removeEventListener("waiting",this.onWaiting),e.removeEventListener("stalled",this.onStalled),e.removeEventListener("playing",this.onPlaying),e.removeEventListener("progress",this.onProgress),
e.removeEventListener("timeupdate",this.onTime),e.removeEventListener("pause",this.onPause),e.removeEventListener("volumechange",this.onVolume),e.removeEventListener("ended",this.onEnded),e.removeEventListener("error",this.onError)},load:function(e){var t=e.model,i=t.get("url"),n=e.mediaElement||this.createManagedMediaElement();this.backlog.clear(),this.model=t,this.mediaElement=n,this.autoplay=null==e.autoplay?!0:e.autoplay,this.offset=t.get("position"),this.lastOffset=null;var s=!t.get("directPlay")&&"http"===e.protocol;
this.useSeekStreamSwitch=s||e.useOffsetHLS,this.useOffset=e.useOffsetHLS,this.useOffset&&this.model.set("offset",this.offset),n.stream_restart=!1,n.autoplay=this.autoplay,this.addMediaListeners(),l.group("HTML Player"),l("URL: "+i),l("Autoplay: "+this.autoplay),l("Offset: "+this.offset),l.groupEnd(),"dash"===e.protocol?(c.load(i,n),this.usingDashPlayer=!0):(this.setMediaSrc(i,e.mimeType),n.load())},play:function(){this.mediaElement.play()},pause:function(){this.mediaElement.pause(),this.mediaElement.autoplay=!1;
},setVolume:function(e){this.mediaElement.volume=e/100},setPosition:function(e){this.mediaElement.readyState>0&&(this.mediaElement.currentTime=e/1e3)},resume:function(){l("Resuming at "+this.offset),this.setPosition(this.offset),this.offset=0},stop:function(){l("Stopping playback"),this.removeMediaListeners(),this.model.set("ready",!1),this.usingDashPlayer&&(this.usingDashPlayer=!1,c.stop()),this.removeMediaSrc(),this.removeManagedMediaElement(),this.mediaElement=null},preferElementDuration:function(){
if(!e.isFinite(this.mediaElement.duration))return!1;if(this.model.get("type")!==n.types.PHOTO){var t=e.first(s.getStreams(this.model.get("media"),{streamType:o.get("audio").id,selected:!0}));if(t&&"vbr"===t.bitrateMode)return!1}return!0},getErrorMessage:function(e){return t("There was a problem playing this item.")},beforeStreamSwitch:function(){this.mediaElement&&(this.mediaElement.stream_restart=!0)},createManagedMediaElement:function(){var e=n.getElementByType(this.type),t=document.createElement(e);
return t.style.cssText="position:absolute;width:1px;height:1px;",t.managed=!0,document.body.appendChild(t),t},removeManagedMediaElement:function(){var e=this.mediaElement;e&&e.managed&&(e.managed=!1,e.parentNode&&e.parentNode.removeChild(e))},onReady:function(){var e=this.model;if(!e.get("ready")){l("Playback is ready");var t=this.mediaElement,i={ready:!0,loaded:!0};if(e.get("type")===n.types.VIDEO&&(i.videoDimensions={width:t.videoWidth,height:t.videoHeight}),e.set(i),this.preferElementDuration()){
var s=1e3*t.duration;this.useOffset&&(s+=this.offset),e.set("duration",Math.round(s))}var a=e.get("volume");null!=a&&this.setVolume(a),this.backlog.process()}},onWaiting:function(){this.model.set("state",n.states.BUFFERING)},onStalled:function(){this.model.set("state",n.states.BUFFERING)},onPlaying:function(){this.model.set("state",n.states.PLAYING)},onProgress:function(){for(var e=this.mediaElement.buffered,t=null,i=null,n=0,s=e.length;s>n;n++){var a=Math.round(1e3*e.start(n)),r=Math.round(1e3*e.end(n));
this.useOffset&&(a+=this.offset,r+=this.offset),(null===t||t>a)&&(t=a),(null===i||r>i)&&(i=r)}this.model.set({startBuffer:t,endBuffer:i})},onTime:function(){var e=this.mediaElement,t=this.offset&&!this.useSeekStreamSwitch,i=e.stream_restart;if(t||i)return void(t&&this.resume());var s=1e3*e.currentTime;this.useOffset&&(s+=this.offset);var a=this.lastOffset&&Math.abs(s-this.lastOffset)<100;if(!(e.paused||a&&this.model.get("buffering"))){var r=this.model;this.lastOffset=s,r.get("buffering")&&r.set("state",n.states.PLAYING),
r.set("position",Math.round(s))}},onPause:function(){var e=this.model.get("partIndex")+1<this.model.get("partCount");this.mediaElement.ended&&e||(this.mediaElement.resume_pending||this.mediaElement.stream_restart||this.usingDashPlayer&&c.canPause(this.mediaElement)?this.model.set("state",n.states.BUFFERING):this.model.set("state",n.states.PAUSED))},onVolume:function(){this.model.set("volume",Math.round(100*this.mediaElement.volume))},onEnded:function(){this.model.set("ended",!0)},onError:function(e){
var t=e.target.error,i=t&&t.code;i&&l.warn("Media element error code: "+i),this.model.set({state:n.states.ERROR,errorMessage:this.getErrorMessage(i)})}});return u}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(4),a=n(s),r=i(20),o=n(r),l=i(33),c=n(l),u=i(16),d=n(u),h=i(72),p=n(h),f=i(136),m=n(f),g=i(73),v=n(g),y=o.default.extend({mixins:[c.default],initialize:function(e){this.appModel=e.appModel,this.servers=e.servers,
this.minServerVersion=e.minServerVersion},start:function(e){this.stop(),this.listenTo(this.appModel,{"change:primaryServer":this.onPrimaryServerChange,"change:isWaitingForServers":this.onWaitingForServersChange}),this.listenTo(this.servers,{"update reset":this.onServersUpdate}),this._setPrimaryServer()},stop:function(){this.stopListening(),this._primaryServerPromise=null},canBePrimary:function(e){return e.canBePrimary(this.minServerVersion)},fetchPrimaryRelations:function(e){var t=this;(!e.get("isShared")||e.supports("sharedSettings"))&&!function(){
var i=e.get("settings");i.populate().done(function(){var n=t.appModel.get("primaryServer");n&&n.id===e.id&&t.handlePrimarySettings(e,i)})}()},handlePrimarySettings:function(e,t){var i=t.get("collectUsageData");i&&i.get("value")?(m.default.enable(),p.default.enable(),v.default.enable()):(m.default.disable(),p.default.disable(),v.default.disable())},_setPrimaryServer:function(){var e=this;if(this._primaryServerPromise)return this._primaryServerPromise;this.appModel.set("primaryServer",null);var t=this._waitForPrimaryServer();
return this._primaryServerPromise=t,t.done(function(i){t===e._primaryServerPromise&&(e._primaryServerPromise=null,e.appModel.set("primaryServer",i))}).fail(function(){t===e._primaryServerPromise&&(e._primaryServerPromise=null,e.appModel.set("primaryServer",!1))}),t},_waitForPrimaryServer:function(){var e=this,t=this.appModel.get("user"),i=t.get("lastPrimaryServerID"),n=void 0;return i?((0,d.default)("[Primary Server] Waiting to restore last primary server,",i),n=this.servers.populateServer(i,this.canBePrimary.bind(this))):n=a.default.Deferred().reject().promise(),
n=n.then(null,function(){return(0,d.default)("[Primary Server] Waiting for any owned server"),e.servers.populateServer({isFullOwnedServer:!0},e.canBePrimary.bind(e))}),n=n.then(null,function(){return(0,d.default)("[Primary Server] Waiting for any shared server"),e.servers.populateServer({isFullServer:!0},e.canBePrimary.bind(e))})},onPrimaryServerChange:function(e,t){if(t){d.default.info("[Primary Server] %s is now the primary server",t.get("debugName"));var i=e.get("user");i.set("lastPrimaryServerID",t.id),
this.fetchPrimaryRelations(t)}else t===!1?d.default.warn("[Primary Server] No primary server found"):(0,d.default)("[Primary Server] Waiting to set the primary server")},onWaitingForServersChange:function(e,t){t&&this.appModel.get("primaryServer")===!1&&this._setPrimaryServer()},onServersUpdate:function(){var e=this.appModel.get("user"),t=this.appModel.get("primaryServer");if(t){var i=t&&!this.servers.get(t.id);i&&((0,d.default)("[Primary Server] The previous primary server, %s, was removed",t.get("debugName")),
e.unset("lastPrimaryServerID"),this._setPrimaryServer())}else this._setPrimaryServer()}});t.default=y,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(2),a=n(s),r=i(7),o=n(r),l=i(5),c=n(l),u=i(20),d=n(u),h=i(34),p=n(h),f=i(93),m=n(f),g=i(16),v=n(g),y=i(547),b=n(y),w=i(33),x=n(w),S=d.default.extend({mixins:[x.default],initialize:function(e){this.name=e.name||"ServerEventManager",this.servers=e.servers,this.isValidServer=e.isValidServer,
this.supportsLongPolling=e.supportsLongPolling,this.showTimelineStatus=e.showTimelineStatus,this.ServerEventConnection=e.ServerEventConnection,this.retryWorker=new b.default(this),this.connections={}},start:function(){this.listenTo(this.servers,{"change:isResolved":this.onServerResolvedChange,"change:isRejected":this.onServerRejectedChange,remove:this.onServerRemove,reset:this.onServersReset}),this.showTimelineStatus&&this.listenTo(c.default,"timeline",this.onTimeline)},stop:function(){this.stopListening(),
this.retryWorker.removeAll(),this.connections={}},connect:function(e){var t=e.server,i=this.connections[t.id];i||(i=new this.ServerEventConnection({server:t}),this.connections[t.id]=i,this.listenTo(i,{open:this.onOpen,close:this.onClose,error:this.onClose}));var n=i.open(),s=i.socket?i.socket.url:i.pollUrl;return(0,v.default)("["+this.name+"] Opening server event connection to "+t.get("debugName")+" at "+s),n},disconnectAll:function(){var e=this;a.default.each(this.connections,function(t){e.disconnect({
connection:t})})},disconnect:function(e){var t=e.connection;if(t||(t=this.connections[e.server.id]),t){var i=t.socket?t.socket.url:t.pollUrl,n=t.server;(0,v.default)("["+this.name+"] Closing server event connection to "+n.get("debugName")+" at "+i),this.stopListening(t),this.retryWorker.remove(t.server),t.close(),delete this.connections[t.server.id]}},onServerResolvedChange:function(e,t){this.isValidServer(e)&&t&&(p.default.hasWebSocket||this.supportsLongPolling?this.connect({server:e}):e.trigger("socket:websocket",{
error:!0}))},onServerRejectedChange:function(e,t){t&&this.disconnect({server:e})},onServerRemove:function(e){var t=this.connections[e.id];if(t&&(this.disconnect({connection:t}),e.get("isMerged")&&t)){var i=this.servers.get(e.id);this.connect({server:i})}},onServersReset:function(e,t){var i=this,n=t.previousModels;a.default.each(n,function(t){e.contains(t)||i.disconnect({server:t})})},onTimeline:function(e){var t=void 0;switch(e.state){case m.default.CREATED:t="Created {1} in {2} on {3}";break;case m.default.MATCHING:
t="Matching {1} in {2} on {3}";break;case m.default.DOWNLOADING_METADATA:t="Downloading metadata for {1} in {2} on {3}";break;case m.default.LOADING_METADATA:t="Loading metadata for {1} in {2} on {3}";break;case m.default.PROCESSED:t="Finished processing {1} in {2} on {3}";break;case m.default.ANALYZING:t="Analyzing {1} in {2} on {3}";break;case m.default.DELETED:t="Deleted {1} in {2} on {3}"}if(t&&e.sectionID>0){var i=e.title||(0,o.default)("an item"),n=e.section?e.section.get("title"):"section "+e.sectionID;
c.default.trigger("show:status",e.server,(0,o.default)(t,i,n,e.server.get("friendlyName")))}},onOpen:function(e){var t=this.connections[e.id],i=t.socket?t.socket.url:t.pollUrl;v.default.info("["+this.name+"] Opened server event connection to "+e.get("debugName")+" at "+i),this.retryWorker.remove(e)},onClose:function(e){v.default.warn("["+this.name+"] Unexpectedly closed server event connection to "+e.get("debugName")),this.retryWorker.add(e)}});t.default=S,e.exports=t.default},function(e,t,i){var n,s;
n=[i(2),i(4),i(59),i(24)],s=function(e,t,i,n){"use strict";var s=n.extend({fetch:function(){return this.storage.fetch().then(e.bind(function(){var i=this.storage.get(e.result(this,"storageKey"));return i?(this.set(i),this):t.Deferred().reject()},this))},save:function(t){return i.alwaysResolve(this.storage.fetch()).then(e.bind(function(){return t&&this.set(t),this.storage.save(e.result(this,"storageKey"),this.toJSON())},this))},destroy:function(){return i.alwaysResolve(this.storage.fetch()).then(e.bind(function(){
return this.storage.unset(e.result(this,"storageKey")),this.storage.save()},this))}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(15),i(24),i(40)],s=function(e,t,i,n){"use strict";var s=i.extend({idAttribute:"key",subcollections:["Directory","Video","Track","Photo","Artist","Album","Playlist"],url:function(){return this.id?this.id:"/:/plugins/"+this.get("identifier")+"/root"},initialize:function(e,t){this.set("items",new n([],{server:this.server,channel:this.channel||this,
parent:this,skipCache:!0}))},convert:function(i){var n=e.isObject(i)?i:t.parseXML(i);return t.parseBoolean(n,["installed","noCache","allowSync","hasPrefs","hasStoreServices","share"]),t.parseInteger(n,["size","lastAccessedAt"]),t.parseArray(n,"Metadata"),n},parse:function(t){if(e.isString(t)){var i=this.subcollections.join("|"),n=new RegExp("<("+i+")","g"),s=new RegExp("</("+i+")>","g");t=t.replace(n,'<Metadata elementName="$1"'),t=t.replace(s,"</Metadata>")}var a=this.convert(t),r=this.toJSON();if(r&&(r.key&&(a.key=r.key),
r.identifier&&(a.identifier=r.identifier)),"none"===a.key&&delete a.key,a.title2?(a.title=a.title2,delete a.title2):a.title1?(a.title=a.title1,delete a.title1):a.name&&(a.title=a.name,delete a.name),a.prefsKey&&(a.settingsKey=a.prefsKey,delete a.prefsKey),a.key){var o=/^\/(\w+)\//,l=a.key.match(o);l&&(a.type=l[1])}for(var c=a.Metadata.length-1;c>-1;c--){var u=a.Metadata[c];u.isChannel=!0,u.allowSync=a.allowSync,a.identifier&&(u.identifier=a.identifier),a.mediaTagPrefix&&(u.mediaTagPrefix=a.mediaTagPrefix),
a.mediaTagVersion&&(u.mediaTagVersion=a.mediaTagVersion),u.settings?(a.settingsKey=u.key,a.Metadata.splice(c,1)):u.search&&(a.searchKey=u.key,a.Metadata.splice(c,1))}var d=this.get("items");return d&&(d.reset({Metadata:a.Metadata},{parse:!0}),delete a.Metadata),a}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(5),i(15),i(14),i(123),i(29),i(194)],s=function(e,t,i,n,s,a,r){"use strict";var o=a.extend({model:r,subcollections:["Playlist","Directory","Video","Track","Photo","Hub"],
url:function l(){var l="/hubs";if(this.section&&(l+="/sections/"+this.section.id),this.excludes&&this.excludes.length>0){var t=e.map(this.excludes,function(e){return"exclude"+s(e)+"=1"});l+="?"+t.join("&")}return l},initialize:function(e,i){i||(i={}),this.excludes=i&&i.excludes,i.section&&this.listenTo(t,"clear:sections:hubs",this.clear)},fetch:function(t){t||(t={});var i=e.clone(t);return t.onlyTransient&&this.populatePromise&&(i.remove=!1,i.url=n.join(e.result(this,"url"),{onlyTransient:1})),a.prototype.fetch.call(this,i);
},parse:function(t){return e.isString(t)&&(t=i.replaceXMLElementNames(t,this.subcollections,"Metadata")),this.convert(t,"Metadata")}});return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(15),i(24),i(40)],s=function(e,t,i,n){"use strict";var s=i.extend({idAttribute:"hubIdentifier",whitelistedAttrs:["key","hubKey","hubIdentifier","title","type","size","more","browse"],url:function(){return this.get("key")||this.get("hubKey")},convert:function(i){var n=e.isObject(i)?i:t.parseXML(i);
return t.parseInteger(n,"size"),t.parseBoolean(n,["more","browse"]),n},parse:function(t){var i=this.convert(t),s=this.get("children");return s||(s=new n([],{server:this.server,section:this.section,parent:this,url:i.key||i.hubKey}),this.set("children",s)),s.set(t,{parse:!0,silent:!0}),i=e.pick(i,this.whitelistedAttrs)}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(14),i(25),i(40)],s=function(e,t,i,n){"use strict";function s(e,t,n){var s=/!$/.test(n),a=/\.id$/.test(n);
if(s||a)return e[n]=t,e;var r=n.match(/^(.+)\.(.+)/);return r&&(e.type=i.get(r[1]).id,n=r[2]),e[n+".query"]=t,e}var a=n.extend({initialize:function(e,t){return this.query=t.query,this.multiMetadataModel=t.multiMetadataModel,n.prototype.initialize.apply(this,arguments)},url:function(){var n=this.multiMetadataModel,a={type:i.get(n.get("type")).id,limit:10};return a=e.reduce(this.query,s,a),t.join([n.sectionUrl(),"/autocomplete"],a)}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){
var n,s;n=[i(29),i(447)],s=function(e,t){"use strict";var i=e.extend({model:t});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(20),i(33),i(25),i(445),i(198)],s=function(e,t,i,n,s,a){"use strict";var r=t.extend({mixins:i,initialize:function(e){this.server=e.server,this._queues={audio:null,photo:null,video:null},this.canCreateOnLocal=s.prototype.isItemQueueable,this.doesLocalSupport=s.prototype.supports},createFor:function(e,t){t=t||e;var i;i=t.get("isPlaylist")?t.get("playlistType"):e.get("element")||n.getChildMediaType(t.get("type")).element;
var r=null;return this.canCreateOnServer(e)?r=new a({mediaType:i},{server:this.server}):this.canCreateOnLocal(e)&&(r=new s({mediaType:i},{server:this.server})),this._queues[i]=r,this.trigger("change change:playQueue:"+i,r),r},getForType:function(e){return this._queues[e]},createForType:function(e,t){var i=null;return i=t.onServer?new a({mediaType:e},{server:this.server}):new s({mediaType:e}),this._queues[e]=i,this.trigger("change change:playQueue:"+e,i),i},getFor:function(e){var t=e.get("type");if(!t||"channelDirectory"===t)return null;
var i;i=e.get("isPlaylist")?e.get("playlistType"):e.get("element")||n.getChildMediaType(t).element;var s=this._queues[i];return s&&s.isItemQueueable(e)?s:null},get:function(t){return e.findWhere(this._queues,{id:t})},populateQueue:function(e,t){var i=new a({playQueueID:e,mediaType:t},{server:this.server});return this._queues[t]=i,i.populate()},remove:function(e){var t=this._queues[e];t&&(this._queues[e]=null,this.trigger("change remove:playQueue:"+e,t))},removeAll:function(){e.each(e.keys(this._queues),this.remove,this);
},canCreateOnServer:function(e){return this.server.supports("playQueues")&&this.server.get("isFullServer")&&a.prototype.isItemQueueable(e)},doesServerSupport:function(e){return this.server.supports("playQueues")&&a.prototype.supports(e)},canCreateFor:function(e,t){return this.canCreateOnServer(e)&&this.doesServerSupport(t)||this.canCreateOnLocal(e)&&this.doesLocalSupport(t)}});return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(5),i(77),i(15),i(14),i(24),i(140)],
s=function(e,t,i,n,s,a,r,o){"use strict";var l={audio:"Track",photo:"Photo",video:"Video"},c=r.extend({idAttribute:"playQueueID",defaults:{selectedItem:null,mediaType:null,collection:null,server:null,owned:!0,allowedElement:null,hasUserAdditions:!1,repeatAll:!1,shuffled:!1,hasUpNext:!1,playQueueID:null,playQueueVersion:0,playQueueSelectedItemID:null,message:null},url:function(){return"/playQueues/"+this.id},initialize:function(e,t){this.set("server",t.server),this.set("allowedElement",l[this.get("mediaType")]),
this.set("collection",new o([],{server:t.server}))},_fetch:function(){var t=e.result(this,"url");return this._ajax("GET",t)},convert:function(t){var i=e.isObject(t)?t:s.parseXML(t);return s.parseInteger(i,"playQueueVersion"),s.parseArray(i,this.get("allowedElement")),s.parseBoolean(i,"playQueueShuffled"),i.stationService?(s.parseBoolean(i,"allowRepeat"),s.parseBoolean(i,"allowSeek"),s.parseBoolean(i,"allowShuffle"),s.parseBoolean(i,"allowSkipPrevious"),s.parseInteger(i,"stationSkipsPerHour"),s.parseInteger(i,"serviceSkipsPerDay"),
i.isRadio=!0):i.isRadio=!1,i},parse:function(t){t=s.replaceXMLElementNames(t,["Directory"],"Metadata");var i=this.convert(t),n=["playQueueSelectedItemID","playQueueSelectedItemOffset","playQueueSelectedMetadataItemID","message","isRadio","stationTitle","stationThumb","stationService","allowRepeat","allowSeek","allowShuffle","allowSkipPrevious","stationSkipsPerHour","serviceSkipsPerDay"];i.playQueueVersion>this.get("playQueueVersion")&&n.push("playQueueID","playQueueVersion");var a=e.pick(i,n);return a.shuffled=!!i.playQueueShuffled,
a.hasUpNext=!!i.playQueueLastAddedItemID,this.set(a),this.parseElementCollection(i)},parseElementCollection:function(t){var i=t[this.get("allowedElement")],n=e(i).pluck("playQueueItemID").indexOf(t.playQueueSelectedItemID),s=parseInt(t.playQueueSelectedItemOffset,10),a=s-n;return e.each(i,function(e,i){e.queueIndex=a+i,t.identifier&&(e.identifier=t.identifier),t.mediaTagPrefix&&(e.mediaTagPrefix=t.mediaTagPrefix),t.mediaTagVersion&&(e.mediaTagVersion=t.mediaTagVersion)}),i.message=t.message,i.totalSize=parseInt(t.playQueueTotalCount,10),
i.availableRange={start:a,end:a+i.length},i},_ajax:function(n,s){var r={repeat:this.get("repeatAll")?1:0};"audio"===this.get("mediaType")&&(r.includeRelated=1),s=a.join(s,r);var o=e.extend(this.get("server").getXHROptions(s),{type:n}),l=t.ajax(o),c=e.bind(function(e){var t=this.parse(e);t.message&&i.trigger("show:alert",{type:"error",message:t.message}),this.get("collection").reset(t,{parse:!0}),this.set("selectedItem",this.getCurrentItem())},this);return l.done(c,this)},getCurrentItem:function(){
var e=this.get("playQueueSelectedItemID");return this.get("collection").findWhere({playQueueItemID:e})||null},queueContent:function(t,i){i||(i={});var s={type:this.get("mediaType"),includeChapters:1};if(t.get("playlistType"))s.playlistID=t.get("ratingKey");else{var r=e.pick(i,"unwatched","items","excludeSeedItem");s.uri=n.uri(t,r)}return i.firstItem&&(s.key=i.firstItem.get("key")),i.extrasPrefixCount&&(s.extrasPrefixCount=i.extrasPrefixCount),s.shuffle=i.shuffle?1:0,i.continuous&&"episode"===t.get("type")&&(s.continuous=1),
this.isNew()?this._addContentPromise=this._ajax("POST",a.join("/playQueues",s)):(s.next=i.next?1:0,this.set("hasUserAdditions",!0),this._addContentPromise=this._ajax("PUT",a.join(e.result(this,"url"),s))),this._addContentPromise},addContent:function(t,i){var n=this.queueContent(t,i);return i&&i.firstItem?n.done(e.bind(function(){var e=i.firstItem.get("key"),t=this.get("collection").find(function(t){return t.get("key")===e});this.set("selectedItem",t)},this)):n.done(e.bind(function(){this.set("selectedItem",this.get("collection").at(0));
},this))},removeItem:function(i){if(i.get("playQueueItemID")===this.get("selectedItem").get("playQueueItemID"))return t.Deferred().resolve().promise();this.set("hasUserAdditions",!0);var n=a.join([e.result(this,"url"),"/items/",i.get("playQueueItemID")]);return this._ajax("DELETE",n)},moveItem:function(i,n){if(i===this.get("selectedItem").get("playQueueItemID"))return t.Deferred().resolve().promise();var s=n||this.get("selectedItem").get("playQueueItemID");this.set("hasUserAdditions",!0);var r={after:s
},o=a.join([e.result(this,"url"),"/items/",i,"/move"],r);return this._ajax("PUT",o)},isItemQueueable:function(t){var i=e(t).result("url"),n=/\/(library|hubs|services\/(gracenote|mixradio))\//.test(i)||t.get("playlistType"),s=-1!==i.indexOf("/sync/"),a=-1!==i.indexOf("/folder"),r=t.get("type")&&("photoAlbum"===t.get("type")||"photo"===t.get("type")),o="photo"===t.viewGroup||r,l=t.server.supports("photoPlayQueues"),c=!1;if(t.get("currentSubset")){var u=t.get("currentSubset").id;c="folder"===u||"recentlyViewedShows"===u;
}return n&&!s&&!a&&(l||!o)&&!c},toggleShuffle:function(){var t=[e.result(this,"url")];return this.get("shuffled")?t.push("/unshuffle"):t.push("/shuffle"),this._ajax("PUT",a.join(t))},setRepeatAll:function(e){return this.set("repeatAll",e),this.fetch()},yieldOwnership:function(){this.set("owned",!1);var i=this._addContentPromise||t.Deferred().resolve().promise();return i.then(e.bind(function(){return this.get("playQueueID")&&this.get("collection").length>0?e.result(this,"url")+"?own=1&window=200":null;
},this))},takeOwnership:function(){if(this.get("owned"))return t.Deferred().resolve().promise();this.set("owned",!0);var i=e.result(this,"url")+"?own=1";return this._ajax("GET",i)},supports:function(){return!0}});return c}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(437)],s=function(e,t){"use strict";var i=t.extend({initialize:function(t){this.playQueue=t.playQueue,this.includeSelectedItem=t.includeSelectedItem,this.addFilter(e.bind(this.filterUpNext,this)),this.listenForUpNextChanges();
},listenForUpNextChanges:function(){var t=e.debounce(this.onPlayQueueChange),i=["change:playQueueSelectedItemID","change:playQueueLastAddedItemID"];this.listenTo(this.playQueue,i.join(" "),t),this.listenTo(this.playQueue.get("collection"),"change:queueIndex",t)},filterUpNext:function(e){var t=this.superset.indexOf(e),i=this.playQueue.getUpNextRange(),n=i.start,s=i.end;return this.includeSelectedItem||(n+=1),t>=n&&s>=t},onPlayQueueChange:function(){this.refilter()}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(67),i(29),i(118)],s=function(e,t,i){"use strict";var n=t.extend({model:i,comparator:"titleSort",url:function s(){var e,t=this.filterOptions.get("currentSort");e=t?t.id+":"+t.get("direction"):"titleSort:asc";var s="/playlists/all?type=15&sort="+e,i=this.filterOptions.get("currentType");return i&&(s+="&playlistType="+i),this.filterOptions.get("onlyDumb")&&(s+="&smart=0"),s},initialize:function(e,t){this.filterOptions=t.filterOptions},sync:function(i,n,s){var a=e.addVersionHeader(2,s);
return t.prototype.sync.call(this,i,n,a)},parse:function(e){return this.convert(e,"Playlist")}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(35)],s=function(e){"use strict";var t=e.extend({cacheKey:function(t){var i=e.prototype.cacheKey.apply(this,arguments);return i+"!"+t.syncItemId}});return t}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(2),a=n(s),r=i(27),o=n(r),l=i(455),c=n(l),u=o.default.extend({
name:"FilterOptionCollection",context:["server","section","type","standalone"],model:c.default,url:function d(){var e=a.default.result(this.section,"url"),d=e+"/"+this.parent.id;return this.type?d+="?type="+this.type:this.standalone||(d+="?"+this.getUrlParams()),d},getUrlParams:function(){var e=this,t={},i=[],n=this.section.get("currentType"),s=this.section.get("currentFilters");return n&&(t.type=n.id),a.default.each(s,function(i){i.key!==e.parent.id&&i.values.length&&(t[i.key]=i.values.join(","));
}),a.default.each(t,function(e,t){"unviewedLeafCount"===t?i.push(t+">="+e):i.push(t+"="+e)}),i.join("&")},augmentResponse:function(e){return e.Directory&&!a.default.isArray(e.Directory)&&(e.Directory=[e.Directory]),e.Directory=a.default.filter(e.Directory,function(e){return e.title}),e},search:function(e){var t=this.filter(function(t){return t.get("title").toLowerCase().indexOf(e.toLowerCase())>-1});return this.clone(t)}});t.default=u,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;
Object.defineProperty(t,"__esModule",{value:!0});var s=i(21),a=n(s),r=i(23),o=n(r),l=o.default.extend({name:"FirstCharacterModel",context:["server","section"],idAttribute:"key",rootPropertyName:"Directory",syncedAttrs:{key:a.default.string,title:a.default.string,size:a.default.integer},urlRoot:function(){return"/library/sections/"+this.section.id+"/firstCharacter"}});t.default=l,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(21),a=n(s),r=i(23),o=n(r),l=o.default.extend({
name:"MediaTypeModel",context:["server","section"],sessionAttrs:{id:a.default.integer,typeString:a.default.string,title:a.default.string,plural:a.default.string,element:a.default.string,child:a.default.integer,grandchild:a.default.integer,parent:a.default.integer,grandparent:a.default.integer,selected:a.default.boolean},defaults:{selected:!1}});t.default=l,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(2),a=n(s),r=i(14),o=n(r),l=i(27),c=n(l),u=i(206),d=n(u),h=c.default.extend({
name:"SortCollection",context:["server","section","typeID"],model:d.default,url:function(){var e=a.default.result(this.section,"url"),t=this.typeID||this.section.get("currentType").id,i=t?{type:t}:{};return o.default.join([e,"/sorts"],i)}});t.default=h,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(21),a=n(s),r=i(23),o=n(r),l={ASCENDING:"asc",DESCENDING:"desc"},c=o.default.extend({name:"SortModel",context:["server","section"],
idAttribute:"key",rootPropertyName:"Directory",sessionAttrs:{selected:a.default.boolean,direction:a.default.string},syncedAttrs:{key:a.default.string,title:a.default.string,isDefault:a.default.boolean,defaultDirection:a.default.string},defaults:{selected:!1},augmentResponse:function(e){return e.defaultDirection||(e.defaultDirection=e.default||l.ASCENDING),e.isDefault=!!e.default,e.direction||(e.direction=e.defaultDirection),e},reverseSortDirection:function(){var e=this.get("direction")||this.get("defaultDirection");
e=e&&e!==l.ASCENDING?l.ASCENDING:l.DESCENDING,this.set("direction",e)}},{directions:l});t.default=c,e.exports=t.default},function(e,t,i){var n,s;n=[i(2),i(209)],s=function(e,t){"use strict";var i={PLAYING:"playing",PAUSED:"paused"},n=t.extend({defaults:e.extend({slideshowState:i.PAUSED,slideshowPaused:!0,slideshowPlaying:!1},t.prototype.defaults),initialize:function(){this.on("change:slideshowState",function(e,t){e.set({slideshowPaused:t===i.PAUSED,slideshowPlaying:t===i.PLAYING})}),t.prototype.initialize.apply(this,arguments);
}},{slideshowStates:i});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(187),i(242),i(89),i(191)],s=function(e,t,i,n){"use strict";var s=2592e5,a=i.extend({storageKey:"resumePlayQueue",serialize:function(e){return i.prototype.serialize.call(this,t.augmentDictionary(e,{ttl:s}))},_getStorage:function(){return e}}),r=n.extend({initialize:function(e,t){n.prototype.initialize.apply(this,arguments),this.user=t.user,this.storage=new a},storageKey:function(){return this.user.id;
},toJSON:function(){var e=n.prototype.toJSON.apply(this,arguments);return t.augmentObj(e,s,!0)}});return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(19),i(28)],s=function(e,t,i){"use strict";var n={item:null,media:null,part:null,url:null,subtitlesUrl:null,playQueue:null,transcodeServer:null,mediaIndex:-1,partIndex:-1,partCount:1,qualityIndex:null,videoStreamID:null,audioStreamID:null,subtitleStreamID:null,type:i.types.VIDEO},s={state:i.states.STOPPED,stopped:!0,paused:!1,
playing:!1,buffering:!1,bufferingMessage:null,error:!1,errorMessage:null,ready:!1,loaded:!1,ended:!1,finished:!1,embedHtml:null,duration:0,position:0,lastSeekPosition:null,offset:0,volume:100,startBuffer:0,endBuffer:0,percentBuffered:0,shuffled:!1,repeatAll:!1,repeatItem:!1,directPlay:!1,videoDimensions:null,session:null,softSubtitlesFailed:!1},a={canPlayPause:!1,canStop:!1,canSeek:!1,canSetVolume:!1,canSetVideoStream:!1,canSetAudioStream:!1,canSetSubtitleStream:!1,canSetQuality:!1,canShuffle:!1,
canRepeat:!1,canSkipPrevious:!1,canSkipNext:!1,showSeekBar:!1,showAudioStream:!1,showSubtitleStream:!1,showQuality:!1,showPlayQueue:!1,showShuffle:!1,showRepeat:!1,showMinimize:!1,showMaximize:!1,showEnterFullscreen:!1,showExitFullscreen:!1,forceWebkitVideoFullscreen:!1},r=t.Model.extend({itemDefaults:n,playerDefaults:s,controllerDefaults:a,defaults:e.extend({},n,s,a),initialize:function(){this.on("invalid",function(t,i){e.indexOf(i.keys,"duration")>-1&&(i.attrs.duration=Math.max(i.attrs.duration,0)),
e.indexOf(i.keys,"position")>-1&&(i.attrs.position=Math.min(Math.max(i.attrs.position,0),i.attrs.duration)),e.indexOf(i.keys,"volume")>-1&&(i.attrs.volume=Math.min(Math.max(i.attrs.position,0),100)),t.set(i.attrs)}),this.on("change:state",function(e,t){e.set({stopped:t===i.states.STOPPED,paused:t===i.states.PAUSED,playing:t===i.states.PLAYING,buffering:t===i.states.BUFFERING,error:t===i.states.ERROR}),t!==i.states.STOPPED&&e.set("ended",!1)}),this.on("change:position",function(e,t){var i=this.get("duration"),n=i?Math.min(Math.max(t/i*100,0),100):0;
this.set("positionPercentage",n)})},validate:function(e,t){var i=[];return e.duration<0&&i.push("duration"),(e.position<0||e.position>e.duration)&&i.push("position"),(e.volume<0||e.volume>100)&&i.push("volume"),i.length?{keys:i,attrs:e}:void 0}});return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";function n(e){if(!e.length)return"(none)";var t=r.default.map(e,function(e){return e.get("debugName")});return t.join(", ")}var s=i(8).default;Object.defineProperty(t,"__esModule",{
value:!0});var a=i(2),r=s(a),o=i(4),l=s(o),c=i(16),u=s(c),d=i(143),h=s(d),p=i(27),f=s(p),m=i(53),g=s(m),v=f.default.extend({mixins:[h.default],name:"ServerCollection",model:g.default,initialize:function(){this._resetPopulate()},comparator:function(e){var t=e.get("isFullOwnedServer"),i=e.get("isShared"),n=e.get("friendlyName")||"",s=t?"0":"1";return s+=i?"1":"0",s+=n.toLowerCase()},shouldWaitForInitialServers:function(){var e=this.filter(function(e){var t=!e.id||!!e.get("resources");return t&&e.hasPendingPopulate();
});return e.length?((0,u.default)("[Servers] Waiting for initial servers =",n(e)),!0):!1},shouldWaitForResources:function(){var e=this.reduce(function(e,t){var i=t.get("isResolved"),n=t.get("resources"),s=n&&(!n.populatePromise||n.hasPendingPopulate());return i&&s&&e.push(t),e},[]);return e.length?((0,u.default)("[Servers] Waiting for additional resources from",n(e)),!0):!1},shouldWaitForPendingServers:function(){if(this.findWhere({isConnected:!0}))return!1;var e=this.filter(function(e){return e.hasPendingPopulate();
});return e.length?((0,u.default)("[Servers] Waiting for pending servers =",n(e)),!0):!1},waitForServers:function(){this._resetPopulate()},foundAllServers:function(){var e=this.where({isConnected:!0}),t=n(e);(0,u.default)("[Servers] Found all servers =",t),e.length?this._resolvePopulate():this._rejectPopulate()},populateAnyServer:function(){function e(e){var t=o.indexOf(e);t>-1&&(o.splice(t,1),this.hasOnlyRejectedServers(o)&&a.reject())}function t(e,t){var i=r.default.contains(o,e);i&&t&&a.resolve(e);
}function i(e,t){var i=r.default.contains(o,e);i&&t&&this.hasOnlyRejectedServers(o)&&a.reject()}var n=this,s=arguments.length<=0||void 0===arguments[0]?this.models:arguments[0],a=l.default.Deferred(),o=s.slice(0),c=r.default.find(o,function(e){return e.get("isResolved")});return c?a.resolve(c).promise():this.hasOnlyRejectedServers(o)?a.reject().promise():(this.listenTo(this,{remove:e,"change:isResolved":t,"change:isRejected":i}),a.always(function(){n.stopListening(n,"change:isResolved",t),n.stopListening(n,"change:isRejected",i);
}),a.promise())},populateServer:function(e,t){return this.findServer(e,t,!0).then(function(e){return e.populate()})},findServer:function(e,t,i){function n(){var e=this,s=this.filterServers(o,t,i);s&&(h=s,s.done(function(e){h===s&&c.resolve(e)}),s.fail(function(t){h===s&&(a||"pending"!==e.populatePromise.state()?c.reject():e.populate().always(n.bind(e)))}))}var s=this,a=r.default.isString(e),o=a?{machineIdentifier:e}:e,c=l.default.Deferred(),u=r.default.map(r.default.keys(o),function(e){return"change:"+e;
}),d="add "+u.join(" "),h=void 0;return n.call(this),this.listenTo(this,d,n),this.populate().always(function(){h||c.reject()}),c.always(function(){s.stopListening(s,d,n)}),c.promise()},filterServers:function(e,t,i){var n=this.where(e),s=t?r.default.filter(n,t):n;return s.length?i?this.populateAnyServer(s):l.default.Deferred().resolve(s[0]).promise():void 0},hasOnlyRejectedServers:function(){var e=arguments.length<=0||void 0===arguments[0]?this.models:arguments[0];return r.default.every(e,function(e){
return e.get("isRejected")})},hasLoopbackServer:function(){var e=arguments.length<=0||void 0===arguments[0]?this.models:arguments[0];return!!r.default.find(e,function(e){var t=e.get("activeConnection");return!!t&&t.get("isLoopback")})}});t.default=v,e.exports=t.default},function(e,t,i){var n,s;n=[i(35)],s=function(e){"use strict";var t=e.extend({idAttribute:"sessionKey",cacheKey:function(e){return this.server&&this.server.getScopedKey(e.sessionKey)}});return t}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(2),i(39),i(89)],s=function(e,t,i){"use strict";var n=i.extend({storageKey:"sessionstats",incPlaybackCount:function(){this.save("playbackCount",this.get("playbackCount")+1)},startSession:function(){var i=(new Date).getTime();this.save({playbackCount:0,startTime:i,heartbeatTime:i}),setInterval(e.bind(function(){this.save("heartbeatTime",(new Date).getTime())},this),t.get("heartbeatInterval"))}});return new n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;
n=[i(2),i(4),i(15),i(24),i(498)],s=function(e,t,i,n,s){"use strict";var a=n.extend({whitelistedAttrs:["id","home","protected","restricted","title","username","email","thumb","recommendationsPlaylistId","allowSync","allowCameraUpload","allowChannels","filterMovies","filterTelevision","filterMusic","filterPhotos"],saveAttrs:["allowSync","allowCameraUpload","allowChannels","filterMovies","filterTelevision","filterMusic","filterPhotos"],filterAttrs:["filterMovies","filterTelevision","filterMusic","filterPhotos"],
urlRoot:function(){return this.get("home")?"/api/users":"/api/friends"},convert:function(t){var n=e.isObject(t)?t:i.parseXML(t);return n.User&&(n=n.User),i.parseInteger(n,"id"),i.parseBoolean(n,["home","protected","restricted","allowSync","allowCameraUpload","allowChannels"]),i.parseQueryString(n,["filterMovies","filterTelevision","filterMusic","filterPhotos"],"|"),i.parseArray(n,"Server"),n},parse:function(t){var i=this.convert(t);return this.parseServers(i),i=e.pick(i,this.whitelistedAttrs)},parseServers:function(e){
var t=this.get("serverShares"),i=e.Server;t?t.set(i,{parse:!0}):(t=new s(i,{server:this.server,parent:this,populated:!0,parse:!0}),this.set("serverShares",t))},cloneDeep:function(){var e=this.toJSON();e.Server=e.serverShares.toJSON(),e.serverShares=null;var i={server:this.server,section:this.section,channel:this.channel,parent:this.parent,parse:!0,skipCache:!0};return new this.constructor(t.extend(!0,{},e),i)||null},getSaveParams:function(t,i){if(e.isEmpty(t)){var s=this.pick(this.saveAttrs);return e.map(s,function(t,i,n){
e.isBoolean(t)?n[i]=t?"1":"0":e.contains(this.filterAttrs,i)&&(n[i]=this.stringifyFilter(t))},this),s}return n.prototype.getSaveParams.apply(this,arguments)},stringifyFilter:function(t){var i=e.map(e.keys(t),function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])});return i.join("|")}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(29),i(146)],s=function(e,t){"use strict";var i=e.extend({model:t,url:"/api/home/users",parse:function(e){return this.convert(e,"User");
}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(67),i(29),i(147)],s=function(e,t,i,n){"use strict";var s=i.extend({model:n,url:function(){return this.device?"/devices/"+this.device.get("clientIdentifier")+"/sync_items":"/servers/"+this.parent.id+"/sync_lists"},sync:function(e,n,s){var a=t.addVersionHeaderForDevice(this.device,s);return i.prototype.sync.call(this,e,n,a)},parse:function(t){var i=this.convert(t),n=[],s=function(t,i){i&&(e.isArray(i)||(i=[i]),
e.each(i,function(e){e.clientIdentifier=t,n.push(e)}))};return i.SyncList&&!e.isArray(i.SyncList)&&(i.SyncList=[i.SyncList]),e.each(i.SyncList,function(e){s(e.clientIdentifier,e.SyncItems.SyncItem)}),i.SyncItems&&s(i.clientIdentifier,i.SyncItems.SyncItem),n},filterByServer:function(e){var t=this.filter(function(t){var i=t.get("Server");return i&&i.machineIdentifier===e});return this.clone(t)}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{
value:!0});var s=i(27),a=n(s),r=i(502),o=n(r),l=a.default.extend({name:"UserEntitlementCollection",model:o.default});t.default=l,e.exports=t.default},function(e,t,i){var n,s;n=[i(2),i(15),i(14),i(29),i(218)],s=function(e,t,i,n,s){"use strict";var a=n.extend({model:s,url:function(){return"/pms/playlists/"+this.key+"/"+this.subset},initialize:function(e,t){this.key=t.key,this.label=t.label||"queue"===this.key?"Watch Later":"Recommended",this.subset=t.subset||"all","queue"===this.key&&(this.helpRoute="#!/playlist/"+this.key+"/help"),
this.playlistRoute="#!/playlist/"+this.key},parse:function(i){var n=this.convert(i);return t.parseArray(n,"Video"),e.each(n.Video,function(t){t.identifier=n.identifier,t.containerKey=e.result(this,"url")},this),n.Video},filterWatched:function(){var e=this.filter(function(e){return!!e.get("viewCount")});return this.clone(e)},filterUnwatched:function(){var e=this.filter(function(e){return!e.get("viewCount")});return this.clone(e)}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){
var n,s;n=[i(15),i(35)],s=function(e,t){"use strict";var i=t.extend({idAttribute:"id",url:function(){return"/pms/playlists/"+this.get("playlist")+"/items/"+this.id},initialize:function(e,t){this.set("playlist",t.playlist||this.collection.key)},convert:function(i){var n=t.prototype.convert.apply(this,arguments);return e.parseInteger(n,"id"),n},parse:function(i){var n=t.prototype.parse.apply(this,arguments);if(n.type="userPlaylistItem",n.ratingKey=n.url,n.thumb){var s=/\?(\d+)$/.exec(n.thumb);s&&(n.addedAt=s[1],
e.parseInteger(n,"addedAt"))}return n}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(27),a=n(s),r=i(505),o=n(r),l=a.default.extend({name:"UserProviderCollection",model:o.default});t.default=l,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(27),a=n(s),r=i(506),o=n(r),l=a.default.extend({name:"UserRoleCollection",
model:o.default});t.default=l,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(21),a=n(s),r=i(23),o=n(r),l=i(503),c=n(l),u=o.default.extend({name:"UserSubscriptionModel",syncedAttrs:{active:a.default.boolean,status:a.default.string,plan:a.default.string},syncedRelations:{features:{relationClass:c.default,rootPropertyName:"feature"}}});t.default=u,e.exports=t.default},function(e,t,i){var n,s;n=[i(2),i(148)],s=function(e,t){
"use strict";var i=t.extend({maxCycles:3,maxSize:20,get:function(e){var i=t.prototype.get.apply(this,arguments);return i&&i.every(function(e){return e.cache&&e.cache.isListening?(e.cache.store(e),!0):!1}),i},getItemCacheKey:function(t){var i=e.result(t,"url");return t.server&&(i=t.server.getScopedKey(i)),i}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n;n=function(){"use strict";var e={DISABLED:0,ENABLED:1,VERBOSE:2};return e.settings=[{value:e.DISABLED,title:"Disabled"
},{value:e.ENABLED,title:"Enabled"},{value:e.VERBOSE,title:"Verbose"}],e}.call(t,i,t,e),!(void 0!==n&&(e.exports=n))},function(e,t,i){"use strict";function n(e){var t=r.default.duration(e),i=365*t.years(),n=30*t.months(),s=i+n+t.days(),a=s>1||0>=s?(0,l.default)("days"):(0,l.default)("day");return s+" "+a}var s=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var a=i(12),r=s(a),o=i(7),l=s(o);t.default=n,e.exports=t.default},function(e,t,i){"use strict";function n(e){var t=r.default.duration(e),i=t.days(),n=t.hours(),s=i>1?(0,
l.default)("days"):(0,l.default)("day"),a=n>1||0>=n?(0,l.default)("hours"):(0,l.default)("hour");return i&&n?i+" "+s+", "+n+" "+a:i?i+" "+s:n+" "+a}var s=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var a=i(12),r=s(a),o=i(7),l=s(o);t.default=n,e.exports=t.default},function(e,t,i){"use strict";function n(e){var t=r.default.duration(e),i=24*t.days()*60,n=60*t.hours(),s=t.minutes()+n+i,a=t.seconds();return s?(0,l.default)("{1} min",s):a>0?(0,l.default)("{1} sec",a):""}var s=i(8).default;
Object.defineProperty(t,"__esModule",{value:!0});var a=i(12),r=s(a),o=i(7),l=s(o);t.default=n,e.exports=t.default},function(e,t,i){"use strict";function n(e){var t=arguments.length<=1||void 0===arguments[1]?"MMMM D, YYYY":arguments[1];return e?r.default.unix(e).format(t):""}var s=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var a=i(12),r=s(a);t.default=n,e.exports=t.default},function(e,t,i){var n,s;n=[i(2)],s=function(e){"use strict";var t={pms:/plex.*media.*server|plex.*media.*hub/i,
osx:/macosx/i,pht:/konvergo|plex.*home.*theater|plex.*media.*center/i,win8:/windows/i,wp:/windows.*phone|wince/i,ios:/ios/i,android:/android/i,chrome:/chrome/i,safari:/safari/i,firefox:/firefox/i,ie:/internet.*explorer|explorer.*windows/i,opera:/opera/i,wiiu:/wii.*u/i,samsung:/samsung/i,roku:/roku/i,atv:/plex.*atv|tvos/i,gtv:/google.*tv/i,cloudsync:/cloudsync/i,dlna:/dlna/i,xbox:/xbox|mystery.*5/i,linux:/linux/i},i=e.pairs(t),n={},s={getIcon:function(t){var s="default";return t?n.hasOwnProperty(t)?n[t]:(e.every(i,function(e){
var i=e[1].test(t);return i&&(s=e[0],n[t]=s),!i}),s):s}};return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(164),a=n(s),r=i(41),o=n(r);t.default=(0,o.default)(a.default),e.exports=t.default},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(26),i(28),i(46),i(47),i(56),i(92),i(16)],s=function(e,t,i,n,s,a,r,o,l,c){"use strict";var u={getMediaDecision:function(t){var i=this.augmentProfile(t);if(c("MDE: Augmented profile:",i),
t.media)return this.analyzeMedia(t.media,i,t);var n=t.item,s=n.get("Media");if(!s.length)return{canPlay:!0,canDirectPlay:!0};if(1===s.length)return this.analyzeMedia(e.first(s),i,t);var a=e.map(s,function(e){return this.analyzeMedia(e,i,t)},this);return this.getBestDecision(a)},augmentProfile:function(i){var n=i.profile;if(!n)throw new Error("MDE: No player profile provided for "+i.type);var a=t.extend(!0,{},n.directPlay),r=t.extend(!0,{},n.directStream),o=a.generic;o&&delete a.generic;var l=i.allowedAC3Containers,c="*"===l;
!c&&l&&(l=e.isArray(l)?l:[l]);var u=i.allowedEAC3Containers,d="*"===u;!d&&u&&(u=e.isArray(u)?u:[u]);var h=i.allowedDCAContainers,p="*"===h;return!p&&h&&(h=e.isArray(h)?h:[h]),e.each(a,function(t,n){this.mergeGenericOptions(t,o),this.mergeMaxQualityOptions(t,i),(c||l&&e.contains(l,n))&&this.addAudioCodec("ac3",t,i),(d||u&&e.contains(u,n))&&this.addAudioCodec("eac3",t,i),(p||h&&e.contains(h,n))&&this.addAudioCodec("dca",t,i);var a=s.getStreamByType(i.type),r=t[a];if(r){var f=r.codecs;e.each(f,function(e,t){
this.mergeMaxQualityOptions(e,i,!0),i.videoCodecOptions&&i.videoCodecOptions[t]&&this.mergeVideoCodecOptions(e,i.videoCodecOptions[t])},this)}},this),this.mergeMaxQualityOptions(r,i),i.videoCodecOptions&&i.type===s.types.VIDEO&&r.video&&e.each(r.video.codecs,function(e,t){i.videoCodecOptions[t]&&this.mergeVideoCodecOptions(e,i.videoCodecOptions[t])},this),{directPlay:a,directStream:r}},mergeGenericOptions:function(t,i){i&&(e.defaults(t,e.omit(i,"video","audio")),e.each(["audio","video"],function(n){
var s=i[n],a=t[n];s&&(a||(a={},t[n]=a),e.defaults(a,e.omit(s,"codecs")),s.codecs&&e.each(s.codecs,function(t,i){e.defaults(this.ensureCodecs(i,a),t)},this))},this))},mergeVideoCodecOptions:function(t,i){e.each(i,function(e,i){t[i]=e},this)},ensureCodecs:function(e,t){return t.codecs||(t.codecs={}),t.codecs[e]||(t.codecs[e]={}),t.codecs[e]},mergeMaxQualityOptions:function(t,i,n){var a=[{option:"bitrate",setting:"maxBitrate"},{option:"videoResolution",setting:"maxVideoResolution"}];e.each(a,function(e){
if("videoResolution"!==e.option||i.type===s.types.VIDEO){var a=this.getMaxQualityOption(t,e.option,i);if(null!=a){var r=e.setting,o=s.getStreamByType(i.type);t.hasOwnProperty(r)?t[r]=a:t.hasOwnProperty(o)?t[o][r]=a:n||(t[o]={},t[o][r]=a)}}},this)},getMaxQualityOption:function(e,t,i){var n=i.quality||{},s="max"+t.charAt(0).toUpperCase()+t.slice(1),r=n[t],o=this.getPrimaryStreamProperty(e,s,i);if("videoResolution"===t&&r&&(r=a.getResolutionFromSize(r)),r||o){var l;return l=r&&o?Math.min(r,o):r||o}},
addAudioCodec:function(e,t,i){t.audio||(t.audio={}),this.ensureCodecs(e,t.audio)},analyzeMedia:function(t,i,a){c.info("MDE: Starting analysis of",this.getMediaTitle(t)),c("MDE: Analyzing direct play");var r={transcodeServer:a.transcodeServer,media:t,canDirectPlay:this.canDirectPlay(t,i.directPlay,a)},o=a.transcoderOptions||{};if(e.isFunction(o)&&(o=o(r)),a.type===s.types.VIDEO){c("MDE: Analyzing video direct stream");var l=n.getSelectedVideo(t);l&&(r.canDirectStreamVideo=this.canDirectStream(l,i.directStream.video,a,o));
}if(a.type!==s.types.PHOTO){c("MDE: Analyzing audio direct stream");var u=n.getSelectedAudio(t);u&&(r.canDirectStreamAudio=this.canDirectStream(u,i.directStream.audio,a,o))}var d=n.getSelectedSubtitles(r.media);return d&&(c("MDE: Analyzing subtitles"),e.extend(r,this.analyzeSubtitles(d,a))),c("MDE: Analyzing playability"),e.extend(r,this.canPlay(r,a)),e.extend(r,this.getEffectiveQuality(t,i.directStream,a)),c.group("MDE: Finished analysis of",this.getMediaTitle(t)),this.getDecisionLogs(r).forEach(function(e){
return c.info(e)}),c.groupEnd(),r},canDirectPlay:function(t,i,a){if(a.forceDirectPlay)return c("MDE: Direct play forced"),!0;if(a.allowDirectPlay===!1)return c.warn("MDE: Direct play failed; option is disabled"),!1;if(a.type===s.types.VIDEO&&!this.canDirectPlayVideo(t,a))return!1;var o=i[t.container];if(!o)return c.warn("MDE: Direct play failed; unsupported container:",t.container),!1;var l=e.keys(o);if(l&&l.length){for(var u=0,d=l.length;d>u;u++){var h=l[u],p=o[h];if("mimeType"===h){if(!a.skipCanPlayTypeTest&&!this.canPlayType(s.getElementByType(a.type),p))return c.warn("MDE: Direct play failed; canPlayType test, %s: %s",h,p),
!1}else if("video"===h||"audio"===h){var f=r.get(h),m=n.getStreams(t,{streamType:f.id}),g="video"===h?n.getSelectedVideo(t):n.getSelectedAudio(t);if(!g)continue;var v="audio"===h&&g!==m[0];if(v&&!a.allowMultiTrackAudio)return c.warn("MDE: Direct play failed; multi-track audio is required"),!1;if(!this.analyzeStream(g,p,a))return!1}else if("photo"===h){if(!this.analyzeStream(e.first(t.Part),p,a))return!1}else if(!this.validateProfileProperty(h,p,t))return!1}return!0}return!0},canDirectPlayVideo:function(t,i){
if(!i.allowDirectPlay)return c.warn("MDE: Direct play failed; option is disabled"),!1;if("hls"===t.protocol&&!i.hasFlash&&!i.hasNativeHLS)return c.warn("MDE: Direct play failed; cannot play HLS"),!1;if("flv"===t.container&&!i.hasFlash)return c.warn("MDE: Direct play failed; cannot play FLV"),!1;var n=e.first(t.Part);return i.allowSecureDirectPlay===!1&&n&&/^https:\/\//.test(n.key)?(c.warn("MDE: Direct play prevented; cannot play via HTTPS"),!1):!0},canPlayType:function(e,t){if(e===s.elements.PHOTO)return!0;
if(e===s.elements.MUSIC&&window.soundManager)return window.soundManager.canPlayMIME(t);var i=document.createElement(e);return!(!i.canPlayType||!i.canPlayType(t).replace(/^no$/,""))},canDirectStream:function(e,t,i,n){return n.directStream?this.analyzeStream(e,t,i):(c.warn("MDE: Direct stream failed; option is disabled"),!1)},analyzeStream:function(e,t,i){var n=t&&t.codecs&&t.codecs[e.codec],s=function(e){return n&&e in n};for(var a in t){var r=t[a];if("codecs"===a){var o=r[e.codec];if(!o||!this.analyzeStream(e,o,i))return!1;
}else if(!s(a)&&!this.validateProfileProperty(a,r,e))return!1}return!0},validateProfileProperty:function(t,i,n){var s,r=t.match(/^max(\w)(\w*)/);if(r){if(t=r[1].toLowerCase()+r[2],s=n[t],null!=s&&"videoResolution"===t&&(s=a.getHeightFromResolution(s),i=a.getHeightFromResolution(i)),null!=s&&s>i)return c.warn("MDE: Invalid profile property; %s: %s > %s",t,s,i),!1}else if(s=n[t],s!==i&&!e.contains(i,s))return c.warn("MDE: Invalid profile property; %s: %s !== %s",t,s,i),!1;return!0},analyzeSubtitles:function(e,t){
var i=t.subtitlesBurnLevel||l.ALWAYS,n=e.codec;return c("MDE: Subtitle codec:",n),c("MDE: Burn level:",i),i===l.ALWAYS?(c.warn("MDE: Direct play failed; asked to always burn subtitles"),{useSoftSubtitles:!1,canDirectPlay:!1,canDirectStreamVideo:!1}):t.transcodeServer.supports("softSubtitles")?i===l.NEVER?{useSoftSubtitles:!0}:(c.warn("MDE: Direct play failed; %s subtitles",n),/^(pgs|vobsub)$/i.test(n)?(c.warn("MDE: Soft subtitles failed; bitmap subtitles"),{useSoftSubtitles:!1,canDirectPlay:!1,canDirectStreamVideo:!1
}):/^(ass|ssa)$/i.test(n)&&i===l.AUTO?(c.warn("MDE: Soft subtitles failed; ASS subtitles"),{useSoftSubtitles:!1,canDirectPlay:!1,canDirectStreamVideo:!1}):{useSoftSubtitles:!0,canDirectPlay:!1}):(c.warn("MDE: Direct play failed; server support requires burn subtitles"),c.warn("MDE: Soft subtitles failed; server version"),{useSoftSubtitles:!1,canDirectPlay:!1,canDirectStreamVideo:!1})},canPlay:function(e,t){var i=this.validateParts(e,t)||this.validatePremium(e,t)||this.validateTranscoder(e,t);return i?{
canPlay:!1,errorMessage:i}:{canPlay:!0}},validateParts:function(t,s){var a=n.getMissingParts(t.media);if(a.length){c.warn("MDE: Unable to play; missing parts");var r=e.first(a);return i(1===Number(r.exists)?"Please check the permissions for this file.":"Please check that the file exists and the necessary drive is mounted.")}},validatePremium:function(e,t){var n=t.item.server.get("myPlexSubscription");return e.media.premium&&n===!1?(c.warn("MDE: Unable to play; premium content requires a Plex Pass"),
i("Premium content requires your server be connected with a Plex Pass subscription.")):void 0},validateTranscoder:function(t,n){var r=i("This server is not powerful enough to convert video."),o=i("This server is not powerful enough to convert video. You may be able to enable playback by increasing your quality setting.");if(!t.canDirectPlay){var l=n.transcodeServer;if(n.type===s.types.VIDEO){var u=l.get("transcoderVideo"),d=t.canDirectStreamVideo||!l.get("transcoderVideoRemuxOnly");if(!u||!d){if(c.warn("MDE: Unable to play; server unable to transcode video"),
!l.get("isFullServer"))return i("Synced videos cannot be converted to a lower quality. Please increase your quality setting.");if(n.quality){if(n.quality.index===a.ORIGINAL)return r;var h=e.clone(n);return h.quality=e.extend({index:a.ORIGINAL},e.pick(n.quality,"attribute")),this.getMediaDecision(h).canDirectPlay?o:r}return o}}else if(n.type===s.types.MUSIC){var p=l.get("transcoderAudio");if(!p)return c.warn("MDE: Unable to play; server unable to transcode music"),i("This server is not powerful enough to convert music.");
}}},getEffectiveQuality:function(e,t,i){var r=i.quality,o={},l={};if(i.type===s.types.VIDEO){o.bitrate=e.bitrate,o.videoResolution=a.getHeightFromResolution(e.videoResolution);var c=this.getPrimaryStreamProperty(t,"maxBitrate",i);if(c){var u=n.getSelectedVideo(e),d=u?u.bitrate:e.bitrate;o.bitrate=Math.min(d,c),l.maxVideoBitrate=c}if(r){var h=r.videoResolution;if(h){var p=a.getResolutionFromSize(r.videoResolution),f=a.getHeightFromResolution(p);o.videoResolution=Math.min(o.videoResolution,f)}l.videoQuality=r.videoQuality,
l.videoResolution=r.videoResolution}}else if(i.type===s.types.MUSIC){o.bitrate=e.bitrate;var m=this.getPrimaryStreamProperty(t,"maxBitrate",i);m&&(o.bitrate=Math.min(e.bitrate,m),l.maxAudioBitrate=m)}return o.transcoderQualityOptions=l,o},getPrimaryStreamProperty:function(e,t,i){var n=s.getStreamByType(i.type),a=e[n],r=e[t];return null==r&&a&&(r=a[t]),r},getMediaTitle:function(t){var i=t.title||t.videoResolution||t.bitrate,s=e.compact([t.container,t.videoCodec,t.audioCodec]),a=n.getSelectedVideo(t);
return a&&s.push(a.level,a.profile),s.length&&(i+=" ("+s.join(", ")+")"),i},getDecisionLogs:function(t){var i=["canPlay: "+t.canPlay,"canDirectPlay: "+t.canDirectPlay],n=t.canDirectStreamVideo;null!=n&&i.push("canDirectStreamVideo: "+n);var s=t.canDirectStreamAudio;null!=s&&i.push("canDirectStreamAudio: "+s);var a=t.useSoftSubtitles;null!=a&&i.push("useSoftSubtitles: "+a);var r=t.bitrate;null==r||e.isNaN(r)||i.push("bitrate: "+r);var o=t.videoResolution;return null==o||e.isNaN(o)||i.push("videoResolution: "+o),
i},getBestDecision:function(t){var i=e.last(this.sortDecisions(t));return c.group("MDE: Selected %s to play",this.getMediaTitle(i.media)),this.getDecisionLogs(i).forEach(function(e){return c.info(e)}),c.groupEnd(),i},sortDecisions:function(t){return e.chain(t).reverse().sortBy(this.preferHigherBitrate,this).sortBy(this.preferMoreAudioChannels,this).sortBy(this.preferDirectStreamAudio,this).sortBy(this.preferHigherResolution,this).sortBy(this.preferDirectStreamVideo,this).sortBy(this.preferDirectPlay,this).sortBy(this.preferHigherResolutionIfCapable,this).sortBy(this.preferCloudIfRemote,this).sortBy(this.preferPlayable,this).value();
},preferPlayable:function(e){return void 0===e.canPlay?null:e.canPlay},preferCloudIfRemote:function(e){var t=e.media.proxyType===o.CLOUD;return e.transcodeServer.hasLocalConnection()?!t:t},preferHigherResolutionIfCapable:function(e){var t=e.transcodeServer,i=t.get("transcoderVideo"),n=t.get("transcoderVideoRemuxOnly");return i&&!n&&(e.canDirectPlay||e.canDirectStreamVideo)?this.preferHigherResolution(e):null},preferDirectPlay:function(e){return void 0===e.canDirectPlay?null:e.canDirectPlay},preferDirectStreamVideo:function(e){
return void 0===e.canDirectStreamVideo?null:e.canDirectStreamVideo},preferHigherResolution:function(e){return void 0===e.videoResolution?null:e.videoResolution},preferDirectStreamAudio:function(e){return void 0===e.canDirectStreamAudio?null:e.canDirectStreamAudio},preferMoreAudioChannels:function(e){var t=e.media.audioChannels;return void 0===t?null:t},preferHigherBitrate:function(e){return void 0===e.bitrate?null:e.bitrate}};return u}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";
function n(e){if(!e)return(0,r.default)("None");var t=e.language||(0,r.default)("Unknown"),i=l.default.get(e.streamType),n=i&&i.typeString,s=e.codec,a=[];return"subtitles"===n&&s?(a.push(s.toUpperCase()),e.key&&a.push((0,r.default)("External")),e.forced&&a.push((0,r.default)("Forced"))):"audio"===n&&s&&(a.push((0,u.default)(s)),e.channels&&a.push((0,h.default)(e.channels))),a.length?t+" ("+a.join(" ")+")":t}var s=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var a=i(7),r=s(a),o=i(47),l=s(o),c=i(156),u=s(c),d=i(155),h=s(d);
t.default=n,e.exports=t.default},function(e,t,i){"use strict";function n(e){var t=e.bitrate||e.maxVideoBitrate,i=e.videoResolution;if(!t&&!i)return(0,r.default)("Unknown");var n=[];if(t){var s=1e3>t||t%1e3===0?0:1;n.push((0,u.default)(t,s))}if(i&&(!t||t>=1e3)){var a=l.default.getResolutionFromSize(i);n.push((0,h.default)(a))}return n.join(" ")}var s=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var a=i(7),r=s(a),o=i(46),l=s(o),c=i(157),u=s(c),d=i(122),h=s(d);t.default=n,e.exports=t.default;
},function(e,t,i){"use strict";function n(e,t){if(e=parseInt(e,10),t=t||1,r.default.isNaN(e))return"";if(0===e)return"0 Bytes";var i=parseInt(Math.floor(Math.log(e)/Math.log(1024)),10);return(e/Math.pow(1024,i)).toFixed(t)+" "+o[i]}var s=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var a=i(2),r=s(a),o=["Bytes","KB","MB","GB","TB"];t.default=n,e.exports=t.default},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(28),i(26),i(230),i(92),i(162),i(16),i(66)],s=function(e,t,i,n,s,a,r,o,l,c){
"use strict";var u={getPlayerDecision:function(i){e.defaults(i,{offset:0,minVersionForDASH:c.dash,minVersionForStreamingMKV:c.streamingMKV,transcoderOptions:{}});var n={session:o(),offset:i.offset},s=this.populateMedia(n,i);return s=s.then(e.bind(function(){return this.resolveMedia(n,i)},this)),s=s.then(function(){return t.when(n.url)}),s=s.then(function(e){return n.url=e,n})},populateMedia:function(i,n){var a=t.Deferred(),r=e.bind(a.resolve,a,i);return n.requireAnalysis&&s.isMediaAnalysisRequired(n.item)?n.item.fetch({
scope:"player"}).always(r):e.defer(r),a.promise()},resolveMedia:function(i,n){var s=e.extend({transcodeServer:this.resolveTranscodeServer(n)},n),r=a.getMediaDecision(s),o=r.media,c=t.Deferred();return e.extend(i,r),o?i.canPlay?"webkit"===o.protocol?(l.warn("PDE: Webkit videos are not supported"),i.redirect=!0,c.reject(i).promise()):"embed"===o.protocol?(l.warn("PDE: An embed is required"),i.embed=!0,i.part=e.first(o.Part),c.reject(i).promise()):this.resolvePart(i,n):(l.warn("PDE: Unable to play item;",i.errorMessage),
c.reject(i).promise()):this.resolveUrls(i,n)},resolveTranscodeServer:function(e){var t=e.item.server,i=e.fallbackServer;if(t===i||!i||!i.get("isConnected"))return t;var s;return e.type===n.types.VIDEO?s="transcoderVideo":e.type===n.types.MUSIC&&(s="transcoderAudio"),s&&!t.get(s)&&i.get(s)?i:t},resolvePart:function(t,i){return i.part?t.part=i.part:i.offset?1===t.media.Part.length?t.part=t.media.Part[0]:(t.part=s.getPartByAbsoluteOffset(t.media,i.offset),t.offset=s.getRelativeOffset(t.media,t.part,i.offset)):t.part=e.first(t.media.Part),
t.media.indirect?this.resolveIndirect(t,i):this.resolveUrls(t,i)},resolveIndirect:function(i,n){l("PDE: Resolving indirect item");var s=n.item.resolveIndirect(i.media,i.part),a=e.bind(function(){return this.resolveMedia(i,n)},this),r=e.bind(function(){return l.warn("PDE: A redirect is required"),i.redirect=!0,t.Deferred().reject(i).promise()},this);return s=s.then(a,r)},resolveUrls:function(e,i){var n=t.Deferred();return this.validatePlayerType(e,i)?(this.validateSoftSubtitles(e,i)?e.subtitlesUrl=this.resolveSubtitlesUrl(e,i):e.useSoftSubtitles&&(e.useSoftSubtitles=!1),
l.group("PDE: Player decision"),l.info("Player:",e.playerType),l.info("Protocol:",e.protocol),l.info("Direct Play:",e.canDirectPlay),l.groupEnd(),e.canDirectPlay?e.url=this.resolveDirectPlayUrl(e,i):e.url=this.resolveTranscoderUrl(e,i),n.resolve(e).promise()):n.reject(e).promise()},validatePlayerType:function(e,t){return e.media&&t.type&&t.type!==n.types.PHOTO?e.canDirectPlay?("hls"===e.media.protocol?(e.protocol="hls",e.playerType=t.hasNativeHLS?"html":"flash"):(e.protocol="http",e.playerType="flv"===e.media.container?"flash":"html"),
!0):this.validatePlayerTranscodeProtocol(e,t):(e.protocol="http",e.playerType="html",!0)},validatePlayerTranscodeProtocol:function(e,t){var s,a=e.transcodeServer,r=t.transcodeProtocol,o=!0,l=!0,c=!0;if(r&&(o="dash"===r,l="http"===r,c="hls"===r),c&&t.hasNativeHLS)return e.protocol="hls",e.playerType="html",!0;if(l&&t.hasStreamingMKV){if(a.isVersionOrNewer(t.minVersionForStreamingMKV))return e.protocol="http",e.playerType="html",!0;s=t.minVersionForStreamingMKV}if(o&&t.hasDASH){if(a.isVersionOrNewer(t.minVersionForDASH))return e.protocol="dash",
e.playerType="html",!0;s=t.minVersionForDASH}return t.type===n.types.MUSIC?(e.protocol="http",e.playerType="html",!0):c&&t.hasFlash?(e.protocol="hls",e.playerType="flash",!0):(s?e.errorMessage=i("Please update Plex Media Server. This feature requires {1} or later.",s):e.errorMessage=i("Streaming this media is unsupported."),!1)},validateSoftSubtitles:function(e,t){return e.useSoftSubtitles&&"html"!==e.playerType?(l.warn("PDE: Only the HTML player supports soft subtitles"),!1):e.useSoftSubtitles},
resolveDirectPlayUrl:function(e,t){var i=t.item,n=e.part;if(n){var s=/(googlevideo|youtube).com/.test(n.key);return"flv"===n.container&&s&&n.postURL?n.postURL:i.server.resolveUrl(n.key,{appendToken:!0})}return i.server.resolveUrl(i.get("key"),{appendToken:!0})},resolveTranscoderUrl:function(t,i){var s=i.item,a=t.media,o=t.part,c=i.transcoderOptions;e.isFunction(c)&&(c=c(t)),c=e.extend({},t.transcoderQualityOptions,c,{protocol:t.protocol,session:t.session,offset:t.offset/1e3}),i.type===n.types.VIDEO&&(t.useSoftSubtitles?(c.subtitles="auto",
i.subtitlesBurnLevel===r.AVOID&&(c.advancedSubtitles="text")):c.subtitles="burn");var u=i.profileExtra;e.isFunction(u)&&(u=u(t)),c["X-Plex-Client-Profile-Extra"]=u,("hls"===c.protocol&&!i.useOffsetHLS||"dash"===c.protocol)&&(l("PDE: DASH and HLS should seek forward by default, offset=0"),c.offset=0),"hls"===c.protocol&&i.useOffsetHLS&&(t.useOffsetHLS=!0,c.offset&&(l("PDE: HLS started with an offset, copyts=0"),c.copyts=0)),"http"===c.protocol&&(c.copyts=1),"http"!==c.protocol||t.canDirectPlay||(c["X-Plex-Chunked"]=1),
e.each(e.keys(c),function(e){var t=c[e];null==t&&delete c[e]});var d=i.type,h=i.transcoder,p=t.transcodeServer;return d===n.types.VIDEO?h.video(p,s,a,o,c):d===n.types.MUSIC?h.music(p,s,c):d===n.types.PHOTO?(c.fallbackServer=i.fallbackServer,h.image(p,s.getMediaKey(),c)):void 0},resolveSubtitlesUrl:function(e,t){var i=this.resolveTranscoderUrl(e,t),n=i.substring(i.indexOf("?"));return e.transcodeServer.resolveUrl("/video/:/transcode/universal/subtitles"+n)}};return u}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t){"use strict";function i(e){return e?e.replace(/\w\S*/g,function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}):""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i,e.exports=t.default},function(e,t){"use strict";function i(e){return e?e.toUpperCase():""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i,e.exports=t.default},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={encode:function(e){for(var t="",i=0,n=0;n<e.length;n++){
var s=e.charCodeAt(n);128>s||(2048>s?(n>i&&(t+=e.substring(i,n)),i=n+1,t+=String.fromCharCode(192|s>>>6),t+=String.fromCharCode(128|63&s)):(n>i&&(t+=e.substring(i,n)),i=n+1,t+=String.fromCharCode(224|s>>>12),t+=String.fromCharCode(128|s>>>6&63),t+=String.fromCharCode(128|63&s)))}return i>0&&i<e.length&&(t+=e.substring(i)),0===i?e:t}};t.default=i,e.exports=t.default},function(e,t){"use strict";function i(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}Object.defineProperty(t,"__esModule",{value:!0
}),t.default=i,e.exports=t.default},function(e,t,i){"use strict";function n(e){return e&&l.default.parseBoolean(e)?(0,r.default)("Yes"):(0,r.default)("No")}var s=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var a=i(7),r=s(a),o=i(95),l=s(o);t.default=n,e.exports=t.default},function(e,t,i){"use strict";function n(e,t){return(0,r.default)((0,o.getLastSegment)(e||""),t)}var s=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var a=i(164),r=s(a),o=i(14);t.default=n,e.exports=t.default;
},function(e,t,i){var n,s;n=[i(2),i(16),i(186),i(182)],s=function(e,t,i){"use strict";function n(t,i){l=setTimeout(function(){l=null,s(),e.times(i,a),o.length&&n(t,i)},t)}function s(){var t=(new Date).getTime();o=e.filter(o,function(e){return e.expire>t})}function a(){for(var e=0;e<o.length;e++){var i=o[e],n=!1;try{n=i.fn.apply(i.thisArg)}catch(s){t.error(s.name+": "+s.message),n=!0}if(n){o.splice(e,1);break}}}var r={defaultWait:100,defaultBatchSize:1,timeout:3e4,enqueue:function(e,t,s,a){var r={
fn:e,thisArg:t,cancelToken:s,expire:(new Date).getTime()+this.timeout};if(void 0===a?o.push(r):o.splice(a,0,r),!l){var c=i.prop("taskThrottle")||{},u=c.wait||this.defaultWait,d=c.batchSize||this.defaultBatchSize;n(u,d)}},cancel:function(t){o=e.filter(o,function(e){return e.cancelToken!==t})},throttleWithRAF:function(e,t){var i=function n(){n.rafID&&window.cancelAnimationFrame(n.rafID),n.rafID=window.requestAnimationFrame(function(){delete n.rafID,e.call(t)})};return i}},o=[],l=null;return r}.apply(t,n),
!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2)],s=function(e){"use strict";var t={augmentDictionary:function(i,n){return n=n||{},e.reduce(i,function(i,s,a){var r=(new Date).getTime(),o=e.isFunction(n.ttl)?n.ttl(a,s):n.ttl,l=e.isFunction(n.refresh)?n.refresh(a,s):n.refresh,c=e.isObject(s)?t.augmentObj(s,o,l,r):null;return c&&(i[a]=c),i},{})},augmentObj:function(e,t,i,n){var s=e._ttl;if(n=n||(new Date).getTime(),s){if(i)s.expireAt=n+t;else if(s.expireAt<=n)return null}else s={expireAt:n+t
};return e._ttl=s,e}};return t}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(7),a=n(s),r=i(99),o=n(r),l=["id","typeString"],c=(0,o.default)(l,[{id:1,typeString:"trailer",title:function(){return(0,a.default)("Trailer")}},{id:2,typeString:"deletedScene",title:function(){return(0,a.default)("Deleted Scene")}},{id:3,typeString:"interview",title:function(){return(0,a.default)("Interview")}},{id:4,typeString:"musicVideo",
title:function(){return(0,a.default)("Music Video")}},{id:5,typeString:"behindTheScenes",title:function(){return(0,a.default)("Behind the Scenes")}},{id:6,typeString:"scene",title:function(){return(0,a.default)("Scene")}},{id:7,typeString:"liveMusicVideo",title:function(){return(0,a.default)("Live Music Video")}},{id:8,typeString:"lyricMusicVideo",title:function(){return(0,a.default)("Lyric Music Video")}},{id:9,typeString:"concert",title:function(){return(0,a.default)("Concert")}},{id:10,typeString:"featurette",
title:function(){return(0,a.default)("Featurette")}},{id:11,typeString:"short",title:function(){return(0,a.default)("Short")}}]);t.default=c,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(7),a=n(s),r=i(99),o=n(r),l=["key"],c=(0,o.default)(l,[{key:"all",title:function(){return(0,a.default)("All")}},{key:"unwatched",title:function(){return(0,a.default)("Unwatched")}},{key:"newest",title:function(){return(0,a.default)("Recently Released");
}},{key:"recentlyAdded",title:function(){return(0,a.default)("Recently Added")}},{key:"recentlyViewed",title:function(){return(0,a.default)("Recently Viewed")}},{key:"recentlyViewedShows",title:function(){return(0,a.default)("Recently Viewed Shows")}},{key:"onDeck",title:function(){return(0,a.default)("On Deck")}},{key:"folder",title:function(){return(0,a.default)("By Folder")}}]);t.default=c,e.exports=t.default},function(e,t,i){"use strict";function n(e){var t=c.exec(e);if(null!=t)return{octets:o.default.map(o.default.rest(t),function(e){
return parseInt(e,10)})}}function s(e){if(u.test(e)){var t=e.split("::"),i=t[0].match(d),n={parts:[]};if(null!=i){if(i.length>8)return;n.parts=o.default.map(i,function(e){return parseInt(e,16)})}if(t.length>1){var s=t[1].match(d),a=o.default.map(s,function(e){return parseInt(e,16)}),r=8-n.parts.length-a.length;if(0>r||8===r)return;o.default.times(r,function(){n.parts.push(0)}),n.parts=n.parts.concat(a)}return n}}var a=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var r=i(2),o=a(r),l=/^([0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$/,c=/^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/,u=/(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))/i,d=/[a-f0-9]{1,4}/gi,h={
isValidPort:function(e){return l.test(e)},isValidAddress:function(e){return this.isValidV4Address(e)||this.isValidV6Address(e)},isLoopbackAddress:function(e){return"localhost"===e||this.isLoopbackV4Address(e)||this.isLoopbackV6Address(e)},isPrivateAddress:function(e){return this.isPrivateV4Address(e)||this.isPrivateV6Address(e)},isPlexDirectAddress:function(e){return/plex\.direct$/.test(e)},isValidV4Address:function(e){var t=n(e);return!(!t||!o.default.all(t.octets,function(e){return e>=0&&255>=e;
}))},isLoopbackV4Address:function(e){var t=n(e);return!(!t||127!==t.octets[0]&&!o.default.all(t.octets,function(e){return 0===e}))},isPrivateV4Address:function(e){var t=n(e);if(t){if(10===t.octets[0])return!0;if(172===t.octets[0]&&t.octets[1]>=16&&t.octets[1]<=31)return!0;if(192===t.octets[0]&&168===t.octets[1])return!0}return!1},isValidV6Address:function(e){var t=s(e);return!(!t||!o.default.all(t.parts,function(e){return e>=0&&65535>=e}))},isLoopbackV6Address:function(e){var t=s(e);if(t){var i=o.default.all(o.default.take(t.parts,7),function(e){
return 0===e});return i&&1===o.default.last(t.parts)}return!1},isPrivateV6Address:function(e){var t=s(e);return!!(t&&t.parts[0]>=64512&&t.parts[0]<=65023)}};t.default=h,e.exports=t.default},function(e,t,i){var n,s;n=[i(247)],s=function(e){"use strict";var t=e.extend({initialize:function(t){e.prototype.initialize.apply(this,arguments),this.serverConnectionManager=t},process:function(e,t){return e.testAllConnections()},logRescheduledJob:function(t,i){e.prototype.logRescheduledJob.call(this,t,{prefix:"[Connections]",
jobName:"connection tests",subjectName:t.data.get("debugName"),delay:i.delay})}});return t}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(20),i(16)],s=function(e,t,i,n){"use strict";var s=i.extend({initialize:function(){this.jobs=[]},minDelay:2e3,maxJobAge:0,schedule:function(){throw new Error("`schedule` must be implemented by a subclass")},process:function(){throw new Error("`process` must be implemented by a subclass")},timeout:function(){throw new Error("`timeout` must be implemented by a subclass");
},add:function(t){var i=e.find(this.jobs,function(e){return e.data===t});if(i)return i.promise;var n=(new Date).getTime(),s={data:t,addedAt:n};this.jobs.push(s),this.rescheduleJobInQueue(s),this.scheduleNextTick()},removeAll:function(){this.jobs.length=0,this.scheduleNextTick()},remove:function(t){this.jobs=e.filter(this.jobs,function(e){return e.data!==t}),this.scheduleNextTick()},rescheduleJobInQueue:function(t){var i=this.jobAge(t),n=this.schedule(t.data,i);this.logRescheduledJob(t,{jobName:"job",
delay:n});var s=(new Date).getTime();t.processAt=s+n,this.jobs=e.sortBy(this.jobs,function(e){return e.processAt})},logRescheduledJob:function(e,t){var i=Math.round(t.delay/1e3),s="";t.prefix&&(s+=t.prefix+" "),s+="Retrying "+t.jobName,t.subjectName&&(s+=" for "+t.subjectName),s+=" in "+i+" seconds",n(s)},scheduleNextTick:function(){var t=this.jobs[0];this._timeout&&clearTimeout(this._timeout),t&&(this._timeout=setTimeout(e.bind(this.processJob,this,t),this.jobDelay(t)))},jobDelay:function(e){var t=(new Date).getTime();
return Math.max(e.processAt-t,1,this.minDelay)},jobAge:function(e){var t=(new Date).getTime();return t-e.addedAt},processJob:function(i){var n=i.data,s=this.jobAge(i);if(this.maxJobAge&&s>=this.maxJobAge)return this.removeJob(i),this.scheduleNextTick(),void this.timeout(n,s);var a,r=this.process(n,s);a=r?r.then?r:t.when(r):t.Deferred().reject(),a.then(e.bind(this.onProcessSuccessful,this,i),e.bind(this.onProcessFailure,this,i))},removeJob:function(t){this.jobs.splice(e.indexOf(this.jobs,t),1)},onProcessSuccessful:function(e){
this.removeJob(e),this.scheduleNextTick()},onProcessFailure:function(e){this.rescheduleJobInQueue(e),this.scheduleNextTick()}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n;n=function(){"use strict";var e={PLAY:"PLAY",PAUSE:"PAUSE",SEEK:"SEEK",STOP:"STOP",PREVIOUS:"PREVIOUS",NEXT:"NEXT",SKIPTO:"SKIPTO",SHOWDETAILS:"SHOWDETAILS",REFRESHPLAYQUEUE:"REFRESHPLAYQUEUE",SETSTREAM:"SETSTREAM",SETQUALITY:"SETQUALITY"};return e}.call(t,i,t,e),!(void 0!==n&&(e.exports=n))},function(e,t,i){
var n,s;n=[i(2),i(7),i(20),i(5),i(26),i(28),i(47),i(33),i(116),i(9),i(11),i(22)],s=function(e,t,i,n,s,a,r,o,l,c,u,d){"use strict";var h=i.extend({mixins:[o,l],companion:!0,modelDefaults:function(){var t=l.modelDefaults.apply(this,arguments);return e.extend(t,{state:a.states.BUFFERING,showMinimize:!0,showMaximize:this.type!==a.types.MUSIC,showSeekBar:this.type!==a.types.PHOTO})},initialize:function(t){l.initialize.apply(this,arguments),e.bindAll(this,"skipPrevious","skipNext"),this.type=t.type,this.manager=t.manager,
this.player=this.manager.player},getServerConnection:function(e,t){t||(t={});var i=e.get("activeConnection");return i&&i.get("isLoopback")&&(i=e.get("connections").find(function(e){return e.get("isConnected")&&!e.get("isLoopback")})),i?{protocol:i.get("scheme")||"http",address:i.getAddressFromUri(),port:i.get("port")}:void(t.isRequired&&this.showLoopbackWarning(e))},showLoopbackWarning:function(e){var i=c.get("user");if(!i.get("signedIn")||"ok"!==e.get("myPlexSigninState")){var s;s=t(i.get("signedIn")?"This server is unavailable to the player. Please sign this server in to your Plex account and try again.":"This server is unavailable to the player. Please sign in to your Plex account and try again.");
var a=new d({title:t("Unable to Cast"),message:s,confirmLabel:t("OK"),cancelLabel:t("Ignore")});a.promise.done(function(){n.trigger("hide:player"),i.get("signedIn")?n.trigger("navigate","serverSettings",{serverID:e.id}):n.trigger("navigate","login",{silent:!0})}),n.trigger("show:modal",a)}},getTransientToken:function(e){return u.execute("getTransientToken",{server:e})},reset:function(t){var i={loop:"photo"===this.type};return this.currentItem=t,this.previousItem=this.getPreviousItem(t,i),this.nextItem=this.getNextItem(t,i),
this.model.set(e.result(this,"modelDefaults")),t},stop:function(e){l.stop.apply(this,arguments);var t=this.model.get("playQueue");t&&!c.get("primaryPlayer")&&t.takeOwnership(),this.manager.resetActiveController(this.type)},setStream:function(e,t){},refreshRemotePlayQueue:function(){},onFinishedChange:function(e,t){t&&(this.manager.resetActiveController(this.type),n.trigger("hide:player"))},onItemChange:function(){var t,i,n=this.model.get("item"),s=this.model.get("mediaIndex"),a=this.model.get("partIndex"),r=n.get("Media");
if(t=s>1&&r.length>s?r[s]:e.first(r)){var o=t.Part;i=a>1&&o.length>a?o[a]:e.first(o)}this.model.set({media:t,part:i})},onAudioStreamIDChange:function(e,t){var i=e.previous("audioStreamID");if(null!=t&&null!=i){if(this.isTimelineChange){var n=r.get("audio");return void s.selectStream(e.get("media"),n,t)}this.setStream("audio",t)}},onSubtitleStreamIDChange:function(e,t){var i=e.previous("subtitleStreamID");if(null!=t&&null!=i){if(this.isTimelineChange){var n=r.get("subtitles");return void s.selectStream(e.get("media"),n,t);
}this.setStream("subtitles",t)}},onPlayQueueChange:function(){this.previousItem=this.getPreviousItem(),this.nextItem=this.getNextItem(),this.model.set({canSkipPrevious:!!this.previousItem,canSkipNext:!!this.nextItem}),this.refreshRemotePlayQueue()}});return h}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(20),i(28),i(25),i(11),i(33),i(16),i(9),i(53),i(35),i(40)],s=function(e,t,i,n,s,a,r,o,l,c,u){"use strict";var d=t.extend({mixins:[a],types:[i.types.VIDEO,i.types.MUSIC,i.types.PHOTO],
initialize:function(){this.items={},this.containers={},this.activeControllerTypes={},this.listenTo(o,"change:primaryPlayer",this.onPrimaryPlayerChange)},start:function(e){this.player&&this.stop(),r.info("Casting to "+e.get("friendlyName")),this.player=e,e&&this.listenTo(e.get("nowPlaying"),"add",this.onNowPlayingAdd)},stop:function(){if(this.player){r("Stopped casting to "+this.player.get("friendlyName"));var e=this.player.get("nowPlaying");e.clear(),this.stopListening(e),this.player=null}this.items={},
this.containers={},this.activeControllerTypes={}},resetActiveController:function(e){this.activeControllerTypes[e]=!1},createController:function(e,t){return t.isPassive||(this.activeControllerTypes[e]=!0),new this.controller({type:e,manager:this})},updateNowPlaying:function(t){var n=t.type,s=t.key,a=t.state===i.states.STOPPED||t.state===i.states.ERROR,r=this.items[n],o=this.containers[n];if(r){if(s===r.get("key")&&!a)return;this.removeFromNowPlaying(r,t)}s&&!a&&this.addToNowPlaying(e.extend({},t,{
previousItem:r,previousContainer:o}))},addToNowPlaying:function(t){var n=t.type,s=t.machineIdentifier,a=t.key,r=t.containerKey,o=t.previousContainer;"node"===s&&(s="myPlex");var d=new l({machineIdentifier:s},{onlyIfCached:!0});if(!e.isEmpty(d)){if("myPlex"===s){var h=d.parent.get("primaryServer");a=h?h.resolveUrl(a):d.resolveUrl(a,{connection:{scheme:"https",address:"node.plexapp.com",port:"32443"}})}var p=new c({key:a},{server:d,skipCache:!0}),f=p.populate();if(this.items[n]=p,r&&"myPlex"!==s){var m;
if(o&&o.key===r)m=o.playQueue;else{var g=r.match(/playQueues\/(\d+)/),v=p.server.get("playQueueManager"),y=i.getElementByType(n);if(g)m=v.getForType(y),m&&m.get("playQueueID")===g[1]||(m=v.createForType(y,{onServer:!0}),m.set("playQueueID",g[1]),f=f.then(function(){return m.fetch({reset:!0})}));else{var b=new u([],{server:d,skipCache:!0});b.url=r,f=f.then(function(){return b.populate()}),f=f.then(function(){return m=v.createForType(y,{onServer:!1}),m.addContent(b)})}f.done(function(){var e=m.get("collection").findWhere({
key:a});m.set("selectedItem",e)})}this.containers[n]={key:r,playQueue:m}}else this.containers[n]=null;f.done(e.bind(function(){p.set("key",a);var e=this.player.get("nowPlaying");e.add(p)},this)),f.fail(e.bind(function(){this.removeFromNowPlaying(p,t)},this))}},removeFromNowPlaying:function(e,t){this.items[t.type]=null,this.containers[t.type]=null;var i=this.player.get("nowPlaying");i.remove(e)},onPrimaryPlayerChange:function(e,t){t&&t.get("protocol")===this.protocol?this.start(t):this.stop()},onNowPlayingAdd:function(e){
var t=e.get("type");if(t){var a=n.getChildMediaType(t),r=i.getTypeByElement(a.element);this.activeControllerTypes[r]||s.execute("playMedia",{item:e,useMiniPlayer:!0,isCompanionConnect:!0})}}});return d}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5)],s=function(e,t,i,n){"use strict";function s(s){var a=s.server,r="/sync/refreshSynclists",o=e.extend(a.getXHROptions(r),{type:"PUT"}),l=t.ajax(o);return s.skipContent||(l=l.then(function(i){var n="/sync/refreshContent",s=e.extend(a.getXHROptions(n),{
type:"PUT"});return t.ajax(s)})),l.done(function(){s.silent||n.trigger("show:alert",{type:"success",message:i("Synced items were refreshed.")})}),l.promise()}return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2)],s=function(e){"use strict";var t={triggerAutoselect:function(e){this.trigger("autoselect",{shiftKey:e.shiftKey})},stopTrackingSelecting:function(e,t){return this.isTrackingSelecting?(e.preventDefault(),void(this.isTrackingSelecting=!1)):void(t&&t.call(this,e));
},onMouseEnter:function(e){this.parentMediaActions&&this.parentMediaActions.get("selecting")&&this.triggerAutoselect(e)},onMouseLeave:function(e){this.stopTrackingSelecting(e)},onMouseDown:function(t){if(this.parentMediaActions&&this.parentMediaActions.shouldStartTrackingSelecting(t)){var i=e.bind(function(){this.ignoreOnClick=!0},this);this.listenToOnce(this.parentMediaActions,"change:selectedItems",i),this.isTrackingSelecting=!0,this.trigger("select",{multiSelect:t.shiftKey}),this.stopListening(this.parentMediaActions,"change:selectedItems",i);
}},onClick:function(e){this.ignoreOnClick&&(this.ignoreOnClick=!1,e.preventDefault())}};return t}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2)],s=function(e){"use strict";var t={collectionEvents:{sync:"onSync"},markDiscNumbers:function(){if(this.collection.server.supports("premiumMusic")){var e=this.collection.reduce(function(e,t,i){var n=t.get("parentIndex");return n!==e.lastDiscNumber&&(e.markers[i]=n,e.lastDiscNumber=n,e.count+=1),e},{markers:{},lastDiscNumber:null,
count:0});return this.discMarkers=e.markers,e.count}},onRender:function(){var t=this.markDiscNumbers();1!==t&&e.each(this.discMarkers,e.bind(function(e,t){this.$("li:eq("+t+") .disc-number").removeClass("hidden")},this))},onSync:function(){this.render()}};return t}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(27),i(652)],s=function(e,t){"use strict";var i=e.extend({name:"FilePathCollection",context:["server"],model:t,url:"/services/browse"});return i}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(27),i(653)],s=function(e,t){"use strict";var i=e.extend({name:"MatchResultCollection",context:["server"],model:t,url:function(){return"/library/metadata/"+this.parent.id+"/matches"}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(56),i(29),i(655)],s=function(e,t,i){"use strict";var n=t.extend({model:i,url:"/playQueues?type="+e.LOCAL,parse:function(e){return this.convert(e,"PlayQueue")}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(56),i(29),i(657)],s=function(e,t,i){"use strict";var n=t.extend({model:i,url:"/clients/profiles?type="+e.LOCAL,parse:function(e){return this.convert(e,"Profile")}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(56),i(29),i(661)],s=function(e,t,i){"use strict";var n=t.extend({model:i,url:"/library/tags?type="+e.LOCAL,comparator:function(e){return e.get("MediaSettings").maxVideoBitrate},parse:function(e){return this.convert(e,"Tag")}});
return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(110)],s=function(e,t){"use strict";var i=t.extend({constructor:function(i,n,s,a){this.exclusiveAgents=n,this.agentIdentifier=s,t.call(this,i,a),this.filterBy(e.bind(this.filterExclusiveAgent,this))},filterExclusiveAgent:function(e){var t=e.get("identifier"),i=this.exclusiveAgents;if(!i)return!0;var n=this.agentIdentifier,s=-1!==i.indexOf(n),a=-1!==i.indexOf(t),r=s?t===n:!a;return r}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n;n=function(){"use strict";var e={PRODUCTION:"9AC194DC",QA:"4289C4E0",CUSTOM:"custom"};return e.settings=[{value:e.PRODUCTION,title:"Production"},{value:e.QA,title:"QA"},{value:e.CUSTOM,title:"Custom"}],e}.call(t,i,t,e),!(void 0!==n&&(e.exports=n))},function(e,t,i){var n,s;n=[i(2),i(4),i(301),i(14),i(165),i(26),i(46),i(161),i(17)],s=function(e,t,i,n,s,a,r,o,l){"use strict";var c="KQMIY6GATPC63AIMC4R2",u=o.decode("k3U6GLkZOoNIoSgjDshPErvqMIFdE0xMTx8kgsrhnC0="),d=e.extend({},s,{
video:function(e,i,n,a,r){if(r||(r={}),e.supports("universalTranscoder"))return s.video(e,i,n,a,r);var o=t.Deferred(),l=this.getTranscoderUrl(e,i,a,r),c=t.ajax(e.getXHROptions(l));return c.done(function(t){var i=t.replace(/[\s\S]+(session.+?\.m3u8)[\s\S]+/,"$1"),n=e.resolveUrl("video/:/transcode/segmented/")+i;o.resolve(n)}),c.fail(function(){o.reject()}),o.promise()},getTranscoderUrl:function(t,s,d,h){var p=r.getCurrentQuality(s,l.getInstance()).index,f=Math.round((new Date).getTime()/1e3),m={identifier:s.get("identifier"),
key:t.resolveUrl(s.get("key"),{useLoopback:!0}),url:t.resolveUrl(d.key,{useLoopback:!0}),session:h.session,offset:0,quality:p,subtitleSize:l.get("subtitleSize"),audioBoost:l.get("audioBoost"),"3g":0},g=s.get("indirectHttpHeaders");g&&(m.httpCookies=g.Cookie,m.userAgent=g["User-Agent"]);var v=n.join("/video/:/transcode/segmented/start.m3u8",m);i.HMAC_SHA256_init(u),i.HMAC_SHA256_write(v+"@"+f);var y=i.HMAC_SHA256_finalize(),b=o.encode(i.array_to_string(y)),w=a.capabilities;l.get("preferAAC")&&(w=a.capabilities.replace("audioDecoders=mp3,aac","audioDecoders=aac")),
l.get("directStream")||(w=a.capabilities.replace(/videoDecoders=[^;]+;audioDecoders=[^;]+/,""));var x=e.extend(t.getHeaders(),{"X-Plex-Access-Key":c,"X-Plex-Access-Code":b,"X-Plex-Access-Time":f,"X-Plex-Client-Capabilities":w});return n.join(v,x)}});return d}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1009),i(6)],s=function(e,t){"use strict";var i=t.ItemView.extend({className:"loading",template:e,initialize:function(e){e&&e.inline&&this.$el.addClass("loading-inline")}});
return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1025),i(2),i(6),i(82)],s=function(e,t,i,n){"use strict";var s=i.ItemView.extend({mixins:[n],className:"alert transition-in",template:e,alertDuration:2e3,transitionDuration:500,events:{mouseenter:"onMouseEnter",mouseleave:"onMouseLeave","click .close-btn":"onCloseClick"},initialState:"transitionIn",states:{transitionIn:{nextState:"visible",onEnter:function(){this.$el.triggerReflow(),this.$el.removeClass("transition-in"),
this.startTransition()}},visible:{nextState:"transitionOut",onEnter:function(){this.transitionOutTimeout=setTimeout(this.enterNextState,this.alertDuration)}},transitionOut:{onEnter:function(){this.$el.addClass("transition-out"),this.startTransition()}}},initialize:function(e){this.bindAllWhenRendered(["enterNextState"]),t.isString(e)&&(e={message:e}),this.type=e.type,this.message=e.message,this.type&&this.$el.addClass("has-"+this.type)},serializeData:function(){return{type:this.type,message:this.message
}},startTransition:function(){setTimeout(this.enterNextState,this.transitionDuration)},onRender:function(){t.defer(this.enterNextState)},onStateMachineComplete:function(){this.close()},onMouseEnter:function(e){clearTimeout(this.transitionOutTimeout)},onMouseLeave:function(e){"visible"===this.currentState&&(clearTimeout(this.transitionOutTimeout),this.transitionOutTimeout=setTimeout(this.enterNextState,this.alertDuration/2))},onCloseClick:function(e){e.preventDefault(),"visible"===this.currentState&&(clearTimeout(this.transitionOutTimeout),
this.enterNextState())}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1060),i(2),i(4),i(6),i(87),i(5),i(18),i(814),i(742),i(106)],s=function(e,t,i,n,s,a,r,o,l,c){"use strict";var u=n.CompositeView.extend({id:"player-play-queue-dropdown",tagName:"span",className:"dropup",itemView:o,emptyView:l,itemViewContainer:"ol",template:e,modelEvents:{"change:showPlayQueue":"onShowPlayQueueChange"},events:{"click .save-btn":"onSaveClick"},serializeData:function(){var e=this.model.get("playQueue"),t=e.get("isRadio"),i=e.server&&e.server.supports("playlists"),n=e.supports({
playlists:!0});return{canEdit:this.model.get("showPlayQueue"),canPlaylist:!t&&n&&i}},appendHtml:function(e,t,i){return r.prototype.sortedAppendHtml.apply(this,[e,t,i+1])},onRender:function(){if(this.$el.toggleClass("hidden",!this.model.get("showPlayQueue")),this.model.get("showPlayQueue")){var e=function(e){var t=i(e.item).data("play-queue-id"),n=i(e.item).prev(".play-queue-list-item").data("play-queue-id");this.trigger("move",t,n)},n=this.$el.children(".dropdown-menu")[0];this.sortable=new s(n,{
draggable:"li.play-queue-list-item",animation:200,onUpdate:t.bind(e,this)})}},onShowPlayQueueChange:function(){this.render()},onSaveClick:function(){a.trigger("show:modal",new c({model:this.model.get("playQueue")}))}});return u}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1064),i(6),i(5),i(11),i(9),i(745)],s=function(e,t,i,n,s,a){"use strict";var r=t.Layout.extend({id:"primary-player-dropdown",tagName:"li",className:"nav-dropdown dropdown",template:e,regions:{list:".dropdown-menu"
},events:{"click .cast-btn":"onCastClick"},initialize:function(e){e||(e={}),this.showNowPlaying=e.showNowPlaying,this.players=s.get("players"),this.listenTo(s,{"change:primaryPlayer":this.onPrimaryPlayerChange,"change:isCastApiAvailable":this.render,"change:isCastDeviceAvailable":this.render}),this.listenTo(this.players,"update reset",this.render),this.setup()},setup:function(){var e=s.get("primaryPlayer");if(e){var t=e.get("nowPlaying");this.listenTo(t,"update reset",this.render)}},serializeData:function(){
return{primaryPlayer:!!s.get("primaryPlayer"),showDropdown:!s.get("isCastApiAvailable")}},onRender:function(){var e=s.get("isCastDeviceAvailable")||!!this.players.length,t=!s.get("isCastApiAvailable")&&e;this.$el.toggleClass("hidden",!e),t&&this.list.append(new a({showNowPlaying:this.showNowPlaying}),this.$el)},onPrimaryPlayerChange:function(e,t){var i=s.previous("primaryPlayer");i&&this.stopListening(i.get("nowPlaying")),this.setup(),this.render()},onCastClick:function(e){e.preventDefault(),i.trigger("cast:launch");
}});return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1067),i(6)],s=function(e,t){"use strict";var i=t.ItemView.extend({id:"section-dropdown",tagName:"span",className:"dropdown",template:e,modelEvents:{"change:title":"render"},serializeData:function(){var e=this.model.server.supports("playlists");return{showDropdown:this.collection.length>1||e,showPlaylists:e,sections:this.collection.toJSON(),serverID:this.model.server.id,currentSection:this.model.toJSON()}}});return i;
}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(6)],s=function(e,t,i){"use strict";var n=i.Layout.extend({events:{"click .edit-lock-addon":"onLockClick","keyup .lockable-field:not(.selectized)":"onLockableFieldChange","change .lockable-field:not(.selectized)":"onLockableFieldChange"},ui:{form:".edit-metadata-form"},serializeData:function(){var t=this.model.get("Field"),i=e.reduce(t,function(e,t){return e[t.name]=t.locked,e},{});return{item:this.model.toJSON(),locked:i,
canReparent:this.canReparent,canEditSimilarArtists:this.canEditSimilarArtists,disableIndices:!this.canReparent}},flushChanges:function(){},getLockedFieldsArray:function(){var i=this.ui.form,n=e.reduce(this.model.get("Field"),function(e,t){return e[t.name]=t.locked,e},{});return i.find(".edit-lock-addon").each(function(e,i){var s=t(i),a=s.data("field");s.hasClass("locked")?n[a]="1":a in n&&(n[a]="0")}),e.map(n,function(e,t){return{name:t,locked:e}})},onLockClick:function(e){e.preventDefault();var i=t(e.currentTarget);
i.hasClass("disabled")||t(e.currentTarget).toggleClass("locked")},onLockableFieldChange:function(e){var i=e instanceof t?e:t(e.currentTarget);if(!e.force){var n=i.data("original-value");if(void 0===n&&(n=i.attr("value")||i.val()),i.data("original-value",n),i.val()===n)return}i.siblings(".edit-lock-addon").addClass("locked")}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1082),i(1089),i(1078),i(1075),i(1073),i(1091),i(2),i(4),i(123),i(74),i(267),i(755),i(183)],s=function(e,t,i,n,s,a,r,o,l,c,u,d){
"use strict";var h=u.extend({templatesByType:{movie:e,show:t,episode:i,artist:n,album:s,track:a},ui:r.extend({tagInputs:".tag-input-hidden"},u.prototype.ui),events:r.extend({"change .lockable-field":"onLockableFieldChange"},u.prototype.events),initialize:function(e){this.template=this.templatesByType[this.model.get("type")]||this.templatesByType.movie,this.canAutocomplete=this.model.server.supports("batchEdit"),this.canEditSimilarArtists=this.model.server.supports("editSimilarArtists"),this.getSection();
},getSection:function(){var e=this.model.section;if(!e){var t=this.model.get("librarySectionID");e=new c({key:t},{server:this.model.server})}this.section=e},flushChanges:function(){var e=this.ui.form,t=r.reduce(e.serializeArray(),function(e,t){return e[t.name]=t.value,e},{});t.Field=this.getLockedFieldsArray();var i=r.reduce(this.ui.tagInputs,function(e,t){var i=t.selectize,n=o(t).data("name");return e[n]=r.map(i.items,function(e){var t=i.options[e];return{tag:t.tag,id:t.id}}),this.model.set("original.tag."+n,r.toArray(i.options)),
e},{},this);r.each(i,function(e,i){var n=l(i),s=r.pluck(this.model.get(n),"tag"),a=r.pluck(e,"tag");r.isEqual(s,a)||(t[n]=e)},this),this.model.set(t)},onRender:function(){var e=this;this.ui.tagInputs.each(function(t,i){d(e,i)})}});return h}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(18)],s=function(e){"use strict";var t=e.extend({measure:!0,page:1,pagesPadding:1,itemViewOptions:{skipFirstRender:!0},initialize:function(e){this.$container=e.$container},scroll:function(){var e=(this.page-1)*this.pageWidth,t=(this.page-1)*this.itemsPerPage,i=t+this.itemsPerPage;
t-=this.itemsPadding,i+=this.itemsPadding;for(var n=0,s=this.collection.length;s>n;n++){var a=this.collection.at(n),r=this.children.findByModel(a);r&&(n>=t&&i>n?r.show():r.hide())}this.trigger("scroll",this,this.page,-1*e)},previous:function(){this.page=Math.max(this.page-1,1),this.scroll()},next:function(){this.page=Math.min(this.page+1,this.pages),this.scroll()},onMeasure:function(e){this.containerWidth=this.$container.width(),this.listWidth=this.itemWidth*this.children.length,this.itemsPerPage=Math.floor((this.containerWidth+this.itemMarginRight)/this.itemWidth),
this.itemsPadding=this.pagesPadding*this.itemsPerPage,this.pageWidth=this.itemWidth*this.itemsPerPage,this.pages=Math.ceil(this.listWidth/this.pageWidth),this.$el.width(this.listWidth),this.$el.removeClass("hidden"),this.page=1,this.scroll()},onCollectionBeforeClose:function(){this.isClosing=!0},onCollectionClosed:function(){this.isClosing=!1},onCollectionBeforeRender:function(){this.isRendering=!0},onCollectionRendered:function(){this.isRendering=!1,e.prototype.onCollectionRendered.apply(this,arguments);
},onItemRemoved:function(e){this.isClosing||this.measureList()},onAfterItemAdded:function(e){this.isRendering||this.measureList()}});return t}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1102),i(19),i(6),i(7),i(121),i(82),i(166)],s=function(e,t,i,n,s,a,r){"use strict";var o=i.Layout.extend({mixins:[a],className:"conversion-status",template:e,regions:{progressBarRegion:".progress-bar-region"},initialize:function(e){this.initialState=e.initialState,this.initialErrorMessage=e.initialErrorMessage,
this.generator=e.generator,this.transcodeJobs=e.transcodeJobs,this.pausedSetting=e.pausedSetting,this.progressModel=new t.Model({progress:0,remaining:0,speed:0})},states:{pending:{onEnter:function(){this.$el.addClass("pending")},onExit:function(){this.$el.removeClass("pending")}},converting:{onEnter:function(){this.$el.addClass("converting")},onExit:function(){this.$el.removeClass("converting")}},processed:{onEnter:function(){this.$el.addClass("processed")},onExit:function(){this.$el.removeClass("processed");
}},disabled:{onEnter:function(){this.$el.addClass("disabled")},onExit:function(){this.$el.removeClass("disabled")}},error:{onEnter:function(){this.$el.addClass("error")},onExit:function(){this.$el.removeClass("error")}}},bindingsModel:"progressModel",bindings:{".conversion-status-converting-label":{model:"pausedSetting",modelAttribute:"value",formatter:function(e){return n(e?"Paused":"Converting")}},".conversion-status-pending-label":{model:"pausedSetting",modelAttribute:"value",formatter:function(e){
return n(e?"Paused":"Waiting")}},".conversion-status-converting-speed":{modelAttribute:"speed",autohide:!0,formatter:function(e){if(e){var t=Math.round(10*e)/10;return t>10&&(t=Math.round(t)),"("+t+"x)"}}},".conversion-status-converting-percentage":{modelAttribute:"progress",formatter:function(e){return Math.round(e)+"%"}},".conversion-status-converting-progress-separator":{modelAttribute:"remaining",manual:!0,autohide:function(e){return e&&this.progressModel.get("speed")}},".conversion-status-converting-remaining":{
modelAttribute:"remaining",autohide:!0,formatter:function(e){return this.progressModel.get("speed")?s(e):void 0}}},serializeData:function(){return{initialErrorMessage:this.initialErrorMessage}},findTranscodeJob:function(){return this.transcodeJob=this.transcodeJobs.find(function(e){var t=this.model.get("ratingKey"),i=this.generator?this.generator.id:this.model.get("generatorID"),n=this.model.get("syncItemId"),s=t&&t===e.get("ratingKey"),a=i&&i===e.get("generatorID"),r=n&&n===e.get("syncItemId");return s&&(a||r);
},this),this.transcodeJob&&(this.stopListening(this.transcodeJobs),this.enterState("converting"),this.progressModel.set({progress:this.transcodeJob.get("progress"),speed:this.transcodeJob.get("speed"),remaining:this.transcodeJob.get("remaining")}),this.listenTo(this.transcodeJob,{remove:this.onTranscodeJobRemove,"change:progress":this.onTranscodeProgressChange,"change:speed":this.onTranscodeSpeedChange,"change:remaining":this.onTranscodeRemainingChange})),this.transcodeJob},onRender:function(){this.enterState(this.initialState||"pending"),
this.findTranscodeJob()||this.listenTo(this.transcodeJobs,"reset add",this.findTranscodeJob),this.progressBarRegion.append(new r({model:this.progressModel,size:30,lineWidth:3}))},onTranscodeJobRemove:function(e){this.enterState("pending")},onTranscodeProgressChange:function(e,t){this.progressModel.set("progress",t)},onTranscodeSpeedChange:function(e,t){this.progressModel.set("speed",t)},onTranscodeRemainingChange:function(e,t){this.progressModel.set("remaining",t)}});return o}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(18),i(785)],s=function(e,t){"use strict";var i=e.extend({tagName:"ul",className:"tile-list media-tile-list channel-directory-tile-list",itemView:t});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1105),i(2),i(6),i(7),i(5),i(11),i(65),i(30),i(129)],s=function(e,t,i,n,s,a,r,o,l){"use strict";var c=i.ItemView.extend({tagName:"li",className:"poster-item media-tile-list-item channel",template:e,ui:{poster:".media-poster"},events:{"click .settings-btn":"onSettingsClick",
"click .uninstall-btn":"onUninstallClick"},initialize:function(e){this.skipFirstRender=e.skipFirstRender,this.image=new o({model:this.model,type:"channel",width:150}),this.shared=this.model.server.get("shared")},serializeData:function(){return{item:this.model.toJSON(),serverID:this.model.server.id,shared:this.shared}},render:function(){return this.skipFirstRender?(this.skipFirstRender=!1,this):(this.visible=!0,void i.ItemView.prototype.render.apply(this,arguments))},show:function(){this.visible||(this.visible=!0,
this.render())},hide:function(){this.visible&&(this.image.cancel(),this.visible=!1,this.stopListening(this.model),this.$el.empty())},bindings:{".media-title":{modelAttribute:"title"},".media-subtitle-1":{modelAttribute:"type",autohide:!0,formatter:function(e){return n("video"===e?"Video":"music"===e?"Music":"photos"===e?"Photo":"Utility")}}},onRender:function(){this.image.setElement(this.ui.poster)},onClose:function(){this.image.close()},onSettingsClick:function(e){if(e.preventDefault(),!this.$el.hasClass("active")){
this.$el.addClass("active");var i=new r([],{server:this.model.server,url:this.model.id+"/:/prefs"}),n=i.fetch();n.done(t.bind(function(){s.trigger("show:modal",new l({model:this.model,collection:i}))},this)),n.always(t.bind(function(){this.$el.removeClass("active")},this))}},onUninstallClick:function(e){if(e.preventDefault(),!this.$el.hasClass("active")){this.$el.addClass("active");var i=a.execute("uninstallChannel",{channel:this.model});i.done(t.bind(function(){this.model.trigger("destroy",this.model,this.model.collection);
},this)),i.always(t.bind(function(){this.$el.removeClass("active")},this))}}});return c}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(6),i(96),i(25),i(30)],s=function(e,t,i,n){"use strict";var s=e.ItemView.extend({tagName:"li",ui:{poster:".media-poster"},bindings:{".media-title":{modelAttribute:"title"}},initialize:function(e){this.type=this.model.get("type");var t=i.get(this.type).element,s=this.posterWidth[t]||40,a="movie"===this.type?"art":"thumb",r="movie"===this.type?"art":this.type;
this.image=new n({model:this.model,type:r,getUrl:this.getPosterUrl,width:s,modelAttribute:a})},getPosterUrl:function(e){return e=e||this.model.get("parentThumb")||this.model.get("grandparentThumb"),e||(this.model.parent?e=this.model.parent.get("thumb"):this.model.channel&&(e=this.model.channel.get("thumb"))),e},onRender:function(){this.image.setElement(this.ui.poster)}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(18),i(803)],s=function(e,t){"use strict";var i=e.extend({
tagName:"ul",className:"tile-list media-tile-list extra-tile-list",itemView:t});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(269),i(70)],s=function(e,t){"use strict";var i=e.extend({tagName:"ul",className:"tile-list media-tile-list horizontal-media-tile-list hidden",itemView:t,initialize:function(t){e.prototype.initialize.apply(this,arguments),this.itemViewOptions.continuousPlay=!!t.continuousPlay,this.sorted=!!t.sorted}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(170),i(171)],s=function(e,t){"use strict";var i=e.extend({tagName:"ul",className:"list virtual-list media-list media-details-list",itemView:t});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(170),i(48)],s=function(e,t){"use strict";var i=e.extend({tagName:"ul",className:"list virtual-list media-list",itemView:t});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(170),i(70)],s=function(e,t){"use strict";var i=e.extend({
tagName:"ul",className:"tile-list virtual-list media-tile-list",itemView:t});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(18),i(835)],s=function(e,t){"use strict";var i=e.extend({tagName:"ul",className:"list side-bar-list",itemView:t,initialize:function(e){var t=this.collection.section;e.disabled?this.$el.addClass("disabled"):t&&(this.listenTo(t,"change:currentType",this.onCurrentTypeChange),t.get("pseudo")||this.collection.populate({reset:!0,scope:"page"}))},onCurrentTypeChange:function(e,t){
this.collection.section.set("currentSort",null,{silent:!0}),e.get("pseudo")||this.collection.fetch({reset:!0,scope:"page"})}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1143),i(2),i(4),i(6),i(7),i(5),i(98),i(9),i(83)],s=function(e,t,i,n,s,a,r,o,l){"use strict";var c=n.ItemView.extend({className:"friend-server-status-container",template:e,events:{"click .server-share-edit-btn":"onEditClick"},initialize:function(){this.collection=this.model.get("serverShares"),
this.servers=o.get("servers"),this.attachedServers=[],this.collection.each(this.addServerShare,this),this.listenTo(this.collection,{add:this.onServerShareAdd,remove:this.onServerShareRemove,"change:numLibraries":this.render}),this.listenTo(this.servers,"add",this.onServerAdd)},serializeData:function(){var e={owned:this.getLibrariesData({owned:!0}),shared:this.getLibrariesData({owned:!1}),canEdit:!o.get("user").get("restricted")};return e.owned.numLibraries||e.shared.numLibraries||(e.showEmptyMessage=!0),
e},getLibrariesData:function(e){var t={friendLabel:s(this.model.get("restricted")?"user":"friend"),status:this.getServerStatus(e),hasActiveShare:!!this.collection.findWhere({pending:!1,owned:e.owned})};return t.numLibraries=this.collection.getLibraryCount({pending:!t.hasActiveShare,owned:e.owned}),t.libraryLabel=r(s("library"),t.numLibraries,s("libraries")),t},getServerStatus:function(e){for(var t,i=0,n=this.collection.length;n>i;i++){var s=this.collection.at(i);if(s.get("owned")===e.owned){var a=this.servers.get(s.get("machineIdentifier")),r=a&&a.get("connected");
if(r===!1)return"unavailable";r&&(t="available")}}return t},addServerShare:function(e){var t=this.servers.get(e.get("machineIdentifier"));t&&this.attachServer(t)},removeServerShare:function(e){var t=this.servers.get(e.get("machineIdentifier"));t&&!e.get("owned")&&this.detachServer(t)},attachServer:function(e){this.attachedServers.push(e),this.listenTo(e,"change:connected",this.render)},detachServer:function(e){var i=t.indexOf(this.attachedServers,e);i>-1&&this.attachedServers.splice(i,1),this.stopListening(e);
},onServerShareAdd:function(e){this.addServerShare(e),this.render()},onServerShareRemove:function(e){this.removeServerShare(e),this.render()},onServerAdd:function(e){this.collection.findWhere({machineIdentifier:e.id})&&(this.attachServer(e),this.render())},onEditClick:function(e){e.preventDefault();var t=i(e.currentTarget);if(!t.isDisabled()){var n,s=t.hasClass("owned"),r=this.collection.findWhere({owned:s});r&&(n=r.get("machineIdentifier")),a.trigger("show:modal",new l({model:this.model,defaultPaneType:s?"ownedServer":"sharedServer",
defaultPaneID:n}))}}});return c}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1145),i(4),i(6),i(7),i(5),i(11),i(9),i(49),i(280),i(83),i(107)],s=function(e,t,i,n,s,a,r,o,l,c,u){"use strict";var d=i.Layout.extend({tagName:"li",className:"card-tile-list-item card-2-col-item",template:e,ui:{poster:".card-poster"},regions:{details:".card-details"},events:{"click .pin-btn":"onPINClick","click .edit-btn":"onEditClick","click .delete-btn":"onDeleteClick"},initialize:function(e){var t=r.get("user"),i=t.get("friends"),n=i.get(this.model.id);
this.isAdmin=e.isAdmin,this.isSignedInUser=this.model.id===t.id,this.image=new o({model:this.model,type:"friend",width:80}),n?this.friend=n:this.listenTo(i,"add",this.onFriendAdd)},serializeData:function(){return{isSignedInUser:this.isSignedInUser}},canEditPIN:function(){var e=this.isSignedInUser&&!this.model.get("restricted"),t=this.isAdmin&&this.model.get("restricted")&&!this.model.get("guest");return e||t},showStatusView:function(){this.friend&&this.details.append(new l({model:this.friend}))},
bindings:{".username":{modelAttribute:"title"},".admin-icon":{modelAttribute:"admin",autohide:!0,manual:!0},".user-type":{modelAttribute:"restricted",autohide:!0,formatter:function(e){return this.model.get("guest")?n("Guest User"):e?n("Managed User"):void 0}},".pin-protected-btn":{modelAttribute:"protected",manual:!0,autohide:!0,formatter:function(e,t){return t.toggleClass("disabled",!this.canEditPIN()),e}},".pin-unprotected-btn":{modelAttribute:"protected",manual:!0,autohide:!0,formatter:function(e,t){
return t.toggleClass("disabled",!this.canEditPIN()),!e}},".edit-btn":{modelAttribute:"admin",manual:!0,autohide:!0,formatter:function(e){var t=r.get("user"),i=this.isAdmin||!t.get("restricted")&&!this.model.get("restricted");return i&&!this.isSignedInUser}},".delete-btn":{modelAttribute:"admin",manual:!0,autohide:!0,formatter:function(e){return this.isAdmin&&!this.isSignedInUser&&!this.model.get("guest")}}},onRender:function(){this.image.setElement(this.ui.poster),this.showStatusView()},onClose:function(){
this.image.close()},onFriendAdd:function(e){e.id===this.model.id&&(this.friend=e,this.showStatusView())},onPINClick:function(e){e.preventDefault(),t(e.currentTarget).isDisabled()||s.trigger("show:modal",new u({model:this.model,isEditing:!0}))},onEditClick:function(e){e.preventDefault(),s.trigger("show:modal",new c({type:"home",homeUser:this.model,isAdmin:this.isAdmin}))},onDeleteClick:function(e){e.preventDefault(),a.execute("removeHomeUser",{homeUser:this.model})}});return d}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(18),i(850)],s=function(e,t){"use strict";var i=e.extend({tagName:"ul",className:"list card-tile-list",itemView:t,sorted:!0});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1163),i(2),i(31)],s=function(e,t,i){"use strict";function n(e){return t.reduce(e,function(e,t,i){var n=s(t);if(0===i)return e.concat(n);var a=n.length>1;return e.concat({plain:!0,split:a,s:"or"},n)},[])}function s(e){var i=e.match(/(.+) (.+)/);if(i)return s(i[1]).concat({
plain:!0,s:"then"}).concat(s(i[2]));var n=e.match(/(.+)\+(\S+)/);if(n)return s(n[1]).concat({plain:!0,s:"+"}).concat(s(n[2]));var a=t.reduce([[/command/,"\u2318"],[/up/,"\u2191"],[/down/,"\u2193"],[/left/,"\u2190"],[/right/,"\u2192"]],function(e,t){return e.replace(t[0],t[1])},e);return[{s:a}]}var a=i.extend({name:"keyboardShortcutsModal",className:"keyboard-shortcuts-modal modal fade",template:e,orderedGroups:[{group:"navigation",label:"Navigation"},{group:"actions",label:"Actions"},{group:"player",
label:"Player"}],initialize:function(e){i.prototype.initialize.apply(this,arguments),this.shortcuts=e.shortcuts},serializeData:function(){var e={};t.each(this.shortcuts,function(t){var i=t.group;e[i]||(e[i]=[]),e[i].push(this.humanizeShortcut(t))},this);var i=t.map(this.orderedGroups,function(i){var n=t.clone(i);return n.shortcuts=e[i.group],n},this);return{groups:i}},humanizeShortcut:function(e){return e=t.clone(e),e.keys=n(e.keys),e}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){
var n,s;n=[i(1167),i(2),i(4),i(11),i(64)],s=function(e,t,i,n,s){"use strict";var a=s.extend({name:"playVersionModal",template:e,serializeData:function(){return{mediaItems:this.model.get("Media")}},onClick:function(e){e.preventDefault();var t=i(e.currentTarget).data("value"),s=this.model.get("Media")[t];n.execute("playMedia",{item:this.model,media:s}),this.promise.resolve(s),this.hide()}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1168),i(2),i(5),i(31)],s=function(e,t,i,n){
"use strict";var s=n.extend({name:"plexPassModal",template:e,events:t.extend({"click .sign-in-btn":"onSignInClick"},n.prototype.events),serializeData:function(){return{signedIn:this.model.get("signedIn"),plexPassUrl:this.model.server.get("plexPassUrl")}},onSignInClick:function(e){e.preventDefault(),this.hide(),i.trigger("navigate","login",{silent:!0})}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1179),i(2),i(6),i(28),i(25)],s=function(e,t,i,n,s){"use strict";var a=i.ItemView.extend({
className:"convert-policy-container",template:e,ui:{policyUnwatchedInput:"#convert-policy-unwatched",policyScopeInput:"#convert-policy-scope",policyValueInput:"#convert-policy-value",policyWarning:".convert-warning"},events:{"change input[name=policyUnwatched]":"onPolicyUnwatchedChange","change input[name=policyScope]":"onPolicyScopeChange","keyup input[name=policyValue]":"onPolicyValueChange","change input[name=policyValue]":"onPolicyValueChange"},initialize:function(e){this.type=s.get(this.model.get("metadataType")||"movie"),
this.childElement=s.getChildMediaType(this.type.typeString).element,this.model.setPolicyDefaultsFor(this.childElement)},serializeData:function(){var e={isSync:this.options.isSync,isCloudSync:this.options.isCloudSync,isDirectory:this.model.isDirectory(),policy:this.model.get("Policy")};return e.showLimitWarning=this.model.shouldShowPolicyWarning(this.childElement,e.policy.value),e.showUnwatched=e.isDirectory&&this.childElement===n.elements.VIDEO,e},updatePolicyValue:function(){var e=this.model.get("Policy"),i=Math.abs(parseInt(this.ui.policyValueInput.val(),10));
this.ui.policyValueInput.val(t.isNaN(i)?"":i),t.isNaN(i)&&(i=0),e.value="all"===e.scope?null:i;var n=this.model.shouldShowPolicyWarning(this.childElement,i);this.ui.policyWarning.toggleClass("hidden",!n)},onPolicyUnwatchedChange:function(e){var t=this.model.get("Policy");t.unwatched=this.ui.policyUnwatchedInput.prop("checked")},onPolicyScopeChange:function(e){var t=this.model.get("Policy");t.scope=this.ui.policyScopeInput.prop("checked")?this.ui.policyScopeInput.val():"all",this.updatePolicyValue();
},onPolicyValueChange:function(e){this.updatePolicyValue()}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1188),i(4),i(82),i(125),i(258),i(257),i(31),i(881),i(882),i(879)],s=function(e,t,i,n,s,a,r,o,l,c){"use strict";var u=r.extend({mixins:[i],name:"syncModal",className:"convert-modal modal fade",template:e,regions:{bodyRegion:".modal-body-region"},initialize:function(e){r.prototype.initialize.apply(this,arguments),this.device=this.model?this.model.device:e.device;
},initialState:"form",states:{form:{nextState:"success",onEnter:function(){this.bodyRegion.show(new o({model:this.model,item:this.options.item,items:this.options.items,device:this.device})),this.listenForStateRequests()}},success:{onEnter:function(){this.model?this.hide():(this.bodyRegion.show(new l({server:this.options.item.server,device:this.device})),this.listenForStateRequests())}},error:{onEnter:function(){this.bodyRegion.show(new c),this.listenForStateRequests()}}},listenForStateRequests:function(){
this.bodyRegion&&this.bodyRegion.currentView&&this.listenTo(this.bodyRegion.currentView,{"request:state":this.enterState,"request:nextState":this.enterNextState})},onRender:function(){r.prototype.onRender.apply(this,arguments),this.enterNextState()},onStateMachineComplete:function(){this.hide()}});return u}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1203),i(2),i(7),i(5),i(31)],s=function(e,t,i,n,s){"use strict";var a=s.extend({name:"homeWarningModal",template:e,events:t.extend({
"click .server-settings-btn":"onServerSettingsClick"},s.prototype.events),initialize:function(e){s.prototype.initialize.apply(this,arguments),this.type=e.type},serializeData:function(){var e;return e=i("pin"===this.type?"You've added a PIN restriction":"You've joined a Plex Home"),{intro:e}},onServerSettingsClick:function(e){e.preventDefault(),this.hide(),n.trigger("navigate","serverSettings")}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1207),i(6),i(9),i(49)],
s=function(e,t,i,n){"use strict";var s=t.ItemView.extend({tagName:"li",className:"user-select-list-item",template:e,ui:{container:".user-select-container",poster:".user-poster"},events:{"click a":"onClick"},initialize:function(e){this.disabled=e.disabled,this.posterImage=new n({model:this.model,type:"friend",width:80});var t=i.get("primaryServer");t&&t.supports("imageFilters")&&(this.backgroundImage=new n({model:this.model,type:"friend",width:120,background:!0,filters:{blur:20,opacity:50,background:"000000"
}}),this.backgroundImage.placeholderClass=!1)},serializeData:function(){return{disabled:this.disabled}},bindings:{".username":{modelAttribute:"title"},".protected-icon":{modelAttribute:"protected",autohide:!0,manual:!0},".admin-icon":{modelAttribute:"admin",autohide:!0,manual:!0}},onRender:function(){this.posterImage.setElement(this.ui.poster),this.backgroundImage&&this.backgroundImage.setElement(this.ui.container)},onClose:function(){this.posterImage.close(),this.backgroundImage&&this.backgroundImage.close();
},onClick:function(e){e.preventDefault(),this.trigger("selectUser",this.model)}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1228),i(2),i(134)],s=function(e,t,i){"use strict";var n=i.extend({className:function(){var e=this.model.get("canSeek");return"player-seek-bar player-slider"+(e?"":" disabled")},template:e,ui:{thumb:".player-slider-thumb",track:".player-slider-track",progress:".player-slider-progress",buffer:".player-slider-buffer"},modelEvents:{"change:position":"onPositionChange",
"change:startBuffer":"onBufferChange","change:endBuffer":"onBufferChange","change:canSeek":"onCanSeekChange"},events:t.extend({mouseenter:"onMouseMove",mousemove:"onMouseMove",mouseleave:"onMouseLeave"},i.prototype.events),normalizeValue:function(e){var t=this.model.get("duration");return e=t?e/t*100:0,e=Math.min(Math.max(e,0),100)},getValueForPosition:function(e){var t=this.model.get("duration"),i=this.ui.track,n=e-i.offset().left,s=n/i.width();return s=Math.min(Math.max(s,0),1),s*=t,Math.round(s);
},setValue:function(e){this.model.get("canSeek")&&i.prototype.setValue.apply(this,arguments)},displayValue:function(e){e=this.normalizeValue(e),this.dragging&&(e>=100||!this.model.get("canSeek"))||i.prototype.displayValue.call(this,e)},onRender:function(){this.displayValue(this.model.get("position"))},onPositionChange:function(e,t){this.displayValue(t)},onBufferChange:function(e,t){var i=this.model.get("endBuffer"),n=this.normalizeValue(i);this.ui.buffer.css("width",n+"%")},onCanSeekChange:function(e,t){
this.$el.toggleClass("disabled",!t)},onMouseMove:function(e){var t=e.pageX,i=this.getValueForPosition(t);this.trigger("hover",{position:t,time:i})},onMouseLeave:function(e){this.trigger("hover",!1)}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1248),i(6),i(5),i(9),i(282),i(845)],s=function(e,t,i,n,s,a){"use strict";var r=t.Layout.extend({className:"friends-container col-sm-8 col-md-9",template:e,ui:{inviteListHeader:".invite-list-header",friendListHeader:".friend-list-header",
pendingListHeader:".pending-list-header"},regions:{inviteList:".invite-list-container",friendList:".friend-list-container",pendingList:".pending-list-container"},initialize:function(){var e=n.get("user");return e.get("restricted")?void i.trigger("navigate","users",{subset:"home"}):(this.collection=e.get("friends").filterByUnrestricted(),this.invites=e.get("invites").filterByFriends(),this.sentInvites=e.get("sentInvites").filterByFriends(),void this.addListeners())},addListeners:function(){this.listenTo(this.invites,"reset add remove",this.onInvitesChange),
this.listenTo(this.sentInvites,"reset add remove",this.onInvitesChange)},updateHeaders:function(){var e=!!this.invites.length,t=!!this.sentInvites.length,i=e||t;this.ui.friendListHeader.toggleClass("hidden",!i),this.ui.inviteListHeader.toggleClass("hidden",!e),this.ui.pendingListHeader.toggleClass("hidden",!t),this.ui.friendListHeader.toggleClass("top",!e),this.ui.inviteListHeader.toggleClass("top",e)},onRender:function(){this.friendList.show(new a({collection:this.collection})),this.inviteList.show(new s({
collection:this.invites})),this.pendingList.show(new s({collection:this.sentInvites})),this.updateHeaders()},onClose:function(){this.collection.destroy&&this.collection.destroy(),this.invites.destroy(),this.sentInvites.destroy()},onInvitesChange:function(){this.updateHeaders()}});return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){e.exports={"default":i(968),__esModule:!0}},,function(e,t,i){"use strict";var n=i(292).default;t.default=function(e,t,i){return t in e?n(e,t,{value:i,enumerable:!0,
configurable:!0,writable:!0}):e[t]=i,e},t.__esModule=!0},,,function(e,t,i){var n=i(973);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==n(e)?e.split(""):Object(e)}},function(e,t,i){var n=i(297),s=i(295);e.exports=function(e){return n(s(e))}},,function(e,t){function i(e,t,i){"use strict";function n(e){var t=e.localName;return null==t&&(t=e.baseName),(null==t||""==t)&&(t=e.nodeName),t}function s(a){var r,o,l;if(a.nodeType==y.DOCUMENT_NODE){var c,u;for(o=a.firstChild,
c=0,u=a.childNodes.length;u>c;c+=1)if(a.childNodes[c].nodeType!==y.COMMENT_NODE){o=a.childNodes[c];break}return i?r=s(o):(r={},l=n(o),r[l]=s(o)),r}if(a.nodeType==y.ELEMENT_NODE){var d=0,h=a.childNodes;r=new Object;for(var p=0;p<h.length;p++)if(o=h.item(p),l=n(o),d++,null==r[l])r[l]=s(o);else{if(null!=r[l]&&!(r[l]instanceof Array)){var f=r[l];r[l]=[],r[l].push(f)}for(var m=0;null!=r[l][m];)m++;r[l][m]=s(o)}for(var g=0;g<a.attributes.length;g++){var v=a.attributes.item(g);d++;for(var b=v.value,w=0,x=e.length;x>w;w++){
var S=e[w];S.test.call(this,v.value)&&(b=S.converter.call(this,v.value))}r[t+v.name]=b}if(null!=r["#text"]){var C=r["#text"];"string"==typeof C?(C=C.replace(/[\r\n]/g,""),r["#text"]=C,1==d&&(r=C)):delete r["#text"]}return r}return a.nodeType==y.TEXT_NODE||a.nodeType==y.CDATA_SECTION_NODE?a.nodeValue:a.nodeType==y.COMMENT_NODE?null:void 0}function a(e){return"string"==typeof e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;"):e;
}function r(e){var t="";return null!=e.__cdata&&(t+="<![CDATA["+e.__cdata+"]]>"),null!=e.__text&&(t+=v?a(e.__text):e.__text),t}function o(e){var t="";return e instanceof Object?t+=r(e):null!=e&&(t+=v?a(e):e),t}function l(e,t){return-1!==e.indexOf(t,e.length-t.length)}function c(e,t){return l(t.toString(),"_asArray")||0==t.toString().indexOf("_")||e[t]instanceof Function?!0:!1}function u(e){var t=0;if(e instanceof Object)for(var i in e)c(e,i)||t++;return t}function d(e){var t=[];if(e instanceof Object)for(var i in e){
var n=i.toString(),s=n.charAt(0);-1==i.indexOf("__")&&("_"===s||s===s.toLowerCase()&&s!==s.toUpperCase())&&t.push(i)}return t}function h(e,t,i){var n="";if(0==e.length)n+=p(e,t,i,!0);else for(var s=0;s<e.length;s++)n+=p(e[s],t,d(e[s]),!1),n+=m(e[s]),n+=f(e[s],t);return n}function p(e,t,i,n){var s="<"+(null!=e&&null!=e.__prefix?e.__prefix+":":"")+t;if(null!=i)for(var r=0;r<i.length;r++){var o=i[r],l=a(e[o]);s+=" "+o.substr(1)+"='"+l+"'"}return s+=n?"/>":">"}function f(e,t){return"</"+(null!=e.__prefix?e.__prefix+":":"")+t+">";
}function m(e){var t="",i=u(e);if(i>0)for(var n in e)if(!c(e,n)){var s=e[n],a=d(s);if(null==s||void 0==s)t+=p(s,n,a,!0);else if(s instanceof Object)if(s instanceof Array)t+=h(s,n,a);else{var r=u(s);r>0||null!=s.__text||null!=s.__cdata?(t+=p(s,n,a,!1),t+=m(s),t+=f(s,n)):t+=p(s,n,a,!0)}else t+=p(s,n,a,!1),t+=o(s),t+=f(s,n)}return t+=o(e)}(null===t||void 0===t)&&(t="_"),(null===i||void 0===i)&&(i=!1);var g="1.0.11",v=!1,y={ELEMENT_NODE:1,TEXT_NODE:3,CDATA_SECTION_NODE:4,COMMENT_NODE:8,DOCUMENT_NODE:9
};this.parseXmlString=function(e){var t;if(window.DOMParser){var i=new window.DOMParser;t=i.parseFromString(e,"text/xml")}else 0==e.indexOf("<?")&&(e=e.substr(e.indexOf("?>")+2)),t=new ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(e);return t},this.xml2json=function(e){return s(e)},this.xml_str2json=function(e){var t=this.parseXmlString(e);return this.xml2json(t)},this.getVersion=function(){return g},this.escapeMode=function(e){v=e},this.json2xml_str=function(e){return m(e)}}e.exports=i;
},function(e,t){function i(e){for(var t=e.length,i=new Array(t),n=0;t>n;n++)i[n]=e.charCodeAt(n);return i}function n(e){for(var t="",i=0;i<e.length;i++)t+=SHA256_hexchars[e[i]>>4]+SHA256_hexchars[15&e[i]];return t}function s(e){for(var t="",i=0;i<e.length;i++)t+=String.fromCharCode(e[i]);return t}function a(){SHA256_H=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),SHA256_buf=new Array,SHA256_len=0}function r(e){"string"==typeof e?SHA256_buf=SHA256_buf.concat(i(e)):SHA256_buf=SHA256_buf.concat(e);
for(var t=0;t+64<=SHA256_buf.length;t+=64)b(SHA256_H,SHA256_buf.slice(t,t+64));SHA256_buf=SHA256_buf.slice(t),SHA256_len+=e.length}function o(){if(SHA256_buf[SHA256_buf.length]=128,SHA256_buf.length>56){for(var e=SHA256_buf.length;64>e;e++)SHA256_buf[e]=0;b(SHA256_H,SHA256_buf),SHA256_buf.length=0}for(var e=SHA256_buf.length;59>e;e++)SHA256_buf[e]=0;SHA256_buf[59]=SHA256_len>>>29&255,SHA256_buf[60]=SHA256_len>>>21&255,SHA256_buf[61]=SHA256_len>>>13&255,SHA256_buf[62]=SHA256_len>>>5&255,SHA256_buf[63]=SHA256_len<<3&255,
b(SHA256_H,SHA256_buf);for(var t=new Array(32),e=0;8>e;e++)t[4*e+0]=SHA256_H[e]>>>24,t[4*e+1]=SHA256_H[e]>>16&255,t[4*e+2]=SHA256_H[e]>>8&255,t[4*e+3]=255&SHA256_H[e];return delete SHA256_H,delete SHA256_buf,delete SHA256_len,t}function l(e){var t;return a(),r(e),t=o(),n(t)}function c(e){"string"==typeof e?HMAC_SHA256_key=i(e):HMAC_SHA256_key=(new Array).concat(e),HMAC_SHA256_key.length>64&&(a(),r(HMAC_SHA256_key),HMAC_SHA256_key=o());for(var t=HMAC_SHA256_key.length;64>t;t++)HMAC_SHA256_key[t]=0;
for(var t=0;64>t;t++)HMAC_SHA256_key[t]^=54;a(),r(HMAC_SHA256_key)}function u(e){r(e)}function d(){for(var e=o(),t=0;64>t;t++)HMAC_SHA256_key[t]^=106;a(),r(HMAC_SHA256_key),r(e);for(var t=0;64>t;t++)HMAC_SHA256_key[t]=0;return delete HMAC_SHA256_key,o()}function h(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function p(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}function f(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function m(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function g(e,t,i){
return i^e&(t^i)}function v(e,t,i){return e&t^i&(e^t)}function y(e,t){for(var i=16;64>i;i++)t[i]=p(t[i-2])+t[i-7]+h(t[i-15])+t[i-16]&4294967295;for(var n=(new Array).concat(e),i=0;64>i;i++){var s=n[7]+m(n[4])+g(n[4],n[5],n[6])+SHA256_K[i]+t[i],a=f(n[0])+v(n[0],n[1],n[2]);n.pop(),n.unshift(s+a&4294967295),n[4]=n[4]+s&4294967295}for(var i=0;8>i;i++)e[i]=e[i]+n[i]&4294967295}function b(e,t){for(var i=new Array(16),n=0;16>n;n++)i[n]=t[4*n+0]<<24|t[4*n+1]<<16|t[4*n+2]<<8|t[4*n+3];y(e,i)}SHA256_hexchars=new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"),
SHA256_K=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),
t.array_to_string=s,t.SHA256_hash=l,t.HMAC_SHA256_init=c,t.HMAC_SHA256_write=u,t.HMAC_SHA256_finalize=d},function(e,t){"use strict";function i(e){this.string=e}i.prototype.toString=function(){return""+this.string},t.default=i},function(e,t,i){var n,s;(function(){!function(i,a){"use strict";function r(e,t){var i,n;t=t||{},e="raven"+e.substr(0,1).toUpperCase()+e.substr(1),document.createEvent?(i=document.createEvent("HTMLEvents"),i.initEvent(e,!0,!0)):(i=document.createEventObject(),i.eventType=e);for(n in t)p(t,n)&&(i[n]=t[n]);
if(document.createEvent)document.dispatchEvent(i);else try{document.fireEvent("on"+i.eventType.toLowerCase(),i)}catch(s){}}function o(e){this.name="RavenConfigError",this.message=e}function l(e){var t=Q.exec(e),i={},n=7;try{for(;n--;)i[$[n]]=t[n]||""}catch(s){throw new o("Invalid DSN: "+e)}if(i.pass)throw new o("Do not specify your private key in the DSN!");return i}function c(e){return"undefined"==typeof e}function u(e){return"function"==typeof e}function d(e){return"string"==typeof e}function h(e){
for(var t in e)return!1;return!0}function p(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function f(e,t){var i,n;if(c(e.length))for(i in e)p(e,i)&&t.call(null,i,e[i]);else if(n=e.length)for(i=0;n>i;i++)t.call(null,i,e[i])}function m(){z="?sentry_version=4&sentry_client=raven-js/"+W.VERSION+"&sentry_key="+F}function g(e,t){var i=[];e.stack&&e.stack.length&&f(e.stack,function(e,t){var n=v(t);n&&i.push(n)}),r("handle",{stackInfo:e,options:t}),b(e.name,e.message,e.url,e.lineno,i,t)}function v(e){
if(e.url){var t,i={filename:e.url,lineno:e.line,colno:e.column,"function":e.func||"?"},n=y(e);if(n){var s=["pre_context","context_line","post_context"];for(t=3;t--;)i[s[t]]=n[t]}return i.in_app=!(!V.includePaths.test(i.filename)||/(Raven|TraceKit)\./.test(i.function)||/raven\.(min\.)?js$/.test(i.filename)),i}}function y(e){if(e.context&&V.fetchContext){for(var t=e.context,i=~~(t.length/2),n=t.length,s=!1;n--;)if(t[n].length>300){s=!0;break}if(s){if(c(e.column))return;return[[],t[i].substr(e.column,50),[]];
}return[t.slice(0,i),t[i],t.slice(i+1)]}}function b(e,t,i,n,s,a){var r,o;t+="",("Error"!==e||t)&&(V.ignoreErrors.test(t)||(s&&s.length?(i=s[0].filename||i,s.reverse(),r={frames:s}):i&&(r={frames:[{filename:i,lineno:n,in_app:!0}]}),t=x(t,100),V.ignoreUrls&&V.ignoreUrls.test(i)||(!V.whitelistUrls||V.whitelistUrls.test(i))&&(o=n?t+" at "+n:t,C(w({exception:{type:e,value:t},stacktrace:r,culprit:i,message:o},a)))))}function w(e,t){return t?(f(t,function(t,i){e[t]=i}),e):e}function x(e,t){return e.length<=t?e:e.substr(0,t)+"\u2026";
}function S(){var e={url:document.location.href,headers:{"User-Agent":navigator.userAgent}};return document.referrer&&(e.headers.Referer=document.referrer),e}function C(e){P()&&(e=w({project:U,logger:V.logger,site:V.site,platform:"javascript",request:S()},e),e.tags=w(V.tags,e.tags),e.extra=w(V.extra,e.extra),h(e.tags)&&delete e.tags,h(e.extra)&&delete e.extra,N&&(e.user=N),u(V.dataCallback)&&(e=V.dataCallback(e)),(!u(V.shouldSendCallback)||V.shouldSendCallback(e))&&(O=e.event_id||(e.event_id=I()),
k(e)))}function k(e){var t=new Image,i=L+z+"&sentry_data="+encodeURIComponent(JSON.stringify(e));t.onload=function(){r("success",{data:e,src:i})},t.onerror=t.onabort=function(){r("failure",{data:e,src:i})},t.src=i}function P(){return j?L?!0:(_("error","Error: Raven has not been configured."),!1):!1}function A(e){for(var t,i=[],n=0,s=e.length;s>n;n++)t=e[n],d(t)?i.push(t.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")):t&&t.source&&i.push(t.source);return new RegExp(i.join("|"),"i")}function I(){return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,function(e){
var t=16*Math.random()|0,i="x"==e?t:3&t|8;return i.toString(16)})}function _(e,t){i.console&&console[e]&&W.debug&&console[e](t)}function T(){var e=i.RavenConfig;e&&W.config(e.dsn,e.config).install()}var D={remoteFetching:!1,collectWindowErrors:!0,linesOfContext:7},E=[].slice,M="?";D.wrap=function(e){function t(){try{return e.apply(this,arguments)}catch(t){throw D.report(t),t}}return t},D.report=function(){function e(e){o(),f.push(e)}function t(e){for(var t=f.length-1;t>=0;--t)f[t]===e&&f.splice(t,1);
}function n(){l(),f=[]}function s(e,t){var i=null;if(!t||D.collectWindowErrors){for(var n in f)if(p(f,n))try{f[n].apply(null,[e].concat(E.call(arguments,2)))}catch(s){i=s}if(i)throw i}}function r(e,t,i,n,a){var r=null;if(v)D.computeStackTrace.augmentStackTraceWithInitialElement(v,t,i,e),c();else if(a)r=D.computeStackTrace(a),s(r,!0);else{var o={url:t,line:i,column:n};o.func=D.computeStackTrace.guessFunctionName(o.url,o.line),o.context=D.computeStackTrace.gatherContext(o.url,o.line),r={message:e,url:document.location.href,
stack:[o]},s(r,!0)}return d?d.apply(this,arguments):!1}function o(){h||(d=i.onerror,i.onerror=r,h=!0)}function l(){h&&(i.onerror=d,h=!1,d=a)}function c(){var e=v,t=m;m=null,v=null,g=null,s.apply(null,[e,!1].concat(t))}function u(e,t){var n=E.call(arguments,1);if(v){if(g===e)return;c()}var s=D.computeStackTrace(e);if(v=s,g=e,m=n,i.setTimeout(function(){g===e&&c()},s.incomplete?2e3:0),t!==!1)throw e}var d,h,f=[],m=null,g=null,v=null;return u.subscribe=e,u.unsubscribe=t,u.uninstall=n,u}(),D.computeStackTrace=function(){
function e(e){if(!D.remoteFetching)return"";try{var t=function(){try{return new i.XMLHttpRequest}catch(e){return new i.ActiveXObject("Microsoft.XMLHTTP")}},n=t();return n.open("GET",e,!1),n.send(""),n.responseText}catch(s){return""}}function t(t){if(!d(t))return[];if(!p(x,t)){var i="";-1!==t.indexOf(document.domain)&&(i=e(t)),x[t]=i?i.split("\n"):[]}return x[t]}function n(e,i){var n,s=/function ([^(]*)\(([^)]*)\)/,a=/['"]?([0-9A-Za-z$_]+)['"]?\s*[:=]\s*(function|eval|new Function)/,r="",o=10,l=t(e);
if(!l.length)return M;for(var u=0;o>u;++u)if(r=l[i-u]+r,!c(r)){if(n=a.exec(r))return n[1];if(n=s.exec(r))return n[1]}return M}function s(e,i){var n=t(e);if(!n.length)return null;var s=[],a=Math.floor(D.linesOfContext/2),r=a+D.linesOfContext%2,o=Math.max(0,i-a-1),l=Math.min(n.length,i+r-1);i-=1;for(var u=o;l>u;++u)c(n[u])||s.push(n[u]);return s.length>0?s:null}function a(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#]/g,"\\$&")}function r(e){return a(e).replace("<","(?:<|&lt;)").replace(">","(?:>|&gt;)").replace("&","(?:&|&amp;)").replace('"','(?:"|&quot;)').replace(/\s+/g,"\\s+");
}function o(e,i){for(var n,s,a=0,r=i.length;r>a;++a)if((n=t(i[a])).length&&(n=n.join("\n"),s=e.exec(n)))return{url:i[a],line:n.substring(0,s.index).split("\n").length,column:s.index-n.lastIndexOf("\n",s.index)-1};return null}function l(e,i,n){var s,r=t(i),o=new RegExp("\\b"+a(e)+"\\b");return n-=1,r&&r.length>n&&(s=o.exec(r[n]))?s.index:null}function u(e){for(var t,n,s,l,c=[i.location.href],u=document.getElementsByTagName("script"),d=""+e,h=/^function(?:\s+([\w$]+))?\s*\(([\w\s,]*)\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/,p=/^function on([\w$]+)\s*\(event\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/,f=0;f<u.length;++f){
var m=u[f];m.src&&c.push(m.src)}if(s=h.exec(d)){var g=s[1]?"\\s+"+s[1]:"",v=s[2].split(",").join("\\s*,\\s*");t=a(s[3]).replace(/;$/,";?"),n=new RegExp("function"+g+"\\s*\\(\\s*"+v+"\\s*\\)\\s*{\\s*"+t+"\\s*}")}else n=new RegExp(a(d).replace(/\s+/g,"\\s+"));if(l=o(n,c))return l;if(s=p.exec(d)){var y=s[1];if(t=r(s[2]),n=new RegExp("on"+y+"=[\\'\"]\\s*"+t+"\\s*[\\'\"]","i"),l=o(n,c[0]))return l;if(n=new RegExp(t),l=o(n,c))return l}return null}function h(e){if(!e.stack)return null;for(var t,i,a=/^\s*at (?:((?:\[object object\])?\S+(?: \[as \S+\])?) )?\(?((?:file|https?|chrome-extension):.*?):(\d+)(?::(\d+))?\)?\s*$/i,r=/^\s*(\S*)(?:\((.*?)\))?@((?:file|https?|chrome).*?):(\d+)(?::(\d+))?\s*$/i,o=e.stack.split("\n"),u=[],d=/^(.*) is undefined$/.exec(e.message),h=0,p=o.length;p>h;++h){
if(t=r.exec(o[h]))i={url:t[3],func:t[1]||M,args:t[2]?t[2].split(","):"",line:+t[4],column:t[5]?+t[5]:null};else{if(!(t=a.exec(o[h])))continue;i={url:t[2],func:t[1]||M,line:+t[3],column:t[4]?+t[4]:null}}!i.func&&i.line&&(i.func=n(i.url,i.line)),i.line&&(i.context=s(i.url,i.line)),u.push(i)}return u.length?(u[0].line&&!u[0].column&&d?u[0].column=l(d[1],u[0].url,u[0].line):u[0].column||c(e.columnNumber)||(u[0].column=e.columnNumber+1),{name:e.name,message:e.message,url:document.location.href,stack:u
}):null}function f(e){for(var t,i=e.stacktrace,a=/ line (\d+), column (\d+) in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\) in (.*):\s*$/i,r=i.split("\n"),o=[],l=0,c=r.length;c>l;l+=2)if(t=a.exec(r[l])){var u={line:+t[1],column:+t[2],func:t[3]||t[4],args:t[5]?t[5].split(","):[],url:t[6]};if(!u.func&&u.line&&(u.func=n(u.url,u.line)),u.line)try{u.context=s(u.url,u.line)}catch(d){}u.context||(u.context=[r[l+1]]),o.push(u)}return o.length?{name:e.name,message:e.message,url:document.location.href,
stack:o}:null}function m(e){var a=e.message.split("\n");if(a.length<4)return null;var l,c,u,d,h=/^\s*Line (\d+) of linked script ((?:file|https?)\S+)(?:: in function (\S+))?\s*$/i,f=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?)\S+)(?:: in function (\S+))?\s*$/i,m=/^\s*Line (\d+) of function script\s*$/i,g=[],v=document.getElementsByTagName("script"),y=[];for(c in v)p(v,c)&&!v[c].src&&y.push(v[c]);for(c=2,u=a.length;u>c;c+=2){var b=null;if(l=h.exec(a[c]))b={url:l[2],func:l[3],line:+l[1]
};else if(l=f.exec(a[c])){b={url:l[3],func:l[4]};var w=+l[1],x=y[l[2]-1];if(x&&(d=t(b.url))){d=d.join("\n");var S=d.indexOf(x.innerText);S>=0&&(b.line=w+d.substring(0,S).split("\n").length)}}else if(l=m.exec(a[c])){var C=i.location.href.replace(/#.*$/,""),k=l[1],P=new RegExp(r(a[c+1]));d=o(P,[C]),b={url:C,line:d?d.line:k,func:""}}if(b){b.func||(b.func=n(b.url,b.line));var A=s(b.url,b.line),I=A?A[Math.floor(A.length/2)]:null;A&&I.replace(/^\s*/,"")===a[c+1].replace(/^\s*/,"")?b.context=A:b.context=[a[c+1]],
g.push(b)}}return g.length?{name:e.name,message:a[0],url:document.location.href,stack:g}:null}function g(e,t,i,a){var r={url:t,line:i};if(r.url&&r.line){e.incomplete=!1,r.func||(r.func=n(r.url,r.line)),r.context||(r.context=s(r.url,r.line));var o=/ '([^']+)' /.exec(a);if(o&&(r.column=l(o[1],r.url,r.line)),e.stack.length>0&&e.stack[0].url===r.url){if(e.stack[0].line===r.line)return!1;if(!e.stack[0].line&&e.stack[0].func===r.func)return e.stack[0].line=r.line,e.stack[0].context=r.context,!1}return e.stack.unshift(r),
e.partial=!0,!0}return e.incomplete=!0,!1}function v(e,t){for(var i,s,a,r=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,o=[],c={},d=!1,h=v.caller;h&&!d;h=h.caller)if(h!==y&&h!==D.report){if(s={url:null,func:M,line:null,column:null},h.name?s.func=h.name:(i=r.exec(h.toString()))&&(s.func=i[1]),a=u(h)){s.url=a.url,s.line=a.line,s.func===M&&(s.func=n(s.url,s.line));var p=/ '([^']+)' /.exec(e.message||e.description);p&&(s.column=l(p[1],a.url,a.line))}c[""+h]?d=!0:c[""+h]=!0,o.push(s);
}t&&o.splice(0,t);var f={name:e.name,message:e.message,url:document.location.href,stack:o};return g(f,e.sourceURL||e.fileName,e.line||e.lineNumber,e.message||e.description),f}function y(e,t){var i=null;t=null==t?0:+t;try{if(i=f(e))return i}catch(n){if(w)throw n}try{if(i=h(e))return i}catch(n){if(w)throw n}try{if(i=m(e))return i}catch(n){if(w)throw n}try{if(i=v(e,t+1))return i}catch(n){if(w)throw n}return{}}function b(e){e=(null==e?0:+e)+1;try{throw new Error}catch(t){return y(t,e+1)}}var w=!1,x={};
return y.augmentStackTraceWithInitialElement=g,y.guessFunctionName=n,y.gatherContext=s,y.ofCaller=b,y}();var R,O,L,N,F,U,z,B=i.Raven,j=!(!i.JSON||!i.JSON.stringify),V={logger:"javascript",ignoreErrors:[],ignoreUrls:[],whitelistUrls:[],includePaths:[],collectWindowErrors:!0,tags:{},extra:{}},H=!1,W={VERSION:"1.1.16",debug:!0,noConflict:function(){return i.Raven=B,W},config:function(e,t){if(L)return _("error","Error: Raven has already been configured"),W;if(!e)return W;var i=l(e),n=i.path.lastIndexOf("/"),s=i.path.substr(1,n);
return t&&f(t,function(e,t){V[e]=t}),V.ignoreErrors.push("Script error."),V.ignoreErrors.push("Script error"),V.ignoreErrors.push("Javascript error: Script error on line 0"),V.ignoreErrors.push("Javascript error: Script error. on line 0"),V.ignoreErrors=A(V.ignoreErrors),V.ignoreUrls=V.ignoreUrls.length?A(V.ignoreUrls):!1,V.whitelistUrls=V.whitelistUrls.length?A(V.whitelistUrls):!1,V.includePaths=A(V.includePaths),F=i.user,U=i.path.substr(n+1),L="//"+i.host+(i.port?":"+i.port:"")+"/"+s+"api/"+U+"/store/",
i.protocol&&(L=i.protocol+":"+L),V.fetchContext&&(D.remoteFetching=!0),V.linesOfContext&&(D.linesOfContext=V.linesOfContext),D.collectWindowErrors=!!V.collectWindowErrors,m(),W},install:function(){return P()&&!H&&(D.report.subscribe(g),H=!0),W},context:function(e,t,i){return u(e)&&(i=t||[],t=e,e=a),W.wrap(e,t).apply(this,i)},wrap:function(e,t){function i(){for(var i=[],n=arguments.length,s=!e||e&&e.deep!==!1;n--;)i[n]=s?W.wrap(e,arguments[n]):arguments[n];try{return t.apply(this,i)}catch(a){throw W.captureException(a,e),
a}}if(c(t)&&!u(e))return e;if(u(e)&&(t=e,e=a),!u(t))return t;if(t.__raven__)return t;for(var n in t)p(t,n)&&(i[n]=t[n]);return i.__raven__=!0,i.__inner__=t,i},uninstall:function(){return D.report.uninstall(),H=!1,W},captureException:function(e,t){if(!(e instanceof Error))return W.captureMessage(e,t);R=e;try{D.report(e,t)}catch(i){if(e!==i)throw i}return W},captureMessage:function(e,t){return C(w({message:e+""},t)),W},setUserContext:function(e){return N=e,W},setExtraContext:function(e){return V.extra=e||{},
W},setTagsContext:function(e){return V.tags=e||{},W},lastException:function(){return R},lastEventId:function(){return O}};W.setUser=W.setUserContext;var $="source protocol user pass host port path".split(" "),Q=/^(?:(\w+):)?\/\/(\w+)(:\w+)?@([\w\.-]+)(?::(\d+))?(\/.*)/;o.prototype=new Error,o.prototype.constructor=o,T(),i.Raven=W,n=[],s=function(){return W}.apply(t,n),!(s!==a&&(e.exports=s))}(this)}).call(window)},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,i){(function(e){
+function(e){"use strict";var t=function(i,n){this.$element=e(i),this.options=e.extend({},t.DEFAULTS,n)};t.DEFAULTS={loadingText:"loading..."},t.prototype.setState=function(e){var t="disabled",i=this.$element,n=i.is("input")?"val":"html",s=i.data();e+="Text",s.resetText||i.data("resetText",i[n]()),i[n](s[e]||this.options[e]),setTimeout(function(){"loadingText"==e?i.addClass(t).attr(t,t):i.removeClass(t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.closest('[data-toggle="buttons"]');
if(e.length){var t=this.$element.find("input").prop("checked",!this.$element.hasClass("active")).trigger("change");"radio"===t.prop("type")&&e.find(".active").removeClass("active")}this.$element.toggleClass("active")};var i=e.fn.button;e.fn.button=function(i){return this.each(function(){var n=e(this),s=n.data("bs.button"),a="object"==typeof i&&i;s||n.data("bs.button",s=new t(this,a)),"toggle"==i?s.toggle():i&&s.setState(i)})},e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=i,
this},e(document).on("click.bs.button.data-api","[data-toggle^=button]",function(t){var i=e(t.target);i.hasClass("btn")||(i=i.closest(".btn")),i.button("toggle"),t.preventDefault()})}(e)}).call(t,i(4))},function(e,t,i){(function(e){+function(e){"use strict";function t(){e(n).remove(),e(s).each(function(t){var n=i(e(this));n.hasClass("open")&&(n.trigger(t=e.Event("hide.bs.dropdown")),t.isDefaultPrevented()||n.removeClass("open").trigger("hidden.bs.dropdown"))})}function i(t){var i=t.attr("data-target");
i||(i=t.attr("href"),i=i&&/#/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,""));var n=i&&e(i);return n&&n.length?n:t.parent()}var n=".dropdown-backdrop",s="[data-toggle=dropdown]",a=function(t){e(t).on("click.bs.dropdown",this.toggle)};a.prototype.toggle=function(n){var s=e(this);if(!s.is(".disabled, :disabled")){var a=i(s),r=a.hasClass("open");if(t(),!r){if("ontouchstart"in document.documentElement&&!a.closest(".navbar-nav").length&&e('<div class="dropdown-backdrop"/>').insertAfter(e(this)).on("click",t),
a.trigger(n=e.Event("show.bs.dropdown")),n.isDefaultPrevented())return;a.toggleClass("open").trigger("shown.bs.dropdown"),s.focus()}return!1}},a.prototype.keydown=function(t){if(/(38|40|27)/.test(t.keyCode)){var n=e(this);if(t.preventDefault(),t.stopPropagation(),!n.is(".disabled, :disabled")){var a=i(n),r=a.hasClass("open");if(!r||r&&27==t.keyCode)return 27==t.which&&a.find(s).focus(),n.click();var o=e("[role=menu] li:not(.divider):visible a",a);if(o.length){var l=o.index(o.filter(":focus"));38==t.keyCode&&l>0&&l--,
40==t.keyCode&&l<o.length-1&&l++,~l||(l=0),o.eq(l).focus()}}}};var r=e.fn.dropdown;e.fn.dropdown=function(t){return this.each(function(){var i=e(this),n=i.data("dropdown");n||i.data("dropdown",n=new a(this)),"string"==typeof t&&n[t].call(i)})},e.fn.dropdown.Constructor=a,e.fn.dropdown.noConflict=function(){return e.fn.dropdown=r,this},e(document).on("click.bs.dropdown.data-api",t).on("click.bs.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("click.bs.dropdown.data-api",s,a.prototype.toggle).on("keydown.bs.dropdown.data-api",s+", [role=menu]",a.prototype.keydown);
}(e)}).call(t,i(4))},function(e,t,i){(function(e){+function(e){"use strict";var t=function(t,i){this.options=i,this.$element=e(t),this.$backdrop=this.isShown=null,this.options.remote&&this.$element.load(this.options.remote)};t.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},t.prototype.toggle=function(e){return this[this.isShown?"hide":"show"](e)},t.prototype.show=function(t){var i=this,n=e.Event("show.bs.modal",{relatedTarget:t});this.$element.trigger(n),this.isShown||n.isDefaultPrevented()||(this.isShown=!0,
this.escape(),this.$element.on("click.dismiss.modal",'[data-dismiss="modal"]',e.proxy(this.hide,this)),this.backdrop(function(){var n=e.support.transition&&i.$element.hasClass("fade");i.$element.parent().length||i.$element.appendTo(document.body),i.$element.show(),n&&i.$element[0].offsetWidth,i.$element.addClass("in").attr("aria-hidden",!1),i.enforceFocus();var s=e.Event("shown.bs.modal",{relatedTarget:t});n?i.$element.find(".modal-dialog").one(e.support.transition.end,function(){i.$element.focus().trigger(s);
}).emulateTransitionEnd(300):i.$element.focus().trigger(s)}))},t.prototype.hide=function(t){t&&t.preventDefault(),t=e.Event("hide.bs.modal"),this.$element.trigger(t),this.isShown&&!t.isDefaultPrevented()&&(this.isShown=!1,this.escape(),e(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.modal"),e.support.transition&&this.$element.hasClass("fade")?this.$element.one(e.support.transition.end,e.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal());
},t.prototype.enforceFocus=function(){e(document).off("focusin.bs.modal").on("focusin.bs.modal",e.proxy(function(e){this.$element[0]===e.target||this.$element.has(e.target).length||this.$element.focus()},this))},t.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.bs.modal",e.proxy(function(e){27==e.which&&this.hide()},this)):this.isShown||this.$element.off("keyup.dismiss.bs.modal")},t.prototype.hideModal=function(){var e=this;this.$element.hide(),this.backdrop(function(){
e.removeBackdrop(),e.$element.trigger("hidden.bs.modal")})},t.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},t.prototype.backdrop=function(t){var i=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var n=e.support.transition&&i;if(this.$backdrop=e('<div class="modal-backdrop '+i+'" />').appendTo(document.body),this.$element.on("click.dismiss.modal",e.proxy(function(e){e.target===e.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this));
},this)),n&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!t)return;n?this.$backdrop.one(e.support.transition.end,t).emulateTransitionEnd(150):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(e.support.transition.end,t).emulateTransitionEnd(150):t()):t&&t()};var i=e.fn.modal;e.fn.modal=function(i,n){return this.each(function(){var s=e(this),a=s.data("bs.modal"),r=e.extend({},t.DEFAULTS,s.data(),"object"==typeof i&&i);
a||s.data("bs.modal",a=new t(this,r)),"string"==typeof i?a[i](n):r.show&&a.show(n)})},e.fn.modal.Constructor=t,e.fn.modal.noConflict=function(){return e.fn.modal=i,this},e(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(t){var i=e(this),n=i.attr("href"),s=e(i.attr("data-target")||n&&n.replace(/.*(?=#[^\s]+$)/,"")),a=s.data("modal")?"toggle":e.extend({remote:!/#/.test(n)&&n},s.data(),i.data());t.preventDefault(),s.modal(a,this).one("hide",function(){i.is(":visible")&&i.focus();
})}),e(document).on("show.bs.modal",".modal",function(){e(document.body).addClass("modal-open")}).on("hidden.bs.modal",".modal",function(){e(document.body).removeClass("modal-open")})}(e)}).call(t,i(4))},function(e,t,i){(function(e){+function(e){"use strict";var t=function(e,t){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",e,t)};t.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
trigger:"hover focus",title:"",delay:0,html:!1,container:!1},t.prototype.init=function(t,i,n){this.enabled=!0,this.type=t,this.$element=e(i),this.options=this.getOptions(n);for(var s=this.options.trigger.split(" "),a=s.length;a--;){var r=s[a];if("click"==r)this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this));else if("manual"!=r){var o="hover"==r?"mouseenter":"focus",l="hover"==r?"mouseleave":"blur";this.$element.on(o+"."+this.type,this.options.selector,e.proxy(this.enter,this)),
this.$element.on(l+"."+this.type,this.options.selector,e.proxy(this.leave,this))}}this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.getOptions=function(t){return t=e.extend({},this.getDefaults(),this.$element.data(),t),t.delay&&"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),t},t.prototype.getDelegateOptions=function(){var t={},i=this.getDefaults();return this._options&&e.each(this._options,function(e,n){
i[e]!=n&&(t[e]=n)}),t},t.prototype.enter=function(t){var i=t instanceof this.constructor?t:e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?void(i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)):i.show()},t.prototype.leave=function(t){var i=t instanceof this.constructor?t:e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);
return clearTimeout(i.timeout),i.hoverState="out",i.options.delay&&i.options.delay.hide?void(i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)):i.hide()},t.prototype.show=function(){var t=e.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){if(this.$element.trigger(t),t.isDefaultPrevented())return;var i=this.tip();this.setContent(),this.options.animation&&i.addClass("fade");var n="function"==typeof this.options.placement?this.options.placement.call(this,i[0],this.$element[0]):this.options.placement,s=/\s?auto?\s?/i,a=s.test(n);
a&&(n=n.replace(s,"")||"top"),i.detach().css({top:0,left:0,display:"block"}).addClass(n),this.options.container?i.appendTo(this.options.container):i.insertAfter(this.$element);var r=this.getPosition(),o=i[0].offsetWidth,l=i[0].offsetHeight;if(a){var c=this.$element.parent(),u=n,d=document.documentElement.scrollTop||document.body.scrollTop,h="body"==this.options.container?window.innerWidth:c.outerWidth(),p="body"==this.options.container?window.innerHeight:c.outerHeight(),f="body"==this.options.container?0:c.offset().left;
n="bottom"==n&&r.top+r.height+l-d>p?"top":"top"==n&&r.top-d-l<0?"bottom":"right"==n&&r.right+o>h?"left":"left"==n&&r.left-o<f?"right":n,i.removeClass(u).addClass(n)}var m=this.getCalculatedOffset(n,r,o,l);this.applyPlacement(m,n),this.$element.trigger("shown.bs."+this.type)}},t.prototype.applyPlacement=function(e,t){var i,n=this.tip(),s=n[0].offsetWidth,a=n[0].offsetHeight,r=parseInt(n.css("margin-top"),10),o=parseInt(n.css("margin-left"),10);isNaN(r)&&(r=0),isNaN(o)&&(o=0),e.top=e.top+r,e.left=e.left+o,
n.offset(e).addClass("in");var l=n[0].offsetWidth,c=n[0].offsetHeight;if("top"==t&&c!=a&&(i=!0,e.top=e.top+a-c),/bottom|top/.test(t)){var u=0;e.left<0&&(u=-2*e.left,e.left=0,n.offset(e),l=n[0].offsetWidth,c=n[0].offsetHeight),this.replaceArrow(u-s+l,l,"left")}else this.replaceArrow(c-a,c,"top");i&&n.offset(e)},t.prototype.replaceArrow=function(e,t,i){this.arrow().css(i,e?50*(1-e/t)+"%":"")},t.prototype.setContent=function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.options.html?"html":"text"](t),
e.removeClass("fade in top bottom left right")},t.prototype.hide=function(){function t(){"in"!=i.hoverState&&n.detach()}var i=this,n=this.tip(),s=e.Event("hide.bs."+this.type);return this.$element.trigger(s),s.isDefaultPrevented()?void 0:(n.removeClass("in"),e.support.transition&&this.$tip.hasClass("fade")?n.one(e.support.transition.end,t).emulateTransitionEnd(150):t(),this.$element.trigger("hidden.bs."+this.type),this)},t.prototype.fixTitle=function(){var e=this.$element;(e.attr("title")||"string"!=typeof e.attr("data-original-title"))&&e.attr("data-original-title",e.attr("title")||"").attr("title","");
},t.prototype.hasContent=function(){return this.getTitle()},t.prototype.getPosition=function(){var t=this.$element[0];return e.extend({},"function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{width:t.offsetWidth,height:t.offsetHeight},this.$element.offset())},t.prototype.getCalculatedOffset=function(e,t,i,n){return"bottom"==e?{top:t.top+t.height,left:t.left+t.width/2-i/2}:"top"==e?{top:t.top-n,left:t.left+t.width/2-i/2}:"left"==e?{top:t.top+t.height/2-n/2,left:t.left-i}:{top:t.top+t.height/2-n/2,
left:t.left+t.width}},t.prototype.getTitle=function(){var e,t=this.$element,i=this.options;return e=t.attr("data-original-title")||("function"==typeof i.title?i.title.call(t[0]):i.title)},t.prototype.tip=function(){return this.$tip=this.$tip||e(this.options.template)},t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},t.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},t.prototype.enable=function(){
this.enabled=!0},t.prototype.disable=function(){this.enabled=!1},t.prototype.toggleEnabled=function(){this.enabled=!this.enabled},t.prototype.toggle=function(t){var i=t?e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type):this;i.tip().hasClass("in")?i.leave(i):i.enter(i)},t.prototype.destroy=function(){this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var i=e.fn.tooltip;e.fn.tooltip=function(i){return this.each(function(){var n=e(this),s=n.data("bs.tooltip"),a="object"==typeof i&&i;
s||n.data("bs.tooltip",s=new t(this,a)),"string"==typeof i&&s[i]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.noConflict=function(){return e.fn.tooltip=i,this}}(e)}).call(t,i(4))},function(e,t,i){(function(e){+function(e){"use strict";function t(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in t)if(void 0!==e.style[i])return{end:t[i]}}e.fn.emulateTransitionEnd=function(t){
var i=!1,n=this;e(this).one(e.support.transition.end,function(){i=!0});var s=function(){i||e(n).trigger(e.support.transition.end)};return setTimeout(s,t),this},e(function(){e.support.transition=t()})}(e)}).call(t,i(4))},function(e,t,i){var n,s;n=[i(4),i(1279)],s=function(e,t){"use strict";e.fn.translate=function(e,i){var n=t.csstransforms3d?"translate3d("+e+"px, "+i+"px, 0)":"translate("+e+"px, "+i+"px)";if(1===this.length){var s=this[0].style;"webkitTransform"in s?s.webkitTransform=n:"OTransform"in s?s.OTransform=n:s.transform=n;
}else this.css("transform",n)}}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n;(function(e){/** @license
	 *
	 * SoundManager 2: JavaScript Sound for the Web
	 * ----------------------------------------------
	 * http://schillmania.com/projects/soundmanager2/
	 *
	 * Copyright (c) 2007, Scott Schiller. All rights reserved.
	 * Code provided under the BSD License:
	 * http://schillmania.com/projects/soundmanager2/license.txt
	 *
	 * V2.97a.20150601
	 */
var s=!0;!function(a,r){"use strict";function o(e,t){function i(e){return pe.preferFlash&&ae&&!pe.ignoreFlash&&pe.flash[e]!==r&&pe.flash[e]}function n(e){return function(t){var i,n=this._s;return i=n&&n._a?e.call(this,t):null}}this.setupOptions={url:e||null,flashVersion:8,debugMode:!0,debugFlash:!1,useConsole:!0,consoleOnly:!0,waitForWindowLoad:!1,bgColor:"#ffffff",useHighPerformance:!1,flashPollingInterval:null,html5PollingInterval:null,flashLoadTimeout:1e3,wmode:null,allowScriptAccess:"always",
useFlashBlock:!1,useHTML5Audio:!0,forceUseGlobalHTML5Audio:!1,ignoreMobileRestrictions:!1,html5Test:/^(probably|maybe)$/i,preferFlash:!1,noSWFCache:!1,idPrefix:"sound"},this.defaultOptions={autoLoad:!1,autoPlay:!1,from:null,loops:1,onid3:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onposition:null,onstop:null,onfailure:null,onfinish:null,multiShot:!0,multiShotEvents:!1,position:null,pan:0,stream:!0,to:null,type:null,usePolicyFile:!1,volume:100},this.flash9Options={
isMovieStar:null,usePeakData:!1,useWaveformData:!1,useEQData:!1,onbufferchange:null,ondataerror:null},this.movieStarOptions={bufferTime:3,serverURL:null,onconnect:null,duration:null},this.audioFormats={mp3:{type:['audio/mpeg; codecs="mp3"',"audio/mpeg","audio/mp3","audio/MPA","audio/mpa-robust"],required:!0},mp4:{related:["aac","m4a","m4b"],type:['audio/mp4; codecs="mp4a.40.2"',"audio/aac","audio/x-m4a","audio/MP4A-LATM","audio/mpeg4-generic"],required:!1},ogg:{type:["audio/ogg; codecs=vorbis"],required:!1
},opus:{type:["audio/ogg; codecs=opus","audio/opus"],required:!1},wav:{type:['audio/wav; codecs="1"',"audio/wav","audio/wave","audio/x-wav"],required:!1}},this.movieID="sm2-container",this.id=t||"sm2movie",this.debugID="soundmanager-debug",this.debugURLParam=/([#?&])debug=1/i,this.versionNumber="V2.97a.20150601",this.version=null,this.movieURL=null,this.altURL=null,this.swfLoaded=!1,this.enabled=!1,this.oMC=null,this.sounds={},this.soundIDs=[],this.muted=!1,this.didFlashBlock=!1,this.filePattern=null,
this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i},this.features={buffering:!1,peakData:!1,waveformData:!1,eqData:!1,movieStar:!1},this.sandbox={},this.html5={usingFlash:null},this.flash={},this.html5Only=!1,this.ignoreFlash=!1;var s,o,l,c,u,d,h,p,f,m,g,v,y,b,w,x,S,C,k,P,A,I,_,T,D,E,M,R,O,L,N,F,U,z,B,j,V,H,W,$,Q,q,K,Y,G,X,J,Z,ee,te,ie,ne,se,ae,re,oe,le,ce,ue,de,he,pe=this,fe=null,me=null,ge=navigator.userAgent,ve=a.location.href.toString(),ye=document,be=[],we=!1,xe=!1,Se=!1,Ce=!1,ke=!1,Pe=8,Ae=null,Ie=null,_e=!1,Te=!1,De=0,Ee=null,Me=[],Re=null,Oe=Array.prototype.slice,Le=!1,Ne=0,Fe=1e3,Ue=ge.match(/(ipad|iphone|ipod)/i),ze=ge.match(/android/i),Be=ge.match(/msie/i),je=ge.match(/webkit/i),Ve=ge.match(/safari/i)&&!ge.match(/chrome/i),He=ge.match(/opera/i),We=ge.match(/(mobile|pre\/|xoom)/i)||Ue||ze,$e=!ve.match(/usehtml5audio/i)&&!ve.match(/sm2\-ignorebadua/i)&&Ve&&!ge.match(/silk/i)&&ge.match(/OS X 10_6_([3-7])/i),Qe=(a.console!==r&&console.log!==r,
ye.hasFocus!==r?ye.hasFocus():null),qe=Ve&&(ye.hasFocus===r||!ye.hasFocus()),Ke=!qe,Ye=/(mp3|mp4|mpa|m4a|m4b)/i,Ge="about:blank",Xe="data:audio/wave;base64,/UklGRiYAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQIAAAD//w==",Je=ye.location?ye.location.protocol.match(/http/i):null,Ze=Je?"":"http://",et=/^\s*audio\/(?:x-)?(?:mpeg4|aac|flv|mov|mp4||m4v|m4a|m4b|mp4v|3gp|3g2)\s*(?:$|;)/i,tt=["mpeg4","aac","flv","mov","mp4","m4v","f4v","m4a","m4b","mp4v","3gp","3g2"],it=new RegExp("\\.("+tt.join("|")+")(\\?.*)?$","i");
this.mimePattern=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i,this.useAltURL=!Je,B={swfBox:"sm2-object-box",swfDefault:"movieContainer",swfError:"swf_error",swfTimedout:"swf_timedout",swfLoaded:"swf_loaded",swfUnblocked:"swf_unblocked",sm2Debug:"sm2_debug",highPerf:"high_performance",flashDebug:"flash_debug"},this.hasHTML5=function(){try{return Audio!==r&&(He&&opera!==r&&opera.version()<10?new Audio(null):new Audio).canPlayType!==r}catch(e){return!1}}(),this.setup=function(e){var t=!pe.url;return e!==r&&Se&&Re&&pe.ok()&&(e.flashVersion!==r||e.url!==r||e.html5Test!==r),
f(e),Le||(We?(!pe.setupOptions.ignoreMobileRestrictions||pe.setupOptions.forceUseGlobalHTML5Audio)&&(Me.push(k.globalHTML5),Le=!0):pe.setupOptions.forceUseGlobalHTML5Audio&&(Me.push(k.globalHTML5),Le=!0)),!he&&We&&(pe.setupOptions.ignoreMobileRestrictions?Me.push(k.ignoreMobile):(pe.setupOptions.useHTML5Audio=!0,pe.setupOptions.preferFlash=!1,Ue?pe.ignoreFlash=!0:(ze&&!ge.match(/android\s2\.3/i)||!ze)&&(Le=!0))),e&&(t&&_&&e.url!==r&&pe.beginDelayedInit(),_||e.url===r||"complete"!==ye.readyState||setTimeout(A,1)),
he=!0,pe},this.ok=function(){return Re?Se&&!Ce:pe.useHTML5Audio&&pe.hasHTML5},this.supported=this.ok,this.getMovie=function(e){return o(e)||ye[e]||a[e]},this.createSound=function(e,t){function i(){return a=j(a),pe.sounds[a.id]=new s(a),pe.soundIDs.push(a.id),pe.sounds[a.id]}var n,a,o=null;if(!Se||!pe.ok())return!1;if(t!==r&&(e={id:e,url:t}),a=p(e),a.url=K(a.url),a.id===r&&(a.id=pe.setupOptions.idPrefix+Ne++),W(a.id,!0))return pe.sounds[a.id];if(X(a))o=i(),o._setup_html5(a);else{if(pe.html5Only)return i();
if(pe.html5.usingFlash&&a.url&&a.url.match(/data\:/i))return i();d>8&&null===a.isMovieStar&&(a.isMovieStar=!!(a.serverURL||(a.type?a.type.match(et):!1)||a.url&&a.url.match(it))),a=V(a,n),o=i(),8===d?me._createSound(a.id,a.loops||1,a.usePolicyFile):(me._createSound(a.id,a.url,a.usePeakData,a.useWaveformData,a.useEQData,a.isMovieStar,a.isMovieStar?a.bufferTime:!1,a.loops||1,a.serverURL,a.duration||null,a.autoPlay,!0,a.autoLoad,a.usePolicyFile),a.serverURL||(o.connected=!0,a.onconnect&&a.onconnect.apply(o))),
a.serverURL||!a.autoLoad&&!a.autoPlay||o.load(a)}return!a.serverURL&&a.autoPlay&&o.play(),o},this.destroySound=function(e,t){if(!W(e))return!1;var i,n=pe.sounds[e];for(n.stop(),n._iO={},n.unload(),i=0;i<pe.soundIDs.length;i++)if(pe.soundIDs[i]===e){pe.soundIDs.splice(i,1);break}return t||n.destruct(!0),n=null,delete pe.sounds[e],!0},this.load=function(e,t){return W(e)?pe.sounds[e].load(t):!1},this.unload=function(e){return W(e)?pe.sounds[e].unload():!1},this.onPosition=function(e,t,i,n){return W(e)?pe.sounds[e].onposition(t,i,n):!1;
},this.onposition=this.onPosition,this.clearOnPosition=function(e,t,i){return W(e)?pe.sounds[e].clearOnPosition(t,i):!1},this.play=function(e,t){var i=null,n=t&&!(t instanceof Object);if(!Se||!pe.ok())return!1;if(W(e,n))n&&(t={url:t});else{if(!n)return!1;n&&(t={url:t}),t&&t.url&&(t.id=e,i=pe.createSound(t).play())}return null===i&&(i=pe.sounds[e].play(t)),i},this.start=this.play,this.setPosition=function(e,t){return W(e)?pe.sounds[e].setPosition(t):!1},this.stop=function(e){return W(e)?pe.sounds[e].stop():!1;
},this.stopAll=function(){var e;for(e in pe.sounds)pe.sounds.hasOwnProperty(e)&&pe.sounds[e].stop()},this.pause=function(e){return W(e)?pe.sounds[e].pause():!1},this.pauseAll=function(){var e;for(e=pe.soundIDs.length-1;e>=0;e--)pe.sounds[pe.soundIDs[e]].pause()},this.resume=function(e){return W(e)?pe.sounds[e].resume():!1},this.resumeAll=function(){var e;for(e=pe.soundIDs.length-1;e>=0;e--)pe.sounds[pe.soundIDs[e]].resume()},this.togglePause=function(e){return W(e)?pe.sounds[e].togglePause():!1},
this.setPan=function(e,t){return W(e)?pe.sounds[e].setPan(t):!1},this.setVolume=function(e,t){var i,n;{if(e===r||isNaN(e)||t!==r)return W(e)?pe.sounds[e].setVolume(t):!1;for(i=0,n=pe.soundIDs.length;n>i;i++)pe.sounds[pe.soundIDs[i]].setVolume(e)}},this.mute=function(e){var t=0;if(e instanceof String&&(e=null),e)return W(e)?pe.sounds[e].mute():!1;for(t=pe.soundIDs.length-1;t>=0;t--)pe.sounds[pe.soundIDs[t]].mute();return pe.muted=!0,!0},this.muteAll=function(){pe.mute()},this.unmute=function(e){var t;
if(e instanceof String&&(e=null),e)return W(e)?pe.sounds[e].unmute():!1;for(t=pe.soundIDs.length-1;t>=0;t--)pe.sounds[pe.soundIDs[t]].unmute();return pe.muted=!1,!0},this.unmuteAll=function(){pe.unmute()},this.toggleMute=function(e){return W(e)?pe.sounds[e].toggleMute():!1},this.getMemoryUse=function(){var e=0;return me&&8!==d&&(e=parseInt(me._getMemoryUse(),10)),e},this.disable=function(e){var t;if(e===r&&(e=!1),Ce)return!1;for(Ce=!0,t=pe.soundIDs.length-1;t>=0;t--)O(pe.sounds[pe.soundIDs[t]]);return h(e),
ne.remove(a,"load",y),!0},this.canPlayMIME=function(e){var t;return pe.hasHTML5&&(t=J({type:e})),!t&&Re&&(t=e&&pe.ok()?!!((d>8?e.match(et):null)||e.match(pe.mimePattern)):null),t},this.canPlayURL=function(e){var t;return pe.hasHTML5&&(t=J({url:e})),!t&&Re&&(t=e&&pe.ok()?!!e.match(pe.filePattern):null),t},this.canPlayLink=function(e){return e.type!==r&&e.type&&pe.canPlayMIME(e.type)?!0:pe.canPlayURL(e.href)},this.getSoundById=function(e,t){if(!e)return null;var i=pe.sounds[e];return i},this.onready=function(e,t){
var i="onready",n=!1;if("function"!=typeof e)throw F("needFunction",i);return t||(t=a),g(i,e,t),v(),n=!0,n},this.ontimeout=function(e,t){var i="ontimeout",n=!1;if("function"!=typeof e)throw F("needFunction",i);return t||(t=a),g(i,e,t),v({type:i}),n=!0,n},this._writeDebug=function(e,t){return!0},this._wD=this._writeDebug,this._debug=function(){},this.reboot=function(e,t){var i,n,s;for(i=pe.soundIDs.length-1;i>=0;i--)pe.sounds[pe.soundIDs[i]].destruct();if(me)try{Be&&(Ie=me.innerHTML),Ae=me.parentNode.removeChild(me);
}catch(r){}if(Ie=Ae=Re=me=null,pe.enabled=_=Se=_e=Te=we=xe=Ce=pe.swfLoaded=!1,pe.soundIDs=[],pe.sounds={},Ne=0,he=!1,e)be=[];else for(i in be)if(be.hasOwnProperty(i))for(n=0,s=be[i].length;s>n;n++)be[i][n].fired=!1;return pe.html5={usingFlash:null},pe.flash={},pe.html5Only=!1,pe.ignoreFlash=!1,a.setTimeout(function(){t||pe.beginDelayedInit()},20),pe},this.reset=function(){return pe.reboot(!0,!0)},this.getMoviePercent=function(){return me&&"PercentLoaded"in me?me.PercentLoaded():null},this.beginDelayedInit=function(){
ke=!0,A(),setTimeout(function(){return Te?!1:(D(),P(),Te=!0,!0)},20),b()},this.destruct=function(){pe.disable(!0)},s=function(e){var t,i,n,s,a,o,l,c,u,h,f=this,m=!1,g=[],v=0,y=null;u={duration:null,time:null},this.id=e.id,this.sID=this.id,this.url=e.url,this.options=p(e),this.instanceOptions=this.options,this._iO=this.instanceOptions,this.pan=this.options.pan,this.volume=this.options.volume,this.isHTML5=!1,this._a=null,h=this.url?!1:!0,this.id3={},this._debug=function(){},this.load=function(e){var t,i=null;
if(e!==r?f._iO=p(e,f.options):(e=f.options,f._iO=e,y&&y!==f.url&&(f._iO.url=f.url,f.url=null)),f._iO.url||(f._iO.url=f.url),f._iO.url=K(f._iO.url),f.instanceOptions=f._iO,t=f._iO,!t.url&&!f.url)return f;if(t.url===f.url&&0!==f.readyState&&2!==f.readyState)return 3===f.readyState&&t.onload&&de(f,function(){t.onload.apply(f,[!!f.duration])}),f;if(f.loaded=!1,f.readyState=1,f.playState=0,f.id3={},X(t))i=f._setup_html5(t),i._called_load||(f._html5_canplay=!1,f.url!==t.url&&(f._a.src=t.url,f.setPosition(0)),
f._a.autobuffer="auto",f._a.preload="auto",f._a._called_load=!0);else{if(pe.html5Only)return f;if(f._iO.url&&f._iO.url.match(/data\:/i))return f;try{f.isHTML5=!1,f._iO=V(j(t)),f._iO.autoPlay&&(f._iO.position||f._iO.from)&&(f._iO.autoPlay=!1),t=f._iO,8===d?me._load(f.id,t.url,t.stream,t.autoPlay,t.usePolicyFile):me._load(f.id,t.url,!!t.stream,!!t.autoPlay,t.loops||1,!!t.autoLoad,t.usePolicyFile)}catch(n){E({type:"SMSOUND_LOAD_JS_EXCEPTION",fatal:!0})}}return f.url=t.url,f},this.unload=function(){return 0!==f.readyState&&(f.isHTML5?(s(),
f._a&&(f._a.pause(),y=ee(f._a))):8===d?me._unload(f.id,Ge):me._unload(f.id),t()),f},this.destruct=function(e){f.isHTML5?(s(),f._a&&(f._a.pause(),ee(f._a),Le||n(),f._a._s=null,f._a=null)):(f._iO.onfailure=null,me._destroySound(f.id)),e||pe.destroySound(f.id,!0)},this.play=function(e,t){var i,n,s,l,u,g,v=!0,y=null;if(t=t===r?!0:t,e||(e={}),f.url&&(f._iO.url=f.url),f._iO=p(f._iO,f.options),f._iO=p(e,f._iO),f._iO.url=K(f._iO.url),f.instanceOptions=f._iO,!f.isHTML5&&f._iO.serverURL&&!f.connected)return f.getAutoPlay()||f.setAutoPlay(!0),
f;if(X(f._iO)&&(f._setup_html5(f._iO),a()),1!==f.playState||f.paused||(i=f._iO.multiShot,i||(f.isHTML5&&f.setPosition(f._iO.position),y=f)),null!==y)return y;if(e.url&&e.url!==f.url&&(f.readyState||f.isHTML5||8!==d||!h?f.load(f._iO):h=!1),f.loaded||(0===f.readyState?(f.isHTML5||pe.html5Only?f.isHTML5?f.load(f._iO):y=f:(f._iO.autoPlay=!0,f.load(f._iO)),f.instanceOptions=f._iO):2===f.readyState&&(y=f)),null!==y)return y;if(!f.isHTML5&&9===d&&f.position>0&&f.position===f.duration&&(e.position=0),f.paused&&f.position>=0&&(!f._iO.serverURL||f.position>0))f.resume();else{
if(f._iO=p(e,f._iO),(!f.isHTML5&&null!==f._iO.position&&f._iO.position>0||null!==f._iO.from&&f._iO.from>0||null!==f._iO.to)&&0===f.instanceCount&&0===f.playState&&!f._iO.serverURL){if(s=function(){f._iO=p(e,f._iO),f.play(f._iO)},f.isHTML5&&!f._html5_canplay?(f.load({_oncanplay:s}),y=!1):f.isHTML5||f.loaded||f.readyState&&2===f.readyState||(f.load({onload:s}),y=!1),null!==y)return y;f._iO=c()}(!f.instanceCount||f._iO.multiShotEvents||f.isHTML5&&f._iO.multiShot&&!Le||!f.isHTML5&&d>8&&!f.getAutoPlay())&&f.instanceCount++,
f._iO.onposition&&0===f.playState&&o(f),f.playState=1,f.paused=!1,f.position=f._iO.position===r||isNaN(f._iO.position)?0:f._iO.position,f.isHTML5||(f._iO=V(j(f._iO))),f._iO.onplay&&t&&(f._iO.onplay.apply(f),m=!0),f.setVolume(f._iO.volume,!0),f.setPan(f._iO.pan,!0),f.isHTML5?f.instanceCount<2?(a(),n=f._setup_html5(),f.setPosition(f._iO.position),n.play()):(l=new Audio(f._iO.url),u=function(){ne.remove(l,"ended",u),f._onfinish(f),ee(l),l=null},g=function(){ne.remove(l,"canplay",g);try{l.currentTime=f._iO.position/Fe;
}catch(e){}l.play()},ne.add(l,"ended",u),f._iO.volume!==r&&(l.volume=Math.max(0,Math.min(1,f._iO.volume/100))),f.muted&&(l.muted=!0),f._iO.position?ne.add(l,"canplay",g):l.play()):(v=me._start(f.id,f._iO.loops||1,9===d?f.position:f.position/Fe,f._iO.multiShot||!1),9!==d||v||f._iO.onplayerror&&f._iO.onplayerror.apply(f))}return f},this.start=this.play,this.stop=function(e){var t,i=f._iO;return 1===f.playState&&(f._onbufferchange(0),f._resetOnPosition(0),f.paused=!1,f.isHTML5||(f.playState=0),l(),i.to&&f.clearOnPosition(i.to),
f.isHTML5?f._a&&(t=f.position,f.setPosition(0),f.position=t,f._a.pause(),f.playState=0,f._onTimer(),s()):(me._stop(f.id,e),i.serverURL&&f.unload()),f.instanceCount=0,f._iO={},i.onstop&&i.onstop.apply(f)),f},this.setAutoPlay=function(e){f._iO.autoPlay=e,f.isHTML5||(me._setAutoPlay(f.id,e),e&&(f.instanceCount||1!==f.readyState||f.instanceCount++))},this.getAutoPlay=function(){return f._iO.autoPlay},this.setPosition=function(e){e===r&&(e=0);var t,i,n=f.isHTML5?Math.max(e,0):Math.min(f.duration||f._iO.duration,Math.max(e,0));
if(f.position=n,i=f.position/Fe,f._resetOnPosition(f.position),f._iO.position=n,f.isHTML5){if(f._a){if(f._html5_canplay){if(f._a.currentTime!==i)try{f._a.currentTime=i,(0===f.playState||f.paused)&&f._a.pause()}catch(s){}}else if(i)return f;f.paused&&f._onTimer(!0)}}else t=9===d?f.position:i,f.readyState&&2!==f.readyState&&me._setPosition(f.id,t,f.paused||!f.playState,f._iO.multiShot);return f},this.pause=function(e){return f.paused||0===f.playState&&1!==f.readyState?f:(f.paused=!0,f.isHTML5?(f._setup_html5().pause(),
s()):(e||e===r)&&me._pause(f.id,f._iO.multiShot),f._iO.onpause&&f._iO.onpause.apply(f),f)},this.resume=function(){var e=f._iO;return f.paused?(f.paused=!1,f.playState=1,f.isHTML5?(f._setup_html5().play(),a()):(e.isMovieStar&&!e.serverURL&&f.setPosition(f.position),me._pause(f.id,e.multiShot)),!m&&e.onplay?(e.onplay.apply(f),m=!0):e.onresume&&e.onresume.apply(f),f):f},this.togglePause=function(){return 0===f.playState?(f.play({position:9!==d||f.isHTML5?f.position/Fe:f.position}),f):(f.paused?f.resume():f.pause(),
f)},this.setPan=function(e,t){return e===r&&(e=0),t===r&&(t=!1),f.isHTML5||me._setPan(f.id,e),f._iO.pan=e,t||(f.pan=e,f.options.pan=e),f},this.setVolume=function(e,t){return e===r&&(e=100),t===r&&(t=!1),f.isHTML5?f._a&&(pe.muted&&!f.muted&&(f.muted=!0,f._a.muted=!0),f._a.volume=Math.max(0,Math.min(1,e/100))):me._setVolume(f.id,pe.muted&&!f.muted||f.muted?0:e),f._iO.volume=e,t||(f.volume=e,f.options.volume=e),f},this.mute=function(){return f.muted=!0,f.isHTML5?f._a&&(f._a.muted=!0):me._setVolume(f.id,0),
f},this.unmute=function(){f.muted=!1;var e=f._iO.volume!==r;return f.isHTML5?f._a&&(f._a.muted=!1):me._setVolume(f.id,e?f._iO.volume:f.options.volume),f},this.toggleMute=function(){return f.muted?f.unmute():f.mute()},this.onPosition=function(e,t,i){return g.push({position:parseInt(e,10),method:t,scope:i!==r?i:f,fired:!1}),f},this.onposition=this.onPosition,this.clearOnPosition=function(e,t){var i;if(e=parseInt(e,10),isNaN(e))return!1;for(i=0;i<g.length;i++)e===g[i].position&&(t&&t!==g[i].method||(g[i].fired&&v--,
g.splice(i,1)))},this._processOnPosition=function(){var e,t,i=g.length;if(!i||!f.playState||v>=i)return!1;for(e=i-1;e>=0;e--)t=g[e],!t.fired&&f.position>=t.position&&(t.fired=!0,v++,t.method.apply(t.scope,[t.position]),i=g.length);return!0},this._resetOnPosition=function(e){var t,i,n=g.length;if(!n)return!1;for(t=n-1;t>=0;t--)i=g[t],i.fired&&e<=i.position&&(i.fired=!1,v--);return!0},c=function(){var e,t,i=f._iO,n=i.from,s=i.to;return t=function(){f.clearOnPosition(s,t),f.stop()},e=function(){null===s||isNaN(s)||f.onPosition(s,t);
},null===n||isNaN(n)||(i.position=n,i.multiShot=!1,e()),i},o=function(){var e,t=f._iO.onposition;if(t)for(e in t)t.hasOwnProperty(e)&&f.onPosition(parseInt(e,10),t[e])},l=function(){var e,t=f._iO.onposition;if(t)for(e in t)t.hasOwnProperty(e)&&f.clearOnPosition(parseInt(e,10))},a=function(){f.isHTML5&&$(f)},s=function(){f.isHTML5&&Q(f)},t=function(e){e||(g=[],v=0),m=!1,f._hasTimer=null,f._a=null,f._html5_canplay=!1,f.bytesLoaded=null,f.bytesTotal=null,f.duration=f._iO&&f._iO.duration?f._iO.duration:null,
f.durationEstimate=null,f.buffered=[],f.eqData=[],f.eqData.left=[],f.eqData.right=[],f.failures=0,f.isBuffering=!1,f.instanceOptions={},f.instanceCount=0,f.loaded=!1,f.metadata={},f.readyState=0,f.muted=!1,f.paused=!1,f.peakData={left:0,right:0},f.waveformData={left:[],right:[]},f.playState=0,f.position=null,f.id3={}},t(),this._onTimer=function(e){var t,i,n=!1,s={};return f._hasTimer||e?(f._a&&(e||(f.playState>0||1===f.readyState)&&!f.paused)&&(t=f._get_html5_duration(),t!==u.duration&&(u.duration=t,
f.duration=t,n=!0),f.durationEstimate=f.duration,i=f._a.currentTime*Fe||0,i!==u.time&&(u.time=i,n=!0),(n||e)&&f._whileplaying(i,s,s,s,s)),n):void 0},this._get_html5_duration=function(){var e=f._iO,t=f._a&&f._a.duration?f._a.duration*Fe:e&&e.duration?e.duration:null,i=t&&!isNaN(t)&&t!==1/0?t:null;return i},this._apply_loop=function(e,t){e.loop=t>1?"loop":""},this._setup_html5=function(e){var n,s=p(f._iO,e),a=Le?fe:f._a,r=decodeURI(s.url);if(Le?r===decodeURI(se)&&(n=!0):r===decodeURI(y)&&(n=!0),a){
if(a._s)if(Le)a._s&&a._s.playState&&!n&&a._s.stop();else if(!Le&&r===decodeURI(y))return f._apply_loop(a,s.loops),a;n||(y&&t(!1),a.src=s.url,f.url=s.url,y=s.url,se=s.url,a._called_load=!1)}else s.autoLoad||s.autoPlay?(f._a=new Audio(s.url),f._a.load()):f._a=He&&opera.version()<10?new Audio(null):new Audio,a=f._a,a._called_load=!1,Le&&(fe=a);return f.isHTML5=!0,f._a=a,a._s=f,i(),f._apply_loop(a,s.loops),s.autoLoad||s.autoPlay?f.load():(a.autobuffer=!1,a.preload="auto"),a},i=function(){function e(e,t,i){
return f._a?f._a.addEventListener(e,t,i||!1):null}if(f._a._added_events)return!1;var t;f._a._added_events=!0;for(t in le)le.hasOwnProperty(t)&&e(t,le[t]);return!0},n=function(){function e(e,t,i){return f._a?f._a.removeEventListener(e,t,i||!1):null}var t;f._a._added_events=!1;for(t in le)le.hasOwnProperty(t)&&e(t,le[t])},this._onload=function(e){var t=!!e||!f.isHTML5&&8===d&&f.duration;return f.loaded=t,f.readyState=t?3:2,f._onbufferchange(0),f._iO.onload&&de(f,function(){f._iO.onload.apply(f,[t]);
}),!0},this._onbufferchange=function(e){return 0===f.playState?!1:e&&f.isBuffering||!e&&!f.isBuffering?!1:(f.isBuffering=1===e,f._iO.onbufferchange&&f._iO.onbufferchange.apply(f,[e]),!0)},this._onsuspend=function(){return f._iO.onsuspend&&f._iO.onsuspend.apply(f),!0},this._onfailure=function(e,t,i){f.failures++,f._iO.onfailure&&1===f.failures&&f._iO.onfailure(e,t,i)},this._onwarning=function(e,t,i){f._iO.onwarning&&f._iO.onwarning(e,t,i)},this._onfinish=function(){var e=f._iO.onfinish;f._onbufferchange(0),
f._resetOnPosition(0),f.instanceCount&&(f.instanceCount--,f.instanceCount||(l(),f.playState=0,f.paused=!1,f.instanceCount=0,f.instanceOptions={},f._iO={},s(),f.isHTML5&&(f.position=0)),(!f.instanceCount||f._iO.multiShotEvents)&&e&&de(f,function(){e.apply(f)}))},this._whileloading=function(e,t,i,n){var s=f._iO;f.bytesLoaded=e,f.bytesTotal=t,f.duration=Math.floor(i),f.bufferLength=n,f.isHTML5||s.isMovieStar?f.durationEstimate=f.duration:s.duration?f.durationEstimate=f.duration>s.duration?f.duration:s.duration:f.durationEstimate=parseInt(f.bytesTotal/f.bytesLoaded*f.duration,10),
f.isHTML5||(f.buffered=[{start:0,end:f.duration}]),(3!==f.readyState||f.isHTML5)&&s.whileloading&&s.whileloading.apply(f)},this._whileplaying=function(e,t,i,n,s){var a,o=f._iO;return isNaN(e)||null===e?!1:(f.position=Math.max(0,e),f._processOnPosition(),!f.isHTML5&&d>8&&(o.usePeakData&&t!==r&&t&&(f.peakData={left:t.leftPeak,right:t.rightPeak}),o.useWaveformData&&i!==r&&i&&(f.waveformData={left:i.split(","),right:n.split(",")}),o.useEQData&&s!==r&&s&&s.leftEQ&&(a=s.leftEQ.split(","),f.eqData=a,f.eqData.left=a,
s.rightEQ!==r&&s.rightEQ&&(f.eqData.right=s.rightEQ.split(",")))),1===f.playState&&(f.isHTML5||8!==d||f.position||!f.isBuffering||f._onbufferchange(0),o.whileplaying&&o.whileplaying.apply(f)),!0)},this._oncaptiondata=function(e){f.captiondata=e,f._iO.oncaptiondata&&f._iO.oncaptiondata.apply(f,[e])},this._onmetadata=function(e,t){var i,n,s={};for(i=0,n=e.length;n>i;i++)s[e[i]]=t[i];f.metadata=s,f._iO.onmetadata&&f._iO.onmetadata.call(f,f.metadata)},this._onid3=function(e,t){var i,n,s=[];for(i=0,n=e.length;n>i;i++)s[e[i]]=t[i];
f.id3=p(f.id3,s),f._iO.onid3&&f._iO.onid3.apply(f)},this._onconnect=function(e){e=1===e,f.connected=e,e&&(f.failures=0,W(f.id)&&(f.getAutoPlay()?f.play(r,f.getAutoPlay()):f._iO.autoLoad&&f.load()),f._iO.onconnect&&f._iO.onconnect.apply(f,[e]))},this._ondataerror=function(e){f.playState>0&&f._iO.ondataerror&&f._iO.ondataerror.apply(f)}},T=function(){return ye.body||ye.getElementsByTagName("div")[0]},o=function(e){return ye.getElementById(e)},p=function(e,t){var i,n,s=e||{};i=t===r?pe.defaultOptions:t;
for(n in i)i.hasOwnProperty(n)&&s[n]===r&&("object"!=typeof i[n]||null===i[n]?s[n]=i[n]:s[n]=p(s[n],i[n]));return s},de=function(e,t){e.isHTML5||8!==d?t():a.setTimeout(t,0)},m={onready:1,ontimeout:1,defaultOptions:1,flash9Options:1,movieStarOptions:1},f=function(e,t){var i,n=!0,s=t!==r,a=pe.setupOptions,o=m;for(i in e)if(e.hasOwnProperty(i))if("object"!=typeof e[i]||null===e[i]||e[i]instanceof Array||e[i]instanceof RegExp)s&&o[t]!==r?pe[t][i]=e[i]:a[i]!==r?(pe.setupOptions[i]=e[i],pe[i]=e[i]):o[i]===r?n=!1:pe[i]instanceof Function?pe[i].apply(pe,e[i]instanceof Array?e[i]:[e[i]]):pe[i]=e[i];else{
if(o[i]!==r)return f(e[i],i);n=!1}return n},ne=function(){function e(e){var t=Oe.call(e),i=t.length;return s?(t[1]="on"+t[1],i>3&&t.pop()):3===i&&t.push(!1),t}function t(e,t){var i=e.shift(),n=[r[t]];s?i[n](e[0],e[1]):i[n].apply(i,e)}function i(){t(e(arguments),"add")}function n(){t(e(arguments),"remove")}var s=a.attachEvent,r={add:s?"attachEvent":"addEventListener",remove:s?"detachEvent":"removeEventListener"};return{add:i,remove:n}}(),le={abort:n(function(){}),canplay:n(function(){var e,t=this._s;
if(t._html5_canplay)return!0;if(t._html5_canplay=!0,t._onbufferchange(0),e=t._iO.position===r||isNaN(t._iO.position)?null:t._iO.position/Fe,this.currentTime!==e)try{this.currentTime=e}catch(i){}t._iO._oncanplay&&t._iO._oncanplay()}),canplaythrough:n(function(){var e=this._s;e.loaded||(e._onbufferchange(0),e._whileloading(e.bytesLoaded,e.bytesTotal,e._get_html5_duration()),e._onload(!0))}),durationchange:n(function(){var e,t=this._s;e=t._get_html5_duration(),isNaN(e)||e===t.duration||(t.durationEstimate=t.duration=e);
}),ended:n(function(){var e=this._s;e._onfinish()}),error:n(function(){this._s._onload(!1)}),loadeddata:n(function(){var e=this._s;e._loaded||Ve||(e.duration=e._get_html5_duration())}),loadedmetadata:n(function(){}),loadstart:n(function(){this._s._onbufferchange(1)}),play:n(function(){this._s._onbufferchange(0)}),playing:n(function(){this._s._onbufferchange(0)}),progress:n(function(e){var t,i,n=this._s,s=0,a=("progress"===e.type,e.target.buffered),r=e.loaded||0,o=e.total||1;if(n.buffered=[],a&&a.length){
for(t=0,i=a.length;i>t;t++)n.buffered.push({start:a.start(t)*Fe,end:a.end(t)*Fe});s=(a.end(0)-a.start(0))*Fe,r=Math.min(1,s/(e.target.duration*Fe))}isNaN(r)||(n._whileloading(r,o,n._get_html5_duration()),r&&o&&r===o&&le.canplaythrough.call(this,e))}),ratechange:n(function(){}),suspend:n(function(e){var t=this._s;le.progress.call(this,e),t._onsuspend()}),stalled:n(function(){}),timeupdate:n(function(){this._s._onTimer()}),waiting:n(function(){var e=this._s;e._onbufferchange(1)})},X=function(e){var t;
return t=e&&(e.type||e.url||e.serverURL)?e.serverURL||e.type&&i(e.type)?!1:e.type?J({type:e.type}):J({url:e.url})||pe.html5Only||e.url.match(/data\:/i):!1},ee=function(e){var t;return e&&(t=Ve?Ge:pe.html5.canPlayType("audio/wav")?Xe:Ge,e.src=t,e._called_unload!==r&&(e._called_load=!1)),Le&&(se=null),t},J=function(e){if(!pe.useHTML5Audio||!pe.hasHTML5)return!1;var t,n,s,a,o=e.url||null,l=e.type||null,c=pe.audioFormats;if(l&&pe.html5[l]!==r)return pe.html5[l]&&!i(l);if(!Z){Z=[];for(a in c)c.hasOwnProperty(a)&&(Z.push(a),
c[a].related&&(Z=Z.concat(c[a].related)));Z=new RegExp("\\.("+Z.join("|")+")(\\?.*)?$","i")}return s=o?o.toLowerCase().match(Z):null,s&&s.length?s=s[1]:l?(n=l.indexOf(";"),s=(-1!==n?l.substr(0,n):l).substr(6)):t=!1,s&&pe.html5[s]!==r?t=pe.html5[s]&&!i(s):(l="audio/"+s,t=pe.html5.canPlayType({type:l}),pe.html5[s]=t,t=t&&pe.html5[l]&&!i(l)),t},ie=function(){function e(e){var t,i,n=!1,r=!1;if(!a||"function"!=typeof a.canPlayType)return n;if(e instanceof Array){for(s=0,i=e.length;i>s;s++)(pe.html5[e[s]]||a.canPlayType(e[s]).match(pe.html5Test))&&(r=!0,
pe.html5[e[s]]=!0,pe.flash[e[s]]=!!e[s].match(Ye));n=r}else t=a&&"function"==typeof a.canPlayType?a.canPlayType(e):!1,n=!(!t||!t.match(pe.html5Test));return n}if(!pe.useHTML5Audio||!pe.hasHTML5)return pe.html5.usingFlash=!0,Re=!0,!1;var t,i,n,s,a=Audio!==r?He&&opera.version()<10?new Audio(null):new Audio:null,o={};n=pe.audioFormats;for(t in n)if(n.hasOwnProperty(t)&&(i="audio/"+t,o[t]=e(n[t].type),o[i]=o[t],t.match(Ye)?(pe.flash[t]=!0,pe.flash[i]=!0):(pe.flash[t]=!1,pe.flash[i]=!1),n[t]&&n[t].related))for(s=n[t].related.length-1;s>=0;s--)o["audio/"+n[t].related[s]]=o[t],
pe.html5[n[t].related[s]]=o[t],pe.flash[n[t].related[s]]=o[t];return o.canPlayType=a?e:null,pe.html5=p(pe.html5,o),pe.html5.usingFlash=G(),Re=pe.html5.usingFlash,!0},k={},F=function(){},j=function(e){return 8===d&&e.loops>1&&e.stream&&(e.stream=!1),e},V=function(e,t){return e&&!e.usePolicyFile&&(e.onid3||e.usePeakData||e.useWaveformData||e.useEQData)&&(e.usePolicyFile=!0),e},H=function(e){},l=function(){return!1},O=function(e){var t;for(t in e)e.hasOwnProperty(t)&&"function"==typeof e[t]&&(e[t]=l);
t=null},L=function(e){e===r&&(e=!1),(Ce||e)&&pe.disable(e)},N=function(e){var t,i=null;if(e)if(e.match(/\.swf(\?.*)?$/i)){if(i=e.substr(e.toLowerCase().lastIndexOf(".swf?")+4))return e}else e.lastIndexOf("/")!==e.length-1&&(e+="/");return t=(e&&-1!==e.lastIndexOf("/")?e.substr(0,e.lastIndexOf("/")+1):"./")+pe.movieURL,pe.noSWFCache&&(t+="?ts="+(new Date).getTime()),t},S=function(){d=parseInt(pe.flashVersion,10),8!==d&&9!==d&&(pe.flashVersion=d=Pe);var e=pe.debugMode||pe.debugFlash?"_debug.swf":".swf";
pe.useHTML5Audio&&!pe.html5Only&&pe.audioFormats.mp4.required&&9>d&&(pe.flashVersion=d=9),pe.version=pe.versionNumber+(pe.html5Only?" (HTML5-only mode)":9===d?" (AS3/Flash 9)":" (AS2/Flash 8)"),d>8?(pe.defaultOptions=p(pe.defaultOptions,pe.flash9Options),pe.features.buffering=!0,pe.defaultOptions=p(pe.defaultOptions,pe.movieStarOptions),pe.filePatterns.flash9=new RegExp("\\.(mp3|"+tt.join("|")+")(\\?.*)?$","i"),pe.features.movieStar=!0):pe.features.movieStar=!1,pe.filePattern=pe.filePatterns[8!==d?"flash9":"flash8"],
pe.movieURL=(8===d?"soundmanager2.swf":"soundmanager2_flash9.swf").replace(".swf",e),pe.features.peakData=pe.features.waveformData=pe.features.eqData=d>8},M=function(e,t){return me?void me._setPolling(e,t):!1},R=function(){},W=this.getSoundById,z=function(){var e=[];return pe.debugMode&&e.push(B.sm2Debug),pe.debugFlash&&e.push(B.flashDebug),pe.useHighPerformance&&e.push(B.highPerf),e.join(" ")},U=function(){var e=(F("fbHandler"),pe.getMoviePercent()),t=B,i={type:"FLASHBLOCK"};return pe.html5Only?!1:void(pe.ok()?pe.oMC&&(pe.oMC.className=[z(),t.swfDefault,t.swfLoaded+(pe.didFlashBlock?" "+t.swfUnblocked:"")].join(" ")):(Re&&(pe.oMC.className=z()+" "+t.swfDefault+" "+(null===e?t.swfTimedout:t.swfError)),
pe.didFlashBlock=!0,v({type:"ontimeout",ignoreInit:!0,error:i}),E(i)))},g=function(e,t,i){be[e]===r&&(be[e]=[]),be[e].push({method:t,scope:i||null,fired:!1})},v=function(e){if(e||(e={type:pe.ok()?"onready":"ontimeout"}),!Se&&e&&!e.ignoreInit)return!1;if("ontimeout"===e.type&&(pe.ok()||Ce&&!e.ignoreInit))return!1;var t,i,n={success:e&&e.ignoreInit?pe.ok():!Ce},s=e&&e.type?be[e.type]||[]:[],a=[],r=[n],o=Re&&!pe.ok();for(e.error&&(r[0].error=e.error),t=0,i=s.length;i>t;t++)s[t].fired!==!0&&a.push(s[t]);
if(a.length)for(t=0,i=a.length;i>t;t++)a[t].scope?a[t].method.apply(a[t].scope,r):a[t].method.apply(this,r),o||(a[t].fired=!0);return!0},y=function(){a.setTimeout(function(){pe.useFlashBlock&&U(),v(),"function"==typeof pe.onload&&pe.onload.apply(a),pe.waitForWindowLoad&&ne.add(a,"load",y)},1)},re=function(){if(ae!==r)return ae;var e,t,i,n=!1,s=navigator,o=s.plugins,l=a.ActiveXObject;if(o&&o.length)t="application/x-shockwave-flash",i=s.mimeTypes,i&&i[t]&&i[t].enabledPlugin&&i[t].enabledPlugin.description&&(n=!0);else if(l!==r&&!ge.match(/MSAppHost/i)){
try{e=new l("ShockwaveFlash.ShockwaveFlash")}catch(c){e=null}n=!!e,e=null}return ae=n,n},G=function(){var e,t,i=pe.audioFormats,n=Ue&&!!ge.match(/os (1|2|3_0|3_1)\s/i);if(n?(pe.hasHTML5=!1,pe.html5Only=!0,pe.oMC&&(pe.oMC.style.display="none")):pe.useHTML5Audio&&(pe.html5&&pe.html5.canPlayType||(pe.hasHTML5=!1)),pe.useHTML5Audio&&pe.hasHTML5){Y=!0;for(t in i)i.hasOwnProperty(t)&&i[t].required&&(pe.html5.canPlayType(i[t].type)?pe.preferFlash&&(pe.flash[t]||pe.flash[i[t].type])&&(e=!0):(Y=!1,e=!0))}
return pe.ignoreFlash&&(e=!1,Y=!0),pe.html5Only=pe.hasHTML5&&pe.useHTML5Audio&&!e,!pe.html5Only},K=function(e){var t,i,n,s=0;if(e instanceof Array){for(t=0,i=e.length;i>t;t++)if(e[t]instanceof Object){if(pe.canPlayMIME(e[t].type)){s=t;break}}else if(pe.canPlayURL(e[t])){s=t;break}e[s].url&&(e[s]=e[s].url),n=e[s]}else n=e;return n},$=function(e){e._hasTimer||(e._hasTimer=!0,!We&&pe.html5PollingInterval&&(null===Ee&&0===De&&(Ee=setInterval(q,pe.html5PollingInterval)),De++))},Q=function(e){e._hasTimer&&(e._hasTimer=!1,
!We&&pe.html5PollingInterval&&De--)},q=function(){var e;if(null!==Ee&&!De)return clearInterval(Ee),Ee=null,!1;for(e=pe.soundIDs.length-1;e>=0;e--)pe.sounds[pe.soundIDs[e]].isHTML5&&pe.sounds[pe.soundIDs[e]]._hasTimer&&pe.sounds[pe.soundIDs[e]]._onTimer()},E=function(e){e=e!==r?e:{},"function"==typeof pe.onerror&&pe.onerror.apply(a,[{type:e.type!==r?e.type:null}]),e.fatal!==r&&e.fatal&&pe.disable()},oe=function(){if(!$e||!re())return!1;var e,t,i=pe.audioFormats;for(t in i)if(i.hasOwnProperty(t)&&("mp3"===t||"mp4"===t)&&(pe.html5[t]=!1,
i[t]&&i[t].related))for(e=i[t].related.length-1;e>=0;e--)pe.html5[i[t].related[e]]=!1},this._setSandboxType=function(e){},this._externalInterfaceOK=function(e){if(pe.swfLoaded)return!1;pe.swfLoaded=!0,qe=!1,$e&&oe(),setTimeout(u,Be?100:1)},D=function(e,t){function i(){}function n(e,t){return'<param name="'+e+'" value="'+t+'" />'}if(we&&xe)return!1;if(pe.html5Only)return S(),i(),pe.oMC=o(pe.movieID),u(),we=!0,xe=!0,!1;var s,a,l,c,d,h,p,f,m=t||pe.url,g=pe.altURL||m,v="JS/Flash audio component (SoundManager 2)",y=T(),b=z(),w=null,x=ye.getElementsByTagName("html")[0];
if(w=x&&x.dir&&x.dir.match(/rtl/i),e=e===r?pe.id:e,S(),pe.url=N(Je?m:g),t=pe.url,pe.wmode=!pe.wmode&&pe.useHighPerformance?"transparent":pe.wmode,null!==pe.wmode&&(ge.match(/msie 8/i)||!Be&&!pe.useHighPerformance)&&navigator.platform.match(/win32|win64/i)&&(Me.push(k.spcWmode),pe.wmode=null),s={name:e,id:e,src:t,quality:"high",allowScriptAccess:pe.allowScriptAccess,bgcolor:pe.bgColor,pluginspage:Ze+"www.macromedia.com/go/getflashplayer",title:v,type:"application/x-shockwave-flash",wmode:pe.wmode,
hasPriority:"true"},pe.debugFlash&&(s.FlashVars="debug=1"),pe.wmode||delete s.wmode,Be)a=ye.createElement("div"),c=['<object id="'+e+'" data="'+t+'" type="'+s.type+'" title="'+s.title+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">',n("movie",t),n("AllowScriptAccess",pe.allowScriptAccess),n("quality",s.quality),pe.wmode?n("wmode",pe.wmode):"",n("bgcolor",pe.bgColor),n("hasPriority","true"),pe.debugFlash?n("FlashVars",s.FlashVars):"","</object>"].join("");else{
a=ye.createElement("embed");for(l in s)s.hasOwnProperty(l)&&a.setAttribute(l,s[l])}if(R(),b=z(),y=T())if(pe.oMC=o(pe.movieID)||ye.createElement("div"),pe.oMC.id)f=pe.oMC.className,pe.oMC.className=(f?f+" ":B.swfDefault)+(b?" "+b:""),pe.oMC.appendChild(a),Be&&(d=pe.oMC.appendChild(ye.createElement("div")),d.className=B.swfBox,d.innerHTML=c),xe=!0;else{if(pe.oMC.id=pe.movieID,pe.oMC.className=B.swfDefault+" "+b,h=null,d=null,pe.useFlashBlock||(pe.useHighPerformance?h={position:"fixed",width:"8px",height:"8px",
bottom:"0px",left:"0px",overflow:"hidden"}:(h={position:"absolute",width:"6px",height:"6px",top:"-9999px",left:"-9999px"},w&&(h.left=Math.abs(parseInt(h.left,10))+"px"))),je&&(pe.oMC.style.zIndex=1e4),!pe.debugFlash)for(p in h)h.hasOwnProperty(p)&&(pe.oMC.style[p]=h[p]);try{Be||pe.oMC.appendChild(a),y.appendChild(pe.oMC),Be&&(d=pe.oMC.appendChild(ye.createElement("div")),d.className=B.swfBox,d.innerHTML=c),xe=!0}catch(C){throw new Error(F("domError")+" \n"+C.toString())}}return we=!0,i(),!0},P=function(){
return pe.html5Only?(D(),!1):me?!1:pe.url?(me=pe.getMovie(pe.id),me||(Ae?(Be?pe.oMC.innerHTML=Ie:pe.oMC.appendChild(Ae),Ae=null,we=!0):D(pe.id,pe.url),me=pe.getMovie(pe.id)),"function"==typeof pe.oninitmovie&&setTimeout(pe.oninitmovie,1),!0):!1},b=function(){setTimeout(w,1e3)},x=function(){a.setTimeout(function(){pe.setup({preferFlash:!1}).reboot(),pe.didFlashBlock=!0,pe.beginDelayedInit()},1)},w=function(){var e,t=!1;return pe.url?_e?!1:(_e=!0,ne.remove(a,"load",b),ae&&qe&&!Qe?!1:(Se||(e=pe.getMoviePercent(),
e>0&&100>e&&(t=!0)),void setTimeout(function(){return e=pe.getMoviePercent(),t?(_e=!1,a.setTimeout(b,1),!1):void(!Se&&Ke&&(null===e?pe.useFlashBlock||0===pe.flashLoadTimeout?pe.useFlashBlock&&U():!pe.useFlashBlock&&Y?x():v({type:"ontimeout",ignoreInit:!0,error:{type:"INIT_FLASHBLOCK"}}):0===pe.flashLoadTimeout||(!pe.useFlashBlock&&Y?x():L(!0))))},pe.flashLoadTimeout))):!1},C=function(){function e(){ne.remove(a,"focus",C)}return Qe||!qe?(e(),!0):(Ke=!0,Qe=!0,_e=!1,b(),e(),!0)},ue=function(){},ce=function(){},
h=function(e){if(Se)return!1;if(pe.html5Only)return Se=!0,y(),!0;var t,i=pe.useFlashBlock&&pe.flashLoadTimeout&&!pe.getMoviePercent(),n=!0;return i||(Se=!0),t={type:!ae&&Re?"NO_FLASH":"INIT_TIMEOUT"},(Ce||e)&&(pe.useFlashBlock&&pe.oMC&&(pe.oMC.className=z()+" "+(null===pe.getMoviePercent()?B.swfTimedout:B.swfError)),v({type:"ontimeout",error:t,ignoreInit:!0}),E(t),n=!1),Ce||(pe.waitForWindowLoad&&!ke?ne.add(a,"load",y):y()),n},c=function(){var e,t=pe.setupOptions;for(e in t)t.hasOwnProperty(e)&&(pe[e]===r?pe[e]=t[e]:pe[e]!==t[e]&&(pe.setupOptions[e]=pe[e]));
},u=function(){function e(){ne.remove(a,"load",pe.beginDelayedInit)}if(Se)return!1;if(pe.html5Only)return Se||(e(),pe.enabled=!0,h()),!0;P();try{me._externalInterfaceTest(!1),M(!0,pe.flashPollingInterval||(pe.useHighPerformance?10:50)),pe.debugMode||me._disableDebug(),pe.enabled=!0,pe.html5Only||ne.add(a,"unload",l)}catch(t){return E({type:"JS_TO_FLASH_EXCEPTION",fatal:!0}),L(!0),h(),!1}return h(),e(),!0},A=function(){return _?!1:(_=!0,c(),R(),!ae&&pe.hasHTML5&&pe.setup({useHTML5Audio:!0,preferFlash:!1
}),ie(),!ae&&Re&&(Me.push(k.needFlash),pe.setup({flashLoadTimeout:1})),ye.removeEventListener&&ye.removeEventListener("DOMContentLoaded",A,!1),P(),!0)},te=function(){return"complete"===ye.readyState&&(A(),ye.detachEvent("onreadystatechange",te)),!0},I=function(){ke=!0,A(),ne.remove(a,"load",I)},re(),ne.add(a,"focus",C),ne.add(a,"load",b),ne.add(a,"load",I),ye.addEventListener?ye.addEventListener("DOMContentLoaded",A,!1):ye.attachEvent?ye.attachEvent("onreadystatechange",te):E({type:"NO_DOM2_EVENTS",
fatal:!0})}if(!a||!a.document)throw new Error("SoundManager requires a browser with window and document objects.");var l=null;a.SM2_DEFER!==r&&s||(l=new o),"object"==typeof e&&e&&"object"==typeof e.exports?(e.exports.SoundManager=o,e.exports.soundManager=l):(n=function(){function e(e){if(!a.soundManager&&e instanceof Function){var t=e(o);t instanceof o&&(a.soundManager=t)}return a.soundManager}return{constructor:o,getInstance:e}}.call(t,i,t,e),!(void 0!==n&&(e.exports=n))),a.SoundManager=o,a.soundManager=l;
}(window)}).call(t,i(368)(e))},function(e,t,i){var n,s;n=[i(991),i(20)],s=function(e,t){"use strict";var i=t.extend({constructor:function(t,i){this.ga=this.createGaQueue(),e("create",t,"auto"),e("set",{appName:i.name,appVersion:i.version})},createGaQueue:function(){var t=function i(){i.queue.push(arguments)};return t.queue=[],t.run=function(){for(;t.queue.length;)e.apply(window,t.queue.shift())},t},enable:function(){this.ga.run&&this.ga.run(),this.ga=e},disable:function(){this.ga=function(){}},set:function(t){
e("set",t)},trackView:function(e){this.ga("send",{hitType:"appview",description:e})},trackEvent:function(e){this.ga("send","event",e)}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(20),i(16)],s=function(e,t){"use strict";var i=e.extend({enable:function(){t("Analytics enabled")},disable:function(){t("Analytics disabled")},set:function(e){t("Analytics set options:",e)},trackView:function(e){t('Analytics tracked view "%s"',e)},trackEvent:function(e){t("Analytics tracked event:",e);
}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(16)],s=function(e){"use strict";var t={init:function(){e("Error tracker initialized")},enable:function(){e("Error tracker enabled")},disable:function(){e("Error tracker disabled")},set:function(t){e("Error tracker set options:",t)},capture:function(t,i){e.error(t),e("Tracked error:",i)}};return t}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(16)],s=function(e,t){"use strict";var i={defaults:{},
enable:function(){t("Metrics enabled")},disable:function(){t("Metrics disabled")},set:function(i){e.extend(this.defaults,i),t("Metrics default options now:",this.defaults)},trackEvent:function(i,n,s){s||(s={});var a=e.defaults({category:i,action:n},s,this.defaults);t("Metrics tracked event:",a)}};return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4)],s=function(e,t){"use strict";var i={defaults:{},enabled:!0,url:"https://metrics.plex.tv/collect/event",enable:function(){
this.enabled=!0},disable:function(){this.enabled=!1},set:function(t){e.extend(this.defaults,t)},trackEvent:function(i,n,s){if(this.enabled){s||(s={});var a=e.defaults({category:i,action:n},s,this.defaults);t.ajax({type:"POST",url:this.url,contentType:"application/json",data:JSON.stringify(a)})}}};return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(303)],s=function(e){"use strict";var t={},i={init:function(t,i){e.config(t).install(),this.set("version",i)},enable:function(){
e.install()},disable:function(){e.uninstall()},set:function(i,n){t[i]=n,e.setTagsContext(t)},capture:function(t,i){e.captureException(t,i)}};return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(992),a=n(s),r=i(20),o=n(r),l=o.default.extend({load:function(e,t){this.dashPlayer&&this.stop(),this.dashPlayer=new a.default.BasicPlayer({url:e,mediaElement:t}),this.dashPlayer.init()},stop:function(){var e=this.dashPlayer;
this.dashPlayer=null;try{e.destroy()}catch(t){}},canPause:function(e){return e.autopause_pending||e.autopaused}});t.default=l,e.exports=t.default},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(20),i(26),i(28),i(90),i(535),i(138),i(33),i(116),i(188)],s=function(e,t,i,n,s,a,r,o,l,c,u,d){"use strict";var h=n.extend({mixins:[c,u],playerProfileAdapter:l,resetStreamDebounce:200,handleSetPositionDebounce:0,wrapped:["play","pause","setVolume","setPosition"],modelDefaults:function(){var t=u.modelDefaults.apply(this,arguments);
return e.extend(t,{state:a.states.BUFFERING})},initialize:function(t){t||(t={}),u.initialize.apply(this,arguments),e.bindAll(this,"onDecisionSuccess","onDecisionError"),this.profile=this.playerProfileAdapter.prop(this.type),this.backlog=new r,this.backlog.wrapAll(this.wrapped,function(){return!!this.subcontroller},this),this.bufferingDetector=new o,this.bufferingDetector.on("warn",this.onBufferingDetectorWarn,this),this.bufferingDetector.on("buffering",this.onBufferingDetected),this.resetStreamDebounce&&(this.resetStream=e.debounce(this.resetStream,this.resetStreamDebounce)),
this.handleSetPositionDebounce&&(this.handleSetPosition=e.debounce(this.handleSetPosition,this.handleSetPositionDebounce))},load:function(e){this.originalOptions=e,this.model=e.model,this.autoplay=e.autoplay,this.postplay=e.postplay;var t=this.model.get("item"),i=this.model.get("playQueue");return this.reset(t),this.listenTo(this.model,{"change:state":this.onStateChange,"change:repeatAll change:repeatItem":this.onRepeatChange,"change:qualityIndex":this.onQualityIndexChange,"change:audioStreamID":this.onAudioStreamIDChange,
"change:subtitleStreamID":this.onSubtitleStreamIDChange,"change:ended":this.onEndedChange,"change:softSubtitlesFailed":this.onSoftSubtitlesFailedChange}),i&&(this.listenTo(i.get("collection"),"add remove reset",this.onPlayQueueChange),this.listenTo(i,"change:hasUpNext change:shuffled",this.onPlayQueueChange)),this.getPlayerDecision(t,e)},reset:function(e){return this.bufferingDetector.stop(),u.reset.apply(this,arguments)},populateItem:function(t,i){var n=e.extend({},i,{reset:!0,scope:"player"});if(t.isLibraryItem()&&(n.data={
checkFiles:"1",includeChapters:"1"}),t.server.get("cloud")){var s=t.get("key");n.url=t.server.swizzleNodeUrl(s)}return t.populate(n)},loadMediaElement:function(t){this.subcontroller=this.getSubcontrollerByType(this.playerType),this.backlog.process();var i,n=this.profile&&this.profile.protocols,s=this.protocol;s&&n&&n[s]&&(i=n[s].mimeType),this.subcontroller.load(e.extend({},this.originalOptions,{model:this.model,protocol:s,autoplay:this.autoplay,mimeType:i,useOffsetHLS:t.useOffsetHLS,canDirectPlay:t.canDirectPlay
})),this.bufferingDetector.setModel(this.model),this.bufferingDetector.start()},getSubcontrollerByType:function(e){return new d(this.type)},embed:function(n){var s=this.model.get("item"),r=t.ajax(s.server.getXHROptions(n.key));r.done(e.bind(function(e){this.model.set("embedHtml",e)},this)),r.fail(e.bind(function(e){this.model.set({state:a.states.ERROR,errorMessage:i("There was a problem embedding this video.")})},this))},redirect:function(t){var i=this.model.get("item"),n=i.get("url");if(!n&&t){var s=t.key.match(/\/webkit\?url=([^&]+)/);
s&&(n=decodeURIComponent(s[1]))}window.open(n),e.defer(e.bind(function(){this.model.set("finished",!0)},this))},play:function(){this.model.get("state")!==a.states.PLAYING&&this.subcontroller.play()},pause:function(){this.model.get("state")!==a.states.PAUSED&&this.subcontroller.pause()},setPosition:function(e,t){t||(t={}),this.canSeek(e)&&(this.model.set({finished:!1,position:e,lastSeekPosition:e}),this.model.trigger("seeking",this.model),this.bufferingDetector.seek(e),this.subcontroller.useSeekStreamSwitch?(this.resetStreamDebounce&&this.pause(),
this.switchStreams(t)):(this.handleSetPositionDebounce&&this.pause(),this.handleSetPosition(e,t)))},handleSetPosition:function(e,t){this.canHandleDebounce()&&(this.subcontroller.setPosition(e),t.autoplay&&this.play())},canHandleDebounce:function(){var e=this.model&&this.model.get("state");return void 0===e?!1:e!==a.states.STOPPED},setVolume:function(e){this.model.set("volume",e),this.subcontroller.setVolume(e)},restartCurrent:function(){this.getPlayerDecision(this.model.get("item"),this.originalOptions);
},skipPrevious:function(){var e=u.skipPrevious.apply(this,arguments);return e&&this.switchStreams({autoplay:!0}),e},skipNext:function(){var e=u.skipNext.apply(this,arguments);return e&&this.switchStreams({autoplay:!0}),e},skipTo:function(e){var t=u.skipTo.apply(this,arguments);return t&&this.switchStreams({autoplay:!0}),t},switchStreams:function(e){e||(e={}),null==e.autoplay&&(e.autoplay=!this.model.get("paused")),this.subcontroller&&this.subcontroller.beforeStreamSwitch&&this.subcontroller.beforeStreamSwitch(),
this.originalOptions.media=this.model.get("media"),this.originalOptions.part=this.model.get("part"),this.originalOptions.offset=this.model.get("position"),this.pause(),this.resetStream(e)},resetStream:function(t){if(this.canHandleDebounce()){var i=this.stopSession();i.done(e.bind(function(){this.autoplay=t.autoplay,this.getPlayerDecision(this.currentItem,this.originalOptions)},this))}},stop:function(e){return u.stop.apply(this,arguments),this.bufferingDetector.off("warn",this.onBufferingDetectorWarn),
this.bufferingDetector.stop(),this.stopSession(e)},onDecisionSuccess:function(e){var t=this.model,i=t.get("state"),n=0;if(i!==a.states.STOPPED&&i!==a.states.ERROR){e.part&&e.part.duration&&(n=e.part.duration),this.session=e.session,this.playerType=e.playerType,this.protocol=e.protocol;var r=e.media,o=e.part,l=s.getSelectedAudio(r),c=s.getSelectedSubtitles(r);this.model.set({media:r,part:o,url:e.url,subtitlesUrl:e.subtitlesUrl,transcodeServer:e.transcodeServer,mediaIndex:r?s.getMediaIndex(t.get("item"),r.id):0,
partIndex:o?s.getPartIndex(r,o.key):0,partCount:s.getPartCount(e.media),audioStreamID:l?l.id:0,subtitleStreamID:c?c.id:0,state:this.autoplay?a.states.BUFFERING:a.states.PAUSED,position:e.offset,duration:n,directPlay:e.canDirectPlay,session:e.session,softSubtitlesFailed:!1}),this.loadMediaElement(e)}},onDecisionError:function(e){var t=this.model,n=t.get("state");if(n!==a.states.STOPPED&&n!==a.states.ERROR){var s=this.playerProfileAdapter.prop("capabilities");if(e.embed&&s.embed)return void this.embed(e.part);
if(e.redirect&&s.redirect)return void this.redirect(e.part);var r=e.errorMessage||i("There was a problem playing this item.");t.set({state:a.states.ERROR,errorMessage:r})}},onQualityIndexChange:function(e,t){var i=e.previous("qualityIndex");null!=t&&null!=i&&this.switchStreams()},onAudioStreamIDChange:function(e,t){var i=e.previous("audioStreamID");null!=t&&null!=i&&this.switchStreams()},onSubtitleStreamIDChange:function(e,t){var i=e.previous("subtitleStreamID");null!=t&&null!=i&&this.switchStreams();
},onPlayQueueChange:function(){var e=this.model.get("playQueue");e&&this.model.set({canShuffle:!e.get("hasUpNext"),shuffled:e.get("shuffled")}),this.previousItem=this.getPreviousItem(),this.nextItem=this.getNextItem(),this.model.set({canSkipPrevious:!!this.previousItem,canSkipNext:!!this.nextItem})},onRepeatChange:function(t,i){this.previousItem=this.getPreviousItem(),this.nextItem=this.getNextItem();var n=e.extend({canSkipPrevious:!!this.previousItem,canSkipNext:!!this.nextItem},this.modelOverrides());
this.model.set(n)},onStateChange:function(t,i){var n=this.timeline();i===a.states.PLAYING&&n.done(e.bind(this.updatePlayQueue,this)),i===a.states.STOPPED||i===a.states.ERROR?this.stopTimeline():this.startTimeline(),i===a.states.PAUSED?this.startPing():this.stopPing(),i===a.states.PLAYING?this.startPlaybackTracking():this.stopPlaybackTracking()},onEndedChange:function(e,t){if(t){var i=e.get("partIndex"),n=e.get("partCount");if(++i>=n)this.model.get("repeatItem")?this.restartCurrent():this.nextItem&&!this.postplay?this.skipNext():(!this.nextItem&&this.postplay?this.stop():this.pause(),
this.model.set("finished",!0));else{var s=e.get("media");this.model.set({part:s.Part[i],position:0}),this.switchStreams({autoplay:!0})}}},onSoftSubtitlesFailedChange:function(e,t){!t||e.get("stopped")||e.get("error")||this.switchStreams()},onBufferingDetected:function(){this.model.set("state",a.states.BUFFERING)},onBufferingDetectorWarn:function(e){var t,n=this.bufferingDetector.reasons,s=e.reason,r=this.bufferingDetector.recommendations,o=e.recommendation,l=i(this.type===a.types.VIDEO?"video":"track");
t=s===n.TRANSCODER?o===r.ORIGINAL_QUALITY?i("The server is not powerful enough to convert this {1} for smooth playback. Try playing at the original quality.",l):i("The server is not powerful enough to convert this {1} for smooth playback.",l):s===n.NETWORK?o===r.LOWER_QUALITY?i("Your connection to the server is not fast enough to stream this {1}. Check your network or try a lower quality.",l):i("Your connection to the server is not fast enough to stream this {1}. Check your network.",l):i("We are having trouble playing this {1}. Please check your playback setup.",l),
this.model.set("bufferingMessage",t)}});return h}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(20),i(34),i(28),i(33),i(116),i(207)],s=function(e,t,i,n,s,a,r,o){"use strict";var l=i.extend({mixins:[a,r],type:s.types.PHOTO,slideshowDelay:5e3,skipTransition:!1,modelDefaults:function(){var t=r.modelDefaults.apply(this,arguments);return e.extend(t,{ready:!0,canPlayPause:!0,canStop:!0,showEnterFullscreen:n.hasFullscreen})},initialize:function(t){r.initialize.apply(this,arguments),
this.loop=!(!t||!t.loop),e.bindAll(this,"skipPrevious","skipNext")},load:function(e){return this.model=e.model,e.autoplay?this.play():this.pause(),this.reset(this.model.get("item")),this.listenTo(this.model,{"change:state":this.onStateChange,"change:loaded":this.onLoadedChange,"change:error":this.onErrorChange}),t.Deferred().resolve().promise()},reset:function(t){this.currentItem&&this.timeline({state:s.states.STOPPED,continuing:!0});var i={loop:this.loop};return this.currentItem=t,this.previousItem=this.getPreviousItem(t,i),
this.nextItem=this.getNextItem(t,i),this.model.set(e.result(this,"modelDefaults")),this.timeline().done(e.bind(this.updatePlayQueue,this)),t},play:function(){this.model.set({state:s.states.PLAYING,slideshowState:o.slideshowStates.PLAYING}),this.model.get("loaded")&&(this.slideshowTimeout=setTimeout(this.skipNext,this.slideshowDelay)),this.model.get("errorMessage")&&(this.slideshowTimeout=setTimeout(this.skipNext,this.slideshowDelay/2)),this.startPlaybackTracking()},pause:function(){this.model.set({
state:s.states.PAUSED,slideshowState:o.slideshowStates.PAUSED}),this.slideshowTimeout=clearTimeout(this.slideshowTimeout),this.stopPlaybackTracking()},skipPrevious:function(e){return e||(e={}),this.skipTransition=!!e.manual,this.previousItem&&(this.slideshowTimeout=clearTimeout(this.slideshowTimeout)),this.model.set("state",s.states.BUFFERING),r.skipPrevious.apply(this,arguments)},skipNext:function(e){return e||(e={}),this.skipTransition=!!e.manual,this.nextItem&&(this.slideshowTimeout=clearTimeout(this.slideshowTimeout)),
this.model.set("state",s.states.BUFFERING),r.skipNext.apply(this,arguments)},stop:function(e){r.stop.apply(this,arguments),this.slideshowTimeout=clearTimeout(this.slideshowTimeout),this.stopPlaybackTracking(),this.trackPlaybackEvent()},onStateChange:function(t,i){this.timeline().done(e.bind(this.updatePlayQueue,this))},onLoadedChange:function(e,t){t&&(this.model.get("slideshowState")===o.slideshowStates.PLAYING?(clearTimeout(this.slideshowTimeout),this.slideshowTimeout=setTimeout(this.skipNext,this.slideshowDelay),
this.model.set("state",s.states.PLAYING)):this.model.set("state",s.states.PAUSED))},onErrorChange:function(e,t){t&&this.model.get("slideshowState")===o.slideshowStates.PLAYING&&(clearTimeout(this.slideshowTimeout),this.slideshowTimeout=setTimeout(this.skipNext,this.slideshowDelay/2))}});return l}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(139),a=n(s),r=a.default.extend({storageName:"BasicVolatileStorage",
initialize:function(){var e={};this.api={getItem:function(t){return e[t]},setItem:function(t,i){e[t]=i},removeItem:function(t){delete e[t]},clear:function(){for(var t in e)e.hasOwnProperty(t)&&delete e[t]}}},getStorage:function(){return this.api}});t.default=r,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(139),a=n(s);try{"string"==typeof localStorage.getItem&&delete localStorage.getItem,"string"==typeof localStorage.setItem&&delete localStorage.setItem,
"string"==typeof localStorage.removeItem&&delete localStorage.removeItem,"string"==typeof localStorage.clear&&delete localStorage.clear}catch(r){}var o=a.default.extend({storageName:"PersistentWebStorage",getStorage:function(){return window.localStorage}});t.default=o,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(139),a=n(s),r=a.default.extend({storageName:"VolatileWebStorage",getStorage:function(){return window.sessionStorage;
}});t.default=r,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(399),a=n(s);t.testServerConnection=a.default;var r=i(400),o=n(r);t.testServerImage=o.default;var l=i(397),c=n(l);t.populateServerIdentity=c.default;var u=i(398),d=n(u);t.relayServer=d.default;var h=i(406),p=n(h);t.signIn=p.default;var f=i(408),m=n(f);t.signUp=m.default;var g=i(407),v=n(g);t.signOut=v.default;var y=i(404),b=n(y);t.resetUser=b.default;var w=i(409),x=n(w);
t.switchUser=x.default;var S=i(402),C=n(S);t.authenticateWithServer=C.default;var k=i(401),P=n(k);t.authenticateWithHash=P.default;var A=i(405),I=n(A);t.share=I.default;var _=i(403),T=n(_);t.recommend=T.default;var D=i(392),E=n(D);t.selectStream=E.default;var M=i(391),R=n(M);t.rate=R.default;var O=i(393),L=n(O);t.updateWatchedStatus=L.default;var N=i(390),F=n(N);t.deleteFile=F.default;var U=i(396),z=n(U);t.getTransientToken=z.default;var B=i(395),j=n(B);t.resumePlayQueue=j.default;var V=i(394),H=n(V);
t.persistPlayQueue=H.default},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5)],s=function(e,t,i,n){"use strict";function s(s){var a,r=s.item,o=s.media,l=r.server;if(o){var c="/library/metadata/"+r.id+"/media/"+o.id,u=e.extend(l.getXHROptions(c),{type:"DELETE"});a=t.ajax(u),a.done(function(){var t=s.item.get("Media");t.splice(e.indexOf(t,o),1),r.trigger("change:Media",r,r.get("Media"))})}else a=r.destroy({wait:!0});return a.fail(function(e){var t=i(403===e.status?'"Allow clients to delete media" must be enabled in your server settings.':"There was a problem deleting this item.");
n.trigger("show:alert",{type:"error",message:t})}),a}return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(4),i(7),i(5),i(14)],s=function(e,t,i,n){"use strict";function s(s){var a=s.item,r=s.rating,o=a.get("userRating");if(a.set("userRating",r),s.passive)return e.Deferred().resolve().promise();var l={key:a.get("ratingKey"),identifier:a.get("identifier"),rating:r},c=n.join("/:/rate",l),u=e.ajax(a.server.getXHROptions(c));return u.fail(function(){a.set("userRating",o),i.trigger("show:alert",{
type:"error",message:t("There was a problem rating this item.")})}),u.promise()}return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5),i(26),i(14)],s=function(e,t,i,n,s,a){"use strict";function r(r){var o=t.Deferred(),l=r.item,c=l.server,u=r.media||e.first(l.get("Media")),d=r.part||u&&e.first(u.Part),h=r.streamType,p=r.streamID;if(!u||!d)return o.reject().promise();var f={};f[h.key]=p,!r.media&&c.supports("allPartsStreamSelection")&&(f.allParts=1);var m=a.join(["/library/parts/",d.id],f),g=e.extend(c.getXHROptions(m),{
type:"PUT"}),v=t.ajax(g);return v.done(function(){s.selectStream(u,h,p),l.trigger("change:streams"),o.resolve()}),v.fail(function(e){n.trigger("show:alert",{type:"error",message:i("There was a problem selecting the stream for this item.")}),o.reject(e)}),o.promise()}return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5),i(25),i(14)],s=function(e,t,i,n,s,a){"use strict";function r(s){var r,c,u=s.watched;s.item?(r=s.item,c=[r]):s.items&&(c=s.items,r=c[0]);var d=e.map(c,function(e){
var i=u?"scrobble":"unscrobble",n={identifier:e.get("identifier")||"com.plexapp.plugins.library"};e.server.get("isCloudSync")?(n.key=e.get("key"),n.ratingKey=e.get("ratingKey")):n.key=e.get("ratingKey");var s=a.join(["/:/",i],n),r=t.ajax(e.server.getXHROptions(s));return r.done(function(){l(e,u),o(e,u)}),r}),h=t.when.apply(t,d);return h.done(function(){n.trigger("dashboard:update")}),h.fail(function(){var e;e=i(u?"There was a problem marking this item as watched.":"There was a problem marking this item as unwatched."),
n.trigger("show:alert",{type:"error",message:e})}),h}function o(e,t){var i=s.get(e.get("type"));if(i&&"directory"===i.element){e.set({unviewedLeafCount:t?0:e.get("leafCount"),viewedLeafCount:t?e.get("leafCount"):0});var n=e.get("children")||e.get("items");n&&n.each(function(e){o(e,t)})}else e.set({viewOffset:0,viewCount:t?1:0})}function l(e,t){var i=s.get(e.get("type")),n=e.parent,a=n&&s.get(n.get("type"));if(a&&a.id===i.parent){var r,o="directory"===i.element;t?r=o?e.get("unviewedLeafCount"):1:(r=o?e.get("viewedLeafCount"):1,
r*=-1),n.set({unviewedLeafCount:n.get("unviewedLeafCount")-r,viewedLeafCount:n.get("viewedLeafCount")+r}),l(n,t)}}return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(59),i(28),i(9),i(208)],s=function(e,t,i,n,s,a){"use strict";function r(s,a){var r=a.playQueue;if(!r.get("playQueueID"))return t.Deferred().reject().promise();var o=n.getTypeByElement(r.get("mediaType"));if("music"!==o)return t.Deferred().reject().promise();var l=e.pick(a,"position","autoplay","inline");
return l=e.extend(l,{serverID:r.server.id,playQueueID:r.get("playQueueID"),mediaType:o}),i.alwaysResolve(s.fetch()).then(e.bind(s.save,s,l))}function o(e){return e.destroy()}function l(e){var t=s.get("user"),i=new a({},{user:t});return e?r(i,e):o(i)}return l}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(4),i(5),i(28),i(11),i(9),i(208)],s=function(e,t,i,n,s,a){"use strict";var r=function(t){var r=new a({},{user:t}),o=r.fetch().then(function(){return s.get("servers").populateServer(r.get("serverID"));
}).then(function(e){return e.get("playQueueManager").populateQueue(r.get("playQueueID"),i.getElementByType(r.get("mediaType")))}).then(function(t){return e.when(t,r.get("position"),r.get("autoplay"),r.get("mediaType"),r.get("inline"))}).then(function(e,t,i,s,a){return"music"!==s?n.execute("persistPlayQueue",null):n.execute("playMedia",{type:s,item:e,playQueue:e,offset:t,autoplay:i,inline:a})}).fail(function(){n.execute("persistPlayQueue",null)});return o};return r}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(2),i(4),i(15),i(14)],s=function(e,t,i,n){"use strict";function s(e){var s=t.Deferred(),a=e.server;if(!a.supports("transientToken"))return s.resolve(a.get("accessToken")).promise();var r={type:e.type||"delegation",scope:e.scope||"all"},o=n.join("/security/token",r),l=t.ajax(a.getXHROptions(o));return l.done(function(e){var t=i.parseXML(e);s.resolve(t.token)}),l.fail(function(e){s.reject(e)}),s.promise()}return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){
"use strict";function n(e){var t=e.server,i=e.connection;if(t.id)return l.default.Deferred().resolve(t.id).promise();var n=t.resolveUrl("/identity",{connection:i}),s=r.default.extend(t.getXHROptions(n),{timeout:t.connectionTestTimeout});(0,h.default)("[Identity] Requesting the machine identifier of "+t.get("debugName")+" at "+n);var a=l.default.ajax(s).promise();return a=a.then(function(e){var i=l.default.Deferred(),n=u.default.parseXML(e),s=n&&n.machineIdentifier;return s?((0,h.default)("[Identity] Machine identifier found for "+t.get("debugName")+": "+s),
!t.collection||t.collection.get(s)?i.resolve(s):(t.collection.populateServer({isCloud:!0}).done(function(e){e.get("resources").populate().always(function(){i.resolve(s)})}),t.collection.findServer({isCloud:!0}).done(function(e){e.populate().fail(function(){i.resolve(s)})}).fail(function(){i.resolve(s)}))):i.reject(),i.promise()}),a.fail(function(){h.default.warn("[Identity] Machine identifier not found for "+t.get("debugName")+" at "+n)}),a}var s=i(8).default;Object.defineProperty(t,"__esModule",{
value:!0});var a=i(2),r=s(a),o=i(4),l=s(o),c=i(95),u=s(c),d=i(16),h=s(d);t.default=n,e.exports=t.default},function(e,t,i){var n,s;n=[i(4),i(2),i(5),i(9)],s=function(e,t,i,n){"use strict";function s(i){var s=i.server,r=n.get("user"),o="/devices/"+r.id+"/"+s.id+"/relay",l=t.extend(r.server.getXHROptions(o),{type:"POST"}),c=e.ajax(l).promise();return c=c.then(function(){function t(){s.off("change:connected",i),s.populate().then(r.resolve,r.reject)}function i(e,t){t&&(clearTimeout(n),s.off("change:connected",i),
r.resolve())}if(!s.get("connected")){var n,r=e.Deferred();return n=setTimeout(t,a),s.on("change:connected",i),r.promise()}})}var a=1e4;return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";function n(e){var t=e.server,i=e.connection,n=t.resolveUrl(e.url||"/",{connection:i});return t.abortConnectionTest(i),y.default.get("allowHttpsMediaServerConnections")||t.get("isCloud")||!i.get("isHttps")?y.default.get("allowMixedContent")||!f.default.isHostedHttps||i.get("isHttps")?o(n,e):a(n,e):s(n,e);
}function s(e,t){var i=t.server,n=i.get("debugName");return g.default.warn("[Connections] Aborting connection test for "+n+" at "+e+" because secure connections are disallowed"),r(e,t)}function a(e,t){var i=t.server,n=i.get("debugName");return g.default.warn("[Connections] Aborting connection test for "+n+" at "+e+" due to mixed content prevention"),r(e,t)}function r(e,t){var i=t.connection,n=h.default.Deferred();return u.default.defer(function(){i.set({currentTest:null,testState:b.testStates.UNAVAILABLE
}),n.reject(i)}),n.promise()}function o(e,t){function i(t){(0,g.default)("[Connections] "+o+" connected at "+e),a.set({currentTest:null,testState:b.testStates.CONNECTED}),r.resolve(a,t)}function n(t,i){var n={currentTest:null};a.get("isAborted")||(g.default.warn("[Connections] "+o+" is "+t+" at "+e+" (Status "+i.status+")"),n.testState=t),a.set(n),r.reject(a,i)}var s=t.server,a=t.connection,r=h.default.Deferred(),o=s.get("debugName");(0,g.default)("[Connections] Testing connection for "+o+" at "+e);
var l=s.getXHROptions(e);l.timeout=s.connectionTestTimeout,y.default.get("emulateCNP")&&(y.default.get("proxied")||!a.get("isPrivate")&&!a.get("isLoopback")||(l.url="cnpfail"+l.url));var c=h.default.ajax(l);return a.set({currentTest:c,testState:b.testStates.PENDING}),c.done(function(t,a,r){if(s.get("isCloud"))return void i();var l=s.parse(t),c=l&&l.machineIdentifier;!c||s.id&&l.machineIdentifier!==s.id?(g.default.warn("[Connections] "+o+" has an unexpected machine identifier at "+e),n(b.testStates.UNAVAILABLE,r)):i(l);
}),c.fail(function(e){var t=401===e.status||403===e.status,i=t?b.testStates.UNAUTHORIZED:b.testStates.UNAVAILABLE;n(i,e)}),r.promise()}var l=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var c=i(2),u=l(c),d=i(4),h=l(d),p=i(34),f=l(p),m=i(16),g=l(m),v=i(39),y=l(v),b=i(75);t.default=n,e.exports=t.default},function(e,t,i){var n,s;n=[i(4),i(16)],s=function(e,t){"use strict";function i(i){var n,s=i.server,a=i.connection,r=s.get("friendlyName"),o=(new Date).getTime(),l=s.resolveUrl("/web/img/blank.png?cb="+o,{
connection:a}),c=e.Deferred();t("Testing image for "+r+" at "+l);var u=new Image;return u.onload=function(){u.onload=u.onerror=u.onabort=null,n=clearTimeout(n),t.info("Image test for "+r+" was successful. Show mixed content warning."),c.resolve(s,a)},u.onerror=u.onabort=function(){u.onload=u.onerror=u.onabort=null,n=clearTimeout(n),t.warn(r+" is unavailable at "+l),c.reject(s,a)},n=setTimeout(function(){u.onload=u.onerror=u.onabort=null,u.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",
t.warn(r+" is unavailable at "+l+" (Timeout)"),c.reject(s,a)},5e3),u.src=l,c.promise()}return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";function n(e){var t=r.default.Deferred().resolve().promise(),i=r.default.Deferred().reject().promise(),n=u.default.getActiveUser();if(!n)return i;var s=n.get("pin"),a=n.get("authenticationToken");if(!s&&!e.pin)return t;var o=l.default.get("user"),c=o.hashPIN(e.pin,a);return s===c?t:i}var s=i(8).default;Object.defineProperty(t,"__esModule",{
value:!0});var a=i(4),r=s(a),o=i(9),l=s(o),c=i(45),u=s(c);t.default=n,e.exports=t.default},function(e,t,i){var n,s;n=[i(4),i(2),i(14),i(9),i(39)],s=function(e,t,i,n,s){"use strict";function a(s){var a=s.homeUser,r=n.get("user"),o=a.id||r.id,l={pin:s.pin},c=i.join(["/api/home/users/",o,"/switch"],l),u=t.extend(a.server.getXHROptions(c),{type:"POST",xhrFields:{withCredentials:!1}});return e.ajax(u).promise()}return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(4),i(2),i(7),i(5),i(14),i(9)],
s=function(e,t,i,n,s,a){"use strict";function r(r){var o=a.get("user"),l=[],c={url:r.item.get("url"),message:r.message};t.each(r.playlistIDs,function(i){var n=s.join(["/pms/playlists/",i,"/items"],c),a=t.extend(o.server.getXHROptions(n),{type:"POST"});l.push(e.ajax(a))});var u=e.when.apply(e,l);return u.fail(function(e){n.trigger("show:alert",{type:"error",message:i("There was a problem recommending this item.")})}),u.promise()}return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";
function n(){var e=f.default.get("user"),t=e.server,i=e.clearAccessToken();return i.fail(function(){h.default.warn("Failed to clear the access token and user storage")}).always(function(){f.default.set("history",[]),u.default.abortAll(),e.signOut(),e.uninitialize(),e.initialize(),r.default.trigger("clearAll:cache"),t.cache.store(t)}),l.default.alwaysResolve(i)}var s=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var a=i(5),r=s(a),o=i(59),l=s(o),c=i(68),u=s(c),d=i(16),h=s(d),p=i(9),f=s(p);
t.default=n,e.exports=t.default},function(e,t,i){var n,s;n=[i(4),i(2),i(7),i(5),i(14),i(9)],s=function(e,t,i,n,s,a){"use strict";function r(r){var o=a.get("user"),l=[],c={url:r.item.get("url"),message:r.message};t.each(r.networkIDs,function(i){var n=s.join(["/pms/social/networks/",i,"/share"],c),a=t.extend(o.server.getXHROptions(n),{type:"POST"});l.push(e.ajax(a))});var u=e.when.apply(e,l);return u.fail(function(e){n.trigger("show:alert",{type:"error",message:i("There was a problem sharing this item.")
})}),u.promise()}return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";function n(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=g.default.get("user"),i=void 0;if(e.username&&e.password){i=t.server.getXHROptions("/users/sign_in.xml"),i.type="POST";var n="Basic "+h.default.encode(f.default.encode(e.username+":"+e.password));i.headers.Authorization=n}else i=t.server.getXHROptions("/users/account.xml?auth_token="+e.accessToken),i.type="GET";var s=r.default.ajax(i).promise();
return s=s.then(function(i){return e.remember?y.default.restorePrevious():y.default.register(w.default.getInstance()),t.signIn(i,{lockState:x.lockStates.UNLOCKED})}),s.fail(function(t){var i=void 0;e.silent||(i=401===t.status&&e.username&&e.password?(0,l.default)("The username or password is incorrect."):(0,l.default)("There was a problem connecting to Plex."),u.default.trigger("show:alert",{type:"error",message:i}))}),s}var s=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var a=i(4),r=s(a),o=i(7),l=s(o),c=i(5),u=s(c),d=i(161),h=s(d),p=i(237),f=s(p),m=i(9),g=s(m),v=i(44),y=s(v),b=i(114),w=s(b),x=i(76);
t.default=n,e.exports=t.default},function(e,t,i){"use strict";function n(){var e=c.default.execute("resetUser");return e=e.then(function(){return d.default.restoreDefaults(),d.default.save()}),e=e.then(function(){o.default.trigger("reset:servers")})}var s=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var a=i(4),r=(s(a),i(5)),o=s(r),l=i(11),c=s(l),u=i(45),d=s(u);t.default=n,e.exports=t.default},function(e,t,i){"use strict";function n(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=w.default.get("user"),i=r.default.pick(e,"username","email","password");
e.birthday&&(i.birthday_str=e.birthday.format("YYYY/MM/DD"));var n=t.server.getXHROptions("/users?format=xml");n.type="POST",n.data=i;var s=l.default.ajax(n).promise();return s=s.then(function(i){return e.remember?g.default.restorePrevious():g.default.register(y.default.getInstance()),t.signIn(i,{lockState:x.lockStates.UNLOCKED})}),s.fail(function(e){var t=void 0;if(422===e.status){var i=e.responseText,n=f.default.parseXML(i);f.default.parseArray(n,"error"),t=n.error.length?r.default.first(n.error):(0,
u.default)("This account information is invalid.")}else t=(0,u.default)("There was a problem connecting to Plex.");h.default.trigger("show:alert",{type:"error",message:t})}),s}var s=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var a=i(2),r=s(a),o=i(4),l=s(o),c=i(7),u=s(c),d=i(5),h=s(d),p=i(15),f=s(p),m=i(44),g=s(m),v=i(114),y=s(v),b=i(9),w=s(b),x=i(76);t.default=n,e.exports=t.default},function(e,t,i){"use strict";function n(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=d.default.get("user"),i=t.get("signedIn"),n=t.id!==e.homeUser.id,a=e.allowGuestLock,r=n||a,l=i?c.default.execute("authenticateWithServer",e):c.default.execute("authenticateWithHash",e);
return i&&r?l=l.then(function(t){return s(t,e)}):l.done(function(){t.set("lockState",h.lockStates.UNLOCKED),r&&o.default.trigger("home:userswitched",t)}),l}function s(e,t){var i=d.default.get("user"),n=c.default.execute("resetUser");return n=n.then(function(){return i.activateStoredUser(t.homeUser.id),o.default.trigger("reset:servers"),i.signIn(e,{lockState:h.lockStates.UNLOCKED})}),n=n.then(function(){return o.default.trigger("home:userswitched",i),i})}var a=i(8).default;Object.defineProperty(t,"__esModule",{
value:!0});var r=i(5),o=a(r),l=i(11),c=a(l),u=i(9),d=a(u),h=i(76);t.default=n,e.exports=t.default},function(e,t,i){var n,s;n=[i(38),i(112),i(136),i(72),i(73),i(379),i(378),i(380),i(135),i(212)],s=function(e,t,i,n,s,a,r,o,l,c){"use strict";function u(e){e.disableErrorTracking&&(i.disable(),i.register(a)),f=e.errorTrackerID||f,i.init(f,t.prop("X-Plex-Version")),i.set("X-Plex-Product",t.prop("X-Plex-Product")),i.set("X-Plex-Device",t.prop("X-Plex-Device")),i.set("X-Plex-Platform",t.prop("X-Plex-Platform")),
i.set("X-Plex-Platform-Version",t.prop("X-Plex-Platform-Version"))}function d(e){e.disableAnalytics&&n.register(r),p=e.googleAnalyticsID||p,n.init(p,{name:t.prop("X-Plex-Product"),version:t.prop("X-Plex-Version")}),n.set({dimension1:t.prop("X-Plex-Product"),dimension2:t.prop("X-Plex-Client-Identifier"),dimension3:t.prop("X-Plex-Platform"),dimension4:t.prop("X-Plex-Platform-Version"),dimension5:t.prop("X-Plex-Device"),dimension6:t.prop("X-Plex-Version")}),c.populate().done(function(){var e=c.get("heartbeatTime")-c.get("startTime"),t=Math.round(e/1e3),i=c.get("playbackCount");
n.trackEvent({eventCategory:"App",eventAction:"Shutdown",eventValue:t,metric1:i})}),c.populate().always(function(){c.startSession(),n.trackEvent({eventCategory:"App",eventAction:"Start",eventValue:1,sessionControl:"start"})})}function h(i){if(i.disableMetrics&&s.register(o),!i.disableMetrics){e(l.hasInstance(),"A registered appModel is required to gather metrics");var n=l.get("user");s.set({product:t.prop("X-Plex-Product"),platform:t.prop("X-Plex-Platform"),subplatform:t.prop("X-Plex-Device"),visitorID:t.prop("X-Plex-Client-Identifier"),
userID:n.id}),n.on("change:id",function(e){s.set({userID:e.id})}),l.on("change:primaryServer",function(e,t){t&&s.set({serverID:t.id})})}}var p="UA-6111912-18",f="https://67349abf654648e18514f1fbcb1603c8@app.getsentry.com/34246",m={init:function(e){e||(e={}),u(e),d(e),h(e)}};return m}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(4),i(59),i(68),i(162),i(44)],s=function(e,t,i,n,s){"use strict";function a(e){var t;return e.get("clientID")?t=s.set("clientID",e.get("clientID")):(t=s.get("clientID"),
t=t.then(function(t){e.set("clientID",t)},function(){var t=n();return e.set("clientID",t),s.set("clientID",t)})),t}function r(e){var t=s.get("skipSignIn");return t.always(function(t){e.set("skipSignIn","1"===t)}),t}var o={init:function(e){i.startListening();var n=a(e),s=r(e);return t.whenEach(n,s)}};return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";function n(e){return e.get("isCloud")}var s=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var a=i(539),r=s(a),o=i(190),l=s(o),c=i(9),u=s(c),d={
init:function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=new l.default({name:"CloudServerEventManager",servers:e.servers||u.default.get("servers"),isValidServer:n,supportsLongPolling:!0,showTimelineStatus:!1,ServerEventConnection:r.default});t.start()}};t.default=d,e.exports=t.default},function(e,t,i){var n,s;n=[i(376),i(39)],s=function(e,t){"use strict";var i=new e.SoundManager;return window.soundManager=i,i.url="swf/soundmanager",i.debugMode=!1,i.preferFlash=t.get("allowFlash"),
i.flashVersion=9,i.flashLoadTimeout=2e3,i.useFastPolling=!0,i.useHighPerformance=!0,i.forceUseGlobalHTML5Audio=!0,i.beginDelayedInit(),i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";function n(){var e=h.default.get("connections");return e=e.then(function(e){if(e)try{var t=function(){var t=JSON.parse(e),i=t.users;if(!i)return{v:void 0};var n=[];return i.forEach(function(e){var i=e.entitlements,s=e.servers,a={id:e.id,authenticationToken:e.accessToken,title:e.title,pin:e.pin,
home:e.home,hasAllEntitlements:!!e.entitlements&&e.entitlements.hasOwnProperty("all"),lastPrimaryServerID:t.lastPrimaryServerID,entitlements:[],servers:[]};i&&r.default.each(i,function(e,t){e&&a.entitlements.push({id:t})}),s&&s.forEach(function(e){var t=e.connections,i=e.sources,n=!(!t||!t.length),s=!(!i||!i.length);if(e.machineIdentifier&&n&&s){var o={machineIdentifier:e.machineIdentifier,friendlyName:e.friendlyName,sourceTitle:e.shared?e.friendlyName:void 0,accessToken:e.accessToken,synced:e.synced,
isShared:e.shared,connections:[]};t.forEach(function(e){var t={uri:e.uri,scheme:e.scheme,address:e.address,port:e.port,sources:[]};r.default.contains(i,"myPlex")?t.sources.push({id:"myPlex"}):t.sources.push({id:"internal"}),o.connections.push(t)}),a.servers.push(o)}}),n.push(a)}),{v:h.default.set("users",JSON.stringify({users:n}))}}();if("object"==typeof t)return t.v}catch(i){(0,l.default)(!1,"Unable to migrate stored connections: "+i.message)}}),e=e.then(function(){return h.default.remove("connections");
}),u.default.alwaysResolve(e)}var s=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var a=i(2),r=s(a),o=i(38),l=s(o),c=i(59),u=s(c),d=i(44),h=s(d);t.default=n,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(2),a=n(s),r=i(5),o=n(r),l=i(16),c=n(l),u=i(17),d=n(u),h=i(421),p=n(h),f=i(189),m=n(f),g=i(420),v=n(g),y=i(419),b=n(y),w=i(9),x=n(w),S=i(39),C=n(S),k=i(45),P=n(k),A=i(53),I=n(A),_={init:function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];
this.servers=e.servers||x.default.get("servers"),this.connectionManager=e.connectionManager||new v.default({appModel:x.default,servers:this.servers}),this.serverManager=e.serverManager||new p.default({appModel:x.default,servers:this.servers}),this.primaryServerManager=e.primaryServerManager||new m.default({appModel:x.default,servers:this.servers,minServerVersion:null}),this.manualServerManager=e.manualServerManager||new b.default({appModel:x.default,servers:this.servers}),this.initServers()},initServers:function(){
(0,c.default)("[Servers] Initializing..."),this.initCloudServer(),this.initStoredServers(),this.initConfigServer(),this.initBundledServer(),this.initLoopbackServer(),this.connectionManager.start(),this.serverManager.start(),this.primaryServerManager.start(),this.manualServerManager.start(),(0,c.default)("[Servers] Finished initialization")},resetServers:function(){(0,c.default)("[Servers] Resetting..."),this.connectionManager.stop(),this.serverManager.stop(),this.primaryServerManager.stop(),this.manualServerManager.stop(),
this.servers.uninitialize(),this.servers.reset(),this.servers.initialize(),this.initServers()},initCloudServer:function(){var e=x.default.get("cloudServer");e.addConnection({scheme:d.default.get("myPlexScheme")||C.default.get("myPlexScheme"),address:d.default.get("myPlexUrl")||C.default.get("myPlexUrl")}),this.servers.add(e)},initStoredServers:function(e){var t=this,i=P.default.getActiveServers();i&&i.each(function(e){if(e.get("connections").length){var i=new I.default(e.toJSON(),{parent:x.default
});t.servers.add(i)}})},initConfigServer:function(){var e=C.default.get("primaryServer");if(e){var t=new I.default({machineIdentifier:e.machineIdentifier,friendlyName:e.name,isShared:e.shared,superToken:e.superToken,accessToken:e.accessToken,sourceTitle:e.sourceTitle},{parent:x.default});t.addConnection({scheme:e.scheme,address:e.address,port:e.port}),this.servers.add(t)}},initBundledServer:function(){var e=new I.default({isBundled:!0},{parent:x.default});e.addConnection({scheme:window.location.protocol.replace(":",""),
address:window.location.hostname,port:window.location.port,isBundled:!0}),this.servers.add(e)},initLoopbackServer:function(){if(C.default.get("allowLoopbackDiscovery")){var e=new I.default({},{parent:x.default});e.addConnection({scheme:"http",address:"127.0.0.1",port:"32400"}),this.servers.add(e)}}};o.default.on("reset:servers",a.default.bind(_.resetServers,_)),t.default=_,e.exports=t.default},function(e,t,i){var n,s;n=[i(4),i(88),i(17),i(45)],s=function(e,t,i,n){"use strict";var s={init:function(){
var s=e.Deferred();return e.when(i.populate(),n.populate()).always(function(){var e=i.get("language");t.load(e).always(function(){s.resolve()})}),s.promise()}};return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(414),a=n(s),r={init:function(){return(0,a.default)()}};t.default=r,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(4),a=n(s),r=i(44),o=n(r),l=i(9),c=n(l),u=i(45),d=n(u),h={
init:function(){var e=a.default.Deferred(),t=o.default.get("myPlexAccessToken");return t.done(function(e){var t=c.default.get("user"),i=d.default.get("users"),n=i.findWhere({authenticationToken:e});n&&t.activateStoredUser(n.id)}),t.always(function(){e.resolve()}),e.promise()}};t.default=h,e.exports=t.default},function(e,t,i){"use strict";var n=i(293).default,s=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var a=i(20),r=s(a),o=i(5),l=s(o),c=i(33),u=s(c),d=i(53),h=s(d),p=i(485),f=s(p),m="manualServer",g=r.default.extend({
mixins:[u.default],initialize:function(e){this.appModel=e.appModel,this.servers=e.servers},start:function(){this.listenTo(f.default,"change",this.onManualConnectionChange),this.initManualServer()},stop:function(){this.stopListening()},initManualServer:function(){function e(e){var t=f.default.get("ip"+e),i=f.default.get("port"+e);t&&i&&this.addManualConnection(t,i,e)}e.call(this,1),e.call(this,2)},removeManualConnection:function(e,t,i){var n=this.appModel.get("primaryServer");this.servers.each(function(e){
if(!e.get("isCloud")){e.removeSource(m+i);var t=e.get("connections"),s=t.findWhere({isConnected:!0});s||e!==n||l.default.trigger("navigate","dashboard",{replace:!0})}})},addManualConnection:function(e,t,i){var n={scheme:"http",address:e,port:t.toString(),sources:{id:m+i}},s=new h.default({friendlyName:e});s.addConnection(n),this.servers.add(s)},onManualConnectionChange:function(e){var t=n(e.changed)[0],i=t.slice(-1),s="ip"+i,a="port"+i,r=e._previousAttributes[s],o=e._previousAttributes[a],l=e.get(s),c=e.get(a);
l&&c&&this.addManualConnection(l,c,i),r&&o&&this.removeManualConnection(r,o,i)}});t.default=g,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(2),a=n(s),r=i(4),o=n(r),l=i(5),c=n(l),u=i(20),d=n(u),h=i(546),p=n(h),f=i(545),m=n(f),g=i(33),v=n(g),y=i(16),b=n(y),w=i(45),x=n(w),S=d.default.extend({mixins:[v.default],browserConnectionChangeDelay:2e3,initialize:function(e){a.default.bindAll(this,"onBrowserConnectionChange"),this.appModel=e.appModel,
this.servers=e.servers,this._pessimisticServerRetryWorker=new p.default(this),this._optimisticServerRetryWorker=new m.default(this)},start:function(){this.stop();var e=(0,o.default)(window);e.on("online",this.onBrowserConnectionChange),e.on("offline",this.onBrowserConnectionChange),this.listenTo(c.default,{"test:servers":this.onTestAllServers,"test:server":this.onTestServer}),this.listenTo(this.servers,{add:this.onServerAdd,remove:this.onServerRemove,reset:this.onServersReset,"error:connection":this.onServerConnectionError,
"change:connections.add":this.onServerConnectionAdd,"change:connections.remove":this.onServerConnectionRemove,"change:connections.reset":this.onServerConnectionsReset,"change:connections.change:isConnected":this.onServerConnectionConnectedChange,"change:connections.change:sources.change":this.onServerConnectionSourcesChange,"change:accessToken":this.onServerAccessTokenChange,"change:isConnected":this.onServerConnectedChange,"change:isUnavailable":this.onServerUnavailableChange}),this.servers.invoke("testOnlyUntestedConnections");
},stop:function(){this.stopListening(),this._pessimisticServerRetryWorker.removeAll(),this._optimisticServerRetryWorker.removeAll();var e=(0,o.default)(window);e.off("online",this.onBrowserConnectionChange),e.off("offline",this.onBrowserConnectionChange)},_startFailedServerRetries:function(e){var t=e.get("update");t&&"installing"===t.get("state")?this._optimisticServerRetryWorker.add(e):this._pessimisticServerRetryWorker.add(e)},_stopFailedServerRetries:function(e){this._pessimisticServerRetryWorker.remove(e),
this._optimisticServerRetryWorker.remove(e)},_removeConnection:function(e){var t=e.server,i=x.default.getActiveServers();if((0,b.default)("[Connections] Removed connection %s from %s",e.id,t.get("debugName")),t.abortConnectionTest(e),i){var n=i.get(t.id),s=n&&n.get("connections");s&&s.get(e.id)&&(s.remove(e.id),s.length||i.remove(t.id),x.default.debouncedSave())}},onBrowserConnectionChange:function(e){var t=this;(0,b.default)("[Connections] Browser online status changed to",window.navigator.onLine),
clearTimeout(this.browserConnectionChangeTimeout),this.browserConnectionChangeTimeout=setTimeout(function(){t.servers.invoke("testAllConnections")},this.browserConnectionChangeDelay)},onTestAllServers:function(){this.servers.invoke("testAllConnections")},onTestServer:function(e){e.testAllConnections()},onServerAdd:function(e){e.testOnlyUntestedConnections()},onServerRemove:function(e){var t=x.default.getActiveServers(),i=void 0;if(e.abortAllConnectionTests(),this._stopFailedServerRetries(e),t)if(e.get("isMerged")){
var n=e.previous("machineIdentifier");n&&(i=t.get(n),i&&(i.set("machineIdentifier",e.id),x.default.debouncedSave()))}else i=t.get(e.id),i&&(t.remove(e.id),x.default.debouncedSave())},onServersReset:function(e,t){var i=this,n=t.previousModels;a.default.each(n,function(t){e.contains(t)||(t.abortAllConnectionTests(),i._stopFailedServerRetries(t))})},onServerConnectionError:function(e){if(b.default.warn("[Connections] Possible connection error for %s, retrying connection tests",e.get("debugName")),e.get("isCloud")){
var t=this.appModel.get("user");t.signInWithStoredToken()}else e.testAllConnections()},onServerConnectionAdd:function(e){var t=e.server;(0,b.default)("[Connections] Added connection %s for %s",e.id,t.get("debugName")),t.testConnection(e)},onServerConnectionRemove:function(e){this._removeConnection(e)},onServerConnectionsReset:function(e,t){var i=this,n=t.previousModels;a.default.each(n,function(t){e.contains(t)||i._removeConnection(t)})},onServerConnectionConnectedChange:function(e,t){var i=e.server,n=e.get("isBundled"),s=e.get("isFallback"),r=e.get("isRelayed"),o=t&&!n&&!s&&!r,l=x.default.getActiveServers();
if(i.id&&!i.get("isCloud")&&o&&l){var c=l.get(i.id);if(c)c.copyFromServer(i);else{var u=a.default.omit(i.toJSON(),"connections");c=l.add(u,{merge:!0,parse:!0})}c.get("connections").add(e.toJSON(),{merge:!0,parse:!0}),x.default.debouncedSave()}},onServerConnectionSourcesChange:function(e,t){var i=e.server,n=x.default.getActiveServers(),s=n&&n.get(i.id);if(s){var a=s.get("connections"),r=a.get(e.id);if(r){var o=r.get("sources");o.set(t.toJSON()),x.default.debouncedSave()}}},onServerAccessTokenChange:function(e,t){
e.get("isCloud")||((0,b.default)("[Connections] Access token for %s changed to %s",e.get("debugName"),t),e.testAllConnections())},onServerConnectedChange:function(e,t){t&&this._stopFailedServerRetries(e)},onServerUnavailableChange:function(e,t){t&&this._startFailedServerRetries(e)}});t.default=S,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(2),a=n(s),r=i(20),o=n(r),l=i(5),c=n(l),u=i(16),d=n(u),h=i(33),p=n(h),f=i(53),m=n(f),g=o.default.extend({
mixins:[p.default],initialize:function(e){this.appModel=e.appModel,this.servers=e.servers},start:function(){this.stop(),this.listenTo(this.servers,{"change:promiseState":this.onServerPromiseStateChange,remove:this.onServerRemove,"add remove reset":this.onServersUpdate,"change:resources.add":this.onResourceAdd,"change:resources.remove":this.onResourceRemove,"change:resources.add change:resources.remove":a.default.debounce(this.onResourcesUpdate),"change:resources.reset":this.onResourcesReset}),this._checkFoundAllServers();
},stop:function(){this.stopListening()},_checkFoundAllServers:function(){this.servers.shouldWaitForInitialServers()?this._waitForServers():this.servers.shouldWaitForResources()?this._waitForServers():this.servers.shouldWaitForPendingServers()?this._waitForServers():this._foundAllServers()},_waitForServers:function(){this.servers.waitForServers(),this.appModel.set("isWaitingForServers",!0)},_foundAllServers:function(){this.servers.foundAllServers(),this.appModel.set("isWaitingForServers",!1)},_fetchResources:function(e){
var t=this;(0,d.default)("[Servers] Finding resources through %s",e.get("debugName")),this._waitForServers();var i=e.get("resources"),n=i.fetch().done(function(){(0,d.default)("[Servers] Found %s resources through %s",i.length,e.get("debugName"))}).fail(function(){d.default.warn("[Servers] Failed to request resources through %s",e.get("debugName"))}).always(function(){return t._checkFoundAllServers()});return n},_convertResourceToServer:function(e){(0,d.default)("[Servers] %s was found through %s",e.get("name"),e.server.get("debugName"));
var t=new m.default({machineIdentifier:e.id,friendlyName:e.get("name"),isShared:!e.get("owned"),accessToken:e.get("accessToken"),sourceTitle:e.get("sourceTitle"),publicAddressMatches:e.get("publicAddressMatches"),httpsRequired:e.get("httpsRequired"),presence:e.get("presence"),home:e.get("home"),synced:e.get("synced"),createdAt:e.get("createdAt"),lastSeenAt:e.get("lastSeenAt")},{parent:this.appModel});return e.get("connections").each(function(i){var n=[{id:e.server.id}],s=a.default.extend(i.toJSON(),{
sources:n});t.addConnection(s)}),t},_removeResource:function(e){(0,d.default)("[Servers] %s was removed as a resource from %s",e.get("name"),e.server.id);var t=this.servers.get(e.id);t&&t.removeSource(e.server.id)},_pruneStaleSources:function(e){for(var t=e.get("resources"),i=this.servers.length-1;i>=0;){var n=this.servers.at(i),s=t.get(n.id);if(s)for(var a=n.get("connections"),r=a.length-1;r>=0;){var o=a.at(r),l=o.get("sources");if(l.get(e.id)){var c=s.get("connections");c.get(o.id)||o.get("sources").remove(e.id);
}r--}else n.removeSource(e.id);i--}},_setAuthorized:function(){var e=!!this.servers.findWhere({isConnected:!0,isCloud:!1}),t=!!this.servers.findWhere({isResolved:!0,isCloud:!0});this.appModel.set("authorized",e||t)},_setMultiServer:function(){var e=this.servers.where({isConnected:!0,isCloud:!1});this.appModel.set("multiserver",e.length>1)},onServerPromiseStateChange:function(e,t){if(t===m.default.promiseStates.RESOLVED){var i=e.get("resources");i&&this._fetchResources(e)}this._setAuthorized(),this._setMultiServer(),
this._checkFoundAllServers()},onServerRemove:function(e){d.default.warn("[Servers] %s was removed",e.get("debugName")),e.cache.remove(e),c.default.trigger("clearWhere:cache",{server:e})},onServersUpdate:function(){this._setAuthorized(),this._setMultiServer(),this._checkFoundAllServers()},onResourceAdd:function(e){if(a.default.contains(e.get("provides"),"server")){var t=this._convertResourceToServer(e);this.servers.add(t)}},onResourceRemove:function(e){this._removeResource(e)},onResourcesUpdate:function(e){
this._pruneStaleSources(e.server),this._checkFoundAllServers()},onResourcesReset:function(e,t){var i=this,n=t.previousModels;a.default.each(n,function(t){e.contains(t)||i._removeResource(t)}),this._checkFoundAllServers()}});t.default=g,e.exports=t.default},function(e,t,i){var n,s;n=[i(2),i(52)],s=function(e,t){"use strict";var i={bindings:e.extend({".artist-title":{modelAttribute:"parentTitle"},".album-title":{modelAttribute:"title"}},e.pick(t.defaultBindings,[".item-year",".item-genre"]))};return i;
}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(52)],s=function(e,t){"use strict";var i={bindings:e.pick(t.defaultBindings,[".item-title",".item-genre"])};return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(52)],s=function(e,t){"use strict";var i={bindings:e.pick(t.defaultBindings,[".item-title",".item-year",".item-duration",".item-tagline",".item-genre",".item-director",".item-writer",".item-cast",".item-content-rating",".content-rating-flag-container",".studio-flag-container"])
};return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(52),i(26)],s=function(e,t,i){"use strict";var n={bindings:e.extend({".show-title":{modelAttribute:"grandparentTitle"},".episode-title":{modelAttribute:"title"},".episode-index":{modelAttribute:"index",formatter:function(e){return i.getSeasonEpisodeIndex({seasonIndex:this.model.get("parentIndex"),episodePrefix:" \xb7 E{1}",episodeIndex:e,date:this.model.get("originallyAvailableAt"),noLeadingZero:!0})}}},e.pick(t.defaultBindings,[".item-year",".item-progress",".item-duration",".item-unwatched-label",".item-unavailable-btn",".item-available-at",".item-director",".item-writer",".item-cast",".item-content-rating",".media-count-badge",".content-rating-flag-container"]))
};return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(52)],s=function(e,t){"use strict";var i={bindings:e.pick(t.defaultBindings,[".item-title",".item-year",".item-progress",".item-duration",".item-unwatched-label",".item-unavailable-btn",".item-tagline",".item-genre",".item-director",".item-writer",".item-cast",".item-content-rating",".media-count-badge",".content-rating-flag-container",".studio-flag-container"])};return i}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(2),i(52)],s=function(e,t){"use strict";var i={bindings:e.pick(t.defaultBindings,[".item-title",".item-year",".item-duration",".item-genre",".item-content-rating",".details-unwatched-count-badge",".content-rating-flag-container",".studio-flag-container"])};return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(238),i(5)],s=function(e,t,i,n){"use strict";var s={},a={languages:{en:"en.json","en-GB":"en-GB.json",af:"af.json",my:"my.json",
ca:"ca.json",cs:"cs.json",sr:"sr.json",da:"da.json",de:"de.json",et:"et.json",es:"es.json","es-419":"es-419.json",el:"el.json",fr:"fr.json","fr-CA":"fr-CA.json",hr:"hr.json",is:"is.json",it:"it.json",lt:"lt.json",hu:"hu.json",nl:"nl.json",no:"no.json",pl:"pl.json",pt:"pt.json","pt-BR":"pt-BR.json",ru:"ru.json",ro:"ro.json",sk:"sk.json",sl:"sl.json",fi:"fi.json",sv:"sv.json",vi:"vi.json",tr:"tr.json",uk:"uk.json",bg:"bg.json",zh:"zh.json","zh-TW":"zh-TW.json",ja:"ja.json",ko:"ko.json",th:"th.json",
fa:"fa.json",ar:"ar.json",he:"he.json"},loadingPromise:null,loadingLanguage:null,getLanguages:function(){return this.languages},getTranslation:function(e){return this.translations[this.language]?this.translations[this.language][e]:void 0},load:function(i){if(this.loadingLanguage&&this.loadingLanguage===i)return this.loadingPromise;var n,s=this.getLanguages();return n=e.has(s,i)?e.has(this.translations,i)?t.Deferred().resolve().promise():t.ajax({dataType:"json",url:this.basePath+s[i]}):t.Deferred().reject().promise(),
this.loadingLanguage=i,this.loadingPromise=n,n.done(e.bind(this.onLoadSuccess,this,n)),n.fail(e.bind(this.onLoadError,this,n)),n},t:function(t){if(!t)return"";var n,a,r=1,o=arguments.length;e.isObject(arguments[o-1])&&(a=arguments[o-1],o-=1);var l=this.getTranslation(t)||t;for(a&&a.escape&&(l=e.escape(l));o>r;)n=s[r],n||(n=new RegExp(i("{"+r+"}"),"g"),s[r]=n),l=l.replace(n,arguments[r]),r++;return l},onLoadSuccess:function(e,t){var i=this.loadingLanguage;e===this.loadingPromise&&(this.loadingPromise=null,
this.loadingLanguage=null,this.language=i,t&&(this.translations[i]=t),n.trigger("change:language",i))},onLoadError:function(e){e===this.loadingPromise&&(this.loadingPromise=null,this.loadingLanguage=null)}};return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(159)],s=function(e,t,i){"use strict";var n={fetchRange:function(e){return e.remove=!1,e.scope="page",e.prepend&&(e.at=0),this.pageStart=e.start,this.pageSize=e.size,this.fetch(e).promise()},populateRange:function(n){
var s=t.Deferred();if(this.hasPendingPopulate())return s.reject().promise();this.populatedRange||(this.populatedRange={start:0,end:0});var a=i.difference(n,this.populatedRange)[0];if(!a)return s.resolve().promise();if(a=i.degap(a,this.populatedRange),n.reloadThreshold&&a.size>n.reloadThreshold)return this.reset([],{silent:!0}),this.populatedRange={start:0,end:0},this.populateRange(e.omit(n,"reloadThreshold"));var r=e.extend(n,a);r.prepend=a.start<this.populatedRange.start;var o=this.fetchRange(r);
return o.done(e.bind(function(e){var t=i.union(this.populatedRange,a)[0].start;this.populatedRange={start:t,end:t+e.length,size:e.length},s.resolve(e)},this)),o.fail(s.reject),s.promise()},remove:function(t,i){var n=e.isArray(t)?t.length:1;this.populatedRange&&this.populatedRange.end&&(this.populatedRange.end-=n)}};return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(2),a=n(s),r=i(4),o=n(r),l=i(1281),c=n(l),u=i(38),d=n(u),h=0,p=100,f={
createASSRenderer:function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];a.default.bindAll(this,"renderSubtitles","resizeSubtitles","getPosition","onSubtitleFailure"),(0,d.default)(e.element,"No element defined for ASS renderer"),this.delay=e.delay||h,this.rendererOptions=e.rendererOptions||{},this.subtitleSize=e.subtitleSize||p,this.el=e.element,this.$el=(0,o.default)(this.el),this.clock=new c.default.renderers.AutoClock(this.getPosition,500),this.debouncedResize=a.default.debounce(this.resizeSubtitles,200),
this.listenTo(this.model,{"change:playing":this.onPlayingChange,"change:paused":this.onPausedChange,"change:buffering":this.onPausedChange,"change:stopped":this.onStoppedChange,"change:error":this.onStoppedChange,"change:showFullScreen":this.onShowFullScreenChange}),this.loadSubtitles().then(this.renderSubtitles,this.onSubtitleFailure)},loadSubtitles:function(){var e=this;this.xhr=new XMLHttpRequest;var t=new c.default.parser.XhrStream(this.xhr),i=new c.default.parser.StreamParser(t);return this.xhr.open("GET",this.model.get("subtitlesUrl"),!0),
this.xhr.send(),this.xhr.onreadystatechange=function(){4===e.xhr.readyState&&200!==e.xhr.status&&e.onSubtitleFailure()},i.minimalASS},renderSubtitles:function(e){var t=a.default.defaults(this.rendererOptions,{enableSvg:!0,preciseOutlines:!1});this.renderer=new c.default.renderers.WebRenderer(e,this.clock,this.el,t),this.setSubtitleSize(),this.resizeSubtitles(),(0,o.default)(window).on("resize",this.debouncedResize)},setSubtitleSize:function(){var e=this.renderer._ass._properties,t=this.subtitleSize/100;
e._resolutionX/=t,e._resolutionY/=t},resizeSubtitles:function(){this.renderer.resize(this.$el.width(),this.$el.height())},getPosition:function(){var e=this.model.get("position"),t=this.model.get("offset")||0,i=(e-t+this.delay)/1e3;return i},closeASSRenderer:function(){(0,o.default)(window).off("resize",this.debouncedResize),this.clock.disable(),this.xhr&&(this.xhr.onreadystatechange=null)},onPlayingChange:function(e,t){t&&this.clock.play()},onPausedChange:function(e,t){t&&this.clock.pause()},onStoppedChange:function(e,t){
t&&this.clock.disable()},onShowFullScreenChange:function(e,t){this.resizeSubtitles()},onSubtitleFailure:function(){this.model.set("softSubtitlesFailed",!0)}};t.default=f,e.exports=t.default},function(e,t,i){var n,s;n=[i(2),i(19),i(26)],s=function(e,t,i){"use strict";var n={ui:{background:".post-play-background",previousPoster:".item-previous .media-poster",nextPoster:".item-next .media-poster",nextTitle:".next-title",nextSubtitle:".next-subtitle",nextIndex:".next-index",countdown:".countdown"},createCountdown:function(e){
this.totalSeconds=e,this.secondsLeft=this.totalSeconds,this.progressModel=new t.Model({text:this.secondsLeft}),this.updateCountdown()},serializeData:function(){var e=this.nextItem.get("title"),t=this.nextItem.get("grandparentTitle"),i={previous:{title:this.previousItem.get("title")||this.previousItem.get("grandparentTitle"),subtitle:this.episodeIndexFor(this.previousItem)||this.previousItem.get("year")},next:{title:t||e,summary:this.nextItem.get("summary")}};return t?(i.next.subtitle=e,i.next.index=this.episodeIndexFor(this.nextItem)):i.next.subtitle=this.nextItem.get("year"),
i},episodeIndexFor:function(e){var t="";return"episode"===e.get("type")&&(t=i.getSeasonEpisodeIndex({seasonIndex:e.get("parentIndex"),episodePrefix:" \xb7 E{1}",episodeIndex:e.get("index"),date:e.get("originallyAvailableAt"),noLeadingZero:!0})),t},updateCountdown:function(){var t=(new Date).getTime(),i=t-(this.startTime||t);this.startTime=t,this.secondsLeft-=i/1e3,this.secondsLeft>0?(this.progressModel.set("progress",100*(this.secondsLeft/this.totalSeconds)),this.progressModel.set("text",Math.ceil(this.secondsLeft)),
this.countdownAnimator=window.requestAnimationFrame(e.bind(this.updateCountdown,this))):this.trigger("next")},onClose:function(){window.cancelAnimationFrame(this.countdownAnimator)}};return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},,function(e,t,i){var n,s;n=[i(79),i(223),i(89)],s=function(e,t,i){"use strict";var n,s=window.PLEXWEB_INLINE&&window.PLEXWEB_INLINE.acceptLanguage,a=window.navigator;s?n=e.parseHeader(s):a.languages?n=a.languages:a.language?n=[a.language]:a.userLanguage&&(n=[a.userLanguage]);
var r=e.closestLanguage(n)||"en",o=i.extend({defaults:{language:r,autoLogin:!1,extrasPrefixCount:0,debugLevel:t.DISABLED}});return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";function n(e,t){return e?r.default.reduce(t,function(t,i,n){return e[n]!==i&&(t[n]=i),t},{}):t}var s=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var a=i(2),r=s(a),o=i(38),l=s(o),c=i(44),u=s(c),d=i(120),h=s(d),p=i(23),f=s(p),m=f.default.extend({name:"AbstractStorageModel",responseType:h.default.json,
save:function(e,t){var i=this,s=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],a=this.attributes,o=void 0;if(null==e||r.default.isObject(e)?(o=e,s=t):(o={})[e]=t,s=r.default.extend({validate:!0},s),this._warnUnsupportedOptions(s),o&&!s.wait){if(!this.set(o,s))return!1}else if(!this._validate(o,s))return!1;o&&s.wait&&(this.attributes=r.default.extend({},a,o));var l=this.toJSON({syncedOnly:!0});u.default.getInstance().persistDefaults||(l=n(r.default.result(this,"defaults"),l));var c=this._serialize(l),d=u.default.set(this._getStorageKey(),c);
return d.done(function(){i.attributes=a,i.trigger("sync",i,a,s)}),d.fail(function(e){i.trigger("error",i,e,s)}),o&&s.wait&&(this.attributes=a),d},destroy:function(){var e=this,t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this._warnUnsupportedOptions(t),t.wait||this.trigger("destroy",this,this.collection,t);var i=u.default.remove(this._getStorageKey());return i.done(function(i){t.wait&&e.trigger("destroy",e,e.collection,t),e.trigger("sync",e,i,t)}),i.fail(function(i){e.trigger("error",e,i,t);
}),i},sync:function(){this._logError("does not support syncing to a server")},_getStorageKey:function(){var e=r.default.result(this,"storageKey");return(0,l.default)(e,this.name+" requires a `storageKey` property"),e},_fetch:function(){var e=this,t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this._warnUnsupportedOptions(t);var i=u.default.get(this._getStorageKey());return i.done(function(i){i&&e.set(e.parse(i)),e.trigger("sync",e,i,t)}),i.fail(function(i){e.trigger("error",e,i,t)}),
i},_serialize:function(e){var t="";try{t=JSON.stringify(e)}catch(i){this._logError("serialization error: "+i.message)}return t},_warnUnsupportedOptions:function(e){e.parse&&this._logError("does not support the `parse` option. The response from storage is always parsed."),e.success&&this._logError("does not support a `success` callback. Use the returned promise."),e.error&&this._logError("does not support an `error` callback. Use the returned promise.")},_logError:function(e){var t=void 0;try{t=this._getStorageKey();
}catch(i){t="no storageKey"}(0,l.default)(!1,this.name+" ("+t+") "+e)}});t.default=m,e.exports=t.default},function(e,t,i){var n,s;n=[i(29),i(436)],s=function(e,t){"use strict";var i=e.extend({model:t,url:"https://plex-907658.c.cdn77.org/announcements/announcements.json?cb="+(new Date).getTime(),parse:function(e){return JSON.parse(e)}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(17),i(24)],s=function(e,t,i){"use strict";var n=i.extend({whitelistedAttrs:["promo","timestamp","link","thumb","title","description"],
initialize:function(){this.listenTo(t.getInstance(),"change:announcementsLastReadTimestamp",this.onTimestampChange),this.onTimestampChange()},parse:function(t){return e.pick(t,this.whitelistedAttrs)},onTimestampChange:function(){this.set("isUnread",this.get("timestamp")>t.get("announcementsLastReadTimestamp"))}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(19),i(20),i(33)],s=function(e,t,i,n){"use strict";var s=i.extend({mixins:[n],defaultFilterName:"__default",
whitelistedEvents:["add","remove","reset","sort","destroy","sync","request","error"],blacklistedMethods:["_onModelEvent","_prepareModel","_removeReference","_reset","add","initialize","sync","remove","reset","set","push","pop","unshift","shift","sort","parse","fetch","create","model","off","on","listenTo","listenToOnce","bind","trigger","once","stopListening"],constructor:function(e,i){this.superset=e,this._collection=new t.Collection(e.toArray()),this._proxyCollection(this._collection),this.resetFilters(),
this.listenTo(e,{add:this.onSupersetAdd,remove:this.onSupersetRemove,reset:this.onSupersetReset}),this.initialize(i)},_proxyCollection:function(e){this.models=e.models,this._proxyCollectionMethods(e),this._proxyCollectionLength(e),this._proxyCollectionEvents(e)},_proxyCollectionMethods:function(i){var n={};e.each(e.functions(t.Collection.prototype),function(t){e.contains(this.blacklistedMethods,t)||(n[t]=function(){return i[t].apply(i,arguments)})},this),e.extend(this,n)},_proxyCollectionLength:function(e){
var t=function(){this.length=e.length};this.listenTo(e,"all",t),t.call(this)},_proxyCollectionEvents:function(t){var i=function(i){var n=e.toArray(arguments),s="change"===i||"change:"===i.slice(0,7);"reset"===i&&(this.models=t.models),e.contains(this.whitelistedEvents,i)?(e.contains(["add","remove","destroy"],i)?n[2]=this:e.contains(["reset","sort"],i)&&(n[1]=this),this.trigger.apply(this,n)):s&&this.contains(n[1])&&this.trigger.apply(this,n)};this.listenTo(t,"all",i)},addFilter:function(t,i){return i||(i=t,
t=this.defaultFilterName),e.has(this._filters,t)&&this._invalidateCacheForFilter(t),this._filters[t]=this._createFilter(i),this._execFilters(),this.trigger("filtered:add",t),this},removeFilter:function(e){return e||(e=this.defaultFilterName),delete this._filters[e],this._invalidateCacheForFilter(e),this._execFilters(),this.trigger("filtered:remove",e),this},resetFilters:function(){return this._filters={},this._invalidateCache(),this._execFilters(),this.trigger("filtered:reset"),this},getFilters:function(){
return e.keys(this._filters)},hasFilter:function(t){return e.contains(this.getFilters(),t)},refilter:function(t){return e.isObject(t)&&t.cid?this.onSupersetAdd(t):(this._invalidateCache(),this._execFilters()),this},destroy:function(){return this.stopListening(),this.superset=null,this._collection.reset([]),this.length=0,this.trigger("filtered:destroy"),this},_createFilter:function(t,i){if(e.isFunction(t))return t;throw new Error("Unsupported filter type")},_execFilters:function(t){t||(t={});var i=[];
this.superset&&(i=this.superset.filter(e.bind(this._execFiltersOnModel,this))),t.reset?this._collection.reset(i):this._collection.set(i),this.length=this._collection.length},_execFiltersOnModel:function(t){this._filterResultCache[t.cid]||(this._filterResultCache[t.cid]={});var i=this._filterResultCache[t.cid];for(var n in this._filters)if(e.has(this._filters,n)&&(e.has(i,n)||(i[n]=this._filters[n](t)),!i[n]))return!1;return!0},_invalidateCache:function(){this._filterResultCache={}},_invalidateCacheForFilter:function(t){
for(var i in this._filterResultCache)e.has(this._filterResultCache,i)&&delete this._filterResultCache[i][t]},onSupersetAdd:function(e){if(this._filterResultCache[e.cid]={},this._execFiltersOnModel(e)){if(!this._collection.get(e.cid)){for(var t=this.superset.indexOf(e),i=0,n=t-1;n>=0;n-=1)if(this.contains(this.superset.at(n))){i=this.indexOf(this.superset.at(n))+1;break}this._collection.add(e,{at:i})}}else this._collection.get(e.cid)&&this._collection.remove(e);this.length=this._collection.length},
onSupersetRemove:function(e){this.contains(e)&&this._collection.remove(e),this.length=this._collection.length},onSupersetReset:function(){this._execFilters({reset:!0})}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(19),i(17)],s=function(e,t,i){"use strict";var n=t.Model.extend({AWAKE:"awake",ASLEEP:"asleep",IDLE:"idle",NONE:"none",defaults:{state:"none",idleTime:void 0,sleepTime:void 0},initialize:function(t){t||(t={}),e.bindAll(this,"onIdleTimeout","onSleepTimeout"),
this._locks={},this.listenTo(this,{"change:idleTime":this.notice,"change:sleepTime":this.notice})},notice:function(){var e;this.timer=clearTimeout(this.timer),this.has("idleTime")&&!this.isLocked()?(this.timer=setTimeout(this.onIdleTimeout,this.get("idleTime")),e=this.AWAKE):e=this.NONE,this.set("state",e)},isInactive:function(){var e=this.get("state");return e===this.IDLE||e===this.ASLEEP},lock:function(e){this._locks[e]=!0,this.notice()},unlock:function(e){delete this._locks[e],this.notice()},toggleLock:function(e,t){
t?this.lock(e):this.unlock(e)},isLocked:function(){return e.keys(this._locks).length>0},onIdleTimeout:function(){this.set("state",this.IDLE),this.has("sleepTime")?this.timer=setTimeout(this.onSleepTimeout,this.get("sleepTime")):this.timer=clearTimeout(this.timer)},onSleepTimeout:function(){this.set("state",this.ASLEEP),this.timer=clearTimeout(this.timer)}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(29)],s=function(e){"use strict";var t=e.extend({pageSize:10,pages:function(){
return Math.max(Math.ceil(this.length/this.pageSize),1)},page:function(e,t){t||(t={});var i,n=0;return i=t.reverse?this.length-e*this.pageSize:e*this.pageSize-this.pageSize,0>i&&(n=i,i=0),this.models.slice(i,i+this.pageSize+n)}});return t}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(19),i(5),i(17),i(442),i(441)],s=function(e,t,i,n,s,a,r){"use strict";var o=/(auth_token=|accessToken=|X-Plex-Token=)(\"?\w+\"?)/g,l=/(email=)(\"?[^&]+\"?)/g,c=/(password=)([^&]+)/,u=/(address=|host=|uri=)(\"?[^&]+\"?)/g,d=function(e){
return e=e.replace(o,"$1TOKEN"),e.replace(c,"$1PASSWORD")},h=function(e){return e&&e.hasOwnProperty("X-Plex-Token")&&(e["X-Plex-Token"]="TOKEN"),e&&e.hasOwnProperty("Authorization")&&(e.Authorization="BASIC AUTHORIZATION"),e},p=function(e){return e?(e=e.replace(o,'$1"TOKEN"'),e=e.replace(l,'$1"EMAIL"'),e=e.replace(u,'$1"IP ADRRESS"')):void 0},f=i.Collection.extend({model:r,initialize:function(t,i){e.bindAll(this,"onAjaxComplete"),this.parent=i.parent,a.parent=i.parent,this.listenTo(s,"change:instance",this.onSettingsAdapterInstanceChange),
s.hasInstance()&&this.onSettingsAdapterInstanceChange(),this.reconfigure()},reconfigure:function(){this.settings&&this.settings.get("debugLevel")?this.start():this.stop()},start:function(){this.enabled||(this.enabled=!0,this.reset(),this.listenTo(n,"log:message",this.onLogMessage),i.history.on("route",this.onRoute,this),t(document).on("ajaxComplete",this.onAjaxComplete))},stop:function(){this.enabled&&(this.enabled=!1,this.reset(),this.stopListening(n),i.history.off("route",this.onRoute,this),t(document).off("ajaxComplete",this.onAjaxComplete));
},add:function(){this.length>200&&this.shift(),i.Collection.prototype.add.apply(this,arguments)},toJSON:function(){var t=i.Collection.prototype.toJSON.apply(this,arguments);return t.unshift(e.extend({type:"info"},a.toJSON())),t},toJSONString:function(){return JSON.stringify(this.toJSON(),null,2)},onSettingsAdapterInstanceChange:function(){this.settings&&(this.stopListening(this.settings),this.settings=null),s.hasInstance()&&(this.settings=s.getInstance(),this.listenTo(this.settings,"change:debugLevel",this.reconfigure)),
this.reconfigure()},onLogMessage:function(e){this.add(e)},onRoute:function(e,t,i){var n={type:"navigation",route:t,args:i,fragment:window.location.hash};this.add(n)},onAjaxComplete:function(t,i,n){var s={type:"ajax",url:d(n.url),status:i.status};e.isEmpty(n.headers)||(s.headers=h(n.headers)),e.isEmpty(n.data)||(s.params=n.data),200===i.status?2===this.settings.get("debugLevel")?s.response=p(i.responseText):s.responseLength=i.responseText?i.responseText.length:0:(s.statusText=i.statusText,s.response=p(i.responseText)),
this.add(s)}});return f}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(19)],s=function(e){"use strict";var t=e.Model.extend({initialize:function(e,t){this.set("time",new Date)}});return t}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(19),i(42)],s=function(e,t,i){"use strict";var n=t.Model.extend({initialize:function(e,t){this.set("host",window.location.host),this.set("userAgent",window.navigator.userAgent),this.set("browser",i)},toJSON:function(){
var i=this.parent.get("primaryServer"),n=this.parent.get("user"),s=n.get("features");return this.set("version","2.4.39"),i&&(this.set("primaryServerUrl",i.url()),this.set("primaryServerAuthToken",!!i.get("accessToken")),this.set("primaryServerVersion",i.get("versionFull"))),this.set("username",n.get("username")),this.set("cloudUrl",n.server.get("connections")),this.set("cloudAccessToken",!!n.server.get("accessToken")),s&&this.set("userFeatures",e.keys(s).join(", ")),t.Model.prototype.toJSON.apply(this,arguments);
}});return new n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(29),i(444)],s=function(e,t){"use strict";var i=e.extend({model:t});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(15),i(24)],s=function(e,t,i){"use strict";var n=i.extend({whitelistedAttrs:["id","tag","venue","city","country","url","at"],convert:function(i){var n=e.isObject(i)?i:t.parseXML(i);return n},parse:function(i){var n=this.convert(i);return n=e.pick(n,this.whitelistedAttrs),
t.parseInteger(n,["id","at"]),n}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(19),i(24),i(25),i(140),i(141)],s=function(e,t,i,n,s,a,r){"use strict";var o=0,l=function(e){return e instanceof i.Collection?e:e.get("children")},c=function(e){var t=e.get("type"),i="channelDirectory"===t,n=i||t&&"directory"===s.get(t).element||e.get("isFolder"),a=void 0===e.length;return a&&!n},u=function(t){o+=1;var i=e.extend({},t.attributes,{playQueueItemID:o}),n=new r(i,{
server:t.server,parent:t.parent});return n},d=n.extend({defaults:{selectedItem:null,mediaType:null,collection:null,owned:!0,lastAddedItem:null,hasUserAdditions:!1},url:"",initialize:function(e){this.set({mediaType:e.mediaType,collection:new a([],{type:e.mediaType,server:e.server})})},fetch:function(){return t.Deferred().resolve().promise()},queueContent:function(i,n,s){s||(s={});var a=t.Deferred().resolve().promise();return this.isItemQueueable(i)&&(i.get("children")&&e.result(i.get("children"),"url")&&(a=a.then(function(){
return i.get("children").populate()})),a=a.done(e.bind(function(){this.set({lastAddedItem:i,hasUpNext:!0,hasUserAdditions:this.get("collection").length>0,shuffled:!!s.shuffled});var t=this.get("collection").indexOf(n);-1===t&&(t=0);var a=s.next?{at:t+1}:{},r=l(i);if(r){var o=r.filter(c);s.shuffle&&(o=e(o).shuffle());var d=e.map(o,e.bind(u,this));this.get("collection").add(d,a)}else this.get("collection").add(u.apply(this,[i]),a);this.get("collection").trigger("reset",this.get("collection"))},this))),
a},addContent:function(t,i){var n=this.queueContent(t,this.get("selectedItem"),i);return n.done(e.bind(function(){var e=null;i&&i.firstItem?e=this.get("collection").find(function(e){return e.get("key")===i.firstItem.get("key")}):this.get("collection").length&&(e=this.get("collection").at(0)),this.set("selectedItem",e)},this)),n},removeItem:function(e){return e.get("playQueueItemID")===this.get("selectedItem").get("playQueueItemID")?t.Deferred().resolve().promise():(this.set("hasUserAdditions",!0),
this.get("collection").remove(e),this.get("collection").trigger("reset",this.get("collection")),t.Deferred().resolve().promise())},moveItem:function(e,i){if(e===this.get("selectedItem").get("playQueueItemID"))return t.Deferred().resolve().promise();var n=this.get("collection"),s=n.findWhere({playQueueItemID:e});n.remove(s);var a=i||this.get("selectedItem").get("playQueueItemID"),r=n.findWhere({playQueueItemID:a}),o=n.indexOf(r)+1;return this.set("hasUserAdditions",!0),n.add(s,{at:o}),n.trigger("reset",n),
t.Deferred().resolve().promise()},isItemQueueable:function(t){if(t.get("currentSubset")&&"photo"!==t.viewGroup)return!1;if("photoAlbum"===t.get("type")&&!t.isLibraryItem())return!1;var i=["track","episode","movie","photo","clip","userPlaylistItem","photoAlbum","album","season"],n=e(i).contains(t.get("type")),s=l(t),a=s&&s.any(c);return n||a},toggleShuffle:function(){return t.Deferred().resolve().promise()},setRepeatAll:function(e){return t.Deferred().resolve().promise()},yieldOwnership:function(){
var i=this.get("lastAddedItem"),n=e.result(i.get("children")||i,"url");return t.Deferred().resolve(n).promise()},takeOwnership:function(){return t.Deferred().resolve().promise()},supports:function(e){return!(e&&(e.unwatched||e.remoteRefresh))}});return d}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(7),i(15),i(160),i(25),i(35)],s=function(e,t,i,n,s,a){"use strict";var r={album:{title:"title",parentRatingKey:"artist.id",parentTitle:"artist.title"},track:{parentRatingKey:"album.id",
parentTitle:"album.title",grandparentRatingKey:"artist.id",grandparentTitle:"artist.title"}},o=a.extend({cacheKey:null,omittedSaveAttrs:a.prototype.omittedSaveAttrs.concat(["key"]),initialize:function(t,i){var n=i.mediaActions;this.mediaActions=n;var s=e.clone(n.getActionTargets());this.defaults=e.extend({type:s[0].get("type")},s[0].defaults),this.set(this.defaults),this.set(t),this.section=this.getSection(),this.server=s[0].server,this.channel=s[0].channel,this.parent=s[0].parent,this.models=s,this.set("aggregateTitle",this.mediaActions.getActionTargetsTitle());
},sync:function(e,t,i){return i.url=i.url||this.commonUrl(),a.prototype.sync.call(this,e,t,i)},save:function(t){var i=a.prototype.save.apply(this,arguments);return i=i.done(e.bind(function(){e.invoke(this.models,"set",t)},this))},firstItemUrl:function(){return e.result(this.models[0],"url")},commonUrl:function(){return this.sectionUrl()+"/common?"+this.mediaActionsParams()},saveUrl:function(){return this.sectionUrl()+"/all?"+this.mediaActionsParams()},sectionUrl:function(){var e=this.getSection();
return e.url()},mediaActionsParams:function(){var t=this.mediaActions.getActionTargets(),i=t[0],n=s.get(i.get("type")),a=e.map(t,function(e){return e.get("ratingKey")});return"type="+n.id+"&id="+a.join(",")},getSection:function(){var e=this.mediaActions.getActionTargets(),t=e[0];return t.server.getSectionForItem(t)},isNew:function(){return!1},getQueryAttr:function(e){var t=this.get("type"),i=r[t];return i?i[e]||e:e},getQueryAttrSibling:function(e){var t=this.getQueryAttr(e).match(/(^.*\.)(.*$)/);return t?t[1]+("id"===t[2]?"title":"id"):e;
},changedAttributes:function(t){var i=a.prototype.changedAttributes.apply(this,arguments);i=e.reduce(i,function(t,i,n){var s=n.match(/^manualChange\.(.*)/);if(s){if(!i)return t;var a=this.getQueryAttr(s[1]);return e.has(t,a)||(t[a]=this.get(s[1])),t}return-1!==this.omittedSaveAttrs.indexOf(n)?t:(t[n]=i,t)},{},this);var n=r[this.get("type")];if(n){var s;e.each(n,function(t,n){e.has(i,n)&&(s=!0,n!==t&&(i[n]&&(i[t]=i[n]),delete i[n]))},this),s&&e.each(n,function(t,n){var s=this.getQueryAttrSibling(t);
if(e.has(i,t))s!==t&&delete i[s];else{if(e.has(i,s))return;var a=this.get(n);a&&(i[t]=a)}},this)}return i},getSaveParams:function(t,i){var s={};return e.reduce(t.Field,function(e,t){return e[t.name+".locked"]=t.locked,e},s),delete t.Field,e.each(this.tagAttrs,function(i){if(i in t){for(var a=n(i),r=e.pluck(this.get(i),"tag"),o=e.pluck(t[i],"tag"),l=Math.max(r.length,o.length),c=0;l>c;c++)void 0!==o[c]&&(s[a+"["+c+"].tag.tag"]=o[c]);var u=e.filter(r,function(e){return-1===o.indexOf(e)});u.length>0&&(s[a+"[].tag.tag-"]=e.map(u,encodeURIComponent).join(",")),
delete t[i]}},this),e.reduce(t,function(e,t,i){return e[i+".value"]=t,e},s,this),s},convert:function(t){var n=e.isObject(t)?t:i.parseXML(t);return n=a.prototype.convert.call(this,e.omit(n.Common,"type"))},parse:function(i){var n=this.convert(i),s=(n.mixedFields||"").split(",");return e.each(s,function(e){e&&(n[e+"Placeholder"]=t("MIXED"))}),n},clone:function(){return new o(this.attributes,{mediaActions:this.mediaActions,section:this.getSection()})},singleMetadataModel:function(){var e=this.mediaActions.getActionTargets();
return 1===e.length?e[0]:void 0},isSingleMetadataModel:function(){return!!this.singleMetadataModel()}});return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(15),i(24)],s=function(e,t,i){"use strict";var n=i.extend({whitelistedAttrs:["key","marginTop","marginRight","marginBottom","marginLeft","width","height","alignHorizontal","alignVertical","relative","imageScaling","marginScaling"],convert:function(i){var n=e.isObject(i)?i:t.parseXML(i);return n},parse:function(i){
var n=this.convert(i);return n=e.pick(n,this.whitelistedAttrs),t.parseInteger(n,["marginTop","marginRight","marginBottom","marginLeft","width","height"]),n}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(199)],s=function(e,t){"use strict";var i=t.extend({initialize:function(t){this.playQueue=t.playQueue,this.addFilter(e.bind(this.filterAfterUpNext,this)),this.listenForUpNextChanges()},filterAfterUpNext:function(e){var t=this.superset.indexOf(e),i=this.playQueue.getUpNextRange();
return t>i.end}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(7),i(24),i(205),i(200)],s=function(e,t,i,n,s){"use strict";var a=i.extend({defaults:function(){return{pseudo:!0,currentType:0}},initialize:function(){var i=[{key:"title",title:t("Name"),defaultDirection:"asc",isDefault:!0},{key:"viewCount",title:t("Plays")},{key:"lastViewedAt",title:t("Last Played")},{key:"duration",title:t("Duration")},{key:"addedAt",title:t("Date Added")}],a=new n([],{section:this,
server:this.server});e.each(i,function(e){a.create(e)}),this.set({items:new s([],{filterOptions:this,server:this.server}),title:t("Playlists"),sorts:a})}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(29),i(451)],s=function(e,t){"use strict";var i=e.extend({model:t,url:function(){return"/system/search?query="+this.query},initialize:function(e,t){this.query=t.query},parse:function(e){return this.convert(e,"Provider")}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(2),i(15),i(24)],s=function(e,t,i){"use strict";var n=i.extend({idAttribute:"key",whitelistedAttrs:["key","machineIdentifier","type","title"],convert:function(i){var n=e.isObject(i)?i:t.parseXML(i);return n},parse:function(t){var i=this.convert(t);return i=e.pick(i,this.whitelistedAttrs)}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(25),i(40)],s=function(e,t,i){"use strict";var n=i.extend({pageStart:0,pageSize:0,url:function(){
var t=this.section.get("currentFolderKey");if(t)return t;var i=e.result(this.section,"url"),n=this.section.get("currentSubset"),s=n.id;if(!this.section.get("allowAdvancedFilters")){var a=this.section.get("currentFilters");return a.length?a[0].values[0]:i+"/"+s}("recentlyAdded"===s||"newest"===s)&&(s="all");var r=i+"/"+s,o=this.getUrlParams();return o.length&&(r+=r.indexOf("?")>-1?"&":"?",r+=o),r},initialize:function(e,t){i.prototype.initialize.apply(this,arguments),this.server.get("isFullServer")||(this.pageStart=null,
this.pageSize=null)},clear:function(e){this.server.get("isFullServer")?(this.pageStart=0,this.pageSize=0):(this.pageStart=null,this.pageSize=null),i.prototype.clear.apply(this,arguments)},getUrlParams:function(){var e=this.getFilterUrlParams({sendType:!0});return this.section.get("refreshing")&&this.server.supports("timelineState")&&e.push("timelineState=1"),e.length?e.join("&"):""},getFilterUrlParams:function(i){i||(i={});var n={},s=[],a=this.getMediaType().id;i.sendType&&a&&a!==t.get("photo").id&&(n.type=a);
var r=this.section.get("currentFilters");e.each(r,function(e){e.values.length&&(n[e.key]=e.values.join(","))});var o=this.getSort();o&&(n.sort=o);for(var l in n)"unviewedLeafCount"===l?s.push(l+">="+n[l]):s.push(l+"="+n[l]);return s},getMediaType:function(){var e=this.section.get("currentType"),i=this.section.get("currentSubset");e||(e=t.get(this.section.get("type")));var n=i.id;if(/^(onDeck|recentlyAdded|recentlyViewed|newest)$/.test(n)){var s=e.id;if(s===t.get("show").id||s===t.get("season").id)return t.get("episode");
if(s===t.get("artist").id||s===t.get("track").id)return t.get("album")}else if(/^recentlyViewedShows$/.test(n))return t.get("show");return this.parent&&"season"===this.parent.get("type")?t.get("episode"):e},getSort:function(){var e=this.section.get("currentSort"),t=this.section.get("currentSubset").id;return"recentlyAdded"===t?"addedAt:desc":"newest"===t?"originallyAvailableAt:desc":e?e.id+":"+e.get("direction"):!1}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(40),i(201)],
s=function(e,t,i){"use strict";var n=t.extend({model:i,url:function(){return"/sync/items/"+this.syncItemId},initialize:function(e,t){this.syncItemId=t.syncItemId},parse:function(i){var n=t.prototype.parse.apply(this,arguments);return e.each(n,e.bind(function(e){e.syncItemId=this.syncItemId},this)),n}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(2),a=n(s),r=i(14),o=n(r),l=i(27),c=n(l),u=i(119),d=n(u),h=c.default.extend({
name:"FilterCollection",context:["server","section","includeAdvanced"],model:d.default,comparator:"filterType",includeAdvanced:!0,url:function(){var e=a.default.result(this.section,"url"),t=this.section.get("currentType"),i={includeAdvanced:this.includeAdvanced?1:0};return t&&(i.type=t.id),o.default.join([e,"/filters"],i)},findUnwatchedFilter:function(){return this.get("unwatched")||this.get("unwatchedLeaves")}});t.default=h,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{
value:!0});var s=i(21),a=n(s),r=i(23),o=n(r),l=o.default.extend({name:"FilterOptionModel",context:["server","section","type","standalone"],idAttribute:"key",rootPropertyName:"Directory",syncedAttrs:{key:a.default.string,type:a.default.string,title:a.default.string}});t.default=l,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(2),a=n(s),r=i(27),o=n(r),l=i(203),c=n(l),u=o.default.extend({name:"FirstCharacterCollection",context:["server","section"],
model:c.default,url:function d(){var e=a.default.result(this.section,"url")+"/firstCharacter",t=this.getUrlParams(),d=t?e+"?"+t:e;return d},getUrlParams:function(){var e={},t=[],i=this.section.get("currentType");i&&(e.type=i.id);var n=this.section.get("currentFilters");return a.default.each(n,function(t){t.values.length&&(e[t.key]=t.values.join(","))}),a.default.each(e,function(i,n){"unviewedLeafCount"===n?t.push(n+">="+e[n]):t.push(n+"="+e[n])}),t.join("&")}});t.default=u,e.exports=t.default},function(e,t,i){
"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(2),a=n(s),r=i(27),o=n(r),l=i(458),c=n(l),u=o.default.extend({name:"LinearFilterCollection",context:["server","section"],model:c.default,url:function(){return a.default.result(this.section,"url")},filterBySecondary:function(){var e=this.filter(function(e){return e.get("secondary")});return this.clone(e)}});t.default=u,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{
value:!0});var s=i(21),a=n(s),r=i(23),o=n(r),l=i(202),c=n(l),u=o.default.extend({name:"LinearFilterModel",context:["server","section"],idAttribute:"key",rootPropertyName:"Directory",syncedAttrs:{secondary:a.default.boolean,key:a.default.string,title:a.default.string},syncedRelations:{options:{relationClass:c.default}},defaults:{secondary:!1}});t.default=u,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(27),a=n(s),r=i(460),o=n(r),l=a.default.extend({
name:"LocationCollection",context:["server","section"],model:o.default});t.default=l,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(21),a=n(s),r=i(23),o=n(r),l=o.default.extend({name:"LocationModel",context:["server","section"],rootPropertyName:"Location",syncedAttrs:{id:a.default.integer,path:{type:a.default.string,save:!0}}});t.default=l,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{
value:!0});var s=i(27),a=n(s),r=i(204),o=n(r),l=a.default.extend({name:"MediaTypeCollection",context:["server","section"],model:o.default});t.default=l,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(27),a=n(s),r=i(74),o=n(r),l=a.default.extend({name:"SectionCollection",context:["server"],model:o.default,url:"/library/sections"});t.default=l,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{
value:!0});var s=i(2),a=n(s),r=i(27),o=n(r),l=i(142),c=n(l),u=o.default.extend({name:"SectionSubsetCollection",context:["server","section"],model:c.default,url:function(){return a.default.result(this.section,"url")},filterPrimaries:function(){var e=this.filter(function(e){return e.get("primary")});return this.clone(e)}});t.default=u,e.exports=t.default},function(e,t,i){var n,s;n=[i(2),i(59),i(244),i(25),i(142),i(24)],s=function(e,t,i,n,s,a){"use strict";var r=a.extend({initialize:function(t,i){this.storage=i.storage,
this.section=i.section,this.type=i.type,this.filters=i.filters,this.sortKey=i.sortKey,this.sortDirection=i.sortDirection,this.subset=i.subset,this.debouncedStorageSave=e.debounce(e.bind(this.storage.save,this.storage),300)},_fetch:function(i){i=i||{};var n=t.alwaysResolve(this.storage.fetch());return n=n.done(e.bind(function(){this.type&&this.storage.set("typeID",this.type),this.sortKey&&this.sortDirection&&this.storage.set({sortKey:this.sortKey,sortDirection:this.sortDirection}),this.subset&&this.storage.set("subset",this.subset),
this.filters&&this.filters.length&&this.storage.set("filters",this.filters)},this)),n=n.then(e.bind(function(){return this.fetchSort().then(e.bind(function(e){e&&e.set("direction",this.storage.get("sortDirection")||e.get("defaultDirection"))},this))},this)),n=n.done(e.bind(this.storage.save,this.storage)),n.then(e.constant(this))},fetchSort:function(){var t=this.section.get("sorts");t.typeID=this.storage.get("typeID");var i=t.populate();return t.typeID=null,i=i.then(e.bind(function(){var e,i=this.storage.get("sortKey");
return i&&(e=t.findWhere({key:i})),this.sort=e||t.findWhere({isDefault:!0}),this.sort},this))},getType:function(){var e=this.storage.get("typeID")||n.get(this.section.get("type")).id,t=this.section.get("types");return t.get(e)},getSubsetModel:function(){var e,t=this.storage.get("subset");t&&(e=i.get(t)),e||(this.storage.set("subset","all"),e=i.get("all"));var n=new s(e,{server:this.section.server,section:this.section});return n},getSort:function(){return this.sort&&this.sort.set("selected",!0),this.sort;
},getFilters:function(){return this.storage.get("filters")||[]},refreshAttributes:function(){var e=this.section.get("currentType");e&&this.storage.set("typeID",e.get("id"));var t=this.section.get("currentSubset");t&&this.storage.set("subset",t.get("key"));var i=this.section.get("currentSort");i&&(this.storage.set("sortKey",i.get("key")),this.storage.set("sortDirection",i.get("direction")||i.get("defaultDirection")));var n=this.section.get("currentFilters");this.storage.set("filters",n)},getSectionAttrs:function(){
return{currentType:this.getType(),currentSubset:this.getSubsetModel(),currentSort:this.getSort(),currentFilters:this.getFilters()}},addListeners:function(){this.listenTo(this.section,{"change:currentType":this.onValueChange,"change:currentSort":this.onValueChange,"change:currentSubset":this.onValueChange,"change:currentFilters":this.onValueChange}),this.listenTo(this.section.get("sorts"),"change:direction",this.onValueChange)},removeListeners:function(){this.stopListening(this.section),this.stopListening(this.section.get("sorts"));
},onValueChange:function(){this.refreshAttributes(),this.debouncedStorageSave()}});return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(242),i(89),i(191)],s=function(e,t,i){"use strict";var n=7776e6,s=t.extend({storageKey:"sectionViewState",serialize:function(i){return t.prototype.serialize.call(this,e.augmentDictionary(i,{ttl:n}))}}),a=i.extend({initialize:function(e,t){i.prototype.initialize.apply(this,arguments),this.section=t.section,this.storage=new s},storageKey:function(){
return this.section.getScopedKey("attrs")},toJSON:function(){var t=i.prototype.toJSON.apply(this,arguments);return e.augmentObj(t,n,!0)}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(24),i(40)],s=function(e,t,i,n){"use strict";var s=i.extend({whitelistedAttrs:["friendlyName","label","capabilities"],defaults:{protocolCapabilities:["playback","timeline","mirror","playqueues"]},initialize:function(){this.set("nowPlaying",new n([],{server:this.server}))},
parse:function(i){var n=e.pick(i,this.whitelistedAttrs);return n.friendlyName=t("<div/>").html(n.friendlyName).text(),n.protocol=i.receiverType,n.volume=i.volume.level,n.muted=i.volume.muted,n}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(27),a=n(s),r=i(468),o=n(r),l=a.default.extend({name:"PlexPlayerCollection",context:["server"],model:o.default,url:"/clients"});t.default=l,e.exports=t.default;
},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(2),a=n(s),r=i(14),o=n(r),l=i(112),c=n(l),u=i(21),d=n(u),h=i(23),p=n(h),f=i(40),m=n(f),g=p.default.extend({name:"PlexPlayerModel",context:["server"],idAttribute:"machineIdentifier",rootPropertyName:"Server",sessionAttrs:{nowPlaying:d.default.instanceOf(m.default).required()},syncedAttrs:{machineIdentifier:d.default.string,name:d.default.string,address:d.default.string,port:d.default.string,deviceClass:d.default.string,
version:d.default.string,product:d.default.string,protocol:d.default.string,protocolVersion:d.default.string,protocolCapabilities:d.default.list},defaults:function(){return{nowPlaying:new m.default([],{server:this.server})}},url:function(){return"http://"+this.get("address")+":"+this.get("port")+"/"},getXHROptions:function(e){return{url:this.resolveUrl(e),dataType:"text",headers:this.getHeaders()}},resolveUrl:function(e){return/^\w+:\/\//.test(e)?e:o.default.join([a.default.result(this,"url"),e]);
},getHeaders:function(){var e=c.default.getInstance(),t=a.default.clone(e);return t}});t.default=g,e.exports=t.default},function(e,t,i){var n,s;n=[i(2),i(7),i(24)],s=function(e,t,i){"use strict";var n=36e5,s=i.extend({defaults:function(){return{canSkipNext:!0,stationSkipsPerHour:1/0,skips:[]}},initialize:function(){var t=[this.get("stationSkipsPerHour"),0];t=e.reject(t,function(e){return e===1/0}),this.maxLength=Math.max.apply(Math,t)},updateTimeout:function(i){this.timeout&&(this.timeout=clearTimeout(this.timeout));
var s=this.get("stationSkipsPerHour");if(s!==1/0){var a=i-n,r=e.filter(this.get("skips"),function(e){return e>=a}),o=r.length>=s?n-(i-e.last(r)):null,l=!o,c=l?"":t("You can skip {1} songs an hour per mix.",this.get("stationSkipsPerHour"));this.set({canSkipNext:l,canSkipNextMessage:c}),o>0&&(this.timeout=setTimeout(e.bind(function(){this.updateTimeout((new Date).getTime())},this),o))}},registerSkip:function(){var e=(new Date).getTime(),t=this.get("skips");t.unshift(e),t.length>this.maxLength&&(t.length=this.maxLength),
this.updateTimeout(e)},stop:function(){this.timeout&&clearTimeout(this.timeout)}},{playQueueAttributes:["stationSkipsPerHour"]});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(14),a=n(s),r=i(16),o=n(r),l=i(11),c=n(l),u=i(21),d=n(u),h=i(39),p=n(h),f=i(53),m=n(f),g=i(145),v=n(g),y=i(75),b=n(y),w=i(197),x=n(w),S=i(473),C=n(S),k=m.default.connectionTestResults,P=m.default.promiseStates,A=d.default.boolean.required(),I=d.default.string.required(),_=m.default.extend({
name:"CloudServerModel",sessionAttrs:{connectionTestResult:d.default.oneOf(k.PENDING,k.CONNECTED,k.UNAVAILABLE,k.UNAUTHORIZED).required(),promiseState:d.default.oneOf(P.PENDING,P.RESOLVED,P.REJECTED).required(),playQueueManager:d.default.instanceOf(x.default).required(),isShared:A,isBundled:A,isCloud:A,isMerged:A,isDownForMaintenance:A,friendlyName:d.default.string,accessToken:d.default.string,baseUrl:I,plexPassUrl:I,accountUrl:I,cloudSyncUrl:I,appsUrl:I,helpUrl:I},sessionRelations:{activeConnection:{
relationClass:b.default,deferred:!0},connections:{relationClass:v.default,options:function(){return{server:this}}},resources:{relationClass:C.default,options:function(){return{server:this}}}},defaults:function(){var e=p.default.get("myPlexScheme")+"://"+p.default.get("myPlexUrl");return{connectionTestResult:k.PENDING,promiseState:P.PENDING,playQueueManager:new x.default({server:this}),isShared:!1,isBundled:!1,isCloud:!0,isMerged:!1,isDownForMaintenance:!1,friendlyName:"plex.tv",baseUrl:e,plexPassUrl:a.default.join([e,"/subscription/about"]),
accountUrl:a.default.join([e,"/users/edit"]),cloudSyncUrl:a.default.join([e,"/cloudsync/providers"]),appsUrl:a.default.join([e,"/downloads"]),helpUrl:"http://support.plex.tv/hc/en-us"}},swizzleNodeUrl:function(e){var t=this.parent.get("primaryServer");return t&&t.get("isConnected")&&t.get("allowChannelAccess")?t.swizzleUrl(e):this.swizzleUrl(e,{connection:new b.default({scheme:"https",address:"node.plexapp.com",port:"32443"})})},testAllConnections:function(){var e=this,t=this.get("connections");return(0,
o.default)("[Connections] Testing all %s connection(s) for %s",t.length,this.get("debugName")),t.each(function(t){e.testConnection(t)}),this.populatePromise},testConnection:function(e){var t={server:this,connection:e,url:"/pms/:/ip"},i=c.default.execute("testServerConnection",t).done(this.onConnectionTestSuccess.bind(this)).fail(this.onConnectionTestError.bind(this));return i},deauthenticate:function(){this.get("resources").clear(),this._reject({connectionTestResult:this.get("connectionTestResult"),
accessToken:null})},onConnectionTestSuccess:function(e){var t=this.get("connections").getBestConnection();o.default.info("[Connections] Active connection to %s is %s",this.get("debugName"),t.id),this.startCapturingChangeEvents(),this.set({isDownForMaintenance:!1,connectionTestResult:k.CONNECTED,activeConnection:t}),this.releaseCapturedChangeEvents()},onConnectionTestError:function(e,t){e.get("isAborted")||this.get("connections").hasOnlyFailedConnections()&&this._reject({isDownForMaintenance:503===t.status
})}});t.default=_,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(27),a=n(s),r=i(472),o=n(r),l=a.default.extend({name:"ConnectionSourceCollection",context:["server"],model:o.default});t.default=l,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(21),a=n(s),r=i(23),o=n(r),l=o.default.extend({name:"ConnectionSourceModel",context:["server"],sessionAttrs:{
id:a.default.string}});t.default=l,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(14),a=n(s),r=i(39),o=n(r),l=i(27),c=n(l),u=i(474),d=n(u),h=c.default.extend({model:d.default,context:["server"],url:function(){var e={};return o.default.get("allowHttpsMediaServerConnections")&&(e.includeHttps=1),o.default.get("shouldFilterPublicMediaServerConnections")&&(e.filterByPublic=1),a.default.join("/api/resources",e)}});t.default=h,
e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(21),a=n(s),r=i(23),o=n(r),l=i(145),c=n(l),u=o.default.extend({name:"ResourceModel",context:["server"],idAttribute:"clientIdentifier",rootPropertyName:"Device",urlRoot:"/api/resources",syncedAttrs:{clientIdentifier:a.default.string,name:a.default.string,sourceTitle:a.default.string,accessToken:a.default.string,product:a.default.string,productVersion:a.default.string,platform:a.default.string,
platformVersion:a.default.string,device:a.default.string,provides:a.default.list,owned:a.default.boolean,home:a.default.boolean,synced:a.default.boolean,presence:a.default.boolean,publicAddressMatches:a.default.boolean,httpsRequired:a.default.boolean,createdAt:a.default.integer,lastSeenAt:a.default.integer},syncedRelations:{connections:{relationClass:c.default,rootPropertyName:"Connection"}}});t.default=u,e.exports=t.default},function(e,t,i){var n,s;n=[i(2),i(15),i(24)],s=function(e,t,i){"use strict";
var n=i.extend({idAttribute:"key",whitelistedAttrs:["key","name","defaultAudioLanguage","autoSelectAudio","defaultSubtitleLanguage","subtitleMode"],url:function(){return this.get("key")},convert:function(i){var n=e.isObject(i)?i:t.parseXML(i);return n.Account&&(n=n.Account),t.parseBoolean(n,"autoSelectAudio"),n},parse:function(t){var i=this.convert(t);return i=e.pick(i,this.whitelistedAttrs)}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(439),i(477)],s=function(e,t,i){
"use strict";var n=t.extend({model:i,url:"/servers",pageSize:20,limit:1e3,initialize:function(){this.startTime=new Date,this.listenTo(this.server,"socket:setting",this.onSettingChange),this.listenTo(this.server,"socket:timeline",this.onTimeline),this.listenTo(this.server,"socket:status",this.onStatus),this.listenTo(this.server,"socket:playing",this.onPlaying),this.listenTo(this.server,"socket:websocket",this.onWebSocket)},add:function(e){this.length+1>this.limit&&this.remove(this.at(0)),t.prototype.add.apply(this,arguments);
},onSettingChange:function(t){t.label&&this.add(e.extend({_type:"setting"},t),{parse:!0})},onTimeline:function(t){1===t.state||t.sectionID<0||this.add(e.extend({_type:"timeline"},t),{parse:!0})},onStatus:function(t){"ProgressNotification"!==t._elementType&&this.add(e.extend({_type:"status"},t),{parse:!0})},onPlaying:function(t){this.add(e.extend({_type:"playing"},t),{parse:!0})},onWebSocket:function(t){this.add(e.extend({_type:"websocket"},t),{parse:!0})}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(24)],s=function(e){"use strict";var t=0,i=e.extend({idAttribute:"id",parse:function(e){var i=e;return i.time=new Date,i.id="evt"+t++,"preference"===i._type&&(i.value=String(i.value)),i}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(15),i(24)],s=function(e,t,i){"use strict";var n=i.extend({url:"/myplex/account",whitelistedAttrs:["username","mappingState","mappingError","mappingErrorMessage","signInState","publicAddress","publicPort","privateAddress","privatePort","subscriptionActive","subscriptionState"],
defaults:{signedIn:!1,remoteAccessState:"",mappingState:"",mappingError:"",mappingErrorMessage:"",signInState:"",publicAddress:"",publicPort:"",privateAddress:"",privatePort:""},isNew:function(){return!this.get("signedIn")},convert:function(i){var n=e.isObject(i)?i:t.parseXML(i);return e.defaults(n,e.result(this,"defaults")),n},parse:function(t){var i=this.convert(t);return i=e.pick(i,this.whitelistedAttrs),"ok"===i.signInState?i.signedIn=!0:(i.signedIn=!1,i.username=""),i.signedIn&&"mapped"===i.mappingState&&!i.mappingError?i.remoteAccessState="ok":(!i.signedIn||i.mappingError)&&(i.remoteAccessState="unreachable"),
i},isWaiting:function(){var e=this.get("remoteAccessState");return"connecting"===e||"disconnecting"===e}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(15),i(24)],s=function(e,t,i){"use strict";var n=i.extend({idAttribute:"id",url:"/:/prefs",defaults:{type:"string",summary:"",label:"",group:""},whitelistedAttrs:["id","label","default","summary","value","type","group","advanced","option","hidden","enumValues","values"],convert:function(i){var n=e.isObject(i)?i:t.parseXML(i);
return"bool"===n.type?t.parseBoolean(n,"value"):("int"===n.type||"enum"===n.type)&&t.parseInteger(n,"value"),t.parseBoolean(n,["advanced","hidden"]),n},parse:function(t){var i=this.convert(t);if(i=e.pick(i,this.whitelistedAttrs),i.enumValues&&!e.isArray(i.enumValues)&&(i.enumValues=e.map(i.enumValues.split("|"),function(e){var t=e.indexOf(":"),n=t>0?e.slice(t+1):e,s=t>0?e.slice(0,t):e;return"int"===i.type&&(s=parseInt(s,10)),{label:n,value:s}})),"enum"===i.type&&i.values&&!e.isArray(i.values)){var n=0;
i.enumValues=e.map(i.values.split("|"),function(e){return{label:e,value:n++}})}return i},getSaveParams:function(t,i){if(e.has(t,"FriendlyName")&&this.server.set("friendlyName",t.FriendlyName),e.has(t,"allowMediaDeletion")&&this.server.set("allowMediaDeletion","1"===String(t.allowMediaDeletion)),e.isEmpty(t)){var n={};return n[this.get("id")]=this.get("value"),n}return"value"in t&&(t[this.get("id")]=t.value,delete t.value),t}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;
n=[i(2),i(4),i(5),i(15),i(24)],s=function(e,t,i,n,s){"use strict";var a=s.extend({url:"/updater/status",whitelistedAttrs:["status","canInstall","downloadURL","state","progress","version","error","added","fixed"],defaults:{state:"none",progress:0,version:"",error:"",added:"",fixed:"",shouldInstall:!1},fetch:function(){return this.server.supports("updater")?s.prototype.fetch.apply(this,arguments):t.Deferred().reject().promise()},convert:function(t){var i=e.isObject(t)?t:n.parseXML(t);return n.parseBoolean(i,"canInstall"),
n.parseInteger(i,"status"),n.parseInteger(i.Release,"progress"),i},parse:function(t,i){var n=this.convert(t);return n=e.extend(n,n.Release),n=e.pick(n,this.whitelistedAttrs),0!==n.status&&(n.state="error"),n}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(40),i(211)],s=function(e,t){"use strict";var i=e.extend({model:t,url:"/status/sessions"});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(29),i(483)],s=function(e,t){"use strict";
var i=e.extend({model:t,url:"/sync/transcodeQueue",parse:function(e){return this.convert(e,"TranscodeJob")}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(15),i(24)],s=function(e,t,i){"use strict";var n=i.extend({idAttribute:"syncItemId",whitelistedAttrs:["syncItemId","syncItemTitle","key","type","progress","speed","remaining","size","title","thumb"],convert:function(i){var n=e.isObject(i)?i:t.parseXML(i);return t.parseInteger(n,"syncItemId"),t.parseFloat(n,["progress","speed"]),
n},parse:function(t){var i=this.convert(t);return i=e.pick(i,this.whitelistedAttrs)}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(15),i(24)],s=function(e,t,i){"use strict";var n=i.extend({idAttribute:"key",whitelistedAttrs:["key","progress","throttled","speed","duration","videoDecision","audioDecision","protocol","container","videoCodec","audioCodec","audioChannels","width","height"],url:function(){return"/transcode/sessions/"+this.id},convert:function(i){
var n=e.isObject(i)?i:t.parseXML(i);return n.TranscodeSession&&(n=n.TranscodeSession),t.parseBoolean(n,"throttled"),t.parseInteger(n,["duration","audioChannels"]),n.progress=parseFloat(n.progress),n.speed=parseFloat(n.speed),n},parse:function(t){var i=this.convert(t);return i=e.pick(i,this.whitelistedAttrs)}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(89),a=n(s),r=a.default.extend({storageKey:"manualServers",
defaults:{port1:"32400",port2:"32400"}});t.default=new r,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(27),a=n(s),r=i(487),o=n(r),l=a.default.extend({name:"StoredConnectionCollection",model:o.default});t.default=l,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(21),a=n(s),r=i(23),o=n(r),l=i(488),c=n(l),u=o.default.extend({name:"StoredConnectionModel",
idAttribute:"uri",syncedAttrs:{uri:a.default.string,scheme:a.default.string,address:a.default.string,port:a.default.string},syncedRelations:{sources:{relationClass:c.default}}});t.default=u,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(27),a=n(s),r=i(489),o=n(r),l=a.default.extend({name:"StoredConnectionSourceCollection",model:o.default});t.default=l,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;
Object.defineProperty(t,"__esModule",{value:!0});var s=i(21),a=n(s),r=i(23),o=n(r),l=o.default.extend({name:"StoredConnectionSourceModel",syncedAttrs:{id:a.default.string}});t.default=l,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(27),a=n(s),r=i(491),o=n(r),l=a.default.extend({name:"StoredServerCollection",model:o.default});t.default=l,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{
value:!0});var s=i(2),a=n(s),r=i(21),o=n(r),l=i(23),c=n(l),u=i(486),d=n(u),h=c.default.extend({name:"StoredServerModel",idAttribute:"machineIdentifier",syncedAttrs:{machineIdentifier:o.default.string,friendlyName:o.default.string,accessToken:o.default.string,sourceTitle:o.default.string,home:o.default.boolean,synced:o.default.boolean,serverClass:o.default.string,isShared:o.default.boolean},syncedRelations:{connections:{relationClass:d.default}},copyFromServer:function(e){var t={};a.default.each(this.syncedAttrs,function(i,n){
t[n]=e.get(n)}),this.set(t)}});t.default=h,e.exports=t.default},function(e,t,i){var n,s;n=[i(2),i(29),i(493)],s=function(e,t,i){"use strict";var n=t.extend({model:i,url:"/devices.xml",parse:function(e){return this.convert(e,"Device")},filterSyncDevices:function(t){var i=!(!t||!t.channel),n=t&&t.get("isPlaylist"),s=this.filter(function(e){var t=e.get("SyncList"),s=t&&t.version>=2,a=i&&e.get("isCloudSync"),r=n&&!s;return e.supports("sync-target")&&!a&&!r}),a=e.sortBy(s,function(e){return!e.get("isCloudSync");
});return this.clone(a)},filterByProducts:function(t){var i=this.filter(function(i){return e.contains(t,i.get("product"))});return this.clone(i)},products:function s(){var s=this.map(function(e){return e.get("product")});return e.uniq(s)}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(15),i(24),i(215)],s=function(e,t,i,n){"use strict";var s=i.extend({whitelistedAttrs:["id","clientIdentifier","name","product","productVersion","platform","platformVersion","device","model","provides","screenResolution","screenDensity","lastSeenAt","SyncList"],
url:function(){return"/devices/"+this.id+".xml"},initialize:function(e,t){this.set("syncItems",new n([],{server:this.server,device:this}))},convert:function(i){var n=e.isObject(i)?i:t.parseXML(i);return t.parseInteger(n,"lastSeenAt"),n},parse:function(t){var i=this.convert(t);return i=e.pick(i,this.whitelistedAttrs),i.isCloudSync="cloudsync"===i.platform,i.provides?i.provides=i.provides.split(","):i.provides=[],i},supports:function(t){var i=this.get("provides");return e.indexOf(i,t)>-1}});return s;
}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(110),i(29),i(213)],s=function(e,t,i){"use strict";var n=t.extend({model:i,url:"/api/users",parse:function(e){return this.convert(e,"User")},filterByHome:function(){var t=new e(this);return t.filterBy(function(e){return e.get("home")}),t},filterByUnrestricted:function(){var t=new e(this);return t.filterBy(function(e){return!e.get("restricted")}),t},filterByServerShares:function(t){var i=new e(this);return i.filterBy(function(e){
var i=e.get("serverShares");return!!i.findWhere({machineIdentifier:t})}),i}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(15),i(24)],s=function(e,t,i){"use strict";var n=i.extend({url:"/api/home",whitelistedAttrs:["id","guestUserID","guestEnabled","name"],convert:function(i){var n=e.isObject(i)?i:t.parseXML(i);return t.parseInteger(n,"id"),t.parseBoolean(n,["guestEnabled"]),n},parse:function(t){var i=this.convert(t);return i=e.pick(i,this.whitelistedAttrs);
},getSaveParams:function(t,n){return e.isEmpty(t)?{guestEnabled:this.get("guestEnabled")?"1":"0"}:i.prototype.getSaveParams.apply(this,arguments)}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(110),i(29),i(497)],s=function(e,t,i){"use strict";var n=t.extend({model:i,url:function(){return"/api/invites/"+this.subset},initialize:function(e,t){t||(t={}),this.subset=t.subset||"requests"},parse:function(e){return this.convert(e,"Invite")},filterByHome:function(){var t=new e(this);
return t.filterBy(function(e){return e.get("home")}),t},filterByFriends:function(){var t=new e(this);return t.filterBy(function(e){return!e.get("home")}),t}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(15),i(14),i(24)],s=function(e,t,i,n){"use strict";var s=n.extend({whitelistedAttrs:["id","friend","server","home","friendlyName","username","email","thumb","createdAt","Server"],urlRoot:"/api/invites/requests",url:function a(){var a;if(this.isNew())a=e.result(this,"urlRoot");else{
var t=this.pick("friend","server","home");e.each(e.keys(t),function(e){t[e]=t[e]?"1":"0"}),a=this.collection?e.result(this.collection,"url"):e.result(this,"urlRoot"),a=a.replace(/([^\/])$/,"$1/")+encodeURIComponent(this.get("id")),a=i.join(a,t)}return a},convert:function(i){var n=e.isObject(i)?i:t.parseXML(i);t.parseInteger(n,"createdAt"),t.parseBoolean(n,["friend","server","home"]),t.parseArray(n,"Server");var s=n.Server;return e.each(s,function(e){t.parseInteger(e,"numLibraries")}),n},parse:function(t){
var i=this.convert(t);return i=e.pick(i,this.whitelistedAttrs)}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(29),i(499)],s=function(e,t,i){"use strict";var n=t.extend({model:i,filterByOwned:function(e){var t=this.filter(function(e){return e.get("owned")});return this.clone(t)},filterByShared:function(e){var t=this.filter(function(e){return!e.get("owned")&&!e.get("pending")});return this.clone(t)},getLibraryCount:function(t){var i=this.where(t);return e.reduce(i,function(e,t){
return e+=t.get("numLibraries")},0)},getOwnedLibraryCount:function(){return this.getLibraryCount({owned:!0})},getSharedLibraryCount:function(){return this.getLibraryCount({owned:!1})},getActiveCount:function(){return this.reduce(function(e,t){return t.isActive()&&e++,e},0)}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(15),i(24)],s=function(e,t,i){"use strict";var n=i.extend({whitelistedAttrs:["id","serverId","machineIdentifier","name","owned","admin","pending","lastSeenAt","invitedAt","acceptedAt","allLibraries","numLibraries","allowSync","allowCameraUpload","allowChannels","Section"],
urlRoot:function(){return"/api/servers/"+this.get("machineIdentifier")+"/shared_servers"},isActive:function(){return!(!this.get("numLibraries")&&!this.get("allLibraries"))},convert:function(i){var n=e.isObject(i)?i:t.parseXML(i);n.SharedServer&&(n=n.SharedServer),t.parseInteger(n,["id","serverId","lastSeenAt","invitedAt","acceptedAt","numLibraries"]),t.parseBoolean(n,["owned","admin","pending","allLibraries","allowSync","allowCameraUpload","allowChannels"]),t.parseArray(n,"Section");var s=n.Section;
return e.each(s,function(e){t.parseInteger(e,"id"),t.parseBoolean(e,"shared")}),n},parse:function(t){var i=this.convert(t);return i=e.pick(i,this.whitelistedAttrs),!i.numLibraries&&i.Section.length&&(i.numLibraries=e.where(i.Section,{shared:!0}).length),i}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(29),i(501)],s=function(e,t){"use strict";var i=e.extend({model:t,url:"/pms/social/networks",parse:function(e){return this.convert(e,"Directory")}});return i}.apply(t,n),
!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(15),i(24)],s=function(e,t,i){"use strict";var n=i.extend({idAttribute:"key",whitelistedAttrs:["key","title","linked","maxLength"],convert:function(i){var n=e.isObject(i)?i:t.parseXML(i);return t.parseBoolean(n,["linked","maxLength"]),n},parse:function(t){var i=this.convert(t);return i=e.pick(i,this.whitelistedAttrs)}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{
value:!0});var s=i(21),a=n(s),r=i(23),o=n(r),l=o.default.extend({name:"UserEntitlementModel",syncedAttrs:{id:a.default.string}});t.default=l,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(27),a=n(s),r=i(504),o=n(r),l=a.default.extend({name:"UserFeatureCollection",model:o.default});t.default=l,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(21),a=n(s),r=i(23),o=n(r),l=o.default.extend({
name:"UserFeatureModel",syncedAttrs:{id:a.default.string}});t.default=l,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(21),a=n(s),r=i(23),o=n(r),l=o.default.extend({name:"UserProviderModel",syncedAttrs:{id:a.default.string,territory:a.default.string}});t.default=l,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(21),a=n(s),r=i(23),o=n(r),l=o.default.extend({
name:"UserRoleModel",syncedAttrs:{id:a.default.string}});t.default=l,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(27),a=n(s),r=i(508),o=n(r),l=a.default.extend({name:"StoredUserCollection",model:o.default});t.default=l,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(2),a=n(s),r=i(21),o=n(r),l=i(23),c=n(l),u=i(490),d=n(u),h=i(221),p=n(h),f=i(220),m=n(f),g=i(216),v=n(g),y=i(219),b=n(y),w=c.default.extend({
name:"StoredUserModel",additionalRelations:["servers"],syncedAttrs:{id:o.default.integer,authenticationToken:o.default.string,username:o.default.string,email:o.default.string,title:o.default.string,thumb:o.default.string,pin:o.default.string,home:o.default.boolean,restricted:o.default.boolean,guest:o.default.boolean,hasAllEntitlements:o.default.boolean,lastPrimaryServerID:o.default.string},syncedRelations:{subscription:{relationClass:p.default},roles:{relationClass:m.default},entitlements:{relationClass:v.default
},providers:{relationClass:b.default},servers:{relationClass:d.default}},copyFromUser:function(e){var t=this,i={};a.default.each(this.syncedAttrs,function(t,n){i[n]=e.get(n)}),a.default.each(this.syncedRelations,function(i,n){if(!a.default.contains(t.additionalRelations,n)){var s=t.get(n),r=e.get(n);if(r){var o=r.toJSON();s.set(s.parse(o))}}}),this.set(i)},clearSensitiveAttributes:function(){this.unset("authenticationToken"),this.unset("pin"),this.get("servers").reset()}});t.default=w,e.exports=t.default;
},function(e,t,i){var n,s;n=[i(2),i(9),i(54),i(5)],s=function(e,t,i,n){"use strict";var s=i.extend({initialize:function(){e.bindAll(this,"viewFor")},viewFor:function(e,t){var i=this.viewsByType[e];if(i)return new i(t);throw new Error("No view defined for "+e)},login:function(){var e=this.viewFor,i=t.get("servers"),s=i.findWhere({cloud:!0});n.trigger("show:loading"),s.populate().done(function(){n.trigger("navigate","dashboard")}).fail(function(){var t=s.get("available")?e("signIn"):e("unavailable",{
model:s});n.trigger("show:view",t)})},error:function(){n.trigger("show:view",this.viewFor("notFound",{type:"404"}))},unauthorized:function(t){var i=e.some(this.getUnauthorizedHandlers(),function(e){return e.call(this,t)},this);i||n.trigger("show:view",this.viewFor("notFound",{type:"media"}))},getUnauthorizedHandlers:function(){return[this.handleAuthorized,this.handleServer,this.handleChannelError]},handleAuthorized:function(e){var i=t.get("servers").findWhere({authorized:!0});i||this.populateServersThenRecover();
var n=!i&&!t.get("skipSignIn");return n},handleServer:function(e){var i,s,a=this.viewFor,r=e.options,o=e.server,l=t.get("cloudServer");return r.primaryServer||r.serverID?(!o&&r.primaryServer?s=a("serverRequired"):o?o.get("available")?o.get("authorized")||"resolved"!==l.populatePromise.state()?o.get("authorized")||(i=this.populateServersThenRecover()):s=a("unauthorized"):s=a("unavailable",{model:o}):s=a("notFound",{type:"server"}),s&&n.trigger("show:view",s),!(!s&&!i)):!1},handleChannelError:function(e){
var t=!!e.options.channelID;return t&&n.trigger("show:view",this.viewFor("channelError")),t},populateServersThenRecover:function(){var e=t.get("skipSignIn"),i=t.get("servers"),s=i.findWhere({cloud:!0}),a=this.viewFor;return i.populate().done(function(){s.get("authorized")?n.trigger("navigate:refresh"):e||n.trigger("navigate","login",{silent:!0})}).fail(function(){n.trigger("show:view",a("unavailable",{model:s}))})}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(19),i(5),i(55),i(9)],
s=function(e,t,i,n,s){"use strict";var a=n.extend({initialize:function(){n.prototype.initialize.apply(this,arguments),this.listenTo(i,{"navigate:back":this.onNavigateBack,"navigate:forward":this.onNavigateForward,"navigate:refresh":this.onNavigateRefresh})},onNavigateBack:function(){var t=s.get("history"),i=s.get("forwardHistory");return t.length<2?this.navigate("",{trigger:!0}):(i.unshift(t.pop()),void this.navigate(e.last(t),{trigger:!0}))},onNavigateForward:function(){var e=s.get("forwardHistory");
e.length&&this.navigate(e[0],{trigger:!0})},onNavigateRefresh:function(){t.history.loadUrl(t.history.getFragment())}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s,a=i(957).default;n=[i(2),i(20)],s=function(e,t){"use strict";function i(e){for(var t=a(null),i=0,n=e.length;n>i;i++)t[e[i]]=!0;return t}var n=t.extend({initialize:function(){this.pool=[],this.index={}},lockOrCreate:function(t,n,s){var a=i(t);e.each(t,function(t){if(!this.find(t)){var i=e.find(this.pool,function(e){
return!a[e.id]},this);i||(i={},this.pool.push(i),i.view=n.call(s,i)),this.index[i.id]=void 0,this.index[t]=i,i.id=t}},this)},each:function(t,i){e.each(this.pool,t,i)},filter:function(t,i){var n=e.partition(this.pool,t,i),s=n[0],a=n[1];e.each(a,function(e){e.view.close(),e.view.$el.remove()}),this.pool=s},find:function(e){var t=this.index[e];return t&&t.id===e?t:void 0},findByModel:function(t){return e.find(this.pool,function(e){return e.view.model===t})},close:function(){e.each(this.pool,function(e){
e.view.close()}),this.pool=[],this.index={}},reindex:function(){var t=this.index={};e.each(this.pool,function(e){t[e.id]=e})}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(34),i(148)],s=function(e,t,i){"use strict";var n=i.extend({maxCycles:3,maxSize:50,imageParamsRegex:/&?(width|height|minSize)=([^&]+)/g,_infoMemo:{},store:function(t,i){if(i||(i=this.getItemCacheKey(t)),i){var n=t.url,s=this.getImageInfo(n),a={url:n,blobUrl:t.blobUrl,size:s.size},r=this.get(i);
if(r){if(!r.images.hasOwnProperty(n)){var o=r.sizes;r.images[n]=a;var l=e.sortedIndex(o,a,"size");o.splice(l,0,a)}}else r={images:{},sizes:[a]},r.images[n]=a,this.startListening(),r._cacheKey=i,this._cache[i]=r,this.size++,t.persistInCache||this.setItemCycle(r,i,e.first(this.cycles))}},getItemCacheKey:function(e){var t=this.getImageInfo(e.url);return t.key},getImageInfo:function(e){if(this._infoMemo.hasOwnProperty(e))return this._infoMemo[e];var t={width:0,height:0,minSize:0},i=e.replace(this.imageParamsRegex,function(e,i,n){
return t[i]=parseInt(n,10),""}),n={key:i,size:t.width*t.height+t.minSize};return this._infoMemo[e]=n,n},removeImageInfo:function(e){this._infoMemo.hasOwnProperty(e)&&delete this._infoMemo[e]},getBlobUrl:function(e){var t=this.getImageInfo(e),i=this.get(t.key);if(i){var n=i.images[e];if(n)return n.blobUrl}},getPlaceholder:function(t){var i=this.getImageInfo(t),n=this.get(i.key);if(n){if(n.images[t])return;var s=e.last(n.sizes);return s.blobUrl}},remove:function(n,s){i.prototype.remove.apply(this,arguments),
e.each(n.sizes,function(e){this.removeImageInfo(e.url),t.hasObjectUrl&&window.URL.revokeObjectURL(e.blobUrl)},this)}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2)],s=function(e){"use strict";function t(t){var n=t.get("items"),s=n.length,a=t.get("viewGroup");if("Pictures"===a)return i.tileList;if("List"===a)return i.list;if(n.findWhere({type:"photo"}))return i.tileList;var r=e.compact(n.pluck("summary")),o=e.uniq(n.pluck("thumb")),l=n.reduce(function(e,t){var i=t.get("title");
return i?e+i.length:e},0),c=l/s;return o.length>s/2&&30>c?i.tileList:r.length>s/2?i.detailsList:i.list}var i={tileList:"media-tile-list",detailsList:"media-details-list",list:"media-list"},n={types:i,getListType:t};return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(94),a=n(s);t.formatDate=a.default;var r=i(224),o=n(r);t.formatDays=o.default;var l=i(225),c=n(l);t.formatDaysHours=c.default;var u=i(150),d=n(u);
t.formatDuration=d.default;var h=i(78),p=n(h);t.formatHoursMinutes=p.default;var f=i(226),m=n(f);t.formatMinutes=m.default;var g=i(121),v=n(g);t.formatMinutesLeft=v.default;var y=i(57),b=n(y);t.formatPlayerTime=b.default;var w=i(151),x=n(w);t.formatTimeAgo=x.default;var S=i(227),C=n(S);t.formatTimestamp=C.default},function(e,t){"use strict";function i(e){return e.join(", ")}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;
Object.defineProperty(t,"__esModule",{value:!0});var s=i(94),a=n(s),r=i(41),o=n(r);t.default=(0,o.default)(a.default),e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(227),a=n(s),r=i(41),o=n(r);t.default=(0,o.default)(a.default),e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(155),a=n(s),r=i(41),o=n(r);t.default=(0,o.default)(a.default),e.exports=t.default;
},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(156),a=n(s),r=i(41),o=n(r);t.default=(0,o.default)(a.default),e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(157),a=n(s),r=i(41),o=n(r);t.default=(0,o.default)(a.default),e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(122),a=n(s),r=i(41),o=n(r);
t.default=(0,o.default)(a.default),e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(236),a=n(s),r=i(41),o=n(r);t.default=(0,o.default)(a.default),e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(240),a=n(s),r=i(41),o=n(r);t.default=(0,o.default)(a.default),e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{
value:!0});var s=i(14),a=i(41),r=n(a);t.default=(0,r.default)(s.getLastSegment),e.exports=t.default},,,,function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(20),a=n(s),r=i(5),o=n(r),l=i(33),c=n(l),u=a.default.extend({mixins:c.default,name:"AbstractReporter",enabled:!1,destroyed:!1,_suspended:!1,initialize:function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];e.enabled!==!1&&this.enable()},hasSupport:function(){return!0},enable:function(){
this.enabled||this.destroyed||!this.hasSupport()||(this.enabled=!0,this.listenTo(o.default,{"log:message":this.onLog,"log:group":this.onLog,"log:groupEnd":this.onLog}),this.onEnabled())},disable:function(){this.enabled&&(this.enabled=!1,this.stopListening(),this.onDisabled())},destroy:function(){this.destroyed||(this.disable(),this.destroyed=!0,this.onDestroyed())},_suspend:function(){this._suspended||(this._suspended=!0,this.onSuspended())},_resume:function(){this._suspended&&(this._suspended=!1,
this.onResumed())},onLog:function(e){if(!this._suspended)switch(e.type){case"log:message":this.onLogMessage(e);break;case"log:group":this.onLogGroup(e);break;case"log:groupEnd":this.onLogGroupEnd(e)}},onLogMessage:function(){},onLogGroup:function(){},onLogGroupEnd:function(){},onEnabled:function(){},onDisabled:function(){},onResumed:function(){},onSuspended:function(){},onDestroyed:function(){}});t.default=u,e.exports=t.default},function(e,t,i){"use strict";var n=i(294).default,s=i(8).default;Object.defineProperty(t,"__esModule",{
value:!0});var a,r=i(528),o=s(r),l=i(34),c=s(l),u=i(16),d=s(u),h=(a={},n(a,d.default.LEVEL_LOG,{method:"log",color:"black"}),n(a,d.default.LEVEL_DEBUG,{method:"debug",color:"#d500ff"}),n(a,d.default.LEVEL_INFO,{method:"info",color:"blue"}),n(a,d.default.LEVEL_WARN,{method:"warn",color:"#ff6600"}),n(a,d.default.LEVEL_ERROR,{method:"error",color:"red"}),a),p=o.default.extend({name:"ConsoleReporter",hasSupport:function(){return c.default.hasConsole},onLogMessage:function(e){var t=e.message,i=h[e.level],n=console[i&&i.method||"log"];
i&&i.color?n.call(console,"%c"+t,"color: "+i.color+";"):n.call(console,t)},onLogGroup:function(e){console.group(e.message)},onLogGroupEnd:function(){console.groupEnd()}});t.default=p,e.exports=t.default},function(e,t){"use strict";function i(e){var t=parseInt(Math.floor(Math.log(e)/Math.log(1024)),10);return(e/Math.pow(1024,t)).toFixed(2)+" "+n[t]}Object.defineProperty(t,"__esModule",{value:!0});var n=["B","KB","MB","GB","TB"];t.default=i,e.exports=t.default},function(e,t){"use strict";function i(e){
return e=parseInt(e,10),(e/10).toFixed(1)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(155),a=n(s);t.formatAudioChannels=a.default;var r=i(156),o=n(r);t.formatAudioCodec=o.default;var l=i(157),c=n(l);t.formatBitrate=c.default;var u=i(530),d=n(u);t.formatBytes=d.default;var h=i(122),p=n(h);t.formatResolution=p.default;var f=i(231),m=n(f);t.formatStreamLanguage=m.default;
var g=i(531),v=n(g);t.formatVideoLevel=v.default;var y=i(232),b=n(y);t.formatVideoQuality=b.default},function(e,t,i){"use strict";function n(e){if(e=parseInt(e,10),r.default.isNaN(e))return"";var t=10>e?"0":"";return t+e}var s=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var a=i(2),r=s(a);t.default=n,e.exports=t.default},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5),i(28),i(25),i(16),i(17),i(11),i(35)],s=function(e,t,i,n,s,a,r,o,l,c){"use strict";function u(e){return e.get("isPlaylist")?e.get("playlistType"):a.getChildMediaType(e.get("type")).element;
}function d(t,i){var n=e(i).pick("type","controller","media","offset","media","autoplay","useMiniPlayer","isSwitchingPlayers","inline");if(!n.type){var a=u(t);n.type=s.getTypeByElement(a)}return n}function h(t,i){var n=e(i).pick("shuffle","unwatched","continuous","items","excludeSeedItem"),s="movie"===t.get("type")&&!t.get("viewOffset");return s&&i.supportsContinuous&&(n.extrasPrefixCount=o.get("extrasPrefixCount")),n}function p(i,n){var s=t.Deferred(),a=i.get("type");if(n.siblings&&i.collection){
var r;r=i.parent&&i.parent.get("isPlaylist")?i.parent:i.collection,s.resolve({toPlay:i,toAdd:r})}else if(n.unwatched&&e.contains(["show","season"],a)){var o="show"===a?i:new c({key:i.get("parentKey")},{server:i.server}),l=o.populate({data:{includeOnDeck:"1"}});l.done(function(){var e=o.get("onDeck"),t=e&&"show"===a,n=e&&"season"===a&&e.get("parentRatingKey")===i.id;t||n?s.resolve({toPlay:e,toAdd:i}):s.resolve({toAdd:i})}),l.fail(function(){s.reject()})}else s.resolve({toAdd:i});return s.promise();
}function f(e,i){return e&&e.get("hasUserAdditions")?i.confirmClearPlayQueue():t.Deferred().resolve().promise()}function m(e){return e.controller||e.playQueue?!0:void 0}function g(e,t){return e&&e.get("selectedItem")&&e.get("selectedItem").get("key")===t.get("key")}function v(e){n.trigger("show:alert",{type:"error",message:e||i("Sorry, there was a problem playing this item.")})}function y(i){var n=t.Deferred(),s=i.item||i.items[0],a=d(s,i);if(m(a))return n.resolve(a).promise();var o=h(s,i),c=p(s,i);
return c.done(function(c){c.toPlay&&(o.firstItem=c.toPlay);var u=s.server.get("playQueueManager"),d=u.getFor(c.toPlay||c.toAdd);if(g(d,s))return void(i.isCompanionConnect?(a.model=d.get("selectedItem"),a.playQueue=d,n.resolve(a)):n.reject());var h=f(d,i);h.done(function(){var s,d;if(i.playQueue)s=i.playQueue,d=t.Deferred().resolve().promise();else{if(s=u.createFor(c.toAdd,c.toPlay),!s)return r.warn("Unable to queue item; failed to create play queue"),v(),void n.reject();d=s.addContent(c.toAdd,o)}
a.playQueue=s,a.autoplay=i.autoplay!==!1,n.notify(e.extend({loading:!0},a)),d.done(function(){return s.get("collection").length?void l.execute("persistPlayQueue",null).done(function(){a.model=s.get("selectedItem"),a.playQueue=s,a.autoplay=i.autoplay!==!1,n.resolve(a)}):(r.warn("Unable to queue item; empty play queue"),v(s.get("message")),void n.reject())}),d.fail(function(){r.warn("Unable to queue item; failed to add content"),v(),n.reject()})})}),c.fail(function(){r.warn("Unable to queue item; failed to get next unwatched item"),
v(),n.reject()}),n.promise()}return y}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(20),i(28),i(46),i(536),i(16),i(33),i(484)],s=function(e,t,i,n,s,a,r,o,l){"use strict";var c=i.extend({mixins:o,warningThreshold:2e3,networkReasonThreshold:3e3,startDelay:1e4,syncDelay:500,resyncDelay:1e4,reasons:{TRANSCODER:"transcoder",NETWORK:"network",UNKNOWN:"unknown"},recommendations:{LOWER_QUALITY:"lowerQuality",ORIGINAL_QUALITY:"originalQuality",NONE:"none"},initialize:function(t){
e.bindAll(this,"onSyncCheck"),t||(t={}),this.warningThreshold=t.warningThreshold||this.warningThreshold,this.startDelay=t.startDelay||this.startDelay,this.syncDelay=t.syncDelay||this.syncDelay,this.resyncDelay=t.resyncDelay||this.resyncDelay,this._clock=new a,this.setModel(t.model)},setModel:function(e){this.model=e},start:function(){this._hasWarned=!1,this._startedAt=this._clock.now(),this._clock.setPosition(this.model.get("position")),this.listenTo(this.model,{"change:state":this.onStateChange,
"change:position":this.onPositionChange})},stop:function(){this._cancelSyncCheck(),this.stopListening(),this._startedAt=null,this._resyncedAt=null},seek:function(e){this._startedAt=this._clock.now(),this._cancelSyncCheck(),this._clock.pause()},determineReason:function(){var i=t.Deferred(),n=this.determineReasonFromBuffer(),s=this.fetchTranscodeSession();return s.done(e.bind(function(e){var t=this.determineReasonFromTranscode(e);t===this.reasons.UNKNOWN&&(t=n),i.resolve(t)},this)),s.fail(e.bind(function(){
i.resolve(n)},this)),i.promise()},determineReasonFromTranscode:function(e){return!e.get("throttled")&&e.get("speed")<1?this.reasons.TRANSCODER:this.reasons.UNKNOWN},determineReasonFromBuffer:function(){var e=this.model.get("position"),t=this.model.get("endBuffer");return t&&t-e<this.networkReasonThreshold?this.reasons.NETWORK:this.reasons.UNKNOWN},fetchTranscodeSession:function(){if(this.model.get("directPlay"))return t.Deferred().reject().promise();var e=this.model.get("session"),i=this.model.get("transcodeServer"),n=new l({
key:e},{server:i});return n.fetch()},determineRecommendation:function(t){var i,n=this.model.get("qualityIndex");if(t===this.reasons.TRANSCODER)n>=0&&(i=this.recommendations.ORIGINAL_QUALITY);else if(t===this.reasons.NETWORK){var a=this.model.get("transcodeServer"),r=this.model.get("media"),o=s.getAvailableQualitiesFor(r,a);if(o.length&&this.model.get("canSetQuality")){var l=e.reduce(o,function(e,t){return e&&e.index<t.index?e:t});(0>n||n>l.index)&&(i=this.recommendations.LOWER_QUALITY)}}return i?i:this.recommendations.NONE;
},_scheduleSyncCheck:function(){this._syncChecker||(this._syncChecker=setTimeout(this.onSyncCheck,this.syncDelay))},_cancelSyncCheck:function(){this._syncChecker=clearTimeout(this._syncChecker)},_shouldPlayClock:function(){return this.model.get("playing")||this.model.get("buffering")},onStateChange:function(e,t){this._shouldPlayClock()||(this._cancelSyncCheck(),this._clock.pause(),this._clock.setPosition(e.get("position")))},onPositionChange:function(e,t){this._shouldPlayClock()&&(this._clock.play(),
this._scheduleSyncCheck())},onSyncCheck:function(){var t=this._clock,i=t.now(),n=t.getPosition(),s=this.model.get("position"),a=n-s;this._startedAt+this.startDelay>i?t.setPosition(s):a>this.warningThreshold?(t.setPosition(s),this.model.get("buffering")||this.trigger("buffering"),this._hasWarned||(this._hasWarned=!0,this.determineReason().done(e.bind(function(e){r.warn("Player: Excessive buffering detected; "+e),this.trigger("warn",{reason:e,recommendation:this.determineRecommendation(e)})},this)))):this._resyncedAt?i-this._resyncedAt>this.resyncDelay&&(this._resyncedAt=null,
t.setPosition(s)):this._resyncedAt=i,this._syncChecker=null,this._scheduleSyncCheck()}});return c}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(20)],s=function(e,t){"use strict";var i=t.extend({_position:0,_timestamp:null,now:function(){return e.now()},play:function(){null==this._timestamp&&(this._timestamp=this.now())},pause:function(){this._position=this.getPosition(),this._timestamp=null},getPosition:function(){return null!=this._timestamp?this.now()-this._timestamp+this._position:this._position;
},setPosition:function(e){this._position=e,null!=this._timestamp&&(this._timestamp=this.now())}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(158)],s=function(e,t){"use strict";var i=e.extend({},t,{type:"music",qualities:{bitrate:[96,128,192,320]},getNearestIndexToBitrate:function(e){return this.getNearestIndex(this.qualities.bitrate,e)}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(7),i(158)],s=function(e,t,i){"use strict";
var n=e.extend({},i,{type:"photo",qualities:{photoResolution:["720x480","1280x720","1920x1080","3840x2160"],photoQuality:[24,49,74,99],title:function(){return[t("Low"),t("Medium"),t("High"),t("Highest")]}},getNearestIndexToQuality:function(e){return this.getNearestIndex(this.qualities.photoQuality,e)}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(20),i(34),i(68),i(15),i(33),i(9),i(75)],s=function(e,t,i,n,s,a,r,o,l){"use strict";var c=i.extend({mixins:r,
url:function u(){var e=o.get("user"),t="/sub/"+this.requestType+"/"+e.id+"/"+o.get("clientID"),i=new l({scheme:"websockets"===this.requestType?"wss":"https",address:"pubsub.plex.tv"}),u=this.server.resolveUrl(t,{connection:i,appendToken:!0});return u},initialize:function(t){e.bindAll(this,"onSocketOpen","onSocketClose","onSocketError","onSocketMessage","onPollSuccess","onPollError"),this.server=t.server},open:function(){return(this.socket||this.pollRequest)&&this.close(),n.hasWebSocket?(this._deferred=t.Deferred(),
this.requestType="websockets",this.socket=new WebSocket(e.result(this,"url")),this.socket.onopen=this.onSocketOpen,this.socket.onclose=this.onSocketClose,this.socket.onerror=this.onSocketError,this.socket.onmessage=this.onSocketMessage,this._deferred.promise()):this.poll()},close:function(){this.pollRequest&&(s.abort(this.pollRequest.rid),this.pollRequest=null),this._deferred&&"pending"===this._deferred.state()&&this._deferred.reject(),this.socket&&(this.socket.onopen=null,this.socket.onclose=null,
this.socket.onerror=null,this.socket.onmessage=null,this.socket.close(),this.socket=null)},poll:function(){this.requestType="longpolling",this.pollUrl=e.result(this,"url");var i=this.server.getXHROptions(this.pollUrl);return this.pollRequest=t.ajax(i).done(this.onPollSuccess).fail(this.onPollError),this.pollRequest.promise()},handleResponse:function(t){if(t){var i=a.parseXML(t);if(e.isObject(i)){var n=this[i.command];e.isFunction(n)&&n.call(this,i)}}},relayStarted:function(e){var t=o.get("servers"),i=t.get(e.clientIdentifier);
i&&i.addConnection({address:e.host,port:e.port,accessToken:i.get("accessToken"),relay:!0})},onSocketOpen:function(e){this.trigger("open",this.server,e),this._deferred.resolve(this.server,e)},onSocketClose:function(e){this.close(),this.trigger("close",this.server,e),this._deferred.reject(this.server,e)},onSocketError:function(e){this.close(),this.trigger("error",this.server,e),this._deferred.reject(this.server,e)},onSocketMessage:function(e){this.handleResponse(e.data)},onPollSuccess:function(e){this.trigger("open",this.server,e),
this.handleResponse(e),this.poll()},onPollError:function(e){this.pollRequest.aborting||this.trigger("error",this.server,e)}});return c}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t){"use strict";function i(e){return e?e.toLowerCase():""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i,e.exports=t.default},function(e,t){"use strict";function i(e){for(var t="",i=0,n=e.length;n>i;i++){var s=e.charAt(i),a=s.toUpperCase();t+=0===i?a:s===a?" "+a:s}return t}Object.defineProperty(t,"__esModule",{
value:!0}),t.default=i,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(238),a=n(s);t.escapeRegExp=a.default;var r=i(239),o=n(r);t.formatBoolean=o.default;var l=i(541),c=n(l);t.formatPropertyLabel=c.default;var u=i(98),d=n(u);t.pluralize=d.default;var h=i(162),p=n(h);t.random=p.default;var f=i(543),m=n(f);t.toStableJSON=m.default;var g=i(540),v=n(g);t.toLowerCase=v.default;var y=i(160),b=n(y);t.toLowerCaseFirstLetter=b.default;
var w=i(235),x=n(w);t.toTitleCase=x.default;var S=i(236),C=n(S);t.toUpperCase=C.default;var k=i(123),P=n(k);t.toUpperCaseFirstLetter=P.default;var A=i(161),I=n(A);t.base64=I.default;var _=i(237),T=n(_);t.utf8=T.default;var D=i(163),E=n(D);t.truncate=E.default;var M=i(240),R=n(M);t.truncateFilename=R.default;var O=i(164),L=n(O);t.truncateMiddle=L.default},function(e,t,i){"use strict";function n(e){var t=r.default.keys(e).sort();return JSON.stringify(r.default.reduce(t,function(t,i){return t[i]=e[i],
t},{}))}var s=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var a=i(2),r=s(a);t.default=n,e.exports=t.default},function(e,t,i){var n,s;n=[i(2),i(163),i(25)],s=function(e,t,i){"use strict";function n(n){function s(i){var s=e.escape(t(i.tag,n.maxLen));if(!l||!i.id)return s;var a=["#!/server/"+encodeURIComponent(o.server.id),"/section/"+encodeURIComponent(o.id),"/filter","/"+encodeURIComponent(c.id),"/"+encodeURIComponent(n.key),"/"+encodeURIComponent(i.id),"/"+encodeURIComponent(i.tag)];
return'<a class="pivot-link" href="'+a.join("")+'">'+s+"</a>"}var a=e.reject(n.tags,function(e){return!e.tag}),r=n.model,o=r.section,l=o&&o.get("allowAdvancedFilters"),c=i.get(r.get("type")),u=n.separator||", ",d="";if(a&&a.length){var h=n.maxTags||a.length;h>a.length&&(h=a.length);for(var p=0;h>p;p++)d+=s(a[p]),h>p+1&&(d+=u)}return d}return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(246)],s=function(e){"use strict";var t=e.extend({minDelay:500,maxJobAge:12e4,schedule:function(e,t){
return 2e3},timeout:function(e){var t=e.get("update");t.set("state","error")}});return t}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(246)],s=function(e){"use strict";var t=e.extend({minDelay:3e3,maxDelay:6e5,schedule:function(e,t){return Math.max(Math.min(Math.floor(1.15*t),this.maxDelay),this.minDelay)}});return t}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(247)],s=function(e){"use strict";var t=e.extend({minDelay:3e3,maxDelay:6e5,initialize:function(t){
e.prototype.initialize.apply(this,arguments),this.serverEventManager=t},process:function(e,t){return this.serverEventManager.connect({server:e})},schedule:function(e,t){return Math.max(Math.min(Math.floor(2*t),this.maxDelay),this.minDelay)},logRescheduledJob:function(t,i){e.prototype.logRescheduledJob.call(this,t,{prefix:"[Connections]",jobName:"server events connection",subjectName:t.data.get("debugName"),delay:i.delay})}});return t}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;
n=[i(2),i(6),i(241),i(511)],s=function(e,t,i,n){"use strict";var s=t.View.extend({initialize:function(){t.View.prototype.initialize.apply(this,arguments),this.pool=new n(this)},render:function(){this.isRendered||this.triggerMethod("before:render",this),this.isRendered=!0;var e=this.getLockIndexes();this.pool.lockOrCreate(e,this.createCellView,this),this.scheduleFilling(e),this.prepareCells(e),this.pool.each(this.moveCell,this),this.moveElement(),this.clearVisibleReusedCells()},createCellView:function(i){
var n=t.getOption(this,"itemView"),s=t.getOption(this,"itemViewOptions");e.isFunction(s)&&(s=s.call(this,i));var a=new n(s);return a.render(),this.$el.append(a.$el),a},scheduleFilling:function(t){i.cancel(this.cid),e.each(t,function(e){var t=this.pool.find(e);t.filledWithIndex!==t.id&&i.enqueue(function(){var e=this.fillCell(t);return e&&(t.filledWithIndex=t.id),e},this,this.cid)},this)},prepareCells:function(){this.pool.each(this.prepareCell,this)},clearVisibleReusedCells:function(){var e=this.getVisibleBounds();
this.pool.each(function(t){var i=t.filledWithIndex===t.id,n=-1===t.filledWithIndex,s=t.id>=e.from&&t.id<=e.to;!s||i||n||(this.clearCell(t),t.filledWithIndex=-1)},this)},_getImmediateChildren:function(){return e.pluck(this.pool.pool,"view")},onClose:function(){i.cancel(this.cid),this.pool.close()}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(1001),a=n(s),r=i(2),o=n(r),l=i(6),c=n(l),u=i(430),d=n(u),h=c.default.ItemView.extend({
mixins:[d.default],className:"video-subtitles-renderer",template:a.default,initialize:function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.options=o.default.extend(e,{element:this.el})},onRender:function(){this.createASSRenderer(this.options)},onClose:function(){this.closeASSRenderer()}});t.default=h,e.exports=t.default},function(e,t,i){var n,s;n=[i(1002),i(2),i(4),i(6),i(43)],s=function(e,t,i,n,s){"use strict";var a=n.ItemView.extend({className:"video-image-overlay",template:e,
initialize:function(e){this.videoAspectRatio=e.videoAspectRatio,this.overscan=e.overscan,this.throttledSetStyles=t.throttle(this.whenRendered(this.setStyles),100),this.image=new s({model:this.model,modelAttribute:"key",width:this.model.get("width"),height:this.model.get("height"),background:!0}),this.setStyles(),"video"===this.model.get("relative")&&i(window).on("resize",this.throttledSetStyles)},setStyles:function(){if("video"===this.model.get("relative")&&!this.videoAspectRatio)return void this.$el.addClass("hidden");
var e=this.model.get("alignHorizontal"),t=this.model.get("alignVertical"),i=this.model.get("width"),n=this.model.get("height"),s=0,a=0,r=this.getOffset(),o={position:"absolute",top:"auto",right:"auto",bottom:"auto",left:"auto",backgroundSize:i+"px "+n+"px",backgroundRepeat:"no-repeat",width:i,height:n};"center"===e?(o.left="50%",s="-50%"):"left"===e?o.left=r.x:"right"===e&&(o.right=r.x),"middle"===t?(o.top="50%",a="-50%"):"top"===t?o.top=r.y:"bottom"===t&&(o.bottom=r.y),o.transform="translate("+s+", "+a+")",
o.marginTop=this.model.get("marginTop")||0,o.marginRight=this.model.get("marginRight")||0,o.marginBottom=this.model.get("marginBottom")||0,o.marginLeft=this.model.get("marginLeft")||0,this.$el.css(o),this.$el.removeClass("hidden")},getOffset:function(){var e={x:0,y:0};if("video"===this.model.get("relative")){var t=i(window).width(),n=i(window).height(),s=t/n;if(this.videoAspectRatio>s){var a=t/this.videoAspectRatio;e.y=(n-a)/2}else{var r=n*this.videoAspectRatio;e.x=(t-r)/2}}return this.overscan&&(e.x+=this.overscan.x,
e.y+=this.overscan.y),e},onRender:function(){this.image.setElement(this.$el)},onClose:function(){i(window).off("resize",this.throttledSetStyles),this.image.close()}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1003),i(2),i(4),i(6),i(196),i(550)],s=function(e,t,i,n,s,a){"use strict";var r=n.CompositeView.extend({className:"video-image-overlays-container",template:e,itemView:a,itemViewContainer:".video-player-image-overlays",itemViewOptions:function(){return{videoAspectRatio:this.getVideoAspectRatio(),
overscan:this.overscan}},modelEvents:{"change:media":"onMediaChange","change:videoDimensions":"onVideoDimensionsChange"},overscan:null,initialize:function(e){e||(e={}),this.overscan=e.overscan||this.overscan,this.collection=new s,this.populateCollection()},populateCollection:function(){var e=this.model.get("item"),t=e&&e.get("overlays");t?this.collection.reset(t.models):this.collection.reset()},getVideoAspectRatio:function(){var e=this.model.get("videoDimensions");return e?e.width/e.height:void 0;
},onMediaChange:function(e,t){this.populateCollection()},onVideoDimensionsChange:function(e,t){var i=this.getVideoAspectRatio();i&&this.children.each(function(e){var t=e.model;"video"===t.get("relative")&&(e.videoAspectRatio=i,e.setStyles())})}});return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(7),i(80)],s=function(e,t){"use strict";var i=t.extend({serializeData:function(){return{title:e("This channel is not responding.")}}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(80)],s=function(e){"use strict";var t=e.extend({initialize:function(e){this.title=e.title,this.subtitle=e.subtitle,this.message=e.message},serializeData:function(){return{title:this.title,subtitle:this.subtitle,message:this.message}}});return t}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(7),i(80)],s=function(e,t){"use strict";var i=t.extend({initialize:function(e){this.type=e.type||"404"},serializeData:function(){var t,i;return"404"===this.type?(t=e("You must be lost."),
i=e("This page doesn't exist.")):"server"===this.type?(t=e("Media server not found."),i=e("The server you're trying to access doesn't seem to exist.")):(t=e("Media not found."),i=e("The media you're trying to access doesn't seem to exist.")),{title:t,subtitle:i}}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(80)],s=function(e){"use strict";var t=e.extend({});return t}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(7),i(80)],s=function(e,t){
"use strict";var i=t.extend({serializeData:function(){return{title:e("No soup for you!"),subtitle:e("The server you're trying to access doesn't want to let you in. Make sure you're signed in as a user with access to this server.")}}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(7),i(5),i(80)],s=function(e,t,i){"use strict";var n=i.extend({modelEvents:{"change:isResolved":"onResolvedChange"},serializeData:function(){var t,i,n=this.model,s=n.get("friendlyName");return n.get("cloud")?n.get("isDownForMaintenance")?(t=e("Plex is down for maintenance."),
i=e("Don't worry, it'll be back soon.")):(t=e("Plex is not reachable."),i=e("Make sure your server has an internet connection and any firewalls or other programs are set to allow access.")):(t=e("Server unavailable."),i=s?e("We couldn't reach \"{1}\". Make sure it's online and try again.",s):e("We couldn't reach this server. Make sure it's online and try again.")),{title:t,subtitle:i}},onResolvedChange:function(e,i){i&&t.trigger("navigate:refresh")}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(5),i(20),i(283)],s=function(e,t,i){"use strict";var n=t.extend({shortcuts:[{keys:["?"],fn:"help",group:"navigation",label:"Open Keyboard Shortcuts"},{keys:["esc"],fn:"escape",group:"navigation",label:"Close Modal or Close Player or Navigate Back"},{keys:["`"],fn:"sidebar",group:"navigation",label:"Toggle Sidebar"},{keys:["g d"],fn:"dashboard",group:"navigation",label:"Navigate to Dashboard"},{keys:["g s"],fn:"settings",group:"navigation",label:"Navigate to Settings"
},{keys:["g a"],fn:"activity",group:"navigation",label:"Navigate to Activity"},{keys:["g w"],fn:"watchLater",group:"navigation",label:"Navigate to Watch Later"},{keys:["g r"],fn:"recommendations",group:"navigation",label:"Navigate to Recommended"},{keys:["g u"],fn:"users",group:"navigation",label:"Navigate to Users"},{keys:["/"],fn:"search",group:"actions",label:"Focus Search"},{keys:["p"],fn:"play",group:"actions",label:"Open Player"},{keys:["e"],fn:"edit",group:"actions",label:"Edit Library or Edit Item"
},{keys:["#","del"],fn:"remove",group:"actions",label:"Delete Library or Delete Item"},{keys:["shift+s"],fn:"save",group:"actions",label:"Save Changes"},{keys:["r"],fn:"refresh",group:"actions",label:"Update Library or Refresh Item"},{keys:["a"],fn:"analyze",group:"actions",label:"Analyze Library or Analyze Item"},{keys:["w"],fn:"markWatched",group:"actions",label:"Mark as Watched"},{keys:["u"],fn:"markUnwatched",group:"actions",label:"Mark as Unwatched"},{keys:["s"],fn:"sync",group:"actions",label:"Sync"
},{keys:["i"],fn:"info",group:"actions",label:"Info"},{keys:["space"],fn:"playPause",group:"player",label:"Play or Pause"},{keys:["\\"],fn:"toggleFullScreen",group:"player",label:"Toggle FullScreen"},{keys:["down"],fn:"decreaseVolume",group:"player",label:"Decrease Volume"},{keys:["up"],fn:"increaseVolume",group:"player",label:"Increase Volume"},{keys:[",","shift+left"],fn:"seekBackward",group:"player",label:"Seek Backward (10 seconds)"},{keys:[".","shift+right"],fn:"seekForward",group:"player",label:"Seek Forward (30 seconds)"
},{keys:["[","alt+left"],fn:"stepBackward",group:"player",label:"Step Backward (10 minutes)"},{keys:["]","alt+right"],fn:"stepForward",group:"player",label:"Step Forward (10 minutes)"},{keys:["left"],fn:"skipPrevious",group:"player",label:"Skip to Previous Item"},{keys:["right"],fn:"skipNext",group:"player",label:"Skip to Next Item"}],triggerShortcut:function(t){var i="shortcut:"+t;return e.hasListener(i)?(e.trigger(i),!1):void 0},help:function(t){e.trigger("show:modal",new i({shortcuts:this.shortcuts
}))},escape:function(t){e.hasListener("shortcut:escape")?e.trigger("shortcut:escape"):e.hasListener("shortcut:stop")?e.trigger("shortcut:stop"):e.trigger("navigate:back")},sidebar:function(t){e.trigger("shortcut:sidebar")},dashboard:function(t){e.trigger("navigate","dashboard")},settings:function(t){e.trigger("navigate","settings")},activity:function(t){e.trigger("navigate","activity")},watchLater:function(t){e.trigger("navigate","userPlaylist",{key:"queue"})},recommendations:function(t){e.trigger("navigate","userPlaylist",{
key:"recommendations"})},users:function(t){e.trigger("navigate","users")},search:function(e){return this.triggerShortcut("search")},edit:function(e){return this.triggerShortcut("edit")},play:function(e){return this.triggerShortcut("play")},remove:function(e){return this.triggerShortcut("delete")},save:function(e){return this.triggerShortcut("save")},refresh:function(e){return this.triggerShortcut("refresh")},analyze:function(e){return this.triggerShortcut("analyze")},markWatched:function(e){return this.triggerShortcut("markWatched");
},markUnwatched:function(e){return this.triggerShortcut("markUnwatched")},sync:function(e){return this.triggerShortcut("sync")},info:function(e){return this.triggerShortcut("info")},playPause:function(e){return this.triggerShortcut("playPause")},toggleFullScreen:function(e){return this.triggerShortcut("toggleFullScreen")},decreaseVolume:function(e){return this.triggerShortcut("decreaseVolume")},increaseVolume:function(e){return this.triggerShortcut("increaseVolume")},seekBackward:function(e){return this.triggerShortcut("seekBackward");
},seekForward:function(e){return this.triggerShortcut("seekForward")},stepBackward:function(e){return this.triggerShortcut("stepBackward")},stepForward:function(e){return this.triggerShortcut("stepForward")},skipPrevious:function(e){return this.triggerShortcut("skipPrevious")},skipNext:function(e){return this.triggerShortcut("skipNext")}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(20),i(428),i(17)],s=function(e,t,i){"use strict";var n=e.extend({mixins:t,constructor:function(){
this.basePath="translations/",this.translations={},i.getInstance().on("change:language",function(e,t){this.load(t)},this)}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(303),i(382)],s=function(e,t,i){"use strict";var n=e.extend({},i,{init:function(e,i){t.config(e,{shouldSendCallback:function(e){return/plex\.js/.test(e.culprit)}}).install(),this.set("version",i)}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(135),i(9),i(17),i(649),i(88),i(559),i(136),i(560),i(186),i(564),i(73),i(381),i(185),i(383),i(28),i(113),i(572),i(566),i(385)],
s=function(e,t,i,n,s,a,r,o,l,c,u,d,h,p,f,m,g,v,y){"use strict";var b={registerAll:function(){e.register(t),i.register(new n),s.register(new a),r.register(o),l.register(c),u.register(d),h.register(new p);var b=new g,w=new v;m.register({protocol:"plex",type:"*",create:function(e,t){return b.createController(e,t)}}),m.register({protocol:"cast",type:"*",create:function(e,t){return w.createController(e,t)}}),m.register({protocol:"local",type:f.types.PHOTO,create:function(e){return new y({type:e})}})}};
return b}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(561),i(44),i(114),i(187),i(387),i(388),i(112),i(563),i(72),i(377),i(137),i(558),i(138),i(573),i(28),i(113),i(570),i(569)],s=function(e,t,i,n,s,a,r,o,l,c,u,d,h,p,f,m,g,v){"use strict";var y={registerAll:function(){var y=new s;t.register(y),i.register(new a),n.register(y),r.register(o),l.register(c),u.register(new d),h.register(p),m.register({protocol:"local",type:f.types.VIDEO,create:function(e){return new g({type:e})}
}),m.register({protocol:"local",type:f.types.MUSIC,create:function(e){return new v({type:e})}}),e.registerAll()}};return y}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(42),i(9)],s=function(e,t){"use strict";var i={"X-Plex-Product":"Plex Web","X-Plex-Version":"2.4.39","X-Plex-Client-Identifier":t.get("clientID"),"X-Plex-Platform":e.name,"X-Plex-Platform-Version":e.version,"X-Plex-Device":e.platform,"X-Plex-Device-Name":"Plex Web ("+e.name+")"};return t.on("change:clientID",function(e,t){
i["X-Plex-Client-Identifier"]=t}),i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[],s=function(){"use strict";var e={name:"desktop",taskThrottle:{wait:10,batchSize:2},showPhotoBackground:!1,useExtraAnimations:!1};return e}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(5),i(28),i(46),i(26),i(47),i(59),i(245),i(17),i(248),i(249),i(9)],s=function(e,t,i,n,s,a,r,o,l,c,u,d,h){"use strict";var p=d.extend({modelDefaults:function(){var t=d.prototype.modelDefaults.apply(this,arguments),i=this.model.get("playQueue");
return e.extend(t,{canPlayPause:!0,canStop:!0,canSeek:!0,canSetVolume:this.type!==n.types.PHOTO,canSetAudioStream:!0,canSetSubtitleStream:!0,canSetQuality:!0,showPlayQueue:!(!i||!i.supports({remoteRefresh:!0}))})},load:function(i){this.model=i.model,this.mediaElement=i.mediaElement||document.createElement(this.type),this.reset(this.model.get("item")),this.listenTo(this.manager,{timeline:this.onTimeline,progress:this.onProgress,error:this.onError,volume:this.onVolumeUpdate}),this.listenTo(this.model,{
"change:item":this.onItemChange,"change:mediaIndex":this.onItemChange,"change:partIndex":this.onItemChange,"change:qualityIndex":this.onQualityIndexChange,"change:audioStreamID":this.onAudioStreamIDChange,"change:subtitleStreamID":this.onSubtitleStreamIDChange,"change:finished":this.onFinishedChange});var n=this.model.get("playQueue");if(n&&this.listenTo(n.get("collection"),"reset",this.onPlayQueueChange),i.silent)return this.manager.updatePlayer(),t.Deferred().resolve().promise();var a=this.model.get("item"),r=a.server,l=h.get("primaryServer"),u=i.offset/1e3||0,d=s.getCurrentQuality(a,c.getInstance()),p=h.get("user"),f={
offset:u,directPlay:c.get("directPlay"),directStream:c.get("directStream"),bitrate:d.bitrate,subtitleSize:c.get("subtitleSize"),audioBoost:c.get("audioBoost"),server:this.getServerInfo(r,{isRequired:!0}),user:{username:p.get("username")}};if(!f.server)return t.Deferred().reject().promise();var m=[];m.push(this.getTransientTokenFor(r,f.server)),l&&r.id!==l.id&&(f.primaryServer=this.getServerInfo(l),f.primaryServer&&m.push(this.getTransientTokenFor(l,f.primaryServer)));var g=t.Deferred().resolve().promise();
return n&&(g=n.yieldOwnership().then(function(e){f.containerKey=e})),g=g.then(function(){return o.whenEach(m)}),g.done(e.bind(function(){var e=new chrome.cast.media.MediaInfo(a.get("key"),this.type);e.customData=f;var t=new chrome.cast.media.LoadRequest(e);t.currentTime=u,t.autoplay=!0,this.manager.loadMedia(t)},this)),g},mirror:function(i){var n=i.item,s=n.server,a=h.get("primaryServer"),r=h.get("user"),l={server:this.getServerInfo(s,{isRequired:!0}),user:{username:r.get("username")}};if(!l.server)return t.Deferred().reject().promise();
var c=[];c.push(this.getTransientTokenFor(s,l.server)),a&&s.id!==a.id&&(l.primaryServer=this.getServerInfo(a),l.primaryServer&&c.push(this.getTransientTokenFor(a,l.primaryServer)));var d=o.whenEach(c);return d.done(e.bind(function(){var e=new chrome.cast.media.MediaInfo(n.get("key"),this.type);e.customData=l;var t={type:u.SHOWDETAILS};t.media=e,this.manager.sendCustomMessage(t)},this)),d},getServerInfo:function(t,i){var n=this.getServerConnection(t,i);if(n){var s=e.extend({machineIdentifier:t.id,
transcoderVideo:t.get("transcoderVideo")||!1,transcoderVideoRemuxOnly:t.get("transcoderVideoRemuxOnly")||!1,transcoderAudio:t.get("transcoderAudio")||!1,version:t.get("shortVersion"),myPlexSubscription:t.get("myPlexSubscription"),isVerifiedHostname:"https"===n.protocol&&!l.isValidAddress(n.address)},n);return s}},getTransientTokenFor:function(e,t){var i=this.getTransientToken(e).then(function(e){t.accessToken=e});return i},play:function(){this.model.set("state",n.states.PLAYING),this.manager.sendCustomMessage({
type:u.PLAY})},pause:function(){this.model.set("state",n.states.PAUSED),this.manager.sendCustomMessage({type:u.PAUSE})},setPosition:function(e){if(this.canSeek(e)){this.model.set({state:n.states.BUFFERING,position:e});var t=e/1e3;this.manager.startSeek(t),this.sendPositionRequest(t)}},sendPositionRequest:e.debounce(function(e){this.manager.sendCustomMessage({type:u.SEEK,currentTime:e})},500),setVolume:function(e){this.model.set("volume",e),this.sendVolumeRequest(e/100)},sendVolumeRequest:e.debounce(function(e){
this.manager.sendSessionCommand("setReceiverVolumeLevel",e),e||this.manager.sendSessionCommand("setReceiverMuted",!0)},200),skipPrevious:function(){this.manager.sendCustomMessage({type:u.PREVIOUS})},skipNext:function(){this.manager.sendCustomMessage({type:u.NEXT})},skipTo:function(e){this.manager.sendCustomMessage({type:u.SKIPTO,key:e})},stop:function(e){d.prototype.stop.apply(this,arguments),this.manager.sendCustomMessage({type:u.STOP})},refreshRemotePlayQueue:function(){this.manager.sendCustomMessage({
type:u.REFRESHPLAYQUEUE})},setStream:function(e,t){this.manager.sendCustomMessage({type:u.SETSTREAM,stream:{type:e,id:t}})},setQualityIndex:function(){var e=this.model.get("item"),t=s.getCurrentQuality(e,c.getInstance());this.manager.sendCustomMessage({type:u.SETQUALITY,bitrate:t.bitrate})},onTimeline:function(t){var i=this.model.get("playQueue"),a=this.model.get("item");if(t.containerKey){var r=t.containerKey.split("?")[0],o=e.result(i,"url");if(!i||o&&o!==r)return}if(t.key!==a.get("key")){var l=i&&i.get("collection");
if(a=l&&l.findWhere({key:t.key}),!a)return;this.reset(a)}var c=null;if(t.transcodeServerID){var u=h.get("servers");c=u.get(t.transcodeServerID)}var d=s.getNearestIndexToBitrate(t.bitrate),p=e.isNumber(t.audioStreamID)?t.audioStreamID:null,f=e.isNumber(t.subtitleStreamID)?t.subtitleStreamID:null;this.isTimelineChange=!0,this.model.set({mediaIndex:t.mediaIndex,partIndex:t.partIndex,qualityIndex:d,audioStreamID:p,subtitleStreamID:f,transcodeServer:c,state:t.state,ready:!0,loaded:"photo"!==this.type,
finished:t.state===n.states.STOPPED,errorMessage:t.errorMessage,duration:1e3*t.duration,volume:t.volume}),this.isTimelineChange=!1,this.onProgress(t.position)},onProgress:function(e){var t=this.model.get("item"),i=this.model.get("duration"),n=1e3*e;a.setViewOffset(t,n,i),this.model.set("position",n)},onError:function(e){this.model.set({state:n.states.ERROR,errorMessage:e})},onQualityIndexChange:function(e,t){var i=e.previous("qualityIndex");null==t||null==i||this.isTimelineChange||this.setQualityIndex();
},onVolumeUpdate:function(e){this.model.set("volume",e)}});return p}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(7),i(5),i(42),i(90),i(28),i(165),i(260),i(248),i(16),i(17),i(250),i(9),i(466),i(565)],s=function(e,t,i,n,s,a,r,o,l,c,u,d,h,p,f){"use strict";var m=d.extend({protocol:"cast",namespace:"urn:x-cast:plex",progressDelay:100,controller:f,sessionWrapped:["loadMedia","sendSessionCommand","sendCustomMessage"],mediaSessionWrapped:["sendMediaCommand","startSeek"],appID:function(){
var e=u.get("chromecastAppID"),t=u.get("chromecastCustomAppID");return e===o.CUSTOM&&t?t:e||o.PRODUCTION},initialize:function(){if("chrome"===n.id){e.bindAll(this,"onApiAvailable","onApiLoadSuccess","onApiLoadError","onReceiverAvailable","onReceiverAction","onCustomReceiversError","onSessionAvailable","onSessionError","onSessionUpdate","onMediaSessionDiscovered","onMediaSessionError","onMediaSessionUpdate"),d.prototype.initialize.apply(this,arguments),this.sessionBacklog=new s,this.sessionBacklog.wrapAll(this.sessionWrapped,function(){
return!!this.session},this),this.mediaSessionBacklog=new s,this.mediaSessionBacklog.wrapAll(this.mediaSessionWrapped,function(){return!!this.mediaSession},this),this.listenTo(i,"cast:launch",this.onLaunch),window.__onGCastApiAvailable=this.onApiAvailable;var t=document.createElement("script");t.src="//www.gstatic.com/cv/js/sender/v1/cast_sender.js",document.head.appendChild(t)}},load:function(){u.populate({reset:!0}).always(e.bind(function(){var t=e.result(this,"appID"),i=new chrome.cast.SessionRequest(t),n=new chrome.cast.ApiConfig(i,this.onSessionAvailable,this.onReceiverAvailable);
chrome.cast.initialize(n,this.onApiLoadSuccess,this.onApiLoadError)},this))},loadCustomReceivers:function(){var e=h.get("players");e.length&&(this.customReceivers=[],e.each(function(e){var t=new chrome.cast.Receiver(this.getCustomReceiverLabel(e),e.get("name"));t.receiverType=chrome.cast.ReceiverType.CUSTOM,this.customReceivers.push(t)},this),chrome.cast.setCustomReceivers(this.customReceivers,null,this.onCustomReceiversError))},getCustomReceiverLabel:function(e){return"custom-"+e.id},stop:function(){
this.session&&this.session.stop(null,this.onSessionStopError),d.prototype.stop.apply(this,arguments)},loadMedia:function(e){c("Load media command"),this.session.loadMedia(e,this.onMediaSessionDiscovered,this.onMediaSessionError)},sendSessionCommand:function(e,t){c("Sending session command: "+e),this.session[e](t,null,this.onMessageError)},sendMediaCommand:function(e,t){c("Sending media command: "+e),this.mediaSession[e](t,null,this.onMessageError)},sendCustomMessage:function(e){c("Sending custom message: "+e.type),
e.type===l.SEEK&&(this.seeking=!1),this.session.sendMessage(this.namespace,e,null,this.onMessageError)},startSeek:function(e){this.seeking=!0,this.mediaSession.playerState=chrome.cast.media.PlayerState.BUFFERING,this.mediaSession.currentTime=e},error:function(){i.trigger("show:alert",{type:"error",message:t("There was a problem connecting to this player.")}),h.set("primaryPlayer",null)},updatePlayer:function(){clearInterval(this.progressInterval);var t=this.mediaSession.media,i=this.mediaSession.customData;
if(t&&i){var n=e.extend({machineIdentifier:i.server.machineIdentifier,state:a.getStateByCastState(this.mediaSession.playerState),duration:t.duration,position:this.mediaSession.currentTime,volume:this.getVolumeLevel(this.session.receiver.volume)},e.omit(i,["server","primaryServer","user"]));n.state===a.states.PLAYING&&"photo"!==t.contentType&&(this.progressInterval=setInterval(e.bind(this.onProgress,this),this.progressDelay)),this.mediaSession.idleReason===chrome.cast.media.IdleReason.ERROR&&(n.state=a.states.ERROR,
n.errorMessage=i.errorMessage),this.trigger("timeline",n),this.updateNowPlaying(n)}},updateCustomReceiverDisplayStatus:function(e,t){var i,n;if(t){var s=r.image(t.server,t.get("thumb"),{fallbackServer:h.get("primaryServer"),width:32,height:32,minSize:1});i=t.get("title"),n=[new chrome.cast.Image(s)]}else{var a=h.get("primaryPlayer");i=a.get("product")||"Plex"}e.displayStatus=new chrome.cast.ReceiverDisplayStatus(i,n),chrome.cast.setReceiverDisplayStatus(e)},updateVolumeState:function(){this.session&&this.trigger("volume",this.getVolumeLevel(this.session.receiver.volume));
},getVolumeLevel:function(e){return e.muted?0:100*e.level},resetCustomReceiverDisplayStatus:function(e){e.displayStatus=null,chrome.cast.setReceiverDisplayStatus(e)},resetSession:function(){this.session&&(this.session.removeUpdateListener(this.onSessionUpdate),this.session=null),this.sessionBacklog.clear()},resetMediaSession:function(){this.mediaSession&&(this.mediaSession.removeUpdateListener(this.onMediaSessionUpdate),this.mediaSession=null),clearInterval(this.progressInterval),this.mediaSessionBacklog.clear();
},onPrimaryPlayerChange:function(t,i){if(d.prototype.onPrimaryPlayerChange.apply(this,arguments),this.activeCustomReceiver){var n=h.previous("primaryPlayer");n&&this.stopListening(n.get("nowPlaying")),this.resetCustomReceiverDisplayStatus(this.activeCustomReceiver),this.activeCustomReceiver=null}if(i){var s=e.findWhere(this.customReceivers,{label:this.getCustomReceiverLabel(i)});if(s){var a=i.get("nowPlaying");this.updateCustomReceiverDisplayStatus(s),this.activeCustomReceiver=s,this.listenTo(a,"add",this.onCustomNowPlayingAdd),
this.listenTo(a,"remove",this.onCustomNowPlayingRemove)}}},onCustomNowPlayingAdd:function(e){this.activeCustomReceiver&&this.updateCustomReceiverDisplayStatus(this.activeCustomReceiver,e)},onCustomNowPlayingRemove:function(e){this.activeCustomReceiver&&this.updateCustomReceiverDisplayStatus(this.activeCustomReceiver)},onApiAvailable:function(e,t){e?this.load():c.warn(t)},onApiLoadSuccess:function(){c("Loaded the cast api"),h.set("isCastApiAvailable",!0),this.listenTo(h.get("players"),"add remove reset",this.loadCustomReceivers),
this.loadCustomReceivers(),chrome.cast.addReceiverActionListener(this.onReceiverAction)},onApiLoadError:function(e){c.error("Unable to load the cast api: "+JSON.stringify(e)),h.set("isCastApiAvailable",!1)},onReceiverAvailable:function(e){e===chrome.cast.ReceiverAvailability.AVAILABLE?(c("Receivers are available"),h.set("isCastDeviceAvailable",!0)):(c.warn("No receivers are available"),h.set("isCastDeviceAvailable",!1))},onReceiverAction:function(e,t){c(e.friendlyName+" -> "+t);var i=/^custom-(.*)/.exec(e.label);
if(i){c.info(e.friendlyName+" is a custom receiver");var n=h.get("players"),s=n.get(i[1]);"cast"===t?h.set("primaryPlayer",s):"stop"===t&&h.set("primaryPlayer",null)}},onCustomReceiversError:function(e){c.warn("Custom receivers error: "+JSON.stringify(e))},onLaunch:function(){this.sessionBacklog.clear(),this.mediaSessionBacklog.clear(),chrome.cast.requestSession(this.onSessionAvailable,this.onSessionError)},onSessionAvailable:function(e){if(c("Session: "+JSON.stringify(e)),this.session=e,e.sessionId===chrome.cast.Session.CUSTOM_RECEIVER_SESSION_ID){
c.info("Custom receiver: "+e.receiver.friendlyName);var t=/^custom-(.*)/.exec(e.receiver.label);if(t){var i=h.get("players");h.set("primaryPlayer",i.get(t[1]))}}else h.set("primaryPlayer",new p(e.receiver,{parse:!0})),e.addUpdateListener(this.onSessionUpdate),e.addMediaListener(this.onMediaSessionDiscovered),e.media.length&&(c("Found existing media sessions."),this.onMediaSessionDiscovered(e.media[0])),this.sessionBacklog.process()},onSessionError:function(e){c.error("Unable to launch new session: "+JSON.stringify(e));
},onSessionUpdate:function(e){return e?void this.updateVolumeState():(c("Session ended"),this.resetSession(),this.resetMediaSession(),void(this.activeCustomReceiver||h.set("primaryPlayer",null)))},onSessionStopError:function(e){c.error("Unable to stop session: "+JSON.stringify(e))},onMediaSessionDiscovered:function(e){return c("Media session discovered: "+JSON.stringify(e)),e.playerState===a.castStates.STOPPED?void this.resetMediaSession():(this.mediaSession=e,e.addUpdateListener(this.onMediaSessionUpdate),
this.updatePlayer(),void this.mediaSessionBacklog.process())},onMediaSessionError:function(e){c.error("Media session error: "+JSON.stringify(e)),this.resetMediaSession(),e.details&&e.details.customData&&this.trigger("error",e.details.customData.errorMessage)},onMediaSessionUpdate:function(e){return this.seeking?void(this.mediaSession.playerState=chrome.cast.media.PlayerState.BUFFERING):void this.updatePlayer()},onMessageError:function(e){c.warn("Message error: "+JSON.stringify(e))},onProgress:function(){
this.trigger("progress",this.mediaSession.getEstimatedTime())}});return m}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(993),i(7),i(20),i(28),i(90),i(16)],s=function(e,t,i,n,s,a,r){"use strict";t.key="fv2ELs9q2gEZxE9uuiAGfhbE9Qhc4DyhZjt1j0GaxUI=";var o=n.extend({wrapped:["play","pause","playPause","getState","setVolume","setPosition","resume","stop"],initialize:function(t){e.bindAll(this,"onReady","onPlay","onTime","onBuffer","onPause","onVolume","onComplete","onError"),
this.type=t,this.backlog=new a,this.backlog.wrapAll(this.wrapped,function(){return!!this.video},this)},load:function(n){this.model=n.model,this.offset=this.model.get("position"),this.backlog.clear(),e.defer(e.bind(function(){var a=t("flash-video-placeholder"),o=this.model.get("url");return e.isFunction(a.setup)?(r.group("Flash Player"),r("URL: "+o),r("Autoplay: true"),r("Offset: "+this.offset),r.groupEnd(),this.model.set("ready",!0),void(this.video=a.setup({file:o,skin:"swf/jwplayer/plex.xml",flashplayer:"swf/jwplayer/jwplayer.swf",
stretching:"uniform",width:"100%",height:"100%",volume:100,mute:!1,autostart:n.autoplay,analytics:{enabled:!1},events:{onReady:this.onReady,onPlay:this.onPlay,onTime:this.onTime,onBuffer:this.onBuffer,onPause:this.onPause,onVolume:this.onVolume,onComplete:this.onComplete,onError:this.onError}}))):void this.model.set({state:s.states.ERROR,errorMessage:i("Your browser does not support video streaming.")})},this))},play:function(){this.video.play(!0)},pause:function(){this.video.pause(!0)},setVolume:function(e){
this.video.setVolume(e)},setPosition:function(e){this.video.seek(e/1e3)},resume:function(){r("resuming at "+this.offset);var e=this.offset;this.offset=null,this.setPosition(e)},stop:function(){this.model.get("loaded")&&this.video.remove(),this.video=null},onReady:function(){this.model.set("loaded",!0),this.setVolume(this.model.get("volume")),this.backlog.process()},onPlay:function(e){this.model.set("state",s.states.PLAYING)},onTime:function(e){return this.offset?void this.resume():(this.model.set("duration",Math.round(1e3*e.duration)),
void this.model.set("position",Math.round(1e3*e.position)))},onBuffer:function(){this.model.set("state",s.states.BUFFERING)},onPause:function(){this.model.set("state",s.states.PAUSED)},onVolume:function(e){this.model.set("volume",e.volume)},onComplete:function(){this.model.set("ended",!0)},onError:function(e){this.model.set({state:s.states.ERROR,errorMessage:e.message})}});return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(7),i(34),i(16),i(188)],s=function(e,t,i,n,s){
"use strict";var a=s.extend({load:function(e){s.prototype.load.apply(this,arguments),i.hasTouchScreen&&this.model.set("ready",!0)},resume:function(){n("resuming at "+this.offset);var t=this.offset;this.offset=0,this.autoplay&&(this.mediaElement.resume_pending=!0,this.pause()),this.resumePositionTimeout=setTimeout(e.bind(function(){this.setPosition(t)},this),1e3),this.autoplay&&(this.resumePlayTimeout=setTimeout(e.bind(function(){this.mediaElement.resume_pending=!1,this.play()},this),1500))},stop:function(){
s.prototype.stop.apply(this,arguments),this.resumePositionTimeout=clearTimeout(this.resumePositionTimeout),this.resumePlayTimeout=clearTimeout(this.resumePlayTimeout)},onReady:function(){s.prototype.onReady.apply(this,arguments);var e=this.model.get("showEnterFullscreen")||this.model.get("showExitFullscreen");!e&&this.mediaElement.webkitSupportsFullscreen&&this.model.set({showEnterFullscreen:!0,forceWebkitVideoFullscreen:!0})}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;
n=[i(2),i(7),i(20),i(5),i(42),i(28),i(90),i(26),i(234),i(261),i(16),i(138),i(11),i(33),i(116),i(9)],s=function(e,t,i,n,s,a,r,o,l,c,u,d,h,p,f,m){"use strict";var g=i.extend({mixins:[p,f],type:a.types.MUSIC,wrapped:["play","pause","playPause","setVolume","setPosition","whileLoading","whilePlaying"],modelDefaults:function(){var t=f.modelDefaults.apply(this,arguments);return e.extend(t,{canPlayPause:!0,canStop:!0,canSetVolume:!s.mobile,showSeekBar:!0,showShuffle:!0,showRepeat:!0,showPlayQueue:!0})},initialize:function(t){
f.initialize.apply(this,arguments),e.bindAll(this,"onDecisionSuccess","onDecisionError","onCreate","onLoad","onFinish"),this.profile=d.prop(this.type),this.backlog=new r,this.backlog.wrapAll(this.wrapped,function(){return!!this.sound},this)},load:function(e){this.model=e.model,this.autoplay=e.autoplay,this.offset=e.offset;var t=this.model.get("item"),i=this.model.get("playQueue");return this.reset(t),this.listenTo(this.model,{"change:state":this.onStateChange,"change:repeatAll change:repeatItem":this.onRepeatChange
}),i&&(this.listenTo(i.get("collection"),"add remove reset sync",this.onPlayQueueChange),this.listenTo(i,"change:hasUpNext change:shuffled",this.onPlayQueueChange)),this.getPlayerDecision(t,e)},getPlayerDecision:function(e,t){this.errorTimeout&&(this.errorTimeout=clearTimeout(this.errorTimeout)),this.backlog.clear();var i=this.getPlayerDecisionPromise(e,t);return i.done(this.onDecisionSuccess),i.fail(this.onDecisionError),i},getPlayerDecisionPromise:function(e,t){return t=t||{},l.getPlayerDecision({
type:this.type,profile:this.profile,item:e,offset:t.offset,fallbackServer:m.get("primaryServer"),transcoder:c})},play:function(){this.model.set("state",a.states.PLAYING),this.sound.play()},pause:function(){this.model.set("state",a.states.PAUSED),this.sound.pause()},setPosition:function(e){this.canSeek(e)&&(this.model.set("position",e),this.sound.setPosition(e))},setVolume:function(e){this.model.set("volume",e),this.sound.setVolume(e)},restartCurrent:function(){this.getPlayerDecision(this.model.get("item"));
},skipPrevious:function(){if(this.model.get("canSkipPrevious")){var e=f.skipPrevious.apply(this,arguments);return e&&(this.autoplay=!0,this.getPlayerDecision(e)),e}},skipNext:function(){var e=f.skipNext.apply(this,arguments);return e&&(this.autoplay=!0,this.getPlayerDecision(e)),e},skipTo:function(e){var t=f.skipTo.apply(this,arguments);return t&&(this.autoplay=!0,this.getPlayerDecision(t)),t},stop:function(e){return f.stop.apply(this,arguments),this.sound=null,h.execute("playSound",{key:this.currentItem.get("key"),
stop:!0}),this.stopSession()},onDecisionSuccess:function(t){var i=this.model.get("item"),n=0;t.part&&t.part.duration&&(n=t.part.duration),this.session=t.session;var s={media:t.media,part:t.part,url:t.url,transcodeServer:t.transcodeServer,mediaIndex:t.media?o.getMediaIndex(i,t.media.id):0,partIndex:t.part?o.getPartIndex(t.media,t.part.key):0,partCount:o.getPartCount(t.media),state:this.autoplay?a.states.BUFFERING:a.states.PAUSED,position:t.offset,duration:n,directPlay:t.canDirectPlay,canSeek:t.canDirectPlay
},r=e.extend(s,this.modelOverrides());this.model.set(r),h.execute("playSound",{key:this.currentItem.get("key"),url:t.url,autoLoad:!0,autoPlay:this.autoplay,volume:this.model.get("volume"),oncreate:this.onCreate,onload:this.onLoad,whileloading:this.whileLoading,whileplaying:this.whilePlaying,onfinish:this.onFinish})},onDecisionError:function(e){this.model.set("state",a.states.ERROR),n.trigger("stop:music"),e.errorMessage&&n.trigger("show:alert",{type:"error",message:e.errorMessage})},onStateChange:function(t,i){
var n=this.timeline();i===a.states.PLAYING&&n.done(e.bind(this.updatePlayQueue,this)),i===a.states.STOPPED||i===a.states.ERROR?this.stopTimeline():this.startTimeline(),i===a.states.PLAYING?this.startPlaybackTracking():this.stopPlaybackTracking(),i===a.states.ERROR&&(this.errorTimeout=setTimeout(e.bind(function(){u.warn("Track failed to play, automatically skipping to the next track"),n.done(e.bind(function(){this.model.get("error")&&this.skipNext()},this))},this),2e3))},onRepeatChange:function(e,t){
this.previousItem=this.getPreviousItem(),this.nextItem=this.getNextItem(),this.model.set({canSkipPrevious:!!this.previousItem,canSkipNext:!!this.nextItem})},onPlayQueueChange:function(){this.previousItem=this.getPreviousItem(),this.nextItem=this.getNextItem();var t=this.model.get("playQueue"),i={};t&&(i.canShuffle=!t.get("hasUpNext"),i.shuffled=t.get("shuffled")),e.extend(i,{canSkipPrevious:!!this.previousItem,canSkipNext:!!this.nextItem},this.modelOverrides()),this.model.set(i)},onCreate:function(e){
this.sound=e,this.backlog.process(),this.model.set("ready",!0)},onLoad:function(e){if(!e&&!this.sound.loaded)return void this.model.set("state",a.states.ERROR);var t=this.model.get("media"),i=this.model.get("directPlay");this.model.set("loaded",!0),!i&&t&&this.model.set({endBuffer:t.duration,canSeek:!0}),this.offset&&this.model.get("paused")&&(this.sound.setPosition(this.offset),this.offset=null)},whileLoading:function(){if(this.sound.url===this.model.get("url")){var e,t,i=this.model.get("media"),n=this.model.get("directPlay");
if(!n&&i)e=i.duration,t=0;else{var s=!this.sound.isHTML5&&this.sound.bytesLoaded>=this.sound.bytesTotal,a=!i||!i.duration||s;e=a?this.sound.durationEstimate:i.duration,t=this.sound.bytesLoaded/this.sound.bytesTotal*e}this.model.set({endBuffer:t,duration:e})}},whilePlaying:function(){this.sound.url===this.model.get("url")&&(this.model.get("playing")||this.sound.paused||this.model.set("state",a.states.PLAYING),this.model.set("position",Math.round(this.sound.position)))},onFinish:function(){this.sound=null,
this.model.get("repeatItem")?this.restartCurrent():this.nextItem?this.skipNext({organic:!0}):this.model.set({state:a.states.STOPPED,finished:!0})}});return g}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(994),i(7),i(34),i(42),i(28),i(46),i(234),i(230),i(92),i(261),i(17),i(384),i(568),i(567),i(9),i(66)],s=function(e,t,i,n,s,a,r,o,l,c,u,d,h,p,f,m,g){"use strict";var v=h.extend({type:a.types.VIDEO,modelDefaults:function(){var t=h.prototype.modelDefaults.apply(this,arguments);
return e.extend(t,{canPlayPause:!0,canStop:!0,canSeek:!0,canSetVolume:!s.mobile,canSetAudioStream:!0,canSetSubtitleStream:!0,canSetQuality:!0,showSeekBar:!0,showPlayQueue:!0,showEnterFullscreen:n.hasFullscreen})},getPlayerDecision:function(t,n){this.backlog.clear();var s=this.populateItem(t);return s=s.then(e.bind(function(){var e=r.getCurrentQuality(t,d.getInstance());this.model.set("qualityIndex",e.index);var i=o.getPlayerDecision({type:this.type,profile:this.profile,item:t,media:n.media,part:n.part,
offset:n.offset,fallbackServer:m.get("primaryServer"),allowDirectPlay:d.get("directPlay"),allowedAC3Containers:d.get("allowAC3")?"mp4":null,subtitlesBurnLevel:this.model.get("softSubtitlesFailed")?c.ALWAYS:d.get("subtitlesBurnLevel"),hasFlash:this.canPlayFlash(),hasNativeHLS:this.canPlayHLS(),useOffsetHLS:!1,hasDASH:this.canPlayDASH(),hasStreamingMKV:this.canPlayStreamingMKV(),minVersionForStreamingMKV:g.streamingMKV,quality:e,transcoder:u,transcoderOptions:{directStream:d.get("directStream")?1:0,
subtitleSize:d.get("subtitleSize"),audioBoost:d.get("audioBoost")},profileExtra:d.get("preferAAC")?"add-transcode-target-audio-codec(type=videoProfile&context=streaming&protocol=hls&audioCodec=aac)":null});return i.done(this.onDecisionSuccess),i.fail(this.onDecisionError),i},this),e.bind(function(){this.model.set({state:"error",errorMessage:i("Plex Media Server is not responding.")})},this))},getSubcontrollerByType:function(e){return"flash"===e?new f(this.type):new p(this.type)},canPlayFlash:function(){
return t.hasFlashPlayerVersion("10")},canPlayHLS:function y(){var e=this.profile.protocols;if(!e||!e.hls)return!1;var y=l.canPlayType("video",e.hls.mimeType),t="Android"===s.platform;return y||t},canPlayDASH:function(){var e=this.profile.directPlay;if(!e.hasOwnProperty("mp4"))return!1;var t=l.canPlayType("video",e.mp4.mimeType);return d.get("dash")&&t&&n.hasMediaSource},canPlayStreamingMKV:function(){var e=this.profile.directPlay,t=l.canPlayType("video",e.mp4.mimeType);return d.get("dash")&&"chrome"===s.id&&!s.mobile&&t;
}});return v}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(14),i(28),i(26),i(47),i(59),i(249)],s=function(e,t,i,n,s,a,r,o){"use strict";var l=o.extend({modelDefaults:function(){var t=o.prototype.modelDefaults.apply(this,arguments),i=this.player.get("protocolCapabilities"),n=e.contains(i,"playqueues"),s=this.model.get("playQueue");return e.extend(t,{canStop:!0,showPlayQueue:!!(n&&s&&s.supports({remoteRefresh:!0}))})},load:function(n){this.model=n.model,this.mediaElement=n.mediaElement||document.createElement(this.type),
this.reset(this.model.get("item")),this.listenTo(this.manager,"timeline",this.onTimeline),this.listenTo(this.model,{"change:item":this.onItemChange,"change:mediaIndex":this.onItemChange,"change:partIndex":this.onItemChange,"change:audioStreamID":this.onAudioStreamIDChange,"change:subtitleStreamID":this.onSubtitleStreamIDChange,"change:finished":this.onFinishedChange});var s=this.model.get("item"),a=s.server,o=this.getServerInfo(a,{isRequired:!0});if(!o)return t.Deferred().reject().promise();var l;
if("node"===o.machineIdentifier?this.model.set("playQueue",null):(l=this.model.get("playQueue"),l&&this.listenTo(l.get("collection"),"reset",this.onPlayQueueChange)),n.silent)return t.Deferred().resolve().promise();var c=e.extend({key:s.get("key"),offset:n.offset||0},o),u=t.Deferred().resolve().promise(),d=this.getTransientTokenFor(a,c);return l&&(u=l.yieldOwnership().then(function(e){c.containerKey=e})),u=u.then(function(){return r.alwaysResolve(d)}),u=u.then(e.bind(function(){var e=i.join("/player/playback/playMedia",c);
return this.manager.request(this.player,e)},this))},mirror:function(n){if(e.contains(this.player.get("protocolCapabilities"),"mirror")){var s=n.item,a=s.server,o=this.getServerInfo(a,{isRequired:!0});if(!o)return t.Deferred().reject().promise();var l=e.extend({type:this.type,key:s.get("key")},o),c=r.alwaysResolve(this.getTransientTokenFor(a,l));return c=c.then(e.bind(function(){return this.manager.request(this.player,i.join("/player/mirror/details",l))},this))}},getServerInfo:function(t,i){var n=this.getServerConnection(t,i);
if(n){var s=e.extend({machineIdentifier:t.id},n);return"myPlex"===s.machineIdentifier&&(s.machineIdentifier="node",s.address="node.plexapp.com"),s}},getTransientTokenFor:function(e,t){var i=this.getTransientToken(e).then(function(e){t.token=e});return i},reset:function(e){return this.hasStarted=!1,o.prototype.reset.apply(this,arguments)},play:function(){return this.model.set("state",n.states.PLAYING),this.manager.request(this.player,"/player/playback/play?type="+this.type)},pause:function(){return this.model.set("state",n.states.PAUSED),
this.manager.request(this.player,"/player/playback/pause?type="+this.type)},setPosition:function(e){return this.canSeek(e)?(this.model.set("position",e),this.sendPositionRequest(e)):void 0},sendPositionRequest:e.throttle(function(e){var t={type:this.type,offset:e},n=i.join("/player/playback/seekTo",t);return this.manager.request(this.player,n)},500),setVolume:function(e){this.model.set("volume",e),this.sendVolumeRequest(e)},sendVolumeRequest:e.throttle(function(e){var t={type:this.type,volume:e},n=i.join("/player/playback/setParameters",t);
return this.manager.request(this.player,n)},500),setStream:function(e,t){var i=a.get(e).key;return this.manager.request(this.player,"/player/playback/setStreams?"+i+"="+t+"&type="+this.type)},refreshRemotePlayQueue:function(){var i=this.model.get("playQueue"),n=this.manager.player.get("protocolCapabilities");if(i&&e.contains(n,"playqueues")){var s=i.get("playQueueID");return this.manager.request(this.player,"/player/playback/refreshPlayQueue?playQueueID="+s)}return t.Deferred().resolve().promise();
},skipPrevious:function(){return o.prototype.skipPrevious.apply(this,arguments),this.manager.request(this.player,"/player/playback/skipPrevious?type="+this.type)},skipNext:function(){return o.prototype.skipNext.apply(this,arguments),this.manager.request(this.player,"/player/playback/skipNext?type="+this.type)},skipTo:function(e){return o.prototype.skipTo.apply(this,arguments),this.manager.request(this.player,"/player/playback/skipTo?type="+this.type+"&key="+e)},stop:function(e){return o.prototype.stop.apply(this,arguments),
this.manager.request(this.player,"/player/playback/stop?type="+this.type)},removeItem:function(){var t=o.prototype.removeItem.apply(this,arguments);return t.then(e.bind(this.refreshRemotePlayQueue,this))},moveItem:function(){var t=o.prototype.moveItem.apply(this,arguments);return t.then(e.bind(this.refreshRemotePlayQueue,this))},onTimeline:function(t){if(this.type===t.type&&!t.continuing){var i=this.model.get("playQueue"),a=this.model.get("item");if(i){if(t.key&&t.key!==a.get("key")){if(a=i.get("collection").findWhere({
key:t.key}),!a)return;this.reset(a)}var r=parseInt(t.playQueueVersion,10);r&&r>i.get("playQueueVersion")&&i.fetch()}t.state!==n.states.STOPPED&&(this.hasStarted=!0);var o=parseInt(t.audioStreamID,10),l=parseInt(t.subtitleStreamID,10);this.isTimelineChange=!0,this.model.set({mediaIndex:t.mediaIndex,partIndex:t.partIndex,partCount:t.partCount,audioStreamID:e.isNaN(o)?null:o,subtitleStreamID:e.isNaN(l)?null:l,state:t.state,ready:!0,loaded:"photo"!==this.type,finished:this.hasStarted&&t.state===n.states.STOPPED,
duration:t.duration,position:t.time,volume:t.volume,shuffled:t.shuffle,repeatAll:t.repeat,canPlayPause:t.controllable.indexOf("playPause")>-1,canStop:t.controllable.indexOf("stop")>-1,canSeek:t.controllable.indexOf("seekTo")>-1,canSetVolume:t.controllable.indexOf("volume")>-1,canSetVideoStream:t.controllable.indexOf("videoStream")>-1,canSetAudioStream:t.controllable.indexOf("audioStream")>-1,canSetSubtitleStream:t.controllable.indexOf("subtitleStream")>-1,canShuffle:t.controllable.indexOf("shuffle")>-1,
canRepeat:t.controllable.indexOf("repeat")>-1,canSkipPrevious:t.controllable.indexOf("skipPrevious")>-1,canSkipNext:t.controllable.indexOf("skipNext")>-1}),this.isTimelineChange=!1,"video"===this.type&&s.setViewOffset(a,t.time,t.duration)}}});return l}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5),i(15),i(34),i(14),i(250),i(9),i(571)],s=function(e,t,i,n,s,a,r,o,l,c){"use strict";var u=o.extend({protocol:"plex",controller:c,initialize:function(){e.bindAll(this,"error"),
o.prototype.initialize.apply(this,arguments)},start:function(e){o.prototype.start.apply(this,arguments),this.commandID=0,this.stopPolling=!1,this.poll()},stop:function(){this.stopPolling=!0,this.pollRequest&&this.pollRequest.abort(),o.prototype.stop.apply(this,arguments)},request:function(o,l,c){c||(c={}),c.skipIncrement||this.commandID++,l=r.join(l,{commandID:this.commandID});var u=a.isHostedHttps?o.server:o,d=u.getXHROptions(l);return d.headers["X-Plex-Target-Client-Identifier"]=o.id,t.ajax(d).fail(e.bind(function(e){
if(!this.stopPolling){var t,a=e.responseText,r=s.parseXML(a);t=r&&r.status?r.status:i("The player is unable to perform this action."),n.trigger("show:alert",{type:"error",message:t})}},this))},poll:function(t){t||(t={});var i=r.join("/player/timeline/poll",{wait:t.wait?1:0});this.pollRequest=this.request(this.player,i,{skipIncrement:!0}),this.pollRequest.done(e.bind(function(e,t,i){this.player.id===i.getResponseHeader("X-Plex-Client-Identifier")&&this.onTimeline(e),this.poll({wait:!0})},this)),this.pollRequest.fail(e.bind(function(e){
this.stopPolling||this.error()},this))},error:function(){n.trigger("show:alert",{type:"error",message:i("There was a problem connecting to this player.")}),l.set("primaryPlayer",null),l.get("players").fetch({reset:!0})},onTimeline:function(t){var i=s.parseXML(t);s.parseArray(i,"Timeline"),i.commandID<this.commandID||e.each(i.Timeline,function(e){s.parseInteger(e,["time","duration","volume"]),s.parseBoolean(e,["repeat","shuffle","continuing"]),e.controllable?e.controllable=e.controllable.split(","):e.controllable=[],
this.trigger("timeline",e),this.updateNowPlaying(e)},this)}});return u}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(42)],s=function(e){"use strict";var t={capabilities:{embed:!0,redirect:!0},video:{protocols:{hls:{mimeType:"application/x-mpegURL"}},directPlay:{generic:{video:{maxWidth:1920,maxHeight:1280,maxFrameRate:60}},mp4:{mimeType:'video/mp4; codecs="avc1.42E01E"',video:{codecs:{h264:{}}},audio:{codecs:{aac:{}}}},mkv:{mimeType:"video/webm",video:{codecs:{vp8:{}}},audio:{
codecs:{vorbis:{}}}},ogg:{mimeType:"video/ogg"},mpegts:{protocol:"hls"},flv:{}},directStream:{video:{codecs:{h264:{}},maxWidth:1920,maxHeight:1280,maxBitDepth:8},audio:{codecs:{aac:{}},maxBitrate:192,maxChannels:2}}},music:{directPlay:{generic:{audio:{maxBitrate:350}},mp4:{mimeType:"audio/mp4",audio:{codecs:{aac:{}}}},mp3:{mimeType:'audio/mpeg; codecs="mp3"',audio:{codecs:{mp3:{}}}},ogg:{mimeType:'audio/ogg; codecs="vorbis"',audio:{codecs:{vorbis:{}}}},wav:{mimeType:"audio/wav",audio:{codecs:{pcm:{}
}}}},directStream:{audio:{codecs:{mp3:{}},maxBitrate:320,maxChannels:2}}}};return"ie"===e.id&&"9.0"===e.version&&(t.video.directPlay.mp4.optimizedForStreaming=!0),t}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(4)],s=function(e){"use strict";function t(t){var i=t.channel,n=i.get("identifier"),s=n?"/system/appstore/apps/"+n:i.get("key"),a=s+"/install",r=i.server.getXHROptions(a),o=e.ajax(r);return o.done(function(){i.set("installed",!0)}),o.promise()}return t}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5),i(15)],s=function(e,t,i,n,s){"use strict";function a(a){var r=a.channel,o=r.get("identifier"),l=o?"/system/appstore/apps/"+o:r.get("key"),c=l+"/reset",u=r.server.getXHROptions(c),d=t.ajax(u);return d.done(function(t){var a,r=e.isObject(t)?t:s.parseXML(t);a=r.message?r.message:i("This channel was successfully reset."),n.trigger("show:alert",{type:"success",message:a})}),d.fail(function(){n.trigger("show:alert",{type:"error",message:i("There was a problem resetting this channel.")
})}),d.promise()}return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5),i(15)],s=function(e,t,i,n,s){"use strict";function a(a){var r=a.channel,o=r.get("identifier"),l=o?"/system/appstore/apps/"+o:r.get("key"),c=l+"/restart",u=r.server.getXHROptions(c),d=t.ajax(u);return d.done(function(t){var a,r=e.isObject(t)?t:s.parseXML(t);a=r.message?r.message:i("This channel was successfully restarted."),n.trigger("show:alert",{type:"success",message:a})}),d.fail(function(){
n.trigger("show:alert",{type:"error",message:i("There was a problem restarting this channel.")})}),d.promise()}return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5),i(15),i(22)],s=function(e,t,i,n,s,a){"use strict";function r(r){function o(){var o=t.ajax(p);o.done(function(t){var i=e.isObject(t)?t:s.parseXML(t);c.set("installed",!1),i.message&&!r.skipConfirmation&&n.trigger("show:alert",{type:"success",message:i.message}),l.resolve()}),o.fail(function(e){
if(400===e.status){var t=new a({title:i("Unable to Uninstall Channel"),message:i("This channel could not be uninstalled, but you can disable it in the server settings."),confirmLabel:i("OK"),cancelLabel:i("Ignore")});t.promise.done(function(){n.trigger("navigate","serverSettings",{serverID:c.server.id,group:"channels"})}),n.trigger("show:modal",t)}else n.trigger("show:alert",{type:"error",message:i("This channel could not be uninstalled.")});l.reject(e)})}var l=t.Deferred(),c=r.channel,u=c.get("identifier"),d=u?"/system/appstore/apps/"+u:c.get("key"),h=d+"/uninstall",p=c.server.getXHROptions(h);
if(r.skipConfirmation)o();else{var f=new a({title:i("Uninstall Channel"),message:i("Are you sure you want to uninstall this channel?")}),m=f.promise;m.done(o),m.fail(function(){l.reject()}),n.trigger("show:modal",f)}return l.promise()}return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5),i(15)],s=function(e,t,i,n,s){"use strict";function a(a){function r(i){var a=e.isObject(i)?i:s.parseXML(i);if(!a||!a.message&&!a.Directory)return void o();if(a.message)h||n.trigger("show:alert",{
type:"success",message:a.message}),c.resolve();else{s.parseArray(a,"Directory");var l=a.Directory[0].key,u=t.ajax(d.getXHROptions(l));u.done(r),u.fail(o)}}function o(e){h||n.trigger("show:alert",{type:"error",message:i("There was a problem checking for updates.")}),c.reject(e)}var l,c=t.Deferred(),u=a.channel,d=u?u.server:a.server,h=a.silent;if(u){var p=u.get("identifier"),f=p?"/system/appstore/apps/"+p:u.get("key");l=f+"/update"}else l="/system/appstore/updates";var m=t.ajax(d.getXHROptions(l));return m.done(r),
m.fail(o),c.promise()}return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(14),i(5),i(9)],s=function(e,t,i,n,s,a){"use strict";function r(r){var o=a.get("user"),l=o.server,c={url:r.item.get("url")},u=n.join("/pms/playlists/queue/items",c),d=e.extend(l.getXHROptions(u),{type:"POST"}),h=t.ajax(d).promise();return h.done(function(){s.trigger("show:alert",{type:"success",message:i("{1} added to Watch Later.",r.item.get("title"))})}),h.fail(function(){s.trigger("show:alert",{
type:"error",message:i("There was a problem adding to Watch Later.")})}),h}return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";var n=i(960).default,s=i(962).default,a=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var r=i(389);n(t,s(r,n));var o=i(604),l=a(o);t.playSound=l.default;var c=i(605),u=a(c);t.refreshMetadata=u.default;var d=i(581),h=a(d);t.analyzeItems=h.default;var p=i(582),f=a(p);t.analyzeSection=f.default;var m=i(600),g=a(m);t.markWatched=g.default;
var v=i(599),y=a(v);t.markUnwatched=y.default;var b=i(607),w=a(b);t.unmatch=w.default;var x=i(606),S=a(x);t.splitApart=S.default;var C=i(602),k=a(C);t.merge=k.default;var P=i(591),A=a(P);t.deleteItem=A.default;var I=i(592),_=a(I);t.deleteItems=_.default;var T=i(593),D=a(T);t.deleteMediaItem=D.default;var E=i(597),M=a(E);t.deleteVersions=M.default;var R=i(595),O=a(R);t.deleteSection=O.default;var L=i(596),N=a(L);t.deleteSectionThumbnails=N.default;var F=i(594),U=a(F);t.deletePlaylist=U.default;var z=i(608),B=a(z);
t.updateLibrary=B.default;var j=i(603),V=a(j);t.optimize=V.default;var H=i(585),W=a(H);t.cleanBundles=W.default;var $=i(598),Q=a($);t.emptyTrash=Q.default;var q=i(601),K=a(q);t.match=K.default;var Y=i(583),G=a(Y);t.autoMatch=G.default;var X=i(584),J=a(X);t.changeArtwork=J.default;var Z=i(589),ee=a(Z);t.enableVersionGenerator=ee.default;var te=i(588),ie=a(te);t.disableVersionGenerator=ie.default;var ne=i(590),se=a(ne);t.reprocessVersionGenerator=se.default;var ae=i(587),re=a(ae);t.deleteVersionGenerator=re.default;
var oe=i(586),le=a(oe);t.deleteAllVersionGenerators=le.default;var ce=i(574),ue=a(ce);t.installChannel=ue.default;var de=i(578),he=a(de);t.updateChannel=he.default;var pe=i(576),fe=a(pe);t.restartChannel=fe.default;var me=i(575),ge=a(me);t.resetChannel=ge.default;var ve=i(577),ye=a(ve);t.uninstallChannel=ye.default;var be=i(579),we=a(be);t.watchLater=we.default;var xe=i(609),Se=a(xe);t.playMedia=Se.default;var Ce=i(610),ke=a(Ce);t.queueMedia=ke.default;var Pe=i(613),Ae=a(Pe);t.connectServer=Ae.default;
var Ie=i(615),_e=a(Ie);t.reconnectServer=_e.default;var Te=i(618),De=a(Te);t.signInServer=De.default;var Ee=i(620),Me=a(Ee);t.signUpServer=Me.default;var Re=i(619),Oe=a(Re);t.signOutServer=Oe.default;var Le=i(617),Ne=a(Le);t.removeServer=Ne.default;var Fe=i(612),Ue=a(Fe);t.checkForServerUpdates=Ue.default;var ze=i(614),Be=a(ze);t.installServerUpdates=Be.default;var je=i(616),Ve=a(je);t.redirectToHttp=Ve.default;var He=i(611),We=a(He);t.allowHttpFallback=We.default;var $e=i(621),Qe=a($e);t.showTermsOfService=Qe.default;
var qe=i(632),Ke=a(qe);t.showSyncModal=Ke.default;var Ye=i(631),Ge=a(Ye);t.showHomeWarningsModal=Ge.default;var Xe=i(623),Je=a(Xe);t.deleteSyncItem=Je.default;var Ze=i(251),et=a(Ze);t.refreshSyncItems=et.default;var tt=i(626),it=a(tt);t.removeDevice=it.default;var nt=i(627),st=a(nt);t.removeFriend=st.default;var at=i(622),rt=a(at);t.acceptInvite=rt.default;var ot=i(625),lt=a(ot);t.rejectInvite=lt.default;var ct=i(630),ut=a(ct);t.shareServer=ut.default;var dt=i(629),ht=a(dt);t.removeServerShare=ht.default;
var pt=i(628),ft=a(pt);t.removeHomeUser=ft.default;var mt=i(634),gt=a(mt);t.validateUsername=gt.default;var vt=i(633),yt=a(vt);t.toggleGuest=yt.default;var bt=i(624),wt=a(bt);t.lockUser=wt.default},function(e,t,i){var n,s;n=[i(2),i(4)],s=function(e,t){"use strict";function i(i){var n=i.items;return t.when.apply(t,e.map(n,function(i){var n="/library/metadata/"+i.id+"/analyze",s=e.extend(i.server.getXHROptions(n),{type:"PUT"});return t.ajax(s).promise()}))}return i}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5),i(22)],s=function(e,t,i,n,s){"use strict";function a(a){function r(){var e=t.ajax(u);e.done(function(){o.resolve()}),e.fail(function(e){n.trigger("show:alert",{type:"error",message:i("There was a problem analyzing the library.")}),o.reject(e)}),e.always(function(e){d.hide()})}var o=t.Deferred(),l=a.section,c="/library/sections/"+l.id+"/analyze",u=e.extend(l.server.getXHROptions(c),{type:"PUT"}),d=new s({title:i("Analyze Library"),message:i("Analyzes all the media files in the library. The analysis captures information about the media which helps Plex decide how to optimally play back the media."),
confirmLabel:i("Analyze"),cancelLabel:i("Cancel"),async:!0}),h=d.promise;return h.done(r),h.fail(function(){o.reject()}),n.trigger("show:modal",d),o.promise()}return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5),i(15),i(14)],s=function(e,t,i,n,s,a){"use strict";function r(r){var o=t.Deferred(),l=r.item,c=r.agent,u={agent:c.id,manual:0},d=a.join(["/library/metadata/",l.id,"/matches"],u),h=e.extend(l.server.getXHROptions(d)),p=t.ajax(h);return p.done(function(r){
var c=e.isObject(r)?r:s.parseXML(r);if(c.SearchResult){var d=c.SearchResult;e.isArray(c.SearchResult)&&(d=c.SearchResult[0]),u={guid:d.guid,name:d.name};var h=a.join(["/library/metadata/",l.id,"/match"],u),p=e.extend(l.server.getXHROptions(h),{type:"PUT"}),f=t.ajax(p);f.done(function(){o.resolve()}),f.fail(function(){n.trigger("show:alert",{type:"error",message:i("There was a problem matching this item.")}),o.reject()})}else n.trigger("show:alert",{type:"error",message:i("No matches were found using this agent.")
}),o.reject()}),p.fail(function(e){n.trigger("show:alert",{type:"error",message:i("There was a problem searching for matches.")}),o.reject(e)}),o.promise()}return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(14)],s=function(e,t,i){"use strict";function n(n){var a=n.item,r={url:n.artworkRatingKey},o=i.join(["/library/metadata/",a.id,n.artworkType],r),l=e.extend(a.server.getXHROptions(o),{type:"PUT"}),c=t.ajax(l);return c.done(function(e){a.set(s[n.artworkType],e);
}),c.promise()}var s={poster:"thumb",art:"art",banner:"banner"};return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5),i(22)],s=function(e,t,i,n,s){"use strict";function a(a){function r(){var e=t.ajax(u);e.done(function(){n.trigger("show:alert",{type:"success",message:i("Unused bundles are being removed.")}),o.resolve()}),e.fail(function(e){n.trigger("show:alert",{type:"error",message:i("There was a problem removing unused bundles.")}),o.reject(e)}),e.always(function(e){
d.hide()})}var o=t.Deferred(),l=a.server,c="/library/clean/bundles",u=e.extend(l.getXHROptions(c),{type:"PUT"}),d=new s({title:i("Clean Bundles"),message:i("The media server stores information about your media to disk, as well as posters, artwork, and other media resources from the internet. Running this task deletes any bundles which are no longer in use."),confirmLabel:i("Clean"),cancelLabel:i("Cancel"),async:!0}),h=d.promise;return h.done(r),h.fail(function(){o.reject()}),n.trigger("show:modal",d),
o.promise()}return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5),i(56),i(22)],s=function(e,t,i,n,s,a){"use strict";function r(a){var r=o(),l=r.promise;return l=l.then(function(){var o="/playlists/generators?type="+s.LOCAL,l=e.extend(a.server.getXHROptions(o),{type:"DELETE"}),c=t.ajax(l).promise();return c.fail(function(e){n.trigger("show:alert",{type:"error",message:i("There was a problem deleting all versions.")})}),c.always(function(){r.hide()}),c.promise();
})}function o(){var e=new a({title:i("Delete All Versions"),message:i("Are you sure you want to delete all versions? This cannot be undone."),confirmLabel:i("Delete"),cancelLabel:i("Cancel"),async:!0,hasDanger:!0});return n.trigger("show:modal",e),e}return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(7),i(5),i(251),i(22)],s=function(e,t,i,n){"use strict";function s(i){var n=i.generator,s=a(i),r=s.promise.then(function(){var i=n.destroy();return i.fail(function(i){t.trigger("show:alert",{
type:"error",message:e("Unable to stop generating these versions.")})}),i.always(function(){s.hide()}),i});return r}function a(i){var s=i.generator.get("title"),a=s?e("Removing this item will delete all versions created by {1}. Are you sure you want to continue?",s):e("Removing this item will delete all related versions. Are you sure you want to continue?"),r=new n({title:e("Delete Versions"),message:a,confirmLabel:e("Remove"),cancelLabel:e("Cancel"),async:!0,hasDanger:!0});return t.trigger("show:modal",r),
r}return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5),i(22)],s=function(e,t,i,n,s){"use strict";function a(s){var a=s.generator,o=e.result(a,"url")+"/"+s.ratingKey+"/disable",l=r(),c=l.promise.then(function(){var s=e.extend(a.server.getXHROptions(o),{type:"PUT"}),r=t.ajax(s).promise();return r.fail(function(e){n.trigger("show:alert",{type:"error",message:i("There was a problem disabling this version.")})}),r.always(function(){l.hide()}),r});return c}function r(){
var e=new s({title:i("Remove Version"),message:i("Are you sure you want to delete this version? You can enable it again in Optimized Versions Settings."),confirmLabel:i("Remove"),cancelLabel:i("Cancel"),async:!0,hasDanger:!0});return n.trigger("show:modal",e),e}return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5)],s=function(e,t,i,n){"use strict";function s(s){var a=s.generator,r=e.result(a,"url")+"/"+s.ratingKey+"/enable",o=e.extend(a.server.getXHROptions(r),{
type:"PUT"}),l=t.ajax(o).promise();return l.fail(function(e){n.trigger("show:alert",{type:"error",message:i("There was a problem enabling this version.")})}),l}return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5)],s=function(e,t,i,n){"use strict";function s(s){var a=s.generator,r=s.ratingKey,o=e.result(a,"url");r&&(o+="/"+r),o+="/reprocess";var l=e.extend(a.server.getXHROptions(o),{type:"PUT"}),c=t.ajax(l).promise();return c.fail(function(e){var t=i(r?"There was a problem processing this item.":"There was a problem processing these items.");
n.trigger("show:alert",{type:"error",message:t})}),c}return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(5),i(11),i(35)],s=function(e,t,i,n){"use strict";function s(e){var t=i.execute("deleteFile",e);return t.done(function(){var t=e.item,i=a(t.get("parentKey"),e);if(!i)return void r(e);var n=i.get("children");if(n.length)return void o(i.get("key"),e);i.trigger("destroy",i,i.collection);var s=a(t.get("grandparentKey"),e);if(!s)return void r(e);var l=s.get("children");
l.length?o(s.get("key"),e):r(e)}),t}function a(t,i){if(!t)return!1;var s=new n({key:t},{server:i.item.server,onlyIfCached:!0});return e.isEmpty(s)?!1:s}function r(e){if(!e.skipRedirect){var i=e.item;t.trigger("navigate","section",{serverID:i.server.id,sectionID:i.section.id})}}function o(e,i){if(!i.skipRedirect){var n=i.item;t.trigger("navigate","details",{serverID:n.server.id,key:e})}}return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5),i(25),i(11),i(22)],
s=function(e,t,i,n,s,a,r){"use strict";function o(i){var n=i.items,s=i.item;n||(n=[s]),s||(s=e.first(n));var r=s.get("Media");if(1===n.length&&r.length>1&&s.server.supports("specificMediaDeletion"))return a.execute("deleteMediaItem",{item:s});var o=l({item:s,items:n}),c=o.promise,u=c.then(function(){var s=e.map(n,function(e){return a.execute("deleteItem",{item:e,skipRedirect:i.skipRedirect})});return t.when.apply(t,s).always(function(){o.hide()})});return u}function l(e){var t,a,o=e.item,l=e.items,c=l.length>1,u=s.get(o.get("type"));
c?(t=u.plural,a=i("Are you sure you want to delete {1} items from your filesystem?",l.length)):(t=u.title,a=i("Are you sure you want to delete this item from your filesystem?"));var d={title:i("Delete {1}",t),message:a,confirmLabel:i("Delete"),cancelLabel:i("Cancel"),async:!0,hasDanger:!0};(c||u.child)&&(d.requireDoubleConfirm=!0,d.doubleConfirmMessage=i("Multiple files may be deleted."),d.doubleConfirmLabel=i("Yes, I'm sure"));var h=new r(d);return n.trigger("show:modal",h),h}return o}.apply(t,n),
!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5),i(11),i(869),i(22)],s=function(e,t,i,n,s,a,r){"use strict";function o(e){var t=l(e);return t=t.then(function(t){var i=c(),n=i.promise.then(function(){return s.execute("deleteFile",{item:e.item,media:t}).always(function(){i.hide()})});return n})}function l(e){var i=t.Deferred(),s=e.item,r=s.get("Media");if(e.index in r)return i.resolve(r[e.index]).promise();var o=new a({model:s}),l=o.promise;return l.done(function(e){i.resolve(r[e]);
}),l.fail(function(){i.reject()}),n.trigger("show:modal",o),i.promise()}function c(){var e=new r({title:i("Delete File"),message:i("Are you sure you want to delete this file from your filesystem?"),confirmLabel:i("Delete"),cancelLabel:i("Cancel"),async:!0,hasDanger:!0});return n.trigger("show:modal",e),e}return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(4),i(7),i(5),i(22)],s=function(e,t,i,n){"use strict";function s(s){function a(){var e=s.item.destroy();e.done(function(){
i.trigger("navigate","playlists",{serverID:o.id}),r.resolve()}),e.fail(function(e){i.trigger("show:alert",{type:"error",message:t("There was a problem deleting the playlist.")}),r.reject(e)}),e.always(function(e){l.hide()})}var r=e.Deferred(),o=s.item.server,l=new n({title:t("Delete Playlist"),message:t("Are you sure you want to delete {1}? This cannot be undone.",s.item.get("title")),confirmLabel:t("Delete"),cancelLabel:t("Cancel"),async:!0,hasDanger:!0}),c=l.promise;return c.done(a),c.fail(function(){
r.reject()}),i.trigger("show:modal",l),r.promise()}return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(4),i(7),i(5),i(22)],s=function(e,t,i,n){"use strict";function s(s){function a(){var e=o.destroy({wait:!0});e.done(function(){r.resolve()}),e.fail(function(e){i.trigger("show:alert",{type:"error",message:t("There was a problem deleting the library.")}),r.reject(e)}),e.always(function(e){l.hide()})}var r=e.Deferred(),o=s.section,l=new n({title:t("Delete Library"),message:t("Are you sure you want to delete {1}?",o.get("title")),
confirmLabel:t("Delete"),cancelLabel:t("Cancel"),requireDoubleConfirm:!0,doubleConfirmMessage:t("This cannot be undone."),doubleConfirmLabel:t("Yes, I'm sure"),async:!0,hasDanger:!0}),c=l.promise;return c.done(a),c.fail(function(){r.reject()}),i.trigger("show:modal",l),r.promise()}return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5),i(22)],s=function(e,t,i,n,s){"use strict";function a(a){function r(){var e=t.ajax(c);return e.done(function(e){n.trigger("show:alert",{
type:"success",message:i("The preview thumbnails for items in this library were deleted.")})}),e.fail(function(e){n.trigger("show:alert",{type:"error",message:i("There was a problem deleting the preview thumbnails for items in this library.")})}),e.always(function(e){u.hide()}),e}var o=a.section,l="/library/sections/"+o.id+"/indexes",c=e.extend(o.server.getXHROptions(l),{type:"DELETE"}),u=new s({title:i("Delete Preview Thumbnails"),message:i("Are you sure you want to delete the preview thumbnails for items in this library? This cannot be undone."),
confirmLabel:i("Delete"),cancelLabel:i("Cancel"),async:!0,hasDanger:!0}),d=u.promise;return d=d.then(function(){return r()}),n.trigger("show:modal",u),d}return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5),i(14),i(22)],s=function(e,t,i,n,s,a){"use strict";function r(a){var r=a.item,l=r.server,c=r.get("Media"),u=e.filter(c,function(e){return!!e.proxyType}),d=o({item:r,versions:u}),h=d.promise,p=h.then(function(){var a=s.join(["/library/metadata/",r.id],{
proxy:1}),o=e.extend(l.getXHROptions(a),{type:"DELETE"}),h=t.ajax(o);return h.done(function(){e.each(u,function(t){c.splice(e.indexOf(c,t),1)}),r.trigger("change:Media",r,r.get("Media"))}),h.fail(function(e){var t=i(403===e.status?'"Allow clients to delete media" must be enabled in your server settings.':"There was a problem deleting these versions.");n.trigger("show:alert",{type:"error",message:t})}),h.always(function(){d.hide()}),h.promise()});return p}function o(t){var s,r=t.item,o=t.versions,l=o.length>1;
if(l)s=i("Are you sure you want to delete {1} versions of {2}?",o.length,r.get("title"));else{var c=e.first(o);s=i("Are you sure you want to delete the {1} version of {2}?",c.title,r.get("title"))}var u=new a({title:i(l?"Delete Versions":"Delete Version"),message:s,confirmLabel:i("Delete"),cancelLabel:i("Cancel"),async:!0,hasDanger:!0});return n.trigger("show:modal",u),u}return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5),i(22)],s=function(e,t,i,n,s){
"use strict";function a(a){function r(){e.each(u,function(i){var n="/library/sections/"+i+"/emptyTrash",s=e.extend(c.getXHROptions(n),{type:"PUT"});d.push(t.ajax(s))});var s=t.when.apply(t,d);s.done(function(){n.trigger("show:alert",{type:"success",message:i("The trash was emptied.")}),o.resolve()}),s.fail(function(e){n.trigger("show:alert",{type:"error",message:i("There was a problem emptying the trash.")}),o.reject(e)}),s.always(function(e){p.hide()})}var o=t.Deferred(),l=a.section,c=l?l.server:a.server,u=[],d=[];
if(l)u.push(l.id);else{var h=c.get("sections");h.each(function(e){u.push(e.id)})}var p=new s({title:i("Empty Trash"),message:i("By default the media server doesn't remove information for media right away. This helps if a drive is temporarily disconnected. When you empty the trash for a section, all information about missing media is deleted."),confirmLabel:i("Empty"),cancelLabel:i("Cancel"),async:!0}),f=p.promise;return f.done(r),f.fail(function(){o.reject()}),n.trigger("show:modal",p),o.promise();
}return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5),i(25),i(11),i(22)],s=function(e,t,i,n,s,a,r){"use strict";function o(o){var l,c,u=t.Deferred();o.item?(l=o.item,c=[l]):o.items&&(c=o.items,l=c[0]);var d=e.extend({},o,{watched:!1}),h=l.get("type"),p=s.get(h),f=p&&"directory"===p.element,m=(f||c.length>1)&&!o.force,g=1===c.length,v=g&&l.get("isSection")?l.getSyncTitle():l.get("title");if(m){var y;switch(l.get("type")){case"movie":y=g?i("Are you sure you want to mark {1} as unwatched?",v):i("Are you sure you want to mark these movies as unwatched?");
break;case"show":case"season":case"episode":y=g?i("Are you sure you want to mark all episodes of {1} as unwatched?",v):i("Are you sure you want to mark these episodes as unwatched?");break;default:y=g?i("Are you sure you want to mark {1} as unwatched?",v):i("Are you sure you want to mark these items as unwatched?")}var b=new r({title:i("Mark as Unwatched"),message:y}),w=b.promise;w.done(function(){a.execute("updateWatchedStatus",d)}),w.fail(function(){u.reject()}),n.trigger("show:modal",b)}else a.execute("updateWatchedStatus",d);
return u.promise()}return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5),i(25),i(11),i(22)],s=function(e,t,i,n,s,a,r){"use strict";function o(o){var l,c,u=t.Deferred();o.item?(l=o.item,c=[l]):o.items&&(c=o.items,l=c[0]);var d=e.extend({},o,{watched:!0}),h=l.get("type"),p=s.get(h),f=p&&"directory"===p.element,m=(f||c.length>1)&&!o.force,g=1===c.length,v=g&&l.get("isSection")?l.getSyncTitle():l.get("title");if(m){var y;switch(l.get("type")){case"movie":y=g?i("Are you sure you want to mark {1} as watched?",v):i("Are you sure you want to mark these movies as watched?");
break;case"show":case"season":case"episode":y=g?i("Are you sure you want to mark all episodes of {1} as watched?",v):i("Are you sure you want to mark these episodes as watched?");break;default:y=g?i("Are you sure you want to mark {1} as watched?",v):i("Are you sure you want to mark these items as watched?")}var b=new r({title:i("Mark as Watched"),message:y}),w=b.promise;w.done(function(){a.execute("updateWatchedStatus",d)}),w.fail(function(){u.reject()}),n.trigger("show:modal",b)}else a.execute("updateWatchedStatus",d);
return u.promise()}return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(14)],s=function(e,t,i){"use strict";function n(n){var s=n.item,a={guid:n.guid,name:n.name};"album"===s.get("type")&&n.children&&n.children.reduce(function(e,t){var i=t.get("id");return i&&(e["guid["+i+"]"]=t.get("guid")),e},a);var r=i.join(["/library/metadata/",s.id,"/match"],a),o=e.extend(s.server.getXHROptions(r),{type:"PUT"});return t.ajax(o).promise()}return n}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5),i(22)],s=function(e,t,i,n,s){"use strict";function a(a){function r(){var e=t.ajax(d);e.done(function(){o.resolve()}),e.fail(function(e){n.trigger("show:alert",{type:"error",message:i("There was a problem merging these items.")}),o.reject(e)}),e.always(function(e){h.hide()})}var o=t.Deferred(),l=a.item,c=e.pluck(a.items,"id").join(","),u="/library/metadata/"+l.id+"/merge?ids="+c,d=e.extend(l.server.getXHROptions(u),{type:"PUT"}),h=new s({title:i("Merge"),
message:i("Are you sure you want to merge these items together?"),async:!0}),p=h.promise;return p.done(r),p.fail(function(){o.reject()}),n.trigger("show:modal",h),o.promise()}return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5),i(22)],s=function(e,t,i,n,s){"use strict";function a(a){function r(){var e=t.ajax(u);e.done(function(){n.trigger("show:alert",{type:"success",message:i("The database was optimized.")}),o.resolve()}),e.fail(function(e){n.trigger("show:alert",{
type:"error",message:i("There was a problem optimizing this database.")}),o.reject(e)}),e.always(function(e){d.hide()})}var o=t.Deferred(),l=a.server,c="/library/optimize",u=e.extend(l.getXHROptions(c),{type:"PUT"}),d=new s({title:i("Optimize Database"),message:i("Cleans up the library database and ensures it is operating as quickly as possible. This is especially useful when you've added or removed a large amount of media from the library."),confirmLabel:i("Optimize"),cancelLabel:i("Cancel"),async:!0
}),h=d.promise;return h.done(r),h.fail(function(){o.reject()}),n.trigger("show:modal",d),o.promise()}return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(413)],s=function(e,t){"use strict";function i(){l&&(l.destruct(),l=null)}function n(){var e=setInterval(function(){return l?(l.setVolume(l.volume-5),void(l.volume<=0&&(clearInterval(e),i()))):void clearInterval(e)},50)}function s(n){n.onfinish?n.onfinish=e.wrap(n.onfinish,function(e){i(),e()}):n.onfinish=i,n.id=n.url,
l=t.createSound(n),l.key=n.key,l.background=!!n.background,n.oncreate&&n.oncreate(l)}function a(e){if(l&&e.background){if(!l.background)return;if(l.url===e.url)return void(l.key=e.key)}i(),t.preferFlash&&!t.swfLoaded?(t.preferFlash=!1,t.onready(function(){s(e)}),t.reboot()):s(e)}function r(e){l&&(e.key&&e.key!==l.key||(l.background?n():e.background||i()))}function o(e){e||(e={}),e.stop?r(e):a(e)}var l;return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5),i(173)],
s=function(e,t,i,n,s){"use strict";function a(a){var r,o;return a.item?(r=a.item,o=[r]):(o=a.items,r=o[0]),t.when.apply(t,e.map(o,function(i){var n="/library/metadata/"+i.id+"/refresh",s=e.extend(r.server.getXHROptions(n),{type:"PUT"});return t.ajax(s).promise()})).fail(function(e){503===e.status?n.trigger("show:modal",new s({model:r.server})):n.trigger("show:alert",{type:"error",message:i("There was a problem refreshing.")})})}return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;
n=[i(2),i(4),i(7),i(5),i(22)],s=function(e,t,i,n,s){"use strict";function a(a){function r(){var s=e.extend(l.server.getXHROptions(c),{type:"PUT"}),a=t.ajax(s);a.done(function(){var e,t=l.get("type");e="show"===t||"artist"===t||"album"===t?"Location":"Media",l.set(e,l.get(e).slice(0,1)),n.trigger("navigate:back"),o.resolve()}),a.fail(function(e){n.trigger("show:alert",{type:"error",message:i("There was a problem splitting this item apart.")}),o.reject(e)}),a.always(function(e){u.hide()})}var o=t.Deferred(),l=a.item,c="/library/metadata/"+l.id+"/split",u=new s({
title:i("Split Apart"),message:i("Are you sure you want to split this item apart?"),async:!0}),d=u.promise;return d.done(r),d.fail(function(){o.reject()}),n.trigger("show:modal",u),o.promise()}return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5),i(9)],s=function(e,t,i,n,s){"use strict";function a(s){var a=s.item,r="/library/metadata/"+a.id+"/unmatch",o=e.extend(a.server.getXHROptions(r),{type:"PUT"}),l=t.ajax(o);return l.fail(function(){n.trigger("show:alert",{
type:"error",message:i("There was a problem unmatching this item.")})}),l.promise()}return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5),i(22),i(173)],s=function(e,t,i,n,s,a){"use strict";function r(r){function o(){var e=t.ajax(g);e.done(function(){l.resolve()}),e.fail(function(e){if(503===e.status)n.trigger("show:modal",new a({model:h}));else{var t=i(d?"There was a problem canceling the update.":"There was a problem updating the library.");n.trigger("show:alert",{
type:"error",message:t})}l.reject(e)})}var l=t.Deferred(),c=r.section,u=c?c.id:"all",d=r.cancel,h=c?c.server:r.server,p=r.params||{},f={};p.force&&(f.force=1);var m="/library/sections/"+u+"/refresh",g=e.extend(h.getXHROptions(m),{data:f});if(d&&(g.type="DELETE",c&&c.set("refreshing",!1)),f.force){var v=new s({title:i("Refresh All"),message:i("Forces a download of fresh media information from the internet. This can take a long time. Any locked fields are not modified."),confirmLabel:i("Refresh"),cancelLabel:i("Cancel")
}),y=v.promise;y.done(o),y.fail(function(){l.reject()}),n.trigger("show:modal",v)}else o();return l.promise()}return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(7),i(5),i(534),i(9),i(22)],s=function(e,t,i,n,s,a){"use strict";function r(r){var o=e.clone(r);o.confirmClearPlayQueue=function(){var e=new a({title:t("Play Now"),message:t("This will clear the contents of Up Next and play the selection instead.")});return i.trigger("show:modal",e),e.promise};var l=s.get("primaryPlayer");
return o.supportsContinuous=!l||e(l.get("protocolCapabilities")).contains("playqueues"),n(o).progress(function(e){i.trigger("show:playerLoading",e)}).then(function(e){i.trigger("show:player",e)}).fail(function(e){i.trigger("hide:playerLoading",e)})}return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(5),i(25),i(16)],s=function(e,t,i){"use strict";function n(n){var s,a;n.items?(a=n.items,s=a[0]):n.item&&(s=n.item,a=[s]),n.items=a;var r=t.getChildMediaType(s.get("type")).element,o=s.server.get("playQueueManager").getFor(s);
o?o.queueContent(s,n).done(function(){"audio"===r.element&&e.trigger("show:music",{collection:o})}):i.warn("No compatible queue found. Item not queued.")}return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(4),i(5),i(91),i(17),i(864)],s=function(e,t,i,n,s){"use strict";function a(e){var a=new s({server:e}),r=a.promise.then(function(){var t=e.get("publicAddressMatches")?i.SAME_NETWORK:i.ALWAYS;return n.save("allowHttpFallback",t)});return r.done(function(){t.trigger("test:server",e);
}),t.trigger("show:modal",a),r}return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(14)],s=function(e,t,i){"use strict";function n(n){var s=n.server,a={download:n.download===!1?"0":"1"},r=i.join("/updater/check",a),o=e.extend(s.getXHROptions(r),{type:"PUT"}),l=n.initialState||"checking",c=s.get("update");c.set("state",l);var u=t.ajax(o).promise();return u.fail(function(){c.set("state","error")}),u}return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){
var n,s;n=[i(4),i(7),i(5)],s=function(e,t,i){"use strict";function n(n){function s(){var e=r.fetch();e.done(function(){var e=r.get("mappingState"),t=n.value&&"unknown"===e,i=!n.value&&"mapped"===e;"waiting"===e||t||i?a||(a=setInterval(s,u)):(a=clearInterval(a),r.isWaiting()&&r.set("remoteAccessState",""),c.resolve())})}var a,r=n.cloudAccount,o=r.server.get("settings"),l=o.get("PublishServerOnPlexOnlineKey"),c=e.Deferred(),u=500;if(!r.isWaiting()){var d=n.value?"connecting":"disconnecting";r.set("remoteAccessState",d);
}var h=r.previous("remoteAccessState"),p=l.save({PublishServerOnPlexOnlineKey:n.value},{timeout:0});return p.done(s),p.fail(function(e){var s;s=t(n.value?"There was a problem connecting your server.":"There was a problem disconnecting your server."),i.trigger("show:alert",{type:"error",message:s}),r.set("remoteAccessState",h),c.reject(e)}),c.promise()}return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5),i(22)],s=function(e,t,i,n,s){"use strict";function a(a){
function r(){var e=l.get("update");e.set("state","installing");var i=t.ajax(u).promise();return i.fail(function(){e.set("state","error")}),i}var o,l=a.server,c="/updater/apply",u=e.extend(l.getXHROptions(c),{type:"PUT"});l.get("activeConnection").get("isLoopback")||(o=new s({title:i("Remote Installation"),confirmLabel:i("Continue"),cancelLabel:i("Cancel"),message:i("The installer may display dialogs that require input. Make sure you have desktop access to the computer running Plex Media Server before continuing."),
hasDanger:!0}),n.trigger("show:modal",o));var d=o?o.promise:t.Deferred().resolve().promise();return d=d.then(function(){return r()})}return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(11)],s=function(e,t,i){"use strict";function n(e){var n=e.cloudAccount,s={cloudAccount:n,value:!1},a=i.execute("connectServer",s);return a=a.then(function(){return s.value=!0,i.execute("connectServer",s)}),a=a.then(function(){return n.get("mappingError")?t.Deferred().reject().promise():void 0;
})}return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(4)],s=function(e){"use strict";function t(){return window.location=i(),e.Deferred().resolve().promise()}function i(){return window.location.href.replace("https://","http://")}return t}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5),i(9),i(53),i(22)],s=function(e,t,i,n,s,a,r){"use strict";function o(t){var i=new a({machineIdentifier:t},{onlyIfCached:!0});return e.isEmpty(i)?void 0:i;
}function l(e){var t=e.get("cloudAccount"),i=t.destroy();return i.done(function(){e.set({myPlexSigninState:"none",myPlexSubscription:!1})}),i}function c(e){e.trigger("destroy",e,e.collection),e.cache.remove(e)}function u(a){function u(){var i;if(p)i=p.destroy({wait:!0});else{var s="/api/servers/"+f.id,a=e.extend(h.server.getXHROptions(s),{type:"DELETE"});i=t.ajax(a)}if(f.get("connected")&&"ok"===f.get("myPlexSigninState")){var r=f.get("cloudAccount");i=i.then(function(){return r.fetch()}),i=i.then(function(){
return l(f)})}return f.get("connected")===!1?c(f):i.always(function(){n.trigger("test:server",f),f.populate().fail(function(){c(f)})}),i.always(function(){m.hide()}),i.promise()}var d,h=s.get("user"),p=a.device,f=a.server||o(p.get("clientIdentifier"));d=i(p?"If you remove the server, you will need to sign the server in again to restore access to Plex.":"Are you sure you want to remove this server?");var m=new r({title:i("Remove Server"),message:d,confirmLabel:i("Remove"),cancelLabel:i("Cancel"),async:!0,
hasDanger:!0}),g=m.promise;return g=g.then(function(){return u()}),n.trigger("show:modal",m),g}return u}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5),i(15)],s=function(e,t,i,n,s){"use strict";function a(a){var r=t.Deferred(),o=a.cloudAccount;o.set("signedIn",!0,{silent:!0}),o.set({username:"",password:""});var l=o.save({username:a.username,password:a.password},{wait:!0,timeout:0});return l.done(function(t){var l=e.isObject(t)?t:s.parseXML(t);l&&"invalid"===l.signInState?(n.trigger("show:alert",{
type:"error",message:i("The username or password is incorrect.")}),r.reject()):(o.trigger("change:signedIn",o,!0),o.server.set({myPlexSigninState:"ok",myPlexUsername:a.username}),r.resolve())}),l.fail(function(e){o.set("signedIn",!1,{silent:!0});var t;t=i(401===e.status?"The username or password is incorrect.":"There was a problem signing in to Plex."),n.trigger("show:alert",{type:"error",message:t}),r.reject(e)}),r.promise()}return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;
n=[i(7),i(5)],s=function(e,t){"use strict";function i(i){var n=i.cloudAccount,s=n.destroy({timeout:0});return s.done(function(){n.server.set({myPlexSigninState:"none",myPlexSubscription:!1})}),s.fail(function(){t.trigger("show:alert",{type:"error",message:e("There was a problem signing the server out.")})}),s.promise()}return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5),i(15)],s=function(e,t,i,n,s){"use strict";function a(a){var r=t.Deferred(),o=a.cloudAccount;
o.set("signedIn",!1),o.set({username:"",email:"",password:""});var l=o.save({username:a.username,email:a.email,password:a.password});return l.done(function(t){var a=e.isObject(t)?t:s.parseXML(t);if(a&&"invalid"===a.signInState){var l;s.parseArray(a,"Error"),l=a.Error.length?e.first(a.Error).error:i("This account information is invalid."),n.trigger("show:alert",{type:"error",message:l}),r.reject()}else o.set("signedIn",!0),r.resolve()}),l.fail(function(e){n.trigger("show:alert",{type:"error",message:i("There was a problem signing up for a Plex account.")
}),r.reject(e)}),r.promise()}return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(5),i(872)],s=function(e,t){"use strict";function i(i){e.trigger("show:modal",new t({collection:i.collection}))}return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5),i(9),i(22),i(107)],s=function(e,t,i,n,s,a,r){"use strict";function o(a){function r(){var e=o.save(null,{force:!0});o.trigger("destroy",o,u),e.done(function(){p.fetch(),h.get("friends").fetch(),
h.get("sentInvites").fetch(),o.get("server")&&h.server.get("resources").fetch(),f.resolve()}),e.fail(function(e){n.trigger("show:alert",{type:"error",message:i("There was a problem accepting this invite.")}),u.add(o,{at:d}),f.reject(e)})}var o=a.invite,u=o.collection,d=u.indexOf(o),h=s.get("user"),p=h.get("homeUsers"),f=t.Deferred();e.extend(a,{homeUsers:p,signedInHomeUser:p.get(h.id)});var m=l(a);return m.done(function(){c(a).always(r)}),m.fail(function(){f.reject()}),f.promise}function l(e){if(!e.invite.get("home"))return t.Deferred().resolve().promise();
var s;s=i(e.homeUsers.length>1?e.signedInHomeUser.get("admin")?"You are the admin in your current home. If you leave, the remaining users will be removed and managed users will be deleted.":"Are you sure you want to join this home? You will leave your current home.":"The admin of this home will have access to your account. Other users of this home will be able to switch to your account by entering your PIN.");var r=new a({title:i("Join Home"),message:s,confirmLabel:i("Join"),cancelLabel:i("Cancel"),
hasDanger:!0});return n.trigger("show:modal",r),r.promise}function c(e){if(e.invite.get("home")&&!e.signedInHomeUser.get("protected")){var i=new r({model:e.signedInHomeUser,isEditing:!0,isEditWarning:!0});return n.trigger("show:modal",i),i.promise}return t.Deferred().resolve().promise()}return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(4),i(7),i(5),i(11),i(22)],s=function(e,t,i,n,s){"use strict";function a(s){var a=s.syncItem,o=s.server;if(!a.server.get("connected"))return i.trigger("show:alert",{
type:"error",message:t("Please sign in to remove sync items.")}),e.Deferred().reject().promise();var l=r(),c=l.promise.then(function(){var e=a.destroy();return e.fail(function(e){i.trigger("show:alert",{type:"error",message:t("There was a problem removing this sync item.")})}),e.always(function(){l.hide()}),e});return c=c.then(function(){return n.execute("refreshSyncItems",{server:o,silent:!0,skipContent:!0})})}function r(){var e=new s({title:t("Stop Syncing"),message:t("Are you sure you want to stop syncing this item? All files created by this job will be removed from the device."),
confirmLabel:t("Remove"),cancelLabel:t("Cancel"),async:!0,hasDanger:!0});return i.trigger("show:modal",e),e}return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(11),i(5),i(44),i(9),i(146)],s=function(e,t,i,n,s,a,r){"use strict";function o(){return l().then(c).then(u)}function l(){var e=t.Deferred(),i=a.get("user");if(i.hasPlexPass()||i.get("homeUsers").length>1){var n=i.get("homeUsers").findWhere({guest:!0}),s=i.get("homeDetails");if(n)e.resolve(n);else{var o=s.populate();
o.done(function(){n=new r({id:s.get("guestUserID"),guest:!0},{server:i.server}),e.resolve(n)}),o.fail(function(){e.reject()})}}else e.reject();return e.promise()}function c(e){return i.execute("authenticateWithServer",{homeUser:e})}function u(e){var i=t.Deferred(),s=a.get("user"),r=s.id,o=s.clearAccessToken();return o.always(function(){var t=s.signIn(e,null,{silent:!0});t.always(function(){n.trigger("home:locked",r),i.resolve()})}),i.promise()}return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){
var n,s;n=[i(7),i(5),i(9),i(22)],s=function(e,t,i,n){"use strict";function s(e){function n(){var t=s.destroy({wait:!0});return t.done(function(){if(s.get("server")){var e=i.get("user");e.get("friends").fetch()}}),t.fail(function(){r(e)}),t.always(function(){o.hide()}),t.promise()}var s=e.invite,o=a(e),l=o.promise;return l=l.then(function(){return n()}),t.trigger("show:modal",o),l}function a(t){var i,s;"requests"===t.subset?(i=e("Reject Invite"),s=e("Are you sure you want to reject this invite?")):(i=e("Cancel Invite"),
s=e("Are you sure you want to cancel this invite?"));var a=new n({title:i,message:s,async:!0});return a}function r(i){var n;n=e("requests"===i.subset?"There was a problem rejecting this invite.":"There was a problem canceling this invite."),t.trigger("show:alert",{type:"error",message:n})}return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(7),i(5),i(22)],s=function(e,t,i){"use strict";function n(n){function s(){var i=r.destroy({wait:!0});return i.fail(function(){t.trigger("show:alert",{
type:"error",message:e("There was a problem removing this device.")})}),i.always(function(){o.hide()}),i.promise()}var a,r=n.device;a=e(r.get("isCloudSync")?"Deleting the Cloud Sync entry will stop Plex from being able to access any existing Cloud Sync content. You will need to create and upload new sync items.":"If you remove this device, you will need to sign in again on the device to restore access to Plex.");var o=new i({title:e("Remove Device"),message:a,confirmLabel:e("Remove"),cancelLabel:e("Cancel"),
async:!0,hasDanger:!0}),l=o.promise;return l=l.then(function(){return s()}),t.trigger("show:modal",o),l}return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(7),i(5),i(98),i(9),i(22)],s=function(e,t,i,n,s){"use strict";function a(i){function s(){o&&a.set("home",!1);var i=a.destroy({wait:!0});return i.done(function(){var e=n.get("user"),t=a.get("serverShares");if(e.get("invites").fetch(),e.get("sentInvites").fetch(),o){var i=e.get("homeUsers");i.fetch()}t.getLibraryCount({
owned:!1})&&e.server.get("resources").fetch()}),i.fail(function(){o&&a.set("home",!0),t.trigger("show:alert",{type:"error",message:e("There was a problem removing this friend.")})}),i.always(function(){l.hide()}),i.promise()}var a=i.friend,o=a.get("home"),l=r(i),c=l.promise;return c=c.then(function(){return s()}),t.trigger("show:modal",l),c}function r(t){var a=t.friend,r=a.get("serverShares"),o=r.getLibraryCount({owned:!0}),l=r.getLibraryCount({owned:!1}),c=o+l,u=a.get("title"),d=e("Are you sure you want to remove {1}?",u),h=i(e("library"),c,e("libraries"));
if(o&&l?d+=" "+e("You are sharing {1} {2} with each other.",c,h):o?d+=" "+e("You are sharing {1} {2} with this friend.",o,h):l&&(d+=" "+e("This friend is sharing {1} {2} with you.",l,h)),a.get("home")){var p=n.get("user"),f=p.get("homeUsers"),m=f.get(p.id);d+=m.get("admin")?" "+e("This friend will be removed from your home."):" "+e("You will be leaving your home.")}var g=new s({title:e("Remove Friend"),message:d,confirmLabel:e("Remove"),cancelLabel:e("Cancel"),async:!0,hasDanger:!0});return g}return a;
}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5),i(9),i(22)],s=function(e,t,i,n,s,a){"use strict";function r(i){function a(){var n=e.extend(r.server.getXHROptions(r.url()),{type:"DELETE"}),s=t.ajax(n);return s.done(function(){var e=d.get(r.id);e?(r.trigger("destroy",r,u),r.get("restricted")?e.trigger("destroy",e,d):e.set("home",!1)):(u.reset([r]),r.set("admin",!0),d.each(function(e){e.set("home",!1)}));var t=c.hasHome();if(c.set("home",t),!t){var i=c.get("homeDetails");
i.clear()}}),s.fail(function(){l(i)}),s.always(function(){h.hide()}),s.promise()}var r=i.homeUser,c=s.get("user"),u=c.get("homeUsers"),d=c.get("friends"),h=o(i),p=h.promise;return p=p.then(function(){return a()}),n.trigger("show:modal",h),p}function o(e){var t,n,s,r=e.homeUser;e.isSignedInUser?(t=i("Leave Home"),s=i("Leave"),n=i(r.get("admin")?"You are the admin in this home. If you leave, the remaining users will be removed and managed users will be deleted.":"Are you sure you want to leave this home?")):(t=i("Remove User"),
s=i("Remove"),n=i(r.get("restricted")?"Removing a managed user from your home will delete the managed user. Watched status for this user will be lost. This cannot be undone.":"You will no longer be able to switch to this user."));var o=new a({title:t,message:n,confirmLabel:s,cancelLabel:i("Cancel"),async:!0,hasDanger:!0});return o}function l(e){var t;t=i(e.isSignedInUser?"There was a problem leaving this home.":"There was a problem removing this user."),n.trigger("show:alert",{type:"error",message:t
})}return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(7),i(5),i(9),i(22)],s=function(e,t,i,n){"use strict";function s(s){function a(){var n=l.destroy({wait:!0});return n.done(function(){var e=i.get("user");e.get("friends").fetch(),e.get("invites").fetch(),e.server.get("resources").fetch()}),n.fail(function(){var i;i=e(l.get("owned")?"There was a problem removing this share.":"There was a problem leaving this server."),t.trigger("show:alert",{type:"error",message:i})}),
n.always(function(){c.hide()}),n.promise()}var r,o,l=s.serverShare;l.get("owned")?(r=e("Stop Sharing"),o=e("Are you sure you want to stop sharing with this friend?")):(r=e("Leave Server"),o=e("Are you sure you want to leave this server? You can rejoin at any time."));var c=new n({title:r,message:o,async:!0,hasDanger:!0}),u=c.promise;return u=u.then(function(){return a()}),t.trigger("show:modal",c),u}return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4)],s=function(e,t){
"use strict";function i(i){var n,s=i.user,a=i.serverShare,r=a.get("Section");if(!r||!r.length)return t.Deferred().resolve().promise();n=a.get("allLibraries")?[]:e.pluck(e.where(r,{shared:!0}),"id");var o={server_id:a.get("machineIdentifier"),shared_server:{library_section_ids:n}};s.isNew()&&(o.sharing_settings=s.getSaveParams()),a.isNew()&&(s.isNew()?o.shared_server.invited_email=s.get("username"):o.shared_server.invited_id=s.id);var l=a.url(),c=e.extend(s.server.getXHROptions(l),{type:a.isNew()?"POST":"PUT",
contentType:"application/json",data:JSON.stringify(o)});return t.ajax(c).promise()}return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";function n(e){var t=u.default.get("user"),i=t.get("homeUsers"),n=i.get(t.id);if(n.get("protected")||i.length>1)return r.default.Deferred().reject().promise();var s=new h.default({model:n,isEditing:!0,isEditWarning:!0});return s.promise.always(function(e){e||l.default.trigger("show:modal",new f.default({type:"home"}))}),l.default.trigger("show:modal",s),
s.promise}var s=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var a=i(4),r=s(a),o=i(5),l=s(o),c=i(9),u=s(c),d=i(107),h=s(d),p=i(288),f=s(p);t.default=n,e.exports=t.default},function(e,t,i){var n,s;n=[i(2),i(7),i(5),i(9),i(285),i(287),i(868)],s=function(e,t,i,n,s,a,r){"use strict";function o(o){var l=n.get("user");if("ok"!==o.item.server.get("myPlexSigninState")){var c=t("This server needs to be connected to Plex to sync its content.");return void i.trigger("show:alert",{type:"error",
message:c})}if(!o.item.server.get("myPlexSubscription"))return void i.trigger("show:modal",new s({model:l}));var u=l.get("devices"),d=u.filterSyncDevices(o.item),h=e.clone(o);if(d.length>1){var p=new r({collection:d}),f=p.promise;f.done(function(e){h.device=d.get(e),i.trigger("show:modal",new a(h))}),i.trigger("show:modal",p)}else h.device=d.first(),i.trigger("show:modal",new a(h))}return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(7),i(5),i(15),i(11)],s=function(e,t,i,n,s){
"use strict";function a(a){var r=a.user,o=r.get("homeDetails"),l=r.get("homeSize");o.set("guestEnabled",a.enable);var c=o.save();return c.done(function(){r.get("homeUsers").fetch(),r.get("friends").fetch(),r.hasHome()||s.execute("showHomeWarningsModal"),a.enable||2!==l||o.clear()}),c.fail(function(s){var r=n.parseXML(s.responseText),o=r&&r.status;e.isString(o)||(o=t(a.enable?"Unable to enable guest account":"Unable to disable guest account")),i.trigger("show:alert",{type:"error",message:o})}),c}return a;
}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(15)],s=function(e,t,i){"use strict";function n(n){var s=t.Deferred(),a="/api/users/validate?invited_email="+encodeURIComponent(n.username),r=e.extend(n.server.getXHROptions(a),{type:"POST"}),o=t.ajax(r);return o.done(function(){s.resolve()}),o.fail(function(e){var t=e.responseText,n=i.parseXML(t);s.reject(e,n&&n.status)}),s.promise()}return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;window.PLEXWEB=window.PLEXWEB||{},
window.PLEXWEB.allowFlash=!0,window.PLEXWEB.allowServerUpdates=!0,window.PLEXWEB.allowHttpsMediaServerConnections=!0,n=[i(6),i(529),i(11),i(580),i(562),i(637),i(643)],s=function(e,t,i,n,s,a,r){"use strict";new t,i.registerAll(n),s.registerAll();var o=new e.Application;return o.addInitializer(r),o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(4),a=n(s),r=i(9),o=n(r),l=i(440),c=n(l),u=i(184),d={init:function(){
return(0,u.registerAll)({logs:new c.default([],{parent:o.default})}),a.default.Deferred().resolve().promise()}};t.default=d,e.exports=t.default},function(e,t,i){var n,s;n=[i(1217),i(1215),i(1216),i(1214),i(1218),i(1212),i(1213),i(3)],s=function(e,t,i,n,s,a,r,o){"use strict";o.registerPartial("setting",e),o.registerPartial("lockableTagInput",t),o.registerPartial("lockableTextInput",i),o.registerPartial("lockableNumericInput",n),o.registerPartial("textInput",s),o.registerPartial("autocompleteTextInput",a),
o.registerPartial("connectError",r)}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(5),i(410),i(72)],s=function(e,t,i){"use strict";var n={init:function(){t.init(),e.on("show:modal",function(e){e.name&&i.trackView(e.name)})}};return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(415),i(647),i(646),i(9)],s=function(e,t,i,n){"use strict";var s={init:function(){var s=n.get("servers"),a=new t({servers:s});a.start();var r=new i({appModel:n,servers:s});e.init({
servers:s,primaryServerManager:r})}};return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";function n(){var e=o.default.Deferred(),t=d.default.get("myPlexAccessToken");return t.done(function(){window.PLEXWEB.myPlexAccessToken||c.default.register(d.default.getInstance())}),t.always(function(){e.resolve()}),e.promise()}function s(){var e=o.default.Deferred(),t=c.default.set("plexTestToken",1);return t.done(function(){c.default.remove("plexTestToken")}),t.fail(function(e){var t=new p.default;
m.default.warn("Storage module swapped for "+t.storageName+' due to exception: "'+e+'"'),d.default.register(t),c.default.register(t,{ignorePrevious:!0})}),t.always(function(){e.resolve()}),e.promise()}var a=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var r=i(4),o=a(r),l=i(44),c=a(l),u=i(114),d=a(u),h=i(386),p=a(h),f=i(16),m=a(f),g=i(417),v=a(g),y={init:function(){return n().then(s).then(v.default.init())}};t.default=y,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;
Object.defineProperty(t,"__esModule",{value:!0});var s=i(418),a=n(s),r=i(17),o=n(r),l=i(9),c=n(l),u=i(45),d=n(u),h=i(76),p=i(648),f=n(p),m={init:function(){var e=c.default.get("user"),t=a.default.init();return t.done(function(){var t=new f.default(e);if(t.start(),!o.default.get("autoLogin")){var i=d.default.getActiveUser();i&&i.get("home")&&e.set("lockState",h.lockStates.LOCKED)}}),t}};t.default=m,e.exports=t.default},function(e,t,i){var n,s;n=[i(2),i(1283),i(5),i(17),i(137)],s=function(e,t,i,n,s){
"use strict";var a={init:function(){function a(t){return(o||arguments[1]instanceof KeyboardEvent&&"esc"===arguments[2])&&n.get("keyboardShortcuts")?t.apply(r,e.toArray(arguments).slice(1)):void 0}var r=s.getInstance(),o=!0;i.on("anyModalOpen",function(){o=!1}),i.on("allModalsClosed",function(){o=!0}),e.each(r.shortcuts,function(i){t.bind(i.keys,e.wrap(r[i.fn],a))})}};return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(4),i(996),i(411),i(416),i(636),i(640),i(638),i(412),i(644),i(641),i(639),i(645),i(642),i(9),i(374),i(371),i(373),i(370),i(372)],
s=function(e,t,i,n,s,a,r,o,l,c,u,d,h,p){"use strict";var f=function(f){t.attach(document.body);var m=s.init();return m=m.then(function(){return a.init()}),m=m.then(function(){return e.when(i.init(p),n.init())}),m=m.then(function(){return c.init()}),m=m.then(function(){return e.when(r.init(),o.init(),l.init(),u.init(),d.init(),h.init())})};return f}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){"use strict";function n(e){var t=!e.get("isShared")||e.supports("sharedSyncStatus");return e.get("isFullServer")&&t;
}var s=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var a=i(694),r=s(a),o=i(190),l=s(o),c=i(9),u=s(c),d={init:function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=new l.default({name:"MediaServerEventManager",servers:e.servers||u.default.get("servers"),isValidServer:n,supportsLongPolling:!1,showTimelineStatus:!0,ServerEventConnection:r.default});t.start()}};t.default=d,e.exports=t.default},function(e,t,i){var n,s;n=[i(19),i(679),i(687),i(681),i(677),i(683),i(685),i(675),i(689)],
s=function(e,t,i,n,s,a,r,o,l){"use strict";var c={init:function(){new t,new i,new n,new s,new a,new r,new o,new l,e.history.start()}};return c}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(11),i(9),i(189)],s=function(e,t,i,n){"use strict";var s=n.extend({fetchPrimaryRelations:function(e){n.prototype.fetchPrimaryRelations.apply(this,arguments);var t=e.get("shared"),s=e.get("home"),a=e.get("activeConnection");if(!t){var r=e.get("sessions");r.fetch({reset:!0})}var o=a.get("isPrivate")||!t||s;
if(o){var l=i.get("players");l.reset(),l.setContext("server",e),l.fetch()}},handlePrimarySettings:function(e,i){n.prototype.handlePrimarySettings.apply(this,arguments);var s=e.get("shared"),a=i.get("AcceptedEULA");!s&&a&&a.get("value")===!1&&t.execute("showTermsOfService",{collection:i})}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(20),i(5),i(17),i(33),i(11),i(9),i(39),i(714)],s=function(e,t,i,n,s,a,r,o,l){"use strict";var c=t.extend({mixins:s,bundleUpdatesDelay:36e5,
start:function(){this.stop(),this.listenTo(r,"change:primaryServer",this.onPrimaryServerChange)},stop:function(){this.stopListening()},isLastHistoryEntry:function(t){var i=r.get("history"),n=e.last(i);return!(!n||!n.indexOf("fragment"))},isLastDismissedVersion:function(e){var t=e.get("shortVersion")||"unknown";return t===n.get("serverUpdateDismissedVersion")},checkForServerUpdates:function(e){var t=e.get("update");e.supports("updater")?t.fetch().then(function(){a.execute("checkForServerUpdates",{
server:e,download:!1})}):this.isLastDismissedVersion(t)||i.trigger("show:bar","alertbar",new l({model:t}))},onPrimaryServerChange:function(e,t){var i=r.previous("primaryServer");return i&&this.stopListening(i.get("update")),!t||t.get("shared")?void clearTimeout(this.bundleUpdatesTimeout):(this.listenTo(t.get("update"),"change:state",this.onServerUpdateStateChange),void this.checkForServerUpdates(t))},onServerUpdateStateChange:function(e,t){this.isLastDismissedVersion(e)||this.isLastHistoryEntry("/settings/server")||/^(available|downloaded|notify)$/.test(t)&&i.trigger("show:bar","alertbar",new l({
model:e}))}});return c}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(7),i(20),i(5),i(33),i(11),i(45),i(22),i(107)],s=function(e,t,i,n,s,a,r,o,l){"use strict";var c=i.extend({mixins:s,initialize:function(e){this.user=e},start:function(){this.previousUserID=this.user.id,this.listenTo(n,{"home:locked":this.onHomeLocked,"home:userswitched":this.onHomeUserSwitched}),this.listenTo(this.user,{change:this.onUserChange,"change:signedIn":this.onSignedInChange,"change:hasInvalidToken":this.onInvalidTokenChange,
"change:locked":this.onLockedChange})},onHomeLocked:function(e){this.previousUserID=e},onHomeUserSwitched:function(){this.user.id===this.previousUserID?n.trigger("navigate:refresh"):n.trigger("navigate:refresh:dashboard")},onUserChange:function(e){if(this.user.get("signedIn")){var t=r.getActiveUser();if(t)t.copyFromUser(e);else{var i=r.get("users");i.add(e.toJSON(),{parse:!0})}r.debouncedSave()}},onSignedInChange:function(e,t){t&&(e.get("devices").populate({reset:!0}),e.get("homeUsers").populate({
reset:!0}),e.get("homeDetails").populate({reset:!0}),e.get("friends").populate({reset:!0}),e.get("invites").populate({reset:!0}),e.get("socialNetworks").populate({reset:!0}))},onLockedChange:function(e,t){t?n.trigger("show:modal",new l({isForced:!0})):t===!1&&a.execute("resumePlayQueue",e)},onInvalidTokenChange:function(e,i){if(i){var s=new o({title:t("Invalid Credentials"),message:t("Your credentials have expired. Please sign in again."),confirmLabel:t("OK"),cancelLabel:t("Ignore")});s.promise.done(function(){
n.trigger("navigate","login",{silent:!0})}),n.trigger("show:modal",s)}}});return c}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(42),i(92),i(91),i(433)],s=function(e,t,i,n,s){"use strict";var a=s.extend({storageKey:"settingsv2",defaults:e.extend({},s.prototype.defaults,{playThemeMusic:!1,keyboardShortcuts:!0,showUnwatchedIcons:!1,showAdvancedSettings:!1,allowHttpFallback:n.NEVER,dashboardPriorityOnDeck:1,dashboardPriorityRecentlyAdded:2,dashboardPriorityChannels:3,dashboardPriorityQueue:4,
dashboardPriorityRecommendations:5,dashboardOnDeckEnabled:!0,dashboardRecentlyAddedEnabled:!0,dashboardChannelsEnabled:!0,dashboardQueueEnabled:!0,dashboardRecommendationsEnabled:!0,sharedSearch:!0,channelSearch:!0,localQuality:-1,remoteQuality:8,channelQuality:-1,dash:!0,directPlay:!0,directStream:!0,preferAAC:"wiiu"===t.id||"edge"===t.id,allowAC3:!1,subtitleSize:100,subtitlesBurnLevel:i.ALWAYS,audioBoost:100,"syncQuality!video":8,"syncQuality!music":2,"syncQuality!photo":2,sidebarOpen:!1,videoPlayerVolume:100,
musicPlayerVolume:100,announcementsLastReadTimestamp:0,serverUpdateDismissedVersion:"",hasDismissedPremiumMusicAlert:!1,listType:"media-tile-list","listType!track":"media-list"}),getListTypeKey:function(e){var t="listType";return e&&(t+="!"+e.get("typeString")),t},getListType:function(t){var i,n;return t=t||{},e.has(t,"mediaType")&&e.isObject(t.mediaType)&&(n=this.getListTypeKey(t.mediaType)),i=this.get(n)||this.get(t.fallbackKey)||this.get("listType")},saveListType:function(t,i){var n=this.getListTypeKey(t);
this.save(n,i),e.isEqual(n,"listType")||this.trigger("change:listType",this,i)},getSectionListType:function(e,t){var i;return e&&(t=t||e.get("currentType"),i=e.getScopedKey("listType")),this.getListType({mediaType:t,fallbackKey:i})}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(27),i(651)],s=function(e,t,i){"use strict";var n=t.extend({name:"ArtworkCollection",context:["server","artworkType"],model:i,url:function(){var t=e.result(this.parent,"url");return t+"/"+this.artworkType+"s";
}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(21),i(23)],s=function(e,t){"use strict";var i={POSTER:"poster",ART:"art",BANNER:"banner"},n=t.extend({name:"ArtworkModel",context:["server","artworkType"],idAttribute:"ratingKey",rootPropertyName:"Photo",syncedAttrs:{key:e.string,ratingKey:e.string,thumb:e.string,selected:e.boolean}},{types:i});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(21),i(23)],s=function(e,t){"use strict";var n=t.extend({
name:"FilePathModel",context:["server"],idAttribute:"key",rootPropertyName:"Path",sessionAttrs:{isBackShortcut:e.boolean},sessionRelations:{children:function(){return{relationClass:i(254),options:{url:this.id}}}},syncedAttrs:{key:e.string,title:e.string,path:e.string,home:e.boolean,network:e.boolean}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(21),i(23)],s=function(e,t){"use strict";var n=t.extend({name:"MatchResultModel",context:["server"],idAttribute:"guid",
rootPropertyName:"SearchResult",syncedAttrs:{id:e.integer,guid:e.string,name:e.string,parentGUID:e.string,parentName:e.string,type:e.string,index:e.integer,score:e.integer,thumb:e.string,year:e.integer,matched:e.boolean},syncedRelations:{children:function(){return{relationClass:i(255),rootPropertyName:"SearchResult"}}},derivedAttrs:{normalizedScore:function(){var e=this.get("score");return null!=e?Math.min(Math.max(e,0),100):void 0}}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){
var n,s;n=[i(2),i(4),i(14),i(118),i(658)],s=function(e,t,i,n,s){"use strict";var a=n.extend({defaults:function(){return{children:new s([],{server:this.server,parent:this})}},findItem:function(e){return this.get("children").get(e)},addContent:function(n){var s=[e.result(this,"url"),"items",n.id],a=i.join(s,n.getSaveParams()),r=e.extend(n.server.getXHROptions(a),{type:"PUT"}),o=t.ajax(r);return o.then(e.bind(function(e){this.set(this.parse(e))},this)),o.promise()}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(2),i(4),i(5),i(15),i(14),i(198),i(140)],s=function(e,t,i,n,s,a,r){"use strict";var o=a.extend({whitelistedAttrs:["playQueueID","playQueueSelectedItemID","playQueueSelectedItemOffset","playQueueSelectedMetadataItemID","playQueueLastAddedItemID","playQueueShuffled","playQueueSourceURI","playQueueTotalCount","playQueueVersion","message"],defaults:function(){return{selectedItem:null,mediaType:null,owned:!0,hasUserAdditions:!1,playQueueVersion:0}},metadataElementNames:["Directory","Video","Track","Photo","Hub"],
url:function(){return"/playQueues/"+this.id},initialize:function(){this.listenTo(this,"change:message",this.onMessageChange)},convert:function(t){var i=e.isObject(t)?t:n.parseXML(t);return n.parseBoolean(i,"playQueueShuffled"),n.parseInteger(i,["playQueueSelectedItemOffset","playQueueTotalCount","playQueueVersion"]),n.parseArray(i,"Metadata"),i},parse:function(t,i){e.isString(t)&&(t=n.replaceXMLElementNames(t,this.metadataElementNames,"Metadata"));var s=this.convert(t);s.id&&(s.playQueueID=s.id);var a=e.pick(s,this.whitelistedAttrs);
return this.set(a,{silent:!0}),this.pendingChanges=this.changed,this.parseItems(s),a},parseItems:function(t){var i=this.get("collection"),n=t.Metadata,s=!!n.length,a=e.pluck(n,"playQueueItemID").indexOf(t.playQueueSelectedItemID),o=t.playQueueSelectedItemOffset,l=o-a;e.each(n,function(e,i){e.queueIndex=l+i,t.identifier&&(e.identifier=t.identifier),t.mediaTagPrefix&&(e.mediaTagPrefix=t.mediaTagPrefix),t.mediaTagVersion&&(e.mediaTagVersion=t.mediaTagVersion)}),i?i.set(n,{parse:s}):(i=new r(n,{server:this.server,
parent:this,parse:s}),this.set("collection",i)),i.totalSize=t.playQueueTotalCount,i.availableRange={start:l,end:l+i.length}},moveItem:function(i,n){if(i===this.get("playQueueSelectedItemID"))return t.Deferred().resolve().promise();this.set("hasUserAdditions",!0);var a={after:n||-1},r=s.join([e.result(this,"url"),"/items/",i,"/move"],a);return this._ajax("PUT",r)},queueContent:function(){throw new Error("Clients cannot queue background processing items.")},addContent:function(){throw new Error("Clients cannot add background processing items.");
},removeItem:function(){throw new Error("Clients cannot remove background processing items directly. Generators (e.g. sync items) should be deleted.")},yieldOwnership:function(){throw new Error("Only the admin owns the background processing queue.")},takeOwnership:function(){throw new Error("Only the admin owns the background processing queue.")},getUpNextRange:function(){var e=this.get("collection"),t=e.get(this.get("playQueueSelectedItemID")),i=e.indexOf(t),n=Math.max(i,0),s=n,a=this.get("playQueueLastAddedItemID");
if(null!=a){var r=e.get(a),o=e.indexOf(r);o>n&&(s=o)}return{start:n,end:s}},_ajax:function(i,n){var s=e.extend(this.server.getXHROptions(n),{type:i}),a=t.ajax(s);return a.done(e.bind(function(t){this.set(this.parse(t)),e.isEmpty(this.pendingChanges)||(e.each(this.pendingChanges,function(e,t){this.trigger("change:"+t,this,e)},this),this.trigger("change",this),this.pendingChanges=null),this.set("selectedItem",this.getCurrentItem())},this)),a.promise()},onMessageChange:function(e,t){t&&i.trigger("show:alert",{
type:"error",message:t})}});return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(15),i(24)],s=function(e,t,i){"use strict";var n=i.extend({idAttribute:"key",whitelistedAttrs:["queueItemID","generatorID","targetTagID","syncItemId","syncItemTitle","key","type","progress","speed","remaining","size","ratingKey","title","thumb"],convert:function(i){var n=e.isObject(i)?i:t.parseXML(i);return t.parseInteger(n,["queueItemID","generatorID","targetTagID","syncItemId","remaining","size"]),
t.parseFloat(n,["progress","speed"]),n},parse:function(t){var i=this.convert(t);return i=e.pick(i,this.whitelistedAttrs)}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(15),i(24)],s=function(e,t,i){"use strict";var n=i.extend({idAttribute:"title",whitelistedAttrs:["title","selected"],convert:function(i){var n=e.isObject(i)?i:t.parseXML(i);return t.parseBoolean(n,"selected"),n},parse:function(t,i){var n=this.convert(t);return n=e.pick(n,this.whitelistedAttrs);
}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(14),i(56),i(29),i(101)],s=function(e,t,i,n){"use strict";var s=i.extend({model:n,url:function(){return e.join(["playlists",this.parent.id,"items"],{type:t.LOCAL})},parse:function(e){return this.convert(e,"Item")}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(40),i(660)],s=function(e,t,i){"use strict";var n=t.extend({model:i,url:function(){return e.result(this.parent,"url")+"/items";
}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(35)],s=function(e){"use strict";var t=e.extend({cacheKey:null});return t}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(15),i(24)],s=function(e,t,i){"use strict";var n=i.extend({whitelistedAttrs:["id","tag","tagType","MediaSettings","Device"],convert:function(i){var n=e.isObject(i)?i:t.parseXML(i);return n},parse:function(t,i){var n=this.convert(t);return n=e.pick(n,this.whitelistedAttrs);
}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(21),i(120),i(23)],s=function(e,t,i){"use strict";var n=i.extend({name:"AgentAttributionModel",context:["server"],responseType:t.text,syncedAttrs:{content:e.string},url:function(){return"/system/agents/attribution?identifier="+this.parent.id},augmentResponse:function(e){return{content:e}}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(21),i(23),i(662),i(665)],s=function(e,t,i,n){"use strict";
var s=t.extend({name:"AgentModel",context:["server"],idAttribute:"identifier",rootPropertyName:"Agent",sessionAttrs:{isPrimary:e.boolean,selected:e.boolean},sessionRelations:{attribution:{relationClass:i}},syncedAttrs:{identifier:e.string,name:e.string,enabled:e.boolean,hasPrefs:e.boolean,order:e.string},syncedRelations:{languages:{relationClass:n,rootPropertyName:"Language"}}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(110)],s=function(e,t){"use strict";
var i=t.extend({constructor:function(i,n,s,a){this.exclusiveScanners=n,this.scannerName=s,t.call(this,i,a),this.filterBy(e.bind(this.filterExclusiveScanner,this))},filterExclusiveScanner:function(e){var t=e.get("name"),i=this.exclusiveScanners;if(!i)return!0;var n=this.scannerName,s=-1!==i.indexOf(n),a=-1!==i.indexOf(t),r=s?t===n:!a;return r}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(27),i(666)],s=function(e,t){"use strict";var i=e.extend({name:"LanguageCollection",
context:["server"],model:t});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(79),i(21),i(23)],s=function(e,t,i){"use strict";var n=i.extend({name:"LanguageModel",context:["server"],idAttribute:"code",rootPropertyName:"Language",syncedAttrs:{code:t.string},derivedAttrs:{name:function(){return e.getLanguageName(this.get("code"))}}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(27),i(668)],s=function(e,t,i){"use strict";var n=t.extend({
name:"ScannerCollection",context:["server","sectionTypeID"],model:i,url:function(){return"/system/scanners/"+this.sectionTypeID},hasExclusiveScanner:function(t){return!!e.intersection(this.pluck("name"),t).length}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(21),i(23)],s=function(e,t){"use strict";var i=t.extend({name:"ScannerModel",context:["server"],rootPropertyName:"Scanner",syncedAttrs:{name:e.string}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){
"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(27),a=n(s),r=i(670),o=n(r),l=a.default.extend({name:"SectionOverviewCollection",context:["server"],model:o.default});t.default=l,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(21),a=n(s),r=i(23),o=n(r),l=o.default.extend({name:"SectionOverviewModel",context:["server"],rootPropertyName:"Section",syncedAttrs:{id:a.default.integer,key:a.default.string,
type:a.default.string,title:a.default.string}});t.default=l,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(27),a=n(s),r=i(672),o=n(r),l=a.default.extend({name:"ServerOverviewCollection",context:["server"],model:o.default});t.default=l,e.exports=t.default},function(e,t,i){"use strict";var n=i(8).default;Object.defineProperty(t,"__esModule",{value:!0});var s=i(21),a=n(s),r=i(23),o=n(r),l=i(669),c=n(l),u=o.default.extend({
name:"ServerOverviewModel",context:["server"],idAttribute:"machineIdentifier",rootPropertyName:"Server",urlRoot:"/api/servers",syncedAttrs:{machineIdentifier:a.default.string,name:a.default.string,address:a.default.string,port:a.default.string,version:a.default.string,createdAt:a.default.integer,updatedAt:a.default.integer},syncedRelations:{sections:{relationClass:c.default,rootPropertyName:"Section"}}});t.default=u,e.exports=t.default},function(e,t,i){var n,s;n=[i(2),i(4),i(6),i(5)],s=function(e,t,i,n){
"use strict";var s=i.Region.extend({resizeSubscribersCallbacks:[],scrollSubscribersCallbacks:[],sidebarDelay:200,scrollDelay:100,initialize:function(i){e.bindAll(this,"onResize","onScroll","onScrollEvent","onSidebarChange"),this.$el=t(this.el),this.channelName=i.channelName;var s={};s[this.channelName+".subscribe:resize"]=this.onResizeSubscribe,s[this.channelName+".unsubscribe:resize"]=this.onResizeUnsubscribe,s[this.channelName+".subscribe:scroll"]=this.onScrollSubscribe,s[this.channelName+".unsubscribe:scroll"]=this.onScrollUnsubscribe,
this.listenTo(n,s)},updateSize:function(){this.size={width:this.$el.width(),height:this.$el.height(),innerWidth:this.$el.innerWidth(),innerHeight:this.$el.innerHeight(),outerWidth:this.$el.outerWidth(),outerHeight:this.$el.outerHeight(),offset:this.$el.offset()}},updateScrollPosition:function(){this.scrollPosition={scrollHeight:this.$el[0].scrollHeight,scrollTop:this.$el[0].scrollTop}},onShow:function(){this.updateSize(),this.updateScrollPosition()},onResizeSubscribe:function(e){this.resizeSubscribersCallbacks.push(e),
1===this.resizeSubscribersCallbacks.length&&(this.updateSize(),this.listenTo(n,{resize:this.onResize,"show:bar hide:bar":this.onSidebarChange})),e(this.size)},onResizeUnsubscribe:function(t){this.resizeSubscribersCallbacks.splice(e.indexOf(this.resizeSubscribersCallbacks,t),1),0===this.resizeSubscribersCallbacks.length&&this.stopListening(n,"resize show:bar hide:bar")},onScrollSubscribe:function(e){this.scrollSubscribersCallbacks.push(e),1===this.scrollSubscribersCallbacks.length&&(this.updateScrollPosition(),
this.$el.on("scroll",this.onScroll)),e(this.scrollPosition)},onScrollUnsubscribe:function(t){this.scrollSubscribersCallbacks.splice(e.indexOf(this.scrollSubscribersCallbacks,t),1),0===this.scrollSubscribersCallbacks.length&&this.$el.off("scroll",this.onScroll)},onResize:function(){this.updateSize(),e.each(this.resizeSubscribersCallbacks,function(e){e(this.size)},this)},onScroll:function(){this.scrollTimeout=clearTimeout(this.scrollTimeout),this.scrollTimeout=setTimeout(this.onScrollEvent,this.scrollDelay);
},onScrollEvent:function(){this.updateScrollPosition(),e.each(this.scrollSubscribersCallbacks,function(e){e(this.scrollPosition)},this)},onSidebarChange:function(t){"sidebar"===t&&e.delay(this.onResize,this.sidebarDelay)}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(5),i(54),i(9),i(256),i(100),i(125),i(707),i(69)],s=function(e,t,i,n,s,a,r,o,l,c,u){"use strict";var d=s.extend({activity:function(){var t=this.populateView({primaryServer:!0});t.done(e.bind(function(e){
var t=e.server;t.get("shared")?this.sync(t.id):n.trigger("show:view",new c({model:t,collection:t.get("alerts"),subset:"alerts"}))},this))},alerts:function(e){var t;t=e?{serverID:e}:{primaryServer:!0};var i=this.populateView(t);i.done(function(e){var t=e.server;n.trigger("show:view",new c({model:t,collection:t.get("alerts"),subset:"alerts"}))})},sync:function(t,s){var r=this.populateView({serverID:"myPlex"});r=r.then(e.bind(function(e){var i;return i=t?{serverID:t}:{primaryServer:!0},this.populateView(i);
},this)),r.done(function(e){var t=a.get("user"),r=t.get("devices"),o=r.populate();o.done(function(){var t=r.filterSyncDevices(),i=s?t.get(s):null;n.trigger("show:view",new c({model:e.server,collection:t,selectedDevice:i,subset:"sync"}))}),o.fail(function(){n.trigger("show:view",new u({title:i("Sync status is unavailable.")}))})})},conversion:function(e){var s;s=e?{serverID:e}:{primaryServer:!0};var a=this.populateView(s);a.done(function(e){var s,a,d=e.server,h=new r([],{server:d,allowInCache:!0}),p=new o([],{
server:d,allowInCache:!0}),f=new l([],{server:d,allowInCache:!0}),m=t.when(h.populate(),p.fetch(),d.get("settings").fetch(),f.populate()).then(function(){s=h.first();var e=f.first();return s&&e?(a=e.get("children"),t.when(s.fetch(),a.fetch())):t.Deferred().reject().promise()});m.done(function(){n.trigger("show:view",new c({model:d,playQueue:s,transcodeJobs:p,generators:a,subset:"conversion"}))}),m.fail(function(){n.trigger("show:view",new u({title:i("The conversion queue is unavailable.")}))})})},
nowPlaying:function(e){var t;t=e?{serverID:e}:{primaryServer:!0};var i=this.populateView(t);i.done(function(e){var t=e.server;n.trigger("show:view",new c({model:t,collection:t.get("sessions"),subset:"nowPlaying"}))})}});return d}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(55),i(674)],s=function(e,t){"use strict";var i=e.extend({controller:new t,appRoutes:{"!/activity":"activity","!/activity/alerts(/:serverID)":"alerts","!/activity/sync(/:serverID)(/:deviceID)":"sync","!/activity/conversion(/:serverID)":"conversion",
"!/activity/playing(/:serverID)":"nowPlaying"}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(7),i(5),i(54),i(117),i(722),i(723),i(721),i(127),i(69)],s=function(e,t,i,n,s,a,r,o,l){"use strict";var c=i.extend({channel:function(e,i,n){var a=this.populateView({serverID:e,channelID:i,channelKey:n});a.done(function(e){var i=e.channelItem?e.channelItem:e.channel;t.trigger("show:view",new s({model:i,collection:i.get("items")}))})},channelDetails:function(e,i,n){var s=this.populateView({
serverID:e,channelID:i,channelKey:n});s.done(function(e){var i=e.channelItem.get("items"),n=i.first();t.trigger("show:view",new o({model:n}))})},channels:function(i){var s=this.populateView({serverID:i});s.done(function(i){var s=new n([],{server:i.server,subset:"all"});s.comparator=s.sortByTitle;var r=s.fetch({scope:"page"});r.done(function(){t.trigger("show:view",new a({collection:s}))}),r.fail(function(){t.trigger("show:view",new l({title:e("Your channels are unavailable.")}))})})},directory:function(i,s,a){
var o=this.populateView({serverID:i});o.done(function(i){if(i.server.get("shared"))return void t.trigger("show:view",new l({title:e("The channel directory is restricted from shared users.")}));var o=new n([],{server:i.server,url:"system/appstore"}),c=o.fetch({scope:"page"});c.done(function(){t.trigger("show:view",new r({collection:o,currentKey:s,currentPath:a}))}),c.fail(function(){t.trigger("show:view",new l({title:e("The channel directory is unavailable.")}))})})}});return c}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(55),i(676)],s=function(e,t){"use strict";var i=e.extend({controller:new t,appRoutes:{"!/server/:serverID/channel/:channelID(/:key)":"channel","!/server/:serverID/channel/:channelID/details/:key":"channelDetails","!/server/:serverID/channels":"channels","!/server/:serverID/directory(/:key)(/:path)":"directory"}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(5),i(9),i(184),i(11),i(509),i(697),i(728),i(703),i(700),i(699),i(765),i(69),i(766),i(767),i(768),i(769)],
s=function(e,t,i,n,s,a,r,o,l,c,u,d,h,p,f,m){"use strict";var g=s.extend({viewsByType:{signIn:o,error:d,channelError:u,notFound:h,serverRequired:p,unauthorized:f,unavailable:m},initialize:function(){s.prototype.initialize.apply(this,arguments),this.appView=new a,this.appView.render()},dashboard:function(){var t=this.populateView();t.done(function(){e.trigger("show:view",new r)})},logout:function(){var t=this.viewFor;n.execute("signOut").done(function(){e.trigger("navigate","login",{silent:!0})}).fail(function(){
e.trigger("show:view",t("logoutError"))})},logs:function(){e.trigger("show:view",new l({collection:i.resolve("logs")}))},info:function(){e.trigger("show:view",new c)}});return g}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(19),i(5),i(510),i(678)],s=function(e,t,i,n){"use strict";var s=i.extend({initialize:function(){i.prototype.initialize.apply(this,arguments),this.listenTo(t,"navigate:refresh:dashboard",this.onNavigateRefreshDashboard)},controller:new n,appRoutes:{"!/dashboard":"dashboard",
"":"dashboard","!/login":"login","!/unauthorized":"unauthorized","!/logs":"logs","!/info":"info","*404":"error"},onNavigateRefreshDashboard:function(){var i=e.history.getFragment();""===i||"!/dashboard"===i?e.history.loadUrl(""):t.trigger("navigate","dashboard")}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(5),i(54),i(701),i(919),i(127)],s=function(e,t,i,n,s){"use strict";var a=t.extend({search:function(t){var n=this.populateView({primaryServer:!0});n.done(function(){
e.trigger("show:view",new i({query:t}))})},section:function(t,i,s){var a=this.populateView({serverID:t,sectionID:i});a.done(function(t){e.trigger("show:view",new n({model:t.section,subset:s}))})},sectionFolder:function(t,i,s){var a=this.populateView({serverID:t,sectionID:i});a.done(function(t){var i=t.section.get("items");i.scrollPosition=0,e.trigger("show:view",new n({model:t.section,subset:"folder",folderKey:s}))})},sectionFilter:function(t,i,s,a,r,o){var l=this.populateView({serverID:t,sectionID:i
});l.done(function(t){var i=t.section.get("currentFilters");i.length=0,o||(o=r),i.push({key:a,values:r.split(","),titles:o.split(",")}),e.trigger("show:view",new n({model:t.section,type:parseInt(s,10)}))})},sectionType:function(t,i,s,a,r){var o=this.populateView({serverID:t,sectionID:i});o.done(function(t){e.trigger("show:view",new n({model:t.section,type:s,sortKey:a,sortDirection:r}))})},details:function(t,i){var n=this.populateView({serverID:t,key:i,populateData:{includeRelatedCount:"5",includePopularLeaves:"1",
includeConcerts:"1"}});n.done(function(t){e.trigger("show:view",new s({model:t.item}))})}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(55),i(680)],s=function(e,t){"use strict";var i=e.extend({controller:new t,appRoutes:{"!/search/:query":"search","!/server/:serverID/section/:sectionID(/:subset)":"section","!/server/:serverID/section/:sectionID/folder/:key":"sectionFolder","!/server/:serverID/section/:sectionID/filter/:type/:key/:value(/:title)":"sectionFilter",
"!/server/:serverID/section/:sectionID/type/:type/:sortKey/:sortDirection":"sectionType","!/server/:serverID/details/:key":"details"}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(4),i(7),i(5),i(54),i(118),i(69),i(917),i(127)],s=function(e,t,i,n,s,a,r,o){"use strict";var l=n.extend({playlists:function(n){var s=this.populateView({serverID:n});s.done(function(n){var s=n.server.get("playlists"),o=n.server.get("sections").populate({scope:"page"}),l=s.get("items").populate({
scope:"page"}),c=e.when(o,l);c.done(function(){i.trigger("show:view",new r({model:s}))}),c.fail(function(){i.trigger("show:view",new a({title:t("Playlists are unavailable for this server.")}))})})},playlist:function(n,r){var l=this.populateView({serverID:n});l.done(function(n){var l=n.server.get("sections").populate({scope:"page"}),c=new s({ratingKey:r},{server:n.server}),u=c.fetch({scope:"page"});u.fail(function(){i.trigger("show:view",new a({title:t("Playlist not found.")}))}),e.when(l,u).done(function(){
i.trigger("show:view",new o({model:c}))})})}});return l}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(55),i(682)],s=function(e,t){"use strict";var i=e.extend({controller:new t,appRoutes:{"!/server/:serverID/playlists":"playlists","!/server/:serverID/playlist/:key":"playlist"}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(4),i(7),i(5),i(17),i(54),i(9),i(475),i(65),i(924),i(69)],s=function(e,t,i,n,s,a,r,o,l,c){"use strict";var u=s.extend({
settings:function(){return this.webSettings()},webSettings:function(){var e=this.populateView();e.done(function(){function e(){i.trigger("show:view",new l({model:n.getInstance(),subset:"web"}))}var t=a.get("user"),s=t.get("homeUsers"),r=t.server.populate();r.done(function(){t.get("signedIn")?s.populate().always(e):e()}),r.fail(e)})},serverSettings:function(n,s){var a;a=n?{serverID:n}:{primaryServer:!0};var u=this.populateView(a);u.done(function(n){var a=n.server;if(a.get("shared"))return void i.trigger("show:view",new c({
title:t("Server settings are restricted from shared users.")}));var u=a.get("settings"),d=new r({key:"/accounts/1"},{server:a}),h=a.get("cloudAccount"),p=new o([],{server:a,url:"/system/:/prefs"}),f=e.when(u.fetch(),d.fetch({scope:"page"}),h.fetch({scope:"page"}),p.fetch({scope:"page"}));f.done(function(){i.trigger("show:view",new l({model:a,collection:a.get("settings"),account:d,cloudAccount:h,channelSettings:p,subset:"server",group:s}))}),f.fail(function(){i.trigger("show:view",new c({title:t("Server settings are unavailable.")
}))})})},users:function(n){var s=this.populateView({serverID:"myPlex"});s.done(function(s){var r=a.get("user"),o=r.get("homeUsers"),u=r.get("friends"),d=r.get("invites"),h=r.get("sentInvites"),p=r.get("homeDetails"),f=e.Deferred(),m=p.fetch();m.done(function(){f.resolve()}),m.fail(function(e,t){404===t.status?f.resolve():f.reject()});var g=e.when(r.fetch({scope:"page"}),o.fetch({scope:"page"}),u.fetch({scope:"page"}),d.fetch({scope:"page"}),h.fetch({scope:"page"}),f.promise());g.done(function(){var e=!1;
"pin"===n?(n="home",e=!0):n||(n=d.length&&!d.findWhere({home:!0})?"friends":"home"),i.trigger("show:view",new l({model:a.get("user"),subset:"users",usersSubset:n,promptPIN:e}))}),g.fail(function(){var e;e=t("friends"===n?"Your friends are unavailable.":"Your home is unavailable."),i.trigger("show:view",new c({title:e}))})})},devices:function(){var e=this.populateView({serverID:"myPlex"});e.done(function(e){var n=a.get("user"),s=n.get("devices"),r=s.fetch({scope:"page"});r.done(function(){i.trigger("show:view",new l({
model:n,collection:s,subset:"devices"}))}),r.fail(function(){i.trigger("show:view",new c({title:t("Your devices are unavailable.")}))})})}});return u}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(55),i(684)],s=function(e,t){"use strict";var i=e.extend({controller:new t,appRoutes:{"!/settings":"settings","!/settings/web":"webSettings","!/settings/server(/:serverID)(/:group)":"serverSettings","!/settings/users":"users","!/settings/users(/:subset)":"users","!/settings/devices":"devices"
}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(5),i(54),i(946)],s=function(e,t,i){"use strict";var n=t.extend({setupBasic:function(t){var n;n=t?{serverID:t}:{primaryServer:!0};var s=this.populateView(n);s.done(function(t){e.trigger("show:view",new i({model:t.server,subset:"setupBasic"}))})},setupLibrary:function(){var t=this.populateView({primaryServer:!0});t.done(function(t){e.trigger("show:view",new i({model:t.server,subset:"setupLibrary"}))})},setupChannels:function(){
var t=this.populateView({primaryServer:!0});t.done(function(t){e.trigger("show:view",new i({model:t.server,subset:"setupChannels"}))})},setupComplete:function(){var t=this.populateView({primaryServer:!0});t.done(function(t){e.trigger("show:view",new i({model:t.server,subset:"setupComplete"}))})}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(55),i(686)],s=function(e,t){"use strict";var i=e.extend({controller:new t,appRoutes:{"!/setup(/:serverID)":"setupBasic","!/setup/library":"setupLibrary",
"!/setup/channels":"setupChannels","!/setup/complete":"setupComplete"}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(7),i(5),i(17),i(54),i(9),i(218),i(217),i(952),i(950),i(127),i(69),i(951)],s=function(e,t,i,n,s,a,r,o,l,c,u,d){"use strict";var h=n.extend({userPlaylist:function(i,n){var a=this.populateView({serverID:"myPlex"});a.done(function(a){var l=s.get("user"),c=new r([],{server:l.server,parent:l,key:i}),d=c.fetch({scope:"page"});d.done(function(){t.trigger("show:view",new o({
model:s.get("user"),collection:c,subset:n}))}),d.fail(function(){t.trigger("show:view",new u({title:e("This playlist is unavailable.")}))})})},userPlaylistDetails:function(i,n){var r=this.populateView({serverID:"myPlex"});r.done(function(r){var o=s.get("user"),l=new a({id:n},{server:r.server,parent:o,playlist:i}),d=l.fetch({scope:"page"});d.done(function(){t.trigger("show:view",new c({model:l}))}),d.fail(function(){t.trigger("show:view",new u({title:e("This playlist item is unavailable.")}))})})},
queueHelp:function(){var e=this.populateView({serverID:"myPlex"});e.done(function(){var e=s.get("user");t.trigger("show:view",new d({queueEmail:e.get("queueEmail")}))})},announcements:function(){var n=this.populateView();n.done(function(){var n=s.get("announcements"),a=n.fetch({scope:"page"});a.done(function(){t.trigger("show:view",new l({collection:n})),i.save("announcementsLastReadTimestamp",(new Date).getTime())}),a.fail(function(){t.trigger("show:view",new u({title:e("Announcements are not available.")
}))})})}});return h}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(55),i(688)],s=function(e,t){"use strict";var i=e.extend({controller:new t,appRoutes:{"!/playlist/queue/help":"queueHelp","!/playlist/:key(/:subset)":"userPlaylist","!/playlist/:key/details/:itemID":"userPlaylistDetails","!/announcements":"announcements"}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n;n=function(){"use strict";var e={NONE:100,SMALL:150,LARGE:200,HUGE:250};return e.settings=[{
value:e.NONE,title:"None"},{value:e.SMALL,title:"Small"},{value:e.LARGE,title:"Large"},{value:e.HUGE,title:"Huge"}],e}.call(t,i,t,e),!(void 0!==n&&(e.exports=n))},function(e,t,i){var n;n=function(){"use strict";var e={PENDING:"pending",ERROR:"error",PROCESSED:"processed",contexts:{OK:"ok",FILE_UNAVAILABLE:"sourceFileUnavailable",METADATA_ERROR:"sourceFileMetadataError",PROFILE_ERROR:"clientProfileError",IO_ERROR:"ioError",TRANSCODER_ERROR:"transcoderError",UNKNOWN_ERROR:"unknownError",ANALYSIS_ERROR:"mediaAnalysisError",
DOWNLOAD_FAILED:"downloadFailed",CANNOT_TRANSCODE:"cannotTranscode"}};return e}.call(t,i,t,e),!(void 0!==n&&(e.exports=n))},function(e,t,i){var n;n=function(){"use strict";var e={PENDING:"pending",FAILED:"failed",COMPLETE:"complete",failureCodes:{INVALID_PATH:"invalidPath",DISK_FULL:"diskFull",DISK_UNWRITABLE:"diskUnwritable"}};return e}.call(t,i,t,e),!(void 0!==n&&(e.exports=n))},function(e,t,i){var n;n=function(){"use strict";var e={TINY:50,SMALL:75,NORMAL:100,LARGE:125,HUGE:200};return e.settings=[{
value:e.TINY,title:"Tiny"},{value:e.SMALL,title:"Small"},{value:e.NORMAL,title:"Normal"},{value:e.LARGE,title:"Large"},{value:e.HUGE,title:"Huge"}],e}.call(t,i,t,e),!(void 0!==n&&(e.exports=n))},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(20),i(5),i(28),i(67),i(33),i(9),i(74),i(35),i(201),i(211),i(75),i(101),i(256),i(100)],s=function(e,t,i,n,s,a,r,o,l,c,u,d,h,p,f,m,g){"use strict";var v=n.extend({mixins:o,url:function y(){var e=this.server.get("activeConnection"),t=e.id.replace(/^http/,"ws"),y=this.server.resolveUrl("/:/websockets/notifications",{
connection:new p({uri:t}),appendToken:!0});return y},initialize:function(t){e.bindAll(this,"onOpen","onClose","onError","onMessage"),this.server=t.server},open:function(){return this.socket&&this.close(),this._deferred=t.Deferred(),this.socket=new WebSocket(e.result(this,"url")),this.socket.onopen=this.onOpen,this.socket.onclose=this.onClose,this.socket.onerror=this.onError,this.socket.onmessage=this.onMessage,this._deferred.promise()},close:function(){this._deferred&&"pending"===this._deferred.state()&&this._deferred.reject(),
this.socket&&(this.socket.onopen=null,this.socket.onclose=null,this.socket.onerror=null,this.socket.onmessage=null,this.socket.close(),this.socket=null)},testConnection:function(){if(this.server.get("connected")){var e=this.server.get("update");e&&"installing"===e.get("state")&&this.server.set("connected",null),this.server.trigger("error:connection",this.server)}},preference:function(e){e.key=e.id,e.server=this.server,this.server.trigger("socket:setting",e)},timeline:function(t){t.server=this.server;
var i={server:this.server,onlyIfCached:!0},n=new c({key:t.sectionID},i);if(!e.isEmpty(n)){i.section=n,t.section=n;var a="/library/metadata/"+t.itemID,r=new u({key:a},i);if(e.isEmpty(r)||(t.item=r,r.set({metadataState:t.metadataState,mediaState:t.mediaState}),r.trigger("socket:timeline",t)),t.rootItemID){var o="/library/metadata/"+t.rootItemID,l=new u({key:o},i);e.isEmpty(l)||(l.fetch(),l.refreshChildren())}if(t.parentItemID){var d="/library/metadata/"+t.parentItemID,h=new u({key:d},i);e.isEmpty(h)||(h.fetch(),
h.refreshChildren())}n.trigger("socket:timeline",t)}t.server.trigger("socket:timeline",t),s.trigger("timeline",t)},status:function b(e){var b=e.title+(e.description?": "+e.description:"");s.trigger("show:status",this.server,b),this.server.trigger("socket:status",e),"LIBRARY_UPDATE"===e.notificationName&&(this.server.get("sections").fetch(),s.trigger("dashboard:update"))},progress:function(e){s.trigger("show:status",this.server,e.message),this.server.trigger("socket:status",e)},playing:function(t){
if(t.sessionKey&&!this.server.get("shared")){var n={server:this.server,onlyIfCached:!0},r=this.server.get("sessions"),o=new h({sessionKey:t.sessionKey},n);if(e.isEmpty(o)||o.get("key")!==t.key){var c=r.fetch();c.done(e.bind(function(){if(o=r.get(t.sessionKey)){var n=l.get("user"),a=o.get("Player").title,c=o.get("User").title,u=o.get("grandparentTitle"),d=o.get("title");u&&(d=u+" - "+d);var h=i("{1} started playing {2} on {3}.",c,d,a);c&&c!==n.get("username")&&s.trigger("show:status",this.server,h),
this.server.trigger("socket:playing",e.extend(t,{username:c||i("Unknown"),title:d,player:a}))}},this))}else if(t.state===a.states.STOPPED)o.trigger("destroy",o,o.collection),o.cache.remove(o),s.trigger("dashboard:update");else{var u=o.get("Player");u&&(u.state=t.state,o.trigger("change:Player",o,u)),o.set("viewOffset",t.viewOffset)}}},syncState:function(t){var i={server:this.server,onlyIfCached:!0},n=new d({key:t.key,syncItemId:t.syncItemId},i);if(!e.isEmpty(n)){var s=n.get("Media");e.each(s,function(i){
var s=i.Part;e.each(s,function(e){e.transcodeState=t.syncFileState,e.transcodeStateContext=t.syncFileStateContext,e.syncState=t.syncState,e.syncStateContext=t.syncStateContext;var i=r.getSyncStateFromPart(e);r.waitingRegex.test(i)&&(e.key="placeholder"),n.trigger("change:Media",n,n.get("Media"))})})}},backgroundGeneratorState:function(t){var i={server:this.server,onlyIfCached:!0},n=new f({id:t.generatorID},i);e.isEmpty(n)||n.fetch()},versionState:function(t){var i={server:this.server,onlyIfCached:!0
},n=new f({id:t.generatorID},i);if(!e.isEmpty(n)){var s=n.get("metadataItems"),a=s.get(t.metadataItemID);a&&a.set({processingState:t.state,processingStateContext:t.stateContext})}},backgroundProcessingQueue:function(t){var i=new m([],{server:this.server,allowInCache:!0,onlyIfCached:!0});if(!e.isEmpty(i)){var n=i.first();n&&n.fetch()}},"transcodeSession.start":function(t){if("static"===t.context){var i=new g([],{server:this.server,allowInCache:!0,onlyIfCached:!0});e.isEmpty(i)||i.fetch()}},"transcodeSession.update":function(t){
if("static"===t.context){var i=new g([],{server:this.server,allowInCache:!0,onlyIfCached:!0});if(!e.isEmpty(i)){var n=i.get(t.key);n?n.set(n.parse(t)):i.fetch()}}},"transcodeSession.end":function(e){this["transcodeSession.start"].apply(this,arguments)},"update.statechange":function(t){var i=this.server.get("update"),n=e.pick(t,i.whitelistedAttrs);e.defaults(n,e.result(i,"defaults")),"downloading"===i.get("state")&&"available"===n.state&&(n.state="downloading"),i.set(n)},reachability:function(e){var t=this.server.get("cloudAccount");
t.fetch()},account:function(e){this.server.set("myPlexSubscription",e.hasPlexPass)},onOpen:function(e){this.server.trigger("socket:websocket",{opened:!0}),this.trigger("open",this.server,e),this._deferred.resolve(this.server,e)},onClose:function(e){this.close(),this.server.trigger("socket:websocket",{closed:!0}),this.trigger("close",this.server,e),this._deferred.reject(this.server,e),this.testConnection()},onError:function(e){this.close(),this.server.trigger("socket:websocket",{error:!0}),this.trigger("error",this.server,e),
this._deferred.reject(this.server,e),this.testConnection()},onMessage:function(t){var i;try{i=JSON.parse(t.data)}catch(n){return}var s=i.type,a=this[s];e.each(i._children,function(t){this.trigger("message",t),e.isFunction(a)&&a.call(this,t)},this)}});return v}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1004),i(6)],s=function(e,t){"use strict";var i=t.ItemView.extend({tagName:"span",template:e});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1005),i(2),i(6),i(5),i(16),i(43)],
s=function(e,t,i,n,s,a){"use strict";var r=i.ItemView.extend({className:"background-container",template:e,ui:{background:".background"},onlyAfterRender:["onTransitionIn","onTransitionOut","onImageLoad"],initialize:function(){t.bindAll(this,"onImageLoad"),this.image=new a({width:1280,height:720}),this.listenTo(n,"show:background",this.onTransitionIn),this.listenTo(n,"hide:background",this.onTransitionOut)},load:function(e){if(!this.model)return void s.warn("A background cannot be loaded without a model, current key: "+this.currentKey);
if(this.currentBackground!==e||!t.isEmpty(this.imageFilters)||this.image.hasFilters()){if(this.currentBackground=e,!e)return void this.ui.background.addClass("transition-out");this.image.server=this.model.server,this.image.setFilters(this.imageFilters),this.image.load(e,!0).done(this.onImageLoad)}},showBackground:function(e){this.ui.background.css("background-image","url("+e+")").removeClass("transition-out")},onRender:function(){this.currentSrc&&this.showBackground(this.currentSrc)},onClose:function(){
this.image.close()},onTransitionIn:function(e){return this.model&&this.model.id===e.model.id?void this.references++:(this.references=1,this.model=e.model,this.listenTo(this.model,"change:art",this.onArtChange),this.imageFilters=e.imageFilters||{},this.currentKey=this.model.get("key"),this.ui.background.toggleClass("dim",!!e.dim),void this.load(this.model.get("art")))},onTransitionOut:function(e){if(this.model&&this.model.id===e.id){if(this.references>1)return void this.references--;this.image.cancel(),
this.stopListening(this.model),this.model=null,this.currentBackground=null,this.currentSrc=null,this.ui.background.addClass("transition-out")}},onArtChange:function(e,t){this.load(t)},onImageLoad:function(e){this.currentBackground&&this.showBackground(e),this.currentSrc=e}});return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1006),i(2),i(4),i(6),i(5),i(28),i(11),i(9),i(39),i(262),i(696),i(263),i(715),i(908),i(907),i(902),i(901),i(905),i(903),i(899),i(126),i(673)],s=function(e,t,i,n,s,a,r,o,l,c,u,d,h,p,f,m,g,v,y,b,w,x){
"use strict";var S=n.Layout.extend({el:"#plex",template:e,resizeDelay:200,ui:{content:"#content",shadow:".scroll-shadow"},customRegions:{background:{prepend:!0,global:!0},content:{selector:"#content",global:!0,scrollable:!0,channelName:"content"},status:{prepend:!0,global:!0},player:{append:!0,global:!0},miniPlayer:{append:!0,global:!0},navbar:{modifier:"show-nav-bar",prepend:!0,global:!0},sidebar:{modifier:"show-side-bar",append:!0},actionbar:{modifier:"show-action-bar",append:!0},breadcrumbbar:{
modifier:"show-breadcrumb-bar",append:!0},filterbar:{modifier:"show-filter-bar",append:!0},alphabar:{modifier:"show-alpha-bar",append:!0},alertbar:{modifier:"show-alert-bar",append:!0,global:!0}},openAlerts:{},initialize:function(){t.bindAll(this,"triggerResizeEvent","onResize","onScroll"),this.user=o.get("user"),this.modals=[],this.playerConstructors={full:{},mini:{}},this.playerConstructors.full[a.types.VIDEO]=p,this.playerConstructors.full[a.types.PHOTO]=v,this.playerConstructors.mini[a.types.VIDEO]=f,
this.playerConstructors.mini[a.types.MUSIC]=m,this.playerConstructors.mini[a.types.PHOTO]=y,t.each(t.keys(this.customRegions),function(e){var i=this.customRegions[e],n=i.selector||t.uniqueId("r");i.scrollable?this.addRegion(e,new x({el:n,channelName:i.channelName})):this.addRegion(e,n)},this),this.listenTo(o,{"change:authorized":this.onAuthorizedChange,"change:multiserver":this.onMultiserverChange}),this.listenTo(this.user,{"change:locked":this.onUserLockedChange}),this.listenTo(s,{"show:loading":this.showLoading,
"show:view":this.showView,"show:alert":this.showAlert,"show:bar":this.showBar,"hide:bar":this.hideBar,"show:modal":this.showModal,"hide:modal":this.hideModal,"show:player":this.showPlayer,"hide:player":this.hidePlayer,"show:playerLoading":this.showPlayerLoading,"hide:playerLoading":this.hideLoadingMiniPlayerView,"start:scrollListener":this.onStartScrollListener,"stop:scrollListener":this.onStopScrollListener,"update:scrollPosition":this.onUpdateScrollPosition}),i(window).on("resize",this.onResize);
},showCustomRegion:function(e,t){var i=this.customRegions[e],n=this[e];return this.user.get("locked")?(n.lockedView=t,void t.close()):void(i.append?n.append(t,this.$el):i.prepend?n.prepend(t,this.$el):n.show(t))},showLoading:function(){this.hideBar("alertbar"),this.user.get("locked")&&this.resetContentLockedRegions(),this.showCustomRegion("content",new c)},showView:function(e){i(".tooltip").remove(),this.hideBackground(),s.trigger("cycle:cache"),this.currentView=e,this.showCustomRegion("content",e),
this.ui.content.scrollTop(0)},showAlert:function(e){var t=e.message;if(!this.openAlerts[t]){var i=new d(e);this.openAlerts[t]=!0,this.listenToOnce(i,"close",function(){delete this.openAlerts[t]}),this.$el.append(i.render().el)}},showAlertBar:function(){var e=l.get("alerts");e&&e.length&&(l.set("alerts",null),this.showBar("alertbar",new w({alert:t.first(e)})))},showBar:function(e,t){var i=this.customRegions[e],n=i.modifier;n&&this.$el.addClass(this.customRegions[e].modifier),t&&this.showCustomRegion(e,t);
},hideBar:function(e,t){t||(t={});var i=this.customRegions[e],n=i.modifier;n&&this.$el.removeClass(n),t.preserve||(this[e].lockedView=null,this[e].close())},showModal:function(e){this.modals.push(e);var t=i("body");e.transparent&&t.addClass("show-modal-transparent"),t.append(e.render().el)},hideModal:function(e){var n=t.indexOf(this.modals,e);n>-1&&this.modals.splice(n,1)[0].close(),e.transparent&&!t.findWhere(this.modals,{transparent:!0})&&i("body").removeClass("show-modal-transparent")},showPlayer:function(e){
this.hideLoadingMiniPlayerView(),i(".tooltip").remove();var t=this.player.currentView,n=t&&t.playQueue===e.playQueue;if(e.controller||!n){var s=e.useMiniPlayer||e.type===a.types.MUSIC,r=o.get("primaryPlayer"),l=r&&"cast"===r.get("protocol"),c=l||e.type===a.types.VIDEO;(c||e.isSwitchingPlayers)&&this.hidePlayer();var u=this.playerConstructors[s?"mini":"full"][e.type],d=new u(e);s?(this.showCustomRegion("miniPlayer",d),this.$el.addClass("show-mini-player")):this.showCustomRegion("player",d)}},showPlayerLoading:function(){
this.showCustomRegion("miniPlayer",new g)},hidePlayer:function(e){e?(this.miniPlayer.currentView===e&&(this.miniPlayer.close(),this.$el.removeClass("show-mini-player")),this.player.currentView===e&&this.player.close()):(this.miniPlayer.close(),this.$el.removeClass("show-mini-player"),this.player.close())},hideBackground:function(){if(this.currentView&&this.currentView.model){var e=this.currentView.model;s.trigger("hide:background",e),e.get("key")&&r.execute("playSound",{key:e.get("key"),stop:!0,background:!0
})}},hideLoadingMiniPlayerView:function(){this.miniPlayer.currentView instanceof g&&(this.miniPlayer.currentView.$el.remove(),this.miniPlayer.close())},lockAll:function(){var e=t.map(t.keys(this.customRegions),function(e){return this[e]},this);t.each(e,function(e){e.close()},this)},resetContentLockedRegions:function(){t.each(t.keys(this.customRegions),function(e){var t=this.customRegions[e];if(!t.global){var i=this[e];i.lockedView&&(i.lockedView=null)}},this)},restoreAll:function(){o.get("authorized")&&this.showBar("navbar",new b({
model:o}),{prepend:!0}),this.showCustomRegion("background",this.backgroundView),this.showCustomRegion("status",new h)},triggerResizeEvent:function(){s.trigger("resize")},onRender:function(){this.backgroundView=new u,this.restoreAll()},onAuthorizedChange:function(e,t){if(t){this.showBar("navbar",new b({model:o}),{prepend:!0});var i=this.user.get("locked");(i===!1||null===i)&&this.showAlertBar()}else this.hideBar("navbar"),this.hidePlayer(),s.trigger("navigate:refresh")},onMultiserverChange:function(e,t){
this.$el.toggleClass("show-multiserver",t)},onUserLockedChange:function(e,t){t?this.lockAll():(t===!1||null===t)&&(null===t&&(this.backgroundView=new u),this.restoreAll())},onResize:function(){this.resizeTimeout=clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(this.triggerResizeEvent,this.resizeDelay)},onStartScrollListener:function(){this.ui.content.on("scroll",this.onScroll)},onStopScrollListener:function(){this.ui.content.off("scroll",this.onScroll),this.ui.shadow.addClass("transition-out");
},onScroll:function(){var e=this.ui.content.scrollTop();this.ui.shadow.toggleClass("transition-out",10>e)},onUpdateScrollPosition:function(e){this.ui.content[0].scrollTop=e}});return S}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1007),i(4),i(2),i(6),i(5),i(11)],s=function(e,t,i,n,s,a){"use strict";var r=10,o=1,l=-1,c=n.ItemView.extend({tagName:"span",className:"rating heart-rating",template:e,disabled:!0,events:{"click .like-meh-btn":"onLikeMehClick","click .dislike-btn":"onDislikeClick"
},bindings:{".like-meh-btn":{modelAttribute:"userRating",formatter:function(e,t){var i=this.model.get("userRating")===r;t.toggleClass("user-rating",i)}},".like-meh-btn > i":{modelAttribute:"userRating",formatter:function(e,t){var i=this.model.get("userRating")===r;t.toggleClass("plex-icon-heart",i),t.toggleClass("plex-icon-heart-empty",!i)}},".dislike-btn":{modelAttribute:"userRating",formatter:function(e,t){var i=this.model.get("userRating")===o;t.toggleClass("user-rating",i)}}},persistRating:function(e){
return a.execute("rate",{item:this.model,rating:e})},onUserRatingChange:function(e,t){this.render()},onLikeMehClick:function(e){this.persistRating(this.model.get("userRating")===r?l:r)},onDislikeClick:function(){return this.model.get("userRating")===o?void this.persistRating(l):void this.persistRating(o).done(i.bind(function(){var e=this.model.server.get("playQueueManager"),t=e.getFor(this.model);t.fetch().then(function(){s.trigger("shortcut:skipNext")})},this))}});return c}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(1008),i(6),i(42),i(9)],s=function(e,t,i,n){"use strict";var s=t.ItemView.extend({template:e,initialize:function(){this.listenTo(n,"change:primaryServer",this.render),this.listenTo(n.get("user"),"change:signedIn",this.render)},serializeData:function(){var e=n.get("user"),t=n.get("primaryServer"),s={host:window.location.host,userAgent:window.navigator.userAgent,browser:i,user:e.toJSON(),hasPlexPass:e.hasPlexPass(),cloudServer:e.server.toJSON(),cloudServerUrl:e.server.url()
};return t&&(s.primaryServer=t.toJSON(),s.primaryServerUrl=t.url()),s}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1010),i(6)],s=function(e,t){"use strict";var i=t.ItemView.extend({className:"logs-container",template:e,ui:{textarea:"textarea"},collectionEvents:{add:"onAdd"},onlyAfterRender:["onAdd"],serializeData:function(){return{logs:this.collection.toJSONString()}},onAdd:function(e,t){this.ui.textarea.text(this.collection.toJSONString())}});return i}.apply(t,n),
!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1011),i(2),i(6),i(17),i(9),i(450),i(40),i(811)],s=function(e,t,i,n,s,a,r,o){"use strict";var l=["movie","show","episode","artist","album","track","photo","clip"],c=i.Layout.extend({className:"search-container container searching",template:e,ui:{emptyMessage:".empty-message"},initialize:function(e){this.bindAllWhenRendered("checkPendingRequests"),this.query=e.query,this.collections=[],this.channelProviders=[],this.pendingRequests=0,this.lists={},
t.each(l,function(e){var t="."+e+"-search-container",i=new r;i.comparator=this.itemComparator;var n=new o({collection:i});n.sorted=!0,this.addRegion(e,t),this.lists[e]=n},this);var i=s.get("servers");i.each(this.initializeServer,this),s.set("searchValue",this.query),this.listenTo(i,"change:authorized",this.initializeServer)},initializeServer:function(e){e.get("authorized")&&e.get("isFullServer")&&(!e.get("shared")||n.get("sharedSearch"))&&e.populate().done(t.bind(function(){e.supports("search")&&this.initializeProviders(e);
},this))},initializeProviders:function(e){var t=new r([],{server:e,url:"/search?local=1&query="+encodeURIComponent(this.query)}),i=new r([],{server:e,url:"/search?type=10&query="+encodeURIComponent(this.query)});if(this.listenToOnce(t,"reset",this.onMetadataReset),this.listenToOnce(i,"reset",this.onMetadataReset),this.pendingRequests+=2,t.fetch({reset:!0,scope:"page"}).always(this.checkPendingRequests),i.fetch({reset:!0,scope:"page"}).always(this.checkPendingRequests),n.get("channelSearch")&&!e.get("shared")){
var s=new a([],{server:e,query:encodeURIComponent(this.query)});this.listenToOnce(s,"reset",this.onChannelProvidersReset),this.pendingRequests++,s.fetch({reset:!0,scope:"page"}).always(this.checkPendingRequests)}},serializeData:function(){return{query:t.escape(this.query)}},checkPendingRequests:function(){if(!--this.pendingRequests){this.$el.removeClass("searching");var e=t.every(this.lists,function(e){return 0===e.collection.length});e&&this.ui.emptyMessage.removeClass("hidden")}},itemComparator:function(e){
var t=e.server,i=t.get("friendlyName")||"",n=t.get("shared"),s=n?"1":"0";return s+=i.toLowerCase()},onRender:function(){t.each(l,function(e){var t=this.lists[e];this[e].append(t)},this)},onChannelProvidersReset:function(e){e.each(function(e){if(!(e.get("machineIdentifier")||t.indexOf(this.channelProviders,e.id)>-1)){var i=new r([],{server:e.server,url:e.id+"&query="+encodeURIComponent(this.query)});this.listenToOnce(i,"reset",this.onMetadataReset),this.pendingRequests++,i.fetch({reset:!0,scope:"page"
}).always(this.checkPendingRequests)}},this)},onMetadataReset:function(e){this.collections.push(e);var i=e.splitByType();for(var n in i){if(t.indexOf(l,n)<0)return;this.$("."+n+"-search-container").removeClass("hidden");var s=this.lists[n];s.collection.add(i[n])}},onClose:function(){s.set({searchValue:null})}});return c}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1012),i(2),i(6),i(12),i(73),i(9)],s=function(e,t,i,n,s,a){"use strict";var r=i.ItemView.extend({className:"sign-in-form",
template:e,validationFields:["username","email","password","confirm"],ui:{submitBtn:"[type=submit]",signInBtn:".sign-in-btn",signUpBtn:".sign-up-btn",username:".username-group",email:".email-group",password:".password-group",confirm:".confirm-group"},events:{"click .sign-in-btn":"onSignInClick","click .sign-up-btn":"onSignUpClick","blur input":"onInputBlur","submit form":"onSubmit"},initialize:function(e){this.showRememberMe=e.showRememberMe,s.trackEvent("view","signin")},serializeData:function(){
return{showRememberMe:this.showRememberMe}},validateAll:function(e,i,n){var s=!0;return i||(i=this.validationFields),t.each(i,t.bind(function(t){var i=e[t];this.validate(i,n[t],n)||(s=!1)},this)),s},validate:function(e,i,n){var s,a=e.id;if(t.indexOf(this.validationFields,a)<0)return!0;var r=this.ui[a];return s="confirm"===e.id?i===e.form.password.value:!!i,r.toggleClass("has-error",!s),s},onSignInClick:function(e){e.preventDefault(),this.ui.signInBtn.addClass("selected"),this.ui.signUpBtn.removeClass("selected"),
this.$el.addClass("sign-in-form"),this.$el.removeClass("sign-up-form"),s.trackEvent("view","signin")},onSignUpClick:function(e){e.preventDefault(),this.ui.signInBtn.removeClass("selected"),this.ui.signUpBtn.addClass("selected"),this.$el.removeClass("sign-in-form"),this.$el.addClass("sign-up-form"),s.trackEvent("view","signup")},onInputBlur:function(e){var t=e.target,i="checkbox"===t.type?t.checked:t.value;this.validate(t,i)}});return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;
n=[i(1013),i(2),i(4),i(6),i(5),i(73),i(11),i(9),i(702)],s=function(e,t,i,n,s,a,r,o,l){"use strict";var c=n.Layout.extend({className:"sign-in-container container",template:e,ui:{form:"#user-account-form"},regions:{form:"#user-account-form"},events:{"submit form":"onSubmit"},signIn:function(e){return this.form.currentView.validateAll(this.ui.form[0],["username","password"],e)?r.execute("signIn",e):i.Deferred().reject().promise()},signUp:function(e){return this.form.currentView.validateAll(this.ui.form[0],null,e)?r.execute("signUp",e):i.Deferred().reject().promise();
},onRender:function(){this.form.show(new l({showRememberMe:!0}))},onSubmit:function(e){e.preventDefault();var i=e.currentTarget,n=this.form.currentView.ui.submitBtn;if(!n.hasClass("active")){n.addClass("active");var r,l,c={username:i.username.value,email:i.email.value,password:i.password.value,confirm:i.confirm.value,remember:i.remember.checked};this.form.currentView.$el.hasClass("sign-in-form")?(r=this.signIn(c),l="signin_success"):(r=this.signUp(c),l="signup_success"),r.done(function(){s.trigger("navigate:refresh"),
a.trackEvent("view",l,{userID:o.get("user").id})}),r.fail(t.bind(function(){n.removeClass("active")},this))}}});return c}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1015),i(2),i(4),i(6),i(7),i(5),i(14),i(11),i(284),i(106),i(71),i(863),i(132),i(131),i(130),i(133)],s=function(e,t,i,n,s,a,r,o,l,c,u,d,h,p,f,m){"use strict";var g=["episode","movie","clip","userPlaylistItem"],v={preventDefault:!0,stopPropagation:!1},y=n.ItemView.extend({className:"action-bar",template:e,ui:{primaryActions:".action-bar-nav",
secondaryActions:".dropdown-menu",playBtn:".play-btn",playVersionBtn:".play-version-btn",playAllBtn:".play-all-btn",playUnwatchedBtn:".play-unwatched-btn",playShuffledBtn:".play-shuffled-btn",playTrailerBtn:".play-trailer-btn",playNextBtn:".play-next-btn",mixRadioBtn:".play-mixradio-btn",addToUpNextBtn:".add-to-up-next-btn",addToPlaylistBtn:".add-to-playlist-btn",secondaryDivider:".secondary-divider",editBtn:".edit-btn",refreshBtn:".refresh-btn",analyzeBtn:".analyze-btn",markWatchedBtn:".mark-watched-btn",
markUnwatchedBtn:".mark-unwatched-btn",syncBtn:".sync-btn",convertBtn:".convert-btn",watchLaterBtn:".watch-later-btn",shareBtn:".share-btn",recommendBtn:".recommend-btn",deleteBtn:".delete-btn",deleteVersionsBtn:".delete-versions-btn",deleteFromUserPlaylistBtn:".delete-from-user-playlist-btn",infoBtn:".info-btn"},triggers:{"click .play-btn":"play","click .play-version-btn":t.extend({event:"playVersion"},v),"click .play-all-btn":t.extend({event:"play"},v),"click .play-unwatched-btn":"playUnwatched",
"click .play-shuffled-btn":"playShuffled","click .play-trailer-btn":"playTrailer","click .edit-btn":"edit","click .refresh-btn":"refresh","click .analyze-btn":t.extend({event:"analyze"},v),"click .mark-watched-btn":"markWatched","click .mark-unwatched-btn":"markUnwatched","click .match-btn":t.extend({event:"fixMatch"},v),"click .select-btn":"select","click .deselect-btn":"deselect","click .fix-match-btn":t.extend({event:"fixMatch"},v),"click .unmatch-btn":t.extend({event:"unmatch"},v),"click .split-apart-btn":t.extend({
event:"splitApart"},v),"click .sync-btn":"sync","click .convert-btn":t.extend({event:"convert"},v),"click .watch-later-btn":t.extend({event:"watchLater"},v),"click .share-btn":t.extend({event:"share"},v),"click .recommend-btn":t.extend({event:"recommend"},v),"click .delete-btn":t.extend({event:"delete"},v),"click .delete-versions-btn":t.extend({event:"deleteVersions"},v),"click .delete-from-user-playlist-btn":t.extend({event:"deleteFromUserPlaylist"},v),"click .info-btn":t.extend({event:"info"},v),
"click .play-next-btn":t.extend({event:"playNext"},v),"click .play-mixradio-btn":t.extend({event:"playMixRadio"},v),"click .add-to-up-next-btn":t.extend({event:"addToUpNext"},v),"click .add-to-playlist-btn":"addToPlaylist"},onlyAfterRender:["onPlay","onPlayUnwatched","onPlayShuffled","onPlayTrailer","onEdit","onRefresh","onAnalyze","onMarkWatched","onMarkUnwatched","onSync","onWatchLater","onShare","onRecommend","onDelete","onDeleteFromUserPlaylist","onInfo","onPlayNext","onAddToUpNext","onAddToPlaylist","updateDropdown"],
initialize:function(e){this.type=this.model.get("type"),this.mediaActions=e.mediaActions,this.listenTo(this.mediaActions,"change",t.throttle(this.updateDropdown,50)),this.listenTo(this.mediaActions,"change:selectedItems",this.onSelectedItemsChange),this.listenTo(a,{"shortcut:play":this.onPlay,"shortcut:edit":this.onEdit,"shortcut:refresh":this.onRefresh,"shortcut:analyze":this.onAnalyze,"shortcut:markWatched":this.onMarkWatched,"shortcut:markUnwatched":this.onMarkUnwatched,"shortcut:sync":this.onSync,
"shortcut:delete":this.onDelete,"shortcut:info":this.onInfo}),this.listenTo(a,"shortcut:play",this.onPlayUnwatched),this.listenTo(a,"shortcut:delete",this.onDeleteFromUserPlaylist)},serializeData:function(){var e=t.extend({},this.mediaActions.attributes);if(e.isSingleItem=t.contains(g,this.type),this.mediaActions.get("showDownload")){e.downloadUrl=this.model.getDownloadUrl();var i=this.model.getFilepath();i&&(e.downloadName=r.getLastSegment(i))}return e},updateDropdown:function(){var e=this.ui.secondaryActions.find("a:not(.hidden)"),t=e.hasClass("secondary-only"),i=e.length>2||t;
if(this.$el.toggleClass("show-secondary-actions-dropdown",i),i){var n=this.ui.secondaryDivider,s=n.prevAll(":not(:has(.hidden))").length,a=n.nextAll(":not(:has(.hidden))").length;n.toggleClass("hidden",!s||!a)}},bindingsModel:"mediaActions",bindings:{".play-btn":{modelAttribute:"showPlay",manual:!0,autohide:!0},".play-version-btn":{modelAttribute:"showPlayVersion",manual:!0,autohide:!0},".play-all-btn":{modelAttribute:"showPlayAll",manual:!0,autohide:!0},".play-unwatched-btn":{modelAttribute:"showPlayUnwatched",
manual:!0,autohide:!0},".play-shuffled-btn":{modelAttribute:"showShuffle",manual:!0,autohide:!0},".play-next-btn, .add-to-up-next-btn":{modelAttribute:"showQueue",modelListeners:["showQueue","canQueue"],manual:!0,autohide:!0,formatter:function(e,t){return t.toggleClass("disabled",!this.mediaActions.get("canQueue")),e}},".play-trailer-btn":{modelAttribute:"showPlayTrailer",manual:!0,autohide:!0},".play-mixradio-btn":{modelAttribute:"showPlayMixRadio",manual:!0,autohide:!0},".add-to-playlist-btn":{
modelAttribute:"showAddToPlaylist",manual:!0,autohide:!0},".edit-btn":{modelAttribute:"showEdit",manual:!0,autohide:!0},".refresh-btn":{modelAttribute:"showRefresh",manual:!0,autohide:!0},".analyze-btn":{modelAttribute:"showAnalyze",manual:!0,autohide:!0},".mark-watched-btn":{modelAttribute:"showMarkWatched",manual:!0,autohide:!0},".mark-unwatched-btn":{modelAttribute:"showMarkUnwatched",manual:!0,autohide:!0},".match-btn":{modelAttribute:"showMatch",manual:!0,autohide:!0},".select-btn":{modelAttribute:"selecting",
manual:!0,autohide:function(e){return!e&&this.mediaActions.get("showSelect")}},".deselect-btn":{modelAttribute:"selecting",manual:!0,autohide:!0},".fix-match-btn":{modelAttribute:"showFixMatch",manual:!0,autohide:!0},".unmatch-btn":{modelAttribute:"showUnmatch",manual:!0,autohide:!0},".split-apart-btn":{modelAttribute:"showSplitApart",manual:!0,autohide:!0},".sync-btn":{modelAttribute:"showSync",manual:!0,autohide:!0},".convert-btn":{modelAttribute:"showConvert",manual:!0,autohide:!0},".download-btn":{
modelAttribute:"showDownload",manual:!0,autohide:!0},".watch-later-btn":{modelAttribute:"showWatchLater",manual:!0,autohide:!0},".share-btn, .recommend-btn":{modelAttribute:"showShare",manual:!0,autohide:!0},".delete-btn":{modelAttribute:"showDelete",manual:!0,autohide:!0},".delete-versions-btn":{modelAttribute:"showDeleteVersions",manual:!0,autohide:!0},".delete-from-user-playlist-btn":{modelAttribute:"showDeleteFromUserPlaylist",manual:!0,autohide:!0},".info-btn":{modelAttribute:"showInfo",manual:!0,
autohide:!0}},onRender:function(){this.$el.tooltip({selector:".nav > li > a",container:"body",placement:"right"}),this.updateDropdown()},onPlay:function(){this.ui.playBtn.isDisabled()&&this.ui.playAllBtn.isDisabled()||o.execute("playMedia",{items:this.mediaActions.getActionTargets()})},onPlayVersion:function(){this.ui.playVersionBtn.isDisabled()||a.trigger("show:modal",new l({model:this.model}))},onPlayUnwatched:function(){this.ui.playUnwatchedBtn.isDisabled()||o.execute("playMedia",{items:this.mediaActions.getActionTargets(),
unwatched:!0})},onPlayShuffled:function(){this.ui.playShuffledBtn.isDisabled()||o.execute("playMedia",{items:this.mediaActions.getActionTargets(),shuffle:!0})},onPlayTrailer:function(){if(!this.ui.playTrailerBtn.isDisabled()){var e=this.model.get("extras"),t=e.findWhere({key:this.model.get("primaryExtraKey")});o.execute("playMedia",{items:[t]})}},onPlayMixRadio:function(){var e=this.model.get("related"),t=e.findWhere({browse:!1});t.set("type","track"),o.execute("playMedia",{item:t})},onEdit:function(){
this.ui.editBtn.isDisabled()||a.trigger("show:modal",new u({mediaActions:this.mediaActions}))},onRefresh:function(){this.ui.refreshBtn.isDisabled()||o.execute("refreshMetadata",{items:this.mediaActions.getActionTargets()})},onAnalyze:function(){this.ui.analyzeBtn.isDisabled()||o.execute("analyzeItems",{items:this.mediaActions.getActionTargets()})},onMarkWatched:function(){this.ui.markWatchedBtn.isDisabled()||o.execute("markWatched",{items:this.mediaActions.getActionTargets()})},onMarkUnwatched:function(){
this.ui.markUnwatchedBtn.isDisabled()||o.execute("markUnwatched",{items:this.mediaActions.getActionTargets()})},onSelect:function(){this.mediaActions.set("selecting",!0)},onDeselect:function(){this.mediaActions.set("selecting",!1)},onFixMatch:function(){a.trigger("show:modal",new d({model:this.model}))},onUnmatch:function(){o.execute("unmatch",{item:this.model})},onSplitApart:function(){o.execute("splitApart",{item:this.model})},onSync:function(){this.ui.syncBtn.isDisabled()||o.execute("showSyncModal",{
item:this.model,items:this.mediaActions.getActionTargets()})},onConvert:function(){a.trigger("show:modal",new m({item:this.model,items:this.mediaActions.getActionTargets()}))},onWatchLater:function(){this.ui.watchLaterBtn.isDisabled()||o.execute("watchLater",{item:this.model})},onShare:function(){this.ui.shareBtn.isDisabled()||a.trigger("show:modal",new h({model:this.model}))},onRecommend:function(){this.ui.recommendBtn.isDisabled()||a.trigger("show:modal",new p({model:this.model}))},onDelete:function(){
this.ui.deleteBtn.isDisabled()||(this.model.get("playlistType")?o.execute("deletePlaylist",{item:this.model}):o.execute("deleteItems",{items:this.mediaActions.getActionTargets()}))},onDeleteVersions:function(){this.ui.deleteBtn.isDisabled()||o.execute("deleteVersions",{item:this.model})},onDeleteFromUserPlaylist:function(){if(!this.ui.deleteFromUserPlaylistBtn.isDisabled()){var e=this.model.destroy();e.done(t.bind(function(){i(".tooltip").remove(),a.trigger("navigate","userPlaylist",{key:this.model.get("playlist")
})},this))}},onInfo:function(){this.ui.infoBtn.isDisabled()||a.trigger("show:modal",new f({model:this.model}))},onPlayNext:function(){this.ui.playNextBtn.isDisabled()||o.execute("queueMedia",{item:this.model,next:!0})},onAddToUpNext:function(){this.ui.addToUpNextBtn.isDisabled()||o.execute("queueMedia",{item:this.model,next:!1})},onAddToPlaylist:function(){this.ui.addToPlaylistBtn.isDisabled()||a.trigger("show:modal",new c({model:this.model,items:this.mediaActions.getActionTargets(),title:this.mediaActions.getActionTargetsTitle()
}))},onSelectedItemsChange:function(e,t){var i=s(t&&t.length?"Play selected":"Play All");this.ui.playBtn.attr("data-original-title",i)}});return y}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1016),i(4),i(6),i(5),i(948)],s=function(e,t,i,n,s){"use strict";var a=i.Layout.extend({className:"playlists-side-bar-container",template:e,regions:{sidebar:".side-bar"},triggers:{"click .options-btn":"toggleSidebar"},onlyAfterRender:["onToggleSidebar"],initialize:function(){this.listenTo(n,{
"shortcut:sidebar":this.onToggleSidebar})},onRender:function(){this.$el.tooltip({selector:".nav > li > a",container:"body",placement:"right"}),this.sidebar.append(new s({model:this.model}),this.$el)},onToggleSidebar:function(){t(".tooltip").remove();var e=this.sidebar.currentView;e.hidden?e.open():e.hide()}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1017),i(2),i(4),i(6),i(7),i(5),i(25),i(11),i(9),i(949),i(860),i(106),i(71),i(63),i(133)],s=function(e,t,i,n,s,a,r,o,l,c,u,d,h,p,f){
"use strict";var m={preventDefault:!0,stopPropagation:!1},g=n.Layout.extend({className:"section-side-bar-container",template:e,ui:{actionBar:".action-bar",secondaryActions:".dropdown-menu",playBtn:".play-btn",playShuffledBtn:".play-shuffled-btn",refreshBtn:".refresh-btn",analyzeBtn:".analyze-btn",markWatchedBtn:".mark-watched-btn",markUnwatchedBtn:".mark-unwatched-btn",addToCollectionBtn:".add-to-collection-btn",addToPlaylistBtn:".add-to-playlist-btn",mergeBtn:".merge-btn",syncBtn:".sync-btn",deleteBtn:".delete-btn"
},regions:{sidebar:".side-bar"},triggers:{"click .options-btn":"toggleSidebar","click .play-btn":"play","click .play-shuffled-btn":"playShuffled","click .select-btn":"select","click .deselect-btn":"deselect","click .edit-btn":"edit","click .refresh-btn":t.extend({event:"refresh"},m),"click .analyze-btn":t.extend({event:"analyze"},m),"click .mark-watched-btn":"markWatched","click .mark-unwatched-btn":"markUnwatched","click .add-to-collection-btn":t.extend({event:"addToCollection"},m),"click .add-to-playlist-btn":"addToPlaylist",
"click .merge-btn":t.extend({event:"merge"},m),"click .sync-btn":"sync","click .convert-btn":t.extend({event:"convert"},m),"click .delete-btn":t.extend({event:"delete"},m)},initialize:function(e){this.bindAllWhenRendered("updateDropdown"),this.mediaActions=e.mediaActions,this.type=this.model.get("type"),this.multiuser=this.model.server.get("multiuser"),this.signedIn=l.get("user").get("signedIn"),this.listenTo(this.mediaActions,"change:selectedItems",this.onSelectedItemsChange),this.listenTo(a,{"shortcut:sidebar":this.onToggleSidebar,
"shortcut:play":this.onPlay,"shortcut:refresh":this.onRefresh,"shortcut:analyze":this.onAnalyze,"shortcut:markWatched":this.onMarkWatched,"shortcut:markUnwatched":this.onMarkUnwatched,"shortcut:sync":this.onSync,"shortcut:edit":this.onEdit,"shortcut:delete":this.onDelete})},updateDropdown:function(){var e=this.ui.secondaryActions.find("a:not(.hidden)"),t=e.hasClass("secondary-only"),i=e.length>2||t;this.ui.actionBar.toggleClass("show-secondary-actions-dropdown",i)},bindingsModel:"mediaActions",bindings:{
".play-btn":{modelAttribute:"showPlay",manual:!0,autohide:!0},".play-shuffled-btn":{modelAttribute:"showShuffle",manual:!0,autohide:!0},".select-btn":{modelAttribute:"selecting",modelListeners:["selecting","showSelect"],manual:!0,autohide:function(e){return this.mediaActions.get("showSelect")?!e:!1}},".deselect-btn":{modelAttribute:"selecting",manual:!0,autohide:!0},".edit-btn":{modelAttribute:"selectedItems",modelListeners:["selectedItems","showEdit"],manual:!0,autohide:function(e){return this.mediaActions.get("showEdit")?!(!e||!e.length):!1;
}},".refresh-btn":{modelAttribute:"selectedItems",modelListeners:["selectedItems","showRefresh"],manual:!0,autohide:function(e){return this.mediaActions.get("showRefresh")?e&&e.length&&!this.hasSelectedFolder:!1}},".analyze-btn":{modelAttribute:"selectedItems",modelListeners:["selectedItems","showAnalyze"],manual:!0,autohide:function(e){return this.mediaActions.get("showAnalyze")?e&&e.length&&!this.hasSelectedFolder:!1}},".mark-watched-btn":{modelAttribute:"showMarkWatched",manual:!0,autohide:!0},
".mark-unwatched-btn":{modelAttribute:"showMarkUnwatched",manual:!0,autohide:!0},".add-to-collection-btn":{modelAttribute:"selectedItems",modelListeners:["selectedItems","showAddToCollection"],manual:!0,autohide:function(e){return this.mediaActions.get("showAddToCollection")?e&&e.length&&!this.hasSelectedFolder:!1}},".add-to-playlist-btn":{modelAttribute:"showAddToPlaylist",manual:!0,autohide:!0},".merge-btn":{modelAttribute:"selectedItems",modelListeners:["selectedItems","showMerge"],manual:!0,autohide:function(e){
if(!this.mediaActions.get("showMerge"))return!1;var t=this.model.server.supports("merge"),i=e&&e.length>1;return t&&i&&!this.hasSelectedFolder}},".sync-btn":{modelAttribute:"showSync",manual:!0,autohide:!0},".convert-btn":{modelAttribute:"showConvert",manual:!0,autohide:!0},".delete-btn":{modelAttribute:"selectedItems",modelListeners:["selectedItems","showDelete"],manual:!0,autohide:function(e){return this.mediaActions.get("showDelete")?e&&e.length&&!this.hasSelectedFolder:!1}}},onRender:function(){
var e=new c({model:this.model,mediaActions:this.mediaActions});this.sidebar.append(e,this.$el),this.$el.tooltip({selector:".nav > li > a",container:"body",placement:"right"}),this.updateDropdown()},onClose:function(){this.mediaActions.stopListening(),this.mediaActions.deselectAll()},onSelectedItemsChange:function(e,i){if(i){this.hasSelectedFolder=t.some(i,function(e){return e.get("isFolder")});var n=s(i&&i.length?"Play selected":"Play All");this.ui.playBtn.attr("data-original-title",n),t.defer(this.updateDropdown);
}},onToggleSidebar:function(){i(".tooltip").remove();var e=this.sidebar.currentView;e.hidden?e.open():e.hide()},onPlay:function(){this.ui.playBtn.isDisabled()||o.execute("playMedia",{items:this.mediaActions.getActionTargets()})},onPlayShuffled:function(){this.ui.playShuffledBtn.isDisabled()||o.execute("playMedia",{items:this.mediaActions.getActionTargets(),shuffle:!0})},onSelect:function(){this.mediaActions.set("selecting",!0)},onDeselect:function(){this.mediaActions.set("selecting",!1)},onEdit:function(){
if(this.model.server.get("isFullOwnedServer")){var e=this.mediaActions.get("selectedItems");if(e.length){if(e.length>1&&!e[0].server.supports("batchEdit"))return;a.trigger("show:modal",new h({mediaActions:this.mediaActions}))}else a.trigger("show:modal",new p({server:this.model.server,model:this.model}))}},onRefresh:function(){return this.ui.refreshBtn.isDisabled()?void o.execute("updateLibrary",{section:this.model}):void o.execute("refreshMetadata",{items:this.mediaActions.getActionTargets()})},
onAnalyze:function(){return this.ui.analyzeBtn.isDisabled()?void o.execute("analyzeSection",{section:this.model}):void o.execute("analyzeItems",{items:this.mediaActions.getActionTargets()})},onMarkWatched:function(){this.ui.markWatchedBtn.isDisabled()||o.execute("markWatched",{items:this.mediaActions.getActionTargets()}).then(t.bind(function(){this.mediaActions.updateAll()},this))},onMarkUnwatched:function(){this.ui.markUnwatchedBtn.isDisabled()||o.execute("markUnwatched",{items:this.mediaActions.getActionTargets()
}).then(t.bind(function(){this.mediaActions.updateAll()},this))},onAddToCollection:function(){this.ui.addToCollectionBtn.isDisabled()||a.trigger("show:modal",new u({items:this.mediaActions.getActionTargets()}))},onAddToPlaylist:function(e){if(!this.ui.addToPlaylistBtn.isDisabled()){var t=this.mediaActions.getActionTargets();a.trigger("show:modal",new d({model:t[0],items:t,title:this.mediaActions.getActionTargetsTitle()}))}},onMerge:function(){if(!this.ui.mergeBtn.isDisabled()){var e=this.mediaActions.getActionTargets(),i=t.first(e),n=e.slice(1);
o.execute("merge",{item:i,items:n})}},onSync:function(){if(!this.ui.syncBtn.isDisabled()){var e=this.mediaActions.getActionTargets();o.execute("showSyncModal",{item:e[0],items:e})}},onConvert:function(){var e=this.mediaActions.getActionTargets();a.trigger("show:modal",new f({item:e[0],items:e}))},onDelete:function(){this.ui.deleteBtn.isDisabled()||o.execute("deleteItems",{items:this.mediaActions.getActionTargets(),skipRedirect:!0})}});return g}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){
var n,s;n=[i(1018),i(2),i(6),i(100),i(708),i(712),i(709),i(710)],s=function(e,t,i,n,s,a,r,o){"use strict";var l={alerts:s,sync:a,conversion:r,nowPlaying:o},c=i.Layout.extend({className:"container",template:e,ui:{conversionBadge:".conversion-btn > .badge",nowPlayingBadge:".now-playing-btn > .badge"},regions:{container:".activity-container"},initialize:function(e){this.options=e,this.subset=e.subset||"alerts";var t=new n([],{server:this.model,persistInCache:!0});this.subsets={conversion:t,nowPlaying:this.model.get("sessions")
},this.listenTo(this.subsets.conversion,"reset add remove",this.updateBadges),this.listenTo(this.subsets.nowPlaying,"reset add remove",this.updateBadges)},serializeData:function(){return{subset:this.subset}},updateBadges:function(){var e={conversion:this.subsets.conversion.length,nowPlaying:this.subsets.nowPlaying.length};t.each(t.keys(e),function(t){var i=this.ui[t+"Badge"];i.text(e[t]),i.toggleClass("hidden",0===e[t])},this)},onRender:function(){var e=l[this.subset];this.container.show(new e(this.options)),
this.updateBadges()}});return c}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1019),i(6),i(7),i(5),i(9),i(104),i(771)],s=function(e,t,i,n,s,a,r){"use strict";var o=t.Layout.extend({className:"alerts-container",template:e,ui:{pageCount:".page-count",previousBtn:".previous-btn",nextBtn:".next-btn"},regions:{serverDropdown:".filter-bar",list:".alert-list-container"},modelEvents:{"change:shared":"onSharedChange"},collectionEvents:{add:"onAlertAdd"},events:{"click .previous-btn":"onPreviousClick",
"click .next-btn":"onNextClick"},onlyAfterRender:["onAlertAdd"],initialize:function(){this.shared=this.model.get("shared"),this.page=1,this.listCollection=this.collection.clone(this.collection.page(this.page,{reverse:!0})),this.listCollection.stopListening(),s.set("primaryServer",this.model),this.listenTo(s,"change:primaryServer",this.onPrimaryServerChange)},serializeData:function(){var e=this.collection.pages();return{shared:this.shared,page:this.page,pages:e,enablePrevious:this.page>1,enableNext:this.page<e
}},updatePages:function(){var e=this.collection.pages();this.ui.pageCount.text(i("{1} of {2}",this.page,e)),this.ui.previousBtn.toggleClass("disabled",this.page<2),this.ui.nextBtn.toggleClass("disabled",this.page>=e)},updateList:function(){this.listCollection.reset(this.collection.page(this.page,{reverse:!0}))},onRender:function(){this.serverDropdown.append(new a),this.shared||this.list.append(new r({collection:this.listCollection}))},onPrimaryServerChange:function(e,t){t&&n.trigger("navigate","alerts",{
serverID:t.id})},onSharedChange:function(e,t){this.shared=t,this.render()},onAlertAdd:function(e,t){this.shared||(this.updatePages(),this.updateList())},onPreviousClick:function(e){e.preventDefault(),this.ui.previousBtn.isDisabled()||(this.page--,this.updatePages(),this.updateList())},onNextClick:function(e){e.preventDefault(),this.ui.nextBtn.isDisabled()||(this.page++,this.updatePages(),this.updateList())}});return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1020),i(2),i(6),i(7),i(5),i(9),i(66),i(199),i(448),i(104),i(780),i(781)],
s=function(e,t,i,n,s,a,r,o,l,c,u,d){"use strict";var h=i.Layout.extend({className:"conversion-container",template:e,ui:{filterBar:".filter-bar",pauseBtn:".pause-btn",resumeBtn:".resume-btn",divider:".conversion-queue-divider"},regions:{filterBar:".filter-bar",upNextList:".conversion-queue-up-next-list-region",afterUpNextList:".conversion-queue-after-up-next-list-region",emptyRegion:".conversion-queue-empty-region"},events:{"click .pause-btn":"onTogglePauseClick","click .resume-btn":"onTogglePauseClick"
},initialize:function(e){this.playQueue=e.playQueue,this.transcodeJobs=e.transcodeJobs,this.generators=e.generators,this.items=this.playQueue.get("collection"),this.upNextItems=new o(this.items,{playQueue:this.playQueue,includeSelectedItem:!0}),this.afterUpNextItems=new l(this.items,{playQueue:this.playQueue}),this.settings=this.model.get("settings"),this.pausedSetting=this.settings.get("BackgroundQueueIdlePaused"),a.set("primaryServer",this.model),this.listenTo(a,"change:primaryServer",this.onPrimaryServerChange),
this.listenTo(this.upNextItems,"reset add remove",this.onUpNextChange),this.listenTo(this.afterUpNextItems,"reset add remove",this.onAfterUpNextChange)},serializeData:function(){return{serverID:this.model.id,shouldShowList:this.model.supports("streamReady"),shouldShowDivider:!!this.afterUpNextItems.length,minServerVersion:r.streamReady,hasPausedSetting:!!this.pausedSetting,isPaused:this.pausedSetting&&this.pausedSetting.get("value"),errorMessage:this.getErrorMessage()}},toggleEmptyView:function(){
var e=this.upNextItems.length+this.afterUpNextItems.length>0;e?this.emptyRegion.close():this.emptyRegion.show(new d({model:this.model})),this.$el.toggleClass("is-empty",!e),this.ui.filterBar.toggleClass("hide-actions",!e)},getErrorMessage:function(){var e=this.generators.reduce(function(e,t){var i=t.get("Status");return"failed"===i.state?e+=Math.max(i.itemsCount,1):i.itemsFailedCount&&(e+=i.itemsFailedCount),e},0);return e?1===e?n("There was a problem converting 1 item."):n("There were problems converting {1} items.",e):void 0;
},onRender:function(){this.filterBar.append(new c);var e={playQueue:this.playQueue},i={playQueue:this.playQueue,transcodeJobs:this.transcodeJobs,pausedSetting:this.pausedSetting};this.upNextList.show(new u(t.extend({},e,{collection:this.upNextItems,itemViewOptions:i,sortableOptions:{sort:!0,group:{name:"upNext",pull:!1,put:["afterUpNext"]}}}))),this.afterUpNextList.show(new u(t.extend({},e,{collection:this.afterUpNextItems,itemViewOptions:t.extend({},i,{hideDragHandle:!0}),sortableOptions:{sort:!1,
group:{name:"afterUpNext",pull:!0,put:!1}}}))),this.toggleEmptyView()},onClose:function(){this.upNextItems.destroy(),this.afterUpNextItems.destroy()},onPrimaryServerChange:function(e,t){t&&s.trigger("navigate","conversion",{serverID:t.id})},onUpNextChange:function(){this.toggleEmptyView()},onAfterUpNextChange:function(){this.ui.divider.toggleClass("hidden",!this.afterUpNextItems.length),this.toggleEmptyView()},onTogglePauseClick:function(e){e.preventDefault();var t=this.pausedSetting.get("value");
this.ui.pauseBtn.toggleClass("hidden",!t),this.ui.resumeBtn.toggleClass("hidden",t),this.pausedSetting.set("value",!t),this.settings.first().save(this.pausedSetting.id,t?0:1)}});return h}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1021),i(6),i(5),i(9),i(66),i(104),i(773)],s=function(e,t,i,n,s,a,r){"use strict";var o=t.Layout.extend({className:"now-playing-container",template:e,regions:{filterBar:".filter-bar",list:".sessions-list-container"},modelEvents:{"change:shared":"onSharedChange"
},shouldShowList:function(){return!this.shared&&!this.synced&&this.supported},initialize:function(e){this.shared=this.model.get("shared"),this.synced=!this.model.get("isFullServer"),this.supported=this.model.supports("publicNowPlaying")||this.model.get("myPlexSubscription"),n.set("primaryServer",this.model),this.listenTo(n,"change:primaryServer",this.onPrimaryServerChange)},serializeData:function(){return{shouldShowList:this.shouldShowList(),shared:this.shared,synced:this.synced,minServerVersion:s.publicNowPlaying
}},onRender:function(){this.filterBar.append(new a),this.shouldShowList()&&this.list.show(new r({collection:this.collection}))},onPrimaryServerChange:function(e,t){t&&i.trigger("navigate","nowPlaying",{serverID:t.id})},onSharedChange:function(e,t){this.shared=t,this.render()}});return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1022),i(6),i(215),i(776)],s=function(e,t,i,n){"use strict";var s=t.Layout.extend({className:"sync-device-items-container",template:e,ui:{loading:".row-loading",
empty:".sync-empty-message"},regions:{list:".sync-item-list-container"},onlyAfterRender:["onSyncItemsReset"],initialize:function(e){this.server=e.server,this.collection=new i([],{server:this.server,device:this.model});var t=this.model.get("syncItems");this.listenTo(t,{reset:this.onSyncItemsReset}),this.listenTo(this.collection,{reset:this.onSyncItemsChange,remove:this.onSyncItemsChange}),t.fetch({reset:!0,scope:"page"})},onRender:function(){this.list.show(new n({collection:this.collection,itemViewOptions:{
server:this.server}}))},onSyncItemsReset:function(e){this.ui.loading.addClass("hidden"),this.collection.reset(e.filterByServer(this.server.id).models)},onSyncItemsChange:function(){this.ui.empty.toggleClass("hidden",!!this.collection.length)}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1023),i(2),i(4),i(6),i(7),i(5),i(34),i(11),i(9),i(104),i(711)],s=function(e,t,i,n,s,a,r,o,l,c,u){"use strict";var d=n.Layout.extend({className:"sync-container",template:e,transcodeJobDelay:2e3,
ui:{devices:".nav a"},regions:{filterBar:".filter-bar",container:".sync-device-container"},modelEvents:{"change:shared":"onSharedChange"},events:{"click .nav a":"onDeviceClick","click .edit-btn":"onEditClick","click .refresh-btn":"onRefreshClick","click .cloud-sync-settings-btn":"onCloudSyncSettingsClick"},initialize:function(e){this.selectedDevice=e.selectedDevice,this.user=l.get("user"),this.shared=this.model.get("shared"),this.transcodeJobs=this.model.get("transcodeJobs"),this.hasPlexPass=this.model.get("myPlexSubscription"),
this.signedIn="ok"===this.model.get("myPlexSigninState"),l.set("primaryServer",this.model),this.listenTo(l,"change:primaryServer",this.onPrimaryServerChange),this.collection.length&&(this.selectedDevice||(this.selectedDevice=this.collection.first()),this.fetchTranscodeJobs())},serializeData:function(){return{shared:this.shared,hasTouchScreen:r.hasTouchScreen,signedIn:this.signedIn,hasPlexPass:this.hasPlexPass,selectedDevice:this.selectedDevice?this.selectedDevice.toJSON():null,devices:this.collection.toJSON(),
plexPassInfo:this.getPlexPassInfo()}},fetchTranscodeJobs:function(){this.transcodeJobs.fetch({reset:!0,scope:"page"}),this.transcodeJobTimeout=setTimeout(t.bind(this.fetchTranscodeJobs,this),this.transcodeJobDelay)},showList:function(){this.selectedDevice?this.container.show(new u({model:this.selectedDevice,server:this.model})):this.container.close()},getPlexPassInfo:function(){return this.signedIn||this.shared?{url:this.user.server.get("plexPassUrl"),message:s("The server needs a Plex Pass to use sync."),
buttonText:s("Learn More"),target:"_blank",showButton:!this.shared}:{url:"#!/settings/server",message:s("The server needs to be signed in with a Plex Pass to use sync."),buttonText:s("Sign In"),target:"_self",showButton:!0}},onRender:function(){this.filterBar.append(new c({showSharedServers:!0})),this.hasPlexPass&&this.showList()},onClose:function(){clearTimeout(this.transcodeJobTimeout)},onPrimaryServerChange:function(e,t){t&&a.trigger("navigate","sync",{serverID:t.id})},onSharedChange:function(e,t){
this.shared=t,this.render()},onDeviceClick:function(e){e.preventDefault();var t=i(e.currentTarget),n=t.data("id");this.ui.devices.removeClass("selected"),t.addClass("selected"),this.selectedDevice=this.collection.get(n),this.showList()},onEditClick:function(e){e.preventDefault(),i(e.currentTarget).toggleClass("selected"),this.$el.toggleClass("force-hover")},onRefreshClick:function(e){e.preventDefault();var t=o.execute("refreshSyncItems",{server:this.model});this.selectedDevice&&t.always(this.whenRendered(function(){
var e=this.selectedDevice.get("syncItems");e.fetch({reset:!0,scope:"page"})}))},onCloudSyncSettingsClick:function(e){e.preventDefault(),e.stopImmediatePropagation();var t=l.get("user");window.open(t.server.get("cloudSyncUrl"))}});return d}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1026),i(2),i(4),i(7),i(5),i(17),i(126),i(63)],s=function(e,t,i,n,s,a,r,o){"use strict";var l=r.extend({className:"premium-music-alert-bar alert-bar notify",template:e,events:t.extend({"click .create-link":"onCreateClick"
},r.prototype.events),onCreateClick:function(e){e.preventDefault();var i=this.options.seed,a=t.extend({type:"music",title:n("Premium {1}",i.get("title")),language:i.get("language"),locations:i.get("locations").toJSON()});s.trigger("show:modal",new o({server:this.model,seedAttrs:a,redirect:!0})),this.hide()},onCloseClick:function(e){r.prototype.onCloseClick.apply(this,arguments),a.save("hasDismissedPremiumMusicAlert",!0)}});return l}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;
n=[i(1027),i(2),i(5),i(17),i(11),i(9),i(126)],s=function(e,t,i,n,s,a,r){"use strict";var o=r.extend({className:"alert-bar notify",template:e,events:t.extend({"click .download-link":"onDownloadClick","click .install-link":"onInstallClick"},r.prototype.events),initialize:function(){this.server=this.model.server},serializeData:function(){var e=a.get("user").server;return{state:this.model.get("state"),downloadURL:this.model.get("downloadURL")||e.get("appsUrl")}},onDownloadClick:function(e){e.preventDefault(),
s.execute("checkForServerUpdates",{server:this.server,download:!0,initialState:"downloading"}),i.trigger("navigate","serverSettings",{serverID:this.server.id})},onInstallClick:function(e){e.preventDefault(),this.model.set("shouldInstall",!0),i.trigger("navigate","serverSettings",{serverID:this.server.id})},onCloseClick:function(e){r.prototype.onCloseClick.apply(this,arguments);var t=this.model.get("shortVersion")||"unknown";n.save("serverUpdateDismissedVersion",t)}});return o}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(1028),i(2),i(6),i(5)],s=function(e,t,i,n){"use strict";var s=i.ItemView.extend({className:"alert alert-status transition-out",template:e,coolDown:!1,alertDuration:5e3,coolDownDuration:5e3,ui:{status:".status"},events:{mouseover:"onMouseOver"},onlyAfterRender:["onShowStatus"],initialize:function(e){t.bindAll(this,"hide"),this.listenTo(n,"show:status",this.onShowStatus)},hide:function(){this.$el.addClass("transition-out")},onShowStatus:function(e,t){this.coolDown||(this.server=e,
this.ui.status.text(t),this.$el.removeClass("transition-out"),this.inactivityTimeout=clearTimeout(this.inactivityTimeout),this.inactivityTimeout=setTimeout(this.hide,this.alertDuration))},onMouseOver:function(e){this.inactivityTimeout=clearTimeout(this.inactivityTimeout),this.hide(),this.coolDown=!0,setTimeout(t.bind(function(){this.coolDown=!1},this),this.coolDownDuration)}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1029),i(2),i(6),i(5),i(93),i(828)],s=function(e,t,i,n,s,a){
"use strict";var r=i.Layout.extend({className:"action-bar alpha-bar",template:e,regions:{list:".alpha-bar-list"},modelEvents:{"change:currentFilters":"onListRefresh","socket:timeline":"onTimeline"},collectionEvents:{reset:"onReset"},initialize:function(e){this.listenTo(n,"resize",this.onResize),this.collection.clear(),this.updateCollection(),this.debouncedUpdateCollection=t.debounce(this.updateCollection,2e3)},measure:function(){this.updateContainerHeight(),this.updateLineHeight()},updateContainerHeight:function(){
this.containerHeight=this.$el.height()},updateLineHeight:function(){var e=this.collection.length;if(e){var t=this.containerHeight/e;this.$el.css("line-height",t+"px")}},updateCollection:function(){this.collection.fetch({reset:!0,scope:"page"})},onRender:function(){this.list.append(new a({collection:this.collection}),this.$el),t.defer(t.bind(this.measure,this))},onListRefresh:function(){this.list.currentView.$el.addClass("hidden"),this.updateCollection()},onReset:function(e){return e.length<10?(this.$el.addClass("hidden"),
void n.trigger("hide:bar","alphabar",{preserve:!0})):(this.containerHeight&&this.updateLineHeight(),this.$el.removeClass("hidden"),this.list.currentView.$el.removeClass("hidden"),void n.trigger("show:bar","alphabar"))},onResize:function(){this.updateContainerHeight(),this.updateLineHeight()},onTimeline:function(e){(e.state===s.CREATED||e.state===s.DELETED)&&this.debouncedUpdateCollection()}});return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1030),i(2),i(4),i(6),i(5),i(65),i(129)],
s=function(e,t,i,n,s,a,r){"use strict";var o=n.Layout.extend({className:"breadcrumb-bar",template:e,ui:{listSelectedIcons:"#channel-list-dropdown .dropdown-selected-icon"},events:{"click .settings-btn":"onSettingsClick","click .list-btn":"onListClick"},initialize:function(e){this.currentListType=e.currentListType,this.settingsKey=this.model.get("settingsKey"),!this.settingsKey&&this.model.channel&&(this.settingsKey=this.model.channel.get("settingsKey")),this.shared=this.model.server.get("shared");
},serializeData:function(){var e=this.model.channel||this.model,t=e?e.get("title"):this.model.get("title"),i=e?e.id:e.get("identifier"),n="#!/server/"+encodeURIComponent(this.model.server.id);n+="/channel/"+encodeURIComponent(i);var s=this.model.channel?this.model.get("title"):null;return{channelTitle:t,channelUrl:n,title:s,totalSize:this.model.get("items").length,showSettings:!!this.settingsKey&&!this.shared,listType:this.currentListType}},onSettingsClick:function(e){e.preventDefault();var i=new a([],{
server:this.model.server,url:this.settingsKey});i.fetch().done(t.bind(function(){s.trigger("show:modal",new r({model:this.model.channel||this.model,collection:i}))},this))},onListClick:function(e){e.preventDefault();var t=i(e.currentTarget),n=t.data("type");this.trigger("change:listType",n),this.ui.listSelectedIcons.addClass("hidden"),t.find(".dropdown-selected-icon").removeClass("hidden")}});return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1031),i(4),i(6),i(5),i(17),i(35),i(741)],
s=function(e,t,i,n,s,a,r){"use strict";var o=i.Layout.extend({className:"details-breadcrumb-bar breadcrumb-bar",template:e,ui:{previousBtn:".previous-btn",nextBtn:".next-btn",listSelectedIcons:"#section-list-dropdown .dropdown-selected-icon"},regions:{currentItem:".current-item",grandparentItem:".grandparent-item",siblingsDropdown:".siblings-dropdown",parentsDropdown:".parents-dropdown"},events:{"click .playlists-btn":"onPlaylistsClick","click .section-btn":"onSectionClick","click .list-btn":"onListClick",
"click .previous-btn":"onPreviousClick","click .next-btn":"onNextClick"},onlyAfterRender:["onSiblingsPopulate","onParentsPopulate"],initialize:function(e){var t=this.model.get("parentKey");if(!t)return void this.onSiblingsPopulate(!1);var i,n={server:this.model.server,section:this.model.section},s=this.parent=new a({key:t},n),r=s.populate({scope:"page"});r=r.then(function(){return i=s.get("children"),i.populate({scope:"page"})}),r.done(this.onSiblingsPopulate);var o=this.model.get("grandparentKey");
if(o){var l=this.grandparent=new a({key:o},n),c=l.populate({scope:"page"});c=c.then(function(){var e=l.get("children");return e.populate({scope:"page"})}),c.done(this.onParentsPopulate)}},serializeData:function(){var e=this.model.server,t=this.model.section,i=t||this.model.get("playlistType");return{serverID:e.id,showSectionDropdown:i,showPlaylists:this.model.server.supports("playlists"),sections:e.get("sections").toJSON(),section:t?t.toJSON():null,item:this.model.toJSON(),parent:this.parent?this.parent.toJSON():null,
grandparent:this.grandparent?this.grandparent.toJSON():null,listType:this.getListType()}},getListTypeSettingKey:function(){var e="episodeListType",t=this.model.section||this.model.server;return t.getScopedKey(e)},getListType:function(){return"season"===this.model.get("type")?s.get(this.getListTypeSettingKey())||"episode-tile-list":null},previous:function(){this.previousSibling&&n.trigger("navigate","details",{serverID:this.model.server.id,key:this.previousSibling.get("key")})},next:function(){this.nextSibling&&n.trigger("navigate","details",{
serverID:this.model.server.id,key:this.nextSibling.get("key")})},onSiblingsPopulate:function(e){if(!e)return this.currentItem.show(new r({model:this.model,isLeaf:!0})),void this.currentItem.$el.removeClass("hidden");var t=e.get(this.model.id),i=e.indexOf(t);i>0&&(this.previousSibling=e.at(i-1)),i<e.length-1&&(this.nextSibling=e.at(i+1)),this.ui.previousBtn.toggleClass("disabled",!this.previousSibling),this.ui.nextBtn.toggleClass("disabled",!this.nextSibling),this.ui.previousBtn.removeClass("hidden"),
this.ui.nextBtn.removeClass("hidden"),this.grandparent||(this.grandparentItem.show(new r({model:this.parent})),this.grandparentItem.$el.removeClass("hidden")),this.siblingsDropdown.show(new r({id:"siblings-dropdown",model:this.model,collection:e})),this.siblingsDropdown.$el.removeClass("hidden")},onParentsPopulate:function(e){this.grandparentItem.show(new r({model:this.grandparent})),this.grandparentItem.$el.removeClass("hidden"),this.parentsDropdown.show(new r({id:"parents-dropdown",model:this.parent,
collection:e})),this.parentsDropdown.$el.removeClass("hidden")},onSectionClick:function(e){e.preventDefault();var i=t(e.currentTarget),s=i.data("key");n.trigger("navigate","section",{serverID:this.model.server.id,sectionID:s})},onPlaylistsClick:function(e){e.preventDefault(),n.trigger("navigate","playlists",{serverID:this.model.server.id})},onListClick:function(e){e.preventDefault();var i=t(e.currentTarget),n=i.data("type");s.save(this.getListTypeSettingKey(),n),this.ui.listSelectedIcons.addClass("hidden"),
i.find(".dropdown-selected-icon").removeClass("hidden")},onPreviousClick:function(e){e.preventDefault(),this.previous()},onNextClick:function(e){e.preventDefault(),this.next()}});return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1032),i(6),i(5),i(266),i(744),i(865)],s=function(e,t,i,n,s,a){"use strict";var r=t.Layout.extend({className:"breadcrumb-bar",template:e,ui:{itemsBadge:".items-badge"},regions:{sectionDropdown:".breadcrumb-dropdown",typeDropdown:".breadcrumb-subset-dropdown"
},events:{"click .import-btn":"onImportClick"},initialize:function(){this.listenTo(this.model.get("items"),"reset remove add",this.onSizeChange);var e=this.model.server.get("isFullOwnedServer"),t=this.model.server.get("sections").where({type:"artist"}).length>0;this.canImportPlaylists=e&&t},serializeData:function(){return{totalSize:this.model.get("items").length,canImportPlaylists:this.canImportPlaylists}},onRender:function(){this.sectionDropdown.show(new n({model:this.model,collection:this.model.server.get("sections")
})),this.typeDropdown.show(new s({model:this.model}))},onSizeChange:function(){this.ui.itemsBadge.text(this.model.get("items").length)},onImportClick:function(e){this.limited||(e.preventDefault(),i.trigger("show:modal",new a({server:this.model.server})))}});return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1033),i(4),i(2),i(6),i(7),i(5),i(17),i(11),i(266),i(746),i(747),i(63),i(83)],s=function(e,t,i,n,s,a,r,o,l,c,u,d,h){"use strict";var p=n.Layout.extend({className:"breadcrumb-bar",
template:e,ui:{listSelectedIcons:"#section-list-dropdown .dropdown-selected-icon",itemsBadge:".items-badge",updateBtn:".update-btn"},regions:{sectionDropdown:".breadcrumb-dropdown",subsetDropdown:".breadcrumb-subset-dropdown",typeDropdown:".breadcrumb-type-dropdown"},events:{"click .list-btn":"onListClick","click .edit-btn":"onEditClick","click .share-btn":"onShareClick","click .update-btn":"onUpdateClick","click .analyze-btn":"onAnalyzeClick","click .force-refresh-btn":"onForceRefreshClick","click .empty-trash-btn":"onEmptyTrashClick",
"click .delete-btn":"onDeleteClick"},onlyAfterRender:["onTotalSizeChange"],initialize:function(){var e=this.model.get("items");this.refreshing=this.model.get("refreshing"),this.updateTitle=s("Update Library"),this.updateTitleAlt=s("Cancel Update"),this.shared=this.model.server.get("shared"),this.synced=!this.model.server.get("isFullServer"),this.limited=!(!this.shared&&!this.synced),this.listenTo(e,"change:totalSize",this.onTotalSizeChange),this.listenTo(this.model,"change:refreshing",this.onRefreshingChange),
this.listenTo(this.model,"change:currentType",this.updateListViewDropdown)},serializeData:function(){return{limited:this.limited,totalSize:this.model.get("items").totalSize,listType:r.getInstance().getSectionListType(this.model),refreshing:this.refreshing,updateTitle:this.refreshing?this.updateTitleAlt:this.updateTitle,updateTitleAlt:this.refreshing?this.updateTitle:this.updateTitleAlt}},updateListViewDropdown:function(e){i.isString(e)||(e=r.getInstance().getSectionListType(this.model)),this.ui.listSelectedIcons.each(function(n,s){
var a=t(s),r=a.closest(".list-btn").data("type");a.toggleClass("hidden",!i.isEqual(e,r))})},onRender:function(){this.$el.tooltip({selector:".breadcrumb-actions > a",container:"body",placement:"bottom"}),this.sectionDropdown.show(new l({model:this.model,collection:this.model.server.get("sections")})),this.subsetDropdown.show(new c({model:this.model.get("currentSubset"),collection:this.model.get("subsets")})),this.typeDropdown.show(new u({model:this.model,collection:this.model.get("types")}))},onTotalSizeChange:function(e,t){
var i=null==t?0:t;this.ui.itemsBadge.toggleClass("hidden",0===i),this.ui.itemsBadge.text(i)},onEditClick:function(e){e.preventDefault(),this.limited||a.trigger("show:modal",new d({server:this.model.server,model:this.model}))},onUpdateClick:function(e){e.preventDefault(),this.limited||o.execute("updateLibrary",{section:this.model,cancel:this.model.get("refreshing")})},onShareClick:function(e){e.preventDefault(),this.limited||a.trigger("show:modal",new h({defaultPaneType:"ownedServer",defaultPaneID:this.model.server.id
}))},onAnalyzeClick:function(e){e.preventDefault(),this.limited||o.execute("analyzeSection",{section:this.model})},onForceRefreshClick:function(e){e.preventDefault(),this.limited||o.execute("updateLibrary",{section:this.model,params:{force:!0}})},onEmptyTrashClick:function(e){e.preventDefault(),this.limited||o.execute("emptyTrash",{section:this.model})},onDeleteClick:function(e){e.preventDefault(),this.onDelete()},onListClick:function(e){e.preventDefault();var i=t(e.currentTarget),n=i.data("type"),s=this.model.get("currentType");
r.getInstance().saveListType(s,n),this.updateListViewDropdown(n)},onDelete:function(){if(!this.limited){var e=o.execute("deleteSection",{section:this.model});e.done(function(){a.trigger("navigate","dashboard")})}},onRefreshingChange:function(e,n){var s=this.ui.updateBtn,a=this.ui.updateBtn.attr("data-original-title");if(this.ui.updateBtn.toggleClass("active",this.model.get("refreshing")),a){var r=t(".tooltip > .tooltip-inner").html();i.contains([this.updateTitle,this.updateTitleAlt],r)&&t(".tooltip > .tooltip-inner").html(s.attr("data-title-alt")),
s.attr("data-original-title",s.attr("data-title-alt")),s.attr("data-title-alt",a)}}});return p}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1034),i(6),i(117),i(783),i(271)],s=function(e,t,i,n,s){"use strict";var a=t.Layout.extend({className:"container",template:e,regions:{list:".directory-container"},initialize:function(e){this.currentKey=e.currentKey,this.currentPath=e.currentPath,this.currentKey||(this.currentKey=this.collection.first().get("key")),this.currentPath||(this.currentPath=this.currentKey);
var t=new i([],{server:this.collection.server,url:this.currentPath});this.listenToOnce(t,"reset",this.onReset),t.fetch({reset:!0,scope:"page"})},serializeData:function(){return{directories:this.collection.toJSON(),serverID:this.collection.server.id,currentKey:this.currentKey}},onReset:function(e){var t,i={collection:e,itemViewOptions:{currentKey:this.currentKey}};t="Store:Info"===e.viewGroup?new s(i):new n(i),this.list.show(t)}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){
var n,s;n=[i(1035),i(6),i(5),i(14),i(513),i(9),i(717),i(278),i(276),i(277)],s=function(e,t,i,n,s,a,r,o,l,c){"use strict";var u=t.Layout.extend({className:"channel-container",template:e,regions:{list:".channel-list-container"},initialize:function(){var e=this.model.get("header"),t=this.model.get("message");(e||t)&&i.trigger("show:alert",{message:t||e}),this.searchKey=this.model.get("searchKey"),this.searchPlaceholder=this.model.get("title"),!this.searchKey&&this.model.channel&&(this.searchKey=this.model.channel.get("searchKey"),
this.searchPlaceholder=this.model.channel.get("title")),this.searchKey&&(a.set({searchType:"channel",searchPlaceholder:this.searchPlaceholder}),this.listenTo(i,"search:channel",this.onSearch)),this.listType=s.getListType(this.model);var n=new r({model:this.model,currentListType:this.listType});this.listenTo(n,"change:listType",this.onListTypeChange),i.trigger("show:bar","breadcrumbbar",n),i.trigger("show:background",{model:this.model,dim:!0})},getListConstructor:function(){switch(this.listType){case s.types.tileList:
return o;case s.types.detailsList:return l;default:return c}},onRender:function(){var e=this.getListConstructor();this.list.append(new e({collection:this.collection,paginated:!1}),this.$el)},onClose:function(){a.set({searchType:null,searchPlaceholder:null}),i.trigger("hide:bar","breadcrumbbar")},onSearch:function(e){if(e){var t=this.model.channel||this.model,s=t.id?t.id:t.get("identifier"),a=n.join(this.searchKey,{query:e});i.trigger("navigate","channel",{serverID:this.model.server.id,channelID:s,
key:a})}},onListTypeChange:function(e){this.listType=e,this.collection.scrollPosition=0,this.list.currentView.scrollPosition=0,this.render()}});return u}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1036),i(2),i(4),i(6),i(11),i(786)],s=function(e,t,i,n,s,a){"use strict";var r=n.Layout.extend({className:"container",template:e,ui:{navLinks:".nav a",checkUpdatesBtn:".check-updates-btn"},regions:{list:".channels-container"},events:{"click .nav a":"onNavClick","click .all-btn":"onAllClick",
"click .video-btn":"onVideoClick","click .music-btn":"onMusicClick","click .photo-btn":"onPhotoClick","click .check-updates-btn":"onCheckUpdatesClick"},initialize:function(){this.videoCollection=this.collection.filterByType("video"),this.musicCollection=this.collection.filterByType("music"),this.photoCollection=this.collection.filterByType("photos"),this.shared=this.collection.server.get("shared")},serializeData:function(){return{serverID:this.collection.server.id,allCount:this.collection.length,
videoCount:this.videoCollection.length,musicCount:this.musicCollection.length,photoCount:this.photoCollection.length,shared:this.shared}},onRender:function(){this.list.show(new a({collection:this.collection}))},onNavClick:function(e){this.ui.navLinks.removeClass("selected"),i(e.currentTarget).addClass("selected")},onAllClick:function(e){e.preventDefault(),this.list.show(new a({collection:this.collection}))},onVideoClick:function(e){e.preventDefault(),this.list.show(new a({collection:this.videoCollection
}))},onMusicClick:function(e){e.preventDefault(),this.list.show(new a({collection:this.musicCollection}))},onPhotoClick:function(e){e.preventDefault(),this.list.show(new a({collection:this.photoCollection}))},onCheckUpdatesClick:function(e){e.preventDefault();var i=this.ui.checkUpdatesBtn;if(!i.hasClass("active")){i.addClass("active");var n=s.execute("updateChannel",{server:this.collection.server});n.always(t.bind(function(){i.removeClass("active")},this))}}});return r}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(1037),i(2),i(4),i(5),i(9),i(117),i(168),i(787)],s=function(e,t,i,n,s,a,r,o){"use strict";var l=r.extend({template:e,initialize:function(e){this.listenTo(n,"resize",this.onResize),this.listenTo(s,"change:primaryServer",this.setup),this.setup()},setup:function(){var e=s.get("primaryServer");this.$el.addClass("hidden"),!e||e.get("shared")&&!e.get("allowChannelAccess")||(this.collection=new a([],{server:e,subset:"recentlyViewed",pageSize:50}),this.listenToOnce(this.collection,"reset",this.onReset),
this.collection.fetch({reset:!0,scope:"page"}))},onReset:function(e){if(e.length){this.$el.removeClass("hidden");var t=new o({collection:e,$container:this.$el});this.listenTo(t,"scroll",this.onListScroll),this.list.show(t)}}});return l}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1038),i(6),i(5),i(866)],s=function(e,t,i,n){"use strict";var s=t.ItemView.extend({className:"dashboard-empty-servers-message",template:e,events:{"click .local-server-test-link":"onLocalServerTestClick"
},serializeData:function(){return{hasSharedServers:this.options.hasSharedServers,isManagedUser:this.options.isManagedUser,bundled:!0}},onLocalServerTestClick:function(e){e.preventDefault(),i.trigger("show:modal",new n)}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1039),i(6)],s=function(e,t){"use strict";var i=t.ItemView.extend({template:e,initialize:function(e){this.type=e.type,this.helpRoute=e.helpRoute},serializeData:function(){return{type:this.type,helpRoute:this.helpRoute,
defaultTarget:"_self"}}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1041),i(2),i(4),i(5),i(9),i(217),i(168),i(275),i(726)],s=function(e,t,i,n,s,a,r,o,l){"use strict";var c=r.extend({template:e,initialize:function(e){this.type=e.key,this.user=s.get("user"),this.collection=new a([],{server:this.user.server,parent:this.user,key:e.key,subset:"unwatched"}),this.label=this.collection.label,this.listenTo(n,"resize",this.onResize),this.listenTo(this.user,"change:signedIn",this.setup),
this.setup()},setup:function(){this.$el.addClass("hidden"),this.user.get("signedIn")&&!this.user.get("restricted")&&(this.listenToOnce(this.collection,"reset",this.onReset),this.collection.fetch({reset:!0,scope:"page"}))},serializeData:function(){return{label:this.label,helpRoute:this.collection.helpRoute,playlistRoute:this.collection.playlistRoute,defaultTarget:"_self"}},onReset:function(e){var t=!this.collection.length&&"queue"===this.type;if(this.collection.length||t){this.$el.removeClass("hidden");
var i;i=t?new l({type:this.type,helpRoute:this.collection.helpRoute}):new o({className:o.prototype.className+" show-context",collection:e,$container:this.$el}),this.listenTo(i,"scroll",this.onListScroll),this.list.show(i)}}});return c}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1042),i(6),i(5),i(17),i(9),i(947),i(168),i(724),i(727)],s=function(e,t,i,n,s,a,r,o,l){"use strict";var c=t.Layout.extend({className:"priorities-container",template:e,ui:{1:".priority-1-container",
2:".priority-2-container",3:".priority-3-container",4:".priority-4-container",5:".priority-5-container"},regions:{onDeck:".on-deck-container",recentlyAdded:".recently-added-container",channels:".channels-container",queue:".queue-container",recommendations:".recommendations-container"},initialize:function(){this.primaryServer=s.get("primaryServer"),this.onDeckPriority=n.get("dashboardPriorityOnDeck"),this.recentlyAddedPriority=n.get("dashboardPriorityRecentlyAdded"),this.channelsPriority=n.get("dashboardPriorityChannels"),
this.queuePriority=n.get("dashboardPriorityQueue"),this.recommendationsPriority=n.get("dashboardPriorityRecommendations"),i.trigger("show:bar","sidebar",new a),this.listenTo(s,"change:primaryServer",this.onPrimaryServerChange),this.primaryServer&&this.listenTo(this.primaryServer,"change:shared",this.onPrimaryServerSharedChange)},onRender:function(){n.get("dashboardOnDeckEnabled")&&this.onDeck.append(new r({key:"onDeck"}),this.ui[this.onDeckPriority]),n.get("dashboardRecentlyAddedEnabled")&&this.recentlyAdded.append(new r({
key:"recentlyAdded"}),this.ui[this.recentlyAddedPriority]),n.get("dashboardChannelsEnabled")&&this.channels.append(new o,this.ui[this.channelsPriority]),n.get("dashboardQueueEnabled")&&this.queue.append(new l({key:"queue"}),this.ui[this.queuePriority]),n.get("dashboardRecommendationsEnabled")&&this.recommendations.append(new l({key:"recommendations"}),this.ui[this.recommendationsPriority])},onClose:function(){i.trigger("hide:bar","sidebar")},onPrimaryServerChange:function(e,t){this.primaryServer&&this.stopListening(this.primaryServer),
this.primaryServer=t,this.primaryServer&&this.listenTo(this.primaryServer,"change:shared",this.onPrimaryServerSharedChange)},onPrimaryServerSharedChange:function(e,t){i.trigger("navigate:refresh")}});return c}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1043),i(422),i(51),i(61),i(62),i(30),i(821)],s=function(e,t,i,n,s,a,r){"use strict";var o=i.extend({mixins:t,className:"album-details-row details-row",template:e,allowMirror:!0,initialize:function(){i.prototype.initialize.apply(this,arguments),
this.ListConstructor=r,this.listItemViewOptions={artistTitle:this.model.get("parentTitle"),mediaActions:this.mediaActions},this.starRatingView=new n({model:this.model}),this.summaryView=new s({model:this.model}),this.posterImage=new a({model:this.model,type:this.model.get("type"),width:this.posterWidth})}});return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1044),i(2),i(5),i(93),i(423),i(9),i(51),i(739),i(62),i(30),i(793),i(791),i(274)],s=function(e,t,i,n,s,a,r,o,l,c,u,d,h){
"use strict";var p=r.extend({mixins:s,className:"artist-details-row details-row",template:e,allowMirror:!0,ui:t.extend({concertRegion:".concert-region",popularTracksRegion:".popular-tracks-region",extrasRegion:".extras-region",similarArtistsRegion:".similar-artists-region"},r.prototype.ui),regions:t.extend({concert:".concert-region",popularTracksList:".popular-tracks-region",extrasList:".extras-region",similarArtistsList:".similar-artists-region"},r.prototype.regions),modelEvents:{"socket:timeline":"onTimeline",
"change:concerts":"onConcertsChange","change:related":"onRelatedChange"},initialize:function(){r.prototype.initialize.apply(this,arguments),this.bindAllWhenRendered("updateConcerts","showConcert","updatePopularTracks","updateExtras","updateSimilarArtists","showSimilarArtistsList"),this.ListConstructor=d,this.listItemViewOptions={mediaActions:this.mediaActions},this.popularLeaves=this.model.get("popularLeaves"),this.popularLeaves&&this.listenTo(this.popularLeaves,"reset add remove",this.updatePopularTracks),
this.extras=this.model.get("extras"),this.extras&&this.listenTo(this.extras,"reset add remove",this.updateExtras),this.concerts=this.model.get("concerts"),this.concerts&&this.listenTo(this.concerts,"reset add remove",this.showConcert),this.related=this.model.get("related"),this.related&&this.listenTo(this.related,"reset add remove",this.showSimilarArtistsList),this.summaryView=new l({model:this.model}),this.posterImage=new c({model:this.model,type:this.model.get("type"),width:this.posterWidth})},
updatePopularTracks:function(){this.ui.popularTracksRegion.toggleClass("hidden",!(this.popularLeaves&&this.popularLeaves.length))},updateExtras:function(){this.ui.extrasRegion.toggleClass("hidden",!(this.extras&&this.extras.length))},updateConcerts:function(){this.ui.concertRegion.toggleClass("hidden",!(this.concerts&&this.concerts.length))},showConcert:function(){var e=this.concerts&&this.concerts.first();e?this.concert.append(new o({model:e})):this.concert.close(),this.updateConcerts()},updateSimilarArtists:function(){
this.ui.similarArtistsRegion.toggleClass("hidden",!(this.similarArtists&&this.similarArtists.length))},showSimilarArtistsList:function(){if(this.similarArtists&&(this.stopListening(this.similarArtists),this.similarArtists=null),this.related){var e=this.related.get("artist.similar");e&&(this.similarArtists=e.get("children"),this.similarArtistsList.append(new d({collection:this.similarArtists})),this.listenTo(this.similarArtists,"reset add remove",this.updateSimilarArtists))}this.updateSimilarArtists();
},onRender:function(){r.prototype.onRender.apply(this,arguments),this.popularLeaves&&(this.popularTracksList.append(new u({collection:this.popularLeaves})),this.updatePopularTracks()),this.collection.populate({scope:"page"}).then(this.whenRendered(function(){this.extras&&(this.extrasList.append(new h({collection:this.extras})),this.updateExtras()),this.showConcert(),this.showSimilarArtistsList()}))},onTimeline:function(e){e.state===n.DELETED&&i.trigger("navigate","section",{serverID:this.model.server.id,
sectionID:this.model.section.id})},onConcertsChange:function(e,t){this.concerts&&this.stopListening(this.concerts),this.concerts=t,t&&this.listenTo(t,"reset add remove",this.showConcert),this.showConcert()},onRelatedChange:function(e,t){this.related&&this.stopListening(this.related),this.related=t,t&&this.listenTo(t,"reset add remove",this.showSimilarArtistsList),this.showSimilarArtistsList()}});return p}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1045),i(424),i(51),i(61),i(62),i(169),i(30),i(124)],
s=function(e,t,i,n,s,a,r,o){"use strict";var l=i.extend({mixins:t,className:"clip-details-row details-row",template:e,allowMirror:!0,initialize:function(){i.prototype.initialize.apply(this,arguments),this.starRatingView=new n({model:this.model,disabled:!0}),this.summaryView=new s({model:this.model}),this.audioDropdown=new a({type:"audio",model:this.model}),this.subtitlesDropdown=new a({type:"subtitles",model:this.model}),this.posterImage=new r({model:this.model,type:this.model.get("type"),width:this.posterWidth
}),this.contentRatingFlag=new o({model:this.model,modelAttribute:"contentRating",className:"content-rating-flag",width:70,height:30}),this.videoResolutionFlag=new o({model:this.model,flag:"videoResolution",className:"media-flag",width:100,height:20}),this.audioCodecFlag=new o({model:this.model,flag:"audioCodec",className:"media-flag",width:100,height:20}),this.audioChannelsFlag=new o({model:this.model,flag:"audioChannels",className:"media-flag",width:100,height:20}),this.studioFlag=new o({model:this.model,
modelAttribute:"studio",className:"studio-flag",width:200,height:40})}});return l}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1047),i(425),i(51),i(61),i(62),i(169),i(30),i(124)],s=function(e,t,i,n,s,a,r,o){"use strict";var l=i.extend({mixins:t,className:"episode-details-row details-row",template:e,allowMirror:!0,initialize:function(){i.prototype.initialize.apply(this,arguments),this.starRatingView=new n({model:this.model}),this.summaryView=new s({model:this.model}),this.audioDropdown=new a({
type:"audio",model:this.model}),this.subtitlesDropdown=new a({type:"subtitles",model:this.model}),this.posterImage=new r({model:this.model,type:this.model.get("type"),width:this.posterWidth}),this.contentRatingFlag=new o({model:this.model,modelAttribute:"contentRating",className:"content-rating-flag",width:70,height:30}),this.videoResolutionFlag=new o({model:this.model,flag:"videoResolution",className:"media-flag",width:100,height:20}),this.audioCodecFlag=new o({model:this.model,flag:"audioCodec",
className:"media-flag",width:100,height:20}),this.audioChannelsFlag=new o({model:this.model,flag:"audioChannels",className:"media-flag",width:100,height:20})}});return l}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1048),i(2),i(426),i(51),i(61),i(62),i(169),i(30),i(124),i(274)],s=function(e,t,i,n,s,a,r,o,l,c){"use strict";var u=n.extend({mixins:i,className:"movie-details-row details-row",template:e,allowMirror:!0,ui:t.extend({extrasRegion:".extras-region"},n.prototype.ui),
regions:t.extend({extrasList:".extras-region"},n.prototype.regions),initialize:function(){n.prototype.initialize.apply(this,arguments),this.extras=this.model.get("extras"),this.extras&&this.listenTo(this.extras,"reset add remove",this.updateExtras),this.starRatingView=new s({model:this.model}),this.summaryView=new a({model:this.model}),this.audioDropdown=new r({type:"audio",model:this.model}),this.subtitlesDropdown=new r({type:"subtitles",model:this.model}),this.posterImage=new o({model:this.model,
type:this.model.get("type"),width:this.posterWidth}),this.contentRatingFlag=new l({model:this.model,modelAttribute:"contentRating",className:"content-rating-flag",width:70,height:30}),this.videoResolutionFlag=new l({model:this.model,flag:"videoResolution",className:"media-flag",width:100,height:20}),this.audioCodecFlag=new l({model:this.model,flag:"audioCodec",className:"media-flag",width:100,height:20}),this.audioChannelsFlag=new l({model:this.model,flag:"audioChannels",className:"media-flag",width:100,
height:20}),this.studioFlag=new l({model:this.model,modelAttribute:"studio",className:"studio-flag",width:200,height:40})},updateExtras:function(){this.ui.extrasRegion.toggleClass("hidden",!(this.extras&&this.extras.length))},onRender:function(){n.prototype.onRender.apply(this,arguments),this.extras&&(this.extrasList.append(new c({collection:this.extras})),this.updateExtras())}});return u}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1049),i(2),i(51),i(62),i(812)],s=function(e,t,i,n,s){
"use strict";var a=i.extend({className:"photo-album-details-row details-row",template:e,initialize:function(){i.prototype.initialize.apply(this,arguments),this.ListConstructor=s,this.summaryView=new n({model:this.model})},bindings:t.pick(i.prototype.defaultBindings,[".item-title"])});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1050),i(2),i(7),i(97),i(150),i(52),i(51),i(128),i(815)],s=function(e,t,i,n,s,a,r,o,l){"use strict";var c=r.extend({className:"playlist-details-row details-row",
template:e,posterWidth:200,pageSize:50,compositeOptions:{audio:{media:"art",stripRatio:n.ratios.landscape,posterRatio:n.ratios.square},photo:{media:"thumb",stripRatio:n.ratios.square,posterRatio:n.ratios.square},video:{media:"thumb",stripRatio:n.ratios.portrait,posterRatio:n.ratios.portrait}},ui:t.extend({sideStrip:".item-side-strip"},r.prototype.ui),bindings:t.extend(t.pick(a.defaultBindings,[".item-title",".item-summary"]),{".item-duration":{modelAttribute:"duration",autohide:!0,formatter:function(e){
return e?s(e):0}},".item-count":{modelAttribute:"leafCount",formatter:function(e){return 0===e?i("This playlist has no items."):1===e?i("1 Item"):i("{1} Items",e)}},".no-items":{modelAttribute:"leafCount",manual:!0,autohide:!0,formatter:function(e){return 0===e}},".loading-container":{model:"progress",modelAttribute:"loading",manual:!0,autohide:!0},".error-text":{model:"progress",modelAttribute:"failed",manual:!0,autohide:!0}}),serializeData:function(){var e=this.model.get("playlistType");return{
smart:this.model.get("smart"),hasComposite:"audio"===e||"photo"===e,type:e}},initialize:function(){r.prototype.initialize.apply(this,arguments),this.ListConstructor=l,this.listItemViewOptions={canEdit:!this.model.get("smart")};var e=this.compositeOptions[this.model.get("playlistType")];this.posterWidth=200,this.sideStripImage=new o({model:this.model,media:e.media,width:this.posterWidth,height:this.posterWidth/e.stripRatio*16,columns:1,rows:16,unique:!0,noPlaceholder:!0}),this.posterImage=new o({model:this.model,
width:this.posterWidth,height:this.posterWidth/e.posterRatio,noPlaceholder:!0})},onRender:function(){r.prototype.onRender.apply(this,arguments),this.sideStripImage.setElement(this.ui.sideStrip)},onClose:function(){return this.posterImage&&this.sideStripImage.close(),r.prototype.onClose.apply(this,arguments)}});return c}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1051),i(17),i(51),i(62),i(801),i(797),i(799)],s=function(e,t,i,n,s,a,r){"use strict";var o=i.extend({className:"season-details-row details-row",
template:e,allowMirror:!0,initialize:function(){i.prototype.initialize.apply(this,arguments),this.ListConstructor=this.getListConstructor(),this.summaryView=new n({model:this.model}),this.listenTo(t.getInstance(),"change:"+this.getListTypeSettingKey(),this.onListTypeChange)},getListTypeSettingKey:function(){var e="episodeListType",t=this.model.section||this.model.server;return t.getScopedKey(e)},getListConstructor:function(e){switch(e||(e=t.get(this.getListTypeSettingKey())),e){case"episode-details-list":
return a;case"episode-list":return r;default:return s}},bindings:{".show-title":{modelAttribute:"parentTitle"},".season-title":{modelAttribute:"title"}},onListTypeChange:function(e,t){this.ListConstructor=this.getListConstructor(t),this.render()}});return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1052),i(427),i(51),i(61),i(62),i(30),i(124),i(817)],s=function(e,t,i,n,s,a,r,o){"use strict";var l=i.extend({mixins:t,className:"show-details-row details-row",template:e,allowMirror:!0,
initialize:function(){i.prototype.initialize.apply(this,arguments),this.ListConstructor=o,this.starRatingView=new n({model:this.model}),this.summaryView=new s({model:this.model}),this.posterImage=new a({model:this.model,type:this.model.get("type"),width:this.posterWidth}),this.contentRatingFlag=new r({model:this.model,modelAttribute:"contentRating",className:"show-content-rating content-rating-flag",width:70,height:30}),this.studioFlag=new r({model:this.model,modelAttribute:"studio",className:"show-studio studio-flag",
width:200,height:40})}});return l}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1053),i(6)],s=function(e,t){"use strict";var i=t.ItemView.extend({className:"container",template:e});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1054),i(2),i(6),i(12)],s=function(e,t,i,n){"use strict";var s=i.ItemView.extend({className:"concert",template:e,bindings:{".concert-link":{modelAttribute:"url",manual:!0,formatter:function(e,t){t.attr("href",e)}},".concert-month":{
modelAttribute:"at",formatter:function(e){return n.unix(e).format("MMM")}},".concert-day":{modelAttribute:"at",formatter:function(e){return n.unix(e).format("DD")}},".concert-name":{modelAttribute:"tag"},".concert-venue":{modelAttribute:"venue"},".concert-city":{modelAttribute:"city",modelListeners:["city","country"],formatter:function(e){var i=t.compact([e,this.model.get("country")]);return i.join(", ")}}}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1056),i(4),i(6),i(11)],
s=function(e,t,i,n){"use strict";var s=i.ItemView.extend({id:"auto-match-dropdown",tagName:"span",className:"dropdown",template:e,collectionEvents:{reset:"render"},events:{"click .auto-match-agent":"onClick"},serializeData:function(){return{agents:this.collection.toJSON()}},onClick:function(e){e.preventDefault();var i=t(e.currentTarget).data("id"),s=this.collection.get(i);n.execute("autoMatch",{item:this.model,agent:s})}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;
n=[i(1057),i(4),i(6),i(5)],s=function(e,t,i,n){"use strict";var s=i.ItemView.extend({tagName:"span",className:"details-breadcrumb dropdown",template:e,events:{"click .breadcrumb-btn":"onClick"},initialize:function(e){this.listenTo(this.model,"change:title",this.render),this.isLeaf=e&&e.isLeaf||!1},serializeData:function(){var e=this.collection&&this.collection.length>1;return{id:this.id,item:this.model.toJSON(),items:e?this.collection.toJSON():null,hasDetails:this.isLeaf,showDropdown:e}},onClick:function(e){
e.preventDefault();var i=t(e.currentTarget).data("key");i&&n.trigger("navigate","details",{serverID:this.model.server.id,key:i})}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1059),i(6)],s=function(e,t){"use strict";var i=t.ItemView.extend({tagName:"li",className:"play-queue-list-item",template:e});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1062),i(2),i(4),i(6),i(7),i(5),i(14),i(25),i(11),i(50),i(106),i(132),i(130),i(131)],
s=function(e,t,i,n,s,a,r,o,l,c,u,d,h,p){"use strict";var f=n.ItemView.extend({tagName:"ul",className:"dropdown-menu",template:e,ui:{divider:".divider"},events:{"click .play-mix-btn":"onPlayMixClick","click .add-to-playlist-btn":"onAddToPlaylistClick","click .sync-btn":"onSyncClick","click .share-btn":"onShareClick","click .recommend-btn":"onRecommendClick","click .info-btn":"onInfoClick"},initialize:function(e){this.mediaType=o.get(this.model.get("type")),this.mediaActions=new c({},{item:this.model,
playQueue:e.playQueue}),i(".dropdown.open .dropdown-toggle").dropdown("toggle")},serializeData:function(){var e,t;if(this.mediaActions.get("showDownload")){e=this.model.getDownloadUrl();var i=this.model.getFilepath();i&&(t=r.getLastSegment(i))}return{downloadUrl:e,downloadName:t}},bindingsModel:"mediaActions",bindings:{".play-mix-btn":{modelAttribute:"showPlayMix",manual:!0,autohide:!0,formatter:function(e,t){if(e){var i=this.model.get("related"),n=i.findWhere({browse:!1}),a=n.get("title");a&&t.text(s("Queue {1}",a));
}return e}},".add-to-playlist-btn":{modelAttribute:"showAddToPlaylist",manual:!0,autohide:!0},".sync-btn":{modelAttribute:"showSync",manual:!0,autohide:!0},".download-btn":{modelAttribute:"showDownload",manual:!0,autohide:!0},".share-btn, .recommend-btn":{modelAttribute:"showShare",manual:!0,autohide:!0},".info-btn":{modelAttribute:"showInfo",manual:!0,autohide:!0}},onRender:function(){var e=this.ui.divider,t=e.prevAll(":not(:has(.hidden))").length,i=e.nextAll(":not(:has(.hidden))").length;e.toggleClass("hidden",!t||!i);
},onClose:function(){this.mediaActions.stopListening()},onPlayMixClick:function(e){e.preventDefault();var t=this.model.get("related"),i=t.findWhere({browse:!1});i.set("type","track"),l.execute("queueMedia",{item:i,excludeSeedItem:!0,next:!0})},onAddToPlaylistClick:function(e){return e.preventDefault(),i(e.currentTarget).isDisabled()?void e.stopImmediatePropagation():void a.trigger("show:modal",new u({model:this.model,items:this.mediaActions.getActionTargets(),title:this.mediaActions.getActionTargetsTitle()
}))},onSyncClick:function(e){e.preventDefault(),l.execute("showSyncModal",{item:this.model})},onShareClick:function(e){e.preventDefault(),a.trigger("show:modal",new d({model:this.model}))},onRecommendClick:function(e){e.preventDefault(),a.trigger("show:modal",new p({model:this.model}))},onInfoClick:function(e){e.preventDefault(),a.trigger("show:modal",new h({model:this.model}))}});return f}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1063),i(2),i(4),i(6)],s=function(e,t,i,n){
"use strict";var s=n.ItemView.extend({id:"playlist-type-dropdown",tagName:"span",className:"dropdown",template:e,events:{"click .type-btn":"onClick"},types:[{key:0,title:"All"},{key:"audio",title:"Music"},{key:"photo",title:"Photo"},{key:"video",title:"Video"}],initialize:function(){this.listenTo(this.model,"change:currentType",this.render)},serializeData:function(){return{currentType:t(this.types).findWhere({key:this.model.get("currentType")}),types:this.types}},onClick:function(e){e.preventDefault();
var t=i(e.currentTarget).data("key");this.model.set("currentType",t)}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1065),i(4),i(6),i(11),i(9)],s=function(e,t,i,n,s){"use strict";var a=i.ItemView.extend({tagName:"ul",className:"dropdown-menu pull-right",template:e,events:{"click .local-player-btn":"onLocalPlayerClick","click .plex-player-btn":"onPlexPlayerClick","click .now-playing-btn":"onNowPlayingClick"},initialize:function(e){e||(e={}),this.showNowPlaying=e.showNowPlaying,
this.players=s.get("players")},serializeData:function(){var e=s.get("primaryPlayer");return{showNowPlaying:this.showNowPlaying,primaryPlayer:e?e.toJSON():null,nowPlaying:e?e.get("nowPlaying").toJSON():null,players:this.players.toJSON()}},onLocalPlayerClick:function(e){e.preventDefault(),s.set("primaryPlayer",null)},onPlexPlayerClick:function(e){e.preventDefault();var i=t(e.currentTarget).data("id"),n=this.players.get(i);s.set("primaryPlayer",n)},onNowPlayingClick:function(e){e.preventDefault();var i=s.get("primaryPlayer"),a=i.get("nowPlaying"),r=t(e.currentTarget).data("id"),o=a.get(r);
n.execute("playMedia",{item:o})}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1068),i(6)],s=function(e,t){"use strict";var i=t.ItemView.extend({id:"section-subset-dropdown",tagName:"span",className:"dropdown",template:e,collectionEvents:{reset:"render"},initialize:function(){this.collection.populate({reset:!0,scope:"page"})},serializeData:function(){var e=this.collection.get(this.model.id)||this.model;return{showDropdown:this.collection.length>1,subsets:this.collection.toJSON(),
currentSubset:e.toJSON(),serverID:this.model.server.id,sectionID:this.model.section.id}}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1069),i(6),i(748)],s=function(e,t,i){"use strict";var n=t.CompositeView.extend({id:"section-type-dropdown",tagName:"span",className:"dropdown",template:e,itemView:i,itemViewContainer:".dropdown-menu",modelEvents:{"change:currentType":"render","change:currentSubset":"render"},serializeData:function(){return{currentType:this.model.get("currentType").toJSON()
}},onRender:function(){var e=this.collection.length<2,t=this.model.get("allowAdvancedFilters"),i="all"!==this.model.get("currentSubset").id;this.$el.toggleClass("hidden",e||!t||i)}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1070),i(6)],s=function(e,t){"use strict";var i=t.ItemView.extend({tagName:"li",template:e,events:{"click a":"onClick"},onClick:function(e){e.preventDefault();var t=this.model.section,i=t.get("currentType");i.set("selected",!1),this.model.set("selected",!0),
this.model.section.set("currentType",this.model)}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1076),i(2),i(4),i(6),i(34),i(35),i(650),i(795)],s=function(e,t,i,n,s,a,r,o){"use strict";var l=n.Layout.extend({template:e,dragStatus:0,ui:{upload:".upload-artwork-container",urlInput:"input[name=url]"},regions:{list:".artwork-list-container"},events:{dragenter:"onDragEnter",dragleave:"onDragLeave",dragover:"onDragOver",drop:"onDrop",keydown:"onKeyDown","change .artwork-file-control":"onFileChange",
"click .upload-url-btn":"onUploadUrlClick","click .cancel-url-btn":"onCancelUrlClick","click .submit-url-btn":"onUrlSubmit","submit #upload-form":"onUrlSubmit","click .upload-back-btn":"onUploadBackClick","click .artwork-option":"onArtworkOptionClick"},initialize:function(e){this.type=e.type,this.changes={},this.collection=new r([],{server:this.model.server,section:this.model.section,parent:this.model,artworkType:this.type}),this.collection.fetch()},serializeData:function(){return{showUpload:this.model.server.supports("artworkUpload"),
showFileUpload:s.hasFileUpload}},flushChanges:function(){this.model.set(this.changes)},uploadFiles:function(e){if(e&&e.length){this.changes={},this.ui.upload.removeClass("show-success show-error");var n=this.collection.url(),s=t.extend(this.model.server.getXHROptions(n),{type:"POST",processData:!1}),a=[],r=t.bind(function(e){/image\//.test(e.type)&&(s.data=e,a.push(i.ajax(s)))},this);if(t.each(e,r),!a.length)return void this.ui.upload.addClass("show-error");this.ui.upload.addClass("show-progress"),
this.monitorUpload(i.when.apply(i,a))}},uploadUrl:function(e){this.changes={},this.ui.upload.removeClass("show-form"),this.ui.upload.addClass("show-progress"),this.ui.urlInput.val(""),e=this.collection.url()+"?url="+encodeURIComponent(e);var n=t.extend(this.model.server.getXHROptions(e),{type:"POST"});this.monitorUpload(i.ajax(n))},monitorUpload:function(e){e.done(t.bind(function(){this.isClosed||this.ui.upload.addClass("show-success");var e={server:this.model.server,onlyIfCached:!0},i=new a({key:this.model.get("key")
},e);t.isEmpty(i)||i.fetch(),this.collection.fetch()},this)),e.fail(this.whenRendered(function(){this.ui.upload.addClass("show-error")})),e.always(this.whenRendered(function(){this.ui.upload.removeClass("show-progress")}))},onRender:function(){this.list.show(new o({collection:this.collection,itemViewOptions:{artworkType:this.type}}))},onDragEnter:function(e){this.dragStatus++,this.ui.upload.addClass("drag-hover")},onDragLeave:function(e){this.dragStatus--,0===this.dragStatus&&this.ui.upload.removeClass("drag-hover");
},onDragOver:function(e){e.preventDefault()},onDrop:function(e){e.preventDefault(),e.stopPropagation(),this.dragStatus=0,this.ui.upload.removeClass("drag-hover"),this.uploadFiles(e.originalEvent.dataTransfer.files)},onKeyDown:function(e){27===e.which&&this.ui.upload.hasClass("show-form")&&(e.preventDefault(),this.ui.upload.removeClass("show-form"))},onFileChange:function(e){this.uploadFiles(e.target.files)},onUploadUrlClick:function(e){e.preventDefault(),this.ui.upload.addClass("show-form"),this.ui.urlInput.focus();
},onCancelUrlClick:function(e){e.preventDefault(),this.ui.upload.removeClass("show-form")},onUrlSubmit:function(e){e.preventDefault();var t=this.ui.urlInput.val();t?this.uploadUrl(t):this.ui.upload.removeClass("show-form")},onUploadBackClick:function(e){e.preventDefault(),this.ui.upload.removeClass("show-success show-error")},onArtworkOptionClick:function(e){e.preventDefault();var t=i(e.currentTarget),n=t.data("ratingKey");this.$(".artwork-option.selected").removeClass("selected"),t.addClass("selected"),
this.changes["artwork:"+this.type]=n}});return l}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1072),i(1074),i(1077),i(1081),i(1083),i(1084),i(1086),i(1088),i(1090),i(1085),i(2),i(4),i(7),i(25),i(267),i(754),i(61)],s=function(e,t,i,n,s,a,r,o,l,c,u,d,h,p,f,m,g){"use strict";function v(e){return u.reduce(e,function(e,t){return e[t]=!0,e},{})}var y={movie:n,show:o,season:r,episode:i,artist:t,album:e,track:l,photoAlbum:s,photo:a,playlist:c},b=f.extend({regions:{ratingRegion:".rating-region"
},ui:u.extend({selectizeInputs:".selectize input[type=text]"},f.prototype.ui),initialize:function(e){var t=this.model.get("type");this.template=y[t]||y.movie;var i=p.get(t);this.canSelectize=this.model.server.supports("batchEdit")&&i,this.canReparent=this.model.server.supports("batchEdit")},serializeData:function(){var e=f.prototype.serializeData.apply(this,arguments);return e.supportsLinkedYears=this.model.server.supports("linkedYearMetadata"),e},flushChanges:function(){var e=this.ui.form,t=e.find(".selectize input[tabindex=-1]"),i=v(u.pluck(t,"name")),n=v(u.pluck(e.find("[type=number]"),"name")),s=u(e.serializeArray()).reject(function(e){
return i[e.name]},this),a=u.reduce(s,function(e,t){if(n[t.name]){var i=d.trim(t.value);if(i)return e[t.name]=parseFloat(i,10),e;if(!this.model.get(t.name))return e}return e[t.name]=t.value,e},{},this);a.Field=this.getLockedFieldsArray(),u.each(t,function(e){var t=d(e),i=t.data("updateAttr"),n=t.data("altUpdateAttr"),s=t.data("isText"),r=e.selectize.getValue();if(n)if(s)a[i]=r,a[n]=null;else{var o=e.selectize.options[r];if(o){var l=o[t.data("autocompleteAttr")];a[i]=l,a[n]=r}}else a[i]=r}),this.model.set(a);
},markInvalid:function(e){this.$(".form-group").removeClass("has-error"),u(e).each(function(e){var t=this.$('.form-group[data-attr="'+e+'"]');t.addClass("has-error"),t.find(".control-error").text(h("Required"))},this)},onRender:function(){if(this.$(".rating-region").length>0&&this.ratingRegion.show(new g({model:this.model,passive:!0})),this.canSelectize){var e=this;this.ui.selectizeInputs.each(function(t,i){m(e,i)})}}});return b}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1079),i(2),i(4),i(6),i(35),i(29),i(752)],
s=function(e,t,i,n,s,a,r){"use strict";var o=n.CompositeView.extend({template:e,className:"files",itemView:r,itemViewContainer:"ul",initialize:function(){this.collection=new a,this.populateParts().always(this.whenRendered(function(){this.$(".loading").addClass("hidden")}))},populateParts:function(){function e(e){var i=e.get("Media");return i&&i.length?(t.each(i,n),i):void 0}function n(e){t.each(e.Part,a)}function a(e){r.push(e)}var r=this.collection,o=new s(this.model.pick("ratingKey","key"),{server:this.model.server
});if(e(o))return i.Deferred().resolve();var l=o.populate().then(function(){if(!e(o)){var t=o.get("children");if(t){if(!t.length)return t.populate().then(function(){t.each(e)});t.each(e)}}});return l},flushChanges:function(){}});return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1080),i(6)],s=function(e,t){"use strict";var i=t.ItemView.extend({template:e,tagName:"li",className:"well",serializeData:function(){var e={file:this.model.get("file")};return e}});return i}.apply(t,n),
!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1087),i(2),i(9),i(66),i(268)],s=function(e,t,i,n,s){"use strict";var a=s.extend({templatesByType:{movie:e,show:e,album:e,photo:e},serializeData:function(){var e=i.get("user"),a=s.prototype.serializeData.apply(this,arguments);return t.extend(a,{showLabels:this.model.server.supports("labels"),labelsMinVersion:n.labels,hasPlexPass:e.hasPlexPass(),plexPassUrl:e.server.get("plexPassUrl")}),a}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(2),i(4),i(7),i(195)],s=function(e,t,i,n){"use strict";var s=function(s,a){var r=t(a),o=r.attr("name"),l=o.replace(/parentTitle$/,"parentRatingKey");l===o&&(l=null);var c,u=s.model.getQueryAttr(o),d=s.model.getQueryAttrSibling(o),h=u!==o,p=h?"title":o,f=h?"ratingKey":p,m=s.model.get("type");c=h?u.match(/(^.*)\./)[1]:"title"===p?m:null;var g=r.data("scopeToAttr"),v=r.data("scopeToParam"),y=r.data("ratingKey"),b=!y;y&&(y=y.toString());var w=!h,x={};v&&s.listenTo(s,"reset_selectize:"+v,function(){
D.loadedSearches={}});var S,C,k=s.model.get("original.updateValues."+o);k?(S=k.updateAttr,C=k.altUpdateAttr):(S=s.model.get(o),l&&(C=parseInt(s.model.get(l),10)),s.model.set("original.updateValues."+o,{updateAttr:S,altUpdateAttr:C}));var P=s.model.get("original.general."+o);if(!P){P=[];var A={};A[p]=S,A.ratingKey=y,P=[A],s.model.set("original.general."+o,P)}var I=[s.model.get(l)||s.model.get(o)],_=function(){var e=D.$dropdown_content.children();D.$dropdown.toggleClass("hidden",e.length<=1)},T=function(){
e.defer(_)};r.data("autocompleteAttr",p),r.data("updateAttr",o),l&&r.data("altUpdateAttr",l);var D=r.selectize({options:P,items:I,plugins:["restore_on_focus"],delimiter:null,create:!0,maxItems:1,labelField:p,valueField:f,sortField:p,searchField:[p],selectOnTab:!0,hideSelected:!1,highlight:!1,openOnFocus:!0,selectOnBlur:!0,createOnBlur:!0,persist:!0,addPrecedence:!0,allowEmptyOption:!0,allowCreateEmpty:w,manualInputWidth:!0,loadingClass:"",onFocus:function(){D.preloaded||(D.preloaded=!0,D.onSearchChange(D.$control_input.val()));
},createFilter:function(t){x[p]=t;var i=e(this.options).findWhere(x);return!i},load:function(e,t){if(!e.length)return void t();var i={};if(i[u]=e,g){var a=s.model.get(g);if(!a)return void t();i[v]=a}var r=new n([],{multiMetadataModel:s.model,query:i,server:s.model.server});r.fetch().done(function(e){t(e.map(function(e){return e.attributes})),_()})},render:{option:function(e,t){var n,s=l?e.ratingKey===String(C):e[p]===S;return n=s?'<small class="autocomplete-annotate pull-right">('+(c&&!b?i("this {1}",c):i("original value"))+")</small>":"",
"<div>"+t(e[p])+n+"</div>"},option_create:function(e,t){return e.input?'<div class="create">'+t(e.input)+"</div>":'<div class="create hidden"></div>'}},onDropdownClose:function(){D.$dropdown.addClass("hidden")},onDropdownOpen:function(){D.$dropdown.addClass("hidden"),T()},onType:e.bind(function(e){if(D.canCreate(e)){var i=t(D.$dropdown_content[0].childNodes[0]);D.setActiveOption(i)}T(),this.onLockableFieldChange({currentTarget:D.$input,force:!0})},s),onOptionAdd:function(t,i){var n=e.pick(i,p,"ratingKey"),s=e.findWhere(P,n);
s||P.splice(P.length,0,i)},onChange:function(t){var i=this.options[t];if(i){if(h){var n=i.ratingKey===i[p];r.data("isText",n),s.model.set("manualChange."+l,!n),s.model.set("manualChange."+o,n)}else s.model.set("manualChange."+o,!0);s.flushChanges();var a=s.model.changedAttributes();e.has(a,u)||e.has(a,d)?s.trigger("focusSubmit"):e.defer(function(){D.onBlur()}),s.trigger("reset_selectize:"+o),_()}}})[0].selectize;D.$dropdown.addClass("hidden")};return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){
var n,s;n=[i(2),i(4),i(7),i(123),i(25),i(119),i(195)],s=function(e,t,i,n,s,a,r){"use strict";var o=function(o,l){var c=t(l),u=c.data("name"),d=c.data("query")||c.data("name"),h=n(u),p=[].concat(o.model.get(h)),f=e.pluck(p,"tag"),m=o.model.get("original.tag."+u);m||(m=e.clone(p),o.model.set("original.tag."+u,m));var g=e.difference(f,e.pluck(m,"tag"));if(g.length){var v=e.map(g,function(e){return{tag:e}});v.unshift(m.length,0),m.splice.apply(m,v)}var y=function(t){o.model.set("original.allTagsRequested."+u,!0);
var i=new a({filter:u,filterType:"string"},{server:o.model.server,section:o.section,type:s.get(o.model.get("type")).id}),n=i.get("options");n.populate().then(e.bind(function(e){o.model.set("original.allTagsAvailable."+u,!0),t(e.map(function(e){return{tag:e.attributes.title}}))},o))};c.data("original-value",c.val()),c.selectize({options:m,items:f,plugins:["remove_button"],create:!0,labelField:"tag",valueField:"tag",sortField:"tag",searchField:["tag"],highlight:!1,createFilter:function(t){var i=e(this.options).findWhere({
tag:t});return!i},onChange:function(){o.onLockableFieldChange(c)},onFocus:function(){this.onSearchChange("")},loadingClass:"",load:function(e,t){var i=!(d!==u||e.length&&o.canAutocomplete);if(i)return void(o.model.get("original.allTagsRequested."+u)?t():y.call(o,t));var n=o.model.get("original.allTagsAvailable."+u)||0===e.length;if(n)return void t();var s={};s[d]=e;var a=new r([],{multiMetadataModel:o.model,query:s,server:o.model.server}),l=d===u?function(e){return e.attributes}:function(e){var t=e.attributes[d];
return{tag:t}};a.fetch().done(function(e){var i=e.map(l);t(i)}).fail(function(){t()})},render:{item:function(e,t){var n=e.tag?t(e.tag):'<span class="autocomplete-annotate">('+i("blank")+")</span>";return'<div class="item">'+n+"</div>"},option:function(e,t){var n;return n=e.tag?t(e.tag):'<small class="autocomplete-annotate">('+i("blank")+")</small>",'<div class="item">'+n+"</div>"}}})};return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1239),i(2),i(4),i(11),i(79),i(60),i(105),i(763),i(757)],
s=function(e,t,i,n,s,a,r,o,l){"use strict";var c=r.extend({template:e,ui:t.extend({sectionAgent:"#edit-section-agent",sectionScanner:"#edit-section-scanner",thumbnailsCheckbox:'input[name="enableBIFGeneration"]',agentGroup:".agent-group",scannerGroup:".scanner-group"},r.prototype.ui),events:{"change #edit-section-agent":"onEditSectionAgentChange","change #edit-section-scanner":"onEditSectionScannerChange","click .delete-thumbnails-btn":"onThumbnailsDeleteClick"},regions:{sectionSettingsRegion:".section-settings-region",
agentSettingsRegion:".section-agent-settings-region"},onlyAfterRender:["renderSectionAgent","renderSectionScanner","renderSectionSettings","renderSectionAgentSettings"].concat(r.prototype.onlyAfterRender),initialize:function(){this.populateCollections()},onRender:function(){this.model.agents.populate(),this.model.scanners.populate()},validate:function(e){var t=[];return e.get("agent")||t.push("agent"),e.get("scanner")||t.push("scanner"),t},renderSectionSettings:function(){var e=new o({model:this.model,
collection:this.model.settings});this.sectionSettingsRegion.show(e)},renderSectionAgentSettings:function(){var e=new l({model:this.model,collection:this.model.agentSettings});this.agentSettingsRegion.show(e)},populateCollections:function(){var e=this.populateAgents(),n=this.populateScanners(),s=this.populateSectionSettings(),a=this.populateSectionAgentSettings();return this.populateAgentsProxy(),this.populateScannersProxy(),e.then(t.bind(this.onAgentsPopulate,this)),n.then(t.bind(this.onScannersPopulate,this)),
s.then(t.bind(this.renderSectionSettings,this)),a.then(t.bind(this.renderSectionAgentSettings,this)),i.when(e,n,s,a).then(t.bind(this.validate,this,this.model))},renderSectionAgent:function(){var e=this.model.agentsProxy,t=this.createMenuOptions(e.map(function(e){return{label:e.get("name"),value:e.get("identifier")}}),this.model.get("agent"));this.ui.sectionAgent.html(t),e.length>1&&this.ui.agentGroup.removeClass("hidden")},renderSectionScanner:function(){var e=this.model.scannersProxy,t=this.createMenuOptions(e.map(function(e){
return{label:e.get("name"),value:e.get("name")}}),this.model.get("scanner"));this.ui.sectionScanner.html(t),e.length>1&&this.ui.scannerGroup.removeClass("hidden")},onEditSectionAgentChange:function(e){var n=i(e.currentTarget),s=n.val();this.model.set("agent",s),this.agentSettingsRegion.close();var a=this.model.agents.get(s);if(a){var r=a.get("languages"),o=this.model.get("language");r.get(o)||this.model.set("language",r.first().get("code")),this.model.agentSettings=null,this.populateSectionAgentSettings().then(t.bind(this.renderSectionAgentSettings,this));
}this.showValidationResult(this.validate(this.model))},onEditSectionScannerChange:function(e){var t=i(e.currentTarget);this.model.set("scanner",t.val()),this.showValidationResult(this.validate(this.model))},onAgentsPopulate:function(e){this.renderSectionAgent()},onScannersPopulate:function(e){this.renderSectionScanner()},onThumbnailsDeleteClick:function(e){e.preventDefault();var t=n.execute("deleteSectionThumbnails",{section:this.model});t.done(this.whenRendered(function(){this.ui.thumbnailsCheckbox.prop("checked",!1);
}))}});return c}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1092),i(2),i(4),i(6)],s=function(e,t,i,n){"use strict";var s=n.ItemView.extend({template:e,events:{"change input[name]":"onInputChange","change select[name]":"onInputChange"},initialize:function(){this.changes={}},serializeData:function(){return{settings:this.collection.toJSON(),agentName:this.model.agents.get(this.model.get("agent")).get("name")}},onInputChange:function(e){var t=i(e.currentTarget),n=t.is(":checkbox")?t.prop("checked"):t.val(),s=this.collection.findWhere({
id:t.attr("name")});s.set("value",n)}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1093),i(105)],s=function(e,t){"use strict";var i=t.extend({template:e});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1240),i(2),i(4),i(19),i(5),i(88),i(105),i(761),i(859)],s=function(e,t,i,n,s,a,r,o,l){"use strict";var c=r.extend({template:e,fieldNames:["Location"],regions:{pathsRegion:".paths-region"},events:{"click .add-folder-btn":"onAddFolderClick",
"change input[name=path]":"onFolderChange"},onlyAfterRender:["renderSectionLocation"].concat(r.prototype.onlyAfterRender),initialize:function(){this.listenTo(this.model.get("locations"),{add:this.onCollectionChange,remove:this.onCollectionChange}),this.renderSectionLocation(),this.showValidationResult(this.validate(this.model))},validate:function(e){var t=[];return e.get("locations").length||t.push("locations"),t},renderSectionLocation:function(){var e=new o({collection:this.model.get("locations")
});this.pathsRegion.show(e)},onCollectionChange:function(){this.showValidationResult(this.validate(this.model))},onAddFolderClick:function(e){e.preventDefault();var t=new l({server:this.model.server});this.listenToOnce(t,"add:folder",this.onAddFolder),s.trigger("show:modal",t)},onAddFolder:function(e){if(e){var t={path:e};this.model.get("locations").findWhere(t)||this.model.get("locations").add(t)}},onFolderChange:function(e){var t=i(e.currentTarget),n=t.prop("defaultValue"),s=t.val();if(!s)return void t.val(n);
var a=this.model.get("locations").findWhere({path:n});a.set("path",s),t.prop("defaultValue",s)}});return c}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1241),i(6)],s=function(e,t){"use strict";var i=t.ItemView.extend({template:e,className:"row",events:{"click .remove-path-btn":"onRemovePathClick"},onRemovePathClick:function(e){e.preventDefault(),this.model.trigger("destroy",this.model,this.model.collection)}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){
var n,s;n=[i(6),i(760)],s=function(e,t){"use strict";var i=e.CollectionView.extend({itemView:t});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1242),i(4),i(5),i(9),i(105),i(285)],s=function(e,t,i,n,s,a){"use strict";var r=s.extend({template:e,ui:{chooseAgent:".choose-agent"},events:{"click .choose-agent":"onChooseAgentClick"},modelEvents:{"change:agent":"onSectionAgentChange","change:scanner":"onSectionScannerChange"},onlyAfterRender:["updateSelectedOffering"],initialize:function(){
this.hasPlexPass=this.model.server.get("myPlexSubscription"),this.updateSelectedOffering()},serializeData:function(){var e=n.get("user"),t={hasPlexPass:this.hasPlexPass,plexPassUrl:e.server.get("plexPassUrl")};return t},updateSelectedOffering:function(){var e=this.model.get("agent"),t=this.model.get("scanner");this.ui.chooseAgent.find("input").prop("checked",!1);var i=this.ui.chooseAgent.filter('[data-agent="'+e+'"][data-scanner="'+t+'"]').find("input");i.length||(i=this.ui.chooseAgent.not("[data-agent][data-scanner]").find("input")),
i.prop("checked",!0)},onChooseAgentClick:function(e){var s=t(e.currentTarget),r=s.data("agent"),o=s.data("scanner");if((r||o)&&!this.hasPlexPass){var l=n.get("user");return void i.trigger("show:modal",new a({model:l}))}this.model.agentSettings=null,this.model.set({agent:r||this.getSectionType().defaultAgent,scanner:o||this.getSectionType().defaultScanner})},onSectionAgentChange:function(){this.updateSelectedOffering()},onSectionScannerChange:function(){this.updateSelectedOffering()}});return r}.apply(t,n),
!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1243),i(4),i(6)],s=function(e,t,i){"use strict";var n=i.ItemView.extend({template:e,events:{"change [name]":"onEditSectionSettingInputChange"},serializeData:function(){var e=this.model.isNew(),t="music"===this.model.get("type"),i={settings:this.collection.toJSON(),edit:!e,isNewMusicSection:e&&t&&this.model.server.supports("premiumMusic")};return i},onEditSectionSettingInputChange:function(e){var i=t(e.currentTarget),n=i.attr("name");if("importFromiTunes"===n)return void this.model.set(n,1);
var s=i.is(":checkbox")?i.prop("checked"):i.val(),a=this.collection.findWhere({id:n});a.set("value",s)}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1244),i(2),i(4),i(12),i(79),i(60),i(105)],s=function(e,t,i,n,s,a,r){"use strict";var o=r.extend({template:e,ui:t.extend({sectionTypes:".wizard-block",sectionTitle:"#edit-section-title",sectionLanguage:"#edit-section-language"},r.prototype.ui),modelEvents:{"change:type":"onSectionTypeChange","change:title":"onSectionTitleChange",
"change:language":"onSectionLanguageChange"},events:{"click .section-type":"onSectionTypeClick","keyup #edit-section-title":"onEditSectionTitleChange","change #edit-section-title":"onEditSectionTitleChange","change #edit-section-language":"onEditSectionLanguageChange"},onlyAfterRender:["renderSectionLanguage","updateSectionTypesWizardBlocks","updateSectionLanguage","updateSectionTitle"].concat(r.prototype.onlyAfterRender),initialize:function(){this.populateCollections()},serializeData:function(){
var e=r.prototype.serializeData.apply(this,arguments);e.sectionTypes=a.getAll();var t=this.getSectionType();t&&(e.currentSectionKey=t.key);var i=this.model.get("updatedAt");return i&&(e.updatedAt=n.unix(i).fromNow()),e},validate:function(e){var t=[];return e.get("type")||t.push("type"),e.get("title")||t.push("title"),e.get("language")||t.push("language"),t},populateCollections:function(){var e=this.populateAgents(),n=this.populateScanners(),s=this.getSectionType(),a=i.when(s,e,n,this.model.server.get("myPlexSubscription")&&this.model.server.supports("premiumMusic"));
return this.model.isNew()&&(a=a.then(t.bind(this.model.setAgentAndScanner,this.model))),a=a.then(e).then(t.bind(this.onAgentsPopulate,this)).then(t.bind(function(){this.showValidationResult(this.validate(this.model))},this))},renderSectionLanguage:function(){var e=this.model.get("language"),t=this.model.agents.get(this.model.get("agent")),i=t.get("languages");if(!i.get(e)){var n=this.model.get("type"),s=a.get(n),r=s.defaultLanguage;this.model.set("language",r,{silent:!0}),e=r}var o=i.map(function(e){
return{label:e.get("name"),value:e.id}});this.updateSectionLanguage(),this.ui.sectionLanguage.html(this.createMenuOptions(o,e))},updateSectionTypesWizardBlocks:function(){this.ui.sectionTypes.removeClass("selected"),this.ui.sectionTypes.filter('[data-key="'+this.model.get("type")+'"]').addClass("selected"),this.$el.addClass("section-type-chosen")},updateSectionLanguage:function(){this.ui.sectionLanguage.val(this.model.get("language"))},updateSectionTitle:function(){var e=this.ui.sectionTitle.val(),t=this.model.get("title");
e!==t&&this.ui.sectionTitle.val(t)},onSectionTypeClick:function(e){e.preventDefault();var t=i(e.currentTarget);if(t.hasClass("selectable")){var n=t.data("key"),s={type:n},r=a.get(n);this.model.get("title")||(s.title=r.title),this.model.set(s)}},onEditSectionTitleChange:function(e){var t=i(e.currentTarget);this.model.set("title",t.val()),this.showValidationResult(this.validate(this.model))},onEditSectionLanguageChange:function(e){var t=i(e.currentTarget);this.model.set("language",t.val()),this.showValidationResult(this.validate(this.model));
},onSectionTypeChange:function(e,t){this.updateSectionTypesWizardBlocks();var i=a.get(t);if(!this.model.get("language")){var n=i.defaultLanguage;this.model.set("language",n)}var s=this.model.get("title"),r=this.model.previous("type"),o=a.get(r),l=o&&o.title;s&&s!==l||this.model.set("title",i.title),this.setSectionType(i),this.model.agents=null,this.model.scanners=null,this.model.settings=null,this.populateCollections()},onSectionTitleChange:function(e,t){this.updateSectionTitle(),this.showValidationResult(this.validate(this.model));
},onSectionLanguageChange:function(e,t){this.updateSectionLanguage()},onAgentsPopulate:function(e){this.renderSectionLanguage()}});return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(86),i(552)],s=function(e,t){"use strict";var i=t.extend({className:"container",template:e});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(86),i(554)],s=function(e,t){"use strict";var i=t.extend({className:"container",template:e});return i}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(86),i(7),i(555)],s=function(e,t,i){"use strict";var n=i.extend({className:"container",template:e,serializeData:function(){return{title:t("You don't have any media servers yet."),subtitle:t("{1}Download and install{2} one and try again.",'<a href="https://plex.tv/downloads" target="_blank">',"</a>")}}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(86),i(556)],s=function(e,t){"use strict";var i=t.extend({className:"container",template:e
});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(86),i(557)],s=function(e,t){"use strict";var i=t.extend({className:"container",template:e});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1094),i(2),i(6),i(5)],s=function(e,t,i,n){"use strict";var s=i.ItemView.extend({className:"filter-bar filter-bar-fixed",template:e,events:{"click .clear-filters-btn":"onClearFiltersClick"},serializeData:function(){var e=this.model.get("currentFilters"),i=[];
return t.each(e,function(e){i.push(e.titles.join(", "))}),{titles:i.join(", ")}},onClearFiltersClick:function(e){e.preventDefault();var t=this.model.get("currentFilters");t.length=0,this.model.trigger("change:currentFilters",this.model,t),n.trigger("navigate","section",{serverID:this.model.server.id,sectionID:this.model.id,subset:this.model.get("subset"),trigger:!1})}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(18),i(772)],s=function(e,t){"use strict";var i=e.extend({
tagName:"ul",className:"list card-list alert-list",itemView:t,reversed:!0});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1095),i(2),i(6),i(7)],s=function(e,t,i,n){"use strict";var s=i.ItemView.extend({tagName:"li",className:"card-collapsed striped-list-item alert-list-item",template:e,serializeData:function(){var e=this.model.toJSON(),i={serverID:this.model.server.id,serverName:t.escape(this.model.server.get("friendlyName")),itemKey:"/library/metadata/"+this.model.get("itemID"),
event:e};if(e.label=t.escape(e.label),e.value=t.escape(e.value),"playing"===e._type&&(e.username=t.escape(e.username),e.title=t.escape(e.title),e.player=t.escape(e.player)),"timeline"===e._type)switch(e.sectionTitle=this.model.get("section")?this.model.get("section").get("title"):"section "+this.model.get("sectionID"),e.mediaTitle=this.model.get("title")||"an item",this.model.get("state")){case 0:e.stateString=n("Created");break;case 1:e.stateString=n("Progress for");break;case 2:e.stateString=n("Matching");
break;case 3:e.stateString=n("Downloading metadata for");break;case 4:e.stateString=n("Loading metadata for");break;case 5:e.stateString=n("Finished processing");break;case 6:e.stateString=n("Analyzing");break;case 9:e.stateString=n("Deleted")}return i}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(18),i(775),i(774)],s=function(e,t,i){"use strict";var n=e.extend({tagName:"ul",className:"tile-list session-tile-list",itemView:t,emptyView:i});return n}.apply(t,n),
!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1096),i(6)],s=function(e,t){"use strict";var i=t.ItemView.extend({template:e});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1097),i(2),i(7),i(228),i(28),i(26),i(235),i(11),i(48),i(30)],s=function(e,t,i,n,s,a,r,o,l,c){"use strict";var u=l.extend({className:"poster-item session-tile-list-item",template:e,screenshotPreferredIndex:"hd",screenshotInterval:null,screenshotIntervalDelay:2e3,screenshotCount:0,ui:{
poster:".media-poster",posterFade:".media-poster-fade",userPoster:".user-poster"},events:t.extend({"click .info-btn":"onInfoClick","click .close-btn":"onInfoClick"},l.prototype.events),modelEvents:{"change:viewOffset":"onViewOffsetChange","change:Player":"onPlayerChange"},initialize:function(e){l.prototype.initialize.apply(this,arguments);var i=this.getScreenshotUrl(this.model.get("Media"));this.image=new c({model:this.model,modelAttribute:"ratingKey",type:"clip",getUrl:this.getPosterUrl,width:350,
url:i?i:null}),this.userImage=new c({model:this.model,modelAttribute:"User",type:"friend",getUrl:this.getUserPosterUrl,width:44}),this.posterFade=new c({model:this.model,modelAttribute:"Media",type:"clip",getUrl:t.bind(this.getScreenshotUrl,this),width:350});var n=this.model.get("Player");n&&n.state===s.states.PLAYING&&(this.screenshotInterval=setInterval(t.bind(this.updateScreenshot,this),this.screenshotIntervalDelay)),this.listenTo(this.model,"change:Player",this.onPlayerChange)},getPosterUrl:function(e){
var t=this.model;return"photo"===t.get("type")?t.get("thumb"):t.get("art")||t.get("parentArt")||t.get("grandparentArt")||t.get("thumb")},getUserPosterUrl:function(e){return e.thumb},getScreenshotUrl:function(e){var i=t.first(e);if(i){var n=this.model.get("viewOffset")||0,s=this.screenshotCount*this.screenshotIntervalDelay+n+4e3;return a.getScreenshotUrl(i,s,this.screenshotPreferredIndex)}},updateScreenshot:function(){this.screenshotCount++;var e=this.posterFade.screenshotUrl,i=this.getScreenshotUrl(this.model.get("Media"));
i&&(this.posterFade.screenshotUrl=i,this.posterFade.load(i).done(this.whenRendered(function(i){this.posterFade.showImage(i),this.ui.posterFade.removeClass("invisible"),this.posterFadeDelay=t.delay(this.whenRendered(function(){if(this.image.showImage(i),this.ui.posterFade.addClass("invisible"),e){var t=this.posterFade.cache,n=this.image.getTranscodeUrl(e),s=t.get(t.getItemCacheKey({url:n}));s&&t.remove(s)}}),800)})))},bindings:t.extend({},l.prototype.bindings,{".media-subtitle-1":{modelAttribute:"year",
modelListeners:["title","year"],autohide:!0,formatter:function(e){var t=l.prototype.bindings[".media-subtitle-1"].formatter.apply(this,arguments),i=l.prototype.bindings[".media-subtitle-2"].formatter.call(this,this.model.get("index"));return i?i+" "+t:t}},".device-icon":{modelAttribute:"Player",manual:!0,formatter:function(e,t){var i=n.getIcon(e.platform||e.product);t.addClass("device-icon-"+i)}},".session-player":{modelAttribute:"Player",formatter:function(e){return e.title}},".session-state":{modelAttribute:"Player",
formatter:function(e){return r(e.state)}},".session-transcode":{modelAttribute:"TranscodeSession",formatter:function(e){return i(e?"Transcoding":"Direct Play")}},".session-transcode-throttled":{modelAttribute:"TranscodeSession",autohide:!0,formatter:function(e){return e&&"1"===e.throttled?i("(throttled)"):""}},".session-transcode-video-decision":{modelAttribute:"TranscodeSession",formatter:function(e,t){var n=!(!e||!e.videoCodec);return t.parent().toggleClass("hidden",!n),n?"copy"===e.videoDecision?i("Direct Stream"):i("Transcode ({1})",e.videoCodec):"";
}},".session-transcode-audio-decision":{modelAttribute:"TranscodeSession",formatter:function(e,t){var n=!(!e||!e.audioCodec);return t.parent().toggleClass("hidden",!n),n?"copy"===e.audioDecision?i("Direct Stream"):i("Transcode ({1})",e.audioCodec):""}},".session-username":{modelAttribute:"User",formatter:function(e){return e.title}}}),onRender:function(){l.prototype.onRender.apply(this,arguments),this.userImage.setElement(this.ui.userPoster),this.posterFade.setElement(this.ui.posterFade)},onClose:function(){
l.prototype.onClose.call(this),clearTimeout(this.posterFadeDelay),clearInterval(this.screenshotInterval),this.posterFade&&this.posterFade.close()},onViewOffsetChange:function(e,t){this.screenshotCount=0},onPlayerChange:function(e,i){i&&(i.state!==s.states.PLAYING&&this.screenshotInterval?(this.screenshotInterval=clearInterval(this.screenshotInterval),this.screenshotCount=0):i.state!==s.states.PLAYING||this.screenshotInterval||(this.screenshotInterval=setInterval(t.bind(this.updateScreenshot,this),this.screenshotIntervalDelay)));
},onPlayClick:function(e){e.preventDefault(),e.stopImmediatePropagation(),o.execute("playMedia",{item:this.model,offset:this.model.get("viewOffset")})},onInfoClick:function(e){e.preventDefault(),e.stopImmediatePropagation(),this.$el.toggleClass("dim")}});return u}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(18),i(777)],s=function(e,t){"use strict";var i=e.extend({tagName:"ul",className:"tile-list media-tile-list sync-tile-list show-context",itemView:t});return i}.apply(t,n),
!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1098),i(2),i(19),i(6),i(7),i(5),i(67),i(121),i(11),i(453),i(30),i(166),i(871),i(287)],s=function(e,t,i,n,s,a,r,o,l,c,u,d,h,p){"use strict";var f=n.Layout.extend({tagName:"li",className:"poster-item media-tile-list-item sync-tile-list-item",template:e,metadataItemsDelay:5e3,ui:{poster:".media-poster",transcodeStatus:".sync-status-transcode",transcodeTimeRemaining:".media-context",statusIcons:".sync-status-icon",completeIcon:".sync-complete-icon",
waitingIcon:".sync-waiting-icon",processingIcon:".sync-processing-icon",failedIcon:".sync-failed-icon",unknownIcon:".sync-unknown-icon"},regions:{transcodeProgress:".sync-status-transcode"},events:{"click a":"onClick","click .edit-btn":"onEditClick","click .delete-btn":"onDeleteClick"},onlyAfterRender:["onMetadataItemsReset","onMediaChange","onTranscodeJobsReset"],initialize:function(e){this.server=e.server,this.model.parent=this.server,this.type=this.model.get("metadataType"),this.contentType=this.model.get("contentType");
var n=this.type,s=this.contentType,a=150;"episode"===n?n="show":"clip"===n||"userPlaylistItem"===n?a=250:"directory"===n&&(n="audio"===s?"track":"photo"===s?"photo":"movie"),this.$el.addClass(n),this.image=new u({server:this.server,type:n,width:a}),this.progressModel=new i.Model({current:0});var r=this.server.get("transcodeJobs");this.metadataItems=new c([],{server:this.server,device:this.model.device,syncItemId:this.model.id}),this.listenTo(this.metadataItems,"reset",this.onMetadataItemsReset),this.listenTo(r,"reset",this.onTranscodeJobsReset),
this.metadataItems.fetch({reset:!0}),this.server.supports("syncNotifications")?this.listenTo(this.metadataItems,"change:Media",this.onMediaChange):this.metadataItemsInterval=setInterval(t.bind(function(){this.metadataItems.fetch({reset:!0})},this),this.metadataItemsDelay)},serializeData:function(){return{syncItem:this.model.toJSON(),isCloudSync:this.model.device.get("isCloudSync"),isFailure:!!this.model.get("Status").failure}},getPosterUrl:function(e){var t=e.get("thumb");return this.hasMultipleItems?this.hasSameParents?e.get("parentThumb")||e.get("grandparentThumb")||t:this.hasSameGrandparents?e.get("grandparentThumb")||e.get("parentThumb")||t:void 0:t;
},updatePoster:function(e){if(this.hasPoster=!0,!e){var t=this.metadataItems.first();if(!t)return;e=this.getPosterUrl(t)}this.image.url!==e&&(this.image.src=null,this.image.url=e,this.image.render())},analyzeParts:function(e){if(this.model.get("Status").failure)return"failed";var i=e.models,n=i.length;if(!n)return"unknown";for(var s="complete",a=[],o=[],l=0;n>l;l++){var c=i[l],u=c.get("Media");if(a.push(c.get("grandparentKey")),o.push(c.get("parentKey")),u.length||(s="unknown"),"failed"!==s&&"unknown"!==s)for(var d=0,h=u.length;h>d;d++)for(var p=u[d].Part,f=0,m=p.length;m>f;f++){
var g=p[f],v=r.getSyncStateFromPart(g);r.failedRegex.test(v)&&(s="failed"),r.processingRegex.test(v)&&(s="processing"),r.waitingRegex.test(v)&&"processing"!==s&&(s=g.key?"waiting":"processing")}}return this.hasMultipleItems=n>1,this.hasSameGrandparents=1===t.compact(t.uniq(a)).length,this.hasSameParents=1===t.compact(t.uniq(o)).length,this.hasPoster||this.updatePoster(),s},bindings:{".media-title":{modelAttribute:"title"},".media-subtitle-1":{modelAttribute:"rootTitle"}},onRender:function(){this.image.setElement(this.ui.poster),
this.transcodeProgress.append(new d({model:this.progressModel,size:56}))},onClose:function(){clearInterval(this.metadataItemsInterval)},onMetadataItemsReset:function(e){var t=this.analyzeParts(e);if(this.ui.statusIcons.addClass("hidden"),this.ui.transcodeStatus.hasClass("hidden"))switch(t){case"complete":this.ui.completeIcon.removeClass("hidden");break;case"waiting":this.ui.waitingIcon.removeClass("hidden");break;case"processing":this.ui.processingIcon.removeClass("hidden");break;case"failed":this.ui.failedIcon.removeClass("hidden");
break;default:this.ui.unknownIcon.removeClass("hidden")}},onMediaChange:function(e,t){this.onMetadataItemsReset(this.metadataItems)},onTranscodeJobsReset:function(e){var t=e.where({syncItemId:this.model.id});if(!t.length)return this.ui.transcodeStatus.hasClass("hidden")||(this.ui.transcodeStatus.addClass("hidden"),this.ui.waitingIcon.removeClass("hidden")),this.ui.transcodeTimeRemaining.text(""),void this.updatePoster();var i=t[0],n=i.get("progress");if(this.ui.statusIcons.addClass("hidden"),n>0){
this.ui.transcodeStatus.removeClass("hidden");var a=i.get("type"),r=o(i.get("remaining"));if(this.progressModel.set("progress",n),"download"===a)this.progressModel.set("text",n.toString()+"%"),this.ui.transcodeTimeRemaining.text(s("Downloading"));else if("upload"===a)this.progressModel.set("text",n.toString()+"%"),this.ui.transcodeTimeRemaining.text(s("Uploading"));else{var l=i.get("speed");if(l){var c=Math.round(10*i.get("speed"))/10;c>10&&(c=Math.round(c)),this.progressModel.set("text",c.toString()+"x");
}else this.progressModel.set("text","");this.ui.transcodeTimeRemaining.text(r)}this.updatePoster(i.get("thumb"))}else this.ui.transcodeStatus.addClass("hidden"),this.ui.processingIcon.removeClass("hidden")},onClick:function(e){e.preventDefault(),a.trigger("show:modal",new h({model:this.model,collection:this.metadataItems}))},onEditClick:function(e){e.stopImmediatePropagation(),e.preventDefault(),a.trigger("show:modal",new p({model:this.model}))},onDeleteClick:function(e){e.stopImmediatePropagation(),
e.preventDefault(),l.execute("deleteSyncItem",{syncItem:this.model,server:this.server})}});return f}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(18),i(779)],s=function(e,t){"use strict";var i=e.extend({tagName:"ul",className:"list sync-status-list",itemView:t});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1099),i(2),i(6),i(7),i(67),i(121),i(30)],s=function(e,t,i,n,s,a,r){"use strict";var o=i.ItemView.extend({tagName:"li",className:"sync-status-list-item",
template:e,ui:{poster:".media-poster"},initialize:function(e){this.syncItem=e.syncItem,this.transcodeJobs=this.model.server.get("transcodeJobs"),this.$el.addClass(this.model.get("type")),this.image=new r({model:this.model,type:this.model.get("type"),getUrl:this.getPosterUrl,height:50,background:!1}),this.listenTo(this.transcodeJobs,"reset",function(e){this.model.trigger("change:Media",this.model,this.model.get("Media"))})},serializeData:function(){return{isCloudSync:this.model.device.get("isCloudSync")
}},getPosterUrl:function(e){return e||this.model.get("parentThumb")||this.model.get("grandparentThumb")},analyzeTranscodeJobs:function(){var e;if(this.transcodeJobs.each(t.bind(function(t){if(this.syncItem.id===t.get("syncItemId")){var i=this.model.get("thumb"),n=this.model.get("title"),s=t.get("transcodeThumb"),a=t.get("title"),r=a&&a.indexOf(n)>-1,o=!0;if(i&&s){var l=new RegExp("(.+)"+t.get("thumb")+"$");o=l.exec(i)}r&&o&&(e=t)}},this)),e&&e.get("progress")>0){var i=Math.round(10*e.get("speed"))/10,s=a(e.get("remaining"))||n("done"),r=Math.round(10*e.get("progress"))/10;
return{active:!0,speed:i,remaining:s,progress:r}}return{active:!1}},analyzeParts:function(){var e="complete",t=this.model.get("Media");if(!t.length)return"unknown";for(var i=0,n=t.length;n>i;i++)for(var a=t[i].Part,r=0,o=a.length;o>r;r++){var l=a[r],c=s.getSyncStateFromPart(l);s.failedRegex.test(c)&&(e=s.getSyncStateContextFromPart(l)),s.processingRegex.test(c)&&(e="downloading"===c?"downloading":"processing"),s.waitingRegex.test(c)&&"processing"!==e&&(e=l.key?"waiting":"processing")}return e},getErrorMessage:function(e){
switch(e){case"sourceFileUnavailable":return n("This media is inaccessible. Please check that the file exists with the correct permissions.");case"sourceFileMetadataError":return n("The metadata for this media is invalid. Please reanalyze the media and try again.");case"clientProfileError":return n("The client profile for the sync target is invalid.");case"ioError":return n("An error occurred processing this media. Please check that the disk is not full.");case"transcoderError":return n("The transcoder was unable to process this media.");
case"mediaAnalysisError":return n("This media was unable to be analyzed.");case"downloadFailed":return n("This media was unable to be downloaded. Please check that it is still available and try again.");case"unknownError":return n("An error occurred while syncing this media.")}return n("An error occurred while syncing this media.")},bindings:{".title":{modelAttribute:"title"},".subtitle":{modelAttribute:"Media",manual:!0,formatter:function(e){var t=this.analyzeParts(),i=this.analyzeTranscodeJobs();
switch(this.$(".subtitle").addClass("hidden"),t){case"complete":this.$(".complete-subtitle").removeClass("hidden");break;case"waiting":this.$(".waiting-subtitle").removeClass("hidden");break;case"downloading":i.active?(this.$(".downloading-subtitle").removeClass("hidden"),this.$(".transcode-progress").text(i.progress)):this.$(".processing-subtitle").removeClass("hidden");break;case"processing":i.active?(this.$(".converting-subtitle").removeClass("hidden"),this.$(".transcode-progress").text(i.progress),
this.$(".transcode-remaining").text(i.remaining)):this.$(".processing-subtitle").removeClass("hidden");break;case"unknown":this.$(".unknown-subtitle").removeClass("hidden");break;default:this.$(".failed-subtitle").removeClass("hidden"),this.$(".error-message").text(this.getErrorMessage(t))}}}},onRender:function(){this.image.setElement(this.ui.poster)}});return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(4),i(2),i(87),i(7),i(5),i(22),i(18),i(782)],s=function(e,t,i,n,s,a,r,o){
"use strict";var l=r.extend({tagName:"ol",className:"list media-list playlist-items",itemView:o,sorted:!0,itemEvents:{sort:"onSort"},initialize:function(){t.bindAll(this,"onItemMove")},onRender:function(){this.sortable&&this.sortable.destroy(),this.sortable=new i(this.el,t.extend({onAdd:this.onItemMove,onUpdate:this.onItemMove,handle:".sortable-handle",animation:200,scroll:!0,scrollSensitivity:100,scrollSpeed:2},this.options.sortableOptions))},onClose:function(){this.sortable&&this.sortable.destroy();
},onSort:function(){this.render()},onItemMove:function(i){var r=e(i.item).data("queue-item-id"),o=e(i.item).prev().data("queue-item-id"),l=this.options.playQueue;if(o)return void l.moveItem(r,o);var c=l.get("selectedItem").get("title"),u=new a({title:n("Convert Immediately"),message:n("Do you want to start converting this item immediately? Any conversion progress for '{1}' will be lost.",c)}),d=u.promise;d.done(function(){l.moveItem(r)}),d.fail(t.bind(this.render,this)),s.trigger("show:modal",u)}
});return l}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1100),i(6)],s=function(e,t){"use strict";var i=t.ItemView.extend({template:e,serializeData:function(){return{serverID:this.model.id}}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1101),i(2),i(6),i(7),i(5),i(77),i(96),i(11),i(9),i(147),i(101),i(30),i(270)],s=function(e,t,i,n,s,a,r,o,l,c,u,d,h){"use strict";var p=i.Layout.extend({className:"striped-list-item media-list-item playlist-item version-generator-item",
tagName:"li",template:e,ui:{poster:".media-poster"},events:{"click .promote-btn":"onPromoteClick","click .delete-btn":"onDeleteClick"},regions:{statusRegion:".conversion-status-region"},attributes:function(){return{"data-queue-item-id":this.model.id}},initialize:function(e){this.playQueue=e.playQueue,this.transcodeJobs=e.transcodeJobs,this.pausedSetting=e.pausedSetting,this.hideDragHandle=e.hideDragHandle,this.type=this.model.get("type");var t=r[this.type];"movie"===this.type&&(t=r.art);var i="episode"===this.type?"show":this.type;
this.image=new d({model:this.model,type:i,placeholderClass:t,height:60,modelAttribute:"thumb",getUrl:this.getPosterUrl})},bindings:{".generator-title":{modelAttribute:"title",formatter:function(e){return a.title(this.model)}},".generator-target":{modelAttribute:"target",formatter:function(e){return this.model.get("syncItemId")?n("Sync"):e}},".sortable-handle":{model:"playQueue",modelAttribute:"playQueueSelectedItemID",manual:!0,autohide:function(e){return this.model.get("playQueueItemID")!==e}},".promote-btn":{
modelAttribute:"queueIndex",manual:!0,autohide:function(e){var t=this.playQueue.getCurrentItem();return this.hideDragHandle||e-t.get("queueIndex")>1}}},serializeData:function(){return{hideDragHandle:this.hideDragHandle}},getPosterUrl:function(e){return"episode"===this.model.get("type")?this.model.get("grandparentThumb")||this.model.get("parentThumb")||e:e},deleteSyncItem:function(){var e=new c({id:this.model.get("syncItemId"),clientIdentifier:this.model.get("clientIdentifier")},{server:l.get("user").server
});return o.execute("deleteSyncItem",{syncItem:e,server:this.model.server})},deleteGenerator:function(){var e=new u({id:this.model.get("generatorID")},{server:this.model.server,playlistID:this.model.get("playlistID")});return o.execute("disableVersionGenerator",{generator:e,ratingKey:this.model.get("ratingKey")})},onRender:function(){this.image.setElement(this.ui.poster),this.statusRegion.show(new h({model:this.model,transcodeJobs:this.transcodeJobs,pausedSetting:this.pausedSetting}))},onClose:function(){
this.image.close()},onCollectionSort:function(e){this.trigger("sort")},onPromoteClick:function(e){e.preventDefault();var i=this.playQueue.get("collection");this.listenToOnce(i,"sort",t.debounce(this.onCollectionSort));var n=this.model.get("playQueueItemID"),s=this.playQueue.get("playQueueSelectedItemID");this.playQueue.moveItem(n,s)},onDeleteClick:function(e){e.preventDefault(),this.model.has("syncItemId")?this.deleteSyncItem():this.deleteGenerator()}});return p}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(18),i(784)],s=function(e,t){"use strict";var i=e.extend({tagName:"ul",className:"list card-list",itemView:t});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1103),i(2),i(6),i(5),i(11),i(65),i(129)],s=function(e,t,i,n,s,a,r){"use strict";var o=i.ItemView.extend({tagName:"li",className:"striped-list-item",template:e,events:{"click a":"onClick"},initialize:function(e){this.currentKey=e.currentKey},serializeData:function(){return{channel:this.model.toJSON(),
serverID:this.model.server.id,currentKey:this.currentKey}},bindings:{".media-title":{modelAttribute:"title"}},onClick:function(e){if(/\/updates$/.test(this.model.id))e.preventDefault(),s.execute("updateChannel",{server:this.model.server});else if(/\/prefs$/.test(this.model.id)){e.preventDefault();var i=new a([],{server:this.model.server,url:this.model.id});i.fetch().done(t.bind(function(){n.trigger("show:modal",new r({model:this.model,collection:i}))},this))}}});return o}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(1104),i(6),i(7),i(5),i(30),i(862)],s=function(e,t,i,n,s,a){"use strict";var r=t.ItemView.extend({tagName:"li",className:"poster-item media-tile-list-item channel-directory-tile-list-item channel",template:e,ui:{poster:".media-poster",subtitle:".media-subtitle-1"},events:{"click a":"onClick"},initialize:function(e){this.closeOnInstall=e.closeOnInstall,this.image=new s({model:this.model,type:"channel",width:150})},bindings:{".media-title":{modelAttribute:"title"},".installed-icon":{
modelAttribute:"installed",manual:!0,autohide:!0,formatter:function(e,t){var n=e?i("Installed"):"";return this.ui.subtitle.text(n),e}}},onRender:function(){this.image.setElement(this.ui.poster)},onClose:function(){this.image.close()},onClick:function(e){e.preventDefault(),n.trigger("show:modal",new a({model:this.model,closeOnInstall:this.closeOnInstall}))}});return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(18),i(272)],s=function(e,t){"use strict";var i=e.extend({tagName:"ul",
className:"tile-list media-tile-list channel-tile-list",itemView:t});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(269),i(272)],s=function(e,t){"use strict";var i=e.extend({tagName:"ul",className:"tile-list media-tile-list horizontal-media-tile-list channel-tile-list hidden",itemView:t});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1106),i(6),i(5),i(63)],s=function(e,t,i,n){"use strict";var s={artist:"music",movie:"film",photo:"picture",
show:"display"},a=t.ItemView.extend({tagName:"li",className:"dashboard-section-list-item",template:e,ui:{loadingBtn:".btn-loading"},events:{"click .edit-section-btn":"onEditClick"},initialize:function(e){this.showActions=e.showActions,this.showActions&&(this.listenTo(this.model,"change:refreshing",this.onRefreshingChange),this.refreshing=this.model.get("refreshing"))},serializeData:function(){var e=this.model.server,t=this.model.toJSON();return{section:t,serverID:e.id,icon:s[t.type],showActions:this.showActions,
refreshing:this.refreshing}},bindings:{".section-title":{modelAttribute:"title"}},onEditClick:function(e){e.preventDefault(),i.trigger("show:modal",new n({server:this.model.server,model:this.model}))},onRefreshingChange:function(e,t){this.ui.loadingBtn.toggleClass("active",t)}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(18),i(790)],s=function(e,t){"use strict";var i=e.extend({tagName:"ul",className:"list dashboard-server-list",itemView:t,sorted:!0});return i}.apply(t,n),
!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1107),i(4),i(2),i(6),i(7),i(5),i(34),i(17),i(11),i(9),i(102),i(788),i(63),i(83),i(713)],s=function(e,t,i,n,s,a,r,o,l,c,u,d,h,p,f){"use strict";var m=n.CompositeView.extend({tagName:"li",className:"dashboard-server-list-item",template:e,itemView:d,itemViewContainer:".dashboard-section-list",itemViewOptions:function(){return{showActions:this.showActions}},ui:{actions:".side-bar-actions",selectServerBtn:".select-server-btn",updateBtnLabel:".update-btn .dropdown-truncated-label",
secureConnectionIcon:".secure-connection-icon"},modelEvents:{"change:connected":"onConnectedChange","change:shared":"onSharedChange","change:activeConnection":"onActiveConnectionChange"},events:{"click .select-server-btn":"onSelectServerClick","click .add-library-btn":"onAddLibraryClick","click .settings-btn":"onSettingsClick","click .share-btn":"onShareClick","click .update-btn":"onUpdateClick","click .optimize-btn":"onOptimizeClick","click .clean-bundles-btn":"onCleanBundlesClick","click .empty-trash-btn":"onEmptyTrashClick",
"click .mixed-content-btn":"onMixedContentClick","click .http-fallback-btn":"onHttpFallbackClick","click .remove-btn":"onRemoveClick"},onlyAfterRender:["onPrimaryServerChange","onSectionsChange","onSectionRefreshingChange"],initialize:function(){this.collection=this.model.get("sections"),this.user=c.get("user"),this.listenTo(c,"change:primaryServer",this.onPrimaryServerChange),this.listenTo(this.user,"change:signedIn",this.onSignedInChange),this.setup()},setup:function(){var e=this.model.get("isFullOwnedServer");
if(this.allowCancel=this.model.supports("cancelAllUpdates")&&e,this.allowChannels=this.model.supports("sharedChannels")&&this.model.get("allowChannelAccess"),this.showActions=e,this.model.get("connected")){this.allowCancel&&this.collection.length&&this.updateRefreshingStatus();var n=!this.collection.populatePromise,s=n?"reset":"add remove",a=this.collection.fetch({reset:n});this.agents=new u([],{server:this.model});var r=this.model===c.get("primaryServer"),l=o.get("hasDismissedPremiumMusicAlert");
if(e&&r&&!l){var d=this.agents.populate(),h=t.when(a,d);h.done(i.bind(this.checkForPremiumMusic,this))}this.allowCancel&&(this.listenTo(this.collection,s,this.onSectionsChange),this.listenTo(this.collection,"change:refreshing",this.onSectionRefreshingChange))}},serializeData:function(){var e=c.get("primaryServer"),t=this.model.toJSON(),i=t.presence&&!t.available,n=this.model.canAllowHttpFallback(),s=r.isHostedHttps&&i,a=!n&&!r.isHostedHttps&&i;return{server:t,selected:e&&this.model.id===e.id,signedIn:this.user.get("signedIn"),
canBePrimary:this.model.canBePrimary(),showActions:this.showActions,showChannels:(this.showActions||this.allowChannels)&&o.get("dashboardChannelsEnabled"),showPlaylists:this.model.supports("playlists")&&this.model.get("isFullServer"),showUnavailableMessage:!s&&!a&&!t.available,showMixedContentMessage:s,showHttpFallbackMessage:a,hasRefreshingSection:this.hasRefreshingSection,hasSecureConnection:this.model.hasSecureConnection()}},updateRefreshingStatus:function(){this.hasRefreshingSection=this.collection.some(function(e){
return e.get("refreshing")})},getUpdateLabel:function(){return s(this.hasRefreshingSection?"Cancel Update":"Update Libraries")},checkForPremiumMusic:function(){if(!this.user.get("signedIn"))return void this.listenToOnce(this.user,"change:signedIn",this.checkForPremiumMusic);if(this.user.hasPlexPass()&&this.model.supports("premiumMusic")){var e=this.collection.findWhere({agent:"com.plexapp.agents.lastfm"}),t=this.collection.findWhere({agent:"com.plexapp.agents.plexmusic"}),i=this.agents.get("com.plexapp.agents.plexmusic");
e&&!t&&i&&a.trigger("show:bar","alertbar",new f({model:this.model,seed:e}))}},onPrimaryServerChange:function(e,t){this.ui.selectServerBtn.toggleClass("selected",t&&t.id===this.model.id)},onSignedInChange:function(e,t){this.ui.actions.toggleClass("signed-in",!!t)},onSectionsChange:function(){this.updateRefreshingStatus(),this.ui.updateBtnLabel.text(this.getUpdateLabel())},onSectionRefreshingChange:function(e,t){this.hasRefreshingSection=t,this.ui.updateBtnLabel.text(this.getUpdateLabel())},onConnectedChange:function(e,t){
this.setup(),this.render()},onSharedChange:function(e,t){this.render()},onActiveConnectionChange:function(e,t){this.ui.secureConnectionIcon.toggleClass("hidden",!e.hasSecureConnection())},onSelectServerClick:function(e){e.preventDefault();var t=this.ui.selectServerBtn;t.hasClass("disabled")||t.hasClass("selected")||c.set("primaryServer",this.model)},onAddLibraryClick:function(e){e.preventDefault(),a.trigger("show:modal",new h({server:this.model,redirect:!0}))},onSettingsClick:function(e){e.preventDefault(),
a.trigger("navigate","serverSettings",{serverID:this.model.id})},onShareClick:function(e){e.preventDefault(),a.trigger("show:modal",new p({defaultPaneType:"ownedServer",defaultPaneID:this.model.id}))},onUpdateClick:function(e){e.preventDefault();var t=this.allowCancel?this.hasRefreshingSection:!1;l.execute("updateLibrary",{server:this.model,cancel:t})},onOptimizeClick:function(e){e.preventDefault(),l.execute("optimize",{server:this.model})},onCleanBundlesClick:function(e){e.preventDefault(),l.execute("cleanBundles",{
server:this.model})},onEmptyTrashClick:function(e){e.preventDefault(),l.execute("emptyTrash",{server:this.model})},onMixedContentClick:function(e){e.preventDefault(),l.execute("redirectToHttp")},onHttpFallbackClick:function(e){e.preventDefault();var t=l.execute("allowHttpFallback",this.model);t.done(this.whenRendered(function(){this.render()}))},onRemoveClick:function(e){e.preventDefault(),l.execute("removeServer",{server:this.model})}});return m}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){
var n,s;n=[i(81),i(18),i(792)],s=function(e,t,i){"use strict";var n=t.extend({mixins:[e],tagName:"ul",className:"tile-list media-tile-list album-tile-list",itemView:i});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1108),i(2),i(48),i(70),i(30)],s=function(e,t,i,n,s){"use strict";var a=i.extend({className:"poster-item media-tile-list-item",template:e,ui:n.prototype.ui,initialize:function(e){i.prototype.initialize.apply(this,arguments),this.image=new s({model:this.model,
type:"album",width:180})},bindings:t.extend({},i.prototype.bindings,{".media-title":{modelAttribute:"title"},".media-subtitle-1":{modelAttribute:"year"}}),onMoreClick:function(e){n.prototype.onMoreClick.apply(this,arguments)}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(172),i(794)],s=function(e,t,i){"use strict";var n=t.extend({tagName:"ul",className:"list media-list track-list show-context",itemView:i,itemViewOptions:function(){return{collection:this.collection
}}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1109),i(2),i(4),i(6),i(5),i(57),i(11),i(35),i(50),i(103),i(71)],s=function(e,t,i,n,s,a,r,o,l,c,u){"use strict";var d=n.ItemView.extend({tagName:"li",className:"striped-list-item",template:e,ui:{index:".track-index span",actions:".track-actions",dropdown:".track-actions-dropdown"},events:{"click .track-list-inner-item":"onClick","click .track-music-video-btn":"onMusicVideoClick","click .track-more-btn":"onMoreClick",
"hide.bs.dropdown .track-actions-dropdown":"onDropdownHide"},collectionEvents:{sort:"onCollectionSort"},initialize:function(e){t.bindAll(this,"onResize"),this.artistTitle=e.artistTitle,this.parentMediaActions=e.mediaActions,this.mediaActions=new l({},{item:this.model}),this.playQueueManager=this.model.server.get("playQueueManager"),this.listenTo(this.playQueueManager,"change:playQueue:audio",this.onPlayQueueChange),this.listenTo(this.playQueueManager,"remove:playQueue:audio",this.onRemovePlayQueue),
this.onPlayQueueChange(this.playQueueManager.getFor(this.model)),s.trigger("content.subscribe:resize",this.onResize)},serializeData:function(){return{index:this.getIndex(),selected:this.selected}},getIndex:function(){return this.collection.indexOf(this.model)+1},bindings:{".track-parent-index":{modelAttribute:"parentIndex"},".track-title":{modelAttribute:"title"},".track-subtitle-1":{modelAttribute:"originalTitle",autohide:function(e){var t=e&&this.artistTitle&&e.toLowerCase()!==this.artistTitle.toLowerCase();
return this.$el.toggleClass("show-subtitle",!!t),t}},".track-context":{modelAttribute:"duration",autohide:!0,formatter:function(e){return e?a(e):!1}},".track-music-video-btn":{model:"mediaActions",modelAttribute:"showPlayMusicVideo",manual:!0,autohide:!0}},onRender:function(){var e=this.playQueueManager.getFor(this.model);if(e){var t=e.get("selectedItem");t&&this.model.get("key")===t.get("key")&&this.$(".track-list-item").addClass("current-track")}},onClose:function(){this.dropdown&&this.dropdown.close(),
s.trigger("content.unsubscribe:resize",this.onResize)},onResize:function(e){this.containerSize=e},onCollectionSort:function(){this.ui.index.text(this.getIndex())},onClick:function(e){e.preventDefault(),r.execute("playMedia",{item:this.model,siblings:!0})},onMusicVideoClick:function(e){e.preventDefault(),e.stopImmediatePropagation();var i=this.model.server.getSectionForItem(this.model);if(!t.isEmpty(i)){var n=new o({key:this.model.get("primaryExtraKey"),type:"clip",librarySectionUUID:i.get("uuid")
},{server:this.model.server,section:this.model.section});r.execute("playMedia",{item:n})}},onMoreClick:function(e){e.preventDefault(),e.stopImmediatePropagation(),this.dropdown=new c({model:this.model}),this.ui.dropdown.append(this.dropdown.render().el),this.ui.dropdown.addClass("open"),this.$el.addClass("force-hover");var t=i(e.currentTarget),n=this.ui.actions.position().top,s=this.dropdown.getPosition(t,this.containerSize,n);this.ui.dropdown.css(s)},onDropdownHide:function(e){this.dropdown&&(this.dropdown.close(),
this.dropdown=null,this.$el.removeClass("force-hover"))},onPlayQueueSelectedItemChange:function(e,t){var i=!(!t||this.model.get("key")!==t.get("key"));this.$(".track-list-item").toggleClass("current-track",i)},onPlayQueueChange:function(e){e&&this.listenTo(e,"change:selectedItem",this.onPlayQueueSelectedItemChange)},onRemovePlayQueue:function(e){this.stopListening(e),this.$(".track-list-item").removeClass("current-track")}});return d}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;
n=[i(18),i(796)],s=function(e,t){"use strict";var i=e.extend({className:"artwork-options-list",itemView:t});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1110),i(6),i(97),i(96),i(43)],s=function(e,t,i,n,s){"use strict";var a=t.Layout.extend({tagName:"span",template:e,regions:{poster:".media-poster"},initialize:function(e){var t=e.artworkType,a=150;"art"===t?a=240:"banner"===t&&(a=520),this.$el.addClass(t),this.image=new s({className:"media-poster-image",model:this.model,
modelAttribute:"thumb",placeholderClass:n[t],width:a,height:i.getPosterHeight(t,a)})},bindings:{".artwork-option":{modelAttribute:"selected",manual:!0,formatter:function(e,t){t.toggleClass("selected",e)}}},onRender:function(){this.poster.show(this.image)}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(809),i(798)],s=function(e,t){"use strict";var i=e.extend({tagName:"ul",className:"list media-list media-details-list episode-details-list show-context",itemView:t});
return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1111),i(2),i(26),i(171),i(30)],s=function(e,t,i,n,s){"use strict";var a=n.extend({className:"striped-list-item media-list-item media-details-list-item episode-details-list-item",template:e,showRating:!0,bypassShowUnwatchedIconsSetting:!0,createImageView:function(){this.image=new s({model:this.model,type:"episode",getUrl:this.getPosterUrl,height:110})},getPosterUrl:function(e){return e},bindings:t.extend({},n.prototype.bindings,{
".media-title":{modelAttribute:"title"},".media-index":{modelAttribute:"index",autohide:!0,formatter:function(e,t){return t.toggleClass("date",null==e),i.getEpisodeIndex({episodeIndex:e,date:this.model.get("originallyAvailableAt"),noLeadingZero:!0})}}})});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(172),i(800)],s=function(e,t){"use strict";var i=e.extend({tagName:"ul",className:"list media-list episode-list show-context",itemView:t});return i}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(1112),i(2),i(26),i(48)],s=function(e,t,i,n){"use strict";var s=n.extend({className:"striped-list-item media-list-item episode-list-item",template:e,showRating:!0,bypassShowUnwatchedIconsSetting:!0,regions:{rating:".media-rating"},bindings:t.extend({},n.prototype.bindings,{".media-title":{modelAttribute:"title"},".media-index":{modelAttribute:"index",autohide:!0,formatter:function(e,t){return t.toggleClass("date",null==e),i.getEpisodeIndex({episodeIndex:e,date:this.model.get("originallyAvailableAt"),
noLeadingZero:!0})}}})});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(81),i(18),i(802)],s=function(e,t,i){"use strict";var n=t.extend({mixins:[e],tagName:"ul",className:"tile-list media-tile-list episode-tile-list",itemView:i});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1113),i(2),i(26),i(48),i(70),i(30)],s=function(e,t,i,n,s,a){"use strict";var r=n.extend({className:"poster-item media-tile-list-item episode-tile-list-item",template:e,
ui:s.prototype.ui,bypassShowUnwatchedIconsSetting:!0,initialize:function(e){n.prototype.initialize.apply(this,arguments),this.image=new a({model:this.model,type:"episode",width:250})},bindings:t.extend({},n.prototype.bindings,{".media-title":{modelAttribute:"title"},".media-subtitle-1":{modelAttribute:"index",formatter:function(e){return i.getEpisodeIndex({episodePrefix:"Episode {1}",episodeIndex:e,date:this.model.get("originallyAvailableAt"),noLeadingZero:!0})}},".media-count-badge":{modelAttribute:"Media",
formatter:function(e){return e&&e.length||0},autohide:function(e){return e>1}}}),onMoreClick:function(e){s.prototype.onMoreClick.apply(this,arguments)}});return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1114),i(7),i(243),i(48),i(70),i(30)],s=function(e,t,i,n,s,a){"use strict";var r=n.extend({className:"poster-item media-tile-list-item extra-tile-list-item",template:e,ui:s.prototype.ui,initialize:function(e){n.prototype.initialize.apply(this,arguments),this.image=new a({
model:this.model,type:"clip",width:250})},bindings:{".media-title":{modelAttribute:"title"},".media-subtitle-1":{modelAttribute:"extraType",formatter:function(e){if(e){var t=i.get(e);return t&&t.title}}}}});return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(18),i(805),i(253)],s=function(e,t,i){"use strict";var n=e.extend({mixins:[i],tagName:"ul",itemView:t,className:"list"});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1115),i(6)],s=function(e,t){
"use strict";var i=t.ItemView.extend({tagName:"li",template:e,className:"striped-list-item",initialize:function(e){this.item=e.item}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(18),i(808),i(807)],s=function(e,t,i){"use strict";var n=e.extend({tagName:"ul",className:"list match-result-list",itemView:t,emptyView:i});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1116),i(6)],s=function(e,t){"use strict";var i=t.ItemView.extend({template:e
});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1117),i(6),i(11),i(804)],s=function(e,t,i,n){"use strict";var s=t.Layout.extend({tagName:"li",className:"striped-list-item match-result-list-item row",template:e,ui:{matchExtendedInfo:".match-extended-info"},regions:{childrenRegion:".children-region"},events:{"click .match-result":"onClick"},initialize:function(e){this.item=e.item},onRender:function(){var e=this.model.get("children");if(e){var t=e.first();t&&"track"===t.get("type")&&(this.ui.matchExtendedInfo.removeClass("hidden"),
this.childrenRegion.show(new n({collection:e})))}},onClick:function(e){e.preventDefault(),i.execute("match",{item:this.item,guid:this.model.id,name:this.model.get("name"),children:this.model.get("children")})}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(81),i(18)],s=function(e,t){"use strict";var i=t.extend({mixins:[e]});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1120),i(6),i(26)],s=function(e,t,i){"use strict";var n=t.ItemView.extend({
className:"hidden",template:e,bindings:{".media-progress-pct":{modelAttribute:"viewOffset",manual:!0,formatter:function(e,t){var n=this.model,s="track"===n.get("type")?0:i.getPercentWatched(e,n.get("duration"));s&&t.css("width",s+"%"),this.$el.toggleClass("hidden",!s)}}}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(18),i(70)],s=function(e,t){"use strict";var i=e.extend({tagName:"ul",className:"tile-list media-tile-list show-context",itemView:t});return i}.apply(t,n),
!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(18),i(813)],s=function(e,t){"use strict";var i=e.extend({tagName:"ul",className:"tile-list photo-tile-list",itemView:t});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1122),i(5),i(11),i(48),i(30)],s=function(e,t,i,n,s){"use strict";var a=n.extend({className:"poster-item media-tile-list-item",template:e,ui:{poster:".media-poster"},events:{"click a":"onClick"},initialize:function(e){n.prototype.initialize.apply(this,arguments),
this.image=new s({model:this.model,type:this.type,width:200})},bindings:{".collection-title-container":{modelAttribute:"title",manual:!0,autohide:function(e){return"photoAlbum"===this.type}},".collection-title":{modelAttribute:"title"}},onClick:function(e){e.preventDefault(),"photoAlbum"===this.type?t.trigger("navigate","details",{serverID:this.model.server.id,key:this.model.get("key")}):i.execute("playMedia",{item:this.model,siblings:this.canPlaySiblings(),autoplay:!1})}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(1061),i(2),i(26),i(78),i(273)],s=function(e,t,i,n,s){"use strict";var a=s.extend({template:e,className:"play-queue-list-item",attributes:function(){return{"data-play-queue-id":this.model.get("playQueueItemID")||this.model.get("ratingKey")}},events:{"click a":"onPlayClick","click .delete-btn":"onDeleteClick"},posterWidth:{video:70},bindings:t.extend({".media-primary-subtitle":{modelAttribute:"grandparentTitle",modelListeners:["grandparentTitle","duration"],formatter:function(e){
var t=e;this.model.parent&&(t=t||this.model.parent.get("parentTitle"),this.model.parent.parent&&(t=this.model.parent.parent.get("title")));var i=this.model.get("duration");return"movie"===this.type&&i&&(t=n(i)),t||""}},".media-secondary-subtitle":{modelAttribute:"parentTitle",modelListeners:["parentTitle","index"],formatter:function(e){var t=e;return this.model.parent&&(t=t||this.model.parent.get("title")),"episode"===this.type&&(t=i.getSeasonEpisodeIndex({seasonIndex:this.model.get("parentIndex"),
episodeIndex:this.model.get("index"),date:this.model.get("originallyAvailableAt")})),t&&(t=" - "+t),t||""}}},s.prototype.bindings),serializeData:function(){var e=this.model.server.get("playQueueManager"),t=e.getFor(this.model);return{type:this.type,canDelete:!t.get("isRadio")}},onPlayClick:function(e){e.preventDefault(),this.trigger("skip",this.model.get("key"))},onDeleteClick:function(e){e.preventDefault(),e.stopImmediatePropagation(),this.trigger("remove",this.model)}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(4),i(2),i(87),i(18),i(816)],s=function(e,t,i,n,s){"use strict";var a=n.extend({tagName:"ol",className:"list media-list playlist-items",itemView:s,sorted:!0,itemEvents:{remove:"onItemRemove"},initialize:function(e){this.canEdit=!this.model.get("smart")},onRender:function(){this.sortable&&this.sortable.destroy(),this.canEdit&&(this.sortable=new i(this.el,{onUpdate:t.bind(this.onItemMove,this),handle:".sortable-handle",animation:200,scroll:!0,scrollSensitivity:100,scrollSpeed:2
}))},onItemRemove:function(e,t,i){this.model.removeItem(i)},onItemMove:function(t){var i=e(t.item).data("playlist-id"),n=e(t.item).prev().data("playlist-id");this.model.moveItem(i,n)},onClose:function(){this.sortable&&this.sortable.destroy()}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1123),i(2),i(5),i(26),i(94),i(78),i(57),i(11),i(273)],s=function(e,t,i,n,s,a,r,o,l){"use strict";var c=l.extend({className:"striped-list-item media-list-item playlist-item",template:e,
events:{"click .delete-btn":"onDeleteClick","click .playlist-inner-item":"onClick","click .media-details":"onDetailsClick","click .media-primary-subtitle":"onGrandparentClick","click .media-secondary-subtitle":"onParentClick"},posterWidth:{video:103,photo:59},attributes:function(){return{"data-playlist-id":this.model.get("playlistItemID")}},bindings:t.extend({".media-primary-subtitle":{modelAttribute:"grandparentTitle",formatter:function(e){var t=e;return this.model.parent&&(t=t||this.model.parent.get("parentTitle"),
this.model.parent.parent&&(t=this.model.parent.parent.get("title"))),"movie"===this.type&&(t=""),t||""}},".media-secondary-subtitle":{modelAttribute:"parentTitle",modelListeners:["parentTitle","index","year"],formatter:function(e){var t=e;return this.model.parent&&(t=t||this.model.parent.get("title")),"episode"===this.type?t=n.getSeasonEpisodeIndex({noLeadingZero:!0,seasonPrefix:"Season {1}",episodePrefix:" - Episode {1}",seasonIndex:this.model.get("parentIndex"),episodeIndex:this.model.get("index"),
date:this.model.get("originallyAvailableAt")}):"movie"===this.type&&(t=this.model.get("year")),t||""}},".media-duration":{modelAttribute:"duration",formatter:function(e){return"photo"===this.type?s(this.model.get("originallyAvailableAt")):"track"===this.type?r(e):a(e)}}},l.prototype.bindings),initialize:function(e){l.prototype.initialize.apply(this,arguments),this.canEdit=e&&e.canEdit,"track"===this.type&&(this.playQueueManager=this.model.server.get("playQueueManager"),this.listenTo(this.playQueueManager,"change:playQueue:audio",this.onPlayQueueChange),
this.listenTo(this.playQueueManager,"remove:playQueue:audio",this.onRemovePlayQueue),this.onPlayQueueChange(this.playQueueManager.getFor(this.model)))},serializeData:function(){return{canEdit:this.canEdit,hasDetails:"track"!==this.type&&"photo"!==this.type,type:this.type}},navigateTo:function(e,t){e&&(t.preventDefault(),t.stopPropagation(),i.trigger("navigate","details",{serverID:this.model.server.id,key:e}))},onRender:function(){if(l.prototype.onRender.apply(this,arguments),"track"===this.type){
var e=this.playQueueManager.getFor(this.model);if(!e)return;var t=e.get("selectedItem");t&&this.model.get("key")===t.get("key")&&this.$el.addClass("current-track")}},onClick:function(e){e.preventDefault(),e.stopImmediatePropagation(),o.execute("playMedia",{item:this.model,siblings:!0})},onDeleteClick:function(e){e.preventDefault(),e.stopImmediatePropagation(),this.trigger("remove",this.model.get("playlistItemID"))},onDetailsClick:function(e){var t=this.model.get("type");"track"!==t&&"photo"!==t&&this.navigateTo(this.model.get("key"),e);
},onParentClick:function(e){this.navigateTo(this.model.get("parentKey"),e)},onGrandparentClick:function(e){this.navigateTo(this.model.get("grandparentKey"),e)},onPlayQueueSelectedItemChange:function(e,t){var i=!(!t||this.model.get("key")!==t.get("key"));this.$el.toggleClass("current-track",i)},onPlayQueueChange:function(e){e&&this.listenTo(e,"change:selectedItem",this.onPlayQueueSelectedItemChange)},onRemovePlayQueue:function(e){this.stopListening(e),this.$el.removeClass("current-track")}});return c;
}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(81),i(18),i(818)],s=function(e,t,i){"use strict";var n=t.extend({mixins:[e],tagName:"ul",className:"tile-list media-tile-list season-tile-list",itemView:i});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1124),i(2),i(7),i(48),i(70),i(30)],s=function(e,t,i,n,s,a){"use strict";var r=n.extend({className:"poster-item media-tile-list-item",template:e,ui:s.prototype.ui,initialize:function(e){n.prototype.initialize.apply(this,arguments),
this.image=new a({model:this.model,type:"season",width:150})},bindings:t.extend({},n.prototype.bindings,{".media-title":{modelAttribute:"title"},".media-subtitle-1":{modelAttribute:"leafCount",formatter:function(e){return null==e?"":1===e?i("{1} episode",e):i("{1} episodes",e)}},".unwatched-count-badge":{modelAttribute:"unviewedLeafCount",autohide:function(e){var t=this.model.server.get("shared"),i=this.model.server.get("multiuser");return t&&!i?!1:"album"===this.type?!1:!!e}}}),onMoreClick:function(e){
s.prototype.onMoreClick.apply(this,arguments)}});return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(18),i(820)],s=function(e,t){"use strict";var i=e.extend({tagName:"ul",className:"list select-list select-playlist-list minimal-scroll",itemView:t});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1125),i(6),i(128)],s=function(e,t,i){"use strict";var n=t.ItemView.extend({tagName:"li",className:"striped-list-item select-list-item",template:e,
ui:{poster:".playlist-poster"},initialize:function(){this.image=new i({model:this.model,width:40})},onRender:function(){this.image.setElement(this.ui.poster)},onClose:function(){this.image.close()}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(253),i(172),i(822)],s=function(e,t,i,n){"use strict";var s=i.extend({mixins:[t],initialize:function(){i.prototype.initialize.apply(this,arguments),this.listenTo(this.collection,"change:parentIndex",e.debounce(this.onParentIndexChange));
},tagName:"ul",className:"list media-list track-list show-context",itemView:n,onParentIndexChange:function(e,t){null!=e.previous("parentIndex")&&this.collection.fetch()}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1126),i(2),i(4),i(6),i(5),i(57),i(11),i(252),i(35),i(50),i(103),i(71)],s=function(e,t,i,n,s,a,r,o,l,c,u,d){"use strict";var h=n.ItemView.extend({mixins:[o],tagName:"li",template:e,className:"striped-list-item",ui:{actions:".track-actions",container:".track-list-inner-item",
dropdown:".track-actions-dropdown"},events:{"mousenter .track-list-inner-item":"onMouseEnter","mouseleave .track-list-inner-item":"onMouseLeave","mousedown .track-list-inner-item":"onMouseDown","click .track-list-inner-item":"onClick","click .track-music-video-btn":"onMusicVideoClick","click .track-edit-btn":"onEditClick","click .track-more-btn":"onMoreClick","hide.bs.dropdown .track-actions-dropdown":"onDropdownHide"},onlyAfterRender:["select","deselect"],initialize:function(e){t.bindAll(this,"onResize"),
this.artistTitle=e.artistTitle,this.parentMediaActions=e.mediaActions,this.mediaActions=new c({},{item:this.model}),this.playQueueManager=this.model.server.get("playQueueManager"),this.listenTo(this.playQueueManager,"change:playQueue:audio",this.onPlayQueueChange),this.listenTo(this.playQueueManager,"remove:playQueue:audio",this.onRemovePlayQueue),this.onPlayQueueChange(this.playQueueManager.getFor(this.model)),s.trigger("content.subscribe:resize",this.onResize)},serializeData:function(){return this.shared=this.model.server.get("shared"),
this.synced=!this.model.server.get("isFullServer"),{showEdit:!this.shared&&!this.synced,selected:this.selected}},bindings:{".track-index span":{modelAttribute:"index",formatter:function(e){return 1>e?"":e}},".track-parent-index":{modelAttribute:"parentIndex"},".track-title":{modelAttribute:"title"},".track-subtitle-1":{modelAttribute:"originalTitle",autohide:function(e){var t=e&&this.artistTitle&&e.toLowerCase()!==this.artistTitle.toLowerCase();return this.$el.toggleClass("show-subtitle",!!t),t}},
".track-context":{modelAttribute:"duration",autohide:!0,formatter:function(e){return e?a(e):!1}},".track-music-video-btn":{model:"mediaActions",modelAttribute:"showPlayMusicVideo",manual:!0,autohide:!0}},onRender:function(){var e=this.playQueueManager.getFor(this.model);if(e){var t=e.get("selectedItem");t&&this.model.get("key")===t.get("key")&&this.$(".track-list-item").addClass("current-track")}},onClose:function(){this.dropdown&&this.dropdown.close(),s.trigger("content.unsubscribe:resize",this.onResize);
},onResize:function(e){this.containerSize=e},onClick:function(e){this.stopTrackingSelecting(e,function(){e.preventDefault(),r.execute("playMedia",{item:this.model,siblings:!0})})},onMusicVideoClick:function(e){e.preventDefault(),e.stopImmediatePropagation();var i=this.model.server.getSectionForItem(this.model);if(!t.isEmpty(i)){var n=new l({key:this.model.get("primaryExtraKey"),type:"clip",librarySectionUUID:i.get("uuid")},{server:this.model.server,section:this.model.section});r.execute("playMedia",{
item:n})}},onEditClick:function(e){e.preventDefault(),e.stopImmediatePropagation(),s.trigger("show:modal",new d({mediaActions:this.mediaActions}))},onMoreClick:function(e){e.preventDefault(),e.stopImmediatePropagation(),this.dropdown=new u({model:this.model}),this.ui.dropdown.append(this.dropdown.render().el),this.ui.dropdown.addClass("open"),this.$el.addClass("force-hover");var t=i(e.currentTarget),n=this.ui.actions.position().top,s=this.dropdown.getPosition(t,this.containerSize,n);this.ui.dropdown.css(s);
},onDropdownHide:function(e){this.dropdown&&(this.dropdown.close(),this.dropdown=null,this.$el.removeClass("force-hover"))},onPlayQueueSelectedItemChange:function(e,t){var i=!(!t||this.model.get("key")!==t.get("key"));this.$(".track-list-item").toggleClass("current-track",i)},onPlayQueueChange:function(e){e&&this.listenTo(e,"change:selectedItem",this.onPlayQueueSelectedItemChange)},onRemovePlayQueue:function(e){this.stopListening(e),this.$(".track-list-item").removeClass("current-track")},select:function(){
this.ui.container.addClass("selected")},deselect:function(){this.ui.container.removeClass("selected")}});return h}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(4),i(2),i(87),i(18),i(825),i(824)],s=function(e,t,i,n,s,a){"use strict";var r=n.extend({tagName:"ol",className:"list media-list playlist-items",itemView:s,emptyView:a,sorted:!0,onRender:function(){this.sortable&&this.sortable.destroy(),this.sortable=new i(this.el,{onUpdate:t.bind(this.onItemMove,this),handle:".sortable-handle",
animation:200,scroll:!0,scrollSensitivity:100,scrollSpeed:2})},onClose:function(){this.sortable&&this.sortable.destroy()},onItemMove:function(t){var i=e(t.item).data("generator-id"),n=e(t.item).prev().data("generator-id");this.collection.parent.moveItem(i,n)}});return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1127),i(6)],s=function(e,t){"use strict";var i=t.ItemView.extend({template:e});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1128),i(2),i(6),i(7),i(5),i(97),i(692),i(11),i(128),i(133),i(883)],
s=function(e,t,i,n,s,a,r,o,l,c,u){"use strict";var d=i.ItemView.extend({className:"striped-list-item media-list-item playlist-item version-generator-item",tagName:"li",template:e,ui:{poster:".media-poster",status:".generator-status"},events:{"click .playlist-inner-item":"onClick","click .retry-btn":"onRetryClick","click .edit-btn":"onEditClick","click .delete-btn":"onDeleteClick"},attributes:function(){return{"data-generator-id":this.model.id}},initialize:function(e){this.transcodeJobs=e.transcodeJobs,
this.pausedSetting=e.pausedSetting;var t=60;this.compositeImage=new l({model:this.model,width:a.getPosterWidth("movie",t),height:t,rows:1,columns:1}),this.listenTo(this.transcodeJobs,"reset add remove",this.onTranscodeJobsChange)},resetState:function(){var e=["converting",r.PENDING,r.COMPLETE,r.FAILED];this.ui.status.removeClass(e.join(" "))},getState:function(e){return this.transcodeJobs.findWhere({generatorID:this.model.id})?"converting":e.itemsFailedCount>0?r.FAILED:e.state},bindings:{".generator-title":{
modelAttribute:"title"},".generator-target":{modelAttribute:"target"},".generator-status":{modelAttribute:"Status",manual:!0,formatter:function(e,t){this.resetState(),t.addClass(this.getState(e))}},".generator-status-failed-message":{modelAttribute:"Status",formatter:function(e){if(e.itemsFailedCount){var t=e.itemsFailedCount;return 1===t?n("1 failed item"):n("{1} failed items",t)}return n("Failed")}},".retry-btn":{modelAttribute:"Status",manual:!0,autohide:function(e){return this.getState(e)===r.FAILED;
}}},onRender:function(){this.compositeImage.setElement(this.ui.poster)},onClose:function(){this.compositeImage.close()},onTranscodeJobsChange:function(){var e=this.getState(this.model.get("Status"));this.resetState(),this.ui.status.addClass(e)},onClick:function(e){e.preventDefault(),s.trigger("show:modal",new u({model:this.model,collection:this.model.get("metadataItems"),transcodeJobs:this.transcodeJobs,pausedSetting:this.pausedSetting}))},onRetryClick:function(e){e.preventDefault(),e.stopImmediatePropagation(),
o.execute("reprocessVersionGenerator",{generator:this.model})},onEditClick:function(e){e.preventDefault(),e.stopImmediatePropagation(),s.trigger("show:modal",new c({model:this.model}))},onDeleteClick:function(e){e.preventDefault(),e.stopImmediatePropagation(),o.execute("deleteVersionGenerator",{generator:this.model})}});return d}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(18),i(827)],s=function(e,t){"use strict";var i=e.extend({tagName:"ul",className:"list version-generator-metadata-list",
itemView:t});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1129),i(6),i(7),i(26),i(691),i(11),i(30),i(270)],s=function(e,t,i,n,s,a,r,o){"use strict";var l=t.Layout.extend({tagName:"li",className:"striped-list-item version-generator-metadata-list-item",template:e,ui:{poster:".media-poster"},regions:{statusRegion:".conversion-status-region"},events:{"click .enable-btn":"onEnableClick","click .retry-btn":"onRetryClick"},modelEvents:{"change:processingState":"onProcessingStateChange"
},initialize:function(e){this.generator=e.generator,this.transcodeJobs=e.transcodeJobs,this.pausedSetting=e.pausedSetting,this.type=this.model.get("type"),this.image=new r({model:this.model,type:"movie",height:60,modelAttribute:"episode"===this.type?"grandparentThumb":"thumb"})},bindings:{".generator-metadata-title":{modelAttribute:"title",formatter:function(e){return this.model.get("grandparentTitle")||this.model.get("parentTitle")||e}},".generator-metadata-episode-index":{modelAttribute:"index",
autohide:!0,formatter:function(e){return"episode"===this.type?n.getSeasonEpisodeIndex({seasonIndex:this.model.get("parentIndex"),episodePrefix:" \xb7 E{1}",episodeIndex:e,date:this.model.get("originallyAvailableAt"),noLeadingZero:!0}):void 0}},".generator-metadata-year":{modelAttribute:"year",autohide:!0,formatter:function(e){return"movie"===this.type?e:void 0}},".conversion-status-failed-message":{modelAttribute:"processingStateContext",formatter:function(e){return this.getErrorMessage(e)}}},getErrorMessage:function(e){
var t=s.contexts;switch(e){case t.FILE_UNAVAILABLE:return i("File unavailable");case t.METADATA_ERROR:return i("Invalid metadata");case t.PROFILE_ERROR:return i("Invalid profile");case t.ANALYSIS_ERROR:return i("Unable to analyze")}return i("Unable to convert")},onRender:function(){this.image.setElement(this.ui.poster),this.statusRegion.show(new o({model:this.model,generator:this.generator,transcodeJobs:this.transcodeJobs,pausedSetting:this.pausedSetting,initialState:this.model.get("processingState"),
initialErrorMessage:this.getErrorMessage(this.model.get("processingStateContext"))}))},onClose:function(){this.image.close()},onProcessingStateChange:function(e,t){this.statusRegion.currentView&&this.statusRegion.currentView.enterState(t)},onEnableClick:function(e){e.preventDefault(),a.execute("enableVersionGenerator",{generator:this.model.parent,ratingKey:this.model.id})},onRetryClick:function(e){e.preventDefault(),a.execute("reprocessVersionGenerator",{generator:this.model.parent,ratingKey:this.model.id
})}});return l}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(18),i(829)],s=function(e,t){"use strict";var i=e.extend({tagName:"ul",className:"list alpha-bar-list",itemView:t});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1130),i(6)],s=function(e,t){"use strict";var i=t.ItemView.extend({tagName:"li",className:"alpha-bar-list-item",template:e,events:{"click a":"onClick"},onClick:function(e){e.preventDefault(),this.model.section.set("currentFirstCharacter",this.model);
}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1131),i(4),i(6)],s=function(e,t,i){"use strict";var n=i.ItemView.extend({className:"label-list section-current-filters-list",template:e,modelEvents:{"change:currentFilters":"render"},events:{"click .remove-filter-btn":"onRemoveFilterClick"},initialize:function(e){e.disabled&&this.$el.addClass("disabled")},serializeData:function(){return{currentFilters:this.model.get("currentFilters")}},onRemoveFilterClick:function(e){
e.preventDefault();var i=t(e.currentTarget).data("key");this.trigger("removeAllFilters",i)}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(18),i(832)],s=function(e,t){"use strict";var i=e.extend({tagName:"ul",className:"list side-bar-list",itemView:t,initialize:function(e){var t=this.collection.section;e.disabled?this.$el.addClass("disabled"):this.listenTo(t,"change:currentType",this.onCurrentTypeChange)},onCurrentTypeChange:function(e,t){this.collection.fetch({
reset:!0,scope:"page"})}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1132),i(2),i(6)],s=function(e,t,i){"use strict";var n=i.ItemView.extend({tagName:"li",template:e,ui:{btn:"a",selectedIcon:".selected-icon"},events:{"click .boolean-btn":"onBooleanFilterClick","click .filter-btn":"onFilterClick"},onlyAfterRender:["onCurrentFiltersChange"],initialize:function(){this.listenTo(this.model.section,"change:currentFilters",this.onCurrentFiltersChange)},serializeData:function(){
return{filter:this.model.toJSON(),selected:this.isCurrentFilter()}},isCurrentFilter:function(){var e=this.model.section.get("currentFilters");return!!t.findWhere(e,{key:this.model.id})},onBooleanFilterClick:function(e){e.preventDefault();var t={key:this.model.id,title:this.model.get("title"),value:1};this.ui.btn.hasClass("selected")?this.trigger("removeFilter",t):this.trigger("addFilter",t)},onFilterClick:function(e){e.preventDefault(),this.trigger("showOptions",this.model)},onCurrentFiltersChange:function(e,t){
var i=this.isCurrentFilter();this.ui.btn.toggleClass("selected",i),this.ui.selectedIcon.toggleClass("hidden",!i)}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1133),i(4),i(6),i(834)],s=function(e,t,i,n){"use strict";var s=i.CompositeView.extend({classname:"filter-option-list-search-container",template:e,itemView:n,itemViewContainer:".side-bar-list",query:"",ui:{searchForm:"#filter-options-search-form",searchInput:"#filter-options-search",loading:"#filter-options-loading"
},events:{"keyup #filter-options-search":"onSearchKeyUp","submit #filter-options-search-form":"onSearchSubmit","click .filter-options-deselect-btn":"onDeselectClick"},initialize:function(){this.originalCollection=this.collection,this.listenToOnce(this.originalCollection,"reset",this.onCollectionReset),this.collection.fetch({reset:!0,scope:"page"})},serializeData:function(){return{showSearch:this.collection.length>20,query:this.query,showLoading:!this.collection.length}},search:function(){this.query=t.trim(this.ui.searchInput.val()),
this.query?this.rebase(this.originalCollection.search(this.query)):this.rebase(this.originalCollection)},selectExactMatch:function(){this.collection.each(function(e){var t=e.get("title");if(t&&t.toLowerCase()===this.query.toLowerCase()){var i={key:e.parent.id,title:t,value:e.id};this.trigger("addFilter",this,i)}},this)},onCollectionReset:function(e){var t=e.length>20;this.ui.searchForm.toggleClass("hidden",!t),this.ui.loading.addClass("hidden")},onSearchKeyUp:function(e){this.search()},onSearchSubmit:function(e){
e.preventDefault(),this.search(),this.query&&this.selectExactMatch()},onDeselectClick:function(e){e.preventDefault(),this.trigger("removeAllFilters",this.collection.parent.id)}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1134),i(2),i(6)],s=function(e,t,i){"use strict";var n=i.ItemView.extend({tagName:"li",template:e,ui:{btn:"a",selectedIcon:".selected-icon"},events:{"click a":"onClick"},onlyAfterRender:["onCurrentFiltersChange"],initialize:function(){this.listenTo(this.model.section,"change:currentFilters",this.onCurrentFiltersChange);
},serializeData:function(){return{filterOption:this.model.toJSON(),selected:this.isCurrentFilter()}},isCurrentFilter:function(){var e=this.model.section.get("currentFilters"),i=t.findWhere(e,{key:this.model.parent.id});if(!i)return!1;var n=i.values,s=t.find(n,t.bind(function(e){return e===this.model.get("key")},this));return!!s},onClick:function(e){e.preventDefault();var t={key:this.model.parent.id,title:this.model.get("title"),value:this.model.id};this.ui.btn.hasClass("selected")?this.trigger("removeFilter",t):this.trigger("addFilter",t);
},onCurrentFiltersChange:function(e,t){var i=this.isCurrentFilter();this.ui.btn.toggleClass("selected",i),this.ui.selectedIcon.toggleClass("hidden",!i)}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1135),i(6)],s=function(e,t){"use strict";var i=t.ItemView.extend({tagName:"li",template:e,events:{"click a":"onClick"},initialize:function(){var e=this.model.section.get("currentSort");if(!e){var t=this.model.get("isDefault");t&&(this.model.set("selected",!0),this.model.section.set("currentSort",this.model,{
silent:!0}),this.model.section.trigger("default:currentSort"))}this.listenTo(this.model.section,"change:currentSort",this.onCurrentSortChange)},bindings:{".sort-btn":{modelAttribute:"selected",manual:!0,formatter:function(e,t){t.toggleClass("selected",e)}},".desc-icon":{modelAttribute:"direction",manual:!0,formatter:function(e,t){t.toggleClass("hidden","desc"!==e)}},".asc-icon":{modelAttribute:"direction",manual:!0,formatter:function(e,t){t.toggleClass("hidden","asc"!==e)}}},onCurrentSortChange:function(e,t){
t&&this.model.id!==t.id&&this.model.set({selected:!1})},onClick:function(e){e.preventDefault();var t=this.model.section.get("currentSort");t&&t.id===this.model.id?t.reverseSortDirection():this.model.set({selected:!0}),this.model.section.set("currentSort",this.model,{silent:!0}),this.model.section.trigger("change:currentSort",this.model.section,this.model)}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(6),i(4),i(837)],s=function(e,t,i){"use strict";var n=e.CollectionView.extend({
tagName:"ul",className:"list browse-directory-list",itemView:i,selectedFilePath:null,events:{"click a":"onDirectoryClick"},collectionEvents:{reset:"onReset"},startLoadingItem:function(e){this.selectedFilePath&&this.unselectItem(this.selectedFilePath),this.selectedFilePath=e;var t=this.children.findByModel(e);t&&t.select(!0)},stopLoadingItem:function(e){var t=this.children.findByModel(e);t&&t.select(!1)},unselectItem:function(e){this.selectedFilePath=null;var t=this.children.findByModel(e);t&&t.unselect();
},onReset:function(){this.parentFilePath&&this.collection.add(this.parentFilePath,{at:0})},onDirectoryClick:function(e){e.preventDefault();var i=t(e.currentTarget),n=i.data("key"),s=this.collection.get(n)||this.parentFilePath;this.trigger("change:path",s),this.options.isRoot||(s.parent?(this.parentFilePath=s.parent.clone(),this.parentFilePath.set({title:".. [Back]",isBackShortcut:!0})):this.parentFilePath=null)}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1136),i(6)],
s=function(e,t){"use strict";var i=t.ItemView.extend({tagName:"li",className:"striped-list-item browse-directory-list-item",template:e,ui:{link:"a",spinner:".loading"},serializeData:function(){return{filePath:this.model.toJSON(),isRoot:!this.model.parent}},select:function(e){this.ui.link.addClass("selected"),this.ui.spinner.toggleClass("hidden",!e)},unselect:function(){this.ui.link.removeClass("selected"),this.ui.spinner.addClass("hidden")}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){
var n,s;n=[i(18),i(839)],s=function(e,t){"use strict";var i=e.extend({tagName:"ul",className:"agents-nav nav nav-pills nav-pills-sm",itemView:t});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1137),i(6)],s=function(e,t){"use strict";var i=t.ItemView.extend({tagName:"li",template:e,bindings:{a:{modelAttribute:"selected",manual:!0,formatter:function(e){this.$el.toggleClass("active",!!e)}}}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;
n=[i(87),i(18),i(841)],s=function(e,t,i){"use strict";var n=t.extend({tagName:"ul",className:"list contributor-list",itemView:i,events:{"change input[type=checkbox]":"save",update:"save"},save:function(){var e=[];this.$(":checked").each(function(t){e.push(this.name)}),this.trigger("save",e.join(","))},onRender:function(){this.sortable=new e(this.$el[0],{draggable:".card-sortable",animation:200})},onClose:function(){this.sortable.destroy()}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){
var n,s;n=[i(1138),i(2),i(6),i(5),i(65),i(129),i(861)],s=function(e,t,i,n,s,a,r){"use strict";var o=i.ItemView.extend({tagName:"li",className:"card card-sortable",template:e,events:{"change input[type=checkbox]":"onEnabledChange","click .settings-btn":"onSettingsClick","click .info-btn":"onInfoClick"},initialize:function(){this.attribution=this.model.get("attribution"),this.attribution.fetch()},bindings:{".info-btn":{model:"attribution",modelAttribute:"content",manual:!0,autohide:!0},".settings-btn":{
modelAttribute:"hasPrefs",manual:!0,autohide:!0}},onEnabledChange:function(e){this.model.set("enabled",e.target.checked)},onSettingsClick:function(e){e.preventDefault();var i=new s([],{server:this.model.server,url:"/:/plugins/"+this.model.id+"/prefs"});i.fetch().done(t.bind(function(){n.trigger("show:modal",new a({model:this.model,collection:i}))},this))},onInfoClick:function(e){e.preventDefault(),n.trigger("show:modal",new r({model:this.model}))}});return o}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(18),i(844),i(843)],s=function(e,t,i){"use strict";var n=e.extend({tagName:"ul",className:"list card-tile-list",itemView:t,emptyView:i});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1139),i(6)],s=function(e,t){"use strict";var i=t.ItemView.extend({template:e});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1140),i(6),i(12),i(228),i(98),i(233),i(11)],s=function(e,t,i,n,s,a,r){"use strict";var o=t.ItemView.extend({
tagName:"li",className:"card-tile-list-item card-2-col-item",template:e,ui:{icon:".device-icon",syncInfo:".sync-info"},events:{"click .remove-device-btn":"onRemoveClick"},isMediaServer:function(){if(null==this.isServer){var e=this.model.get("product").toLowerCase();this.isServer="plex media server"===e}return this.isServer},bindings:{".device-icon":{modelAttribute:"platform",manual:!0,formatter:function(e,t){var i=n.getIcon(e);t.addClass("device-icon-"+i)}},".name":{modelAttribute:"name",autohide:!1
},".version":{modelAttribute:"productVersion",autohide:!1},".product":{modelAttribute:"product",autohide:!1},".platform":{modelAttribute:"platform",autohide:function(e){return e&&this.isMediaServer()}},".platform-version":{modelAttribute:"platformVersion",autohide:function(e){return e&&this.isMediaServer()}},".device":{modelAttribute:"device",autohide:!1},".last-seen":{modelAttribute:"lastSeenAt",autohide:!0,formatter:function(e,t){return e?i.unix(e).fromNow():void 0}},".sync-count":{modelAttribute:"SyncList",
autohide:!1,formatter:function(e){if(e){var t,i=e.itemsCompleteCount;return i&&i>0&&(t=[i,s("item",i)].join(" "),this.ui.syncInfo.removeClass("hidden")),t}}},".sync-size":{modelAttribute:"SyncList",autohide:!1,formatter:function(e){if(e){var t,i=e.totalSize;return i&&i>0&&(t=["(",a(i),")"].join("")),t}}}},onRemoveClick:function(e){e.preventDefault(),this.isMediaServer()?r.execute("removeServer",{device:this.model}):r.execute("removeDevice",{device:this.model})}});return o}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(18),i(847),i(846)],s=function(e,t,i){"use strict";var n=e.extend({tagName:"ul",className:"list card-tile-list",itemView:t,emptyView:i,sorted:!0});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1141),i(6)],s=function(e,t){"use strict";var i=t.ItemView.extend({template:e});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1142),i(6),i(5),i(11),i(49),i(280),i(83)],s=function(e,t,i,n,s,a,r){"use strict";var o=t.Layout.extend({
tagName:"li",className:"card-tile-list-item card-2-col-item",template:e,ui:{poster:".card-poster"},regions:{details:".card-details"},events:{"click .edit-btn":"onEditClick","click .delete-btn":"onDeleteClick"},initialize:function(e){this.serverShares=this.model.get("serverShares"),this.image=new s({model:this.model,type:"friend",width:80})},bindings:{".username":{modelAttribute:"title"}},onRender:function(){this.image.setElement(this.ui.poster),this.details.show(new a({model:this.model}))},onClose:function(){
this.image.close()},onEditClick:function(e){e.preventDefault(),i.trigger("show:modal",new r({model:this.model}))},onDeleteClick:function(e){e.preventDefault(),n.execute("removeFriend",{friend:this.model})}});return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(18),i(281),i(849)],s=function(e,t,i){"use strict";var n=e.extend({tagName:"ul",className:"list card-tile-list",itemView:t,emptyView:i,sorted:!0,isEmpty:function(e){return!this.collection||this.collection.length<2},
addChildView:function(t,i,n){this.isEmpty(this.collection)?this.showEmptyView():this._showingEmptyView?this.render():this.children.findByModel(t)||e.prototype.addChildView.apply(this,arguments)},showEmptyView:function(){this._showingEmptyView||this.children.each(function(e){this.removeChildView(e)},this),e.prototype.showEmptyView.apply(this,arguments)}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1144),i(2),i(6),i(9),i(281)],s=function(e,t,i,n,s){"use strict";var a=i.Layout.extend({
template:e,regions:{card:".centered-home-user-container"},initialize:function(e){this.itemViewOptions=e},serializeData:function(){var e=n.get("user");return{hasPlexPass:e.hasPlexPass(),plexPassUrl:e.server.get("plexPassUrl")}},onRender:function(){var e=n.get("user"),i=e.get("homeUsers");i.length&&this.card.show(new s(t.extend({},this.itemViewOptions,{model:i.first()})))}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1146),i(2),i(12),i(6),i(7),i(98),i(11),i(9),i(49)],
s=function(e,t,i,n,s,a,r,o,l){"use strict";var c=n.ItemView.extend({tagName:"li",className:"card-tile-list-item card-2-col-item",template:e,ui:{poster:".card-poster"},events:{"click .accept-btn":"onAcceptClick","click .delete-btn":"onDeleteClick"},initialize:function(e){this.subset=this.model.collection.subset,this.image=new l({model:this.model,type:"friend",width:80})},serializeData:function(){return{showAccept:"requests"===this.subset}},bindings:{".username":{modelAttribute:"friendlyName"},".user-summary":{
modelAttribute:"Server",autohide:!0,formatter:function(e){if("requested"===this.subset){var n=this.model.get("createdAt");if(n){var r=Math.min(n,i().unix());return s("invite sent {1}",i.unix(r).fromNow())}return s("invite sent to {1}",this.model.get("email"))}var o=this.model.get("friend"),l=this.model.get("server"),c=this.model.get("home");if(l){var u=t.reduce(e,function(e,t){return e+=t.numLibraries},0),d=a(s("library"),u,s("libraries"));return c?s("wants you to join their home and share {1} {2} with you",u,d):o?s("wants to be friends and share {1} {2} with you",u,d):s("wants to share {1} {2} with you",u,d);
}return s(c?"wants you to join their home":"wants to be friends")}}},onRender:function(){this.image.setElement(this.ui.poster)},onClose:function(){this.image.close()},onAcceptClick:function(e){e.preventDefault(),r.execute("acceptInvite",{invite:this.model})},onDeleteClick:function(e){e.preventDefault(),r.execute("rejectInvite",{invite:this.model,subset:this.subset})}});return c}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(18),i(852)],s=function(e,t){"use strict";var i=e.extend({
tagName:"ul",className:"list card-tile-list",itemView:t});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1147),i(6),i(5),i(11),i(63)],s=function(e,t,i,n,s){"use strict";var a={artist:"music",movie:"film",photo:"picture",show:"display"},r=t.ItemView.extend({tagName:"li",className:"card-tile-list-item",template:e,events:{"click .edit-section-btn":"onEditClick","click .delete-section-btn":"onDeleteClick"},serializeData:function(){var e=this.model.server,t=this.model.toJSON();
return{section:t,serverID:e.id,icon:a[t.type]}},bindings:{".section-title":{modelAttribute:"title"}},onEditClick:function(e){e.preventDefault(),i.trigger("show:modal",new s({server:this.model.server,model:this.model}))},onDeleteClick:function(e){e.preventDefault(),n.execute("deleteSection",{section:this.model})}});return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(18),i(854)],s=function(e,t){"use strict";var i=e.extend({className:"list announcement-list",itemView:t});return i;
}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1148),i(6),i(43)],s=function(e,t,i){"use strict";var n=t.ItemView.extend({className:"announcement-list-item",template:e,ui:{thumb:".thumb"},initialize:function(){this.image=new i({url:this.model.get("thumb")})},onRender:function(){this.image.setElement(this.ui.thumb)},onClose:function(){this.image.close()}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(18),i(856)],s=function(e,t){"use strict";
var i=e.extend({tagName:"ul",className:"list select-list select-friends-list dark-scrollbar",itemView:t});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1149),i(6),i(49)],s=function(e,t,i){"use strict";var n=t.ItemView.extend({tagName:"li",className:"striped-list-item select-list-item",template:e,ui:{poster:".user-poster"},initialize:function(e){this.image=new i({model:this.model,type:"friend",width:80})},onRender:function(){this.image.setElement(this.ui.poster)},
onClose:function(){this.image.close()}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(18),i(858)],s=function(e,t){"use strict";var i=e.extend({tagName:"ul",className:"list card-tile-list",itemView:t});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1150),i(2),i(11),i(171)],s=function(e,t,i,n){"use strict";var s=n.extend({template:e,className:"card-tile-list-item card-2-col-item",events:{"click .play-btn":"onPlayClick","click .mark-watched-btn":"onMarkWatchedClick",
"click .mark-unwatched-btn":"onMarkUnwatchedClick","click .delete-btn":"onDeleteClick"},serializeData:function(){var e=n.prototype.serializeData.apply(this,arguments);return e},bindings:t.extend({},n.prototype.bindings,{".media-summary":{autohide:!0,formatter:function(){return this.model.get("message")||this.model.get("summary")}},".mark-unwatched-btn":{modelAttribute:"viewCount",manual:!0,autohide:function(e){return e>0}},".mark-watched-btn":{modelAttribute:"viewCount",manual:!0,autohide:function(e){
return 0===e}}}),onPlayClick:function(e){e.preventDefault(),i.execute("playMedia",{item:this.model,siblings:this.canPlaySiblings()})},onMarkWatchedClick:function(e){e.preventDefault(),i.execute("markWatched",{item:this.model})},onMarkUnwatchedClick:function(e){e.preventDefault(),i.execute("markUnwatched",{item:this.model})},onDeleteClick:function(e){e.preventDefault(),this.model.destroy()}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1151),i(2),i(68),i(254),i(31),i(836)],
s=function(e,t,i,n,s,a){"use strict";var r=s.extend({name:"addFolderModal",className:"add-folder-modal modal fade",template:e,events:t.extend({"submit form":"onSubmitForm"},s.prototype.events),ui:{path:'input[name="path"]'},regions:{rootList:".home-directory-container",childrenList:".path-container"},initialize:function(e){s.prototype.initialize.apply(this,arguments),this.rootPathCollection=new n([],{server:e.server}),this.childrenPathCollection=new n([],{server:e.server}),this.loadRootPaths()},loadRootPaths:function(){
this.rootPathCollection.fetch().done(this.whenRendered(function(){var e=this.rootPathCollection.where({home:!0}),i=t.first(e)||this.rootPathCollection.first();this.rootList.currentView.startLoadingItem(i),this.loadChildrenPaths(i)}))},loadChildrenPaths:function(e){i.abortAll("addFolderModal");var t=e.get("children"),n=t.fetch({scope:"addFolderModal"});n.done(this.whenRendered(function(){this.ui.path.val(e.get("path")),this.childrenPathCollection.reset(t.models),this.rootList.currentView.stopLoadingItem(e);
}))},onRender:function(){s.prototype.onRender.apply(this,arguments);var e=new a({isRoot:!0,collection:this.rootPathCollection}),t=new a({collection:this.childrenPathCollection});this.listenTo(e,"change:path",this.onRootPathChange),this.listenTo(t,"change:path",this.onChildrenPathChange),this.rootList.show(e),this.childrenList.show(t)},onRootPathChange:function(e){this.childrenList.currentView.parentFilePath=null,this.rootList.currentView.startLoadingItem(e),this.loadChildrenPaths(e)},onChildrenPathChange:function(e){
this.childrenList.currentView.startLoadingItem(e),this.loadChildrenPaths(e)},onSubmitForm:function(e){e.preventDefault(),this.trigger("add:folder",this.ui.path.val()),this.hide()}});return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1152),i(2),i(4),i(7),i(5),i(119),i(31),i(64)],s=function(e,t,i,n,s,a,r,o){"use strict";var l=o.extend({name:"addToCollectionModal",className:"add-to-collection-modal select-modal modal modal-sm fade",template:e,ui:{addBtn:".add-btn",message:".message"
},events:t.extend({"click .collection":"onCollectionClick","keyup .message":"onMessageKeyUp","click .add-btn":"onAddClick"},r.prototype.events),onlyAfterRender:["onReset"],initialize:function(e){o.prototype.initialize.apply(this,arguments),this.loading=!0,this.models=e.items,this.model=t.first(this.models),this.collectionIDs=[],this.filter=new a({filter:"collection",flterType:"string",type:"filter",title:"Collection"},{server:this.model.server,section:this.model.section,standalone:!0}),this.collections=this.filter.get("options"),
this.collections.fetch().always(t.bind(this.onReset,this))},serializeData:function(){return{loading:this.loading,collections:this.filter.get("options").toJSON()}},toggleAddButton:function(){var e=this.ui.message.val().trim();this.ui.addBtn.toggleClass("disabled",!this.collectionIDs.length&&!e)},onReset:function(){this.loading=!1,this.render()},onCollectionClick:function(e){e.preventDefault();var n=i(e.currentTarget),s=n.data("value");n.hasClass("selected")?this.collectionIDs.splice(t.indexOf(this.collectionIDs,s),1):this.collectionIDs.push(s),
n.toggleClass("selected"),this.toggleAddButton()},onMessageKeyUp:function(){this.toggleAddButton()},onAddClick:function(e){e.preventDefault();var a=this.ui.addBtn;if(!a.isDisabled()){a.addClass("active");var r=this.ui.message.val().trim(),o=[];r&&o.push(this.model.batchAdd(this.models,"collection",r)),t.each(this.collectionIDs,function(e){var t=this.collections.get(e);o.push(this.model.batchAdd(this.models,"collection",t.get("title")))},this);var l=i.when.apply(i,o);l.done(t.bind(this.hide,this)),
l.fail(function(){a.removeClass("active"),s.trigger("show:alert",{type:"error",message:n("There was a problem adding to this collection.")})})}}});return l}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1154),i(31),i(43)],s=function(e,t,i){"use strict";var n=t.extend({name:"agentInfoModal",className:"agent-info-modal modal fade",template:e,regions:{icon:".agent-icon-container"},serializeData:function(){return{agent:this.model.toJSON(),attribution:this.model.get("attribution").get("content")
}},onRender:function(){t.prototype.onRender.apply(this,arguments),this.icon.show(new i({model:this.model,url:"/system/agents/attribution/image?identifier="+this.model.id,className:"agent-icon",width:100,height:100}))}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1155),i(2),i(5),i(11),i(31),i(30)],s=function(e,t,i,n,s,a){"use strict";var r=s.extend({name:"channelModal",className:"channel-modal modal fade",template:e,ui:{poster:".media-poster",installBtn:".install-btn",
updateBtn:".update-btn",uninstallBtn:".uninstall-btn"},events:t.extend({"click .browse-btn":"onBrowseClick","click .install-btn":"onInstallClick","click .update-btn":"onUpdateClick","click .restart-btn":"onRestartClick","click .reset-btn":"onResetClick","click .uninstall-btn":"onUninstallClick"},s.prototype.events),initialize:function(e){s.prototype.initialize.apply(this,arguments),this.closeOnInstall=e.closeOnInstall,this.image=new a({model:this.model,type:"channel",width:200})},serializeData:function(){
return{channel:this.model.toJSON(),serverID:this.model.server.id,agent:/com.plexapp.agents./.test(this.model.id)}},bindings:{".installed-actions-container":{modelAttribute:"installed",manual:!0,autohide:!0},".uninstalled-actions-container":{modelAttribute:"installed",manual:!0,autohide:function(e){return!e}}},onRender:function(){s.prototype.onRender.apply(this,arguments),this.image.setElement(this.ui.poster)},onClose:function(){this.image.close()},onBrowseClick:function(e){e.preventDefault();var n=this.model.get("key"),s=t.last(n.split("/"));
i.trigger("navigate","channel",{serverID:this.model.server.id,channelID:s}),this.hide()},onInstallClick:function(e){e.preventDefault();var i=this.ui.installBtn;if(!i.hasClass("active")){i.addClass("active");var s=n.execute("installChannel",{channel:this.model});s.done(t.bind(function(){this.closeOnInstall&&this.hide()},this)),s.always(function(){i.removeClass("active")})}},onUpdateClick:function(e){e.preventDefault();var t=this.ui.updateBtn;if(!t.hasClass("active")){t.addClass("active");var i=n.execute("updateChannel",{
channel:this.model,skipConfirmation:!0});i.always(function(){t.removeClass("active")})}},onRestartClick:function(e){e.preventDefault(),n.execute("restartChannel",{channel:this.model})},onResetClick:function(e){e.preventDefault(),n.execute("resetChannel",{channel:this.model})},onUninstallClick:function(e){e.preventDefault();var t=this.ui.uninstallBtn;if(!t.hasClass("active")){t.addClass("active");var i=n.execute("uninstallChannel",{channel:this.model,skipConfirmation:!0});i.always(function(){t.removeClass("active");
})}}});return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1160),i(2),i(4),i(7),i(31),i(740),i(167),i(920),i(921)],s=function(e,t,i,n,s,a,r,o,l){"use strict";var c=s.extend({mixins:[r],name:"fixIncorrectMatch",className:"fix-incorrect-match-modal modal modal-lg fade",template:e,panes:{form:{constructor:o},results:{constructor:l}},ui:{searchBtn:".search-btn"},regions:{paneRegion:".pane-region",autoMatchDropdownRegion:".auto-match-dropdown-region"},events:t.extend({"click .auto-match-agent":"hide",
"click .match-result":"hide","click .search-options-btn":"onSearchOptionsClick","click .cancel-btn":"onCancelClick","click .search-btn":"onSearchClick","submit #fix-incorrect-match-form":"onSearchSubmit"},s.prototype.events),onlyAfterRender:["showPane","updateSearchBtn"],initialize:function(){s.prototype.initialize.apply(this,arguments),o.prototype.setupAgents.apply(this),l.prototype.setupResults.apply(this),this.showPane("results")},serializeData:function(){var e={location:this.model.getLocation(),
showNavigation:!this.model.isPlexMusicItem()};return e},updateSearchBtn:function(e){this.ui.searchBtn.toggleClass("disabled","form"!==e)},fetchResults:function(e){var i=t.reduce(e.serializeArray(),function(e,t){return e[t.name]=t.value,e},{manual:1});this.model.results.fetch({reset:!0,data:i,processData:!0,timeout:0})},bindings:{".modal-title-text":{modelAttribute:"guid",formatter:function(e){return n(/com\.plexapp\.agents\.none\:\/\//.test(e)?"Match":"Fix Incorrect Match")}}},onRender:function(){
s.prototype.onRender.apply(this,arguments),this.autoMatchDropdownRegion.show(new a({model:this.model,collection:this.model.agentsProxy}))},onPaneShow:function(e){this.updateSearchBtn(e)},onSearchOptionsClick:function(e){e.preventDefault(),this.showPane("form")},onCancelClick:function(e){e.preventDefault(),"results"!==this.selectedPane?this.showPane("results"):this.hide()},onSearchClick:function(e){e.preventDefault();var t=i(e.currentTarget);if(!t.isDisabled()){var n=t.closest("form");this.fetchResults(n),
this.showPane("results")}},onSearchSubmit:function(e){e.preventDefault();var t=i(e.currentTarget),n=t.find("search-btn");n.isDisabled()||(this.fetchResults(t),this.showPane("results"))}});return c}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1161),i(2),i(22)],s=function(e,t,i){"use strict";var n=i.extend({template:e,initialize:function(e){i.prototype.initialize.apply(this,arguments),this.server=e.server},serializeData:function(){return this.server.toJSON()}});return n}.apply(t,n),
!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1162),i(2),i(4),i(7),i(5),i(31)],s=function(e,t,i,n,s,a){"use strict";var r=a.extend({name:"importPlaylistsModal",className:"import-playlists-modal modal fade",template:e,ui:{importBtn:".import-btn",sections:"#section-list",importAll:"#import-all"},events:t.extend({"click .import-btn":"onImportClick"},a.prototype.events),initialize:function(e){a.prototype.initialize.apply(this,arguments),this.server=e.server,this.musicSections=e.server.get("sections").where({
type:"artist"})},serializeData:function(){var e=t.map(this.musicSections,function(e){return e.pick("key","title")});return{showSections:e.length>1,sections:e}},onImportClick:function(e){e.preventDefault();var a=this.ui.importBtn;a.addClass("active");var r=this.ui.sections.val(),o="/playlists/import/itunes?sectionID="+r;this.ui.importAll[0].checked&&(o+="&force=1");var l=t.extend(this.server.getXHROptions(o),{type:"PUT"}),c=i.ajax(l);c.done(t.bind(function(){s.trigger("show:alert",{type:"success",
message:n("Playlists have been imported.")}),this.server.get("playlists").get("items").fetch(),this.hide()},this)),c.fail(function(){s.trigger("show:alert",{type:"error",message:n("There was a problem importing.")})})}});return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1165),i(2),i(4),i(11),i(53),i(31)],s=function(e,t,i,n,s,a){"use strict";var r=a.extend({name:"localServerTestModal",className:"local-server-test-modal modal modal-sm fade",template:e,ui:{loadingIcon:".loading",
serverFound:".server-found",serverNotFound:".server-not-found"},events:t.extend({"click .confirm-btn":"onConfirm"},a.prototype.events),initialize:function(){this.bindAllWhenRendered("onConnectionTestSuccess","onConnectionTestFailure");var e=new s,t=e.addConnection({address:"127.0.0.1",port:"32400"}),i=n.execute("testServerImage",{server:e,connection:t});i.done(this.onConnectionTestSuccess),i.fail(this.onConnectionTestFailure),i.always(this.whenRendered(function(){this.ui.loadingIcon.addClass("hidden");
}))},onConnectionTestSuccess:function(){this.ui.serverFound.removeClass("hidden")},onConnectionTestFailure:function(){this.ui.serverNotFound.removeClass("hidden")},onConfirm:function(){this.hide()}});return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1170),i(31)],s=function(e,t){"use strict";function i(e){return e?e.split("\n"):[]}var n=t.extend({name:"releaseNotesModal",template:e,serializeData:function(){var e=this.model.toJSON();return e.version=e.version.replace(/\-.*/gi,""),
e.added=i(e.added),e.fixed=i(e.fixed),e}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1171),i(64)],s=function(e,t){"use strict";var i=t.extend({name:"selectDeviceModal",template:e,serializeData:function(){return{devices:this.collection.toJSON()}}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1172),i(2),i(64)],s=function(e,t,i){"use strict";var n=i.extend({name:"SelectMediaFileModal",template:e,serializeData:function(){var e=this.model.get("Media");
return{medias:e}}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1173),i(57),i(64)],s=function(e,t,i){"use strict";var n=i.extend({name:"selectOffsetModal",template:e,initialize:function(e){i.prototype.initialize.apply(this,arguments),this.offset=e.offset},serializeData:function(){return{offset:this.offset,formattedOffset:t(this.offset)}}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1175),i(31),i(778)],s=function(e,t,i){"use strict";
var n=t.extend({name:"syncStatusModal",template:e,regions:{list:".sync-status-list-container"},onRender:function(){t.prototype.onRender.apply(this,arguments),this.list.show(new i({collection:this.collection,itemViewOptions:{syncItem:this.model}}))}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1176),i(2),i(31)],s=function(e,t,i){"use strict";var n=i.extend({name:"termsModal",template:e,isForced:!0,ui:{confirmBtn:".confirm-btn"},events:t.extend({"click .confirm-btn":"onConfirmClick"
},i.prototype.events),onConfirmClick:function(e){e.preventDefault();var i=this.ui.confirmBtn;if(!i.isDisabled()){i.addClass("active");var n=this.collection.first().save({AcceptedEULA:!0});n.always(t.bind(this.hide,this))}}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1177),i(6)],s=function(e,t){"use strict";var i=t.ItemView.extend({className:"modal-body",template:e,events:{"click .try-again-link":"onTryAgainClick"},serializeData:function(){return{status:this.options.status
}},onTryAgainClick:function(e){e.preventDefault(),this.triggerMethod("request:state","loading")}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1178),i(6)],s=function(e,t){"use strict";var i=t.ItemView.extend({className:"convert-location-container form-group",template:e,events:{"change select[name=storageLocation]":"onLocationChange"},serializeData:function(){return{selectedLocationID:this.model.get("locationID"),locations:this.model.section&&this.model.section.get("locations").toJSON()
}},onLocationChange:function(e){this.model.set("locationID",parseInt(e.currentTarget.value,10))}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1180),i(2),i(6),i(46)],s=function(e,t,i,n){"use strict";var s=i.ItemView.extend({className:"convert-target-container form-group",template:e,ui:{targetTitleInput:".convert-target-title"},events:{"change select[name=target]":"onTargetChange","keydown input[name=targetTitle]":"onTitleKeyDown","change input[name=targetTitle]":"onTitleChange",
"change select[name=targetProfile]":"onProfileChange","change select[name=targetQuality]":"onQualityChange"},initialize:function(e){this.targets=e.targets,this.profiles=e.profiles;var i=this.model.get("Device").profile;i?this.selectedProfile=this.profiles.get(i):this.selectedProfile=this.profiles.findWhere({selected:!0}),this.availableCustomQualities=n.getAvailableQualities().reverse();var s=this.model.get("MediaSettings").maxVideoBitrate;if(s){var a=n.getNearestIndexToBitrate(s);this.selectedCustomQuality=n.getQualityByIndex(a);
}else this.selectedCustomQuality=t.first(this.availableCustomQualities);this.model.isNew()||this.model.get("targetTagID")||this.$el.addClass("show-custom-target")},serializeData:function(){return{item:this.model.toJSON(),targets:this.targets.toJSON(),disableTarget:!this.model.isNew(),profiles:this.profiles.toJSON(),selectedProfile:this.selectedProfile.toJSON(),availableCustomQualities:this.availableCustomQualities,selectedCustomQuality:this.selectedCustomQuality}},updateDeviceProfile:function(e){
var t=this.model.get("Device");t.profile=this.selectedProfile.get("title")},updateMediaSettings:function(e){var t=this.model.get("MediaSettings");t.videoQuality=e.videoQuality,t.videoResolution=e.videoResolution,t.maxVideoBitrate=e.bitrate},onTargetChange:function(e){var t=parseInt(e.currentTarget.value,10);t>-1?(this.model.unset("target"),this.model.set({targetTagID:t,MediaSettings:{},Device:{}})):(this.model.set("target",this.ui.targetTitleInput.val()),this.model.unset("targetTagID"),this.updateDeviceProfile(this.selectedProfile),
this.updateMediaSettings(this.selectedCustomQuality)),this.$el.toggleClass("show-custom-target",-1===t)},onTitleKeyDown:function(e){190===e.which&&0===e.currentTarget.selectionStart&&e.preventDefault()},onTitleChange:function(e){this.model.set("target",e.currentTarget.value)},onProfileChange:function(e){this.selectedProfile=this.profiles.findWhere({title:e.currentTarget.value}),this.updateDeviceProfile(this.selectedProfile)},onQualityChange:function(e){var t=parseInt(e.currentTarget.value,10);this.selectedCustomQuality=n.getQualityByIndex(t),
this.updateMediaSettings(this.selectedCustomQuality)}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1181),i(2),i(4),i(6),i(7),i(5),i(15),i(77),i(74),i(101),i(286),i(875),i(874)],s=function(e,t,i,n,s,a,r,o,l,c,u,d,h){"use strict";var p=n.Layout.extend({template:e,ui:{submitBtn:".submit-btn"},regions:{policyRegion:".policy-region",targetsRegion:".targets-region",locationRegion:".location-region"},events:{"change input[name=title]":"onTitleChange","submit #convert-form":"onSubmit"
},initialize:function(e){if(this.playlist=e.playlist,this.targets=e.targets,this.profiles=e.profiles,this.model){this.tempModel=this.model.cloneDeep();var i=this.model.get("Location").librarySectionID;if(i){var n=new l({key:i},{server:this.model.server,onlyIfCached:!0});t.isEmpty(n)||(this.tempModel.section=n)}}else{var s,a=e.item,r=e.items,u=a.get("children")||a,d=a.server;if(a.get("isSection"))s=a;else{var h=d.getSectionForItem(a);t.isEmpty(h)||(s=h)}this.tempModel=new c({title:o.title(a,{items:r
}),targetTagID:this.targets.first().id,Location:{uri:o.uri(u,{items:r})}},{server:d,section:s})}},serializeData:function(){return{conversionItem:this.tempModel.toJSON(),isNew:this.tempModel.isNew(),showRemuxOnlyWarning:this.tempModel.server.get("transcoderVideoRemuxOnly")}},onRender:function(){this.policyRegion.show(new u({model:this.tempModel,isSync:!1,isCloudSync:!1})),this.targetsRegion.show(new d({model:this.tempModel,targets:this.targets,profiles:this.profiles})),this.locationRegion.show(new h({
model:this.tempModel}))},onTitleChange:function(e){this.tempModel.set("title",e.currentTarget.value)},onSubmit:function(e){e.preventDefault();var t=this.ui.submitBtn;if(!t.hasClass("active")){if(t.addClass("active"),!this.tempModel.get("targetTagID")&&!this.tempModel.get("target")){var i=this.tempModel.get("Device");this.tempModel.set("target",s("Custom: {1}",i.profile))}var n=this.playlist.addContent(this.tempModel);n.done(this.whenRendered(function(){this.model&&this.model.set(this.tempModel.toJSON()),
this.trigger("request:nextState")})),n.fail(this.whenRendered(function(e){var t=e.responseText,i=r.parseXML(t),n=i&&i.status;this.trigger("request:state","error",n)}))}}});return p}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1182),i(6)],s=function(e,t){"use strict";var i=t.ItemView.extend({className:"modal-body loading-container",template:e});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1184),i(6),i(5)],s=function(e,t,i){"use strict";var n=t.ItemView.extend({
className:"modal-body",template:e,events:{"click .status-link":"onStatusClick"},onStatusClick:function(e){e.preventDefault(),this.triggerMethod("request:nextState"),i.trigger("navigate","conversion",{serverID:this.options.server.id})}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1185),i(6)],s=function(e,t){"use strict";var i=t.ItemView.extend({className:"modal-body",template:e,events:{"click .try-again-link":"onTryAgainClick"},onTryAgainClick:function(e){e.preventDefault(),
this.triggerMethod("request:state","form")}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1186),i(2),i(6),i(25),i(46),i(537),i(538),i(17)],s=function(e,t,i,n,s,a,r,o){"use strict";var l=i.ItemView.extend({className:"sync-quality-container form-group",template:e,events:{"change select[name=videoQuality]":"onVideoQualityChange","change select[name=musicQuality]":"onMusicQualityChange","change select[name=photoQuality]":"onPhotoQualityChange"},initialize:function(e){
this.mediaSettings=this.model.get("MediaSettings"),t.defaults(this.mediaSettings,{audioBoost:o.get("audioBoost"),subtitleSize:o.get("subtitleSize")}),this.initVideoQuality(),this.initMusicQuality(),this.initPhotoQuality()},initVideoQuality:function(){this.availableVideoQualities=s.getAvailableQualities().reverse();var e=this.mediaSettings.maxVideoBitrate,t=e?s.getNearestIndexToBitrate(e):o.get(s.getSyncQualityAttribute());this.updateVideoQuality(s.getQualityByIndex(t))},initMusicQuality:function(){
this.availableMusicQualities=a.getAvailableQualities().reverse();var e=this.mediaSettings.musicBitrate,t=e?a.getNearestIndexToBitrate(e):o.get(a.getSyncQualityAttribute());this.updateMusicQuality(a.getQualityByIndex(t))},initPhotoQuality:function(){this.availablePhotoQualities=r.getAvailableQualities().reverse();var e=this.mediaSettings.photoQuality,t=e?r.getNearestIndexToQuality(e):o.get(r.getSyncQualityAttribute());this.updatePhotoQuality(r.getQualityByIndex(t))},serializeData:function(){var e=this.model.get("metadataType"),t=n.get(e);
return{typeElement:t.element,availableVideoQualities:this.availableVideoQualities,selectedVideoQuality:this.selectedVideoQuality,availableMusicQualities:this.availableMusicQualities,selectedMusicQuality:this.selectedMusicQuality,availablePhotoQualities:this.availablePhotoQualities,selectedPhotoQuality:this.selectedPhotoQuality}},updateVideoQuality:function(e){this.selectedVideoQuality=e,this.mediaSettings.videoQuality=e.videoQuality,this.mediaSettings.videoResolution=e.videoResolution,this.mediaSettings.maxVideoBitrate=e.bitrate;
},updateMusicQuality:function(e){this.selectedMusicQuality=e,this.mediaSettings.musicBitrate=e.bitrate},updatePhotoQuality:function(e){this.selectedPhotoQuality=e,this.mediaSettings.photoQuality=e.photoQuality,this.mediaSettings.photoResolution=e.photoResolution},saveQualityIndex:function(e,t){var i=parseInt(t,10);return o.save(e.getSyncQualityAttribute(),i),e.getQualityByIndex(i)},onVideoQualityChange:function(e){var t=this.saveQualityIndex(s,e.currentTarget.value);this.updateVideoQuality(t)},onMusicQualityChange:function(e){
var t=this.saveQualityIndex(a,e.currentTarget.value);this.updateMusicQuality(t)},onPhotoQualityChange:function(e){var t=this.saveQualityIndex(r,e.currentTarget.value);this.updatePhotoQuality(t)}});return l}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1187),i(2),i(6),i(77),i(25),i(11),i(9),i(147),i(286),i(880)],s=function(e,t,i,n,s,a,r,o,l,c){"use strict";var u={video:"movie",audio:"track",photo:"photo"},d=i.Layout.extend({template:e,ui:{submitBtn:".submit-btn"},regions:{
policyRegion:".policy-region",qualityRegion:".quality-region"},events:{"change input[name=title]":"onTitleChange","submit #sync-form":"onSubmit"},initialize:function(e){if(this.device=e.device,this.model)this.tempModel=this.model.cloneDeep();else{var t,i,a=e.item,l=e.items;a.get("isPlaylist")?(t=a,i=u[a.get("playlistType")]):(t=a.get("children")||a,i=s.getChildMediaType(a.get("type")).typeString),this.tempModel=new o({metadataType:i,title:n.title(a,{items:l}),rootTitle:this.getRootTitle(a),machineIdentifier:a.server.id,
clientIdentifier:this.device.get("clientIdentifier"),Location:{uri:n.uri(t,{items:l})}},{parent:a.server,server:r.get("user").server,device:this.device})}},serializeData:function(){return{syncItem:this.tempModel.toJSON(),isNew:this.tempModel.isNew()}},getRootTitle:function(e){return e.section?e.section.get("title"):e.channel?e.channel.get("title"):e.get("title")},onRender:function(){this.policyRegion.show(new l({model:this.tempModel,isSync:!0,isCloudSync:this.device.get("isCloudSync")})),this.qualityRegion.show(new c({
model:this.tempModel}))},onTitleChange:function(e){this.tempModel.set("title",e.currentTarget.value)},onSubmit:function(e){e.preventDefault();var i=this.ui.submitBtn;if(!i.hasClass("active")){i.addClass("active");var n=this.tempModel.save();n.done(t.bind(function(){if(this.model){var e=this.model.get("version")||0,t=this.tempModel.toJSON();t.version=e+1,this.model.set(t)}},this)),n=n.then(t.bind(function(){return a.execute("refreshSyncItems",{server:this.tempModel.parent,silent:!0})},this)),n.done(this.whenRendered(function(){
this.trigger("request:nextState")})),n.fail(this.whenRendered(function(){this.trigger("request:state","error")}))}}});return d}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1189),i(6),i(5)],s=function(e,t,i){"use strict";var n=t.ItemView.extend({className:"modal-body",template:e,events:{"click .status-link":"onStatusClick"},onStatusClick:function(e){e.preventDefault(),this.triggerMethod("request:nextState"),i.trigger("navigate","sync",{serverID:this.options.server.id,deviceID:this.options.device.id
})}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1190),i(2),i(7),i(233),i(82),i(31),i(826)],s=function(e,t,i,n,s,a,r){"use strict";var o=a.extend({mixins:[s],name:"versionGeneratorMetadataModal",className:"version-generator-metadata-modal modal fade",template:e,pageSize:20,scrollThreshold:50,ui:{body:".modal-body",loading:".loading",errorMessage:".error-message"},regions:{listRegion:".list-region"},initialize:function(e){this.transcodeJobs=e.transcodeJobs,this.pausedSetting=e.pausedSetting,
this.handleScroll=t.throttle(this.whenRendered(this.onScroll),100)},states:{base:{},loading:{onEnter:function(){this.ui.loading.removeClass("hidden")},onExit:function(){this.ui.loading.addClass("hidden")}},error:{onEnter:function(){this.ui.errorMessage.removeClass("hidden")},onExit:function(){this.ui.errorMessage.addClass("hidden")}}},bindings:{".generator-title":{modelAttribute:"title"},".generator-items-count":{modelAttribute:"Status",formatter:function(e){var t=e.itemsCount;return 1===t?i("{1} item",t):i("{1} items",t);
}},".generator-total-size":{modelAttribute:"Status",formatter:function(e){return e.totalSize?n(e.totalSize):i("0 files")}},".generator-failure-container":{modelAttribute:"Status",manual:!0,autohide:function(e){return!!e.failure}},".generator-failure-message":{modelAttribute:"Status",formatter:function(e){return e.failure}}},populatePage:function(){this.enterState("loading");var e=this.collection.populateRange({start:0,end:this.collection.length+this.pageSize});return e.done(this.whenRendered(function(){
this.enterState("base")})),e.fail(this.whenRendered(function(){this.enterState("error")})),e},onRender:function(){a.prototype.onRender.apply(this,arguments),this.ui.body.on("scroll",this.handleScroll),this.model.fetch(),this.populatePage(),this.listRegion.show(new r({collection:this.collection,itemViewOptions:{generator:this.model,transcodeJobs:this.transcodeJobs,pausedSetting:this.pausedSetting}}))},onClose:function(){this.ui.body.off("scroll",this.handleScroll),this.collection.clear()},onScroll:function(){
if("error"!==this.currentState){var e=this.ui.body.prop("scrollHeight")-this.ui.body.innerHeight(),t=e-this.ui.body.scrollTop()<this.scrollThreshold;t&&this.collection.length<this.collection.totalSize&&this.populatePage()}}});return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1193),i(6),i(49)],s=function(e,t,i){"use strict";var n=t.ItemView.extend({template:e,ui:{poster:".media-poster"},events:{"change input":"onInputChange","click .remove-home-btn":"onRemoveHomeClick",
"click .remove-friend-btn":"onRemoveFriendClick","click .disable-guest-btn":"onGuestDisableClick"},initialize:function(e){this.paneID=e.paneID,this.homeUser=e.homeUser,this.type=e.type,this.isAdmin=e.isAdmin,this.changes={},this.image=new i({model:this.model,type:"friend",width:60})},serializeData:function(){var e=!this.model.isNew(),t=this.homeUser&&!this.homeUser.isNew();return{friend:this.model.toJSON(),homeUser:this.homeUser&&this.homeUser.toJSON(),canRemoveFriend:e,canRemoveHomeUser:t&&this.isAdmin,
showActions:e||t}},flushChanges:function(){this.homeUser&&this.homeUser.set(this.changes)},onRender:function(){this.image.setElement(this.ui.poster)},onClose:function(){this.image.close()},onInputChange:function(e){var t=e.currentTarget,i=t.value;"checkbox"===t.type&&(i=t.checked),this.changes[t.name]=i},onRemoveHomeClick:function(e){e.preventDefault(),this.trigger("destroy:homeUser")},onRemoveFriendClick:function(e){e.preventDefault(),this.trigger("destroy:friend")},onGuestDisableClick:function(e){
e.preventDefault(),this.trigger("disable:guest")}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1194),i(4),i(6),i(886)],s=function(e,t,i,n){"use strict";var s=i.Layout.extend({tagName:"ul",className:"list modal-nav-list",template:e,ui:{sharedHeader:".shared-list-header"},regions:{ownedServerList:".owned-servers-container",sharedServerList:".shared-servers-container"},events:{"click .change-pane-btn":"onChangePaneClick"},onlyAfterRender:["selectItem","toggleDisabled"],
initialize:function(){this.serverOverviews=this.model.get("serverOverviews"),this.sharedServerShares=this.model.get("serverShares").filterByShared(),this.listenTo(this.sharedServerShares,"reset add remove",this.updateHeaders)},setModel:function(e){this.stopListening(),this.model=e,this.initialize(),this.render()},selectItem:function(e){this.$(".change-pane-btn").removeClass("selected"),this.$('[data-pane-id="'+e+'"]').addClass("selected")},toggleDisabled:function(e){this.$(".change-pane-btn").toggleClass("disabled",e),
this.$(".modal-nav-list-header").toggleClass("disabled",e)},updateHeaders:function(){this.ui.sharedHeader.toggleClass("hidden",!this.sharedServerShares.length)},onRender:function(){this.updateHeaders(),this.ownedServerList.show(new n({collection:this.serverOverviews,itemViewOptions:{paneType:"ownedServer"}})),this.sharedServerList.show(new n({collection:this.sharedServerShares,itemViewOptions:{paneType:"sharedServer"}}))},onChangePaneClick:function(e){e.preventDefault();var i=t(e.currentTarget);if(!i.isDisabled()){
var n=i.data("pane"),s=i.data("pane-id"),a={};"ownedServer"===n?a.serverOverview=this.model.get("serverOverviews").get(s):"sharedServer"===n&&(a.serverShare=this.model.get("serverShares").get(s)),this.trigger("change:pane",n,s,a)}}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(18),i(887)],s=function(e,t){"use strict";var i=e.extend({className:"server-nav-list",itemView:t});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1195),i(6),i(9)],
s=function(e,t,i){"use strict";var n=t.ItemView.extend({tagName:"a",className:"btn-gray change-pane-btn disabled",template:e,initialize:function(e){this.$el.attr({href:"#","data-pane":e.paneType,"data-pane-id":this.model.id});var t=i.get("servers"),n=t.get(this.model.get("machineIdentifier"));n?this.attachServer(n):this.listenTo(t,"add",this.onServerAdd)},serializeData:function(){var e;return e=this.server&&null!=this.server.get("connected")?this.server.get("connected")?"available":"unavailable":"unknown",
{server:this.model.toJSON(),status:e}},attachServer:function(e){this.server=e,this.listenTo(e,"change:connected",this.render)},onServerAdd:function(e){e.id===this.model.get("machineIdentifier")&&(this.attachServer(e),this.render())}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1196),i(2),i(4),i(6),i(151),i(9),i(891)],s=function(e,t,i,n,s,a,r){"use strict";var o=n.Layout.extend({template:e,ui:{details:".server-details",lastSeenRow:".server-detail-last-seen-row"
},regions:{share:".share-details"},events:{"click .server-status-btn":"onServerStatusClick"},initialize:function(e){this.paneID=e.paneID,this.serverOverview=e.serverOverview,this.server=a.get("servers").get(this.serverOverview.id);var t=this.model.get("serverShares");this.serverShare=t.findWhere({machineIdentifier:this.serverOverview.id}),this.changes={}},serializeData:function(){return{server:this.serverOverview.toJSON()}},flushChanges:function(){var e=this.model.get("serverShares"),t=e.findWhere({
machineIdentifier:this.serverOverview.id}),i=this.getServerShareAttributes(this.serverOverview);t?t.set(i):e.add(i)},getServerShareAttributes:function(e){var i=e.get("sections"),n=this.$("#"+e.id+"-section-list"),s=n.find(":checked:visible"),a=[],r={machineIdentifier:e.id,owned:!0,allLibraries:!1};return s.each(function(){return"all"===this.value?(r.allLibraries=!0,!1):void a.push(parseInt(this.value,10))}),r.allLibraries?r.numLibraries=i.length:r.numLibraries=a.length,r.Section=i.map(function(e){
var i=e.toJSON();return i.shared=r.allLibraries||t.contains(a,i.id),i}),r},bindings:{".server-title":{model:"serverOverview",modelAttribute:"name"},".server-status-btn":{model:"server",modelAttribute:"connected",manual:!0,formatter:function(e,t){t.removeClass("unknown available unauthorized unavailable"),null==e?t.addClass("unknown"):e?t.addClass("available"):this.server.get("unauthorized")?t.addClass("unauthorized"):t.addClass("unavailable")}},".server-detail-version":{model:"server",modelAttribute:"shortVersion"
},".server-detail-last-seen":{model:"serverShare",modelAttribute:"lastSeenAt",formatter:function(e){var t=s(e);return this.ui.lastSeenRow.toggleClass("hidden",!t),t}},".server-detail-address":{model:"serverOverview",modelAttribute:"address",formatter:function(e){if(e)return e;var t=this.server.get("activeConnection");return t?t.address:void 0}},".server-detail-port":{model:"serverOverview",modelAttribute:"port",formatter:function(e){if(e)return e;var t=this.server.get("activeConnection");return t?t.port:void 0;
}}},onRender:function(){this.share.append(new r({model:this.model,serverOverview:this.serverOverview,itemViewOptions:this.itemViewOptions}))},onServerStatusClick:function(e){e.preventDefault();var t=i(e.currentTarget);t.toggleClass("active"),this.ui.details.toggleClass("transition-out",!t.hasClass("active"))}});return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1197),i(2),i(4),i(6),i(60),i(9),i(119),i(183)],s=function(e,t,i,n,s,a,r){"use strict";var o=n.ItemView.extend({
className:"form-horizontal",template:e,filters:{contentRating:{sectionTypes:["movie","show"],presets:{movie:["G","PG","PG-13","R","NC-17","None"],show:["TV-Y","TV-Y7","TV-G","TV-PG","TV-14","TV-MA","None"]}},label:{sectionTypes:["movie","show","artist","photo"]}},filterByType:{movie:"filterMovies",show:"filterTelevision",artist:"filterMusic",photo:"filterPhotos"},ui:{tagInputs:".tag-input-hidden"},events:{"change input":"onInputChange"},initialize:function(e){this.paneID=e.paneID,this.type=e.type;
var t=a.get("user");this.hasPlexPass=t.hasPlexPass(),this.plexPassUrl=t.server.get("plexPassUrl"),this.changes={}},serializeData:function(){return{user:this.model.toJSON(),hasPlexPass:this.hasPlexPass,plexPassUrl:this.plexPassUrl,moviesIcon:s.get("movies").sectionTypeIcon,showsIcon:s.get("tv").sectionTypeIcon,musicIcon:s.get("music").sectionTypeIcon,photosIcon:s.get("photos").sectionTypeIcon}},loadPresets:function(){t.each(this.filters,function(e,i){t.isEmpty(e.presets)||t.each(e.presets,function(e,n){
var s=this.getSelectizeInputByFilterName(i,n),a=t.map(e,function(e){return{title:e,key:e}});s.addOption(a)},this)},this)},loadSections:function(){var e=a.get("servers"),i=this.model.get("serverShares"),n=i.filter(function(e){return e.isActive()&&e.get("owned")}),s=t.compact(t.map(n,function(t){return e.get(t.get("machineIdentifier"))}));t.each(s,function(e){if(e.get("connected")){var i=e.get("sections");i.populate().done(t.bind(function(){this.loadFilters(i)},this))}},this)},loadFilters:function(e){
e.each(function(e){var i=e.get("type");t.each(this.filters,function(n,s){t.contains(n.sectionTypes,i)&&this.loadFilterOptions(e,s)},this)},this)},loadFilterOptions:function(e,i){var n=new r({filter:i,filterType:"string"},{server:e.server,section:e}),s=n.get("options");s.populate().done(t.bind(function(){var t=this.getSelectizeInputByFilterName(i,e.get("type"));t.addOption(s.toJSON())},this))},getSelectizeInputByFilterName:function(e,t){var i="#filter-"+t+"-"+e;return this.$(i)[0].selectize},resetAllPlaceholders:function(){
var e=[];t.each(this.filters,function(i){e=t.union(e,i.sectionTypes)}),t.each(e,function(e){var i=this.model.get(this.filterByType[e]);this.resetPlaceholders(e,{restore:t.isEmpty(i)})},this)},resetPlaceholders:function(e,t){t||(t={});var i=this.$("input[data-section-type="+e+"]");i.each(function(){var e=t.restore?this.placeholder:"";e?(this.selectize.settings.placeholder=e,this.selectize.updatePlaceholder()):this.selectize.$control_input.attr("placeholder","")})},flushChanges:function(){this.model.set(this.changes);
},onRender:function(){this.hasPlexPass&&(this.ui.tagInputs.selectize({plugins:["remove_button"],create:!0,labelField:"title",valueField:"title",sortField:"title",searchField:["title"]}),this.resetAllPlaceholders(),this.loadSections(),this.loadPresets())},onInputChange:function(e){var n=e.currentTarget,s=i(n),a=n.value,r=s.data("filter"),o=s.data("sectionType");if(r){var l=this.changes[n.name]||this.model.get(n.name)||{};a?l[r]=a:l.hasOwnProperty(r)&&delete l[r],this.resetPlaceholders(o,{restore:t.isEmpty(l)
}),a=l}else"checkbox"===n.type&&(a=n.checked);this.changes[n.name]=a}});return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1198),i(2),i(6),i(60)],s=function(e,t,i,n){"use strict";var s=i.ItemView.extend({tagName:"li",className:"share-section-list-item",template:e,initialize:function(e){this.serverShare=e.serverShare},serializeData:function(){var e={section:this.model.toJSON(),typeIcon:n.get(this.model.get("type")).sectionTypeIcon,isChecked:!1};if(this.serverShare&&!this.serverShare.get("allLibraries")){
var i=this.serverShare.get("Section");e.isChecked=!!t.findWhere(i,{id:this.model.id,shared:!0})}return e}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1199),i(2),i(4),i(6),i(890)],s=function(e,t,i,n,s){"use strict";var a=n.CompositeView.extend({className:"share-server-container",template:e,itemView:s,itemViewContainer:".share-section-list",ui:{list:".share-section-list"},events:{"change input[name=share-all-libraries-cb]":"onAllLibrariesChange"},initialize:function(e){
t.bindAll(this,"render"),this.serverOverview=e.serverOverview,this.collection=this.serverOverview.get("sections");var n=this.model.get("serverShares");this.serverShare=n.findWhere({machineIdentifier:this.serverOverview.id});var s=[];s.push(this.serverOverview.populate()),this.serverShare&&(this.itemViewOptions={serverShare:this.serverShare},this.serverShare.isNew()||s.push(this.serverShare.populate())),this.listPromise=i.when.apply(i,s),"pending"===this.listPromise.state()&&this.listPromise.always(this.render);
},serializeData:function(){var e=this.listPromise.state(),t=!this.serverShare&&this.model.isNew(),i=this.serverShare&&this.serverShare.get("allLibraries");return{server:this.serverOverview.toJSON(),isPending:"pending"===e,hasFailed:"rejected"===e,hasSections:!!this.serverOverview.get("sections").length,allLibraries:t||i}},onAllLibrariesChange:function(e){this.ui.list.toggleClass("show-libraries",!e.currentTarget.checked)}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;
n=[i(1200),i(1201),i(2),i(4),i(6),i(7),i(151),i(60),i(9)],s=function(e,t,i,n,s,a,r,o,l){"use strict";var c=s.ItemView.extend({template:e,ui:{details:".server-details"},events:{"click .server-status-btn":"onServerStatusClick","click .leave-server-btn":"onLeaveServerClick"},initialize:function(e){this.paneID=e.paneID,this.serverShare=e.serverShare,this.serverShare.populate();var t=l.get("servers"),i=t.get(this.serverShare.get("machineIdentifier"));i?this.attachServer(i):this.listenTo(t,"add",this.onServerAdd);
},flushChanges:function(){},attachServer:function(e){this.server=e,this.listenTo(e,"change:connected",this.render)},bindings:{".server-title":{model:"serverShare",modelAttribute:"name"},".server-status-btn":{model:"server",modelAttribute:"connected",manual:!0,formatter:function(e,t){t.removeClass("unknown available unauthorized unavailable"),null==e?t.addClass("unknown"):e?t.addClass("available"):this.server.get("unauthorized")?t.addClass("unauthorized"):t.addClass("unavailable")}},".server-detail-version":{
model:"server",modelAttribute:"shortVersion"},".server-detail-last-seen":{model:"serverShare",modelAttribute:"lastSeenAt",formatter:function(e){return r(e)}},".server-detail-address":{model:"server",modelAttribute:"activeConnection",formatter:function(e){return e&&e.address}},".server-detail-port":{model:"server",modelAttribute:"activeConnection",formatter:function(e){return e&&e.port}},".server-restriction-allow-sync":{model:"serverShare",modelAttribute:"allowSync",manual:!0,autohide:!0},".share-section-list":{
model:"serverShare",modelAttribute:"Section",isHtml:!0,formatter:function(e){var n;return e.length||"pending"!==this.serverShare.populatePromise.state()?(n="",i.each(i.where(e,{shared:!0}),function(e){var i={section:e,typeIcon:o.get(e.type).sectionTypeIcon};n+=t(i)})):n=t({section:{title:a("Loading...")},typeIcon:"hidden"}),n}}},onServerAdd:function(e){e.id===this.serverShare.get("machineIdentifier")&&(this.attachServer(e),this.unbindFromModel(),this.bindToModel())},onServerStatusClick:function(e){
e.preventDefault();var t=n(e.currentTarget);t.toggleClass("active"),this.ui.details.toggleClass("transition-out",!t.hasClass("active"))},onLeaveServerClick:function(e){e.preventDefault(),this.trigger("destroy:serverShare",this.serverShare)}});return c}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1202),i(2),i(4),i(6),i(11)],s=function(e,t,i,n,s){"use strict";var a=n.ItemView.extend({template:e,focusDelay:200,validationDelay:500,ui:{existingGroup:".existing-user-group",existingBtn:".add-existing-user-btn",
restrictedGroup:".restricted-user-group",restrictedBtn:".add-restricted-user-btn"},events:{"keyup input":"onInputChange","change input":"onInputChange","click .add-existing-user-btn":"onAddExistingUserClick","click .add-restricted-user-btn":"onAddRestrictedUserClick"},initialize:function(e){this.paneID=e.paneID,this.type=e.type,this.homeUser=e.homeUser,this.changes={},this.validate=t.debounce(this.validate,500)},serializeData:function(){return{type:this.type}},flushChanges:function(){this.model.set(this.changes),
this.homeUser&&this.homeUser.set(this.changes)},focusInput:function(){var e;e=this.changes.restricted?this.$("[name=title]"):this.$("[name=username]"),e.removeClass("hidden"),e.focus()},validate:function(e){if(e){var i=s.execute("validateUsername",{username:e,server:this.model.server});i.done(t.bind(function(){this.$el.addClass("is-valid-username"),this.$el.removeClass("is-invalid-username")},this)),i.fail(t.bind(function(e,t){this.$el.removeClass("is-valid-username"),this.$el.addClass("is-invalid-username"),
this.trigger("change:errorMessage",t)},this))}},onRender:function(){"friend"===this.type&&setTimeout(t.bind(this.focusInput,this),this.focusDelay)},onInputChange:function(e){var t=e.currentTarget,i=t.name,n=t.value;n!==this.changes[i]&&(this.changes[i]=n,this.trigger("change:errorMessage",""),this.trigger("enable:submit",!!n),"username"===i&&this.validate(n))},onAddExistingUserClick:function(e){e.preventDefault();var t=i(e.currentTarget);t.isDisabled()||(t.addClass("hidden"),this.ui.restrictedGroup.addClass("disabled"),
this.ui.restrictedBtn.addClass("disabled"),this.focusInput())},onAddRestrictedUserClick:function(e){e.preventDefault();var t=i(e.currentTarget);t.isDisabled()||(this.changes.restricted=!0,t.addClass("hidden"),this.ui.existingGroup.addClass("disabled"),this.ui.existingBtn.addClass("disabled"),this.focusInput())}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1205),i(126)],s=function(e,t){"use strict";var i=t.extend({className:"user-select-alert-bar",template:e});return i;
}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1206),i(2),i(4),i(6),i(7),i(5),i(11),i(9),i(289),i(288)],s=function(e,t,i,n,s,a,r,o,l,c){"use strict";var u=n.Layout.extend({className:"user-select-modal-pin-container",template:e,ui:{inputsContainer:".pin-inputs-container",inputs:"input",loading:".loading",removeBtn:".remove-btn",saveBtn:".save-btn"},regions:{userList:".user-select-list"},events:{"keydown input":"onKeyDown","animationend .pin-inputs-container":"onInputsAnimationEnd",
"webkitAnimationEnd .pin-inputs-container":"onInputsAnimationEnd","oAnimationEnd .pin-inputs-container":"onInputsAnimationEnd","click .back-btn":"onBackClick","click .remove-btn":"onRemoveClick","submit #pin-form":"onSubmit"},onlyAfterRender:["confirmUser"],initialize:function(e){this.isForced=e.isForced,this.isEditing=e.isEditing,this.isEditWarning=e.isEditWarning,this.showBackButton=e.showBackButton,this.focusDelay=e.focusDelay,this.user=o.get("user"),this.isEditConfirmation=this.isEditing&&this.model.get("protected")&&!this.model.get("restricted");
},serializeData:function(){return{isEditing:this.isEditing&&!this.isEditConfirmation,isEditWarning:this.isEditWarning,isEditConfirmation:this.isEditConfirmation,hasCurrentPIN:this.model.get("protected"),showBackButton:this.showBackButton}},focusInput:function(e){var t;t=e?e.next("input"):this.ui.inputs.first(),t.length?t.focus().select():!this.isEditing||this.isEditConfirmation?this.confirmUser(this.getPIN()):this.ui.saveBtn.focus()},clearInputs:function(){this.ui.inputs.val(""),this.focusInput();
},clearInput:function(e){e.length&&(e.val(""),e.focus().select())},getPIN:function(){var e="";return this.ui.inputs.each(function(){e+=this.value}),e},editPIN:function(e){if(!this.ui.saveBtn.isDisabled()){this.ui.saveBtn.addClass("disabled");var t=this.savePIN(e);t.fail(this.whenRendered(function(){this.ui.saveBtn.removeClass("disabled"),a.trigger("show:alert",{type:"error",message:s("This PIN could not be saved.")})}))}},removePIN:function(){if(!this.ui.removeBtn.isDisabled()){this.ui.removeBtn.addClass("disabled");
var e=this.savePIN("");e.fail(this.whenRendered(function(){this.ui.removeBtn.removeClass("disabled"),a.trigger("show:alert",{type:"error",message:s("This PIN could not be removed.")})}))}},savePIN:function(e){this.ui.loading.removeClass("hidden");var i={pin:e};this.currentPin&&(i.currentPin=this.currentPin);var n=this.model.save(i,{wait:!0});return n.done(t.bind(function(){this.model.unset("pin"),this.model.unset("currentPin"),this.model.set("protected",!!e),this.model.id===this.user.id&&(e?this.user.set("pin",this.user.hashPIN(e)):this.user.unset("pin"),
this.user.set("home",this.user.hasHome())),this.trigger("resolve",e),e&&this.user.get("homeUsers").length<2&&a.trigger("show:modal",new c({type:"pin"}))},this)),n.always(this.whenRendered(function(){this.ui.loading.addClass("hidden")})),n},confirmUser:function(e){this.ui.loading.removeClass("hidden");var i=r.execute("switchUser",{homeUser:this.model,pin:e,allowGuestLock:!this.isEditing});i.done(t.bind(function(){this.isEditing?(this.isEditConfirmation=!1,this.currentPin=e,this.render()):this.trigger("resolve",e);
},this)),i.fail(this.whenRendered(function(){this.ui.inputsContainer.addClass("shake"),this.clearInputs()})),i.always(this.whenRendered(function(){this.ui.loading.addClass("hidden")}))},onRender:function(){this.userList.show(new l({model:this.model,disabled:!0})),setTimeout(t.bind(this.focusInput,this),this.focusDelay)},onKeyDown:function(e){var t=e.which;if(13!==t){var n=i(e.currentTarget);if(8!==t&&46!==t){e.preventDefault();var s=t>=48&&57>=t,a=t>=96&&105>=t;(s||a)&&(a&&(t-=48),n.val(String.fromCharCode(t)),
this.focusInput(n))}else if(!n.val().length){e.preventDefault();var r=8===t?n.prev():n.next();this.clearInput(r)}}},onInputsAnimationEnd:function(e){i(e.currentTarget).removeClass("shake")},onBackClick:function(e){e.preventDefault(),this.trigger("change:pane","users")},onRemoveClick:function(e){e.preventDefault(),this.removePIN()},onSubmit:function(e){e.preventDefault();var t=this.getPIN();return 4!==t.length?void a.trigger("show:alert",{type:"error",message:s("Please enter a 4 digit PIN.")}):void(this.isEditing&&!this.isEditConfirmation?this.editPIN(t):this.confirmUser(t));
}});return u}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(18),i(289)],s=function(e,t){"use strict";var i=e.extend({tagName:"ul",className:"tile-list user-select-list",itemView:t});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1208),i(2),i(4),i(6),i(5),i(11),i(9),i(45),i(76),i(214),i(896)],s=function(e,t,i,n,s,a,r,o,l,c,u){"use strict";var d=n.Layout.extend({className:"user-select-modal-users-container",template:e,ui:{loading:".loading"},
regions:{body:".modal-body"},onlyAfterRender:["onUserPopulated","onHomeUsersPopulated","onError"],initialize:function(e){this.user=r.get("user"),this.homeUsers=this.user.get("homeUsers"),this.user.server.populate().done(t.bind(this.onUserPopulated,this)).fail(t.bind(this.onError,this))},showList:function(e){this.ui.loading.addClass("hidden"),this.body.show(new u({collection:e})),this.listenTo(this.body.currentView,"itemview:selectUser",this.onUserSelect)},selectUser:function(e){this.ui.loading.removeClass("hidden");
var i=a.execute("switchUser",{homeUser:e,switchUser:!0,allowGuestLock:!0});i.done(t.bind(function(){this.trigger("resolve")},this)),i.always(this.whenRendered(function(){this.ui.loading.addClass("hidden")}))},onUserPopulated:function(){this.homeUsers.fetch().done(t.bind(this.onHomeUsersPopulated,this)).fail(t.bind(this.onError,this))},onHomeUsersPopulated:function(e){var i=a.execute("lockUser");i.always(t.bind(function(){1===e.length&&e.first().get("protected")?this.trigger("change:pane","pin",{model:e.first(),
showBackButton:!1,focusDelay:0}):this.showList(e)},this))},onError:function(){var e=o.getActiveUser();if(e&&e.get("home")){var t={id:e.id,title:e.get("title"),"protected":!!e.get("pin")};this.showList(new c([t],{server:this.user.server,parent:this.user}))}else this.user.set("lockState",l.lockStates.UNLOCKED),this.trigger("resolve")},onUserSelect:function(e,t){t.get("protected")?this.trigger("change:pane","pin",{model:t,showBackButton:!0,focusDelay:0}):this.selectUser(t)}});return d}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(1209),i(2),i(4),i(6),i(7),i(5)],s=function(e,t,i,n,s,a){"use strict";var r=n.ItemView.extend({id:"#nav-bar-search-form",tagName:"form",className:"nav-bar-form nav-bar-left hidden-xs",template:e,sectionSearchDelay:500,ui:{searchInput:"#nav-bar-search",searchLabel:".control-label-search",clearSearchBtn:".clear-search-btn"},events:{"focus #nav-bar-search":"onSearchFocus","blur #nav-bar-search":"onSearchBlur","keyup #nav-bar-search":"onSearchKeyUp",submit:"onSearchSubmit",
"mousedown .clear-search-btn":"onClearSearchClick"},modelEvents:{"change:searchPlaceholder":"onSearchPlaceholderChange","change:searchValue":"onSearchValueChange"},onlyAfterRender:["focusSearch","onSearchPlaceholderChange","onSearchValueChange"],initialize:function(){this.debouncedSearch=t.debounce(this.search,this.sectionSearchDelay),this.listenTo(a,"shortcut:search",this.focusSearch)},focusSearch:function(){this.ui.searchInput.focus()},search:function(){var e=i.trim(this.ui.searchInput.val()),t=this.model.get("searchType");
return e.length?void(t?a.trigger("search:"+t,e):a.trigger("navigate","search",{query:e})):void this.clearSearch()},clearSearch:function(){var e=this.model.get("searchType");e&&a.trigger("search:"+e,"")},onSearchPlaceholderChange:function(e,t){var i=t?s("Search {1}",t):"";this.ui.searchInput.attr("placeholder",i)},onSearchValueChange:function(e,t){this.ui.searchInput.is(document.activeElement)||(this.ui.clearSearchBtn.toggleClass("hidden",!t),this.ui.searchInput.val(t))},onSearchFocus:function(e){
this.ui.searchLabel.addClass("selected")},onSearchBlur:function(e){this.ui.searchLabel.removeClass("selected")},onSearchKeyUp:function(e){13!==e.which&&(this.ui.clearSearchBtn.toggleClass("hidden",0===this.ui.searchInput.val().length),"section"===this.model.get("searchType")&&this.debouncedSearch())},onSearchSubmit:function(e){e.preventDefault(),this.sectionSearchTimeout=clearTimeout(this.sectionSearchTimeout),this.search(),this.ui.searchInput.blur()},onClearSearchClick:function(e){e.preventDefault(),
this.ui.clearSearchBtn.addClass("hidden"),this.ui.searchInput.val(""),this.clearSearch()}});return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1210),i(1274),i(2),i(6),i(5),i(17),i(11),i(100),i(898),i(900),i(265)],s=function(e,t,i,n,s,a,r,o,l,c,u){"use strict";var d=n.Layout.extend({className:"nav-bar",template:e,sectionSearchDelay:500,ui:{backBtn:".back-btn",plexPassBtn:".plex-pass-btn",activityBtn:".activity-btn",activityBadge:".activity-badge"},regions:{search:".nav-bar-search-container",
navDropdown:".nav-bar-right",playerDropdown:".nav-bar-right"},events:{"click .back-btn":"onBackClick","click .activity-btn":"onActivityClick"},modelEvents:{"change:history":"onHistoryChange","change:primaryServer":"onPrimaryServerChange"},onlyAfterRender:["onSignedInChange","onHistoryChange","onPrimaryServerChange","onActivityChange"],initialize:function(){this.listenTo(this.model.get("user"),{"change:signedIn":this.onSignedInChange,"change:homeSize":this.onHomeSizeChange}),this.listenTo(s,"change:language",this.render),
this.setupServerListeners()},setupServerListeners:function(){this.primaryServer&&(this.stopListening(this.primaryServer),this.stopListening(this.sessions),this.stopListening(this.transcodeJobs),this.sessions=null,this.transcodeJobs=null),this.primaryServer=this.model.get("primaryServer"),this.primaryServer&&(this.sessions=this.primaryServer.get("sessions"),this.transcodeJobs=new o([],{server:this.primaryServer,persistInCache:!0}),this.listenTo(this.sessions,"reset add remove",this.onActivityChange),
this.listenTo(this.transcodeJobs,"reset add remove",this.onActivityChange))},serializeData:function(){var e=this.model.get("user");return{plexPassUrl:e.server.get("plexPassUrl"),hasHistory:this.hasHistory(),canGoPremium:this.canGoPremium(),showActivity:!!this.primaryServer,activityCount:this.getActivityCount()}},getActivityCount:function(){var e=this.sessions?this.sessions.length:0,t=this.transcodeJobs?this.transcodeJobs.length:0;return e+t},hasHistory:function(){var e=this.model.get("history");return e.length>1;
},canGoPremium:function(){var e=this.model.get("user"),t=e.get("homeSize")>1;return e.get("signedIn")&&!e.get("restricted")&&!e.hasPlexPass()&&!t},showPlexPassTooltip:function(){this.canGoPremium()&&!a.get("hasSeenHolidayTooltip")&&i.defer(i.bind(function(){this.isClosed||(a.save("hasSeenHolidayTooltip",!0),this.ui.plexPassBtn.focus())},this))},showOrHidePremiumNotice:function(){this.ui.plexPassBtn.toggleClass("hidden",!this.canGoPremium()),this.showPlexPassTooltip()},onRender:function(){this.search.append(new l({
model:this.model})),this.playerDropdown.append(new u({showNowPlaying:!0})),this.navDropdown.append(new c({model:this.model})),this.$el.tooltip({selector:'[data-toggle="tooltip"]',container:"body",placement:"bottom"}),this.ui.plexPassBtn.tooltip({container:"body",placement:"bottom",template:'<div class="tooltip tooltip-plex-pass" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:t(),html:!0,trigger:"hover focus"}),this.showPlexPassTooltip()},onSignedInChange:function(e,t){
this.showOrHidePremiumNotice()},onHistoryChange:function(e,t){this.ui.backBtn.toggleClass("hidden",!this.hasHistory())},onPrimaryServerChange:function(e,t){this.setupServerListeners();var i=!!t;this.ui.activityBtn.toggleClass("hidden",!i),this.onActivityChange()},onActivityChange:function(){var e=this.getActivityCount();this.ui.activityBtn.parent("li").toggleClass("active",!!e),this.ui.activityBadge.toggleClass("hidden",!e),this.ui.activityBadge.text(e)},onBackClick:function(e){e.preventDefault(),
s.trigger("navigate:back")},onActivityClick:function(e){e.preventDefault(),this.transcodeJobs&&this.transcodeJobs.length?s.trigger("navigate","conversion"):this.sessions&&this.sessions.length?s.trigger("navigate","nowPlaying"):s.trigger("navigate","activity")},onHomeSizeChange:function(){this.showOrHidePremiumNotice()}});return d}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1211),i(2),i(6),i(7),i(5),i(11),i(49)],s=function(e,t,i,n,s,a,r){"use strict";var o=i.ItemView.extend({
id:"nav-dropdown",tagName:"li",className:"nav-dropdown dropdown",template:e,ui:{poster:".dropdown-poster-toggle .media-poster",dropdownMenu:".dropdown-menu",switchUserItem:".switch-user-item",totalBadge:".total-badge",invitesBadge:".invites-badge",announcementsBadge:".announcements-badge"},events:{"click .switch-user-btn":"onSwitchUserClick","click .users-btn":"onUsersClick","click .sign-in-btn":"onSignInClick","click .sign-out-btn":"onSignOutClick"},onlyAfterRender:["onSignedInChange","updateBadges"],
bindings:{".username-header":{model:"user",modelAttribute:"title"}},initialize:function(){this.user=this.model.get("user"),this.invites=this.user.get("invites"),this.announcements=this.model.get("announcements"),this.image=new r({model:this.user,type:"friend",width:34}),this.listenTo(this.user,"change:signedIn",this.onSignedInChange),this.listenTo(this.user,"change:username",this.onUsernameChange),this.listenTo(this.user,"change:home",this.onHomeChange),this.listenTo(this.invites,"reset add remove",this.updateBadges),
this.listenTo(this.announcements,"reset add remove change:isUnread",this.updateBadges),this.announcements.populate({reset:!0})},serializeData:function(){var e=this.invites.length,t=this.getUnreadAnnouncementsCount();return{signedIn:this.user.get("signedIn"),home:this.user.get("home"),isFullUser:this.user.isFullUser(),invitesCount:e,unreadAnnouncementsCount:t,totalCount:e+t,accountUrl:this.user.server.get("accountUrl"),appsUrl:this.user.server.get("appsUrl"),helpUrl:this.user.server.get("helpUrl"),
defaultTarget:"_self"}},getUnreadAnnouncementsCount:function(){var e=this.announcements.where({isUnread:!0});return this.user.hasPlexPass()&&(e=t.reject(e,function(e){return"PlexPass"===e.get("promo")})),e.length},updateBadges:function(){var e=this.invites.length,t=this.getUnreadAnnouncementsCount(),i=e+t;this.ui.totalBadge.toggleClass("hidden",!i),this.ui.totalBadge.text(i),this.ui.invitesBadge.toggleClass("hidden",!e),this.ui.invitesBadge.text(e),this.ui.announcementsBadge.toggleClass("hidden",!t),
this.ui.announcementsBadge.text(t)},onRender:function(){this.image.setElement(this.ui.poster)},onClose:function(){this.image.close()},onSignedInChange:function(e,t){this.ui.dropdownMenu.toggleClass("signed-in",!!t)},onUsernameChange:function(e,t){this.ui.dropdownMenu.toggleClass("full-user",!!t)},onHomeChange:function(e,t){this.ui.switchUserItem.toggleClass("hidden",!e.get("home"))},onSwitchUserClick:function(e){e.preventDefault(),this.user.set({locked:!0})},onUsersClick:function(e){e.preventDefault(),
s.trigger("navigate","users")},onSignInClick:function(e){e.preventDefault(),s.trigger("navigate","login")},onSignOutClick:function(e){e.preventDefault(),a.execute("signOut").done(t.bind(function(){s.trigger("navigate:refresh:dashboard")},this))}});return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1226),i(6)],s=function(e,t){"use strict";var i=t.ItemView.extend({template:e,className:"player mini-player"});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){
var n,s;n=[i(1219),i(9),i(144),i(175),i(176)],s=function(e,t,i,n,s){"use strict";var a=n.extend({template:e,volumeSettingsKey:"musicPlayerVolume",initialize:function(e){n.prototype.initialize.apply(this,arguments),this.controlsView=new s({model:this.playerModel,upNextCollection:new i(null,{parent:this.playerModel})}),this.addListeners()},startPlayback:function(e){e||(e={}),this.controller.load({model:this.playerModel,offset:e.offset,autoplay:e.autoplay,fallbackServer:t.get("primaryServer"),silent:this.isNowPlaying()
})},getNavigationKey:function(){var e=this.model.get("parentKey");return e?e:this.model.parent&&this.model.parent.get("key")},onRender:function(){this.controls.append(this.controlsView,this.$el),n.prototype.onRender.apply(this,arguments)}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1220),i(175),i(176)],s=function(e,t,i){"use strict";var n=t.extend({template:e,initialize:function(e){t.prototype.initialize.apply(this,arguments),this.controlsView=new i({model:this.playerModel
}),this.addListeners()},addListeners:function(){t.prototype.addListeners.apply(this,arguments),this.listenTo(this.controlsView,"load:poster",this.onPosterLoad)},getNavigationKey:function(){var e=this.model.get("parentKey");return e?e:this.model.parent&&this.model.parent.get("key")},onRender:function(){this.controls.append(this.controlsView,this.$el),t.prototype.onRender.apply(this,arguments)},onPrimaryPlayerChange:function(e,i){t.prototype.onPrimaryPlayerChange.apply(this,arguments),this.maximize();
},onPosterLoad:function(e){this.playerModel.set("loaded",!0)}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1221),i(2),i(4),i(6),i(7),i(5),i(28),i(50),i(43),i(71),i(103)],s=function(e,t,i,n,s,a,r,o,l,c,u){"use strict";var d=n.Layout.extend({className:"photo-player-container",template:e,ui:{details:".photo-details",playBtn:".play-btn",pauseBtn:".pause-btn",dropdown:".photo-actions-dropdown",error:".error"},regions:{photo:".photo-details"},events:{"click .edit-btn":"onEditClick",
"click .more-btn":"onMoreClick","hide.bs.dropdown .photo-actions-dropdown":"onDropdownHide"},onlyAfterRender:["onPausedChange"],initialize:function(e){this.playerModel=e.playerModel,this.transition=e.transition,this.mediaActions=new o({},{item:this.model});var t=this.getImageSize();this.imageWidth=t.width,this.imageHeight=t.height,this.photoImage=new l({model:this.model,url:this.model.getMediaKey(),width:this.imageWidth,height:this.imageHeight,resetOnError:!0}),this.updateImageSize(t),this.transition&&(this.$el.addClass(this.transition.type),
this.transition.direction&&(this.$el.addClass(this.transition.direction),"left"===this.transition.direction?this.$el.css("left",-1*this.windowWidth):this.$el.css("left",this.windowWidth))),this.listenTo(a,"resize",this.onResize),this.listenTo(this.playerModel,{"change:slideshowPaused":this.onPausedChange,"change:errorMessage":this.onErrorMessageChange,"change:showEnterFullscreen":this.onResize}),this.listenTo(this.photoImage,{load:this.onImageLoad,error:this.onImageError}),this.model.isLibraryItem()&&this.model.populate();
},serializeData:function(){var e=this.collection.availableRange,t=e?e.start:0,i=t+this.collection.indexOf(this.model)+1,n=this.collection.totalSize||this.collection.length;return{player:this.playerModel.toJSON(),index:i,total:n}},getImageSize:function(){return this.windowWidth=i(window).width(),this.windowHeight=i(window).height(),{width:Math.round(.8*this.windowWidth),height:Math.round(.7*this.windowHeight)}},updateImageSize:function(e){this.photoImage.$el.css({"max-width":e.width,"max-height":e.height
}),e.width>=this.imageWidth&&e.height>=this.imageHeight&&(this.imageWidth=e.width,this.imageHeight=e.height,this.photoImage.src=null,this.photoImage.width=this.imageWidth,this.photoImage.height=this.imageHeight,this.photoImage.render())},transitionIn:function(){this.transition&&(this.$el.triggerReflow(),this.$el.removeClass(this.transition.type),this.transition.direction&&this.$el.removeClass(this.transition.direction).css("left",0))},transitionOut:function(e){return e?(this.$el.addClass(e.type),
e.direction&&("right"===e.direction?this.$el.addClass("left").css("left",-1*this.windowWidth):this.$el.addClass("right").css("left",this.windowWidth)),void t.delay(t.bind(this.close,this),1e3)):void this.close()},bindings:{".photo-title":{modelAttribute:"title"},".photo-summary":{modelAttribute:"summary",autohide:!0},".edit-btn":{model:"mediaActions",modelAttribute:"showEdit",manual:!0,autohide:!0},".more-btn":{model:"mediaActions",modelAttribute:"showListDropdown",manual:!0,autohide:!0},".minimize-btn":{
model:"playerModel",modelAttribute:"showMinimize",manual:!0,autohide:!0},".enter-fullscreen-btn":{model:"playerModel",modelAttribute:"showEnterFullscreen",manual:!0,autohide:!0},".exit-fullscreen-btn":{model:"playerModel",modelAttribute:"showExitFullscreen",manual:!0,autohide:!0}},onRender:function(){this.photo.prepend(this.photoImage)},onImageLoad:function(e){this.model===this.playerModel.get("item")&&this.playerModel.set("loaded",!0)},onImageError:function(){this.model===this.playerModel.get("item")&&this.playerModel.set({
state:r.states.ERROR,errorMessage:s("There was a problem loading '{1}'",this.model.get("title"))})},onPausedChange:function(e,t){this.ui.playBtn.toggleClass("hidden",!t),this.ui.pauseBtn.toggleClass("hidden",t)},onErrorMessageChange:function(e,t){this.model===this.playerModel.get("item")&&t&&(this.ui.error.text(t),this.ui.error.removeClass("hidden"),this.ui.details.addClass("hidden"))},onResize:function(){var e=this.getImageSize();this.updateImageSize(e)},onEditClick:function(e){e.preventDefault(),
a.trigger("show:modal",new c({mediaActions:this.mediaActions}))},onMoreClick:function(e){e.preventDefault(),e.stopImmediatePropagation(),this.dropdown=new u({model:this.model}),this.ui.dropdown.append(this.dropdown.render().el),this.ui.dropdown.addClass("open"),this.ui.details.addClass("force-hover")},onDropdownHide:function(e){this.dropdown&&(this.dropdown.close(),this.dropdown=null,this.ui.details.removeClass("force-hover"))}});return d}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){
var n,s;n=[i(1222),i(2),i(11),i(207),i(174),i(904)],s=function(e,t,i,n,s,a){"use strict";var r=s.extend({className:"photo-player dark-scrollbar",template:e,defaultTransition:{type:"fade"},ui:{loading:".loading",previousBtn:".previous-btn",nextBtn:".next-btn"},regions:{details:".photo-player-container"},events:t.extend({"click .player-close-btn":"onCloseClick","click .play-btn":"onPlayClick","click .pause-btn":"onPauseClick","click .previous-btn":"onPreviousClick","click .next-btn":"onNextClick","click .minimize-btn":"onMinimizeClick",
"click .enter-fullscreen-btn":"onEnterFullscreenClick","click .exit-fullscreen-btn":"onExitFullscreenClick"},s.prototype.events),collectionEvents:{destroy:"onItemDestroy"},onlyAfterRender:["onPlayerCanSkipPreviousChange","onPlayerCanSkipNextChange"],initialize:function(e){e||(e={}),e.playerModelClass=n,s.prototype.initialize.call(this,e),this.addListeners()},addListeners:function(){s.prototype.addListeners.apply(this,arguments),this.listenTo(this.playerModel,{"change:loaded":this.onPlayerLoadedChange,
"change:error":this.onPlayerErrorChange,"change:canSkipPrevious":this.onPlayerCanSkipPreviousChange,"change:canSkipNext":this.onPlayerCanSkipNextChange})},startPlayback:function(){this.controller.load({model:this.playerModel,autoplay:this.autoplay}),this.transition()},continuePlayback:function(){this.playerModel.set("loaded",!1),this.transition()},transition:function(e){e||(e=this.defaultTransition),this.nextDetails=new a({model:this.model,collection:this.playQueue.get("collection"),playerModel:this.playerModel,
transition:e}),this.ui.loading.removeClass("hidden"),this.$el.addClass("show-photo-loading"),this.$el.append(this.nextDetails.render().el),this.currentTransition=this.defaultTransition},skipPrevious:function(){this.currentTransition={type:"slide",direction:"left"},this.controller.skipPrevious()},skipNext:function(){this.currentTransition={type:"slide",direction:"right"},this.controller.skipNext()},transitionToNewImage:function(){this.ui.loading.addClass("hidden"),this.$el.removeClass("show-photo-loading"),
this.nextDetails.transitionIn(),this.currentDetails&&this.currentDetails.transitionOut(this.nextDetails.transition),this.currentDetails=this.nextDetails},onClose:function(){s.prototype.onClose.apply(this,arguments),this.currentDetails&&this.currentDetails.close(),this.nextDetails&&this.nextDetails.close()},onPlayerItemChange:function(e,t){this.model=t,this.transition(this.currentTransition),this.updatePageTitle()},onPlayerLoadedChange:function(e,t){t&&this.transitionToNewImage()},onPlayerErrorChange:function(e,t){
t&&this.transitionToNewImage()},onPlayerCanSkipPreviousChange:function(e,t){this.ui.previousBtn.toggleClass("hidden",!t)},onPlayerCanSkipNextChange:function(e,t){this.ui.nextBtn.toggleClass("hidden",!t)},onItemDestroy:function(e){this.playerModel.get("item")===e&&(this.playQueue.get("collection").length?this.skipNext():this.stop())},onCloseClick:function(e){e.preventDefault(),this.stop()},onPlayClick:function(e){e.preventDefault(),this.controller.play()},onPauseClick:function(e){e.preventDefault(),
this.controller.pause()},onPreviousClick:function(e){e.preventDefault(),this.skipPrevious()},onNextClick:function(e){e.preventDefault(),this.skipNext()},onMinimizeClick:function(e){e.preventDefault(),this.minimize()},onEnterFullscreenClick:function(e){e.preventDefault(),this.enterFullscreen()},onExitFullscreenClick:function(e){e.preventDefault(),this.exitFullscreen()}});return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1223),i(2),i(6),i(431),i(43),i(30),i(166),i(182)],
s=function(e,t,i,n,s,a,r){"use strict";var o=i.Layout.extend({mixins:n,className:"video-post-play",template:e,regions:{countdown:".countdown"},events:{"click .next-btn":"onNextClick","click .replay-btn":"onReplayClick",mousemove:"onMouseMove"},initialize:function(e){e||(e={}),e.countdown&&this.createCountdown(e.countdown),this.previousItem=this.model;var t=this.collection.indexOf(this.model)+1;this.nextItem=this.collection.at(t);var i="movie"===this.previousItem.get("type")?"art":"thumb";this.previousPoster=new a({
model:this.previousItem,modelAttribute:i,type:this.previousItem.get("type"),height:140}),this.nextPoster=new a({model:this.nextItem,modelAttribute:i,type:this.nextItem.get("type"),height:190}),this.backgroundImage=new s({model:this.nextItem,modelAttribute:"art",width:1280,height:720,background:!0})},onRender:function(){this.previousPoster.setElement(this.ui.previousPoster),this.nextPoster.setElement(this.ui.nextPoster),this.backgroundImage.setElement(this.ui.background),this.totalSeconds&&this.countdown.append(new r({
model:this.progressModel,size:80}))},onNextClick:function(e){e.preventDefault(),this.trigger("next",{manual:!0})},onReplayClick:function(e){e.preventDefault(),this.trigger("replay")},onMouseMove:function(e){(this.lastX!==e.clientX||this.lastY!==e.clientY)&&this.totalSeconds&&(this.startTime=0,this.lastX=e.clientX,this.lastY=e.clientY,window.cancelAnimationFrame(this.countdownAnimator),clearInterval(this.idleTimer),this.idleTimer=setTimeout(t.bind(this.updateCountdown,this),1e3))},onClose:function(){
n.onClose.apply(this,arguments),clearInterval(this.idleTimer)}});return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1224),i(144),i(175),i(176)],s=function(e,t,i,n){"use strict";var s=i.extend({template:e,initialize:function(e){i.prototype.initialize.apply(this,arguments),this.controlsView=new n({model:this.playerModel,upNextCollection:new t(null,{parent:this.playerModel})}),this.addListeners()},startPlayback:function(e){e||(e={}),this.controller.load({model:this.playerModel,
offset:e.offset,autoplay:e.autoplay,silent:this.isNowPlaying(),mediaElement:e.mediaElement})},continuePlayback:function(){},onRender:function(){this.controls.append(this.controlsView,this.$el),i.prototype.onRender.apply(this,arguments)},onPrimaryPlayerChange:function(e,t){i.prototype.onPrimaryPlayerChange.apply(this,arguments),this.maximize()}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1225),i(2),i(4),i(7),i(5),i(34),i(68),i(28),i(243),i(17),i(11),i(9),i(174),i(22),i(870),i(911),i(906)],
s=function(e,t,i,n,s,a,r,o,l,c,u,d,h,p,f,m,g){"use strict";var v=h.extend({className:"video-player dark-scrollbar buffering",template:e,volumeSettingsKey:"videoPlayerVolume",controlsDelay:a.hasTouchScreen?4e3:2e3,ui:{container:".video-container"},regions:{controls:".video-controls-container",postPlay:".video-post-play-container"},events:t.extend({"click .player-close-btn":"onCloseClick",mousemove:"onMouseMove"},h.prototype.events),postPlayDuration:10,awakeTime:72e5,maximumDurationForAutoadvance:12e5,
minimumDurationForPostPlay:3e5,initialize:function(e){this.playQueue=e.playQueue,h.prototype.initialize.apply(this,arguments),this.controlsView=new m({model:this.playerModel}),u.execute("playSound",{stop:!0,background:!0}),this.startSleepProtection(),this.addListeners()},addListeners:function(){h.prototype.addListeners.apply(this,arguments),this.listenTo(this.playerModel,{"change:ready":this.onPlayerReadyChange,"change:embedHtml":this.onPlayerEmbedHtmlChange}),this.listenTo(this.controlsView,"toggleControls",this.toggleControls);
},startPlayback:function(e){if(e||(e={}),this.isNowPlaying())return void this.load(t.extend({},e,{silent:!0}));var i=this.resolveOffset(e);i.done(this.whenRendered(function(i){this.load(t.extend({},e,{offset:i,silent:!1}))})),i.fail(t.bind(this.stop,this))},continuePlayback:function(){this.controlsView.replaceVideo(this.controller.mediaElement),this.playerModel.get("ready")&&(this.onPlayerReadyChange(this.playerModel,!0),this.onPlayerStateChange(this.playerModel,this.playerModel.get("state")))},resolveOffset:function(e){
var n=i.Deferred(),a=e.offset||this.offset;if(t.isNumber(a))return n.resolve(a).promise();var r=this.model.get("viewOffset");if(!r)return n.resolve(0).promise();var o=new f({offset:r}),l=o.promise;return l.done(function(e){n.resolve(e)}),l.fail(function(){n.reject()}),s.trigger("show:modal",o),n.promise()},load:function(e){this.controller.load({model:this.playerModel,media:this.media,offset:e.offset,autoplay:e.autoplay,postplay:!d.get("primaryPlayer"),silent:e.silent,mediaElement:e.mediaElement||this.controls.currentView.ui.video[0]
})},stop:function(){var e,t,a=i.Deferred().resolve().promise(),r=!d.get("primaryPlayer");if(this.model&&r&&(e=this.model.server.get("playQueueManager"),t=e.getFor(this.model)),t&&t.get("hasUserAdditions")){var o=new p({title:n("Finish Watching Queue"),message:n("This will clear the contents of your play queue.")});a=o.promise,s.trigger("show:modal",o)}return a.then(function(){s.trigger("hide:player")}),a},canAutoplay:function(e){return!a.hasTouchScreen&&(null==e||e!==o.states.PAUSED)},showVideo:function(e){
this.$el.toggleClass("show-html-video","html"===e),this.$el.toggleClass("show-flash-video","flash"===e),this.$el.toggleClass("show-placeholder-video",!e)},hideVideo:function(){this.$el.removeClass("show-html-video show-flash-video show-placeholder-video")},toggleControls:function(e){this.controller.model&&this.controller.model.get("ready")&&"flash"!==this.controller.playerType&&(e||(e={}),this.controlsView.visible||this.controlsView.transitionIn(),this.controlsTimeout=clearTimeout(this.controlsTimeout),
e.autohide&&(this.controlsTimeout=setTimeout(this.controlsView.transitionOut,this.controlsDelay)))},startSleepProtection:function(){clearTimeout(this.sleepTimeout),this.isDefinitelyAwake||(this.isPotentiallyAsleep?this.isDefinitelyAwake=!0:this.sleepTimeout=setTimeout(t.bind(this.onSleep,this),this.awakeTime))},onRender:function(){this.controls.show(this.controlsView),h.prototype.onRender.apply(this,arguments)},onClose:function(){h.prototype.onClose.apply(this,arguments),this.controlsTimeout=clearTimeout(this.controlsTimeout),
this.sleepTimeout=clearTimeout(this.sleepTimeout),this.controller.model&&!this.isContinuing&&r.abortAll("player")},onPlayerReadyChange:function(e,t){t?(this.showVideo(this.controller.playerType),this.controller.companion?this.toggleControls():this.toggleControls({autohide:!0})):this.hideVideo()},onPlayerStateChange:function(e,t){h.prototype.onPlayerStateChange.apply(this,arguments),this.controller.companion||(t===o.states.ERROR&&this.hideVideo(),clearTimeout(this.controlsTimeout),this.controlsTimeout=setTimeout(this.controlsView.transitionOut,this.controlsDelay)),
this.$el.toggleClass("stopped",e.get("stopped")),this.$el.toggleClass("paused",e.get("paused")),this.$el.toggleClass("playing",e.get("playing")),this.$el.toggleClass("buffering",e.get("buffering")),this.$el.toggleClass("error",e.get("error"))},onPlayerEmbedHtmlChange:function(e,t){this.ui.container.html(t)},onPlayerFinishedChange:function(e,t){if(t){var i=this.model.get("duration")<this.minimumDurationForPostPlay,n=this.model.get("extraType")===l.get("trailer").id;if(this.model===this.playQueue.get("collection").last())this.model.server.get("playQueueManager").remove("video"),
s.trigger("hide:player");else if(i||n)this.controller.skipNext();else{this.hideVideo();var a={model:this.model,collection:this.playQueue.get("collection")},r=this.model.get("duration")<this.maximumDurationForAutoadvance;(!this.isPotentiallyAsleep||this.isDefinitelyAwake||r)&&(a.countdown=this.postPlayDuration);var o=new g(a);this.listenTo(o,{replay:this.onPostPlayReplay,next:this.onPostPlayNext}),this.postPlay.show(o)}}},onPostPlayReplay:function(){this.startSleepProtection(),this.stopListening(this.postPlay.currentView),
this.postPlay.close(),this.controller.setPosition(0,{autoplay:!0}),this.showVideo(this.controller.playerType)},onPostPlayNext:function(e){e&&e.manual&&this.startSleepProtection(),this.stopListening(this.postPlay.currentView),this.postPlay.close(),this.controller.skipNext()},onSleep:function(){this.isPotentiallyAsleep=!0},onCloseClick:function(e){e.preventDefault(),this.stop()},onMouseMove:function(e){(this.lastX!==e.clientX||this.lastY!==e.clientY)&&(this.lastX=e.clientX,this.lastY=e.clientY,this.controller.companion||this.playerModel.get("finished")||this.toggleControls({
autohide:!0}))}});return v}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(263)],s=function(e){"use strict";var t=e.extend({className:"video-player-alert alert alert-sm transition-in",alertDuration:5e3});return t}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1230),i(2),i(6),i(26),i(97),i(57),i(43)],s=function(e,t,i,n,s,a,r){"use strict";var o=i.ItemView.extend({className:"player-scrub-preview",template:e,areThumbnailsAvailable:null,thumbnailPreferredIndex:"sd",
thumbnailWidth:240,ui:{scrubPreviewThumbnail:".player-scrub-preview-thumbnail",scrubPreviewTooltip:".player-scrub-preview-tooltip",scrubPreviewTime:".player-scrub-preview-time"},modelEvents:{"change:item":"onItemChange"},initialize:function(){this.throttledShowThumbnail=t.throttle(this.whenRendered(this.showThumbnail),200),this.thumbnailImage=new r({model:this.model.get("item"),width:this.thumbnailWidth,height:s.getPosterHeight("art",this.thumbnailWidth)})},show:function(){this.$el.removeClass("hidden");
},hide:function(){this.$el.addClass("hidden"),this.ui.scrubPreviewThumbnail.addClass("hidden")},positionContainer:function(){this.$el.css("left",this.position-this.$el.width()/2+"px")},updatePreview:function(e){this.position=e.position,this.ui.scrubPreviewTime.text(a(e.time)),this.positionContainer(),this.areThumbnailsAvailable!==!1&&this.throttledShowThumbnail(e.time)},showThumbnail:function(e){if(this.model.get("media")){var t=this.getScreenshotUrl(e);t?(this.areThumbnailsAvailable=!0,this.thumbnailImage.load(t).done(this.whenRendered(function(e){
this.$el.hasClass("hidden")||(this.thumbnailImage.showImage(e),this.ui.scrubPreviewThumbnail.removeClass("hidden"),this.positionContainer())}))):this.areThumbnailsAvailable=!1}},getScreenshotUrl:function(e){var t=e+6e3;return n.getScreenshotUrl(this.model.get("media"),t,this.thumbnailPreferredIndex)},onRender:function(){this.thumbnailImage.setElement(this.ui.scrubPreviewThumbnail)},onClose:function(){this.thumbnailImage.close()},onItemChange:function(e,t){this.ui.scrubPreviewThumbnail.addClass("hidden"),
this.areThumbnailsAvailable=null,this.thumbnailImage.setModel(t),this.thumbnailImage.src=null}});return o}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1231),i(2),i(4),i(6),i(7),i(42),i(5),i(34),i(57),i(17),i(9),i(144),i(43),i(30),i(549),i(551),i(290),i(134),i(913),i(914),i(912),i(910),i(909),i(264),i(132),i(131)],s=function(e,t,i,n,s,a,r,o,l,c,u,d,h,p,f,m,g,v,y,b,w,x,S,C,k,P){"use strict";var A=n.Layout.extend({className:"video-controls transition-out",template:e,visible:!1,
muted:!1,mutedVolume:0,ui:{video:"#html-video",poster:".media-poster",background:".video-background",volumeBtn:".volume-btn",errorMessage:".video-error-message",errorSkipMessage:".video-error-skip-message",dropdowns:".player-dropdowns-container",dropups:".player-dropups-container"},regions:{subtitles:".video-subtitles-container",seekBar:".seek-bar-container",volume:".player-volume-slider-container",playQueueDropdown:"#player-play-queue-dropdown",qualityDropdown:"#player-quality-dropdown",audioDropdown:"#player-subtitles-dropdown",
subtitlesDropdown:"#player-audio-dropdown",playerDropdown:"#player-primary-player-dropdown",scrubPreview:".player-scrub-preview-container",imageOverlaysRegion:".video-image-overlays-region",alertRegion:".video-alert-region"},modelEvents:{"change:item":"onItemChange","change:subtitlesUrl":"onPlayerSubtitlesUrlChange","change:volume":"onVolumeChange","change:errorMessage":"onErrorMessageChange","change:bufferingMessage":"onBufferingMessageChange","change:showQuality":"onShowQualityChange","change:showAudioStream":"onShowAudioStreamChange",
"change:showSubtitleStream":"onShowSubtitleStreamChange"},events:{"click .volume-btn":"onVolumeClick","click .enter-fullscreen-btn":"onEnterFullscreenClick","click .exit-fullscreen-btn":"onExitFullscreenClick","click .video-overlay-btn":"onOverlayClick","click .share-btn":"onShareClick","click .recommend-btn":"onRecommendClick","click .video-error-message-center":"onErrorMessageClick"},triggers:{"click .play-btn":"play","click .pause-btn":"pause","click .previous-btn":"previous","click .next-btn":"next",
"click .minimize-btn":"minimize"},onlyAfterRender:["onVolumeChange","onErrorMessageChange"],initialize:function(){t.bindAll(this,"onMobileVideoClose"),this.bindAllWhenRendered("transitionIn","transitionOut"),this.item=this.model.get("item"),this.upNextCollection=new d(null,{parent:this.model}),this.posterImage=new p({model:this.item,type:"movie",getUrl:this.getPosterUrl,width:100}),this.backgroundImage=new h({server:this.item.server,width:1280,height:720}),this.seekBarView=new g({model:this.model
}),this.playQueueDropdownView=new C({model:this.model,collection:this.upNextCollection}),this.volumeSlider=new v({className:"player-volume-slider player-slider",value:this.model.get("volume")}),this.listenTo(this.seekBarView,"change:value",this.onSeekBarValueChange),this.listenTo(this.seekBarView,"hover",this.onSeekBarHover),this.listenTo(this.volumeSlider,"change:value",this.onVolumeSliderValueChange),this.listenTo(this.playQueueDropdownView,"itemview:skip",this.onSkip),this.listenTo(this.playQueueDropdownView,"itemview:remove",this.onRemove),
this.listenTo(this.playQueueDropdownView,"move",this.onMove)},getPosterUrl:function(e){return this.model.get("parentThumb")||this.model.get("grandparentThumb")||e},transitionIn:function(){this.visible=!0,this.$el.removeClass("transition-out")},transitionOut:function(){this.$(".dropdown.open, .dropup.open").length||(this.visible=!1,this.$el.addClass("transition-out"),this.scrubPreview.currentView.hide())},updateVolumeBtn:function(e){var t=this.ui.volumeBtn;e>50?(this.muted=!1,t.addClass("high"),t.removeClass("low mute")):50>=e&&e>0?(this.muted=!1,
t.addClass("low"),t.removeClass("high mute")):(this.muted=!0,t.addClass("mute"),t.removeClass("high low"))},replaceVideo:function(e){var t=i(e);this.ui.video.off("webkitendfullscreen",this.onMobileVideoClose),t.attr("id",this.ui.video.attr("id")),t.attr("class",this.ui.video.attr("class")),this.ui.video.replaceWith(t),this.ui.video=t,t.on("webkitendfullscreen",this.onMobileVideoClose)},createErrorSkipInterval:function(){this.errorSkipInterval=clearInterval(this.errorSkipInterval),this.errorSkipCounter=5,
this.updateErrorSkipMessage(this.errorSkipCounter),this.errorSkipInterval=setInterval(t.bind(this.onErrorSkipInterval,this),1e3)},updateErrorSkipMessage:function(e){this.ui.errorSkipMessage.text(s("Skipping in {1} seconds...",e))},bindings:{".video-title":{modelAttribute:"item",autohide:!0,formatter:function(e){return e.get("title")}},".video-background":{modelAttribute:"item",manual:!0,formatter:function(e,i){var n=e.get("art")||e.channel&&e.channel.get("art");if(i.css("background-image","none"),
i.addClass("transition-out"),!n)return this.currentArt=null,void(this.currentArtSrc=null);var s=t.bind(function(e){this.currentArt=n,this.currentArtSrc=e,i.css("background-image","url("+e+")"),i.removeClass("transition-out")},this);this.currentArt===n?s(this.currentArtSrc):this.backgroundImage.load(n,!0).done(s)}},".play-btn":{modelAttribute:"paused",modelListeners:["paused","canPlayPause"],manual:!0,autohide:!0,formatter:function(e,t){return t.toggleClass("disabled",!this.model.get("canPlayPause")),
e}},".pause-btn":{modelAttribute:"paused",modelListeners:["paused","canPlayPause"],manual:!0,autohide:!0,formatter:function(e,t){return t.toggleClass("disabled",!this.model.get("canPlayPause")),!e}},".previous-btn":{modelAttribute:"canSkipPrevious",manual:!0,autohide:function(){var e=this.model.get("playQueue");return e&&e.get("collection").length>1},formatter:function(e,t){t.toggleClass("disabled",!e)}},".next-btn":{modelAttribute:"canSkipNext",manual:!0,autohide:function(){var e=this.model.get("playQueue");
return e&&e.get("collection").length>1},formatter:function(e,t){t.toggleClass("disabled",!e)}},".player-position":{modelAttribute:"position",formatter:function(e){return l(e)}},".player-duration":{modelAttribute:"duration",formatter:function(e){return l(e)}},".volume-btn":{modelAttribute:"canSetVolume",manual:!0,autohide:!0,formatter:function(e,t){return this.$el.toggleClass("show-volume",e),e}},".minimize-btn":{modelAttribute:"showMinimize",manual:!0,autohide:!0},".enter-fullscreen-btn":{modelAttribute:"showEnterFullscreen",
manual:!0,autohide:!0},".exit-fullscreen-btn":{modelAttribute:"showExitFullscreen",manual:!0,autohide:!0},".share-btn, .recommend-btn":{modelAttribute:"item",manual:!0,autohide:function(e){var i=u.get("user"),n=t.contains(["clip","userPlaylistItem"],e.get("type"));return e.get("url")&&i.get("signedIn")&&n}},".primary-player-name":{modelAttribute:"friendlyName",autohide:!0,formatter:function(e){return e?s("Casting to {1}",e):void 0}}},onRender:function(){this.ui.video.on("webkitendfullscreen",this.onMobileVideoClose),
this.posterImage.setElement(this.ui.poster),this.seekBar.append(this.seekBarView),this.volume.show(this.volumeSlider);var e=this.model.get("playQueue");e&&e.get("collection").length>1&&this.playQueueDropdown.append(this.playQueueDropdownView,this.ui.dropups),this.updateVolumeBtn(this.model.get("volume")),this.scrubPreview.append(new x({model:this.model})),this.qualityDropdown.append(new y({model:this.model}),this.ui.dropdowns),this.audioDropdown.append(new b({model:this.model,type:"audio"}),this.ui.dropdowns),
this.subtitlesDropdown.append(new b({model:this.model,type:"subtitles"}),this.ui.dropdowns),this.playerDropdown.append(new w,this.ui.dropdowns),this.imageOverlaysRegion.show(new m({model:this.model}))},onClose:function(){this.ui.video.off("webkitendfullscreen",this.onMobileVideoClose),this.errorSkipInterval=clearInterval(this.errorSkipInterval),this.posterImage.close(),this.backgroundImage.close()},onItemChange:function(e,t){this.errorSkipInterval=clearInterval(this.errorSkipInterval),this.posterImage.src=null,
this.posterImage.setModel(t),this.posterImage.render(),this.backgroundImage.src=null},onPlayerSubtitlesUrlChange:function(e,t){t?this.subtitles.show(new f({model:e,subtitleSize:c.get("subtitleSize"),rendererOptions:{enableSvg:"safari"!==a.id}})):this.subtitles.close()},onVolumeChange:function(e,t){this.volumeSlider.displayValue(t),this.updateVolumeBtn(t)},onErrorMessageChange:function(e,t){var i=u.has("primaryPlayer");if(this.ui.errorMessage.text(t),this.ui.errorSkipMessage.text(""),t&&!i){var n=e.get("playQueue").get("collection");
if(n.length>1){var s=e.get("item"),a=n.at(n.length-1);s.id!==a.id&&this.createErrorSkipInterval()}}},onErrorSkipInterval:function(){this.errorSkipCounter--,this.updateErrorSkipMessage(this.errorSkipCounter),0===this.errorSkipCounter&&(this.errorSkipInterval=clearInterval(this.errorSkipInterval),this.trigger("next"))},onBufferingMessageChange:function(e,t){t?this.alertRegion.show(new S({message:t})):this.alertRegion.close()},onShowQualityChange:function(e,t){var i=this.qualityDropdown.currentView;i&&i.$el.toggleClass("hidden",!t);
},onShowAudioStreamChange:function(e,t){var i=this.audioDropdown.currentView;i&&i.$el.toggleClass("hidden",!t)},onShowSubtitleStreamChange:function(e,t){var i=this.subtitlesDropdown.currentView;i&&i.$el.toggleClass("hidden",!t)},onSeekBarValueChange:function(e){this.trigger("change:position",e)},onSeekBarHover:function(e){e?(this.scrubPreview.currentView.updatePreview(e),this.scrubPreview.currentView.show()):this.scrubPreview.currentView.hide()},onVolumeSliderValueChange:function(e){this.trigger("change:volume",e);
},onVolumeClick:function(e){e.preventDefault(),this.muted?(this.mutedVolume>0?this.trigger("change:volume",this.mutedVolume):this.trigger("change:volume",100),this.muted=!1,this.mutedVolume=0):(this.muted=!0,this.mutedVolume=this.model.get("volume"),this.trigger("change:volume",0))},onEnterFullscreenClick:function(e){e.preventDefault(),this.model.get("forceWebkitVideoFullscreen")?this.ui.video[0].webkitEnterFullscreen():this.trigger("enterFullscreen")},onExitFullscreenClick:function(e){e.preventDefault(),
this.trigger("exitFullscreen")},onMobileVideoClose:function(e){r.trigger("hide:player")},onOverlayClick:function(e){e.preventDefault();var t=this.model.get("playing"),i=t?"pause":"play";return"pause"===i&&o.hasTouchScreen&&!this.visible?void this.trigger("toggleControls",{autohide:!0}):void this.trigger(i)},onShareClick:function(e){e.preventDefault(),r.trigger("show:modal",new k({model:this.item}))},onRecommendClick:function(e){e.preventDefault(),r.trigger("show:modal",new P({model:this.item}))},
onErrorMessageClick:function(e){e.preventDefault(),this.errorSkipInterval?this.trigger("next"):r.trigger("hide:player")},onSkip:function(e,t){this.trigger("skip",t)},onRemove:function(e,t){this.trigger("remove",t)},onMove:function(e,t){this.trigger("move",e,t)}});return A}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1232),i(265)],s=function(e,t){"use strict";var i=t.extend({id:"player-primary-player-dropdown",tagName:"span",className:"dropdown",template:e});return i}.apply(t,n),
!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1233),i(2),i(4),i(6),i(46),i(17)],s=function(e,t,i,n,s,a){"use strict";var r=n.ItemView.extend({id:"player-quality-dropdown",tagName:"span",className:"dropdown hidden",template:e,modelEvents:{"change:transcodeServer":"render","change:qualityIndex":"render","change:media":"render"},events:{"click .dropdown-menu a":"onQualityClick"},serializeData:function(){var e=this.model.get("transcodeServer"),i=this.model.get("media"),n=s.getAvailableQualitiesFor(i,e);
if(!n.length||!this.model.get("canSetQuality"))return void this.model.set("showQuality",!1);this.model.set("showQuality",!0);var a=this.model.get("qualityIndex"),r=t.findWhere(n,{index:a});return r&&(r.selected=!0),{availableQualities:n.reverse(),hasSelectedQuality:!!r}},onQualityClick:function(e){e.preventDefault();var t=i(e.currentTarget);if(!t.hasClass("selected")){var n=s.getQualityAttribute(this.model.get("item")),r=parseInt(t.data("index"),10);a.save(n,r),this.model.set("qualityIndex",r)}}});
return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1234),i(2),i(4),i(6),i(26),i(47),i(9),i(11)],s=function(e,t,i,n,s,a,r,o){"use strict";var l=n.ItemView.extend({id:"player-quality-dropdown",tagName:"span",className:"dropdown hidden",template:e,modelEvents:{"change:media":"render"},events:{"click .dropdown-menu a":"onStreamClick"},initialize:function(e){this.streamType=a.get(e.type);var t=this.streamType.typeString;this.capabilityAttr="audio"===t?"canSetAudioStream":"canSetSubtitleStream",
this.visibilityAttr="audio"===t?"showAudioStream":"showSubtitleStream",this.$el.attr("id",t+"-dropdown-list"),this.listenTo(this.model,"change:"+this.capabilityAttr,this.render),this.listenTo(this.model,"change:"+this.streamType.key,this.render)},serializeData:function(){var e=this.model.get("media"),t=this.streamType.typeString;if(!e||!this.model.get(this.capabilityAttr))return this.model.set(this.visibilityAttr,!1),{type:t};this.model.get(this.visibilityAttr)&&this.$el.hasClass("hidden")&&this.$el.removeClass("hidden");
var i=s.getStreams(e,{streamType:this.streamType.id});if(i.length<2)return this.model.set(this.visibilityAttr,!1),{type:t};this.model.set(this.visibilityAttr,!0);var n,a=s.getStreams(e,{streamType:this.streamType.id,selected:!0});return a.length&&(n=a[0]),{type:t,streams:i,selectedStream:n}},onStreamClick:function(e){e.preventDefault();var n=i(e.currentTarget),a=n.data("id");if(r.has("primaryPlayer"))s.selectStream(this.model.get("media"),this.streamType,a),this.model.set(this.streamType.key,a);else{
var l=o.execute("selectStream",{item:this.model.get("item"),media:this.model.get("media"),part:this.model.get("part"),streamType:this.streamType,streamID:a});l.done(t.bind(function(){this.model.set(this.streamType.key,a)},this))}}});return l}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(18),i(916)],s=function(e,t){"use strict";var i=e.extend({tagName:"ul",className:"tile-list media-tile-list playlist-tile-list",itemView:t,modelEvents:{"change:currentSort":"onListRefresh",
"change:currentType":"onListRefresh"},onListRefresh:function(){this.collection.clear(),this.collection.fetch({reset:!0,scope:"page"})},onClose:function(){this.collection.clear()}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1235),i(2),i(4),i(6),i(7),i(5),i(150),i(11),i(128),i(103),i(71)],s=function(e,t,i,n,s,a,r,o,l,c,u){"use strict";var d=n.ItemView.extend({tagName:"li",className:"poster-item media-tile-list-item playlist-tile-list-item playlist",template:e,events:{
"click .play-btn":"onPlayClick","click .edit-btn":"onEditClick","click .more-btn":"onMoreClick","hide.bs.dropdown .playlist-actions-dropdown":"onDropdownHide"},ui:{composite:".media-poster",actions:".media-poster-actions",dropdown:".media-actions-dropdown"},bindings:{".playlist-title":{modelAttribute:"title"},".playlist-duration":{modelAttribute:"duration",modelListeners:["duration","leafCount"],formatter:function(e){return e?r(e):1===this.model.get("leafCount")?s("1 Item"):s("{1} Items",this.model.get("leafCount"));
}}},initialize:function(){t.bindAll(this,"onResize"),this.compositeImage=new l({model:this.model,width:150}),a.trigger("content.subscribe:resize",this.onResize)},serializeData:function(){var e="#!/server/"+encodeURIComponent(this.model.server.id);return e+="/playlist/"+this.model.get("ratingKey"),{url:e,smart:this.model.get("smart")}},onRender:function(){this.compositeImage.setElement(this.ui.composite)},onClose:function(){this.compositeImage.close(),a.trigger("content.unsubscribe:resize",this.onResize);
},onResize:function(e){this.containerSize=e},onPlayClick:function(e){e.preventDefault(),e.stopImmediatePropagation(),o.execute("playMedia",{item:this.model})},onEditClick:function(e){e.preventDefault(),a.trigger("show:modal",new u({model:this.model}))},onMoreClick:function(e){e.preventDefault(),e.stopImmediatePropagation(),this.dropdown=new c({model:this.model}),this.ui.dropdown.append(this.dropdown.render().el),this.ui.dropdown.addClass("open"),this.$el.addClass("force-hover");var t=i(e.currentTarget),n=this.ui.actions.position().top,s=this.dropdown.getPosition(t,this.containerSize,n);
this.ui.dropdown.css(s)},onDropdownHide:function(e){this.dropdown&&(this.dropdown.close(),this.dropdown=null,this.$el.removeClass("force-hover"))}});return d}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1236),i(6),i(5),i(705),i(719),i(915)],s=function(e,t,i,n,s,a){"use strict";var r=t.Layout.extend({className:"section-container",template:e,regions:{list:".playlists-container"},initialize:function(){i.trigger("show:bar","actionbar",new n({model:this.model})),i.trigger("show:bar","breadcrumbbar",new s({
model:this.model}))},onRender:function(){this.list.append(new a({model:this.model,collection:this.model.get("items")}),this.$el)},onClose:function(){i.trigger("hide:bar","actionbar"),i.trigger("hide:bar","breadcrumbbar")}});return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1237),i(6),i(93),i(5),i(17),i(278),i(276),i(277),i(63)],s=function(e,t,i,n,s,a,r,o,l){"use strict";var c=t.Layout.extend({className:"section-list-container",template:e,ui:{loading:".section-loading-container",
emptyMessageContainer:".empty-message"},regions:{list:"ul"},modelEvents:{"change:selecting":"onSelectingChange","change:currentType":"onCurrentTypeChange","change:currentFilters":"onListRefresh","change:currentSort":"onListRefresh","change:currentFirstCharacter":"onCurrentFirstCharacterChange","socket:timeline":"onTimeline","change:refreshing":"showEmptyMessage"},collectionEvents:{reset:"showEmptyMessage","change:totalSize":"showEmptyMessage"},events:{"click .add-to-library-link":"onAddToLibraryLinkClick"
},onlyAfterRender:["showLoading","hideLoading","showEmptyMessage"],initialize:function(e){this.listenTo(s.getInstance(),"change:listType",this.onListTypeChange),this.mediaActions=e.mediaActions,this.collection.fetch({reset:!0,scope:"page"})},serializeData:function(){return{canEdit:this.model.server.get("isFullOwnedServer")}},showLoading:function(e){e||(e={});var t=this.list.currentView,i=t.itemsPerPage,n=this.collection[t.sizeProperty];this.ui.loading.toggleClass("has-scrollbar",n>i),this.ui.loading.toggleClass("bottom",!e.prepend),
this.ui.loading.removeClass("hidden")},hideLoading:function(){this.ui.loading.addClass("hidden")},showEmptyMessage:function(){this.ui.emptyMessageContainer.removeClass("folder filter refreshing default");var e=this.collection[this.list.currentView.sizeProperty];if(0===e){var t=this.model.get("currentSubset"),i=this.model.get("currentFilters");t&&"folder"===t.id?this.ui.emptyMessageContainer.addClass("folder"):t&&"all"!==t.id?this.ui.emptyMessageContainer.addClass("filter"):i&&i.length?this.ui.emptyMessageContainer.addClass("filter"):this.model.get("refreshing")?this.ui.emptyMessageContainer.addClass("refreshing"):this.ui.emptyMessageContainer.addClass("default");
}},getListConstructor:function(){var e=s.getInstance().getSectionListType(this.model);switch(e){case"media-details-list":return r;case"media-list":return o;default:return a}},onRender:function(){var e=this.getListConstructor();if(e){var t=new e({collection:this.collection,paginated:this.model.server.get("isFullServer"),mediaActions:this.mediaActions});this.list.append(t,this.$el),this.listenTo(this.list.currentView,{"change:loading":this.onLoadingChange})}},onClose:function(){this.collection.clear();
},onSelectingChange:function(e,t){this.$el.toggleClass("hide-actions",t)},onCurrentTypeChange:function(){this.onListRefresh();var e=s.getInstance().getSectionListType(this.model),t=s.getInstance().getSectionListType(this.model,this.model.previous("currentType"));e!==t&&this.render()},onListRefresh:function(){this.collection.scrollPosition=0,this.collection.clear({silent:!1}),this.collection.fetch({reset:!0,scope:"page"}),this.showLoading()},onListTypeChange:function(e,t){this.list.currentView.scrollPosition=0,
this.collection.populatedRange.start>0&&(this.collection.clear(),this.collection.fetch({reset:!0,scope:"page"})),this.render()},onCurrentFirstCharacterChange:function(e,t){for(var i=e.get("firstCharacters"),n=0,s=0,a=i.length;a>s;s++){var r=i.at(s);if(t.id===r.id)break;n+=r.get("size")}this.list.currentView.scrollToIndex(n)},onTimeline:function(e){if(e.state===i.CREATED||e.state===i.DELETED){var t=this.model.get("currentType");("folder"===this.collection.subset||e.type===t.id)&&this.list.currentView.merge();
}},onLoadingChange:function(e,t){e?this.showLoading(t):this.hideLoading()},onAddToLibraryLinkClick:function(e){e.preventDefault(),n.trigger("show:modal",new l({server:this.model.server,model:this.model,selectedPane:"folders"}))}});return c}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1238),i(2),i(6),i(5),i(50),i(464),i(465),i(706),i(720),i(716),i(918)],s=function(e,t,i,n,s,a,r,o,l,c,u){"use strict";var d=i.Layout.extend({className:"section-container",template:e,regions:{
list:".section-list-container"},modelEvents:{"default:currentSort":"toggleAlphaBar","change:currentType":"toggleAlphaBar","change:currentSort":"toggleAlphaBar","change:currentSubset":"onCurrentSubsetChange"},initialize:function(e){this.initViewState(e).always(t.bind(function(){this.model.set("currentFolderKey",e.folderKey),n.trigger("show:bar","actionbar",new o({model:this.model,mediaActions:this.mediaActions})),n.trigger("show:bar","breadcrumbbar",new l({model:this.model})),this.toggleAlphaBar();
},this))},initViewState:function(e){this.viewState=new a({},t.extend({storage:new r({},{section:this.model}),section:this.model,filters:this.model.get("currentFilters")},e));var i=this.model.get("currentSort");i&&i.set("selected",!1);var n=this.viewState.fetch();return n.done(t.bind(function(){var e=this.viewState.getSectionAttrs();this.model.set(e),this.model.get("currentType").set("selected",!0),this.model.get("currentSubset").set("selected",!0);var t=this.model.get("currentSort");t&&t.set("selected",!0),
this.viewState.addListeners()},this)),n.always(t.bind(function(){this.mediaActions=new s({},{section:this.model,showAdvanced:!0})},this)),n.always(this.whenRendered(function(){var e=new u({model:this.model,collection:this.model.get("items"),mediaActions:this.mediaActions});this.list.append(e,this.$el)})),n},toggleAlphaBar:function(){this.supportsAlphaPagination()?n.trigger("show:bar","alphabar",new c({model:this.model,collection:this.model.get("firstCharacters")})):n.trigger("hide:bar","alphabar");
},supportsAlphaPagination:function(){if(!this.model.get("allowAdvancedFilters")||"all"!==this.model.get("currentSubset").get("key"))return!1;var e=this.model.get("currentType"),t=this.model.get("currentSort");if(!t){var i=/^(season|episode|album|track)$/;return!i.test(e.get("typeString"))}var n=t.get("key"),s=t.get("direction");return"titleSort"===n&&"asc"===s},onCurrentSubsetChange:function(e,t){var i=e.previous("currentSubset"),n=i&&i.id,s=t&&t.id;n!==s&&(this.model.get("items").scrollPosition=0);
},onClose:function(){n.trigger("hide:bar","actionbar"),n.trigger("hide:bar","breadcrumbbar"),n.trigger("hide:bar","alphabar"),this.viewState.removeListeners()}});return d}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1245),i(6),i(2),i(102),i(259)],s=function(e,t,i,n,s){"use strict";function a(e){return i.map(e,function(e){return'<option value="'+e.value+'"'+(e.selected?" selected":"")+">"+e.label+"</option>"}).join("\n")}function r(e,t){return e.map(function(e){return{label:e.get("name"),
value:e.get("identifier"),selected:t===e.get("identifier")}})}function o(e,t){if(!e)return[];var i=e.get("languages"),n=i.map(function(e){return{label:e.get("name"),value:e.id,selected:e.id===t}});return n}var l=t.ItemView.extend({template:e,ui:{agentSelect:"#match-search-agent",languageSelect:"#match-search-language"},events:{"change #match-search-agent":"onAgentSelectChange"},onlyAfterRender:["updateAgents","updateLanguages"],initialize:function(){var e=this.model.section.get("agent"),t=this.setupAgents(e);
t.then(i.bind(this.updateAgents,this,e)),t.then(i.bind(this.updateLanguages,this,e))},serializeData:function(){var e=this.model.section.get("agent"),t=this.model.agentsProxy.findWhere({identifier:e}),i={item:this.model.toJSON(),agents:r(this.model.agentsProxy,e),languages:o(t)};return i},setupAgents:function(e){if(this.model.agentsPromise)return this.model.agentsPromise;var t=this.model.section.getSectionType(),i=new n([],{server:this.model.server,mediaTypeID:t.typeID}),a=t.exclusiveAgents,r=new s(i,a,e);
return this.model.agents=i,this.model.agentsProxy=r,this.model.agentsPromise=this.model.agents.populate({reset:!0,cancelable:!0}),this.model.agentsPromise},updateAgents:function(e){this.ui.agentSelect.html(a(r(this.model.agentsProxy,e)))},updateLanguages:function(e){var t=this.model.agentsProxy.findWhere({identifier:e});if(!e)return void this.ui.languageSelect.empty();var i=this.model.section.get("language");this.ui.languageSelect.html(a(o(t,i)))},onAgentSelectChange:function(e){this.updateLanguages(e.currentTarget.value);
},onModalClose:function(){this.model.agents=null,this.model.agentsProxy=null,this.model.agentsPromise=null}});return l}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1246),i(2),i(6),i(255),i(806)],s=function(e,t,i,n,s){"use strict";var a=i.Layout.extend({template:e,regions:{resultRegion:".result-region"},onlyAfterRender:["updateResults"],initialize:function(){this.setupResults();var e=this.model.section,i={manual:1},n={reset:!0,timeout:0,data:i};/com\.plexapp\.agents\.none\:\/\//.test(this.model.get("guid"))&&t.extend(n,{
data:t.extend(i,{agent:e.get("agent"),language:e.get("language")}),processData:!0}),this.model.results.populate(n).then(t.bind(this.updateResults,this))},setupResults:function(){if(!this.model.results){var e=this.model.results||new n([],{server:this.model.server,parent:this.model});this.model.results=e}},updateResults:function(){this.resultRegion.show(new s({collection:this.model.results,itemViewOptions:{item:this.model}}))},onModalClose:function(){this.model.results=null}});return a}.apply(t,n),
!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1247),i(2),i(4),i(6),i(842)],s=function(e,t,i,n,s){"use strict";var a=n.Layout.extend({className:"devices-container row",template:e,regions:{list:".device-list-container"},events:{"click .nav a":"onDeviceTypeClick"},ui:{filters:".nav a"},deviceTypes:[{id:"all",title:"All",ids:["all"]},{id:"web",title:"Web",ids:["Web Client","Plex Web"]},{id:"pht",title:"Home Theater",ids:["Plex Home Theater","Plex for Home Theater","PlexHomeTheater","Plex Media Center"]
},{id:"pmp",title:"Media Player",ids:["Plex Media Player"]},{id:"pms",title:"Server",ids:["Plex Media Server"]},{id:"android",title:"Android",ids:["Plex for Android","Android"]},{id:"ios",title:"iOS",ids:["Plex/iOS","Plex for iOS"]},{id:"samsung",title:"Samsung",ids:["Plex for Samsung"]},{id:"google-tv",title:"Google TV",ids:["Google TV"]},{id:"windows",title:"Windows",ids:["Plex for Windows"]},{id:"apple-tv",title:"Apple TV",ids:["Plex-ATV","Plex for Apple TV"]},{id:"windows-phone",title:"Windows Phone",
ids:["Plex for Windows Phone"]},{id:"plexbmc",title:"PleXBMC",ids:["PleXBMC"]},{id:"cloud-sync",title:"Cloud Sync",ids:["Cloud Sync"]},{id:"roku",title:"Roku",ids:["Plex for Roku"]},{id:"popcorn-hour",title:"Popcorn Hour",ids:["Plex for Popcorn Hour"]},{id:"xbox",title:"Xbox",ids:["Plex for Xbox One","Plex for Xbox 360"]},{id:"other",title:"Other",ids:[]}],initialize:function(){this.products=this.collection.products(),this.addOtherIds()},serializeData:function(){return{deviceTypes:this.getFilteredDeviceTypes()
}},sortDeviceTypes:function(e){var i=t.sortBy(e,function(e){return"all"===e.id?"":e.title.toLowerCase()});return i},getFilteredDeviceTypes:function(){var e=this.deviceTypes.filter(function(e){return"all"===e.id?!0:t.intersection(this.products,e.ids).length>0},this);return this.sortDeviceTypes(e)},addOtherIds:function(){var e=t.flatten(t.map(this.deviceTypes,function(e){return e.ids})),i=t.difference(this.products,e),n=t.find(this.deviceTypes,function(e){return"other"===e.id});t.each(i,function(e){
n.ids.push(e)})},onRender:function(){this.list.show(new s({collection:this.collection}))},onDeviceTypeClick:function(e){e.preventDefault();var n=i(e.currentTarget),a=n.data("id"),r=this.collection;if(this.ui.filters.removeClass("selected"),n.addClass("selected"),"all"!==a){var o=t.findWhere(this.deviceTypes,{id:a});r=this.collection.filterByProducts(o.ids)}this.list.show(new s({collection:r}))}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1249),i(9),i(291),i(282),i(848)],
s=function(e,t,i,n,s){"use strict";var a=i.extend({template:e,initialize:function(){var e=t.get("user");this.collection=e.get("homeUsers"),this.invites=e.get("invites").filterByHome(),this.sentInvites=e.get("sentInvites").filterByHome(),this.signedInHomeUser=this.collection.get(e.id),this.itemViewOptions={isAdmin:!(!this.signedInHomeUser||!this.signedInHomeUser.get("admin"))},this.addListeners()},addListeners:function(){i.prototype.addListeners.apply(this,arguments),this.signedInHomeUser&&this.listenTo(this.signedInHomeUser,"change:admin",this.onAdminChange);
},onRender:function(){this.friendList.show(new s({collection:this.collection,itemViewOptions:this.itemViewOptions})),this.inviteList.show(new n({collection:this.invites})),this.pendingList.show(new n({collection:this.sentInvites})),this.updateHeaders()},onAdminChange:function(e,t){this.friendList.currentView&&(this.itemViewOptions.isAdmin=t)}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1250),i(2),i(6),i(5),i(9),i(926),i(938),i(925),i(922)],s=function(e,t,i,n,s,a,r,o,l){
"use strict";var c={web:a,server:r,users:o,devices:l},u=i.Layout.extend({className:"container",template:e,ui:{webNavItem:".web-nav-item",serverNavItem:".server-nav-item",usersNavItem:".users-nav-item",devicesNavItem:".devices-nav-item",usersBadge:".users-btn > .badge"},regions:{container:".settings-container"},onlyAfterRender:["onSignedInChange","onPrimaryServerChange"],initialize:function(e){this.options=e,this.subset=e.subset||"web";var t=s.get("user"),i=t.get("invites");this.subsets={users:i},
this.listenTo(t,"change:signedIn",this.onSignedInChange),this.listenTo(s,"change:primaryServer",this.onPrimaryServerChange),this.listenTo(i,"reset add remove",this.onInvitesChange),this.listenTo(n,"change:language",this.render)},serializeData:function(){var e=s.get("user"),t=s.get("primaryServer");return{subset:this.subset,signedIn:e.get("signedIn"),hasPrimaryServer:t&&!t.get("shared")}},updateBadges:function(){var e={users:this.subsets.users.length};t.each(t.keys(e),function(t){var i=this.ui[t+"Badge"];
i.text(e[t]),i.toggleClass("hidden",0===e[t])},this)},onRender:function(){var e=c[this.subset];this.container.show(new e(this.options)),this.updateBadges()},onSignedInChange:function(e,t){this.ui.usersNavItem.toggleClass("hidden",!t),this.ui.devicesNavItem.toggleClass("hidden",!t)},onPrimaryServerChange:function(e,t){var i=t&&!t.get("shared");this.ui.serverNavItem.toggleClass("hidden",!i)},onInvitesChange:function(){this.updateBadges()}});return u}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){
var n,s;n=[i(1251),i(2),i(4),i(6),i(7),i(5),i(16),i(11),i(9),i(923),i(291),i(83),i(107)],s=function(e,t,i,n,s,a,r,o,l,c,u,d,h){"use strict";var p={home:c,friends:u},f=n.Layout.extend({className:"users-container",template:e,ui:{navLinks:".nav-cards a",homeBadge:".home-card > .badge",friendsBadge:".friends-card > .badge",leaveHomeBtn:".leave-home-btn",enableGuestBtn:".enable-guest-btn",disableGuestBtn:".disable-guest-btn",userActions:".user-actions"},regions:{container:".users-row"},events:{"click .nav-cards a":"onNavClick",
"click .add-user-btn":"onAddUserClick","click .leave-home-btn":"onLeaveHomeClick","click .invite-friend-btn":"onInviteFriendClick","click .enable-guest-btn":"onEnableGuestClick","click .disable-guest-btn":"onDisableGuestClick"},shouldShowUserActions:function(){return this.signedInHomeUser.get("admin")&&this.user.hasPlexPass()},shouldShowLeaveHome:function(){return this.home.length>1&&!this.signedInHomeUser.get("restricted")},shouldShowFriends:function(){return!this.signedInHomeUser.get("restricted");
},shouldShowEnableGuest:function(){return!(this.homeDetails&&this.homeDetails.get("guestEnabled"))},initialize:function(e){this.subset=e.usersSubset,this.user=l.get("user"),this.home=this.user.get("homeUsers"),this.invites=this.user.get("invites"),this.signedInHomeUser=this.home.get(this.user.id),this.homeDetails=this.user.get("homeDetails"),this.proxies={home:this.invites.filterByHome(),friends:this.invites.filterByFriends()},e.promptPIN&&a.trigger("show:modal",new h({model:this.signedInHomeUser,
isEditing:!0,isEditWarning:!this.signedInHomeUser.get("protected")})),this.listenTo(this.signedInHomeUser,"change:admin",this.onAdminChange),this.listenTo(this.home,"reset add remove",this.onHomeChange),this.listenTo(this.invites,"reset add remove",this.onInvitesChange),this.listenTo(this.homeDetails,"change",this.onHomeDetailsChange)},serializeData:function(){return{subset:this.subset,showUserActions:this.shouldShowUserActions(),showLeaveHome:this.shouldShowLeaveHome(),showFriends:this.shouldShowFriends(),
showEnableGuest:this.shouldShowEnableGuest(),showDisableGuest:!this.shouldShowEnableGuest()}},showSubset:function(e){e&&(this.$el.removeClass("show-"+this.subset),this.subset=e),this.$el.addClass("show-"+this.subset);var t=p[this.subset];t?this.container.append(new t):r.warn("Invalid subset: "+this.subset)},updateBadges:function(){var e={home:this.proxies.home.length,friends:this.proxies.friends.length};t.each(t.keys(e),function(t){var i=this.ui[t+"Badge"];i.text(e[t]),i.toggleClass("hidden",0===e[t]);
},this)},toggleGuestAccount:function(e,t){e.preventDefault(),o.execute("toggleGuest",{user:this.user,enable:t})},onRender:function(){this.showSubset(),this.updateBadges()},onClose:function(){t.each(this.proxies,function(e){e.destroy()})},onAdminChange:function(){this.ui.userActions.toggleClass("hidden",!this.shouldShowUserActions())},onHomeChange:function(){this.ui.leaveHomeBtn.toggleClass("hidden",!this.shouldShowLeaveHome())},onInvitesChange:function(){this.updateBadges()},onHomeDetailsChange:function(){
this.ui.enableGuestBtn.toggleClass("hidden",!this.shouldShowEnableGuest()),this.ui.disableGuestBtn.toggleClass("hidden",this.shouldShowEnableGuest())},onNavClick:function(e){e.preventDefault();var n=i(e.currentTarget);n.hasClass("selected")||(this.ui.navLinks.removeClass("selected"),n.addClass("selected"),this.showSubset(t.last(e.currentTarget.href.split("/"))),a.trigger("navigate","users",{subset:this.subset,trigger:!1}))},onAddUserClick:function(e){e.preventDefault();var t=this.user.get("maxHomeSize");
t&&this.home.length-1<t?a.trigger("show:modal",new d({type:"home"})):a.trigger("show:alert",{type:"error",message:s("You have reached the {1} person home limit.",t)})},onLeaveHomeClick:function(e){e.preventDefault(),o.execute("removeHomeUser",{homeUser:this.signedInHomeUser,isSignedInUser:!0})},onInviteFriendClick:function(e){e.preventDefault(),a.trigger("show:modal",new d({type:"friend"}))},onEnableGuestClick:function(e){this.toggleGuestAccount(e,!0)},onDisableGuestClick:function(e){this.toggleGuestAccount(e,!1);
}});return f}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1252),i(2),i(4),i(6),i(87),i(7),i(5),i(34),i(79),i(46),i(223),i(92),i(91),i(260),i(693),i(690),i(88),i(17),i(11),i(9),i(39),i(137),i(283)],s=function(e,t,i,n,s,a,r,o,l,c,u,d,h,p,f,m,g,v,y,b,w,x,S){"use strict";var C=[{value:0,title:"None"},{value:1,title:"1"},{value:2,title:"2"},{value:3,title:"3"},{value:4,title:"4"},{value:5,title:"5"}],k=[{id:"dashboardPriorityOnDeck",enabledID:"dashboardOnDeckEnabled",title:"On Deck"
},{id:"dashboardPriorityRecentlyAdded",enabledID:"dashboardRecentlyAddedEnabled",title:"Recently Added"},{id:"dashboardPriorityChannels",enabledID:"dashboardChannelsEnabled",title:"Channels"},{id:"dashboardPriorityQueue",enabledID:"dashboardQueueEnabled",title:"Watch Later"},{id:"dashboardPriorityRecommendations",enabledID:"dashboardRecommendationsEnabled",title:"Recommended"}],P=n.ItemView.extend({className:"web-settings-container",template:e,ui:{dashboardList:".dashboard-list",chromecastCustomGroup:"#chromecast-custom-group",
submitBtn:".submit-btn",message:".form-message"},events:{"click .toggle-advanced-btn":"onToggleAdvancedClick","click .settings-nav a":"onSettingsGroupClick","click .keyboard-shortcuts-btn":"onKeyboardShortcutsClick","change #chromecastAppID":"onChromecastAppIDChange","change input[id]":"onInputChange","keyup input[type=text]":"onInputChange","change select[id]":"onInputChange","update .dashboard-list":"onDashboardUpdate","submit #web-settings-form":"onSubmit"},onlyAfterRender:["saveChanges"],initialize:function(){
this.changes={};var e=b.get("user");this.listenTo(e,"change:signedIn",this.onSignedInChange),this.listenTo(b,"change:primaryServer",this.render),this.listenTo(r,"shortcut:save",this.saveChanges);var t=v.get("showAdvancedSettings");this.$el.toggleClass("show-advanced",t)},serializeData:function(){var e=[],i=this.model.toJSON(),n=b.get("user"),s=n.hasPlexPass(),a=n.hasHome(),r=n.isNinja();return t.each(t.keys(g.getLanguages()),function(t){e.push({value:t,title:l.getLanguageName(t)})}),t.each(k,function(e){
e.value=i[e.id],e.enabled=i[e.enabledID]}),{settings:i,hasPlexPass:s,hasHome:a,isNinja:r,showExperimentalPlayer:o.hasMediaSource&&w.get("allowFlash"),version:"2.4.39",languages:e,debugLevels:u.settings,subtitlesBurnLevels:d.settings,chromecastAppIDs:p.settings,availableQualities:c.getAvailableQualities().reverse(),subtitleSizes:f.settings,audioBoostLevels:m.settings,httpFallbackOptions:h.settings,extrasPrefixCounts:C,dashboardPriorities:t.sortBy(k,"value")}},saveChanges:function(){var e=this.ui.submitBtn,i=this.ui.message;
if(!e.isDisabled()){e.addClass("active");var n=!!this.changes.language,s=this.model.save(this.changes);s.done(t.bind(function(){this.changes={},n||(e.addClass("disabled"),i.text(a("Your changes have been saved.")))},this)),s.fail(t.bind(function(){i.text(a("Your changes could not be saved."))},this)),s.always(t.bind(function(){n||e.removeClass("active")},this))}},onRender:function(){this.sortable=new s(this.ui.dashboardList[0],{draggable:".card-sortable",animation:200})},onSignedInChange:function(e,t){
null!=t&&this.render()},onToggleAdvancedClick:function(e){e.preventDefault();var t=this.$el.hasClass("show-advanced");t&&this.$(".advanced-setting > .selected").length&&this.$(".nav a:first").click(),this.$el.toggleClass("show-advanced",!t),v.save("showAdvancedSettings",!t)},onSettingsGroupClick:function(e){e.preventDefault();var t=i(e.currentTarget),n=t.attr("href");this.$(".settings-group").removeClass("active"),this.$(n).addClass("active"),this.$(".nav a").removeClass("selected"),t.addClass("selected");
},onKeyboardShortcutsClick:function(e){e.preventDefault(),r.trigger("show:modal",new S({shortcuts:x.prop("shortcuts")}))},onChromecastAppIDChange:function(e){var t=e.currentTarget.value===p.CUSTOM;this.ui.chromecastCustomGroup.toggleClass("hidden",!t)},onInputChange:function(e){var t=i(e.currentTarget),n=e.currentTarget,s=n.value;"checkbox"===n.type&&(s=t.prop("checked")),"int"===t.data("type")&&(s=parseInt(s,10)),this.changes[n.id]=s,this.ui.submitBtn.removeClass("disabled"),this.ui.message.text("");
},onDashboardUpdate:function(e){var i={};this.ui.dashboardList.find(".card-sortable").each(function(e,t){i[t.id]=e+1}),t.extend(this.changes,i),this.ui.submitBtn.removeClass("disabled"),this.ui.message.text("")},onSubmit:function(e){e.preventDefault(),this.saveChanges()}});return P}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1253),i(2),i(4),i(6),i(25),i(102),i(838),i(840)],s=function(e,t,i,n,s,a,r,o){"use strict";var l=n.Layout.extend({template:e,ui:{agentLabel:".agent-label",
typeNavItems:".agent-types-nav li",agentNavItems:".agents-nav li"},regions:{agentsList:".agents-list-container",contributorsList:".contributors-list-container"},events:{"click .agent-types-nav a":"onAgentTypeClick","click .agents-nav a":"onAgentClick"},initialize:function(){this.bindAllWhenRendered("onAgentsReset","onContributorsReset"),this.agentTypes=[],this.agentTypes.push(s.get("movie")),this.agentTypes.push(s.get("show")),this.agentTypes.push(s.get("artist")),this.agentTypes.push(s.get("album")),
this.agentTypes.push(s.get("photo")),this.currentType=t.first(this.agentTypes),this.populateAgents()},serializeData:function(){return{currentType:this.currentType,agentTypes:this.agentTypes}},populateAgents:function(){this.agents=new a([],{server:this.model,mediaTypeID:this.currentType.id});var e=this.agents.populate({reset:!0,scope:"page"});e.done(t.bind(this.onAgentsReset,this))},selectAgent:function(e){this.currentAgent&&this.currentAgent.set("selected",!1),this.currentAgent=e,e.set("selected",!0),
this.ui.agentLabel.text(e.get("name")),this.additionalAgents=new a([],{server:this.model,mediaTypeID:this.currentType.id,relatedAgentID:e.id}),this.contributors=new a([],{server:this.model,mediaTypeID:this.currentType.id,primaryAgentID:e.id}),this.contributorsList.show(new o({collection:this.contributors})),this.listenTo(this.contributorsList.currentView,"save",this.onContributorsSave),this.populateContributors()},populateContributors:function(){var e=[];e.push(this.additionalAgents.populate({reset:!0,
scope:"page"})),e.push(this.contributors.populate({reset:!0,scope:"page"}));var n=i.when.apply(i,e);n.done(t.bind(this.onContributorsReset,this))},onAgentsReset:function(){if(this.agentsList.show(new r({collection:this.agents})),this.agents.length){var e=this.agents.findWhere({selected:!0})||this.agents.first();this.selectAgent(e)}},onContributorsReset:function(){var e=t.bind(function(e){return e.id===this.currentAgent.id?(e.set("isPrimary",!0),!0):!!this.contributors.get(e.id)},this);this.contributors.reset(this.additionalAgents.filter(e));
},onAgentTypeClick:function(e){e.preventDefault();var t=i(e.currentTarget),n=t.data("type");this.currentType=s.get(n),this.populateAgents(),this.ui.typeNavItems.removeClass("active"),t.parent("li").addClass("active")},onAgentClick:function(e){e.preventDefault();var t=i(e.target),n=t.data("identifier"),s=this.agents.get(n);this.selectAgent(s)},onContributorsSave:function(e){this.currentAgent.url="system/agents/"+this.currentAgent.id+"/config/"+this.currentType.id;var i=this.currentAgent.save({order:e
});i.done(t.bind(function(){this.additionalAgents.fetch({silent:!0}),this.contributors.fetch({silent:!0})},this))}});return l}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(84)],s=function(e,t){"use strict";var i=t.extend({prefix:"channel.",serializeData:function(){var i=t.prototype.serializeData.apply(this,arguments),n=this.options.channelSettings.toJSON();return e.each(n,function(e){e.id=this.prefix+e.id},this),i.unshift.apply(i,n),i},updateModel:function(e,i){var n=t.prototype.updateModel.apply(this,arguments);
if(n)return n;var s=e.replace(this.prefix,""),a=this.options.channelSettings.get(s);return a?a.set("value",i):void 0}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1254),i(2),i(7),i(84),i(934),i(935)],s=function(e,t,i,n,s,a){"use strict";var r=n.extend({template:e,regions:{signIn:".sign-in-region",update:".update-region"},serializeData:function(){var e=n.prototype.serializeData.apply(this,arguments),i=t.findWhere(e,{id:"FriendlyName"});return i&&(i.placeholder=this.model.get("friendlyName")),
e},bindings:{".version":{modelAttribute:"shortVersion",formatter:function(e){return i("Version {1}",e)}}},onRender:function(){n.prototype.onRender.apply(this,arguments),this.signIn.show(new s({model:this.model.get("cloudAccount"),collection:this.collection})),this.update.show(new a({model:this.model.get("update"),collection:this.collection}))}});return r}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(2),i(7),i(79),i(84)],s=function(e,t,i,n){"use strict";var s=n.extend({prefix:"account.",
serializeData:function(){var n=this.options.account,s=[],a=e.map(i.languages,function(e,t){return{value:t,label:e}});return s.push({id:this.prefix+"autoSelectAudio",label:t("Automatically select audio and subtitle tracks"),summary:t("Automatically select audio and subtitle tracks in your preferred language when possible."),"default":!1,value:n.get("autoSelectAudio"),type:"bool",group:"account.language",advanced:!1,hidden:!1}),s.push({id:this.prefix+"defaultAudioLanguage",label:t("Prefer audio tracks in"),
"default":"en",value:n.get("defaultAudioLanguage"),type:"text",group:"account.language",advanced:!1,hidden:!1,enumValues:a}),s.push({id:this.prefix+"subtitleMode",label:t("Subtitle mode"),"default":1,value:parseInt(n.get("subtitleMode"),10),type:"int",group:"account.language",advanced:!1,hidden:!1,enumValues:[{value:0,label:t("Manually selected")},{value:1,label:t("Shown with foreign audio")},{value:2,label:t("Always enabled")}]}),s.push({id:this.prefix+"defaultSubtitleLanguage",label:t("Prefer subtitles in"),
"default":"en",value:n.get("defaultSubtitleLanguage"),type:"text",group:"account.language",advanced:!1,hidden:!1,enumValues:a}),s},updateModel:function(e,t){var i=n.prototype.updateModel.apply(this,arguments);if(i)return i;var s=e.replace(this.prefix,""),a=this.options.account;return a.has(s)?a.set(s,t):void 0}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(6),i(932)],s=function(e,t){"use strict";var i=e.CollectionView.extend({tagName:"ul",className:"nav nav-cards",
itemView:t,selectGroup:function(e){this.selectedView&&this.selectedView.deselect(),this.selectedView=this.children.findByModel(this.collection.get(e)),this.selectedView.select()},showDecorator:function(e,t){var i=this.children.findByModel(this.collection.get(e));i.showDecorator(t)}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1255),i(6)],s=function(e,t){"use strict";var i=t.ItemView.extend({tagName:"li",className:"server-settings-nav-list-item",template:e,ui:{
card:".card"},events:{"click .card":"onClick"},select:function(){this.ui.card.addClass("selected")},deselect:function(){this.ui.card.removeClass("selected")},showDecorator:function(e){this.currentStatus&&this.$el.removeClass(this.currentStatus),this.currentStatus=e,this.$el.addClass(e)},onClick:function(e){e.preventDefault(),this.ui.card.hasClass("selected")||this.trigger("change:pane",this.model.id)}});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1257),i(2),i(4),i(11),i(84)],
s=function(e,t,i,n,s){"use strict";var a=s.extend({className:"remote-access-container",template:e,ui:{manualPortMappingMode:"#ManualPortMappingMode",manualPortMappingPort:"#ManualPortMappingPort"},events:{"change .remote-access-error-container input[id]":"onInputChange","click .sign-in-link":"onSignInClick","click .remote-access-enable-btn":"onEnableClick","click .retry-btn":"onRetryClick","click .remote-access-disable-btn":"onDisableClick"},initialize:function(e){this.cloudAccount=e.cloudAccount,
this.changes=e.changes,this.listenTo(this.cloudAccount,{"change:signInState":this.render,"change:remoteAccessState":this.render})},serializeData:function(){var e=this.collection.get("PublishServerOnPlexOnlineKey"),t=this.collection.get("ManualPortMappingMode"),i=this.collection.get("ManualPortMappingPort"),n=this.cloudAccount.toJSON(),s=!e.get("value"),a=!n.signedIn,r=s||a;return{isDisabled:s,isSignedOut:a,isUnavailable:r,hasPrivateAddress:!(!n.privateAddress||!n.privatePort),hasPublicAddress:!(!n.publicAddress||!n.publicPort),
cloudAccount:n,hasMappingSettings:!(!t||!i),mappingModeSetting:t?t.toJSON():null,mappingPortSetting:i?i.toJSON():null}},enable:function(){},connect:function(){return n.execute("connectServer",{cloudAccount:this.cloudAccount,value:!0})},disconnect:function(){return n.execute("connectServer",{cloudAccount:this.cloudAccount,value:!1})},reconnect:function(){return n.execute("reconnectServer",{cloudAccount:this.cloudAccount})},saveChanges:function(){if(t.isEmpty(this.changes))return i.Deferred().resolve().promise();
var e=this.collection.first().save(this.changes);return e.done(t.bind(function(){this.changes={}},this)),e},onInputChange:function(e){s.prototype.onInputChange.apply(this,arguments),this.ui.manualPortMappingPort.prop("disabled",!this.ui.manualPortMappingMode.prop("checked"))},onSignInClick:function(e){e.preventDefault(),this.trigger("change:pane","general")},onEnableClick:function(e){e.preventDefault(),this.connect()},onDisableClick:function(e){e.preventDefault(),this.disconnect()},onRetryClick:function(e){
e.preventDefault(),this.cloudAccount.set("remoteAccessState","connecting"),this.saveChanges().always(t.bind(this.reconnect,this))}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1258),i(2),i(4),i(6),i(7),i(5),i(11),i(9),i(49)],s=function(e,t,i,n,s,a,r,o,l){"use strict";var c=n.ItemView.extend({className:"server-account-container",template:e,ui:{poster:".server-account-poster",signInBtn:".server-sign-in-btn",signOutBtn:".server-sign-out-btn",username:"input[name=username]",
password:"input[name=password]"},events:{"submit #server-sign-in-form":"onSubmit","click .server-sign-out-btn":"onSignOutClick"},modelEvents:{"change:signedIn":"updateSignInState","change:username":"updateUserImage"},initialize:function(){this.user=o.get("user"),this.image=new l({type:"friend",width:60}),this.listenTo(this.user,"change:signedIn",this.updateUserImage)},updateSignInState:function(){this.$el.toggleClass("signed-in",this.model.get("signedIn"))},updateUserImage:function(){var e=this.model.get("username");
e===this.user.get("username")||e===this.user.get("email")?this.image.setModel(this.user):(this.image.setModel(null),this.image.url=null),this.image.render()},submit:function(e){var i={cloudAccount:this.model,username:e.username.value,password:e.password.value},n=this.signInUser(i);return n=n.then(t.bind(function(){var e=this.model.server;if(!e.get("accessToken")){var t=this.user.get("authenticationToken");t&&e.set("accessToken",t)}return this.signIn(i)},this))},signIn:function(e){return r.execute("signInServer",e);
},signInUser:function(e){return this.user.get("signedIn")?i.Deferred().resolve().promise():r.execute("signIn",{username:e.username,password:e.password})},signOut:function(){return this.ui.username.val(""),this.ui.password.val(""),r.execute("signOutServer",{cloudAccount:this.model})},bindings:{".server-account-username":{modelAttribute:"username"}},onRender:function(){this.image.setElement(this.ui.poster),this.updateSignInState(),this.updateUserImage()},onClose:function(){this.image.close()},onSubmit:function(e){
if(e.preventDefault(),!this.ui.signInBtn.isDisabled()){this.ui.signInBtn.addClass("active");var i=this.submit(e.target);i.done(t.bind(function(){this.model.fetch();var e=r.execute("connectServer",{cloudAccount:this.model,value:!0});e.always(t.bind(function(){this.user.get("signedIn")&&this.user.server.get("resources").fetch()},this))},this)),i.always(this.whenRendered(function(){this.ui.signInBtn.removeClass("active")}))}},onSignOutClick:function(e){if(e.preventDefault(),!this.ui.signOutBtn.isDisabled()){
this.ui.signOutBtn.addClass("active");var i=this.signOut();i.done(t.bind(function(){this.model.fetch()},this)),i.always(this.whenRendered(function(){this.ui.signOutBtn.removeClass("active")}))}}});return c}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1259),i(2),i(6),i(7),i(5),i(11),i(9),i(867)],s=function(e,t,i,n,s,a,r,o){"use strict";var l=i.ItemView.extend({tagName:"span",className:"check-for-updates-container",template:e,ui:{checkForUpdatesBtn:".check-for-updates-btn",
downloadUpdatesContainer:".downloading-updates-container",downloadProgressContainer:".downloading-progress-container",downloadProgressLabel:".downloading-progress-label",updateProgressLabel:".downloading-updates-label",updateErrorMessage:".update-error-message",installManualLink:".install-manual-link"},modelEvents:{"change:state":"onStateChange","change:progress":"onProgressChange"},events:{"click .check-for-updates-btn":"onCheckForUpdatesClick","click .available-updates-btn":"onDownloadUpdatesClick",
"click .install-updates-btn":"onInstallUpdatesClick","click .release-notes-btn":"onInfoClick"},initialize:function(){this.model.fetch().then(this.whenRendered(function(){var e=this.model.get("state");"downloaded"===e&&this.model.get("shouldInstall")?(this.model.set("shouldInstall",!1),this.installUpdates()):this.canCheckForUpdate(e)&&this.checkForUpdates({download:!1})}))},serializeData:function(){return{canCheckForUpdate:this.canCheckForUpdate(this.model.get("state"))}},checkForUpdates:function(e){
a.execute("checkForServerUpdates",{server:this.model.server,download:e.download,initialState:e.initialState})},installUpdates:function(){a.execute("installServerUpdates",{server:this.model.server})},waitForInstall:function(){this.listenTo(this.model.server,"change:isConnected",this.onServerConnectedChange)},showUpdateState:function(e){this.$el.removeClass(this.model.previous("state"));var t=e;this.model.get("canInstall")||"available"!==e||(t="notify"),this.$el.addClass(t);var i=!(!this.model.get("added")&&!this.model.get("fixed"));
if(this.$el.toggleClass("has-release-notes",i),"installing"===t)this.waitForInstall();else if("error"===t||"notify"===t){var s;this.model.get("error")?(s=this.model.get("error"),this.ui.installManualLink.addClass("hidden")):this.model.get("canInstall")?(s=n("Something went wrong."),this.ui.installManualLink.removeClass("hidden")):(s=n("An update is available."),this.ui.installManualLink.removeClass("hidden"));var a=r.get("user").server,o=this.model.get("downloadURL")||a.get("appsUrl");this.ui.installManualLink.attr("href",o),
this.ui.updateErrorMessage.text(s)}},canCheckForUpdate:function(e){return"done"===e||"error"===e||"none"===e},onRender:function(){this.showUpdateState(this.model.get("state"))},onStateChange:function(e,t){this.isRendered&&(this.showUpdateState(t),this.ui.checkForUpdatesBtn.toggleClass("active",!this.canCheckForUpdate(t)))},onProgressChange:function(e,i){t.isNumber(i)?(this.ui.downloadUpdatesContainer.css({"background-size":i+"% 100%"}),this.ui.downloadProgressContainer.removeClass("hidden"),this.ui.downloadProgressLabel.text(i)):this.ui.downloadProgressContainer.addClass("hidden");
},onServerConnectedChange:function(e,t){t&&(this.stopListening(e,"change:isConnected",this.onServerConnectedChange),a.execute("checkForServerUpdates",{server:this.model.server}))},onCheckForUpdatesClick:function(e){e.preventDefault(),this.ui.checkForUpdatesBtn.isDisabled()||(this.ui.checkForUpdatesBtn.addClass("active"),this.checkForUpdates({download:!0}))},onDownloadUpdatesClick:function(e){e.preventDefault(),this.checkForUpdates({download:!0,initialState:"downloading"})},onInstallUpdatesClick:function(e){
e.preventDefault(),this.installUpdates()},onInfoClick:function(e){e.preventDefault(),s.trigger("show:modal",new o({model:this.model}))}});return l}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1260),i(6),i(66)],s=function(e,t,i){"use strict";var n=t.ItemView.extend({template:e,serializeData:function(){return{isTranscoderRequired:!this.model.get("transcoderVideo"),isUpgradeRequired:!this.model.supports("streamReady"),minServerVersion:i.streamReady}}});return n}.apply(t,n),
!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1261),i(2),i(4),i(11),i(82),i(125),i(100),i(262),i(823),i(84),i(936)],s=function(e,t,i,n,s,a,r,o,l,c,u){"use strict";var d=c.extend({mixins:[s],className:"versions-container",template:e,ui:{message:".versions-status-message"},regions:{listRegion:".background-processing-list-region"},events:{"click .delete-all-btn":"onDeleteAllVersionsClick"},initialize:function(e){this.pausedSetting=this.collection.get("BackgroundQueueIdlePaused"),this.playlists=new a([],{
server:this.model,allowInCache:!0}),this.transcodeJobs=new r([],{server:this.model,allowInCache:!0})},initialState:"loading",states:{loading:{nextState:"list",onEnter:function(){var e=this.model.supports("streamReady"),n=this.model.get("transcoderVideo");if(this.listRegion.show(new o({inline:!0})),!e||!n)return void this.enterState("error");var s=i.when(this.playlists.populate(),this.transcodeJobs.fetch());s=s.then(t.bind(function(){return this.playlist=this.playlists.first(),this.playlist?(this.generators=this.playlist.get("children"),
this.generators.fetch()):i.Deferred().reject().promise()},this)),s.done(this.whenRendered(function(){this.enterNextState()})),s.fail(this.whenRendered(function(){this.enterState("error")}))}},list:{onEnter:function(){this.toggleMessage(),this.listenTo(this.generators,"reset add remove",this.toggleMessage),this.listRegion.show(new l({collection:this.generators,itemViewOptions:{transcodeJobs:this.transcodeJobs,pausedSetting:this.pausedSetting}}))},onExit:function(){this.stopListening(this.generators);
}},error:{onEnter:function(){this.listRegion.show(new u({model:this.model}))}}},toggleMessage:function(){this.ui.message.toggleClass("hidden",!this.generators.length)},onRender:function(){this.enterNextState()},onDeleteAllVersionsClick:function(e){e.preventDefault(),n.execute("deleteAllVersionGenerators",{server:this.model}).then(t.bind(function(){return this.generators.fetch()},this))}});return d}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1262),i(2),i(4),i(19),i(6),i(7),i(11),i(5),i(14),i(9),i(104),i(931),i(929),i(933),i(937),i(927),i(928),i(930),i(84),i(17),i(69)],
s=function(e,t,i,n,s,a,r,o,l,c,u,d,h,p,f,m,g,v,y,b,w){"use strict";var x=s.Layout.extend({className:"server-settings-container",template:e,remoteAccessDecorators:{connecting:"unknown",disconnecting:"unknown",unreachable:"error",ok:"success"},regions:{serverDropdown:".filter-bar",nav:".nav-region",pane:".pane-region"},events:{"click .toggle-advanced-btn":"onToggleAdvancedClick"},panes:{general:{constructor:h,group:"general",title:"General",isCustom:!0},remoteAccess:{constructor:p,group:"remoteAccess",
title:"Remote Access",isCustom:!0},versions:{constructor:f,group:"versions",title:"Optimized Versions",isCustom:!0},agents:{constructor:m,group:"agents",title:"Agents",isCustom:!0},library:{constructor:y,group:"library",title:"Library"},channels:{constructor:g,group:"channels",title:"Channels",isCustom:!0},network:{constructor:y,group:"network",title:"Network"},transcoder:{constructor:y,group:"transcoder",title:"Transcoder"},languages:{constructor:v,group:"account.language",title:"Languages",isCustom:!0
},dlna:{constructor:y,group:"dlna",title:"DLNA"},bonjour:{constructor:y,group:"bonjour",title:"Network Discovery"},butler:{constructor:y,group:"butler",title:"Scheduled Tasks"},extras:{constructor:y,group:"extras",title:"Extras"}},initialize:function(e){this.defaultGroup=e.group||"general",this.account=e.account,this.cloudAccount=e.cloudAccount,this.channelSettings=e.channelSettings,this.tempSettings=this.collection.cloneDeep(),this.tempAccount=this.account.clone(),this.tempChannelSettings=this.channelSettings.cloneDeep(),
this.changes={};var n=b.get("showAdvancedSettings");if(this.$el.toggleClass("show-advanced",n),this.initGroups(),this.model.supports("reachability")){var s="/myplex/refreshReachability",a=t.extend(this.model.getXHROptions(s),{type:"PUT"});i.ajax(a)}c.set("primaryServer",this.model),this.listenTo(o,"shortcut:save",this.saveChanges),this.listenTo(c,"change:primaryServer",this.onPrimaryServerChange),this.listenTo(this.cloudAccount,"change:remoteAccessState",this.onRemoteAccessStatusChange)},initGroups:function(){
var e=t.keys(this.panes),i=t.chain(this.collection.pluck("group")).unique().compact().value();this.groups=new n.Collection,t.each(e,function(e){var n=this.panes[e];(n.isCustom||t.contains(i,e))&&this.addGroup(e,n)},this),t.each(i,function(i){if(!t.contains(e,i)){var n={constructor:y,group:i,title:i};this.panes[i]=n,this.addGroup(i,n)}},this)},addGroup:function(e,i){var n=t.omit(i,"constructor");n.id=e,this.groups.add(n)},showPane:function(e){if(this.currentPane){if(this.currentPane.isActive)return this.currentPane;
this.stopListening(this.currentPane),this.flushChanges()}var t=this.panes[e],i=t.constructor,n=new i({model:this.model,collection:this.tempSettings,account:this.tempAccount,cloudAccount:this.cloudAccount,channelSettings:this.tempChannelSettings,group:t.group,changes:this.changes});return this.currentPane=n,this.pane.show(n),this.nav.currentView.selectGroup(e),this.listenTo(this.currentPane,{"change:pane":this.showPane,save:this.saveChanges}),o.trigger("navigate","serverSettings",{serverID:this.model.id,
group:e,replace:!0,trigger:!1}),n},flushChanges:function(){this.currentPane.changes&&t.extend(this.changes,this.currentPane.changes)},saveChanges:function(){if(this.flushChanges(),!this.currentPane.isDisabled&&!this.currentPane.isActive){this.currentPane.triggerMethod("before:save");var e=[],n=this.getPrefixedChanges("channel."),s=this.getPrefixedChanges("account.");if(!t.isEmpty(n)){var a=this.channelSettings.first().getSaveParams(n),r=t.result(this.channelSettings,"url"),o=l.join([r,"/set"],a);e.push(i.ajax(this.model.getXHROptions(o)));
}t.isEmpty(s)||e.push(this.account.save(s)),t.isEmpty(this.changes)||e.push(this.collection.first().save(this.changes));var c=i.when.apply(i,e);c.done(t.bind(function(){var e=t.keys(this.changes);t.each(e,function(e){var t=this.tempSettings.get(e),i=this.collection.get(e);i.set("value",t.get("value")),"ButlerUpdateChannel"===e&&this.onButlerUpdateChannelChange()},this),this.changes={},this.currentPane&&(this.currentPane.changes&&(this.currentPane.changes={}),this.currentPane.triggerMethod("after:save",!0));
},this)),c.fail(t.bind(function(){this.currentPane&&this.currentPane.triggerMethod("after:save",!1)},this))}},getPrefixedChanges:function(e){var i={};return t.each(this.changes,function(t,n){var s=0===n.lastIndexOf(e,0);s&&(i[n.substring(e.length)]=t,delete this.changes[n])},this),i},onRender:function(){this.serverDropdown.append(new u);var e=new d({collection:this.groups});this.listenTo(e,"itemview:change:pane",this.onNavItemChangePane),this.nav.show(e);var t=this.remoteAccessDecorators[this.cloudAccount.get("remoteAccessState")];
t&&this.nav.currentView.showDecorator("remoteAccess",t),this.showPane(this.defaultGroup)},onClose:function(){this.currentPane=null},onNavItemChangePane:function(e,t){this.showPane(t)},onPrimaryServerChange:function(e,t){var i=this.model.get("update");return"installing"===i.get("state")?void this.listenTo(this.model,"change:connected",this.onServerConnectedChange):t?void o.trigger("navigate","serverSettings",{serverID:t.id}):void o.trigger("show:view",new w({title:a("Server settings are unavailable because the server could not be reached.")
}))},onRemoteAccessStatusChange:function(e,t){var i=this.remoteAccessDecorators[t];i&&this.nav.currentView.showDecorator("remoteAccess",i)},onServerConnectedChange:function(e,t){t&&(this.stopListening(e,"change:connected",this.onServerConnectedChange),c.set("primaryServer",e))},onToggleAdvancedClick:function(e){e.preventDefault();var t=this.$el.hasClass("show-advanced");this.$el.toggleClass("show-advanced",!t),b.save("showAdvancedSettings",!t)},onButlerUpdateChannelChange:function(){var e=this.collection.get("ButlerTaskCheckForUpdates"),t=e&&e.get("value");
t&&r.execute("checkForServerUpdates",{server:this.model,download:!1})}});return x}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1263),i(2),i(4),i(6),i(7),i(5),i(11),i(9)],s=function(e,t,i,n,s,a,r,o){"use strict";var l=n.ItemView.extend({className:"setup-basic-container",template:e,ui:{connectCheckbox:"#connect",submitBtn:".submit-btn",nextBtn:".next-btn"},collectionEvents:{reset:"render"},events:{"change input[id]":"onInputChange","submit #setup-basic-form":"onSubmit"},initialize:function(){
this.collection=this.model.get("settings"),this.collection.populate({reset:!0}),this.model.supports("firstRunPref")?this.changes={FirstRun:0}:this.changes={};var e=this.model.get("superToken");e&&(this.changes.PlexOnlineToken=e)},serializeData:function(){var e=this.model.toJSON(),t=this.collection.get("FriendlyName"),i=this.collection.get("collectUsageData");return{server:e,signedIn:!!e.superToken||"ok"===e.myPlexSigninState,friendlyNameSetting:t?t.toJSON():null,collectUsageDataSetting:i?i.toJSON():null
}},submit:function(){var e=this.ui.submitBtn;if(!e.hasClass("active")){e.addClass("active");var t=this.save();t.done(this.whenRendered(function(){var e=this.model.get("cloudAccount");e.get("mappingError")&&this.ui.nextBtn.data("subset","setupConnectError"),this.ui.nextBtn.click()})),t.always(function(){e.removeClass("active")})}},save:function(){if(t.isEmpty(this.changes))return i.Deferred().resolve().promise();delete this.changes.connect;var e=this.collection.first().save(this.changes);return e=e.then(this.whenRendered(function(){
return this.ui.connectCheckbox.length?r.execute("connectServer",{cloudAccount:this.model.get("cloudAccount"),value:this.ui.connectCheckbox.prop("checked")}):void 0}),t.bind(function(){a.trigger("show:alert",{type:"error",message:s("There was a problem saving these settings.")})}))},onInputChange:function(e){var t=e.currentTarget,i=t.value;"checkbox"!==t.type||t.checked||(i="0"),this.changes[t.id]=i},onSubmit:function(e){e.preventDefault(),this.submit()}});return l}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(1264),i(6),i(117),i(271)],s=function(e,t,i,n){"use strict";var s=t.Layout.extend({className:"setup-channels-container",template:e,regions:{list:".setup-channel-list-container"},metricsValue:function(){return this.collection.where({installed:!0}).length},initialize:function(){this.collection=new i([],{server:this.model,url:"/system/appstore/featured"}),this.collection.fetch({scope:"page"})},onRender:function(){this.list.show(new n({collection:this.collection,itemViewOptions:{
closeOnInstall:!0}}))}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1265),i(6),i(9)],s=function(e,t,i){"use strict";var n=t.ItemView.extend({className:"setup-complete-container",template:e,serializeData:function(){var e=i.get("user");return{hasPlexPass:e.hasPlexPass(),plexPassUrl:e.server.get("plexPassUrl")}}});return n}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1266),i(2),i(4),i(6),i(11)],s=function(e,t,i,n,s){"use strict";var a=n.ItemView.extend({
className:"setup-connect-error-container",template:e,ui:{retryBtn:".retry-btn",nextBtn:".next-btn",manualPortMappingPort:"#ManualPortMappingPort"},events:{"change input[id]":"onInputChange","submit #setup-manual-connect-form":"onSubmit"},initialize:function(){this.collection=this.model.get("settings"),this.changes={}},serializeData:function(){var e=this.model.get("cloudAccount"),t=this.collection.get("ManualPortMappingMode"),i=this.collection.get("ManualPortMappingPort");return{cloudAccount:e.toJSON(),
mappingModeSetting:t?t.toJSON():null,mappingPortSetting:i?i.toJSON():null}},save:function(){if(t.isEmpty(this.changes))return i.Deferred().resolve().promise();var e=this.collection.first().save(this.changes);return e.done(t.bind(function(){t.each(this.changes,function(e,t){var i=this.collection.get(t),n=i.get("type");"bool"===n?i.set("value","0"!==e):"int"===n?i.set("value",parseInt(e,10)):i.set("value",e)},this),this.changes={}},this)),e},reconnect:function(){return s.execute("reconnectServer",{
cloudAccount:this.model.get("cloudAccount")})},onInputChange:function(e){var t=e.currentTarget,i=t.value;if("checkbox"===t.type){var n=!1;t.checked||(i="0",n=!0),this.ui.manualPortMappingPort[0].disabled=n}this.changes[t.id]=i},onSubmit:function(e){e.preventDefault();var i=this.ui.retryBtn;if(!i.hasClass("active")){i.addClass("active");var n=this.save();n.always(t.bind(function(){var e=this.reconnect();e.done(t.bind(function(){this.isClosed||this.ui.nextBtn.click()},this)),e.fail(t.bind(this.render,this));
},this))}}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1267),i(6)],s=function(e,t){"use strict";var i=t.ItemView.extend({className:"setup-error-container",template:e});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1268),i(6),i(5),i(851),i(63)],s=function(e,t,i,n,s){"use strict";var a=t.Layout.extend({className:"setup-library-container",template:e,regions:{list:".setup-section-list-container"},events:{"click .add-section-btn":"onAddSectionClick"
},metricsValue:function(){return this.collection.size()},initialize:function(){this.collection=this.model.get("sections"),this.collection.populate()},onRender:function(){this.list.show(new n({collection:this.collection}))},onAddSectionClick:function(e){e.preventDefault(),i.trigger("show:modal",new s({server:this.model}))}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1269),i(6)],s=function(e,t){"use strict";var i=t.ItemView.extend({className:"setup-loading-container",
template:e});return i}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1270),i(2),i(4),i(6),i(5),i(16),i(73),i(11),i(102),i(945),i(943),i(939),i(942),i(944),i(940),i(941)],s=function(e,t,i,n,s,a,r,o,l,c,u,d,h,p,f,m){"use strict";var g={setupLoading:c,setupError:u,setupBasic:d,setupConnectError:h,setupLibrary:p,setupChannels:f,setupComplete:m},v=["com.plexapp.agents.imdb","com.plexapp.agents.thetvdb","com.plexapp.agents.lastfm"],y=n.Layout.extend({className:"container",template:e,
maxAttempts:120,regions:{container:".setup-container"},events:{"click .segment-btn":"onNavClick","click .next-btn":"onNavClick","click .done-btn":"onDoneClick"},onlyAfterRender:["onAgentsSuccess","onAgentsFail","onUpdatesComplete"],initialize:function(e){t.bindAll(this,"start","onAgentsSuccess","onAgentsFail","onUpdatesComplete"),this.subset=e.subset||"setupBasic",this.attempts=0,a.info("Starting the setup wizard")},serializeData:function(){return{subset:this.subset}},start:function(){if(this.attempts>=this.maxAttempts)return a.error("Failed to start the setup wizard after "+this.attempts+" attempts"),
void this.navigate("setupError");this.attempts++;var e=this.model.get("startState");if(e)a("Waiting for server to start ("+e+")"),this.model.fetch().done(t.delay(this.start,500));else{var i=new l([],{server:this.model}),n=i.fetch({scope:"page",timeout:0});n.done(this.onAgentsSuccess),n.fail(this.onAgentsFail)}},navigate:function(e){var i=g[e];this.previousSubset=this.subset,this.subset=e,this.previousSubset&&this.container.currentView&&r.trackEvent("view",this.previousSubset+"_pass",{value:t.result(this.container.currentView,"metricsValue")
}),r.trackEvent("view",this.subset),this.container.show(new i({model:this.model})),this.$el.addClass(e),this.previousSubset!==e&&this.$el.removeClass(this.previousSubset)},onRender:function(){this.model.get("shared")?this.navigate("setupError"):(this.navigate("setupLoading"),this.start())},onAgentsSuccess:function(e){a("Looking for a core agent");for(var t=0,i=v.length;i>t;t++){var n=v[t];if(e.get(n)){a(n+" found");var s=o.execute("updateChannel",{server:this.model,silent:!0});return void s.always(this.onUpdatesComplete);
}}a.error("No core agents found"),this.navigate("setupError")},onAgentsFail:function(){a.warn("Unable to request agents"),t.delay(this.start,500)},onUpdatesComplete:function(){this.navigate(this.previousSubset)},onNavClick:function(e){e.preventDefault();var t=i(e.currentTarget),n=t.data("subset"),a=t.hasClass("segment-btn")&&"setupBasic"===this.subset;a&&this.container.currentView?(e.preventDefault(),this.container.currentView.submit()):(this.navigate(n),s.trigger("navigate",n,{trigger:!1}))},onDoneClick:function(e){
e.preventDefault(),s.trigger("navigate","dashboard")}});return y}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1271),i(2),i(6),i(5),i(91),i(17),i(9),i(210),i(11),i(725),i(789)],s=function(e,t,i,n,s,a,r,o,l,c,u){"use strict";var d=i.Layout.extend({className:"side-bar dark-scrollbar",template:e,regions:{empty:".dashboard-empty-servers-container",servers:".dashboard-servers-container"},initialize:function(){var e=r.get("servers"),t=e.filter(this.isAuthorized),i=e.filter(this.isUnavailableOwned),n=e.filter(this.isSharedPresentAndUnavailable),s=t.concat(i,n);
this.collection=new o(s),this.listenTo(r,"change:primaryServer",this.onPrimaryServerChange),this.listenTo(e,"remove",this.onServerRemove),this.listenTo(e,"change:connected",this.onServerConnectedChange),this.listenTo(e,"change:presence",this.onServerPresenceChange)},showEmptyView:function(){if(!this.collection.length&&r.get("primaryServer")===!1){var e=r.get("servers"),t=!!e.where({cloud:!1,shared:!0}).length,i=!r.get("user").isFullUser();this.empty.show(new c({hasSharedServers:t,isManagedUser:i}));
}},isAuthorized:function(e){return e.id&&!e.get("cloud")&&e.get("authorized")},isUnavailableOwned:function(e){return e.id&&e.get("isFullOwnedServer")&&!e.get("available")},isSharedPresentAndUnavailable:function(e){var t=a.get("allowHttpFallback"),i=e.get("publicAddressMatches")&&t===s.SAME_NETWORK,n=t===s.ALWAYS||i;return e.get("shared")&&e.get("presence")&&!e.get("available")&&!n},onRender:function(){this.showEmptyView(),this.servers.show(new u({collection:this.collection}))},onPrimaryServerChange:function(e,t){
this.showEmptyView()},onServerRemove:function(e){this.collection.remove(e.cid),this.showEmptyView()},onServerConnectedChange:function(e,t){this.isAuthorized(e)||this.isUnavailableOwned(e)||this.isSharedPresentAndUnavailable(e)?this.collection.add(e):this.collection.remove(e)},onServerPresenceChange:function(e,t){this.isSharedPresentAndUnavailable(e)&&this.collection.add(e)}});return d}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1272),i(6),i(5),i(17),i(279)],s=function(e,t,i,n,s){
"use strict";var a=t.Layout.extend({className:"side-bar",template:e,ui:{sortContainer:".section-sort-container"},regions:{sort:".section-sort-list-container"},initialize:function(){this.hidden=!n.get("sidebarOpen"),this.hidden?this.$el.addClass("transition-out"):i.trigger("show:bar","sidebar")},open:function(){this.hidden=!1,n.save("sidebarOpen",!0),this.$el.removeClass("transition-out"),i.trigger("show:bar","sidebar")},hide:function(){this.hidden=!0,n.save("sidebarOpen",!1),this.$el.addClass("transition-out"),
i.trigger("hide:bar","sidebar")},onRender:function(){this.sort.show(new s({collection:this.model.get("sorts")}))},onClose:function(){i.trigger("hide:bar","sidebar")}});return a}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1273),i(2),i(6),i(7),i(5),i(17),i(9),i(770),i(830),i(831),i(833),i(279)],s=function(e,t,i,n,s,a,r,o,l,c,u,d){"use strict";var h=i.Layout.extend({className:"side-bar",template:e,ui:{newFilterBtn:".new-filter-icon-btn",filterOptionsHeader:".filter-options-header",
typeContainer:".section-type-container",sortContainer:".section-sort-container"},regions:{currentFilters:".section-current-filters-list-container",filters:".section-filters-list-container",filterOptions:".section-filter-option-list-container",sort:".section-sort-list-container"},modelEvents:{"change:currentFilters":"onCurrentFiltersChange","change:currentType":"onCurrentTypeChange","change:title":"onSectionTitleChange"},events:{"click .new-filter-btn":"onNewFilterClick","click .hide-btn":"onHideClick"
},initialize:function(e){this.hidden=!a.get("sidebarOpen"),this.advancedFilters=!!this.model.get("allowAdvancedFilters"),this.linearFilters=!this.advancedFilters,this.mediaActions=e.mediaActions,this.hidden?this.$el.addClass("transition-out"):s.trigger("show:bar","sidebar"),r.set({searchType:"section",searchPlaceholder:this.model.get("title"),searchValue:this.getSearchValue()}),this.listenTo(s,"search:section",this.onSearch)},serializeData:function(){return{showNewFilterIconBtn:this.advancedFilters&&!!this.model.get("currentFilters").length
}},open:function(){this.hidden=!1,a.save("sidebarOpen",!0),this.$el.removeClass("transition-out"),s.trigger("show:bar","sidebar")},hide:function(){this.hidden=!0,a.save("sidebarOpen",!1),this.$el.addClass("transition-out"),s.trigger("hide:bar","sidebar")},getSearchValue:function(){var e=this.model.get("currentFilters"),i=t.findWhere(e,{key:"title"});return i&&i.values.length?i.values[0]:null},addFilter:function(e,i){i||(i={});var n=this.model.get("currentFilters");this.linearFilters&&n.length&&(n.length=0);
var s=t.findWhere(n,{key:e.key});if(s){if(t.indexOf(s.values,e.value)>-1)return;i.replace?(s.titles=[e.title],s.values=[e.value]):(s.titles.push(e.title),s.values.push(e.value))}else n.push({key:e.key,titles:[e.title],values:[e.value]});this.model.trigger("change:currentFilters",this.model,n)},removeFilter:function(e){var i=this.model.get("currentFilters"),n=t.findWhere(i,{key:e.key});n&&(n.titles=t.reject(n.titles,function(t){return t===e.title}),n.values=t.reject(n.values,function(t){return t===e.value;
}),n.values.length||i.splice(t.indexOf(i,n),1)),this.model.trigger("change:currentFilters",this.model,i)},removeAllFilters:function(e){var i=this.model.get("currentFilters"),n=t.findWhere(i,{key:e});i.splice(t.indexOf(i,n),1),this.model.trigger("change:currentFilters",this.model,i)},onRender:function(){var e="all"!==this.model.get("currentSubset").id,i=this.model.get("currentFilters");e&&(i.length=0);var n=new l({model:this.model,disabled:e}),a=new d({collection:this.model.get("sorts"),disabled:e
});if(this.listenTo(n,"removeAllFilters",this.onRemoveAllFilters),this.listenToOnce(a,"collection:rendered",this.onSortListRender),this.currentFilters.show(n),this.sort.show(a),!e){var r=this.model.get("filters").populate({reset:!0,scope:"page"});r.done(t.bind(function(t){if(!this.isClosed){var i=this.linearFilters?t.filterBySecondary():t,n=new c({collection:i,disabled:e});this.listenTo(n,"itemview:addFilter",this.onAddFilter),this.listenTo(n,"itemview:removeFilter",this.onRemoveFilter),this.listenTo(n,"itemview:showOptions",this.onFilterListShowOptions),
this.filters.show(n)}},this))}i.length&&s.trigger("show:bar","filterbar",new o({model:this.model}))},onClose:function(){r.set({searchType:null,searchPlaceholder:null,searchValue:null}),s.trigger("hide:bar","sidebar"),s.trigger("hide:bar","filterbar")},onCurrentFiltersChange:function(e,t){var i=!!t.length;this.ui.newFilterBtn.toggleClass("hidden",this.linearFilters||!i),r.set("searchValue",this.getSearchValue()),i?s.trigger("show:bar","filterbar",new o({model:this.model})):s.trigger("hide:bar","filterbar");
},onCurrentTypeChange:function(e,t){this.$el.removeClass("show-filters show-filter-options"),this.removeAllFilters()},onSectionTitleChange:function(e,t){r.set("searchPlaceholder",t)},onSearch:function(e){return e?void this.addFilter({key:"title",value:e,title:e},{replace:!0}):void this.removeAllFilters("title")},onAddFilter:function(e,t){this.addFilter(t)},onRemoveFilter:function(e,t){this.removeFilter(t)},onRemoveAllFilters:function(e){this.removeAllFilters(e)},onFilterListShowOptions:function(e,t){
var i=t.get("title");this.$el.addClass("show-filter-options"),this.$el.removeClass("show-filters"),this.ui.filterOptionsHeader.text(i);var n=new u({collection:t.get("options")});this.listenTo(n,"addFilter",this.onAddFilter),this.listenTo(n,"removeAllFilters",this.onRemoveAllFilters),this.listenTo(n,"itemview:addFilter",this.onAddFilter),this.listenTo(n,"itemview:removeFilter",this.onRemoveFilter),this.filterOptions.show(n)},onSortListRender:function(e){this.ui.sortContainer.toggleClass("hidden",!e.collection.length);
var t=e.collection.length;t||this.listenToOnce(e,"before:item:added",this.onSortListItemAdded)},onSortListItemAdded:function(e){this.ui.sortContainer.removeClass("hidden")},onNewFilterClick:function(e){e.preventDefault(),this.$el.addClass("show-filters")},onHideClick:function(e){e.preventDefault(),this.$el.hasClass("show-filter-options")?(this.$el.removeClass("show-filter-options"),this.$el.addClass("show-filters")):this.$el.removeClass("show-filters")}});return h}.apply(t,n),!(void 0!==s&&(e.exports=s));
},function(e,t,i){var n,s;n=[i(1275),i(6),i(853),i(9)],s=function(e,t,i,n){"use strict";var s=t.Layout.extend({className:"container",template:e,regions:{list:".announcements-container"},onRender:function(){var e=this.collection;n.get("user").hasPlexPass()&&(e=e.clone(e.reject(function(e){return"PlexPass"===e.get("promo")}))),this.list.show(new i({collection:e}))}});return s}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1276),i(2),i(6),i(7),i(42),i(9),i(22),i(5)],s=function(e,t,n,s,a,r,o,l){
"use strict";var c=n.ItemView.extend({className:"container queue-help-container",template:e,ui:{queueEmail:".queue-email",plexitBtn:".btn-plexit"},events:{"focus .queue-email":"onQueueEmailFocus","mouseup .queue-email":"onQueueEmailMouseUp","click .btn-plexit":"onPlexitClick","mousedown .btn-plexit":"onPlexitMouseDown","mouseup .btn-plexit":"onPlexitMouseUp"},initialize:function(e){this.queueEmail=e.queueEmail,"ie"===a.id?(this.stepsImgSrc=i(997),this.modalText=s('Right click the "Plex It!" button and choose Add to Favorites so you can save videos to Watch Later.'),
this.firstStepText=s("Add the button above to your favorites bar.")):(this.stepsImgSrc=i(998),this.modalText=s('Drag the "Plex it!" button to your Bookmarks Bar so you can save videos to your Watch Later.'),this.firstStepText=s("Drag the button above to your bookmarks bar."));var n=["OSX","Windows","Linux"];if(-1!==t.indexOf(n,a.platform)){var r=s("OSX"===a.platform?"\u2318 C":"Ctrl C");this.copyCommand=s("{1} to copy",r)}},serializeData:function(){return{queueEmail:this.queueEmail,copyCommand:this.copyCommand,
stepsImgSrc:this.stepsImgSrc,emailImgSrc:i(999),firstStepText:this.firstStepText}},onRender:function(){this.copyCommand&&this.$el.tooltip({selector:".queue-email",placement:"top",trigger:"focus"})},onQueueEmailFocus:function(e){this.ui.queueEmail.selectText()},onQueueEmailMouseUp:function(e){return!1},onPlexitClick:function(e){e.preventDefault();var t=new o({title:s("Plex It!"),message:this.modalText,confirmLabel:s("OK"),hideCancel:!0});l.trigger("show:modal",t)},onPlexitMouseDown:function(){this.ui.plexitBtn.css("user-select","text");
},onPlexitMouseUp:function(){this.ui.plexitBtn.css("user-select","none")}});return c}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;n=[i(1277),i(2),i(4),i(6),i(7),i(5),i(17),i(857)],s=function(e,t,i,n,s,a,r,o){"use strict";var l=n.Layout.extend({className:"container",template:e,ui:{navLinks:".nav a",allBadge:".all-btn > .badge",unwatchedBadge:".unwatched-btn > .badge",watchedBadge:".watched-btn > .badge"},regions:{list:".user-playlist-container"},events:{"click .nav a":"onNavClick"
},initialize:function(e){this.initSubset(e),this.subsets={all:this.collection,unwatched:this.collection.filterUnwatched(),watched:this.collection.filterWatched()},this.listenTo(this.collection,{add:this.onCollectionChange,remove:this.onCollectionChange,"change:viewCount":this.onCollectionChange})},initSubset:function(e){var t=e.subset,i=this.collection.key+"!subset";t||(t=r.get(i)),t||(t="unwatched"),r.save(i,t),this.subset=t},serializeData:function(){return{label:this.collection.label,helpRoute:this.collection.helpRoute,
defaultTarget:"_self",filters:[{title:s("All"),key:this.collection.key,subset:"all"},{title:s("Unwatched"),key:this.collection.key,subset:"unwatched"},{title:s("Watched"),key:this.collection.key,subset:"watched"}]}},updateBadges:function(){var e={all:this.subsets.all.length,unwatched:this.subsets.unwatched.length,watched:this.subsets.watched.length};t.each(t.keys(e),function(t){var i=this.ui[t+"Badge"];i.text(e[t]),i.toggleClass("hidden",0===e[t])},this)},onRender:function(){this.list.show(new o({
collection:this.subsets[this.subset]})),this.ui.navLinks.filter('[href*="/'+this.subset+'"]').addClass("selected"),this.updateBadges()},onCollectionChange:function(){this.subsets.unwatched.set(this.collection.filterUnwatched().models),this.subsets.watched.set(this.collection.filterWatched().models),this.updateBadges()},onNavClick:function(e){e.preventDefault(),this.ui.navLinks.removeClass("selected"),i(e.currentTarget).addClass("selected"),this.initSubset({subset:t.last(e.currentTarget.href.split("/"))
}),this.list.show(new o({collection:this.subsets[this.subset]})),a.trigger("navigate","userPlaylist",{key:this.collection.key,subset:this.subset,trigger:!1})}});return l}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){e.exports={"default":i(963),__esModule:!0}},,,function(e,t,i){e.exports={"default":i(966),__esModule:!0}},function(e,t,i){e.exports={"default":i(967),__esModule:!0}},function(e,t,i){e.exports={"default":i(969),__esModule:!0}},function(e,t,i){e.exports={"default":i(970),__esModule:!0
}},function(e,t,i){"use strict";var n=i(959).default,s=i(958).default,a=i(292).default;t.default=function(e,t){for(var i=n(t),r=0;r<i.length;r++){var o=i[r],l=s(t,o);l&&l.configurable&&void 0===e[o]&&a(e,o,l)}return e},t.__esModule=!0},function(e,t,i){"use strict";var n=i(956).default;t.default=n||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},t.__esModule=!0},function(e,t){"use strict";t.default=function(e,t){
var i=t({},e);return delete i.default,i},t.__esModule=!0},function(e,t,i){i(980),e.exports=i(108).Number.isInteger},,,function(e,t,i){i(983),e.exports=i(108).Object.assign},function(e,t,i){var n=i(85);e.exports=function(e,t){return n.create(e,t)}},function(e,t,i){var n=i(85);e.exports=function(e,t,i){return n.setDesc(e,t,i)}},function(e,t,i){var n=i(85);i(984),e.exports=function(e,t){return n.getDesc(e,t)}},function(e,t,i){var n=i(85);i(985),e.exports=function(e){return n.getNames(e)}},,,function(e,t){
var i={}.toString;e.exports=function(e){return i.call(e).slice(8,-1)}},,function(e,t,i){var n=i(298),s=i(85).getNames,a={}.toString,r="object"==typeof window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],o=function(e){try{return s(e)}catch(t){return r.slice()}};e.exports.get=function(e){return r&&"[object Window]"==a.call(e)?o(e):s(n(e))}},,function(e,t,i){var n=i(978),s=Math.floor;e.exports=function(e){return!n(e)&&isFinite(e)&&s(e)===e}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e;
}},function(e,t,i){var n=i(85),s=i(299),a=i(297);e.exports=i(296)(function(){var e=Object.assign,t={},i={},n=Symbol(),s="abcdefghijklmnopqrst";return t[n]=7,s.split("").forEach(function(e){i[e]=e}),7!=e({},t)[n]||Object.keys(e({},i)).join("")!=s})?function(e,t){for(var i=s(e),r=arguments,o=r.length,l=1,c=n.getKeys,u=n.getSymbols,d=n.isEnum;o>l;)for(var h,p=a(r[l++]),f=u?c(p).concat(u(p)):c(p),m=f.length,g=0;m>g;)d.call(p,h=f[g++])&&(i[h]=p[h]);return i}:Object.assign},function(e,t,i){var n=i(109);
n(n.S,"Number",{isInteger:i(977)})},,,function(e,t,i){var n=i(109);n(n.S+n.F,"Object",{assign:i(979)})},function(e,t,i){var n=i(298);i(177)("getOwnPropertyDescriptor",function(e){return function(t,i){return e(n(t),i)}})},function(e,t,i){i(177)("getOwnPropertyNames",function(){return i(975).get})},,,,,function(e,t,i){"use strict";var n=i(179),s=i(302).default,a=i(180).default,r=i(181),o=i(1278),l=function(){var e=new n.HandlebarsEnvironment;return r.extend(e,n),e.SafeString=s,e.Exception=a,e.Utils=r,
e.VM=o,e.template=function(t){return o.template(t,e)},e},c=l();c.create=l,t.default=c,e.exports=c},function(e,t,i){(function(t){!function(){function e(e,t){return e.name=t}function t(e,t){return e.href=t}function i(e){ye.set(e)}function n(e){return"function"==typeof e}function s(e){return void 0!=e&&-1<(e.constructor+"")[W]("String")}function a(){return N.round(2147483647*N.random())}function r(e){var t=Ce[K]("img");return t.width=1,t.height=1,t.src=e,t}function o(){}function l(e){return R instanceof Function?R(e):(i(28),
e)}function c(e){return l(e)[j](/\(/g,"%28")[j](/\)/g,"%29")}function u(e,t){if(e){var i=Ce[K]("script");i.type="text/javascript",i.async=!0,i.src=e,i.id=t;var n=Ce.getElementsByTagName("script")[0];n[me].insertBefore(i,n)}}function d(){var e=""+Ce[ne][se];return 0==e[W]("www.")?e[de](4):e}function h(e){var t=Ce.referrer;if(/^https?:\/\//i.test(t)){if(e)return t;e="//"+Ce[ne][se];var i=t[W](e);if((5==i||6==i)&&(e=t.charAt(i+e[Z]),"/"==e||"?"==e||""==e||":"==e))return;return t}}function p(e,t){if(1==t[Z]&&null!=t[0]&&"object"==typeof t[0])return t[0];
for(var i={},n=N.min(e[Z]+1,t[Z]),s=0;n>s;s++){if("object"==typeof t[s]){for(var a in t[s])t[s].hasOwnProperty(a)&&(i[a]=t[s][a]);break}s<e[Z]&&(i[e[s]]=t[s])}return i}function f(e){if(100!=e.get(fi)&&M(je(e,ni))%1e4>=100*Ve(e,fi))throw"abort"}function m(e){if(ke(je(e,si)))throw"abort"}function g(){var e=Ce[ne][le];if("http:"!=e&&"https:"!=e)throw"abort"}function v(e){e.set(ot,Ve(e,ot)+1);var t=[];ze.map(function(i,n){if(n.p){var s=e.get(i);void 0!=s&&s!=n[Q]&&("boolean"==typeof s&&(s*=1),t[U](n.p+"="+l(""+s)));
}}),t[U]("z="+a()),e.set(rt,t[ge]("&"),!0)}function y(e){Re(je(e,rt),e.get(at)),e.set(at,o,!0)}function b(e){var t=Se.gaData;t&&(t.expId&&e.set(Ft,t.expId),t.expVar&&e.set(Ut,t.expVar))}function w(){if(Se[fe]&&"preview"==Se[fe].loadPurpose)throw"abort"}function x(e){var t=Ve(e,Vt);t>=500&&i(15);var n=je(e,st);if("transaction"!=n&&"item"!=n){var n=Ve(e,Wt),s=(new Date)[X](),a=Ve(e,Ht);if(0==a&&e.set(Ht,s),a=N.round(2*(s-a)/1e3),a>0&&(n=N.min(n+a,20),e.set(Ht,s)),0>=n)throw"abort";e.set(Wt,--n)}e.set(Vt,++t);
}function S(){var e=Gi;C("create",e,e.create,3),C("getByName",e,e.j,5),C("getAll",e,e.K,6),e=ji[ee],C("get",e,e.get,7),C("set",e,e.set,4),C("send",e,e.send,2),e=Ue[ee],C("get",e,e.get),C("set",e,e.set),(Se.gaplugins=Se.gaplugins||{}).Linker=Ri,e=Ri[ee],Ki.C("linker",Ri),C("decorate",e,e.Q,20),C("autoLink",e,e.S,25),Ki.C("displayfeatures",zi)}function C(e,t,n,s){t[e]=function(){try{return s&&i(s),n[pe](this,arguments)}catch(t){var r=t&&t[G];if(!(1<=100*N.random()||ke("?"))){var o=["t=error","_e=exc","_v=j15","sr=1"];
e&&o[U]("_f="+e),r&&o[U]("_m="+l(r[de](0,100))),o[U]("aip=1"),o[U]("z="+a()),Re(o[ge]("&"))}throw t}}}function k(){var e,t,i;if((i=(i=Se[fe])?i.plugins:null)&&i[Z])for(var n=0;n<i[Z]&&!t;n++){var s=i[n];-1<s[G][W]("Shockwave Flash")&&(t=s.description)}if(!t)try{e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"),t=e.GetVariable("$version")}catch(a){}if(!t)try{e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"),t="WIN 6,0,21,0",e.AllowScriptAccess="always",t=e.GetVariable("$version")}catch(r){}
if(!t)try{e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash"),t=e.GetVariable("$version")}catch(o){}return t&&(e=t[$](/[\d]+/g))&&3<=e[Z]&&(t=e[0]+"."+e[1]+" r"+e[2]),t||void 0}function P(e,t,i){"none"==t&&(t="");var n=[],s=Ae(e);e="__utma"==e?6:2;for(var a=0;a<s[Z];a++){var r=(""+s[a])[ie](".");r[Z]>=e&&n[U]({hash:r[0],R:s[a],O:r})}return 0==n[Z]?void 0:1==n[Z]?n[0]:A(t,n)||A(i,n)||A(null,n)||n[0]}function A(e,t){var i,n;null==e?i=n=1:(i=M(e),n=M(0==e[W](".")?e[de](1):"."+e));for(var s=0;s<t[Z];s++)if(t[s][z]==i||t[s][z]==n)return t[s];
}function I(e){e=e.get(ni);var t=_(e,0);return"_ga=1."+l(t+"."+e)}function _(e,t){for(var i=new Date,n=Se.screen||{},s=Se[fe],a=s.plugins||[],i=[e,s.userAgent,n.width,n.height,i.getTimezoneOffset(),i.getYear(),i.getDate(),i.getHours(),i.getMinutes()+t],n=0;n<a[Z];++n)i[U](a[n].description);return M(i[ge]("."))}function T(e,t){if(t==Ce[ne][se])return!1;for(var i=0;i<e[Z];i++)if(0<=t[W](e[i]))return!0;return!1}function D(){var e=Se.gaGlobal=Se.gaGlobal||{};return e.hid=e.hid||a()}function E(e){function i(e){
var t=(e[se]||"")[ie](":")[0][ve](),i=(e[le]||"")[ve](),i=1*e[q]||("http:"==i?80:"https:"==i?443:"");return e=e.pathname||"",0==e[W]("/")||(e="/"+e),[t,""+i,e]}var n=Ce[K]("a");t(n,Ce[ne][ue]);var s=(n[le]||"")[ve](),a=i(n),r=n[ae]||"",o=s+"//"+a[0]+(a[1]?":"+a[1]:"");return 0==e[W]("//")?e=s+e:0==e[W]("/")?e=o+e:e&&0!=e[W]("?")?0>e[ie]("/")[0][W](":")&&(e=o+a[2][de](0,a[2].lastIndexOf("/"))+"/"+e):e=o+a[2]+(e||r),t(n,e),s=i(n),{protocol:(n[le]||"")[ve](),host:s[0],port:s[1],path:s[2],G:n[ae]||"",
url:e||""}}function M(e){var t,i=1,n=0;if(e)for(i=0,t=e[Z]-1;t>=0;t--)n=e.charCodeAt(t),i=(i<<6&268435455)+n+(n<<14),n=266338304&i,i=0!=n?i^n>>21:i;return i}var R=encodeURIComponent,O=window,L=setTimeout,N=Math,F=RegExp,U="push",z="hash",B="slice",j="replace",V="data",H="cookie",W="indexOf",$="match",Q="defaultValue",q="port",K="createElement",Y="setAttribute",G="name",X="getTime",J="host",Z="length",ee="prototype",te="clientWidth",ie="split",ne="location",se="hostname",ae="search",re="target",oe="call",le="protocol",ce="clientHeight",ue="href",de="substring",he="action",pe="apply",fe="navigator",me="parentNode",ge="join",ve="toLowerCase",ye=new function(){
var e=[];this.set=function(t){e[t]=!0},this.M=function(){for(var t=[],i=0;i<e[Z];i++)e[i]&&(t[N.floor(i/6)]=t[N.floor(i/6)]^1<<i%6);for(i=0;i<t[Z];i++)t[i]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".charAt(t[i]||0);return t[ge]("")+"~"}},be=function(e,t,n,s){try{e.addEventListener?e.addEventListener(t,n,!!s):e.attachEvent&&e.attachEvent("on"+t,n)}catch(a){i(27)}},we=function(e,t,i){e.removeEventListener?e.removeEventListener(t,i,!1):e.detachEvent&&e.detachEvent("on"+t,i)},xe=function(){
this.keys=[],this.w={},this.m={}};xe[ee].set=function(e,t,i){this.keys[U](e),i?this.m[":"+e]=t:this.w[":"+e]=t},xe[ee].get=function(e){return this.m.hasOwnProperty(":"+e)?this.m[":"+e]:this.w[":"+e]},xe[ee].map=function(e){for(var t=0;t<this.keys[Z];t++){var i=this.keys[t],n=this.get(i);n&&e(i,n)}};var Se=O,Ce=document,ke=function(e){var t=Se._gaUserPrefs;if(t&&t.ioo&&t.ioo()||e&&!0===Se["ga-disable-"+e])return!0;try{var i=Se.external;if(i&&i._gaUserPrefs&&"oo"==i._gaUserPrefs)return!0}catch(n){}
return!1},Pe=function(e){L(e,100)},Ae=function(e){var t=[],i=Ce[H][ie](";");e=F("^\\s*"+e+"=\\s*(.*?)\\s*$");for(var n=0;n<i[Z];n++){var s=i[n][$](e);s&&t[U](s[1])}return t},Ie=function(e,t,n,s,a,r){if(a=ke(a)?!1:Te.test(Ce[ne][se])||"/"==n&&_e.test(s)?!1:!0,!a)return!1;if(t&&200<t[Z]&&(t=t[de](0,200),i(24)),n=e+"="+t+"; path="+n+"; ",r&&(n+="expires="+new Date((new Date)[X]()+r).toGMTString()+"; "),s&&"none"!=s&&(n+="domain="+s+";"),s=Ce[H],Ce.cookie=n,!(s=s!=Ce[H]))e:{for(e=Ae(e),s=0;s<e[Z];s++)if(t==e[s]){
s=!0;break e}s=!1}return s},_e=F(/^(www\.)?google(\.com?)?(\.[a-z]{2})?$/),Te=F(/(^|\.)doubleclick\.net$/i),De=function(){return(et||"https:"==Ce[ne][le]?"https:":"http:")+"//www.google-analytics.com"},Ee=function(t){e(this,"len"),this.message=t+"-8192"},Me=function(t){e(this,"ff2post"),this.message=t+"-2036"},Re=function(e,t){if(t=t||o,2036>=e[Z])Oe(e,t);else{if(!(8192>=e[Z]))throw new Ee(e[Z]);var i=t;if(0<=Se[fe].userAgent[W]("Firefox")&&![].reduce)throw new Me(e[Z]);Le(e,i)||Ne(e,i)}},Oe=function(e,t){
var i=r(De()+"/collect?"+e);i.onload=i.onerror=function(){i.onload=null,i.onerror=null,t()}},Le=function(e,t){var i,n=Se.XDomainRequest;return n?(i=new n,i.open("POST",De()+"/collect")):(n=Se.XMLHttpRequest)&&(n=new n,"withCredentials"in n&&(i=n,i.open("POST",De()+"/collect",!0),i.setRequestHeader("Content-Type","text/plain"))),i?(i.onreadystatechange=function(){4==i.readyState&&(t(),i=null)},i.send(e),!0):void 0},Ne=function(t,i){if(Ce.body){t=R(t);try{var n=Ce[K]('<iframe name="'+t+'"></iframe>');
}catch(s){n=Ce[K]("iframe"),e(n,t)}n.height="0",n.width="0",n.style.display="none",n.style.visibility="hidden";var a=Ce[ne],a=De()+"/analytics_iframe.html#"+R(a[le]+"//"+a[J]+"/favicon.ico"),r=function(){n.src="",n[me]&&n[me].removeChild(n)};be(Se,"beforeunload",r);var o=!1,l=0,c=function(){if(!o){try{if(l>9||n.contentWindow[ne][J]==Ce[ne][J])return o=!0,r(),we(Se,"beforeunload",r),void i()}catch(e){}l++,L(c,200)}};be(n,"load",c),Ce.body.appendChild(n),n.src=a}else Pe(function(){Ne(t,i)})},Fe=function(){
this.t=[]};Fe[ee].add=function(e){this.t[U](e)},Fe[ee].execute=function(e){try{for(var t=0;t<this.t[Z];t++){var i=e.get(this.t[t]);i&&n(i)&&i[oe](Se,e)}}catch(s){}t=e.get(at),t!=o&&n(t)&&(e.set(at,o,!0),L(t,10))};var Ue=function(){this.data=new xe},ze=new xe,Be=[];Ue[ee].get=function(e){var t=Qe(e),i=this[V].get(e);return t&&void 0==i&&(i=n(t[Q])?t[Q]():t[Q]),t&&t.n?t.n(this,e,i):i};var je=function(e,t){var i=e.get(t);return void 0==i?"":""+i},Ve=function(e,t){var i=e.get(t);return void 0==i||""===i?0:1*i;
};Ue[ee].set=function(e,t,i){if(e)if("object"==typeof e)for(var n in e)e.hasOwnProperty(n)&&We(this,n,e[n],i);else We(this,e,t,i)};var He,We=function(e,t,i,n){var s=Qe(t);s&&s.o?s.o(e,t,i,n):e[V].set(t,i,n)},$e=function(t,i,n,s,a){e(this,t),this.p=i,this.n=s,this.o=a,this.defaultValue=n},Qe=function(e){var t=ze.get(e);if(!t)for(var i=0;i<Be[Z];i++){var n=Be[i],s=n[0].exec(e);if(s){t=n[1](s),ze.set(t[G],t);break}}return t},qe=function(e){var t;return ze.map(function(i,n){n.p==e&&(t=n)}),t&&t[G]},Ke=function(e,t,i,n,s){
return e=new $e(e,t,i,n,s),ze.set(e[G],e),e[G]},Ye=function(e,t){Be[U]([F("^"+e+"$"),t])},Ge=function(e,t,i){return Ke(e,t,i,void 0,Xe)},Xe=function(){};if(He=s(O.GoogleAnalyticsObject)){var Je=O.GoogleAnalyticsObject;He=Je?Je[j](/^[\s\xa0]+|[\s\xa0]+$/g,""):""}var Ze=He||"ga",et=!1,tt=Ge("apiVersion","v"),it=Ge("clientVersion","_v");Ke("anonymizeIp","aip");var nt=Ke("adSenseId","a"),st=Ke("hitType","t"),at=Ke("hitCallback"),rt=Ke("hitPayload");Ke("nonInteraction","ni"),Ke("currencyCode","cu"),Ke("sessionControl","sc",""),
Ke("queueTime","qt");var ot=Ke("_s","_s");Ke("description","cd");var lt=Ke("location","dl",""),ct=Ke("referrer","dr"),ut=Ke("page","dp","");Ke("hostname","dh");var dt=Ke("language","ul"),ht=Ke("encoding","de");Ke("title","dt",function(){return Ce.title||void 0}),Ye("contentGroup([0-9]+)",function(e){return new $e(e[0],"cg"+e[1])});var pt=Ke("screenColors","sd"),ft=Ke("screenResolution","sr"),mt=Ke("viewportSize","vp"),gt=Ke("javaEnabled","je"),vt=Ke("flashVersion","fl");Ke("campaignId","ci"),Ke("campaignName","cn"),
Ke("campaignSource","cs"),Ke("campaignMedium","cm"),Ke("campaignKeyword","ck"),Ke("campaignContent","cc");var yt=Ke("eventCategory","ec"),bt=Ke("eventAction","ea"),wt=Ke("eventLabel","el"),xt=Ke("eventValue","ev"),St=Ke("socialNetwork","sn"),Ct=Ke("socialAction","sa"),kt=Ke("socialTarget","st"),Pt=Ke("l1","plt"),At=Ke("l2","pdt"),It=Ke("l3","dns"),_t=Ke("l4","rrt"),Tt=Ke("l5","srt"),Dt=Ke("l6","tcp"),Et=Ke("l7","dit"),Mt=Ke("l8","clt"),Rt=Ke("timingCategory","utc"),Ot=Ke("timingVar","utv"),Lt=Ke("timingLabel","utl"),Nt=Ke("timingValue","utt");
Ke("appName","an"),Ke("appVersion","av",""),Ke("appId","aid",""),Ke("appInstallerId","aiid",""),Ke("exDescription","exd"),Ke("exFatal","exf");var Ft=Ke("expId","xid"),Ut=Ke("expVar","xvar"),zt=Ke("_utma","_utma"),Bt=Ke("_utmz","_utmz"),jt=Ke("_utmht","_utmht"),Vt=Ke("_hc",void 0,0),Ht=Ke("_ti",void 0,0),Wt=Ke("_to",void 0,20);Ye("dimension([0-9]+)",function(e){return new $e(e[0],"cd"+e[1])}),Ye("metric([0-9]+)",function(e){return new $e(e[0],"cm"+e[1])}),Ke("linkerParam",void 0,void 0,I,Xe),Ke("usage","_u",void 0,function(){
return ye.M()},Xe),Ke("forceSSL",void 0,void 0,function(){return et},function(e,t,i){et=!!i});var $t=Ke("joinId","jid");Ye("\\&(.*)",function(e){var t=new $e(e[0],e[1]),i=qe(e[0][de](1));return i&&(t.n=function(e){return e.get(i)},t.o=function(e,t,n,s){e.set(i,n,s)},t.p=void 0),t});var Qt=Ge("oot"),qt=Ke("previewTask"),Kt=Ke("checkProtocolTask"),Yt=Ke("checkStorageTask"),Gt=Ke("historyImportTask"),Xt=Ke("samplerTask"),Jt=Ge("rateLimiterTask"),Zt=Ke("buildHitTask"),ei=Ke("sendHitTask"),ti=Ke("ceTask"),ii=Ge("name"),ni=Ge("clientId","cid"),si=Ge("trackingId","tid"),ai=Ge("cookieName",void 0,"_ga"),ri=Ge("cookieDomain"),oi=Ge("cookiePath",void 0,"/"),li=Ge("cookieExpires",void 0,63072e3),ci=Ge("legacyCookieDomain"),ui=Ge("legacyHistoryImport",void 0,!0),di=Ge("storage",void 0,"cookie"),hi=Ge("allowLinker",void 0,!1),pi=Ge("allowAnchor",void 0,!0),fi=Ge("sampleRate","sf",100),mi=Ge("siteSpeedSampleRate",void 0,1),gi=Ge("alwaysSendReferrer",void 0,!1),vi=function(e,t){
var i=N.min(Ve(e,mi),100);if(!(M(je(e,ni))%100>=i)&&(i={},yi(i)||bi(i))){var n=i[Pt];void 0==n||1/0==n||isNaN(n)||(n>0?(wi(i,It),wi(i,Dt),wi(i,Tt),wi(i,At),wi(i,_t),wi(i,Et),wi(i,Mt),t(i)):be(Se,"load",function(){vi(e,t)},!1))}},yi=function(e){var t=Se.performance||Se.webkitPerformance,t=t&&t.timing;if(!t)return!1;var i=t.navigationStart;return 0==i?!1:(e[Pt]=t.loadEventStart-i,e[It]=t.domainLookupEnd-t.domainLookupStart,e[Dt]=t.connectEnd-t.connectStart,e[Tt]=t.responseStart-t.requestStart,e[At]=t.responseEnd-t.responseStart,
e[_t]=t.fetchStart-i,e[Et]=t.domInteractive-i,e[Mt]=t.domContentLoadedEventStart-i,!0)},bi=function(e){if(Se.top!=Se)return!1;var t=Se.external,i=t&&t.onloadT;return t&&!t.isValidLoadTime&&(i=void 0),i>2147483648&&(i=void 0),i>0&&t.setPageReadyTime(),void 0==i?!1:(e[Pt]=i,!0)},wi=function(e,t){var i=e[t];(isNaN(i)||1/0==i||0>i)&&(e[t]=void 0)},xi=!1,Si=function(e){if("cookie"==je(e,di)){var t=je(e,ai),n=Pi(e),s=Ti(je(e,oi)),a=Ii(je(e,ri)),r=1e3*Ve(e,li),o=je(e,si);if("auto"!=a)Ie(t,n,s,a,o,r)&&(xi=!0);else{
i(32);var l;if(n=[],a=d()[ie]("."),4!=a[Z]||(l=a[a[Z]-1],parseInt(l,10)!=l)){for(l=a[Z]-2;l>=0;l--)n[U](a[B](l)[ge]("."));n[U]("none"),l=n}else l=["none"];for(var c=0;c<l[Z];c++)if(a=l[c],e[V].set(ri,a),n=Pi(e),Ie(t,n,s,a,o,r))return void(xi=!0);e[V].set(ri,"auto")}}},Ci=function(e){if("cookie"==je(e,di)&&!xi&&(Si(e),!xi))throw"abort"},ki=function(e){if(e.get(ui)){var t=je(e,ri),n=je(e,ci)||d(),s=P("__utma",n,t);s&&(i(19),e.set(jt,(new Date)[X](),!0),e.set(zt,s.R),(t=P("__utmz",n,t))&&s[z]==t[z]&&e.set(Bt,t.R));
}},Pi=function(e){var t=c(je(e,ni)),i=_i(je(e,ri));return e=Di(je(e,oi)),e>1&&(i+="-"+e),["GA1",i,t][ge](".")},Ai=function(e,t,i){for(var n,s=[],a=[],r=0;r<e[Z];r++){var o=e[r];o.r[i]==t?s[U](o):void 0==n||o.r[i]<n?(a=[o],n=o.r[i]):o.r[i]==n&&a[U](o)}return 0<s[Z]?s:a},Ii=function(e){return 0==e[W](".")?e.substr(1):e},_i=function(e){return Ii(e)[ie](".")[Z]},Ti=function(e){return e?(1<e[Z]&&e.lastIndexOf("/")==e[Z]-1&&(e=e.substr(0,e[Z]-1)),0!=e[W]("/")&&(e="/"+e),e):"/"},Di=function(e){return e=Ti(e),
"/"==e?1:e[ie]("/")[Z]},Ei=F(/^https?:\/\/([^\/:]+)/),Mi=/(.*)([?&#])(?:_ga=[^&]*)(?:&?)(.*)/,Ri=function(e){this.target=e,this.T=!1};Ri[ee].Q=function(e,i){if(e.tagName){if("a"==e.tagName[ve]())return void(e[ue]&&t(e,Oi(this,e[ue],i)));if("form"==e.tagName[ve]())return Li(this,e)}return"string"==typeof e?Oi(this,e,i):void 0};var Oi=function(e,t,i){var n=Mi.exec(t);n&&3<=n[Z]&&(t=n[1]+(n[3]?n[2]+n[3]:"")),e=e[re].get("linkerParam");var s=t[W]("?"),n=t[W]("#");return i?t+=(-1==n?"#":"&")+e:(i=-1==s?"?":"&",
t=-1==n?t+(i+e):t[de](0,n)+i+e+t[de](n)),t},Li=function(e,t){if(t&&t[he]){var i=e[re].get("linkerParam")[ie]("=")[1];if("get"==t.method[ve]()){for(var n=t.childNodes||[],s=0;s<n[Z];s++)if("_ga"==n[s][G])return void n[s][Y]("value",i);n=Ce[K]("input"),n[Y]("type","hidden"),n[Y]("name","_ga"),n[Y]("value",i),t.appendChild(n)}else"post"==t.method[ve]()&&(t.action=Oi(e,t[he]))}};Ri[ee].S=function(e,n,s){function a(s){try{s=s||Se.event;var a;e:{var o=s[re]||s.srcElement;for(s=100;o&&s>0;){if(o[ue]&&o.nodeName[$](/^a(?:rea)?$/i)){
a=o;break e}o=o[me],s--}a={}}("http:"==a[le]||"https:"==a[le])&&T(e,a[se]||"")&&a[ue]&&t(a,Oi(r,a[ue],n))}catch(l){i(26)}}var r=this;if(this.T||(this.T=!0,be(Ce,"mousedown",a,!1),be(Ce,"touchstart",a,!1),be(Ce,"keyup",a,!1)),s){s=function(t){if(t=t||Se.event,(t=t[re]||t.srcElement)&&t[he]){var i=t[he][$](Ei);i&&T(e,i[1])&&Li(r,t)}};for(var o=0;o<Ce.forms[Z];o++)be(Ce.forms[o],"submit",s)}};var Ni,Fi=function(e){return e.get(ii)&&"t0"!=e.get(ii)?"_dc_"+c(e.get(ii)):"_dc"},Ui=function(e){if(e.get($t)){
var t=new xe,i=function(i){t.set(Qe(i).p,e.get(i))};i(tt),i(it),i(si),i(ni),i($t);var n=Ve(e,"forceSSL")||"https:"==Ce[ne][le]?"https:":"http:",n=n+"//stats.g.doubleclick.net/collect?t=dc&aip=1&";t.map(function(e,t){n+=l(e)+"="+l(""+t)+"&"}),n+="z="+a(),r(n),e.set($t,"",!0)}},zi=function(e){i(29),e=e.b;var t=e.get(Zt);e.set(Zt,function(e){return e.get($t)||(-1!=Ce[H][W](Fi(e)+"=1")?e.set($t,"",!0):(Fi(e),Ie(Fi(e),"1",e.get(oi),e.get(ri),e.get(si),6e5)?e.set($t,""+a(),!0):i(30))),t(e)});var n=e.get(ei);
e.set(ei,function(e){var t=n(e);return Ui(e),t})},Bi=function(e,t,i){if(!Ni){var n;n=Ce[ne][z];var s=Se[G],r=/^#?gaso=([^&]*)/;(s=(n=(n=n&&n[$](r)||s&&s[$](r))?n[1]:Ae("GASO")[0]||"")&&n[$](/^(?:!([-0-9a-z.]{1,40})!)?([-.\w]{10,1200})$/i))&&(Ie("GASO",""+n,i,t,e,0),O._udo||(O._udo=t),O._utcp||(O._utcp=i),e=s[1],u("https://www.google.com/analytics/web/inpage/pub/inpage.js?"+(e?"prefix="+e+"&":"")+a(),"_gasojs")),Ni=!0}},ji=function(e){function t(e,t){n.b[V].set(e,t)}function i(e,i){t(e,i),n.filters.add(e);
}var n=this;this.b=new Ue,this.filters=new Fe,t(ii,e[ii]),t(si,e[si]),t(ai,e[ai]),t(ri,e[ri]||d()),t(oi,e[oi]),t(li,e[li]),t(ci,e[ci]),t(ui,e[ui]),t(hi,e[hi]),t(pi,e[pi]),t(fi,e[fi]),t(mi,e[mi]),t(gi,e[gi]),t(di,e[di]),t(tt,1),t(it,"j15"),i(Qt,m),i(qt,w),i(Kt,g),i(Yt,Ci),i(Gt,ki),i(Xt,f),i(Jt,x),i(ti,b),i(Zt,v),i(ei,y),Vi(this.b,e[ni]),Hi(this.b),this.b.set(nt,D()),Bi(this.b.get(si),this.b.get(ri),this.b.get(oi))},Vi=function(e,t){if("cookie"==je(e,di)){xi=!1;var n;e:{var s=Ae(je(e,ai));if(s&&!(1>s[Z])){
n=[];for(var r=0;r<s[Z];r++){var o;o=s[r][ie](".");var c=o.shift();("GA1"==c||"1"==c)&&1<o[Z]?(c=o.shift()[ie]("-"),1==c[Z]&&(c[1]="1"),c[0]*=1,c[1]*=1,o={r:c,s:o[ge](".")}):o=void 0,o&&n[U](o)}if(1==n[Z]){i(13),n=n[0].s;break e}if(0!=n[Z]){if(i(14),s=_i(je(e,ri)),n=Ai(n,s,0),1==n[Z]){n=n[0].s;break e}s=Di(je(e,oi)),n=Ai(n,s,1),n=n[0]&&n[0].s;break e}i(12)}n=void 0}n||(n=je(e,ri),s=je(e,ci)||d(),n=P("__utma",s,n),(n=void 0==n?void 0:n.O[1]+"."+n.O[2])&&i(10)),n&&(e[V].set(ni,n),xi=!0)}if(n=e.get(pi),
(r=(n=Ce[ne][n?"href":"search"][$]("(?:&|#|\\?)"+l("_ga")[j](/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")+"=([^&#]*)"))&&2==n[Z]?n[1]:"")&&(e.get(hi)?(n=r[W]("."),-1==n?i(22):(s=r[de](n+1),"1"!=r[de](0,n)?i(22):(n=s[W]("."),-1==n?i(22):(r=s[de](0,n),n=s[de](n+1),r!=_(n,0)&&r!=_(n,-1)&&r!=_(n,-2)?i(23):(i(11),e[V].set(ni,n)))))):i(21)),t&&(i(9),e[V].set(ni,l(t))),!e.get(ni))if(n=(n=Se.gaGlobal&&Se.gaGlobal.vid)&&-1!=n[ae](/^(?:utma\.)?\d+\.\d+$/)?n:void 0)i(17),e[V].set(ni,n);else{for(i(8),n=Se[fe],n=n.appName+n.version+n.platform+n.userAgent+(Ce[H]?Ce[H]:"")+(Ce.referrer?Ce.referrer:""),
s=n[Z],r=Se.history[Z];r>0;)n+=r--^s++;e[V].set(ni,[a()^2147483647&M(n),N.round((new Date)[X]()/1e3)][ge]("."))}Si(e)},Hi=function(e){var t=Se[fe],n=Se.screen,s=Ce[ne];if(e.set(ct,h(e.get(gi))),s){var a=s.pathname||"";"/"!=a.charAt(0)&&(i(31),a="/"+a),e.set(lt,s[le]+"//"+s[se]+a+s[ae])}n&&e.set(ft,n.width+"x"+n.height),n&&e.set(pt,n.colorDepth+"-bit");var n=Ce.documentElement,r=(a=Ce.body)&&a[te]&&a[ce],o=[];if(n&&n[te]&&n[ce]&&("CSS1Compat"===Ce.compatMode||!r)?o=[n[te],n[ce]]:r&&(o=[a[te],a[ce]]),
n=0>=o[0]||0>=o[1]?"":o[ge]("x"),e.set(mt,n),e.set(vt,k()),e.set(ht,Ce.characterSet||Ce.charset),e.set(gt,t&&"function"==typeof t.javaEnabled&&t.javaEnabled()||!1),e.set(dt,(t&&(t.language||t.browserLanguage)||"")[ve]()),s&&e.get(pi)&&(t=Ce[ne][z])){for(t=t[de](1),t=t[ie]("&"),s=[],n=0;n<t[Z];++n)0!=t[n][W]("utm_id")&&0!=t[n][W]("utm_campaign")&&0!=t[n][W]("utm_source")&&0!=t[n][W]("utm_medium")&&0!=t[n][W]("utm_term")&&0!=t[n][W]("utm_content")||s[U](t[n]);0<s[Z]&&(t="#"+s[ge]("&"),e.set(lt,e.get(lt)+t));
}};ji[ee].get=function(e){return this.b.get(e)},ji[ee].set=function(e,t){this.b.set(e,t)};var Wi={pageview:[ut],event:[yt,bt,wt,xt],social:[St,Ct,kt],timing:[Rt,Ot,Nt,Lt]};ji[ee].send=function(e){if(!(1>arguments[Z])){var t,i;"string"==typeof arguments[0]?(t=arguments[0],i=[][B][oe](arguments,1)):(t=arguments[0]&&arguments[0][st],i=arguments),t&&(i=p(Wi[t]||[],i),i[st]=t,this.b.set(i,void 0,!0),this.filters.execute(this.b),"pageview"==t&&$i(this),this.b[V].m={})}};var $i=function(e){e.I||(e.I=!0,
vi(e.b,function(t){e.send("timing",t)}))},Qi=function(e){return"prerender"==Ce.webkitVisibilityState?!1:(e(),!0)},qi=function(e){if(!Qi(e)){i(16);var t=!1,n=function(){!t&&Qi(e)&&(t=!0,we(Ce,"webkitvisibilitychange",n))};be(Ce,"webkitvisibilitychange",n)}},Ki={F:"/plugins/ua/",D:/^(?:(\w+)\.)?(?:(\w+):)?(\w+)$/};Ki.k=new xe,Ki.f=[];var Yi=function(e){if(n(e[0]))this.u=e[0];else{var t=Ki.D.exec(e[0]);if(null!=t&&4==t[Z]&&(this.c=t[1]||"t0",this.e=t[2]||"",this.d=t[3],this.a=[][B][oe](e,1),this.e||(this.A="create"==this.d,
this.i="require"==this.d,this.g="provide"==this.d)),!n(e[0])){if(t=e[1],e=e[2],!this.d)throw"abort";if(this.i&&(!s(t)||""==t))throw"abort";if(this.g&&(!s(t)||""==t||!n(e)))throw"abort";if(0<=this.c[W](".")||0<=this.c[W](":")||0<=this.e[W](".")||0<=this.e[W](":"))throw"abort";if(this.g&&"t0"!=this.c)throw"abort"}}};Ki.B=function(e,t,i){var s=Ki.k.get(e);return n(s)?(t.plugins_=t.plugins_||new xe,t.plugins_.set(e,new s(t,i||{})),!0):!1},Ki.C=function(e,t){Ki.k.set(e,t)},Ki.execute=function(e){var t=Ki.J[pe](Ki,arguments),t=Ki.f.concat(t);
for(Ki.f=[];0<t[Z]&&!Ki.v(t[0])&&(t.shift(),!(0<Ki.f[Z])););Ki.f=Ki.f.concat(t)},Ki.J=function(e){for(var t=[],i=0;i<arguments[Z];i++)try{var s=new Yi(arguments[i]);if(s.g)Ki.v(s);else{if(s.i){var a=s.a[1];if(!n(Ki.k.get(s.a[0]))&&!s.H&&a){var r,o=a+"",a=o&&0<=o[W]("/")?o:"//www.google-analytics.com"+Ki.F+o,l=E(""+a),c=l[le],d=Ce[ne][le];r="https:"==c||c==d?!0:"http:"!=c?!1:"http:"==d;var h;if(h=r){var o=l,p=E(Ce[ne][ue]);if(o.G||0<=o.url[W]("?")||0<=o.path[W]("://"))h=!1;else if(o[J]==p[J]&&o[q]==p[q])h=!0;else{
var f="http:"==o[le]?80:443;h="www.google-analytics.com"==o[J]&&(o[q]||f)==f&&0==o.path[W]("/plugins/")?!0:!1}}h&&(s.H=!!u(l.url))}}t[U](s)}}catch(m){}return t},Ki.v=function(e){try{if(e.u)e.u[oe](Se,Gi.j("t0"));else if(e.g)Ki.C(e.a[0],e.a[1]);else{var t=e.c==Ze?Gi:Gi.j(e.c);if(e.A)"t0"==e.c&&Gi.create[pe](Gi,e.a);else if(t)if(e.i){if(!Ki.B(e.a[0],t,e.a[2]))return!0}else e.e&&(t=t.plugins_.get(e.e)),t[e.d][pe](t,e.a)}}catch(i){}};var Gi=function(e){i(1),Ki.execute[pe](Ki,[arguments])};Gi.h={},Gi.P=[],
Gi.L=0,Gi.answer=42;var Xi=[si,ri,ii];Gi.create=function(e){var t=p(Xi,[][B][oe](arguments));t[ii]||(t[ii]="t0");var i=""+t[ii];return Gi.h[i]?Gi.h[i]:(t=new ji(t),Gi.h[i]=t,Gi.P[U](t),t)},Gi.j=function(e){return Gi.h[e]},Gi.K=function(){return Gi.P[B](0)},Gi.N=function(){var e=Se[Ze];if(!e||42!=e.answer){Gi.L=e&&e.l,Gi.loaded=!0,Se[Ze]=Gi,S();var t=e&&e.q;"[object Array]"==Object[ee].toString[oe](Object(t))&&qi(function(){Ki.execute[pe](Gi,t)})}},Gi.N()}(window),e.exports=ga}).call(t,i(4))},function(e,t){
!function(){"use strict";var e={};!function(){function t(){n||console.log.apply(console,arguments);for(var e=Math.round(Date.now()-a),t=[],i=0;i<arguments.length;i++){var s=""+arguments[i];"[obj"!=s.slice(0,4)&&t.push(s)}var r=e+": "+t.join(", "),o=document.getElementById("console");o&&(o.value+=r+"\n"),n&&console.log(r)}function i(e){s>=e&&t.apply(null,arguments)}var n=!!(window.console&&window.console.log&&window.console.log.call),s=0,a=(new Date).getTime();e.dlog=i,e.log=t,e.DLOG_LEVEL=s}(),function(){
var t={SMOOTH_STREAMING:"smoothstreaming",DASH:"dash"};e.StreamingType=t}(),function(){var t=function(e){this.ttml_=e,this.frameRate_=30};t.prototype.xmlDecode_=function(e){return e.replace(/&apos;/g,"'").replace(/&quot;/g,'"').replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">")},t.prototype.parseChildElements_=function(e,t,i){var n=[];if(null==i)return n;for(var s=i.firstElementChild;null!=s;s=s.nextElementSibling)s.nodeName==e&&n.push(t.call(this,s));return n},t.prototype.parseAttributes_=function(e,t){
var i={};for(var n in e)null!=t.attributes.getNamedItem(n)&&(i[n]=e[n](t.attributes[n].value));return i},t.prototype.parseTime_=function(e){var t=e.split(":"),i=3600*parseFloat(t[0])+60*parseFloat(t[1])+parseFloat(t[2])+parseFloat(t[3])/this.frameRate_;return i},t.prototype.parseTextTrack_=function(e){var t=this.xmlDecode_(e.replace(/[\r\n]+/g,"").replace(/ {2,}/g," ").replace(/<[^>]+>/g,"").replace(/<br\s*\/>/g,"\n"));return t.trim()},t.prototype.parse_cue_=function(e){var t=this.parseAttributes_({
begin:this.parseTime_.bind(this),end:this.parseTime_.bind(this)},e);return t&&(t.caption=this.parseTextTrack_(e.textContent),t.start=t.begin,delete t.begin),t},t.prototype.parse_div_=function(e){return this.parseChildElements_("p",this.parse_cue_,e)},t.prototype.parse_body_=function(e){var t=this.parseChildElements_("div",this.parse_div_,e);return t[0]},t.prototype.parse_ttml_=function(e){var t=this.parseChildElements_("body",this.parse_body_,e);return t[0]},t.prototype.parse=function(){for(var e=new DOMParser,t=e.parseFromString(this.ttml_,"text/xml"),i=0;i<t.childNodes.length;i++)if("tt"===t.childNodes[i].nodeName)return this.parse_ttml_(t.childNodes[i]);
},e.Ttml=t}(),function(){var t=0,i=1,n=function(e){if(null==e)throw new Error("A url for the close captions location is required");this._url=e,this._callback=null,this._ccInfo=null};n.prototype.ccType=function(){return t},n.prototype.requestCC=function(){var e=new XMLHttpRequest;e.addEventListener("load",this.onCCLoad.bind(this)),e.addEventListener("error",this.onCCError.bind(this)),e.open("GET",this._url),e.send()},n.prototype.load=function(t){if(null==t)throw new Error("A callback is required");
this._callback=t,this.requestCC(),e.dlog(1,"Sent request to get the close captions info")},n.prototype.getCCInfo=function(){return this._ccInfo},n.prototype.onCCError=function(t){var i="Error geting captions from "+this._url;return e.log(i),this._callback(i)},n.prototype.onCCLoad=function(n){e.dlog(2,"Close Captions Info received");var s=null;if(200!==n.target.status||n.target.status>299)return s="HTTP error "+n.target.status+" retrieving close captions from "+this._url,e.log(s),this._callback(s);
switch(this.ccType()){case t:this._ccInfo=new e.Ttml(n.target.responseText).parse();break;case i:throw new Error("VTT parsing not implemented yet")}return null===this._ccInfo?(s="Error parsing the close captions info",e.log(s),this._callback(s)):this._callback(s,this._ccInfo)},e.CloseCaptionsLoader=n}(),function(){function t(e){return e}function i(e){var t=/PT(([0-9]*)H)?(([0-9]*)M)?(([0-9.]*)S)?/,i=t.exec(e);return i?3600*parseFloat(i[2]||0)+60*parseFloat(i[4]||0)+parseFloat(i[6]||0):parseFloat(e);
}function n(e,t,i){var n=[];if(null==i)return n;for(var s=i.firstElementChild;null!=s;s=s.nextElementSibling)s.nodeName==e&&n.push(t(s));return n}function s(e,t,i){return n(e,t,i)[0]||null}function a(e,t,i){i=i||{};for(var n in e)null!=t.attributes.getNamedItem(n)&&(i[n]=e[n](t.attributes[n].value));return i}function r(e){var t=/([0-9]+)(\/([0-9]+))?/.exec(e);return t?t[3]?parseFloat(t[1])/(parseFloat(t[3])||1):parseFloat(t[1]):1}function o(e){var t=/([0-9]+)-([0-9]+)/.exec(e);if(!t)return null;var i=parseInt(t[1]),n=parseInt(t[2]);
return{start:i,end:n,length:n-i+1}}function l(e){return a(x,e)}function c(e){return e.textContent}function u(e){return o(e.attributes.range.value)}function d(e){var t=a(S,e);return t.initialization=s("Initialization",u,e),t}function h(e){return a(C,e)}function p(e){var t=d(e);return t.timescale&&t.duration?t.durationSeconds=t.duration/t.timescale:t.durationSeconds=t.duration,t.segmentURLs=n("SegmentURL",l,e),t}function f(e){var t=a(P,e);return t.baseURLs=n("BaseURL",c,e),t.segmentBase=s("SegmentBase",d,e),
t.segmentList=s("SegmentList",p,e),t.contentProtection=s("ContentProtection",k,e),t}function m(e){var t=f(e);return a(A,e,t),t}function g(e){var t=f(e);t.representations=n("Representation",m,e),t.segmentTemplate=s("SegmentTemplate",h,e);for(var i=0;i<t.representations.length;i++)t.representations[i].segmentTemplate=t.segmentTemplate;return t}function v(e){var t=f(e);return a(I,e,t),t.adaptationSets=n("AdaptationSet",g,e),t}function y(e){var t={};return a({mediaPresentationDuration:i},e,t),t.periods=n("Period",v,e),
t.baseURLs=n("BaseURL",c,e),t}function b(e,t){e.manifestURL=t,e.duration=e.mediaPresentationDuration,delete e.mediaPresentationDuration,e.adaptationSets=e.periods[0].adaptationSets,delete e.periods;for(var i=0;i<e.adaptationSets.length;i++)e.adaptationSets[i].mimeType?(e.adaptationSets[i].mime=e.adaptationSets[i].mimeType,delete e.adaptationSets[i].mimeType):e.adaptationSets[i].mime=e.adaptationSets[i].representations[0].mimeType,e.adaptationSets[i].codecs||(e.adaptationSets[i].codecs=e.adaptationSets[i].representations[0].codecs);
return e}function w(e,t){var i=new DOMParser,n=i.parseFromString(e,"text/xml");return b(y(n.firstChild),t)}var x={media:t,mediaRange:o,index:t,indexRange:o},S={timescale:parseInt,duration:parseInt,indexRange:o,presentationTimeOffset:parseInt,startNumber:parseInt},C={timescale:parseInt,duration:parseInt,initialization:t,media:t,startNumber:parseInt},k=function(e){var t=e.attributes.schemeIdUri;if(!t||"http://youtube.com/drm/2012/10/10"!=t.textContent)return null;for(var i={},n=e.firstElementChild;null!=n;n=n.nextElementSibling)if("yt:SystemURL"==n.nodeName){
var s=n.attributes.type.textContent;i[s]=n.textContent}return i},P={id:t,profiles:t,width:parseInt,height:parseInt,frameRate:r,audioSamplingRate:parseInt,mimeType:t,codecs:t},A={bandwidth:parseInt,qualityRanking:parseInt},I={id:parseInt,start:i,duration:i};e.parseDASHManifest=w}(),function(){function t(e){for(var t=new DataView(e),i=0;i<e.byteLength;){var n=t.getUint32(i+4,!1);if(1936286840==n||1836019558==n)break;i+=t.getUint32(i,!1)}return new Uint8Array(e.slice(0,i))}function i(e,t){for(var i=new DataView(e),n=0;1936286840!=i.getUint32(n+4,!1);)if(n+=i.getUint32(n,!1),
n>=e.byteLength)throw"Could not find sidx";var s=i.getUint32(n,!1)+n;if(s>e.byteLength)throw"sidx terminates after array buffer";var a=i.getUint8(n+8);n+=12;var r=i.getUint32(n+4,!1);n+=8;var o,l;0==a?(o=i.getUint32(n,!1),l=i.getUint32(n+4,!1),n+=8):(o=(i.getUint32(n,!1)<<32)+i.getUint32(n+4,!1),l=(i.getUint32(n+8,!1)<<32)+i.getUint32(n+12,!1),n+=16),l+=s+(t||0);var c=i.getUint16(n+2,!1);n+=4;for(var u=l,d=o,h=[],p=0;c>p;p++){var f=i.getUint32(n,!1),m=2147483648&f;if(m)throw"Unhandled indirect reference";
f=2147483647&f;var g=i.getUint32(n+4,!1);n+=12,h.push({size:f,offset:u,duration:g/r,time:d/r}),u+=f,d+=g}if(n!=s)throw"Error: final pos "+n+" differs from SIDX end "+s;return h}window.ArrayBuffer&&!window.ArrayBuffer.prototype.slice&&(window.ArrayBuffer.prototype.slice=function(e,t){var i=new Uint8Array(this);null==t&&(t=i.length);for(var n=new ArrayBuffer(t-e),s=new Uint8Array(n),a=0;a<s.length;a++)s[a]=i[a+e];return n}),e.extractInit=t,e.parseSIDX=i}(),function(){function t(e){return e}function i(e){
for(var t=new ArrayBuffer(e.length/2),i=new Uint8Array(t),n=0;n<e.length;n+=2)i[n/2]=parseInt(e.substr(n,2),16);return i}function n(e){for(var t=[],i=0;i<e.length;i+=2)t.push(parseInt(e.substr(i,2),16));return t}function s(e){return i(e.replace(/[{}-]/g,""))}function a(e,t,i){var n=[];if(null==i)return n;for(var s=i.firstElementChild;null!=s;s=s.nextElementSibling)s.nodeName==e&&n.push(t(s));return n}function r(e,t,i){i=i||{};for(var n in e)null!=t.attributes.getNamedItem(n)&&(i[n]=e[n](t.attributes[n].value));
return i}function o(t){var i={},s=t.split("00000001");return 3!==s.length?(t||(e.log("Warning, Audio codec private data is not specified."),t="1210"),i=n(t)):(i.SPS=n(s[1]),i.PPS=n(s[2])),i}function l(t){return"AACL"==t?"mp4a.40.2":"H264"==t||"AVC1"==t?"avc1.4d40":(e.log("Warning, unsupported FourCC encountered: "+t),"")}function c(e){var t={};return r({Bitrate:parseInt},e,t),r({CodecPrivateData:o},e,t),r({MaxWidth:parseInt},e,t),r({MaxHeight:parseInt},e,t),r({FourCC:l},e,t),t}function u(e){var t={};
return r({Bitrate:parseInt},e,t),r({CodecPrivateData:o},e,t),r({SamplingRate:parseInt},e,t),r({Channels:parseInt},e,t),r({BitsPerSample:parseInt},e,t),r({PacketSize:parseInt},e,t),r({FourCC:l},e,t),t}function d(e){var t=[];if(null==e)return t;for(var i=-1,n=e.firstElementChild;null!=n;n=n.nextElementSibling)if("c"==n.nodeName){var s={};if(-1==i&&(i=null!=n.attributes.getNamedItem("t")?parseInt(n.attributes.t.value):0),s.time=i/1e7,s.timeURL=i,null==n.attributes.getNamedItem("d"))throw"Expected attribute 'd' not found";
var a=parseInt(n.attributes.d.value);s.duration=a/1e7,s.durationURL=a,i+=a,t.push(s)}return t}function h(e){var i={};return r({Type:t},e,i),r({Url:t},e,i),"video"===i.Type?i.QualityLevels=a("QualityLevel",c,e):"audio"==i.Type&&(i.QualityLevels=a("QualityLevel",u,e)),i.Fragments=d(e),i}function p(e,t){for(var i=[],n=[],s=!1,a=!1,r=e.length-1;r>=0&&(a||"video"!==e[r].Type||(n.push(r),a=!0),s||"audio"!==e[r].Type||(n.push(r),s=!0),!a||!s);r--);for(var r=0;r<e.length;r++)if(-1!==n.indexOf(r)){var o={};
switch(o.contentProtection=null,e[r].Type){case"audio":o.mime="audio/mp4";break;case"video":o.mime="video/mp4"}if(e[r].QualityLevels){o.representations=[];for(var l=0;l<e[r].QualityLevels.length;l++){var c={};switch(c.bandwidth=e[r].QualityLevels[l].Bitrate,c.baseURLs=[],c.baseURLs[0]=e[r].Url,c.segmentBase=null,c.segs=e[r].Fragments,e[r].Type){case"audio":c.codecs=e[r].QualityLevels[l].FourCC,c.audio_codec_private_data=e[r].QualityLevels[l].CodecPrivateData,c.audio_sample_rate=e[r].QualityLevels[l].SamplingRate;
break;case"video":c.codecs=e[r].QualityLevels[l].FourCC+e[r].QualityLevels[l].CodecPrivateData.SPS[3].toString(16).toLowerCase(),c.sps=e[r].QualityLevels[l].CodecPrivateData.SPS,c.pps=e[r].QualityLevels[l].CodecPrivateData.PPS,c.width=e[r].QualityLevels[l].MaxWidth,c.height=e[r].QualityLevels[l].MaxHeight}o.representations.push(c)}o.codecs=o.representations[0].codecs}t&&(o.contentProtection=t),i.push(o)}return i}function f(e){for(var t=atob(e.trim()),i=new ArrayBuffer(t.length),n=new Uint8Array(i),s=0;s<t.length;s++)n[s]=t.charCodeAt(s);
return{ab:i,u8:n}}function m(e){for(var t=0,i=[],n=[],s=new Uint16Array(e),a=e.byteLength/2;a>t&&(0===i.length||0===n.length);){for(;a>t&&60!==s[t];)t++;if(75===s[t+1]&&73===s[t+2]&&68===s[t+3]&&62===s[t+4])for(t+=5;a>t&&60!==s[t];)i.push(s[t]),t++;else if(76===s[t+1]&&65===s[t+2]&&95===s[t+3]&&85===s[t+4]&&82===s[t+5]&&76===s[t+6]&&62===s[t+7])for(t+=8;a>t&&60!==s[t];)n.push(s[t]),t++;else t++}return{kid:String.fromCharCode.apply(null,i),url:String.fromCharCode.apply(null,n)}}function g(e){var t={};
r({SystemID:s},e,t);var i=f(e.textContent),n=m(i.ab);return t.KID=f(n.kid).u8,t.url=n.url,t.PrHeader=i.u8,t}function v(e){var t={};return t.ProtectionHeader=a("ProtectionHeader",g,e)[0],t}function y(e){var t={};r({TimeScale:parseInt},e,t),t.TimeScale||(t.TimeScale=1e7),r({Duration:parseInt},e,t),t.StreamIndexes=a("StreamIndex",h,e);var i=a("Protection",v,e);i&&i[0]&&(t.Protection=i[0]),t.duration=t.Duration/t.TimeScale;var n;return t.Protection&&(n={},t.Protection.ProtectionHeader.url?n.playready=t.Protection.ProtectionHeader.url:n.playready="http://playready.directtaps.net/pr/svc/rightsmanager.asmx"),
t.adaptationSets=p(t.StreamIndexes,n),t.Protection&&(t.pr={},t.pr.systemId=t.Protection.ProtectionHeader.SystemID,t.pr.prHeader=t.Protection.ProtectionHeader.PrHeader,t.pr.ivsize=8,t.pr.kid=t.Protection.ProtectionHeader.KID),t}function b(t,i){return t.manifestURL=i,t.type=e.StreamingType.SMOOTH_STREAMING,t}function w(e,t){for(var i,n=new DOMParser,s=n.parseFromString(e,"text/xml"),a=0;a<s.childNodes.length;a++)if("SmoothStreamingMedia"===s.childNodes[a].nodeName){i=s.childNodes[a];break}return b(y(i),t);
}e.parseSSManifest=w}(),function(){function t(e,t,i){e.setUint32(t,i)}function i(e,t,i){for(var n=0;4>n;n++)e.setUint8(t+4+n,i.charCodeAt(n));return 8}function n(e,t,i,n,s){return i.set(s,n),n+s.length}function s(e,n,s,a,r,o){var l=a;return a+=i(n,a,r),o&&(a=o(e,n,s,a)),t(n,l,a-l),a}function a(e,t,i,a,r,o){return s(e,t,i,a,r,function(e,t,i,s){return n(e,t,i,s,o)})}function r(e,t,i,n){return a(e,t,i,n,"smhd",[0,0,0,0,0,0,0,0])}function o(e,t,i,n){return a(e,t,i,n,"vmhd",[0,0,0,1,0,0,0,0,0,0,0,0])}
function l(e,t,i,a){return s(e,t,i,a,"esds",function(e,t,i,s){var a=e.audio_codec_private_data[0],r=e.audio_codec_private_data[1];return s=n(e,t,i,s,[0,0,0,0,3,25,0,1,0,4,17,64,21,0,0,0,0,0,0,0,0,0,0,0,5,2,a,r,6,1,2])})}function c(e,t,i,a){return s(e,t,i,a,"avcC",function(e,t,i,s){return s=n(e,t,i,s,[1,77,64,30,255,225]),t.setUint16(s,e.sps.length),s+=2,s=n(e,t,i,s,e.sps),t.setUint8(s,1),s+=1,t.setUint16(s,e.pps.length),s+=2,s=n(e,t,i,s,e.pps)})}function u(e,t,i){for(var n=i-t+1,s=0,a=t;t+n/2>a;a++)s=e[a],
e[a]=e[i-a+t],e[i-a+t]=s}function d(e){var t=new ArrayBuffer(e.length),i=new Uint8Array(t);return i.set(e),u(i,0,3),u(i,4,5),u(i,6,7),i}function h(e,t,i,a){return s(e,t,i,a,"tenc",function(e,t,i,s){s=n(e,t,i,s,[0,0,0,0,0,0,1]),t.setUint8(s,e.pr.ivsize),s++;var a=d(e.pr.kid);return s=n(e,t,i,s,a)})}function p(e,t,i,n){return s(e,t,i,n,"schi",function(e,t,i,n){return n=h(e,t,i,n)})}function f(e,t,i,n){return a(e,t,i,n,"schm",[0,0,0,0,99,101,110,99,0,1,0,0])}function m(e,t,i,n){return"audio/mp4"!==e.mime?a(e,t,i,n,"frma",[97,118,99,49]):a(e,t,i,n,"frma",[109,112,52,97]);
}function g(e,t,i,n){return s(e,t,i,n,"sinf",function(e,t,i,n){return n=m(e,t,i,n),n=f(e,t,i,n),n=p(e,t,i,n)})}function v(e,t,i,a,r){return s(e,t,i,a,r,function(e,t,i,s){var a=e.audio_sample_rate>>8&255,o=255&e.audio_sample_rate;return s=n(e,t,i,s,[0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,16,0,0,0,0,a,o,0,0]),s=l(e,t,i,s),"enca"===r&&(s=g(e,t,i,s)),s})}function y(e,t,i,a,r){return s(e,t,i,a,r,function(e,t,i,s){return s=n(e,t,i,s,[0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),t.setUint16(s,e.width),
s+=2,t.setUint16(s,e.height),s+=2,s=n(e,t,i,s,[0,72,0,0,0,72,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]),s=c(e,t,i,s),"encv"===r&&(s=g(e,t,i,s)),s})}function b(e,t,i,a){return s(e,t,i,a,"stsd",function(e,t,i,s){return s=n(e,t,i,s,[0,0,0,0,0,0,0,1]),"audio/mp4"!==e.mime?(e.pr&&(s=y(e,t,i,s,"encv")),s=y(e,t,i,s,"avc1")):(e.pr&&(s=v(e,t,i,s,"enca")),s=v(e,t,i,s,"mp4a")),s})}function w(e,t,i,a){return s(e,t,i,a,"stbl",function(e,t,i,s){return s=b(e,t,i,s),
s="audio/mp4"!==e.mime?n(e,t,i,s,[0,0,0,16,115,116,116,115,0,0,0,0,0,0,0,0,0,0,0,16,115,116,115,99,0,0,0,0,0,0,0,0,0,0,0,16,115,116,99,111,0,0,0,0,0,0,0,0,0,0,0,20,115,116,115,122,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,115,116,115,115,0,0,0,0,0,0,0,0]):n(e,t,i,s,[0,0,0,16,115,116,116,115,0,0,0,0,0,0,0,0,0,0,0,16,115,116,115,99,0,0,0,0,0,0,0,0,0,0,0,16,115,116,99,111,0,0,0,0,0,0,0,0,0,0,0,20,115,116,115,122,0,0,0,0,0,0,0,0,0,0,0,0])})}function x(e,t,i,n){return a(e,t,i,n,"url ",[0,0,0,1])}function S(e,t,i,a){
return s(e,t,i,a,"dref",function(e,t,i,s){return s=n(e,t,i,s,[0,0,0,0,0,0,0,1]),s=x(e,t,i,s)})}function C(e,t,i,n){return s(e,t,i,n,"dinf",function(e,t,i,n){return n=S(e,t,i,n)})}function k(e,t,i,n){return s(e,t,i,n,"minf",function(e,t,i,n){return n=C(e,t,i,n),n=w(e,t,i,n),n="audio/mp4"!==e.mime?o(e,t,i,n):r(e,t,i,n)})}function P(e,t,i,n){return"audio/mp4"!==e.mime?a(e,t,i,n,"hdlr",[0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]):a(e,t,i,n,"hdlr",[0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);
}function A(e,t,i,n){return a(e,t,i,n,"mdhd",[0,0,0,0,204,96,118,241,204,96,118,241,0,152,150,128,0,0,0,0,85,196,0,0])}function I(e,t,i,n){return s(e,t,i,n,"mdia",function(e,t,i,n){return n=A(e,t,i,n),n=P(e,t,i,n),n=k(e,t,i,n)})}function _(e,t,i,a){return s(e,t,i,a,"tkhd",function(e,t,i,s){return s=n(e,t,i,s,[0,0,0,3,204,96,118,241,204,96,118,241,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0]),t.setUint32(s,e.width),
s+=4,t.setUint32(s,e.height),s+=4,t.setUint16(s,0),s+=2})}function T(e,t,i,n){return s(e,t,i,n,"trak",function(e,t,i,n){return n=_(e,t,i,n),n=I(e,t,i,n)})}function D(e,t,i,n){return a(e,t,i,n,"trex",[0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])}function E(e,t,i,n){return s(e,t,i,n,"mvex",function(e,t,i,n){return n=D(e,t,i,n)})}function M(e,t,i,a){return s(e,t,i,a,"pssh",function(e,t,i,s){return s=n(e,t,i,s,[0,0,0,0]),s=n(e,t,i,s,e.pr.systemId),t.setUint32(s,e.pr.prHeader.length),s+=4,s=n(e,t,i,s,e.pr.prHeader);
})}function R(e,t,i,n){return a(e,t,i,n,"mvhd",[0,0,0,0,204,96,118,241,204,96,118,241,0,152,150,128,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2])}function O(e,t,i,n){return s(e,t,i,n,"moov",function(e,t,i,n){return n=R(e,t,i,n),e.pr&&(n=M(e,t,i,n)),n=E(e,t,i,n),n=T(e,t,i,n)})}function L(e){var t=new ArrayBuffer(2e4),i=new DataView(t),n=new Uint8Array(t),s=0,a=0;s=O(e,i,n,s),
a=s-1;var r={};return r.data=t.slice(0,s),r.init={},r.init.start=0,r.init.end=a,r}function N(e,t,i){for(var n=0,s=t,a=0;4>a;a++)n<<=8,n+=i.charCodeAt(a);for(;e.getUint32(s+4,!1)!=n;)if(s+=e.getUint32(s),s>=e.byteLength)throw"Could not find box: "+i;return s}function F(e,t){var i=N(e,t,"traf");i=N(e,i+8,"tfhd"),e.setUint32(i+12,1)}function U(e,t,i,n){var s=N(e,t,i),a=e.getUint32(s);return e.setUint32(s,a+n),s}function z(e,t,i){var n=0;if(n=U(e,n,"moof",t),n=U(e,n+8,"traf",t),n=N(e,n+8,"trun"),1&e.getUint32(n+8)){
var s=n+16;e.setUint32(s,i)}return n}function B(e,t,i){var n=0;if(n=U(e,n,"moof",t),n=U(e,n+8,"traf",t),n=N(e,n+8,"trun"),1&e.getUint32(n+8)){var s=n+16,a=e.getUint32(s);e.setUint32(s,a+i)}return n}function j(e,t){var i=[0,0,0,20,116,102,100,116,1,0,0,0],n=i.length+8,s=new ArrayBuffer(e.byteLength+n),a=(new Uint8Array(e),new DataView(e)),r=new Uint8Array(s),o=new DataView(s),l=0;return F(a,8),l=B(a,n,n),r.set(new Uint8Array(e,0,l)),r.set(i,l),o.setUint32(l+12,t/4294967295&4294967295),o.setUint32(l+16,4294967295&t),
r.set(new Uint8Array(e,l,e.byteLength-l),l+n),s}function V(e,t,i,n,s){if(!s)return new Uint8Array(0);for(var a=new Uint8Array(i),r=0,o=0,l=t,c=0;i>c;c++)r=e.getUint16(l+n),o=n+2+6*r,a[c]=o,l+=o;return a}function H(e,t,i,a,r,o){return s(e,t,i,a,"mdat",function(e,t,i,s){return s=n(e,t,i,s,r),s=n(e,t,i,s,o)})}function W(e,t,i,a){return s(e,t,i,a,"saio",function(e,t,i,s){s=n(e,t,i,s,[0,0,0,0,0,0,0,1]);var a=s+4+8;return t.setUint32(s,a),s+=4})}function $(e,t,i,a,r,o,l,c){return s(e,t,i,a,"saiz",function(e,t,i,s){
return s=l?n(e,t,i,s,[0,0,0,0,0]):n(e,t,i,s,[0,0,0,0,c]),t.setUint32(s,r),s+=4,i.set(o,s),s+=o.length})}function Q(e){var t=new DataView(e),i=0,n=0,s=0,a=t.getUint32(i);i=N(t,i+8,"traf"),i=N(t,i+8,"trun"),n=t.getUint32(i+12),i=N(t,i,"uuid");var r=t.getUint8(i+27),o=!1;if(2!==r&&0!==r)throw"uuid flags expected is 0x02 or 0x00 but found: "+r;2===r&&(o=!0);var l=t.getUint32(i+28);if(n!==l)throw"Samples count does not match "+n+" "+l;var c=t.getUint32(i);s=c-32;var u=200,d=new ArrayBuffer(e.byteLength+u),h=new Uint8Array(d),p=new DataView(d);
h.set(new Uint8Array(e,0,i));var f=i,m=8,g=i+32,v=i+c,y=t.getUint32(v),b=V(t,g,n,m,o);if(f=$(null,p,h,f,n,b,o,m),f=W(null,p,h,f),o){for(var w=0,x=0;x<b.length;x++)w+=b[x];if(w!==s)throw"Samples size does not match "+w+" "+s}else if(m*n!==s)throw"Samples size does not match "+m*n+" "+s;var S=new Uint8Array(e,g,s),C=new Uint8Array(e,v+8,y-8),k=f-a,P=f;return f=H(null,p,h,f,S,C),z(p,k,P+8+s),new Uint8Array(d,0,f)}function q(e,t,i){var n=j(e,t);return i?Q(n):new Uint8Array(n)}e.abtohex=function(e){for(var t=[],i=0;i<e.byteLength;i++)t.push(e[i].toString(16));
return t},e.abtob64=function(e){return btoa(String.fromCharCode.apply(null,new Uint8Array(e)))},e.createSSInit=L,e.process_traf=q}(),function(){function t(e){for(var t=new Uint8Array(e.length),i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}function i(e){return String.fromCharCode.apply(String,e)}var n=function(e){this.video=e,!e.generateKeyRequest&&e.webkitGenerateKeyRequest&&(e.generateKeyRequest=e.webkitGenerateKeyRequest),!e.addKey&&e.webkitAddKey&&(e.addKey=e.webkitAddKey),this.initDataQueue=[],
this.flavor=null,this.keySystem=null,this.licenseServerURL=null,this.mediaEvents_={},e.generateKeyRequest&&e.addKey&&(this.addMediaEventListener("needkey",this.onNeedKey),this.addMediaEventListener("keymessage",this.onKeyMessage),this.addMediaEventListener("keyerror",this.onKeyError),this.addMediaEventListener("webkitneedkey",this.onNeedKey),this.addMediaEventListener("webkitkeymessage",this.onKeyMessage),this.addMediaEventListener("webkitkeyerror",this.onKeyError))};n.kMime='video/mp4; codecs="avc1.640028"',
n.kFlavorToSystem={clearkey:["webkit-org.w3.clearkey","org.w3.clearkey"],widevine:["com.widevine.alpha"],playready:["com.youtube.playready","com.microsoft.playready"]},n.prototype.init=function(e,t,i){this.chooseFlavor(n.kMime,e,t),this.isClearKey="clearkey"==this.flavor},n.prototype.destroy=function(){this.removeAllMediaEventListeners(),this.video=null},n.prototype.addMediaEventListener=function(e,t){var i=t.bind(this);this.video.addEventListener(e,i),this.mediaEvents_[e]=i},n.prototype.removeMediaEventListener=function(e){
this.video.removeEventListener(e,this.mediaEvents_[e]),this.mediaEvents_[e]=null},n.prototype.removeAllMediaEventListeners=function(){for(var e in this.mediaEvents_)e&&this.removeMediaEventListener(e)},n.prototype.chooseFlavor=function(e,t,i){for(var s in t)if(!i||s==i){var a=n.kFlavorToSystem[s];if(a)for(var r in a)if(this.video.canPlayType(e,a[r]))return this.flavor=s,this.keySystem=a[r],void(this.licenseServerURL=t[s])}throw"Could not find a compatible key system"},n.prototype.extractBMFFClearKeyID=function(e){
var t=new ArrayBuffer(e.length),i=new Uint8Array(t);i.set(e);for(var n=new DataView(t),s=0;s<t.byteLength;){var a=n.getUint32(s,!1),r=n.getUint32(s+4,!1);if(1886614376!=r)throw"Box type "+r.toString(16)+' not equal to "pssh"';if(1477738184==n.getUint32(s+12,!1)&&69420633==n.getUint32(s+16,!1)&&2464609580==n.getUint32(s+20,!1)&&1558758348==n.getUint32(s+24,!1)){var o=n.getUint32(s+28,!1);if(16!=o)throw"Unexpected KID size "+o;return new Uint8Array(t.slice(s+32,s+32+o))}if(3991899049==n.getUint32(s+12,!1)&&2044086990==n.getUint32(s+16,!1)&&2747803612==n.getUint32(s+20,!1)&&3575456237==n.getUint32(s+24,!1))return new Uint8Array(t.slice(s+36,s+52));
s+=a}return e},n.prototype.onNeedKey=function(t){if(e.dlog(2,"onNeedKey()"),!this.keySystem)throw"Not initialized! Bad manifest parse?";if(16==t.initData.length)return void e.log("Dropping non-BMFF needKey event");var i=t.initData;this.isClearKey&&(i=this.extractBMFFClearKeyID(t.initData)),this.video.generateKeyRequest(this.keySystem,i),this.initDataQueue.push(i)},n.prototype.onKeyMessage=function(t){e.dlog(2,"onKeyMessage() Sending request: "+this.licenseServerURL+" "+t.sessionId);var i=this.initDataQueue.shift(),n=new XMLHttpRequest;
n.open("POST",this.licenseServerURL),n.setRequestHeader("content-type","text/xml;charset=utf-8"),n.addEventListener("load",this.onLoad.bind(this,i,t.sessionId)),n.responseType="arraybuffer",n.send(t.message)},n.prototype.onKeyError=function(t){e.dlog(2,"onKeyError("+t.keySystem+", "+t.errorCode.code+", "+t.systemCode+")")},n.prototype.onLoad=function(n,s,a){if(e.dlog(2,"onLoad("+this.licenseServerURL+"): "+s),a.target.status<200||a.target.status>299)throw"Bad XHR status: "+a.target.statusText;var r=i(new Uint8Array(a.target.response)).split("\r\n").pop();
this.video.addKey(this.keySystem,t(r),n,s)},e.EMEManager=n}(),function(){var t=function(e,t,i,n,s,a,r){this.url=e,this.bandwidth=t,this.width=i,this.height=n,this.sps=s,this.pps=a,this.codecs=r,this.initFragment=null,this.initRequestData=null,this.indexRequestData=null,this.isInitialized=!1,this.segs=null};e.Representation=t}(),function(){var t={ENOUGH:20},i=function(e,t,i,n,s,a){if(this.sourceBuffer_=t,this.sourceBuffer_.appendBuffer)this.appendBuffer_=this.sourceBuffer_.appendBuffer,this.sourceBuffer_.addEventListener("updateend",this.onUpdateEnd.bind(this));else{
if(!this.sourceBuffer_.append)throw new Error("Unknown SourceBuffer interface");this.appendBuffer_=this.sourceBuffer_.append}this.representations_=i,this.currentRep=0,this.segIndex=null,this.mime=n,this.resetReason=null,this.active=!0,this.type=s,this.pr_=a,this.seekingStartTime=null,this.mediaSrc_=e,this.bitrates=[];for(var r=0;r<this.representations_.length;r++)this.bitrates.push(this.representations_[r].bandwidth);this.deferredAppends_=[],this.segmentQueue=[],this.segmentSize=0,this.segmentLastEndTime=0,
this.waitingForBuffer=!1,this.segmentTimeout=null};i.prototype.destroy=function(){delete this.mediaSrc_},i.prototype.getCurrentTime=function(){var e=window.googledash.player,t=e&&e.getMediaElement();return t?t.currentTime:0},i.prototype.updateBuffer=function(){var t=this.sourceBuffer_.buffered;if(t.length>0){var i=t.end(t.length-1)-this.segmentLastEndTime;e.dlog(3,"["+this.mime+"] Play head: "+this.getCurrentTime()+" Segment size: "+(this.segmentSize/1024/1024).toFixed(2)+" MB Segment duration: "+i),
this.segmentQueue.push({size:this.segmentSize,duration:i,offset:this.segmentLastEndTime})}},i.prototype.reset=function(t){e.dlog(1,"SourceBuffer["+this.mime+"] reset: "+t),this.segIndex=null,this.representations_[this.currentRep].isInitialized=!1,this.resetReason=t||null,this.active=!0,this.segmentQueue=[],this.segmentSize=0,this.segmentLastEndTime=0,this.waitingForBuffer=!1,null!=this.segmentTimeout&&clearTimeout(this.segmentTimeout),"open"==this.mediaSrc_.readyState&&this.sourceBuffer_.abort()},
i.prototype.isInitialized=function(){return this.representations_[this.currentRep].isInitialized},i.prototype.initialize=function(){this.representations_[this.currentRep].isInitialized=!0},i.prototype.updating=function(){return this.sourceBuffer_.updating},i.prototype.onUpdateEnd=function(t){this.updateBuffer(),this.deferredAppends_.length>0&&(e.dlog(2,"SourceBuffer["+this.mime+"] appended deferred data"),this.append(this.deferredAppends_.pop()))},i.prototype.append=function(t){var i=this.sourceBuffer_.buffered;
if(this.segmentSize=t.length,this.segmentLastEndTime=0,i.length>0&&(this.segmentLastEndTime=i.end(i.length-1)),this.sourceBuffer_.updating){if(this.deferredAppends_.length<5)return e.dlog(2,"SourceBuffer["+this.mime+"] deferring append"),void this.deferredAppends_.push(t);e.log("SourceBuffer["+this.mime+"] too many deferrals, aborting"),this.deferredAppends_=[],this.appendBuffer_.abort()}this.appendBuffer_.call(this.sourceBuffer_,t),"appendBuffer"in this.sourceBuffer_||this.updateBuffer()},i.prototype.getCurrentRep=function(){
return this.representations_[this.currentRep]},i.prototype.changeQuality=function(t){if(t===this.currentRep)return!1;e.dlog(2,"Bandwitdth change sourceBuffer["+this.mime+"]: "+this.active),e.dlog(2,"bandwidthChange["+this.mime+"]: "+this.currentRep+" "+t);var i,n=this.representations_[this.currentRep].bandwidth,s=this.representations_[t].bandwidth;e.dlog(2,"bandwidthChange["+this.mime+"]: "+n+" "+s),i=n>s?"rep_down":"rep_up",this.reset(i),this.currentRep=t},i.prototype.getRangesString=function(){
for(var e=this.sourceBuffer_.buffered,t="Ranges["+this.mime+"]:",i=0;i<e.length;i++)t+=" ["+e.start(i)+","+e.end(i)+"]";return t},i.prototype.findRangeForPlaybackTime=function(e){for(var t=this.sourceBuffer_.buffered,i=0;i<t.length;i++)if(t.start(i)<=e&&t.end(i)>=e)return{start:t.start(i),end:t.end(i)};return null},i.prototype.getBufferSize=function(t){e.dlog(4,"Time: "+t+" Ranges in onProgress: "+this.getRangesString());var i=this.findRangeForPlaybackTime(t),n=i&&i.end||0;if(null!==this.segIndex){
var s=this.representations_[this.currentRep].segs[this.segIndex].time;n=s>n?s:n}if(i){var a=Math.abs(i.end-n);a>.001&&e.dlog(2,"Difference in available data: "+i.end+" "+n)}return n-t},i.prototype.findSegmentIndexForTime=function(t){for(var i=this.representations_[this.currentRep].segs,n=0;n<i.length;n++){var s=i[n];if(s.time<=t&&s.time+s.duration>=t)return n==i.length-1&&s.time+s.duration+.5<t?null:n}return e.dlog(5,"Could not find segment for time "+t),null},i.prototype.identifyNextFragment=function(i){
var n=this.findRangeForPlaybackTime(i),s=n&&n.end||i;if(s>i+t.ENOUGH)return e.dlog(3,"Enough buffering currentTime in rage: "+this.mime+" "+i+"  "+s),null;if(1==this.waitingForBuffer)return null;if(null==this.segIndex){if(e.dlog(4,"Non existing index, finding the index for the next request["+this.mime+"]"),this.segIndex=this.findSegmentIndexForTime(s),null===this.segIndex)return this.active=!1,null;e.dlog(4,"New Index["+this.mime+"]: "+s+" "+this.segIndex)}else{null==n&&e.log("Playback head outside of buffer in append-continue state.");
var a=this.representations_[this.currentRep].segs[this.segIndex].time;if(a>i+t.ENOUGH)return e.dlog(3,"Enough buffering: "+this.mime+" "+this.segIndex+" "+i+"  "+a),null}return s},i.prototype.appendData=function(t){for(e.dlog(2,"["+this.mime+"] Time is "+this.getCurrentTime()+", asked to add a "+(t.byteLength/1024/1024).toFixed(2)+" MB segment, see if we can."),this.segmentQueue.length>0&&e.dlog(2,"["+this.mime+"] End of first segment is "+(this.segmentQueue[0].offset+this.segmentQueue[0].duration).toFixed(2));this.segmentQueue.length>0&&this.segmentQueue[0].offset+this.segmentQueue[0].duration<this.getCurrentTime()+2;)e.dlog(2,"["+this.mime+"] Removing collectable segment."),
this.segmentQueue.shift();for(var i=0,n=0;n<this.segmentQueue.length;n++)i+=this.segmentQueue[n].size;e.dlog(2,"["+this.mime+"] Time is "+this.getCurrentTime()+" and there are "+(i/1024/1024).toFixed(2)+" MB uncollectable, bringing the proposed total to "+((i+t.byteLength)/1024/1024).toFixed(2)+" MB."),(i+t.byteLength)/1024/1024>24&&this.segmentQueue.length>0?(e.dlog(2,"["+this.mime+"] Waiting for buffer to have enough room."),this.waitingForBuffer=!0,this.segmentTimeout=setTimeout(function(){this.appendData(t);
}.bind(this),1e3)):(this.reallyAppendData(t),this.waitingForBuffer=!1)},i.prototype.reallyAppendData=function(t){e.dlog(3,"["+this.mime+"] Current Time: "+this.getCurrentTime()+" Ranges in appendData1: "+this.getRangesString());var i,n=this.representations_[this.currentRep].segs[this.segIndex].time,s=n+this.representations_[this.currentRep].segs[this.segIndex].duration;e.dlog(4,"Appending Response ["+this.mime+"] : ["+n+","+s+"]"),i=this.type===e.StreamingType.SMOOTH_STREAMING?process_traf(t,this.representations_[this.currentRep].segs[this.segIndex].timeURL,this.pr_):new Uint8Array(t),
this.append(i),this.segIndex++,this.segIndex>=this.representations_[this.currentRep].segs.length&&(this.active=!1,e.dlog(2,"Source["+this.mime+"] is not active: "+this.segIndex+" "+this.representations_[this.currentRep].segs.length)),e.dlog(3,"Ranges in appendData2: "+this.getRangesString())},e.SourceBufferManager=i}(),function(){var t=function(){this.mediaSrc_=null,this.sourceBufferManagers_=[],this.videoSrcBufIndex_=0,this.emeMgr_=null,this.type=null,this.pr,this.manifest_=null,this.attachedHandlers_={};
};t.prototype.destroy=function(){null!=this.mediaSrc_&&(this.detachAllHandlers_(),this.mediaSrc_=null);var e=this.sourceBufferManagers_;if(e){for(var t=0;t<e.length;t++)e[t].reset(),e[t].destroy();e.length=0}this.sourceBufferManagers_=null,this.emeMgr_&&(this.emeMgr_.destroy(),this.emeMgr_=null),this.revokeObjectURL_(),this.video_=null},t.prototype.getMediaSource=function(){return this.mediaSrc_},t.prototype.getSourceBufferCount=function(){return this.sourceBufferManagers_.length},t.prototype.getVideoSrcBufferIndex=function(){
return this.videoSrcBufIndex_},t.prototype.getLevel=function(e){return this.sourceBufferManagers_[e].currentRep},t.prototype.getSegIndex=function(e){return this.sourceBufferManagers_[e].segIndex},t.prototype.getCurrentRep=function(e){return this.sourceBufferManagers_[e].getCurrentRep()},t.prototype.getBufferSize=function(e,t){return this.sourceBufferManagers_[e].getBufferSize(t)},t.prototype.getLevel=function(e){return this.sourceBufferManagers_[e].currentRep},t.prototype.appendData=function(e,t){
this.mediaSrc_&&"closed"!==this.mediaSrc_.readyState&&this.sourceBufferManagers_[e].appendData(t)},t.prototype.append=function(e,t){this.mediaSrc_&&"closed"!==this.mediaSrc_.readyState&&this.sourceBufferManagers_[e].append(t)},t.prototype.isActive=function(e){return this.sourceBufferManagers_[e].active},t.prototype.isInitialized=function(e){return this.sourceBufferManagers_[e].isInitialized()},t.prototype.initialize=function(e){this.sourceBufferManagers_[e].initialize()},t.prototype.mime=function(e){
return this.sourceBufferManagers_[e].mime},t.prototype.getBitrates=function(e){return this.sourceBufferManagers_[e].bitrates},t.prototype.identifyNextFragment=function(e,t){return this.sourceBufferManagers_[e].identifyNextFragment(t)},t.prototype.resetAll=function(e){for(var t=0;t<this.sourceBufferManagers_.length;t++)this.sourceBufferManagers_[t].reset(e)},t.prototype.reset=function(e,t){this.sourceBufferManagers_[e].reset(t)},t.prototype.changeQuality=function(e,t){return this.sourceBufferManagers_[e].changeQuality(t);
},t.prototype.endOfStream=function(){if(this.mediaSrc_&&"open"===this.mediaSrc_.readyState){for(var t=!1,i=0;i<this.sourceBufferManagers_.length;i++)if(this.sourceBufferManagers_[i].updating()){t=!0;break}t||(e.log("Ending stream"),this.mediaSrc_.endOfStream())}},t.prototype.absolutizeURL=function(e,t){if(void 0===t&&(t=""),t.match(/^[a-z]*:\/\//))return t;var i;return i="/"==t[0]?e.match(/^[a-z]*:\/\/[^\/]*/)[0]:e.replace(/\/[^\/]*$/,"/"),i+t},t.prototype.displaySourceBuffers=function(t){for(var i=0;i<this.mediaSrc_.sourceBuffers.length;i++){
var n=this.mediaSrc_.sourceBuffers[i];e.dlog(5,t+" SourceBuffer["+n.mime+"]: "+n.active)}},t.prototype.normalizeRepresentation=function(t){var i={url:this.absolutizeURL(this.manifest_.manifestURL,t.baseURLs[0]),bandwidth:t.bandwidth,width:t.width,height:t.height,sps:t.sps,pps:t.pps,audio_codec_private_data:t.audio_codec_private_data,audio_sample_rate:t.audio_sample_rate};if(this.type===e.StreamingType.SMOOTH_STREAMING)return i.segs=t.segs,i;var n=null;if(null!=t.segmentList){n=t.segmentList.initialization,
i.segs=[];for(var s=0;s<t.segmentList.segmentURLs.length;s++){var a=t.segmentList.segmentURLs[s],r={start:a.mediaRange.start,end:a.mediaRange.end,index:a.indexRange&&a.indexRange.end||null,time:t.segmentList.durationSeconds*s,duration:t.segmentList.durationSeconds,subsegments:null};i.segs.push(r)}}else if(null!=t.segmentTemplate){i.segs=[];var o=t.segmentTemplate.duration/t.segmentTemplate.timescale,r={url:i.url+t.segmentTemplate.initialization.replace("$RepresentationID$",t.id)};i.segs.push(r);for(var l=0;l*o<this.manifest_.duration;l++){
var r={start:-1,end:-1,index:null,time:l*o,duration:o,subsegments:null,url:i.url+t.segmentTemplate.media.replace("$RepresentationID$",t.id).replace("$Number$",l)};i.segs.push(r)}}else{var r={start:null,end:null,index:null,time:0,duration:this.manifest_.duration,subsegments:null};if(null!=t.segmentBase){var a=t.segmentBase;n=a.initialization,null!=a.indexRange&&(i.indexRequestData=a.indexRange)}i.segs=[r]}return this.type!==e.StreamingType.SMOOTH_STREAMING&&(i.initRequestData={start:n&&n.start||0,
end:n&&n.end||i.segs[0].index||null}),i},t.prototype.onSourceOpen=function(t,i,n){e.dlog(2,"onSourceOpen()");var s,a,r,o,l=this.video_;if(this.mediaSrc_.sourceBuffers.length)for(e.dlog(2,"onSourceOpen(): Target already has buffers, bailing."),r=0;r<this.mediaSrc_.sourceBuffers.length;r++)this.mediaSrc_.sourceBuffers[r].active=!0;else{for(this.mediaSrc_.duration=this.manifest_.duration,this.sourceBufferManagers_=[],this.emeMgr_=new e.EMEManager(l),this.type=this.manifest_.type,this.pr=this.manifest_.pr,
r=0;r<this.manifest_.adaptationSets.length;r++)if(o=this.manifest_.adaptationSets[r],!(o.mime&&o.mime.indexOf("webm")>=0)){o.contentProtection&&this.emeMgr_.init(o.contentProtection,options.flavor),s=o.representations.map(this.normalizeRepresentation.bind(this)),a=this.mediaSrc_.addSourceBuffer(o.mime+'; codecs="'+o.codecs+'"'),e.dlog(2,"Buffer added properly: "+(this.mediaSrc_.sourceBuffers[r]===a));var c=new e.SourceBufferManager(this.mediaSrc_,a,s,o.mime,this.type,this.pr);o.mime.indexOf("video")>=0&&(this.videoSrcBufIndex_=r),
this.sourceBufferManagers_.push(c),e.dlog(2,"onSourceOpen. Initialized SourceBuffer["+o.mime+"]")}i()}},t.prototype.isSupported=function(e){return null==window.MediaSource&&null==window.WebKitMediaSource?!1:(null==window.MediaSource&&(window.MediaSource=window.WebKitMediaSource),!0)},t.prototype.init=function(){this.mediaSrc_=new MediaSource},t.prototype.attach=function(e,t,i,n){if(!this.mediaSrc_)throw new Error("MediaSourceManager has not been initialized, please call init()");this.manifest_=t,
this.video_=e,this.attachHandler_("sourceopen",this.onSourceOpen.bind(this,i,n)),this.attachHandler_("webkitsourceopen",this.onSourceOpen.bind(this,i,n)),this.createAndSetObjectURL_(e,this.mediaSrc_)},t.prototype.createAndSetObjectURL_=function(e,t){this.revokeObjectURL_(),this.videoURL=window.URL.createObjectURL(t),e.src=this.videoURL},t.prototype.revokeObjectURL_=function(){this.videoURL&&(window.URL.revokeObjectURL(this.videoURL),this.videoURL=null)},t.prototype.attachHandler_=function(e,t){this.attachedHandlers_[e]||(this.attachedHandlers_[e]=[]),
this.attachedHandlers_[e].push(t),this.mediaSrc_.addEventListener(e,t)},t.prototype.detachAllHandlers_=function(){var e,t=this.attachedHandlers_,i=this.mediaSrc_;for(var n in t){e=t[n];for(var s=0;s<e.length;s++)i.removeEventListener(n,e[s]);e.length=0}},e.MediaSourceManager=t}(),function(){var t=0,i=1,n=function(e){if(null==e)throw new Error("A url for the manifest is required");this.url_=e,this.callback_=null,this.manifest_=null};n.prototype.load=function(t){if(null==t)throw new Error("A callback is required");
this.callback_=t,this.requestManifest_(),e.dlog(1,"Sent request to get the manifest")},n.prototype.getManifest=function(){return this.manifest_},n.prototype.manifestType_=function(){return-1!=this.url_.lastIndexOf(".mpd")?t:i},n.prototype.requestManifest_=function(){var e=new XMLHttpRequest;e.addEventListener("load",this.onManifestLoad_.bind(this)),e.addEventListener("error",this.onManifestError_.bind(this)),e.open("GET",this.url_),e.send()},n.prototype.onManifestError_=function(t){var i="Error retrieving manifest from "+this.url_;
return e.log(i),this.callback_(i)},n.prototype.onManifestLoad_=function(n){e.dlog(2,"Manifest received");var s=null;if(n.target.status<200||n.target.status>299)return s="HTTP error "+n.target.status+" retrieving manifest from "+this.url_,e.log(s),this.callback_(s);switch(this.manifestType_()){case t:this.manifest_=e.parseDASHManifest(n.target.responseText,this.url_);break;case i:this.manifest_=e.parseSSManifest(n.target.responseText,this.url_)}return null===this.manifest_?(s="Error parsing the manifest",
e.log(s),this.callback_(s)):this.callback_(s,this.manifest_)},e.ManifestLoader=n}(),function(){var t=.99,i=.98,n=5e5,s=5e5,a=function(e,t,i){this.bitrates_=e,this.levelCount_=this.bitrates_.length,this.algorithm_=t||"adaptive",this.cooldownPeriod_=2,i&&(this.level_=parseInt(i))};a.prototype.onBandwithTracking=function(a){var r=a.target;if(null!=r.lastTime&&a.timeStamp!=r.lastTime){var o=8e3*(a.loaded-r.lastSize)/(a.timeStamp-r.lastTime);n=t*n+(1-t)*o,s=i*s+(1-i)*o}r.lastTime=a.timeStamp,r.lastSize=a.loaded,
e.dlog(5,"Calculated bandwidth: "+n+" "+s)},a.prototype.adapt=function(t){if(!this.bitrates_||this.bitrates_.length<=1)return-1;var i=-1;if("fixed"===this.algorithm_)i=this.level_;else if("random"===this.algorithm_)Math.random()>.5&&(i=Math.floor(Math.random()*this.levelCount_));else if("adaptive"===this.algorithm_)if(this.cooldownPeriod_)this.cooldownPeriod_--;else{var a=0,r=0,o=.85,l=Math.min(n,s);e.dlog(5,"Calculated Bandwidth: "+l+" globalSlowBandwidth: "+n+" globalFastBandwidth: "+s);for(var c=0;c<this.bitrates_.length;c++){
var u=this.bitrates_[c];u>a&&o*l-128e3>u&&(a=u,r=c)}if(r!==t)return e.dlog(2,"Selected new rate "+a+" for bandwidth "+l+" (from "+n+", "+s+")"),this.cooldownPeriod_=8,r}return t!==i&&-1!==i?(e.dlog(2,"Selected new bitrate level: "+i),i):-1},e.AdaptiveManager=a}(),function(){var t=function(e,t,i){this.mediaSrcMgr_=e,this.bufferIndex_=t,this.adaptiveManager_=i,this.fragmentRequest_=null};t.prototype.appendInit=function(){e.dlog(2,"Appending init ["+this.mediaSrcMgr_.mime(this.bufferIndex_)+"]: "+this.mediaSrcMgr_.getLevel(this.bufferIndex_)),
this.mediaSrcMgr_.initialize(this.bufferIndex_),this.mediaSrcMgr_.append(this.bufferIndex_,this.mediaSrcMgr_.getCurrentRep(this.bufferIndex_).initFragment)},t.prototype.onXHRAbort=function(t){e.log("Received abort of XHR.")},t.prototype.onXHRError=function(t){return this.fragmentRequest_!==t.target?void e.log("Received error of untracked XHR."):(e.log("Received error of XHR."),void(this.fragmentRequest_=null))},t.prototype.onXHRLoad=function(t){this.fragmentRequest_!==t.target&&e.log("Error, HTTP response for unknown request");
var i=this.fragmentRequest_;return this.fragmentRequest_=null,i.readyState==i.DONE?i.status>=300?void e.log("HTTP Request failure, status="+i.status):(i.is_index&&(e.dlog(2,"Index Response"),this.mediaSrcMgr_.getCurrentRep(this.bufferIndex_).segs=e.parseSIDX(i.response,i.startByte)),i.is_init?(e.dlog(2,"Init Response"),this.mediaSrcMgr_.getCurrentRep(this.bufferIndex_).initFragment=e.extractInit(i.response),void(this.mediaSrcMgr_.isInitialized(this.bufferIndex_)||this.appendInit())):void this.mediaSrcMgr_.appendData(this.bufferIndex_,i.response)):void 0;
},t.prototype.cancelRequests=function(){null!=this.fragmentRequest_&&(this.fragmentRequest_.abort(),this.fragmentRequest_=null)},t.prototype.makeSSXHR=function(){var t=new XMLHttpRequest,i=this.mediaSrcMgr_.getSegIndex(this.bufferIndex_),n=this.mediaSrcMgr_.getCurrentRep(this.bufferIndex_).url,s=this.mediaSrcMgr_.getCurrentRep(this.bufferIndex_).bandwidth,a=this.mediaSrcMgr_.getCurrentRep(this.bufferIndex_).segs[i].timeURL;if(n=n.replace("{bitrate}",s),n=n.replace("{start time}",a),t.open("GET",n),
t.responseType="arraybuffer",t.addEventListener("load",this.onXHRLoad.bind(this)),t.addEventListener("error",this.onXHRError.bind(this)),t.addEventListener("abort",this.onXHRAbort.bind(this)),null==n)throw"Null URL";return t.is_init=!1,t.is_index=!1,t.lastTime=null,t.lastSize=null,t.addEventListener("progress",this.adaptiveManager_.onBandwithTracking.bind(this.adaptiveManager_)),t.send(),e.dlog(2,"Sent XHR: url="+n),t},t.prototype.makeXHR=function(t){var i,n,s=new XMLHttpRequest,a=this.mediaSrcMgr_.getSegIndex(this.bufferIndex_),r=this.mediaSrcMgr_.getCurrentRep(this.bufferIndex_),o=this.mediaSrcMgr_.getCurrentRep(this.bufferIndex_).url,l=this.mediaSrcMgr_.getCurrentRep(this.bufferIndex_).segs[a],c=!1;
null==a&&(a=0),null!=this.mediaSrcMgr_.getCurrentRep(this.bufferIndex_).segs[a].url&&(o=this.mediaSrcMgr_.getCurrentRep(this.bufferIndex_).segs[a].url),t?(i=0,n=r.initRequestData.end,null!=r.indexRequestData&&(n=r.indexRequestData.end,c=!0)):(i=l.offset,n=l.offset+l.size-1);var u=null;null!=i&&null!=n&&(u="bytes="+i+"-"+n);var d=!!/youtube.com/.exec(o);if(u&&d&&(o=o.replace(/&range=[^&]*/,""),o+="&range="+u.substring(6)),s.open("GET",o),s.responseType="arraybuffer",s.startByte=i,null==u||d||s.setRequestHeader("Range",u),
s.addEventListener("load",this.onXHRLoad.bind(this)),null==o)throw"Null URL";return s.is_init=t,s.is_index=c,s.lastTime=null,s.lastSize=null,s.addEventListener("progress",this.adaptiveManager_.onBandwithTracking.bind(this.adaptiveManager_)),s.send(),e.dlog(2,"Sent XHR: url="+o+", range="+u),s},t.prototype.findRangeForPlaybackTime=function(e,t){for(var i=e.buffered,n=0;n<i.length;n++)if(i.start(n)<=t&&i.end(n)>=t)return{start:i.start(n),end:i.end(n)}},t.prototype.initFragmentRequestNeeded=function(){
if(null==this.mediaSrcMgr_.getCurrentRep(this.bufferIndex_).initFragment){e.dlog(2,"Creating Init segment["+this.mediaSrcMgr_.mime(this.bufferIndex_)+"]");var t=this.mediaSrcMgr_.getCurrentRep(this.bufferIndex_);if(this.mediaSrcMgr_.type===e.StreamingType.SMOOTH_STREAMING){var i={pps:t.pps,sps:t.sps,width:t.width,height:t.height,mime:this.mediaSrcMgr_.mime(this.bufferIndex_),pr:this.mediaSrcMgr_.pr,audio_codec_private_data:t.audio_codec_private_data,audio_sample_rate:t.audio_sample_rate},n=e.createSSInit(i);
return this.mediaSrcMgr_.getCurrentRep(this.bufferIndex_).initFragment=e.extractInit(n.data),this.appendInit(),!1}return this.fragmentRequest_=this.makeXHR(!0),!0}return this.mediaSrcMgr_.isInitialized(this.bufferIndex_)||this.appendInit(),!1},t.prototype.requestNextFragment=function(t,i){this.mediaSrcMgr_.type===e.StreamingType.SMOOTH_STREAMING?this.fragmentRequest_=this.makeSSXHR():this.fragmentRequest_=this.makeXHR(!1),this.fragmentRequest_.expected_time=i},t.prototype.tick=function(t){if(!this.mediaSrcMgr_.isActive(this.bufferIndex_))return e.dlog(4,"Not active["+this.mediaSrcMgr_.mime(this.bufferIndex_)+"]"),
!1;if(this.fragmentRequest_)e.dlog(4,"Will not request next segment["+this.mediaSrcMgr_.mime(this.bufferIndex_)+"] request pending");else if(!this.initFragmentRequestNeeded()){var i=this.mediaSrcMgr_.identifyNextFragment(this.bufferIndex_,t);if(null!==i){var n=-1;this.mediaSrcMgr_.mime(this.bufferIndex_).indexOf("video")>=0&&(n=this.adaptiveManager_.adapt(this.mediaSrcMgr_.getLevel(this.bufferIndex_))),n>=0?(this.cancelRequests(),this.mediaSrcMgr_.changeQuality(this.bufferIndex_,n)):this.requestNextFragment(t,i);
}}return!0},e.FragmentManager=t}(),function(){function t(e){var t=new RegExp("[?&]"+e+"=([^&]*)"),i=t.exec(window.location.search);return null!=i?(i=i[1],/%/.exec(i)&&(i=decodeURIComponent(i)),i):null}function i(){for(var e={},i=["autoplay","algorithm","flavor","level","cc","url"],n=0;n<i.length;n++){var s=t(i[n]);e[i[n]]=s}if(e&&e.url)for(var a in e)e.hasOwnProperty(a)&&(this.options[a]=e[a])}var n={Audio_Type:"audio",Video_Type:"video",Image_Type:"img",MSE_Type:"mse"},s=function(t){t||(t={}),this.options=t,
this.mediaElementType_=null,this.manifestLoader_=null,this.closeCaptionsLoader_=null,this.progressTimer_=null,this.mediaSrcMgr_=new e.MediaSourceManager,this.fragmentManagers_=null,this.showControls_=t.showControls,this.mediaElement_=null,this.imageElement_=null,this.mediaEvents_=new Object,t.mediaElement?this.mediaElement_=t.mediaElement:t.imageElement?this.imageElement_=t.imageElement:this.createMediaElement(),e.player=this},a={AUTO_PAUSE_START:1,PAUSE_RESUME:5};s.prototype.destroy=function(){return this.destroyed_?void e.log("Refusing to destroy a second time"):(this.removeAllMediaEventListeners(),
this.mediaElementType_!==n.Image_Type&&this.mediaElement_.pause(),this.mediaElementType_===n.MSE_Type&&this.stopProgressTimer(),this.mediaSrcMgr_&&this.mediaSrcMgr_.destroy(),delete e.player,delete this.mediaElement_,delete this.imageElement_,void(this.destroyed_=!0))},s.prototype.getMediaElement=function(){return this.mediaElement_},s.prototype.onPause=function(t){e.log("Paused, auto="+this.mediaElement_.autopause_pending),this.mediaElement_.autopaused=this.mediaElement_.autopause_pending,this.mediaElement_.autopause_time=(new Date).getTime(),
this.mediaElement_.autopause_pending=!1},s.prototype.onPlay=function(t){e.log("Playing"),this.mediaElement_.autopause_pending=!1,this.mediaElement_.autopaused=!1,this.mediaElement_.autopause_time=null},s.prototype.onError=function(t){e.log("Error ("+this.mediaElement_.error.code+")")},s.prototype.cancelRequests=function(){for(var e=0;e<this.fragmentManagers_.length;e++)this.fragmentManagers_[e].cancelRequests()},s.prototype.onSeeking=function(t){e.log("Seeking"),this.cancelRequests(),this.mediaSrcMgr_.resetAll("seeking");
},s.prototype.onSeeked=function(t){e.log("Seeked")},s.prototype.onProgress=function(){var t=this.mediaSrcMgr_.getMediaSource();if(!t||"closed"===t.readyState)return void this.stopProgressTimer();var i=this.mediaElement_.currentTime;if(this.mediaElement_.error)return void e.dlog(2,"Video Error: "+this.mediaElement_.error);for(var n=!1,s=0,r=0,o=0;o<this.fragmentManagers_.length;o++)if(this.fragmentManagers_[o].tick(i)){var l=this.mediaSrcMgr_.getBufferSize(o,i);this.mediaElement_.paused?l>=a.PAUSE_RESUME&&r++:l<a.AUTO_PAUSE_START&&(n=!0);
}else s++;return s>0?void(s===this.fragmentManagers_.length&&this.mediaSrcMgr_.endOfStream()):void(this.mediaElement_.paused?this.mediaElement_.autopaused&&r===this.fragmentManagers_.length&&(e.dlog(2,"Autoresuming"),this.mediaElement_.play()):n&&(e.dlog(2,"Autopausing"),this.mediaElement_.autopause_pending=!0,this.mediaElement_.pause()))},s.prototype.createMediaElement=function(){var t=document.getElementById("mediaElement");this.mediaElement_=document.createElement(n.Video_Type),this.imageElement_=document.createElement(n.Image_Type),
t.appendChild(this.mediaElement_),t.appendChild(this.imageElement_),e.me=this.mediaElement_,e.img=this.imageElement_,this.showControls_?this.mediaElement_.hasAttribute("controls")||this.mediaElement_.setAttribute("controls","controls"):this.mediaElement_.hasAttribute("controls")&&this.mediaElement_.removeAttribute("controls")},s.prototype.showMediaElement=function(t){var i=document.getElementById("mediaElement");this.mediaElementType_===n.MSE_Type&&(this.removeMediaEventListener("seeking"),this.removeMediaEventListener("seeked"),
this.removeMediaEventListener("pause"),this.removeMediaEventListener("play"),this.removeMediaEventListener("error"),t!==n.MSE_Type&&(this.stopProgressTimer(),this.mediaSrcMgr_.destroy(),this.mediaSrcMgr_=new e.MediaSourceManager)),this.mediaElementType_!==n.Image_Type&&(this.mediaElement_.play(0),this.mediaElement_.pause());var s=i.children;if(s&&s.length>0)for(var a=0;a<s.length;a++)"VIDEO"===s[a].nodeName&&t!==n.Image_Type?s[a].style.display="block":"IMG"===s[a].nodeName&&t===n.Image_Type?s[a].style.display="block":(s[a].style.display="none",
s[a].src=null);this.mediaElementType_=t},s.prototype.addMediaEventListener=function(e,t){var i=t.bind(this);this.mediaElement_.addEventListener(e,i),this.mediaEvents_[e]=i},s.prototype.removeMediaEventListener=function(e){this.mediaElement_.removeEventListener(e,this.mediaEvents_[e]),this.mediaEvents_[e]=null},s.prototype.removeAllMediaEventListeners=function(){for(var e in this.mediaEvents_)e&&this.removeMediaEventListener(e)},s.prototype.initMseVideoElement=function(e){e&&this.addCaptionInfo(e),
this.addMediaEventListener("seeking",this.onSeeking),this.addMediaEventListener("seeked",this.onSeeked),this.addMediaEventListener("pause",this.onPause),this.addMediaEventListener("play",this.onPlay),this.addMediaEventListener("error",this.onError),this.mediaElement_.autopause_pending=!1,this.options.autoplay?this.mediaElement_.autopaused=!0:this.mediaElement_.autopaused=!1,this.mediaElement_.seekingStatus="none"},s.prototype.onManifestLoad=function(t){return this.destroyed_?void e.log("Ignoring manifest load after destruction"):t?void e.log("Unable to load manifest"):void(this.options.cc?(this.closeCaptionsLoader_=new e.CloseCaptionsLoader(this.options.cc),
this.closeCaptionsLoader_.load(this.onLoadcloseCaptions.bind(this))):this.onLoadcloseCaptions.call(this))},s.prototype.addCaptionInfo=function(e){var t;t=this.mediaElement_.textTracks.length>0?this.mediaElement_.textTracks[0]:this.mediaElement_.addTextTrack("captions"),t.mode="showing";for(var i=e[0].start,n=e[0].end,s=[],a=0;a<e.length;a++){var r=new TextTrackCue(e[a].start,e[a].end,e[a].caption);if(i===e[a].start&&n===e[a].end&&s.push(r),i!==e[a].start||n!==e[a].end||a===e.length-1){for(var o=s.length-1;o>=0;o--)t.addCue(s[o]);
s.length=0,i=e[a].start,n=e[a].end,a<e.length&&s.push(r)}}},s.prototype.onMediaSourceManagerInitialized=function(t){if(this.destroyed_)return void e.log("Ignoring MediaSourceManager initialization after destruction");this.initMseVideoElement(t);for(var i=0;i<this.mediaSrcMgr_.getSourceBufferCount();i++)this.fragmentManagers_.push(new e.FragmentManager(this.mediaSrcMgr_,i,new e.AdaptiveManager(this.mediaSrcMgr_.getBitrates(i),this.options.algorithm,this.options.level)));this.startProgressTimer()},
s.prototype.initializeMsePlayer=function(e){var t=null;this.closeCaptionsLoader_&&(t=this.closeCaptionsLoader_.getCCInfo()),this.fragmentManagers_=[],this.mediaSrcMgr_.init(),this.mediaSrcMgr_.attach(this.mediaElement_,this.manifestLoader_.getManifest(),t,this.onMediaSourceManagerInitialized.bind(this,t))},s.prototype.stopProgressTimer=function(){null!==this.progressTimer_&&(e.dlog(2,"Deregistering progress timer"),window.clearInterval(this.progressTimer_),this.progressTimer_=null)},s.prototype.startProgressTimer=function(){
null===this.progressTimer_&&(e.dlog(2,"Starting progress timer"),this.progressTimer_=setInterval(this.onProgress.bind(this),250))},s.prototype.initializeSimplePlayer=function(e,t){e!==n.Image_Type?(this.mediaElement_.src=t,this.mediaElement_.play()):this.imageElement_.src=t},s.prototype.onLoadcloseCaptions=function(t){return this.destroyed_?void e.log("Ignoring close captions load after destruction"):t?void e.log("Unable to load close captions"):void this.initializeMsePlayer()},s.prototype.onManifestLoad=function(t){
return this.destroyed_?void e.log("Ignoring manifest load after destruction"):t?void e.log("Unable to load manifest"):void(this.options.cc?(this.closeCaptionsLoader_=new e.CloseCaptionsLoader(this.options.cc),this.closeCaptionsLoader_.load(this.onLoadcloseCaptions.bind(this))):this.onLoadcloseCaptions.call(this))},s.prototype.getMediaType=function(t){var i=t.length;if(5>i)return e.log("Error invalid url"),null;var s=t.substring(t.length-4,t.length);switch(s){case".webm":case".mkv":case".mp4":return n.Video_Type;
case".mp3":return n.Audio_Type;case".jpg":return n.Image_Type;case".mpd":return n.MSE_Type;default:return n.MSE_Type}},s.prototype.init=function(){if(e.log("-------- Initializing --------"),!this.mediaSrcMgr_.isSupported())return e.log("Incompatible browser: Media Source extensions not suported"),!1;if(i(),!this.options.url)return e.log("No manifest URL found, please provide one"),!1;var t=this.getMediaType(this.options.url);this.mediaElementType_=t,this.options.mediaElement||this.options.imageElement||this.showMediaElement(t),
t===n.MSE_Type?(this.manifestLoader_=new e.ManifestLoader(this.options.url),this.manifestLoader_.load(this.onManifestLoad.bind(this))):this.initializeSimplePlayer(t,this.options.url)},e.BasicPlayer=s}(),window.googledash=e}(),e.exports=googledash},function(e,t){"undefined"==typeof jwplayer&&(jwplayer=function(e){return jwplayer.api?jwplayer.api.selectPlayer(e):void 0},jwplayer.version="6.8.4616",jwplayer.vid=document.createElement("video"),jwplayer.audio=document.createElement("audio"),jwplayer.source=document.createElement("source"),
function(e){function t(e){return function(){return l(e)}}function i(e,t,i,n,s){return function(){var a,o;if(s)i(e);else{try{if((a=e.responseXML)&&(o=a.firstChild,a.lastChild&&"parsererror"===a.lastChild.nodeName))return void(n&&n("Invalid XML"))}catch(l){}if(a&&o)return i(e);(a=r.parseXML(e.responseText))&&a.firstChild?(e=r.extend({},e,{responseXML:a}),i(e)):n&&n(e.responseText?"Invalid XML":t)}}}var n=document,s=window,a=navigator,r=e.utils=function(){};r.exists=function(e){switch(typeof e){case"string":
return 0<e.length;case"object":return null!==e;case"undefined":return!1}return!0},r.styleDimension=function(e){return e+(0<e.toString().indexOf("%")?"":"px")},r.getAbsolutePath=function(e,t){if(r.exists(t)||(t=n.location.href),r.exists(e)){var i;if(r.exists(e)){i=e.indexOf("://");var s=e.indexOf("?");i=i>0&&(0>s||s>i)}else i=void 0;if(i)return e;i=t.substring(0,t.indexOf("://")+3);var a,s=t.substring(i.length,t.indexOf("/",i.length+1));0===e.indexOf("/")?a=e.split("/"):(a=t.split("?")[0],a=a.substring(i.length+s.length+1,a.lastIndexOf("/")),
a=a.split("/").concat(e.split("/")));for(var o=[],l=0;l<a.length;l++)a[l]&&r.exists(a[l])&&"."!=a[l]&&(".."==a[l]?o.pop():o.push(a[l]));return i+s+"/"+o.join("/")}},r.extend=function(){var e=r.extend.arguments;if(1<e.length){for(var t=1;t<e.length;t++)r.foreach(e[t],function(t,i){try{r.exists(i)&&(e[0][t]=i)}catch(n){}});return e[0]}return null};var o=window.console=window.console||{log:function(){}};r.log=function(){var e=Array.prototype.slice.call(arguments,0);"object"==typeof o.log?o.log(e):o.log.apply(o,e);
};var l=r.userAgentMatch=function(e){return null!==a.userAgent.toLowerCase().match(e)};r.isIE=r.isMSIE=t(/msie/i),r.isFF=t(/firefox/i),r.isChrome=t(/chrome/i),r.isIPod=t(/iP(hone|od)/i),r.isIPad=t(/iPad/i),r.isSafari602=t(/Macintosh.*Mac OS X 10_8.*6\.0\.\d* Safari/i),r.isIETrident=function(e){return e?(e=parseFloat(e).toFixed(1),l(RegExp("msie\\s*"+e+"|trident/.+rv:\\s*"+e,"i"))):l(/msie|trident/i)},r.isSafari=function(){return l(/safari/i)&&!l(/chrome/i)&&!l(/chromium/i)&&!l(/android/i)},r.isIOS=function(e){
return l(e?RegExp("iP(hone|ad|od).+\\sOS\\s"+e,"i"):/iP(hone|ad|od)/i)},r.isAndroid=function(e,t){var i=t?!l(/chrome\/[23456789]/i):!0;return e?i&&l(RegExp("android.*"+e,"i")):i&&l(/android/i)},r.isMobile=function(){return r.isIOS()||r.isAndroid()},r.saveCookie=function(e,t){n.cookie="jwplayer."+e+"="+t+"; path=/"},r.getCookies=function(){for(var e={},t=n.cookie.split("; "),i=0;i<t.length;i++){var s=t[i].split("=");0===s[0].indexOf("jwplayer.")&&(e[s[0].substring(9,s[0].length)]=s[1])}return e},r.typeOf=function(e){
var t=typeof e;return"object"===t?e?e instanceof Array?"array":t:"null":t},r.translateEventResponse=function(t,i){var n=r.extend({},i);if(t!=e.events.JWPLAYER_FULLSCREEN||n.fullscreen)if("object"==typeof n.data){var s=n.data;delete n.data,n=r.extend(n,s)}else"object"==typeof n.metadata&&r.deepReplaceKeyName(n.metadata,["__dot__","__spc__","__dsh__","__default__"],["."," ","-","default"]);else n.fullscreen="true"==n.message?!0:!1,delete n.message;return r.foreach(["position","duration","offset"],function(e,t){
n[t]&&(n[t]=Math.round(1e3*n[t])/1e3)}),n},r.flashVersion=function(){if(r.isAndroid())return 0;var e,t=a.plugins;try{if("undefined"!==t&&(e=t["Shockwave Flash"]))return parseInt(e.description.replace(/\D+(\d+)\..*/,"$1"),10)}catch(i){}if("undefined"!=typeof s.ActiveXObject)try{if(e=new s.ActiveXObject("ShockwaveFlash.ShockwaveFlash"))return parseInt(e.GetVariable("$version").split(" ")[1].split(",")[0],10)}catch(n){}return 0},r.getScriptPath=function(e){for(var t=n.getElementsByTagName("script"),i=0;i<t.length;i++){
var s=t[i].src;if(s&&0<=s.indexOf(e))return s.substr(0,s.indexOf(e))}return""},r.deepReplaceKeyName=function(t,i,n){switch(e.utils.typeOf(t)){case"array":for(var s=0;s<t.length;s++)t[s]=e.utils.deepReplaceKeyName(t[s],i,n);break;case"object":r.foreach(t,function(s,a){var r;if(i instanceof Array&&n instanceof Array){if(i.length!=n.length)return;r=i}else r=[i];for(var o=s,l=0;l<r.length;l++)o=o.replace(RegExp(i[l],"g"),n[l]);t[o]=e.utils.deepReplaceKeyName(a,i,n),s!=o&&delete t[s]})}return t};var c=r.pluginPathType={
ABSOLUTE:0,RELATIVE:1,CDN:2};r.getPluginPathType=function(e){if("string"==typeof e){e=e.split("?")[0];var t=e.indexOf("://");if(t>0)return c.ABSOLUTE;var i=e.indexOf("/");return e=r.extension(e),!(0>t&&0>i)||e&&isNaN(e)?c.RELATIVE:c.CDN}},r.getPluginName=function(e){return e.replace(/^(.*\/)?([^-]*)-?.*\.(swf|js)$/,"$2")},r.getPluginVersion=function(e){return e.replace(/[^-]*-?([^\.]*).*$/,"$1")},r.isYouTube=function(e){return/^(http|\/\/).*(youtube\.com|youtu\.be)\/.+/.test(e)},r.youTubeID=function(e){
try{return/v[=\/]([^?&]*)|youtu\.be\/([^?]*)|^([\w-]*)$/i.exec(e).slice(1).join("").replace("?","")}catch(t){return""}},r.isRtmp=function(e,t){return 0===e.indexOf("rtmp")||"rtmp"==t},r.foreach=function(e,t){var i,n;for(i in e)"function"==r.typeOf(e.hasOwnProperty)?e.hasOwnProperty(i)&&(n=e[i],t(i,n)):(n=e[i],t(i,n))},r.isHTTPS=function(){return 0===s.location.href.indexOf("https")},r.repo=function(){var t="http://p.jwpcdn.com/"+e.version.split(/\W/).splice(0,2).join("/")+"/";try{r.isHTTPS()&&(t=t.replace("http://","https://ssl."));
}catch(i){}return t},r.ajax=function(e,t,n,a){var o;if(0<e.indexOf("#")&&(e=e.replace(/#.*$/,"")),e&&0<=e.indexOf("://")&&e.split("/")[2]!=s.location.href.split("/")[2]&&r.exists(s.XDomainRequest))o=new s.XDomainRequest,o.onload=i(o,e,t,n,a),o.ontimeout=o.onprogress=function(){},o.timeout=5e3;else{if(!r.exists(s.XMLHttpRequest))return n&&n(),o;var l=o=new s.XMLHttpRequest,c=e;o.onreadystatechange=function(){if(4===l.readyState)switch(l.status){case 200:i(l,c,t,n,a)();break;case 404:n("File not found");
}}}return o.overrideMimeType&&o.overrideMimeType("text/xml"),o.onerror=function(){n("Error loading file")},setTimeout(function(){try{o.open("GET",e,!0),o.send()}catch(t){n&&n(e)}},0),o},r.parseXML=function(e){var t;try{if(s.DOMParser){if(t=(new s.DOMParser).parseFromString(e,"text/xml"),t.childNodes&&t.childNodes.length&&"parsererror"==t.childNodes[0].firstChild.nodeName)return}else t=new s.ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(e)}catch(i){return}return t},r.filterPlaylist=function(e,t){
var i,n,s,a,o=[];for(i=0;i<e.length;i++)if(n=r.extend({},e[i]),n.sources=r.filterSources(n.sources),0<n.sources.length){for(s=0;s<n.sources.length;s++)a=n.sources[s],a.label||(a.label=s.toString());o.push(n)}if(t&&0===o.length)for(i=0;i<e.length;i++)if(n=r.extend({},e[i]),n.sources=r.filterSources(n.sources,!0),0<n.sources.length){for(s=0;s<n.sources.length;s++)a=n.sources[s],a.label||(a.label=s.toString());o.push(n)}return o},r.filterSources=function(t,i){var n,s,a=r.extensionmap;if(t){s=[];for(var o=0;o<t.length;o++){
var l=t[o].type,c=t[o].file;c&&(c=r.trim(c)),l||(l=a.extType(r.extension(c)),t[o].type=l),i?e.embed.flashCanPlay(c,l)&&(n||(n=l),l==n&&s.push(r.extend({},t[o]))):r.canPlayHTML5(l)&&(n||(n=l),l==n&&s.push(r.extend({},t[o])))}}return s},r.canPlayHTML5=function(t){return!r.isAndroid()||"hls"!=t&&"m3u"!=t&&"m3u8"!=t?(t=r.extensionmap.types[t],!!t&&!!e.vid.canPlayType&&e.vid.canPlayType(t)):!1},r.seconds=function(e){e=e.replace(",",".");var t=e.split(":"),i=0;return"s"==e.slice(-1)?i=parseFloat(e):"m"==e.slice(-1)?i=60*parseFloat(e):"h"==e.slice(-1)?i=3600*parseFloat(e):1<t.length?(i=parseFloat(t[t.length-1]),
i+=60*parseFloat(t[t.length-2]),3==t.length&&(i+=3600*parseFloat(t[t.length-3]))):i=parseFloat(e),i},r.serialize=function(e){return null==e?null:"true"==e.toString().toLowerCase()?!0:"false"==e.toString().toLowerCase()?!1:isNaN(Number(e))||5<e.length||0===e.length?e:Number(e)}}(jwplayer),function(e){var t="video/",i=e.foreach,n={mp4:t+"mp4",vorbis:"audio/ogg",ogg:t+"ogg",webm:t+"webm",aac:"audio/mp4",mp3:"audio/mpeg",hls:"application/vnd.apple.mpegurl"},s={mp4:n.mp4,f4v:n.mp4,m4v:n.mp4,mov:n.mp4,
m4a:n.aac,f4a:n.aac,aac:n.aac,mp3:n.mp3,ogv:n.ogg,ogg:n.vorbis,oga:n.vorbis,webm:n.webm,m3u8:n.hls,hls:n.hls},t="video",t={flv:t,f4v:t,mov:t,m4a:t,m4v:t,mp4:t,aac:t,f4a:t,mp3:"sound",smil:"rtmp",m3u8:"hls",hls:"hls"},a=e.extensionmap={};i(s,function(e,t){a[e]={html5:t}}),i(t,function(e,t){a[e]||(a[e]={}),a[e].flash=t}),a.types=n,a.mimeType=function(e){var t;return i(n,function(i,n){!t&&n==e&&(t=i)}),t},a.extType=function(e){return a.mimeType(s[e])}}(jwplayer.utils),function(e){var t=e.loaderstatus={
NEW:0,LOADING:1,ERROR:2,COMPLETE:3},i=document;e.scriptloader=function(n){function s(){r=t.ERROR,l.sendEvent(o.ERROR)}function a(){r=t.COMPLETE,l.sendEvent(o.COMPLETE)}var r=t.NEW,o=jwplayer.events,l=new o.eventdispatcher;e.extend(this,l),this.load=function(){var l=e.scriptloader.loaders[n];if(!l||l.getStatus()!=t.NEW&&l.getStatus()!=t.LOADING){if(e.scriptloader.loaders[n]=this,r==t.NEW){r=t.LOADING;var c=i.createElement("script");c.addEventListener?(c.onload=a,c.onerror=s):c.readyState&&(c.onreadystatechange=function(){
("loaded"==c.readyState||"complete"==c.readyState)&&a()}),i.getElementsByTagName("head")[0].appendChild(c),c.src=n}}else l.addEventListener(o.ERROR,s),l.addEventListener(o.COMPLETE,a)},this.getStatus=function(){return r}},e.scriptloader.loaders={}}(jwplayer.utils),function(e){e.trim=function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},e.pad=function(e,t,i){for(i||(i="0");e.length<t;)e=i+e;return e},e.xmlAttribute=function(e,t){for(var i=0;i<e.attributes.length;i++)if(e.attributes[i].name&&e.attributes[i].name.toLowerCase()==t.toLowerCase())return e.attributes[i].value.toString();
return""},e.extension=function(e){return e&&"rtmp"!=e.substr(0,4)?(e=e.substring(e.lastIndexOf("/")+1,e.length).split("?")[0].split("#")[0],-1<e.lastIndexOf(".")?e.substr(e.lastIndexOf(".")+1,e.length).toLowerCase():void 0):""},e.stringToColor=function(e){return e=e.replace(/(#|0x)?([0-9A-F]{3,6})$/gi,"$2"),3==e.length&&(e=e.charAt(0)+e.charAt(0)+e.charAt(1)+e.charAt(1)+e.charAt(2)+e.charAt(2)),parseInt(e,16)}}(jwplayer.utils),function(e){var t="touchmove",i="touchstart";e.touch=function(n){function s(e){
e.type==i?(l=!0,u=r(h.DRAG_START,e)):e.type==t?l&&(d||(a(h.DRAG_START,e,u),d=!0),a(h.DRAG,e)):(l&&(d?a(h.DRAG_END,e):(e.cancelBubble=!0,a(h.TAP,e))),l=d=!1,u=null)}function a(e,t,i){c[e]&&(t.preventManipulation&&t.preventManipulation(),t.preventDefault&&t.preventDefault(),t=i?i:r(e,t))&&c[e](t)}function r(e,t){var i=null;if(t.touches&&t.touches.length?i=t.touches[0]:t.changedTouches&&t.changedTouches.length&&(i=t.changedTouches[0]),!i)return null;var n=o.getBoundingClientRect(),i={type:e,target:o,
x:i.pageX-window.pageXOffset-n.left,y:i.pageY,deltaX:0,deltaY:0};return e!=h.TAP&&u&&(i.deltaX=i.x-u.x,i.deltaY=i.y-u.y),i}var o=n,l=!1,c={},u=null,d=!1,h=e.touchEvents;return document.addEventListener(t,s),document.addEventListener("touchend",function(e){l&&d&&a(h.DRAG_END,e),l=d=!1,u=null}),document.addEventListener("touchcancel",s),n.addEventListener(i,s),n.addEventListener("touchend",s),this.addEventListener=function(e,t){c[e]=t},this.removeEventListener=function(e){delete c[e]},this}}(jwplayer.utils),
function(e){e.touchEvents={DRAG:"jwplayerDrag",DRAG_START:"jwplayerDragStart",DRAG_END:"jwplayerDragEnd",TAP:"jwplayerTap"}}(jwplayer.utils),function(e){e.key=function(t){var i,n,s;this.edition=function(){return s&&s.getTime()<(new Date).getTime()?"invalid":i},this.token=function(){return n},e.exists(t)||(t="");try{t=e.tea.decrypt(t,"36QXq4W@GSBV^teR");var a=t.split("/");(i=a[0])?/^(free|pro|premium|ads)$/i.test(i)?(n=a[1],a[2]&&0<parseInt(a[2])&&(s=new Date,s.setTime(String(a[2])))):i="invalid":i="free";
}catch(r){i="invalid"}}}(jwplayer.utils),function(e){var t=e.tea={};t.encrypt=function(e,s){if(0==e.length)return"";var a=t.strToLongs(n.encode(e));1>=a.length&&(a[1]=0);for(var r,o=t.strToLongs(n.encode(s).slice(0,16)),l=a.length,c=a[l-1],u=a[0],d=Math.floor(6+52/l),h=0;0<d--;){h+=2654435769,r=h>>>2&3;for(var p=0;l>p;p++)u=a[(p+1)%l],c=(c>>>5^u<<2)+(u>>>3^c<<4)^(h^u)+(o[3&p^r]^c),c=a[p]+=c}return a=t.longsToStr(a),i.encode(a)},t.decrypt=function(e,s){if(0==e.length)return"";for(var a,r=t.strToLongs(i.decode(e)),o=t.strToLongs(n.encode(s).slice(0,16)),l=r.length,c=r[l-1],u=r[0],d=2654435769*Math.floor(6+52/l);0!=d;){
a=d>>>2&3;for(var h=l-1;h>=0;h--)c=r[h>0?h-1:l-1],c=(c>>>5^u<<2)+(u>>>3^c<<4)^(d^u)+(o[3&h^a]^c),u=r[h]-=c;d-=2654435769}return r=t.longsToStr(r),r=r.replace(/\0+$/,""),n.decode(r)},t.strToLongs=function(e){for(var t=Array(Math.ceil(e.length/4)),i=0;i<t.length;i++)t[i]=e.charCodeAt(4*i)+(e.charCodeAt(4*i+1)<<8)+(e.charCodeAt(4*i+2)<<16)+(e.charCodeAt(4*i+3)<<24);return t},t.longsToStr=function(e){for(var t=Array(e.length),i=0;i<e.length;i++)t[i]=String.fromCharCode(255&e[i],e[i]>>>8&255,e[i]>>>16&255,e[i]>>>24&255);
return t.join("")};var i={code:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e,t){var s,a,r,o,l,c,u=[],d="",h=i.code;if(c=("undefined"==typeof t?0:t)?n.encode(e):e,l=c.length%3,l>0)for(;3>l++;)d+="=",c+="\x00";for(l=0;l<c.length;l+=3)s=c.charCodeAt(l),a=c.charCodeAt(l+1),r=c.charCodeAt(l+2),o=s<<16|a<<8|r,s=o>>18&63,a=o>>12&63,r=o>>6&63,o&=63,u[l/3]=h.charAt(s)+h.charAt(a)+h.charAt(r)+h.charAt(o);return u=u.join(""),u=u.slice(0,u.length-d.length)+d},decode:function(e,t){
t="undefined"==typeof t?!1:t;var s,a,r,o,l,c,u=[],d=i.code;c=t?n.decode(e):e;for(var h=0;h<c.length;h+=4)s=d.indexOf(c.charAt(h)),a=d.indexOf(c.charAt(h+1)),o=d.indexOf(c.charAt(h+2)),l=d.indexOf(c.charAt(h+3)),r=s<<18|a<<12|o<<6|l,s=r>>>16&255,a=r>>>8&255,r&=255,u[h/4]=String.fromCharCode(s,a,r),64==l&&(u[h/4]=String.fromCharCode(s,a)),64==o&&(u[h/4]=String.fromCharCode(s));return o=u.join(""),t?n.decode(o):o}},n={encode:function(e){return e=e.replace(/[\u0080-\u07ff]/g,function(e){return e=e.charCodeAt(0),
String.fromCharCode(192|e>>6,128|63&e)}),e=e.replace(/[\u0800-\uffff]/g,function(e){return e=e.charCodeAt(0),String.fromCharCode(224|e>>12,128|e>>6&63,128|63&e)})},decode:function(e){return e=e.replace(/[\u00e0-\u00ef][\u0080-\u00bf][\u0080-\u00bf]/g,function(e){return e=(15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2),String.fromCharCode(e)}),e=e.replace(/[\u00c0-\u00df][\u0080-\u00bf]/g,function(e){return e=(31&e.charCodeAt(0))<<6|63&e.charCodeAt(1),String.fromCharCode(e)})}};
}(jwplayer.utils),function(e){e.events={COMPLETE:"COMPLETE",ERROR:"ERROR",API_READY:"jwplayerAPIReady",JWPLAYER_READY:"jwplayerReady",JWPLAYER_FULLSCREEN:"jwplayerFullscreen",JWPLAYER_RESIZE:"jwplayerResize",JWPLAYER_ERROR:"jwplayerError",JWPLAYER_SETUP_ERROR:"jwplayerSetupError",JWPLAYER_MEDIA_BEFOREPLAY:"jwplayerMediaBeforePlay",JWPLAYER_MEDIA_BEFORECOMPLETE:"jwplayerMediaBeforeComplete",JWPLAYER_COMPONENT_SHOW:"jwplayerComponentShow",JWPLAYER_COMPONENT_HIDE:"jwplayerComponentHide",JWPLAYER_MEDIA_BUFFER:"jwplayerMediaBuffer",
JWPLAYER_MEDIA_BUFFER_FULL:"jwplayerMediaBufferFull",JWPLAYER_MEDIA_ERROR:"jwplayerMediaError",JWPLAYER_MEDIA_LOADED:"jwplayerMediaLoaded",JWPLAYER_MEDIA_COMPLETE:"jwplayerMediaComplete",JWPLAYER_MEDIA_SEEK:"jwplayerMediaSeek",JWPLAYER_MEDIA_TIME:"jwplayerMediaTime",JWPLAYER_MEDIA_VOLUME:"jwplayerMediaVolume",JWPLAYER_MEDIA_META:"jwplayerMediaMeta",JWPLAYER_MEDIA_MUTE:"jwplayerMediaMute",JWPLAYER_MEDIA_LEVELS:"jwplayerMediaLevels",JWPLAYER_MEDIA_LEVEL_CHANGED:"jwplayerMediaLevelChanged",JWPLAYER_CAPTIONS_CHANGED:"jwplayerCaptionsChanged",
JWPLAYER_CAPTIONS_LIST:"jwplayerCaptionsList",JWPLAYER_CAPTIONS_LOADED:"jwplayerCaptionsLoaded",JWPLAYER_PLAYER_STATE:"jwplayerPlayerState",state:{BUFFERING:"BUFFERING",IDLE:"IDLE",PAUSED:"PAUSED",PLAYING:"PLAYING"},JWPLAYER_PLAYLIST_LOADED:"jwplayerPlaylistLoaded",JWPLAYER_PLAYLIST_ITEM:"jwplayerPlaylistItem",JWPLAYER_PLAYLIST_COMPLETE:"jwplayerPlaylistComplete",JWPLAYER_DISPLAY_CLICK:"jwplayerViewClick",JWPLAYER_CONTROLS:"jwplayerViewControls",JWPLAYER_USER_ACTION:"jwplayerUserAction",JWPLAYER_INSTREAM_CLICK:"jwplayerInstreamClicked",
JWPLAYER_INSTREAM_DESTROYED:"jwplayerInstreamDestroyed",JWPLAYER_AD_TIME:"jwplayerAdTime",JWPLAYER_AD_ERROR:"jwplayerAdError",JWPLAYER_AD_CLICK:"jwplayerAdClicked",JWPLAYER_AD_COMPLETE:"jwplayerAdComplete",JWPLAYER_AD_IMPRESSION:"jwplayerAdImpression",JWPLAYER_AD_COMPANIONS:"jwplayerAdCompanions",JWPLAYER_AD_SKIPPED:"jwplayerAdSkipped"}}(jwplayer),function(e){var t=e.utils;e.events.eventdispatcher=function(i,n){function s(e,i,n){if(e)for(var s=0;s<e.length;s++){var a=e[s];if(a){null!==a.count&&0===--a.count&&delete e[s];
try{a.listener(i)}catch(r){t.log('Error handling "'+n+'" event listener ['+s+"]: "+r.toString(),a.listener,i)}}}}var a,r;this.resetEventListeners=function(){a={},r=[]},this.resetEventListeners(),this.addEventListener=function(e,i,n){try{t.exists(a[e])||(a[e]=[]),"string"==t.typeOf(i)&&(i=new Function("return "+i)()),a[e].push({listener:i,count:n||null})}catch(s){t.log("error",s)}return!1},this.removeEventListener=function(e,i){if(a[e]){try{for(var n=0;n<a[e].length;n++)if(a[e][n].listener.toString()==i.toString()){
a[e].splice(n,1);break}}catch(s){t.log("error",s)}return!1}},this.addGlobalListener=function(e,i){try{"string"==t.typeOf(e)&&(e=new Function("return "+e)()),r.push({listener:e,count:i||null})}catch(n){t.log("error",n)}return!1},this.removeGlobalListener=function(e){if(e){try{for(var i=r.length;i--;)r[i].listener.toString()==e.toString()&&r.splice(i,1)}catch(n){t.log("error",n)}return!1}},this.sendEvent=function(o,l){t.exists(l)||(l={}),t.extend(l,{id:i,version:e.version,type:o}),n&&t.log(o,l),s(a[o],l,o),
s(r,l,o)}}}(window.jwplayer),function(e){var t={},i={};e.plugins=function(){},e.plugins.loadPlugins=function(n,s){return i[n]=new e.plugins.pluginloader(new e.plugins.model(t),s),i[n]},e.plugins.registerPlugin=function(i,n,s,a){var r=e.utils.getPluginName(i);t[r]||(t[r]=new e.plugins.plugin(i)),t[r].registerPlugin(i,n,s,a)}}(jwplayer),function(e){e.plugins.model=function(t){this.addPlugin=function(i){var n=e.utils.getPluginName(i);return t[n]||(t[n]=new e.plugins.plugin(i)),t[n]},this.getPlugins=function(){
return t}}}(jwplayer),function(e){var t=jwplayer.utils,i=jwplayer.events;e.pluginmodes={FLASH:0,JAVASCRIPT:1,HYBRID:2},e.plugin=function(n){function s(){switch(t.getPluginPathType(n)){case t.pluginPathType.ABSOLUTE:return n;case t.pluginPathType.RELATIVE:return t.getAbsolutePath(n,window.location.href)}}function a(){u=setTimeout(function(){d=t.loaderstatus.COMPLETE,h.sendEvent(i.COMPLETE)},1e3)}function r(){d=t.loaderstatus.ERROR,h.sendEvent(i.ERROR)}var o,l,c,u,d=t.loaderstatus.NEW,h=new i.eventdispatcher;
t.extend(this,h),this.load=function(){if(d==t.loaderstatus.NEW)if(0<n.lastIndexOf(".swf"))o=n,d=t.loaderstatus.COMPLETE,h.sendEvent(i.COMPLETE);else if(t.getPluginPathType(n)==t.pluginPathType.CDN)d=t.loaderstatus.COMPLETE,h.sendEvent(i.COMPLETE);else{d=t.loaderstatus.LOADING;var e=new t.scriptloader(s());e.addEventListener(i.COMPLETE,a),e.addEventListener(i.ERROR,r),e.load()}},this.registerPlugin=function(e,n,s,a){u&&(clearTimeout(u),u=void 0),c=n,s&&a?(o=a,l=s):"string"==typeof s?o=s:"function"==typeof s?l=s:!s&&!a&&(o=e),
d=t.loaderstatus.COMPLETE,h.sendEvent(i.COMPLETE)},this.getStatus=function(){return d},this.getPluginName=function(){return t.getPluginName(n)},this.getFlashPath=function(){if(o)switch(t.getPluginPathType(o)){case t.pluginPathType.ABSOLUTE:return o;case t.pluginPathType.RELATIVE:return 0<n.lastIndexOf(".swf")?t.getAbsolutePath(o,window.location.href):t.getAbsolutePath(o,s())}return null},this.getJS=function(){return l},this.getTarget=function(){return c},this.getPluginmode=function(){return"undefined"!=typeof o&&"undefined"!=typeof l?e.pluginmodes.HYBRID:"undefined"!=typeof o?e.pluginmodes.FLASH:"undefined"!=typeof l?e.pluginmodes.JAVASCRIPT:void 0;
},this.getNewInstance=function(e,t,i){return new l(e,t,i)},this.getURL=function(){return n}}}(jwplayer.plugins),function(e){var t=e.utils,i=e.events,n=t.foreach;e.plugins.pluginloader=function(s,a){function r(){d?p.sendEvent(i.ERROR,{message:l}):u||(u=!0,c=t.loaderstatus.COMPLETE,p.sendEvent(i.COMPLETE))}function o(){if(h||r(),!u&&!d){var i=0,n=s.getPlugins();t.foreach(h,function(s){s=t.getPluginName(s);var a=n[s];s=a.getJS();var o=a.getTarget(),a=a.getStatus();a==t.loaderstatus.LOADING||a==t.loaderstatus.NEW?i++:s&&(!o||parseFloat(o)>parseFloat(e.version))&&(d=!0,
l="Incompatible player version",r())}),0==i&&r()}}var l,c=t.loaderstatus.NEW,u=!1,d=!1,h=a,p=new i.eventdispatcher;t.extend(this,p),this.setupPlugins=function(e,i,a){var r={length:0,plugins:{}},o=0,l={},c=s.getPlugins();return n(i.plugins,function(n,s){var u=t.getPluginName(n),d=c[u],h=d.getFlashPath(),p=d.getJS(),f=d.getURL();h&&(r.plugins[h]=t.extend({},s),r.plugins[h].pluginmode=d.getPluginmode(),r.length++);try{if(p&&i.plugins&&i.plugins[f]){var m=document.createElement("div");m.id=e.id+"_"+u,
m.style.position="absolute",m.style.top=0,m.style.zIndex=o+10,l[u]=d.getNewInstance(e,t.extend({},i.plugins[f]),m),o++,e.onReady(a(l[u],m,!0)),e.onResize(a(l[u],m))}}catch(g){t.log("ERROR: Failed to load "+u+".")}}),e.plugins=l,r},this.load=function(){if(!t.exists(a)||"object"==t.typeOf(a)){c=t.loaderstatus.LOADING,n(a,function(e){t.exists(e)&&(e=s.addPlugin(e),e.addEventListener(i.COMPLETE,o),e.addEventListener(i.ERROR,f))});var e=s.getPlugins();n(e,function(e,t){t.load()})}o()};var f=this.pluginFailed=function(){
d||(d=!0,l="File not found",r())};this.getStatus=function(){return c}}}(jwplayer),function(){jwplayer.parsers={localName:function(e){return e?e.localName?e.localName:e.baseName?e.baseName:"":""},textContent:function(e){return e?e.textContent?jwplayer.utils.trim(e.textContent):e.text?jwplayer.utils.trim(e.text):"":""},getChildNode:function(e,t){return e.childNodes[t]},numChildren:function(e){return e.childNodes?e.childNodes.length:0}}}(jwplayer),function(e){var t=e.parsers;(t.jwparser=function(){}).parseEntry=function(i,n){
for(var s=[],a=[],r=e.utils.xmlAttribute,o=0;o<i.childNodes.length;o++){var l=i.childNodes[o];if("jwplayer"==l.prefix){var c=t.localName(l);"source"==c?(delete n.sources,s.push({file:r(l,"file"),"default":r(l,"default"),label:r(l,"label"),type:r(l,"type")})):"track"==c?(delete n.tracks,a.push({file:r(l,"file"),"default":r(l,"default"),kind:r(l,"kind"),label:r(l,"label")})):(n[c]=e.utils.serialize(t.textContent(l)),"file"==c&&n.sources&&delete n.sources)}n.file||(n.file=n.link)}if(s.length)for(n.sources=[],
o=0;o<s.length;o++)0<s[o].file.length&&(s[o].default="true"==s[o].default?!0:!1,s[o].label.length||delete s[o].label,n.sources.push(s[o]));if(a.length)for(n.tracks=[],o=0;o<a.length;o++)0<a[o].file.length&&(a[o].default="true"==a[o].default?!0:!1,a[o].kind=a[o].kind.length?a[o].kind:"captions",a[o].label.length||delete a[o].label,n.tracks.push(a[o]));return n}}(jwplayer),function(e){var t=jwplayer.utils,i=t.xmlAttribute,n=e.localName,s=e.textContent,a=e.numChildren,r=e.mediaparser=function(){};r.parseGroup=function(e,o){
var l,c,u=[];for(c=0;c<a(e);c++)if(l=e.childNodes[c],"media"==l.prefix&&n(l))switch(n(l).toLowerCase()){case"content":i(l,"duration")&&(o.duration=t.seconds(i(l,"duration"))),0<a(l)&&(o=r.parseGroup(l,o)),i(l,"url")&&(o.sources||(o.sources=[]),o.sources.push({file:i(l,"url"),type:i(l,"type"),width:i(l,"width"),label:i(l,"label")}));break;case"title":o.title=s(l);break;case"description":o.description=s(l);break;case"guid":o.mediaid=s(l);break;case"thumbnail":o.image||(o.image=i(l,"url"));break;case"group":
r.parseGroup(l,o);break;case"subtitle":var d={};if(d.file=i(l,"url"),d.kind="captions",0<i(l,"lang").length){var h=d;l=i(l,"lang");var p={zh:"Chinese",nl:"Dutch",en:"English",fr:"French",de:"German",it:"Italian",ja:"Japanese",pt:"Portuguese",ru:"Russian",es:"Spanish"};l=p[l]?p[l]:l,h.label=l}u.push(d)}for(o.hasOwnProperty("tracks")||(o.tracks=[]),c=0;c<u.length;c++)o.tracks.push(u[c]);return o}}(jwplayer.parsers),function(e){function t(t){for(var s={},a=0;a<t.childNodes.length;a++){var o=t.childNodes[a],l=r(o);
if(l)switch(l.toLowerCase()){case"enclosure":s.file=i.xmlAttribute(o,"url");break;case"title":s.title=n(o);break;case"guid":s.mediaid=n(o);break;case"pubdate":s.date=n(o);break;case"description":s.description=n(o);break;case"link":s.link=n(o);break;case"category":s.tags=s.tags?s.tags+n(o):n(o)}}return s=e.mediaparser.parseGroup(t,s),s=e.jwparser.parseEntry(t,s),new jwplayer.playlist.item(s)}var i=jwplayer.utils,n=e.textContent,s=e.getChildNode,a=e.numChildren,r=e.localName;e.rssparser={},e.rssparser.parse=function(e){
for(var i=[],n=0;n<a(e);n++){var o=s(e,n);if("channel"==r(o).toLowerCase())for(var l=0;l<a(o);l++){var c=s(o,l);"item"==r(c).toLowerCase()&&i.push(t(c))}}return i}}(jwplayer.parsers),function(e){e.playlist=function(t){var i=[];if("array"==e.utils.typeOf(t))for(var n=0;n<t.length;n++)i.push(new e.playlist.item(t[n]));else i.push(new e.playlist.item(t));return i}}(jwplayer),function(e){var t=e.item=function(i){var n=jwplayer.utils,s=n.extend({},t.defaults,i);s.tracks=i&&n.exists(i.tracks)?i.tracks:[],
0==s.sources.length&&(s.sources=[new e.source(s)]);for(var a=0;a<s.sources.length;a++){var r=s.sources[a].default;s.sources[a].default=r?"true"==r.toString():!1,s.sources[a]=new e.source(s.sources[a])}if(s.captions&&!n.exists(i.tracks)){for(i=0;i<s.captions.length;i++)s.tracks.push(s.captions[i]);delete s.captions}for(a=0;a<s.tracks.length;a++)s.tracks[a]=new e.track(s.tracks[a]);return s};t.defaults={description:"",image:"",mediaid:"",title:"",sources:[],tracks:[]}}(jwplayer.playlist),function(e){
var t=jwplayer,i=t.utils,n=t.events,s=t.parsers;e.loader=function(){function t(t){try{var i=t.responseXML.childNodes;t="";for(var a=0;a<i.length&&(t=i[a],!(8!=t.nodeType));a++);if("xml"==s.localName(t)&&(t=t.nextSibling),"rss"!=s.localName(t))r("Not a valid RSS feed");else{var l=new e(s.rssparser.parse(t));o.sendEvent(n.JWPLAYER_PLAYLIST_LOADED,{playlist:l})}}catch(c){r()}}function a(e){r(e.match(/invalid/i)?"Not a valid RSS feed":"")}function r(e){o.sendEvent(n.JWPLAYER_ERROR,{message:e?e:"Error loading file"
})}var o=new n.eventdispatcher;i.extend(this,o),this.load=function(e){i.ajax(e,t,a)}}}(jwplayer.playlist),function(e){var t=jwplayer.utils,i={file:void 0,label:void 0,type:void 0,"default":void 0};e.source=function(e){var n=t.extend({},i);return t.foreach(i,function(i){t.exists(e[i])&&(n[i]=e[i],delete e[i])}),n.type&&0<n.type.indexOf("/")&&(n.type=t.extensionmap.mimeType(n.type)),"m3u8"==n.type&&(n.type="hls"),"smil"==n.type&&(n.type="rtmp"),n}}(jwplayer.playlist),function(e){var t=jwplayer.utils,i={
file:void 0,label:void 0,kind:"captions","default":!1};e.track=function(e){var n=t.extend({},i);return e||(e={}),t.foreach(i,function(i){t.exists(e[i])&&(n[i]=e[i],delete e[i])}),n}}(jwplayer.playlist),function(e){function t(e,t,n){var s=e.style;s.backgroundColor="#000",s.color="#FFF",s.width=i.styleDimension(n.width),s.height=i.styleDimension(n.height),s.display="table",s.opacity=1,n=document.createElement("p"),s=n.style,s.verticalAlign="middle",s.textAlign="center",s.display="table-cell",s.font="15px/20px Arial, Helvetica, sans-serif",
n.innerHTML=t.replace(":",":<br>"),e.innerHTML="",e.appendChild(n)}var i=e.utils,n=e.events,s=!0,a=!1,r=document,o=e.embed=function(l){function c(e,t){i.foreach(t,function(t,i){"function"==typeof e[t]&&e[t].call(e,i)})}function u(){if(!P)if("array"==i.typeOf(b.playlist)&&2>b.playlist.length&&(0==b.playlist.length||!b.playlist[0].sources||0==b.playlist[0].sources.length))p();else if(!k)if("string"==i.typeOf(b.playlist)){var t=new e.playlist.loader;t.addEventListener(n.JWPLAYER_PLAYLIST_LOADED,function(e){
b.playlist=e.playlist,k=a,u()}),t.addEventListener(n.JWPLAYER_ERROR,function(e){k=a,p(e)}),k=s,t.load(b.playlist)}else if(C.getStatus()==i.loaderstatus.COMPLETE){for(t=0;t<b.modes.length;t++)if(b.modes[t].type&&o[b.modes[t].type]){var r=i.extend({},b),h=new o[b.modes[t].type](g,b.modes[t],r,C,l);if(h.supportsConfig())return h.addEventListener(n.ERROR,d),h.embed(),c(l,r.events),l}var m;b.fallback?(m="No suitable players found and fallback enabled",A=setTimeout(function(){f(m,s)},10),i.log(m),new o.download(g,b,p)):(m="No suitable players found and fallback disabled",
f(m,a),i.log(m),g.parentNode.replaceChild(y,g))}}function d(e){m(S+e.message)}function h(e){m("Could not load plugins: "+e.message)}function p(e){m(e&&e.message?"Error loading playlist: "+e.message:S+"No playable sources found")}function f(e,t){A&&(clearTimeout(A),A=null),A=setTimeout(function(){A=null,l.dispatchEvent(n.JWPLAYER_SETUP_ERROR,{message:e,fallback:t})},0)}function m(e){P||(b.fallback?(P=s,t(g,e,b),f(e,s)):f(e,a))}var g,v,y,b=new o.config(l.config),w=b.width,x=b.height,S="Error loading player: ",C=e.plugins.loadPlugins(l.id,b.plugins),k=a,P=a,A=null;
return b.fallbackDiv&&(y=b.fallbackDiv,delete b.fallbackDiv),b.id=l.id,v=r.getElementById(l.id),b.aspectratio?l.config.aspectratio=b.aspectratio:delete l.config.aspectratio,g=r.createElement("div"),g.id=v.id,g.style.width=0<w.toString().indexOf("%")?w:w+"px",g.style.height=0<x.toString().indexOf("%")?x:x+"px",v.parentNode.replaceChild(g,v),this.embed=function(){P||(C.addEventListener(n.COMPLETE,u),C.addEventListener(n.ERROR,h),C.load())},this.errorScreen=m,this};e.embed.errorScreen=t}(jwplayer),function(e){
function t(e){if(e.playlist)for(var t=0;t<e.playlist.length;t++)e.playlist[t]=new s(e.playlist[t]);else{var a={};n.foreach(s.defaults,function(t){i(e,a,t)}),a.sources||(e.levels?(a.sources=e.levels,delete e.levels):(t={},i(e,t,"file"),i(e,t,"type"),a.sources=t.file?[t]:[])),e.playlist=[new s(a)]}}function i(e,t,i){n.exists(e[i])&&(t[i]=e[i],delete e[i])}var n=e.utils,s=e.playlist.item;(e.embed.config=function(i){var s={fallback:!0,height:270,primary:"html5",width:480,base:i.base?i.base:n.getScriptPath("jwplayer.js"),
aspectratio:""};i=n.extend(s,e.defaults,i);var s={type:"html5",src:i.base+"jwplayer.html5.js"},a={type:"flash",src:i.base+"jwplayer.flash.swf"};if(i.modes="flash"==i.primary?[a,s]:[s,a],i.listbar&&(i.playlistsize=i.listbar.size,i.playlistposition=i.listbar.position,i.playlistlayout=i.listbar.layout),i.flashplayer&&(a.src=i.flashplayer),i.html5player&&(s.src=i.html5player),t(i),a=i.aspectratio,"string"==typeof a&&n.exists(a)){var r=a.indexOf(":");-1==r?s=0:(s=parseFloat(a.substr(0,r)),a=parseFloat(a.substr(r+1)),
s=0>=s||0>=a?0:100*(a/s)+"%")}else s=0;return-1==i.width.toString().indexOf("%")?delete i.aspectratio:s?i.aspectratio=s:delete i.aspectratio,i}).addConfig=function(e,i){return t(i),n.extend(e,i)}}(jwplayer),function(e){var t=e.utils,i=document;e.embed.download=function(e,n,s){function a(e,n){for(var s=i.querySelectorAll(e),a=0;a<s.length;a++)t.foreach(n,function(e,t){s[a].style[e]=t})}function r(e,t,n){return e=i.createElement(e),t&&(e.className="jwdownload"+t),n&&n.appendChild(e),e}var o,l=t.extend({},n),c=l.width?l.width:480,u=l.height?l.height:320;
n=n.logo?n.logo:{prefix:t.repo(),file:"logo.png",margin:10};var d,h,p,f,l=l.playlist,m=["mp4","aac","mp3"];if(l&&l.length){for(f=l[0],o=f.sources,l=0;l<o.length;l++){var g=o[l],v=g.type?g.type:t.extensionmap.extType(t.extension(g.file));g.file&&t.foreach(m,function(e){v==m[e]?(d=g.file,h=f.image):t.isYouTube(g.file)&&(p=g.file)})}d?(o=d,s=h,e&&(l=r("a","display",e),r("div","icon",l),r("div","logo",l),o&&l.setAttribute("href",t.getAbsolutePath(o))),l="#"+e.id+" .jwdownload",e.style.width="",e.style.height="",
a(l+"display",{width:t.styleDimension(Math.max(320,c)),height:t.styleDimension(Math.max(180,u)),background:"black center no-repeat "+(s?"url("+s+")":""),backgroundSize:"contain",position:"relative",border:"none",display:"block"}),a(l+"display div",{position:"absolute",width:"100%",height:"100%"}),a(l+"logo",{top:n.margin+"px",right:n.margin+"px",background:"top right no-repeat url("+n.prefix+n.file+")"}),a(l+"icon",{background:"center no-repeat url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAgNJREFUeNrs28lqwkAYB/CZqNVDDj2r6FN41QeIy8Fe+gj6BL275Q08u9FbT8ZdwVfotSBYEPUkxFOoks4EKiJdaDuTjMn3wWBO0V/+sySR8SNSqVRKIR8qaXHkzlqS9jCfzzWcTCYp9hF5o+59sVjsiRzcegSckFzcjT+ruN80TeSlAjCAAXzdJSGPFXRpAAMYwACGZQkSdhG4WCzehMNhqV6vG6vVSrirKVEw66YoSqDb7cqlUilE8JjHd/y1MQefVzqdDmiaJpfLZWHgXMHn8F6vJ1cqlVAkEsGuAn83J4gAd2RZymQygX6/L1erVQt+9ZPWb+CDwcCC2zXGJaewl/DhcHhK3DVj+KfKZrMWvFarcYNLomAv4aPRSFZVlTlcSPA5fDweW/BoNIqFnKV53JvncjkLns/n/cLdS+92O7RYLLgsKfv9/t8XlDn4eDyiw+HA9Jyz2eyt0+kY2+3WFC5hluej0Ha7zQQq9PPwdDq1Et1sNsx/nFBgCqWJ8oAK1aUptNVqcYWewE4nahfU0YQnk4ntUEfGMIU2m01HoLaCKbTRaDgKtaVLk9tBYaBcE/6Artdr4RZ5TB6/dC+9iIe/WgAMYADDpAUJAxjAAAYwgGFZgoS/AtNNTF7Z2bL0BYPBV3Jw5xFwwWcYxgtBP5OkE8i9G7aWGOOCruvauwADALMLMEbKf4SdAAAAAElFTkSuQmCC)"
})):p?(n=p,e=r("iframe","",e),e.src="http://www.youtube.com/embed/"+t.youTubeID(n),e.width=c,e.height=u,e.style.border="none"):s()}}}(jwplayer),function(e){var t=e.utils,i=e.events,n={};(e.embed.flash=function(a,r,o,l,c){function u(e,t,i){var n=document.createElement("param");n.setAttribute("name",t),n.setAttribute("value",i),e.appendChild(n)}function d(e,t,i){return function(){try{i&&document.getElementById(c.id+"_wrapper").appendChild(t);var n=document.getElementById(c.id).getPluginConfig("display");
"function"==typeof e.resize&&e.resize(n.width,n.height),t.style.left=n.x,t.style.top=n.h}catch(s){}}}function h(e){if(!e)return{};var i={},n=[];return t.foreach(e,function(e,s){var a=t.getPluginName(e);n.push(e),t.foreach(s,function(e,t){i[a+"."+e]=t})}),i.plugins=n.join(","),i}var p=new e.events.eventdispatcher,f=t.flashVersion();t.extend(this,p),this.embed=function(){if(o.id=c.id,10>f)return p.sendEvent(i.ERROR,{message:"Flash version must be 10.0 or greater"}),!1;var e,s,m=c.config.listbar,g=t.extend({},o);
if(a.id+"_wrapper"==a.parentNode.id)e=document.getElementById(a.id+"_wrapper");else{if(e=document.createElement("div"),s=document.createElement("div"),s.style.display="none",s.id=a.id+"_aspect",e.id=a.id+"_wrapper",e.style.position="relative",e.style.display="block",e.style.width=t.styleDimension(g.width),e.style.height=t.styleDimension(g.height),c.config.aspectratio){var v=parseFloat(c.config.aspectratio);s.style.display="block",s.style.marginTop=c.config.aspectratio,e.style.height="auto",e.style.display="inline-block",
m&&("bottom"==m.position?s.style.paddingBottom=m.size+"px":"right"==m.position&&(s.style.marginBottom=-1*m.size*(v/100)+"px"))}a.parentNode.replaceChild(e,a),e.appendChild(a),e.appendChild(s)}for(e=l.setupPlugins(c,g,d),0<e.length?t.extend(g,h(e.plugins)):delete g.plugins,"undefined"!=typeof g["dock.position"]&&"false"==g["dock.position"].toString().toLowerCase()&&(g.dock=g["dock.position"],delete g["dock.position"]),e=g.wmode?g.wmode:g.height&&40>=g.height?"transparent":"opaque",s="height width modes events primary base fallback volume".split(" "),
m=0;m<s.length;m++)delete g[s[m]];s=t.getCookies(),t.foreach(s,function(e,t){"undefined"==typeof g[e]&&(g[e]=t)}),s=window.location.href.split("/"),s.splice(s.length-1,1),s=s.join("/"),g.base=s+"/",n[a.id]=g,t.isIE()?(s='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" " width="100%" height="100%"id="'+a.id+'" name="'+a.id+'" tabindex=0"">',s+='<param name="movie" value="'+r.src+'">',s+='<param name="allowfullscreen" value="true"><param name="allowscriptaccess" value="always">',s+='<param name="seamlesstabbing" value="true">',
s+='<param name="wmode" value="'+e+'">',s+='<param name="bgcolor" value="#000000">',s+="</object>",a.outerHTML=s,e=document.getElementById(a.id)):(s=document.createElement("object"),s.setAttribute("type","application/x-shockwave-flash"),s.setAttribute("data",r.src),s.setAttribute("width","100%"),s.setAttribute("height","100%"),s.setAttribute("bgcolor","#000000"),s.setAttribute("id",a.id),s.setAttribute("name",a.id),s.setAttribute("tabindex",0),u(s,"allowfullscreen","true"),u(s,"allowscriptaccess","always"),
u(s,"seamlesstabbing","true"),u(s,"wmode",e),a.parentNode.replaceChild(s,a),e=s),c.config.aspectratio&&(e.style.position="absolute"),c.container=e,c.setPlayer(e,"flash")},this.supportsConfig=function(){if(f){if(!o)return!0;if("string"==t.typeOf(o.playlist))return!0;try{var e=o.playlist[0].sources;if("undefined"==typeof e)return!0;for(var i=0;i<e.length;i++)if(e[i].file&&s(e[i].file,e[i].type))return!0}catch(n){}}return!1}}).getVars=function(e){return n[e]};var s=e.embed.flashCanPlay=function(e,i){
if(t.isYouTube(e)||t.isRtmp(e,i)||"hls"==i)return!0;var n=t.extensionmap[i?i:t.extension(e)];return n?!!n.flash:!1}}(jwplayer),function(e){var t=e.utils,i=t.extensionmap,n=e.events;e.embed.html5=function(s,a,r,o,l){function c(e,t,i){return function(){try{var n=document.querySelector("#"+s.id+" .jwmain");i&&n.appendChild(t),"function"==typeof e.resize&&(e.resize(n.clientWidth,n.clientHeight),setTimeout(function(){e.resize(n.clientWidth,n.clientHeight)},400)),t.left=n.style.left,t.top=n.style.top}catch(a){}
}}function u(e){d.sendEvent(e.type,{message:"HTML5 player not found"})}var d=this,h=new n.eventdispatcher;t.extend(d,h),d.embed=function(){if(e.html5){o.setupPlugins(l,r,c),s.innerHTML="";var i=e.utils.extend({},r);delete i.volume,i=new e.html5.player(i),l.container=document.getElementById(l.id),l.setPlayer(i,"html5")}else i=new t.scriptloader(a.src),i.addEventListener(n.ERROR,u),i.addEventListener(n.COMPLETE,d.embed),i.load()},d.supportsConfig=function(){if(e.vid.canPlayType)try{if("string"==t.typeOf(r.playlist))return!0;
for(var n=r.playlist[0].sources,s=0;s<n.length;s++){var a,o=n[s].file,l=n[s].type;if(null!==navigator.userAgent.match(/BlackBerry/i)||t.isAndroid()&&("m3u"==t.extension(o)||"m3u8"==t.extension(o))||t.isRtmp(o,l))a=!1;else{var c,u=i[l?l:t.extension(o)];if(!u||u.flash&&!u.html5)c=!1;else{var d=u.html5,h=e.vid;if(d)try{c=h.canPlayType(d)?!0:!1}catch(p){c=!1}else c=!0}a=c}if(a)return!0}}catch(f){}return!1}}}(jwplayer),function(e){var t=e.embed,i=e.utils,n=/\.(js|swf)$/;e.embed=i.extend(function(s){function a(){
r="Adobe SiteCatalyst Error: Could not find Media Module"}var r,o=i.repo(),l=i.extend({},e.defaults),c=i.extend({},l,s.config),u=s.config,d=c.plugins,h=c.analytics,p=o+"jwpsrv.js",f=o+"sharing.js",m=o+"related.js",g=o+"gapro.js",l=e.key?e.key:l.key,v=new e.utils.key(l).edition(),d=d?d:{};switch("ads"==v&&c.advertising&&(n.test(c.advertising.client)?d[c.advertising.client]=c.advertising:d[o+c.advertising.client+".js"]=c.advertising),delete u.advertising,u.key=l,c.analytics&&n.test(c.analytics.client)&&(p=c.analytics.client),
delete u.analytics,h&&"ads"!==v&&delete h.enabled,"free"!=v&&h&&!1===h.enabled||(d[p]=h?h:{}),delete d.sharing,delete d.related,v){case"ads":if(u.sitecatalyst)try{window.s&&window.s.hasOwnProperty("Media")?new e.embed.sitecatalyst(s):a()}catch(y){a()}case"premium":c.related&&(n.test(c.related.client)&&(m=c.related.client),d[m]=c.related),c.ga&&(n.test(c.ga.client)&&(g=c.ga.client),d[g]=c.ga);case"pro":c.sharing&&(n.test(c.sharing.client)&&(f=c.sharing.client),d[f]=c.sharing),c.skin&&(u.skin=c.skin.replace(/^(beelden|bekle|five|glow|modieus|roundster|stormtrooper|vapor)$/i,i.repo()+"skins/$1.xml"));
}return u.plugins=d,s.config=u,s=new t(s),r&&s.errorScreen(r),s},e.embed)}(jwplayer),function(e){var t=jwplayer.utils;e.sitecatalyst=function(e){function i(e){h.debug&&t.log(e)}function n(e){return e=e.split("/"),e=e[e.length-1],e=e.split("?"),e[0]}function a(){if(!f){f=!0;var e=d.getPosition();i("stop: "+o+" : "+e),s.Media.stop(o,e)}}function r(){m||(a(),m=!0,i("close: "+o),s.Media.close(o),u=!0,c=0)}var o,l,c,u,d=e,h=t.extend({},d.config.sitecatalyst),p={onPlay:function(){if(!u){var e=d.getPosition();
f=!1,i("play: "+o+" : "+e),s.Media.play(o,e)}},onPause:a,onBuffer:a,onIdle:r,onPlaylistItem:function(e){try{u=!0,r(),c=0;var i;if(h.mediaName)i=h.mediaName;else{var s=d.getPlaylistItem(e.index);i=s.title?s.title:s.file?n(s.file):s.sources&&s.sources.length?n(s.sources[0].file):""}o=i,l=h.playerName?h.playerName:d.id}catch(a){t.log(a)}},onTime:function(){if(u){var e=d.getDuration();if(-1==e)return;m=f=u=!1,i("open: "+o+" : "+e+" : "+l),s.Media.open(o,e,l),i("play: "+o+" : 0"),s.Media.play(o,0)}if(e=d.getPosition(),
3<=Math.abs(e-c)){var t=c;i("seek: "+t+" to "+e),i("stop: "+o+" : "+t),s.Media.stop(o,t),i("play: "+o+" : "+e),s.Media.play(o,e)}c=e},onComplete:r},f=!0,m=!0;t.foreach(p,function(e){d[e](p[e])})}}(jwplayer.embed),function(e,t){var i=[],n=e.utils,s=e.events,a=s.state,r=document,o=e.api=function(i){function l(e,t){return function(i){return t(e,i)}}function c(e,t){return v[e]||(v[e]=[],d(s.JWPLAYER_PLAYER_STATE,function(t){var i=t.newstate;if(t=t.oldstate,i==e){var n=v[i];if(n)for(var s=0;s<n.length;s++){
var a=n[s];"function"==typeof a&&a.call(this,{oldstate:t,newstate:i})}}})),v[e].push(t),m}function u(e,t){try{e.jwAddEventListener(t,'function(dat) { jwplayer("'+m.id+'").dispatchEvent("'+t+'", dat); }')}catch(i){n.log("Could not add internal listener")}}function d(e,t){return g[e]||(g[e]=[],p&&y&&u(p,e)),g[e].push(t),m}function h(){if(y){if(p){var e=Array.prototype.slice.call(arguments,0),t=e.shift();if("function"==typeof p[t]){switch(e.length){case 6:return p[t](e[0],e[1],e[2],e[3],e[4],e[5]);case 5:
return p[t](e[0],e[1],e[2],e[3],e[4]);case 4:return p[t](e[0],e[1],e[2],e[3]);case 3:return p[t](e[0],e[1],e[2]);case 2:return p[t](e[0],e[1]);case 1:return p[t](e[0])}return p[t]()}}return null}b.push(arguments)}var p,f,m=this,g={},v={},y=!1,b=[],w={},x={};m.container=i,m.id=i.id,m.getBuffer=function(){return h("jwGetBuffer")},m.getContainer=function(){return m.container},m.addButton=function(e,t,i,s){try{x[s]=i,h("jwDockAddButton",e,t,"jwplayer('"+m.id+"').callback('"+s+"')",s)}catch(a){n.log("Could not add dock button"+a.message);
}},m.removeButton=function(e){h("jwDockRemoveButton",e)},m.callback=function(e){x[e]&&x[e]()},m.forceState=function(e){return h("jwForceState",e),m},m.releaseState=function(){return h("jwReleaseState")},m.getDuration=function(){return h("jwGetDuration")},m.getFullscreen=function(){return h("jwGetFullscreen")},m.getHeight=function(){return h("jwGetHeight")},m.getLockState=function(){return h("jwGetLockState")},m.getMeta=function(){return m.getItemMeta()},m.getMute=function(){return h("jwGetMute")},
m.getPlaylist=function(){var e=h("jwGetPlaylist");return"flash"==m.renderingMode&&n.deepReplaceKeyName(e,["__dot__","__spc__","__dsh__","__default__"],["."," ","-","default"]),e},m.getPlaylistItem=function(e){return n.exists(e)||(e=m.getPlaylistIndex()),m.getPlaylist()[e]},m.getPlaylistIndex=function(){return h("jwGetPlaylistIndex")},m.getPosition=function(){return h("jwGetPosition")},m.getRenderingMode=function(){return m.renderingMode},m.getState=function(){return h("jwGetState")},m.getVolume=function(){
return h("jwGetVolume")},m.getWidth=function(){return h("jwGetWidth")},m.setFullscreen=function(e){return n.exists(e)?h("jwSetFullscreen",e):h("jwSetFullscreen",!h("jwGetFullscreen")),m},m.setMute=function(e){return n.exists(e)?h("jwSetMute",e):h("jwSetMute",!h("jwGetMute")),m},m.lock=function(){return m},m.unlock=function(){return m},m.load=function(e){return h("jwLoad",e),m},m.playlistItem=function(e){return h("jwPlaylistItem",parseInt(e,10)),m},m.playlistPrev=function(){return h("jwPlaylistPrev"),
m},m.playlistNext=function(){return h("jwPlaylistNext"),m},m.resize=function(e,t){if("flash"!==m.renderingMode)h("jwResize",e,t);else{var i=r.getElementById(m.id+"_wrapper"),s=r.getElementById(m.id+"_aspect");s&&(s.style.display="none"),i&&(i.style.display="block",i.style.width=n.styleDimension(e),i.style.height=n.styleDimension(t))}return m},m.play=function(e){return e===t?(e=m.getState(),h(e==a.PLAYING||e==a.BUFFERING?"jwPause":"jwPlay")):h("jwPlay",e),m},m.pause=function(e){return e===t?(e=m.getState(),
h(e==a.PLAYING||e==a.BUFFERING?"jwPause":"jwPlay")):h("jwPause",e),m},m.stop=function(){return h("jwStop"),m},m.seek=function(e){return h("jwSeek",e),m},m.setVolume=function(e){return h("jwSetVolume",e),m},m.createInstream=function(){return new o.instream(this,p)},m.setInstream=function(e){return f=e},m.loadInstream=function(e,t){return f=m.setInstream(m.createInstream()).init(t),f.loadItem(e),f},m.getQualityLevels=function(){return h("jwGetQualityLevels")},m.getCurrentQuality=function(){return h("jwGetCurrentQuality");
},m.setCurrentQuality=function(e){h("jwSetCurrentQuality",e)},m.getCaptionsList=function(){return h("jwGetCaptionsList")},m.getCurrentCaptions=function(){return h("jwGetCurrentCaptions")},m.setCurrentCaptions=function(e){h("jwSetCurrentCaptions",e)},m.getControls=function(){return h("jwGetControls")},m.getSafeRegion=function(){return h("jwGetSafeRegion")},m.setControls=function(e){h("jwSetControls",e)},m.destroyPlayer=function(){h("jwPlayerDestroy")},m.playAd=function(t){var i=e(m.id).plugins;i.vast&&i.vast.jwPlayAd(t);
},m.pauseAd=function(){var t=e(m.id).plugins;t.vast?t.vast.jwPauseAd():h("jwPauseAd")};var S={onBufferChange:s.JWPLAYER_MEDIA_BUFFER,onBufferFull:s.JWPLAYER_MEDIA_BUFFER_FULL,onError:s.JWPLAYER_ERROR,onSetupError:s.JWPLAYER_SETUP_ERROR,onFullscreen:s.JWPLAYER_FULLSCREEN,onMeta:s.JWPLAYER_MEDIA_META,onMute:s.JWPLAYER_MEDIA_MUTE,onPlaylist:s.JWPLAYER_PLAYLIST_LOADED,onPlaylistItem:s.JWPLAYER_PLAYLIST_ITEM,onPlaylistComplete:s.JWPLAYER_PLAYLIST_COMPLETE,onReady:s.API_READY,onResize:s.JWPLAYER_RESIZE,
onComplete:s.JWPLAYER_MEDIA_COMPLETE,onSeek:s.JWPLAYER_MEDIA_SEEK,onTime:s.JWPLAYER_MEDIA_TIME,onVolume:s.JWPLAYER_MEDIA_VOLUME,onBeforePlay:s.JWPLAYER_MEDIA_BEFOREPLAY,onBeforeComplete:s.JWPLAYER_MEDIA_BEFORECOMPLETE,onDisplayClick:s.JWPLAYER_DISPLAY_CLICK,onControls:s.JWPLAYER_CONTROLS,onQualityLevels:s.JWPLAYER_MEDIA_LEVELS,onQualityChange:s.JWPLAYER_MEDIA_LEVEL_CHANGED,onCaptionsList:s.JWPLAYER_CAPTIONS_LIST,onCaptionsChange:s.JWPLAYER_CAPTIONS_CHANGED,onAdError:s.JWPLAYER_AD_ERROR,onAdClick:s.JWPLAYER_AD_CLICK,
onAdImpression:s.JWPLAYER_AD_IMPRESSION,onAdTime:s.JWPLAYER_AD_TIME,onAdComplete:s.JWPLAYER_AD_COMPLETE,onAdCompanions:s.JWPLAYER_AD_COMPANIONS,onAdSkipped:s.JWPLAYER_AD_SKIPPED};n.foreach(S,function(e){m[e]=l(S[e],d)});var C={onBuffer:a.BUFFERING,onPause:a.PAUSED,onPlay:a.PLAYING,onIdle:a.IDLE};return n.foreach(C,function(e){m[e]=l(C[e],c)}),m.remove=function(){if(!y)throw"Cannot call remove() before player is ready";b=[],o.destroyPlayer(this.id)},m.setup=function(t){if(e.embed){var i=r.getElementById(m.id);
return i&&(t.fallbackDiv=i),i=m,b=[],o.destroyPlayer(i.id),i=e(m.id),i.config=t,new e.embed(i).embed(),i}return m},m.registerPlugin=function(t,i,n,s){e.plugins.registerPlugin(t,i,n,s)},m.setPlayer=function(e,t){p=e,m.renderingMode=t},m.detachMedia=function(){return"html5"==m.renderingMode?h("jwDetachMedia"):void 0},m.attachMedia=function(e){return"html5"==m.renderingMode?h("jwAttachMedia",e):void 0},m.removeEventListener=function(e,t){var i=g[e];if(i)for(var n=i.length;n--;)i[n]===t&&i.splice(n,1);
},m.dispatchEvent=function(e,t){var i=g[e];if(i)for(var i=i.slice(0),a=n.translateEventResponse(e,t),r=0;r<i.length;r++){var o=i[r];if("function"==typeof o)try{e===s.JWPLAYER_PLAYLIST_LOADED&&n.deepReplaceKeyName(a.playlist,["__dot__","__spc__","__dsh__","__default__"],["."," ","-","default"]),o.call(this,a)}catch(l){n.log("There was an error calling back an event handler")}}},m.dispatchInstreamEvent=function(e){f&&f.dispatchEvent(e,arguments)},m.callInternal=h,m.playerReady=function(e){for(y=!0,
p||m.setPlayer(r.getElementById(e.id)),m.container=r.getElementById(m.id),n.foreach(g,function(e){u(p,e)}),d(s.JWPLAYER_PLAYLIST_ITEM,function(){w={}}),d(s.JWPLAYER_MEDIA_META,function(e){n.extend(w,e.metadata)}),m.dispatchEvent(s.API_READY);0<b.length;)h.apply(this,b.shift())},m.getItemMeta=function(){return w},m.isBeforePlay=function(){return h("jwIsBeforePlay")},m.isBeforeComplete=function(){return h("jwIsBeforeComplete")},m};o.selectPlayer=function(e){var t;return n.exists(e)||(e=0),e.nodeType?t=e:"string"==typeof e&&(t=r.getElementById(e)),
t?(e=o.playerById(t.id))?e:o.addPlayer(new o(t)):"number"==typeof e?i[e]:null},o.playerById=function(e){for(var t=0;t<i.length;t++)if(i[t].id==e)return i[t];return null},o.addPlayer=function(e){for(var t=0;t<i.length;t++)if(i[t]==e)return e;return i.push(e),e},o.destroyPlayer=function(e){for(var t,s=-1,a=0;a<i.length;a++)i[a].id==e&&(s=a,t=i[a]);return s>=0&&(e=t.id,a=r.getElementById(e+("flash"==t.renderingMode?"_wrapper":"")),n.clearCss&&n.clearCss("#"+e),a&&("html5"==t.renderingMode&&t.destroyPlayer(),
t=r.createElement("div"),t.id=e,a.parentNode.replaceChild(t,a)),i.splice(s,1)),null},e.playerReady=function(t){var i=e.api.playerById(t.id);i?i.playerReady(t):e.api.selectPlayer(t.id).playerReady(t)}}(window.jwplayer),function(e){var t=e.events,i=e.utils,n=t.state;e.api.instream=function(e,s){function a(t,i){return c[t]||(c[t]=[],s.jwInstreamAddEventListener(t,'function(dat) { jwplayer("'+e.id+'").dispatchInstreamEvent("'+t+'", dat); }')),c[t].push(i),this}function r(e,i){return u[e]||(u[e]=[],a(t.JWPLAYER_PLAYER_STATE,function(t){
var i=t.newstate,n=t.oldstate;if(i==e){var s=u[i];if(s)for(var a=0;a<s.length;a++){var r=s[a];"function"==typeof r&&r.call(this,{oldstate:n,newstate:i,type:t.type})}}})),u[e].push(i),this}var o,l,c={},u={},d=this;d.type="instream",d.init=function(){return e.callInternal("jwInitInstream"),d},d.loadItem=function(t,n){o=t,l=n||{},"array"==i.typeOf(t)?e.callInternal("jwLoadArrayInstream",o,l):e.callInternal("jwLoadItemInstream",o,l)},d.removeEvents=function(){c=u={}},d.removeEventListener=function(e,t){
var i=c[e];if(i)for(var n=i.length;n--;)i[n]===t&&i.splice(n,1)},d.dispatchEvent=function(e,t){var n=c[e];if(n)for(var n=n.slice(0),s=i.translateEventResponse(e,t[1]),a=0;a<n.length;a++){var r=n[a];"function"==typeof r&&r.call(this,s)}},d.onError=function(e){return a(t.JWPLAYER_ERROR,e)},d.onMediaError=function(e){return a(t.JWPLAYER_MEDIA_ERROR,e)},d.onFullscreen=function(e){return a(t.JWPLAYER_FULLSCREEN,e)},d.onMeta=function(e){return a(t.JWPLAYER_MEDIA_META,e)},d.onMute=function(e){return a(t.JWPLAYER_MEDIA_MUTE,e);
},d.onComplete=function(e){return a(t.JWPLAYER_MEDIA_COMPLETE,e)},d.onPlaylistComplete=function(e){return a(t.JWPLAYER_PLAYLIST_COMPLETE,e)},d.onPlaylistItem=function(e){return a(t.JWPLAYER_PLAYLIST_ITEM,e)},d.onTime=function(e){return a(t.JWPLAYER_MEDIA_TIME,e)},d.onBuffer=function(e){return r(n.BUFFERING,e)},d.onPause=function(e){return r(n.PAUSED,e)},d.onPlay=function(e){return r(n.PLAYING,e)},d.onIdle=function(e){return r(n.IDLE,e)},d.onClick=function(e){return a(t.JWPLAYER_INSTREAM_CLICK,e)},
d.onInstreamDestroyed=function(e){return a(t.JWPLAYER_INSTREAM_DESTROYED,e)},d.onAdSkipped=function(e){return a(t.JWPLAYER_AD_SKIPPED,e)},d.play=function(e){s.jwInstreamPlay(e)},d.pause=function(e){s.jwInstreamPause(e)},d.hide=function(){e.callInternal("jwInstreamHide")},d.destroy=function(){d.removeEvents(),e.callInternal("jwInstreamDestroy")},d.setText=function(e){s.jwInstreamSetText(e?e:"")},d.getState=function(){return s.jwInstreamState()},d.setClick=function(e){s.jwInstreamClick&&s.jwInstreamClick(e);
}}}(window.jwplayer),function(e){var t=e.api,i=t.selectPlayer;t.selectPlayer=function(t){return(t=i(t))?t:{registerPlugin:function(t,i,n){e.plugins.registerPlugin(t,i,n)}}}}(jwplayer)),e.exports=jwplayer},function(e,t){var i=function(){function e(){if(!W){try{var e=F.getElementsByTagName("body")[0].appendChild(v("span"));e.parentNode.removeChild(e)}catch(t){return}W=!0;for(var i=B.length,n=0;i>n;n++)B[n]()}}function t(e){W?e():B[B.length]=e}function n(e){if(typeof N.addEventListener!=T)N.addEventListener("load",e,!1);else if(typeof F.addEventListener!=T)F.addEventListener("load",e,!1);else if(typeof N.attachEvent!=T)y(N,"onload",e);else if("function"==typeof N.onload){
var t=N.onload;N.onload=function(){t(),e()}}else N.onload=e}function s(){z?a():r()}function a(){var e=F.getElementsByTagName("body")[0],t=v(D);t.setAttribute("type",R);var i=e.appendChild(t);if(i){var n=0;!function(){if(typeof i.GetVariable!=T){var s=i.GetVariable("$version");s&&(s=s.split(" ")[1].split(","),q.pv=[parseInt(s[0],10),parseInt(s[1],10),parseInt(s[2],10)])}else if(10>n)return n++,void setTimeout(arguments.callee,10);e.removeChild(t),i=null,r()}()}else r()}function r(){var e=j.length;if(e>0)for(var t=0;e>t;t++){
var i=j[t].id,n=j[t].callbackFn,s={success:!1,id:i};if(q.pv[0]>0){var a=g(i);if(a)if(!b(j[t].swfVersion)||q.wk&&q.wk<312)if(j[t].expressInstall&&l()){var r={};r.data=j[t].expressInstall,r.width=a.getAttribute("width")||"0",r.height=a.getAttribute("height")||"0",a.getAttribute("class")&&(r.styleclass=a.getAttribute("class")),a.getAttribute("align")&&(r.align=a.getAttribute("align"));for(var d={},h=a.getElementsByTagName("param"),p=h.length,f=0;p>f;f++)"movie"!=h[f].getAttribute("name").toLowerCase()&&(d[h[f].getAttribute("name")]=h[f].getAttribute("value"));
c(r,d,i,n)}else u(a),n&&n(s);else x(i,!0),n&&(s.success=!0,s.ref=o(i),n(s))}else if(x(i,!0),n){var m=o(i);m&&typeof m.SetVariable!=T&&(s.success=!0,s.ref=m),n(s)}}}function o(e){var t=null,i=g(e);if(i&&"OBJECT"==i.nodeName)if(typeof i.SetVariable!=T)t=i;else{var n=i.getElementsByTagName(D)[0];n&&(t=n)}return t}function l(){return!$&&b("6.0.65")&&(q.win||q.mac)&&!(q.wk&&q.wk<312)}function c(e,t,i,n){$=!0,P=n||null,A={success:!1,id:i};var s=g(i);if(s){"OBJECT"==s.nodeName?(C=d(s),k=null):(C=s,k=i),
e.id=O,(typeof e.width==T||!/%$/.test(e.width)&&parseInt(e.width,10)<310)&&(e.width="310"),(typeof e.height==T||!/%$/.test(e.height)&&parseInt(e.height,10)<137)&&(e.height="137"),F.title=F.title.slice(0,47)+" - Flash Player Installation";var a=q.ie&&q.win?"ActiveX":"PlugIn",r="MMredirectURL="+N.location.toString().replace(/&/g,"%26")+"&MMplayerType="+a+"&MMdoctitle="+F.title;if(typeof t.flashvars!=T?t.flashvars+="&"+r:t.flashvars=r,q.ie&&q.win&&4!=s.readyState){var o=v("div");i+="SWFObjectNew",o.setAttribute("id",i),
s.parentNode.insertBefore(o,s),s.style.display="none",function(){4==s.readyState?s.parentNode.removeChild(s):setTimeout(arguments.callee,10)}()}h(e,t,i)}}function u(e){if(q.ie&&q.win&&4!=e.readyState){var t=v("div");e.parentNode.insertBefore(t,e),t.parentNode.replaceChild(d(e),t),e.style.display="none",function(){4==e.readyState?e.parentNode.removeChild(e):setTimeout(arguments.callee,10)}()}else e.parentNode.replaceChild(d(e),e)}function d(e){var t=v("div");if(q.win&&q.ie)t.innerHTML=e.innerHTML;else{
var i=e.getElementsByTagName(D)[0];if(i){var n=i.childNodes;if(n)for(var s=n.length,a=0;s>a;a++)1==n[a].nodeType&&"PARAM"==n[a].nodeName||8==n[a].nodeType||t.appendChild(n[a].cloneNode(!0))}}return t}function h(e,t,i){var n,s=g(i);if(q.wk&&q.wk<312)return n;if(s)if(typeof e.id==T&&(e.id=i),q.ie&&q.win){var a="";for(var r in e)e[r]!=Object.prototype[r]&&("data"==r.toLowerCase()?t.movie=e[r]:"styleclass"==r.toLowerCase()?a+=' class="'+e[r]+'"':"classid"!=r.toLowerCase()&&(a+=" "+r+'="'+e[r]+'"'));var o="";
for(var l in t)t[l]!=Object.prototype[l]&&(o+='<param name="'+l+'" value="'+t[l]+'" />');s.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+a+">"+o+"</object>",V[V.length]=e.id,n=g(e.id)}else{var c=v(D);c.setAttribute("type",R);for(var u in e)e[u]!=Object.prototype[u]&&("styleclass"==u.toLowerCase()?c.setAttribute("class",e[u]):"classid"!=u.toLowerCase()&&c.setAttribute(u,e[u]));for(var d in t)t[d]!=Object.prototype[d]&&"movie"!=d.toLowerCase()&&p(c,d,t[d]);s.parentNode.replaceChild(c,s),
n=c}return n}function p(e,t,i){var n=v("param");n.setAttribute("name",t),n.setAttribute("value",i),e.appendChild(n)}function f(e){var t=g(e);t&&"OBJECT"==t.nodeName&&(q.ie&&q.win?(t.style.display="none",function(){4==t.readyState?m(e):setTimeout(arguments.callee,10)}()):t.parentNode.removeChild(t))}function m(e){var t=g(e);if(t){for(var i in t)"function"==typeof t[i]&&(t[i]=null);t.parentNode.removeChild(t)}}function g(e){var t=null;try{t=F.getElementById(e)}catch(i){}return t}function v(e){return F.createElement(e);
}function y(e,t,i){e.attachEvent(t,i),H[H.length]=[e,t,i]}function b(e){var t=q.pv,i=e.split(".");return i[0]=parseInt(i[0],10),i[1]=parseInt(i[1],10)||0,i[2]=parseInt(i[2],10)||0,t[0]>i[0]||t[0]==i[0]&&t[1]>i[1]||t[0]==i[0]&&t[1]==i[1]&&t[2]>=i[2]?!0:!1}function w(e,t,i,n){if(!q.ie||!q.mac){var s=F.getElementsByTagName("head")[0];if(s){var a=i&&"string"==typeof i?i:"screen";if(n&&(I=null,_=null),!I||_!=a){var r=v("style");r.setAttribute("type","text/css"),r.setAttribute("media",a),I=s.appendChild(r),
q.ie&&q.win&&typeof F.styleSheets!=T&&F.styleSheets.length>0&&(I=F.styleSheets[F.styleSheets.length-1]),_=a}q.ie&&q.win?I&&typeof I.addRule==D&&I.addRule(e,t):I&&typeof F.createTextNode!=T&&I.appendChild(F.createTextNode(e+" {"+t+"}"))}}}function x(e,t){if(Q){var i=t?"visible":"hidden";W&&g(e)?g(e).style.visibility=i:w("#"+e,"visibility:"+i)}}function S(e){var t=/[\\\"<>\.;]/,i=null!=t.exec(e);return i&&typeof encodeURIComponent!=T?encodeURIComponent(e):e}var C,k,P,A,I,_,T="undefined",D="object",E="Shockwave Flash",M="ShockwaveFlash.ShockwaveFlash",R="application/x-shockwave-flash",O="SWFObjectExprInst",L="onreadystatechange",N=window,F=document,U=navigator,z=!1,B=[s],j=[],V=[],H=[],W=!1,$=!1,Q=!0,q=function(){
var e=typeof F.getElementById!=T&&typeof F.getElementsByTagName!=T&&typeof F.createElement!=T,t=U.userAgent.toLowerCase(),i=U.platform.toLowerCase(),n=i?/win/.test(i):/win/.test(t),s=i?/mac/.test(i):/mac/.test(t),a=/webkit/.test(t)?parseFloat(t.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):!1,r=!1,o=[0,0,0],l=null;if(typeof U.plugins!=T&&typeof U.plugins[E]==D)l=U.plugins[E].description,!l||typeof U.mimeTypes!=T&&U.mimeTypes[R]&&!U.mimeTypes[R].enabledPlugin||(z=!0,r=!1,l=l.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),
o[0]=parseInt(l.replace(/^(.*)\..*$/,"$1"),10),o[1]=parseInt(l.replace(/^.*\.(.*)\s.*$/,"$1"),10),o[2]=/[a-zA-Z]/.test(l)?parseInt(l.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0);else if(typeof N.ActiveXObject!=T)try{var c=new ActiveXObject(M);c&&(l=c.GetVariable("$version"),l&&(r=!0,l=l.split(" ")[1].split(","),o=[parseInt(l[0],10),parseInt(l[1],10),parseInt(l[2],10)]))}catch(u){}return{w3:e,pv:o,wk:a,ie:r,win:n,mac:s}}();(function(){q.w3&&((typeof F.readyState!=T&&"complete"==F.readyState||typeof F.readyState==T&&(F.getElementsByTagName("body")[0]||F.body))&&e(),
W||(typeof F.addEventListener!=T&&F.addEventListener("DOMContentLoaded",e,!1),q.ie&&q.win&&(F.attachEvent(L,function(){"complete"==F.readyState&&(F.detachEvent(L,arguments.callee),e())}),N==top&&!function(){if(!W){try{F.documentElement.doScroll("left")}catch(t){return void setTimeout(arguments.callee,0)}e()}}()),q.wk&&!function(){return W?void 0:/loaded|complete/.test(F.readyState)?void e():void setTimeout(arguments.callee,0)}(),n(e)))})(),function(){q.ie&&q.win&&window.attachEvent("onunload",function(){
for(var e=H.length,t=0;e>t;t++)H[t][0].detachEvent(H[t][1],H[t][2]);for(var n=V.length,s=0;n>s;s++)f(V[s]);for(var a in q)q[a]=null;q=null;for(var r in i)i[r]=null;i=null})}();return{registerObject:function(e,t,i,n){if(q.w3&&e&&t){var s={};s.id=e,s.swfVersion=t,s.expressInstall=i,s.callbackFn=n,j[j.length]=s,x(e,!1)}else n&&n({success:!1,id:e})},getObjectById:function(e){return q.w3?o(e):void 0},embedSWF:function(e,i,n,s,a,r,o,u,d,p){var f={success:!1,id:i};q.w3&&!(q.wk&&q.wk<312)&&e&&i&&n&&s&&a?(x(i,!1),
t(function(){n+="",s+="";var t={};if(d&&typeof d===D)for(var m in d)t[m]=d[m];t.data=e,t.width=n,t.height=s;var g={};if(u&&typeof u===D)for(var v in u)g[v]=u[v];if(o&&typeof o===D)for(var y in o)typeof g.flashvars!=T?g.flashvars+="&"+y+"="+o[y]:g.flashvars=y+"="+o[y];if(b(a)){var w=h(t,g,i);t.id==i&&x(i,!0),f.success=!0,f.ref=w}else{if(r&&l())return t.data=r,void c(t,g,i,p);x(i,!0)}p&&p(f)})):p&&p(f)},switchOffAutoHideShow:function(){Q=!1},ua:q,getFlashPlayerVersion:function(){return{major:q.pv[0],
minor:q.pv[1],release:q.pv[2]}},hasFlashPlayerVersion:b,createSWF:function(e,t,i){return q.w3?h(e,t,i):void 0},showExpressInstall:function(e,t,i,n){q.w3&&l()&&c(e,t,i,n)},removeSWF:function(e){q.w3&&f(e)},createCSS:function(e,t,i,n){q.w3&&w(e,t,i,n)},addDomLoadEvent:t,addLoadEvent:n,getQueryParamValue:function(e){var t=F.location.search||F.location.hash;if(t){if(/\?/.test(t)&&(t=t.split("?")[1]),null==e)return S(t);for(var i=t.split("&"),n=0;n<i.length;n++)if(i[n].substring(0,i[n].indexOf("="))==e)return S(i[n].substring(i[n].indexOf("=")+1));
}return""},expressInstallCallback:function(){if($){var e=g(O);e&&C&&(e.parentNode.replaceChild(C,e),k&&(x(k,!0),q.ie&&q.win&&(C.style.display="block")),P&&P(A)),$=!1}}}}();e.exports=i},function(e,t){},function(e,t,i){var n;!function(){"use strict";/**
		 * @preserve FastClick: polyfill to remove click delays on browsers with touch UIs.
		 *
		 * @codingstandard ftlabs-jsv2
		 * @copyright The Financial Times Limited [All Rights Reserved]
		 * @license MIT License (see LICENSE.txt)
		 */
function s(e,t){function i(e,t){return function(){return e.apply(t,arguments)}}var n;if(t=t||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=t.touchBoundary||10,this.layer=e,this.tapDelay=t.tapDelay||200,this.tapTimeout=t.tapTimeout||700,!s.notNeeded(e)){for(var a=["onMouse","onClick","onTouchStart","onTouchMove","onTouchEnd","onTouchCancel"],o=this,l=0,c=a.length;c>l;l++)o[a[l]]=i(o[a[l]],o);
r&&(e.addEventListener("mouseover",this.onMouse,!0),e.addEventListener("mousedown",this.onMouse,!0),e.addEventListener("mouseup",this.onMouse,!0)),e.addEventListener("click",this.onClick,!0),e.addEventListener("touchstart",this.onTouchStart,!1),e.addEventListener("touchmove",this.onTouchMove,!1),e.addEventListener("touchend",this.onTouchEnd,!1),e.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(e.removeEventListener=function(t,i,n){var s=Node.prototype.removeEventListener;
"click"===t?s.call(e,t,i.hijacked||i,n):s.call(e,t,i,n)},e.addEventListener=function(t,i,n){var s=Node.prototype.addEventListener;"click"===t?s.call(e,t,i.hijacked||(i.hijacked=function(e){e.propagationStopped||i(e)}),n):s.call(e,t,i,n)}),"function"==typeof e.onclick&&(n=e.onclick,e.addEventListener("click",function(e){n(e)},!1),e.onclick=null)}}var a=navigator.userAgent.indexOf("Windows Phone")>=0,r=navigator.userAgent.indexOf("Android")>0&&!a,o=/iP(ad|hone|od)/.test(navigator.userAgent)&&!a,l=o&&/OS 4_\d(_\d)?/.test(navigator.userAgent),c=o&&/OS [6-7]_\d/.test(navigator.userAgent),u=navigator.userAgent.indexOf("BB10")>0;
s.prototype.needsClick=function(e){switch(e.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(e.disabled)return!0;break;case"input":if(o&&"file"===e.type||e.disabled)return!0;break;case"label":case"iframe":case"video":return!0}return/\bneedsclick\b/.test(e.className)},s.prototype.needsFocus=function(e){switch(e.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!r;case"input":switch(e.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":
return!1}return!e.disabled&&!e.readOnly;default:return/\bneedsfocus\b/.test(e.className)}},s.prototype.sendClick=function(e,t){var i,n;document.activeElement&&document.activeElement!==e&&document.activeElement.blur(),n=t.changedTouches[0],i=document.createEvent("MouseEvents"),i.initMouseEvent(this.determineEventType(e),!0,!0,window,1,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),i.forwardedTouchEvent=!0,e.dispatchEvent(i)},s.prototype.determineEventType=function(e){return r&&"select"===e.tagName.toLowerCase()?"mousedown":"click";
},s.prototype.focus=function(e){var t;o&&e.setSelectionRange&&0!==e.type.indexOf("date")&&"time"!==e.type&&"month"!==e.type?(t=e.value.length,e.setSelectionRange(t,t)):e.focus()},s.prototype.updateScrollParent=function(e){var t,i;if(t=e.fastClickScrollParent,!t||!t.contains(e)){i=e;do{if(i.scrollHeight>i.offsetHeight){t=i,e.fastClickScrollParent=i;break}i=i.parentElement}while(i)}t&&(t.fastClickLastScrollTop=t.scrollTop)},s.prototype.getTargetElementFromEventTarget=function(e){return e.nodeType===Node.TEXT_NODE?e.parentNode:e;
},s.prototype.onTouchStart=function(e){var t,i,n;if(e.targetTouches.length>1)return!0;if(t=this.getTargetElementFromEventTarget(e.target),i=e.targetTouches[0],o){if(n=window.getSelection(),n.rangeCount&&!n.isCollapsed)return!0;if(!l){if(i.identifier&&i.identifier===this.lastTouchIdentifier)return e.preventDefault(),!1;this.lastTouchIdentifier=i.identifier,this.updateScrollParent(t)}}return this.trackingClick=!0,this.trackingClickStart=e.timeStamp,this.targetElement=t,this.touchStartX=i.pageX,this.touchStartY=i.pageY,
e.timeStamp-this.lastClickTime<this.tapDelay&&e.preventDefault(),!0},s.prototype.touchHasMoved=function(e){var t=e.changedTouches[0],i=this.touchBoundary;return Math.abs(t.pageX-this.touchStartX)>i||Math.abs(t.pageY-this.touchStartY)>i?!0:!1},s.prototype.onTouchMove=function(e){return this.trackingClick?((this.targetElement!==this.getTargetElementFromEventTarget(e.target)||this.touchHasMoved(e))&&(this.trackingClick=!1,this.targetElement=null),!0):!0},s.prototype.findControl=function(e){return void 0!==e.control?e.control:e.htmlFor?document.getElementById(e.htmlFor):e.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea");
},s.prototype.onTouchEnd=function(e){var t,i,n,s,a,u=this.targetElement;if(!this.trackingClick)return!0;if(e.timeStamp-this.lastClickTime<this.tapDelay)return this.cancelNextClick=!0,!0;if(e.timeStamp-this.trackingClickStart>this.tapTimeout)return!0;if(this.cancelNextClick=!1,this.lastClickTime=e.timeStamp,i=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,c&&(a=e.changedTouches[0],u=document.elementFromPoint(a.pageX-window.pageXOffset,a.pageY-window.pageYOffset)||u,u.fastClickScrollParent=this.targetElement.fastClickScrollParent),
n=u.tagName.toLowerCase(),"label"===n){if(t=this.findControl(u)){if(this.focus(u),r)return!1;u=t}}else if(this.needsFocus(u))return e.timeStamp-i>100||o&&window.top!==window&&"input"===n?(this.targetElement=null,!1):(this.focus(u),this.sendClick(u,e),o&&"select"===n||(this.targetElement=null,e.preventDefault()),!1);return o&&!l&&(s=u.fastClickScrollParent,s&&s.fastClickLastScrollTop!==s.scrollTop)?!0:(this.needsClick(u)||(e.preventDefault(),this.sendClick(u,e)),!1)},s.prototype.onTouchCancel=function(){
this.trackingClick=!1,this.targetElement=null},s.prototype.onMouse=function(e){return this.targetElement?e.forwardedTouchEvent?!0:e.cancelable&&(!this.needsClick(this.targetElement)||this.cancelNextClick)?(e.stopImmediatePropagation?e.stopImmediatePropagation():e.propagationStopped=!0,e.stopPropagation(),e.preventDefault(),!1):!0:!0},s.prototype.onClick=function(e){var t;return this.trackingClick?(this.targetElement=null,this.trackingClick=!1,!0):"submit"===e.target.type&&0===e.detail?!0:(t=this.onMouse(e),
t||(this.targetElement=null),t)},s.prototype.destroy=function(){var e=this.layer;r&&(e.removeEventListener("mouseover",this.onMouse,!0),e.removeEventListener("mousedown",this.onMouse,!0),e.removeEventListener("mouseup",this.onMouse,!0)),e.removeEventListener("click",this.onClick,!0),e.removeEventListener("touchstart",this.onTouchStart,!1),e.removeEventListener("touchmove",this.onTouchMove,!1),e.removeEventListener("touchend",this.onTouchEnd,!1),e.removeEventListener("touchcancel",this.onTouchCancel,!1);
},s.notNeeded=function(e){var t,i,n,s;if("undefined"==typeof window.ontouchstart)return!0;if(i=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!r)return!0;if(t=document.querySelector("meta[name=viewport]")){if(-1!==t.content.indexOf("user-scalable=no"))return!0;if(i>31&&document.documentElement.scrollWidth<=window.outerWidth)return!0}}if(u&&(n=navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/),n[1]>=10&&n[2]>=3&&(t=document.querySelector("meta[name=viewport]")))){if(-1!==t.content.indexOf("user-scalable=no"))return!0;
if(document.documentElement.scrollWidth<=window.outerWidth)return!0}return"none"===e.style.msTouchAction||"manipulation"===e.style.touchAction?!0:(s=+(/Firefox\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1],s>=27&&(t=document.querySelector("meta[name=viewport]"),t&&(-1!==t.content.indexOf("user-scalable=no")||document.documentElement.scrollWidth<=window.outerWidth))?!0:"none"===e.style.touchAction||"manipulation"===e.style.touchAction?!0:!1)},s.attach=function(e,t){return new s(e,t)},n=function(){
return s}.call(t,i,t,e),!(void 0!==n&&(e.exports=n))}()},function(e,t,i){e.exports=i.p+"img/desktop/queue/bookmarklet-steps-ie.3cbda4e75b0dd0e186e0c24999ab0d1d.png"},function(e,t,i){e.exports=i.p+"img/desktop/queue/bookmarklet-steps.abc5147d9257f0ec59f7b2257db9cb8f.png"},function(e,t,i){e.exports=i.p+"img/desktop/queue/email-links.f1b12dd82ea85b39a4c0fa07dd6df095.png"},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){return this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),
s=s||{},'<canvas class="circle-progress-bar"></canvas> <div class="circle-progress-text"></div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var a="";return a})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var a="";return a})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){
return this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{},'<div class="video-player-image-overlays"></div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+=o(i(1).call(t,"Your mix will resume shortly",{hash:{},data:a}))+" "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){return this.compilerInfo=[4,">= 1.0.0"],
i=this.merge(i,e.helpers),s=s||{},'<div class="background transition-out"></div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){return this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{},'<div id="content" class="scroll-container dark-scrollbar"></div> <div class="scroll-shadow transition-out"></div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){return this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),
s=s||{},'<button class="like-meh-btn btn-link"><i class="plex-icon-heart plex-icon-heart-empty"></i></button> <button class="dislike-btn btn-link"><i class="plex-icon-heart-strikethrough"></i></button> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return"(Plex Pass)"}function o(e,t){var i,n="";return n+=' <p><span class="text-muted">Name:</span> '+h((i=e&&e.primaryServer,i=null==i||i===!1?i:i.friendlyName,typeof i===d?i.apply(e):i))+'</p> <p><span class="text-muted">URL:</span> '+h((i=e&&e.primaryServerUrl,
typeof i===d?i.apply(e):i))+'</p> <p><span class="text-muted">Version:</span> '+h((i=e&&e.primaryServer,i=null==i||i===!1?i:i.version,typeof i===d?i.apply(e):i))+'</p> <p><span class="text-muted">Token:</span> '+h((i=e&&e.primaryServer,i=null==i||i===!1?i:i.accessToken,typeof i===d?i.apply(e):i))+"</p> "}function l(e,t){return' <p><span class="text-muted">none</span></p> '}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var c,u="",d="function",h=this.escapeExpression,p=this;return u+='<h3>Browser</h3> <p><span class="text-muted">Host:</span> '+h((c=t&&t.host,
typeof c===d?c.apply(t):c))+'</p> <p><span class="text-muted">User Agent:</span> '+h((c=t&&t.userAgent,typeof c===d?c.apply(t):c))+'</p> <p><span class="text-muted">Name:</span> '+h((c=t&&t.browser,c=null==c||c===!1?c:c.name,typeof c===d?c.apply(t):c))+'</p> <p><span class="text-muted">Version:</span> '+h((c=t&&t.browser,c=null==c||c===!1?c:c.version,typeof c===d?c.apply(t):c))+'</p> <p><span class="text-muted">Platform:</span> '+h((c=t&&t.browser,c=null==c||c===!1?c:c.platform,typeof c===d?c.apply(t):c))+'</p> <p><span class="text-muted">Mobile:</span> '+h(i(153).call(t,(c=t&&t.browser,
null==c||c===!1?c:c.mobile),{hash:{},data:a}))+'</p> <h3>User</h3> <p><span class="text-muted">Username:</span> '+h((c=t&&t.user,c=null==c||c===!1?c:c.username,typeof c===d?c.apply(t):c))+" ",c=n.if.call(t,t&&t.hasPlexPass,{hash:{},inverse:p.noop,fn:p.program(1,r,a),data:a}),(c||0===c)&&(u+=c),u+='</p> <p><span class="text-muted">Email:</span> '+h((c=t&&t.user,c=null==c||c===!1?c:c.email,typeof c===d?c.apply(t):c))+'</p> <p><span class="text-muted">Token:</span> '+h((c=t&&t.user,c=null==c||c===!1?c:c.accessToken,
typeof c===d?c.apply(t):c))+'</p> <h3>plex.tv</h3> <p><span class="text-muted">URL:</span> '+h((c=t&&t.cloudServerUrl,typeof c===d?c.apply(t):c))+'</p> <p><span class="text-muted">Available:</span> '+h(i(153).call(t,(c=t&&t.cloudServer,null==c||c===!1?c:c.available),{hash:{},data:a}))+'</p> <p><span class="text-muted">Authorized:</span> '+h(i(153).call(t,(c=t&&t.cloudServer,null==c||c===!1?c:c.authorized),{hash:{},data:a}))+"</p> <h3>Primary Server</h3> ",c=n.if.call(t,t&&t.primaryServer,{hash:{},
inverse:p.program(5,l,a),fn:p.program(3,o,a),data:a}),(c||0===c)&&(u+=c),u+=" "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var a="";return a})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var a,r,o="",l="function",c=this.escapeExpression;return o+='<textarea class="form-control">',(r=i.logs)?a=r.call(t,{
hash:{},data:s}):(r=t&&t.logs,a=typeof r===l?r.call(t,{hash:{},data:s}):r),o+=c(a)+"</textarea> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<h2 class="searching-header"> '+o(i(1).call(t,"Searching for {1}",t&&t.query,{hash:{},data:a}))+' <span class="loading loading-sm"></span> </h2> <h2 class="search-results-header"> '+o(i(1).call(t,"Results for {1}",t&&t.query,{
hash:{},data:a}))+' </h2> <h4 class="empty-message text-muted text-center hidden"> '+o(i(1).call(t,"No matches found.",{hash:{},data:a}))+' </h4> <div class="movie-search-container hidden"> <div class="filter-bar"><h4>'+o(i(1).call(t,"Movies",{hash:{},data:a}))+'</h4></div> </div> <div class="show-search-container hidden"> <div class="filter-bar"><h4>'+o(i(1).call(t,"TV Shows",{hash:{},data:a}))+'</h4></div> </div> <div class="episode-search-container hidden"> <div class="filter-bar"><h4>'+o(i(1).call(t,"Episodes",{
hash:{},data:a}))+'</h4></div> </div> <div class="artist-search-container hidden"> <div class="filter-bar"><h4>'+o(i(1).call(t,"Artists",{hash:{},data:a}))+'</h4></div> </div> <div class="album-search-container hidden"> <div class="filter-bar"><h4>'+o(i(1).call(t,"Albums",{hash:{},data:a}))+'</h4></div> </div> <div class="track-search-container hidden"> <div class="filter-bar"><h4>'+o(i(1).call(t,"Tracks",{hash:{},data:a}))+'</h4></div> </div> <div class="photo-search-container hidden"> <div class="filter-bar"><h4>'+o(i(1).call(t,"Photos",{
hash:{},data:a}))+'</h4></div> </div> <div class="clip-search-container hidden"> <div class="filter-bar"><h4>'+o(i(1).call(t,"Clips",{hash:{},data:a}))+"</h4></div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var n="";return n+=' <div class="remember-group checkbox"> <label class="control-label"> <input type="checkbox" id="remember" checked> '+c(i(1).call(e,"Remember me",{hash:{},data:t}))+" </label> </div> "}this.compilerInfo=[4,">= 1.0.0"],
n=this.merge(n,e.helpers),a=a||{};var o,l="",c=this.escapeExpression,u=this;return l+='<div class="row"> <div class="col-sm-12"> <h2 class="sign-in-header"> <a class="sign-in-btn selected" href="#">'+c(i(1).call(t,"Sign In",{hash:{},data:a}))+'</a> <span class="sign-in-header-divider">'+c(i(1).call(t,"or",{hash:{},data:a}))+'</span> <a class="sign-up-btn" href="#">'+c(i(1).call(t,"Sign Up",{hash:{},data:a}))+'</a> </h2> </div> </div> <div class="username-group form-group"> <label for="username" class="control-label"> '+c(i(1).call(t,"Username",{
hash:{},data:a}))+' <span class="control-error">'+c(i(1).call(t,"Required",{hash:{},data:a}))+'</span> </label> <input type="text" id="username" class="form-control" autocorrect="off" autocapitalize="off"> </div> <div class="email-group form-group"> <label for="email" class="control-label"> '+c(i(1).call(t,"Email",{hash:{},data:a}))+' <span class="control-error">'+c(i(1).call(t,"Required",{hash:{},data:a}))+'</span> </label> <input type="text" id="email" class="form-control" autocorrect="off" autocapitalize="off"> </div> <div class="password-group form-group"> <label for="password" class="control-label"> '+c(i(1).call(t,"Password",{
hash:{},data:a}))+' <span class="control-error">'+c(i(1).call(t,"Required",{hash:{},data:a}))+'</span> </label> <input type="password" id="password" class="form-control"> </div> <div class="confirm-group form-group"> <label for="confirm" class="control-label"> '+c(i(1).call(t,"Confirm Password",{hash:{},data:a}))+' <span class="control-error">'+c(i(1).call(t,"Passwords do not match",{hash:{},data:a}))+'</span> </label> <input type="password" id="confirm" class="form-control"> </div> <div class="age-disclaimer form-group"> '+c(i(1).call(t,"By creating an account, you confirm that you have read and accept the {1}Terms and Conditions{2} and are at least 13 years old.",'<a href="https://plex.tv/terms" target="_blank">',"</a>",{
hash:{},data:a}))+' </div> <div class="form-footer"> <button type="submit" class="btn btn-lg btn-primary btn-loading pull-right"> <div class="loading loading-sm"></div> <span class="sign-in-label btn-label">'+c(i(1).call(t,"Sign In",{hash:{},data:a}))+'</span> <span class="sign-up-label btn-label">'+c(i(1).call(t,"Sign Up",{hash:{},data:a}))+"</span> </button> ",o=n.if.call(t,t&&t.showRememberMe,{hash:{},inverse:u.noop,fn:u.program(1,r,a),data:a}),(o||0===o)&&(l+=o),l+=" </div> "})},function(e,t,i){
var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){return this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{},'<div class="sign-in-logo text-center"> <i class="plex-image logo"></i> </div> <div class="row row-padded"> <div class="col-sm-6 col-sm-offset-3"> <form id="user-account-form"></form> </div> </div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){function a(e,t){var n,s="";return s+='<span class="star"><i class="star-icon glyphicon ',
n=i.if.call(e,e,{hash:{},inverse:u.program(4,o,t),fn:u.program(2,r,t),data:t}),(n||0===n)&&(s+=n),s+='"></i><span class="empty-icon"></span></span>'}function r(e,t){return"star"}function o(e,t){return"dislikes"}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var l,c="",u=this;return l=i.each.call(t,t&&t.stars,{hash:{},inverse:u.noop,fn:u.program(1,a,s),data:s}),(l||0===l)&&(c+=l),c+=" "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){
return f(i(1).call(e,"Play",{hash:{},data:t}))}function o(e,t){return f(i(1).call(e,"Play All",{hash:{},data:t}))}function l(e,t){var s,a="";return a+='<li><a class="play-next-btn secondary-only ',s=n.unless.call(e,e&&e.canQueue,{hash:{},inverse:m.noop,fn:m.program(6,c,t),data:t}),(s||0===s)&&(a+=s),a+='" href="#">'+f(i(1).call(e,"Play Next",{hash:{},data:t}))+"</a></li>"}function c(e,t){return"disabled"}function u(e,t){var s,a="";return a+='<li><a class="add-to-up-next-btn secondary-only ',s=n.unless.call(e,e&&e.canQueue,{
hash:{},inverse:m.noop,fn:m.program(6,c,t),data:t}),(s||0===s)&&(a+=s),a+='" href="#">'+f(i(1).call(e,"Add to Up Next",{hash:{},data:t}))+"</a></li>"}function d(e,t){var n,s="";return s+=' <li><a class="download-btn secondary-only" href="'+f((n=e&&e.downloadUrl,typeof n===g?n.apply(e):n))+'" download="'+f((n=e&&e.downloadName,typeof n===g?n.apply(e):n))+'">'+f(i(1).call(e,"Download",{hash:{},data:t}))+"</a></li> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var h,p="",f=this.escapeExpression,m=this,g="function";
return p+='<ul class="nav action-bar-nav"> <li> <a class="play-btn btn-gray" href="#" title="',h=n.if.call(t,t&&t.isSingleItem,{hash:{},inverse:m.program(3,o,a),fn:m.program(1,r,a),data:a}),(h||0===h)&&(p+=h),p+='" data-toggle="tooltip"><i class="glyphicon play"></i></a> </li> <li> <a class="play-unwatched-btn btn-gray" href="#" title="'+f(i(1).call(t,"Play Unwatched",{hash:{},data:a}))+'" data-toggle="tooltip"><i class="glyphicon play"></i></a> </li> <li> <a class="play-shuffled-btn btn-gray" href="#" title="'+f(i(1).call(t,"Shuffle",{
hash:{},data:a}))+'" data-toggle="tooltip"><i class="glyphicon random"></i></a> </li> <li> <a class="play-trailer-btn btn-gray" href="#" title="'+f(i(1).call(t,"Play Trailer",{hash:{},data:a}))+'" data-toggle="tooltip"><i class="plex-icon-play-strip"></i></a> </li> <li> <a class="edit-btn btn-gray" href="#" title="'+f(i(1).call(t,"Edit",{hash:{},data:a}))+'" data-toggle="tooltip"><i class="glyphicon pencil"></i></a> </li> <li> <a class="add-to-playlist-btn btn-gray" href="#" title="'+f(i(1).call(t,"Add to playlist",{
hash:{},data:a}))+'" data-toggle="tooltip"><i class="plex-icon-add-to-playlist"></i></a> </li> <li> <a class="refresh-btn btn-gray" href="#" title="'+f(i(1).call(t,"Refresh",{hash:{},data:a}))+'" data-toggle="tooltip"><i class="glyphicon repeat"></i></a> </li> <li> <a class="analyze-btn btn-gray secondary-action" href="#" title="'+f(i(1).call(t,"Analyze",{hash:{},data:a}))+'" data-toggle="tooltip"><i class="glyphicon magic"></i></a> </li> <li> <a class="mark-watched-btn btn-gray" href="#" title="'+f(i(1).call(t,"Mark as Watched",{
hash:{},data:a}))+'" data-toggle="tooltip"><i class="glyphicon circle-ok"></i></a> </li> <li> <a class="mark-unwatched-btn btn-gray" href="#" title="'+f(i(1).call(t,"Mark as Unwatched",{hash:{},data:a}))+'" data-toggle="tooltip"><i class="glyphicon circle-minus"></i></a> </li> <li> <a class="select-btn btn-gray" href="#" title="'+f(i(1).call(t,"Select",{hash:{},data:a}))+'" data-toggle="tooltip"><i class="glyphicon check"></i></a> </li> <li> <a class="deselect-btn btn-gray selected" href="#" title="'+f(i(1).call(t,"Deselect All",{
hash:{},data:a}))+'" data-toggle="tooltip"><i class="glyphicon unchecked"></i></a> </li> <li> <a class="sync-btn btn-gray" href="#" title="'+f(i(1).call(t,"Sync",{hash:{},data:a}))+'" data-toggle="tooltip"><i class="glyphicon download"></i></a> </li> <li> <a class="share-btn btn-gray secondary-action" href="#" title="'+f(i(1).call(t,"Share",{hash:{},data:a}))+'" data-toggle="tooltip"><i class="glyphicon share"></i></a> </li> <li> <a class="recommend-btn btn-gray secondary-action" href="#" title="'+f(i(1).call(t,"Recommend",{
hash:{},data:a}))+'" data-toggle="tooltip"><i class="glyphicon share-alt"></i></a> </li> <li> <a class="delete-btn btn-gray secondary-action" href="#" title="'+f(i(1).call(t,"Delete",{hash:{},data:a}))+'" data-toggle="tooltip"><i class="glyphicon bin"></i></a> </li> <li> <a class="delete-from-user-playlist-btn btn-gray secondary-action" href="#" title="'+f(i(1).call(t,"Delete",{hash:{},data:a}))+'" data-toggle="tooltip"><i class="glyphicon bin"></i></a> </li> <li> <a class="info-btn btn-gray secondary-action" href="#" title="'+f(i(1).call(t,"Info",{
hash:{},data:a}))+'" data-toggle="tooltip"><i class="glyphicon circle-info"></i></a> </li> <li class="secondary-actions-dropdown dropdown"> <a class="more-btn btn-gray dropdown-toggle" href="#" data-toggle="dropdown"><i class="glyphicon more"></i></a> <ul class="dropdown-menu"> <li><a class="play-version-btn secondary-only" href="#">'+f(i(1).call(t,"Play Version...",{hash:{},data:a}))+'</a></li> <li><a class="play-all-btn secondary-only" href="#">',h=n.if.call(t,t&&t.isSingleItem,{hash:{},inverse:m.program(3,o,a),
fn:m.program(1,r,a),data:a}),(h||0===h)&&(p+=h),p+="</a></li> ",h=n.if.call(t,t&&t.showQueue,{hash:{},inverse:m.noop,fn:m.program(5,l,a),data:a}),(h||0===h)&&(p+=h),p+=" ",h=n.if.call(t,t&&t.showQueue,{hash:{},inverse:m.noop,fn:m.program(8,u,a),data:a}),(h||0===h)&&(p+=h),p+=' <li><a class="play-mixradio-btn secondary-only" href="#">'+f(i(1).call(t,"Start Artist MixRadio",{hash:{},data:a}))+'</a></li> <li class="secondary-divider divider"></li> <li><a class="convert-btn" href="#">'+f(i(1).call(t,"Optimize...",{
hash:{},data:a}))+'</a></li> <li><a class="analyze-btn" href="#">'+f(i(1).call(t,"Analyze",{hash:{},data:a}))+'</a></li> <li><a class="match-btn secondary-only" href="#">'+f(i(1).call(t,"Match",{hash:{},data:a}))+'</a></li> <li><a class="fix-match-btn secondary-only" href="#">'+f(i(1).call(t,"Fix Incorrect Match",{hash:{},data:a}))+'</a></li> <li><a class="unmatch-btn secondary-only" href="#">'+f(i(1).call(t,"Unmatch",{hash:{},data:a}))+'</a></li> <li><a class="split-apart-btn secondary-only" href="#">'+f(i(1).call(t,"Split Apart",{
hash:{},data:a}))+"</a></li> ",h=n.if.call(t,t&&t.downloadUrl,{hash:{},inverse:m.noop,fn:m.program(10,d,a),data:a}),(h||0===h)&&(p+=h),p+=' <li><a class="watch-later-btn" href="#" tabindex="-1">'+f(i(1).call(t,"Watch Later",{hash:{},data:a}))+'</a></li> <li><a class="share-btn" href="#">'+f(i(1).call(t,"Share",{hash:{},data:a}))+'</a></li> <li><a class="recommend-btn" href="#">'+f(i(1).call(t,"Recommend",{hash:{},data:a}))+'</a></li> <li><a class="delete-btn has-danger" href="#">'+f(i(1).call(t,"Delete",{
hash:{},data:a}))+'</a></li> <li><a class="delete-versions-btn has-danger secondary-only" href="#">'+f(i(1).call(t,"Delete Versions",{hash:{},data:a}))+'</a></li> <li><a class="delete-from-user-playlist-btn has-danger" href="#">'+f(i(1).call(t,"Delete",{hash:{},data:a}))+'</a></li> <li><a class="info-btn" href="#">'+f(i(1).call(t,"Info",{hash:{},data:a}))+"</a></li> </ul> </li> </ul> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],
n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<div class="action-bar"> <ul class="nav action-bar-nav"> <li> <a class="options-btn btn-gray" href="#" title="'+o(i(1).call(t,"Options",{hash:{},data:a}))+'" data-toggle="tooltip"><i class="glyphicon show-lines"></i></a> </li> </ul> </div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;
return r+='<div class="action-bar"> <ul class="nav action-bar-nav"> <li> <a class="options-btn btn-gray" href="#" title="'+o(i(1).call(t,"Options",{hash:{},data:a}))+'" data-toggle="tooltip"><i class="glyphicon show-lines"></i></a> </li> <li> <a class="play-btn btn-gray" href="#" title="'+o(i(1).call(t,"Play All",{hash:{},data:a}))+'" data-toggle="tooltip"><i class="glyphicon play"></i></a> </li> <li> <a class="play-shuffled-btn btn-gray" href="#" title="'+o(i(1).call(t,"Shuffle",{hash:{},data:a}))+'" data-toggle="tooltip"><i class="glyphicon random"></i></a> </li> <li> <a class="add-to-playlist-btn btn-gray" href="#" title="'+o(i(1).call(t,"Add to playlist",{
hash:{},data:a}))+'" data-toggle="tooltip"><i class="plex-icon-add-to-playlist"></i></a> </li> <li> <a class="select-btn btn-gray" href="#" title="'+o(i(1).call(t,"Select",{hash:{},data:a}))+'" data-toggle="tooltip"><i class="glyphicon check"></i></a> </li> <li> <a class="deselect-btn btn-gray selected" href="#" title="'+o(i(1).call(t,"Deselect All",{hash:{},data:a}))+'" data-toggle="tooltip"><i class="glyphicon unchecked"></i></a> </li> <li> <a class="edit-btn btn-gray" href="#" title="'+o(i(1).call(t,"Edit",{
hash:{},data:a}))+'" data-toggle="tooltip"><i class="glyphicon pencil"></i></a> </li> <li> <a class="mark-watched-btn btn-gray" href="#" title="'+o(i(1).call(t,"Mark as Watched",{hash:{},data:a}))+'" data-toggle="tooltip"><i class="glyphicon circle-ok"></i></a> </li> <li> <a class="mark-unwatched-btn btn-gray" href="#" title="'+o(i(1).call(t,"Mark as Unwatched",{hash:{},data:a}))+'" data-toggle="tooltip"><i class="glyphicon circle-minus"></i></a> </li> <li> <a class="sync-btn btn-gray" href="#" title="'+o(i(1).call(t,"Sync",{
hash:{},data:a}))+'" data-toggle="tooltip"><i class="glyphicon download"></i></a> </li> <li class="secondary-actions-dropdown dropdown"> <a class="more-btn btn-gray dropdown-toggle" href="#" data-toggle="dropdown"><i class="glyphicon more"></i></a> <ul class="dropdown-menu"> <li><a class="convert-btn secondary-only" href="#">'+o(i(1).call(t,"Optimize...",{hash:{},data:a}))+'</a></li> <li><a class="refresh-btn secondary-only" href="#">'+o(i(1).call(t,"Refresh",{hash:{},data:a}))+'</a></li> <li><a class="analyze-btn secondary-only" href="#">'+o(i(1).call(t,"Analyze",{
hash:{},data:a}))+'</a></li> <li><a class="add-to-collection-btn secondary-only" href="#">'+o(i(1).call(t,"Add to Collection...",{hash:{},data:a}))+'</a></li> <li><a class="merge-btn secondary-only" href="#">'+o(i(1).call(t,"Merge",{hash:{},data:a}))+'</a></li> <li><a class="delete-btn has-danger secondary-only" href="#">'+o(i(1).call(t,"Delete",{hash:{},data:a}))+"</a></li> </ul> </li> </ul> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){
return"selected"}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var o,l="",c=this,u=this.escapeExpression;return l+='<ul class="nav nav-header pull-right"> <li class="alerts-nav-item"><a class="alerts-btn btn-gray ',o=i(10).call(t,t&&t.subset,"alerts",{hash:{},inverse:c.noop,fn:c.program(1,r,a),data:a}),(o||0===o)&&(l+=o),l+='" href="#!/activity/alerts">'+u(i(1).call(t,"Alerts",{hash:{},data:a}))+'</a></li> <li class="sync-nav-item"><a class="sync-btn btn-gray ',o=i(10).call(t,t&&t.subset,"sync",{
hash:{},inverse:c.noop,fn:c.program(1,r,a),data:a}),(o||0===o)&&(l+=o),l+='" href="#!/activity/sync">'+u(i(1).call(t,"Sync",{hash:{},data:a}))+'</a></li> <li class="conversion-nav-item"><a class="conversion-btn btn-gray ',o=i(10).call(t,t&&t.subset,"conversion",{hash:{},inverse:c.noop,fn:c.program(1,r,a),data:a}),(o||0===o)&&(l+=o),l+='" href="#!/activity/conversion">'+u(i(1).call(t,"Conversion",{hash:{},data:a}))+'<span class="badge"></span></a></li> <li class="now-playing-nav-item"><a class="now-playing-btn btn-gray ',
o=i(10).call(t,t&&t.subset,"nowPlaying",{hash:{},inverse:c.noop,fn:c.program(1,r,a),data:a}),(o||0===o)&&(l+=o),l+='" href="#!/activity/playing">'+u(i(1).call(t,"Now Playing",{hash:{},data:a}))+'<span class="badge"></span></a></li> </ul> <h2>'+u(i(1).call(t,"Activity",{hash:{},data:a}))+'</h2> <div class="activity-container"></div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var s,a="";return a+=' <div class="filter-bar-right"> <span class="page-count">'+h(i(1).call(e,"{1} of {2}",e&&e.page,e&&e.pages,{
hash:{},data:t}))+'</span> <a class="previous-btn btn-gray ',s=n.unless.call(e,e&&e.enablePrevious,{hash:{},inverse:p.noop,fn:p.program(2,o,t),data:t}),(s||0===s)&&(a+=s),a+='" href="#"> <i class="glyphicon chevron-left"></i> </a> <a class="next-btn btn-gray ',s=n.unless.call(e,e&&e.enableNext,{hash:{},inverse:p.noop,fn:p.program(2,o,t),data:t}),(s||0===s)&&(a+=s),a+='" href="#"> <i class="glyphicon chevron-right"></i> </a> </div> '}function o(e,t){return"disabled"}function l(e,t){var n="";return n+=' <div class="row row-padded"> <div class="col-md-8 col-md-offset-2"> <h4 class="text-muted text-center">'+h(i(1).call(e,"Alerts are restricted from shared users.",{
hash:{},data:t}))+"</h4> </div> </div> "}function c(e,t){return' <div class="alert-list-container"></div> '}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var u,d="",h=this.escapeExpression,p=this;return d+='<div class="filter-bar"> ',u=n.unless.call(t,t&&t.shared,{hash:{},inverse:p.noop,fn:p.program(1,r,a),data:a}),(u||0===u)&&(d+=u),d+=" </div> ",u=n.if.call(t,t&&t.shared,{hash:{},inverse:p.program(6,c,a),fn:p.program(4,l,a),data:a}),(u||0===u)&&(d+=u),d+=" "})},function(e,t,i){
var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var s,a="";return a+=' <div class="filter-bar-right"> <button class="pause-btn btn btn-sm btn-default ',s=n.if.call(e,e&&e.isPaused,{hash:{},inverse:f.noop,fn:f.program(2,o,t),data:t}),(s||0===s)&&(a+=s),a+='">'+m(i(1).call(e,"Pause",{hash:{},data:t}))+'</button> <button class="resume-btn btn btn-sm btn-primary ',s=n.unless.call(e,e&&e.isPaused,{hash:{},inverse:f.noop,fn:f.program(2,o,t),data:t}),(s||0===s)&&(a+=s),a+='">'+m(i(1).call(e,"Resume",{
hash:{},data:t}))+"</button> </div> "}function o(e,t){return"hidden"}function l(e,t){var n,s="";return s+=' <p class="conversion-error-message"><i class="conversion-error-icon glyphicon circle-exclamation-mark text-danger"></i> '+m((n=e&&e.errorMessage,typeof n===g?n.apply(e):n))+" "+m(i(1).call(e,"Check the status in {1}Optimized Versions Settings{2}.",'<a href="#!/settings/server/{3}/versions">',"</a>",e&&e.serverID,{hash:{},data:t}))+"</p> "}function c(e,t){var n="";return n+=' <p class="conversion-status-message">'+m(i(1).call(e,"Manage your completed conversions in {1}Optimized Versions Settings{2}.",'<a href="#!/settings/server/{3}/versions">',"</a>",e&&e.serverID,{
hash:{},data:t}))+"</p> "}function u(e,t){var i,s="";return s+=' <div class="conversion-queue-empty-region"></div> <div class="conversion-queue-up-next-list-region"></div> <hr class="conversion-queue-divider ',i=n.unless.call(e,e&&e.shouldShowDivider,{hash:{},inverse:f.noop,fn:f.program(2,o,t),data:t}),(i||0===i)&&(s+=i),s+='"> <div class="conversion-queue-after-up-next-list-region"></div> '}function d(e,t){var n="";return n+=' <div class="row row-padded"> <h4 class="text-muted text-center"> '+m(i(1).call(e,"This requires Plex Media Server {1} or later.",e&&e.minServerVersion,{
hash:{},data:t}))+" </h4> </div> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var h,p="",f=this,m=this.escapeExpression,g="function";return p+='<div class="conversion-filter-bar filter-bar"> ',h=n.if.call(t,t&&t.hasPausedSetting,{hash:{},inverse:f.noop,fn:f.program(1,r,a),data:a}),(h||0===h)&&(p+=h),p+=" </div> ",h=n.if.call(t,t&&t.errorMessage,{hash:{},inverse:f.program(6,c,a),fn:f.program(4,l,a),data:a}),(h||0===h)&&(p+=h),p+=" ",h=n.if.call(t,t&&t.shouldShowList,{hash:{},
inverse:f.program(10,d,a),fn:f.program(8,u,a),data:a}),(h||0===h)&&(p+=h),p+=" "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return' <div class="sessions-list-container"></div> '}function o(e,t){var i,s="";return s+=' <div class="row row-padded"> <h4 class="text-muted text-center"> ',i=n.if.call(e,e&&e.shared,{hash:{},inverse:m.program(6,c,t),fn:m.program(4,l,t),data:t}),(i||0===i)&&(s+=i),s+=" </h4> </div> "}function l(e,t){var n="";return n+=" "+f(i(1).call(e,"Now Playing is restricted from shared users.",{
hash:{},data:t}))+" "}function c(e,t){var i;return i=n.if.call(e,e&&e.synced,{hash:{},inverse:m.program(9,d,t),fn:m.program(7,u,t),data:t}),i||0===i?i:""}function u(e,t){var n="";return n+=" "+f(i(1).call(e,"Now Playing is unavailable with synced servers.",{hash:{},data:t}))+" "}function d(e,t){var n="";return n+=" "+f(i(1).call(e,"Now Playing requires Plex Media Server {1} or later.",e&&e.minServerVersion,{hash:{},data:t}))+" "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var h,p="",f=this.escapeExpression,m=this;
return p+='<div class="filter-bar"></div> ',h=n.if.call(t,t&&t.shouldShowList,{hash:{},inverse:m.program(3,o,a),fn:m.program(1,r,a),data:a}),(h||0===h)&&(p+=h),p+=" "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<div class="row row-loading"> <div class="loading loading-inline"></div> </div> <div class="sync-empty-message row row-padded hidden"> <h4 class="text-muted text-center"> '+o(i(1).call(t,"Nothing is synced to this device.",{
hash:{},data:a}))+' </h4> </div> <div class="sync-item-list-container"></div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return'<a class="edit-btn btn-gray" href="#"><i class="glyphicon pencil"></i></a>'}function o(e,t){var i,s="";return s+=" ",i=n.if.call(e,e&&e.devices,{hash:{},inverse:x.program(14,f,t),fn:x.program(4,l,t),data:t}),(i||0===i)&&(s+=i),s+=" "}function l(e,t){var i,s="";return s+=' <div class="row"> <div class="col-sm-4 col-md-3"> <ul class="nav nav-cards"> ',
i=n.each.call(e,e&&e.devices,{hash:{},inverse:x.noop,fn:x.programWithDepth(5,c,t,e),data:t}),(i||0===i)&&(s+=i),s+=' </ul> </div> <div class="sync-device-container col-sm-8 col-md-9"></div> </div> '}function c(e,t,s){var a,r="";return r+=' <li> <a class="card btn-gray ',a=i(10).call(e,(a=s&&s.selectedDevice,null==a||a===!1?a:a.id),e&&e.id,{hash:{},inverse:x.noop,fn:x.program(6,u,t),data:t}),(a||0===a)&&(r+=a),r+='" data-id="'+w((a=e&&e.id,typeof a===b?a.apply(e):a))+'" href="#"> ',a=n.if.call(e,e&&e.name,{
hash:{},inverse:x.program(10,h,t),fn:x.program(8,d,t),data:t}),(a||0===a)&&(r+=a),r+=" ",a=n.if.call(e,e&&e.isCloudSync,{hash:{},inverse:x.noop,fn:x.program(12,p,t),data:t}),(a||0===a)&&(r+=a),r+=" </a> </li> "}function u(e,t){return"selected"}function d(e,t){var i;return w((i=e&&e.name,typeof i===b?i.apply(e):i))}function h(e,t){var i;return w((i=e&&e.device,typeof i===b?i.apply(e):i))}function p(e,t){return'<i class="cloud-sync-icon glyphicon cloud"></i><button class="cloud-sync-settings-btn btn-link btn-gray"><i class="glyphicon cogwheel"></i></button>';
}function f(e,t){var n="";return n+=' <div class="row row-padded"> <h4 class="text-muted text-center">'+w(i(1).call(e,"You have no sync capable devices.",{hash:{},data:t}))+"</h4> </div> "}function m(e,t){var i,s="";return s+=' <div class="row row-padded"> <h4 class="text-muted text-center">'+w((i=e&&e.plexPassInfo,i=null==i||i===!1?i:i.message,typeof i===b?i.apply(e):i))+'</h4> <p class="text-center ',i=n.unless.call(e,(i=e&&e.plexPassInfo,null==i||i===!1?i:i.showButton),{hash:{},inverse:x.noop,
fn:x.program(17,g,t),data:t}),(i||0===i)&&(s+=i),s+='"> <a class="btn btn-sm btn-primary" href="'+w((i=e&&e.plexPassInfo,i=null==i||i===!1?i:i.url,typeof i===b?i.apply(e):i))+'" target="'+w((i=e&&e.plexPassInfo,i=null==i||i===!1?i:i.target,typeof i===b?i.apply(e):i))+'">'+w((i=e&&e.plexPassInfo,i=null==i||i===!1?i:i.buttonText,typeof i===b?i.apply(e):i))+"</a> </p> </div> "}function g(e,t){return"hidden"}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var v,y="",b="function",w=this.escapeExpression,x=this;
return y+='<div class="filter-bar"> <div class="filter-bar-right"> ',v=n.if.call(t,t&&t.hasTouchScreen,{hash:{},inverse:x.noop,fn:x.program(1,r,a),data:a}),(v||0===v)&&(y+=v),y+=' <a class="refresh-btn btn-gray" href="#"><i class="glyphicon repeat"></i></a> </div> </div> ',v=n.if.call(t,t&&t.hasPlexPass,{hash:{},inverse:x.program(16,m,a),fn:x.program(3,o,a),data:a}),(v||0===v)&&(y+=v),y+=" "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){this.compilerInfo=[4,">= 1.0.0"],
i=this.merge(i,e.helpers),s=s||{};var a,r,o="",l="function",c=this.escapeExpression;return o+='<button type="button" class="close-btn btn-link"><i class="glyphicon remove-2"></i></button> <span class="message">',(r=i.message)?a=r.call(t,{hash:{},data:s}):(r=t&&t.message,a=typeof r===l?r.call(t,{hash:{},data:s}):r),o+=c(a)+"</span> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return"circle-ok"}function o(e,t){return"circle-exclamation-mark"}
this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var l,c="",u=this,d="function";return c+='<button class="close-btn btn-link"><i class="glyphicon remove-2"></i></button> <i class="alert-icon glyphicon ',l=i(10).call(t,t&&t.type,"success",{hash:{},inverse:u.program(3,o,a),fn:u.program(1,r,a),data:a}),(l||0===l)&&(c+=l),c+='"></i> <h4>',l=t&&t.message,l=typeof l===d?l.apply(t):l,(l||0===l)&&(c+=l),c+="</h4> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){
this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<button type="button" class="close-btn btn-link"><i class="glyphicon remove-2"></i></button> <span class="message">'+o(i(1).call(t,"Experience new music features with a premium music library.",{hash:{},data:a}))+'</span> <a class="create-link link" href="#">'+o(i(1).call(t,"Create a library",{hash:{},data:a}))+'</a> <span class="message message-separator">&middot;</span> <a class="learn-more-link link" href="https://plex.tv/music" target="_blank">'+o(i(1).call(t,"Learn more",{
hash:{},data:a}))+"</a> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var n="";return n+=' <a class="download-link link" href="#">'+h(i(1).call(e,"Download now",{hash:{},data:t}))+"</a> "}function o(e,t){var n;return n=i(10).call(e,e&&e.state,"downloaded",{hash:{},inverse:f.program(6,c,t),fn:f.program(4,l,t),data:t}),n||0===n?n:""}function l(e,t){var n="";return n+=' <a class="install-link link" href="#">'+h(i(1).call(e,"Install now",{hash:{},
data:t}))+"</a> "}function c(e,t){var n,s="";return s+=' <a class="link" href="'+h((n=e&&e.downloadURL,typeof n===p?n.apply(e):n))+'" target="_blank">'+h(i(1).call(e,"Download now",{hash:{},data:t}))+"</a> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var u,d="",h=this.escapeExpression,p="function",f=this;return d+='<button type="button" class="close-btn btn-link"><i class="glyphicon remove-2"></i></button> <span class="message">'+h(i(1).call(t,"A Plex Media Server update is available!",{
hash:{},data:a}))+"</span> ",u=i(10).call(t,t&&t.state,"available",{hash:{},inverse:f.program(3,o,a),fn:f.program(1,r,a),data:a}),(u||0===u)&&(d+=u),d+=" "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){return this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{},'<i class="alert-icon glyphicon cardio"></i> <span class="status"></span> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){this.compilerInfo=[4,">= 1.0.0"],
i=this.merge(i,e.helpers),s=s||{};var a="";return a})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return'<a class="settings-btn btn-gray" href="#"><i class="glyphicon cogwheel"></i></a>'}function o(e,t){return"hidden"}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var l,c="",u=this,d=this.escapeExpression,h="function";return c+='<div class="breadcrumb-actions pull-right"> ',l=n.if.call(t,t&&t.showSettings,{hash:{},inverse:u.noop,
fn:u.program(1,r,a),data:a}),(l||0===l)&&(c+=l),c+=' <span id="channel-list-dropdown" class="dropdown"> <a class="btn-gray dropdown-toggle" href="#channel-list-dropdown" data-toggle="dropdown"><i class="glyphicon show-thumbnails"></i> <i class="caret-icon caret-icon-sm"></i></a> <ul class="dropdown-menu pull-right"> <li><a class="list-btn" data-type="media-tile-list" href="#">'+d(i(1).call(t,"Posters",{hash:{},data:a}))+'<i class="dropdown-selected-icon glyphicon ok-2 ',l=i(36).call(t,t&&t.listType,"media-tile-list",{
hash:{},inverse:u.noop,fn:u.program(3,o,a),data:a}),(l||0===l)&&(c+=l),c+='"></i></a></li> <li><a class="list-btn" data-type="media-details-list" href="#">'+d(i(1).call(t,"Details",{hash:{},data:a}))+'<i class="dropdown-selected-icon glyphicon ok-2 ',l=i(36).call(t,t&&t.listType,"media-details-list",{hash:{},inverse:u.noop,fn:u.program(3,o,a),data:a}),(l||0===l)&&(c+=l),c+='"></i></a></li> <li><a class="list-btn" data-type="media-list" href="#">'+d(i(1).call(t,"List",{hash:{},data:a}))+'<i class="dropdown-selected-icon glyphicon ok-2 ',
l=i(36).call(t,t&&t.listType,"media-list",{hash:{},inverse:u.noop,fn:u.program(3,o,a),data:a}),(l||0===l)&&(c+=l),c+='"></i></a></li> </ul> </span> </div> <span class="breadcrumb-dropdown"><a href="'+d((l=t&&t.channelUrl,typeof l===h?l.apply(t):l))+'">'+d((l=t&&t.channelTitle,typeof l===h?l.apply(t):l))+'</a></span> <span class="breadcrumb-subset-dropdown ',l=n.unless.call(t,t&&t.title,{hash:{},inverse:u.noop,fn:u.program(3,o,a),data:a}),(l||0===l)&&(c+=l),c+='"><span class="dropdown-placeholder">'+d((l=t&&t.title,
typeof l===h?l.apply(t):l))+'</span></span> <span class="list-badge badge badge-lg">'+d((l=t&&t.totalSize,typeof l===h?l.apply(t):l))+"</span> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var n,s="";return s+=' <span id="section-list-dropdown" class="dropdown"> <a class="btn-gray dropdown-toggle" href="#section-list-dropdown" data-toggle="dropdown"><i class="glyphicon show-thumbnails"></i> <i class="caret-icon caret-icon-sm"></i></a> <ul class="dropdown-menu pull-right"> <li><a class="list-btn" data-type="episode-tile-list" href="#">'+g(i(1).call(e,"Posters",{
hash:{},data:t}))+'<i class="dropdown-selected-icon glyphicon ok-2 ',n=i(36).call(e,e&&e.listType,"episode-tile-list",{hash:{},inverse:v.noop,fn:v.program(2,o,t),data:t}),(n||0===n)&&(s+=n),s+='"></i></a></li> <li><a class="list-btn" data-type="episode-details-list" href="#">'+g(i(1).call(e,"Details",{hash:{},data:t}))+'<i class="dropdown-selected-icon glyphicon ok-2 ',n=i(36).call(e,e&&e.listType,"episode-details-list",{hash:{},inverse:v.noop,fn:v.program(2,o,t),data:t}),(n||0===n)&&(s+=n),s+='"></i></a></li> <li><a class="list-btn" data-type="episode-list" href="#">'+g(i(1).call(e,"List",{
hash:{},data:t}))+'<i class="dropdown-selected-icon glyphicon ok-2 ',n=i(36).call(e,e&&e.listType,"episode-list",{hash:{},inverse:v.noop,fn:v.program(2,o,t),data:t}),(n||0===n)&&(s+=n),s+='"></i></a></li> </ul> </span> '}function o(e,t){return"hidden"}function l(e,t){var i,s="";return s+=' <span id="section-dropdown" class="details-breadcrumb dropdown"> ',i=n.if.call(e,e&&e.section,{hash:{},inverse:v.program(7,u,t),fn:v.program(5,c,t),data:t}),(i||0===i)&&(s+=i),s+=' <a class="btn-gray dropdown-toggle split-dropdown-toggle" href="#section-dropdown" data-toggle="dropdown"> <i class="caret-icon caret-icon-sm"></i> </a> <ul class="dropdown-menu"> ',
i=n.if.call(e,e&&e.showPlaylists,{hash:{},inverse:v.noop,fn:v.program(9,d,t),data:t}),(i||0===i)&&(s+=i),s+=" ",i=n.each.call(e,e&&e.sections,{hash:{},inverse:v.noop,fn:v.programWithDepth(12,p,t,e),data:t}),(i||0===i)&&(s+=i),s+=" </ul> </span> "}function c(e,t){var i,n="";return n+=' <a class="section-btn btn-gray" data-key="'+g((i=e&&e.section,i=null==i||i===!1?i:i.key,typeof i===y?i.apply(e):i))+'" href="#">'+g((i=e&&e.section,i=null==i||i===!1?i:i.title,typeof i===y?i.apply(e):i))+"</a> "}function u(e,t){
var n="";return n+=' <a class="playlists-btn btn-gray" href="#">'+g(i(1).call(e,"Playlists",{hash:{},data:t}))+"</a> "}function d(e,t){var s,a="";return a+=' <li><a class="playlists-btn" href="#"><span class="dropdown-truncated-label">'+g(i(1).call(e,"Playlists",{hash:{},data:t}))+"</span>",s=n.unless.call(e,(s=e&&e.section,null==s||s===!1?s:s.key),{hash:{},inverse:v.noop,fn:v.program(10,h,t),data:t}),(s||0===s)&&(a+=s),a+="</a></li> "}function h(e,t){return'<i class="dropdown-selected-icon glyphicon ok-2"></i>';
}function p(e,t,n){var s,a="";return a+=' <li><a class="section-btn" data-key="'+g((s=e&&e.key,typeof s===y?s.apply(e):s))+'" href="#"><span class="dropdown-truncated-label">'+g((s=e&&e.title,typeof s===y?s.apply(e):s))+'</span><i class="dropdown-selected-icon glyphicon ok-2 ',s=i(36).call(e,(s=n&&n.section,null==s||s===!1?s:s.key),e&&e.key,{hash:{},inverse:v.noop,fn:v.program(2,o,t),data:t}),(s||0===s)&&(a+=s),a+='"></i></a></li> '}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};
var f,m="",g=this.escapeExpression,v=this,y="function";return m+='<div class="breadcrumb-actions pull-right"> ',f=n.if.call(t,t&&t.listType,{hash:{},inverse:v.noop,fn:v.program(1,r,a),data:a}),(f||0===f)&&(m+=f),m+=' <a class="previous-btn btn-gray hidden" href="#"><i class="glyphicon chevron-left"></i></a> <a class="next-btn btn-gray hidden" href="#"><i class="glyphicon chevron-right"></i></a> </div> ',f=n.if.call(t,t&&t.showSectionDropdown,{hash:{},inverse:v.noop,fn:v.program(4,l,a),data:a}),(f||0===f)&&(m+=f),
m+=' <span class="grandparent-item hidden"></span> <span class="parents-dropdown hidden"></span> <span class="siblings-dropdown hidden"></span> <span class="current-item hidden"></span> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var n="";return n+=' <span id="section-actions-dropdown" class="dropdown"> <a class="btn-gray dropdown-toggle" href="#section-actions-dropdown" data-toggle="dropdown"><i class="glyphicon cogwheel"></i> <i class="caret-icon caret-icon-sm"></i></a> <ul class="dropdown-menu pull-right"> <li><a class="import-btn" href="#">'+c(i(1).call(e,"Import from iTunes",{
hash:{},data:t}))+"</a></li> </ul> </span> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var o,l="",c=this.escapeExpression,u=this,d="function";return l+='<div class="breadcrumb-actions pull-right"> ',o=n.if.call(t,t&&t.canImportPlaylists,{hash:{},inverse:u.noop,fn:u.program(1,r,a),data:a}),(o||0===o)&&(l+=o),l+=' </div> <span class="breadcrumb-dropdown"></span> <span class="breadcrumb-subset-dropdown"></span> <span class="breadcrumb-items-dropdown"> <span class="items-badge badge badge-lg">'+c((o=t&&t.totalSize,
typeof o===d?o.apply(t):o))+"</span> </span> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var s,a="";return a+=' <a class="update-btn btn-gray btn-loading btn-loading-replace btn-loading-static ',s=n.if.call(e,e&&e.refreshing,{hash:{},inverse:d.noop,fn:d.program(2,o,t),data:t}),(s||0===s)&&(a+=s),a+='" href="#" title="'+p((s=e&&e.updateTitle,typeof s===h?s.apply(e):s))+'" data-title-alt="'+p((s=e&&e.updateTitleAlt,typeof s===h?s.apply(e):s))+'" data-toggle="tooltip"> <span class="loading loading-bc"></span> <i class="btn-label-alt glyphicon ban"></i> <i class="btn-label glyphicon repeat"></i> </a> <span id="section-actions-dropdown" class="dropdown"> <a class="btn-gray dropdown-toggle" href="#section-actions-dropdown" data-toggle="dropdown"><i class="glyphicon cogwheel"></i> <i class="caret-icon caret-icon-sm"></i></a> <ul class="dropdown-menu pull-right"> <li><a class="edit-btn btn-gray" href="#">'+p(i(1).call(e,"Edit Library",{
hash:{},data:t}))+'</a></li> <li><a class="share-btn" href="#">'+p(i(1).call(e,"Share...",{hash:{},data:t}))+'</a></li> <li><a class="analyze-btn" href="#">'+p(i(1).call(e,"Analyze",{hash:{},data:t}))+'</a></li> <li><a class="force-refresh-btn" href="#">'+p(i(1).call(e,"Refresh All",{hash:{},data:t}))+'</a></li> <li><a class="empty-trash-btn" href="#">'+p(i(1).call(e,"Empty Trash",{hash:{},data:t}))+'</a></li> <li><a class="delete-btn has-danger" href="#">'+p(i(1).call(e,"Delete Library",{hash:{},
data:t}))+"</a></li> </ul> </span> "}function o(e,t){return"active"}function l(e,t){return"hidden"}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var c,u="",d=this,h="function",p=this.escapeExpression;return u+='<div class="breadcrumb-actions pull-right"> ',c=n.unless.call(t,t&&t.limited,{hash:{},inverse:d.noop,fn:d.program(1,r,a),data:a}),(c||0===c)&&(u+=c),u+=' <span id="section-list-dropdown" class="dropdown"> <a class="btn-gray dropdown-toggle" href="#section-list-dropdown" data-toggle="dropdown"><i class="glyphicon show-thumbnails"></i> <i class="caret-icon caret-icon-sm"></i></a> <ul class="dropdown-menu pull-right"> <li><a class="list-btn" data-type="media-tile-list" href="#">'+p(i(1).call(t,"Posters",{
hash:{},data:a}))+'<i class="dropdown-selected-icon glyphicon ok-2 ',c=i(36).call(t,t&&t.listType,"media-tile-list",{hash:{},inverse:d.noop,fn:d.program(4,l,a),data:a}),(c||0===c)&&(u+=c),u+='"></i></a></li> <li><a class="list-btn" data-type="media-details-list" href="#">'+p(i(1).call(t,"Details",{hash:{},data:a}))+'<i class="dropdown-selected-icon glyphicon ok-2 ',c=i(36).call(t,t&&t.listType,"media-details-list",{hash:{},inverse:d.noop,fn:d.program(4,l,a),data:a}),(c||0===c)&&(u+=c),u+='"></i></a></li> <li><a class="list-btn" data-type="media-list" href="#">'+p(i(1).call(t,"List",{
hash:{},data:a}))+'<i class="dropdown-selected-icon glyphicon ok-2 ',c=i(36).call(t,t&&t.listType,"media-list",{hash:{},inverse:d.noop,fn:d.program(4,l,a),data:a}),(c||0===c)&&(u+=c),u+='"></i></a></li> </ul> </span> </div> <span class="breadcrumb-dropdown"></span> <span class="breadcrumb-subset-dropdown"></span> <span class="breadcrumb-type-dropdown"></span> <span class="breadcrumb-items-dropdown"> <span class="items-badge badge badge-lg">'+p((c=t&&t.totalSize,typeof c===h?c.apply(t):c))+"</span> </span> ";
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t,n){var s,a="";return a+=' <li><a class="card btn-gray ',s=i(10).call(e,n&&n.currentKey,e&&e.key,{hash:{},inverse:u.noop,fn:u.program(2,o,t),data:t}),(s||0===s)&&(a+=s),a+='" href="#!/server/'+d(i(32).call(e,n&&n.serverID,{hash:{},data:t}))+"/directory/"+d(i(32).call(e,e&&e.key,{hash:{},data:t}))+'">'+d(i(1).call(e,e&&e.title,{hash:{},data:t}))+"</a></li> "}function o(e,t){return"selected"}this.compilerInfo=[4,">= 1.0.0"],
n=this.merge(n,e.helpers),a=a||{};var l,c="",u=this,d=this.escapeExpression;return c+="<h2>"+d(i(1).call(t,"Channel Directory",{hash:{},data:a}))+'</h2> <div class="filter-bar"> <a class="btn btn-sm btn-default pull-right" href="#!/server/'+d(i(32).call(t,t&&t.serverID,{hash:{},data:a}))+'/channels">'+d(i(1).call(t,"Browse Channels",{hash:{},data:a}))+'</a> </div> <div class="row"> <div class="col-md-3"> <ul class="nav nav-cards"> ',l=n.each.call(t,t&&t.directories,{hash:{},inverse:u.noop,fn:u.programWithDepth(1,r,a,t),
data:a}),(l||0===l)&&(c+=l),c+=' </ul> </div> <div class="directory-container col-md-9"></div> </div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var a="";return a})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var i,n="";return n+='<span class="badge">'+f((i=e&&e.allCount,typeof i===p?i.apply(e):i))+"</span>"}function o(e,t){var i,n="";return n+='<span class="badge">'+f((i=e&&e.videoCount,
typeof i===p?i.apply(e):i))+"</span>"}function l(e,t){var i,n="";return n+='<span class="badge">'+f((i=e&&e.musicCount,typeof i===p?i.apply(e):i))+"</span>"}function c(e,t){var i,n="";return n+='<span class="badge">'+f((i=e&&e.photoCount,typeof i===p?i.apply(e):i))+"</span>"}function u(e,t){var n="";return n+=' <div class="filter-bar"> <a class="btn btn-sm btn-primary pull-right" href="#!/server/'+f(i(32).call(e,e&&e.serverID,{hash:{},data:t}))+'/directory">'+f(i(1).call(e,"Install Channels",{hash:{},
data:t}))+'</a> <a class="check-updates-btn btn btn-sm btn-default btn-loading" href="#"> <div class="loading loading-sm"></div> <span class="btn-label">'+f(i(1).call(e,"Check for Updates",{hash:{},data:t}))+"</span> </a> </div> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var d,h="",p="function",f=this.escapeExpression,m=this;return h+='<ul class="nav nav-header pull-right"> <li><a class="all-btn btn-gray selected" href="#">'+f(i(1).call(t,"All",{hash:{},data:a})),d=n.if.call(t,t&&t.allCount,{
hash:{},inverse:m.noop,fn:m.program(1,r,a),data:a}),(d||0===d)&&(h+=d),h+='</a></li> <li><a class="video-btn btn-gray" href="#">'+f(i(1).call(t,"Video",{hash:{},data:a})),d=n.if.call(t,t&&t.videoCount,{hash:{},inverse:m.noop,fn:m.program(3,o,a),data:a}),(d||0===d)&&(h+=d),h+='</a></li> <li><a class="music-btn btn-gray" href="#">'+f(i(1).call(t,"Music",{hash:{},data:a})),d=n.if.call(t,t&&t.musicCount,{hash:{},inverse:m.noop,fn:m.program(5,l,a),data:a}),(d||0===d)&&(h+=d),h+='</a></li> <li><a class="photo-btn btn-gray" href="#">'+f(i(1).call(t,"Photo",{
hash:{},data:a})),d=n.if.call(t,t&&t.photoCount,{hash:{},inverse:m.noop,fn:m.program(7,c,a),data:a}),(d||0===d)&&(h+=d),h+="</a></li> </ul> <h2>"+f(i(1).call(t,"Channels",{hash:{},data:a}))+"</h2> ",d=n.unless.call(t,t&&t.shared,{hash:{},inverse:m.noop,fn:m.program(9,u,a),data:a}),(d||0===d)&&(h+=d),h+=' <div class="channels-container"></div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;
return r+='<ul class="nav nav-header nav-dashboard pull-right"> <li><a class="previous-btn btn-gray" href="#"><i class="glyphicon chevron-left"></i></a></li> <li><a class="next-btn btn-gray" href="#"><i class="glyphicon chevron-right"></i></a></li> </ul> <h2>'+o(i(1).call(t,"Channels",{hash:{},data:a}))+'</h2> <div class="dashboard-list-container"></div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var n="";return n+=' <p class="text-muted">'+f(i(1).call(e,"None of your shared libraries are available.",{
hash:{},data:t}))+"</p> "}function o(e,t){var i;return i=n.if.call(e,e&&e.isManagedUser,{hash:{},inverse:m.program(6,c,t),fn:m.program(4,l,t),data:t}),i||0===i?i:""}function l(e,t){var n="";return n+=' <p class="text-muted">'+f(i(1).call(e,"No one in your home has shared a library with you.",{hash:{},data:t}))+"</p> "}function c(e,t){var i;return i=n.if.call(e,e&&e.bundled,{hash:{},inverse:m.program(9,d,t),fn:m.program(7,u,t),data:t}),i||0===i?i:""}function u(e,t){var n="";return n+=' <p class="text-muted">'+f(i(1).call(e,"You do not have permission to access this server.",{
hash:{},data:t}))+"</p> "}function d(e,t){var n="";return n+=' <p class="text-muted">'+f(i(1).call(e,"We couldn't find any media servers for you. {1}Download and install{2} one, be sure to {3}sign the server in{4}, and it'll appear here.",'<a href="https://plex.tv/downloads" target="_blank">',"</a>",'<a href="https://support.plex.tv/hc/en-us/articles/200878643-Sign-in-to-Your-Plex-Account" target="_blank">',"</a>",{hash:{},data:t}))+"</p> <p class=\"text-muted\"><a class='local-server-test-link' href='#'>"+f(i(1).call(e,"Already running a media server?",{
hash:{},data:t}))+"</a></p> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var h,p="",f=this.escapeExpression,m=this;return p+='<i class="plex-image server server-sm"></i> ',h=n.if.call(t,t&&t.hasSharedServers,{hash:{},inverse:m.program(3,o,a),fn:m.program(1,r,a),data:a}),(h||0===h)&&(p+=h),p+=" "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r,o="",l=this.escapeExpression,c="function";
return o+='<h4 class="text-muted"> '+l(i(1).call(t,"No queued items.",{hash:{},data:a}))+' <a href="'+l((r=t&&t.helpRoute,typeof r===c?r.apply(t):r))+'" target="'+l((r=t&&t.defaultTarget,typeof r===c?r.apply(t):r))+'">'+l(i(1).call(t,"Learn how to add videos to Watch Later.",{hash:{},data:a}))+"</a> </h4> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<ul class="nav nav-header nav-dashboard pull-right"> <li><a class="previous-btn btn-gray" href="#"><i class="glyphicon chevron-left"></i></a></li> <li><a class="next-btn btn-gray" href="#"><i class="glyphicon chevron-right"></i></a></li> </ul> <h2>'+o(i(1).call(t,t&&t.label,{
hash:{},data:a}))+'</h2> <div class="dashboard-list-container"></div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var i,n="";return n+=' <a class="user-playlist-help" href="'+u((i=e&&e.helpRoute,typeof i===c?i.apply(e):i))+'" target="'+u((i=e&&e.defaultTarget,typeof i===c?i.apply(e):i))+'"><i class="glyphicon circle-question-mark"></i></a> '}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var o,l="",c="function",u=this.escapeExpression,d=this;
return l+='<ul class="nav nav-header nav-dashboard pull-right"> <li><a class="previous-btn btn-gray disabled" href="#"><i class="glyphicon chevron-left"></i></a></li> <li><a class="next-btn btn-gray disabled" href="#"><i class="glyphicon chevron-right"></i></a></li> </ul> <h2> '+u(i(1).call(t,t&&t.label,{hash:{},data:a}))+' <a class="user-playlist-full" href="'+u((o=t&&t.playlistRoute,typeof o===c?o.apply(t):o))+'"><i class="button-icon plex-icon-circle-chevron-right"></i></a> ',o=n.if.call(t,t&&t.helpRoute,{
hash:{},inverse:d.noop,fn:d.program(1,r,a),data:a}),(o||0===o)&&(l+=o),l+=' </h2> <div class="dashboard-list-container"></div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){return this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{},'<div class="priority-1-container"></div> <div class="priority-2-container"></div> <div class="priority-3-container"></div> <div class="priority-4-container"></div> <div class="priority-5-container"></div> '})},function(e,t,i){
var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){function a(e,t){return' <a class="media-poster-container play-btn" href="#"> <div class="album-poster item-poster media-poster"> <div class="media-poster-overlay"></div> <div class="media-poster-overlay-icons"> <i class="media-poster-overlay-icon glyphicon play"></i> </div> </div> </a> '}function r(e,t){return' <div class="album-poster item-poster media-poster"></div> '}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};
var o,l,c="",u="function",d=this.escapeExpression,h=this;return c+='<div class="details-title-container"> <h1><a class="artist-title btn-metadata-link" href="#!/server/',(l=i.serverID)?o=l.call(t,{hash:{},data:s}):(l=t&&t.serverID,o=typeof l===u?l.call(t,{hash:{},data:s}):l),c+=d(o)+"/details/",(l=i.parentKey)?o=l.call(t,{hash:{},data:s}):(l=t&&t.parentKey,o=typeof l===u?l.call(t,{hash:{},data:s}):l),c+=d(o)+'"></a></h1> <h2 class="album-title"></h2> <h3 class="item-year"></h3> </div> <div class="details-metadata-container"> <div class="metadata-right pull-right"> <div class="item-genre metadata-tags"></div> </div> <p class="metadata-labels"> <span class="rating-container rating-container-inline"></span> </p> <div class="summary-container"></div> <div class="track-list-container details-list-region"></div> </div> <div class="details-poster-container"> ',
o=i.if.call(t,t&&t.canPlay,{hash:{},inverse:h.program(3,r,s),fn:h.program(1,a,s),data:s}),(o||0===o)&&(c+=o),c+=" </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return' <a class="media-poster-container play-btn" href="#"> <div class="artist-poster item-poster media-poster"> <div class="media-poster-overlay"></div> <div class="media-poster-overlay-icons"> <i class="media-poster-overlay-icon glyphicon play"></i> </div> </div> </a> '}function o(e,t){
return' <div class="artist-poster item-poster media-poster"></div> '}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var l,c="",u=this.escapeExpression,d=this;return c+='<div class="details-title-container"> <h1 class="item-title"></h1> </div> <div class="details-metadata-container"> <div class="artist-details-metadata-container"> <div class="metadata-right pull-right"> <div class="item-genre metadata-tags"></div> </div> <p class="metadata-labels"> </p> <div class="summary-container"></div> </div> <div class="popular-tracks-region hidden"> <h3 class="popular-tracks-header">'+u(i(1).call(t,"Popular Tracks",{
hash:{},data:a}))+'</h3> </div> <div class="albums-region details-list-region"> <h3 class="albums-header">'+u(i(1).call(t,"Albums",{hash:{},data:a}))+'</h3> </div> <div class="extras-region hidden"> <h3 class="extras-header">'+u(i(1).call(t,"Music Videos",{hash:{},data:a}))+'</h3> </div> <div class="concert-region hidden"> <h3 class="concert-region-header">'+u(i(1).call(t,"On Tour",{hash:{},data:a}))+'</h3> </div> <div class="similar-artists-region hidden"> <h3 class="similar-artists-header">'+u(i(1).call(t,"Similar Artists",{
hash:{},data:a}))+'</h3> </div> </div> <div class="details-poster-container"> ',l=n.if.call(t,t&&t.canPlay,{hash:{},inverse:d.program(3,o,a),fn:d.program(1,r,a),data:a}),(l||0===l)&&(c+=l),c+=" </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<div class="details-title-container"> <h1 class="item-title"></h1> <h2 class="item-year"></h2> </div> <div class="details-metadata-container"> <div class="metadata-right pull-right"> <div class="item-genre metadata-tags"></div> <div class="rating-container"></div> <div class="content-rating-flag-container"></div> </div> <p class="metadata-labels"> <span class="item-duration metadata-duration"></span> </p> <p class="item-tagline metadata-tagline"></p> <div class="item-director metadata-tags"> <span class="metadata-label">'+o(i(1).call(t,"Director",{
hash:{},data:a}))+'</span> <span class="metadata-tag-list"></span> </div> <div class="item-writer metadata-tags"> <span class="metadata-label">'+o(i(1).call(t,"Writer",{hash:{},data:a}))+'</span> <span class="metadata-tag-list"></span> </div> <div class="item-cast metadata-tags"> <span class="metadata-label">'+o(i(1).call(t,"Cast",{hash:{},data:a}))+'</span> <span class="metadata-tag-list"></span> </div> <div class="item-audio metadata-tags metadata-tags-separator"> <span class="metadata-label">'+o(i(1).call(t,"Audio",{
hash:{},data:a}))+'</span> </div> <div class="item-subtitles metadata-tags"> <span class="metadata-label">'+o(i(1).call(t,"Subtitles",{hash:{},data:a}))+'</span> </div> <div class="summary-container"></div> <div class="studio-flag-container"></div> </div> <div class="details-poster-container"> <a class="media-poster-container play-btn" href="#"> <div class="clip-poster item-poster media-poster"> <div class="media-poster-overlay"></div> <div class="media-poster-overlay-icons"> <i class="media-poster-overlay-icon glyphicon play"></i> </div> </div> </a> <div class="video-audio-flags-container media-flags"></div> </div> ';
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var a="";return a})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r,o="",l="function",c=this.escapeExpression;return o+='<div class="details-title-container"> <h1><a class="show-title btn-metadata-link" href="#!/server/'+c((r=t&&t.serverID,typeof r===l?r.apply(t):r))+"/details/"+c((r=t&&t.grandparentKey,
typeof r===l?r.apply(t):r))+'"></a></h1> <h2 class="episode-title"></h2> <h3 class="episode-index"></h3> </div> <div class="details-metadata-container"> <div class="details-progress-container"> <div class="item-progress details-progress"></div> </div> <div class="metadata-right pull-right"> <div class="item-available-at metadata-tags"></div> <div class="rating-container"></div> <div class="content-rating-flag-container"></div> </div> <p class="metadata-labels"> <span class="item-duration metadata-duration"></span> <span class="item-unwatched-label label label-primary">'+c(i(1).call(t,"Unwatched",{
hash:{},data:a}))+'</span> <a class="item-unavailable-btn label label-btn label-danger" href="#"><i class="label-icon glyphicon circle-info"></i> '+c(i(1).call(t,"Unavailable",{hash:{},data:a}))+'</a> </p> <div class="item-director metadata-tags"> <span class="metadata-label">'+c(i(1).call(t,"Director",{hash:{},data:a}))+'</span> <span class="metadata-tag-list"></span> </div> <div class="item-writer metadata-tags"> <span class="metadata-label">'+c(i(1).call(t,"Writer",{hash:{},data:a}))+'</span> <span class="metadata-tag-list"></span> </div> <div class="item-cast metadata-tags"> <span class="metadata-label">'+c(i(1).call(t,"Cast",{
hash:{},data:a}))+'</span> <span class="metadata-tag-list"></span> </div> <div class="item-audio metadata-tags metadata-tags-separator"> <span class="metadata-label">'+c(i(1).call(t,"Audio",{hash:{},data:a}))+'</span> </div> <div class="item-subtitles metadata-tags"> <span class="metadata-label">'+c(i(1).call(t,"Subtitles",{hash:{},data:a}))+'</span> </div> <div class="summary-container"></div> </div> <div class="details-poster-container"> <a class="media-poster-container play-btn" href="#"> <div class="episode-poster item-poster media-poster"> <div class="media-poster-overlay"></div> <div class="media-poster-overlay-icons"> <i class="media-poster-overlay-icon glyphicon play"></i> </div> <span class="media-count-badge badge badge-lg hidden"></span> </div> </a> <div class="video-audio-flags-container media-flags"></div> </div> ';
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<div class="details-title-container"> <h1 class="item-title"></h1> <h2 class="item-year"></h2> </div> <div class="details-metadata-container"> <div class="movie-details-metadata-container"> <div class="details-progress-container"> <div class="item-progress details-progress"></div> </div> <div class="metadata-right pull-right"> <div class="item-genre metadata-tags"></div> <div class="rating-container"></div> <div class="content-rating-flag-container"></div> </div> <p class="metadata-labels"> <span class="item-duration metadata-duration"></span> <span class="item-unwatched-label label label-primary">'+o(i(1).call(t,"Unwatched",{
hash:{},data:a}))+'</span> <a class="item-unavailable-btn label label-btn label-danger" href="#"><i class="label-icon glyphicon circle-info"></i> '+o(i(1).call(t,"Unavailable",{hash:{},data:a}))+'</a> </p> <p class="item-tagline metadata-tagline"></p> <div class="item-director metadata-tags"> <span class="metadata-label">'+o(i(1).call(t,"Director",{hash:{},data:a}))+'</span> <span class="metadata-tag-list"></span> </div> <div class="item-writer metadata-tags"> <span class="metadata-label">'+o(i(1).call(t,"Writer",{
hash:{},data:a}))+'</span> <span class="metadata-tag-list"></span> </div> <div class="item-cast metadata-tags"> <span class="metadata-label">'+o(i(1).call(t,"Cast",{hash:{},data:a}))+'</span> <span class="metadata-tag-list"></span> </div> <div class="item-audio metadata-tags metadata-tags-separator"> <span class="metadata-label">'+o(i(1).call(t,"Audio",{hash:{},data:a}))+'</span> </div> <div class="item-subtitles metadata-tags"> <span class="metadata-label">'+o(i(1).call(t,"Subtitles",{hash:{},data:a
}))+'</span> </div> <div class="summary-container"></div> <div class="studio-flag-container"></div> </div> <div class="extras-region hidden"> <h3 class="extras-header">'+o(i(1).call(t,"Extras",{hash:{},data:a}))+'</h3> </div> </div> <div class="details-poster-container"> <a class="media-poster-container play-btn" href="#"> <div class="movie-poster item-poster media-poster"> <div class="media-poster-overlay"></div> <div class="media-poster-overlay-icons"> <i class="media-poster-overlay-icon glyphicon play"></i> </div> <span class="media-count-badge badge badge-lg hidden"></span> </div> </a> <div class="video-audio-flags-container media-flags"></div> </div> ';
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){return this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{},'<div class="details-title-container"> <h1 class="item-title"></h1> </div> <div class="details-metadata-container"> <div class="summary-container"></div> <div class="photo-list-container details-list-region"></div> </div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var i,s="";return s+=' <div class="playlist-poster item-poster media-poster '+h((i=e&&e.type,
typeof i===d?i.apply(e):i))+'"> ',i=n.if.call(e,e&&e.smart,{hash:{},inverse:p.noop,fn:p.program(2,o,t),data:t}),(i||0===i)&&(s+=i),s+=" </div> "}function o(e,t){return' <span class="smart-badge badge badge-round"> <i class="icon glyphicon cogwheel"></i> </span> '}function l(e,t){var i,s="";return s+=" ",i=n.unless.call(e,e&&e.hasComposite,{hash:{},inverse:p.noop,fn:p.program(2,o,t),data:t}),(i||0===i)&&(s+=i),s+=" "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var c,u="",d="function",h=this.escapeExpression,p=this;
return u+='<div class="details-title-container '+h((c=t&&t.type,typeof c===d?c.apply(t):c))+'"> <h1 class="item-title"></h1> </div> <div class="details-metadata-container '+h((c=t&&t.type,typeof c===d?c.apply(t):c))+'"> <div class="playlist-details-metadata-container"> <p class="metadata-right pull-right"> <span class="item-duration metadata-duration"></span> </p> <p class="metadata-labels"> <span class="item-count"></span> </p> <p class="item-summary metadata-summary"></p> </div> <div class="playlist-items-container details-list-region"></div> <h1 class="error-text hidden">'+h(i(1).call(t,"Failed to load items for this playlist.",{
hash:{},data:a}))+'</h1> <div class="loading-container"> <div class="loading loading-inline"></div> </div> </div> <div class="details-poster-container '+h((c=t&&t.type,typeof c===d?c.apply(t):c))+'"> ',c=n.if.call(t,t&&t.hasComposite,{hash:{},inverse:p.noop,fn:p.program(1,r,a),data:a}),(c||0===c)&&(u+=c),u+=' <div class="playlist-side-strip item-side-strip media-poster '+h((c=t&&t.type,typeof c===d?c.apply(t):c))+'"> ',c=n.if.call(t,t&&t.smart,{hash:{},inverse:p.noop,fn:p.program(4,l,a),data:a}),
(c||0===c)&&(u+=c),u+=" </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var a,r,o="",l="function",c=this.escapeExpression;return o+='<div class="details-title-container"> <h1><a class="show-title btn-metadata-link" href="#!/server/',(r=i.serverID)?a=r.call(t,{hash:{},data:s}):(r=t&&t.serverID,a=typeof r===l?r.call(t,{hash:{},data:s}):r),o+=c(a)+"/details/",(r=i.parentKey)?a=r.call(t,{
hash:{},data:s}):(r=t&&t.parentKey,a=typeof r===l?r.call(t,{hash:{},data:s}):r),o+=c(a)+'"></a></h1> <h2 class="season-title"></h2> </div> <div class="details-metadata-container"> <div class="media-actions-container title"></div> <div class="summary-container"></div> <div class="episode-list-container details-list-region"></div> </div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){function a(e,t){return' <a class="media-poster-container play-btn" href="#"> <div class="show-poster item-poster media-poster"> <div class="media-poster-overlay"></div> <div class="media-poster-overlay-icons"> <i class="media-poster-overlay-icon glyphicon play"></i> </div> <span class="unwatched-count-badge details-unwatched-count-badge badge badge-lg hidden"></span> </div> </a> ';
}function r(e,t){return' <div class="show-poster item-poster media-poster"> <span class="unwatched-count-badge details-unwatched-count-badge badge badge-lg hidden"></span> </div> '}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var o,l="",c=this;return l+='<div class="details-title-container"> <h1 class="item-title"></h1> <h2 class="item-year"></h2> </div> <div class="details-metadata-container"> <div class="show-details-metadata-container"> <div class="metadata-right pull-right"> <div class="item-genre metadata-tags"></div> </div> <p class="metadata-labels"> <span class="item-duration metadata-duration"></span> <span class="rating-container rating-container-inline"></span> <span class="content-rating-flag-container content-rating-flag-container-inline"></span> </p> <div class="summary-container"></div> <div class="studio-flag-container"></div> </div> <div class="season-list-container details-list-region"></div> </div> <div class="details-poster-container"> ',
o=i.if.call(t,t&&t.canPlay,{hash:{},inverse:c.program(3,r,s),fn:c.program(1,a,s),data:s}),(o||0===o)&&(l+=o),l+=" </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<div class="row row-padded"> <div class="col-md-8 col-md-offset-2"> <h1>'+o(i(1).call(t,"This media type does not have a details page.",{hash:{},data:a}))+"</h1> </div> </div> "})},function(e,t,i){
var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){return this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{},'<a class="concert-link" target="_blank"> <div class="concert-calendar"> <div class="concert-month"></div> <div class="concert-day"></div> </div> <div class="concert-details"> <div class="concert-name"></div> <div class="concert-location"> <span class="concert-venue"></span> (<span class="concert-city"></span>) </div> </div> </a> '})},function(e,t,i){var n=i(3);
e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<p class="item-summary metadata-summary"></p> <div class="summary-divider hidden"> <button type="button" class="summary-divider-btn">'+o(i(1).call(t,"More",{hash:{},data:a}))+"</button> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var i,n="";return n+=' <li><a class="auto-match-agent" href="#" data-id="'+u((i=e&&e.identifier,
typeof i===c?i.apply(e):i))+'">'+u((i=e&&e.name,typeof i===c?i.apply(e):i))+"</a></li> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var o,l="",c="function",u=this.escapeExpression,d=this;return l+='<a class="dropdown-toggle" href="#auto-match-dropdown" data-toggle="dropdown">'+u(i(1).call(t,"Auto Match",{hash:{},data:a}))+' <i class="caret-icon caret-icon-sm"></i></a> <ul class="dropdown-menu"> ',o=n.each.call(t,t&&t.agents,{hash:{},inverse:d.noop,fn:d.program(1,r,a),data:a
}),(o||0===o)&&(l+=o),l+=" </ul> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var i,s="";return s+=' <a class="breadcrumb-btn btn-gray" data-key="'+f((i=e&&e.item,i=null==i||i===!1?i:i.key,typeof i===p?i.apply(e):i))+'" href="#"><span class="breadcrumb-truncated-label">'+f((i=e&&e.item,i=null==i||i===!1?i:i.title,typeof i===p?i.apply(e):i))+'</span></a> <a class="btn-gray dropdown-toggle split-dropdown-toggle" href="#'+f((i=e&&e.id,typeof i===p?i.apply(e):i))+'" data-toggle="dropdown"> <i class="caret-icon caret-icon-sm"></i> </a> <ul class="dropdown-menu"> ',
i=n.each.call(e,e&&e.items,{hash:{},inverse:m.noop,fn:m.programWithDepth(2,o,t,e),data:t}),(i||0===i)&&(s+=i),s+=" </ul> "}function o(e,t,n){var s,a="";return a+=' <li><a class="breadcrumb-btn" data-key="'+f((s=e&&e.key,typeof s===p?s.apply(e):s))+'" href="#"><span class="dropdown-truncated-label">'+f((s=e&&e.title,typeof s===p?s.apply(e):s))+'</span><i class="dropdown-selected-icon glyphicon ok-2 ',s=i(36).call(e,(s=n&&n.item,null==s||s===!1?s:s.key),e&&e.key,{hash:{},inverse:m.noop,fn:m.program(3,l,t),
data:t}),(s||0===s)&&(a+=s),a+='"></i></a></li> '}function l(e,t){return"hidden"}function c(e,t){var i,s="";return s+=' <a class="breadcrumb-btn btn-gray" ',i=n.unless.call(e,e&&e.hasDetails,{hash:{},inverse:m.noop,fn:m.program(6,u,t),data:t}),(i||0===i)&&(s+=i),s+=' href="#"> <span class="breadcrumb-truncated-label">'+f((i=e&&e.item,i=null==i||i===!1?i:i.title,typeof i===p?i.apply(e):i))+"</span> </a> "}function u(e,t){var i,n="";return n+='data-key="'+f((i=e&&e.item,i=null==i||i===!1?i:i.key,typeof i===p?i.apply(e):i))+'"';
}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var d,h="",p="function",f=this.escapeExpression,m=this;return d=n.if.call(t,t&&t.showDropdown,{hash:{},inverse:m.program(5,c,a),fn:m.program(1,r,a),data:a}),(d||0===d)&&(h+=d),h+=" "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var n,s="";return s+='<li><a class="download-btn" href="'+u((n=e&&e.downloadUrl,typeof n===c?n.apply(e):n))+'" download="'+u((n=e&&e.downloadName,typeof n===c?n.apply(e):n))+'" tabindex="-1">'+u(i(1).call(e,"Download",{
hash:{},data:t}))+"</a></li>"}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var o,l="",c="function",u=this.escapeExpression,d=this;return l+='<li><a class="play-version-btn" href="#" tabindex="-1">'+u(i(1).call(t,"Play Version...",{hash:{},data:a}))+'</a></li> <li><a class="play-all-btn" href="#" tabindex="-1">'+u(i(1).call(t,"Play All",{hash:{},data:a}))+'</a></li> <li><a class="play-shuffled-btn" href="#" tabindex="-1">'+u(i(1).call(t,"Shuffle",{hash:{},data:a}))+'</a></li> <li><a class="play-next-btn" href="#" tabindex="-1">'+u(i(1).call(t,"Play Next",{
hash:{},data:a}))+'</a></li> <li><a class="add-to-up-next-btn" href="#" tabindex="-1">'+u(i(1).call(t,"Add to Up Next",{hash:{},data:a}))+'</a></li> <li><a class="play-mix-btn" href="#" tabindex="-1">'+u(i(1).call(t,"Play Plex Mix",{hash:{},data:a}))+'</a></li> <li><a class="play-trailer-btn play-primary-extra-btn" href="#" tabindex="-1">'+u(i(1).call(t,"Play Trailer",{hash:{},data:a}))+'</a></li> <li><a class="play-music-video-btn play-primary-extra-btn" href="#" tabindex="-1">'+u(i(1).call(t,"Play Music Video",{
hash:{},data:a}))+'</a></li> <li><a class="add-to-playlist-btn btn-link" href="#" tabindex="-1">'+u(i(1).call(t,"Add to Playlist...",{hash:{},data:a}))+'</a></li> <li class="divider"></li> <li><a class="refresh-btn" href="#" tabindex="-1">'+u(i(1).call(t,"Refresh",{hash:{},data:a}))+'</a></li> <li><a class="mark-watched-btn" href="#" tabindex="-1">'+u(i(1).call(t,"Mark as Watched",{hash:{},data:a}))+'</a></li> <li><a class="mark-unwatched-btn" href="#" tabindex="-1">'+u(i(1).call(t,"Mark as Unwatched",{
hash:{},data:a}))+'</a></li> <li><a class="sync-btn" href="#" tabindex="-1">'+u(i(1).call(t,"Sync...",{hash:{},data:a}))+'</a></li> <li><a class="convert-btn" href="#" tabindex="-1">'+u(i(1).call(t,"Optimize...",{hash:{},data:a}))+"</a></li> ",o=n.if.call(t,t&&t.downloadUrl,{hash:{},inverse:d.noop,fn:d.program(1,r,a),data:a}),(o||0===o)&&(l+=o),l+=' <li><a class="watch-later-btn" href="#" tabindex="-1">'+u(i(1).call(t,"Watch Later",{hash:{},data:a}))+'</a></li> <li><a class="share-btn" href="#" tabindex="-1">'+u(i(1).call(t,"Share...",{
hash:{},data:a}))+'</a></li> <li><a class="recommend-btn" href="#" tabindex="-1">'+u(i(1).call(t,"Recommend...",{hash:{},data:a}))+'</a></li> <li><a class="delete-btn has-danger" href="#" tabindex="-1">'+u(i(1).call(t,"Delete",{hash:{},data:a}))+'</a></li> <li><a class="info-btn" href="#" tabindex="-1">'+u(i(1).call(t,"Info",{hash:{},data:a}))+"</a></li> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),
a=a||{};var r="",o=this.escapeExpression;return r+='<div class="play-queue-empty-message">'+o(i(1).call(t,"Nothing queued",{hash:{},data:a}))+"</div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return"hidden"}function o(e,t){return"readonly"}function l(e,t){return' <button class="btn-gray save-btn" href="#"> <i class="plex-icon-add-to-playlist"></i> </button> '}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var c,u="",d=this,h=this.escapeExpression;
return u+='<button class="btn-link dropdown-toggle ',c=n.unless.call(t,t&&t.canEdit,{hash:{},inverse:d.noop,fn:d.program(1,r,a),data:a}),(c||0===c)&&(u+=c),u+='" href="#play-queue-dropdown" data-toggle="dropdown"> <i class="glyphicon show-thumbnails-with-lines"></i> </button> <ol class="play-queue-list dropdown-menu pull-right ',c=n.unless.call(t,t&&t.canEdit,{hash:{},inverse:d.noop,fn:d.program(3,o,a),data:a}),(c||0===c)&&(u+=c),u+='"> <li class="dropdown-header play-queue-header"> ',c=n.if.call(t,t&&t.canPlaylist,{
hash:{},inverse:d.noop,fn:d.program(5,l,a),data:a}),(c||0===c)&&(u+=c),u+=' <i class="glyphicon show-thumbnails-with-lines"></i> '+h(i(1).call(t,"Up Next",{hash:{},data:a}))+" </li> </ol> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){function a(e,t){return' <button class="delete-btn btn-link btn-danger" tabindex="-1"><i class="glyphicon remove-2"></i></button> '}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var r,o,l="",c="function",u=this.escapeExpression,d=this;
return l+='<a href="#"> <div class="media-poster ',(o=i.type)?r=o.call(t,{hash:{},data:s}):(o=t&&t.type,r=typeof o===c?o.call(t,{hash:{},data:s}):o),l+=u(r)+'"></div> <div class="media-item"> <div class="media-title"></div> <div class="media-subtitle-1"><span class="media-primary-subtitle"></span><span class="media-secondary-subtitle"></span></div> </div> ',r=i.if.call(t,t&&t.canDelete,{hash:{},inverse:d.noop,fn:d.program(1,a,s),data:s}),(r||0===r)&&(l+=r),l+=" </a> "})},function(e,t,i){var n=i(3);
e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var n,s="";return s+='<li><a class="download-btn" href="'+u((n=e&&e.downloadUrl,typeof n===c?n.apply(e):n))+'" download="'+u((n=e&&e.downloadName,typeof n===c?n.apply(e):n))+'" tabindex="-1">'+u(i(1).call(e,"Download",{hash:{},data:t}))+"</a></li>"}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var o,l="",c="function",u=this.escapeExpression,d=this;return l+='<li><a class="play-mix-btn" href="#" tabindex="-1">'+u(i(1).call(t,"Play Plex Mix",{
hash:{},data:a}))+'</a></li> <li><a class="add-to-playlist-btn btn-link" href="#" tabindex="-1">'+u(i(1).call(t,"Add to Playlist...",{hash:{},data:a}))+'</a></li> <li class="divider"></li> <li><a class="sync-btn" href="#" tabindex="-1">'+u(i(1).call(t,"Sync...",{hash:{},data:a}))+"</a></li> ",o=n.if.call(t,t&&t.downloadUrl,{hash:{},inverse:d.noop,fn:d.program(1,r,a),data:a}),(o||0===o)&&(l+=o),l+=' <li><a class="share-btn" href="#" tabindex="-1">'+u(i(1).call(t,"Share...",{hash:{},data:a}))+'</a></li> <li><a class="recommend-btn" href="#" tabindex="-1">'+u(i(1).call(t,"Recommend...",{
hash:{},data:a}))+'</a></li> <li><a class="info-btn" href="#" tabindex="-1">'+u(i(1).call(t,"Info",{hash:{},data:a}))+"</a></li> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t,n){var s,a="";return a+=' <li><a href="#" class="type-btn" data-key="'+d((s=e&&e.key,typeof s===u?s.apply(e):s))+'">'+d(i(1).call(e,e&&e.title,{hash:{},data:t}))+" ",s=i(10).call(e,(s=n&&n.currentType,null==s||s===!1?s:s.key),e&&e.key,{hash:{},inverse:h.noop,fn:h.program(2,o,t),
data:t}),(s||0===s)&&(a+=s),a+="</a></li> "}function o(e,t){return'<i class="dropdown-selected-icon glyphicon ok-2"></i>'}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var l,c="",u="function",d=this.escapeExpression,h=this;return c+='<a class="btn-gray dropdown-toggle" href="#playlist-type-dropdown" data-toggle="dropdown">'+d(i(1).call(t,(l=t&&t.currentType,null==l||l===!1?l:l.title),{hash:{},data:a}))+' <i class="caret-icon"></i></a> <ul class="dropdown-menu"> ',l=n.each.call(t,t&&t.types,{
hash:{},inverse:h.noop,fn:h.programWithDepth(1,r,a,t),data:a}),(l||0===l)&&(c+=l),c+=" </ul> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){function a(e,t){var n,s="";return s+=' <a class="dropdown-toggle ',n=i.if.call(e,e&&e.primaryPlayer,{hash:{},inverse:h.noop,fn:h.program(2,r,t),data:t}),(n||0===n)&&(s+=n),s+='" href="#primary-player-dropdown" data-toggle="dropdown"> <i class="',n=i.if.call(e,e&&e.primaryPlayer,{hash:{},inverse:h.program(6,l,t),fn:h.program(4,o,t),
data:t}),(n||0===n)&&(s+=n),s+='"></i><i class="caret-icon"></i> </a> '}function r(e,t){return"active"}function o(e,t){return"plex-icon-companion-cast-active"}function l(e,t){return"plex-icon-companion-cast"}function c(e,t){var n,s="";return s+=' <a class="cast-btn ',n=i.if.call(e,e&&e.primaryPlayer,{hash:{},inverse:h.noop,fn:h.program(2,r,t),data:t}),(n||0===n)&&(s+=n),s+="\" href='#'> <i class=\"",n=i.if.call(e,e&&e.primaryPlayer,{hash:{},inverse:h.program(6,l,t),fn:h.program(4,o,t),data:t}),(n||0===n)&&(s+=n),
s+='"></i> </a> '}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var u,d="",h=this;return u=i.if.call(t,t&&t.showDropdown,{hash:{},inverse:h.program(8,c,s),fn:h.program(1,a,s),data:s}),(u||0===u)&&(d+=u),d+=" "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var s,a="";return a+=' <li class="dropdown-header"><span class="dropdown-truncated-label">',s=n.if.call(e,e&&e.nowPlaying,{hash:{},inverse:v.noop,fn:v.program(2,o,t),data:t
}),(s||0===s)&&(a+=s),a+=m((s=e&&e.primaryPlayer,s=null==s||s===!1?s:s.name,typeof s===g?s.apply(e):s))+"</span></li> ",s=n.if.call(e,e&&e.showNowPlaying,{hash:{},inverse:v.noop,fn:v.program(4,l,t),data:t}),(s||0===s)&&(a+=s),a+=' <li> <a class="local-player-btn" href="#"> <i class="glyphicon ban"></i> '+m(i(1).call(e,"Disconnect",{hash:{},data:t}))+" </a> </li> "}function o(e,t){var n="";return n+=m(i(1).call(e,"Casting on",{hash:{},data:t}))+" "}function l(e,t){var i,s="";return s+=" ",i=n.each.call(e,e&&e.nowPlaying,{
hash:{},inverse:v.noop,fn:v.program(5,c,t),data:t}),(i||0===i)&&(s+=i),s+=" "}function c(e,t){var i,n="";return n+=' <li> <a class="now-playing-btn" data-id="'+m((i=e&&e.ratingKey,typeof i===g?i.apply(e):i))+'" href="#"> <i class="glyphicon play"></i> <span class="dropdown-truncated-label">'+m((i=e&&e.title,typeof i===g?i.apply(e):i))+"</span> </a> </li> "}function u(e,t){var i,s="";return s+=" ",i=n.each.call(e,e&&e.players,{hash:{},inverse:v.noop,fn:v.program(8,d,t),data:t}),(i||0===i)&&(s+=i),
s+=" "}function d(e,t){var i,s="";return s+=' <li> <a class="plex-player-btn" data-id="'+m((i=e&&e.machineIdentifier,typeof i===g?i.apply(e):i))+'" href="#"> <i class="dropdown-item-icon plex-icon-companion-plex"></i> <span class="dropdown-truncated-label">'+m((i=e&&e.name,typeof i===g?i.apply(e):i))+"</span> ",i=n.if.call(e,e&&e.selected,{hash:{},inverse:v.noop,fn:v.program(9,h,t),data:t}),(i||0===i)&&(s+=i),s+=" </a> </li> "}function h(e,t){return'<i class="dropdown-selected-icon glyphicon ok-2"></i>';
}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var p,f="",m=this.escapeExpression,g="function",v=this;return p=n.if.call(t,t&&t.primaryPlayer,{hash:{},inverse:v.program(7,u,a),fn:v.program(1,r,a),data:a}),(p||0===p)&&(f+=p),f+=" "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var i,s="";return s+=' <a class="dropdown-toggle" href="#primary-server-dropdown" data-toggle="dropdown"> <span class="dropdown-friendly-name">'+p((i=e&&e.currentServer,
i=null==i||i===!1?i:i.friendlyName,typeof i===h?i.apply(e):i))+'</span> <i class="caret-icon"></i> </a> <ul class="dropdown-menu"> ',i=n.each.call(e,e&&e.servers,{hash:{},inverse:f.noop,fn:f.programWithDepth(2,o,t,e),data:t}),(i||0===i)&&(s+=i),s+=" </ul> "}function o(e,t,n){var s,a="";return a+=' <li><a data-id="'+p((s=e&&e.machineIdentifier,typeof s===h?s.apply(e):s))+'" href="#"><span class="dropdown-truncated-label">'+p((s=e&&e.friendlyName,typeof s===h?s.apply(e):s))+"</span>",s=i(10).call(e,(s=n&&n.currentServer,
null==s||s===!1?s:s.machineIdentifier),e&&e.machineIdentifier,{hash:{},inverse:f.noop,fn:f.program(3,l,t),data:t}),(s||0===s)&&(a+=s),a+="</a></li> "}function l(e,t){return'<i class="dropdown-selected-icon glyphicon ok-2"></i>'}function c(e,t){var i,n="";return n+=' <span class="dropdown-placeholder"> <span class="dropdown-friendly-name">'+p((i=e&&e.currentServer,i=null==i||i===!1?i:i.friendlyName,typeof i===h?i.apply(e):i))+"</span> </span> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),
a=a||{};var u,d="",h="function",p=this.escapeExpression,f=this;return u=n.if.call(t,t&&t.showDropdown,{hash:{},inverse:f.program(5,c,a),fn:f.program(1,r,a),data:a}),(u||0===u)&&(d+=u),d+=" "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var i,s="";return s+=' <a class="dropdown-toggle" href="#section-dropdown" data-toggle="dropdown">'+p((i=e&&e.currentSection,i=null==i||i===!1?i:i.title,typeof i===m?i.apply(e):i))+' <i class="caret-icon"></i></a> <ul class="dropdown-menu"> ',
i=n.if.call(e,e&&e.showPlaylists,{hash:{},inverse:f.noop,fn:f.programWithDepth(2,o,t,e),data:t}),(i||0===i)&&(s+=i),s+=" ",i=n.each.call(e,e&&e.sections,{hash:{},inverse:f.noop,fn:f.programWithDepth(5,c,t,e),data:t}),(i||0===i)&&(s+=i),s+=" </ul> "}function o(e,t,s){var a,r="";return r+=' <li><a href="#!/server/'+p(i(32).call(e,s&&s.serverID,{hash:{},data:t}))+'/playlists"><span class="dropdown-truncated-label">'+p(i(1).call(e,"Playlists",{hash:{},data:t}))+"</span>",a=n.unless.call(e,(a=e&&e.currentSection,
null==a||a===!1?a:a.key),{hash:{},inverse:f.noop,fn:f.program(3,l,t),data:t}),(a||0===a)&&(r+=a),r+="</a></li> "}function l(e,t){return'<i class="dropdown-selected-icon glyphicon ok-2"></i>'}function c(e,t,n){var s,a="";return a+=' <li><a href="#!/server/'+p(i(32).call(e,n&&n.serverID,{hash:{},data:t}))+"/section/"+p(i(32).call(e,e&&e.key,{hash:{},data:t}))+'"><span class="dropdown-truncated-label">'+p((s=e&&e.title,typeof s===m?s.apply(e):s))+"</span>",s=i(10).call(e,(s=n&&n.currentSection,null==s||s===!1?s:s.key),e&&e.key,{
hash:{},inverse:f.noop,fn:f.program(3,l,t),data:t}),(s||0===s)&&(a+=s),a+="</a></li> "}function u(e,t){var i,n="";return n+=" "+p((i=e&&e.currentSection,i=null==i||i===!1?i:i.title,typeof i===m?i.apply(e):i))+" "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var d,h="",p=this.escapeExpression,f=this,m="function";return d=n.if.call(t,t&&t.showDropdown,{hash:{},inverse:f.program(7,u,a),fn:f.program(1,r,a),data:a}),(d||0===d)&&(h+=d),h+=" "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){
function r(e,t){var s,a="";return a+=' <a class="btn-gray dropdown-toggle" href="#section-subset-dropdown" data-toggle="dropdown">'+p(i(1).call(e,(s=e&&e.currentSubset,null==s||s===!1?s:s.title),{hash:{},data:t}))+' <i class="caret-icon"></i></a> <ul class="dropdown-menu"> ',s=n.each.call(e,e&&e.subsets,{hash:{},inverse:f.noop,fn:f.programWithDepth(2,o,t,e),data:t}),(s||0===s)&&(a+=s),a+=" </ul> "}function o(e,t,i){var s,a="";return a+=" ",s=n.if.call(e,e&&e.primary,{hash:{},inverse:f.noop,fn:f.programWithDepth(3,l,t,i),
data:t}),(s||0===s)&&(a+=s),a+=" "}function l(e,t,n){var s,a="";return a+=' <li><a href="#!/server/'+p(i(32).call(e,n&&n.serverID,{hash:{},data:t}))+"/section/"+p(i(32).call(e,n&&n.sectionID,{hash:{},data:t}))+"/"+p(i(32).call(e,e&&e.key,{hash:{},data:t}))+'">'+p(i(1).call(e,e&&e.title,{hash:{},data:t}))+" ",s=i(10).call(e,(s=n&&n.currentSubset,null==s||s===!1?s:s.key),e&&e.key,{hash:{},inverse:f.noop,fn:f.program(4,c,t),data:t}),(s||0===s)&&(a+=s),a+="</a></li> "}function c(e,t){return'<i class="dropdown-selected-icon glyphicon ok-2"></i>';
}function u(e,t){var n,s="";return s+=' <span class="dropdown-placeholder">'+p(i(1).call(e,(n=e&&e.currentSubset,null==n||n===!1?n:n.title),{hash:{},data:t}))+"</span> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var d,h="",p=this.escapeExpression,f=this;return d=n.if.call(t,t&&t.showDropdown,{hash:{},inverse:f.program(6,u,a),fn:f.program(1,r,a),data:a}),(d||0===d)&&(h+=d),h+=" "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],
n=this.merge(n,e.helpers),a=a||{};var r,o="",l=this.escapeExpression;return o+='<a class="btn-gray dropdown-toggle" href="#section-type-dropdown" data-toggle="dropdown">'+l(i(1).call(t,(r=t&&t.currentType,null==r||r===!1?r:r.plural),{hash:{},data:a}))+' <i class="caret-icon"></i></a> <ul class="dropdown-menu"></ul> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return'<i class="dropdown-selected-icon glyphicon ok-2"></i>'}this.compilerInfo=[4,">= 1.0.0"],
n=this.merge(n,e.helpers),a=a||{};var o,l="",c=this.escapeExpression,u=this;return l+='<a href="#">'+c(i(1).call(t,t&&t.plural,{hash:{},data:a}))+" ",o=n.if.call(t,t&&t.selected,{hash:{},inverse:u.noop,fn:u.program(1,r,a),data:a}),(o||0===o)&&(l+=o),l+="</a> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var s,a="";return a+=' <a class="dropdown-toggle" href="#'+p((s=e&&e.type,typeof s===h?s.apply(e):s))+'-dropdown" data-toggle="dropdown"> '+p(i(152).call(e,e&&e.selectedStream,{
hash:{},data:t}))+' <i class="caret-icon caret-icon-sm"></i> </a> <ul class="dropdown-menu"> ',s=n.each.call(e,e&&e.streams,{hash:{},inverse:f.noop,fn:f.program(2,o,t),data:t}),(s||0===s)&&(a+=s),a+=" </ul> "}function o(e,t){var s,a="";return a+=' <li> <a data-id="'+p((s=e&&e.id,typeof s===h?s.apply(e):s))+'" href="#"> '+p(i(152).call(e,e,{hash:{},data:t}))+" ",s=n.if.call(e,e&&e.selected,{hash:{},inverse:f.noop,fn:f.program(3,l,t),data:t}),(s||0===s)&&(a+=s),a+=" </a> </li> "}function l(e,t){return' <i class="dropdown-selected-icon glyphicon ok-2"></i> ';
}function c(e,t){var n="";return n+=" "+p(i(152).call(e,e&&e.selectedStream,{hash:{},data:t}))+" "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var u,d="",h="function",p=this.escapeExpression,f=this;return u=n.if.call(t,t&&t.showDropdown,{hash:{},inverse:f.program(5,c,a),fn:f.program(1,r,a),data:a}),(u||0===u)&&(d+=u),d+=" "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var n,s="";return s+=' <div class="row"> <div class="col-md-12 selectize"> '+h(i(13).call(e,"autocompleteTextInput",{
hash:{label:"Artist",name:"parentTitle",placeholder:(n=e&&e.item,null==n||n===!1?n:n.parentTitlePlaceholder),ratingKey:(n=e&&e.item,null==n||n===!1?n:n.parentRatingKey),title:(n=e&&e.item,null==n||n===!1?n:n.parentTitle)},data:t}))+" </div> </div> "}function o(e,t){var n,s="";return s+=' <div class="col-md-4"> '+h(i(13).call(e,"lockableTextInput",{hash:{label:"Year",name:"year",value:(n=e&&e.item,null==n||n===!1?n:n.year),placeholder:(n=e&&e.item,null==n||n===!1?n:n.yearPlaceholder),locked:(n=e&&e.locked,
null==n||n===!1?n:n.year),ratingKey:(n=e&&e.item,null==n||n===!1?n:n.ratingKey)},data:t}))+" </div> "}function l(e,t){return"9"}function c(e,t){return"5"}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var u,d="",h=this.escapeExpression,p=this;return d+='<form class="edit-metadata-form"> ',u=n.if.call(t,t&&t.canReparent,{hash:{},inverse:p.noop,fn:p.program(1,r,a),data:a}),(u||0===u)&&(d+=u),d+=' <div class="row"> <div class="col-md-12 selectize"> '+h(i(13).call(t,"lockableTextInput",{
hash:{label:"Album",name:"title",value:(u=t&&t.item,null==u||u===!1?u:u.title),placeholder:(u=t&&t.item,null==u||u===!1?u:u.titlePlaceholder),locked:(u=t&&t.locked,null==u||u===!1?u:u.title),ratingKey:(u=t&&t.item,null==u||u===!1?u:u.ratingKey),scopeToAttr:"parentRatingKey",scopeToParam:"artist.id"},data:a}))+' </div> </div> <div class="row"> <div class="col-md-12 selectize"> '+h(i(13).call(t,"lockableTextInput",{hash:{label:"Sort Album",name:"titleSort",value:(u=t&&t.item,null==u||u===!1?u:u.titleSort),
placeholder:(u=t&&t.item,null==u||u===!1?u:u.titleSortPlaceholder),locked:(u=t&&t.locked,null==u||u===!1?u:u.titleSort),ratingKey:(u=t&&t.item,null==u||u===!1?u:u.ratingKey)},data:a}))+' </div> </div> <div class="row"> <div class="col-md-3"> <label>'+h(i(1).call(t,"Rating",{hash:{},data:a}))+'</label> <div class="rating-region"></div> </div> ',u=n.unless.call(t,t&&t.supportsLinkedYears,{hash:{},inverse:p.noop,fn:p.program(3,o,a),data:a}),(u||0===u)&&(d+=u),d+=' <div class="col-md-',u=n.if.call(t,t&&t.supportsLinkedYears,{
hash:{},inverse:p.program(7,c,a),fn:p.program(5,l,a),data:a}),(u||0===u)&&(d+=u),d+=' "> '+h(i(13).call(t,"lockableTextInput",{hash:{label:"Originally Available",name:"originallyAvailableAt",value:(u=t&&t.item,null==u||u===!1?u:u.originallyAvailableAt),placeholder:(u=t&&t.item,null==u||u===!1?u:u.originallyAvailableAtPlaceholder),locked:(u=t&&t.locked,null==u||u===!1?u:u.originallyAvailableAt)},data:a}))+' </div> </div> <div class="row"> <div class="col-md-12 selectize"> '+h(i(13).call(t,"lockableTextInput",{
hash:{label:"Record Label",name:"studio",value:(u=t&&t.item,null==u||u===!1?u:u.studio),placeholder:(u=t&&t.item,null==u||u===!1?u:u.studioPlaceholder),locked:(u=t&&t.locked,null==u||u===!1?u:u.studio),ratingKey:(u=t&&t.item,null==u||u===!1?u:u.ratingKey)},data:a}))+' </div> </div> <div class="row"> <div class="col-md-12"> '+h(i(13).call(t,"lockableTextInput",{hash:{label:"Review",name:"summary",value:(u=t&&t.item,null==u||u===!1?u:u.summary),placeholder:(u=t&&t.item,null==u||u===!1?u:u.summaryPlaceholder),
type:"textarea",rows:"5",locked:(u=t&&t.locked,null==u||u===!1?u:u.summary),ratingKey:(u=t&&t.item,null==u||u===!1?u:u.ratingKey)},data:a}))+" </div> </div> </form> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r,o="",l=this.escapeExpression;return o+='<form class="edit-metadata-form"> <div class="row"> <div class="col-md-12"> '+l(i(13).call(t,"lockableTagInput",{hash:{label:"Genres",name:"genre",
value:(r=t&&t.item,null==r||r===!1?r:r.Genre),locked:(r=t&&t.locked,null==r||r===!1?r:r.genre)},data:a}))+" </div> </div> </form> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r,o="",l=this.escapeExpression;return o+='<form class="edit-metadata-form"> <div class="row"> <div class="col-md-12 selectize"> '+l(i(13).call(t,"lockableTextInput",{hash:{label:"Artist",name:"title",value:(r=t&&t.item,
null==r||r===!1?r:r.title),placeholder:(r=t&&t.item,null==r||r===!1?r:r.titlePlaceholder),locked:(r=t&&t.locked,null==r||r===!1?r:r.title),ratingKey:(r=t&&t.item,null==r||r===!1?r:r.ratingKey)},data:a}))+' </div> </div> <div class="row"> <div class="col-md-12 selectize"> '+l(i(13).call(t,"lockableTextInput",{hash:{label:"Sort Artist",name:"titleSort",value:(r=t&&t.item,null==r||r===!1?r:r.titleSort),placeholder:(r=t&&t.item,null==r||r===!1?r:r.titleSortPlaceholder),locked:(r=t&&t.locked,null==r||r===!1?r:r.titleSort),
ratingKey:(r=t&&t.item,null==r||r===!1?r:r.ratingKey)},data:a}))+' </div> </div> <div class="row"> <div class="col-md-12"> '+l(i(13).call(t,"lockableTextInput",{hash:{label:"Biography",name:"summary",value:(r=t&&t.item,null==r||r===!1?r:r.summary),placeholder:(r=t&&t.item,null==r||r===!1?r:r.summaryPlaceholder),type:"textarea",rows:"5",locked:(r=t&&t.locked,null==r||r===!1?r:r.summary)},data:a}))+" </div> </div> </form> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){
function r(e,t){var n,s="";return s+=' <div class="row"> <div class="col-md-12"> '+c(i(13).call(e,"lockableTagInput",{hash:{label:"Similar Artists",name:"similar",query:"title",locked:(n=e&&e.locked,null==n||n===!1?n:n.similar)},data:t}))+" </div> </div> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var o,l="",c=this.escapeExpression,u=this;return l+='<form class="edit-metadata-form"> <div class="row"> <div class="col-md-12"> '+c(i(13).call(t,"lockableTagInput",{hash:{label:"Genres",
name:"genre",locked:(o=t&&t.locked,null==o||o===!1?o:o.genre)},data:a}))+' </div> </div> <div class="row"> <div class="col-md-12"> '+c(i(13).call(t,"lockableTagInput",{hash:{label:"Collections",name:"collection",locked:(o=t&&t.locked,null==o||o===!1?o:o.collection)},data:a}))+" </div> </div> ",o=n.if.call(t,t&&t.canEditSimilarArtists,{hash:{},inverse:u.noop,fn:u.program(1,r,a),data:a}),(o||0===o)&&(l+=o),l+=" </form> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){
function r(e,t){var s,a="";return a+=' <div class="upload-artwork-container"> <div class="upload-prompt"> ',s=n.if.call(e,e&&e.showFileUpload,{hash:{},inverse:d.noop,fn:d.program(2,o,t),data:t}),(s||0===s)&&(a+=s),a+=' <a class="upload-url-btn" href="#">'+u(i(1).call(e,"enter a url",{hash:{},data:t}))+'</a> </div> <div class="upload-progress"> '+u(i(1).call(e,"Uploading artwork...",{hash:{},data:t}))+' </div> <div class="upload-success"> '+u(i(1).call(e,"this artwork was uploaded successfully",{hash:{},
data:t}))+' <span class="upload-prompt-divider">&middot;</span> '+u(i(1).call(e,"{1}upload another{2}",'<a class="upload-back-btn" href="#">',"</a>",{hash:{},data:t}))+' </div> <div class="upload-error"> '+u(i(1).call(e,"there was an error uploading this artwork",{hash:{},data:t}))+' <span class="upload-prompt-divider">&middot;</span> '+u(i(1).call(e,"{1}try again{2}",'<a class="upload-back-btn" href="#">',"</a>",{hash:{},data:t}))+' </div> <form id="upload-form" class="upload-form"> <input type="text" class="form-control" name="url" placeholder="'+u(i(1).call(e,"Enter a url to upload an image from the web",{
hash:{},data:t}))+'"> <div class="upload-form-help"> <div class="pull-right">'+u(i(1).call(e,"enter to {1}upload{2}",'<a class="submit-url-btn" href="#">',"</a>",{hash:{},data:t}))+'</div> <div class="pull-left">'+u(i(1).call(e,"esc to {1}cancel{2}",'<a class="cancel-url-btn" href="#">',"</a>",{hash:{},data:t}))+"</div> </div> </form> </div> "}function o(e,t){var n="";return n+=' <span class="artwork-file-container"> <input type="file" class="artwork-file-control" multiple> <a href="#">'+u(i(1).call(e,"choose an image",{
hash:{},data:t}))+'</a> </span> <span class="upload-prompt-divider">&middot;</span> '+u(i(1).call(e,"drag and drop",{hash:{},data:t}))+' <span class="upload-prompt-divider">&middot;</span> '}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var l,c="",u=this.escapeExpression,d=this;return l=n.if.call(t,t&&t.showUpload,{hash:{},inverse:d.noop,fn:d.program(1,r,a),data:a}),(l||0===l)&&(c+=l),c+=' <div class="artwork-list-container"></div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){
this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r,o="",l=this.escapeExpression;return o+='<form class="edit-metadata-form"> <div class="row"> <div class="col-md-12"> '+l(i(13).call(t,"lockableTextInput",{hash:{label:"Title",name:"title",value:(r=t&&t.item,null==r||r===!1?r:r.title),placeholder:(r=t&&t.item,null==r||r===!1?r:r.titlePlaceholder),locked:(r=t&&t.locked,null==r||r===!1?r:r.title)},data:a}))+' </div> </div> <div class="row"> <div class="col-md-12"> '+l(i(13).call(t,"lockableTextInput",{
hash:{label:"Sort Title",name:"titleSort",value:(r=t&&t.item,null==r||r===!1?r:r.titleSort),placeholder:(r=t&&t.item,null==r||r===!1?r:r.titleSortPlaceholder),locked:(r=t&&t.locked,null==r||r===!1?r:r.titleSort)},data:a}))+' </div> </div> <div class="row"> <div class="col-md-4"> '+l(i(13).call(t,"lockableNumericInput",{hash:{label:"Rating",name:"rating",value:(r=t&&t.item,null==r||r===!1?r:r.rating),placeholder:(r=t&&t.item,null==r||r===!1?r:r.ratingPlaceholder),locked:(r=t&&t.locked,null==r||r===!1?r:r.rating)
},data:a}))+' </div> <div class="col-md-4"> '+l(i(13).call(t,"lockableTextInput",{hash:{label:"Content Rating",name:"contentRating",value:(r=t&&t.item,null==r||r===!1?r:r.contentRating),placeholder:(r=t&&t.item,null==r||r===!1?r:r.contentRatingPlaceholder),locked:(r=t&&t.locked,null==r||r===!1?r:r.contentRating)},data:a}))+' </div> <div class="col-md-4"> '+l(i(13).call(t,"lockableTextInput",{hash:{label:"Originally Available",name:"originallyAvailableAt",value:(r=t&&t.item,null==r||r===!1?r:r.originallyAvailableAt),
placeholder:(r=t&&t.item,null==r||r===!1?r:r.originallyAvailableAtPlaceholder),locked:(r=t&&t.locked,null==r||r===!1?r:r.originallyAvailableAt)},data:a}))+' </div> </div> <div class="row"> <div class="col-md-12"> '+l(i(13).call(t,"lockableTextInput",{hash:{label:"Summary",name:"summary",value:(r=t&&t.item,null==r||r===!1?r:r.summary),placeholder:(r=t&&t.item,null==r||r===!1?r:r.summaryPlaceholder),type:"textarea",rows:"5",locked:(r=t&&t.locked,null==r||r===!1?r:r.summary)},data:a}))+" </div> </div> </form> ";
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r,o="",l=this.escapeExpression;return o+='<form class="edit-metadata-form"> <div class="row"> <div class="col-md-12"> '+l(i(13).call(t,"lockableTagInput",{hash:{label:"Writers",name:"writer",value:(r=t&&t.item,null==r||r===!1?r:r.Writer),locked:(r=t&&t.locked,null==r||r===!1?r:r.writer)},data:a}))+' </div> </div> <div class="row"> <div class="col-md-12"> '+l(i(13).call(t,"lockableTagInput",{
hash:{label:"Directors",name:"director",value:(r=t&&t.item,null==r||r===!1?r:r.Director),locked:(r=t&&t.locked,null==r||r===!1?r:r.director)},data:a}))+" </div> </div> </form> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+="<h4>"+o(i(1).call(t,"Files",{hash:{},data:a}))+'</h4> <ul class="media-info-file-list"></ul> <div class="loading-container"><div class="loading"></div></div> ';
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var a,r,o="",l="function",c=this.escapeExpression;return(r=i.file)?a=r.call(t,{hash:{},data:s}):(r=t&&t.file,a=typeof r===l?r.call(t,{hash:{},data:s}):r),o+=c(a)+" "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var n,s="";return s+=" "+p(i(13).call(e,"lockableTextInput",{hash:{label:"Originally Available",
name:"originallyAvailableAt",value:(n=e&&e.item,null==n||n===!1?n:n.originallyAvailableAt),placeholder:(n=e&&e.item,null==n||n===!1?n:n.originallyAvailableAtPlaceholder),locked:(n=e&&e.locked,null==n||n===!1?n:n.originallyAvailableAt)},data:t}))+" "}function o(e,t){var n,s="";return s+=" "+p(i(13).call(e,"lockableTextInput",{hash:{label:"Year",name:"year",value:(n=e&&e.item,null==n||n===!1?n:n.year),placeholder:(n=e&&e.item,null==n||n===!1?n:n.yearPlaceholder),locked:(n=e&&e.locked,null==n||n===!1?n:n.year)
},data:t}))+" "}function l(e,t){return"12"}function c(e,t){return"6"}function u(e,t){var n,s="";return s+=' <div class="col-md-6"> '+p(i(13).call(e,"lockableTextInput",{hash:{label:"Originally Available",name:"originallyAvailableAt",value:(n=e&&e.item,null==n||n===!1?n:n.originallyAvailableAt),placeholder:(n=e&&e.item,null==n||n===!1?n:n.originallyAvailableAtPlaceholder),locked:(n=e&&e.locked,null==n||n===!1?n:n.originallyAvailableAt)},data:t}))+" </div> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),
a=a||{};var d,h="",p=this.escapeExpression,f=this;return h+='<form class="edit-metadata-form"> <div class="row"> <div class="col-md-12 selectize"> '+p(i(13).call(t,"lockableTextInput",{hash:{label:"Title",name:"title",value:(d=t&&t.item,null==d||d===!1?d:d.title),placeholder:(d=t&&t.item,null==d||d===!1?d:d.titlePlaceholder),locked:(d=t&&t.locked,null==d||d===!1?d:d.title),ratingKey:(d=t&&t.item,null==d||d===!1?d:d.ratingKey)},data:a}))+' </div> </div> <div class="row"> <div class="col-md-12 selectize"> '+p(i(13).call(t,"lockableTextInput",{
hash:{label:"Sort Title",name:"titleSort",value:(d=t&&t.item,null==d||d===!1?d:d.titleSort),placeholder:(d=t&&t.item,null==d||d===!1?d:d.titleSortPlaceholder),locked:(d=t&&t.locked,null==d||d===!1?d:d.titleSort),ratingKey:(d=t&&t.item,null==d||d===!1?d:d.ratingKey)},data:a}))+' </div> </div> <div class="row"> <div class="col-md-12 selectize"> '+p(i(13).call(t,"lockableTextInput",{hash:{label:"Original Title",name:"originalTitle",value:(d=t&&t.item,null==d||d===!1?d:d.originalTitle),placeholder:(d=t&&t.item,
null==d||d===!1?d:d.originalTitlePlaceholder),locked:(d=t&&t.locked,null==d||d===!1?d:d.originalTitle),ratingKey:(d=t&&t.item,null==d||d===!1?d:d.ratingKey)},data:a}))+' </div> </div> <div class="row"> <div class="col-md-4"> ',d=n.if.call(t,t&&t.supportsLinkedYears,{hash:{},inverse:f.program(3,o,a),fn:f.program(1,r,a),data:a}),(d||0===d)&&(h+=d),h+=' </div> <div class="col-md-4"> '+p(i(13).call(t,"lockableNumericInput",{hash:{label:"Rating",name:"rating",value:(d=t&&t.item,null==d||d===!1?d:d.rating),
placeholder:(d=t&&t.item,null==d||d===!1?d:d.ratingPlaceholder),locked:(d=t&&t.locked,null==d||d===!1?d:d.rating)},data:a}))+' </div> <div class="col-md-4 selectize"> '+p(i(13).call(t,"lockableTextInput",{hash:{label:"Content Rating",name:"contentRating",value:(d=t&&t.item,null==d||d===!1?d:d.contentRating),placeholder:(d=t&&t.item,null==d||d===!1?d:d.contentRatingPlaceholder),locked:(d=t&&t.locked,null==d||d===!1?d:d.contentRating),ratingKey:(d=t&&t.item,null==d||d===!1?d:d.ratingKey)},data:a}))+' </div> </div> <div class="row"> <div class="col-md-',
d=n.if.call(t,t&&t.supportsLinkedYears,{hash:{},inverse:f.program(7,c,a),fn:f.program(5,l,a),data:a}),(d||0===d)&&(h+=d),h+=' selectize"> '+p(i(13).call(t,"lockableTextInput",{hash:{label:"Studio",name:"studio",value:(d=t&&t.item,null==d||d===!1?d:d.studio),placeholder:(d=t&&t.item,null==d||d===!1?d:d.studioPlaceholder),locked:(d=t&&t.locked,null==d||d===!1?d:d.studio),ratingKey:(d=t&&t.item,null==d||d===!1?d:d.ratingKey)},data:a}))+" </div> ",d=n.unless.call(t,t&&t.supportsLinkedYears,{hash:{},inverse:f.noop,
fn:f.program(9,u,a),data:a}),(d||0===d)&&(h+=d),h+=' </div> <div class="row"> <div class="col-md-12"> '+p(i(13).call(t,"lockableTextInput",{hash:{label:"Tagline",name:"tagline",value:(d=t&&t.item,null==d||d===!1?d:d.tagline),placeholder:(d=t&&t.item,null==d||d===!1?d:d.taglinePlaceholder),locked:(d=t&&t.locked,null==d||d===!1?d:d.tagline)},data:a}))+' </div> </div> <div class="row"> <div class="col-md-12"> '+p(i(13).call(t,"lockableTextInput",{hash:{label:"Summary",name:"summary",value:(d=t&&t.item,
null==d||d===!1?d:d.summary),placeholder:(d=t&&t.item,null==d||d===!1?d:d.summaryPlaceholder),type:"textarea",rows:"5",locked:(d=t&&t.locked,null==d||d===!1?d:d.summary)},data:a}))+" </div> </div> </form> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r,o="",l=this.escapeExpression;return o+='<form class="edit-metadata-form"> <div class="row"> <div class="col-md-6"> '+l(i(13).call(t,"lockableTagInput",{
hash:{label:"Directors",name:"director",value:(r=t&&t.item,null==r||r===!1?r:r.Director),locked:(r=t&&t.locked,null==r||r===!1?r:r.director)},data:a}))+' </div> <div class="col-md-6"> '+l(i(13).call(t,"lockableTagInput",{hash:{label:"Country",name:"country",value:(r=t&&t.item,null==r||r===!1?r:r.Country),locked:(r=t&&t.locked,null==r||r===!1?r:r.country)},data:a}))+' </div> </div> <div class="row"> <div class="col-md-12"> '+l(i(13).call(t,"lockableTagInput",{hash:{label:"Genres",name:"genre",value:(r=t&&t.item,
null==r||r===!1?r:r.Genre),locked:(r=t&&t.locked,null==r||r===!1?r:r.genre)},data:a}))+' </div> </div> <div class="row"> <div class="col-md-12"> '+l(i(13).call(t,"lockableTagInput",{hash:{label:"Writers",name:"writer",value:(r=t&&t.item,null==r||r===!1?r:r.Writer),locked:(r=t&&t.locked,null==r||r===!1?r:r.writer)},data:a}))+' </div> </div> <div class="row"> <div class="col-md-12"> '+l(i(13).call(t,"lockableTagInput",{hash:{label:"Collections",name:"collection",value:(r=t&&t.item,null==r||r===!1?r:r.Collection),
locked:(r=t&&t.locked,null==r||r===!1?r:r.collection)},data:a}))+" </div> </div> </form> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r,o="",l=this.escapeExpression;return o+='<form class="edit-metadata-form"> <div class="row"> <div class="col-md-6"> '+l(i(13).call(t,"lockableTextInput",{hash:{label:"Title",name:"title",value:(r=t&&t.item,null==r||r===!1?r:r.title),placeholder:(r=t&&t.item,
null==r||r===!1?r:r.titlePlaceholder),locked:(r=t&&t.locked,null==r||r===!1?r:r.title)},data:a}))+' </div> <div class="col-md-6"> '+l(i(13).call(t,"lockableTextInput",{hash:{label:"Sort Title",name:"titleSort",value:(r=t&&t.item,null==r||r===!1?r:r.titleSort),placeholder:(r=t&&t.item,null==r||r===!1?r:r.titleSortPlaceholder),locked:(r=t&&t.locked,null==r||r===!1?r:r.titleSort)},data:a}))+' </div> </div> <div class="row"> <div class="col-md-12"> '+l(i(13).call(t,"lockableTextInput",{hash:{label:"Summary",
name:"summary",value:(r=t&&t.item,null==r||r===!1?r:r.summary),placeholder:(r=t&&t.item,null==r||r===!1?r:r.summaryPlaceholder),type:"textarea",rows:"5",locked:(r=t&&t.locked,null==r||r===!1?r:r.summary)},data:a}))+" </div> </div> </form> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r,o="",l=this.escapeExpression;return o+='<form class="edit-metadata-form"> <div class="row"> <div class="col-md-9"> '+l(i(13).call(t,"lockableTextInput",{
hash:{label:"Title",name:"title",value:(r=t&&t.item,null==r||r===!1?r:r.title),placeholder:(r=t&&t.item,null==r||r===!1?r:r.titlePlaceholder),locked:(r=t&&t.locked,null==r||r===!1?r:r.title)},data:a}))+' </div> <div class="col-md-3"> '+l(i(13).call(t,"lockableTextInput",{hash:{label:"Year",name:"year",value:(r=t&&t.item,null==r||r===!1?r:r.year),placeholder:(r=t&&t.item,null==r||r===!1?r:r.yearPlaceholder),locked:(r=t&&t.locked,null==r||r===!1?r:r.year)},data:a}))+' </div> </div> <div class="row"> <div class="col-md-12"> '+l(i(13).call(t,"lockableTextInput",{
hash:{label:"Sort Title",name:"titleSort",value:(r=t&&t.item,null==r||r===!1?r:r.titleSort),placeholder:(r=t&&t.item,null==r||r===!1?r:r.titleSortPlaceholder),locked:(r=t&&t.locked,null==r||r===!1?r:r.titleSort)},data:a}))+' </div> </div> <div class="row"> <div class="col-md-12"> '+l(i(13).call(t,"lockableTextInput",{hash:{label:"Summary",name:"summary",value:(r=t&&t.item,null==r||r===!1?r:r.summary),placeholder:(r=t&&t.item,null==r||r===!1?r:r.summaryPlaceholder),type:"textarea",rows:"5",locked:(r=t&&t.locked,
null==r||r===!1?r:r.summary)},data:a}))+" </div> </div> </form> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r,o="",l=this.escapeExpression;return o+='<form class="edit-metadata-form"> <div class="row"> <div class="col-md-12"> '+l(i(13).call(t,"textInput",{hash:{label:"Title",name:"title",value:(r=t&&t.item,null==r||r===!1?r:r.title)},data:a}))+' </div> </div> <div class="row"> <div class="col-md-12"> '+l(i(13).call(t,"textInput",{
hash:{label:"Summary",name:"summary",value:(r=t&&t.item,null==r||r===!1?r:r.summary),placeholder:(r=t&&t.item,null==r||r===!1?r:r.summaryPlaceholder),type:"textarea",rows:"5"},data:a}))+" </div> </div> </form>"})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r,o="",l=this.escapeExpression;return o+='<form class="edit-metadata-form"> <div class="row"> <div class="col-md-12"> '+l(i(13).call(t,"lockableTextInput",{
hash:{label:"Summary",name:"summary",value:(r=t&&t.item,null==r||r===!1?r:r.summary),placeholder:(r=t&&t.item,null==r||r===!1?r:r.summaryPlaceholder),type:"textarea",rows:"5",locked:(r=t&&t.locked,null==r||r===!1?r:r.summary)},data:a}))+" </div> </div> </form> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var i,s="";return s+=' <form class="edit-metadata-form"> <div class="row"> <div class="col-md-12"> ',i=n.if.call(e,e&&e.showLabels,{hash:{},
inverse:p.program(4,l,t),fn:p.program(2,o,t),data:t}),(i||0===i)&&(s+=i),s+=" </div> </div> </form> "}function o(e,t){var n,s="";return s+=" "+h(i(13).call(e,"lockableTagInput",{hash:{label:"Labels",name:"label",value:(n=e&&e.item,null==n||n===!1?n:n.Label),locked:(n=e&&e.locked,null==n||n===!1?n:n.label)},data:t}))+" "}function l(e,t){var n="";return n+=' <div class="form-group"> <label>'+h(i(1).call(e,"Labels",{hash:{},data:t}))+"</label> <p>"+h(i(1).call(e,"Labels require Plex Media Server {1} or later.",e&&e.labelsMinVersion,{
hash:{},data:t}))+"</p> </div> "}function c(e,t){var n,s="";return s+=' <div class="row row-padded"> <h4 class="text-muted text-center">'+h(i(1).call(e,"You need a Plex Pass to use restrictions.",{hash:{},data:t}))+'</h4> <p class="text-center"> <a class="btn btn-sm btn-primary" href="'+h((n=e&&e.plexPassUrl,typeof n===f?n.apply(e):n))+'" target="_blank">'+h(i(1).call(e,"Learn More",{hash:{},data:t}))+"</a> </p> </div> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var u,d="",h=this.escapeExpression,p=this,f="function";
return u=n.if.call(t,t&&t.hasPlexPass,{hash:{},inverse:p.program(6,c,a),fn:p.program(1,r,a),data:a}),(u||0===u)&&(d+=u),d+=" "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var n,s="";return s+=" "+p(i(13).call(e,"lockableTextInput",{hash:{label:"Originally Available",name:"originallyAvailableAt",value:(n=e&&e.item,null==n||n===!1?n:n.originallyAvailableAt),placeholder:(n=e&&e.item,null==n||n===!1?n:n.originallyAvailableAtPlaceholder),locked:(n=e&&e.locked,
null==n||n===!1?n:n.originallyAvailableAt)},data:t}))+" "}function o(e,t){var n,s="";return s+=" "+p(i(13).call(e,"lockableTextInput",{hash:{label:"Year",name:"year",value:(n=e&&e.item,null==n||n===!1?n:n.year),placeholder:(n=e&&e.item,null==n||n===!1?n:n.yearPlaceholder),locked:(n=e&&e.locked,null==n||n===!1?n:n.year)},data:t}))+" "}function l(e,t){return"12"}function c(e,t){return"6"}function u(e,t){var n,s="";return s+=' <div class="col-md-6"> '+p(i(13).call(e,"lockableTextInput",{hash:{label:"Originally Available",
name:"originallyAvailableAt",value:(n=e&&e.item,null==n||n===!1?n:n.originallyAvailableAt),placeholder:(n=e&&e.item,null==n||n===!1?n:n.originallyAvailableAtPlaceholder),locked:(n=e&&e.locked,null==n||n===!1?n:n.originallyAvailableAt)},data:t}))+" </div> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var d,h="",p=this.escapeExpression,f=this;return h+='<form class="edit-metadata-form"> <div class="row"> <div class="col-md-12 selectize"> '+p(i(13).call(t,"lockableTextInput",{
hash:{label:"Title",name:"title",value:(d=t&&t.item,null==d||d===!1?d:d.title),placeholder:(d=t&&t.item,null==d||d===!1?d:d.titlePlaceholder),locked:(d=t&&t.locked,null==d||d===!1?d:d.title),ratingKey:(d=t&&t.item,null==d||d===!1?d:d.ratingKey)},data:a}))+' </div> </div> <div class="row"> <div class="col-md-12 selectize"> '+p(i(13).call(t,"lockableTextInput",{hash:{label:"Sort Title",name:"titleSort",value:(d=t&&t.item,null==d||d===!1?d:d.titleSort),placeholder:(d=t&&t.item,null==d||d===!1?d:d.titleSortPlaceholder),
locked:(d=t&&t.locked,null==d||d===!1?d:d.titleSort),ratingKey:(d=t&&t.item,null==d||d===!1?d:d.ratingKey)},data:a}))+' </div> </div> <div class="row"> <div class="col-md-4"> ',d=n.if.call(t,t&&t.supportsLinkedYears,{hash:{},inverse:f.program(3,o,a),fn:f.program(1,r,a),data:a}),(d||0===d)&&(h+=d),h+=' </div> <div class="col-md-4"> '+p(i(13).call(t,"lockableNumericInput",{hash:{label:"Rating",name:"rating",value:(d=t&&t.item,null==d||d===!1?d:d.rating),placeholder:(d=t&&t.item,null==d||d===!1?d:d.ratingPlaceholder),
locked:(d=t&&t.locked,null==d||d===!1?d:d.rating)},data:a}))+' </div> <div class="col-md-4 selectize"> '+p(i(13).call(t,"lockableTextInput",{hash:{label:"Content Rating",name:"contentRating",value:(d=t&&t.item,null==d||d===!1?d:d.contentRating),placeholder:(d=t&&t.item,null==d||d===!1?d:d.contentRatingPlaceholder),locked:(d=t&&t.locked,null==d||d===!1?d:d.contentRating),ratingKey:(d=t&&t.item,null==d||d===!1?d:d.ratingKey)},data:a}))+' </div> </div> <div class="row"> <div class="col-md-12 selectize"> '+p(i(13).call(t,"lockableTextInput",{
hash:{label:"Original Title",name:"originalTitle",value:(d=t&&t.item,null==d||d===!1?d:d.originalTitle),placeholder:(d=t&&t.item,null==d||d===!1?d:d.originalTitlePlaceholder),locked:(d=t&&t.locked,null==d||d===!1?d:d.originalTitle),ratingKey:(d=t&&t.item,null==d||d===!1?d:d.ratingKey)},data:a}))+' </div> </div> <div class="row"> <div class="col-md-',d=n.if.call(t,t&&t.supportsLinkedYears,{hash:{},inverse:f.program(7,c,a),fn:f.program(5,l,a),data:a}),(d||0===d)&&(h+=d),h+=' selectize"> '+p(i(13).call(t,"lockableTextInput",{
hash:{label:"Studio",name:"studio",value:(d=t&&t.item,null==d||d===!1?d:d.studio),placeholder:(d=t&&t.item,null==d||d===!1?d:d.studioPlaceholder),locked:(d=t&&t.locked,null==d||d===!1?d:d.studio),ratingKey:(d=t&&t.item,null==d||d===!1?d:d.ratingKey)},data:a}))+" </div> ",d=n.unless.call(t,t&&t.supportsLinkedYears,{hash:{},inverse:f.noop,fn:f.program(9,u,a),data:a}),(d||0===d)&&(h+=d),h+=' </div> <div class="row"> <div class="col-md-12"> '+p(i(13).call(t,"lockableTextInput",{hash:{label:"Tagline",
name:"tagline",value:(d=t&&t.item,null==d||d===!1?d:d.tagline),placeholder:(d=t&&t.item,null==d||d===!1?d:d.taglinePlaceholder),locked:(d=t&&t.locked,null==d||d===!1?d:d.tagline)},data:a}))+' </div> </div> <div class="row"> <div class="col-md-12"> '+p(i(13).call(t,"lockableTextInput",{hash:{label:"Summary",name:"summary",value:(d=t&&t.item,null==d||d===!1?d:d.summary),placeholder:(d=t&&t.item,null==d||d===!1?d:d.summaryPlaceholder),type:"textarea",rows:"5",locked:(d=t&&t.locked,null==d||d===!1?d:d.summary)
},data:a}))+" </div> </div> </form> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r,o="",l=this.escapeExpression;return o+='<form class="edit-metadata-form"> <div class="row"> <div class="col-md-12"> '+l(i(13).call(t,"lockableTagInput",{hash:{label:"Genres",name:"genre",value:(r=t&&t.item,null==r||r===!1?r:r.Genre),locked:(r=t&&t.locked,null==r||r===!1?r:r.genre)},data:a}))+' </div> </div> <div class="row"> <div class="col-md-12"> '+l(i(13).call(t,"lockableTagInput",{
hash:{label:"Collections",name:"collection",value:(r=t&&t.item,null==r||r===!1?r:r.Collection),locked:(r=t&&t.locked,null==r||r===!1?r:r.collection)},data:a}))+" </div> </div> </form> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var n,s="";return s+=' <div class="row"> <div class="col-md-12 selectize"> '+c(i(13).call(e,"autocompleteTextInput",{hash:{label:"Artist",name:"grandparentTitle",placeholder:(n=e&&e.item,null==n||n===!1?n:n.grandparentTitlePlaceholder),
ratingKey:(n=e&&e.item,null==n||n===!1?n:n.grandparentRatingKey),title:(n=e&&e.item,null==n||n===!1?n:n.grandparentTitle)},data:t}))+' </div> </div> <div class="row"> <div class="col-md-12 selectize"> '+c(i(13).call(e,"autocompleteTextInput",{hash:{label:"Album",name:"parentTitle",placeholder:(n=e&&e.item,null==n||n===!1?n:n.parentTitlePlaceholder),ratingKey:(n=e&&e.item,null==n||n===!1?n:n.parentRatingKey),title:(n=e&&e.item,null==n||n===!1?n:n.parentTitle),scopeToAttr:"grandparentRatingKey",scopeToParam:"artist.id"
},data:t}))+" </div> </div> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var o,l="",c=this.escapeExpression,u=this;return l+='<form class="edit-metadata-form"> ',o=n.if.call(t,t&&t.canReparent,{hash:{},inverse:u.noop,fn:u.program(1,r,a),data:a}),(o||0===o)&&(l+=o),l+=' <div class="row"> <div class="col-md-12"> '+c(i(13).call(t,"lockableTextInput",{hash:{label:"Title",name:"title",value:(o=t&&t.item,null==o||o===!1?o:o.title),placeholder:(o=t&&t.item,null==o||o===!1?o:o.titlePlaceholder),
locked:(o=t&&t.locked,null==o||o===!1?o:o.title)},data:a}))+' </div> </div> <div class="row"> <div class="col-md-4"> <label>'+c(i(1).call(t,"Rating",{hash:{},data:a}))+'</label> <div class="rating-region"></div> </div> <div class="col-md-4"> '+c(i(13).call(t,"lockableNumericInput",{hash:{label:"Track",name:"index",value:(o=t&&t.item,null==o||o===!1?o:o.index),placeholder:(o=t&&t.item,null==o||o===!1?o:o.indexPlaceholder),locked:(o=t&&t.locked,null==o||o===!1?o:o.index),disabled:t&&t.disableIndices
},data:a}))+' </div> <div class="col-md-4"> '+c(i(13).call(t,"lockableNumericInput",{hash:{label:"Disc",name:"parentIndex",value:(o=t&&t.item,null==o||o===!1?o:o.parentIndex),placeholder:(o=t&&t.item,null==o||o===!1?o:o.parentIndexPlaceholder),locked:(o=t&&t.locked,null==o||o===!1?o:o.parentIndex),disabled:t&&t.disableIndices},data:a}))+' </div> </div> <div class="row"> <div class="col-md-12 selectize"> '+c(i(13).call(t,"lockableTextInput",{hash:{label:"Track Artist",name:"originalTitle",value:(o=t&&t.item,
null==o||o===!1?o:o.originalTitle),placeholder:(o=t&&t.item,null==o||o===!1?o:o.originalTitlePlaceholder),locked:(o=t&&t.locked,null==o||o===!1?o:o.originalTitle),ratingKey:(o=t&&t.item,null==o||o===!1?o:o.ratingKey)},data:a}))+" </div> </div> </form> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r,o="",l=this.escapeExpression;return o+='<form class="edit-metadata-form"> <div class="row"> <div class="col-md-12"> '+l(i(13).call(t,"lockableTagInput",{
hash:{label:"Mood",name:"mood",value:(r=t&&t.item,null==r||r===!1?r:r.mood),locked:(r=t&&t.locked,null==r||r===!1?r:r.mood)},data:a}))+" </div> </div> </form> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var s,a="";return a+=' <div class="setup-agent-section"> <div class="setup-agent-title">'+u(i(1).call(e,"{1} Settings",e&&e.agentName,{hash:{},data:t}))+'</div> <p class="setup-agent-disclaimer">'+u(i(1).call(e,"Note: These settings will take effect for all libraries using the {1} agent.",e&&e.agentName,{
hash:{},data:t}))+'</p> <div class="setup-agent-settings"> ',s=n.each.call(e,e&&e.settings,{hash:{},inverse:d.noop,fn:d.program(2,o,t),data:t}),(s||0===s)&&(a+=s),a+=" </div> </div> "}function o(e,t){var n="";return n+=" "+u(i(13).call(e,"setting",{hash:{idSuffix:"_c"},data:t}))+" "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var l,c="",u=this.escapeExpression,d=this;return l=n.if.call(t,t&&t.settings,{hash:{},inverse:d.noop,fn:d.program(1,r,a),data:a}),(l||0===l)&&(c+=l),c+=" ";
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<form class="edit-section-type-form settings-container"> <p>'+o(i(1).call(t,"There was an error adding this library.",{hash:{},data:a}))+"</p> <p>"+o(i(1).call(t,"You need to {1}follow these instructions{2} to troubleshoot the Plex Media Server.",'<a href="https://support.plex.tv/hc/en-us/articles/201119258-Resetting-System-and-Framework-bundles" target="_blank">',"</a>",{
hash:{},data:a}))+"</p> </form>"})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var a,r,o="",l="function",c=this.escapeExpression;return o+='<div class="filter-bar-right"> <a class="clear-filters-btn btn-gray" href="#"><i class="glyphicon remove-2"></i></a> </div> <h4>',(r=i.titles)?a=r.call(t,{hash:{},data:s}):(r=t&&t.titles,a=typeof r===l?r.call(t,{hash:{},data:s}):r),o+=c(a)+"</h4> "})},function(e,t,i){
var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return' <i class="server-alert-icon glyphicon cogwheel"></i> '}function o(e,t){var n;return n=i(10).call(e,(n=e&&e.event,null==n||n===!1?n:n._type),"status",{hash:{},inverse:j.program(6,c,t),fn:j.program(4,l,t),data:t}),n||0===n?n:""}function l(e,t){return' <i class="server-alert-icon glyphicon bullhorn"></i> '}function c(e,t){var n;return n=i(10).call(e,(n=e&&e.event,null==n||n===!1?n:n._type),"playing",{hash:{},inverse:j.program(9,d,t),
fn:j.program(7,u,t),data:t}),n||0===n?n:""}function u(e,t){return' <i class="server-alert-icon glyphicon imac"></i> '}function d(e,t){var n;return n=i(10).call(e,(n=e&&e.event,null==n||n===!1?n:n._type),"websocket",{hash:{},inverse:j.program(13,f,t),fn:j.program(10,h,t),data:t}),n||0===n?n:""}function h(e,t){var i,s="";return s+=" ",i=n.if.call(e,(i=e&&e.event,null==i||i===!1?i:i.opened),{hash:{},inverse:j.program(11,p,t),fn:j.program(4,l,t),data:t}),(i||0===i)&&(s+=i),s+=" "}function p(e,t){return' <i class="server-alert-icon glyphicon warning-sign"></i> ';
}function f(e,t){var n;return n=i(10).call(e,(n=e&&e.event,null==n||n===!1?n:n.state),0,{hash:{},inverse:j.program(16,g,t),fn:j.program(14,m,t),data:t}),n||0===n?n:""}function m(e,t){return' <i class="server-alert-icon glyphicon plus"></i> '}function g(e,t){var n;return n=i(10).call(e,(n=e&&e.event,null==n||n===!1?n:n.state),5,{hash:{},inverse:j.program(19,y,t),fn:j.program(17,v,t),data:t}),n||0===n?n:""}function v(e,t){return' <i class="server-alert-icon glyphicon ok-2"></i> '}function y(e,t){var n;
return n=i(10).call(e,(n=e&&e.event,null==n||n===!1?n:n.state),6,{hash:{},inverse:j.program(22,w,t),fn:j.program(20,b,t),data:t}),n||0===n?n:""}function b(e,t){return' <i class="server-alert-icon glyphicon magic"></i> '}function w(e,t){var n;return n=i(10).call(e,(n=e&&e.event,null==n||n===!1?n:n.state),9,{hash:{},inverse:j.program(25,S,t),fn:j.program(23,x,t),data:t}),n||0===n?n:""}function x(e,t){return' <i class="server-alert-icon glyphicon bin"></i> '}function S(e,t){return' <i class="server-alert-icon glyphicon tags"></i> ';
}function C(e,t){var n,s="";return s+=" "+V(i(1).call(e,"{1} set to {2}.",(n=e&&e.event,null==n||n===!1?n:n.label),(n=e&&e.event,null==n||n===!1?n:n.value),{hash:{},data:t}))+" "}function k(e,t){var n;return n=i(10).call(e,(n=e&&e.event,null==n||n===!1?n:n._type),"status",{hash:{},inverse:j.program(36,T,t),fn:j.program(30,P,t),data:t}),n||0===n?n:""}function P(e,t){var i,s="";return s+=" ",i=n.if.call(e,(i=e&&e.event,null==i||i===!1?i:i.message),{hash:{},inverse:j.program(33,I,t),fn:j.program(31,A,t),
data:t}),(i||0===i)&&(s+=i),s+=" "}function A(e,t){var n,s="";return s+=" "+V(i(1).call(e,(n=e&&e.event,null==n||n===!1?n:n.message),{hash:{},data:t}))+" "}function I(e,t){var s,a="";return a+=" "+V(i(1).call(e,(s=e&&e.event,null==s||s===!1?s:s.title),{hash:{},data:t})),s=n.if.call(e,(s=e&&e.event,null==s||s===!1?s:s.description),{hash:{},inverse:j.noop,fn:j.program(34,_,t),data:t}),(s||0===s)&&(a+=s),a+=" "}function _(e,t){var n,s="";return s+=": "+V(i(1).call(e,(n=e&&e.event,null==n||n===!1?n:n.description),{
hash:{},data:t}))}function T(e,t){var n;return n=i(10).call(e,(n=e&&e.event,null==n||n===!1?n:n._type),"timeline",{hash:{},inverse:j.program(39,E,t),fn:j.program(37,D,t),data:t}),n||0===n?n:""}function D(e,t){var n,s="";return s+=" "+V(i(1).call(e,(n=e&&e.event,null==n||n===!1?n:n.stateString),{hash:{},data:t}))+' <a href="#!/server/'+V(i(32).call(e,e&&e.serverID,{hash:{},data:t}))+"/details/"+V(i(32).call(e,e&&e.itemKey,{hash:{},data:t}))+'">'+V((n=e&&e.event,n=null==n||n===!1?n:n.mediaTitle,typeof n===H?n.apply(e):n))+"</a> "+V(i(1).call(e,"in",{
hash:{},data:t}))+' <a href="#!/server/'+V(i(32).call(e,e&&e.serverID,{hash:{},data:t}))+"/section/"+V(i(32).call(e,(n=e&&e.event,null==n||n===!1?n:n.sectionID),{hash:{},data:t}))+'">'+V((n=e&&e.event,n=null==n||n===!1?n:n.sectionTitle,typeof n===H?n.apply(e):n))+"</a> "}function E(e,t){var n;return n=i(10).call(e,(n=e&&e.event,null==n||n===!1?n:n._type),"playing",{hash:{},inverse:j.program(42,R,t),fn:j.program(40,M,t),data:t}),n||0===n?n:""}function M(e,t){var n,s="";return s+=" "+V(i(1).call(e,"{1} started playing {2} on {3}.",(n=e&&e.event,
null==n||n===!1?n:n.username),(n=e&&e.event,null==n||n===!1?n:n.title),(n=e&&e.event,null==n||n===!1?n:n.player),{hash:{},data:t}))+" "}function R(e,t){var n;return n=i(10).call(e,(n=e&&e.event,null==n||n===!1?n:n._type),"websocket",{hash:{},inverse:j.noop,fn:j.program(43,O,t),data:t}),n||0===n?n:""}function O(e,t){var i,s="";return s+=" ",i=n.if.call(e,(i=e&&e.event,null==i||i===!1?i:i.opened),{hash:{},inverse:j.program(46,N,t),fn:j.program(44,L,t),data:t}),(i||0===i)&&(s+=i),s+=" "}function L(e,t){
var n="";return n+=" "+V(i(1).call(e,"Opened connection to {1}, listening for events.",e&&e.serverName,{hash:{},data:t}))+" "}function N(e,t){var i;return i=n.if.call(e,(i=e&&e.event,null==i||i===!1?i:i.closed),{hash:{},inverse:j.program(49,U,t),fn:j.program(47,F,t),data:t}),i||0===i?i:""}function F(e,t){var n="";return n+=" "+V(i(1).call(e,"Connection to {1} closed.",e&&e.serverName,{hash:{},data:t}))+" "}function U(e,t){var n="";return n+=" "+V(i(1).call(e,"Unable to listen for events on {1}.",e&&e.serverName,{
hash:{},data:t}))+" "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var z,B="",j=this,V=this.escapeExpression,H="function";return B+='<div class="striped-list-inner-item alert-list-inner-item"> ',z=i(10).call(t,(z=t&&t.event,null==z||z===!1?z:z._type),"setting",{hash:{},inverse:j.program(3,o,a),fn:j.program(1,r,a),data:a}),(z||0===z)&&(B+=z),B+=' <div class="server-alert-details"> <span class="server-alert-time">'+V(i(516).call(t,(z=t&&t.event,null==z||z===!1?z:z.time),"LT",{
hash:{},data:a}))+"</span> ",z=i(10).call(t,(z=t&&t.event,null==z||z===!1?z:z._type),"setting",{hash:{},inverse:j.program(29,k,a),fn:j.program(27,C,a),data:a}),(z||0===z)&&(B+=z),B+=" </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<div class="row row-padded"> <h4 class="text-muted text-center"> '+o(i(1).call(t,"Nothing is currently being played.",{
hash:{},data:a}))+" </h4> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return"hide-actions"}function o(e,t){return"hidden"}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var l,c="",u=this,d="function",h=this.escapeExpression;return c+='<a class="media-poster-container ',l=n.unless.call(t,t&&t.showActions,{hash:{},inverse:u.noop,fn:u.program(1,r,a),data:a}),(l||0===l)&&(c+=l),c+='" href="'+h((l=t&&t.url,typeof l===d?l.apply(t):l))+'"> <div class="media-poster-fade invisible"></div> <div class="media-poster"> <div class="media-poster-overlay"></div> <div class="media-poster-top-overlay"></div> <div class="media-poster-actions ',
l=n.unless.call(t,t&&t.showActions,{hash:{},inverse:u.noop,fn:u.program(3,o,a),data:a}),(l||0===l)&&(c+=l),c+='"> <button class="play-btn media-poster-btn btn-link" tabindex="-1"><i class="glyphicon play"></i></button> <button class="edit-btn media-poster-btn btn-link" tabindex="-1"><i class="glyphicon pencil"></i></button> <button class="info-btn media-poster-btn btn-link" tabindex="-1"><i class="glyphicon circle-info"></i></button> </div> <button class="close-btn btn-link btn-gray" href="#"><i class="glyphicon remove-2"></i></button> <i class="device-icon"></i> <div class="session-player"></div> <div class="session-state"></div> <div class="session-transcode-details"> <p class="session-transcode-title"> <span class="session-transcode"></span> <span class="session-transcode-throttled"></span> </p> <p class="session-transcode-video"> <span class="session-transcode-label">'+h(i(1).call(t,"Video",{
hash:{},data:a}))+'</span> <span class="session-transcode-video-decision"></span> </p> <p class="session-transcode-audio"> <span class="session-transcode-label">'+h(i(1).call(t,"Audio",{hash:{},data:a}))+'</span> <span class="session-transcode-audio-decision"></span> </p> </div> <div class="media-progress"></div> </div> <div class="session-user pull-right"> <div class="user-poster img-circle"></div> <div class="session-username media-heading secondary"></div> </div> <div class="media-title media-heading"></div> <div class="media-subtitle-1 media-heading secondary"></div> </a> ';
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){function a(e,t){return"cloud-download"}function r(e,t){return"circle-arrow-down"}function o(e,t){return"hidden"}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var l,c="",u=this;return c+='<a class="media-poster-container" href="#"> <div class="media-poster"> <div class="media-poster-overlay"></div> <div class="sync-status"> <div class="sync-status-transcode hidden"></div> <i class="sync-status-icon sync-complete-icon glyphicon ok-2 hidden"></i> <i class="sync-status-icon sync-waiting-icon glyphicon ',
l=i.if.call(t,t&&t.isCloudSync,{hash:{},inverse:u.program(3,r,s),fn:u.program(1,a,s),data:s}),(l||0===l)&&(c+=l),c+=' hidden"></i> <i class="sync-status-icon sync-processing-icon glyphicon more hidden"></i> <i class="sync-status-icon sync-failed-icon glyphicon warning-sign ',l=i.unless.call(t,t&&t.isFailure,{hash:{},inverse:u.noop,fn:u.program(5,o,s),data:s}),(l||0===l)&&(c+=l),c+='"></i> <i class="sync-status-icon sync-unknown-icon glyphicon circle-question-mark ',l=i.if.call(t,t&&t.isFailure,{hash:{},
inverse:u.noop,fn:u.program(5,o,s),data:s}),(l||0===l)&&(c+=l),c+='"></i> </div> <div class="media-poster-actions"> <button class="edit-btn media-poster-btn btn-link" tabindex="-1"><i class="glyphicon pencil"></i></button> <button class="delete-btn media-poster-btn btn-link btn-danger" tabindex="-1"><i class="glyphicon remove-2"></i></button> </div> </div> <div class="media-title media-heading"></div> <div class="media-subtitle-1 media-heading secondary"></div> <div class="media-context media-heading secondary"></div> </a> ';
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var n="";return n+=' <i class="glyphicon cloud-download"></i> '+u(i(1).call(e,"Waiting to be uploaded",{hash:{},data:t}))+" "}function o(e,t){var n="";return n+=' <i class="glyphicon circle-arrow-down"></i> '+u(i(1).call(e,"Waiting to be downloaded",{hash:{},data:t}))+" "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var l,c="",u=this.escapeExpression,d=this;return c+='<div class="media-poster"></div> <p class="title"></p> <p class="complete-subtitle subtitle hidden"> <i class="glyphicon ok-2"></i> '+u(i(1).call(t,"Synced",{
hash:{},data:a}))+' </p> <p class="waiting-subtitle subtitle hidden"> ',l=n.if.call(t,t&&t.isCloudSync,{hash:{},inverse:d.program(3,o,a),fn:d.program(1,r,a),data:a}),(l||0===l)&&(c+=l),c+=' </p> <p class="downloading-subtitle subtitle hidden"> <i class="glyphicon more"></i> '+u(i(1).call(t,"Downloading",{hash:{},data:a}))+' &middot; <span class="transcode-progress"></span>% </p> <p class="converting-subtitle subtitle hidden"> <i class="glyphicon more"></i> '+u(i(1).call(t,"Converting",{hash:{},data:a
}))+' &middot; <span class="transcode-progress"></span>% &middot; <span class="transcode-remaining"></span> </p> <p class="processing-subtitle subtitle hidden"> <i class="glyphicon more"></i> '+u(i(1).call(t,"Waiting to be converted",{hash:{},data:a}))+' </p> <p class="unknown-subtitle subtitle hidden"> <i class="glyphicon circle-question-mark"></i> '+u(i(1).call(t,"Unknown",{hash:{},data:a}))+' </p> <p class="failed-subtitle subtitle hidden"> <i class="glyphicon warning-sign"></i> <span class="error-message"></span> </p> ';
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<div class="row row-padded"> <h4 class="text-muted text-center"> <p>'+o(i(1).call(t,"Conversions for sync and media optimization will appear here.",{hash:{},data:a}))+"</p> <p>"+o(i(1).call(t,"Manage your optimized versions in {1}Optimized Versions Settings{2}.",'<a href="#!/settings/server/{3}/versions">',"</a>",t&&t.serverID,{
hash:{},data:a}))+"</p> </h4> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){function a(e,t){return' <div class="sortable-handle btn-gray-link"><i class="glyphicon show-lines"></i></div> '}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var r,o,l="",c="function",u=this.escapeExpression,d=this;return l+='<div class="show-actions striped-list-inner-item playlist-inner-item ',(o=i.type)?r=o.call(t,{hash:{},data:s}):(o=t&&t.type,r=typeof o===c?o.call(t,{
hash:{},data:s}):o),l+=u(r)+'"> <div class="media-actions media-reorder"> ',r=i.unless.call(t,t&&t.hideDragHandle,{hash:{},inverse:d.noop,fn:d.program(1,a,s),data:s}),(r||0===r)&&(l+=r),l+=' </div> <div class="generator-poster-container"> <div class="media-poster"></div> </div> <div class="media-actions generator-actions"> <button class="promote-btn media-action-btn btn-gray-link" tabindex="-1"><i class="glyphicon up-arrow"></i></button> <button class="delete-btn media-action-btn btn-gray-link btn-danger" tabindex="-1"><i class="glyphicon remove-2"></i></button> </div> <div class="media-item"> <div class="media-details"> <div class="generator-title col-lg"></div> <div class="generator-target col-md col-secondary"></div> <div class="conversion-status-region col-md col-secondary"></div> </div> </div> </div> ';
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r,o="",l=this.escapeExpression,c="function";return o+='<div class="conversion-status-container conversion-status-converting"> <div class="progress-bar-region"></div> <div class="conversion-status-converting-label-container"> <span class="conversion-status-converting-label">'+l(i(1).call(t,"Converting",{hash:{},data:a}))+'</span> <span class="conversion-status-converting-speed"></span> <div class="conversion-status-converting-progress"> <span class="conversion-status-converting-percentage"></span> <span class="conversion-status-converting-progress-separator">&middot;</span> <span class="conversion-status-converting-remaining"></span> </div> </div> </div> <div class="conversion-status-container conversion-status-processed"> <i class="conversion-status-icon glyphicon ok-2 text-success"></i> '+l(i(1).call(t,"Complete",{
hash:{},data:a}))+' </div> <div class="conversion-status-container conversion-status-disabled"> <i class="conversion-status-icon glyphicon circle-exclamation-mark text-danger"></i> '+l(i(1).call(t,"Deleted",{hash:{},data:a}))+' <button class="enable-btn media-action-btn btn-gray-link" tabindex="-1"><i class="glyphicon repeat"></i></button> </div> <div class="conversion-status-container conversion-status-error"> <i class="conversion-status-icon glyphicon circle-exclamation-mark text-danger"></i> <span class="conversion-status-failed-message">'+l((r=t&&t.initialErrorMessage,
typeof r===c?r.apply(t):r))+'</span> <button class="retry-btn media-action-btn btn-gray-link" tabindex="-1"><i class="glyphicon repeat"></i></button> </div> <div class="conversion-status-container conversion-status-pending"> <i class="conversion-status-icon glyphicon clock"></i> <span class="conversion-status-pending-label">'+l(i(1).call(t,"Waiting",{hash:{},data:a}))+"</span> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],
n=this.merge(n,e.helpers),a=a||{};var r,o="",l=this.escapeExpression;return o+='<a class="card-collapsed" href="#!/server/'+l(i(32).call(t,t&&t.serverID,{hash:{},data:a}))+"/directory/"+l(i(32).call(t,t&&t.currentKey,{hash:{},data:a}))+"/"+l(i(32).call(t,(r=t&&t.channel,null==r||r===!1?r:r.key),{hash:{},data:a}))+'"> <span class="media-title media-heading"></span> </a> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){return this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),
s=s||{},'<a class="media-poster-container" href="#"> <div class="media-poster"> <div class="installed-icon"><i class="glyphicon ok-2"></i></div> </div> <div class="media-title media-heading"></div> <div class="media-subtitle-1 media-heading secondary"></div> </a> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var i,s="";return s+=' <div class="media-poster-overlay"></div> <div class="media-poster-actions"> ',i=n.if.call(e,(i=e&&e.item,null==i||i===!1?i:i.hasPrefs),{
hash:{},inverse:u.noop,fn:u.program(2,o,t),data:t}),(i||0===i)&&(s+=i),s+=' <button class="uninstall-btn media-poster-btn btn-link btn-danger" tabindex="-1"><i class="glyphicon remove-2"></i></button> </div> '}function o(e,t){return' <button class="settings-btn media-poster-btn btn-link" tabindex="-1"><i class="glyphicon cogwheel"></i></button> '}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var l,c="",u=this,d=this.escapeExpression;return c+='<a class="media-poster-container" href="#!/server/'+d(i(32).call(t,t&&t.serverID,{
hash:{},data:a}))+"/channel/"+d(i(32).call(t,(l=t&&t.item,null==l||l===!1?l:l.key),{hash:{},data:a}))+'"> <div class="media-poster"> ',l=n.unless.call(t,t&&t.shared,{hash:{},inverse:u.noop,fn:u.program(1,r,a),data:a}),(l||0===l)&&(c+=l),c+=' <div class="loading loading-inline"></div> </div> <div class="media-title media-heading"></div> <div class="media-subtitle-1 media-heading secondary"></div> </a> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){
return"active"}function o(e,t){return' <div class="section-actions pull-right"> <button class="edit-section-btn btn-gray" href="#"><i class="glyphicon pencil"></i></button> </div> '}function l(e,t){return"show-actions"}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var c,u="",d=this,h=this.escapeExpression,p="function";return u+='<a class="btn-gray btn-loading btn-loading-static ',c=n.if.call(t,t&&t.refreshing,{hash:{},inverse:d.noop,fn:d.program(1,r,a),data:a}),(c||0===c)&&(u+=c),
u+='" href="#!/server/'+h(i(32).call(t,t&&t.serverID,{hash:{},data:a}))+"/section/"+h(i(32).call(t,(c=t&&t.section,null==c||c===!1?c:c.key),{hash:{},data:a}))+'"> ',c=n.if.call(t,t&&t.showActions,{hash:{},inverse:d.noop,fn:d.program(3,o,a),data:a}),(c||0===c)&&(u+=c),u+=' <div class="loading loading-xs"></div> <i class="btn-label section-icon glyphicon '+h((c=t&&t.icon,typeof c===p?c.apply(t):c))+'"></i> <span class="section-title ',c=n.if.call(t,t&&t.showActions,{hash:{},inverse:d.noop,fn:d.program(5,l,a),
data:a}),(c||0===c)&&(u+=c),u+='"></span> </a> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var i,s="";return s+=' <div class="side-bar-actions pull-right ',i=n.if.call(e,e&&e.signedIn,{hash:{},inverse:_.noop,fn:_.program(2,o,t),data:t}),(i||0===i)&&(s+=i),s+='"> ',i=n.if.call(e,(i=e&&e.server,null==i||i===!1?i:i.connected),{hash:{},inverse:_.noop,fn:_.program(4,l,t),data:t}),(i||0===i)&&(s+=i),s+=' <span id="'+I((i=e&&e.server,i=null==i||i===!1?i:i.machineIdentifier,
typeof i===T?i.apply(e):i))+'-dropdown" class="dropdown"> <a class="btn-gray dropdown-toggle" href="#'+I((i=e&&e.server,i=null==i||i===!1?i:i.machineIdentifier,typeof i===T?i.apply(e):i))+'-dropdown" data-toggle="dropdown"><i class="glyphicon cogwheel"></i> <i class="caret-icon caret-icon-sm"></i></a> <ul class="dropdown-menu pull-right"> ',i=n.if.call(e,(i=e&&e.server,null==i||i===!1?i:i.connected),{hash:{},inverse:_.program(11,h,t),fn:_.program(6,c,t),data:t}),(i||0===i)&&(s+=i),s+=" </ul> </span> </div> ";
}function o(e,t){return"signed-in"}function l(e,t){return' <a class="add-library-btn btn-gray" href="#"><i class="glyphicon plus"></i></a> '}function c(e,t){var s,a="";return a+=' <li><a class="settings-btn" href="#"><span class="dropdown-truncated-label">'+I(i(1).call(e,"Settings",{hash:{},data:t}))+'</span></a></li> <li class="signed-in-item"><a class="share-btn" href="#"><span class="dropdown-truncated-label">'+I(i(1).call(e,"Share...",{hash:{},data:t}))+'</span></a></li> <li><a class="update-btn" href="#"><span class="dropdown-truncated-label">',
s=n.if.call(e,e&&e.hasRefreshingSection,{hash:{},inverse:_.program(9,d,t),fn:_.program(7,u,t),data:t}),(s||0===s)&&(a+=s),a+='</span></a></li> <li><a class="optimize-btn" href="#"><span class="dropdown-truncated-label">'+I(i(1).call(e,"Optimize Database",{hash:{},data:t}))+'</span></a></li> <li><a class="clean-bundles-btn" href="#"><span class="dropdown-truncated-label">'+I(i(1).call(e,"Clean Bundles",{hash:{},data:t}))+'</span></a></li> <li><a class="empty-trash-btn" href="#"><span class="dropdown-truncated-label">'+I(i(1).call(e,"Empty Trash",{
hash:{},data:t}))+"</span></a></li> "}function u(e,t){return I(i(1).call(e,"Cancel Update",{hash:{},data:t}))}function d(e,t){return I(i(1).call(e,"Update Libraries",{hash:{},data:t}))}function h(e,t){var n="";return n+=' <li class="signed-in-item"><a class="share-btn" href="#"><span class="dropdown-truncated-label">'+I(i(1).call(e,"Share...",{hash:{},data:t}))+'</span></a></li> <li><a class="remove-btn has-danger" href="#"><span class="dropdown-truncated-label">'+I(i(1).call(e,"Remove",{hash:{},
data:t}))+"</span></a></li> "}function p(e,t){return"selected"}function f(e,t){return"disabled"}function m(e,t){return"show-actions"}function g(e,t){var i;return I((i=e&&e.server,i=null==i||i===!1?i:i.sourceTitle,typeof i===T?i.apply(e):i))}function v(e,t){var i;return I((i=e&&e.server,i=null==i||i===!1?i:i.friendlyName,typeof i===T?i.apply(e):i))}function y(e,t){return'<i class="cloud-sync-icon glyphicon cloud"></i>'}function b(e,t){return"hidden"}function w(e,t){var n="";return n+=' <span class="mixed-content-error">'+I(i(1).call(e,"We're sorry, but we can't reach this server.",{
hash:{},data:t}))+"</span> "}function x(e,t){var n="";return n+=' <span class="mixed-content-error">'+I(i(1).call(e,"We're sorry, but we can't reach this server securely. {1}Click here{2} to reload the app using insecure connections.",'<a class="mixed-content-btn" href="#" target="_blank">',"</a>",{hash:{},data:t}))+" <a href='https://support.plex.tv/hc/en-us/articles/206225077'>"+I(i(1).call(e,"More Info",{hash:{},data:t}))+"</a></span> "}function S(e,t){var n="";return n+=' <span class="mixed-content-error">'+I(i(1).call(e,"We're sorry, but we can't reach this server securely. {1}Click here{2} to allow insecure connections.",'<a class="http-fallback-btn" href="#" target="_blank">',"</a>",{
hash:{},data:t}))+"</span> "}function C(e,t){var n,s="";return s+=' <li> <a class="btn-gray" href="#!/server/'+I(i(32).call(e,(n=e&&e.server,null==n||n===!1?n:n.machineIdentifier),{hash:{},data:t}))+'/channels"> <i class="section-icon glyphicon show-big-thumbnails"></i> '+I(i(1).call(e,"Channels",{hash:{},data:t}))+" </a> </li> "}function k(e,t){var n,s="";return s+=' <li> <a class="btn-gray" href="#!/server/'+I(i(32).call(e,(n=e&&e.server,null==n||n===!1?n:n.machineIdentifier),{hash:{},data:t}))+'/playlists"> <i class="section-icon plex-icon-playlist-alt"></i> '+I(i(1).call(e,"Playlists",{
hash:{},data:t}))+" </a> </li> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var P,A="",I=this.escapeExpression,_=this,T="function";return P=n.if.call(t,t&&t.showActions,{hash:{},inverse:_.noop,fn:_.program(1,r,a),data:a}),(P||0===P)&&(A+=P),A+=' <h5> <a class="select-server-btn ',P=n.if.call(t,t&&t.selected,{hash:{},inverse:_.noop,fn:_.program(13,p,a),data:a}),(P||0===P)&&(A+=P),A+=" ",P=n.unless.call(t,t&&t.canBePrimary,{hash:{},inverse:_.noop,fn:_.program(15,f,a),data:a}),
(P||0===P)&&(A+=P),A+='" href="#"> <span class="server-title ',P=n.if.call(t,t&&t.showActions,{hash:{},inverse:_.noop,fn:_.program(17,m,a),data:a}),(P||0===P)&&(A+=P),A+='">',P=n.if.call(t,(P=t&&t.server,null==P||P===!1?P:P.sourceTitle),{hash:{},inverse:_.program(21,v,a),fn:_.program(19,g,a),data:a}),(P||0===P)&&(A+=P),A+="</span> </a> ",P=n.if.call(t,(P=t&&t.server,null==P||P===!1?P:P.isCloudSync),{hash:{},inverse:_.noop,fn:_.program(23,y,a),data:a}),(P||0===P)&&(A+=P),A+=' <i class="secure-connection-icon plex-icon-lock-round-simplified ',
P=n.unless.call(t,t&&t.hasSecureConnection,{hash:{},inverse:_.noop,fn:_.program(25,b,a),data:a}),(P||0===P)&&(A+=P),A+=" ",P=n.unless.call(t,(P=t&&t.server,null==P||P===!1?P:P.connected),{hash:{},inverse:_.noop,fn:_.program(25,b,a),data:a}),(P||0===P)&&(A+=P),A+='"></i> </h5> ',P=n.if.call(t,t&&t.showUnavailableMessage,{hash:{},inverse:_.noop,fn:_.program(27,w,a),data:a}),(P||0===P)&&(A+=P),A+=" ",P=n.if.call(t,t&&t.showMixedContentMessage,{hash:{},inverse:_.noop,fn:_.program(29,x,a),data:a}),(P||0===P)&&(A+=P),
A+=" ",P=n.if.call(t,t&&t.showHttpFallbackMessage,{hash:{},inverse:_.noop,fn:_.program(31,S,a),data:a}),(P||0===P)&&(A+=P),A+=' <ul class="list side-bar-list dashboard-section-list ',P=n.unless.call(t,(P=t&&t.server,null==P||P===!1?P:P.connected),{hash:{},inverse:_.noop,fn:_.program(25,b,a),data:a}),(P||0===P)&&(A+=P),A+='"> ',P=n.if.call(t,t&&t.showChannels,{hash:{},inverse:_.noop,fn:_.program(33,C,a),data:a}),(P||0===P)&&(A+=P),A+=" ",P=n.if.call(t,t&&t.showPlaylists,{hash:{},inverse:_.noop,fn:_.program(35,k,a),
data:a}),(P||0===P)&&(A+=P),A+=" </ul> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){function a(e,t){return"hide-actions"}function r(e,t){return"hidden"}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var o,l,c="",u=this,d="function",h=this.escapeExpression;return c+='<a class="media-poster-container ',o=i.unless.call(t,t&&t.showActions,{hash:{},inverse:u.noop,fn:u.program(1,a,s),data:s}),(o||0===o)&&(c+=o),c+='" href="',(l=i.url)?o=l.call(t,{
hash:{},data:s}):(l=t&&t.url,o=typeof l===d?l.call(t,{hash:{},data:s}):l),c+=h(o)+'"> <div class="media-poster"> <div class="media-poster-overlay"></div> <div class="media-poster-actions ',o=i.unless.call(t,t&&t.showActions,{hash:{},inverse:u.noop,fn:u.program(3,r,s),data:s}),(o||0===o)&&(c+=o),c+='"> <button class="play-btn media-poster-btn btn-link" tabindex="-1"><i class="glyphicon play"></i></button> <button class="edit-btn media-poster-btn btn-link" tabindex="-1"><i class="glyphicon pencil"></i></button> <button class="more-btn media-poster-btn btn-link" tabindex="-1"><i class="glyphicon more"></i></button> </div> </div> <div class="media-title media-heading"></div> <div class="media-subtitle-1 media-heading secondary"></div> </a> <div class="media-actions-dropdown dropdown"> <div class="dropdown-toggle" data-toggle="dropdown"></div> </div> ';
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){function a(e,t){return"selected"}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var r,o,l="",c=this,u="function",d=this.escapeExpression;return l+='<div class="striped-list-inner-item media-list-item track-list-item track"> <a class="track-list-inner-item show-actions ',r=i.if.call(t,t&&t.selected,{hash:{},inverse:c.noop,fn:c.program(1,a,s),data:s}),(r||0===r)&&(l+=r),l+='" href="#"> <div class="track-actions media-actions"> <button class="track-more-btn media-action-btn btn-link" tabindex="-1"><i class="glyphicon more"></i></button> </div> <span class="track-index media-index media-heading secondary"> <span>',
(o=i.index)?r=o.call(t,{hash:{},data:s}):(o=t&&t.index,r=typeof o===u?o.call(t,{hash:{},data:s}):o),l+=d(r)+'</span> <i class="glyphicon volume-up"></i> </span> <span class="track-title media-title media-heading"></span> <span class="track-subtitle-1 media-subtitle-1 media-heading secondary"></span> <span class="track-context media-context media-heading secondary"></span> <button class="track-music-video-btn media-action-btn btn-link" tabindex="-1"><i class="plex-icon-display"></i></button> </a> <div class="track-actions-dropdown media-actions-dropdown dropdown pull-right"> <div class="dropdown-toggle" data-toggle="dropdown"></div> </div> </div> ';
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var a,r,o="",l="function",c=this.escapeExpression;return o+='<a class="artwork-option media-poster-container" data-rating-key="',(r=i.ratingKey)?a=r.call(t,{hash:{},data:s}):(r=t&&t.ratingKey,a=typeof r===l?r.call(t,{hash:{},data:s}):r),o+=c(a)+'" href="#"> <div class="media-poster"></div> </a> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){
function a(e,t){return"show-actions"}function r(e,t){return"hidden"}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var o,l,c="",u=this,d="function",h=this.escapeExpression;return c+='<a class="episode-list-inner-item media-list-inner-item ',o=i.if.call(t,t&&t.showActions,{hash:{},inverse:u.noop,fn:u.program(1,a,s),data:s}),(o||0===o)&&(c+=o),c+='" href="',(l=i.url)?o=l.call(t,{hash:{},data:s}):(l=t&&t.url,o=typeof l===d?l.call(t,{hash:{},data:s}):l),c+=h(o)+'"> <div class="media-poster"> <span class="media-count-badge badge hidden"></span> <span class="unwatched-count-badge badge hidden"></span> <div class="media-progress"></div> </div> <div class="media-actions ',
o=i.unless.call(t,t&&t.showActions,{hash:{},inverse:u.noop,fn:u.program(3,r,s),data:s}),(o||0===o)&&(c+=o),c+='"> <button class="play-btn media-action-btn btn-link" tabindex="-1"><i class="glyphicon play"></i></button> <button class="edit-btn media-action-btn btn-link" tabindex="-1"><i class="glyphicon pencil"></i></button> <button class="more-btn media-action-btn btn-link" tabindex="-1"><i class="glyphicon more"></i></button> </div> <span class="media-index media-heading secondary"></span> <span class="media-title media-heading"></span> <span class="unwatched-icon"></span> <span class="media-context media-heading media-rating"></span> <p class="media-tagline"></p> <p class="media-summary"></p> </a> <div class="media-actions-dropdown dropdown pull-right"> <div class="dropdown-toggle" data-toggle="dropdown"></div> </div> ';
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){function a(e,t){return"show-actions"}function r(e,t){return"hidden"}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var o,l,c="",u=this,d="function",h=this.escapeExpression;return c+='<a class="episode-list-inner-item media-list-inner-item ',o=i.if.call(t,t&&t.showActions,{hash:{},inverse:u.noop,fn:u.program(1,a,s),data:s}),(o||0===o)&&(c+=o),c+='" href="',(l=i.url)?o=l.call(t,{hash:{},data:s}):(l=t&&t.url,
o=typeof l===d?l.call(t,{hash:{},data:s}):l),c+=h(o)+'"> <span class="media-index media-heading secondary"></span> <span class="media-title media-heading"></span> <span class="unwatched-icon"></span> <div class="media-actions ',o=i.unless.call(t,t&&t.showActions,{hash:{},inverse:u.noop,fn:u.program(3,r,s),data:s}),(o||0===o)&&(c+=o),c+='"> <button class="play-btn media-action-btn btn-link" tabindex="-1"><i class="glyphicon play"></i></button> <button class="edit-btn media-action-btn btn-link" tabindex="-1"><i class="glyphicon pencil"></i></button> <button class="more-btn media-action-btn btn-link" tabindex="-1"><i class="glyphicon more"></i></button> </div> <span class="media-context media-heading media-rating"></span> </a> <div class="media-actions-dropdown dropdown pull-right"> <div class="dropdown-toggle" data-toggle="dropdown"></div> </div> ';
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){function a(e,t){return"hide-actions"}function r(e,t){return"hidden"}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var o,l,c="",u=this,d="function",h=this.escapeExpression;return c+='<a class="media-poster-container ',o=i.unless.call(t,t&&t.showActions,{hash:{},inverse:u.noop,fn:u.program(1,a,s),data:s}),(o||0===o)&&(c+=o),c+='" href="',(l=i.url)?o=l.call(t,{hash:{},data:s}):(l=t&&t.url,o=typeof l===d?l.call(t,{
hash:{},data:s}):l),c+=h(o)+'"> <div class="media-poster"> <div class="media-poster-overlay"></div> <div class="media-poster-actions ',o=i.unless.call(t,t&&t.showActions,{hash:{},inverse:u.noop,fn:u.program(3,r,s),data:s}),(o||0===o)&&(c+=o),c+='"> <button class="play-btn media-poster-btn btn-link" tabindex="-1"><i class="glyphicon play"></i></button> <button class="edit-btn media-poster-btn btn-link" tabindex="-1"><i class="glyphicon pencil"></i></button> <button class="more-btn media-poster-btn btn-link" tabindex="-1"><i class="glyphicon more"></i></button> </div> <span class="media-count-badge badge badge-lg hidden"></span> <div class="media-progress"></div> </div> <span class="unwatched-icon"></span> <div class="media-title media-heading"></div> <div class="media-subtitle-1 media-heading secondary"></div> </a> <div class="media-actions-dropdown dropdown"> <div class="dropdown-toggle" data-toggle="dropdown"></div> </div> ';
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var a,r,o="",l="function",c=this.escapeExpression;return o+='<a class="media-poster-container play-btn" href="',(r=i.url)?a=r.call(t,{hash:{},data:s}):(r=t&&t.url,a=typeof r===l?r.call(t,{hash:{},data:s}):r),o+=c(a)+'"> <div class="media-poster"> <div class="media-poster-overlay"></div> <div class="media-poster-overlay-icons"> <i class="media-poster-overlay-icon glyphicon play"></i> </div> <div class="media-progress"></div> </div> <div class="media-title media-heading"></div> <div class="media-subtitle-1 media-heading secondary"></div> </a> ';
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return"missing"}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var o,l="",c=this.escapeExpression,u="function",d=this;return l+='<div class="row disc-number hidden"> '+c(i(1).call(t,"Disc {1}",t&&t.parentIndex,{hash:{},data:a}))+' </div> <div class="row striped-list-inner-item"> <span class="col-xs-1 match-index"> '+c((o=t&&t.index,typeof o===u?o.apply(t):o))+'. </span> <span class="col-xs-11 match-track-name ',
o=n.unless.call(t,t&&t.matched,{hash:{},inverse:d.noop,fn:d.program(1,r,a),data:a}),(o||0===o)&&(l+=o),l+='"> '+c((o=t&&t.name,typeof o===u?o.apply(t):o))+" </span> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<div class="match-empty-message">'+o(i(1).call(t,"No matches found.",{hash:{},data:a}))+"</div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){
function r(e,t){var i,n="";return n+=' <span class="match-name">'+h((i=e&&e.parentName,typeof i===d?i.apply(e):i))+'</span> &ndash; <span class="match-name">'+h((i=e&&e.name,typeof i===d?i.apply(e):i))+"</span> "}function o(e,t){var i,n="";return n+=' <span class="match-name">'+h((i=e&&e.name,typeof i===d?i.apply(e):i))+"</span> "}function l(e,t){var i,n="";return n+=' <span class="match-year">'+h((i=e&&e.year,typeof i===d?i.apply(e):i))+'</span> <span class="match-separator">&middot;</span> '}this.compilerInfo=[4,">= 1.0.0"],
n=this.merge(n,e.helpers),a=a||{};var c,u="",d="function",h=this.escapeExpression,p=this;return u+='<a class="match-result col-xs-12" href="#"> <div class="row"> <div class="col-xs-9 match-title-info"> ',c=n.if.call(t,t&&t.parentName,{hash:{},inverse:p.program(3,o,a),fn:p.program(1,r,a),data:a}),(c||0===c)&&(u+=c),u+=' </div> <div class="col-xs-3 match-score-info" title="'+h(i(1).call(t,"Score {1}",t&&t.normalizedScore,{hash:{},data:a}))+'"> ',c=n.if.call(t,t&&t.year,{hash:{},inverse:p.noop,fn:p.program(5,l,a),
data:a}),(c||0===c)&&(u+=c),u+=' <span class="match-score"><i class="match-score-icon glyphicon certificate"></i>'+h((c=t&&t.normalizedScore,typeof c===d?c.apply(t):c))+'</span> </div> </div> <div class="row match-extended-info hidden"> <div class="col-xs-4"> <img class="match-art" src="'+h((c=t&&t.thumb,typeof c===d?c.apply(t):c))+'"/> </div> <div class="col-xs-8 children-region"></div> </div> </a> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){
return"show-actions"}function o(e,t){return"selected"}function l(e,t){return"hidden"}function c(e,t){return' <span class="media-added-at"></span> '}function u(e,t){var n;return n=i(10).call(e,e&&e.sort,"originallyAvailableAt",{hash:{},inverse:w.program(12,h,t),fn:w.program(10,d,t),data:t}),n||0===n?n:""}function d(e,t){return' <span class="media-available-at"></span> '}function h(e,t){var n;return n=i(10).call(e,e&&e.sort,"rating",{hash:{},inverse:w.program(15,f,t),fn:w.program(13,p,t),data:t}),n||0===n?n:"";
}function p(e,t){return' <span class="media-rating"></span> '}function f(e,t){var n;return n=i(10).call(e,e&&e.sort,"mediaHeight",{hash:{},inverse:w.program(18,g,t),fn:w.program(16,m,t),data:t}),n||0===n?n:""}function m(e,t){return' <span class="media-resolution"></span> '}function g(e,t){var n;return n=i(10).call(e,e&&e.sort,"duration",{hash:{},inverse:w.noop,fn:w.program(19,v,t),data:t}),n||0===n?n:""}function v(e,t){return' <span class="media-duration"></span> '}this.compilerInfo=[4,">= 1.0.0"],
n=this.merge(n,e.helpers),a=a||{};var y,b="",w=this,x="function",S=this.escapeExpression;return b+='<a class="media-list-inner-item ',y=n.if.call(t,t&&t.showActions,{hash:{},inverse:w.noop,fn:w.program(1,r,a),data:a}),(y||0===y)&&(b+=y),b+=" ",y=n.if.call(t,t&&t.selected,{hash:{},inverse:w.noop,fn:w.program(3,o,a),data:a}),(y||0===y)&&(b+=y),b+='" href="'+S((y=t&&t.url,typeof y===x?y.apply(t):y))+'"> <div class="media-poster"> <span class="media-count-badge badge hidden"></span> <span class="unwatched-count-badge badge hidden"></span> <div class="media-progress"></div> </div> <div class="media-actions ',
y=n.unless.call(t,t&&t.showActions,{hash:{},inverse:w.noop,fn:w.program(5,l,a),data:a}),(y||0===y)&&(b+=y),b+='"> <button class="play-btn media-action-btn" tabindex="-1"><i class="glyphicon play"></i></button> <button class="play-unwatched-btn media-action-btn" tabindex="-1"><i class="glyphicon play"></i></button> <button class="edit-btn media-action-btn btn-loading btn-loading-static" tabindex="-1"> <i class="btn-label glyphicon pencil"></i> <div class="loading loading-sm"></div> </button> <button class="more-btn media-action-btn" tabindex="-1"><i class="glyphicon more"></i></button> </div> <div class="media-sort media-heading secondary"> ',
y=i(10).call(t,t&&t.sort,"addedAt",{hash:{},inverse:w.program(9,u,a),fn:w.program(7,c,a),data:a}),(y||0===y)&&(b+=y),b+=' </div> <span class="media-title media-heading"></span> <span class="media-subtitle-2 media-heading secondary"></span> <span class="media-subtitle-1 media-heading secondary"></span> <span class="unwatched-icon"></span> <span class="media-context media-heading secondary"></span> <p class="media-tagline"></p> <p class="media-summary"></p> </a> <div class="media-actions-dropdown dropdown pull-right"> <div class="dropdown-toggle" data-toggle="dropdown"></div> </div> ';
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return"show-actions"}function o(e,t){return"selected"}function l(e,t){return"hidden"}function c(e,t){return' <span class="media-added-at"></span> '}function u(e,t){var n;return n=i(10).call(e,e&&e.sort,"originallyAvailableAt",{hash:{},inverse:w.program(12,h,t),fn:w.program(10,d,t),data:t}),n||0===n?n:""}function d(e,t){return' <span class="media-available-at"></span> '}function h(e,t){var n;return n=i(10).call(e,e&&e.sort,"rating",{
hash:{},inverse:w.program(15,f,t),fn:w.program(13,p,t),data:t}),n||0===n?n:""}function p(e,t){return' <span class="media-rating"></span> '}function f(e,t){var n;return n=i(10).call(e,e&&e.sort,"mediaHeight",{hash:{},inverse:w.program(18,g,t),fn:w.program(16,m,t),data:t}),n||0===n?n:""}function m(e,t){return' <span class="media-resolution"></span> '}function g(e,t){var n;return n=i(10).call(e,e&&e.sort,"duration",{hash:{},inverse:w.noop,fn:w.program(19,v,t),data:t}),n||0===n?n:""}function v(e,t){return' <span class="media-duration"></span> ';
}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var y,b="",w=this,x="function",S=this.escapeExpression;return b+='<a class="media-list-inner-item ',y=n.if.call(t,t&&t.showActions,{hash:{},inverse:w.noop,fn:w.program(1,r,a),data:a}),(y||0===y)&&(b+=y),b+=" ",y=n.if.call(t,t&&t.selected,{hash:{},inverse:w.noop,fn:w.program(3,o,a),data:a}),(y||0===y)&&(b+=y),b+='" href="'+S((y=t&&t.url,typeof y===x?y.apply(t):y))+'"> <div class="media-actions ',y=n.unless.call(t,t&&t.showActions,{
hash:{},inverse:w.noop,fn:w.program(5,l,a),data:a}),(y||0===y)&&(b+=y),b+='"> <button class="play-btn media-action-btn" tabindex="-1"><i class="glyphicon play"></i></button> <button class="play-unwatched-btn media-action-btn" tabindex="-1"><i class="glyphicon play"></i></button> <button class="edit-btn media-action-btn btn-link btn-loading btn-loading-static" tabindex="-1"> <i class="btn-label glyphicon pencil"></i> <div class="loading loading-sm"></div> </button> <button class="more-btn media-action-btn btn-link" tabindex="-1"><i class="glyphicon more"></i></button> </div> <span class="media-title media-heading"></span> <span class="media-subtitle-2 media-heading secondary"></span> <span class="media-subtitle-1 media-heading secondary"></span> <span class="unwatched-icon"></span> <span class="media-context media-heading secondary"></span> <span class="media-sort media-heading secondary"> ',
y=i(10).call(t,t&&t.sort,"addedAt",{hash:{},inverse:w.program(9,u,a),fn:w.program(7,c,a),data:a}),(y||0===y)&&(b+=y),b+=' </span> </a> <div class="media-actions-dropdown dropdown pull-right"> <div class="dropdown-toggle" data-toggle="dropdown"></div> </div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){return this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{},'<div class="media-progress-track"></div> <div class="media-progress-pct"></div> '});
},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return"hide-actions"}function o(e,t){return"selected"}function l(e,t){return"hidden"}function c(e,t){return' <span class="media-added-at"></span> '}function u(e,t){var n;return n=i(10).call(e,e&&e.sort,"originallyAvailableAt",{hash:{},inverse:w.program(12,h,t),fn:w.program(10,d,t),data:t}),n||0===n?n:""}function d(e,t){return' <span class="media-available-at"></span> '}function h(e,t){var n;return n=i(10).call(e,e&&e.sort,"rating",{
hash:{},inverse:w.program(15,f,t),fn:w.program(13,p,t),data:t}),n||0===n?n:""}function p(e,t){return' <span class="media-rating"></span> '}function f(e,t){var n;return n=i(10).call(e,e&&e.sort,"mediaHeight",{hash:{},inverse:w.program(18,g,t),fn:w.program(16,m,t),data:t}),n||0===n?n:""}function m(e,t){return' <span class="media-resolution"></span> '}function g(e,t){var n;return n=i(10).call(e,e&&e.sort,"duration",{hash:{},inverse:w.noop,fn:w.program(19,v,t),data:t}),n||0===n?n:""}function v(e,t){return' <span class="media-duration"></span> ';
}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var y,b="",w=this,x="function",S=this.escapeExpression;return b+='<a class="media-poster-container ',y=n.unless.call(t,t&&t.showActions,{hash:{},inverse:w.noop,fn:w.program(1,r,a),data:a}),(y||0===y)&&(b+=y),b+=" ",y=n.if.call(t,t&&t.selected,{hash:{},inverse:w.noop,fn:w.program(3,o,a),data:a}),(y||0===y)&&(b+=y),b+='" href="'+S((y=t&&t.url,typeof y===x?y.apply(t):y))+'"> <div class="media-poster"> <div class="media-poster-overlay"></div> <div class="media-poster-overlay-icons with-actions"> <i class="analyzing-icon media-poster-overlay-icon glyphicon magic hidden"></i> <i class="matching-icon media-poster-overlay-icon glyphicon search hidden"></i> <i class="metadata-icon media-poster-overlay-icon glyphicon tags hidden"></i> <i class="trash-icon media-poster-overlay-icon glyphicon bin warning hidden"></i> </div> <div class="media-poster-actions ',
y=n.unless.call(t,t&&t.showActions,{hash:{},inverse:w.noop,fn:w.program(5,l,a),data:a}),(y||0===y)&&(b+=y),b+='"> <button class="play-btn media-poster-btn btn-link" tabindex="-1"><i class="glyphicon play"></i></button> <button class="play-unwatched-btn media-poster-btn btn-link" tabindex="-1"><i class="glyphicon play"></i></button> <button class="edit-btn media-poster-btn btn-link" tabindex="-1"><i class="glyphicon pencil"></i></button> <button class="more-btn media-poster-btn btn-link" tabindex="-1"><i class="glyphicon more"></i></button> </div> <span class="media-count-badge badge badge-lg hidden"></span> <span class="unwatched-count-badge badge badge-lg hidden"></span> <div class="media-progress"></div> <div class="loading loading-inline"></div> </div> <span class="unwatched-icon"></span> <div class="media-title media-heading"></div> <div class="media-subtitle-1 media-heading secondary"></div> <div class="media-subtitle-2 media-heading secondary"></div> <div class="media-context media-heading secondary"></div> <div class="media-sort media-heading secondary"> ',
y=i(10).call(t,t&&t.sort,"addedAt",{hash:{},inverse:w.program(9,u,a),fn:w.program(7,c,a),data:a}),(y||0===y)&&(b+=y),b+=' </div> <div class="media-subtitle-1-fill media-heading hidden"></div> <div class="media-subtitle-2-fill media-heading hidden"></div> </a> <div class="media-actions-dropdown dropdown"> <div class="dropdown-toggle" data-toggle="dropdown"></div> </div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return"collection-poster-container";
}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var o,l="",c=this;return l+='<a class="media-poster-container hide-actions ',o=i(10).call(t,(o=t&&t.item,null==o||o===!1?o:o.type),"photoAlbum",{hash:{},inverse:c.noop,fn:c.program(1,r,a),data:a}),(o||0===o)&&(l+=o),l+='" href="#"> <div class="media-poster"> <div class="media-poster-overlay"></div> <div class="collection-title-container"> <div class="collection-title"></div> </div> </div> </a> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){
function r(e,t){return' <div class="media-actions media-reorder"> <div class="sortable-handle btn-gray-link"><i class="glyphicon show-lines"></i></div> </div> '}function o(e,t){return' <div class="media-poster-container play-btn"> <div class="media-poster"> <div class="media-poster-overlay"></div> <div class="media-poster-overlay-icons"> <i class="media-poster-overlay-icon glyphicon play"></i> </div> </div> </div> '}function l(e,t){return' <div class="media-actions media-delete"> <button class="delete-btn media-action-btn btn-gray-link btn-danger" tabindex="-1"><i class="glyphicon remove-2"></i></button> </div> ';
}function c(e,t){return"has-actions"}function u(e,t){return"btn-metadata-link"}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var d,h="",p="function",f=this.escapeExpression,m=this;return h+='<a class="show-actions playlist-inner-item '+f((d=t&&t.type,typeof d===p?d.apply(t):d))+'" href="#"> ',d=n.if.call(t,t&&t.canEdit,{hash:{},inverse:m.noop,fn:m.program(1,r,a),data:a}),(d||0===d)&&(h+=d),h+=' <div class="media-index media-heading secondary"> <i class="glyphicon volume-up"></i> </div> ',
d=i(36).call(t,t&&t.type,"track",{hash:{},inverse:m.noop,fn:m.program(3,o,a),data:a}),(d||0===d)&&(h+=d),h+=" ",d=n.if.call(t,t&&t.canEdit,{hash:{},inverse:m.noop,fn:m.program(5,l,a),data:a}),(d||0===d)&&(h+=d),h+=' <div class="media-item '+f((d=t&&t.type,typeof d===p?d.apply(t):d))+" ",d=n.if.call(t,t&&t.canEdit,{hash:{},inverse:m.noop,fn:m.program(7,c,a),data:a}),(d||0===d)&&(h+=d),h+='"> <div class="media-details"> <div class="media-detail media-heading"> <span class="media-title ',d=n.if.call(t,t&&t.hasDetails,{
hash:{},inverse:m.noop,fn:m.program(9,u,a),data:a}),(d||0===d)&&(h+=d),h+='"></span> </div> <div class="media-detail media-optional media-heading secondary"> <span class="media-primary-subtitle btn-metadata-link"></span> </div> <div class="media-detail media-always media-heading secondary"> <span class="media-secondary-subtitle btn-metadata-link"></span> </div> <div class="media-duration media-heading secondary"></div> </div> </div> </a> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){
function a(e,t){return"hide-actions"}function r(e,t){return"hidden"}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var o,l,c="",u=this,d="function",h=this.escapeExpression;return c+='<a class="media-poster-container ',o=i.unless.call(t,t&&t.showActions,{hash:{},inverse:u.noop,fn:u.program(1,a,s),data:s}),(o||0===o)&&(c+=o),c+='" href="',(l=i.url)?o=l.call(t,{hash:{},data:s}):(l=t&&t.url,o=typeof l===d?l.call(t,{hash:{},data:s}):l),c+=h(o)+'"> <div class="media-poster"> <div class="media-poster-overlay"></div> <div class="media-poster-actions ',
o=i.unless.call(t,t&&t.showActions,{hash:{},inverse:u.noop,fn:u.program(3,r,s),data:s}),(o||0===o)&&(c+=o),c+='"> <button class="play-btn media-poster-btn btn-link" tabindex="-1"><i class="glyphicon play"></i></button> <button class="play-unwatched-btn media-poster-btn btn-link" tabindex="-1"><i class="glyphicon play"></i></button> <button class="edit-btn media-poster-btn btn-link" tabindex="-1"><i class="glyphicon pencil"></i></button> <button class="more-btn media-poster-btn btn-link" tabindex="-1"><i class="glyphicon more"></i></button> </div> <span class="unwatched-count-badge badge badge-lg hidden"></span> </div> <div class="media-title media-heading"></div> <div class="media-subtitle-1 media-heading secondary"></div> </a> <div class="media-actions-dropdown dropdown"> <div class="dropdown-toggle" data-toggle="dropdown"></div> </div> ';
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var a,r,o="",l="function",c=this.escapeExpression;return o+='<a class="playlist" data-id="',(r=i.ratingKey)?a=r.call(t,{hash:{},data:s}):(r=t&&t.ratingKey,a=typeof r===l?r.call(t,{hash:{},data:s}):r),o+=c(a)+'" href="#"> <span class="media-poster playlist-poster"></span> ',(r=i.title)?a=r.call(t,{hash:{},data:s}):(r=t&&t.title,a=typeof r===l?r.call(t,{
hash:{},data:s}):r),o+=c(a)+" </a>"})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return"selected"}function o(e,t){return' <button class="track-edit-btn media-action-btn btn-link" tabindex="-1"><i class="glyphicon pencil"></i></button> '}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var l,c="",u=this.escapeExpression,d=this;return c+='<div class="disc-number hidden"> '+u(i(1).call(t,"Disc {1}",'<span class="track-parent-index"></span>',{
hash:{},data:a}))+' </div> <div class="striped-list-inner-item media-list-item track-list-item track"> <a class="track-list-inner-item show-actions ',l=n.if.call(t,t&&t.selected,{hash:{},inverse:d.noop,fn:d.program(1,r,a),data:a}),(l||0===l)&&(c+=l),c+='" href="#"> <div class="track-actions media-actions"> ',l=n.if.call(t,t&&t.showEdit,{hash:{},inverse:d.noop,fn:d.program(3,o,a),data:a}),(l||0===l)&&(c+=l),c+=' <button class="track-more-btn media-action-btn btn-link" tabindex="-1"><i class="glyphicon more"></i></button> </div> <span class="track-index media-index media-heading secondary"> <span></span> <i class="glyphicon volume-up"></i> </span> <span class="track-title media-title media-heading"></span> <span class="track-subtitle-1 media-subtitle-1 media-heading secondary"></span> <span class="track-context media-context media-heading secondary"></span> <button class="track-music-video-btn media-action-btn btn-link" tabindex="-1"><i class="plex-icon-display"></i></button> </a> <div class="track-actions-dropdown media-actions-dropdown dropdown pull-right"> <div class="dropdown-toggle" data-toggle="dropdown"></div> </div> </div> ';
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<div class="row row-padded"> <h4 class="text-muted text-center"> <p>'+o(i(1).call(t,'Choose "Optimize..." on items in your library and optimized versions will appear here.',{hash:{},data:a}))+"</p> <p>"+o(i(1).call(t,"Monitor conversion progress in {1}Conversion Activity{2}.",'<a href="#!/activity/conversion">',"</a>",{
hash:{},data:a}))+"</p> </h4> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r,o="",l="function",c=this.escapeExpression;return o+='<a class="show-actions playlist-inner-item '+c((r=t&&t.type,typeof r===l?r.apply(t):r))+'" href="#"> <div class="media-actions media-reorder"> <div class="sortable-handle btn-gray-link"><i class="glyphicon show-lines"></i></div> </div> <div class="generator-poster-container"> <div class="media-poster"></div> </div> <div class="media-actions generator-actions"> <button class="retry-btn media-action-btn btn-gray-link" tabindex="-1"><i class="glyphicon repeat"></i></button> <button class="edit-btn media-action-btn btn-gray-link" tabindex="-1"><i class="glyphicon pencil"></i></button> <button class="delete-btn media-action-btn btn-gray-link btn-danger" tabindex="-1"><i class="glyphicon remove-2"></i></button> </div> <div class="media-item"> <div class="media-details"> <div class="generator-title col-lg"></div> <div class="generator-target col-md col-secondary"></div> <div class="generator-status col-md col-secondary"> <div class="generator-status-container generator-status-complete"> <i class="generator-status-icon glyphicon ok-2 text-success"></i> '+c(i(1).call(t,"Complete",{
hash:{},data:a}))+' </div> <div class="generator-status-container generator-status-failed"> <i class="generator-status-icon glyphicon circle-exclamation-mark text-danger"></i> <span class="generator-status-failed-message">'+c(i(1).call(t,"Failed",{hash:{},data:a}))+'</span> </div> <div class="generator-status-container generator-status-converting"> <i class="generator-status-icon glyphicon restart"></i> '+c(i(1).call(t,"Converting",{hash:{},data:a}))+' </div> <div class="generator-status-container generator-status-pending"> <i class="generator-status-icon glyphicon clock"></i> '+c(i(1).call(t,"Waiting",{
hash:{},data:a}))+" </div> </div> </div> </div> </a> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var a,r,o="",l="function",c=this.escapeExpression;return o+='<div class="striped-list-inner-item"> <div class="generator-poster-container"> <div class="media-poster"></div> </div> <div class="conversion-status-region"></div> <div class="generator-metadata-title">',(r=i.title)?a=r.call(t,{hash:{},
data:s}):(r=t&&t.title,a=typeof r===l?r.call(t,{hash:{},data:s}):r),o+=c(a)+'</div> <div class="generator-metadata-episode-index generator-metadata-subtitle"></div> <div class="generator-metadata-year generator-metadata-subtitle">',(r=i.year)?a=r.call(t,{hash:{},data:s}):(r=t&&t.year,a=typeof r===l?r.call(t,{hash:{},data:s}):r),o+=c(a)+"</div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};
var a,r,o="",l="function",c=this.escapeExpression;return o+='<a class="btn-gray" href="#">',(r=i.title)?a=r.call(t,{hash:{},data:s}):(r=t&&t.title,a=typeof r===l?r.call(t,{hash:{},data:s}):r),o+=c(a)+"</a> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var n="";return n+=' <div class="label-list-item"> <a class="new-filter-btn label label-btn label-default" href="#"><i class="label-icon glyphicon circle-plus"></i> '+u(i(1).call(e,"New Filter",{
hash:{},data:t}))+"</a> </div> "}function o(e,t){var n,s="";return s+=' <div class="label-list-item"> <a class="remove-filter-btn label label-btn label-primary" data-key="'+u((n=e&&e.key,typeof n===d?n.apply(e):n))+'" href="#"><i class="label-icon glyphicon circle-remove"></i> <span class="label-truncate">'+u(i(515).call(e,e&&e.titles,{hash:{},data:t}))+"</span></a> </div> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var l,c="",u=this.escapeExpression,d="function",h=this;return l=n.unless.call(t,t&&t.currentFilters,{
hash:{},inverse:h.noop,fn:h.program(1,r,a),data:a}),(l||0===l)&&(c+=l),c+=" ",l=n.each.call(t,t&&t.currentFilters,{hash:{},inverse:h.noop,fn:h.program(3,o,a),data:a}),(l||0===l)&&(c+=l),c+=" "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return"boolean-btn"}function o(e,t){return"filter-btn"}function l(e,t){return"selected"}function c(e,t){return"hidden"}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var u,d="",h=this,p=this.escapeExpression;
return d+='<a class="',u=i(10).call(t,(u=t&&t.filter,null==u||u===!1?u:u.filterType),"boolean",{hash:{},inverse:h.program(3,o,a),fn:h.program(1,r,a),data:a}),(u||0===u)&&(d+=u),d+=" btn-gray ",u=n.if.call(t,t&&t.selected,{hash:{},inverse:h.noop,fn:h.program(5,l,a),data:a}),(u||0===u)&&(d+=u),d+='" href="#"> '+p(i(1).call(t,(u=t&&t.filter,null==u||u===!1?u:u.title),{hash:{},data:a}))+' <i class="selected-icon glyphicon ok-2 ',u=n.unless.call(t,t&&t.selected,{hash:{},inverse:h.noop,fn:h.program(7,c,a),
data:a}),(u||0===u)&&(d+=u),d+='"></i> </a> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return"hidden"}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var o,l="",c=this,u="function",d=this.escapeExpression;return l+='<form id="filter-options-search-form" class="',o=n.unless.call(t,t&&t.showSearch,{hash:{},inverse:c.noop,fn:c.program(1,r,a),data:a}),(o||0===o)&&(l+=o),l+='"> <div class="form-group form-group-search"> <label class="control-label-search" for="filter-options-search"><i class="glyphicon search"></i></label> <input type="search" id="filter-options-search" class="form-control form-control-search" value="'+d((o=t&&t.query,
typeof o===u?o.apply(t):o))+'"> </div> </form> <div id="filter-options-loading" class="loading ',o=n.unless.call(t,t&&t.showLoading,{hash:{},inverse:c.noop,fn:c.program(1,r,a),data:a}),(o||0===o)&&(l+=o),l+='"></div> <ul class="list side-bar-list"> <li><a class="filter-options-deselect-btn btn-gray" href="#">'+d(i(1).call(t,"Deselect All",{hash:{},data:a}))+"</a> </ul> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return"selected"}function o(e,t){
return"hidden"}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var l,c="",u=this,d=this.escapeExpression;return c+='<a class="filter-option-btn btn-gray ',l=n.if.call(t,t&&t.selected,{hash:{},inverse:u.noop,fn:u.program(1,r,a),data:a}),(l||0===l)&&(c+=l),c+='" href="#"> '+d(i(1).call(t,(l=t&&t.filterOption,null==l||l===!1?l:l.title),{hash:{},data:a}))+' <i class="selected-icon glyphicon ok-2 ',l=n.unless.call(t,t&&t.selected,{hash:{},inverse:u.noop,fn:u.program(3,o,a),data:a}),
(l||0===l)&&(c+=l),c+='"></i> </a> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<a class="sort-btn btn-gray" href="#"> '+o(i(1).call(t,t&&t.title,{hash:{},data:a}))+' <i class="desc-icon caret-icon caret-icon-sm hidden"></i> <i class="asc-icon caret-icon caret-icon-sm caret-icon-reverse hidden"></i> </a> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){
function a(e,t){return"left-arrow"}function r(e,t){var n;return n=i.if.call(e,(n=e&&e.filePath,null==n||n===!1?n:n.home),{hash:{},inverse:m.program(6,l,t),fn:m.program(4,o,t),data:t}),n||0===n?n:""}function o(e,t){return"home"}function l(e,t){var n;return n=i.if.call(e,(n=e&&e.filePath,null==n||n===!1?n:n.network),{hash:{},inverse:m.program(9,u,t),fn:m.program(7,c,t),data:t}),n||0===n?n:""}function c(e,t){return"globe"}function u(e,t){var n;return n=i.if.call(e,e&&e.isRoot,{hash:{},inverse:m.program(12,h,t),
fn:m.program(10,d,t),data:t}),n||0===n?n:""}function d(e,t){return"hdd"}function h(e,t){return"folder-open"}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var p,f="",m=this,g="function",v=this.escapeExpression;return f+='<a class="striped-list-item" href="#" data-key="'+v((p=t&&t.filePath,p=null==p||p===!1?p:p.key,typeof p===g?p.apply(t):p))+'"> <i class="folder-icon glyphicon ',p=i.if.call(t,(p=t&&t.filePath,null==p||p===!1?p:p.isBackShortcut),{hash:{},inverse:m.program(3,r,s),
fn:m.program(1,a,s),data:s}),(p||0===p)&&(f+=p),f+='"></i> '+v((p=t&&t.filePath,p=null==p||p===!1?p:p.title,typeof p===g?p.apply(t):p))+' <div class="loading loading-sm loading-inline hidden"></div> </a> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var a,r,o="",l="function",c=this.escapeExpression;return o+='<a class="btn-gray" data-identifier="',(r=i.identifier)?a=r.call(t,{hash:{},data:s}):(r=t&&t.identifier,
a=typeof r===l?r.call(t,{hash:{},data:s}):r),o+=c(a)+'" href="#">',(r=i.name)?a=r.call(t,{hash:{},data:s}):(r=t&&t.name,a=typeof r===l?r.call(t,{hash:{},data:s}):r),o+=c(a)+"</a> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return"checked"}function o(e,t){return"disabled"}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var l,c="",u="function",d=this.escapeExpression,h=this;return c+='<div class="card-actions"> <button class="info-btn card-action-btn"><i class="glyphicon circle-info"></i></button> <button class="settings-btn card-action-btn"><i class="glyphicon cogwheel"></i></button> </div> <div class="card-handle"><i class="glyphicon show-lines"></i></div> <label for="'+d((l=t&&t.identifier,
typeof l===u?l.apply(t):l))+'"> <input id="'+d((l=t&&t.identifier,typeof l===u?l.apply(t):l))+'" name="'+d((l=t&&t.identifier,typeof l===u?l.apply(t):l))+'" type="checkbox" ',l=n.if.call(t,t&&t.enabled,{hash:{},inverse:h.noop,fn:h.program(1,r,a),data:a}),(l||0===l)&&(c+=l),c+=" ",l=n.if.call(t,t&&t.isPrimary,{hash:{},inverse:h.noop,fn:h.program(3,o,a),data:a}),(l||0===l)&&(c+=l),c+="> "+d(i(1).call(t,t&&t.name,{hash:{},data:a}))+" </label> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){
this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<div class="row-padded"> <h4 class="text-muted text-center">'+o(i(1).call(t,"No devices found",{hash:{},data:a}))+"</h4> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){return this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{},'<div class="card card-device"> <i class="card-poster device-icon"></i> <div class="card-actions"> <button class="remove-device-btn card-action-btn btn-danger"><i class="glyphicon remove-2"></i></button> </div> <h4 class="name"></h4> <div class="card-details"> <div class="pull-right"> <div class="last-seen text-muted"></div> <span class="sync-info hidden"> <span class="glyphicon circle-arrow-down sync-icon"></span> <span class="sync-count"></span> <span class="sync-size"></span> </span> </div> <span class="version text-muted"></span> <div class="device-info-container"> <div class="product"></div> <div class="device text-muted"></div> <div class="platform-info text-muted"> <span class="platform"></span> <span class="platform-version"></span> </div> </div> </div> </div> ';
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<h4 class="text-muted text-center">'+o(i(1).call(t,"No friends yet. {1}Invite a friend{2} and share your libraries.",'<a class="invite-friend-btn" href="#">',"</a>",{hash:{},data:a}))+"</h4> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){return this.compilerInfo=[4,">= 1.0.0"],
i=this.merge(i,e.helpers),s=s||{},'<div class="card card-user card-friend"> <div class="card-poster media-poster img-circle"></div> <div class="card-actions"> <button class="edit-btn card-action-btn"><i class="glyphicon pencil"></i></button> <button class="delete-btn card-action-btn btn-danger"><i class="glyphicon remove-2"></i></button> </div> <h4 class="username"></h4> <div class="card-details"></div> </div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){
var i,s="";return s+=' <p class="user-summary"> <i class="server-share-direction-icon glyphicon right-arrow"></i> <a class="server-share-edit-btn server-share-status shared '+g((i=e&&e.shared,i=null==i||i===!1?i:i.status,typeof i===v?i.apply(e):i))+" ",i=n.unless.call(e,e&&e.canEdit,{hash:{},inverse:y.noop,fn:y.program(2,o,t),data:t}),(i||0===i)&&(s+=i),s+='" href="#"> <i class="server-share-status-icon available glyphicon circle-ok"></i> <i class="server-share-status-icon unavailable glyphicon circle-exclamation-mark"></i> <i class="server-share-status-icon unknown glyphicon circle-question-mark"></i> <i class="server-share-status-hover-icon glyphicon pencil"></i> </a> ',
i=n.if.call(e,(i=e&&e.shared,null==i||i===!1?i:i.hasActiveShare),{hash:{},inverse:y.program(6,c,t),fn:y.program(4,l,t),data:t}),(i||0===i)&&(s+=i),s+=" </p> "}function o(e,t){return"disabled"}function l(e,t){var n,s="";return s+=" "+g(i(1).call(e,"shares {1} {2} with you",(n=e&&e.shared,null==n||n===!1?n:n.numLibraries),(n=e&&e.shared,null==n||n===!1?n:n.libraryLabel),{hash:{},data:t}))+" "}function c(e,t){var n,s="";return s+=" "+g(i(1).call(e,"wants to share {1} {2} with you",(n=e&&e.shared,null==n||n===!1?n:n.numLibraries),(n=e&&e.shared,
null==n||n===!1?n:n.libraryLabel),{hash:{},data:t}))+" "}function u(e,t){var i,s="";return s+=' <p class="user-summary"> <i class="server-share-direction-icon glyphicon left-arrow"></i> <a class="server-share-edit-btn server-share-status owned '+g((i=e&&e.owned,i=null==i||i===!1?i:i.status,typeof i===v?i.apply(e):i))+" ",i=n.unless.call(e,e&&e.canEdit,{hash:{},inverse:y.noop,fn:y.program(2,o,t),data:t}),(i||0===i)&&(s+=i),s+='" href="#"> <i class="server-share-status-icon available glyphicon circle-ok"></i> <i class="server-share-status-icon unavailable glyphicon circle-exclamation-mark"></i> <i class="server-share-status-icon unknown glyphicon circle-question-mark"></i> <i class="server-share-status-hover-icon glyphicon pencil"></i> </a> ',
i=n.if.call(e,(i=e&&e.owned,null==i||i===!1?i:i.hasActiveShare),{hash:{},inverse:y.program(11,h,t),fn:y.program(9,d,t),data:t}),(i||0===i)&&(s+=i),s+=" </p> "}function d(e,t){var n,s="";return s+=" "+g(i(1).call(e,"sharing {1} {2} with this {3}",(n=e&&e.owned,null==n||n===!1?n:n.numLibraries),(n=e&&e.owned,null==n||n===!1?n:n.libraryLabel),(n=e&&e.owned,null==n||n===!1?n:n.friendLabel),{hash:{},data:t}))+" "}function h(e,t){var n,s="";return s+=" "+g(i(1).call(e,"invited to share {1} {2}",(n=e&&e.owned,
null==n||n===!1?n:n.numLibraries),(n=e&&e.owned,null==n||n===!1?n:n.libraryLabel),{hash:{},data:t}))+" "}function p(e,t){var n="";return n+=' <p class="user-summary server-share-empty-message">'+g(i(1).call(e,"no shared libraries",{hash:{},data:t}))+"</p> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var f,m="",g=this.escapeExpression,v="function",y=this;return f=n.if.call(t,(f=t&&t.shared,null==f||f===!1?f:f.numLibraries),{hash:{},inverse:y.noop,fn:y.program(1,r,a),data:a}),
(f||0===f)&&(m+=f),m+=" ",f=n.if.call(t,(f=t&&t.owned,null==f||f===!1?f:f.numLibraries),{hash:{},inverse:y.noop,fn:y.program(8,u,a),data:a}),(f||0===f)&&(m+=f),m+=" ",f=n.if.call(t,t&&t.showEmptyMessage,{hash:{},inverse:y.noop,fn:y.program(13,p,a),data:a}),(f||0===f)&&(m+=f),m+=" "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var n="";return n+=' <h4 class="text-muted text-center">'+u(i(1).call(e,"No one else is in your home. {1}Add a user{2} to enable user switching.",'<a class="add-user-btn" href="#">',"</a>",{
hash:{},data:t}))+"</h4> "}function o(e,t){var n,s="";return s+=' <h4 class="text-muted text-center">'+u(i(1).call(e,"You need a Plex Pass to add users to your home.",{hash:{},data:t}))+'</h4> <p class="text-center"> <a class="btn btn-sm btn-primary" href="'+u((n=e&&e.plexPassUrl,typeof n===d?n.apply(e):n))+'" target="_blank">'+u(i(1).call(e,"Learn More",{hash:{},data:t}))+"</a> </p> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var l,c="",u=this.escapeExpression,d="function",h=this;
return l=n.if.call(t,t&&t.hasPlexPass,{hash:{},inverse:h.program(3,o,a),fn:h.program(1,r,a),data:a}),(l||0===l)&&(c+=l),c+=' <ul class="list centered-home-user-container"></ul> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){function a(e,t){return'<div class="selected-user-icon"></div>'}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var r,o="",l=this;return o+='<div class="card card-user card-friend card-home-user"> ',r=i.if.call(t,t&&t.isSignedInUser,{
hash:{},inverse:l.noop,fn:l.program(1,a,s),data:s}),(r||0===r)&&(o+=r),o+=' <div class="card-poster media-poster img-circle"></div> <div class="card-actions"> <button class="pin-btn pin-protected-btn card-action-btn btn-success"><i class="glyphicon lock"></i></button> <button class="pin-btn pin-unprotected-btn card-action-btn"><i class="glyphicon unlock"></i></button> <button class="edit-btn card-action-btn"><i class="glyphicon pencil"></i></button> <button class="delete-btn card-action-btn btn-danger"><i class="glyphicon remove-2"></i></button> </div> <h4> <i class="admin-icon glyphicon crown"></i> <span class="username"></span> </h4> <div class="card-details"> <div class="user-type text-muted"></div> </div> </div> ';
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){function a(e,t){return'<button class="accept-btn card-action-btn btn-success"><i class="glyphicon ok-2"></i></button>'}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var r,o="",l=this;return o+='<div class="card card-user"> <div class="card-poster media-poster img-circle"></div> <div class="card-actions"> ',r=i.if.call(t,t&&t.showAccept,{hash:{},inverse:l.noop,fn:l.program(1,a,s),data:s}),(r||0===r)&&(o+=r),
o+=' <button class="delete-btn card-action-btn btn-danger"><i class="glyphicon remove-2"></i></button> </div> <h4 class="username"></h4> <div class="card-details"> <p class="user-summary"></p> </div> </div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var a,r,o="",l="function",c=this.escapeExpression;return o+='<div class="card card-section"> <div class="card-actions"> <button class="edit-section-btn card-action-btn"><i class="glyphicon pencil"></i></button> <button class="delete-section-btn card-action-btn btn-danger"><i class="glyphicon remove-2"></i></button> </div> <i class="section-icon glyphicon ',
(r=i.icon)?a=r.call(t,{hash:{},data:s}):(r=t&&t.icon,a=typeof r===l?r.call(t,{hash:{},data:s}):r),o+=c(a)+'"></i> <span class="section-title"></span> </div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return' <div class="unread"></div> '}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var o,l="",c=this,u="function",d=this.escapeExpression;return l+='<div class="card card-announcement"> ',o=n.if.call(t,t&&t.isUnread,{hash:{},
inverse:c.noop,fn:c.program(1,r,a),data:a}),(o||0===o)&&(l+=o),l+=' <h4><a href="'+d((o=t&&t.link,typeof o===u?o.apply(t):o))+'" target="_blank">'+d((o=t&&t.title,typeof o===u?o.apply(t):o))+'</a></h4> <a href="'+d((o=t&&t.link,typeof o===u?o.apply(t):o))+'" target="_blank"> <img class="thumb"/> </a> <p class="date">'+d(i(517).call(t,t&&t.timestamp,{hash:{},data:a}))+'</p> <p class="description">',o=t&&t.description,o=typeof o===u?o.apply(t):o,(o||0===o)&&(l+=o),l+="</p> </div> "})},function(e,t,i){
var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r,o="",l="function",c=this.escapeExpression;return o+='<a class="friend" data-id="'+c((r=t&&t.recommendationsPlaylistId,typeof r===l?r.apply(t):r))+'" href="#"> <span class="media-poster user-poster"></span> '+c(i(154).call(t,t&&t.title,20,{hash:{},data:a}))+" </a> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){this.compilerInfo=[4,">= 1.0.0"],
i=this.merge(i,e.helpers),s=s||{};var a,r,o="",l="function",c=this.escapeExpression;return o+='<a class="card card-user-playlist" href="',(r=i.url)?a=r.call(t,{hash:{},data:s}):(r=t&&t.url,a=typeof r===l?r.call(t,{hash:{},data:s}):r),o+=c(a)+'"> <div class="card-poster media-poster"></div> <div class="card-actions"> <button class="play-btn card-action-btn"><i class="glyphicon play"></i></button> <button class="mark-unwatched-btn card-action-btn"><i class="glyphicon circle-minus"></i></button> <button class="mark-watched-btn card-action-btn"><i class="glyphicon circle-ok"></i></button> <button class="delete-btn card-action-btn btn-danger"><i class="glyphicon remove-2"></i></button> </div> <h4 class="media-title"></h4> <div class="card-details"> <span class="media-subtitle-1"></span> <span class="media-context"></span> <p class="media-summary"></p> </div> </a> ';
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<div class="modal-dialog"> <div class="modal-content"> <form name="add-folder-form"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><i class="glyphicon remove-2"></i></button> <h4 class="modal-title"><i class="modal-icon glyphicon folder-plus"></i> '+o(i(1).call(t,"Add Folder",{
hash:{},data:a}))+'</h4> </div> <div class="modal-body modal-body-scroll dark-scrollbar"> <div class="row"> <div class="col-md-12"> <input type="text" name="path" class="form-control" value=""> </div> </div> <div class="row directory-container-row"> <div class="home-directory-container col-md-5"></div> <div class="path-container col-md-7"></div> </div> </div> <div class="modal-footer"> <button type="button" class="cancel-btn btn btn-default" data-dismiss="modal">'+o(i(1).call(t,"Cancel",{hash:{},
data:a}))+'</button> <button type="submit" class="add-btn btn btn-primary">'+o(i(1).call(t,"Add",{hash:{},data:a}))+"</button> </div> </form> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var i,s="";return s+=' <ul class="list select-list select-collections-list dark-scrollbar"> ',i=n.each.call(e,e&&e.collections,{hash:{},inverse:m.noop,fn:m.program(2,o,t),data:t}),(i||0===i)&&(s+=i),s+=" </ul> "}function o(e,t){var i,n="";return n+=' <li class="striped-list-item select-list-item"> <a class="collection" data-value="'+f((i=e&&e.key,
typeof i===p?i.apply(e):i))+'" href="#">'+f((i=e&&e.title,typeof i===p?i.apply(e):i))+"</a> </li> "}function l(e,t){var i;return i=n.if.call(e,e&&e.loading,{hash:{},inverse:m.program(7,u,t),fn:m.program(5,c,t),data:t}),i||0===i?i:""}function c(e,t){return' <div class="loading-container"> <div class="loading loading-inline"></div> </div> '}function u(e,t){var n="";return n+=' <div class="empty-message">'+f(i(1).call(e,"There are no collections in this library.",{hash:{},data:t}))+"</div> "}this.compilerInfo=[4,">= 1.0.0"],
n=this.merge(n,e.helpers),a=a||{};var d,h="",p="function",f=this.escapeExpression,m=this;return h+='<div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><i class="glyphicon remove-2"></i></button> <h4 class="modal-title"><i class="modal-icon glyphicon folder-plus"></i> '+f(i(1).call(t,"Select a Collection",{hash:{},data:a}))+'</h4> </div> <div class="modal-body modal-body-scroll dark-scrollbar"> ',d=n.if.call(t,t&&t.collections,{
hash:{},inverse:m.program(4,l,a),fn:m.program(1,r,a),data:a}),(d||0===d)&&(h+=d),h+=' <div class="message-container"> <input class="message form-control" placeholder="'+f(i(1).call(t,"New collection...",{hash:{},data:a}))+'"> </div> </div> <div class="modal-footer"> <button type="button" class="add-btn btn btn-primary btn-loading disabled"> <div class="loading loading-sm"></div> <span class="btn-label">'+f(i(1).call(t,"Add",{hash:{},data:a}))+"</span> </button> </div> </div> </div> "})},function(e,t,i){
var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return g(i(1).call(e,"Select a Playlist",{hash:{},data:t}))}function o(e,t){return g(i(1).call(e,"Create Playlist",{hash:{},data:t}))}function l(e,t){var i,s="";return s+=" ",i=n.if.call(e,e&&e.hasPlaylists,{hash:{},inverse:v.program(8,u,t),fn:v.program(6,c,t),data:t}),(i||0===i)&&(s+=i),s+=" "}function c(e,t){return' <div class="playlists-container"></div> '}function u(e,t){var i,s="";return s+=" ",i=n.if.call(e,e&&e.loading,{
hash:{},inverse:v.program(11,h,t),fn:v.program(9,d,t),data:t}),(i||0===i)&&(s+=i),s+=" "}function d(e,t){return' <div class="loading-container"> <div class="loading loading-inline"></div> </div> '}function h(e,t){var n="";return n+=' <div class="empty-message">'+g(i(1).call(e,"There are no playlists on this server.",{hash:{},data:t}))+"</div> "}function p(e,t){return"only-control"}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var f,m="",g=this.escapeExpression,v=this;return m+='<div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><i class="glyphicon remove-2"></i></button> <h4 class="modal-title"> <i class="modal-icon plex-icon-add-to-playlist"></i> ',
f=n.if.call(t,t&&t.showExisting,{hash:{},inverse:v.program(3,o,a),fn:v.program(1,r,a),data:a}),(f||0===f)&&(m+=f),m+=' </h4> </div> <div class="modal-body modal-body-scroll minimal-scroll"> ',f=n.if.call(t,t&&t.showExisting,{hash:{},inverse:v.noop,fn:v.program(5,l,a),data:a}),(f||0===f)&&(m+=f),m+=' <div class="message-container ',f=n.unless.call(t,t&&t.showExisting,{hash:{},inverse:v.noop,fn:v.program(13,p,a),data:a}),(f||0===f)&&(m+=f),m+='"> <input class="message form-control" placeholder="'+g(i(1).call(t,"New playlist...",{
hash:{},data:a}))+'"> </div> </div> <div class="modal-footer"> <button type="button" class="add-btn btn btn-primary btn-loading disabled"> <div class="loading loading-sm"></div> <span class="btn-label">'+g(i(1).call(t,"Add",{hash:{},data:a}))+"</span> </button> </div> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var a,r,o="",l="function",c=this.escapeExpression;return o+='<div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><i class="glyphicon remove-2"></i></button> <h4 class="modal-title"> <i class="modal-icon glyphicon circle-info"></i> '+c((a=t&&t.agent,
a=null==a||a===!1?a:a.name,typeof a===l?a.apply(t):a))+' </h4> </div> <div class="modal-body"> <p class="agent-icon-container"></p> <p>',(r=i.attribution)?a=r.call(t,{hash:{},data:s}):(r=t&&t.attribution,a=typeof r===l?r.call(t,{hash:{},data:s}):r),(a||0===a)&&(o+=a),o+="</p> </div> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var n="";return n+='<button class="browse-btn btn btn-primary">'+c(i(1).call(e,"Browse",{hash:{},data:t
}))+"</button>"}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var o,l="",c=this.escapeExpression,u="function",d=this;return l+='<div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><i class="glyphicon remove-2"></i></button> <h4 class="modal-title">'+c((o=t&&t.channel,o=null==o||o===!1?o:o.title,typeof o===u?o.apply(t):o))+'</h4> </div> <div class="modal-body"> <div class="channel-poster-container"> <div class="channel-poster media-poster"></div> <div class="installed-actions-container"> ',
o=n.unless.call(t,t&&t.agent,{hash:{},inverse:d.noop,fn:d.program(1,r,a),data:a}),(o||0===o)&&(l+=o),l+=' <div class="btn-group"> <button type="button" class="update-btn btn btn-default btn-loading"> <div class="loading loading-sm"></div> <span class="btn-label">'+c(i(1).call(t,"Update",{hash:{},data:a}))+'</span> </button> <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> <i class="caret-icon caret-icon-sm"></i> </button> <ul class="dropdown-menu pull-right"> <li><a class="restart-btn" href="#">'+c(i(1).call(t,"Restart",{
hash:{},data:a}))+'</a></li> <li><a class="reset-btn" href="#">'+c(i(1).call(t,"Reset",{hash:{},data:a}))+'</a></li> </ul> </div> <button class="uninstall-btn btn btn-danger btn-loading"> <div class="loading loading-sm"></div> <span class="btn-label">'+c(i(1).call(t,"Uninstall",{hash:{},data:a}))+'</span> </button> </div> <div class="uninstalled-actions-container"> <button class="install-btn btn btn-primary btn-loading"> <div class="loading loading-sm"></div> <span class="btn-label">'+c(i(1).call(t,"Install",{
hash:{},data:a}))+'</span> </button> </div> </div> <div class="channel-details"> '+c((o=t&&t.channel,o=null==o||o===!1?o:o.summary,typeof o===u?o.apply(t):o))+" </div> </div> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var n="";return n+=" "+d(i(1).call(e,"Directory Settings",{hash:{},data:t}))+" "}function o(e,t){var n="";return n+=" "+d(i(1).call(e,"{1} Settings",e&&e.title,{hash:{},data:t}))+" "}function l(e,t){var n="";return n+=" "+d(i(13).call(e,"setting",{
hash:{idSuffix:"_c"},data:t}))+" "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var c,u="",d=this.escapeExpression,h=this;return u+='<div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><i class="glyphicon remove-2"></i></button> <h4 class="modal-title"> <i class="modal-icon glyphicon cogwheel"></i> ',c=i(10).call(t,t&&t.title,"Preferences...",{hash:{},inverse:h.program(3,o,a),fn:h.program(1,r,a),
data:a}),(c||0===c)&&(u+=c),u+=' </h4> </div> <form id="channel-settings-form"> <div class="modal-body settings-container"> ',c=n.each.call(t,t&&t.settings,{hash:{},inverse:h.noop,fn:h.program(5,l,a),data:a}),(c||0===c)&&(u+=c),u+=' </div> <div class="modal-footer"> <button type="button" class="cancel-btn btn btn-lg btn-default" data-dismiss="modal">'+d(i(1).call(t,"Cancel",{hash:{},data:a}))+'</button> <button type="submit" class="submit-btn btn btn-lg btn-primary btn-loading"> <div class="loading loading-sm"></div> <span class="btn-label">'+d(i(1).call(t,"Save",{
hash:{},data:a}))+"</span> </button> </div> </form> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var n="";return n+=' <button type="button" class="cancel-btn btn btn-lg btn-default" data-dismiss="modal">'+d(i(1).call(e,e&&e.cancelLabel,{hash:{},data:t}))+"</button> "}function o(e,t){return"btn-danger"}function l(e,t){return"btn-primary"}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var c,u="",d=this.escapeExpression,h="function",p=this;
return u+='<div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><i class="glyphicon remove-2"></i></button> <h4 class="modal-title"><i class="modal-icon glyphicon circle-exclamation-mark"></i> '+d((c=t&&t.title,typeof c===h?c.apply(t):c))+'</h4> </div> <div class="modal-body"> <p class="confirm-message">'+d((c=t&&t.message,typeof c===h?c.apply(t):c))+'</p> <p class="double-confirm-message text-warning"></p> </div> <div class="modal-footer"> ',
c=n.unless.call(t,t&&t.hideCancel,{hash:{},inverse:p.noop,fn:p.program(1,r,a),data:a}),(c||0===c)&&(u+=c),u+=' <button type="button" class="confirm-btn btn btn-lg ',c=n.if.call(t,t&&t.hasDanger,{hash:{},inverse:p.program(5,l,a),fn:p.program(3,o,a),data:a}),(c||0===c)&&(u+=c),u+=' btn-loading"> <div class="loading loading-sm"></div> <span class="btn-label">'+d(i(1).call(t,t&&t.confirmLabel,{hash:{},data:a}))+"</span> </button> </div> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){
function r(e,t){var n="";return n+=' <li><a class="btn-gray change-pane-btn general-btn" data-pane="general" href="#"> <i class="modal-nav-icon glyphicon align-center"></i> '+m(i(1).call(e,"General",{hash:{},data:t}))+" </a></li> "}function o(e,t){var n="";return n+=' <li><a class="btn-gray change-pane-btn tags-btn" data-pane="tags" href="#"> <i class="modal-nav-icon glyphicon tags"></i> '+m(i(1).call(e,"Tags",{hash:{},data:t}))+" </a></li> "}function l(e,t){var n="";return n+=' <li><a class="btn-gray change-pane-btn sharing-btn" data-pane="sharing" href="#"> <i class="modal-nav-icon glyphicon parents"></i> '+m(i(1).call(e,"Sharing",{
hash:{},data:t}))+" </a></li> "}function c(e,t){var n="";return n+=' <li><a class="btn-gray change-pane-btn poster-btn" data-pane="poster" href="#"> <i class="modal-nav-icon glyphicon picture"></i> '+m(i(1).call(e,"Poster",{hash:{},data:t}))+" </a></li> "}function u(e,t){var n="";return n+=' <li><a class="btn-gray change-pane-btn banner-btn" data-pane="banner" href="#"> <i class="modal-nav-icon glyphicon picture"></i> '+m(i(1).call(e,"Banner",{hash:{},data:t}))+" </a></li> "}function d(e,t){var n="";
return n+=' <li><a class="btn-gray change-pane-btn art-btn" data-pane="art" href="#"> <i class="modal-nav-icon glyphicon picture"></i> '+m(i(1).call(e,"Background",{hash:{},data:t}))+" </a></li> "}function h(e,t){var n="";return n+=' <li><a class="btn-gray change-pane-btn info-btn" data-pane="info" href="#"> <i class="modal-nav-icon glyphicon circle-info"></i> '+m(i(1).call(e,"Info",{hash:{},data:t}))+" </a></li> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var p,f="",m=this.escapeExpression,g="function",v=this;
return f+='<div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><i class="glyphicon remove-2"></i></button> <h4 class="modal-title"><i class="modal-icon glyphicon pencil"></i> ',p=t&&t.paneTitle,p=typeof p===g?p.apply(t):p,(p||0===p)&&(f+=p),f+='</h4> </div> <div class="modal-body modal-body-scroll modal-body-with-panes"> <div class="modal-nav-pane dark-scrollbar hidden"> <ul class="list modal-nav-list"> ',p=n.if.call(t,(p=t&&t.panes,
null==p||p===!1?p:p.general),{hash:{},inverse:v.noop,fn:v.program(1,r,a),data:a}),(p||0===p)&&(f+=p),f+=" ",p=n.if.call(t,(p=t&&t.panes,null==p||p===!1?p:p.tags),{hash:{},inverse:v.noop,fn:v.program(3,o,a),data:a}),(p||0===p)&&(f+=p),f+=" ",p=n.if.call(t,(p=t&&t.panes,null==p||p===!1?p:p.sharing),{hash:{},inverse:v.noop,fn:v.program(5,l,a),data:a}),(p||0===p)&&(f+=p),f+=" ",p=n.if.call(t,(p=t&&t.panes,null==p||p===!1?p:p.poster),{hash:{},inverse:v.noop,fn:v.program(7,c,a),data:a}),(p||0===p)&&(f+=p),
f+=" ",p=n.if.call(t,(p=t&&t.panes,null==p||p===!1?p:p.banner),{hash:{},inverse:v.noop,fn:v.program(9,u,a),data:a}),(p||0===p)&&(f+=p),f+=" ",p=n.if.call(t,(p=t&&t.panes,null==p||p===!1?p:p.art),{hash:{},inverse:v.noop,fn:v.program(11,d,a),data:a}),(p||0===p)&&(f+=p),f+=" ",p=n.if.call(t,(p=t&&t.panes,null==p||p===!1?p:p.info),{hash:{},inverse:v.noop,fn:v.program(13,h,a),data:a}),(p||0===p)&&(f+=p),f+=' </ul> </div> <div class="modal-body-pane pane-region dark-scrollbar"> <div class="loading loading-inline"></div> </div> </div> <div class="modal-footer"> <span class="form-message"></span> <button type="button" class="cancel-btn btn btn-default" data-dismiss="modal">'+m(i(1).call(t,"Cancel",{
hash:{},data:a}))+'</button> <button type="button" class="save-btn btn btn-primary btn-loading"> <div class="loading loading-sm"></div> <span class="btn-label">'+m(i(1).call(t,"Save Changes",{hash:{},data:a}))+"</span> </button> </div> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var n="";return n+=' <i class="modal-icon glyphicon plus"></i> '+y(i(1).call(e,"Add {1} Library",'<span class="section-type-title"></span>',{hash:{},
data:t}))+" "}function o(e,t){var n="";return n+=' <i class="modal-icon glyphicon pencil"></i> '+y(i(1).call(e,"Edit Library",{hash:{},data:t}))+" "}function l(e,t){return" selected"}function c(e,t){var n="";return n+=" "+y(i(1).call(e,"Select type",{hash:{},data:t}))+" "}function u(e,t){var n="";return n+=" "+y(i(1).call(e,"General",{hash:{},data:t}))+" "}function d(e,t){return"disabled"}function h(e,t){var s,a="";return a+=' <li> <a class="btn-gray change-pane-btn create-btn',s=i(10).call(e,e&&e.selectedPane,"create",{
hash:{},inverse:b.noop,fn:b.program(5,l,t),data:t}),(s||0===s)&&(a+=s),a+=" ",s=n.if.call(e,e&&e.add,{hash:{},inverse:b.noop,fn:b.program(11,d,t),data:t}),(s||0===s)&&(a+=s),a+=' hidden" data-pane="create" href="#"> <i class="modal-nav-icon glyphicon magic"></i> '+y(i(1).call(e,"Create",{hash:{},data:t}))+" </a> </li> "}function p(e,t){var n="";return n+=' <button type="button" class="delete-btn btn btn-danger pull-left" data-dismiss="modal">'+y(i(1).call(e,"Delete Library",{hash:{},data:t}))+"</button> ";
}function f(e,t){var n="";return n+=" "+y(i(1).call(e,"Add Library",{hash:{},data:t}))+" "}function m(e,t){var n="";return n+=" "+y(i(1).call(e,"Save Changes",{hash:{},data:t}))+" "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var g,v="",y=this.escapeExpression,b=this;return v+='<div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><i class="glyphicon remove-2"></i></button> <h4 class="modal-title"> ',
g=n.if.call(t,t&&t.add,{hash:{},inverse:b.program(3,o,a),fn:b.program(1,r,a),data:a}),(g||0===g)&&(v+=g),v+=' </h4> </div> <div class="modal-body modal-body-scroll modal-body-with-panes"> <div class="modal-nav-pane dark-scrollbar"> <ul class="list modal-nav-list"> <li> <a class="btn-gray change-pane-btn type-btn',g=i(10).call(t,t&&t.selectedPane,"type",{hash:{},inverse:b.noop,fn:b.program(5,l,a),data:a}),(g||0===g)&&(v+=g),v+='" data-pane="type" href="#"> <i class="modal-nav-icon glyphicon align-center"></i> ',
g=n.if.call(t,t&&t.add,{hash:{},inverse:b.program(9,u,a),fn:b.program(7,c,a),data:a}),(g||0===g)&&(v+=g),v+=' </a> </li> <li> <a class="btn-gray change-pane-btn folders-btn',g=i(10).call(t,t&&t.selectedPane,"folders",{hash:{},inverse:b.noop,fn:b.program(5,l,a),data:a}),(g||0===g)&&(v+=g),v+=" ",g=n.if.call(t,t&&t.add,{hash:{},inverse:b.noop,fn:b.program(11,d,a),data:a}),(g||0===g)&&(v+=g),v+='" data-pane="folders" href="#"> <i class="modal-nav-icon glyphicon folder-open"></i> '+y(i(1).call(t,"Add folders",{
hash:{},data:a}))+" </a> </li> ",g=n.if.call(t,t&&t.add,{hash:{},inverse:b.noop,fn:b.program(13,h,a),data:a}),(g||0===g)&&(v+=g),v+=' <li> <a class="btn-gray change-pane-btn advanced-btn',g=i(10).call(t,t&&t.selectedPane,"advanced",{hash:{},inverse:b.noop,fn:b.program(5,l,a),data:a}),(g||0===g)&&(v+=g),v+=" ",g=n.if.call(t,t&&t.add,{hash:{},inverse:b.noop,fn:b.program(11,d,a),data:a}),(g||0===g)&&(v+=g),v+='" data-pane="advanced" href="#"> <i class="modal-nav-icon glyphicon cogwheel"></i> '+y(i(1).call(t,"Advanced",{
hash:{},data:a}))+' </a> </li> </ul> </div> <div class="modal-body-pane pane-region dark-scrollbar"> </div> </div> <div class="modal-footer"> ',g=n.if.call(t,t&&t.edit,{hash:{},inverse:b.noop,fn:b.program(15,p,a),data:a}),(g||0===g)&&(v+=g),v+=' <span class="form-message"></span> <button type="button" class="cancel-btn btn btn-default" data-dismiss="modal">'+y(i(1).call(t,"Cancel",{hash:{},data:a}))+'</button> <button type="button" class="save-btn btn btn-primary btn-loading ',g=n.if.call(t,t&&t.add,{
hash:{},inverse:b.noop,fn:b.program(11,d,a),data:a}),(g||0===g)&&(v+=g),v+='"> <div class="loading loading-sm"></div> <span class="btn-label"> <span class="save-btn-label-next">'+y(i(1).call(t,"Next",{hash:{},data:a}))+'</span> <span class="save-btn-label-save"> ',g=n.if.call(t,t&&t.add,{hash:{},inverse:b.program(19,m,a),fn:b.program(17,f,a),data:a}),(g||0===g)&&(v+=g),v+=" </span> </span> </button> </div> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){
function r(e,t){var n="";return n+=' <div class="match-location"> '+d(i(1).call(e,"Location",{hash:{},data:t}))+": "+d(i(229).call(e,e&&e.location,60,12,{hash:{},data:t}))+" </div> "}function o(e,t){var n="";return n+=' <ul class="list modal-list"> <li class="modal-list-item"><a class="search-options-btn" href="#">'+d(i(1).call(e,"Search Options",{hash:{},data:t}))+'</a></li> <li class="auto-match-dropdown-region modal-list-item"></li> </ul> '}function l(e,t){var n="";return n+=' <button type="button" class="search-btn btn btn-primary btn-loading"> <div class="loading loading-sm"></div> <span class="btn-label">'+d(i(1).call(e,"Search",{
hash:{},data:t}))+"</span> </button> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var c,u="",d=this.escapeExpression,h=this;return u+='<div class="modal-dialog"> <div class="modal-content"> <form id="fix-incorrect-match-form"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><i class="glyphicon remove-2"></i></button> <h4 class="modal-title"><i class="modal-icon glyphicon nameplate"></i> <span class="modal-title-text"></span></h4> ',c=n.if.call(t,t&&t.location,{
hash:{},inverse:h.noop,fn:h.program(1,r,a),data:a}),(c||0===c)&&(u+=c),u+=' </div> <div class="modal-body modal-body-scroll dark-scrollbar"> ',c=n.if.call(t,t&&t.showNavigation,{hash:{},inverse:h.noop,fn:h.program(3,o,a),data:a}),(c||0===c)&&(u+=c),u+=' <div class="pane-region"></div> </div> <div class="modal-footer"> <div class="match-search-actions"> <button type="button" class="cancel-btn btn btn-default">'+d(i(1).call(t,"Cancel",{hash:{},data:a}))+"</button> ",c=n.if.call(t,t&&t.showNavigation,{
hash:{},inverse:h.noop,fn:h.program(5,l,a),data:a}),(c||0===c)&&(u+=c),u+=" </div> </div> </form> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var n="";return n+=" "+u(i(1).call(e,"Insecure connections will only be allowed when you're on the same network as the server.",{hash:{},data:t}))+" "}function o(e,t){var n="";return n+=" "+u(i(1).call(e,"Insecure connections will be allowed to any server.",{hash:{},data:t}))+" "}this.compilerInfo=[4,">= 1.0.0"],
n=this.merge(n,e.helpers),a=a||{};var l,c="",u=this.escapeExpression,d=this;return c+='<div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><i class="glyphicon remove-2"></i></button> <h4 class="modal-title"><i class="modal-icon glyphicon circle-exclamation-mark"></i> '+u(i(1).call(t,"Server Unreachable",{hash:{},data:a}))+' </h4> </div> <div class="modal-body"> <p> ',l=n.if.call(t,t&&t.publicAddressMatches,{hash:{},
inverse:d.program(3,o,a),fn:d.program(1,r,a),data:a}),(l||0===l)&&(c+=l),c+=" </p> <p>"+u(i(1).call(t,"The Allow Fallback to Insecure Connections setting can be changed in Web Settings. Would you like to allow insecure connections?",{hash:{},data:a}))+'</p> </div> <div class="modal-footer"> <button type="button" class="cancel-btn btn btn-lg btn-default" data-dismiss="modal">'+u(i(1).call(t,"No",{hash:{},data:a}))+'</button> <button type="button" class="confirm-btn btn btn-lg btn-danger">'+u(i(1).call(t,"Yes",{
hash:{},data:a}))+"</button> </div> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return"hidden"}function o(e,t){var i,n="";return n+=' <option value="'+d((i=e&&e.key,typeof i===u?i.apply(e):i))+'">'+d((i=e&&e.title,typeof i===u?i.apply(e):i))+"</option> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var l,c="",u="function",d=this.escapeExpression,h=this;return c+='<div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><i class="glyphicon remove-2"></i></button> <h4 class="modal-title"> <i class="modal-icon glyphicon file-import"></i> '+d(i(1).call(t,"Import from iTunes",{
hash:{},data:a}))+' </h4> </div> <div class="modal-body"> <p class="help-block">'+d(i(1).call(t,"Importing from iTunes will import your music playlists. It will also import your ratings, the date you added the music, as well as play and skip counts for tracks in your library. Depending on how many tracks you have, this process can take many minutes to complete.",{hash:{},data:a}))+'</p> <div class="form-group ',l=n.unless.call(t,t&&t.showSections,{hash:{},inverse:h.noop,fn:h.program(1,r,a),data:a
}),(l||0===l)&&(c+=l),c+='"> <label class="control-label"> '+d(i(1).call(t,"Add to library: ",{hash:{},data:a}))+' <select id="section-list"> ',l=n.each.call(t,t&&t.sections,{hash:{},inverse:h.noop,fn:h.program(3,o,a),data:a}),(l||0===l)&&(c+=l),c+=' </select> </label> </div> <div class="form-group"> <label class="control-label"> <input type="checkbox" id="import-all"> '+d(i(1).call(t,"Overwrite existing playlists",{hash:{},data:a}))+' </label> </div> </div> <div class="modal-footer"> <button type="button" class="cancel-btn btn btn-default" data-dismiss="modal">'+d(i(1).call(t,"Cancel",{
hash:{},data:a}))+'</button> <button type="button" class="import-btn btn btn-primary btn-loading"> <div class="loading loading-sm"></div> <span class="btn-label">'+d(i(1).call(t,"Import",{hash:{},data:a}))+"</span> </button> </div> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var i,s="";return s+=' <h5 class="keyboard-shortcuts-header">'+m((i=e&&e.label,typeof i===f?i.apply(e):i))+'</h5> <ul class="list keyboard-shortcuts-list"> ',
i=n.each.call(e,e&&e.shortcuts,{hash:{},inverse:g.noop,fn:g.program(2,o,t),data:t}),(i||0===i)&&(s+=i),s+=" </ul> "}function o(e,t){var s,a="";return a+=' <li> <span class="keyboard-shortcuts-keys"> ',s=n.each.call(e,e&&e.keys,{hash:{},inverse:g.noop,fn:g.program(3,l,t),data:t}),(s||0===s)&&(a+=s),a+=' </span> <span class="keyboard-shortcuts-label text-muted">'+m(i(1).call(e,e&&e.label,{hash:{},data:t}))+"</span> </li> "}function l(e,t){var i,s="";return s+=" ",i=n.if.call(e,e&&e.plain,{hash:{},inverse:g.noop,
fn:g.program(4,c,t),data:t}),(i||0===i)&&(s+=i),s+=" ",i=n.unless.call(e,e&&e.plain,{hash:{},inverse:g.noop,fn:g.program(6,u,t),data:t}),(i||0===i)&&(s+=i),s+=" ",i=n.if.call(e,e&&e.split,{hash:{},inverse:g.noop,fn:g.program(8,d,t),data:t}),(i||0===i)&&(s+=i),s+=" "}function c(e,t){var i,n="";return n+=' <span class="keyboard-shortcuts-keys-plain">'+m((i=e&&e.s,typeof i===f?i.apply(e):i))+"</span> "}function u(e,t){var i,n="";return n+=' <span class="keyboard-shortcuts-keys-key">'+m((i=e&&e.s,typeof i===f?i.apply(e):i))+"</span> ";
}function d(e,t){return" <br> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var h,p="",f="function",m=this.escapeExpression,g=this;return p+='<div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><i class="glyphicon remove-2"></i></button> <h4 class="modal-title"> <i class="modal-icon glyphicon keyboard-wireless"></i> '+m(i(1).call(t,"Keyboard Shortcuts",{hash:{},data:a}))+' </h4> </div> <div class="modal-body modal-body-scroll dark-scrollbar"> ',
h=n.each.call(t,t&&t.groups,{hash:{},inverse:g.noop,fn:g.program(1,r,a),data:a}),(h||0===h)&&(p+=h),p+=" </div> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var n="";return n+=" "+g(i(1).call(e,"Internet Required",{hash:{},data:t}))+" "}function o(e,t){var n="";return n+=" "+g(i(1).call(e,"Plex Pass Required",{hash:{},data:t}))+" "}function l(e,t){var n="";return n+=" "+g(i(1).call(e,"This server cannot reach the Internet. Please verify connectivity and try again.",{
hash:{},data:t}))+" "}function c(e,t){var n="";return n+=" "+g(i(1).call(e,"This library requires your server be signed in to a Plex Pass account.",{hash:{},data:t}))+" "}function u(e,t){var n="";return n+=' <button type="button" class="confirm-btn btn btn-lg btn-primary">'+g(i(1).call(e,"OK",{hash:{},data:t}))+"</button> "}function d(e,t){var i,s="";return s+=' <a class="confirm-btn btn btn-lg btn-primary" href="#!/settings/server/'+g((i=e&&e.serverID,typeof i===v?i.apply(e):i))+'"> ',i=n.if.call(e,e&&e.isSignedIn,{
hash:{},inverse:y.program(14,p,t),fn:y.program(12,h,t),data:t}),(i||0===i)&&(s+=i),s+=" </a> "}function h(e,t){var n="";return n+=" "+g(i(1).call(e,"Settings",{hash:{},data:t}))+" "}function p(e,t){var n="";return n+=" "+g(i(1).call(e,"Sign In",{hash:{},data:t}))+" "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var f,m="",g=this.escapeExpression,v="function",y=this;return m+='<div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><i class="glyphicon remove-2"></i></button> <h4 class="modal-title"> <i class="modal-icon glyphicon circle-exclamation-mark"></i> ',
f=n.if.call(t,t&&t.hasPlexPass,{hash:{},inverse:y.program(3,o,a),fn:y.program(1,r,a),data:a}),(f||0===f)&&(m+=f),m+=' </h4> </div> <div class="modal-body"> <p class="confirm-message"> ',f=n.if.call(t,t&&t.hasPlexPass,{hash:{},inverse:y.program(7,c,a),fn:y.program(5,l,a),data:a}),(f||0===f)&&(m+=f),m+=' </p> </div> <div class="modal-footer"> <button type="button" class="cancel-btn btn btn-lg btn-default" data-dismiss="modal">'+g(i(1).call(t,"Ignore",{hash:{},data:a}))+"</button> ",f=n.if.call(t,t&&t.hasPlexPass,{
hash:{},inverse:y.program(11,d,a),fn:y.program(9,u,a),data:a}),(f||0===f)&&(m+=f),m+=" </div> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><i class="glyphicon remove-2"></i></button> <h4 class="modal-title"><i class="modal-icon glyphicon circle-info"></i> <span id="title">'+o(i(1).call(t,"Media Server Detection",{
hash:{},data:a}))+'</span></h4> </div> <div class="modal-body"> <div class="loading loading-inline"></div> <div class="server-found hidden"> '+o(i(1).call(t,"We've detected a Plex Media Server running on this computer, but we can't connect to it. {1}Sign in to your account{2} on the server so that you can access it.",'<a href="http://127.0.0.1:32400/web/index.html#!/settings/server" target="_blank">',"</a>",{hash:{},data:a}))+' </div> <div class="server-not-found hidden"> <p>'+o(i(1).call(t,"We were unable to find a Plex Media Server running on this computer. If you have one on this or another computer, make sure it's running and signed in to your account.",{
hash:{},data:a}))+"</p> <p>"+o(i(1).call(t,"For more information, please see {1}this support article{2}.",'<a href="http://help.plex.tv/noserver" target="_blank">',"</a>",{hash:{},data:a}))+'</p> </div> </div> <div class="modal-footer"> <button type="button" class="confirm-btn btn btn-lg btn-primary">'+o(i(1).call(t,"OK",{hash:{},data:a}))+"</button> </div> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return"hide-streams-column";
}function o(e,t){var s,a="";return a+=' <div class="files"> <h4>'+M(i(1).call(e,"Files",{hash:{},data:t}))+"</h4> ",s=n.each.call(e,e&&e.media,{hash:{},inverse:O.noop,fn:O.programWithDepth(4,l,t,e),data:t}),(s||0===s)&&(a+=s),a+=" </div> "}function l(e,t,i){var s,a="";return a+=' <ul class="media-info-file-list well"> ',s=n.if.call(e,i&&i.showDeleteFile,{hash:{},inverse:O.noop,fn:O.program(5,c,t),data:t}),(s||0===s)&&(a+=s),a+=" ",s=n.each.call(e,e&&e.Part,{hash:{},inverse:O.noop,fn:O.programWithDepth(10,h,t,i),
data:t}),(s||0===s)&&(a+=s),a+=" </ul> "}function c(e,t){var n,s="";return s+=' <a href="#" data-media-item="'+M((n=null==t||t===!1?t:t.index,typeof n===R?n.apply(e):n))+'" class="delete-btn text-danger pull-right"> <i class="glyphicon bin"></i> ',n=i(10).call(e,(n=e&&e.Part,null==n||n===!1?n:n.length),"1",{hash:{},inverse:O.program(8,d,t),fn:O.program(6,u,t),data:t}),(n||0===n)&&(s+=n),s+=" </a> "}function u(e,t){var n="";return n+=" "+M(i(1).call(e,"Delete File",{hash:{},data:t}))+" "}function d(e,t){
var n="";return n+=" "+M(i(1).call(e,"Delete Files",{hash:{},data:t}))+" "}function h(e,t,i){var s,a="";return a+=" <li> ",s=n.if.call(e,i&&i.showFilepath,{hash:{},inverse:O.program(13,f,t),fn:O.program(11,p,t),data:t}),(s||0===s)&&(a+=s),a+=" ",s=n.unless.call(e,e&&e.accessible,{hash:{},inverse:O.noop,fn:O.program(15,m,t),data:t}),(s||0===s)&&(a+=s),a+=" </li> "}function p(e,t){var i,n="";return n+=" "+M((i=e&&e.file,typeof i===R?i.apply(e):i))+" "}function f(e,t){var n="";return n+=" "+M(i(524).call(e,e&&e.file,{
hash:{},data:t}))+" "}function m(e,t){var i,s="";return s+=" ",i=n.if.call(e,e&&e.exists,{hash:{},inverse:O.program(18,v,t),fn:O.program(16,g,t),data:t}),(i||0===i)&&(s+=i),s+=" "}function g(e,t){var n="";return n+=' <span class="label label-danger" data-toggle="tooltip" title="'+M(i(1).call(e,"Please check the permissions for this file.",{hash:{},data:t}))+'">'+M(i(1).call(e,"Inaccessible",{hash:{},data:t}))+"</span> "}function v(e,t){var n="";return n+=' <span class="label label-danger" data-toggle="tooltip" title="'+M(i(1).call(e,"Please check that this file exists and the necessary drive is mounted.",{
hash:{},data:t}))+'">'+M(i(1).call(e,"Unavailable",{hash:{},data:t}))+"</span> "}function y(e,t,s){var a,r="";return r+=' <div class="media"> <div class="props"> <h4>'+M(i(1).call(e,"Media",{hash:{},data:t}))+"</h4> <ul> ",a=n.each.call(e,e&&e.properties,{hash:{},inverse:O.noop,fn:O.program(21,b,t),data:t}),(a||0===a)&&(r+=a),r+=" </ul> </div> ",a=n.each.call(e,e&&e.Part,{hash:{},inverse:O.noop,fn:O.programWithDepth(23,w,t,s),data:t}),(a||0===a)&&(r+=a),r+=" </div> "}function b(e,t){var n,s="";return s+=' <li> <span class="detail-label">'+M(i(1).call(e,e&&e.name,{
hash:{},data:t}))+'</span> <span class="detail">'+M((n=e&&e.value,typeof n===R?n.apply(e):n))+"</span> </li> "}function w(e,t,s){var a,r="";return r+=' <div class="part"> <div class="props"> <h4>'+M(i(1).call(e,"Part",{hash:{},data:t}))+"</h4> <ul> ",a=n.each.call(e,e&&e.properties,{hash:{},inverse:O.noop,fn:O.program(21,b,t),data:t}),(a||0===a)&&(r+=a),r+=' </ul> </div> <div class="streams"> ',a=n.each.call(e,e&&e.Stream,{hash:{},inverse:O.noop,fn:O.program(24,x,t),data:t}),(a||0===a)&&(r+=a),r+=" ",
a=n.if.call(e,s&&s.loading,{hash:{},inverse:O.noop,fn:O.program(33,I,t),data:t}),(a||0===a)&&(r+=a),r+=" </div> </div> "}function x(e,t){var s,a="";return a+=' <div class="props"> ',s=i(10).call(e,e&&e.streamType,"1",{hash:{},inverse:O.program(27,C,t),fn:O.program(25,S,t),data:t}),(s||0===s)&&(a+=s),a+=" <ul> ",s=n.each.call(e,e&&e.properties,{hash:{},inverse:O.noop,fn:O.program(21,b,t),data:t}),(s||0===s)&&(a+=s),a+=" </ul> </div> "}function S(e,t){var n="";return n+=" <h4>"+M(i(1).call(e,"Video",{
hash:{},data:t}))+"</h4> "}function C(e,t){var n;return n=i(10).call(e,e&&e.streamType,"2",{hash:{},inverse:O.program(30,P,t),fn:O.program(28,k,t),data:t}),n||0===n?n:""}function k(e,t){var n="";return n+=" <h4>"+M(i(1).call(e,"Audio",{hash:{},data:t}))+"</h4> "}function P(e,t){var n;return n=i(10).call(e,e&&e.streamType,"3",{hash:{},inverse:O.noop,fn:O.program(31,A,t),data:t}),n||0===n?n:""}function A(e,t){var n="";return n+=" <h4>"+M(i(1).call(e,"Subtitles",{hash:{},data:t}))+"</h4> "}function I(e,t){
var n="";return n+=' <div class="props"> <h4>'+M(i(1).call(e,"Loading",{hash:{},data:t}))+"...</h4> </div> "}function _(e,t,i){var s;return s=n.if.call(e,i&&i.showFilepath,{hash:{},inverse:O.noop,fn:O.program(36,T,t),data:t}),s||0===s?s:""}function T(e,t){var n,s="";return s+=' <div class="modal-footer"> <div class="pull-left"> <a href="'+M((n=e&&e.url,typeof n===R?n.apply(e):n))+'" target="_blank">'+M(i(1).call(e,"View XML",{hash:{},data:t}))+"</a> </div> </div> "}this.compilerInfo=[4,">= 1.0.0"],
n=this.merge(n,e.helpers),a=a||{};var D,E="",M=this.escapeExpression,R="function",O=this;return E+='<div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><i class="glyphicon remove-2"></i></button> <h4 class="modal-title"><i class="modal-icon glyphicon circle-info"></i> '+M(i(1).call(t,"Media Info",{hash:{},data:a}))+'</h4> </div> <div class="modal-body modal-body-scroll dark-scrollbar"> <div class="position-ref ',
D=n.unless.call(t,t&&t.hasStreams,{hash:{},inverse:O.noop,fn:O.program(1,r,a),data:a}),(D||0===D)&&(E+=D),E+='"> ',D=n.if.call(t,t&&t.hasFiles,{hash:{},inverse:O.noop,fn:O.program(3,o,a),data:a}),(D||0===D)&&(E+=D),E+=" ",D=n.each.call(t,t&&t.media,{hash:{},inverse:O.noop,fn:O.programWithDepth(20,y,a,t),data:a}),(D||0===D)&&(E+=D),E+=" </div> </div> ",D=n.if.call(t,t&&t.key,{hash:{},inverse:O.noop,fn:O.programWithDepth(35,_,a,t),data:a}),(D||0===D)&&(E+=D),E+=" </div> </div> "})},function(e,t,i){
var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var i,s="";return s+=' <li class="striped-list-item select-list-item"> <a class="media" data-value="'+f((i=null==t||t===!1?t:t.index,typeof i===p?i.apply(e):i))+'" href="#"> ',i=n.if.call(e,e&&e.title,{hash:{},inverse:m.noop,fn:m.program(2,o,t),data:t}),(i||0===i)&&(s+=i),s+=" ",i=n.if.call(e,e&&e.videoResolution,{hash:{},inverse:m.noop,fn:m.program(4,l,t),data:t}),(i||0===i)&&(s+=i),s+=" ",i=n.if.call(e,e&&e.bitrate,{
hash:{},inverse:m.noop,fn:m.program(7,u,t),data:t}),(i||0===i)&&(s+=i),s+=" </a> </li> "}function o(e,t){var i,n="";return n+=" "+f((i=e&&e.title,typeof i===p?i.apply(e):i))+' <span class="title-separator">\u2022</span> '}function l(e,t){var s,a="";return a+=" "+f(i(521).call(e,e&&e.videoResolution,{hash:{},data:t})),s=n.if.call(e,e&&e.bitrate,{hash:{},inverse:m.noop,fn:m.program(5,c,t),data:t}),(s||0===s)&&(a+=s),a+=" "}function c(e,t){return","}function u(e,t){var n="";return n+=" "+f(i(520).call(e,e&&e.bitrate,0,{
hash:{},data:t}))+" "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var d,h="",p="function",f=this.escapeExpression,m=this;return h+='<div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><i class="glyphicon remove-2"></i></button> <h4 class="modal-title"><i class="modal-icon glyphicon adjust-alt"></i> '+f(i(1).call(t,"Select a Version",{hash:{},data:a}))+'</h4> </div> <div class="modal-body modal-body-scroll dark-scrollbar"> <ul class="list select-list"> ',
d=n.each.call(t,t&&t.mediaItems,{hash:{},inverse:m.noop,fn:m.program(1,r,a),data:a}),(d||0===d)&&(h+=d),h+=" </ul> </div> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var n,s="";return s+=' <h4 class="text-center">'+u(i(1).call(e,"This feature requires a Plex Pass subscription.",{hash:{},data:t}))+'</h4> <p class="text-muted">'+u(i(1).call(e,"Everything you need to experience the best of Plex. Your subscription gives you premium features and exclusive access to new ones.",{
hash:{},data:t}))+'</p> <p class="text-center"> <a class="btn btn-sm btn-primary" href="'+u((n=e&&e.plexPassUrl,typeof n===d?n.apply(e):n))+'" target="_blank">'+u(i(1).call(e,"Learn More",{hash:{},data:t}))+"</a> </p> "}function o(e,t){var n="";return n+=' <h4 class="text-center">'+u(i(1).call(e,"{1}Sign in{2} to a Plex account with a Plex Pass subscription.",'<a class="sign-in-btn" href="#">',"</a>",{hash:{},data:t}))+"</h4> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var l,c="",u=this.escapeExpression,d="function",h=this;
return c+='<div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><i class="glyphicon remove-2"></i></button> <h4 class="modal-title"> <i class="modal-icon glyphicon circle-arrow-right"></i> '+u(i(1).call(t,"Go Premium",{hash:{},data:a}))+' </h4> </div> <div class="modal-body"> <p class="text-center"><i class="plex-image plex-pass"></i></p> ',l=n.if.call(t,t&&t.signedIn,{hash:{},inverse:h.program(3,o,a),fn:h.program(1,r,a),
data:a}),(l||0===l)&&(c+=l),c+=" </div> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var n="";return n+=' <div class="friends-container"></div> <div class="message-container invisible"> <textarea class="message form-control" placeholder="'+u(i(1).call(e,"Say something about this...",{hash:{},data:t}))+'"></textarea> </div> '}function o(e,t){var n="";return n+=' <div class="empty-message"> '+u(i(1).call(e,"You need {1}friends{2} to recommend media.",'<a class="friends-btn" href="#!/friends">',"</a>",{
hash:{},data:t}))+" </div> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var l,c="",u=this.escapeExpression,d=this;return c+='<div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><i class="glyphicon remove-2"></i></button> <h4 class="modal-title"><i class="modal-icon glyphicon share-alt"></i> '+u(i(1).call(t,"Select Friends",{hash:{},data:a}))+'</h4> </div> <div class="modal-body modal-body-scroll dark-scrollbar"> ',
l=n.if.call(t,t&&t.hasFriends,{hash:{},inverse:d.program(3,o,a),fn:d.program(1,r,a),data:a}),(l||0===l)&&(c+=l),c+=' </div> <div class="modal-footer"> <span class="characters-remaining"></span> <button type="button" class="send-btn btn btn-primary btn-loading disabled"> <div class="loading loading-sm"></div> <span class="btn-label">'+u(i(1).call(t,"Send",{hash:{},data:a}))+"</span> </button> </div> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){
function r(e,t,s){var a,r="";return r+=' <h4 class="update-list-title">'+h(i(1).call(e,"New",{hash:{},data:t}))+"</h4> <ul> ",a=n.each.call(e,s&&s.added,{hash:{},inverse:p.noop,fn:p.program(2,o,t),data:t}),(a||0===a)&&(r+=a),r+=" </ul> "}function o(e,t){var i="";return i+=" <li>"+h(typeof e===d?e.apply(e):e)+"</li> "}function l(e,t,s){var a,r="";return r+=' <h4 class="update-list-title">'+h(i(1).call(e,"Fixes",{hash:{},data:t}))+"</h4> <ul> ",a=n.each.call(e,s&&s.fixed,{hash:{},inverse:p.noop,fn:p.program(2,o,t),
data:t}),(a||0===a)&&(r+=a),r+=" </ul> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var c,u="",d="function",h=this.escapeExpression,p=this;return u+='<div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><i class="glyphicon remove-2"></i></button> <h4 class="modal-title"><i class="modal-icon glyphicon circle-info"></i> '+h(i(1).call(t,"Plex Media Server Release Notes",{hash:{},data:a}))+'</h4> </div> <div class="modal-body modal-body-scroll dark-scrollbar"> <span class="text-muted">'+h(i(1).call(t,"Version {1}",t&&t.version,{
hash:{},data:a}))+"</span> ",c=n.if.call(t,t&&t.added,{hash:{},inverse:p.noop,fn:p.programWithDepth(1,r,a,t),data:a}),(c||0===c)&&(u+=c),u+=" ",c=n.if.call(t,t&&t.fixed,{hash:{},inverse:p.noop,fn:p.programWithDepth(4,l,a,t),data:a}),(c||0===c)&&(u+=c),u+=" </div> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var i,s="";return s+=' <li class="striped-list-item select-list-item"> <a class="media" data-value="'+h((i=e&&e.id,typeof i===p?i.apply(e):i))+'" href="#"> ',
i=n.if.call(e,e&&e.name,{hash:{},inverse:f.program(4,l,t),fn:f.program(2,o,t),data:t}),(i||0===i)&&(s+=i),s+=" ",i=n.if.call(e,e&&e.isCloudSync,{hash:{},inverse:f.noop,fn:f.program(6,c,t),data:t}),(i||0===i)&&(s+=i),s+=" </a> </li> "}function o(e,t){var n="";return n+=" "+h(i(154).call(e,e&&e.name,25,{hash:{},data:t}))+" "}function l(e,t){var n="";return n+=" "+h(i(154).call(e,e&&e.device,25,{hash:{},data:t}))+" "}function c(e,t){return'<i class="cloud-sync-icon glyphicon cloud"></i>'}this.compilerInfo=[4,">= 1.0.0"],
n=this.merge(n,e.helpers),a=a||{};var u,d="",h=this.escapeExpression,p="function",f=this;return d+='<div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><i class="glyphicon remove-2"></i></button> <h4 class="modal-title"><i class="modal-icon glyphicon iphone"></i> '+h(i(1).call(t,"Choose Destination",{hash:{},data:a}))+'</h4> </div> <div class="modal-body modal-body-scroll dark-scrollbar"> <ul class="list select-list"> ',
u=n.each.call(t,t&&t.devices,{hash:{},inverse:f.noop,fn:f.program(1,r,a),data:a}),(u||0===u)&&(d+=u),d+=" </ul> </div> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var n,s="";return s+=' <li class="striped-list-item select-list-item"> <a class="media" data-value="'+u((n=null==t||t===!1?t:t.index,typeof n===c?n.apply(e):n))+'" href="#"> ',n=i(523).call(e,(n=e&&e.Part,n=null==n||n===!1?n:n[0],null==n||n===!1?n:n.file),35,{hash:{},
data:t}),(n||0===n)&&(s+=n),s+=" </a> </li> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var o,l="",c="function",u=this.escapeExpression,d=this;return l+='<div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><i class="glyphicon remove-2"></i></button> <h4 class="modal-title"><i class="modal-icon glyphicon file"></i> '+u(i(1).call(t,"Select a File",{hash:{},data:a}))+'</h4> </div> <div class="modal-body modal-body-scroll dark-scrollbar"> <ul class="list select-list"> ',
o=n.each.call(t,t&&t.medias,{hash:{},inverse:d.noop,fn:d.program(1,r,a),data:a}),(o||0===o)&&(l+=o),l+=" </ul> </div> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r,o="",l=this.escapeExpression,c="function";return o+='<div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><i class="glyphicon remove-2"></i></button> <h4 class="modal-title"><i class="modal-icon glyphicon circle-arrow-right"></i> '+l(i(1).call(t,"Resume",{
hash:{},data:a}))+'</h4> </div> <div class="modal-body"> <ul class="list select-list"> <li class="striped-list-item select-list-item"><a class="offset" data-value="'+l((r=t&&t.offset,typeof r===c?r.apply(t):r))+'" href="#">'+l(i(1).call(t,"Resume from {1}",t&&t.formattedOffset,{hash:{},data:a}))+'</a></li> <li class="striped-list-item select-list-item"><a class="offset" data-value="0" href="#">'+l(i(1).call(t,"Start from beginning",{hash:{},data:a}))+"</a></li> </ul> </div> </div> </div> "})},function(e,t,i){
var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var s,a="";return a+=' <ul class="list select-list select-networks-list dark-scrollbar"> ',s=n.each.call(e,e&&e.networks,{hash:{},inverse:v.noop,fn:v.programWithDepth(2,o,t,e),data:t}),(s||0===s)&&(a+=s),a+=' </ul> <div class="message-container ',s=n.unless.call(e,e&&e.autoSelect,{hash:{},inverse:v.noop,fn:v.program(10,h,t),data:t}),(s||0===s)&&(a+=s),a+='"> <textarea class="message form-control" placeholder="'+b(i(1).call(e,"Say something about this...",{
hash:{},data:t}))+'"></textarea> </div> '}function o(e,t,s){var a,r="";return r+=' <li class="striped-list-item select-list-item"> <a class="network ',a=n.if.call(e,s&&s.autoSelect,{hash:{},inverse:v.noop,fn:v.program(3,l,t),data:t}),(a||0===a)&&(r+=a),r+='" data-id="'+b((a=e&&e.key,typeof a===y?a.apply(e):a))+'" href="#"> ',a=i(10).call(e,e&&e.key,"facebook",{hash:{},inverse:v.program(7,u,t),fn:v.program(5,c,t),data:t}),(a||0===a)&&(r+=a),r+=" "+b((a=e&&e.title,typeof a===y?a.apply(e):a))+" </a> </li> ";
}function l(e,t){return"selected"}function c(e,t){return' <i class="network-icon glyphicon glyphicon-social facebook"></i> '}function u(e,t){var n,s="";return s+=" ",n=i(10).call(e,e&&e.key,"twitter",{hash:{},inverse:v.noop,fn:v.program(8,d,t),data:t}),(n||0===n)&&(s+=n),s+=" "}function d(e,t){return' <i class="network-icon glyphicon glyphicon-social twitter"></i> '}function h(e,t){return"invisible"}function p(e,t){var n="";return n+=' <div class="empty-message"> '+b(i(1).call(e,"You need to {1}link your account{2}.",'<a href="{3}" target="_blank">',"</a>",e&&e.accountUrl,{
hash:{},data:t}))+" </div> "}function f(e,t){return"disabled"}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var m,g="",v=this,y="function",b=this.escapeExpression;return g+='<div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><i class="glyphicon remove-2"></i></button> <h4 class="modal-title"><i class="modal-icon glyphicon share"></i> '+b(i(1).call(t,"Share",{hash:{},data:a}))+'</h4> </div> <div class="modal-body modal-body-scroll dark-scrollbar"> ',
m=n.if.call(t,t&&t.networks,{hash:{},inverse:v.program(12,p,a),fn:v.program(1,r,a),data:a}),(m||0===m)&&(g+=m),g+=' </div> <div class="modal-footer"> <span class="characters-remaining"></span> <button type="button" class="share-btn btn btn-primary btn-loading ',m=n.unless.call(t,t&&t.autoSelect,{hash:{},inverse:v.noop,fn:v.program(14,f,a),data:a}),(m||0===m)&&(g+=m),g+='"> <div class="loading loading-sm"></div> <span class="btn-label">'+b(i(1).call(t,"Share",{hash:{},data:a}))+"</span> </button> </div> </div> </div> ";
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var i,n="";return n+=' <p class="text-muted"><i class="glyphicon warning-sign"></i> '+u((i=e&&e.Status,i=null==i||i===!1?i:i.failure,typeof i===c?i.apply(e):i))+"</p> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var o,l="",c="function",u=this.escapeExpression,d=this;return l+='<div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><i class="glyphicon remove-2"></i></button> <h4 class="modal-title"><i class="modal-icon glyphicon download"></i> '+u(i(1).call(t,"Sync Status",{
hash:{},data:a}))+'</h4> </div> <div class="modal-body modal-body-scroll dark-scrollbar"> <h4 class="sync-item-title">'+u((o=t&&t.rootTitle,typeof o===c?o.apply(t):o))+" &middot; "+u((o=t&&t.title,typeof o===c?o.apply(t):o))+"</h4> ",o=n.if.call(t,(o=t&&t.Status,null==o||o===!1?o:o.failure),{hash:{},inverse:d.noop,fn:d.program(1,r,a),data:a}),(o||0===o)&&(l+=o),l+=' <div class="sync-status-list-container"></div> </div> </div> </div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){
this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),s=this.merge(s,e.partials),a=a||{};var r,o="",l=this.escapeExpression,c=this;return o+='<div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title"><i class="modal-icon glyphicon circle-info"></i> '+l(i(1).call(t,"Plex Terms of Service",{hash:{},data:a}))+'</h4> </div> <div class="modal-body modal-body-scroll dark-scrollbar"> ',r=c.invokePartial(i(1191),"terms",t,n,s,a),(r||0===r)&&(o+=r),o+=' </div> <div class="modal-footer"> <button type="button" class="confirm-btn btn btn-lg btn-primary btn-loading"> <div class="loading loading-sm"></div> <span class="btn-label">'+l(i(1).call(t,"Agree",{
hash:{},data:a}))+"</span> </button> </div> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var i,n="";return n+=" "+d((i=e&&e.status,typeof i===u?i.apply(e):i))+" "}function o(e,t){var n="";return n+=" "+d(i(1).call(e,"There was a problem preparing for optimization.",{hash:{},data:t}))+" "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var l,c="",u="function",d=this.escapeExpression,h=this;return c+='<div class="convert-message-container row"> <div class="col-sm-3 text-center"> <p class="convert-error-icon"><i class="glyphicon circle-exclamation-mark"></i></p> </div> <div class="col-sm-8"> <h4> ',
l=n.if.call(t,t&&t.status,{hash:{},inverse:h.program(3,o,a),fn:h.program(1,r,a),data:a}),(l||0===l)&&(c+=l),c+=' </h4> <h4><a class="try-again-link" href="#">'+d(i(1).call(t,"Try again",{hash:{},data:a}))+"</a></h4> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return"selected"}function o(e,t,n){var s,a="";return a+=' <option value="'+d((s=e&&e.id,typeof s===u?s.apply(e):s))+'" ',s=i(10).call(e,n&&n.selectedLocationID,e&&e.id,{
hash:{},inverse:h.noop,fn:h.program(1,r,t),data:t}),(s||0===s)&&(a+=s),a+=">"+d(i(229).call(e,e&&e.path,50,20,{hash:{},data:t}))+"</option> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var l,c="",u="function",d=this.escapeExpression,h=this;return c+='<label class="control-label" for="convert-storage-location">'+d(i(1).call(t,"Version storage location",{hash:{},data:a}))+'</label> <select id="convert-storage-location" class="storage-location-select" name="storageLocation"> <option value="-1" ',
l=i(10).call(t,t&&t.selectedLocationID,-1,{hash:{},inverse:h.noop,fn:h.program(1,r,a),data:a}),(l||0===l)&&(c+=l),c+=">"+d(i(1).call(t,"In folders with original items",{hash:{},data:a}))+"</option> ",l=n.each.call(t,t&&t.locations,{hash:{},inverse:h.noop,fn:h.programWithDepth(3,o,a,t),data:a}),(l||0===l)&&(c+=l),c+=' </select> <p class="help-block">'+d(i(1).call(t,'A "Plex Versions" folder will be created in your chosen location.',{hash:{},data:a}))+"</p> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){
function r(e,t){return"hidden"}function o(e,t){return"checked"}function l(e,t){var i,n="";return n+='value="'+g((i=e&&e.policy,i=null==i||i===!1?i:i.value,typeof i===m?i.apply(e):i))+'"'}function c(e,t){var i,s="";return s+=" ",i=n.if.call(e,e&&e.isCloudSync,{hash:{},inverse:v.program(10,d,t),fn:v.program(8,u,t),data:t}),(i||0===i)&&(s+=i),s+=" "}function u(e,t){var n="";return n+=" "+g(i(1).call(e,"A large number of sync items may be time-consuming to convert, and the time to upload is dependent on your bandwidth. A large number of high quality items may take a very long time. If you have trouble, try reducing the number of items or your quality setting.",{
hash:{},data:t}))+" "}function d(e,t){var n="";return n+=" "+g(i(1).call(e,"A large number of sync items may be time-consuming to convert and transfer to your device. If you have trouble, try reducing the number of items.",{hash:{},data:t}))+" "}function h(e,t){var n="";return n+=" "+g(i(1).call(e,"A large number of items may be time-consuming to convert. If you have trouble, try reducing the number of items.",{hash:{},data:t}))+" "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};
var p,f="",m="function",g=this.escapeExpression,v=this;return f+='<div class="form-group ',p=n.unless.call(t,t&&t.showUnwatched,{hash:{},inverse:v.noop,fn:v.program(1,r,a),data:a}),(p||0===p)&&(f+=p),f+='"> <label class="control-label"> <input type="checkbox" id="convert-policy-unwatched" name="policyUnwatched" ',p=n.if.call(t,(p=t&&t.policy,null==p||p===!1?p:p.unwatched),{hash:{},inverse:v.noop,fn:v.program(3,o,a),data:a}),(p||0===p)&&(f+=p),f+="> "+g(i(1).call(t,"Unwatched only",{hash:{},data:a
}))+' </label> </div> <div class="form-group ',p=n.unless.call(t,t&&t.isDirectory,{hash:{},inverse:v.noop,fn:v.program(1,r,a),data:a}),(p||0===p)&&(f+=p),f+='"> <label class="control-label"> <input type="checkbox" id="convert-policy-scope" name="policyScope" value="count" ',p=i(10).call(t,(p=t&&t.policy,null==p||p===!1?p:p.scope),"count",{hash:{},inverse:v.noop,fn:v.program(3,o,a),data:a}),(p||0===p)&&(f+=p),f+="> "+g(i(1).call(t,"Limit to",{hash:{},data:a}))+' <input type="number" id="convert-policy-value" name="policyValue" class="policy-value-control form-control" ',
p=n.if.call(t,(p=t&&t.policy,null==p||p===!1?p:p.value),{hash:{},inverse:v.noop,fn:v.program(5,l,a),data:a}),(p||0===p)&&(f+=p),f+="> "+g(i(1).call(t,"items",{hash:{},data:a}))+' </label> <p class="convert-warning help-block ',p=n.unless.call(t,t&&t.showLimitWarning,{hash:{},inverse:v.noop,fn:v.program(1,r,a),data:a}),(p||0===p)&&(f+=p),f+='"> <i class="convert-warning-icon glyphicon circle-exclamation-mark"></i> <span class="convert-warning-text"> ',p=n.if.call(t,t&&t.isSync,{hash:{},inverse:v.program(12,h,a),
fn:v.program(7,c,a),data:a}),(p||0===p)&&(f+=p),f+=" </span> </p> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return"disabled"}function o(e,t,s){var a,r="";return r+=' <option value="'+f((a=e&&e.id,typeof a===m?a.apply(e):a))+'" ',a=i(10).call(e,(a=s&&s.item,null==a||a===!1?a:a.targetTagID),e&&e.id,{hash:{},inverse:g.noop,fn:g.program(4,l,t),data:t}),(a||0===a)&&(r+=a),r+="> "+f((a=e&&e.tag,typeof a===m?a.apply(e):a)),a=n.if.call(e,(a=e&&e.MediaSettings,
null==a||a===!1?a:a.videoResolution),{hash:{},inverse:g.noop,fn:g.program(6,c,t),data:t}),(a||0===a)&&(r+=a),r+=" </option> "}function l(e,t){return"selected"}function c(e,t){var n="";return n+=" - "+f(i(58).call(e,e&&e.MediaSettings,{hash:{},data:t}))}function u(e,t,n){var s,a="";return a+=' <option value="'+f((s=e&&e.title,typeof s===m?s.apply(e):s))+'" ',s=i(10).call(e,(s=n&&n.selectedProfile,null==s||s===!1?s:s.title),e&&e.title,{hash:{},inverse:g.noop,fn:g.program(4,l,t),data:t}),(s||0===s)&&(a+=s),
a+="> "+f((s=e&&e.title,typeof s===m?s.apply(e):s))+" </option> "}function d(e,t,n){var s,a="";return a+=' <option value="'+f((s=e&&e.index,typeof s===m?s.apply(e):s))+'" ',s=i(10).call(e,(s=n&&n.selectedCustomQuality,null==s||s===!1?s:s.index),e&&e.index,{hash:{},inverse:g.noop,fn:g.program(4,l,t),data:t}),(s||0===s)&&(a+=s),a+="> "+f(i(58).call(e,e,{hash:{},data:t}))+" </option> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var h,p="",f=this.escapeExpression,m="function",g=this;
return p+='<select class="convert-target-select" name="target" ',h=n.if.call(t,t&&t.disableTarget,{hash:{},inverse:g.noop,fn:g.program(1,r,a),data:a}),(h||0===h)&&(p+=h),p+="> ",h=n.each.call(t,t&&t.targets,{hash:{},inverse:g.noop,fn:g.programWithDepth(3,o,a,t),data:a}),(h||0===h)&&(p+=h),p+=' <option value="-1" ',h=n.unless.call(t,(h=t&&t.item,null==h||h===!1?h:h.targetTagID),{hash:{},inverse:g.noop,fn:g.program(4,l,a),data:a}),(h||0===h)&&(p+=h),p+=">"+f(i(1).call(t,"Custom",{hash:{},data:a}))+'</option> </select> <div class="convert-custom-target-container"> <input type="text" class="convert-target-title form-control" name="targetTitle" class="form-control" value="'+f((h=t&&t.item,
h=null==h||h===!1?h:h.target,typeof h===m?h.apply(t):h))+'" placeholder="'+f(i(1).call(t,"Quality Name",{hash:{},data:a}))+'"> <select class="convert-target-profile-select" name="targetProfile"> ',h=n.each.call(t,t&&t.profiles,{hash:{},inverse:g.noop,fn:g.programWithDepth(8,u,a,t),data:a}),(h||0===h)&&(p+=h),p+=' </select> <select class="convert-target-quality-select" name="targetQuality"> ',h=n.each.call(t,t&&t.availableCustomQualities,{hash:{},inverse:g.noop,fn:g.programWithDepth(10,d,a,t),data:a
}),(h||0===h)&&(p+=h),p+=' </select> </div> <p class="help-block">'+f(i(1).call(t,"Plex will convert your media to this quality. Each version will be stored in a separate file.",{hash:{},data:a}))+"</p> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return"hidden"}function o(e,t){return d(i(1).call(e,"Optimize",{hash:{},data:t}))}function l(e,t){return d(i(1).call(e,"Save",{hash:{},data:t}))}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),
a=a||{};var c,u="",d=this.escapeExpression,h=this,p="function";return u+='<form id="convert-form" class="settings-container"> <div class="modal-body"> <div class="form-group ',c=n.unless.call(t,t&&t.showRemuxOnlyWarning,{hash:{},inverse:h.noop,fn:h.program(1,r,a),data:a}),(c||0===c)&&(u+=c),u+='"> <p class="convert-warning help-block"> <i class="convert-warning-icon glyphicon circle-exclamation-mark"></i> <span class="convert-warning-text"> '+d(i(1).call(t,"Video optimization may take a long time to complete on this server. You'll be able to use Plex normally while you wait.",{
hash:{},data:a}))+' </span> </p> </div> <div class="form-group"> <label class="control-label" for="convert-title">'+d(i(1).call(t,"Title",{hash:{},data:a}))+'</label> <input type="text" id="convert-title" name="title" class="form-control" value="'+d((c=t&&t.conversionItem,c=null==c||c===!1?c:c.title,typeof c===p?c.apply(t):c))+'" placeholder="'+d((c=t&&t.conversionItem,c=null==c||c===!1?c:c.title,typeof c===p?c.apply(t):c))+'"> </div> <div class="policy-region"></div> <div class="targets-region"></div> <div class="location-region"></div> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">'+d(i(1).call(t,"Cancel",{
hash:{},data:a}))+'</button> <button type="submit" class="submit-btn btn btn-primary btn-loading"> <div class="loading loading-sm"></div> <span class="btn-label">',c=n.if.call(t,t&&t.isNew,{hash:{},inverse:h.program(5,l,a),fn:h.program(3,o,a),data:a}),(c||0===c)&&(u+=c),u+="</span> </button> </div> </form> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){return this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{},'<div class="loading loading-inline"></div> ';
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><i class="glyphicon remove-2"></i></button> <h4 class="modal-title"><i class="modal-icon glyphicon restart"></i> '+o(i(1).call(t,"Optimize",{hash:{},data:a}))+'</h4> </div> <div class="modal-body-region"></div> </div> </div> ';
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<div class="convert-message-container row"> <div class="col-sm-3 text-center"> <p class="convert-success-icon"><i class="glyphicon ok-2"></i></p> </div> <div class="col-sm-8"> <h4>'+o(i(1).call(t,"This media is being converted.",{hash:{},data:a}))+"</h4> <h4>"+o(i(1).call(t,"Watch the status of the conversion {1}here{2}.",'<a class="status-link" href="#">',"</a>",{
hash:{},data:a}))+"</h4> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<div class="convert-message-container row"> <div class="col-sm-3 text-center"> <p class="convert-error-icon"><i class="glyphicon circle-exclamation-mark"></i></p> </div> <div class="col-sm-8"> <h4>'+o(i(1).call(t,"There was a problem syncing this media.",{hash:{},data:a
}))+'</h4> <h4><a class="try-again-link" href="#">'+o(i(1).call(t,"Try again",{hash:{},data:a}))+"</a></h4> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var i,s="";return s+=' <select class="sync-quality-select" name="videoQuality"> ',i=n.each.call(e,e&&e.availableVideoQualities,{hash:{},inverse:v.noop,fn:v.programWithDepth(2,o,t,e),data:t}),(i||0===i)&&(s+=i),s+=" </select> "}function o(e,t,n){var s,a="";return a+=' <option value="'+g((s=e&&e.index,
typeof s===m?s.apply(e):s))+'" ',s=i(10).call(e,(s=n&&n.selectedVideoQuality,null==s||s===!1?s:s.index),e&&e.index,{hash:{},inverse:v.noop,fn:v.program(3,l,t),data:t}),(s||0===s)&&(a+=s),a+="> "+g(i(58).call(e,e,{hash:{},data:t}))+" </option> "}function l(e,t){return"selected"}function c(e,t){var i,s="";return s+=' <select class="sync-quality-select" name="musicQuality"> ',i=n.each.call(e,e&&e.availableMusicQualities,{hash:{},inverse:v.noop,fn:v.programWithDepth(6,u,t,e),data:t}),(i||0===i)&&(s+=i),
s+=" </select> "}function u(e,t,n){var s,a="";return a+=' <option value="'+g((s=e&&e.index,typeof s===m?s.apply(e):s))+'" ',s=i(10).call(e,(s=n&&n.selectedMusicQuality,null==s||s===!1?s:s.index),e&&e.index,{hash:{},inverse:v.noop,fn:v.program(3,l,t),data:t}),(s||0===s)&&(a+=s),a+="> "+g(i(58).call(e,e,{hash:{},data:t}))+" </option> "}function d(e,t){var i,s="";return s+=' <select class="sync-quality-select" name="photoQuality"> ',i=n.each.call(e,e&&e.availablePhotoQualities,{hash:{},inverse:v.noop,
fn:v.programWithDepth(9,h,t,e),data:t}),(i||0===i)&&(s+=i),s+=" </select> "}function h(e,t,n){var s,a="";return a+=' <option value="'+g((s=e&&e.index,typeof s===m?s.apply(e):s))+'" ',s=i(10).call(e,(s=n&&n.selectedPhotoQuality,null==s||s===!1?s:s.index),e&&e.index,{hash:{},inverse:v.noop,fn:v.program(3,l,t),data:t}),(s||0===s)&&(a+=s),a+="> "+g((s=e&&e.title,typeof s===m?s.apply(e):s))+" </option> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var p,f="",m="function",g=this.escapeExpression,v=this;
return p=i(10).call(t,t&&t.typeElement,"video",{hash:{},inverse:v.noop,fn:v.program(1,r,a),data:a}),(p||0===p)&&(f+=p),f+=" ",p=i(10).call(t,t&&t.typeElement,"audio",{hash:{},inverse:v.noop,fn:v.program(5,c,a),data:a}),(p||0===p)&&(f+=p),f+=" ",p=i(10).call(t,t&&t.typeElement,"photo",{hash:{},inverse:v.noop,fn:v.program(8,d,a),data:a}),(p||0===p)&&(f+=p),f+=' <p class="help-block">'+g(i(1).call(t,"Plex will convert your media to this quality and transfer the converted media to your device.",{hash:{},
data:a}))+"</p> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return u(i(1).call(e,"Sync",{hash:{},data:t}))}function o(e,t){return u(i(1).call(e,"Save",{hash:{},data:t}))}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var l,c="",u=this.escapeExpression,d="function",h=this;return c+='<form id="sync-form" class="settings-container"> <div class="modal-body"> <div class="form-group"> <label class="control-label" for="sync-title">'+u(i(1).call(t,"Title",{
hash:{},data:a}))+'</label> <input type="text" id="sync-title" name="title" class="form-control" value="'+u((l=t&&t.syncItem,l=null==l||l===!1?l:l.title,typeof l===d?l.apply(t):l))+'" placeholder="'+u((l=t&&t.syncItem,l=null==l||l===!1?l:l.title,typeof l===d?l.apply(t):l))+'"> </div> <div class="policy-region"></div> <div class="quality-region"></div> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">'+u(i(1).call(t,"Cancel",{hash:{},data:a}))+'</button> <button type="submit" class="submit-btn btn btn-primary btn-loading"> <div class="loading loading-sm"></div> <span class="btn-label">',
l=n.if.call(t,t&&t.isNew,{hash:{},inverse:h.program(3,o,a),fn:h.program(1,r,a),data:a}),(l||0===l)&&(c+=l),c+="</span> </button> </div> </form> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><i class="glyphicon remove-2"></i></button> <h4 class="modal-title"><i class="modal-icon glyphicon download"></i> '+o(i(1).call(t,"Sync",{
hash:{},data:a}))+'</h4> </div> <div class="modal-body-region"></div> </div> </div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<div class="convert-message-container row"> <div class="col-sm-3 text-center"> <p class="convert-success-icon"><i class="glyphicon ok-2"></i></p> </div> <div class="col-sm-8"> <h4>'+o(i(1).call(t,"This media is being synced.",{
hash:{},data:a}))+"</h4> <h4>"+o(i(1).call(t,"Watch the status of the sync {1}here{2}.",'<a class="status-link" href="#">',"</a>",{hash:{},data:a}))+"</h4> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><i class="glyphicon remove-2"></i></button> <h4 class="modal-title"><i class="modal-icon glyphicon restart"></i> <span class="generator-title"></span></h4> </div> <div class="modal-body modal-body-scroll dark-scrollbar"> <h4> <span class="generator-failure-container pull-right"> <i class="generator-failure-icon glyphicon circle-exclamation-mark text-danger"></i> <span class="generator-failure-message text-muted"></span> </span> <span class="generator-items-count"></span> &middot; <span class="generator-total-size"></span> </h4> <div class="list-region"></div> <div class="list-feedback-container"> <span class="loading hidden"></span> <span class="error-message text-muted hidden"> '+o(i(1).call(t,"There was a problem loading these items.",{
hash:{},data:a}))+" </span> </div> </div> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){return this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{},'<p> Thank you for using Plex! By accessing, using, downloading, or visiting any Plex "Service(s)", which includes the Plex website, Plex software and products described <a href="https://plex.tv/downloads" target="_blank">here</a>, and any other products or materials provided by Plex GmbH, a Swiss company, and its affiliates (together, "Plex"), you agree to the terms ("Terms") listed in this agreement ("Agreement"). Plex reserves the right to amend these Terms at any time and without notice. Any revisions to the Terms will be posted on the Plex website. By continuing to access or use the Services, you accept any changes or revisions to the Terms. </p> <h4>Plex Software</h4> <ol> <li>Plex grants you a personal, non-commercial, worldwide, royalty-free, revocable, non-transferable, non-sublicensable, and non-exclusive license to use the software provided to you by Plex as part of the Services ("Software"). This license is for the sole purpose of enabling you to use and enjoy the benefit of the Services in the manner permitted by these Terms.</li> <li>The Software includes certain executable modules that Plex has licensed from <a href="https://support.plex.tv/hc/en-us/articles/204096476-License-Information" target="_blank">third party providers</a> ("Third Party Components") that may be subject to different end user license terms as specified in the license agreement(s) provided with such Third Party Components.</li> <li>Except as provided in the next section, you may not, or allow anyone else to, directly or indirectly to: (1) copy, modify, distribute, sell, or lease any part of the Software; (2) reverse engineer, disassemble, decompile, or otherwise attempt to discover the source code or structure, sequence, and/or organization of all or any part of the Software, unless laws prohibit those restrictions or you have our written permission; (3) rent, lease, or use the Software for timesharing or service bureau purposes; (4) develop any improvement, modification, or derivative works of the Software, or include any portion thereof in any other product, software, work, equipment, or item (except that you may customize and/or modify the Software only as set forth in the documentation or as authorized in any license agreement of Plex\'s third party licensors and applicable to Third Party Components); or (5) allow the transfer, transmission, export, or re-export of the Software or any portion thereof or any technical data associated with any Software.</li> <li>Plex grants you a personal, non-commercial, worldwide, royalty-free, revocable, non-transferable, non-sublicensable, and non-exclusive license to reproduce the Plex Media Server Software (PMS Software) in copies and distribute the copies to others, provided that: you may not charge a fee for the PMS Software, and you may not individually charge for installing it; you may copy, distribute and install the PMS Software only as others actually need the PMS Software, and not more than five (5) times per calendar day or more than twenty-five (25) times per calendar month; you may not offer the PMS Software to the public for downloading on or in connection with any commercial online site, whether or not a fee is charged for the PMS Software; you shall comply with all other terms and conditions set forth in this document; you agree that Plex may revoke or terminate the license granted to you under this paragraph at any time for any reason in its sole discretion. As an example, this section is intended to permit reasonable copying and distribution of the PMS Software in connection with services such as home theater or home media center installation in which you install the PMS Software on the computers of your customers as a convenience in connection with other services or products that you are providing to them, and/or in Arch Linux repositories and similar distributions.</li> <li>You shall maintain and shall not remove nor obscure any proprietary notices on the Software, and shall reproduce such notices exactly on all permitted copies of the Software.</li> <li>You may reverse engineer the Software solely (1) as permitted by applicable law, or (2) for the purpose of debugging modifications made by you to certain third party files in source code format that are licensed under the GNU Lesser General Public License (LGPL) or under the GNU General Public License version 2 (GPL2) and only provided that you have made, prior to any such reverse engineering permitted under this sentence, unsuccessful prior reasonable good faith efforts to debug such modifications using techniques other than the reverse engineering of the Software.</li> <li>As between the parties and except as otherwise provided in any license agreement for Third Party Components, Plex shall own all title, ownership rights, and intellectual property rights in and to the Software, and any copies or derivative works thereof, except that by downloading the Software, you retain any title that you may own in and to the recording media on which the Software is recorded.</li> <li>You understand that Plex or its licensors may modify or discontinue offering the Services at any time.</li> <li>You shall not make, or assist others in making, any use of data adapters or similar technologies used by or with the Services that are designed to receive and use data from Plex, its third party data providers, and their affiliates and third parties, other than to receive and use such data in accordance with these Terms and your agreement with the third party data providers, and their affiliates and third parties, including without limitation any data passing through the Services or otherwise effectively made available by any Service through an API, a download, a database, or the like.</li> <li>This Agreement does not entitle you to any support, upgrades, patches, enhancements, or \ufb01xes (collectively, "Support") for the Services. Any such Support for the Services that may be made available by Plex, in its sole discretion, shall become part of the Services and will be subject to these Terms.</li> </ol> <h4>Data</h4> <p> Data provided by Plex or other third party data providers may be delayed or unavailable as specified by Plex or such third party data providers. Plex does not verify any data provided by Plex or other third party data providers and disclaims any obligation to do so. Plex, its third party data providers, and each of their affiliates and business partners: (1) expressly disclaim the availability, accuracy, adequacy, or completeness of any data or third party data provider, and (2) shall not be liable for any errors, omissions, or other defects in, unavailability of, delays or interruptions in such data or third party data provider. </p> <h4>Acceptable Use</h4> <ol> <li> You may not, or allow anyone else to, use any of the Services to do the following: <ol> <li>Infringe the intellectual property rights, proprietary rights, or rights of publicity or privacy of any third party;</li> <li>Violate any law, statute, ordinance, or regulation, or perform any other action that would incur civil liability or constitute a crime;</li> <li>Disseminate, transfer or store information or materials in any form or format that is harmful, threatening, abusive, harassing, tortuous, defamatory, vulgar, obscene, libelous, or otherwise objectionable, or that otherwise violate any law or right of any third party; or</li> <li>Disseminate any software viruses or any other computer code, files, programs, or the like that may without limitation interrupt, destroy, or limit the functionality of any computer software or hardware or telecommunications equipment, violate the security of any computer network, or the like.</li> </ol> </li> <li>If the occurrence of any prohibited use comes to our attention, we reserve the right to disable any accounts associated with prohibited use or otherwise terminate your access to the Services.</li> </ol> <h4>Your Content</h4> <ol> <li>You continue to retain any ownership rights you have in content you make available via the Services, or otherwise use in conjunction with the Services. However, by using the Services with particular content, for example by using the Services to share particular content or access particular content, you grant to Plex (and to each of the third parties with whom we work to provide you with the Services) a worldwide license to reproduce, modify, create derivative works, transmit, publish, publicly perform, publicly display, distribute, and otherwise use the particular content and metadata associated with the content, such as images of you or images otherwise associated with your account. The rights you grant us in this license are only for the limited purpose of providing you with our Services. You may not use the Services in connection with any content for which you do not have the right to grant us this license.</li> <li>The Services may include features that allow you to share your content with others. Please be careful when choosing to share content with other users; Plex is not responsible for how others use your content. Additionally, you hereby grant to any user with whom you share content a non-exclusive license to access the content through the Service, and to use, reproduce in copies, distribute, display and perform the shared content as permitted through the functionality of the Service and under this Agreement. You may not share any content with others via the Services if you do not have the right to grant this license to any user with whom you share the content.</li> <li>You understand that Plex may delete any content that you post in or contribute to a message forum or similar service that Plex hosts, in its sole discretion, for any reason.</li> </ol> <h4>Content of Others</h4> <ol> <li>You acknowledge that all content that you access through use of the Software or other Services is accessed at your own risk, and you will be solely responsible for any damage or liability to any party resulting from such access.</li> <li>You understand that by using the Services you may encounter content that you may find offensive, indecent, or objectionable. Plex does not inspect, screen, or otherwise control the content that is posted, shared or made available via the Services, and Plex does not guarantee the accuracy, integrity or quality of such content.</li> <li>You acknowledge that unauthorized use of copyrighted content of others may subject you to civil and criminal penalties, including possible monetary damages, for copyright infringement.</li> </ol> <h4>Developers and Interfacing Software</h4> <ol> <li>"Interfacing Software" means any software that you obtain or provide and that accesses or calls any Software provided by Plex as part of the Services including, but not limited to, plug-ins for the Services, channel plug-ins, metadata agents, and client applications that communicate directly or indirectly with the Services.</li> <li> By making, or assisting others in making, Interfacing Software, you agree to the following terms: <ol> <li>You grant Plex and its affiliates worldwide a worldwide, non-exclusive, and royalty-free right and license to use (including testing, hosting and linking to), copy, publicly perform, publicly display, reproduce in copies for distribution, and distribute the copies of any Interfacing Software made by you or with your assistance. </li> <li>You will include in the source code of the Interfacing Software a copyright notice of the form: Copyright \xa9 &lt;year&gt; &lt;copyright holders&gt;. You grant, and authorize Plex to grant on your behalf if necessary, a license, free of charge, to any person obtaining a copy of the Interfacing Software and associated documentation files from Plex, to deal in the Interfacing Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Interfacing Software, and to permit persons to whom the Interfacing Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Interfacing Software. THE INTERFACING SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE INTERFACING SOFTWARE.</li> <li> You may notify us at legal@plex.tv if you do not wish for Plex to use, distribute, copy, publicly perform, publicly display, reproduce in copies for distribution, or distribute copies of any Interfacing Software that was created by you. Plex will comply with such a request but Plex must be granted a transition period of thirty (30) days after receipt of the request to comply. A request to take down Interfacing Software must include (1) an identification of the Interfacing Software you wish to be removed; (2) your signature in either electronic or physical form; and (3) the following statements: <ul> <li>"I swear under penalty of perjury that I am the owner of the Interfacing Software or I am authorized to act on behalf of the owner of the Interfacing Software."</li> <li>"I swear under penalty of perjury that the information in this notification is accurate."</li> </ul> </li> <li>You shall protect the privacy and legal rights of Plex users. If the users provide, or the Interfacing Software accesses or uses, user names, passwords, or other login information or personal information, you must make the users aware that such information will be available to the Interfacing Software, and you must provide privacy notices and protection for those users in compliance with applicable law. Further, the Interfacing Software may use that information only for the limited purposes for which the user has given you permission to do so. If the Interfacing Software stores personally identifying information of users or information that a reasonable user would consider to be sensitive, then the Interfacing Software must do so securely and only for as long as it is needed. However, if the user has opted or entered into a separate agreement with you that allows you or the Interfacing Software to store or use personally identifying information of users or information that a reasonable user would consider to be sensitive, then the terms of that separate agreement will govern your use of such information. If the user provides the Interfacing Software with Plex account information, the Interfacing Software may only use that information to access the user\'s Plex account when, and for the limited purposes for which, the user has given you permission to do so.</li> <li> Prohibited Uses. Plex prohibits performing certain actions using the Interfacing Software. You shall not make, or assist others in making, any Interfacing Software that: <ol> <li>Knowingly violates a third party\'s terms of service;</li> <li>Violates any applicable laws or regulations;</li> <li>Interferes with, disrupts, damages, harms, or accesses in an unauthorized manner the machines, hardware. devices, servers, networks, data, or other properties or services of any other party including, but not limited to, Plex users, Plex or any network operator;</li> <li>Posts misleading information about an application\'s purpose;</li> <li>Infringes on the intellectual property rights of others; or</li> <li>Performs any other prohibited action listed under "Acceptable Use" above.</li> </ol> </li> <li>You will require your end users to comply with any applicable law and these Terms. You will not knowingly enable your end users to violate applicable law or these Terms.</li> <li>You shall indemnify and hold harmless Plex and its officers, directors, employees, contractors, licensors, suppliers, distributors, contractors, agents, and third party contributors from any claims, damages, liabilities, costs and fees (including reasonable attorney fees) arising from any use of the Interfacing Software or from Plex\'s distribution of the Interfacing Software.</li> <li> Brand Features and Attribution <ol> <li>"Brand Features" is defined as the trade names, trademarks, service marks, logos, domain names, and other distinctive brand features of a party. Except where expressly stated, these terms do not grant either party any right, title, or interest in or to the other party\'s Brand Features. Any use by you of Plex\'s Brand Features (including any goodwill associated therewith) will inure to the benefit of Plex. Plex Brand Features include the Plex Play Logo ("&gt;" in stylized format) and the trademarks, trade names and designs as may be identified from time to time in the Plex Trademark Notice that is posted at <a href="https://plex.tv/legal" target="_blank">plex.tv/legal</a>.</li> <li>You must seek prior written approval from Plex to display Plex\'s Brand Features, including for the purpose of promoting or advertising that your Interfacing Software is for use in conjunction with Plex Services. Plex, in its sole discretion and in a separate writing such as an e-mail from an authorized representative of Plex, may grant you a revocable, non-transferable, nonexclusive license, without right of sub-license, to display Plex\'s Brand Features for the purpose of promoting or advertising that your Interfacing Software is for use in conjunction with Plex Services. You understand and agree that Plex has the sole discretion to determine whether your attribution(s) and use of Plex\'s Brand Features are in accordance with the above requirements and guidelines and that Plex may revoke the license granted herein at any time, or may require you to modify your use of Plex\'s Brand Features, for any reason in its sole discretion.</li> <li>You will not make any statement that suggests a partnership with, sponsorship by, or endorsement by Plex, without Plex\'s express prior written approval.</li> <li>In the course of promoting, marketing, or demonstrating the Services, Plex may produce and distribute incidental depictions, including screenshots, video, or other content from your Interfacing Software, and may use your company or product name. You grant us all necessary rights for the above purposes.</li> </ol> </li> </ol> </li> </ol> <ol> <li>"Interfacing Software" means any software that you obtain or provide and that accesses or calls any Software provided by Plex as part of the Services including, but not limited to, plug-ins for the Services, channel plug-ins, metadata agents, and client applications that communicate directly or indirectly with the Services.</li> <li> By making, or assisting others in making, Interfacing Software, you agree to the following terms: <ol> <li>You grant Plex and its affiliates worldwide a worldwide, non-exclusive, and royalty-free right and license to use (including testing, hosting and linking to), copy, publicly perform, publicly display, reproduce in copies for distribution, and distribute the copies of any Interfacing Software made by you or with your assistance.</li> <li> You may notify us at legal@plex.tv if you do not wish for Plex to use, distribute, copy, publicly perform, publicly display, reproduce in copies for distribution, or distribute copies of any Interfacing Software that was created by you. Plex will comply with such a request but Plex must be granted a transition period of thirty (30) days after receipt of the request to comply. A request to take down Interfacing Software must include (1) an identification of the Interfacing Software you wish to be removed; (2) your signature in either electronic or physical form; and (3) the following statements: <ul> <li>"I swear under penalty of perjury that I am the owner of the Interfacing Software or I am authorized to act on behalf of the owner of the Interfacing Software.\u201d</li> <li>"I swear under penalty of perjury that the information in this notification is accurate.\u201d</li> </ul> </li> <li>You shall protect the privacy and legal rights of Plex users. If the users provide, or the Interfacing Software accesses or uses, user names, passwords, or other login information or personal information, you must make the users aware that such information will be available to the Interfacing Software, and you must provide privacy notices and protection for those users in compliance with applicable law. Further, the Interfacing Software may use that information only for the limited purposes for which the user has given you permission to do so. If the Interfacing Software stores personally identifying information of users or information that a reasonable user would consider to be sensitive, then the Interfacing Software must do so securely and only for as long as it is needed. However, if the user has opted or entered into a separate agreement with you that allows you or the Interfacing Software to store or use personally identifying information of users or information that a reasonable user would consider to be sensitive, then the terms of that separate agreement will govern your use of such information. If the user provides the Interfacing Software with Plex account information, the Interfacing Software may only use that information to access the user\u2019s Plex account when, and for the limited purposes for which, the user has given you permission to do so.</li> <li> Prohibited Uses. Plex prohibits performing certain actions using the Interfacing Software. You shall not make, or assist others in making, any Interfacing Software that: <ol> <li>Knowingly violates a third party\u2019s terms of service;</li> <li>Violates any applicable laws or regulations;</li> <li>Interferes with, disrupts, damages, harms, or accesses in an unauthorized manner the machines, hardware. devices, servers, networks, data, or other properties or services of any other party including, but not limited to, Plex users, Plex or any network operator;</li> <li>Posts misleading information about an application\u2019s purpose;</li> <li>Infringes on the intellectual property rights of others; or</li> <li>Performs any other prohibited action listed under \u201cAcceptable Use\u201d above.</li> </ol> </li> <li>You will require your end users to comply with any applicable law and these Terms. You will not knowingly enable your end users to violate applicable law or these Terms.</li> <li>You shall indemnify and hold harmless Plex and its officers, directors, employees, contractors, licensors, suppliers, distributors, contractors, agents, and third party contributors from any claims, damages, liabilities, costs and fees (including reasonable attorney fees) arising from any use of the Interfacing Software or from Plex\u2019s distribution of the Interfacing Software.</li> <li>Brand Features and Attribution <ol> <li>"Brand Features" is defined as the trade names, trademarks, service marks, logos, domain names, and other distinctive brand features of a party. Except where expressly stated, these terms do not grant either party any right, title, or interest in or to the other party\'s Brand Features. Any use by you of Plex\u2019s Brand Features (including any goodwill associated therewith) will inure to the benefit of Plex. Plex Brand Features include the Plex Play Logo (\u201c>\u201d in stylized format) and the trademarks, trade names and designs as may be identified from time to time in the Plex Trademark Notice that is posted at <a href="https://plex.tv/legal" target="_blank">www.plex.tv/legal</a>.</li> <li>You must seek prior written approval from Plex to display Plex\'s Brand Features, including for the purpose of promoting or advertising that your Interfacing Software is for use in conjunction with Plex Services. Plex, in its sole discretion and in a separate writing such as an e-mail from an authorized representative of Plex, may grant you a revocable, non-transferable, nonexclusive license, without right of sub-license, to display Plex\'s Brand Features for the purpose of promoting or advertising that your Interfacing Software is for use in conjunction with Plex Services. You understand and agree that Plex has the sole discretion to determine whether your attribution(s) and use of Plex\'s Brand Features are in accordance with the above requirements and guidelines and that Plex may revoke the license granted herein at any time, or may require you to modify your use of Plex\u2019s Brand Features, for any reason in its sole discretion.</li> <li>You will not make any statement that suggests a partnership with, sponsorship by, or endorsement by Plex, without Plex\'s express prior written approval.</li> <li>In the course of promoting, marketing, or demonstrating the Services, Plex may produce and distribute incidental depictions, including screenshots, video, or other content from your Interfacing Software, and may use your company or product name. You grant us all necessary rights for the above purposes.</li> </ol> </li> </ol> </li> </ol> <h4>Children</h4> <p> While Plex does distribute products that may be used by children, the Services are not intended to be used by children, without involvement, supervision, and approval of a parent or legal guardian. Therefore, if an account owner sets parental controls or establishes sub-accounts that the account owner intends to permit a child to use, the account owner should not reveal the account password to the child. Plex and its contributors may not provide controls that restrict the maturity level of content available via Plex and an adult account owner has sole responsibility for determining what maturity level is appropriate for or accessible to any children whom the account owner permits to use the Plex service or a sub-account. </p> <h4>NO WARRANTY</h4> <ol> <li>PLEX SERVICES ARE PROVIDED "AS IS". PLEX MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, AND PLEX EXPRESSLY DISCLAIMS ALL WARRANTIES WITH RESPECT TO THE PLEX SERVICES, INCLUDING WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. FURTHER, PLEX DOES NOT WARRANT AGAINST ERRORS, OMISSIONS, RESULTS OF USE, OR THAT PLEX SERVICES ARE BUG FREE OR ERROR FREE OR THAT USE WILL BE UNINTERRUPTED. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THE AGREEMENT. ALL THE FOREGOING DISCLAIMERS ALSO APPLY IN FULL WITH RESPECT TO PLEX\'S LICENSORS, SUPPLIERS, DISTRIBUTORS, CONTRACTORS, AGENTS, AND THIRD PARTY CONTRIBUTORS. SOME STATES DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO THE ABOVE LIMITATIONS MAY NOT APPLY TO YOU.</li> <li>You agree that Plex and its officers, directors, employees, and contractors are not responsible for any fault, inaccuracy, error, omission, delay or any other failure of your equipment and/or services caused by Plex\'s hardware, software, cabling, network services, or the like, or arising from Plex\'s use of such equipment and/or services.</li> <li>The above disclaimer of warranty applies to software developed by Plex and any software developed by a third party and provided by Plex including, but not limited to, Interfacing Software developed by any Plex user.</li> </ol> <h4>Limitation of Liability and Damages</h4> <ol> <li>UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, INCLUDING, BUT NOT LIMITED TO, TORT, CONTRACT, NEGLIGENCE, STRICT LIABILITY, OR OTHERWISE, SHALL PLEX BE LIABLE TO YOU OR ANY OTHER PERSON OR ENTITY: (I) FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE, ACCURACY OF RESULTS, COMPUTER FAILURE OR MALFUNCTION, LOSS OF DATA, OR OTHER DAMAGES RESULTING FROM YOUR USE OF THE SOFTWARE; OR (II) FOR ANY MATTER BEYOND ITS REASONABLE CONTROL. PLEX\'S AGGREGATE LIABILITY FOR DAMAGES OF ANY KIND WHATSOEVER ARISING OUT OF THIS AGREEMENT SHALL BE LIMITED TO THE LESSER OF THE TOTAL FEES PAID BY YOU TO PLEX (IF ANY) FOR THE PORTION OF THE SOFTWARE THAT GAVE RISE TO SUCH DAMAGES OR $100 (U.S.), EXCEPT WHERE NOT PERMITTED BY APPLICABLE LAW, IN WHICH CASE PLEX\'S LIABILITY SHALL BE LIMITED TO THE MINIMUM AMOUNT PERMITTED BY SUCH APPLICABLE LAW. ALL THE FOREGOING LIMITATIONS SHALL APPLY EVEN IF EITHER PARTY HAS BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. ALL THE FOREGOING LIMITATIONS ALSO APPLY WITH RESPECT TO PLEX\'S SUPPLIERS, LICENSORS, DISTRIBUTORS, CONTRACTORS, AGENTS, AND THIRD PARTY CONTRIBUTORS. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THE ABOVE LIMITATION AND EXCLUSION MAY NOT APPLY TO YOU.</li> <li>The above limitations and exclusions apply to software developed by Plex and any software developed by a third party and provided by Plex including, but not limited to, Interfacing Software developed by Plex user.</li> </ol> <h4>Third-Party Materials</h4> <p> This website and other Services may provide links to websites, software, or other materials provided by third parties. Plex does not endorse and is not responsible or liable for the availability, accuracy, safety, or intellectual property rights of or relating to such content. Plex is not liable for any harm caused by any such materials. </p> <h4>Malware</h4> <p> "Malware" means any known, discovered, envisioned, or invented, or any yet to be known, discovered, envisioned, or invented: (i) virus, Trojan horse, or any other harmful, harassing, or malicious software; or (ii) method, use, or means by which any software, firmware, equipment, device, communications medium, person, entity, or the like directly or indirectly engages in or is used for: (a) any unauthorized access; (b) any unauthorized communication; or (c) any cracks, hacks, exploits, or other activity, method, use, or means, that may cause harassment, harm, data loss, data theft, loss of communication, loss of privacy, or the like. You acknowledge that the Internet, Internet service providers, shared or dedicated telecommunication lines, wireless access points and wireless networks, other forms of communication, online resources including websites and cloud computing environments, or other means that you use to connect to the Software may not be secure and may be vulnerable to attack by third parties, and that it is possible to receive Malware by using the Internet, dedicated lines, other forms of communication, or other means. In order to protect the Software, you shall regularly obtain, use, and update appropriate third party software or other means to protect yourself from Malware and to detect and remove Malware that may be downloaded using the Internet, dedicated lines, other forms of communication, or other means. Plex does not warrant that the Software will be free of Malware including, but not limited to, Malware that is introduced by third parties, the Internet, dedicated lines, other forms of communication, or other means. </p> <h4>Waiver and Indemnity</h4> <p> You agree that Plex and its licensors, distributors, contractors, agents, and third party contributors shall have no liability whatsoever for any use you make of the Services. You shall indemnify and hold harmless Plex and its licensors, suppliers, distributors, contractors, agents, and third party contributors from any claims, damages, liabilities, costs and fees (including reasonable attorney fees) arising from your use of the Plex Services as well as from your failure to comply with any of the Terms, or any losses, damages, claims, costs, and/or attorneys\' fees arising from any use of or reliance upon any information received in connection with the Services that comprises or is based upon data provided by Plex or any third party. </p> <h4>Termination of Services</h4> <p> Plex may at any time, with or without cause and with or without prior notice, immediately terminate or suspend your Plex account or otherwise terminate or suspend your access to all or a portion of the Services. Cause for such termination may include: (a) violations of the Terms or any other policies or guidelines that are referenced herein; (b) a request by you to cancel or terminate your account; (c) a request and/or order from law enforcement, a judicial body, or other government agency; (d) where providing the Services to you is or may become unlawful; (e) unexpected technical or security issues or problems; or (f) your participation in fraudulent or illegal activities. Any such termination or suspension shall be made by Plex in its sole discretion and Plex will not be responsible to you or any third party for any damages that may result or arise out of such termination or suspension of your access to the Services. </p> <h4>Miscellaneous</h4> <ol> <li>This Agreement does not give you any rights not expressly and unambiguously granted herein.</li> <li>No agency, partnership, joint venture, or employment is created as a result of this Agreement and you do not have any authority of any kind to bind Plex in any respect whatsoever.</li> <li>If any provision of this Agreement is found to be unenforceable or invalid, that provision shall be limited or eliminated to the minimum extent necessary so that this Agreement shall otherwise remain in full force and effect and enforceable.</li> <li>This Agreement is not assignable, transferable, or sublicensable by you except with Plex\'s prior written consent. Plex may transfer, assign, or delegate this Agreement and its rights and obligations without consent.</li> <li>Plex\'s failure to enforce any right or provisions in this Agreement will not constitute a waiver of such or any other provision.</li> <li>This Agreement shall be governed by and construed in accordance with the laws of the state of California, as if made within California between two residents thereof, and the parties submit to the exclusive jurisdiction of the Superior Court of Santa Clara County and the United States District Court for the Northern District of California. Notwithstanding the foregoing sentence, but without limiting Plex\'s right to seek injunctive or other equitable relief in any court of competent jurisdiction, any disputes arising with respect to this Agreement shall be referred to an arbitrator affiliated with the Judicial Arbitration and Mediation Services, Inc. ("JAMS"). The arbitrator shall be selected by joint agreement of the parties. In the event the parties cannot agree on an arbitrator within thirty (30) days of the initiating party providing the other party with written notice that it plans to seek arbitration, the parties shall each select an arbitrator affiliated with JAMS, which arbitrators shall jointly select a third such arbitrator to resolve the dispute. The written decision of the arbitrator shall be final and binding on the parties. The arbitration proceeding shall be carried on and heard in Santa Clara County, California using the English language and pursuant to the rules of (and administered by) JAMS. In any action or proceeding to enforce rights under this Agreement, the prevailing party will be entitled to recover costs and reasonable attorneys\' fees from the other party. A separate written license agreement or order and signed by Plex and you or your company, employer, or principal may state other terms and conditions that apply to you, including terms relating to price, payment, delivery, confidential information, support services, and the like. You are solely responsible to review such terms or conditions with your company, employer or principal. In the event of any conflict in terms, the terms of the separate license agreement shall supersede the terms of this Agreement.</li> <li>Both parties agree that this Agreement is the complete and exclusive statement of the mutual understanding of the parties and supersedes and cancels all previous written and oral agreements, communications, and other understandings relating to the subject matter of this Agreement.</li> </ol> ';
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var i,n="";return n+=" "+v((i=e&&e.title,typeof i===g?i.apply(e):i))+" "}function o(e,t){var n,s="";return s+=" ",n=i(10).call(e,e&&e.type,"home",{hash:{},inverse:y.program(6,c,t),fn:y.program(4,l,t),data:t}),(n||0===n)&&(s+=n),s+=" "}function l(e,t){var n="";return n+=" "+v(i(1).call(e,"Add User",{hash:{},data:t}))+" "}function c(e,t){var n="";return n+=" "+v(i(1).call(e,"Invite Friend",{hash:{},
data:t}))+" "}function u(e,t){var n="";return n+=" "+v(i(1).call(e,"Save Changes",{hash:{},data:t}))+" "}function d(e,t){var n,s="";return s+=" ",n=i(10).call(e,e&&e.type,"home",{hash:{},inverse:y.program(13,p,t),fn:y.program(11,h,t),data:t}),(n||0===n)&&(s+=n),s+=" "}function h(e,t){var n="";return n+=" "+v(i(1).call(e,"Add",{hash:{},data:t}))+" "}function p(e,t){var n="";return n+=" "+v(i(1).call(e,"Invite",{hash:{},data:t}))+" "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};
var f,m="",g="function",v=this.escapeExpression,y=this;return m+='<div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><i class="glyphicon remove-2"></i></button> <div class="modal-poster media-poster img-circle placeholder-friend"></div> <h4 class="modal-title"> ',f=n.if.call(t,t&&t.title,{hash:{},inverse:y.program(3,o,a),fn:y.program(1,r,a),data:a}),(f||0===f)&&(m+=f),m+=' </h4> </div> <form id="share-server-form"> <div class="modal-body modal-body-scroll modal-body-with-panes"> <div class="modal-nav-pane dark-scrollbar"></div> <div class="modal-body-pane dark-scrollbar"></div> </div> <div class="modal-footer"> <span class="form-message"></span> <button type="button" class="cancel-btn btn btn-lg btn-default" data-dismiss="modal">'+v(i(1).call(t,"Cancel",{
hash:{},data:a}))+'</button> <button type="submit" class="next-btn btn btn-lg btn-primary disabled">'+v(i(1).call(t,"Next",{hash:{},data:a}))+'</button> <button type="submit" class="submit-btn btn btn-lg btn-primary btn-loading hidden"> <div class="loading loading-sm"></div> <span class="btn-label"> ',f=n.if.call(t,t&&t.title,{hash:{},inverse:y.program(10,d,a),fn:y.program(8,u,a),data:a}),(f||0===f)&&(m+=f),m+=" </span> </button> </div> </form> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){
function r(e,t){var n,s="";return s+=' <div class="restricted-name-group form-group"> <input type="text" id="restricted-title" name="title" class="form-control" placeholder="'+x(i(1).call(e,"Name",{hash:{},data:t}))+'" value="'+x((n=e&&e.homeUser,n=null==n||n===!1?n:n.title,typeof n===S?n.apply(e):n))+'"> </div> '}function o(e,t){var i,s="";return s+=' <h3 class="friend-title"> ',i=n.if.call(e,(i=e&&e.friend,null==i||i===!1?i:i.title),{hash:{},inverse:C.program(6,c,t),fn:C.program(4,l,t),data:t}),
(i||0===i)&&(s+=i),s+=' </h3> <p class="text-muted"> ',i=n.if.call(e,(i=e&&e.friend,null==i||i===!1?i:i.email),{hash:{},inverse:C.program(10,d,t),fn:C.program(8,u,t),data:t}),(i||0===i)&&(s+=i),s+=" </p> "}function l(e,t){var i,n="";return n+=" "+x((i=e&&e.friend,i=null==i||i===!1?i:i.title,typeof i===S?i.apply(e):i))+" "}function c(e,t){var i,n="";return n+=" "+x((i=e&&e.friend,i=null==i||i===!1?i:i.username,typeof i===S?i.apply(e):i))+" "}function u(e,t){var i,n="";return n+=" "+x((i=e&&e.friend,
i=null==i||i===!1?i:i.email,typeof i===S?i.apply(e):i))+" "}function d(e,t){var n="";return n+=" "+x(i(1).call(e,"An invite will be sent to this user.",{hash:{},data:t}))+" "}function h(e,t){var i,s="";return s+=' <div class="edit-friend-footer"> ',i=n.if.call(e,(i=e&&e.homeUser,null==i||i===!1?i:i.restricted),{hash:{},inverse:C.program(18,g,t),fn:C.program(13,p,t),data:t}),(i||0===i)&&(s+=i),s+=" </div> "}function p(e,t){var i,s="";return s+=" ",i=n.if.call(e,(i=e&&e.homeUser,null==i||i===!1?i:i.guest),{
hash:{},inverse:C.program(16,m,t),fn:C.program(14,f,t),data:t}),(i||0===i)&&(s+=i),s+=" "}function f(e,t){var n="";return n+=' <button type="button" class="disable-guest-btn btn btn-sm btn-danger">'+x(i(1).call(e,"Disable guest",{hash:{},data:t}))+"</button> "}function m(e,t){var n="";return n+=' <button type="button" class="remove-home-btn btn btn-sm btn-danger">'+x(i(1).call(e,"Delete user",{hash:{},data:t}))+"</button> "}function g(e,t){var i,s="";return s+=" ",i=n.if.call(e,e&&e.canRemoveFriend,{
hash:{},inverse:C.noop,fn:C.program(19,v,t),data:t}),(i||0===i)&&(s+=i),s+=" ",i=n.if.call(e,e&&e.canRemoveHomeUser,{hash:{},inverse:C.noop,fn:C.program(21,y,t),data:t}),(i||0===i)&&(s+=i),s+=" "}function v(e,t){var n="";return n+=' <button type="button" class="remove-friend-btn btn btn-sm btn-danger">'+x(i(1).call(e,"Remove this friend",{hash:{},data:t}))+"</button> "}function y(e,t){var n="";return n+=' <button type="button" class="remove-home-btn btn btn-sm btn-danger">'+x(i(1).call(e,"Remove from home",{
hash:{},data:t}))+"</button> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var b,w="",x=this.escapeExpression,S="function",C=this;return w+='<div class="edit-friend-header"> <div class="media-poster img-circle placeholder-friend"></div> ',b=n.if.call(t,(b=t&&t.homeUser,null==b||b===!1?b:b.restricted),{hash:{},inverse:C.program(3,o,a),fn:C.program(1,r,a),data:a}),(b||0===b)&&(w+=b),w+=" </div> ",b=n.if.call(t,t&&t.showActions,{hash:{},inverse:C.noop,fn:C.program(12,h,a),data:a
}),(b||0===b)&&(w+=b),w+=" "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<li> <a class="btn-gray change-pane-btn disabled" data-pane="general" data-pane-id="general" href="#"> <i class="modal-nav-icon glyphicon user"></i> '+o(i(1).call(t,"General",{hash:{},data:a}))+' </a> </li> <li class="owned-list-header modal-nav-list-header">'+o(i(1).call(t,"My Servers",{
hash:{},data:a}))+'</li> <li class="owned-servers-container"></li> <li> <a class="btn-gray change-pane-btn disabled" data-pane="restrictions" data-pane-id="restrictions" href="#"> <i class="modal-nav-icon glyphicon ban"></i> '+o(i(1).call(t,"Restrictions",{hash:{},data:a}))+' </a> </li> <li class="shared-list-header modal-nav-list-header">'+o(i(1).call(t,"Shared With Me",{hash:{},data:a}))+'</li> <li class="shared-servers-container"></li> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){
this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var a,r,o="",l="function",c=this.escapeExpression;return o+='<span class="modal-nav-icon friend-server-status ',(r=i.status)?a=r.call(t,{hash:{},data:s}):(r=t&&t.status,a=typeof r===l?r.call(t,{hash:{},data:s}):r),o+=c(a)+'"> <i class="friend-server-status-icon unknown glyphicon circle-question-mark"></i> <i class="friend-server-status-icon available glyphicon circle-ok"></i> <i class="friend-server-status-icon unavailable glyphicon circle-exclamation-mark"></i> </span> '+c((a=t&&t.server,
a=null==a||a===!1?a:a.name,typeof a===l?a.apply(t):a))+" "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<div class="server-header"> <i class="plex-image server server-xs"></i> <h3 class="server-title"></h3> <a class="server-status-btn unknown" href="#"> <span class="server-status-label available">'+o(i(1).call(t,"Available",{hash:{},data:a}))+'</span> <span class="server-status-label unavailable">'+o(i(1).call(t,"Unavailable",{
hash:{},data:a}))+'</span> <span class="server-status-label unauthorized">'+o(i(1).call(t,"Unauthorized",{hash:{},data:a}))+'</span> <span class="server-status-label unknown">'+o(i(1).call(t,"Unknown",{hash:{},data:a}))+'</span> <i class="server-details-open-icon glyphicon chevron-down"></i> <i class="server-details-close-icon glyphicon chevron-up"></i> </a> </div> <div class="server-details transition-out"> <h4>'+o(i(1).call(t,"Info",{hash:{},data:a}))+'</h4> <div class="server-detail-row"> <div class="server-detail-label">'+o(i(1).call(t,"Version",{
hash:{},data:a}))+'</div> <div class="server-detail-value server-detail-version"></div> </div> <div class="server-detail-row server-detail-last-seen-row hidden"> <div class="server-detail-label">'+o(i(1).call(t,"Last Seen",{hash:{},data:a}))+'</div> <div class="server-detail-value server-detail-last-seen"></div> </div> <div class="server-detail-row"> <div class="server-detail-label">'+o(i(1).call(t,"Address",{hash:{},data:a}))+'</div> <div class="server-detail-value server-detail-address"></div> </div> <div class="server-detail-row"> <div class="server-detail-label">'+o(i(1).call(t,"Port",{
hash:{},data:a}))+'</div> <div class="server-detail-value server-detail-port"></div> </div> </div> <div class="share-details"> <h4>'+o(i(1).call(t,"Share",{hash:{},data:a}))+"</h4> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var s,a="";return a+=' <div class="form-group"> <div class="col-sm-offset-3 col-sm-9"> <div class="checkbox"> <label for="allow-sync-cb"> <input type="checkbox" id="allow-sync-cb" name="allowSync" ',s=n.if.call(e,(s=e&&e.user,
null==s||s===!1?s:s.allowSync),{hash:{},inverse:d.noop,fn:d.program(2,o,t),data:t}),(s||0===s)&&(a+=s),a+="> "+h(i(1).call(e,"Allow Sync",{hash:{},data:t}))+' </label> </div> <div class="checkbox"> <label for="allow-camera-upload-images-cb"> <input type="checkbox" id="allow-camera-upload-images-cb" name="allowCameraUpload" ',s=n.if.call(e,(s=e&&e.user,null==s||s===!1?s:s.allowCameraUpload),{hash:{},inverse:d.noop,fn:d.program(2,o,t),data:t}),(s||0===s)&&(a+=s),a+="> "+h(i(1).call(e,"Allow Camera Upload",{
hash:{},data:t}))+' </label> <p class="help-block">'+h(i(1).call(e,"Enabling this option will allow this user to upload media to your server.",{hash:{},data:t}))+'</p> </div> <div class="checkbox"> <label for="allow-channels-cb"> <input type="checkbox" id="allow-channels-cb" name="allowChannels" ',s=n.if.call(e,(s=e&&e.user,null==s||s===!1?s:s.allowChannels),{hash:{},inverse:d.noop,fn:d.program(2,o,t),data:t}),(s||0===s)&&(a+=s),a+="> "+h(i(1).call(e,"Allow Channels",{hash:{},data:t}))+' </label> </div> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label section-control-label"> <i class="section-type-icon glyphicon '+h((s=e&&e.moviesIcon,
typeof s===p?s.apply(e):s))+'"></i> '+h(i(1).call(e,"Movies",{hash:{},data:t}))+' </label> <div class="col-sm-9 help-block section-help-block"> '+h(i(1).call(e,"Only allow movies matching the ratings or labels below.",{hash:{},data:t}))+' </div> </div> <div class="form-group"> <label for="filter-movie-contentRating" class="col-sm-3 control-label"> '+h(i(1).call(e,"Ratings",{hash:{},data:t}))+' </label> <div class="col-sm-9"> <input type="text" id="filter-movie-contentRating" class="form-control tag-input-hidden" name="filterMovies" data-filter="contentRating" data-section-type="movie" placeholder="'+h(i(1).call(e,"Allow all ratings",{
hash:{},data:t}))+'" value="'+h((s=e&&e.user,s=null==s||s===!1?s:s.filterMovies,s=null==s||s===!1?s:s.contentRating,typeof s===p?s.apply(e):s))+'"> </div> </div> <div class="form-group"> <label for="filter-movie-label" class="col-sm-3 control-label"> '+h(i(1).call(e,"Labels",{hash:{},data:t}))+' </label> <div class="col-sm-9"> <input type="text" id="filter-movie-label" class="form-control tag-input-hidden" name="filterMovies" data-filter="label" data-section-type="movie" placeholder="'+h(i(1).call(e,"Allow all labels",{
hash:{},data:t}))+'" value="'+h((s=e&&e.user,s=null==s||s===!1?s:s.filterMovies,s=null==s||s===!1?s:s.label,typeof s===p?s.apply(e):s))+'"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label section-control-label"> <i class="section-type-icon glyphicon '+h((s=e&&e.showsIcon,typeof s===p?s.apply(e):s))+'"></i> '+h(i(1).call(e,"TV Shows",{hash:{},data:t}))+' </label> <div class="col-sm-9 help-block section-help-block"> '+h(i(1).call(e,"Only allow TV shows matching the ratings or labels below.",{
hash:{},data:t}))+' </div> </div> <div class="form-group"> <label for="filter-show-contentRating" class="col-sm-3 control-label"> '+h(i(1).call(e,"Ratings",{hash:{},data:t}))+' </label> <div class="col-sm-9"> <input type="text" id="filter-show-contentRating" class="form-control tag-input-hidden" name="filterTelevision" data-filter="contentRating" data-section-type="show" placeholder="'+h(i(1).call(e,"Allow all ratings",{hash:{},data:t}))+'" value="'+h((s=e&&e.user,s=null==s||s===!1?s:s.filterTelevision,
s=null==s||s===!1?s:s.contentRating,typeof s===p?s.apply(e):s))+'"> </div> </div> <div class="form-group"> <label for="filter-show-label" class="col-sm-3 control-label"> '+h(i(1).call(e,"Labels",{hash:{},data:t}))+' </label> <div class="col-sm-9"> <input type="text" id="filter-show-label" class="form-control tag-input-hidden" name="filterTelevision" data-filter="label" data-section-type="show" placeholder="'+h(i(1).call(e,"Allow all labels",{hash:{},data:t}))+'" value="'+h((s=e&&e.user,s=null==s||s===!1?s:s.filterTelevision,
s=null==s||s===!1?s:s.label,typeof s===p?s.apply(e):s))+'"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label section-control-label"> <i class="section-type-icon glyphicon '+h((s=e&&e.musicIcon,typeof s===p?s.apply(e):s))+'"></i> '+h(i(1).call(e,"Albums",{hash:{},data:t}))+' </label> </div> <div class="form-group"> <label for="filter-artist-label" class="col-sm-3 control-label"> '+h(i(1).call(e,"Labels",{hash:{},data:t}))+' </label> <div class="col-sm-9"> <input type="text" id="filter-artist-label" class="form-control tag-input-hidden" name="filterMusic" data-filter="label" data-section-type="artist" placeholder="'+h(i(1).call(e,"Allow all labels",{
hash:{},data:t}))+'" value="'+h((s=e&&e.user,s=null==s||s===!1?s:s.filterMusic,s=null==s||s===!1?s:s.label,typeof s===p?s.apply(e):s))+'"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label section-control-label"> <i class="section-type-icon glyphicon '+h((s=e&&e.photosIcon,typeof s===p?s.apply(e):s))+'"></i> '+h(i(1).call(e,"Photos",{hash:{},data:t}))+' </label> </div> <div class="form-group"> <label for="filter-photo-label" class="col-sm-3 control-label"> '+h(i(1).call(e,"Labels",{
hash:{},data:t}))+' </label> <div class="col-sm-9"> <input type="text" id="filter-photo-label" class="form-control tag-input-hidden" name="filterPhotos" data-filter="label" data-section-type="photo" placeholder="'+h(i(1).call(e,"Allow all labels",{hash:{},data:t}))+'" value="'+h((s=e&&e.user,s=null==s||s===!1?s:s.filterPhotos,s=null==s||s===!1?s:s.label,typeof s===p?s.apply(e):s))+'"> </div> </div> '}function o(e,t){return"checked"}function l(e,t){var n,s="";return s+=' <div class="row row-padded"> <h4 class="text-muted text-center">'+h(i(1).call(e,"You need a Plex Pass to use restrictions.",{
hash:{},data:t}))+'</h4> <p class="text-center"> <a class="btn btn-sm btn-primary" href="'+h((n=e&&e.plexPassUrl,typeof n===p?n.apply(e):n))+'" target="_blank">'+h(i(1).call(e,"Learn More",{hash:{},data:t}))+"</a> </p> </div> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var c,u="",d=this,h=this.escapeExpression,p="function";return c=n.if.call(t,t&&t.hasPlexPass,{hash:{},inverse:d.program(4,l,a),fn:d.program(1,r,a),data:a}),(c||0===c)&&(u+=c),u+=" "})},function(e,t,i){var n=i(3);
e.exports=(n.default||n).template(function(e,t,i,n,s){function a(e,t){return"checked"}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var r,o,l="",c="function",u=this.escapeExpression,d=this;return l+='<div class="checkbox"> <label for="share-section-'+u((r=t&&t.section,r=null==r||r===!1?r:r.id,typeof r===c?r.apply(t):r))+'-cb"> <input type="checkbox" id="share-section-'+u((r=t&&t.section,r=null==r||r===!1?r:r.id,typeof r===c?r.apply(t):r))+'-cb" value="'+u((r=t&&t.section,r=null==r||r===!1?r:r.id,
typeof r===c?r.apply(t):r))+'" ',r=i.if.call(t,t&&t.isChecked,{hash:{},inverse:d.noop,fn:d.program(1,a,s),data:s}),(r||0===r)&&(l+=r),l+='> <i class="section-type-icon glyphicon ',(o=i.typeIcon)?r=o.call(t,{hash:{},data:s}):(o=t&&t.typeIcon,r=typeof o===c?o.call(t,{hash:{},data:s}):o),l+=u(r)+'"></i> '+u((r=t&&t.section,r=null==r||r===!1?r:r.title,typeof r===c?r.apply(t):r))+" </label> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return"show-libraries";
}function o(e,t){var s,a="";return a+=' <li class="share-section-list-item"> <div class="checkbox"> <label for="share-all-libraries-'+v((s=e&&e.server,s=null==s||s===!1?s:s.machineIdentifier,typeof s===g?s.apply(e):s))+'-cb"> <input type="checkbox" id="share-all-libraries-'+v((s=e&&e.server,s=null==s||s===!1?s:s.machineIdentifier,typeof s===g?s.apply(e):s))+'-cb" name="share-all-libraries-cb" value="all" ',s=n.if.call(e,e&&e.allLibraries,{hash:{},inverse:y.noop,fn:y.program(4,l,t),data:t}),(s||0===s)&&(a+=s),
a+="> "+v(i(1).call(e,"All Libraries",{hash:{},data:t}))+" </label> </div> </li> "}function l(e,t){return"checked"}function c(e,t){var n="";return n+=' <p class="text-muted">'+v(i(1).call(e,"Loading...",{hash:{},data:t}))+"</p> "}function u(e,t){var i;return i=n.if.call(e,e&&e.hasFailed,{hash:{},inverse:y.program(11,h,t),fn:y.program(9,d,t),data:t}),i||0===i?i:""}function d(e,t){var n,s="";return s+=' <p class="text-muted">'+v(i(1).call(e,"We were unable to retrieve libraries for {1}. Please ensure the server is signed in to your Plex account.",(n=e&&e.server,
null==n||n===!1?n:n.name),{hash:{},data:t}))+"</p> "}function h(e,t){var i;return i=n.unless.call(e,e&&e.hasSections,{hash:{},inverse:y.noop,fn:y.program(12,p,t),data:t}),i||0===i?i:""}function p(e,t){var n="";return n+=' <p class="text-muted">'+v(i(1).call(e,"No libraries",{hash:{},data:t}))+"</p> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var f,m="",g="function",v=this.escapeExpression,y=this;return m+='<ul id="'+v((f=t&&t.server,f=null==f||f===!1?f:f.machineIdentifier,
typeof f===g?f.apply(t):f))+'-section-list" class="list share-section-list ',f=n.unless.call(t,t&&t.allLibraries,{hash:{},inverse:y.noop,fn:y.program(1,r,a),data:a}),(f||0===f)&&(m+=f),m+='"> ',f=n.if.call(t,t&&t.hasSections,{hash:{},inverse:y.noop,fn:y.program(3,o,a),data:a}),(f||0===f)&&(m+=f),m+=" </ul> ",f=n.if.call(t,t&&t.isPending,{hash:{},inverse:y.program(8,u,a),fn:y.program(6,c,a),data:a}),(f||0===f)&&(m+=f),m+=" "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){
this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<div class="server-header"> <i class="plex-image server server-xs"></i> <h3 class="server-title"></h3> <a class="server-status-btn unknown" href="#"> <span class="server-status-label available">'+o(i(1).call(t,"Available",{hash:{},data:a}))+'</span> <span class="server-status-label unavailable">'+o(i(1).call(t,"Unavailable",{hash:{},data:a}))+'</span> <span class="server-status-label unauthorized">'+o(i(1).call(t,"Unauthorized",{
hash:{},data:a}))+'</span> <span class="server-status-label unknown">'+o(i(1).call(t,"Unknown",{hash:{},data:a}))+'</span> <i class="server-details-open-icon glyphicon chevron-down"></i> <i class="server-details-close-icon glyphicon chevron-up"></i> </a> </div> <div class="server-details transition-out"> <h4>'+o(i(1).call(t,"Info",{hash:{},data:a}))+'</h4> <div class="server-detail-row"> <div class="server-detail-label">'+o(i(1).call(t,"Version",{hash:{},data:a}))+'</div> <div class="server-detail-value server-detail-version"></div> </div> <div class="server-detail-row"> <div class="server-detail-label">'+o(i(1).call(t,"Last Seen",{
hash:{},data:a}))+'</div> <div class="server-detail-value server-detail-last-seen"></div> </div> <div class="server-detail-row"> <div class="server-detail-label">'+o(i(1).call(t,"Address",{hash:{},data:a}))+'</div> <div class="server-detail-value server-detail-address"></div> </div> <div class="server-detail-row"> <div class="server-detail-label">'+o(i(1).call(t,"Port",{hash:{},data:a}))+'</div> <div class="server-detail-value server-detail-port"></div> </div> </div> <div class="share-details"> <h4>'+o(i(1).call(t,"Sharing",{
hash:{},data:a}))+'</h4> <div class="share-server-container"> <div class="server-restriction-allow-sync share-section-list-item no-checkbox"> <i class="section-type-icon glyphicon ok-2"></i> '+o(i(1).call(t,"Sync Allowed",{hash:{},data:a}))+' </div> <ul class="list share-section-list show-libraries"></ul> </div> </div> <div class="share-details-footer"> <button type="button" class="leave-server-btn btn btn-sm btn-danger">'+o(i(1).call(t,"Leave Server",{hash:{},data:a}))+"</button> </div> "})},function(e,t,i){
var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var a,r,o="",l="function",c=this.escapeExpression;return o+='<li class="share-section-list-item no-checkbox"> <i class="section-type-icon glyphicon ',(r=i.typeIcon)?a=r.call(t,{hash:{},data:s}):(r=t&&t.typeIcon,a=typeof r===l?r.call(t,{hash:{},data:s}):r),o+=c(a)+'"></i> '+c((a=t&&t.section,a=null==a||a===!1?a:a.title,typeof a===l?a.apply(t):a))+" </li> "})},function(e,t,i){
var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var n="";return n+=' <div class="existing-user-group username-group"> <div class="media-poster img-circle placeholder-square"></div> <div class="username-group-input-container"> <i class="validation-success-icon glyphicon circle-ok"></i> <i class="validation-error-icon glyphicon circle-exclamation-mark"></i> <input type="text" class="form-control hidden" name="username" placeholder="'+u(i(1).call(e,"Username or email",{
hash:{},data:t}))+'" autocorrect="off" autocapitalize="off"> <button type="button" class="add-existing-user-btn btn btn-primary">'+u(i(1).call(e,"Add an Existing Plex User",{hash:{},data:t}))+'</button> <p class="help-block">'+u(i(1).call(e,"Adding a Plex user to your home will allow you to quickly switch accounts. The invited user will be asked to confirm home membership.",{hash:{},data:t}))+'</p> </div> </div> <div class="restricted-user-group username-group"> <div class="media-poster img-circle placeholder-friend"></div> <div class="username-group-input-container"> <input type="text" class="form-control hidden" name="title" placeholder="'+u(i(1).call(e,"Name",{
hash:{},data:t}))+'" autocorrect="off" autocapitalize="off"> <button type="button" class="add-restricted-user-btn btn btn-primary">'+u(i(1).call(e,"Create a Managed User",{hash:{},data:t}))+'</button> <p class="help-block">'+u(i(1).call(e,"Managed users are only available when signed in with an account in your home. You can choose any name you like and you'll be able to set restrictions on accessible media.",{hash:{},data:t}))+"</p> </div> </div> "}function o(e,t){var n="";return n+=' <div class="friend-group username-group"> <div class="media-poster img-circle placeholder-friend"></div> <div class="username-group-input-container"> <i class="validation-success-icon glyphicon circle-ok"></i> <i class="validation-error-icon glyphicon circle-exclamation-mark"></i> <input type="text" class="form-control" name="username" placeholder="'+u(i(1).call(e,"Username or email",{
hash:{},data:t}))+'" autocorrect="off" autocapitalize="off"> <p class="help-block">'+u(i(1).call(e,"The invited user will be asked to confirm friendship. If libraries are shared with the user, you'll be able to set restrictions on accessible media.",{hash:{},data:t}))+"</p> </div> </div> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var l,c="",u=this.escapeExpression,d=this;return l=i(10).call(t,t&&t.type,"home",{hash:{},inverse:d.program(3,o,a),fn:d.program(1,r,a),data:a}),
(l||0===l)&&(c+=l),c+=" "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><i class="glyphicon remove-2"></i></button> <h4 class="modal-title"><i class="modal-icon glyphicon circle-info"></i> '+o(i(1).call(t,"Welcome to Plex Home",{
hash:{},data:a}))+'</h4> </div> <div class="modal-body modal-body-scroll dark-scrollbar"> <p>'+o(i(1).call(t,"{1}, so we've made a few changes to help keep your media safe.",t&&t.intro,{hash:{},data:a}))+"</p> <ol> <li>"+o(i(1).call(t,"We've increased the security requirements on this server, so anything communicating with it will need to be signed in to a Plex account.",{hash:{},data:a}))+"</li> <li>"+o(i(1).call(t,"We've disabled DLNA to prevent any DLNA-enabled device from browsing and playing media without a password or PIN. You can change this preference in your {1}server settings{2}.",'<a class="server-settings-btn" href="#">',"</a>",{
hash:{},data:a}))+"</li> </ol> <p>"+o(i(1).call(t,"For more information on Plex Home security settings, please see the {1}Plex Home section{2} on our support site.",'<a href="https://support.plex.tv/hc/en-us/sections/200641063" target="_blank">',"</a>",{hash:{},data:a}))+'</p> </div> <div class="modal-footer"> <button type="button" class="btn btn-lg btn-primary" data-dismiss="modal">'+o(i(1).call(t,"OK",{hash:{},data:a}))+"</button> </div> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){
return this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{},'<div class="modal-dialog"> <div class="modal-alert"></div> <div class="modal-content"></div> </div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var a,r,o="",l="function",c=this.escapeExpression;return o+='<span class="message">',(r=i.message)?a=r.call(t,{hash:{},data:s}):(r=t&&t.message,a=typeof r===l?r.call(t,{hash:{},
data:s}):r),o+=c(a)+"</span> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return' <a class="back-btn btn-gray" href="#"><i class="glyphicon chevron-left"></i></a> '}function o(e,t){var n="";return n+=' <i class="modal-icon glyphicon pencil"></i> '+w(i(1).call(e,"Edit PIN",{hash:{},data:t}))+" "}function l(e,t){var i;return i=n.if.call(e,e&&e.isEditConfirmation,{hash:{},inverse:x.program(8,u,t),fn:x.program(6,c,t),data:t}),i||0===i?i:""}function c(e,t){
var n="";return n+=" "+w(i(1).call(e,"Confirm Current PIN",{hash:{},data:t}))+" "}function u(e,t){var n="";return n+=" "+w(i(1).call(e,"Enter PIN",{hash:{},data:t}))+" "}function d(e,t){return"number"}function h(e,t){return"password"}function p(e,t){var n="";return n+=' <p class="help-block"> '+w(i(1).call(e,"You do not currently have a PIN. This will allow any users in this home to switch to your account.",{hash:{},data:t}))+" </p> "}function f(e,t){var s,a="";return a+=' <div class="modal-footer"> ',
s=n.if.call(e,e&&e.hasCurrentPIN,{hash:{},inverse:x.noop,fn:x.program(17,m,t),data:t}),(s||0===s)&&(a+=s),a+=" ",s=n.if.call(e,e&&e.isEditWarning,{hash:{},inverse:x.program(21,v,t),fn:x.program(19,g,t),data:t}),(s||0===s)&&(a+=s),a+=' <button type="submit" class="save-btn btn-link">'+w(i(1).call(e,"Save",{hash:{},data:t}))+"</button> </div> "}function m(e,t){var n="";return n+=' <button type="button" class="remove-btn btn-gray pull-left">'+w(i(1).call(e,"Remove",{hash:{},data:t}))+"</button> "}function g(e,t){
var n="";return n+=' <button type="button" class="skip-btn btn-gray" data-dismiss="modal">'+w(i(1).call(e,"Skip",{hash:{},data:t}))+"</button> "}function v(e,t){var n="";return n+=' <button type="button" class="cancel-btn btn-gray" data-dismiss="modal">'+w(i(1).call(e,"Cancel",{hash:{},data:t}))+"</button> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var y,b="",w=this.escapeExpression,x=this;return b+='<div class="modal-header"> <div class="home-user-dropdown-container pull-right"></div> <h4 class="modal-title"> ',
y=n.if.call(t,t&&t.showBackButton,{hash:{},inverse:x.noop,fn:x.program(1,r,a),data:a}),(y||0===y)&&(b+=y),b+=" ",y=n.if.call(t,t&&t.isEditing,{hash:{},inverse:x.program(5,l,a),fn:x.program(3,o,a),data:a}),(y||0===y)&&(b+=y),b+=' <span class="loading loading-sm hidden"></span> </h4> </div> <form id="pin-form"> <div class="modal-body"> <ul class="tile-list user-select-list disabled"></ul> <div class="pin-inputs-container"> <input type="',y=n.if.call(t,t&&t.isEditing,{hash:{},inverse:x.program(12,h,a),
fn:x.program(10,d,a),data:a}),(y||0===y)&&(b+=y),b+='" pattern="\\d*" class="form-control"> <input type="',y=n.if.call(t,t&&t.isEditing,{hash:{},inverse:x.program(12,h,a),fn:x.program(10,d,a),data:a}),(y||0===y)&&(b+=y),b+='" pattern="\\d*" class="form-control"> <input type="',y=n.if.call(t,t&&t.isEditing,{hash:{},inverse:x.program(12,h,a),fn:x.program(10,d,a),data:a}),(y||0===y)&&(b+=y),b+='" pattern="\\d*" class="form-control"> <input type="',y=n.if.call(t,t&&t.isEditing,{hash:{},inverse:x.program(12,h,a),
fn:x.program(10,d,a),data:a}),(y||0===y)&&(b+=y),b+='" pattern="\\d*" class="form-control"> </div> ',y=n.if.call(t,t&&t.isEditWarning,{hash:{},inverse:x.noop,fn:x.program(14,p,a),data:a}),(y||0===y)&&(b+=y),b+=" </div> ",y=n.if.call(t,t&&t.isEditing,{hash:{},inverse:x.noop,fn:x.program(16,f,a),data:a}),(y||0===y)&&(b+=y),b+=" </form> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){function a(e,t){return' <div class="user-select-container"> '}function r(e,t){return' <a class="user-select-container" href="#"> ';
}function o(e,t){return" </div> "}function l(e,t){return" </a> "}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var c,u="",d=this;return c=i.if.call(t,t&&t.disabled,{hash:{},inverse:d.program(3,r,s),fn:d.program(1,a,s),data:s}),(c||0===c)&&(u+=c),u+=' <div class="user-select-top"> <div class="user-poster img-circle"></div> <i class="protected-icon user-icon glyphicon lock"></i> <i class="admin-icon user-icon glyphicon crown"></i> </div> <div class="username"></div> ',c=i.if.call(t,t&&t.disabled,{
hash:{},inverse:d.program(7,l,s),fn:d.program(5,o,s),data:s}),(c||0===c)&&(u+=c),u+=" "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<div class="modal-header"> <h4 class="modal-title"> '+o(i(1).call(t,"Select User",{hash:{},data:a}))+' <span class="loading loading-sm"></span> </h4> </div> <div class="modal-body"></div> '})},function(e,t,i){var n=i(3);
e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return"hidden"}function o(e,t){return d(i(1).call(e,"Search {1}",e&&e.searchPlaceholder,{hash:{},data:t}))}function l(e,t){var i;return d((i=e&&e.searchValue,typeof i===h?i.apply(e):i))}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var c,u="",d=this.escapeExpression,h="function",p=this;return u+='<div class="form-group form-group-search"> <label class="control-label-search" for="nav-bar-search"> <i class="glyphicon search"></i> <a class="clear-search-btn ',
c=n.unless.call(t,t&&t.searchValue,{hash:{},inverse:p.noop,fn:p.program(1,r,a),data:a}),(c||0===c)&&(u+=c),u+='" href="#"><i class="glyphicon circle-remove"></i></a> </label> <input type="search" id="nav-bar-search" class="form-control form-control-search" placeholder="',c=n.if.call(t,t&&t.searchPlaceholder,{hash:{},inverse:p.noop,fn:p.program(3,o,a),data:a}),(c||0===c)&&(u+=c),u+='" value="',c=n.if.call(t,t&&t.searchValue,{hash:{},inverse:p.noop,fn:p.program(5,l,a),data:a}),(c||0===c)&&(u+=c),u+='"> </div> ';
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return"hidden"}function o(e,t){return"active"}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var l,c="",u=this,d="function",h=this.escapeExpression;return c+='<ul class="nav nav-bar-nav"> <li><a class="back-btn ',l=n.unless.call(t,t&&t.hasHistory,{hash:{},inverse:u.noop,fn:u.program(1,r,a),data:a}),(l||0===l)&&(c+=l),c+='" href="#"><i class="glyphicon chevron-left"></i></a></li> <li><a class="home-btn" href="#"><i class="glyphicon home"></i></a></li> </ul> <div class="nav-bar-search-container"></div> <ul class="nav nav-bar-nav nav-bar-right"> <li><a class="plex-pass-btn ',
l=n.unless.call(t,t&&t.canGoPremium,{hash:{},inverse:u.noop,fn:u.program(1,r,a),data:a}),(l||0===l)&&(c+=l),c+='" href="'+h((l=t&&t.plexPassUrl,typeof l===d?l.apply(t):l))+'" target="_blank" data-toggle="tooltip-holiday"><span class="plex-pass-label label label-primary">'+h(i(1).call(t,"Go Premium",{hash:{},data:a}))+'</span></a></li> <li class="',l=n.if.call(t,t&&t.activityCount,{hash:{},inverse:u.noop,fn:u.program(3,o,a),data:a}),(l||0===l)&&(c+=l),c+='"><a class="activity-btn ',l=n.unless.call(t,t&&t.showActivity,{
hash:{},inverse:u.noop,fn:u.program(1,r,a),data:a}),(l||0===l)&&(c+=l),c+='" href="#!/activity" title="'+h(i(1).call(t,"Activity",{hash:{},data:a}))+'" data-toggle="tooltip"><span class="activity-badge badge badge-transparent ',l=n.unless.call(t,t&&t.activityCount,{hash:{},inverse:u.noop,fn:u.program(1,r,a),data:a}),(l||0===l)&&(c+=l),c+='">'+h((l=t&&t.activityCount,typeof l===d?l.apply(t):l))+'</span><i class="glyphicon cardio"></i></a></li> <li><a class="settings-btn" href="#!/settings" title="'+h(i(1).call(t,"Settings",{
hash:{},data:a}))+'" data-toggle="tooltip"><i class="glyphicon settings"></i></a></li> </ul> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return"hidden"}function o(e,t){return"signed-in"}function l(e,t){return"full-user"}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var c,u="",d=this,h="function",p=this.escapeExpression;return u+='<a class="dropdown-toggle dropdown-poster-toggle" href="#nav-dropdown" data-toggle="dropdown"> <div class="dropdown-poster-container"> <div class="media-poster img-circle"></div> <i class="caret-icon"></i> </div> <span class="total-badge badge ',
c=n.unless.call(t,t&&t.totalCount,{hash:{},inverse:d.noop,fn:d.program(1,r,a),data:a}),(c||0===c)&&(u+=c),u+='">'+p((c=t&&t.totalCount,typeof c===h?c.apply(t):c))+'</span> </a> <ul class="dropdown-menu ',c=n.if.call(t,t&&t.signedIn,{hash:{},inverse:d.noop,fn:d.program(3,o,a),data:a}),(c||0===c)&&(u+=c),u+=" ",c=n.if.call(t,t&&t.isFullUser,{hash:{},inverse:d.noop,fn:d.program(5,l,a),data:a}),(c||0===c)&&(u+=c),u+='"> <li class="signed-in-item dropdown-header username-header"></li> <li class="signed-in-item"><a class="users-btn" href="#">'+p(i(1).call(t,"Users",{
hash:{},data:a}))+' <span class="invites-badge badge ',c=n.unless.call(t,t&&t.invitesCount,{hash:{},inverse:d.noop,fn:d.program(1,r,a),data:a}),(c||0===c)&&(u+=c),u+='">'+p((c=t&&t.invitesCount,typeof c===h?c.apply(t):c))+'</span></a></li> <li class="signed-in-item full-user-item divider"></li> <li class="signed-in-item full-user-item"><a href="#!/playlist/queue">'+p(i(1).call(t,"Watch Later",{hash:{},data:a}))+'</a></li> <li class="signed-in-item full-user-item"><a href="#!/playlist/recommendations">'+p(i(1).call(t,"Recommended",{
hash:{},data:a}))+'</a></li> <li class="signed-in-item divider"></li> <li><a href="#!/announcements">'+p(i(1).call(t,"Announcements",{hash:{},data:a}))+' <span class="announcements-badge badge ',c=n.unless.call(t,t&&t.unreadAnnouncementsCount,{hash:{},inverse:d.noop,fn:d.program(1,r,a),data:a}),(c||0===c)&&(u+=c),u+='">'+p((c=t&&t.unreadAnnouncementsCount,typeof c===h?c.apply(t):c))+'</span></a></li> <li class="signed-in-item full-user-item"><a href="'+p((c=t&&t.accountUrl,typeof c===h?c.apply(t):c))+'" target="_blank">'+p(i(1).call(t,"Account",{
hash:{},data:a}))+'</a></li> <li><a href="'+p((c=t&&t.appsUrl,typeof c===h?c.apply(t):c))+'" target="_blank">'+p(i(1).call(t,"Get Plex apps",{hash:{},data:a}))+'</a></li> <li><a href="'+p((c=t&&t.helpUrl,typeof c===h?c.apply(t):c))+'" target="_blank">'+p(i(1).call(t,"Help",{hash:{},data:a}))+'</a></li> <li class="divider"></li> <li class="signed-in-item switch-user-item ',c=n.unless.call(t,t&&t.home,{hash:{},inverse:d.noop,fn:d.program(1,r,a),data:a}),(c||0===c)&&(u+=c),u+='"><a class="switch-user-btn" href="#">'+p(i(1).call(t,"Switch User...",{
hash:{},data:a}))+'</a></li> <li class="signed-out-item"><a class="sign-in-btn" href="#">'+p(i(1).call(t,"Sign In",{hash:{},data:a}))+'</a></li> <li class="signed-in-item full-user-item"><a class="sign-out-btn" href="#">'+p(i(1).call(t,"Sign Out",{hash:{},data:a}))+"</a></li> </ul> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var i,n="";return n+='data-scope-to-attr="'+u((i=e&&e.scopeToAttr,typeof i===c?i.apply(e):i))+'" data-scope-to-param="'+u((i=e&&e.scopeToParam,
typeof i===c?i.apply(e):i))+'"'}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var o,l="",c="function",u=this.escapeExpression,d=this;return l+='<div class="form-group" data-attr="'+u((o=t&&t.name,typeof o===c?o.apply(t):o))+'"> <label for="text-'+u((o=t&&t.name,typeof o===c?o.apply(t):o))+'" class="control-label">'+u(i(1).call(t,t&&t.label,{hash:{},data:a}))+'<span class="control-error"></span></label> <div class="input-group selectize-group"> <input type="text" id="text-'+u((o=t&&t.name,
typeof o===c?o.apply(t):o))+'" class="form-control text-field" name="'+u((o=t&&t.name,typeof o===c?o.apply(t):o))+'" placeholder="'+u((o=t&&t.placeholder,typeof o===c?o.apply(t):o))+'" data-rating-key="'+u((o=t&&t.ratingKey,typeof o===c?o.apply(t):o))+'" data-title="'+u((o=t&&t.title,typeof o===c?o.apply(t):o))+'" ',o=n.if.call(t,t&&t.scopeToAttr,{hash:{},inverse:d.noop,fn:d.program(1,r,a),data:a}),(o||0===o)&&(l+=o),l+="> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){
function r(e,t){var n="";return n+=' <h4 class="server-connect-error-header">'+p(i(1).call(e,"Problem Connecting to Plex",{hash:{},data:t}))+'</h4> <p class="text-muted">'+p(i(1).call(e,"Plex was unable to authenticate your server. Please sign your server out and try again.",{hash:{},data:t}))+"</p> "}function o(e,t){var n,s="";return n=i(10).call(e,e&&e.mappingError,"myplexgone",{hash:{},inverse:f.program(6,c,t),fn:f.program(4,l,t),data:t}),(n||0===n)&&(s+=n),s+=" "}function l(e,t){var n="";return n+=' <h4 class="server-connect-error-header">'+p(i(1).call(e,"Problem Connecting to Plex",{
hash:{},data:t}))+'</h4> <p class="text-muted">'+p(i(1).call(e,"Your server was unable to reach Plex. Please ensure that the computer or device running your server can access the internet.",{hash:{},data:t}))+"</p> "}function c(e,t){var n="";return n+=' <h4 class="server-connect-error-header">'+p(i(1).call(e,"Signed in to Plex",{hash:{},data:t}))+'</h4> <p class="text-muted">'+p(i(1).call(e,"You have successfully signed your server in to Plex, but we were unable to reach it from outside your network.",{
hash:{},data:t}))+"</p> "}function u(e,t){var n="";return n+=' <p class="text-muted">'+p(i(1).call(e,"If you skip this step you will not be able to share or stream media outside your home. If you change your mind later, you can adjust this in Settings.",{hash:{},data:t}))+"</p> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var d,h="",p=this.escapeExpression,f=this;return d=i(10).call(t,t&&t.mappingError,"badauth",{hash:{},inverse:f.program(3,o,a),fn:f.program(1,r,a),data:a}),
(d||0===d)&&(h+=d),h+=" ",d=i(36).call(t,t&&t.context,"settings",{hash:{},inverse:f.noop,fn:f.program(8,u,a),data:a}),(d||0===d)&&(h+=d),h+=' <p class="text-muted">'+p(i(1).call(t,"If you would like to enable this now, you will need to configure your router or firewall to allow Plex to contact your server. Please refer to our {1}Connecting a Server{2} article for more information.",'<a href="http://support.plex.tv/hc/en-us/articles/200484543-Connecting-a-Server" target="_blank">',"</a>",{hash:{},
data:a}))+"</p> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return"locked"}function o(e,t){return"disabled"}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var l,c="",u="function",d=this.escapeExpression,h=this;return c+='<div class="form-group"> <label for="lockable-'+d((l=t&&t.name,typeof l===u?l.apply(t):l))+'">'+d(i(1).call(t,t&&t.label,{hash:{},data:a}))+'</label> <div class="input-group"> <a href="#" data-field="'+d((l=t&&t.name,
typeof l===u?l.apply(t):l))+'" class="input-group-addon edit-lock-addon ',l=n.if.call(t,t&&t.locked,{hash:{},inverse:h.noop,fn:h.program(1,r,a),data:a}),(l||0===l)&&(c+=l),c+=" ",l=n.if.call(t,t&&t.disabled,{hash:{},inverse:h.noop,fn:h.program(3,o,a),data:a}),(l||0===l)&&(c+=l),c+='" tabindex="-1"><i class="glyphicon lock"></i></a> <input type="number" id="lockable-'+d((l=t&&t.name,typeof l===u?l.apply(t):l))+'" class="form-control lockable-field" name="'+d((l=t&&t.name,typeof l===u?l.apply(t):l))+'" value="'+d((l=t&&t.value,
typeof l===u?l.apply(t):l))+'" placeholder="'+d((l=t&&t.placeholder,typeof l===u?l.apply(t):l))+'" ',l=n.if.call(t,t&&t.disabled,{hash:{},inverse:h.noop,fn:h.program(3,o,a),data:a}),(l||0===l)&&(c+=l),c+="> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return" locked"}function o(e,t){var i,n="";return n+='data-query="'+d((i=e&&e.query,typeof i===u?i.apply(e):i))+'"'}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};
var l,c="",u="function",d=this.escapeExpression,h=this;return c+='<div class="form-group"> <label for="lockable-'+d((l=t&&t.name,typeof l===u?l.apply(t):l))+'">'+d(i(1).call(t,t&&t.label,{hash:{},data:a}))+'</label> <div class="input-group selectize-group"> <a href="#" data-field="'+d((l=t&&t.name,typeof l===u?l.apply(t):l))+'" class="input-group-addon edit-lock-addon',l=n.if.call(t,t&&t.locked,{hash:{},inverse:h.noop,fn:h.program(1,r,a),data:a}),(l||0===l)&&(c+=l),c+='"><i class="glyphicon lock"></i></a> <input type="text" id="lockable-'+d((l=t&&t.name,
typeof l===u?l.apply(t):l))+'" class="form-control lockable-field tag-input-hidden" data-name="'+d((l=t&&t.name,typeof l===u?l.apply(t):l))+'" ',l=n.if.call(t,t&&t.query,{hash:{},inverse:h.noop,fn:h.program(3,o,a),data:a}),(l||0===l)&&(c+=l),c+="> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return" locked"}function o(e,t){var i,s="";return s+=' <textarea class="form-control lockable-field" id="lockable-'+m((i=e&&e.name,typeof i===f?i.apply(e):i))+'" name="'+m((i=e&&e.name,
typeof i===f?i.apply(e):i))+'"',i=n.if.call(e,e&&e.rows,{hash:{},inverse:g.noop,fn:g.program(4,l,t),data:t}),(i||0===i)&&(s+=i),s+=' placeholder="'+m((i=e&&e.placeholder,typeof i===f?i.apply(e):i))+'">'+m((i=e&&e.value,typeof i===f?i.apply(e):i))+"</textarea> "}function l(e,t){var i,n="";return n+=' rows="'+m((i=e&&e.rows,typeof i===f?i.apply(e):i))+'"'}function c(e,t){var i,s="";return s+=' <input type="text" id="lockable-'+m((i=e&&e.name,typeof i===f?i.apply(e):i))+'" class="form-control lockable-field" name="'+m((i=e&&e.name,
typeof i===f?i.apply(e):i))+'" value="'+m((i=e&&e.value,typeof i===f?i.apply(e):i))+'" placeholder="'+m((i=e&&e.placeholder,typeof i===f?i.apply(e):i))+'" ',i=n.if.call(e,e&&e.scopeToAttr,{hash:{},inverse:g.noop,fn:g.program(7,u,t),data:t}),(i||0===i)&&(s+=i),s+=" ",i=n.if.call(e,e&&e.ratingKey,{hash:{},inverse:g.noop,fn:g.program(9,d,t),data:t}),(i||0===i)&&(s+=i),s+="> "}function u(e,t){var i,n="";return n+='data-scope-to-attr="'+m((i=e&&e.scopeToAttr,typeof i===f?i.apply(e):i))+'" data-scope-to-param="'+m((i=e&&e.scopeToParam,
typeof i===f?i.apply(e):i))+'"'}function d(e,t){var i,n="";return n+='data-rating-key="'+m((i=e&&e.ratingKey,typeof i===f?i.apply(e):i))+'"'}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var h,p="",f="function",m=this.escapeExpression,g=this;return p+='<div class="form-group selectize-group" data-attr="'+m((h=t&&t.name,typeof h===f?h.apply(t):h))+'"> <label for="lockable-'+m((h=t&&t.name,typeof h===f?h.apply(t):h))+'">'+m(i(1).call(t,t&&t.label,{hash:{},data:a}))+'</label> <div class="input-group"> <a href="#" data-field="'+m((h=t&&t.name,
typeof h===f?h.apply(t):h))+'" class="input-group-addon edit-lock-addon',h=n.if.call(t,t&&t.locked,{hash:{},inverse:g.noop,fn:g.program(1,r,a),data:a}),(h||0===h)&&(p+=h),p+='" tabindex="-1"><i class="glyphicon lock"></i></a> ',h=i(10).call(t,t&&t.type,"textarea",{hash:{},inverse:g.program(6,c,a),fn:g.program(3,o,a),data:a}),(h||0===h)&&(p+=h),p+=" </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return"advanced-setting"}function o(e,t){
var s,a="";return a+=' <label class="control-label" for="input_'+w((s=e&&e.id,typeof s===x?s.apply(e):s))+w((s=e&&e.idSuffix,typeof s===x?s.apply(e):s))+'"> <input type="checkbox" id="input_'+w((s=e&&e.id,typeof s===x?s.apply(e):s))+w((s=e&&e.idSuffix,typeof s===x?s.apply(e):s))+'" name="'+w((s=e&&e.id,typeof s===x?s.apply(e):s))+'" value="1" ',s=n.if.call(e,e&&e.value,{hash:{},inverse:S.noop,fn:S.program(4,l,t),data:t}),(s||0===s)&&(a+=s),a+="> "+w(i(1).call(e,e&&e.label,{hash:{},data:t}))+" </label> ",
s=n.if.call(e,e&&e.summary,{hash:{},inverse:S.noop,fn:S.program(6,c,t),data:t}),(s||0===s)&&(a+=s),a+=" "}function l(e,t){return"checked"}function c(e,t){var n="";return n+=' <p class="help-block">'+w(i(1).call(e,e&&e.summary,{hash:{},data:t}))+"</p> "}function u(e,t){var s,a="";return a+=' <label class="control-label" for="input_'+w((s=e&&e.id,typeof s===x?s.apply(e):s))+w((s=e&&e.idSuffix,typeof s===x?s.apply(e):s))+'">'+w(i(1).call(e,e&&e.label,{hash:{},data:t}))+"</label> ",s=n.if.call(e,e&&e.enumValues,{
hash:{},inverse:S.program(13,f,t),fn:S.program(9,d,t),data:t}),(s||0===s)&&(a+=s),a+=" ",s=n.if.call(e,e&&e.summary,{hash:{},inverse:S.noop,fn:S.program(6,c,t),data:t}),(s||0===s)&&(a+=s),a+=" "}function d(e,t){var i,s="";return s+=' <select id="input_'+w((i=e&&e.id,typeof i===x?i.apply(e):i))+w((i=e&&e.idSuffix,typeof i===x?i.apply(e):i))+'" name="'+w((i=e&&e.id,typeof i===x?i.apply(e):i))+'"> ',i=n.each.call(e,e&&e.enumValues,{hash:{},inverse:S.noop,fn:S.programWithDepth(10,h,t,e),data:t}),(i||0===i)&&(s+=i),
s+=" </select> "}function h(e,t,n){var s,a="";return a+=' <option value="'+w((s=e&&e.value,typeof s===x?s.apply(e):s))+'" ',s=i(10).call(e,e&&e.value,n&&n.value,{hash:{},inverse:S.noop,fn:S.program(11,p,t),data:t}),(s||0===s)&&(a+=s),a+=">"+w(i(1).call(e,e&&e.label,{hash:{},data:t}))+"</option> "}function p(e,t){return'selected="selected"'}function f(e,t){var s,a="";return a+=' <input type="',s=i(10).call(e,e&&e.option,"hidden",{hash:{},inverse:S.program(16,g,t),fn:S.program(14,m,t),data:t}),(s||0===s)&&(a+=s),
a+='" id="input_'+w((s=e&&e.id,typeof s===x?s.apply(e):s))+w((s=e&&e.idSuffix,typeof s===x?s.apply(e):s))+'" class="form-control" name="'+w((s=e&&e.id,typeof s===x?s.apply(e):s))+'" value="'+w((s=e&&e.value,typeof s===x?s.apply(e):s))+'" ',s=n.if.call(e,e&&e.placeholder,{hash:{},inverse:S.noop,fn:S.program(18,v,t),data:t}),(s||0===s)&&(a+=s),a+="> "}function m(e,t){return"password"}function g(e,t){return"text"}function v(e,t){var i,n="";return n+='placeholder="'+w((i=e&&e.placeholder,typeof i===x?i.apply(e):i))+'"';
}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var y,b="",w=this.escapeExpression,x="function",S=this;return b+='<div class="form-group ',y=n.if.call(t,t&&t.advanced,{hash:{},inverse:S.noop,fn:S.program(1,r,a),data:a}),(y||0===y)&&(b+=y),b+='"> ',y=i(10).call(t,t&&t.type,"bool",{hash:{},inverse:S.program(8,u,a),fn:S.program(3,o,a),data:a}),(y||0===y)&&(b+=y),b+=" </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var i,s="";
return s+=' <textarea class="form-control text-field" id="text-'+p((i=e&&e.name,typeof i===h?i.apply(e):i))+'" name="'+p((i=e&&e.name,typeof i===h?i.apply(e):i))+'"',i=n.if.call(e,e&&e.rows,{hash:{},inverse:f.noop,fn:f.program(2,o,t),data:t}),(i||0===i)&&(s+=i),s+=' placeholder="'+p((i=e&&e.placeholder,typeof i===h?i.apply(e):i))+'">'+p((i=e&&e.value,typeof i===h?i.apply(e):i))+"</textarea> "}function o(e,t){var i,n="";return n+=' rows="'+p((i=e&&e.rows,typeof i===h?i.apply(e):i))+'"'}function l(e,t){
var i,s="";return s+=' <input type="text" id="text-'+p((i=e&&e.name,typeof i===h?i.apply(e):i))+'" class="form-control text-field" name="'+p((i=e&&e.name,typeof i===h?i.apply(e):i))+'" value="'+p((i=e&&e.value,typeof i===h?i.apply(e):i))+'" placeholder="'+p((i=e&&e.placeholder,typeof i===h?i.apply(e):i))+'" ',i=n.if.call(e,e&&e.excludeParam,{hash:{},inverse:f.noop,fn:f.program(5,c,t),data:t}),(i||0===i)&&(s+=i),s+="> "}function c(e,t){var i,n="";return n+='data-exclude-param="'+p((i=e&&e.excludeParam,
typeof i===h?i.apply(e):i))+'" data-exclude-value="'+p((i=e&&e.excludeValue,typeof i===h?i.apply(e):i))+'"'}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var u,d="",h="function",p=this.escapeExpression,f=this;return d+='<div class="form-group"> <label for="text-'+p((u=t&&t.name,typeof u===h?u.apply(t):u))+'">'+p(i(1).call(t,t&&t.label,{hash:{},data:a}))+"</label> ",u=i(10).call(t,t&&t.type,"textarea",{hash:{},inverse:f.program(4,l,a),fn:f.program(1,r,a),data:a}),(u||0===u)&&(d+=u),
d+=" </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var a="";return a})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var a="";return a})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return"hidden"}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),
a=a||{};var o,l="",c=this,u=this.escapeExpression;return l+='<div class="photo-details-container"> <div class="error hidden"></div> <div class="photo-details"> <div class="photo-loading-overlay"></div> <div class="photo-details-info"> <div class="media-actions"> <button class="play-btn media-action-btn btn-link ',o=n.unless.call(t,(o=t&&t.player,null==o||o===!1?o:o.slideshowPaused),{hash:{},inverse:c.noop,fn:c.program(1,r,a),data:a}),(o||0===o)&&(l+=o),l+=" ",o=n.unless.call(t,(o=t&&t.player,null==o||o===!1?o:o.canPlayPause),{
hash:{},inverse:c.noop,fn:c.program(1,r,a),data:a}),(o||0===o)&&(l+=o),l+='"><i class="glyphicon play"></i></button> <button class="pause-btn media-action-btn btn-link ',o=n.if.call(t,(o=t&&t.player,null==o||o===!1?o:o.slideshowPaused),{hash:{},inverse:c.noop,fn:c.program(1,r,a),data:a}),(o||0===o)&&(l+=o),l+=" ",o=n.unless.call(t,(o=t&&t.player,null==o||o===!1?o:o.canPlayPause),{hash:{},inverse:c.noop,fn:c.program(1,r,a),data:a}),(o||0===o)&&(l+=o),l+='"><i class="glyphicon pause"></i></button> <button class="edit-btn media-action-btn btn-link hidden"><i class="glyphicon pencil"></i></button> <button class="more-btn media-action-btn btn-link hidden"><i class="glyphicon more"></i></button> <button class="minimize-btn media-action-btn btn-link hidden"><i class="glyphicon chevron-down"></i></button> <button class="enter-fullscreen-btn media-action-btn btn-link hidden"><i class="glyphicon resize-full"></i></button> <button class="exit-fullscreen-btn media-action-btn btn-link hidden"><i class="glyphicon resize-small"></i></button> <div class="photo-actions-dropdown media-actions-dropdown dropup pull-right"> <div class="dropdown-toggle" data-toggle="dropdown"></div> </div> </div> <h4 class="photo-title"></h4> <span class="photo-subtitle">'+u(i(1).call(t,"{1} of {2}",t&&t.index,t&&t.total,{
hash:{},data:a}))+'</span> <div class="photo-summary"></div> </div> </div> </div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){return this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{},'<a class="player-close-btn btn-gray" href="#"> <i class="glyphicon remove-2"></i> </a> <div class="loading loading-inline"></div> <div class="photo-player-controls"> <a class="previous-btn btn-gray hidden" href="#"> <i class="previous-icon glyphicon chevron-left"></i> </a> <a class="next-btn btn-gray hidden" href="#"> <i class="next-icon glyphicon chevron-right"></i> </a> </div> ';
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r,o="",l=this.escapeExpression,c="function";return o+='<div class="post-play-background background"></div> <div class="post-play-footer"> <div class="item-previous"> <div class="item-poster"> <h1>'+l(i(1).call(t,"Previous",{hash:{},data:a}))+'</h1> <a class="media-poster-container replay-btn play-btn" href="#"> <div class="media-poster"> <div class="media-poster-overlay"></div> <div class="media-poster-overlay-icons"> <i class="media-poster-overlay-icon glyphicon refresh"></i> </div> </div> </a> </div> <div class="item-summary"> <h1 class="media-title">'+l((r=t&&t.previous,
r=null==r||r===!1?r:r.title,typeof r===c?r.apply(t):r))+'</h1> <h2 class="media-subtitle-1">',r=t&&t.previous,r=null==r||r===!1?r:r.subtitle,r=typeof r===c?r.apply(t):r,(r||0===r)&&(o+=r),o+='</h2> </div> </div> <div class="item-next"> <div class="item-poster"> <h1>'+l(i(1).call(t,"Playing Next",{hash:{},data:a}))+'</h1> <a class="media-poster-container next-btn play-btn" href="#"> <div class="media-poster"> <div class="media-poster-overlay"></div> <div class="countdown"></div> <div class="media-poster-overlay-icons"> <i class="media-poster-overlay-icon glyphicon play"></i> </div> </div> </a> </div> <div class="item-summary"> <h1 class="media-title">'+l((r=t&&t.next,
r=null==r||r===!1?r:r.title,typeof r===c?r.apply(t):r))+'</h1> <h2 class="media-subtitle-1">'+l((r=t&&t.next,r=null==r||r===!1?r:r.subtitle,typeof r===c?r.apply(t):r))+'</h2> <h3 class="media-subtitle-2">',r=t&&t.next,r=null==r||r===!1?r:r.index,r=typeof r===c?r.apply(t):r,(r||0===r)&&(o+=r),o+="</h3> <p>"+l((r=t&&t.next,r=null==r||r===!1?r:r.summary,typeof r===c?r.apply(t):r))+"</p> </div> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){this.compilerInfo=[4,">= 1.0.0"],
i=this.merge(i,e.helpers),s=s||{};var a="";return a})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){return this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{},'<div class="video-container"> <div class="video-controls-container"></div> <div class="video-post-play-container"></div> <div class="video-details-container"></div> </div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){return this.compilerInfo=[4,">= 1.0.0"],
i=this.merge(i,e.helpers),s=s||{},'<div class="loading loading-inline"></div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){return this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{},'<div class="mini-controls-left"> <a class="media-poster-container" href="#"><div class="media-poster"></div></a> <div class="media-title"> <div class="grandparent-title-container"> <i class="plex-icon-mixradio"></i> <button class="grandparent-title btn-link btn-metadata-link"></button> </div> <div class="title-container"> <button class="item-title btn-link btn-metadata-link"></button> </div> <div class="rating-container"></div> </div> </div> <div class="mini-player-scrub-preview hidden"></div> <div class="mini-controls-center"> <div class="mini-controls-center-buttons"> <button class="shuffle-btn btn-link"><i class="plex-icon-osd-shuffle"></i></button> <button class="repeat-btn btn-link"> <i class="repeat-one plex-icon-osd-repeat-one"></i> <i class="repeat plex-icon-osd-repeat"></i> </button> <button class="previous-btn btn-link"><i class="glyphicon fast-backward"></i></button> <button class="play-btn btn-link btn-link-lg hidden"><i class="glyphicon play"></i></button> <button class="pause-btn btn-link btn-link-lg hidden"><i class="glyphicon pause"></i></button> <button class="stop-btn btn-link btn-link-lg hidden"><i class="glyphicon stop"></i></button> <button class="next-btn btn-link"><i class="glyphicon fast-forward"></i></button> <span id="player-actions-dropdown" class="dropup"> <button class="more-btn btn-link dropdown-toggle" href="#player-actions-dropdown" data-toggle="dropdown"><i class="glyphicon more"></i></button> </span> </div> <div class="seek-bar-container"> <span class="player-position"></span> <span class="player-duration"></span> </div> </div> <div class="mini-controls-right"> <button class="maximize-btn btn-link"><i class="glyphicon chevron-up"></i></button> <span class="player-play-queue-container"></span> <span class="player-volume-slider-container"></span> <button class="volume-btn btn-link hidden"> <i class="glyphicon volume-up"></i> <i class="glyphicon volume-down"></i> <i class="glyphicon mute"></i> </button> </div> ';
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){return this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{},'<div class="player-slider-track"> <div class="player-slider-buffer"></div> <div class="player-slider-progress"></div> </div> <div class="player-slider-thumb"></div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){return this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{},'<div class="player-slider-track"> <div class="player-slider-progress"></div> </div> <div class="player-slider-thumb"></div> ';
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){return this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{},'<img class="player-scrub-preview-thumbnail hidden"> <div class="tooltip top player-scrub-preview-tooltip"> <div class="tooltip-inner player-scrub-preview-time"></div> <div class="tooltip-arrow"></div> </div>'})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){return this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),
s=s||{},'<div class="video-background"></div> <video id="html-video" class="html-video"></video> <div class="video-subtitles-container"></div> <div class="flash-video"> <div id="flash-video-placeholder"></div> </div> <div class="video-image-overlays-region"></div> <div class="video-loading loading loading-inline"></div> <div class="alert-player alert-paused"><i class="glyphicon play"></i></div> <button class="video-overlay-btn"></button> <button class="player-close-btn btn-gray"><i class="glyphicon remove-2"></i></button> <div class="video-error-message-container"> <div class="video-error-message-center"> <div class="video-error-message"></div> <div class="video-error-skip-message btn-link"></div> </div> </div> <div class="video-controls-overlay video-controls-overlay-top"> <div class="video-controls-left"> <span class="video-title"></span> </div> <div class="player-dropdowns-container video-controls-right"> <button class="player-close-btn btn-link"><i class="glyphicon remove-2"></i></button> <button class="btn-link share-btn pull-left"><i class="glyphicon share"></i></button> <button class="btn-link recommend-btn pull-left"><i class="glyphicon share-alt"></i></button> </div> </div> <div class="player-primary-player-name-container"> <span class="primary-player-name"></span> </div> <div class="player-scrub-preview-container"></div> <div class="video-controls-overlay video-controls-overlay-bottom"> <div class="video-controls-left"> <button class="previous-btn btn-link hidden"><i class="glyphicon fast-backward"></i></button> <button class="play-btn btn-link hidden"><i class="glyphicon play"></i></button> <button class="pause-btn btn-link hidden"><i class="glyphicon pause"></i></button> <button class="next-btn btn-link hidden"><i class="glyphicon fast-forward"></i></button> </div> <div class="player-dropups-container video-controls-right"> <button class="enter-fullscreen-btn fullscreen-btn btn-link hidden"><i class="glyphicon resize-full"></i></button> <button class="exit-fullscreen-btn fullscreen-btn btn-link hidden"><i class="glyphicon resize-small"></i></button> <button class="minimize-btn btn-link"><i class="glyphicon chevron-down"></i></button> <button class="volume-btn btn-link btn-link-lg hidden"> <i class="glyphicon volume-up"></i> <i class="glyphicon volume-down"></i> <i class="glyphicon mute"></i> </button> <div class="player-volume-slider-container"></div> </div> <div class="video-controls-center-wrapper"> <div class="video-controls-center"> <div class="seek-bar-container"> <span class="player-position"></span> <span class="player-duration"></span> </div> </div> </div> </div> <div class="video-player-poster media-poster"></div> <div class="video-alert-region"></div> ';
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){function a(e,t){var n,s="";return s+=' <button class="btn-link dropdown-toggle ',n=i.if.call(e,e&&e.primaryPlayer,{hash:{},inverse:h.noop,fn:h.program(2,r,t),data:t}),(n||0===n)&&(s+=n),s+='" href="#player-primary-player-dropdown" data-toggle="dropdown"> <i class="',n=i.if.call(e,e&&e.primaryPlayer,{hash:{},inverse:h.program(6,l,t),fn:h.program(4,o,t),data:t}),(n||0===n)&&(s+=n),s+='"></i> </button> '}function r(e,t){
return"active"}function o(e,t){return"plex-icon-companion-cast-active"}function l(e,t){return"plex-icon-companion-cast"}function c(e,t){var n,s="";return s+=' <button class="btn-link cast-btn ',n=i.if.call(e,e&&e.primaryPlayer,{hash:{},inverse:h.noop,fn:h.program(2,r,t),data:t}),(n||0===n)&&(s+=n),s+="\" href='#'> <i class=\"",n=i.if.call(e,e&&e.primaryPlayer,{hash:{},inverse:h.program(6,l,t),fn:h.program(4,o,t),data:t}),(n||0===n)&&(s+=n),s+='"></i> </button> '}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),
s=s||{};var u,d="",h=this;return u=i.if.call(t,t&&t.showDropdown,{hash:{},inverse:h.program(8,c,s),fn:h.program(1,a,s),data:s}),(u||0===u)&&(d+=u),d+=" "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return"selected"}function o(e,t){var s,a="";return a+=' <li> <a class="',s=n.if.call(e,e&&e.selected,{hash:{},inverse:u.noop,fn:u.program(1,r,t),data:t}),(s||0===s)&&(a+=s),a+='" data-index="'+h((s=e&&e.index,typeof s===d?s.apply(e):s))+'" href="#"> '+h(i(58).call(e,e,{
hash:{},data:t}))+' <i class="player-dropdown-selected-icon dropdown-selected-icon glyphicon ok-2"></i> </a> </li> '}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var l,c="",u=this,d="function",h=this.escapeExpression;return c+='<button class="btn-link dropdown-toggle" href="#player-quality-dropdown" data-toggle="dropdown"> <i class="glyphicon adjust-alt"></i> </button> <ul class="dropdown-menu pull-right"> <li> <a class="',l=n.unless.call(t,t&&t.hasSelectedQuality,{hash:{},inverse:u.noop,
fn:u.program(1,r,a),data:a}),(l||0===l)&&(c+=l),c+='" data-index="-1" href="#"> '+h(i(1).call(t,"Original",{hash:{},data:a}))+' <i class="player-dropdown-selected-icon selected-icon glyphicon ok-2"></i> </a> </li> ',l=n.each.call(t,t&&t.availableQualities,{hash:{},inverse:u.noop,fn:u.program(3,o,a),data:a}),(l||0===l)&&(c+=l),c+=" </ul> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return"plex-icon-audio"}function o(e,t){return"plex-icon-subtitles-alt";
}function l(e,t,s){var a,r="";return r+=' <li><a class="',a=n.if.call(e,e&&e.selected,{hash:{},inverse:x.noop,fn:x.program(6,c,t),data:t}),(a||0===a)&&(r+=a),r+='" data-id="'+w((a=e&&e.id,typeof a===b?a.apply(e):a))+'" href="#">',a=n.if.call(e,e&&e.language,{hash:{},inverse:x.program(10,d,t),fn:x.program(8,u,t),data:t}),(a||0===a)&&(r+=a),a=i(10).call(e,s&&s.type,"subtitles",{hash:{},inverse:x.noop,fn:x.program(12,h,t),data:t}),(a||0===a)&&(r+=a),a=i(10).call(e,s&&s.type,"audio",{hash:{},inverse:x.noop,
fn:x.program(16,m,t),data:t}),(a||0===a)&&(r+=a),r+=' <i class="player-dropdown-selected-icon dropdown-selected-icon glyphicon ok-2"></i></a></li> '}function c(e,t){return"selected"}function u(e,t){var i;return w((i=e&&e.language,typeof i===b?i.apply(e):i))}function d(e,t){return w(i(1).call(e,"Unknown",{hash:{},data:t}))}function h(e,t){var i;return i=n.if.call(e,e&&e.format,{hash:{},inverse:x.noop,fn:x.program(13,p,t),data:t}),i||0===i?i:""}function p(e,t){var s,a="";return a+=" ("+w(i(522).call(e,e&&e.format,{
hash:{},data:t})),s=n.if.call(e,e&&e.forced,{hash:{},inverse:x.noop,fn:x.program(14,f,t),data:t}),(s||0===s)&&(a+=s),a+=")"}function f(e,t){var n="";return n+=" "+w(i(1).call(e,"Forced",{hash:{},data:t}))}function m(e,t){var i;return i=n.if.call(e,e&&e.codec,{hash:{},inverse:x.noop,fn:x.program(17,g,t),data:t}),i||0===i?i:""}function g(e,t){var n="";return n+=" ("+w(i(519).call(e,e&&e.codec,{hash:{},data:t}))+" "+w(i(518).call(e,e&&e.channels,{hash:{},data:t}))+")"}this.compilerInfo=[4,">= 1.0.0"],
n=this.merge(n,e.helpers),a=a||{};var v,y="",b="function",w=this.escapeExpression,x=this;return y+='<button class="btn-link dropdown-toggle" href="#player-'+w((v=t&&t.type,typeof v===b?v.apply(t):v))+'-dropdown" data-toggle="dropdown"> <i class="',v=i(10).call(t,t&&t.type,"audio",{hash:{},inverse:x.program(3,o,a),fn:x.program(1,r,a),data:a}),(v||0===v)&&(y+=v),y+='"></i> </button> <ul class="dropdown-menu pull-right"> ',v=n.each.call(t,t&&t.streams,{hash:{},inverse:x.noop,fn:x.programWithDepth(5,l,a,t),
data:a}),(v||0===v)&&(y+=v),y+=" </ul> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){function a(e,t){return' <span class="smart-badge badge badge-round"> <i class="icon glyphicon cogwheel"></i> </span> '}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var r,o,l="",c="function",u=this.escapeExpression,d=this;return l+='<a class="media-poster-container" href="',(o=i.url)?r=o.call(t,{hash:{},data:s}):(o=t&&t.url,r=typeof o===c?o.call(t,{hash:{},
data:s}):o),l+=u(r)+'"> <div class="media-poster"> <div class="media-poster-overlay"></div> ',r=i.if.call(t,t&&t.smart,{hash:{},inverse:d.noop,fn:d.program(1,a,s),data:s}),(r||0===r)&&(l+=r),l+=' <div class="media-poster-actions"> <button class="play-btn media-poster-btn btn-link" tabindex="-1"><i class="glyphicon play"></i></button> <button class="edit-btn media-poster-btn btn-link" tabindex="-1"><i class="glyphicon pencil"></i></button> <button class="more-btn media-poster-btn btn-link" tabindex="-1"><i class="glyphicon more"></i></button> </div> </div> <div class="media-subtitle-1-fill media-heading playlist-title"></div> <div class="media-subtitle-2-fill media-heading secondary playlist-duration"></div> </a> <div class="media-actions-dropdown playlist-actions-dropdown dropdown"> <div class="dropdown-toggle" data-toggle="dropdown"></div> </div> ';
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var a="";return a})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var n="";return n+=" "+c(i(1).call(e,"Click {1}here{2} to add content to the library.",'<a href="#" class="add-to-library-link">',"</a>",{hash:{},data:t}))+" "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var o,l="",c=this.escapeExpression,u=this;
return l+='<div class="section-loading-container hidden"> <div class="loading loading-inline"></div> </div> <h4 class="empty-message text-muted text-center"> <span class="empty-default"> '+c(i(1).call(t,"The library has no content yet.",{hash:{},data:a}))+" ",o=n.if.call(t,t&&t.canEdit,{hash:{},inverse:u.noop,fn:u.program(1,r,a),data:a}),(o||0===o)&&(l+=o),l+=' </span> <span class="empty-refreshing"> '+c(i(1).call(t,"The library is still being refreshed. Hang on while we look for your content.",{
hash:{},data:a}))+' </span> <span class="empty-filter"> '+c(i(1).call(t,"There is no content matching your active filter.",{hash:{},data:a}))+' </span> <span class="empty-folder"> '+c(i(1).call(t,"There is no content in the selected folder.",{hash:{},data:a}))+" </span> </h4> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{};var a="";return a})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){
this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r,o="",l="function",c=this.escapeExpression;return o+='<form class="edit-section-advanced-form settings-container"> <div class="language-group"> <input type="hidden" name="language" value="'+c((r=t&&t.section,r=null==r||r===!1?r:r.language,typeof r===l?r.apply(t):r))+'"> </div> <div class="row"> <div class="col-md-12 section-settings-region"></div> </div> <div class="row"> <div class="col-md-12"> <div class="form-group scanner-group hidden"> <label for="edit-section-scanner" class="control-label"> '+c(i(1).call(t,"Scanner",{
hash:{},data:a}))+' <span class="control-error">'+c(i(1).call(t,"A scanner is required.",{hash:{},data:a}))+'</span> </label> <select id="edit-section-scanner" name="scanner"></select> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="form-group agent-group hidden"> <label for="edit-section-agent" class="control-label"> '+c(i(1).call(t,"Agent",{hash:{},data:a}))+' <span class="control-error">'+c(i(1).call(t,"An agent is required.",{hash:{},data:a}))+'</span> </label> <select id="edit-section-agent" name="agent"></select> </div> </div> </div> <div class="row"> <div class="col-md-12 section-agent-settings-region"></div> </div> </form> ';
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<form class="edit-section-folders-form settings-container"> <label> '+o(i(1).call(t,"Add folders to your library",{hash:{},data:a}))+' </label> <div class="form-group Location-group"> <div class="paths-region"></div> <p class="add-folder-container"> <button type="button" class="add-folder-btn btn btn-icon-label btn-default"><i class="glyphicon folder-plus"></i> '+o(i(1).call(t,"Browse for media folder",{
hash:{},data:a}))+'</button> </p> <p class="control-error">'+o(i(1).call(t,"At least one folder is required.",{hash:{},data:a}))+'</p> </div> <p class="help-block">'+o(i(1).call(t,"Help us out by following {1}our guide{2} to naming and organizing your media.",'<a href="http://support.plex.tv/hc/en-us/categories/200028098-Media-Preparation" target="_blank">',"</a>",{hash:{},data:a}))+"</p> </form> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){this.compilerInfo=[4,">= 1.0.0"],
i=this.merge(i,e.helpers),s=s||{};var a,r,o="",l="function",c=this.escapeExpression;return o+='<div class="col-md-12"> <div class="form-group path-group"> <input type="text" name="path" class="form-control" value="',(r=i.path)?a=r.call(t,{hash:{},data:s}):(r=t&&t.path,a=typeof r===l?r.call(t,{hash:{},data:s}):r),o+=c(a)+'"> <div class="path-actions"> <a href="#" class="remove-path-btn btn-link btn-gray"><i class="glyphicon remove-2"></i></a> </div> </div> </div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){
function r(e,t){var n="";return n+=' <p class="help-block"> '+c(i(1).call(e,"Note: An active Plex Pass is required for this service. Don't have a Plex Pass? {1}Subscribe here{2}",'<a href="{3}" target="_blank">',"</a>",e&&e.plexPassUrl,{hash:{},data:t}))+" </p> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var o,l="",c=this.escapeExpression,u=this;return l+='<div class="choose-agent use-premium-agent" data-agent="com.plexapp.agents.plexmusic" data-scanner="Plex Premium Music Scanner"> <div class="row"> <div class="col-xs-12"> <div class="row use-agent-header use-premium-agent-header"> <div class="col-xs-12"> <input type="radio"> <span class="header-text"> '+c(i(1).call(t,"Create a premium Plex music library!",{
hash:{},data:a}))+' </span> </div> </div> <div class="row use-premium-agent-body"> <div class="col-xs-8"> <ul> <li>'+c(i(1).call(t,"Access to the best artwork, artist bios, album reviews, and more",{hash:{},data:a}))+"</li> <li>"+c(i(1).call(t,"Smart mixes based on track or mood",{hash:{},data:a}))+"</li> <li>"+c(i(1).call(t,"Improved music recognition and matching",{hash:{},data:a}))+"</li> <li>"+c(i(1).call(t,"Ad-free music videos",{hash:{},data:a}))+"</li> </ul> ",o=n.unless.call(t,t&&t.hasPlexPass,{
hash:{},inverse:u.noop,fn:u.program(1,r,a),data:a}),(o||0===o)&&(l+=o),l+=' </div> <div class="col-xs-4 vendor-logos"> <div class="vendor-logo vendor-logo-gracenote"></div> <div class="vendor-logo vendor-logo-vevo"></div> <div class="vendor-logo vendor-logo-plex-pass"></div> </div> </div> </div> </div> </div> <div class="choose-agent use-basic-agent"> <div class="row use-agent-header"> <div class="col-xs-12"> <input type="radio"> '+c(i(1).call(t,"Create a basic music library",{hash:{},data:a}))+" </div> </div> </div> ";
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var s,a="";return a+=' <div class="form-group"> <label class="control-label" for="input_importFromItunes_c"> <input type="checkbox" id="input_importFromItunes_c" name="importFromiTunes" value="1" ',s=n.if.call(e,e&&e.value,{hash:{},inverse:p.noop,fn:p.program(2,o,t),data:t}),(s||0===s)&&(a+=s),a+="> "+f(i(1).call(e,"Import from iTunes",{hash:{},data:t}))+' </label> <p class="help-block">'+f(i(1).call(e,"Importing from iTunes will import your music playlists. It will also import your ratings, the date you added the music, as well as play and skip counts for tracks in your library.",{
hash:{},data:t}))+"</p> </div> "}function o(e,t){return"checked"}function l(e,t,s){var a,r="";return r+=" "+f(i(13).call(e,"setting",{hash:{idSuffix:"_c"},data:t}))+" ",a=n.if.call(e,s&&s.edit,{hash:{},inverse:p.noop,fn:p.program(5,c,t),data:t}),(a||0===a)&&(r+=a),r+=" "}function c(e,t){var n,s="";return s+=" ",n=i(10).call(e,e&&e.id,"enableBIFGeneration",{hash:{},inverse:p.noop,fn:p.program(6,u,t),data:t}),(n||0===n)&&(s+=n),s+=" "}function u(e,t){var n="";return n+=' <div class="form-group"> <button type="button" class="delete-thumbnails-btn btn btn-sm btn-danger">'+f(i(1).call(e,"Delete Preview Thumbnails",{
hash:{},data:t}))+"</button> </div> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var d,h="",p=this,f=this.escapeExpression;return d=n.if.call(t,t&&t.isNewMusicSection,{hash:{},inverse:p.noop,fn:p.program(1,r,a),data:a}),(d||0===d)&&(h+=d),h+=" ",d=n.each.call(t,t&&t.settings,{hash:{},inverse:p.noop,fn:p.programWithDepth(4,l,a,t),data:a}),(d||0===d)&&(h+=d),h+=" "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return"section-type-chosen";
}function o(e,t){var n="";return n+=' <p class="prompt">'+v(i(1).call(e,"Select your library type",{hash:{},data:t}))+"</p> "}function l(e,t){var n="";return n+=" <label>"+v(i(1).call(e,"Library type",{hash:{},data:t}))+"</label> "}function c(e,t,s){var a,r="";return r+=' <a class="wizard-block section-type ',a=n.if.call(e,s&&s.add,{hash:{},inverse:y.noop,fn:y.program(8,u,t),data:t}),(a||0===a)&&(r+=a),r+=" ",a=i(10).call(e,s&&s.currentSectionKey,e&&e.key,{hash:{},inverse:y.noop,fn:y.program(10,d,t),
data:t}),(a||0===a)&&(r+=a),r+='" data-key="'+v((a=e&&e.key,typeof a===b?a.apply(e):a))+'" href="#"> <i class="wizard-block-icon '+v((a=e&&e.sectionTypeIcon,typeof a===b?a.apply(e):a))+'"></i> '+v((a=e&&e.title,typeof a===b?a.apply(e):a))+" </a> "}function u(e,t){return"selectable"}function d(e,t){return"selected"}function h(e,t){var n="";return n+=' <div class="row"> <div class="col-xs-12"> <p class="prompt">'+v(i(1).call(e,"Name your library and choose language.",{hash:{},data:t}))+"</p> </div> </div> ";
}function p(e,t){var n="";return n+=" "+v(i(1).call(e,"Last updated {1}",e&&e.updatedAt,{hash:{},data:t}))+" "}function f(e,t){var n="";return n+=" "+v(i(1).call(e,"Each library should only contain one type of media.",{hash:{},data:t}))+" "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var m,g="",v=this.escapeExpression,y=this,b="function";return g+='<form class="edit-section-type-form settings-container ',m=n.if.call(t,(m=t&&t.section,null==m||m===!1?m:m.type),{hash:{},inverse:y.noop,
fn:y.program(1,r,a),data:a}),(m||0===m)&&(g+=m),g+='"> ',m=n.if.call(t,t&&t.add,{hash:{},inverse:y.program(5,l,a),fn:y.program(3,o,a),data:a}),(m||0===m)&&(g+=m),g+=' <div class="wizard-blocks-group form-group type-group"> ',m=n.each.call(t,t&&t.sectionTypes,{hash:{},inverse:y.noop,fn:y.programWithDepth(7,c,a,t),data:a}),(m||0===m)&&(g+=m),g+=' <label class="control-label"> <span class="control-error">'+v(i(1).call(t,"You must select a media type.",{hash:{},data:a}))+'</span> </label> </div> <div class="visible-once-section-type-chosen"> ',
m=n.if.call(t,t&&t.add,{hash:{},inverse:y.noop,fn:y.program(12,h,a),data:a}),(m||0===m)&&(g+=m),g+=' <div class="row"> <div class="col-md-7"> <div class="form-group title-group"> <div> <label for="edit-section-title" class="control-label"> '+v(i(1).call(t,"Name",{hash:{},data:a}))+' <span class="control-error">'+v(i(1).call(t,"A library name is required.",{hash:{},data:a}))+'</span> </label> </div> <input type="text" id="edit-section-title" name="title" class="form-control" value="'+v((m=t&&t.section,
m=null==m||m===!1?m:m.title,typeof m===b?m.apply(t):m))+'"> </div> </div> <div class="col-md-5"> <div class="form-group language-group"> <div> <label for="edit-section-language" class="control-label"> '+v(i(1).call(t,"Language",{hash:{},data:a}))+' <span class="control-error">'+v(i(1).call(t,"A language is required.",{hash:{},data:a}))+'</span> </label> </div> <select id="edit-section-language" name="language"></select> </div> </div> </div> <div class="row"> <div class="col-md-12"> <span class="text-muted"> ',
m=n.if.call(t,t&&t.updatedAt,{hash:{},inverse:y.program(16,f,a),fn:y.program(14,p,a),data:a}),(m||0===m)&&(g+=m),g+=" </span> </div> </div> </div> </form> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var i,s="";return s+=' <option value="'+p((i=e&&e.value,typeof i===h?i.apply(e):i))+'" ',i=n.if.call(e,e&&e.selected,{hash:{},inverse:f.noop,fn:f.program(2,o,t),data:t}),(i||0===i)&&(s+=i),s+=">"+p((i=e&&e.label,typeof i===h?i.apply(e):i))+"</option> ";
}function o(e,t){return"selected"}function l(e,t){var n="";return n+=' <option value="">'+p(i(1).call(e,"Loading...",{hash:{},data:t}))+"</option> "}function c(e,t){var i,n="";return n+=' <option value="'+p((i=e&&e.value,typeof i===h?i.apply(e):i))+'">'+p((i=e&&e.label,typeof i===h?i.apply(e):i))+"</option> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var u,d="",h="function",p=this.escapeExpression,f=this;return d+='<div class="row"> <div class="col-md-6"> <div class="form-group"> <label class="control-label" for="match-search-title">'+p(i(1).call(t,"Title",{
hash:{},data:a}))+'</label> <input type="text" id="match-search-title" name="title" class="form-control" value="'+p((u=t&&t.item,u=null==u||u===!1?u:u.title,typeof u===h?u.apply(t):u))+'"> </div> </div> <div class="col-md-6"> <div class="form-group"> <label class="control-label" for="match-search-agent">'+p(i(1).call(t,"Agent",{hash:{},data:a}))+'</label> <select id="match-search-agent" name="agent"> ',u=n.each.call(t,t&&t.agents,{hash:{},inverse:f.program(4,l,a),fn:f.program(1,r,a),data:a}),(u||0===u)&&(d+=u),
d+=' </select> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label class="control-label" for="match-search-year">'+p(i(1).call(t,"Year",{hash:{},data:a}))+'</label> <input type="text" id="match-search-year" name="year" class="form-control" value="'+p((u=t&&t.item,u=null==u||u===!1?u:u.year,typeof u===h?u.apply(t):u))+'"> </div> </div> <div class="col-md-6"> <div class="form-group"> <label class="control-label" for="match-search-language">'+p(i(1).call(t,"Language",{
hash:{},data:a}))+'</label> <select id="match-search-language" name="language"> ',u=n.each.call(t,t&&t.languages,{hash:{},inverse:f.program(4,l,a),fn:f.program(6,c,a),data:a}),(u||0===u)&&(d+=u),d+=" </select> </div> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){return this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{},'<div class="result-region"> <div class="loading loading-inline"></div> </div> '})},function(e,t,i){var n=i(3);
e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var i,s="";return s+=" ",i=n.if.call(e,e&&e.title,{hash:{},inverse:d.noop,fn:d.program(2,o,t),data:t}),(i||0===i)&&(s+=i),s+=" "}function o(e,t){var n,s="";return s+=' <li> <a class="card btn-gray ',n=i(10).call(e,e&&e.id,"all",{hash:{},inverse:d.noop,fn:d.program(3,l,t),data:t}),(n||0===n)&&(s+=n),s+='" data-id="'+p((n=e&&e.id,typeof n===h?n.apply(e):n))+'" href="#">'+p(i(1).call(e,e&&e.title,{hash:{},data:t}))+"</a> </li> "}function l(e,t){
return"selected"}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var c,u="",d=this,h="function",p=this.escapeExpression;return u+='<div class="col-sm-4 col-md-3"> <ul class="nav nav-cards"> ',c=n.each.call(t,t&&t.deviceTypes,{hash:{},inverse:d.noop,fn:d.program(1,r,a),data:a}),(c||0===c)&&(u+=c),u+=' </ul> </div> <div class="device-list-container col-sm-8 col-md-9"></div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],
n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<h3 class="invite-list-header top">'+o(i(1).call(t,"Invites",{hash:{},data:a}))+'</h3> <div class="invite-list-container"></div> <h3 class="friend-list-header">'+o(i(1).call(t,"Friends",{hash:{},data:a}))+'</h3> <div class="friend-list-container"></div> <h3 class="pending-list-header">'+o(i(1).call(t,"Pending",{hash:{},data:a}))+'</h3> <div class="pending-list-container"></div> </div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){
this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<h3 class="invite-list-header top">'+o(i(1).call(t,"Invites",{hash:{},data:a}))+'</h3> <div class="invite-list-container"></div> <h3 class="friend-list-header">'+o(i(1).call(t,"My Home",{hash:{},data:a}))+'</h3> <div class="friend-list-container"></div> <h3 class="pending-list-header">'+o(i(1).call(t,"Pending",{hash:{},data:a}))+'</h3> <div class="pending-list-container"></div> </div> '});
},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return"selected"}function o(e,t){return"hidden"}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var l,c="",u=this,d=this.escapeExpression;return c+='<ul class="nav nav-header pull-right"> <li class="web-nav-item"><a class="web-btn btn-gray ',l=i(10).call(t,t&&t.subset,"web",{hash:{},inverse:u.noop,fn:u.program(1,r,a),data:a}),(l||0===l)&&(c+=l),c+='" href="#!/settings/web">'+d(i(1).call(t,"Web",{
hash:{},data:a}))+'</a></li> <li class="server-nav-item ',l=n.unless.call(t,t&&t.hasPrimaryServer,{hash:{},inverse:u.noop,fn:u.program(3,o,a),data:a}),(l||0===l)&&(c+=l),c+='"><a class="server-btn btn-gray ',l=i(10).call(t,t&&t.subset,"server",{hash:{},inverse:u.noop,fn:u.program(1,r,a),data:a}),(l||0===l)&&(c+=l),c+='" href="#!/settings/server">'+d(i(1).call(t,"Server",{hash:{},data:a}))+'</a></li> <li class="users-nav-item ',l=n.unless.call(t,t&&t.signedIn,{hash:{},inverse:u.noop,fn:u.program(3,o,a),
data:a}),(l||0===l)&&(c+=l),c+='"><a class="users-btn btn-gray ',l=i(10).call(t,t&&t.subset,"users",{hash:{},inverse:u.noop,fn:u.program(1,r,a),data:a}),(l||0===l)&&(c+=l),c+='" href="#!/settings/users">'+d(i(1).call(t,"Users",{hash:{},data:a}))+'<span class="badge"></span></a></li> <li class="devices-nav-item ',l=n.unless.call(t,t&&t.signedIn,{hash:{},inverse:u.noop,fn:u.program(3,o,a),data:a}),(l||0===l)&&(c+=l),c+='"><a class="devices-btn btn-gray ',l=i(10).call(t,t&&t.subset,"devices",{hash:{},
inverse:u.noop,fn:u.program(1,r,a),data:a}),(l||0===l)&&(c+=l),c+='" href="#!/settings/devices">'+d(i(1).call(t,"Devices",{hash:{},data:a}))+"</a></li> </ul> <h2>"+d(i(1).call(t,"Settings",{hash:{},data:a}))+'</h2> <div class="settings-container"></div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return"hidden"}function o(e,t){return"selected"}function l(e,t){var n,s="";return s+=' <li> <a class="friends-card card btn-gray ',n=i(10).call(e,e&&e.subset,"friends",{
hash:{},inverse:d.noop,fn:d.program(3,o,t),data:t}),(n||0===n)&&(s+=n),s+='" href="#!/settings/users/friends"> <span class="badge"></span> '+h(i(1).call(e,"Friends",{hash:{},data:t}))+" </a> </li> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var c,u="",d=this,h=this.escapeExpression;return u+='<div class="filter-bar"> <div class="filter-bar-right"> <span class="user-actions ',c=n.unless.call(t,t&&t.showUserActions,{hash:{},inverse:d.noop,fn:d.program(1,r,a),data:a}),(c||0===c)&&(u+=c),
u+='"> <button class="add-user-btn btn btn-sm btn-default">'+h(i(1).call(t,"Add User",{hash:{},data:a}))+'</button> <button class="enable-guest-btn btn btn-sm btn-default ',c=n.unless.call(t,t&&t.showEnableGuest,{hash:{},inverse:d.noop,fn:d.program(1,r,a),data:a}),(c||0===c)&&(u+=c),u+='">'+h(i(1).call(t,"Enable Guest",{hash:{},data:a}))+'</button> <button class="disable-guest-btn btn btn-sm btn-danger ',c=n.unless.call(t,t&&t.showDisableGuest,{hash:{},inverse:d.noop,fn:d.program(1,r,a),data:a}),
(c||0===c)&&(u+=c),u+='">'+h(i(1).call(t,"Disable Guest",{hash:{},data:a}))+'</button> </span> <button class="leave-home-btn btn btn-sm btn-danger ',c=n.unless.call(t,t&&t.showLeaveHome,{hash:{},inverse:d.noop,fn:d.program(1,r,a),data:a}),(c||0===c)&&(u+=c),u+='">'+h(i(1).call(t,"Leave Home",{hash:{},data:a}))+'</button> <button class="invite-friend-btn btn btn-sm btn-default">'+h(i(1).call(t,"Invite Friend",{hash:{},data:a}))+'</button> </div> </div> <div class="users-row row"> <div class="col-sm-4 col-md-3"> <ul class="nav nav-cards"> <li> <a class="home-card card btn-gray ',
c=i(10).call(t,t&&t.subset,"home",{hash:{},inverse:d.noop,fn:d.program(3,o,a),data:a}),(c||0===c)&&(u+=c),u+='" href="#!/settings/users/home"> <span class="badge"></span> '+h(i(1).call(t,"My Home",{hash:{},data:a}))+" </a> </li> ",c=n.if.call(t,t&&t.showFriends,{hash:{},inverse:d.noop,fn:d.program(5,l,a),data:a}),(c||0===c)&&(u+=c),u+=" </ul> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t,n){var s,a="";return a+=' <option value="'+I((s=e&&e.value,
typeof s===A?s.apply(e):s))+'" ',s=i(10).call(e,e&&e.value,(s=n&&n.settings,null==s||s===!1?s:s.language),{hash:{},inverse:_.noop,fn:_.program(2,o,t),data:t}),(s||0===s)&&(a+=s),a+="> "+I((s=e&&e.title,typeof s===A?s.apply(e):s))+" </option> "}function o(e,t){return"selected"}function l(e,t){var s,a="";return a+=' <div class="form-group"> <label class="control-label"> <input type="checkbox" id="autoLogin" ',s=n.if.call(e,(s=e&&e.settings,null==s||s===!1?s:s.autoLogin),{hash:{},inverse:_.noop,fn:_.program(5,c,t),
data:t}),(s||0===s)&&(a+=s),a+="> "+I(i(1).call(e,"Automatically Sign In",{hash:{},data:t}))+' </label> <p class="help-block">'+I(i(1).call(e,"Do not prompt to select a user or enter a PIN during startup on this device.",{hash:{},data:t}))+"</p> </div> "}function c(e,t){return"checked"}function u(e,t,n){var s,a="";return a+=' <option value="'+I((s=e&&e.value,typeof s===A?s.apply(e):s))+'" ',s=i(10).call(e,e&&e.value,(s=n&&n.settings,null==s||s===!1?s:s.allowHttpFallback),{hash:{},inverse:_.noop,fn:_.program(2,o,t),
data:t}),(s||0===s)&&(a+=s),a+=">"+I(i(1).call(e,e&&e.title,{hash:{},data:t}))+"</option> "}function d(e,t,n){var s,a="";return a+=' <option value="'+I((s=e&&e.value,typeof s===A?s.apply(e):s))+'" ',s=i(10).call(e,e&&e.value,(s=n&&n.settings,null==s||s===!1?s:s.debugLevel),{hash:{},inverse:_.noop,fn:_.program(2,o,t),data:t}),(s||0===s)&&(a+=s),a+=">"+I(i(1).call(e,e&&e.title,{hash:{},data:t}))+"</option> "}function h(e,t){var s,a="";return a+=' <div class="form-group"> <label for="chromecastAppID">Chromecast Receiver</label> <select id="chromecastAppID"> ',
s=n.each.call(e,e&&e.chromecastAppIDs,{hash:{},inverse:_.noop,fn:_.programWithDepth(12,p,t,e),data:t}),(s||0===s)&&(a+=s),a+=' </select> <p class="help-block">Refresh after saving this setting for it to take effect.</p> </div> <div id="chromecast-custom-group" class="form-group ',s=i(36).call(e,(s=e&&e.settings,null==s||s===!1?s:s.chromecastAppID),"custom",{hash:{},inverse:_.noop,fn:_.program(14,f,t),data:t}),(s||0===s)&&(a+=s),a+='"> <label for="chromecastCustomAppID">Custom Chromecast Application ID</label> <input type="text" id="chromecastCustomAppID" class="form-control" placeholder="Application ID" value="'+I((s=e&&e.settings,
s=null==s||s===!1?s:s.chromecastCustomAppID,typeof s===A?s.apply(e):s))+'"> <p class="help-block">Refresh after saving this setting for it to take effect.</p> </div> <div class="form-group"> <label for="myPlexScheme">Plex.tv Scheme</label> <input type="text" id="myPlexScheme" class="form-control" placeholder="https" value="'+I((s=e&&e.settings,s=null==s||s===!1?s:s.myPlexScheme,typeof s===A?s.apply(e):s))+'"> </div> <div class="form-group"> <label for="myPlexUrl">Plex.tv Address</label> <input type="text" id="myPlexUrl" class="form-control" placeholder="plex.tv" value="'+I((s=e&&e.settings,
s=null==s||s===!1?s:s.myPlexUrl,typeof s===A?s.apply(e):s))+'"> </div> '}function p(e,t,n){var s,a="";return a+=' <option value="'+I((s=e&&e.value,typeof s===A?s.apply(e):s))+'" ',s=i(10).call(e,e&&e.value,(s=n&&n.settings,null==s||s===!1?s:s.chromecastAppID),{hash:{},inverse:_.noop,fn:_.program(2,o,t),data:t}),(s||0===s)&&(a+=s),a+=">"+I(i(1).call(e,e&&e.title,{hash:{},data:t}))+"</option> "}function f(e,t){return"hidden"}function m(e,t){var s,a="";return a+=' <li id="'+I((s=e&&e.id,typeof s===A?s.apply(e):s))+'" class="card card-sortable"> <div class="card-handle"><i class="glyphicon show-lines"></i></div> <label for="'+I((s=e&&e.enabledID,
typeof s===A?s.apply(e):s))+'"> <input type="checkbox" id="'+I((s=e&&e.enabledID,typeof s===A?s.apply(e):s))+'" ',s=n.if.call(e,e&&e.enabled,{hash:{},inverse:_.noop,fn:_.program(5,c,t),data:t}),(s||0===s)&&(a+=s),a+="> "+I(i(1).call(e,e&&e.title,{hash:{},data:t}))+" </label> </li> "}function g(e,t,n){var s,a="";return a+=' <option value="'+I((s=e&&e.index,typeof s===A?s.apply(e):s))+'" ',s=i(10).call(e,e&&e.index,(s=n&&n.settings,null==s||s===!1?s:s.localQuality),{hash:{},inverse:_.noop,fn:_.program(2,o,t),
data:t}),(s||0===s)&&(a+=s),a+="> "+I(i(58).call(e,e,{hash:{},data:t}))+" </option> "}function v(e,t,n){var s,a="";return a+=' <option value="'+I((s=e&&e.index,typeof s===A?s.apply(e):s))+'" ',s=i(10).call(e,e&&e.index,(s=n&&n.settings,null==s||s===!1?s:s.remoteQuality),{hash:{},inverse:_.noop,fn:_.program(2,o,t),data:t}),(s||0===s)&&(a+=s),a+="> "+I(i(58).call(e,e,{hash:{},data:t}))+" </option> "}function y(e,t,n){var s,a="";return a+=' <option value="'+I((s=e&&e.index,typeof s===A?s.apply(e):s))+'" ',
s=i(10).call(e,e&&e.index,(s=n&&n.settings,null==s||s===!1?s:s.channelQuality),{hash:{},inverse:_.noop,fn:_.program(2,o,t),data:t}),(s||0===s)&&(a+=s),a+="> "+I(i(58).call(e,e,{hash:{},data:t}))+" </option> "}function b(e,t){var s,a="";return a+=' <div class="form-group"> <label class="control-label"> <input type="checkbox" id="dash" ',s=n.if.call(e,(s=e&&e.settings,null==s||s===!1?s:s.dash),{hash:{},inverse:_.noop,fn:_.program(5,c,t),data:t}),(s||0===s)&&(a+=s),a+="> "+I(i(1).call(e,"HTML5 Player",{
hash:{},data:t}))+' </label> <p class="help-block">'+I(i(1).call(e,"Prefer the HTML5 video player over the Flash player.",{hash:{},data:t}))+"</p> </div> "}function w(e,t,n){var s,a="";return a+=' <option value="'+I((s=e&&e.value,typeof s===A?s.apply(e):s))+'" ',s=i(10).call(e,e&&e.value,(s=n&&n.settings,null==s||s===!1?s:s.audioBoost),{hash:{},inverse:_.noop,fn:_.program(2,o,t),data:t}),(s||0===s)&&(a+=s),a+=">"+I(i(1).call(e,e&&e.title,{hash:{},data:t}))+"</option> "}function x(e,t,n){var s,a="";
return a+=' <option value="'+I((s=e&&e.value,typeof s===A?s.apply(e):s))+'" ',s=i(10).call(e,e&&e.value,(s=n&&n.settings,null==s||s===!1?s:s.subtitleSize),{hash:{},inverse:_.noop,fn:_.program(2,o,t),data:t}),(s||0===s)&&(a+=s),a+=">"+I(i(1).call(e,e&&e.title,{hash:{},data:t}))+"</option> "}function S(e,t,n){var s,a="";return a+=' <option value="'+I((s=e&&e.value,typeof s===A?s.apply(e):s))+'" ',s=i(10).call(e,e&&e.value,(s=n&&n.settings,null==s||s===!1?s:s.subtitlesBurnLevel),{hash:{},inverse:_.noop,
fn:_.program(2,o,t),data:t}),(s||0===s)&&(a+=s),a+=">"+I(i(1).call(e,e&&e.title,{hash:{},data:t}))+"</option> "}function C(e,t,n){var s,a="";return a+=' <option value="'+I((s=e&&e.value,typeof s===A?s.apply(e):s))+'" ',s=i(10).call(e,e&&e.value,(s=n&&n.settings,null==s||s===!1?s:s.extrasPrefixCount),{hash:{},inverse:_.noop,fn:_.program(2,o,t),data:t}),(s||0===s)&&(a+=s),a+=">"+I(i(1).call(e,e&&e.title,{hash:{},data:t}))+"</option> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};
var k,P="",A="function",I=this.escapeExpression,_=this;return P+='<div class="filter-bar"> <button class="toggle-advanced-btn btn btn-sm btn-default pull-right basic-setting">'+I(i(1).call(t,"Show Advanced",{hash:{},data:a}))+'</button> <button class="toggle-advanced-btn btn btn-sm btn-default pull-right advanced-setting">'+I(i(1).call(t,"Hide Advanced",{hash:{},data:a}))+'</button> </div> <div class="row"> <div class="col-sm-4 col-md-3"> <ul class="settings-nav nav nav-cards"> <li><a class="card btn-gray selected" href="#general-web-group">'+I(i(1).call(t,"General",{
hash:{},data:a}))+'</a></li> <li class="advanced-setting"><a class="card btn-gray" href="#debug-web-group">'+I(i(1).call(t,"Debug",{hash:{},data:a}))+'</a></li> <li><a class="card btn-gray" href="#dashboard-web-group">'+I(i(1).call(t,"Dashboard",{hash:{},data:a}))+'</a></li> <li><a class="card btn-gray" href="#search-web-group">'+I(i(1).call(t,"Search",{hash:{},data:a}))+'</a></li> <li><a class="card btn-gray" href="#player-web-group">'+I(i(1).call(t,"Player",{hash:{},data:a}))+'</a></li> </ul> </div> <div class="col-sm-8 col-md-9"> <form id="web-settings-form"> <div id="general-web-group" class="settings-group active"> <h4 class="version-title"> '+I(i(1).call(t,"Version",{
hash:{},data:a}))+" "+I((k=t&&t.version,typeof k===A?k.apply(t):k))+' </h4> <div class="form-group"> <label for="language">'+I(i(1).call(t,"Language",{hash:{},data:a}))+'</label> <select id="language"> ',k=n.each.call(t,t&&t.languages,{hash:{},inverse:_.noop,fn:_.programWithDepth(1,r,a,t),data:a}),(k||0===k)&&(P+=k),P+=' </select> <p class="help-block">'+I(i(1).call(t,"Help us translate Plex/Web into your language {1}here{2}.",'<a href="https://getlocalization.com/plexweb" target="_blank">',"</a>",{
hash:{},data:a}))+"</p> </div> ",k=n.if.call(t,t&&t.hasHome,{hash:{},inverse:_.noop,fn:_.program(4,l,a),data:a}),(k||0===k)&&(P+=k),P+=' <div class="form-group"> <label class="control-label"> <input type="checkbox" id="playThemeMusic" ',k=n.if.call(t,(k=t&&t.settings,null==k||k===!1?k:k.playThemeMusic),{hash:{},inverse:_.noop,fn:_.program(5,c,a),data:a}),(k||0===k)&&(P+=k),P+="> "+I(i(1).call(t,"Play Theme Music",{hash:{},data:a}))+' </label> <p class="help-block">'+I(i(1).call(t,"Automatically play theme music in the background when available.",{
hash:{},data:a}))+'</p> </div> <div class="form-group"> <label class="control-label"> <input type="checkbox" id="showUnwatchedIcons" ',k=n.if.call(t,(k=t&&t.settings,null==k||k===!1?k:k.showUnwatchedIcons),{hash:{},inverse:_.noop,fn:_.program(5,c,a),data:a}),(k||0===k)&&(P+=k),P+="> "+I(i(1).call(t,"Show Unwatched Icons",{hash:{},data:a}))+' </label> <p class="help-block">'+I(i(1).call(t,"Show unwatched icons in list items.",{hash:{},data:a}))+'</p> </div> <div class="form-group"> <label class="control-label"> <input type="checkbox" id="keyboardShortcuts" ',
k=n.if.call(t,(k=t&&t.settings,null==k||k===!1?k:k.keyboardShortcuts),{hash:{},inverse:_.noop,fn:_.program(5,c,a),data:a}),(k||0===k)&&(P+=k),P+="> "+I(i(1).call(t,"Enable Keyboard Shortcuts",{hash:{},data:a}))+' </label> <p class="help-block">'+I(i(1).call(t,"Press ? to view the list of {1}available shortcuts{2}.",'<a class="keyboard-shortcuts-btn" href="#">',"</a>",{hash:{},data:a}))+'</p> </div> <div class="form-group"> <label for="allowHttpFallback">'+I(i(1).call(t,"Allow Fallback to Insecure Connections",{
hash:{},data:a}))+'</label> <select id="allowHttpFallback"> ',k=n.each.call(t,t&&t.httpFallbackOptions,{hash:{},inverse:_.noop,fn:_.programWithDepth(7,u,a,t),data:a}),(k||0===k)&&(P+=k),P+=' </select> <p class="help-block">'+I(i(1).call(t,"Allow this browser to make insecure connections to Plex Media Server if secure connections fail.",{hash:{},data:a}))+'</p> </div> </div> <div id="debug-web-group" class="settings-group"> <div class="form-group"> <label for="debugLevel">'+I(i(1).call(t,"Debug Level",{
hash:{},data:a}))+'</label> <select id="debugLevel" data-type="int"> ',k=n.each.call(t,t&&t.debugLevels,{hash:{},inverse:_.noop,fn:_.programWithDepth(9,d,a,t),data:a}),(k||0===k)&&(P+=k),P+=' </select> <p class="help-block">'+I(i(1).call(t,"You can view the debug logs {1}here{2}.",'<a href="#!/logs">',"</a>",{hash:{},data:a}))+"</p> </div> ",k=n.if.call(t,t&&t.isNinja,{hash:{},inverse:_.noop,fn:_.program(11,h,a),data:a}),(k||0===k)&&(P+=k),P+=' </div> <div id="dashboard-web-group" class="settings-group"> <p class="help-block sortable-help-block">'+I(i(1).call(t,"Drag the items below to reorder your dashboard content.",{
hash:{},data:a}))+'</p> <ul class="list dashboard-list"> ',k=n.each.call(t,t&&t.dashboardPriorities,{hash:{},inverse:_.noop,fn:_.program(16,m,a),data:a}),(k||0===k)&&(P+=k),P+=' </ul> </div> <div id="search-web-group" class="settings-group"> <div class="form-group"> <label class="control-label"> <input type="checkbox" id="sharedSearch" ',k=n.if.call(t,(k=t&&t.settings,null==k||k===!1?k:k.sharedSearch),{hash:{},inverse:_.noop,fn:_.program(5,c,a),data:a}),(k||0===k)&&(P+=k),P+="> "+I(i(1).call(t,"Search Shared Libraries",{
hash:{},data:a}))+' </label> <p class="help-block">'+I(i(1).call(t,"Allow searching libraries that have been shared with you.",{hash:{},data:a}))+'</p> </div> <div class="form-group"> <label class="control-label"> <input type="checkbox" id="channelSearch" ',k=n.if.call(t,(k=t&&t.settings,null==k||k===!1?k:k.channelSearch),{hash:{},inverse:_.noop,fn:_.program(5,c,a),data:a}),(k||0===k)&&(P+=k),P+="> "+I(i(1).call(t,"Search Channels",{hash:{},data:a}))+' </label> <p class="help-block">'+I(i(1).call(t,"Allow searching channels that have enabled search.",{
hash:{},data:a}))+'</p> </div> </div> <div id="player-web-group" class="settings-group"> <h4 class="settings-header">'+I(i(1).call(t,"Streaming Quality",{hash:{},data:a}))+'</h4> <div class="form-group"> <label for="localQuality">'+I(i(1).call(t,"Local Quality",{hash:{},data:a}))+'</label> <select id="localQuality" data-type="int"> <option value="-1">'+I(i(1).call(t,"Original",{hash:{},data:a}))+"</option> ",k=n.each.call(t,t&&t.availableQualities,{hash:{},inverse:_.noop,fn:_.programWithDepth(18,g,a,t),
data:a}),(k||0===k)&&(P+=k),P+=' </select> </div> <div class="form-group"> <label for="remoteQuality">'+I(i(1).call(t,"Remote Quality",{hash:{},data:a}))+'</label> <select id="remoteQuality" data-type="int"> <option value="-1">'+I(i(1).call(t,"Original",{hash:{},data:a}))+"</option> ",k=n.each.call(t,t&&t.availableQualities,{hash:{},inverse:_.noop,fn:_.programWithDepth(20,v,a,t),data:a}),(k||0===k)&&(P+=k),P+=' </select> </div> <div class="form-group"> <label for="channelQuality">'+I(i(1).call(t,"Online Quality",{
hash:{},data:a}))+'</label> <select id="channelQuality" data-type="int"> <option value="-1">'+I(i(1).call(t,"Original",{hash:{},data:a}))+"</option> ",k=n.each.call(t,t&&t.availableQualities,{hash:{},inverse:_.noop,fn:_.programWithDepth(22,y,a,t),data:a}),(k||0===k)&&(P+=k),P+=" </select> </div> ",k=n.if.call(t,t&&t.showExperimentalPlayer,{hash:{},inverse:_.noop,fn:_.program(24,b,a),data:a}),(k||0===k)&&(P+=k),P+=' <div class="form-group advanced-setting"> <label class="control-label"> <input type="checkbox" id="directPlay" ',
k=n.if.call(t,(k=t&&t.settings,null==k||k===!1?k:k.directPlay),{hash:{},inverse:_.noop,fn:_.program(5,c,a),data:a}),(k||0===k)&&(P+=k),P+="> "+I(i(1).call(t,"Direct Play",{hash:{},data:a}))+' </label> <p class="help-block">'+I(i(1).call(t,"Allows the player to play compatible media without any conversion. In most browsers, direct play supports MP4 videos with h264 video and AAC audio. Videos with subtitles cannot be played directly.",{hash:{},data:a}))+'</p> </div> <div class="form-group advanced-setting"> <label class="control-label"> <input type="checkbox" id="directStream" ',
k=n.if.call(t,(k=t&&t.settings,null==k||k===!1?k:k.directStream),{hash:{},inverse:_.noop,fn:_.program(5,c,a),data:a}),(k||0===k)&&(P+=k),P+="> "+I(i(1).call(t,"Direct Stream",{hash:{},data:a}))+' </label> <p class="help-block">'+I(i(1).call(t,"Allows the server to copy compatible audio and video streams without converting them.",{hash:{},data:a}))+'</p> </div> <h4 class="settings-header">'+I(i(1).call(t,"Audio & Subtitles",{hash:{},data:a}))+'</h4> <div class="form-group advanced-setting"> <label class="control-label"> <input type="checkbox" id="allowAC3" ',
k=n.if.call(t,(k=t&&t.settings,null==k||k===!1?k:k.allowAC3),{hash:{},inverse:_.noop,fn:_.program(5,c,a),data:a}),(k||0===k)&&(P+=k),P+="> "+I(i(1).call(t,"Allow Direct Play of AC3 Audio",{hash:{},data:a}))+' </label> <p class="help-block">'+I(i(1).call(t,"Allow MP4 videos with AC3 audio to be played directly. Browser support for AC3 audio is limited.",{hash:{},data:a}))+'</p> </div> <div class="form-group advanced-setting"> <label class="control-label"> <input type="checkbox" id="preferAAC" ',k=n.if.call(t,(k=t&&t.settings,
null==k||k===!1?k:k.preferAAC),{hash:{},inverse:_.noop,fn:_.program(5,c,a),data:a}),(k||0===k)&&(P+=k),P+="> "+I(i(1).call(t,"Prefer AAC Audio",{hash:{},data:a}))+' </label> <p class="help-block">'+I(i(1).call(t,"Prefer AAC over MP3 when transcoding audio. Some devices, like the Wii U, only support HLS with AAC audio.",{hash:{},data:a}))+'</p> </div> <div class="form-group"> <label for="audioBoost">'+I(i(1).call(t,"Multi-Channel Audio Boost",{hash:{},data:a}))+'</label> <select id="audioBoost" data-type="int"> ',
k=n.each.call(t,t&&t.audioBoostLevels,{hash:{},inverse:_.noop,fn:_.programWithDepth(26,w,a,t),data:a}),(k||0===k)&&(P+=k),P+=' </select> <p class="help-block">'+I(i(1).call(t,"Boost volume when converting multi-channel audio to stereo.",{hash:{},data:a}))+'</p> </div> <div class="form-group"> <label for="subtitleSize">'+I(i(1).call(t,"Subtitle Size",{hash:{},data:a}))+'</label> <select id="subtitleSize" data-type="int"> ',k=n.each.call(t,t&&t.subtitleSizes,{hash:{},inverse:_.noop,fn:_.programWithDepth(28,x,a,t),
data:a}),(k||0===k)&&(P+=k),P+=' </select> </div> <div class="form-group"> <label for="subtitlesBurnLevel">'+I(i(1).call(t,"Burn Subtitles",{hash:{},data:a}))+'</label> <select id="subtitlesBurnLevel"> ',k=n.each.call(t,t&&t.subtitlesBurnLevels,{hash:{},inverse:_.noop,fn:_.programWithDepth(30,S,a,t),data:a}),(k||0===k)&&(P+=k),P+=' </select> <p class="help-block">'+I(i(1).call(t,"Determines if the server should burn in subtitles when converting video depending on the subtitles format. Avoiding burn in improves server performance and is only supported by the HTML5 player.",{
hash:{},data:a}))+'</p> </div> <h4 class="settings-header">'+I(i(1).call(t,"Extras",{hash:{},data:a}))+'</h4> <div class="form-group"> <label for="extrasPrefixCount">'+I(i(1).call(t,"Cinema Trailers to Play Before Movies",{hash:{},data:a}))+'</label> <select id="extrasPrefixCount" data-type="int"> ',k=n.each.call(t,t&&t.extrasPrefixCounts,{hash:{},inverse:_.noop,fn:_.programWithDepth(32,C,a,t),data:a}),(k||0===k)&&(P+=k),P+=' </select> </div> </div> <div class="form-footer"> <button type="submit" class="submit-btn btn btn-lg btn-primary btn-loading disabled"> <div class="loading loading-sm"></div> <span class="btn-label">'+I(i(1).call(t,"Save Changes",{
hash:{},data:a}))+'</span> </button> <span class="form-message"></span> </div> </form> </div> </div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t,n){var s,a="";return a+=' <li class="',s=i(10).call(e,(s=n&&n.currentType,null==s||s===!1?s:s.id),e&&e.id,{hash:{},inverse:u.noop,fn:u.program(2,o,t),data:t}),(s||0===s)&&(a+=s),a+='"> <a class="btn-gray" data-type="'+h((s=e&&e.typeString,typeof s===d?s.apply(e):s))+'" href="#">'+h(i(1).call(e,e&&e.plural,{
hash:{},data:t}))+"</a> </li> "}function o(e,t){return"active"}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var l,c="",u=this,d="function",h=this.escapeExpression;return c+='<ul class="agent-types-nav nav nav-pills"> ',l=n.each.call(t,t&&t.agentTypes,{hash:{},inverse:u.noop,fn:u.programWithDepth(1,r,a,t),data:a}),(l||0===l)&&(c+=l),c+=' </ul> <div class="agents-list-container"></div> <p class="help-block sortable-help-block">'+h(i(1).call(t,"Select which additional agents should contribute to metadata from {1}, and drag them to change the order of preference.",'<span class="agent-label"></span>',{
hash:{},data:a}))+'</p> <div class="contributors-list-container"></div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var n="";return n+=" "+c(i(13).call(e,"setting",{hash:{idSuffix:"_c"},data:t}))+" "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var o,l="",c=this.escapeExpression,u=this;return l+='<div class="sign-in-region"></div> <hr> <form id="server-settings-form"> <div class="form-group"> <h4 class="version-header"><span class="version"></span> <span class="update-region"></span></h4> </div> ',
o=n.each.call(t,t,{hash:{},inverse:u.noop,fn:u.program(1,r,a),data:a}),(o||0===o)&&(l+=o),l+=' <div class="form-footer"> <button type="submit" class="submit-btn btn btn-lg btn-primary btn-loading disabled"> <div class="loading loading-sm"></div> <span class="btn-label">'+c(i(1).call(t,"Save Changes",{hash:{},data:a}))+'</span> </button> <span class="form-message"></span> </div> </form> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],
n=this.merge(n,e.helpers),a=a||{};var r,o="",l="function",c=this.escapeExpression;return o+='<a class="card btn-gray" href="#" data-group="'+c((r=t&&t.id,typeof r===l?r.apply(t):r))+'"> <span class="modal-nav-icon"> <i class="server-settings-status-icon unknown glyphicon circle-question-mark"></i> <i class="server-settings-status-icon error glyphicon circle-exclamation-mark"></i> <i class="server-settings-status-icon success glyphicon circle-ok"></i> </span> '+c(i(1).call(t,t&&t.title,{hash:{},data:a
}))+" </a> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var n="";return n+=" "+c(i(13).call(e,"setting",{hash:{idSuffix:"_c"},data:t}))+" "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var o,l="",c=this.escapeExpression,u=this;return l+='<form id="server-settings-form"> ',o=n.each.call(t,t,{hash:{},inverse:u.noop,fn:u.program(1,r,a),data:a}),(o||0===o)&&(l+=o),l+=' <div class="form-footer"> <button type="submit" class="submit-btn btn btn-lg btn-primary btn-loading disabled"> <div class="loading loading-sm"></div> <span class="btn-label">'+c(i(1).call(t,"Save Changes",{
hash:{},data:a}))+'</span> </button> <span class="form-message"></span> </div> </form> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var n="";return n+=' <h4 class="status-header status-header-single"> <span class="loading loading-sm"></span> '+R(i(1).call(e,"Connecting server...",{hash:{},data:t}))+" </h4> "}function o(e,t){var n;return n=i(10).call(e,(n=e&&e.cloudAccount,null==n||n===!1?n:n.remoteAccessState),"disconnecting",{hash:{},inverse:O.program(6,c,t),
fn:O.program(4,l,t),data:t}),n||0===n?n:""}function l(e,t){var n="";return n+=' <h4 class="status-header status-header-single"> <span class="loading loading-sm"></span> '+R(i(1).call(e,"Disconnecting server...",{hash:{},data:t}))+" </h4> "}function c(e,t){var i;return i=n.if.call(e,e&&e.isUnavailable,{hash:{},inverse:O.program(12,p,t),fn:O.program(7,u,t),data:t}),i||0===i?i:""}function u(e,t){var s,a="";return a+=' <h4 class="status-header text-danger">'+R(i(1).call(e,"Not available outside your network",{
hash:{},data:t}))+"</h4> ",s=n.if.call(e,e&&e.isSignedOut,{hash:{},inverse:O.program(10,h,t),fn:O.program(8,d,t),data:t}),(s||0===s)&&(a+=s),a+=" "}function d(e,t){var n="";return n+=' <span class="status-description help-block">'+R(i(1).call(e,"First {1}sign in{2} to access your server from anywhere.",'<a class="sign-in-link" href="#">',"</a>",{hash:{},data:t}))+"</span> "}function h(e,t){var n="";return n+=' <span class="status-description help-block">'+R(i(1).call(e,"Enable to access your server from anywhere.",{
hash:{},data:t}))+'</span> <button class="remote-access-enable-btn btn btn-sm btn-primary">'+R(i(1).call(e,"Enable Remote Access",{hash:{},data:t}))+"</button> "}function p(e,t){var s,a="";return a+=" ",s=i(10).call(e,(s=e&&e.cloudAccount,null==s||s===!1?s:s.remoteAccessState),"unreachable",{hash:{},inverse:O.program(15,m,t),fn:O.program(13,f,t),data:t}),(s||0===s)&&(a+=s),a+=' <button class="remote-access-disable-btn btn btn-sm btn-default">'+R(i(1).call(e,"Disable Remote Access",{hash:{},data:t
}))+"</button> ",s=n.if.call(e,(s=e&&e.mappingModeSetting,null==s||s===!1?s:s.value),{hash:{},inverse:O.noop,fn:O.program(17,g,t),data:t}),(s||0===s)&&(a+=s),a+=" "}function f(e,t){var n="";return n+=' <h4 class="status-header text-danger">'+R(i(1).call(e,"Not available outside your network",{hash:{},data:t}))+'</h4> <span class="unreachable-description status-description help-block">'+R(i(1).call(e,"Your server is signed in to Plex, but is not reachable from outside your network. {1}Learn more{2}",'<a href="https://support.plex.tv/hc/en-us/articles/200484543-Connecting-a-Server" target="_blank">',"</a>",{
hash:{},data:t}))+"</span> "}function m(e,t){var n="";return n+=' <h4 class="status-header status-header-single text-success">'+R(i(1).call(e,"Fully accessible outside your network",{hash:{},data:t}))+"</h4> "}function g(e,t){var n="";return n+=' <p class="remote-access-disable-message help-block"> <i class="remote-access-disable-warning-icon glyphicon circle-exclamation-mark"></i> '+R(i(1).call(e,"You currently have Remote Access enabled through a manually-specified port. If you wish to disable Remote Access, you will need to remove your manual port forwarding from your router.",{
hash:{},data:t}))+" </p> "}function v(e,t){var n,s="";return s+=" ",n=i(36).call(e,(n=e&&e.cloudAccount,null==n||n===!1?n:n.remoteAccessState),"disconnecting",{hash:{},inverse:O.noop,fn:O.program(20,y,t),data:t}),(n||0===n)&&(s+=n),s+=" "}function y(e,t){var s,a="";return a+=' <div class="remote-access-advanced"> <div class="remote-access-mapping-container ',s=n.unless.call(e,(s=e&&e.cloudAccount,null==s||s===!1?s:s.mappingError),{hash:{},inverse:O.noop,fn:O.program(21,b,t),data:t}),(s||0===s)&&(a+=s),
a+='"> <hr> <h4 class="mapping-header">'+R(i(1).call(e,"Server Mapping",{hash:{},data:t}))+'</h4> <i class="plex-image server server-xs server-logo"></i> <div class="remote-access-mapping"> <span class="mapping-label text-muted">'+R(i(1).call(e,"Private",{hash:{},data:t}))+'</span> <span class="mapping-address"> ',s=n.if.call(e,e&&e.hasPrivateAddress,{hash:{},inverse:O.program(25,x,t),fn:O.program(23,w,t),data:t}),(s||0===s)&&(a+=s),a+=" </span> ",s=n.if.call(e,e&&e.hasPublicAddress,{hash:{},inverse:O.program(29,C,t),
fn:O.program(27,S,t),data:t}),(s||0===s)&&(a+=s),a+=' <span class="mapping-label text-muted">'+R(i(1).call(e,"Public",{hash:{},data:t}))+'</span> <span class="mapping-address"> ',s=n.if.call(e,e&&e.hasPublicAddress,{hash:{},inverse:O.program(25,x,t),fn:O.program(31,k,t),data:t}),(s||0===s)&&(a+=s),a+=" </span> ",s=i(10).call(e,(s=e&&e.cloudAccount,null==s||s===!1?s:s.remoteAccessState),"ok",{hash:{},inverse:O.program(29,C,t),fn:O.program(27,S,t),data:t}),(s||0===s)&&(a+=s),a+=' <span class="mapping-internet ',
s=i(36).call(e,(s=e&&e.cloudAccount,null==s||s===!1?s:s.remoteAccessState),"ok",{hash:{},inverse:O.noop,fn:O.program(33,P,t),data:t}),(s||0===s)&&(a+=s),a+='"> <i class="mapping-internet-icon glyphicon globe text-muted"></i> '+R(i(1).call(e,"Internet",{hash:{},data:t}))+" </span> </div> </div> ",s=n.if.call(e,e&&e.hasMappingSettings,{hash:{},inverse:O.noop,fn:O.program(35,A,t),data:t}),(s||0===s)&&(a+=s),a+=" </div> "}function b(e,t){return"advanced-setting"}function w(e,t){var n,s="";return s+=' <span class="mapping-value">'+R((n=e&&e.cloudAccount,
n=null==n||n===!1?n:n.privateAddress,typeof n===L?n.apply(e):n))+'</span> <span class="mapping-separator text-muted">'+R(i(1).call(e,":",{hash:{},data:t}))+'</span> <span class="mapping-value">'+R((n=e&&e.cloudAccount,n=null==n||n===!1?n:n.privatePort,typeof n===L?n.apply(e):n))+"</span> "}function x(e,t){var n="";return n+=' <span class="mapping-empty-value">'+R(i(1).call(e,"Unknown IP",{hash:{},data:t}))+"</span> "}function S(e,t){return' <i class="mapping-icon glyphicon left-arrow text-success"></i> ';
}function C(e,t){return' <i class="mapping-icon glyphicon remove-2 text-danger"></i> '}function k(e,t){var n,s="";return s+=' <span class="mapping-value">'+R((n=e&&e.cloudAccount,n=null==n||n===!1?n:n.publicAddress,typeof n===L?n.apply(e):n))+'</span> <span class="mapping-separator text-muted">'+R(i(1).call(e,":",{hash:{},data:t}))+'</span> <span class="mapping-value">'+R((n=e&&e.cloudAccount,n=null==n||n===!1?n:n.publicPort,typeof n===L?n.apply(e):n))+"</span> "}function P(e,t){return"unreachable";
}function A(e,t){var s,a="";return a+=' <div class="remote-access-error-container ',s=n.unless.call(e,(s=e&&e.cloudAccount,null==s||s===!1?s:s.mappingError),{hash:{},inverse:O.noop,fn:O.program(21,b,t),data:t}),(s||0===s)&&(a+=s),a+='"> <div class="form-inline"> <div class="checkbox"> <label> <input type="checkbox" id="'+R((s=e&&e.mappingModeSetting,s=null==s||s===!1?s:s.id,typeof s===L?s.apply(e):s))+'" name="'+R((s=e&&e.mappingModeSetting,s=null==s||s===!1?s:s.id,typeof s===L?s.apply(e):s))+'" value="1" ',
s=n.if.call(e,(s=e&&e.mappingModeSetting,null==s||s===!1?s:s.value),{hash:{},inverse:O.noop,fn:O.program(36,I,t),data:t}),(s||0===s)&&(a+=s),a+="> "+R(i(1).call(e,"Manually specify port",{hash:{},data:t}))+' </label> </div> <div class="form-group"> <input type="text" id="'+R((s=e&&e.mappingPortSetting,s=null==s||s===!1?s:s.id,typeof s===L?s.apply(e):s))+'" name="'+R((s=e&&e.mappingPortSetting,s=null==s||s===!1?s:s.id,typeof s===L?s.apply(e):s))+'" class="form-control" value="'+R((s=e&&e.mappingPortSetting,
s=null==s||s===!1?s:s.value,typeof s===L?s.apply(e):s))+'" ',s=n.unless.call(e,(s=e&&e.mappingModeSetting,null==s||s===!1?s:s.value),{hash:{},inverse:O.noop,fn:O.program(38,_,t),data:t}),(s||0===s)&&(a+=s),a+='> </div> <button class="retry-btn btn btn-primary btn-loading"> <div class="loading loading-sm"></div> <span class="btn-label">',s=i(10).call(e,(s=e&&e.cloudAccount,null==s||s===!1?s:s.remoteAccessState),"unreachable",{hash:{},inverse:O.program(42,D,t),fn:O.program(40,T,t),data:t}),(s||0===s)&&(a+=s),
a+='</span> </button> </div> <p class="help-block">'+R(i(1).call(e,"You may need to enable this to establish a direct connection from outside your network. You may also need to configure your router. Detailed instructions are available {1}here{2}.",'<a href="http://support.plex.tv/hc/en-us/articles/200931138-Troubleshooting-myPlex-Server-connections" target="_blank">',"</a>",{hash:{},data:t}))+"</p> </div> "}function I(e,t){return"checked"}function _(e,t){return"disabled"}function T(e,t){return R(i(1).call(e,"Retry",{
hash:{},data:t}))}function D(e,t){return R(i(1).call(e,"Apply",{hash:{},data:t}))}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var E,M="",R=this.escapeExpression,O=this,L="function";return M+='<i class="remote-access-status-icon glyphicon globe"></i> <div class="remote-access-status-message"> ',E=i(10).call(t,(E=t&&t.cloudAccount,null==E||E===!1?E:E.remoteAccessState),"connecting",{hash:{},inverse:O.program(3,o,a),fn:O.program(1,r,a),data:a}),(E||0===E)&&(M+=E),M+=" </div> ",
E=i(36).call(t,(E=t&&t.cloudAccount,null==E||E===!1?E:E.remoteAccessState),"connecting",{hash:{},inverse:O.noop,fn:O.program(19,v,a),data:a}),(E||0===E)&&(M+=E),M+=" "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<div class="server-account-poster user-poster img-circle placeholder-friend"></div> <div class="server-account-info"> <div class="server-account-user"> <div class="server-account-label">'+o(i(1).call(t,"Server signed in as",{
hash:{},data:a}))+'</div> <div class="server-account-username"></div> </div> <button class="server-sign-out-btn btn btn-default btn-loading"> <div class="loading loading-sm"></div> <span class="btn-label">'+o(i(1).call(t,"Sign Out",{hash:{},data:a}))+'</span> </button> </div> <form id="server-sign-in-form" class="form-inline"> <div class="form-group"> <input type="text" class="form-control" name="username" placeholder="'+o(i(1).call(t,"Username or email",{hash:{},data:a}))+'" autocorrect="off" autocapitalize="off"> </div> <div class="form-group"> <input type="password" class="form-control" name="password" placeholder="'+o(i(1).call(t,"Password",{
hash:{},data:a}))+'"> </div> <button type="submit" class="server-sign-in-btn btn btn-primary btn-loading"> <div class="loading loading-sm"></div> <span class="btn-label">'+o(i(1).call(t,"Sign In",{hash:{},data:a}))+'</span> </button> <p class="help-block">'+o(i(1).call(t,"Sign in with your Plex account to help your devices find this server, access your media remotely, and more. {1}Learn more{2}",'<a href="https://support.plex.tv/hc/en-us/articles/200484543-Connecting-a-Server">',"</a>",{hash:{},data:a
}))+"</p> </form> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){return"active"}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var o,l="",c=this,u=this.escapeExpression;return l+='<a href="#" class="check-for-updates-btn label label-btn label-primary ',o=n.unless.call(t,t&&t.canCheckForUpdate,{hash:{},inverse:c.noop,fn:c.program(1,r,a),data:a}),(o||0===o)&&(l+=o),l+='"> <i class="label-icon glyphicon upload"></i> '+u(i(1).call(t,"Check for Updates",{
hash:{},data:a}))+' </a> <a href="#" class="checking-for-updates-btn label label-btn label-primary active"> <i class="label-icon glyphicon upload"></i> '+u(i(1).call(t,"Checking for Updates",{hash:{},data:a}))+' </a> <a href="#" class="available-updates-btn label label-btn label-primary"> <i class="label-icon glyphicon download"></i> '+u(i(1).call(t,"Download Updates",{hash:{},data:a}))+' </a> <span class="downloading-updates-container label label-btn label-progress active"> <i class="label-icon glyphicon download"></i> '+u(i(1).call(t,"Downloading Update",{
hash:{},data:a}))+' <span class="downloading-progress-container hidden">(<span class="downloading-progress-label"></span>%)</span ></span> <a href="#" class="install-updates-btn label label-btn label-primary"> <i class="label-icon glyphicon download"></i> '+u(i(1).call(t,"Install Update",{hash:{},data:a}))+' </a> <a href="#" class="installing-updates-btn label label-btn label-primary active"> <i class="label-icon glyphicon upload"></i> '+u(i(1).call(t,"Installing",{hash:{},data:a}))+' </a> <span class="install-info-label up-to-date-label"> <i class="success-icon glyphicon ok-2"></i> '+u(i(1).call(t,"Up to date",{
hash:{},data:a}))+' </span> <span class="install-info-label install-error-label"> <i class="failure-icon glyphicon circle-exclamation-mark"></i> <span class="update-error-message"></span> <a class="install-manual-link" href="https://plex.tv/downloads" target="_blank">'+u(i(1).call(t,"Please install manually.",{hash:{},data:a}))+'</a> </span> <a href="#" class="release-notes-btn label label-btn label-default"> <i class="label-icon glyphicon circle-info"></i> '+u(i(1).call(t,"What's New",{hash:{},data:a
}))+" </a> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var n="";return n+=" "+h(i(1).call(e,"Optimized Versions requires Plex Media Server {1} or later.",e&&e.minServerVersion,{hash:{},data:t}))+" "}function o(e,t){var i;return i=n.if.call(e,e&&e.isTranscoderRequired,{hash:{},inverse:p.program(6,c,t),fn:p.program(4,l,t),data:t}),i||0===i?i:""}function l(e,t){var n="";return n+=" "+h(i(1).call(e,"This Plex Media Server platform is not capable of converting video.",{
hash:{},data:t}))+" "}function c(e,t){var n="";return n+=" "+h(i(1).call(e,"There was a problem requesting media versions from this server.",{hash:{},data:t}))+" "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var u,d="",h=this.escapeExpression,p=this;return d+='<div class="row row-padded"> <h4 class="text-muted text-center"> ',u=n.if.call(t,t&&t.isUpgradeRequired,{hash:{},inverse:p.program(3,o,a),fn:p.program(1,r,a),data:a}),(u||0===u)&&(d+=u),d+=" </h4> </div> "})},function(e,t,i){
var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<p class="versions-status-message hidden"> <button class="delete-all-btn btn btn-sm btn-danger pull-right">'+o(i(1).call(t,"Delete All Versions",{hash:{},data:a}))+"</button> "+o(i(1).call(t,"Monitor conversion progress in {1}Conversion Activity{2}.",'<a href="#!/activity/conversion">',"</a>",{hash:{},data:a}))+' </p> <div class="background-processing-list-region"></div> ';
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var n="";return n+=' <div class="filter-bar-right"> <button class="toggle-advanced-btn btn btn-sm btn-default basic-setting">'+c(i(1).call(e,"Show Advanced",{hash:{},data:t}))+'</button> <button class="toggle-advanced-btn btn btn-sm btn-default advanced-setting">'+c(i(1).call(e,"Hide Advanced",{hash:{},data:t}))+"</button> </div> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};
var o,l="",c=this.escapeExpression,u=this;return l+='<div class="filter-bar"> ',o=n.unless.call(t,t&&t.shared,{hash:{},inverse:u.noop,fn:u.program(1,r,a),data:a}),(o||0===o)&&(l+=o),l+=' </div> <div class="settings-row row"> <div class="nav-region col-sm-4 col-md-3"></div> <div class="pane-region col-sm-8 col-md-9"></div> </div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var n,s="";return s+=' <p class="setup-basic-help text-muted"> '+h(i(1).call(e,"Let's start by giving your Plex Media Server a friendly name so it can identify itself to other computers on the network. If you leave it blank, your computer name will be used.",{
hash:{},data:t}))+' </p> <div class="form-group"> <label for="'+h((n=e&&e.friendlyNameSetting,n=null==n||n===!1?n:n.id,typeof n===p?n.apply(e):n))+'">'+h((n=e&&e.friendlyNameSetting,n=null==n||n===!1?n:n.label,typeof n===p?n.apply(e):n))+'</label> <input type="text" id="'+h((n=e&&e.friendlyNameSetting,n=null==n||n===!1?n:n.id,typeof n===p?n.apply(e):n))+'" class="form-control" value="'+h((n=e&&e.friendlyNameSetting,n=null==n||n===!1?n:n.value,typeof n===p?n.apply(e):n))+'" placeholder="'+h((n=e&&e.server,
n=null==n||n===!1?n:n.name,typeof n===p?n.apply(e):n))+'"> </div> '}function o(e,t){var n="";return n+=' <p class="setup-basic-help text-muted"> '+h(i(1).call(e,"Connecting your server to Plex allows you to stream media outside your home network.",{hash:{},data:t}))+' </p> <div class="checkbox"> <label for="connect"> <input type="checkbox" id="connect" checked> '+h(i(1).call(e,"Connect to Plex",{hash:{},data:t}))+" </label> </div> "}function l(e,t){var s,a="";return a+=' <p class="setup-basic-help text-muted"> '+h(i(1).call(e,"Would you like to help us make Plex better for everyone? We collect anonymous data, which we use to improve the service over time.",{
hash:{},data:t}))+' </p> <div class="checkbox"> <label for="'+h((s=e&&e.collectUsageDataSetting,s=null==s||s===!1?s:s.id,typeof s===p?s.apply(e):s))+'"> <input type="checkbox" id="'+h((s=e&&e.collectUsageDataSetting,s=null==s||s===!1?s:s.id,typeof s===p?s.apply(e):s))+'" name="'+h((s=e&&e.collectUsageDataSetting,s=null==s||s===!1?s:s.id,typeof s===p?s.apply(e):s))+'" value="1" ',s=n.if.call(e,(s=e&&e.collectUsageDataSetting,null==s||s===!1?s:s.value),{hash:{},inverse:f.noop,fn:f.program(6,c,t),data:t
}),(s||0===s)&&(a+=s),a+="> "+h(i(1).call(e,"Send feedback",{hash:{},data:t}))+" </label> </div> "}function c(e,t){return"checked"}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var u,d="",h=this.escapeExpression,p="function",f=this;return d+='<div class="row"> <div class="col-md-4 visible-md visible-lg text-center"> <i class="plex-image server"></i> </div> <div class="col-md-8"> <h4>'+h(i(1).call(t,"Welcome to Plex!",{hash:{},data:a}))+'</h4> <form id="setup-basic-form" class="settings-container"> ',
u=n.if.call(t,t&&t.friendlyNameSetting,{hash:{},inverse:f.noop,fn:f.program(1,r,a),data:a}),(u||0===u)&&(d+=u),d+=" ",u=n.if.call(t,t&&t.signedIn,{hash:{},inverse:f.noop,fn:f.program(3,o,a),data:a}),(u||0===u)&&(d+=u),d+=" ",u=n.if.call(t,t&&t.collectUsageDataSetting,{hash:{},inverse:f.noop,fn:f.program(5,l,a),data:a}),(u||0===u)&&(d+=u),d+=' <div class="setup-footer"> <button type="submit" class="submit-btn btn btn-primary btn-loading btn-lg"> <div class="loading loading-sm"></div> <span class="btn-label">'+h(i(1).call(t,"Next",{
hash:{},data:a}))+'</span> </button> <button class="next-btn hidden" data-subset="setupLibrary"></button> </div> </form> </div> </div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+="<h4>"+o(i(1).call(t,"Install Channels",{hash:{},data:a}))+'</h4> <p class="text-muted">'+o(i(1).call(t,"Plex channels give you access to online media from a variety of sites. You can browse and install these channels from the Channel Directory, but get started by installing some featured channels.",{
hash:{},data:a}))+'</p> <div class="setup-channel-list-container"></div> <div class="setup-footer"> <button class="next-btn btn btn-primary btn-lg" data-subset="setupComplete">'+o(i(1).call(t,"Next",{hash:{},data:a}))+"</button> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var n="";return n+=" <h4>"+u(i(1).call(e,"Thanks for supporting Plex.",{hash:{},data:t}))+'</h4> <span class="text-muted">'+u(i(1).call(e,"We really appreciate it. See what {1}benefits{2} come with your subscription.",'<a href="https://plex.tv/subscription/welcome" target="_blank">',"</a>",{
hash:{},data:t}))+"</span> "}function o(e,t){var n,s="";return s+=" <h4>"+u(i(1).call(e,"Go Premium. Get a Plex Pass.",{hash:{},data:t}))+'</h4> <span class="text-muted">'+u(i(1).call(e,"Everything you need to experience the best of Plex. Your subscription gives you premium features and exclusive access to new ones.",{hash:{},data:t}))+'</span> <div class="setup-plex-pass-action-container"> <a class="btn btn-sm btn-default" href="'+u((n=e&&e.plexPassUrl,typeof n===d?n.apply(e):n))+'" target="_blank">'+u(i(1).call(e,"Learn More",{
hash:{},data:t}))+"</a> </div> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var l,c="",u=this.escapeExpression,d="function",h=this;return c+='<div class="row"> <div class="col-md-6"> <h4>'+u(i(1).call(t,"Congratulations!",{hash:{},data:a}))+'</h4> <p class="text-muted">'+u(i(1).call(t,"See, that wasn't too bad, right? At this very moment, Plex is working tirelessly to build your library, and make it look beautiful.",{hash:{},data:a}))+'</p> <p class="text-muted">'+u(i(1).call(t,"Feel free to watch Plex work, or take this opportunity to {1}download{2} some Plex apps!",'<a href="https://plex.tv/downloads" target="_blank">',"</a>",{
hash:{},data:a}))+'</p> </div> <div class="col-md-6 visible-md visible-lg text-center"> <i class="plex-image plex-pass"></i> <div class="setup-plex-pass-container"> ',l=n.if.call(t,t&&t.hasPlexPass,{hash:{},inverse:h.program(3,o,a),fn:h.program(1,r,a),data:a}),(l||0===l)&&(c+=l),c+=' </div> </div> </div> <div class="setup-footer setup-done-footer"> <button class="done-btn btn btn-primary btn-lg">'+u(i(1).call(t,"Done",{hash:{},data:a}))+"</button> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){
function r(e,t){var s,a="";return a+=' <div class="checkbox"> <label> <input type="checkbox" id="'+p((s=e&&e.mappingModeSetting,s=null==s||s===!1?s:s.id,typeof s===h?s.apply(e):s))+'" value="1" ',s=n.if.call(e,(s=e&&e.mappingModeSetting,null==s||s===!1?s:s.value),{hash:{},inverse:f.noop,fn:f.program(2,o,t),data:t}),(s||0===s)&&(a+=s),a+="> "+p(i(1).call(e,"Manually specify port",{hash:{},data:t}))+" </label> </div> "}function o(e,t){return"checked"}function l(e,t){var i,s="";return s+=' <div class="form-group"> <input type="text" id="'+p((i=e&&e.mappingPortSetting,
i=null==i||i===!1?i:i.id,typeof i===h?i.apply(e):i))+'" class="form-control" value="'+p((i=e&&e.mappingPortSetting,i=null==i||i===!1?i:i.value,typeof i===h?i.apply(e):i))+'" ',i=n.unless.call(e,(i=e&&e.mappingModeSetting,null==i||i===!1?i:i.value),{hash:{},inverse:f.noop,fn:f.program(5,c,t),data:t}),(i||0===i)&&(s+=i),s+="> </div> "}function c(e,t){return"disabled"}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var u,d="",h="function",p=this.escapeExpression,f=this;return d+='<div class="row"> <div class="col-md-4 visible-md visible-lg text-center"> <i class="plex-image server"></i> </div> <div class="remote-access-error-container col-md-8"> '+p(i(13).call(t,"connectError",{
hash:{mappingError:(u=t&&t.cloudAccount,null==u||u===!1?u:u.mappingError),context:"setup"},data:a}))+' <form id="setup-manual-connect-form" class="form-inline"> ',u=n.if.call(t,t&&t.mappingModeSetting,{hash:{},inverse:f.noop,fn:f.program(1,r,a),data:a}),(u||0===u)&&(d+=u),d+=" ",u=n.if.call(t,t&&t.mappingPortSetting,{hash:{},inverse:f.noop,fn:f.program(4,l,a),data:a}),(u||0===u)&&(d+=u),d+=' <button type="submit" class="retry-btn btn btn-default btn-loading"> <div class="loading loading-sm"></div> <span class="btn-label">'+p(i(1).call(t,"Retry",{
hash:{},data:a}))+'</span> </button> <p class="help-block">'+p(i(1).call(t,"Enable this if automatic mapping fails. You will need to configure your router. Detailed instructions are available {1}here{2}.",'<a href="http://support.plex.tv/hc/en-us/articles/200931138-Troubleshooting-myPlex-Server-connections" target="_blank">',"</a>",{hash:{},data:a}))+'</p> </form> <div class="setup-footer"> <button class="next-btn btn btn-primary btn-lg" data-subset="setupLibrary">'+p(i(1).call(t,"Next",{hash:{},
data:a}))+"</button> </div> </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var n="";return n+=" <h1>"+u(i(1).call(e,"Setup is not allowed for shared servers.",{hash:{},data:t}))+"</h1> "}function o(e,t){var n="";return n+=" <h1>"+u(i(1).call(e,"A problem has been detected with a core component of Plex Media Server.",{hash:{},data:t}))+'</h1> <h2 class="text-muted">'+u(i(1).call(e,"Please visit the {1}forums{2} and provide your logs, as described {3}here{4}.",'<a href="https://forums.plex.tv" target="_blank">',"</a>",'<a href="http://support.plex.tv/hc/en-us/articles/200250417-Log-File-Locations" target="_blank">',"</a>",{
hash:{},data:t}))+"</h2> "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var l,c="",u=this.escapeExpression,d=this;return c+='<div class="row row-padded"> <div class="col-md-8 col-md-offset-2"> ',l=n.if.call(t,t&&t.shared,{hash:{},inverse:d.program(3,o,a),fn:d.program(1,r,a),data:a}),(l||0===l)&&(c+=l),c+=" </div> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;
return r+="<h4>"+o(i(1).call(t,"Organize Your Media",{hash:{},data:a}))+'</h4> <p class="text-muted">'+o(i(1).call(t,"Plex organizes your media into libraries. You can add as many libraries as you want, and you can have multiple libraries with the same type.",{hash:{},data:a}))+'</p> <p class="setup-add-section-container"> <button class="add-section-btn btn btn-default">'+o(i(1).call(t,"Add Library",{hash:{},data:a}))+'</button> </p> <div class="setup-section-list-container"></div> <div class="setup-footer"> <button class="next-btn btn btn-primary btn-lg" data-subset="setupChannels">'+o(i(1).call(t,"Next",{
hash:{},data:a}))+"</button> </div> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<div class="loading loading-inline"></div> <p class="loading-title">'+o(i(1).call(t,"Please wait a moment while Plex starts.",{hash:{},data:a}))+"</p> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],
n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+="<h2>"+o(i(1).call(t,"Get Started",{hash:{},data:a}))+'</h2> <div class="setup-progress"> <div class="basic-segment setup-progress-segment"> <a class="segment-btn btn-gray" data-subset="setupBasic" href="#">'+o(i(1).call(t,"Basic Setup",{hash:{},data:a}))+'</a> </div> <div class="library-segment setup-progress-segment"> <a class="segment-btn btn-gray" data-subset="setupLibrary" href="#">'+o(i(1).call(t,"Library",{hash:{},
data:a}))+'</a> </div> <div class="channels-segment setup-progress-segment"> <a class="segment-btn btn-gray" data-subset="setupChannels" href="#">'+o(i(1).call(t,"Channels",{hash:{},data:a}))+'</a> </div> </div> <div class="setup-container"></div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,i,n,s){return this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),s=s||{},'<div class="dashboard-empty-servers-container"></div> <div class="dashboard-servers-container"></div> ';
})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<div class="side-bar-page main-page minimal-scroll"> <div class="section-sort-container"> <h5>'+o(i(1).call(t,"Sort",{hash:{},data:a}))+'</h5> <div class="section-sort-list-container"></div> </div> </div>'})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){
return"hidden"}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var o,l="",c=this,u=this.escapeExpression;return l+='<div class="side-bar-page main-page dark-scrollbar"> <div class="section-current-filters-container"> <div class="side-bar-actions"> <a class="new-filter-icon-btn new-filter-btn btn-gray ',o=n.unless.call(t,t&&t.showNewFilterIconBtn,{hash:{},inverse:c.noop,fn:c.program(1,r,a),data:a}),(o||0===o)&&(l+=o),l+='" href="#"><i class="glyphicon plus"></i></a> </div> <h5>'+u(i(1).call(t,"Filters",{
hash:{},data:a}))+'</h5> <div class="section-current-filters-list-container"></div> </div> <div class="section-sort-container hidden"> <h5>'+u(i(1).call(t,"Sort",{hash:{},data:a}))+'</h5> <div class="section-sort-list-container"></div> </div> </div> <div class="side-bar-page filters-page dark-scrollbar"> <div class="section-filters-container"> <div class="side-bar-actions"> <a class="hide-btn btn-gray" href="#"><i class="glyphicon chevron-left"></i></a> </div> <h5>'+u(i(1).call(t,"Select A Filter",{
hash:{},data:a}))+'</h5> <div class="section-filters-list-container"></div> </div> </div> <div class="side-bar-page filter-options-page dark-scrollbar"> <div class="section-filter-options-container"> <div class="side-bar-actions"> <a class="hide-btn btn-gray" href="#"><i class="glyphicon chevron-left"></i></a> </div> <h5 class="filter-options-header"></h5> <div class="section-filter-option-list-container"></div> </div> </div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){
this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r="",o=this.escapeExpression;return r+='<i class="plex-image plex-pass plex-pass-sm"></i> <h1>'+o(i(1).call(t,"Upgrade to the Best Experience!",{hash:{},data:a}))+"</h1> <p>"+o(i(1).call(t,"Upgrade to a Plex Pass and get exclusive access to the complete Plex experience! Awesomeness includes:",{hash:{},data:a}))+'</p> <ul class="list"> <li>'+o(i(1).call(t,"Parental controls and fast switching to users in your Plex Home",{hash:{},
data:a}))+"</li> <li>"+o(i(1).call(t,"Sync your media and enjoy it anywhere",{hash:{},data:a}))+"</li> <li>"+o(i(1).call(t,"Free Apps for Android, Roku, and new platforms like Xbox, PlayStation, and VIZIO smart TVs",{hash:{},data:a}))+"</li> <li>"+o(i(1).call(t,"Enhance your movie experience with integrated trailers and extras",{hash:{},data:a}))+"</li> </ul> "})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),
a=a||{};var r="",o=this.escapeExpression;return r+="<h2>"+o(i(1).call(t,"Announcements",{hash:{},data:a}))+'</h2> <div class="announcements-container"></div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var r,o="",l=this.escapeExpression,c="function";return o+="<h2>"+l(i(1).call(t,"Watch Later Help",{hash:{},data:a}))+'</h2> <div class="filter-bar"> <h4>'+l(i(1).call(t,"Add videos from your browser",{
hash:{},data:a}))+'</h4> </div> <div class="row text-muted"> <div class="col-md-5"> <div class="text-center"> <a class="btn btn-primary btn-lg btn-plexit" href=\'javascript: var s=document.createElement("script");s.type="text/javascript";s.src="//plex.tv/queue/bookmarklet_payload";var h=document.getElementsByTagName("head")[0];h.appendChild(s);void(0);\'><span class="plexit-hidden">\u276f</span> Plex It!</a> </div> <ol class="steps-list"> <li>'+l((r=t&&t.firstStepText,typeof r===c?r.apply(t):r))+"</li> <li>"+l(i(1).call(t,'To save a video to Watch Later, click "Plex It!" in your Bookmarks Bar.',{
hash:{},data:a}))+"</li> <li>"+l(i(1).call(t,"A panel will appear on the left side of the page to let you know the video has been saved.",{hash:{},data:a}))+"</li> <li>"+l(i(1).call(t,'You can also recommend the video to friends or "fling" it to a Plex player and watch it there.',{hash:{},data:a}))+'</li> </ol> </div> <div class="col-md-7 text-right"> <img class="plexit-img" src="'+l((r=t&&t.stepsImgSrc,typeof r===c?r.apply(t):r))+'"/> </div> </div> <div class="filter-bar"> <h4>'+l(i(1).call(t,"Add videos by email",{
hash:{},data:a}))+'</h4> </div> <div class="row text-muted"> <div class="col-md-5"> <div class="queue-email form-control input-lg disabled" title="'+l((r=t&&t.copyCommand,typeof r===c?r.apply(t):r))+'" tabindex="-1">'+l((r=t&&t.queueEmail,typeof r===c?r.apply(t):r))+'</div> <ol class="steps-list"> <li>'+l(i(1).call(t,"Send an email to the address above with any link(s) you want added to Watch Later.",{hash:{},data:a}))+"</li> <li>"+l(i(1).call(t,"Add this to your address book so you can easily email links from your iPhone, iPad, Android, or any other device.",{
hash:{},data:a}))+'</li> </ol> </div> <div class="col-md-7 text-right"> <img class="email-links" src="'+l((r=t&&t.emailImgSrc,typeof r===c?r.apply(t):r))+'"/> </div> </div> '})},function(e,t,i){var n=i(3);e.exports=(n.default||n).template(function(e,t,n,s,a){function r(e,t){var i,n="";return n+=' <li><a class="'+d((i=e&&e.subset,typeof i===u?i.apply(e):i))+'-btn btn-gray" href="#!/playlist/'+d((i=e&&e.key,typeof i===u?i.apply(e):i))+"/"+d((i=e&&e.subset,typeof i===u?i.apply(e):i))+'">'+d((i=e&&e.title,
typeof i===u?i.apply(e):i))+'<span class="badge"></span></a></li> '}function o(e,t){var i,n="";return n+=' <a class="user-playlist-help" href="'+d((i=e&&e.helpRoute,typeof i===u?i.apply(e):i))+'" target="'+d((i=e&&e.defaultTarget,typeof i===u?i.apply(e):i))+'"><i class="glyphicon circle-question-mark"></i></a> '}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),a=a||{};var l,c="",u="function",d=this.escapeExpression,h=this;return c+='<ul class="nav nav-header pull-right"> ',l=n.each.call(t,t&&t.filters,{
hash:{},inverse:h.noop,fn:h.program(1,r,a),data:a}),(l||0===l)&&(c+=l),c+=" </ul> <h2> "+d(i(1).call(t,t&&t.label,{hash:{},data:a}))+" ",l=n.if.call(t,t&&t.helpRoute,{hash:{},inverse:h.noop,fn:h.program(3,o,a),data:a}),(l||0===l)&&(c+=l),c+=' </h2> <div class="user-playlist-container"></div> '})},function(e,t,i){"use strict";function n(e){var t=e&&e[0]||1,i=d;if(t!==i){if(i>t){var n=h[i],s=h[t];throw new u("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+n+") or downgrade your runtime to an older version ("+s+").");
}throw new u("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+e[1]+").")}}function s(e,t){if(!t)throw new u("No environment passed to template");var i=function(e,i,n,s,a,r){var o=t.VM.invokePartial.apply(this,arguments);if(null!=o)return o;if(t.compile){var l={helpers:s,partials:a,data:r};return a[i]=t.compile(e,{data:void 0!==r},t),a[i](n,l)}throw new u("The partial "+i+" could not be compiled when running in runtime-only mode");
},n={escapeExpression:c.escapeExpression,invokePartial:i,programs:[],program:function(e,t,i){var n=this.programs[e];return i?n=r(e,t,i):n||(n=this.programs[e]=r(e,t)),n},merge:function(e,t){var i=e||t;return e&&t&&e!==t&&(i={},c.extend(i,t),c.extend(i,e)),i},programWithDepth:t.VM.programWithDepth,noop:t.VM.noop,compilerInfo:null};return function(i,s){s=s||{};var a,r,o=s.partial?s:t;s.partial||(a=s.helpers,r=s.partials);var l=e.call(n,o,i,a,r,s.data);return s.partial||t.VM.checkRevision(n.compilerInfo),
l}}function a(e,t,i){var n=Array.prototype.slice.call(arguments,3),s=function(e,s){return s=s||{},t.apply(this,[e,s.data||i].concat(n))};return s.program=e,s.depth=n.length,s}function r(e,t,i){var n=function(e,n){return n=n||{},t(e,n.data||i)};return n.program=e,n.depth=0,n}function o(e,t,i,n,s,a){var r={partial:!0,helpers:n,partials:s,data:a};if(void 0===e)throw new u("The partial "+t+" could not be found");return e instanceof Function?e(i,r):void 0}function l(){return""}var c=i(181),u=i(180).default,d=i(179).COMPILER_REVISION,h=i(179).REVISION_CHANGES;
t.checkRevision=n,t.template=s,t.programWithDepth=a,t.program=r,t.invokePartial=o,t.noop=l},function(e,t){(function(){window.Modernizr=function(e,t,i){function n(e){v.cssText=e}function s(e,t){return typeof e===t}function a(e,t){return!!~(""+e).indexOf(t)}function r(e,t){for(var n in e){var s=e[n];if(!a(s,"-")&&v[s]!==i)return"pfx"==t?s:!0}return!1}function o(e,t,n){for(var a in e){var r=t[e[a]];if(r!==i)return n===!1?e[a]:s(r,"function")?r.bind(n||t):r}return!1}function l(e,t,i){var n=e.charAt(0).toUpperCase()+e.slice(1),a=(e+" "+w.join(n+" ")+n).split(" ");
return s(t,"string")||s(t,"undefined")?r(a,t):(a=(e+" "+x.join(n+" ")+n).split(" "),o(a,t,i))}var c,u,d,h="2.8.3",p={},f=t.documentElement,m="modernizr",g=t.createElement(m),v=g.style,y=({}.toString," -webkit- -moz- -o- -ms- ".split(" ")),b="Webkit Moz O ms",w=b.split(" "),x=b.toLowerCase().split(" "),S={},C=[],k=C.slice,P=function(e,i,n,s){var a,r,o,l,c=t.createElement("div"),u=t.body,d=u||t.createElement("body");if(parseInt(n,10))for(;n--;)o=t.createElement("div"),o.id=s?s[n]:m+(n+1),c.appendChild(o);
return a=["&#173;",'<style id="s',m,'">',e,"</style>"].join(""),c.id=m,(u?c:d).innerHTML+=a,d.appendChild(c),u||(d.style.background="",d.style.overflow="hidden",l=f.style.overflow,f.style.overflow="hidden",f.appendChild(d)),r=i(c,e),u?c.parentNode.removeChild(c):(d.parentNode.removeChild(d),f.style.overflow=l),!!r},A={}.hasOwnProperty;d=s(A,"undefined")||s(A.call,"undefined")?function(e,t){return t in e&&s(e.constructor.prototype[t],"undefined")}:function(e,t){return A.call(e,t)},Function.prototype.bind||(Function.prototype.bind=function(e){
var t=this;if("function"!=typeof t)throw new TypeError;var i=k.call(arguments,1),n=function(){if(this instanceof n){var s=function(){};s.prototype=t.prototype;var a=new s,r=t.apply(a,i.concat(k.call(arguments)));return Object(r)===r?r:a}return t.apply(e,i.concat(k.call(arguments)))};return n}),S.csstransforms3d=function(){var e=!!l("perspective");return e&&"webkitPerspective"in f.style&&P("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(t,i){
e=9===t.offsetLeft&&3===t.offsetHeight}),e};for(var I in S)d(S,I)&&(u=I.toLowerCase(),p[u]=S[I](),C.push((p[u]?"":"no-")+u));return p.addTest=function(e,t){if("object"==typeof e)for(var n in e)d(e,n)&&p.addTest(n,e[n]);else{if(e=e.toLowerCase(),p[e]!==i)return p;t="function"==typeof t?t():t,"undefined"!=typeof enableClasses&&enableClasses&&(f.className+=" "+(t?"":"no-")+e),p[e]=t}return p},n(""),g=c=null,p._version=h,p._prefixes=y,p._domPrefixes=x,p._cssomPrefixes=w,p.testProp=function(e){return r([e]);
},p.testAllProps=l,p.testStyles=P,p}(this,this.document),e.exports=window.Modernizr}).call(window)},function(e,t,i){var n,s,a;/*!
	 * jQuery Mousewheel 3.1.13
	 *
	 * Copyright jQuery Foundation and other contributors
	 * Released under the MIT license
	 * http://jquery.org/license
	 */
!function(r){s=[i(4)],n=r,a="function"==typeof n?n.apply(t,s):n,!(void 0!==a&&(e.exports=a))}(function(e){function t(t){var r=t||window.event,o=l.call(arguments,1),c=0,d=0,h=0,p=0,f=0,m=0;if(t=e.event.fix(r),t.type="mousewheel","detail"in r&&(h=-1*r.detail),"wheelDelta"in r&&(h=r.wheelDelta),"wheelDeltaY"in r&&(h=r.wheelDeltaY),"wheelDeltaX"in r&&(d=-1*r.wheelDeltaX),"axis"in r&&r.axis===r.HORIZONTAL_AXIS&&(d=-1*h,h=0),c=0===h?d:h,"deltaY"in r&&(h=-1*r.deltaY,c=h),"deltaX"in r&&(d=r.deltaX,0===h&&(c=-1*d)),
0!==h||0!==d){if(1===r.deltaMode){var g=e.data(this,"mousewheel-line-height");c*=g,h*=g,d*=g}else if(2===r.deltaMode){var v=e.data(this,"mousewheel-page-height");c*=v,h*=v,d*=v}if(p=Math.max(Math.abs(h),Math.abs(d)),(!a||a>p)&&(a=p,n(r,p)&&(a/=40)),n(r,p)&&(c/=40,d/=40,h/=40),c=Math[c>=1?"floor":"ceil"](c/a),d=Math[d>=1?"floor":"ceil"](d/a),h=Math[h>=1?"floor":"ceil"](h/a),u.settings.normalizeOffset&&this.getBoundingClientRect){var y=this.getBoundingClientRect();f=t.clientX-y.left,m=t.clientY-y.top;
}return t.deltaX=d,t.deltaY=h,t.deltaFactor=a,t.offsetX=f,t.offsetY=m,t.deltaMode=0,o.unshift(t,c,d,h),s&&clearTimeout(s),s=setTimeout(i,200),(e.event.dispatch||e.event.handle).apply(this,o)}}function i(){a=null}function n(e,t){return u.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120===0}var s,a,r=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],o="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],l=Array.prototype.slice;
if(e.event.fixHooks)for(var c=r.length;c;)e.event.fixHooks[r[--c]]=e.event.mouseHooks;var u=e.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var i=o.length;i;)this.addEventListener(o[--i],t,!1);else this.onmousewheel=t;e.data(this,"mousewheel-line-height",u.getLineHeight(this)),e.data(this,"mousewheel-page-height",u.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var i=o.length;i;)this.removeEventListener(o[--i],t,!1);else this.onmousewheel=null;
e.removeData(this,"mousewheel-line-height"),e.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var i=e(t),n=i["offsetParent"in e.fn?"offsetParent":"parent"]();return n.length||(n=e("body")),parseInt(n.css("fontSize"),10)||parseInt(i.css("fontSize"),10)||16},getPageHeight:function(t){return e(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e);
}})})},function(e,t,i){!function(t,i){var n=this;e.exports=i(n)}(this,function(e){"use strict";return function(e){function t(n){if(i[n])return i[n].exports;var s=i[n]={exports:Object.create(null),id:n,loaded:!1};return e[n](s.exports,t),s.loaded=!0,s.exports}var i=Object.create(null);return t(0)}([function(e,t){var i=t(22),n=t(22);e.debugMode=n.debugMode,e.verboseMode=n.verboseMode;var s=t(32),a=t(32);e.Set=a.Set;var r=t(29),o=t(29);e.Map=o.Map;var l=t(31),c=t(31);e.Promise=c.Promise,e.DeferredPromise=c.DeferredPromise;
var u=t(35);e.webworker=u;var d=t(7);e.parts=d;var h=t(1);e.parser=h;var p=t(13);e.renderers=p;var f=t(23);e.ASS=f.ASS;var m=t(24);e.Dialogue=m.Dialogue;var g=t(26);e.ScriptProperties=g.ScriptProperties;var v=t(27);e.Style=v.Style;var y=t(25);e.BorderStyle=y.BorderStyle,e.Format=y.Format,e.WrappingStyle=y.WrappingStyle,Object.defineProperties(e,{debugMode:{get:function(){return i.debugMode},set:i.setDebugMode},verboseMode:{get:function(){return i.verboseMode},set:i.setVerboseMode},Set:{get:function(){
return s.Set},set:s.setImplementation},Map:{get:function(){return r.Map},set:r.setImplementation},Promise:{get:function(){return l.Promise},set:l.setImplementation}})},function(e,t){var i=t(3);e.parse=i.parse;var n=t(5);e.BrowserReadableStream=n.BrowserReadableStream,e.StringStream=n.StringStream,e.XhrStream=n.XhrStream;var s=t(4);e.StreamParser=s.StreamParser,e.SrtStreamParser=s.SrtStreamParser},function(e,t){function i(e){var t=e.indexOf(":");if(-1===t)return null;var i=e.substr(0,t),n=e.substr(t+1).replace(/^\s+/,"");
return{name:i,value:n}}function n(e,t){var n=i(e);if(null===n)return null;var a=n.value.split(",");a.length>t.length&&(a[t.length-1]=a.slice(t.length-1).join(","));var r=new s.Map;return t.forEach(function(e,t){r.set(e,a[t])}),{type:n.name,template:r}}var s=t(29);e.parseLineIntoProperty=i,e.parseLineIntoTypedTemplate=n},function(e,t){function i(e,t){var i=new o(e,t);if(null===i.result||i.result.end!==e.length)throw a.debugMode&&console.error("Parse failed. %s %s %o",t,e,i.result),new Error("Parse failed.");
return i.result.value}function n(e,t,i,n){o.prototype["parse_tag_"+e]=function(s){var a=this,r=new h(s);if(null===a.read(r,e))return s.pop(),null;var o=i.call(a,r);if(null!==o)r.value=new t(o.value);else{if(n)return s.pop(),null;r.value=new t(null)}return r}}var s=t(7),a=t(22),r=t(29);e.parse=i;var o=function(){function e(e,t){this._input=e,this._parseTree=new h(null),this._result=l.get(t).call(this,this._parseTree)}return Object.defineProperty(e.prototype,"result",{get:function(){return this._result;
},enumerable:!0,configurable:!0}),e.prototype.parse_dialogueParts=function(e){var t=new h(e);for(t.value=[];this._haveMore();){var n=this.parse_enclosedTags(t);if(null!==n)t.value.push.apply(t.value,n.value);else{var a=this.parse_newline(t)||this.parse_hardspace(t)||this.parse_text(t);if(null===a)return e.pop(),null;if(a.value instanceof s.Text&&t.value[t.value.length-1]instanceof s.Text){var r=t.value[t.value.length-1];t.value[t.value.length-1]=new s.Text(r.value+a.value.value)}else t.value.push(a.value);
}}var o=!1;return t.value.forEach(function(e,n){e instanceof s.DrawingMode?o=0!==e.scale:e instanceof s.Text&&o&&(t.value[n]=new s.DrawingInstructions(i(e.value,"drawingInstructions")))}),t},e.prototype.parse_enclosedTags=function(e){var t=new h(e);if(t.value=[],null===this.read(t,"{"))return e.pop(),null;for(var i=this._peek();this._haveMore()&&"}"!==i;i=this._peek()){var n=null;if(null!==this.read(t,"\\")&&(n=this.parse_tag_alpha(t)||this.parse_tag_iclip(t)||this.parse_tag_xbord(t)||this.parse_tag_ybord(t)||this.parse_tag_xshad(t)||this.parse_tag_yshad(t)||this.parse_tag_blur(t)||this.parse_tag_bord(t)||this.parse_tag_clip(t)||this.parse_tag_fade(t)||this.parse_tag_fscx(t)||this.parse_tag_fscy(t)||this.parse_tag_move(t)||this.parse_tag_shad(t)||this.parse_tag_fad(t)||this.parse_tag_fax(t)||this.parse_tag_fay(t)||this.parse_tag_frx(t)||this.parse_tag_fry(t)||this.parse_tag_frz(t)||this.parse_tag_fsp(t)||this.parse_tag_fsplus(t)||this.parse_tag_fsminus(t)||this.parse_tag_org(t)||this.parse_tag_pbo(t)||this.parse_tag_pos(t)||this.parse_tag_an(t)||this.parse_tag_be(t)||this.parse_tag_fn(t)||this.parse_tag_fr(t)||this.parse_tag_fs(t)||this.parse_tag_kf(t)||this.parse_tag_ko(t)||this.parse_tag_1a(t)||this.parse_tag_1c(t)||this.parse_tag_2a(t)||this.parse_tag_2c(t)||this.parse_tag_3a(t)||this.parse_tag_3c(t)||this.parse_tag_4a(t)||this.parse_tag_4c(t)||this.parse_tag_a(t)||this.parse_tag_b(t)||this.parse_tag_c(t)||this.parse_tag_i(t)||this.parse_tag_k(t)||this.parse_tag_K(t)||this.parse_tag_p(t)||this.parse_tag_q(t)||this.parse_tag_r(t)||this.parse_tag_s(t)||this.parse_tag_t(t)||this.parse_tag_u(t),
null===n&&t.pop()),null===n&&(n=this.parse_comment(t)),null===n)return e.pop(),null;n.value instanceof s.Comment&&t.value[t.value.length-1]instanceof s.Comment?t.value[t.value.length-1]=new s.Comment(t.value[t.value.length-1].value+n.value.value):t.value.push(n.value)}return null===this.read(t,"}")?(e.pop(),null):t},e.prototype.parse_newline=function(e){var t=new h(e);return null===this.read(t,"\\N")?(e.pop(),null):(t.value=new s.NewLine,t)},e.prototype.parse_hardspace=function(e){var t=new h(e);return null===this.read(t,"\\h")?(e.pop(),
null):(t.value=new s.Text("\xa0"),t)},e.prototype.parse_text=function(e){var t=this._peek(),i=new h(e),n=new h(i,t);return i.value=new s.Text(n.value),i},e.prototype.parse_comment=function(e){var t=this._peek(),i=new h(e),n=new h(i,t);return i.value=new s.Comment(n.value),i},e.prototype.parse_tag_a=function(e){var t=new h(e);if(null===this.read(t,"a"))return e.pop(),null;var i=this._peek();switch(i){case"1":var n=this._peek(2);switch(n){case"10":case"11":i=n}break;case"2":case"3":case"5":case"6":
case"7":case"9":break;default:return e.pop(),null}var a=new h(t,i),r=null;switch(a.value){case"1":r=1;break;case"2":r=2;break;case"3":r=3;break;case"5":r=7;break;case"6":r=8;break;case"7":r=9;break;case"9":r=4;break;case"10":r=5;break;case"11":r=6}return t.value=new s.Alignment(r),t},e.prototype.parse_tag_alpha=function(){throw new Error("Method not implemented.")},e.prototype.parse_tag_an=function(e){var t=new h(e);if(null===this.read(t,"an"))return e.pop(),null;var i=this._peek();if("1">i||i>"9")return e.pop(),
null;var n=new h(t,i);return t.value=new s.Alignment(parseInt(n.value)),t},e.prototype.parse_tag_b=function(e){var t=new h(e);if(null===this.read(t,"b"))return e.pop(),null;var i=null,n=this._peek();return n>="1"&&"9">=n&&(n=this._peek(3),"00"===n.substr(1)&&(i=new h(t,n),i.value=parseInt(i.value))),null===i&&(i=this.parse_enableDisable(t)),null!==i?t.value=new s.Bold(i.value):t.value=new s.Bold(null),t},e.prototype.parse_tag_be=function(){throw new Error("Method not implemented.")},e.prototype.parse_tag_blur=function(){
throw new Error("Method not implemented.")},e.prototype.parse_tag_bord=function(){throw new Error("Method not implemented.")},e.prototype.parse_tag_c=function(){throw new Error("Method not implemented.")},e.prototype.parse_tag_clip=function(e){return this._parse_tag_clip_or_iclip("clip",e)},e.prototype.parse_tag_fad=function(e){var t=new h(e);if(null===this.read(t,"fad"))return e.pop(),null;if(null===this.read(t,"("))return e.pop(),null;var i=this.parse_decimal(t);if(null===i)return e.pop(),null;if(null===this.read(t,","))return e.pop(),
null;var n=this.parse_decimal(t);return null===n?(e.pop(),null):null===this.read(t,")")?(e.pop(),null):(t.value=new s.Fade(i.value/1e3,n.value/1e3),t)},e.prototype.parse_tag_fade=function(e){var t=new h(e);if(null===this.read(t,"fade"))return e.pop(),null;if(null===this.read(t,"("))return e.pop(),null;var i=this.parse_decimal(t);if(null===i)return e.pop(),null;if(null===this.read(t,","))return e.pop(),null;var n=this.parse_decimal(t);if(null===n)return e.pop(),null;if(null===this.read(t,","))return e.pop(),
null;var a=this.parse_decimal(t);if(null===a)return e.pop(),null;if(null===this.read(t,","))return e.pop(),null;var r=this.parse_decimal(t);if(null===r)return e.pop(),null;if(null===this.read(t,","))return e.pop(),null;var o=this.parse_decimal(t);if(null===o)return e.pop(),null;if(null===this.read(t,","))return e.pop(),null;var l=this.parse_decimal(t);if(null===l)return e.pop(),null;if(null===this.read(t,","))return e.pop(),null;var c=this.parse_decimal(t);return null===c?(e.pop(),null):null===this.read(t,")")?(e.pop(),
null):(t.value=new s.ComplexFade(1-i.value/255,1-n.value/255,1-a.value/255,r.value/1e3,o.value/1e3,l.value/1e3,c.value/1e3),t)},e.prototype.parse_tag_fax=function(){throw new Error("Method not implemented.")},e.prototype.parse_tag_fay=function(){throw new Error("Method not implemented.")},e.prototype.parse_tag_fn=function(e){var t=new h(e);if(null===this.read(t,"fn"))return e.pop(),null;for(var i=new h(t,""),n=this._peek();this._haveMore()&&"\\"!==n&&"}"!==n;n=this._peek())i.value+=n;return i.value.length>0?t.value=new s.FontName(i.value):t.value=new s.FontName(null),
t},e.prototype.parse_tag_fr=function(){throw new Error("Method not implemented.")},e.prototype.parse_tag_frx=function(){throw new Error("Method not implemented.")},e.prototype.parse_tag_fry=function(){throw new Error("Method not implemented.")},e.prototype.parse_tag_frz=function(){throw new Error("Method not implemented.")},e.prototype.parse_tag_fs=function(){throw new Error("Method not implemented.")},e.prototype.parse_tag_fsplus=function(e){var t=new h(e);if(null===this.read(t,"fs+"))return e.pop(),
null;var i=this.parse_decimal(t);return null===i?(e.pop(),null):(t.value=new s.FontSizePlus(i.value),t)},e.prototype.parse_tag_fsminus=function(e){var t=new h(e);if(null===this.read(t,"fs-"))return e.pop(),null;var i=this.parse_decimal(t);return null===i?(e.pop(),null):(t.value=new s.FontSizeMinus(i.value),t)},e.prototype.parse_tag_fscx=function(e){var t=new h(e);if(null===this.read(t,"fscx"))return e.pop(),null;var i=this.parse_decimal(t);return null===i?(e.pop(),null):(t.value=new s.FontScaleX(i.value/100),
t)},e.prototype.parse_tag_fscy=function(e){var t=new h(e);if(null===this.read(t,"fscy"))return e.pop(),null;var i=this.parse_decimal(t);return null===i?(e.pop(),null):(t.value=new s.FontScaleY(i.value/100),t)},e.prototype.parse_tag_fsp=function(){throw new Error("Method not implemented.")},e.prototype.parse_tag_i=function(){throw new Error("Method not implemented.")},e.prototype.parse_tag_iclip=function(e){return this._parse_tag_clip_or_iclip("iclip",e)},e.prototype.parse_tag_k=function(e){var t=new h(e);
if(null===this.read(t,"k"))return e.pop(),null;var i=this.parse_decimal(t);return null===i?(e.pop(),null):(t.value=new s.ColorKaraoke(i.value/100),t)},e.prototype.parse_tag_K=function(e){var t=new h(e);if(null===this.read(t,"K"))return e.pop(),null;var i=this.parse_decimal(t);return null===i?(e.pop(),null):(t.value=new s.SweepingColorKaraoke(i.value/100),t)},e.prototype.parse_tag_kf=function(e){var t=new h(e);if(null===this.read(t,"kf"))return e.pop(),null;var i=this.parse_decimal(t);return null===i?(e.pop(),
null):(t.value=new s.SweepingColorKaraoke(i.value/100),t)},e.prototype.parse_tag_ko=function(e){var t=new h(e);if(null===this.read(t,"ko"))return e.pop(),null;var i=this.parse_decimal(t);return null===i?(e.pop(),null):(t.value=new s.OutlineKaraoke(i.value/100),t)},e.prototype.parse_tag_move=function(e){var t=new h(e);if(null===this.read(t,"move"))return e.pop(),null;if(null===this.read(t,"("))return e.pop(),null;var i=this.parse_decimal(t);if(null===i)return e.pop(),null;if(null===this.read(t,","))return e.pop(),
null;var n=this.parse_decimal(t);if(null===n)return e.pop(),null;if(null===this.read(t,","))return e.pop(),null;var a=this.parse_decimal(t);if(null===a)return e.pop(),null;if(null===this.read(t,","))return e.pop(),null;var r=this.parse_decimal(t);if(null===r)return e.pop(),null;var o=null,l=null;if(null!==this.read(t,",")){if(o=this.parse_decimal(t),null===o)return e.pop(),null;if(null===this.read(t,","))return e.pop(),null;if(l=this.parse_decimal(t),null===l)return e.pop(),null}return null===this.read(t,")")?(e.pop(),
null):(t.value=new s.Move(i.value,n.value,a.value,r.value,null!==o?o.value/1e3:null,null!==l?l.value/1e3:null),t)},e.prototype.parse_tag_org=function(e){var t=new h(e);if(null===this.read(t,"org"))return e.pop(),null;if(null===this.read(t,"("))return e.pop(),null;var i=this.parse_decimal(t);if(null===i)return e.pop(),null;if(null===this.read(t,","))return e.pop(),null;var n=this.parse_decimal(t);return null===n?(e.pop(),null):null===this.read(t,")")?(e.pop(),null):(t.value=new s.RotationOrigin(i.value,n.value),
t)},e.prototype.parse_tag_p=function(){throw new Error("Method not implemented.")},e.prototype.parse_tag_pbo=function(){throw new Error("Method not implemented.")},e.prototype.parse_tag_pos=function(e){var t=new h(e);if(null===this.read(t,"pos"))return e.pop(),null;if(null===this.read(t,"("))return e.pop(),null;var i=this.parse_decimal(t);if(null===i)return e.pop(),null;if(null===this.read(t,","))return e.pop(),null;var n=this.parse_decimal(t);return null===n?(e.pop(),null):null===this.read(t,")")?(e.pop(),
null):(t.value=new s.Position(i.value,n.value),t)},e.prototype.parse_tag_q=function(e){var t=new h(e);if(null===this.read(t,"q"))return e.pop(),null;var i=this._peek();if("0">i||i>"3")return e.pop(),null;var n=new h(t,i);return t.value=new s.WrappingStyle(parseInt(n.value)),t},e.prototype.parse_tag_r=function(e){var t=new h(e);if(null===this.read(t,"r"))return e.pop(),null;for(var i=new h(t,""),n=this._peek();this._haveMore()&&"\\"!==n&&"}"!==n;n=this._peek())i.value+=n;return i.value.length>0?t.value=new s.Reset(i.value):t.value=new s.Reset(null),
t},e.prototype.parse_tag_s=function(){throw new Error("Method not implemented.")},e.prototype.parse_tag_shad=function(){throw new Error("Method not implemented.")},e.prototype.parse_tag_t=function(e){var t=new h(e);if(null===this.read(t,"t"))return e.pop(),null;if(null===this.read(t,"("))return e.pop(),null;var i=null,n=null,a=null,r=this.parse_decimal(t);if(null!==r){if(null===this.read(t,","))return e.pop(),null;var o=this.parse_decimal(t);if(null!==o){if(i=r,n=o,null===this.read(t,","))return e.pop(),
null;var l=this.parse_decimal(t);if(null!==l&&(a=l,null===this.read(t,",")))return e.pop(),null}else if(a=r,null===this.read(t,","))return e.pop(),null}for(var c=[],u=this._peek();this._haveMore()&&")"!==u&&"}"!==u;u=this._peek()){var d=null;if(null!==this.read(t,"\\")&&(d=this.parse_tag_alpha(t)||this.parse_tag_iclip(t)||this.parse_tag_xbord(t)||this.parse_tag_ybord(t)||this.parse_tag_xshad(t)||this.parse_tag_yshad(t)||this.parse_tag_blur(t)||this.parse_tag_bord(t)||this.parse_tag_clip(t)||this.parse_tag_fscx(t)||this.parse_tag_fscy(t)||this.parse_tag_shad(t)||this.parse_tag_fax(t)||this.parse_tag_fay(t)||this.parse_tag_frx(t)||this.parse_tag_fry(t)||this.parse_tag_frz(t)||this.parse_tag_fsp(t)||this.parse_tag_fsplus(t)||this.parse_tag_fsminus(t)||this.parse_tag_be(t)||this.parse_tag_fr(t)||this.parse_tag_fs(t)||this.parse_tag_1a(t)||this.parse_tag_1c(t)||this.parse_tag_2a(t)||this.parse_tag_2c(t)||this.parse_tag_3a(t)||this.parse_tag_3c(t)||this.parse_tag_4a(t)||this.parse_tag_4c(t)||this.parse_tag_c(t),
null===d&&t.pop()),null===d&&(d=this.parse_comment(t)),null===d)return e.pop(),null;d.value instanceof s.Comment&&c[c.length-1]instanceof s.Comment?c[c.length-1]=new s.Comment(c[c.length-1].value+d.value.value):c.push(d.value)}return this.read(t,")"),t.value=new s.Transform(null!==i?i.value/1e3:null,null!==n?n.value/1e3:null,null!==a?a.value/1e3:null,c),t},e.prototype.parse_tag_u=function(){throw new Error("Method not implemented.")},e.prototype.parse_tag_xbord=function(){throw new Error("Method not implemented.");
},e.prototype.parse_tag_xshad=function(){throw new Error("Method not implemented.")},e.prototype.parse_tag_ybord=function(){throw new Error("Method not implemented.")},e.prototype.parse_tag_yshad=function(){throw new Error("Method not implemented.")},e.prototype.parse_tag_1a=function(){throw new Error("Method not implemented.")},e.prototype.parse_tag_1c=function(){throw new Error("Method not implemented.")},e.prototype.parse_tag_2a=function(){throw new Error("Method not implemented.")},e.prototype.parse_tag_2c=function(){
throw new Error("Method not implemented.")},e.prototype.parse_tag_3a=function(){throw new Error("Method not implemented.")},e.prototype.parse_tag_3c=function(){throw new Error("Method not implemented.")},e.prototype.parse_tag_4a=function(){throw new Error("Method not implemented.")},e.prototype.parse_tag_4c=function(){throw new Error("Method not implemented.")},e.prototype.parse_drawingInstructions=function(e){var t=new h(e),i=null;for(t.value=[];this._haveMore();){for(;null!==this.read(t," "););
if(!this._haveMore())break;var n=null,s=this.parse_text(t);if(null===s)return e.pop(),null;switch(n=s.value.value){case"m":case"l":case"b":i=n;break;default:if(null===i)return e.pop(),null;n=i,t.pop()}switch(n){case"m":var a=this.parse_drawingInstructionMove(t);if(null===a)return e.pop(),null;t.value.push(a.value);break;case"l":var r=this.parse_drawingInstructionLine(t);if(null===r)return e.pop(),null;t.value.push(r.value);break;case"b":var o=this.parse_drawingInstructionCubicBezierCurve(t);if(null===o)return e.pop(),
null;t.value.push(o.value)}}for(;null!==this.read(t," "););return t},e.prototype.parse_drawingInstructionMove=function(e){for(var t=new h(e);null!==this.read(t," "););var i=this.parse_decimal(t);if(null===i)return e.pop(),null;for(;null!==this.read(t," "););var n=this.parse_decimal(t);return null===n?(e.pop(),null):(t.value=new s.drawing.MoveInstruction(i.value,n.value),t)},e.prototype.parse_drawingInstructionLine=function(e){for(var t=new h(e);null!==this.read(t," "););var i=this.parse_decimal(t);
if(null===i)return e.pop(),null;for(;null!==this.read(t," "););var n=this.parse_decimal(t);return null===n?(e.pop(),null):(t.value=new s.drawing.LineInstruction(i.value,n.value),t)},e.prototype.parse_drawingInstructionCubicBezierCurve=function(e){for(var t=new h(e);null!==this.read(t," "););var i=this.parse_decimal(t);if(null===i)return e.pop(),null;for(;null!==this.read(t," "););var n=this.parse_decimal(t);if(null===n)return e.pop(),null;for(;null!==this.read(t," "););var a=this.parse_decimal(t);
if(null===a)return e.pop(),null;for(;null!==this.read(t," "););var r=this.parse_decimal(t);if(null===r)return e.pop(),null;for(;null!==this.read(t," "););var o=this.parse_decimal(t);if(null===o)return e.pop(),null;for(;null!==this.read(t," "););var l=this.parse_decimal(t);return null===l?(e.pop(),null):(t.value=new s.drawing.CubicBezierCurveInstruction(i.value,n.value,a.value,r.value,o.value,l.value),t)},e.prototype.parse_decimalInt32=function(e){for(var t=new h(e),i=null!==this.read(t,"-"),n=new h(t,""),s=this._peek();this._haveMore()&&s>="0"&&"9">=s;s=this._peek())n.value+=s;
if(0===n.value.length)return e.pop(),null;var a=parseInt(n.value);return a>=4294967295?a=4294967295:i&&(a=-a),t.value=a,t},e.prototype.parse_hexInt32=function(e){for(var t=new h(e),i=null!==this.read(t,"-"),n=new h(t,""),s=this._peek();this._haveMore()&&(s>="0"&&"9">=s||s>="a"&&"f">=s||s>="A"&&"F">=s);s=this._peek())n.value+=s;if(0===n.value.length)return e.pop(),null;var a=parseInt(n.value,16);return a>=4294967295?a=4294967295:i&&(a=-a),t.value=a,t},e.prototype.parse_decimalOrHexInt32=function(e){
var t=new h(e),i=null;return i=null!==this.read(t,"&H")||null!==this.read(t,"&h")?this.parse_hexInt32(t):this.parse_decimalInt32(t),null===i?(e.pop(),null):(t.value=i.value,t)},e.prototype.parse_decimal=function(e){var t=new h(e),i=null!==this.read(t,"-"),n=this.parse_unsignedDecimal(t);return null===n?(e.pop(),null):(t.value=n.value,i&&(t.value=-t.value),t)},e.prototype.parse_unsignedDecimal=function(e){var t,i=new h(e),n=new h(i,""),s=null;for(t=this._peek();this._haveMore()&&t>="0"&&"9">=t;t=this._peek())n.value+=t;
if(0===n.value.length)return e.pop(),null;if(null!==this.read(i,".")){for(s=new h(i,""),t=this._peek();this._haveMore()&&t>="0"&&"9">=t;t=this._peek())s.value+=t;if(0===s.value.length)return e.pop(),null}return i.value=parseFloat(n.value+(null!==s?"."+s.value:"")),i},e.prototype.parse_enableDisable=function(e){var t=this._peek();if("0"===t||"1"===t){var i=new h(e,t);return i.value="1"===i.value,i}return null},e.prototype.parse_color=function(e){for(var t=new h(e);null!==this.read(t,"&")||null!==this.read(t,"H"););
var i=this.parse_hexInt32(t);if(null===i)return e.pop(),null;var n=i.value;for(t.value=new s.Color(255&n,n>>8&255,n>>16&255);null!==this.read(t,"&")||null!==this.read(t,"H"););return t},e.prototype.parse_alpha=function(e){for(var t=new h(e);null!==this.read(t,"&")||null!==this.read(t,"H"););var i=this.parse_hexInt32(t);if(null===i)return e.pop(),null;var n=i.value;for(t.value=1-(255&n)/255;null!==this.read(t,"&")||null!==this.read(t,"H"););return t},e.prototype.parse_colorWithAlpha=function(e){var t=new h(e),i=this.parse_decimalOrHexInt32(t);
if(null===i)return e.pop(),null;var n=i.value;return t.value=new s.Color(255&n,n>>8&255,n>>16&255,1-(n>>24&255)/255),t},e.prototype.read=function(e,t){return this._peek(t.length)!==t?null:new h(e,t)},e.prototype._peek=function(e){return void 0===e&&(e=1),1===e?this._input[this._parseTree.end]:this._input.substr(this._parseTree.end,e)},e.prototype._haveMore=function(){return this._parseTree.end<this._input.length},e.prototype._parse_tag_clip_or_iclip=function(e,t){var n=new h(t);if(null===this.read(n,e))return t.pop(),
null;if(null===this.read(n,"("))return t.pop(),null;var a=null,r=null,o=null,l=null,c=null,u=null,d=this.parse_decimal(n);if(null!==d){if(null===this.read(n,","))return t.pop(),null;var p=this.parse_decimal(n);null!==p?(a=d,o=p):c=d}if(null!==a&&null!==o){if(null===this.read(n,","))return t.pop(),null;if(r=this.parse_decimal(n),null===this.read(n,","))return t.pop(),null;l=this.parse_decimal(n),n.value=new s.RectangularClip(a.value,o.value,r.value,l.value,"clip"===e)}else{u=new h(n,"");for(var f=this._peek();this._haveMore()&&")"!==f&&"}"!==f;f=this._peek())u.value+=f;
n.value=new s.VectorClip(null!==c?c.value:1,i(u.value,"drawingInstructions"),"clip"===e)}return null===this.read(n,")")?(t.pop(),null):n},e}();n("alpha",s.Alpha,o.prototype.parse_alpha,!1),n("be",s.Blur,o.prototype.parse_decimal,!1),n("blur",s.GaussianBlur,o.prototype.parse_decimal,!1),n("bord",s.Border,o.prototype.parse_decimal,!1),n("c",s.PrimaryColor,o.prototype.parse_color,!1),n("fax",s.SkewX,o.prototype.parse_decimal,!1),n("fay",s.SkewY,o.prototype.parse_decimal,!1),n("fr",s.RotateZ,o.prototype.parse_decimal,!1),
n("frx",s.RotateX,o.prototype.parse_decimal,!1),n("fry",s.RotateY,o.prototype.parse_decimal,!1),n("frz",s.RotateZ,o.prototype.parse_decimal,!1),n("fs",s.FontSize,o.prototype.parse_decimal,!1),n("fsp",s.LetterSpacing,o.prototype.parse_decimal,!1),n("i",s.Italic,o.prototype.parse_enableDisable,!1),n("p",s.DrawingMode,o.prototype.parse_decimal,!0),n("pbo",s.DrawingBaselineOffset,o.prototype.parse_decimal,!0),n("s",s.StrikeThrough,o.prototype.parse_enableDisable,!1),n("shad",s.Shadow,o.prototype.parse_decimal,!1),
n("u",s.Underline,o.prototype.parse_enableDisable,!1),n("xbord",s.BorderX,o.prototype.parse_decimal,!1),n("xshad",s.ShadowX,o.prototype.parse_decimal,!1),n("ybord",s.BorderY,o.prototype.parse_decimal,!1),n("yshad",s.ShadowY,o.prototype.parse_decimal,!1),n("1a",s.PrimaryAlpha,o.prototype.parse_alpha,!1),n("1c",s.PrimaryColor,o.prototype.parse_color,!1),n("2a",s.SecondaryAlpha,o.prototype.parse_alpha,!1),n("2c",s.SecondaryColor,o.prototype.parse_color,!1),n("3a",s.OutlineAlpha,o.prototype.parse_alpha,!1),
n("3c",s.OutlineColor,o.prototype.parse_color,!1),n("4a",s.ShadowAlpha,o.prototype.parse_alpha,!1),n("4c",s.ShadowColor,o.prototype.parse_color,!1);for(var l=new r.Map,c=0,u=Object.keys(o.prototype);c<u.length;c++){var d=u[c];0===d.indexOf("parse_")&&"function"==typeof o.prototype[d]&&l.set(d.substr("parse_".length),o.prototype[d])}var h=function(){function e(e,t){void 0===t&&(t=null),this._parent=e,this._children=[],null!==e&&e.children.push(this),this._start=null!==e?e.end:0,this._end=this._start,
this.value=t}return Object.defineProperty(e.prototype,"start",{get:function(){return this._start},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"end",{get:function(){return this._end},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this._children},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{
get:function(){return this._value},set:function(e){this._value=e,null!==this._value&&this._value.constructor===String&&0===this._children.length&&this._setEnd(this._start+this._value.length)},enumerable:!0,configurable:!0}),e.prototype.pop=function(){this._children.splice(this._children.length-1,1),this._children.length>0?this._setEnd(this._children[this._children.length-1].end):this._setEnd(this.start)},e.prototype._setEnd=function(e){this._end=e,null!==this._parent&&this._parent.end!==this._end&&this._parent._setEnd(this._end);
},e}(),p=t(31),f=t(34),m=t(36);m.registerWorkerCommand(f.WorkerCommands.Parse,function(e){return new p.Promise(function(t){t(i(e.input,e.rule))})})},function(e,t){var i=t(23),n=t(27),s=t(24),a=t(29),r=t(31),o=t(2),l=function(){function e(e){var t=this;this._stream=e,this._ass=new i.ASS,this._minimalDeferred=new r.DeferredPromise,this._deferred=new r.DeferredPromise,this._shouldSwallowBom=!0,this._currentSectionName=null,this._stream.nextLine().then(function(e){return t._onNextLine(e)})}return Object.defineProperty(e.prototype,"minimalASS",{
get:function(){return this._minimalDeferred.promise},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ass",{get:function(){return this._deferred.promise},enumerable:!0,configurable:!0}),e.prototype._onNextLine=function(e){var t=this;if(null===e)return this._minimalDeferred.resolve(this._ass),void this._deferred.resolve(this._ass);if("\r"===e[e.length-1]&&(e=e.substr(0,e.length-1)),65279===e.charCodeAt(0)&&this._shouldSwallowBom&&(e=e.substr(1)),this._shouldSwallowBom=!1,""===e||";"===e[0]);else if("["===e[0]&&"]"===e[e.length-1])"Script Info"===this._currentSectionName&&this._minimalDeferred.resolve(this._ass),
this._currentSectionName=e.substring(1,e.length-1);else switch(this._currentSectionName){case"Script Info":var i=o.parseLineIntoProperty(e);if(null!==i)switch(i.name){case"PlayResX":this._ass.properties.resolutionX=parseInt(i.value);break;case"PlayResY":this._ass.properties.resolutionY=parseInt(i.value);break;case"WrapStyle":this._ass.properties.wrappingStyle=parseInt(i.value);break;case"ScaledBorderAndShadow":this._ass.properties.scaleBorderAndShadow="yes"===i.value}break;case"V4+ Styles":if(null===this._ass.stylesFormatSpecifier){
var i=o.parseLineIntoProperty(e);null!==i&&"Format"===i.name&&(this._ass.stylesFormatSpecifier=i.value.split(",").map(function(e){return e.trim()}))}else this._ass.addStyle(e);break;case"Events":if(null===this._ass.dialoguesFormatSpecifier){var i=o.parseLineIntoProperty(e);null!==i&&"Format"===i.name&&(this._ass.dialoguesFormatSpecifier=i.value.split(",").map(function(e){return e.trim()}))}else this._ass.addEvent(e)}this._stream.nextLine().then(function(e){return t._onNextLine(e)})},e}();e.StreamParser=l;
var c=function(){function e(e){var t=this;this._stream=e,this._ass=new i.ASS,this._deferred=new r.DeferredPromise,this._currentDialogueNumber=null,this._currentDialogueStart=null,this._currentDialogueEnd=null,this._currentDialogueText=null,this._stream.nextLine().then(function(e){return t._onNextLine(e)}),this._ass.properties.resolutionX=1280,this._ass.properties.resolutionY=720,this._ass.properties.wrappingStyle=1,this._ass.properties.scaleBorderAndShadow=!0;var s=new n.Style(new a.Map([["Name","Default"]]));
this._ass.styles.set(s.name,s)}return Object.defineProperty(e.prototype,"ass",{get:function(){return this._deferred.promise},enumerable:!0,configurable:!0}),e.prototype._onNextLine=function(e){var t=this;if(null===e)return null!==this._currentDialogueNumber&&null!==this._currentDialogueStart&&null!==this._currentDialogueEnd&&null!==this._currentDialogueText&&this._ass.dialogues.push(new s.Dialogue(new a.Map([["Style","Default"],["Start",this._currentDialogueStart],["End",this._currentDialogueEnd],["Text",this._currentDialogueText]]),this._ass)),
void this._deferred.resolve(this._ass);if("\r"===e[e.length-1]&&(e=e.substr(0,e.length-1)),""===e)null!==this._currentDialogueNumber&&null!==this._currentDialogueStart&&null!==this._currentDialogueEnd&&null!==this._currentDialogueText&&this._ass.dialogues.push(new s.Dialogue(new a.Map([["Style","Default"],["Start",this._currentDialogueStart],["End",this._currentDialogueEnd],["Text",this._currentDialogueText]]),this._ass)),this._currentDialogueNumber=this._currentDialogueStart=this._currentDialogueEnd=this._currentDialogueText=null;else if(null===this._currentDialogueNumber)/^\d+$/.test(e)&&(this._currentDialogueNumber=e);else if(null===this._currentDialogueStart&&null===this._currentDialogueEnd){
var i=/^(\d\d:\d\d:\d\d,\d\d\d) --> (\d\d:\d\d:\d\d,\d\d\d)/.exec(e);null!==i&&(this._currentDialogueStart=i[1].replace(",","."),this._currentDialogueEnd=i[2].replace(",","."))}else e=e.replace(/<b>/g,"{\\b1}").replace(/\{b\}/g,"{\\b1}").replace(/<\/b>/g,"{\\b0}").replace(/\{\/b\}/g,"{\\b0}").replace(/<i>/g,"{\\i1}").replace(/\{i\}/g,"{\\i1}").replace(/<\/i>/g,"{\\i0}").replace(/\{\/i\}/g,"{\\i0}").replace(/<u>/g,"{\\u1}").replace(/\{u\}/g,"{\\u1}").replace(/<\/u>/g,"{\\u0}").replace(/\{\/u\}/g,"{\\u0}").replace(/<font color="#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})">/g,function(e,t,i,n){
return"{c&H"+n+i+t+"&}"}).replace(/<\/font>/g,"{\\c}"),null!==this._currentDialogueText?this._currentDialogueText+="\\N"+e:this._currentDialogueText=e;this._stream.nextLine().then(function(e){return t._onNextLine(e)})},e}();e.SrtStreamParser=c},function(t,i){var n=i(31),s=function(){function e(e){this._str=e,this._readTill=0}return e.prototype.nextLine=function(){var e=null;if(this._readTill<this._str.length){var t=this._str.indexOf("\n",this._readTill);-1!==t?(e=n.Promise.resolve(this._str.substring(this._readTill,t)),
this._readTill=t+1):(e=n.Promise.resolve(this._str.substr(this._readTill)),this._readTill=this._str.length)}else e=n.Promise.resolve(null);return e},e}();t.StringStream=s;var a=function(){function e(e){var t=this;this._xhr=e,this._readTill=0,this._pendingDeferred=null,e.addEventListener("progress",function(e){return t._onXhrProgress(e)},!1),e.addEventListener("loadend",function(e){return t._onXhrLoadEnd(e)},!1)}return e.prototype.nextLine=function(){if(null!==this._pendingDeferred)throw new Error("XhrStream only supports one pending unfulfilled read at a time.");
var e=this._pendingDeferred=new n.DeferredPromise;return this._tryResolveNextLine(),e.promise},e.prototype._onXhrProgress=function(){null!==this._pendingDeferred&&this._tryResolveNextLine()},e.prototype._onXhrLoadEnd=function(){null!==this._pendingDeferred&&this._tryResolveNextLine()},e.prototype._tryResolveNextLine=function(){var e=this._xhr.responseText,t=e.indexOf("\n",this._readTill);-1!==t?(this._pendingDeferred.resolve(e.substring(this._readTill,t)),this._readTill=t+1,this._pendingDeferred=null):this._xhr.readyState===XMLHttpRequest.DONE&&(this._readTill<e.length?(this._pendingDeferred.resolve(e.substr(this._readTill)),
this._readTill=e.length):this._pendingDeferred.resolve(null),this._pendingDeferred=null)},e}();t.XhrStream=a;var r=function(){function t(t,i){this._buffer="",this._pendingDeferred=null,this._reader=t.getReader(),this._decoder=new e.TextDecoder(i,{ignoreBOM:!0})}return t.prototype.nextLine=function(){if(null!==this._pendingDeferred)throw new Error("BrowserReadableStream only supports one pending unfulfilled read at a time.");var e=this._pendingDeferred=new n.DeferredPromise;return this._tryResolveNextLine(),
e.promise},t.prototype._tryResolveNextLine=function(){var e=this,t=this._buffer.indexOf("\n");-1!==t?(this._pendingDeferred.resolve(this._buffer.substr(0,t)),this._buffer=this._buffer.substr(t+1),this._pendingDeferred=null):this._reader.read().then(function(t){var i=t.value,n=t.done;n?(0===e._buffer.length?e._pendingDeferred.resolve(null):(e._pendingDeferred.resolve(e._buffer),e._buffer=""),e._pendingDeferred=null):(e._buffer+=e._decoder.decode(i,{stream:!0}),e._tryResolveNextLine())})},t}();t.BrowserReadableStream=r;
},function(e){var t=function(){function e(e,t){this._x=e,this._y=t}return Object.defineProperty(e.prototype,"x",{get:function(){return this._x},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this._y},enumerable:!0,configurable:!0}),e}();e.MoveInstruction=t;var i=function(){function e(e,t){this._x=e,this._y=t}return Object.defineProperty(e.prototype,"x",{get:function(){return this._x},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y",{
get:function(){return this._y},enumerable:!0,configurable:!0}),e}();e.LineInstruction=i;var n=function(){function e(e,t,i,n,s,a){this._x1=e,this._y1=t,this._x2=i,this._y2=n,this._x3=s,this._y3=a}return Object.defineProperty(e.prototype,"x1",{get:function(){return this._x1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y1",{get:function(){return this._y1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"x2",{get:function(){return this._x2},enumerable:!0,configurable:!0
}),Object.defineProperty(e.prototype,"y2",{get:function(){return this._y2},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"x3",{get:function(){return this._x3},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y3",{get:function(){return this._y3},enumerable:!0,configurable:!0}),e}();e.CubicBezierCurveInstruction=n},function(e,t){var i=t(6);e.drawing=i;var n=function(){function e(e,t,i,n){void 0===n&&(n=1),this._red=e,this._green=t,this._blue=i,this._alpha=n}return Object.defineProperty(e.prototype,"red",{
get:function(){return this._red},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"green",{get:function(){return this._green},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"blue",{get:function(){return this._blue},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this._alpha},enumerable:!0,configurable:!0}),e.prototype.withAlpha=function(t){return null!==t?new e(this._red,this._green,this._blue,t):this},e.prototype.toString=function(){
return"rgba("+this._red+", "+this._green+", "+this._blue+", "+this._alpha.toFixed(3)+")"},e}();e.Color=n;var s=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.Comment=s;var a=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return"Text { value: "+this._value.replace(/\u00A0/g,"\\h")+" }";
},e}();e.Text=a;var r=function(){function e(){}return e}();e.NewLine=r;var o=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.Italic=o;var l=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.Bold=l;var c=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{
get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.Underline=c;var u=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.StrikeThrough=u;var d=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.Border=d;var h=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{
get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.BorderX=h;var p=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.BorderY=p;var f=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.Shadow=f;var m=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{
get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.ShadowX=m;var g=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.ShadowY=g;var v=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.Blur=v;var y=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{
get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.GaussianBlur=y;var b=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.FontName=b;var w=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.FontSize=w;var x=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{
get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.FontSizePlus=x;var S=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.FontSizeMinus=S;var C=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.FontScaleX=C;var k=function(){function e(e){this._value=e}
return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.FontScaleY=k;var P=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.LetterSpacing=P;var A=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.RotateX=A;var I=function(){
function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.RotateY=I;var _=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.RotateZ=_;var T=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),
e}();e.SkewX=T;var D=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.SkewY=D;var E=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.PrimaryColor=E;var M=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value;
},enumerable:!0,configurable:!0}),e}();e.SecondaryColor=M;var R=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.OutlineColor=R;var O=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.ShadowColor=O;var L=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{
get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.Alpha=L;var N=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.PrimaryAlpha=N;var F=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.SecondaryAlpha=F;var U=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{
get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.OutlineAlpha=U;var z=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.ShadowAlpha=z;var B=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.Alignment=B;var j=function(){function e(e){this._duration=e}
return Object.defineProperty(e.prototype,"duration",{get:function(){return this._duration},enumerable:!0,configurable:!0}),e}();e.ColorKaraoke=j;var V=function(){function e(e){this._duration=e}return Object.defineProperty(e.prototype,"duration",{get:function(){return this._duration},enumerable:!0,configurable:!0}),e}();e.SweepingColorKaraoke=V;var H=function(){function e(e){this._duration=e}return Object.defineProperty(e.prototype,"duration",{get:function(){return this._duration},enumerable:!0,configurable:!0
}),e}();e.OutlineKaraoke=H;var W=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.WrappingStyle=W;var $=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.Reset=$;var Q=function(){function e(e,t){this._x=e,this._y=t}return Object.defineProperty(e.prototype,"x",{get:function(){
return this._x},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this._y},enumerable:!0,configurable:!0}),e}();e.Position=Q;var q=function(){function e(e,t,i,n,s,a){this._x1=e,this._y1=t,this._x2=i,this._y2=n,this._t1=s,this._t2=a}return Object.defineProperty(e.prototype,"x1",{get:function(){return this._x1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y1",{get:function(){return this._y1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"x2",{
get:function(){return this._x2},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y2",{get:function(){return this._y2},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"t1",{get:function(){return this._t1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"t2",{get:function(){return this._t2},enumerable:!0,configurable:!0}),e}();e.Move=q;var K=function(){function e(e,t){this._x=e,this._y=t}return Object.defineProperty(e.prototype,"x",{get:function(){
return this._x},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this._y},enumerable:!0,configurable:!0}),e}();e.RotationOrigin=K;var Y=function(){function e(e,t){this._start=e,this._end=t}return Object.defineProperty(e.prototype,"start",{get:function(){return this._start},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"end",{get:function(){return this._end},enumerable:!0,configurable:!0}),e}();e.Fade=Y;var G=function(){function e(e,t,i,n,s,a,r){
this._a1=e,this._a2=t,this._a3=i,this._t1=n,this._t2=s,this._t3=a,this._t4=r}return Object.defineProperty(e.prototype,"a1",{get:function(){return this._a1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"a2",{get:function(){return this._a2},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"a3",{get:function(){return this._a3},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"t1",{get:function(){return this._t1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"t2",{
get:function(){return this._t2},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"t3",{get:function(){return this._t3},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"t4",{get:function(){return this._t4},enumerable:!0,configurable:!0}),e}();e.ComplexFade=G;var X=function(){function e(e,t,i,n){this._start=e,this._end=t,this._accel=i,this._tags=n}return Object.defineProperty(e.prototype,"start",{get:function(){return this._start},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"end",{
get:function(){return this._end},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"accel",{get:function(){return this._accel},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tags",{get:function(){return this._tags},enumerable:!0,configurable:!0}),e}();e.Transform=X;var J=function(){function e(e,t,i,n,s){this._x1=e,this._y1=t,this._x2=i,this._y2=n,this._inside=s}return Object.defineProperty(e.prototype,"x1",{get:function(){return this._x1},enumerable:!0,configurable:!0
}),Object.defineProperty(e.prototype,"y1",{get:function(){return this._y1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"x2",{get:function(){return this._x2},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y2",{get:function(){return this._y2},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inside",{get:function(){return this._inside},enumerable:!0,configurable:!0}),e}();e.RectangularClip=J;var Z=function(){function e(e,t,i){this._scale=e,
this._instructions=t,this._inside=i}return Object.defineProperty(e.prototype,"scale",{get:function(){return this._scale},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"instructions",{get:function(){return this._instructions},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inside",{get:function(){return this._inside},enumerable:!0,configurable:!0}),e}();e.VectorClip=Z;var ee=function(){function e(e){this._scale=e}return Object.defineProperty(e.prototype,"scale",{
get:function(){return this._scale},enumerable:!0,configurable:!0}),e}();e.DrawingMode=ee;var te=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),e}();e.DrawingBaselineOffset=te;var ie=function(){function e(e){this._instructions=e}return Object.defineProperty(e.prototype,"instructions",{get:function(){return this._instructions},enumerable:!0,configurable:!0}),e}();e.DrawingInstructions=ie;for(var ne=function(e,t){
if(!e.prototype.hasOwnProperty("toString")){var i=Object.getOwnPropertyNames(e.prototype).filter(function(e){return"constructor"!==e});e.prototype.toString=function(){var e=this;return t+" { "+i.map(function(t){return t+": "+e[t]}).join(", ")+(i.length>0?" ":"")+"}"}}},se=t(36),ae=0,re=Object.keys(e);ae<re.length;ae++){var oe=re[ae],le=e[oe];le instanceof Function&&(ne(le,oe),se.registerClassPrototype(le.prototype))}for(var ce=0,ue=Object.keys(i);ce<ue.length;ce++){var oe=ue[ce],le=i[oe];le instanceof Function&&(ne(le,"Drawing"+oe),
se.registerClassPrototype(le.prototype))}},function(e,t){var i=t(22),n=t(10),s=function(){function e(e,t){this._getCurrentTime=e,this._currentTimeUpdateMaxDelay=t,this._manualClock=new n.ManualClock,this._nextAnimationFrameRequestId=null,this._lastKnownExternalTime=null,this._lastKnownExternalTimeObtainedAt=null}return e.prototype.play=function(){this._manualClock.enabled&&(this._startTicking(),this._manualClock.play())},e.prototype.pause=function(){if(this._manualClock.enabled){if(null===this._nextAnimationFrameRequestId)return void(i.debugMode&&console.warn("AutoClock.pause: Abnormal state detected. AutoClock._nextAnimationFrameRequestId should not have been null."));
this._stopTicking(),this._manualClock.pause()}},e.prototype.seeking=function(){this._manualClock.seek(this._getCurrentTime())},Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._manualClock.currentTime},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enabled",{get:function(){return this._manualClock.enabled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paused",{get:function(){return this._manualClock.paused},enumerable:!0,configurable:!0
}),Object.defineProperty(e.prototype,"rate",{get:function(){return this._manualClock.rate},enumerable:!0,configurable:!0}),e.prototype.setRate=function(e){this._manualClock.setRate(e)},e.prototype.enable=function(){return this._manualClock.enable()?(this._startTicking(),!0):!1},e.prototype.disable=function(){return this._manualClock.disable()?(this._stopTicking(),!0):!1},e.prototype.toggle=function(){this._manualClock.toggle()},e.prototype.setEnabled=function(e){return this._manualClock.setEnabled(e);
},e.prototype.addEventListener=function(e,t){this._manualClock.addEventListener(e,t)},e.prototype._onTimerTick=function(e){var t=this;if(!this._manualClock.enabled)return void(i.debugMode&&console.warn("AutoClock._onTimerTick: Called when disabled."));var n=this._manualClock.currentTime,s=this._getCurrentTime();this._manualClock.paused?n!==s&&(this._lastKnownExternalTime=s,this._lastKnownExternalTimeObtainedAt=e,this._manualClock.tick(s)):null!==this._lastKnownExternalTime&&s===this._lastKnownExternalTime?e-this._lastKnownExternalTimeObtainedAt>this._currentTimeUpdateMaxDelay?(this._lastKnownExternalTimeObtainedAt=null,
this._manualClock.pause()):this._manualClock.tick((e-this._lastKnownExternalTimeObtainedAt)/1e3*this._manualClock.rate+this._lastKnownExternalTime):(this._lastKnownExternalTime=s,this._lastKnownExternalTimeObtainedAt=e,this._manualClock.tick(s)),this._nextAnimationFrameRequestId=requestAnimationFrame(function(e){return t._onTimerTick(e)})},e.prototype._startTicking=function(){var e=this;null===this._nextAnimationFrameRequestId&&(this._nextAnimationFrameRequestId=requestAnimationFrame(function(t){
return e._onTimerTick(t)}))},e.prototype._stopTicking=function(){null!==this._nextAnimationFrameRequestId&&(cancelAnimationFrame(this._nextAnimationFrameRequestId),this._nextAnimationFrameRequestId=null)},e}();e.AutoClock=s},function(e){var t=function(){function e(){}return e.prototype.addEventListener=function(e,t){var i=this._eventListeners.get(e);void 0===i&&this._eventListeners.set(e,i=[]),i.push(t)},e.prototype._dispatchEvent=function(e,t){var i=this._eventListeners.get(e);if(void 0!==i)for(var n=0;n<i.length;n++){
var s=i[n];s.apply(this,t)}},e}();e.EventSource=t,function(e){e[e.Play=0]="Play",e[e.Tick=1]="Tick",e[e.Pause=2]="Pause",e[e.Stop=3]="Stop",e[e.RateChange=4]="RateChange"}(e.ClockEvent||(e.ClockEvent={}))},function(e,t){var i=t(30),n=t(29),s=t(9),a=function(){function e(){this._currentTime=-1,this._rate=1,this._enabled=!0,this._paused=!0,this._eventListeners=new n.Map}return e.prototype.play=function(){this._enabled&&this._paused&&(this._paused=!1,this._dispatchEvent(s.ClockEvent.Play,[]))},e.prototype.tick=function(e){
this._enabled&&(this._currentTime!==e&&this.play(),this._currentTime=e,this._dispatchEvent(s.ClockEvent.Tick,[]))},e.prototype.seek=function(e){this._enabled&&(this.pause(),this._currentTime!==e&&(this.stop(),this.tick(e),this.pause()))},e.prototype.pause=function(){this._enabled&&(this._paused||(this._paused=!0,this._dispatchEvent(s.ClockEvent.Pause,[])))},e.prototype.stop=function(){this._dispatchEvent(s.ClockEvent.Stop,[])},Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._currentTime;
},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paused",{get:function(){return this._paused},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rate",{get:function(){return this._rate},enumerable:!0,configurable:!0}),e.prototype.setRate=function(e){this._rate!==e&&(this._rate=e,this._dispatchEvent(s.ClockEvent.RateChange,[]))},e.prototype.enable=function(){
return this._enabled?!1:(this._enabled=!0,!0)},e.prototype.disable=function(){return this._enabled?(this._enabled=!1,this.pause(),this.stop(),!0):!1},e.prototype.toggle=function(){this._enabled?this.disable():this.enable()},e.prototype.setEnabled=function(e){return e?this.enable():this.disable()},e}();e.ManualClock=a,i.mixin(a,[s.EventSource])},function(e,t){var i=t(8),n=function(){function e(e){var t=this;this._autoClock=new i.AutoClock(function(){return e.currentTime},100),e.addEventListener("playing",function(){
return t._autoClock.play()},!1),e.addEventListener("pause",function(){return t._autoClock.pause()},!1),e.addEventListener("seeking",function(){return t._autoClock.seeking()},!1),e.addEventListener("ratechange",function(){return t._autoClock.setRate(e.playbackRate)},!1)}return Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._autoClock.currentTime},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enabled",{get:function(){return this._autoClock.enabled},
enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paused",{get:function(){return this._autoClock.paused},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rate",{get:function(){return this._autoClock.rate},enumerable:!0,configurable:!0}),e.prototype.enable=function(){return this._autoClock.enable()},e.prototype.disable=function(){return this._autoClock.disable()},e.prototype.toggle=function(){this._autoClock.toggle()},e.prototype.setEnabled=function(e){return this._autoClock.setEnabled(e);
},e.prototype.addEventListener=function(e,t){this._autoClock.addEventListener(e,t)},e}();e.VideoClock=n},function(e,t){var i=t(28).__extends,n=t(11),s=t(20),a=function(e){function t(t,i,s){e.call(this,i,new n.VideoClock(t),document.createElement("div"),s),this._video=t,this._videoIsFullScreen=!1,this._video.parentElement.replaceChild(this.libjassSubsWrapper,this._video),this.libjassSubsWrapper.insertBefore(this._video,this.libjassSubsWrapper.firstElementChild)}return i(t,e),t.prototype.resizeVideo=function(e,t){
console.warn("`DefaultRenderer.resizeVideo(width, height)` has been deprecated. Use `DefaultRenderer.resize(width, height)` instead."),this.resize(e,t)},t.prototype._ready=function(){var t=this;document.addEventListener("mozfullscreenchange",function(){return t._onFullScreenChange(document.mozFullScreenElement)},!1),document.addEventListener("webkitfullscreenchange",function(){return t._onFullScreenChange(document.webkitFullscreenElement)},!1),document.addEventListener("fullscreenchange",function(){
return t._onFullScreenChange(document.fullscreenElement)},!1),this.resize(this._video.offsetWidth,this._video.offsetHeight),e.prototype._ready.call(this)},t.prototype._onFullScreenChange=function(e){void 0===e&&(e=document.msFullscreenElement),e===this._video?(this.libjassSubsWrapper.classList.add("libjass-full-screen"),this.resize(screen.width,screen.height),this._videoIsFullScreen=!0,this._dispatchEvent("fullScreenChange",[this._videoIsFullScreen])):null===e&&this._videoIsFullScreen&&(this.libjassSubsWrapper.classList.remove("libjass-full-screen"),
this._videoIsFullScreen=!1,this._dispatchEvent("fullScreenChange",[this._videoIsFullScreen]))},t}(s.WebRenderer);e.DefaultRenderer=a},function(e,t){var i=t(9);e.ClockEvent=i.ClockEvent,e.EventSource=i.EventSource;var n=t(8);e.AutoClock=n.AutoClock;var s=t(10);e.ManualClock=s.ManualClock;var a=t(11);e.VideoClock=a.VideoClock;var r=t(12);e.DefaultRenderer=r.DefaultRenderer;var o=t(14);e.NullRenderer=o.NullRenderer;var l=t(20);e.WebRenderer=l.WebRenderer;var c=t(15);e.RendererSettings=c.RendererSettings;
},function(e,t){var i=t(9),n=t(15),s=t(22),a=function(){function e(t,s,a){var r=this;this._ass=t,this._clock=s,this._id=++e._lastRendererId,this._settings=n.RendererSettings.from(a),this._clock.addEventListener(i.ClockEvent.Play,function(){return r._onClockPlay()}),this._clock.addEventListener(i.ClockEvent.Tick,function(){return r._onClockTick()}),this._clock.addEventListener(i.ClockEvent.Pause,function(){return r._onClockPause()}),this._clock.addEventListener(i.ClockEvent.Stop,function(){return r._onClockStop();
}),this._clock.addEventListener(i.ClockEvent.RateChange,function(){return r._onClockRateChange()})}return Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ass",{get:function(){return this._ass},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clock",{get:function(){return this._clock},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"settings",{get:function(){return this._settings;
},enumerable:!0,configurable:!0}),e.prototype.preRender=function(){},e.prototype.draw=function(){},e.prototype.enable=function(){return this._clock.enable()},e.prototype.disable=function(){return this._clock.disable()},e.prototype.toggle=function(){this._clock.toggle()},e.prototype.setEnabled=function(e){return this._clock.setEnabled(e)},Object.defineProperty(e.prototype,"enabled",{get:function(){return this._clock.enabled},enumerable:!0,configurable:!0}),e.prototype._onClockPlay=function(){s.verboseMode&&console.log("NullRenderer._onClockPlay");
},e.prototype._onClockTick=function(){var e=this._clock.currentTime;s.verboseMode&&console.log("NullRenderer._onClockTick: currentTime = "+e);for(var t=0,i=this._ass.dialogues;t<i.length;t++){var n=i[t];n.end>e&&(n.start<=e?this.draw(n):n.start<=e+this._settings.preRenderTime&&this.preRender(n))}},e.prototype._onClockPause=function(){s.verboseMode&&console.log("NullRenderer._onClockPause")},e.prototype._onClockStop=function(){s.verboseMode&&console.log("NullRenderer._onClockStop")},e.prototype._onClockRateChange=function(){
s.verboseMode&&console.log("NullRenderer._onClockRateChange")},e._lastRendererId=-1,e}();e.NullRenderer=a},function(e,t){var i=t(29),n=function(){function e(){}return e.makeFontMapFromStyleElement=function(t){for(var n=new i.Map,s=t.sheet,a=Array.prototype.filter.call(s.cssRules,function(e){return e.type===CSSRule.FONT_FACE_RULE}),r=0;r<a.length;r++){var o=a[r],l=o.style.getPropertyValue("src");l||(l=o.cssText.split("\n").map(function(e){return e.match(/src: ([^;]+);/)}).filter(function(e){return null!==e;
}).map(function(e){return e[1]})[0]);var c=l.split(/,\s*/).map(function(t){return e._stripQuotes(t.match(/^url\((.+)\)$/)[1])});if(c.length>0){var u=e._stripQuotes(o.style.getPropertyValue("font-family")),d=n.get(u);void 0===d&&(d=[],n.set(u,d)),d.unshift.apply(d,c)}}return n},e.from=function(t){(void 0===t||null===t)&&(t={});var i=t,n=i.fontMap,s=void 0===n?null:n,a=i.preRenderTime,r=void 0===a?5:a,o=i.preciseOutlines,l=void 0===o?!1:o,c=i.enableSvg,u=void 0===c?!0:c,d=new e;return d.fontMap=s,d.preRenderTime=r,
d.preciseOutlines=l,d.enableSvg=u,d},e._stripQuotes=function(e){return e.match(/^["']?(.*?)["']?$/)[1]},e}();e.RendererSettings=n},function(e,t){var i=t(29),n=function(){function e(t){this._cssText="",this._animationStyle="",this._animationDelays=new i.Map,this._numAnimations=0,this._id=t.id+"-"+e._nextId++,this._rate=t.clock.rate}return Object.defineProperty(e.prototype,"cssText",{get:function(){return this._cssText},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"animationStyle",{
get:function(){return this._animationStyle},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"animationDelays",{get:function(){return this._animationDelays},enumerable:!0,configurable:!0}),e.prototype.add=function(e,t){for(var i=null,n=null,s=0;s<t.length;s++){var a=t[s];null===i&&(i=a.time),n=a.time}for(var r="",o=0;o<t.length;o++){var a=t[o];r+="	"+(100*(n-i===0?1:(a.time-i)/(n-i))).toFixed(3)+"% {\n",a.properties.forEach(function(e,t){r+="		"+t+": "+e+";\n"}),r+="	}\n"}var l="animation-"+this._id+"-"+this._numAnimations++;
this._cssText+="@-webkit-keyframes "+l+" {\n"+r+"\n}\n\n@keyframes "+l+" {\n"+r+"\n}\n\n",""!==this._animationStyle&&(this._animationStyle+=","),this._animationStyle+=l+" "+((n-i)/this._rate).toFixed(3)+"s "+e,this._animationDelays.set(l,i)},e._nextId=0,e}();e.AnimationCollection=n},function(e){e.domParser=null,"undefined"!=typeof DOMParser&&(e.domParser=new DOMParser)},function(e,t){var i=t(17),n=t(7),s=function(){function e(e,t){this._outputScaleX=e,this._outputScaleY=t,this._scale=1,this._baselineOffset=0;
}return Object.defineProperty(e.prototype,"scale",{set:function(e){this._scale=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"baselineOffset",{set:function(e){this._baselineOffset=e},enumerable:!0,configurable:!0}),e.prototype.toSVG=function(e,t){for(var s=Math.pow(2,this._scale-1),a=this._outputScaleX/s,r=this._outputScaleY/s,o="",l=0,c=0,u=0,d=e.instructions;u<d.length;u++){var h=d[u];h instanceof n.drawing.MoveInstruction?(o+=" M "+h.x+" "+(h.y+this._baselineOffset),l=Math.max(l,h.x),
c=Math.max(c,h.y+this._baselineOffset)):h instanceof n.drawing.LineInstruction?(o+=" L "+h.x+" "+(h.y+this._baselineOffset),l=Math.max(l,h.x),c=Math.max(c,h.y+this._baselineOffset)):h instanceof n.drawing.CubicBezierCurveInstruction&&(o+=" C "+h.x1+" "+(h.y1+this._baselineOffset)+", "+h.x2+" "+(h.y2+this._baselineOffset)+", "+h.x3+" "+(h.y3+this._baselineOffset),l=Math.max(l,h.x1,h.x2,h.x3),c=Math.max(c,h.y1+this._baselineOffset,h.y2+this._baselineOffset,h.y3+this._baselineOffset))}var p='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+(l*a).toFixed(3)+'px" height="'+(c*r).toFixed(3)+'px">\n<g transform="scale('+a.toFixed(3)+" "+r.toFixed(3)+')">\n	<path d="'+o+'" fill="'+t.toString()+'" />\n</g>\n</svg>';
return i.domParser.parseFromString(p,"image/svg+xml").childNodes[0]},e}();e.DrawingStyles=s},function(e){var t=function(){function e(e,t){this._time=e,this._properties=t}return Object.defineProperty(e.prototype,"time",{get:function(){return this._time},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"properties",{get:function(){return this._properties},enumerable:!0,configurable:!0}),e}();e.Keyframe=t},function(e,t){var i=t(28).__extends,n=t(16),s=t(18),a=t(19),r=t(21),o=t(9),l=t(14),c=t(7),u=t(22),d=t(25),h=t(30),p=t(29),f=t(32),m=t(31),g=function(e){
function t(t,i,n,s){var a=this;e.call(this,t,i,function(){if(!(n instanceof HTMLDivElement)){var e=s;s=n,n=e,console.warn("WebRenderer's constructor now takes libjassSubsWrapper as the third parameter and settings as the fourth parameter. Please update the caller.")}return s}()),this._libjassSubsWrapper=n,this._layerWrappers=[],this._layerAlignmentWrappers=[],this._currentSubs=new p.Map,this._preRenderedSubs=new p.Map,this._eventListeners=new p.Map,this._libjassSubsWrapper.classList.add("libjass-wrapper"),
this._subsWrapper=document.createElement("div"),this._libjassSubsWrapper.appendChild(this._subsWrapper),this._subsWrapper.className="libjass-subs",this._fontSizeElement=document.createElement("div"),this._libjassSubsWrapper.appendChild(this._fontSizeElement),this._fontSizeElement.className="libjass-font-measure",this._fontSizeElement.appendChild(document.createTextNode("M")),this._animationStyleElement=document.createElement("style"),this._animationStyleElement.id="libjass-animation-styles-"+this.id,
this._animationStyleElement.type="text/css",document.querySelector("head").appendChild(this._animationStyleElement);var r=document.createElementNS("http://www.w3.org/2000/svg","svg");this._libjassSubsWrapper.appendChild(r),r.setAttribute("xmlns","http://www.w3.org/2000/svg"),r.setAttribute("version","1.1"),r.setAttribute("class","libjass-filters"),r.setAttribute("width","0"),r.setAttribute("height","0"),this._svgDefsElement=document.createElementNS("http://www.w3.org/2000/svg","defs"),r.appendChild(this._svgDefsElement);
var o=new f.Set;null!==this.settings.fontMap&&this.settings.fontMap.forEach(function(e){for(var t=0;t<e.length;t++){var i=e[t];o.add(i)}}),u.debugMode&&console.log("Preloading "+o.size+" fonts...");var l=[];o.forEach(function(e){l.push(new m.Promise(function(t){var i=new XMLHttpRequest;i.addEventListener("load",function(){u.debugMode&&console.log("Preloaded "+e+"."),t(null)}),i.open("GET",e,!0),i.send()}))}),m.Promise.all(l).then(function(){u.debugMode&&console.log("All fonts have been preloaded."),
a._ready()})}return i(t,e),Object.defineProperty(t.prototype,"libjassSubsWrapper",{get:function(){return this._libjassSubsWrapper},enumerable:!0,configurable:!0}),t.prototype.resize=function(e,t){this._removeAllSubs();var i=Math.min(e/this.ass.properties.resolutionX,t/this.ass.properties.resolutionY),n=this.ass.properties.resolutionX*i,s=this.ass.properties.resolutionY*i;if(this._subsWrapper.style.width=n.toFixed(3)+"px",this._subsWrapper.style.height=s.toFixed(3)+"px",this._subsWrapper.style.left=((e-n)/2).toFixed(3)+"px",
this._subsWrapper.style.top=((t-s)/2).toFixed(3)+"px",this._scaleX=n/this.ass.properties.resolutionX,this._scaleY=s/this.ass.properties.resolutionY,this._preRenderedSubs.clear(),null!==this._animationStyleElement)for(;null!==this._animationStyleElement.firstChild;)this._animationStyleElement.removeChild(this._animationStyleElement.firstChild);for(;null!==this._svgDefsElement.firstChild;)this._svgDefsElement.removeChild(this._svgDefsElement.firstChild);-1!==this.clock.currentTime&&this._onClockTick();
},t.prototype.preRender=function(e){var i=this;if(!this._preRenderedSubs.has(e.id)){var o=document.createElement("div");o.style.marginLeft=(this._scaleX*e.style.marginLeft).toFixed(3)+"px",o.style.marginRight=(this._scaleX*e.style.marginRight).toFixed(3)+"px",o.style.marginTop=o.style.marginBottom=(this._scaleY*e.style.marginVertical).toFixed(3)+"px",o.style.minWidth=(this._subsWrapper.offsetWidth-this._scaleX*(e.style.marginLeft+e.style.marginRight)).toFixed(3)+"px";var l=new n.AnimationCollection(this),h=null,f=new r.SpanStyles(this,e,this._scaleX,this._scaleY,this.settings,this._fontSizeElement,this._svgDefsElement),m=null,g=!1,v=function(e){
null!==h&&""!==h.textContent&&o.appendChild(f.setStylesOnSpan(h,m,i._animationStyleElement)),null!==m&&m.animationDelays.forEach(function(e,t){return l.animationDelays.set(t,e)}),e&&(g?o.appendChild(f.makeNewLine()):o.appendChild(document.createElement("br"))),h=document.createElement("span"),m=new n.AnimationCollection(i),g=e};v(!1);for(var y=new s.DrawingStyles(this._scaleX,this._scaleY),b=this.ass.properties.wrappingStyle,w=0,x=0,S=e.parts;x<S.length;x++){var C=S[x];C instanceof c.Italic?f.italic=C.value:C instanceof c.Bold?f.bold=C.value:C instanceof c.Underline?f.underline=C.value:C instanceof c.StrikeThrough?f.strikeThrough=C.value:C instanceof c.Border?(f.outlineWidth=C.value,
f.outlineHeight=C.value):C instanceof c.BorderX?f.outlineWidth=C.value:C instanceof c.BorderY?f.outlineHeight=C.value:C instanceof c.Shadow?(f.shadowDepthX=C.value,f.shadowDepthY=C.value):C instanceof c.ShadowX?f.shadowDepthX=C.value:C instanceof c.ShadowY?f.shadowDepthY=C.value:C instanceof c.Blur?f.blur=C.value:C instanceof c.GaussianBlur?f.gaussianBlur=C.value:C instanceof c.FontName?f.fontName=C.value:C instanceof c.FontSize?f.fontSize=C.value:C instanceof c.FontSizePlus?f.fontSize+=C.value:C instanceof c.FontSizeMinus?f.fontSize-=C.value:C instanceof c.FontScaleX?f.fontScaleX=C.value:C instanceof c.FontScaleY?f.fontScaleY=C.value:C instanceof c.LetterSpacing?f.letterSpacing=C.value:C instanceof c.RotateX?f.rotationX=C.value:C instanceof c.RotateY?f.rotationY=C.value:C instanceof c.RotateZ?f.rotationZ=C.value:C instanceof c.SkewX?f.skewX=C.value:C instanceof c.SkewY?f.skewY=C.value:C instanceof c.PrimaryColor?f.primaryColor=C.value:C instanceof c.SecondaryColor?f.secondaryColor=C.value:C instanceof c.OutlineColor?f.outlineColor=C.value:C instanceof c.ShadowColor?f.shadowColor=C.value:C instanceof c.Alpha?(f.primaryAlpha=C.value,
f.secondaryAlpha=C.value,f.outlineAlpha=C.value,f.shadowAlpha=C.value):C instanceof c.PrimaryAlpha?f.primaryAlpha=C.value:C instanceof c.SecondaryAlpha?f.secondaryAlpha=C.value:C instanceof c.OutlineAlpha?f.outlineAlpha=C.value:C instanceof c.ShadowAlpha?f.shadowAlpha=C.value:C instanceof c.Alignment||(C instanceof c.ColorKaraoke?(v(!1),m.add("step-end",[new a.Keyframe(0,new p.Map([["color",f.secondaryColor.withAlpha(f.secondaryAlpha).toString()]])),new a.Keyframe(w,new p.Map([["color",f.primaryColor.withAlpha(f.primaryAlpha).toString()]]))]),
w+=C.duration):C instanceof c.WrappingStyle?b=C.value:C instanceof c.Reset?f.reset(this.ass.styles.get(C.value)):C instanceof c.Position?(o.style.position="absolute",o.style.left=(this._scaleX*C.x).toFixed(3)+"px",o.style.top=(this._scaleY*C.y).toFixed(3)+"px"):C instanceof c.Move?(o.style.position="absolute",l.add("linear",[new a.Keyframe(0,new p.Map([["left",(this._scaleX*C.x1).toFixed(3)+"px"],["top",(this._scaleY*C.y1).toFixed(3)+"px"]])),new a.Keyframe(C.t1,new p.Map([["left",(this._scaleX*C.x1).toFixed(3)+"px"],["top",(this._scaleY*C.y1).toFixed(3)+"px"]])),new a.Keyframe(C.t2,new p.Map([["left",(this._scaleX*C.x2).toFixed(3)+"px"],["top",(this._scaleY*C.y2).toFixed(3)+"px"]])),new a.Keyframe(e.end-e.start,new p.Map([["left",(this._scaleX*C.x2).toFixed(3)+"px"],["top",(this._scaleY*C.y2).toFixed(3)+"px"]]))])):C instanceof c.Fade?l.add("linear",[new a.Keyframe(0,new p.Map([["opacity","0"]])),new a.Keyframe(C.start,new p.Map([["opacity","1"]])),new a.Keyframe(e.end-e.start-C.end,new p.Map([["opacity","1"]])),new a.Keyframe(e.end-e.start,new p.Map([["opacity","0"]]))]):C instanceof c.ComplexFade?l.add("linear",[new a.Keyframe(0,new p.Map([["opacity",C.a1.toFixed(3)]])),new a.Keyframe(C.t1,new p.Map([["opacity",C.a1.toFixed(3)]])),new a.Keyframe(C.t2,new p.Map([["opacity",C.a2.toFixed(3)]])),new a.Keyframe(C.t3,new p.Map([["opacity",C.a2.toFixed(3)]])),new a.Keyframe(C.t4,new p.Map([["opacity",C.a3.toFixed(3)]])),new a.Keyframe(e.end-e.start,new p.Map([["opacity",C.a3.toFixed(3)]]))]):C instanceof c.DrawingMode?0!==C.scale&&(y.scale=C.scale):C instanceof c.DrawingBaselineOffset?y.baselineOffset=C.value:C instanceof c.DrawingInstructions?(h.appendChild(y.toSVG(C,f.primaryColor.withAlpha(f.primaryAlpha))),
v(!1)):C instanceof c.Text?(h.appendChild(document.createTextNode(C.value)),v(!1)):u.debugMode&&C instanceof c.Comment?(h.appendChild(document.createTextNode(C.value)),v(!1)):C instanceof c.NewLine&&v(!0))}for(var k=0,P=e.parts;k<P.length;k++){var C=P[k];if(C instanceof c.Position||C instanceof c.Move){var A=t._transformOrigins[e.alignment],I="translate("+-A[0]+"%, "+-A[1]+"%) translate(-"+o.style.marginLeft+", -"+o.style.marginTop+")",_=A[0]+"% "+A[1]+"%";o.style.webkitTransform=I,o.style.webkitTransformOrigin=_,
o.style.transform=I,o.style.transformOrigin=_;break}}switch(b){case d.WrappingStyle.EndOfLineWrapping:o.style.whiteSpace="pre-wrap";break;case d.WrappingStyle.NoLineWrapping:o.style.whiteSpace="pre";break;case d.WrappingStyle.SmartWrappingWithWiderTopLine:case d.WrappingStyle.SmartWrappingWithWiderBottomLine:o.style.whiteSpace="pre-wrap"}if(""!==o.style.position)switch(e.alignment){case 1:case 4:case 7:o.style.textAlign="left";break;case 2:case 5:case 8:o.style.textAlign="center";break;case 3:case 6:
case 9:o.style.textAlign="right"}this._animationStyleElement.appendChild(document.createTextNode(l.cssText)),o.style.webkitAnimation=l.animationStyle,o.style.animation=l.animationStyle,o.setAttribute("data-dialogue-id",this.id+"-"+e.id),this._preRenderedSubs.set(e.id,{sub:o,animationDelays:l.animationDelays})}},t.prototype.draw=function(e){var t=this;if(!this._currentSubs.has(e)){u.debugMode&&console.log(e.toString());var i=this._preRenderedSubs.get(e.id);void 0===i&&(u.debugMode&&console.warn("This dialogue was not pre-rendered. Call preRender() before calling draw() so that draw() is faster."),
this.preRender(e),i=this._preRenderedSubs.get(e.id),u.debugMode&&console.log(e.toString()));var n=i.sub.cloneNode(!0),s=function(n){var s=n.style.animationName||n.style.webkitAnimationName;if(void 0!==s&&""!==s){var a=s.split(",").map(function(n){n=n.trim();var s=i.animationDelays.get(n);return((s+e.start-t.clock.currentTime)/t.clock.rate).toFixed(3)+"s"}).join(", ");n.style.webkitAnimationDelay=a,n.style.animationDelay=a}};s(n);for(var a=n.querySelectorAll('[style*="animation:"]'),r=0;r<a.length;r++)s(a[r]);
var o=e.layer,l="absolute"===n.style.position?0:e.alignment;if(void 0===this._layerWrappers[o]){var c=document.createElement("div");c.className="layer layer"+o;for(var d=null,h=o+1;h<this._layerWrappers.length&&null===d;h++)void 0!==this._layerWrappers[h]&&(d=this._layerWrappers[h]);this._subsWrapper.insertBefore(c,d),this._layerWrappers[o]=c,this._layerAlignmentWrappers[o]=[]}if(void 0===this._layerAlignmentWrappers[o][l]){var p=document.createElement("div");p.className="an an"+l;for(var c=this._layerWrappers[o],d=null,f=l+1;f<this._layerAlignmentWrappers[o].length&&null===d;f++)void 0!==this._layerAlignmentWrappers[o][f]&&(d=this._layerAlignmentWrappers[o][f]);
c.insertBefore(p,d),this._layerAlignmentWrappers[o][l]=p}this._layerAlignmentWrappers[o][l].appendChild(n),this._currentSubs.set(e,n)}},t.prototype._onClockPlay=function(){e.prototype._onClockPlay.call(this),this._removeAllSubs(),this._subsWrapper.style.display="",this._subsWrapper.classList.remove("paused")},t.prototype._onClockTick=function(){var t=this,i=this.clock.currentTime;this._currentSubs.forEach(function(e,n){(n.start>i||n.end<i)&&(t._currentSubs.delete(n),t._removeSub(e))}),e.prototype._onClockTick.call(this);
},t.prototype._onClockPause=function(){e.prototype._onClockPause.call(this),this._subsWrapper.classList.add("paused")},t.prototype._onClockStop=function(){e.prototype._onClockStop.call(this),this._subsWrapper.style.display="none"},t.prototype._onClockRateChange=function(){if(e.prototype._onClockRateChange.call(this),this._preRenderedSubs.clear(),null!==this._animationStyleElement)for(;null!==this._animationStyleElement.firstChild;)this._animationStyleElement.removeChild(this._animationStyleElement.firstChild);
for(;null!==this._svgDefsElement.firstChild;)this._svgDefsElement.removeChild(this._svgDefsElement.firstChild)},t.prototype._ready=function(){this._dispatchEvent("ready",[])},t.prototype._removeSub=function(e){e.parentNode.removeChild(e)},t.prototype._removeAllSubs=function(){var e=this;this._currentSubs.forEach(function(t){return e._removeSub(t)}),this._currentSubs.clear()},t._transformOrigins=[null,[0,100],[50,100],[100,100],[0,50],[50,50],[100,50],[0,0],[50,0],[100,0]],t}(l.NullRenderer);e.WebRenderer=g,
h.mixin(g,[o.EventSource])},function(e,t){var i=t(17),n=t(29),s=function(){function e(e,t,i,n,s,a,r){this._scaleX=i,this._scaleY=n,this._settings=s,this._fontSizeElement=a,this._svgDefsElement=r,this._nextFilterId=0,this._id=e.id+"-"+t.id,this._defaultStyle=t.style,this.reset(null)}return e.prototype.reset=function(e){(void 0===e||null===e)&&(e=this._defaultStyle),this.italic=e.italic,this.bold=e.bold,this.underline=e.underline,this.strikeThrough=e.strikeThrough,this.outlineWidth=e.outlineThickness,
this.outlineHeight=e.outlineThickness,this.shadowDepthX=e.shadowDepth,this.shadowDepthY=e.shadowDepth,this.fontName=e.fontName,this.fontSize=e.fontSize,this.fontScaleX=e.fontScaleX,this.fontScaleY=e.fontScaleY,this.letterSpacing=e.letterSpacing,this._rotationX=null,this._rotationY=null,this._rotationZ=e.rotationZ,this._skewX=null,this._skewY=null,this.primaryColor=e.primaryColor,this.secondaryColor=e.secondaryColor,this.outlineColor=e.outlineColor,this.shadowColor=e.shadowColor,this.primaryAlpha=null,
this.secondaryAlpha=null,this.outlineAlpha=null,this.shadowAlpha=null,this.blur=null,this.gaussianBlur=null},e.prototype.setStylesOnSpan=function(t,n,s){var a=this,r=t.childNodes[0]instanceof Text,o="";this._italic&&(o+="italic "),this._bold===!0?o+="bold ":this._bold!==!1&&(o+=this._bold+" ");var l;l=r?(this._scaleY*e._getFontSize(this._fontName,this._fontSize*this._fontScaleY,this._fontSizeElement)).toFixed(3):(this._scaleY*e._getFontSize(this._fontName,this._fontSize,this._fontSizeElement)).toFixed(3);
var c=(this._scaleY*this._fontSize).toFixed(3);t.style.font=""+o+l+"px/"+c+'px "'+this._fontName+'"';var u="";this._underline&&(u="underline"),this._strikeThrough&&(u+=" line-through"),t.style.textDecoration=u.trim();var d="";if(r?this._fontScaleY!==this._fontScaleX&&(d+="scaleY("+(this._fontScaleY/this._fontScaleX).toFixed(3)+") "):(1!==this._fontScaleX&&(d+="scaleX("+this._fontScaleX+") "),1!==this._fontScaleY&&(d+="scaleY("+this._fontScaleY+") ")),null!==this._rotationY&&(d+="rotateY("+this._rotationY+"deg) "),
null!==this._rotationX&&(d+="rotateX("+this._rotationX+"deg) "),0!==this._rotationZ&&(d+="rotateZ("+-1*this._rotationZ+"deg) "),null!==this._skewX||null!==this._skewY){var h=e._valueOrDefault(this._skewX,0),p=e._valueOrDefault(this._skewY,0);d+="matrix(1, "+p+", "+h+", 1, 0, 0) "}""!==d&&(t.style.webkitTransform=d,t.style.webkitTransformOrigin="50% 50%",t.style.transform=d,t.style.transformOrigin="50% 50%",t.style.display="inline-block"),t.style.letterSpacing=(this._scaleX*this._letterSpacing).toFixed(3)+"px";
var f=this._primaryColor.withAlpha(this._primaryAlpha);t.style.color=f.toString();var m=this._outlineColor.withAlpha(this._outlineAlpha),g=this._scaleX*this._outlineWidth,v=this._scaleY*this._outlineHeight,y="",b="";if(this._settings.enableSvg){var w="svg-filter-"+this._id+"-"+this._nextFilterId++;if(g>0||v>0){var x="",S=0,C=!this._settings.preciseOutlines&&this._gaussianBlur>0?this._gaussianBlur:1;!function(e){if(v>=g)if(g>0){for(var t=0;g>=t;t+=C)e(t,v/g*Math.sqrt(g*g-t*t));t!==g+C&&e(g,0)}else e(0,v);else if(v>0){
for(var i=0;v>=i;i+=C)e(g/v*Math.sqrt(v*v-i*i),i);i!==v+C&&e(0,v)}else e(g,0)}(function(e,t){y+='	<feMorphology in="SourceAlpha" operator="dilate" radius="'+e.toFixed(3)+" "+t.toFixed(3)+'" result="outline'+S+'" />\n',x+='		<feMergeNode in="outline'+S+'" />\n',S++}),y+='	<feMerge result="outline">\n'+x+'\n	</feMerge>\n	<feFlood flood-color="'+m.toString()+'" />\n	<feComposite operator="in" in2="outline" />\n'}this._gaussianBlur>0&&(b+='	<feGaussianBlur stdDeviation="'+this._gaussianBlur+'" />\n');
for(var k=0;k<this._blur;k++)b+='	<feConvolveMatrix kernelMatrix="1 2 1 2 4 2 1 2 1" edgeMode="none" />\n'}else if(g>0||v>0){var P="";!function(e){for(var t=0;g>=t;t++)for(var i=0===g?v:v*Math.sqrt(1-t*t/(g*g)),n=0;i>=n;n++)e(t,n),0!==t&&e(-t,n),0!==n&&e(t,-n),0!==t&&0!==n&&e(-t,-n)}(function(e,t){P+=", "+m.toString()+" "+e+"px "+t+"px "+a._gaussianBlur.toFixed(3)+"px"}),t.style.textShadow=P.substr(", ".length)}var A=document.createElement("span");if(A.appendChild(t),""!==y||""!==b){var I='<filter xmlns="http://www.w3.org/2000/svg" id="'+w+'" x="-50%" width="200%" y="-50%" height="200%">\n'+y+"\n"+b+'\n	<feMerge>\n		<feMergeNode />\n		<feMergeNode in="SourceGraphic" />\n	</feMerge>\n</filter>\n',_=i.domParser.parseFromString(I,"image/svg+xml").childNodes[0];
this._svgDefsElement.appendChild(_),A.style.webkitFilter='url("#'+w+'")',A.style.filter='url("#'+w+'")'}if(0!==this._shadowDepthX||0!==this._shadowDepthY){var T=this._shadowColor.withAlpha(this._shadowAlpha),D=T.toString()+" "+(this._shadowDepthX*this._scaleX/this._fontScaleX).toFixed(3)+"px "+(this._shadowDepthY*this._scaleY/this._fontScaleY).toFixed(3)+"px 0px";""===t.style.textShadow?t.style.textShadow=D:t.style.textShadow+=", "+D}return(0!==this._rotationX||0!==this._rotationY)&&(A.style.display="inline-block"),
s.appendChild(document.createTextNode(n.cssText)),t.style.webkitAnimation=n.animationStyle,t.style.animation=n.animationStyle,A},e.prototype.makeNewLine=function(){var e=document.createElement("br");return e.style.lineHeight=(this._scaleY*this._fontSize).toFixed(3)+"px",e},Object.defineProperty(e.prototype,"italic",{set:function(t){this._italic=e._valueOrDefault(t,this._defaultStyle.italic)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bold",{set:function(t){this._bold=e._valueOrDefault(t,this._defaultStyle.bold);
},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"underline",{set:function(t){this._underline=e._valueOrDefault(t,this._defaultStyle.underline)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"strikeThrough",{set:function(t){this._strikeThrough=e._valueOrDefault(t,this._defaultStyle.strikeThrough)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outlineWidth",{set:function(t){this._outlineWidth=e._valueOrDefault(t,this._defaultStyle.outlineThickness);
},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outlineHeight",{set:function(t){this._outlineHeight=e._valueOrDefault(t,this._defaultStyle.outlineThickness)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shadowDepthX",{set:function(t){this._shadowDepthX=e._valueOrDefault(t,this._defaultStyle.shadowDepth)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shadowDepthY",{set:function(t){this._shadowDepthY=e._valueOrDefault(t,this._defaultStyle.shadowDepth);
},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"blur",{set:function(t){this._blur=e._valueOrDefault(t,0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"gaussianBlur",{set:function(t){this._gaussianBlur=e._valueOrDefault(t,0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fontName",{set:function(t){this._fontName=e._valueOrDefault(t,this._defaultStyle.fontName)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fontSize",{
set:function(t){this._fontSize=e._valueOrDefault(t,this._defaultStyle.fontSize)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fontScaleX",{set:function(t){this._fontScaleX=e._valueOrDefault(t,this._defaultStyle.fontScaleX)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fontScaleY",{set:function(t){this._fontScaleY=e._valueOrDefault(t,this._defaultStyle.fontScaleY)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"letterSpacing",{set:function(t){
this._letterSpacing=e._valueOrDefault(t,this._defaultStyle.letterSpacing)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rotationX",{set:function(e){this._rotationX=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rotationY",{set:function(e){this._rotationY=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rotationZ",{set:function(t){this._rotationZ=e._valueOrDefault(t,this._defaultStyle.rotationZ)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"skewX",{
set:function(e){this._skewX=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"skewY",{set:function(e){this._skewY=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"primaryColor",{get:function(){return this._primaryColor},set:function(t){this._primaryColor=e._valueOrDefault(t,this._defaultStyle.primaryColor)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"secondaryColor",{get:function(){return this._secondaryColor},set:function(t){this._secondaryColor=e._valueOrDefault(t,this._defaultStyle.secondaryColor);
},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outlineColor",{set:function(t){this._outlineColor=e._valueOrDefault(t,this._defaultStyle.outlineColor)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shadowColor",{set:function(t){this._shadowColor=e._valueOrDefault(t,this._defaultStyle.shadowColor)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"primaryAlpha",{get:function(){return this._primaryAlpha},set:function(e){this._primaryAlpha=e;
},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"secondaryAlpha",{get:function(){return this._secondaryAlpha},set:function(e){this._secondaryAlpha=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outlineAlpha",{set:function(e){this._outlineAlpha=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shadowAlpha",{set:function(e){this._shadowAlpha=e},enumerable:!0,configurable:!0}),e._getFontSize=function(t,i,s){var a=e._fontSizeCache.get(t);void 0===a&&e._fontSizeCache.set(t,a=new n.Map);
var r=a.get(i);return void 0===r&&(s.style.fontFamily=t,s.style.fontSize=i+"px",a.set(i,r=i*i/s.offsetHeight)),r},e._fontSizeCache=new n.Map,e._valueOrDefault=function(e,t){return null!==e?e:t},e}();e.SpanStyles=s},function(e){function t(t){e.debugMode=t}function i(t){e.verboseMode=t}e.debugMode=!1,e.verboseMode=!1,e.setDebugMode=t,e.setVerboseMode=i},function(t,i){var n=i(24),s=i(27),a=i(26),r=i(25),o=i(22),l=i(1),c=i(2),u=i(29),d=function(){function t(){if(this._properties=new a.ScriptProperties,
this._styles=new u.Map,this._dialogues=[],this._stylesFormatSpecifier=null,this._dialoguesFormatSpecifier=null,1===arguments.length)throw new Error("Constructor `new ASS(rawASS)` has been deprecated. Use `ASS.fromString(rawASS)` instead.")}return Object.defineProperty(t.prototype,"properties",{get:function(){return this._properties},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"styles",{get:function(){return this._styles},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dialogues",{
get:function(){return this._dialogues},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"stylesFormatSpecifier",{get:function(){return this._stylesFormatSpecifier},set:function(e){this._stylesFormatSpecifier=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dialoguesFormatSpecifier",{get:function(){return this._dialoguesFormatSpecifier},set:function(e){this._dialoguesFormatSpecifier=e},enumerable:!0,configurable:!0}),t.prototype.addStyle=function(e){var t=c.parseLineIntoTypedTemplate(e,this._stylesFormatSpecifier);
if(null!==t&&"Style"===t.type){var i=t.template;if(o.verboseMode){var n="";i.forEach(function(e,t){return n+=t+" = "+e+", "}),console.log("Read style: "+n)}var a=new s.Style(i);this._styles.set(a.name,a)}},t.prototype.addEvent=function(e){var t=c.parseLineIntoTypedTemplate(e,this._dialoguesFormatSpecifier);if(null!==t&&"Dialogue"===t.type){var i=t.template;if(o.verboseMode){var s="";i.forEach(function(e,t){return s+=t+" = "+e+", "}),console.log("Read dialogue: "+s)}this.dialogues.push(new n.Dialogue(i,this));
}},t.fromString=function(e,i){return void 0===i&&(i=r.Format.ASS),t.fromStream(new l.StringStream(e),i)},t.fromStream=function(e,t){switch(void 0===t&&(t=r.Format.ASS),t){case r.Format.ASS:return new l.StreamParser(e).ass;case r.Format.SRT:return new l.SrtStreamParser(e).ass;default:throw new Error("Illegal value of type: "+t)}},t.fromUrl=function(i,n){if(void 0===n&&(n=r.Format.ASS),"function"==typeof e.fetch&&"function"==typeof e.ReadableStream&&"function"==typeof e.ReadableStream.prototype.getReader&&"function"==typeof e.TextDecoder)return e.fetch(i).then(function(e){
return t.fromReadableStream(e.body,"utf-8",n)});var s=new XMLHttpRequest,a=t.fromStream(new l.XhrStream(s),n);return s.open("GET",i,!0),s.send(),a},t.fromReadableStream=function(e,i,n){return void 0===i&&(i="utf-8"),void 0===n&&(n=r.Format.ASS),t.fromStream(new l.BrowserReadableStream(e,i),n)},t}();t.ASS=d},function(e,t){var i=t(25),n=t(3),s=t(7),a=t(22),r=function(){function e(t,n){this._parts=null,this._sub=null,this._id=++e._lastDialogueId;var s=t.get("Style");if(this._style=n.styles.get(s),void 0===this._style)throw new Error("Unrecognized style "+s);
if(this._start=e._toTime(t.get("Start")),this._end=e._toTime(t.get("End")),this._layer=Math.max(i.valueOrDefault(t,"Layer",parseInt,function(e){return!isNaN(e)},"0"),0),this._rawPartsString=t.get("Text"),void 0===this._rawPartsString||null===this._rawPartsString||this._rawPartsString.constructor!==String)throw new Error("Dialogue doesn't have any text.")}return Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"start",{
get:function(){return this._start},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"end",{get:function(){return this._end},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"style",{get:function(){return this._style},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return null===this._parts&&this._parsePartsString(),this._alignment},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"layer",{get:function(){
return this._layer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parts",{get:function(){return null===this._parts&&this._parsePartsString(),this._parts},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return"#"+this._id+" ["+this._start.toFixed(3)+"-"+this._end.toFixed(3)+"] "+(null!==this._parts?this._parts.join(", "):this._rawPartsString)},e.prototype._parsePartsString=function(){var e=this;if(this._parts=n.parse(this._rawPartsString,"dialogueParts"),this._alignment=this._style.alignment,
this._parts.forEach(function(t,i){t instanceof s.Alignment?e._alignment=t.value:t instanceof s.Move?(null===t.t1||null===t.t2)&&(e._parts[i]=new s.Move(t.x1,t.y1,t.x2,t.y2,0,e._end-e._start)):t instanceof s.Transform&&(null===t.start||null===t.end||null===t.accel)&&(e._parts[i]=new s.Transform(null===t.start?0:t.start,null===t.end?e._end-e._start:t.end,null===t.accel?1:t.accel,t.tags))}),a.debugMode){var t=this._parts.filter(function(e){return e instanceof s.Comment&&-1!==e.value.indexOf("\\")});t.length>0&&console.warn("Possible incorrect parse:\n"+this._rawPartsString+"\nwas parsed as\n"+this.toString()+"\nThe possibly incorrect parses are:\n"+t.join("\n"));
}},e._toTime=function(e){return e.split(":").reduce(function(e,t){return 60*e+parseFloat(t)},0)},e._lastDialogueId=-1,e}();e.Dialogue=r},function(e){function t(e,t,i,n,s){var a=e.get(t);if(void 0===a)return i(s);try{var r=i(a);if(null!==n&&!n(r))throw new Error("Validation failed.");return r}catch(o){throw new Error("Property "+t+" has invalid value "+a+" - "+o.stack)}}!function(e){e[e.ASS=0]="ASS",e[e.SRT=1]="SRT"}(e.Format||(e.Format={})),function(e){e[e.SmartWrappingWithWiderTopLine=0]="SmartWrappingWithWiderTopLine",
e[e.SmartWrappingWithWiderBottomLine=3]="SmartWrappingWithWiderBottomLine",e[e.EndOfLineWrapping=1]="EndOfLineWrapping",e[e.NoLineWrapping=2]="NoLineWrapping"}(e.WrappingStyle||(e.WrappingStyle={})),function(e){e[e.Outline=1]="Outline",e[e.OpaqueBox=3]="OpaqueBox"}(e.BorderStyle||(e.BorderStyle={})),e.valueOrDefault=t},function(e){var t=function(){function e(){}return Object.defineProperty(e.prototype,"resolutionX",{get:function(){return this._resolutionX},set:function(e){this._resolutionX=e},enumerable:!0,
configurable:!0}),Object.defineProperty(e.prototype,"resolutionY",{get:function(){return this._resolutionY},set:function(e){this._resolutionY=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wrappingStyle",{get:function(){return this._wrappingStyle},set:function(e){this._wrappingStyle=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scaleBorderAndShadow",{get:function(){return this._scaleBorderAndShadow},set:function(e){this._scaleBorderAndShadow=e},enumerable:!0,
configurable:!0}),e}();e.ScriptProperties=t},function(e,t){var i=t(25),n=t(3),s=function(){function e(e){if(this._name=e.get("Name"),void 0===this._name||null===this._name||this._name.constructor!==String)throw new Error("Style doesn't have a name.");this._italic="-1"===e.get("Italic"),this._bold="-1"===e.get("Bold"),this._underline="-1"===e.get("Underline"),this._strikeThrough="-1"===e.get("StrikeOut"),this._fontName=e.get("Fontname"),this._fontSize=i.valueOrDefault(e,"Fontsize",parseFloat,function(e){
return!isNaN(e)},"50"),this._fontScaleX=i.valueOrDefault(e,"ScaleX",parseFloat,function(e){return!isNaN(e)},"100")/100,this._fontScaleY=i.valueOrDefault(e,"ScaleY",parseFloat,function(e){return!isNaN(e)},"100")/100,this._letterSpacing=i.valueOrDefault(e,"Spacing",parseFloat,function(e){return!isNaN(e)},"0"),this._rotationZ=i.valueOrDefault(e,"Angle",parseFloat,function(e){return!isNaN(e)},"0"),this._primaryColor=i.valueOrDefault(e,"PrimaryColour",function(e){return n.parse(e,"colorWithAlpha")},null,"&H0000FFFF"),
this._secondaryColor=i.valueOrDefault(e,"SecondaryColour",function(e){return n.parse(e,"colorWithAlpha")},null,"&H00000000"),this._outlineColor=i.valueOrDefault(e,"OutlineColour",function(e){return n.parse(e,"colorWithAlpha")},null,"&H00000000"),this._shadowColor=i.valueOrDefault(e,"BackColour",function(e){return n.parse(e,"colorWithAlpha")},null,"&H00000000"),this._outlineThickness=i.valueOrDefault(e,"Outline",parseFloat,function(e){return!isNaN(e)},"1"),this._borderStyle=i.valueOrDefault(e,"BorderStyle",parseInt,function(e){
return!isNaN(e)},"1"),this._shadowDepth=i.valueOrDefault(e,"Shadow",parseFloat,function(e){return!isNaN(e)},"1"),this._alignment=i.valueOrDefault(e,"Alignment",parseInt,function(e){return!isNaN(e)},"2"),this._marginLeft=i.valueOrDefault(e,"MarginL",parseFloat,function(e){return!isNaN(e)},"80"),this._marginRight=i.valueOrDefault(e,"MarginR",parseFloat,function(e){return!isNaN(e)},"80"),this._marginVertical=i.valueOrDefault(e,"MarginV",parseFloat,function(e){return!isNaN(e)},"35")}return Object.defineProperty(e.prototype,"name",{
get:function(){return this._name},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"italic",{get:function(){return this._italic},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bold",{get:function(){return this._bold},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"underline",{get:function(){return this._underline},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"strikeThrough",{get:function(){return this._strikeThrough},enumerable:!0,
configurable:!0}),Object.defineProperty(e.prototype,"fontName",{get:function(){return this._fontName},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fontSize",{get:function(){return this._fontSize},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fontScaleX",{get:function(){return this._fontScaleX},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fontScaleY",{get:function(){return this._fontScaleY},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"letterSpacing",{
get:function(){return this._letterSpacing},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rotationZ",{get:function(){return this._rotationZ},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"primaryColor",{get:function(){return this._primaryColor},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"secondaryColor",{get:function(){return this._secondaryColor},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outlineColor",{get:function(){
return this._outlineColor},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shadowColor",{get:function(){return this._shadowColor},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outlineThickness",{get:function(){return this._outlineThickness},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"borderStyle",{get:function(){return this._borderStyle},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shadowDepth",{get:function(){return this._shadowDepth;
},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this._alignment},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"marginLeft",{get:function(){return this._marginLeft},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"marginRight",{get:function(){return this._marginRight},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"marginVertical",{get:function(){return this._marginVertical},enumerable:!0,
configurable:!0}),e}();e.Style=s},function(e){function t(e,t){function i(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);i.prototype=t.prototype,e.prototype=new i}e.__extends=t},function(t){function i(e){null!==e?t.Map=e:t.Map=n}var n=function(){function e(e){if(this.clear(),void 0!==e){if(!Array.isArray(e))throw new Error("Non-array iterables are not supported by the SimpleMap constructor.");for(var t=0;t<e.length;t++){var i=e[t];this.set(i[0],i[1])}}}return e.prototype.get=function(e){
var t=this._keyToProperty(e);if(null!==t)return this._values[t]},e.prototype.has=function(e){var t=this._keyToProperty(e);return null===t?!1:t in this._keys},e.prototype.set=function(e,t){var i=this._keyToProperty(e);if(null===i)throw new Error("This Map implementation only supports Number and String keys, or keys with an id property.");return i in this._keys||this._size++,this._keys[i]=e,this._values[i]=t,this},e.prototype.delete=function(e){var t=this._keyToProperty(e);if(null===t)return!1;var i=t in this._keys;
return i&&(delete this._keys[t],delete this._values[t],this._size--),i},e.prototype.clear=function(){this._keys=Object.create(null),this._values=Object.create(null),this._size=0},e.prototype.forEach=function(e,t){for(var i=0,n=Object.keys(this._keys);i<n.length;i++){var s=n[i];e.call(t,this._values[s],this._keys[s],this)}},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),e.prototype._keyToProperty=function(e){return"number"==typeof e?"#"+e:"string"==typeof e?"'"+e:void 0!==e.id?"!"+e.id:null;
},e}();t.Map=e.Map,(void 0===t.Map||"function"!=typeof t.Map.prototype.forEach||function(){try{return 2!==new t.Map([[1,"foo"],[2,"bar"]]).size}catch(e){return!0}}())&&(t.Map=n),t.setImplementation=i},function(e){function t(e,t){for(var i=0;i<t.length;i++)for(var n=t[i],s=0,a=Object.getOwnPropertyNames(n.prototype);s<a.length;s++){var r=a[s];e.prototype[r]=n.prototype[r]}}e.mixin=t},function(t){function i(e){null!==e?t.Promise=e:t.Promise=s}var n,s=function(){function i(e){var t=this;this._state=n.PENDING,
this._thens=[],this._propagateIsPending=!1,this._alreadyFulfilledValue=null,this._alreadyRejectedReason=null;try{e(function(e){return t._resolve(e)},function(e){return t._reject(e)})}catch(i){this._reject(i)}}return i.prototype.then=function(e,i){var n=this;if(e="function"==typeof e?e:null,i="function"==typeof i?i:null,null===e&&null===i)return this;null===e&&(e=function(e){return e}),null===i&&(i=function(e){throw e});var s=new t.Promise(function(t,s){n._thens.push({propagateFulfilling:function(i){
try{t(e(i))}catch(n){s(n)}},propagateRejection:function(e){try{t(i(e))}catch(n){s(n)}}})});return this._propagateResolution(),s},i.prototype.catch=function(e){return this.then(null,e)},i.prototype.isFulfilled=function(){return this._state===n.FULFILLED},i.prototype.isRejected=function(){return this._state===n.REJECTED},i.prototype.isPending=function(){return this._state===n.PENDING},i.prototype.value=function(){if(this._state!==n.FULFILLED)throw new Error("This promise is not in FULFILLED state.");
return this._alreadyFulfilledValue},i.prototype.reason=function(){if(this._state!==n.REJECTED)throw new Error("This promise is not in FULFILLED state.");return this._alreadyRejectedReason},i.resolve=function(e){return e instanceof i?e:new t.Promise(function(t){return t(e)})},i.all=function(e){return new t.Promise(function(i,n){var s=[],a=e.length;return 0===a?void i(s):void e.forEach(function(e,n){return t.Promise.resolve(e).then(function(e){s[n]=e,a--,0===a&&i(s)})},n)})},i.prototype._resolve=function(e){
var t=this,n=!1;try{if(e===this)throw new TypeError("2.3.1");var s=i._getThenMethod(e);if(null===s)return void this._fulfill(e);s.call(e,function(e){n||(n=!0,t._resolve(e))},function(e){n||(n=!0,t._reject(e))})}catch(a){if(n)return;this._reject(a)}},i.prototype._fulfill=function(e){this._state===n.PENDING&&(this._state=n.FULFILLED,this._alreadyFulfilledValue=e,this._propagateResolution())},i.prototype._reject=function(e){this._state===n.PENDING&&(this._state=n.REJECTED,this._alreadyRejectedReason=e,
this._propagateResolution())},i._getThenMethod=function(e){if("object"!=typeof e&&"function"!=typeof e)return null;if(null===e||void 0===e)return null;var t=e.then;return"function"!=typeof t?null:t},i.prototype._propagateResolution=function(){var e=this;this._state!==n.PENDING&&(this._propagateIsPending||(this._propagateIsPending=!0,i._nextTick(function(){if(e._propagateIsPending=!1,e._state===n.FULFILLED)for(;e._thens.length>0;){var t=e._thens.shift();t.propagateFulfilling(e._alreadyFulfilledValue);
}else if(e._state===n.REJECTED)for(;e._thens.length>0;){var t=e._thens.shift();t.propagateRejection(e._alreadyRejectedReason)}})))},i._nextTick=function(){var t=e.MutationObserver||e.WebkitMutationObserver;if(void 0!==e.process&&"function"==typeof e.process.nextTick)return function(t){e.process.nextTick(t)};if(void 0!==t){var i=[],n=!1,s=document.createElement("div"),a=new t(function(){var e=i;i=[];for(var t=0;t<e.length;t++){var a=e[t];a()}n=!1,i.length>0&&(s.classList.toggle("foo"),n=!0)});return a.observe(s,{
attributes:!0}),function(e){i.push(e),n||(s.classList.toggle("foo"),n=!0)}}return function(e){return setTimeout(e,0)}}(),i}();!function(e){e[e.PENDING=0]="PENDING",e[e.FULFILLED=1]="FULFILLED",e[e.REJECTED=2]="REJECTED"}(n||(n={})),t.Promise=e.Promise,void 0===t.Promise&&(t.Promise=s),t.setImplementation=i;var a=function(){function e(){var e=this;this._promise=new t.Promise(function(t,i){e._resolve=t,e._reject=i})}return Object.defineProperty(e.prototype,"promise",{get:function(){return this._promise;
},enumerable:!0,configurable:!0}),e.prototype.resolve=function(e){this._resolve(e)},e.prototype.reject=function(e){this._reject(e)},e}();t.DeferredPromise=a},function(t){function i(e){null!==e?t.Set=e:t.Set=n}var n=function(){function e(e){if(this.clear(),void 0!==e){if(!Array.isArray(e))throw new Error("Non-array iterables are not supported by the SimpleSet constructor.");for(var t=0;t<e.length;t++){var i=e[t];this.add(i)}}}return e.prototype.add=function(e){var t=this._toProperty(e);if(null===t)throw new Error("This Set implementation only supports Number and String values.");
return t in this._elements||this._size++,this._elements[t]=e,this},e.prototype.clear=function(){this._elements=Object.create(null),this._size=0},e.prototype.has=function(e){var t=this._toProperty(e);return null===t?!1:t in this._elements},e.prototype.forEach=function(e,t){for(var i=0,n=Object.keys(this._elements);i<n.length;i++){var s=n[i],a=this._elements[s];e.call(t,a,a,this)}},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),e.prototype._toProperty=function(e){
return"number"==typeof e?"#"+e:"string"==typeof e?"'"+e:null},e}();t.Set=e.Set,(void 0===t.Set||"function"!=typeof t.Set.prototype.forEach||function(){try{return 2!==new t.Set([1,2]).size}catch(e){return!0}}())&&(t.Set=n),t.setImplementation=i},function(e,t){var i=t(29),n=t(31),s=t(34),a=t(36),r=function(){function e(e){var t=this;this._comm=e,this._pendingRequests=new i.Map,this._comm.addEventListener("message",function(e){return t._onMessage(e.data)},!1)}return e.prototype.request=function(t,i){
var s=new n.DeferredPromise,r=++e._lastRequestId;this._pendingRequests.set(r,s);var o={requestId:r,command:t,parameters:i};return this._comm.postMessage(a.serialize(o)),s.promise},e.prototype.cancelRequest=function(e){var t=this._pendingRequests.get(e);void 0!==t&&(this._pendingRequests.delete(e),t.reject(new Error("Cancelled.")))},e.prototype._respond=function(e){var t=e.requestId,i=e.error,n=e.result;i instanceof Error&&(i={message:i.message,stack:i.stack}),this._comm.postMessage(a.serialize({command:s.WorkerCommands.Response,
requestId:t,error:i,result:n}))},e.prototype._onMessage=function(e){var t=this,i=a.deserialize(e);if(i.command===s.WorkerCommands.Response){var n=i,r=this._pendingRequests.get(n.requestId);void 0!==r&&(this._pendingRequests.delete(n.requestId),null===n.error?r.resolve(n.result):r.reject(n.error))}else{var o=i,l=o.requestId,c=a.getWorkerCommandHandler(o.command);if(void 0===c)return void this._respond({requestId:l,error:new Error("No handler registered for command "+o.command),result:null});c(o.parameters).then(function(e){
return{requestId:l,error:null,result:e}},function(e){return{requestId:l,error:e,result:null}}).then(function(e){return t._respond(e)})}},e._lastRequestId=-1,e}();e.WorkerChannelImpl=r,a.registerWorkerCommand(s.WorkerCommands.Ping,function(){return new n.Promise(function(e){return e()})})},function(e){!function(e){e[e.Response=0]="Response",e[e.Parse=1]="Parse",e[e.Ping=2]="Ping"}(e.WorkerCommands||(e.WorkerCommands={}))},function(t,i){function n(e){return void 0===e&&(e=r.src),new s.WorkerChannelImpl(new Worker(e));
}var s=i(33),a=i(34);t.WorkerCommands=a.WorkerCommands,t.supported="undefined"!=typeof Worker,t.createWorker=n;var r=null;"undefined"!=typeof document&&void 0!==document.currentScript&&(r=document.currentScript),"undefined"!=typeof WorkerGlobalScope&&e instanceof WorkerGlobalScope&&new s.WorkerChannelImpl(e)},function(e,t){function i(e,t){l.set(e,t)}function n(e){return l.get(e)}function s(e){e._classTag=c.size,c.set(e._classTag,e)}function a(e){return JSON.stringify(e,function(e,t){return t&&void 0!==t._classTag&&(t._classTag=t._classTag),
t})}function r(e){return JSON.parse(e,function(e,t){if(t&&void 0!==t._classTag){for(var i=Object.create(c.get(t._classTag)),n=0,s=Object.keys(t);n<s.length;n++){var a=s[n];"_classTag"!==a&&(i[a]=t[a])}t=i}return t})}var o=t(29),l=new o.Map,c=new o.Map;e.registerWorkerCommand=i,e.getWorkerCommandHandler=n,e.registerClassPrototype=s,e.serialize=a,e.deserialize=r}])})},,function(e,t,i){var n;!function(s,a,r){function o(e,t,i){return e.addEventListener?void e.addEventListener(t,i,!1):void e.attachEvent("on"+t,i);
}function l(e){if("keypress"==e.type){var t=String.fromCharCode(e.which);return e.shiftKey||(t=t.toLowerCase()),t}return x[e.which]?x[e.which]:S[e.which]?S[e.which]:String.fromCharCode(e.which).toLowerCase()}function c(e,t){return e.sort().join(",")===t.sort().join(",")}function u(e){var t=[];return e.shiftKey&&t.push("shift"),e.altKey&&t.push("alt"),e.ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),t}function d(e){return e.preventDefault?void e.preventDefault():void(e.returnValue=!1)}function h(e){
return e.stopPropagation?void e.stopPropagation():void(e.cancelBubble=!0)}function p(e){return"shift"==e||"ctrl"==e||"alt"==e||"meta"==e}function f(){if(!w){w={};for(var e in x)e>95&&112>e||x.hasOwnProperty(e)&&(w[x[e]]=e)}return w}function m(e,t,i){return i||(i=f()[e]?"keydown":"keypress"),"keypress"==i&&t.length&&(i="keydown"),i}function g(e){return"+"===e?["+"]:(e=e.replace(/\+{2}/g,"+plus"),e.split("+"))}function v(e,t){var i,n,s,a=[];for(i=g(e),s=0;s<i.length;++s)n=i[s],k[n]&&(n=k[n]),t&&"keypress"!=t&&C[n]&&(n=C[n],
a.push("shift")),p(n)&&a.push(n);return t=m(n,a,t),{key:n,modifiers:a,action:t}}function y(e,t){return null===e||e===a?!1:e===t?!0:y(e.parentNode,t)}function b(e){function t(e){e=e||{};var t,i=!1;for(t in w)e[t]?i=!0:w[t]=0;i||(C=!1)}function i(e,t,i,n,s,a){var r,o,l=[],u=i.type;if(!g._callbacks[e])return[];for("keyup"==u&&p(e)&&(t=[e]),r=0;r<g._callbacks[e].length;++r)if(o=g._callbacks[e][r],(n||!o.seq||w[o.seq]==o.level)&&u==o.action&&("keypress"==u&&!i.metaKey&&!i.ctrlKey||c(t,o.modifiers))){var d=!n&&o.combo==s,h=n&&o.seq==n&&o.level==a;
(d||h)&&g._callbacks[e].splice(r,1),l.push(o)}return l}function n(e,t,i,n){g.stopCallback(t,t.target||t.srcElement,i,n)||e(t,i)===!1&&(d(t),h(t))}function s(e){"number"!=typeof e.which&&(e.which=e.keyCode);var t=l(e);if(t)return"keyup"==e.type&&x===t?void(x=!1):void g.handleKey(t,u(e),e)}function r(){clearTimeout(y),y=setTimeout(t,1e3)}function f(e,i,s,a){function o(t){return function(){C=t,++w[e],r()}}function c(i){n(s,i,e),"keyup"!==a&&(x=l(i)),setTimeout(t,10)}w[e]=0;for(var u=0;u<i.length;++u){
var d=u+1===i.length,h=d?c:o(a||v(i[u+1]).action);m(i[u],h,a,e,u)}}function m(e,t,n,s,a){g._directMap[e+":"+n]=t,e=e.replace(/\s+/g," ");var r,o=e.split(" ");return o.length>1?void f(e,o,t,n):(r=v(e,n),g._callbacks[r.key]=g._callbacks[r.key]||[],i(r.key,r.modifiers,{type:r.action},s,e,a),void g._callbacks[r.key][s?"unshift":"push"]({callback:t,modifiers:r.modifiers,action:r.action,seq:s,level:a,combo:e}))}var g=this;if(e=e||a,!(g instanceof b))return new b(e);g.target=e,g._callbacks={},g._directMap={};
var y,w={},x=!1,S=!1,C=!1;g._handleKey=function(e,s,a){var r,o=i(e,s,a),l={},c=0,u=!1;for(r=0;r<o.length;++r)o[r].seq&&(c=Math.max(c,o[r].level));for(r=0;r<o.length;++r)if(o[r].seq){if(o[r].level!=c)continue;u=!0,l[o[r].seq]=1,n(o[r].callback,a,o[r].combo,o[r].seq)}else u||n(o[r].callback,a,o[r].combo);var d="keypress"==a.type&&S;a.type!=C||p(e)||d||t(l),S=u&&"keydown"==a.type},g._bindMultiple=function(e,t,i){for(var n=0;n<e.length;++n)m(e[n],t,i)},o(e,"keypress",s),o(e,"keydown",s),o(e,"keyup",s);
}for(var w,x={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},S={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},C={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",
">":".","?":"/","|":"\\"},k={option:"alt",command:"meta","return":"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},P=1;20>P;++P)x[111+P]="f"+P;for(P=0;9>=P;++P)x[P+96]=P;b.prototype.bind=function(e,t,i){var n=this;return e=e instanceof Array?e:[e],n._bindMultiple.call(n,e,t,i),n},b.prototype.unbind=function(e,t){var i=this;return i.bind.call(i,e,function(){},t)},b.prototype.trigger=function(e,t){var i=this;return i._directMap[e+":"+t]&&i._directMap[e+":"+t]({},e),
i},b.prototype.reset=function(){var e=this;return e._callbacks={},e._directMap={},e},b.prototype.stopCallback=function(e,t){var i=this;return(" "+t.className+" ").indexOf(" mousetrap ")>-1?!1:y(t,i.target)?!1:"INPUT"==t.tagName||"SELECT"==t.tagName||"TEXTAREA"==t.tagName||t.isContentEditable},b.prototype.handleKey=function(){var e=this;return e._handleKey.apply(e,arguments)},b.init=function(){var e=b(a);for(var t in e)"_"!==t.charAt(0)&&(b[t]=function(t){return function(){return e[t].apply(e,arguments);
}}(t))},b.init(),s.Mousetrap=b,"undefined"!=typeof e&&e.exports&&(e.exports=b),n=function(){return b}.call(t,i,t,e),!(n!==r&&(e.exports=n))}(window,document)}]);