function _defineProperty(n,t,i){return t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function _defineProperty(n,t,i){return t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function _toConsumableArray(n){if(Array.isArray(n)){for(var t=0,i=Array(n.length);t<n.length;t++)i[t]=n[t];return i}return Array.from(n)}function _defineProperty(n,t,i){return t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function _defineProperty(n,t,i){return t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function _toConsumableArray(n){if(Array.isArray(n)){for(var t=0,i=Array(n.length);t<n.length;t++)i[t]=n[t];return i}return Array.from(n)}function _defineProperty(n,t,i){return t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function _defineProperty(n,t,i){return t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function _defineProperty(n,t,i){return t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function _defineProperty(n,t,i){return t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function _toConsumableArray(n){if(Array.isArray(n)){for(var t=0,i=Array(n.length);t<n.length;t++)i[t]=n[t];return i}return Array.from(n)}function _defineProperty(n,t,i){return t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function _defineProperty(n,t,i){return t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n};this.ClickView=this.ClickView||{};this.ClickView.SearchApp=this.ClickView.SearchApp||{};this.ClickView.SearchApp.Templates=this.ClickView.SearchApp.Templates||{};this.ClickView.SearchApp.Templates.SearchApp=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="results-container">\r\n    <div class="results-viewpart"><\/div>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.SearchApp=this.ClickView.SearchApp||{};this.ClickView.SearchApp.Templates=this.ClickView.SearchApp.Templates||{};this.ClickView.SearchApp.Templates.DurationFilterItem=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return n.escapeExpression("function"==typeof(f=null!=(f=i.name||(null!=t?t.name:t))?f:i.helperMissing)?f.call(null!=t?t:n.nullContext||{},{name:"name",hash:{},data:u}):f)},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.SearchApp=this.ClickView.SearchApp||{};this.ClickView.SearchApp.Templates=this.ClickView.SearchApp.Templates||{};this.ClickView.SearchApp.Templates.FilterItem=Handlebars.template({1:function(n,t,i,r,u){var c,f,e=null!=t?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<div class="radiobox">\r\n    <input type="radio" name="'+h((void 0===(f=null!=(f=i.group||(null!=t?t.group:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"group",hash:{},data:u}):f)+'" id="'+h((void 0===(f=null!=(f=i.id||(null!=t?t.id:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"id",hash:{},data:u}):f)+'" class="nav-radio" value="'+h((void 0===(f=null!=(f=i.value||(null!=t?t.value:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"value",hash:{},data:u}):f)+'" '+(null!=(c=i.if.call(e,null!=t?t.active:t,{name:"if",hash:{},fn:n.program(2,u,0),inverse:n.noop,data:u}))?c:"")+'>\r\n    <label for="'+h((void 0===(f=null!=(f=i.id||(null!=t?t.id:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"id",hash:{},data:u}):f)+'"><\/label>\r\n<\/div><!--\r\n--><label for="'+h((void 0===(f=null!=(f=i.id||(null!=t?t.id:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"id",hash:{},data:u}):f)+'" class="filter-label">\r\n    '+(null!=(c=i.if.call(e,null!=t?t.rating:t,{name:"if",hash:{},fn:n.program(4,u,0),inverse:n.program(6,u,0),data:u}))?c:"")+"\r\n<\/label>\r\n"},2:function(){return"checked"},4:function(n,t,i,r,u){var f;return" "+n.escapeExpression("function"==typeof(f=null!=(f=i.code||(null!=t?t.code:t))?f:i.helperMissing)?f.call(null!=t?t:n.nullContext||{},{name:"code",hash:{},data:u}):f)+" "},6:function(n,t,i,r,u){var f;return" "+n.escapeExpression("function"==typeof(f=null!=(f=i.name||(null!=t?t.name:t))?f:i.helperMissing)?f.call(null!=t?t:n.nullContext||{},{name:"name",hash:{},data:u}):f)+" "},8:function(n,t,i,r,u){var f,e=null!=t?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<div class="checkbox">\r\n    <input type="checkbox" name="checkbox" id="'+h((void 0===(f=null!=(f=i.id||(null!=t?t.id:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"id",hash:{},data:u}):f)+'">\r\n    <label for="'+h((void 0===(f=null!=(f=i.id||(null!=t?t.id:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"id",hash:{},data:u}):f)+'"><\/label>\r\n<\/div><!--\r\n--><label for="'+h((void 0===(f=null!=(f=i.id||(null!=t?t.id:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"id",hash:{},data:u}):f)+'" class="filter-label">'+h((void 0===(f=null!=(f=i.name||(null!=t?t.name:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"name",hash:{},data:u}):f)+"<\/label>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return null!=(f=i.if.call(null!=t?t:n.nullContext||{},null!=t?t.isExclusive:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(8,u,0),data:u}))?f:""},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.SearchApp=this.ClickView.SearchApp||{};this.ClickView.SearchApp.Templates=this.ClickView.SearchApp.Templates||{};this.ClickView.SearchApp.Templates.FilterList=Handlebars.template({1:function(){return'    <span class="clear-filters">Clear<\/span>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var e,f,o=null!=t?t:n.nullContext||{};return"<h3>"+n.escapeExpression("function"==typeof(f=null!=(f=i.title||(null!=t?t.title:t))?f:i.helperMissing)?f.call(o,{name:"title",hash:{},data:u}):f)+"<\/h3>\r\n"+(null!=(e=i.if.call(o,null!=t?t.showClear:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))?e:"")+'<ul class="list-viewpart"><\/ul>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.SearchApp=this.ClickView.SearchApp||{};this.ClickView.SearchApp.Templates=this.ClickView.SearchApp.Templates||{};this.ClickView.SearchApp.Templates.Filters=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="header-viewpart"><\/div>\r\n<div class="body-viewpart"><\/div>\r\n<div class="show-more-container"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.SearchApp=this.ClickView.SearchApp||{};this.ClickView.SearchApp.Templates=this.ClickView.SearchApp.Templates||{};this.ClickView.SearchApp.Templates.FiltersHeader=Handlebars.template({1:function(){return'<span class="clear-filters">Clear Filters<\/span>'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return"<h2>Filter results<\/h2>\r\n"+(null!=(f=i.if.call(null!=t?t:n.nullContext||{},null!=t?t.showClear:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))?f:"")},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.SearchApp=this.ClickView.SearchApp||{};this.ClickView.SearchApp.Templates=this.ClickView.SearchApp.Templates||{};this.ClickView.SearchApp.Templates.ProductionFilter=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return"<li>\r\n    <form>\r\n        <h3>"+n.escapeExpression("function"==typeof(f=null!=(f=i.title||(null!=t?t.title:t))?f:i.helperMissing)?f.call(null!=t?t:n.nullContext||{},{name:"title",hash:{},data:u}):f)+'<\/h3>\r\n\r\n        <div class="form-group">\r\n            <input type="number" class="small" placeholder="From" name="min">\r\n        <\/div>\r\n\r\n        <div class="form-group">\r\n            <input type="number" class="small" placeholder="To" name="max">\r\n        <\/div>\r\n\r\n        <button type="submit">Search<\/button>\r\n        <ul class="error-messages">\r\n            <li class="help-block error-min error-message hidden"><\/li>\r\n            <li class="help-block error-max error-message hidden"><\/li>\r\n        <\/ul>\r\n    <\/form>\r\n<\/li>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.SearchApp=this.ClickView.SearchApp||{};this.ClickView.SearchApp.Templates=this.ClickView.SearchApp.Templates||{};this.ClickView.SearchApp.Templates.RatingFilterItem=Handlebars.template({1:function(){return"highlight"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var c,f,e=null!=t?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<input type="radio" id="rating-'+h((void 0===(f=null!=(f=i.code||(null!=t?t.code:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"code",hash:{},data:u}):f)+'" value="'+h((void 0===(f=null!=(f=i.value||(null!=t?t.value:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"value",hash:{},data:u}):f)+'" name="rating">\r\n<label for="rating-'+h((void 0===(f=null!=(f=i.code||(null!=t?t.code:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"code",hash:{},data:u}):f)+'" class="'+(null!=(c=i.if.call(e,null!=t?t.shouldHighlight:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))?c:"")+'">'+h((void 0===(f=null!=(f=i.code||(null!=t?t.code:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"code",hash:{},data:u}):f)+"<\/label>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.SearchApp=this.ClickView.SearchApp||{};this.ClickView.SearchApp.Templates=this.ClickView.SearchApp.Templates||{};this.ClickView.SearchApp.Templates.RatingItem=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return n.escapeExpression("function"==typeof(f=null!=(f=i.name||(null!=t?t.name:t))?f:i.helperMissing)?f.call(null!=t?t:n.nullContext||{},{name:"name",hash:{},data:u}):f)},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.SearchApp=this.ClickView.SearchApp||{};this.ClickView.SearchApp.Templates=this.ClickView.SearchApp.Templates||{};this.ClickView.SearchApp.Templates.AlbertSuggestion=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="albert-suggestion">\r\n    Albert Search \r\n    <img class="mini-albert" src="/Assets/images/search/tiny-albert@2x.png"/>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.SearchApp=this.ClickView.SearchApp||{};this.ClickView.SearchApp.Templates=this.ClickView.SearchApp.Templates||{};this.ClickView.SearchApp.Templates.CategoryResult=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=null!=t?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<div><a href="'+h((void 0===(f=null!=(f=i.url||(null!=t?t.url:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"url",hash:{},data:u}):f)+'">'+h((void 0===(f=null!=(f=i.name||(null!=t?t.name:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"name",hash:{},data:u}):f)+" - "+h((void 0===(f=null!=(f=i.libraryName||(null!=t?t.libraryName:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"libraryName",hash:{},data:u}):f)+"<\/a><\/div>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.SearchApp=this.ClickView.SearchApp||{};this.ClickView.SearchApp.Templates=this.ClickView.SearchApp.Templates||{};this.ClickView.SearchApp.Templates.DatasetFooter=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="suggestion-seperator"><\/div>\r\n'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.SearchApp=this.ClickView.SearchApp||{};this.ClickView.SearchApp.Templates=this.ClickView.SearchApp.Templates||{};this.ClickView.SearchApp.Templates.DatasetHeader=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){return'<h5 class="suggestion-header">'+n.escapeExpression((i.capitalise||t&&t.capitalise||i.helperMissing).call(null!=t?t:n.nullContext||{},null!=t?t.dataset:t,{name:"capitalise",hash:{},data:u}))+"<\/h5>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.SearchApp=this.ClickView.SearchApp||{};this.ClickView.SearchApp.Templates=this.ClickView.SearchApp.Templates||{};this.ClickView.SearchApp.Templates.DirectSearchSuggestion=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<div class="direct-search-suggestion"><span class="search-for-label">Search for<\/span>\r\n    <span class="query-text">'+n.escapeExpression("function"==typeof(f=null!=(f=i.query||(null!=t?t.query:t))?f:i.helperMissing)?f.call(null!=t?t:n.nullContext||{},{name:"query",hash:{},data:u}):f)+"<\/span>\r\n<\/div>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.SearchApp=this.ClickView.SearchApp||{};this.ClickView.SearchApp.Templates=this.ClickView.SearchApp.Templates||{};this.ClickView.SearchApp.Templates.NotFound=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="tt-not-found"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.SearchApp=this.ClickView.SearchApp||{};this.ClickView.SearchApp.Templates=this.ClickView.SearchApp.Templates||{};this.ClickView.SearchApp.Templates.PartialLoading=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="tt-pending">\r\n    <div class="partial-text">Finding Results<\/div>\r\n    <img class="spinner" src="/Assets/images/cv-loader-orange.gif" alt="...">\r\n<\/div>\r\n<div class="suggestion-seperator"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.SearchApp=this.ClickView.SearchApp||{};this.ClickView.SearchApp.Templates=this.ClickView.SearchApp.Templates||{};this.ClickView.SearchApp.Templates.RecentSearchesHeader=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<h5 class="suggestion-header">Recent Searches<\/h5>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.SearchApp=this.ClickView.SearchApp||{};this.ClickView.SearchApp.Templates=this.ClickView.SearchApp.Templates||{};this.ClickView.SearchApp.Templates.RecentSearchSuggestion=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t){return'<div class="suggestion-item recent">\r\n    <div class="recent-text">'+n.escapeExpression(n.lambda(t,t))+'<\/div>\r\n    <svg class="delete">\r\n        <use xlink:href="#cross-icon"><\/use>\r\n    <\/svg>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.SearchApp=this.ClickView.SearchApp||{};this.ClickView.SearchApp.Templates=this.ClickView.SearchApp.Templates||{};this.ClickView.SearchApp.Templates.SearchNavApp=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<span class="subset-viewpart"><\/span>\r\n<input type="text" name="query" placeholder="Search..." class="typeahead" autocomplete="off" id="query" />\r\n<svg class="close">\r\n    <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#cross-icon"><\/use>\r\n<\/svg>\r\n<svg class="search-icon">\r\n    <use xlink:href="#search-magnifying"><\/use>\r\n<\/svg>\r\n<button type="submit" tabindex="-1" style="display:none"><\/button>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.SearchApp=this.ClickView.SearchApp||{};this.ClickView.SearchApp.Templates=this.ClickView.SearchApp.Templates||{};this.ClickView.SearchApp.Templates.SeriesResult=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=null!=t?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<div><a href="'+h((void 0===(f=null!=(f=i.url||(null!=t?t.url:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"url",hash:{},data:u}):f)+'">'+h((void 0===(f=null!=(f=i.name||(null!=t?t.name:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"name",hash:{},data:u}):f)+"<\/a><\/div>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.SearchApp=this.ClickView.SearchApp||{};this.ClickView.SearchApp.Templates=this.ClickView.SearchApp.Templates||{};this.ClickView.SearchApp.Templates.SpellingSuggestion=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<div class="suggestion-item search-suggestion"><span class="search-for-label">Search for<\/span>\r\n    <span class="query-text">'+n.escapeExpression("function"==typeof(f=null!=(f=i.name||(null!=t?t.name:t))?f:i.helperMissing)?f.call(null!=t?t:n.nullContext||{},{name:"name",hash:{},data:u}):f)+"<\/span>\r\n<\/div>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.SearchApp=this.ClickView.SearchApp||{};this.ClickView.SearchApp.Templates=this.ClickView.SearchApp.Templates||{};this.ClickView.SearchApp.Templates.Subset=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=null!=t?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<div title="'+h((void 0===(f=null!=(f=i.name||(null!=t?t.name:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"name",hash:{},data:u}):f)+'" class="tag subset-search">\r\n    <span>'+h((void 0===(f=null!=(f=i.label||(null!=t?t.label:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"label",hash:{},data:u}):f)+'<\/span>\r\n    <span tabindex="-1" class="remove-tag"><\/span>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.SearchApp=this.ClickView.SearchApp||{};this.ClickView.SearchApp.Templates=this.ClickView.SearchApp.Templates||{};this.ClickView.SearchApp.Templates.VideoResult=Handlebars.template({1:function(){return"aligned"},3:function(n,t,i,r,u){var f,e=null!=t?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'        <div class="result-title collection">\r\n            <p>'+h((void 0===(f=null!=(f=i.collectionType||(null!=t?t.collectionType:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"collectionType",hash:{},data:u}):f)+": "+h((void 0===(f=null!=(f=i.collection||(null!=t?t.collection:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"collection",hash:{},data:u}):f)+"<\/p>\r\n        <\/div>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var o,f,e=null!=t?t:n.nullContext||{},s=i.helperMissing,c="function",h=n.escapeExpression;return'<div class="video-result">\r\n    <a href="'+h((void 0===(f=null!=(f=i.url||(null!=t?t.url:t))?f:s)?"undefined":_typeof(f))===c?f.call(e,{name:"url",hash:{},data:u}):f)+'">\r\n        <div class="video-img">\r\n            <div class="thumbnail">\r\n                <img src="'+h((i.buildThumbnailUrl||t&&t.buildThumbnailUrl||s).call(e,null!=t?t.thumbnailUrl:t,{name:"buildThumbnailUrl",hash:{},data:u}))+'" />\r\n            <\/div>\r\n        <\/div>\r\n        <div class="result-title '+(null!=(o=i.unless.call(e,null!=t?t.collection:t,{name:"unless",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))?o:"")+'">\r\n            <p>'+h((void 0===(f=null!=(f=i.name||(null!=t?t.name:t))?f:s)?"undefined":_typeof(f))===c?f.call(e,{name:"name",hash:{},data:u}):f)+"<\/p>\r\n        <\/div>\r\n"+(null!=(o=i.if.call(e,null!=t?t.collection:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))?o:"")+"    <\/a>\r\n<\/div>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.SearchApp=this.ClickView.SearchApp||{};this.ClickView.SearchApp.Templates=this.ClickView.SearchApp.Templates||{};this.ClickView.SearchApp.Templates.EmptyMedia=Handlebars.template({1:function(){return"        <li>\r\n            Try adjusting your filter\r\n        <\/li>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<img class="magnifying-glass" src="\\Assets\\images\\search\\search_illustration.png" />\r\n<h2 class="empty-video-text">No videos were found that match your search<\/h2>\r\n<div class="suggestions">\r\n    <h4>Can\'t find what you are looking for?<\/h4>\r\n    <ul>\r\n        <li>\r\n            Check your spelling\r\n        <\/li>\r\n        <li>\r\n            Try using a more general search term\r\n        <\/li>\r\n        <li>\r\n            Try different words that have a similar meaning\r\n        <\/li>\r\n'+(null!=(f=i.if.call(null!=t?t:n.nullContext||{},null!=t?t.hasFilters:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))?f:"")+"    <\/ul>\r\n<\/div>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.SearchApp=this.ClickView.SearchApp||{};this.ClickView.SearchApp.Templates=this.ClickView.SearchApp.Templates||{};this.ClickView.SearchApp.Templates.EmptySearchLanding=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="image-container">\r\n    <svg class="icon">\r\n        <use xlink:href="#orange-arrow"><\/use>\r\n    <\/svg>\r\n<\/div>\r\n<h2>Enter a search term to find the perfect video for your classroom<\/h2>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.SearchApp=this.ClickView.SearchApp||{};this.ClickView.SearchApp.Templates=this.ClickView.SearchApp.Templates||{};this.ClickView.SearchApp.Templates.TvResultItem=Handlebars.template({1:function(){return'            <span class="metadata-badge red has-ads-free" title="This programme is available with the ads removed.">ad-free<\/span>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var c,f,e=null!=t?t:n.nullContext||{},o=i.helperMissing,s="function",h=n.escapeExpression;return'<div class="tile-item-inner">\r\n    <div class="cv-thumbnail">\r\n        <a href="'+h((void 0===(f=null!=(f=i.actionUrl||(null!=t?t.actionUrl:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"actionUrl",hash:{},data:u}):f)+'" class="video-link" target="_blank">\r\n            <div class="play-btn-mask"><\/div>\r\n            <img alt="" title="'+h((void 0===(f=null!=(f=i.title||(null!=t?t.title:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"title",hash:{},data:u}):f)+'" class="lazy" data-original="'+h((void 0===(f=null!=(f=i.thumbUrl||(null!=t?t.thumbUrl:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"thumbUrl",hash:{},data:u}):f)+'" />\r\n        <\/a>\r\n    <\/div>\r\n    <div class="info cv-video-content">\r\n        <div class="cv-header">\r\n            <div class="video-actions-container"><a class="tv-logo" href="'+h((void 0===(f=null!=(f=i.cloudSearchUrl||(null!=t?t.cloudSearchUrl:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"cloudSearchUrl",hash:{},data:u}):f)+'" target="_blank"><\/a><\/div>\r\n            <h3 class="cv-title" title="'+h((void 0===(f=null!=(f=i.title||(null!=t?t.title:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"title",hash:{},data:u}):f)+'">\r\n                <a href="'+h((void 0===(f=null!=(f=i.actionUrl||(null!=t?t.actionUrl:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"actionUrl",hash:{},data:u}):f)+'" class="video-link" target="_blank">\r\n                    '+(null!=(c=(void 0===(f=null!=(f=i.title||(null!=t?t.title:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"title",hash:{},data:u}):f)?c:"")+'\r\n                <\/a>\r\n                <span class="metadata-badge origin '+h((void 0===(f=null!=(f=i.origin||(null!=t?t.origin:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"origin",hash:{},data:u}):f)+'" title="'+h((void 0===(f=null!=(f=i.badgeTitle||(null!=t?t.badgeTitle:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"badgeTitle",hash:{},data:u}):f)+'">'+h((void 0===(f=null!=(f=i.origin||(null!=t?t.origin:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"origin",hash:{},data:u}):f)+'<\/span>\r\n            <\/h3>\r\n        <\/div>\r\n        <div class="cv-series">\r\n            <span>\r\n                <span>Aired on '+h((void 0===(f=null!=(f=i.formattedStartDate||(null!=t?t.formattedStartDate:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"formattedStartDate",hash:{},data:u}):f)+" at "+h((void 0===(f=null!=(f=i.formatterStartTime||(null!=t?t.formatterStartTime:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"formatterStartTime",hash:{},data:u}):f)+'<\/span>\r\n            <\/span>\r\n        <\/div>\r\n        <p class="cv-metadata">\r\n            <span class="metadata-badge" title="'+h((void 0===(f=null!=(f=i.channelName||(null!=t?t.channelName:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"channelName",hash:{},data:u}):f)+'">'+h((void 0===(f=null!=(f=i.channelName||(null!=t?t.channelName:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"channelName",hash:{},data:u}):f)+"<\/span>\r\n"+(null!=(c=i.if.call(e,null!=t?t.hasAdsFree:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))?c:"")+'        <\/p>\r\n        <div class="cv-description-wrapper truncated highlighted">\r\n            <p class="cv-description"><!--\r\n                -->'+(null!=(c=(void 0===(f=null!=(f=i.description||(null!=t?t.description:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"description",hash:{},data:u}):f)?c:"")+'<!--\r\n            --><\/p>\r\n        <\/div>\r\n    <\/div>\r\n    <div class="video-preview-pane">\r\n        <div class="cv-video-footer">\r\n            <a class="tv-results-count" href="'+h((void 0===(f=null!=(f=i.cloudSearchUrl||(null!=t?t.cloudSearchUrl:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"cloudSearchUrl",hash:{},data:u}):f)+'" target="_blank">View '+h((void 0===(f=null!=(f=i.resultCount||(null!=t?t.resultCount:t))?f:o)?"undefined":_typeof(f))===s?f.call(e,{name:"resultCount",hash:{},data:u}):f)+" results from TV<\/a>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>"},useData:!0}),function(n){"use strict";var i=n.SearchApp,t=(new Date).getFullYear();i.Utils.Constants={CHANNEL_NAME:"SearchApp",SEARCH_NAV_CHANNEL:"SearchAppChannel",EVENTS:{RENDER:{APP:"search-app:render:app"},DATA:{QUERY_PARSED:"search-app:query-parsed"},ACTION:{CLEAR_FILTERS:"search-app:clear-filters",TOGGLE_FILTERS:"search-app:toggle-filters",UPDATE_QUERY:"search-app:update-query",LOOSE:"search-app:loose",TIGHT:"search-app:tight",FILTER_CHANGED:"search-app:filter-changed",CATEGORY_FILTER_CHANGED:"search-app:category-filter-changed",DYNAMIC_FILTER_CHANGED:"search-app:dynamic-filter-changed",UPDATE_ROUTE:"search-app:update-route",NAVIGATE:"search-app:navigate",RATING_SELECTED:"search-app:rating:selected",DURATION_SELECTED:"search-app:duration:selected",CLOSE_SUBSET:"search-app:subset:close",SEARCH_SUBMIT:"search-app:search-submit",EMPTY_RESULTS:"search-app:empty-results"}},FILTERS:{ADVANCED:[{id:"producedByClickView",value:"producedByClickView",name:"Produced by ClickView"},{id:"hd",value:"hd",name:"HD"},{id:"interactives",value:"interactives",name:"Has Interactives"},{id:"subtitles",value:"subtitles",name:"Closed Captions"},{id:"resources",value:"resources",name:"Resources"}],DURATION:[{id:"0",start:0,end:599999,name:"Short",description:"< 10 min"},{id:"600000",start:6e5,end:2399999,name:"Medium",description:"11 - 40 min"},{id:"2400000",start:24e5,end:Number.MAX_VALUE,name:"Long",description:"> 40 min"}],RATINGS:"ratings",CATEGORIES:"categories",PRODUCTION_YEAR:[{id:t+"...",from:t,to:0,value:t+"...",name:"This Year"},{id:t-3+"...",from:t-3,to:0,value:t-3+"...",name:"Last 3 Years"},{id:t-10+"...",from:t-10,to:0,value:t-10+"...",name:"Last 10 Years"},{id:"...",from:0,to:0,value:"...",name:"All Time"}]},HIDDEN_FILTER_COUNT:5,TV_ITEM_FREQUENCY:4,CLICK_VIEW:{ORGANISATION_ID:5484},QUERY_STRING:{SINCE:"since-",BEFORE:"before-",LONGER_THAN:"longer-than-",SHORTER_THAN:"shorter-than-",TO:"-to-",LIBRARIES:"libraries",CATEGORY:"category",RATINGS:"ratings"},BACKSPACE_KEY_CODE:8,SUGGESTION_LIMITS:{MIN:1,DEFAULT:3,CATEGORY:5,RECENT_SEARCH:5},SEARCH_MIN_WIDTH:375,FULL_SEARCH_MIN_WIDTH:500,TYPEAHEAD_ACTIVATION_LENGTH:1,QUERY_TYPE:{SUGGESTION:"suggestions",VIDEO:"videos",CATEGORY:"categories",SERIES:"series"},SEARCH_TYPES:{DIRECT:"direct-search",RECENT:"recent-searches",ALBERT:"albert"},LIBRARY_TYPES:{CATEGORY:"category",EXCHANGE:"exchange",HOSTED_LIBRARY:"hosted_library",WORKSPACE:"workspace"}}}(ClickView,EasyMoney),function(n){"use strict";n.deparam=function(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i={},u={"true":!0,"false":!1,"null":null};return n.each(t.replace(/\+/g," ").split("&"),function(t,f){var e,a=f.split("="),s=decodeURIComponent(a[0]),l=i,c=0,o=s.split("]["),h=o.length-1;if(/\[/.test(o[0])&&/\]$/.test(o[h])?(o[h]=o[h].replace(/\]$/,""),h=(o=o.shift().split("[").concat(o)).length-1):h=0,2===a.length)if(e=decodeURIComponent(a[1]),r&&(e=e&&!isNaN(e)?+e:"undefined"===e?void 0:void 0!==u[e]?u[e]:e),h)for(;c<=h;c++)l=l[s=""===o[c]?l.length:o[c]]=c<h?l[s]||(o[c+1]&&isNaN(o[c+1])?{}:[]):e;else n.isArray(i[s])?i[s].push(e):i[s]=void 0!==i[s]?[i[s],e]:e;else s&&(i[s]=r?void 0:"")}),i}}(jQuery),function(n){"use strict";n.SearchApp.Utils.Enums={FilterTypes:Object.freeze({SOURCES:"sources",CATEGORIES:"categories",ADVANCED:"advanced",RATINGS:"ratings",PRODUCTION_YEAR:"productionYear",DURATION:"duration",SERIES:"series",TOPIC:"topic"})}}(ClickView,EasyMoney),function(n){"use strict";var r,e,t=n.SearchApp,o=n.Shared,u=t.Utils.Constants,f=o.Utils.Constants.ENUMS.CONTEXT_TYPES,i=u.QUERY_TYPE,s=u.LIBRARY_TYPES;t.Helpers={HandleQuery:function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(i,r){var e=t.name,f=i&&i.length>=u.TYPEAHEAD_ACTIVATION_LENGTH;return e!==u.SEARCH_TYPES.RECENT||f?f?n instanceof Bloodhound?n.search.apply(n,arguments):r([{query:i}]):void 0:r(n.index.all())}},GetTemplate:function(n){return function(i){var r=i.query;return r?r.length&&r.length<u.TYPEAHEAD_ACTIVATION_LENGTH?t.Templates.NotFound.apply(this,arguments):n.call(this,i):t.Templates.NotFound.apply(this,arguments)}},TransformResult:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments[1],u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n===i.SUGGESTION?t.Helpers._processSuggestionResult(r[n],n,u):n===i.CATEGORY?t.Helpers._processCategoryResult(r[n],n,u):n===i.SERIES||n===i.VIDEO?t.Helpers._processInstantResult(r[n],n,u):r[n]||[]},getDirectUrl:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},u=r.source,s=r.suggestion,n=void 0===s?{}:s,t=r.objectLinkService,f=n.id,e=n.name,h=n.libraryType,a=n.libraryId,v=n.libraryName,c,l;return t?u===i.VIDEO?t.getVideoUrl(new o.Models.MasterVideo({id:f,name:e})):u===i.CATEGORY?(c=new o.Models.MasterVideo({categories:[{id:f,name:e,type:h}],libraries:[{id:a,name:v,type:h}]}),t.getCategoryUrl(c.categories)):u===i.SERIES?(l=new o.Models.MasterVideo({series:{id:f,name:e}}),t.getSeriesUrl(l.series)):void 0:""},BuildUrl:function(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=i.subsetOnly;if(!(n instanceof t.Models.Query))throw Error("Cannot build url without a model.");return r&&n.subset?this._getSubsetUrl(n,i):this._getSearchUrl(n,i)},GetLimits:function(n){return n.name===u.CATEGORY?u.SUGGESTION_LIMITS.CATEGORY:u.SUGGESTION_LIMITS.DEFAULT},ReadableContextTypes:(r={},_defineProperty(r,f.CATEGORY,"This category"),_defineProperty(r,f.TOPIC,"This topic"),_defineProperty(r,f.SERIES,"This series"),_defineProperty(r,f.LIBRARY,"This library"),_defineProperty(r,f.HOSTED_LIBRARY,"This library"),_defineProperty(r,f.EXCHANGE,"The Exchange"),_defineProperty(r,f.WORKSPACE,"Your Workspace"),r),DirectUrlWhitelist:(e={},_defineProperty(e,i.VIDEO,!0),_defineProperty(e,i.CATEGORY,!0),_defineProperty(e,i.SERIES,!0),e),_processCategoryResult:function(n,i,r){var u=r.objectLinkService;return n?_.map(n,function(n){var f=n.library,r=void 0===f?{}:f;return r.type===s.EXCHANGE&&(r.name="Exchange"),_.extend({},n,{libraryId:r.id,libraryName:r.name,libraryType:r.type,url:t.Helpers.getDirectUrl({objectLinkService:u,source:i,suggestion:{id:n.id,name:n.name,libraryId:r.id,libraryName:r.name,libraryType:r.type}})})}):[]},_processInstantResult:function(n,i,r){var u=r.objectLinkService;return n?_.map(n,function(n){var e=t.Helpers.getDirectUrl({objectLinkService:u,source:i,suggestion:{id:n.id,name:n.name}}),r=void 0,f=void 0;return n.series?(r=n.series,f="Series"):n.category&&n.category.length&&(r=_.first(n.category),f="Category"),_.extend({},n,{url:e,collectionType:f,collection:r})}):[]},_processSuggestionResult:function(n){return _.map(n,function(n){return{name:n}})},_getSubsetUrl:function(n){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1],n.subset.get("id")){var t=void 0;switch(n.subset.get("type")){case"series":t=" "+n.subset.get("type")+":"+encodeURIComponent(n.subset.get("id"));break;case"category":t="&"+encodeURIComponent("filters[category]="+n.subset.get("name"));break;case"categories":t="&"+encodeURIComponent("filters[category]="+n.subset.get("id"));break;case"hosted_library":t="&sources="+n.subset.get("id")}return t}},_getSearchUrl:function(n){arguments.length>1&&void 0!==arguments[1]&&arguments[1];var i="/search?query="+encodeURIComponent(n.get("query")),t=void 0;return n.subset&&(t=this._getSubsetUrl(n)),t?""+i+t:i}}}(ClickView,EasyMoney),function(n,t){"use strict";var u=n.SearchApp,h=n.Shared,i=u.Utils.Enums.FilterTypes,e=u.Utils.Constants,f=e.FILTERS,s=e.HIDDEN_FILTER_COUNT,r=e.QUERY_STRING,o=h.Utils.Constants.STRINGS.AREA,c=function(){return[{title:"Video sources",type:i.SOURCES,options:_.map(function(){if(n.Data._bootstrap){var t=n.Data._bootstrap.sources,f=_.chain(t).filter(function(n){return"workspace"!==n.type&&"exchange"!==n.type}).sortBy("name").value(),i=_.find(t,function(n){return"exchange"===n.type}),r=_.find(t,function(n){return"workspace"===n.type}),u=[].concat(_toConsumableArray(f));return i&&(i.name="Exchange",u.push(i)),r&&(r.name="Workspace",u.push(r)),u}}(),function(n){return{id:n.id,name:n.name,type:n.type}})},{title:"Categories",type:i.CATEGORIES},{title:"Series",type:i.SERIES},{title:"Topic",type:i.TOPIC},{title:"Features",type:i.ADVANCED,options:f.ADVANCED},{title:"Ratings",type:i.RATINGS,options:function(){if(n.Data._bootstrap){var t=_.filter(n.Data._bootstrap.ratings,function(n){return!!n.value});return n.Data.User.maxMasterRating>0&&(t=_.filter(t,function(t){return t.value<=n.Data.User.maxMasterRating})),_.map(t,function(n){var t;return t={name:name,value:n.value},_defineProperty(t,"name",n.code),_defineProperty(t,"fullName",n.name),t})}}()},{title:"Production Year",type:i.PRODUCTION_YEAR,options:f.PRODUCTION_YEAR},{title:"Duration",type:i.DURATION,options:f.DURATION}]},l=_.map(u.Utils.Constants.FILTERS.ADVANCED,function(n){return n.id.toLowerCase()});u.Services.FilterService=t.Service.extend({initialize:function(){this.initializeQuery();this.initializeFilterCollection();this.initializeListeners()},initializeQuery:function(){this.queryModel=this.options.queryModel;this.queryModel||(this.queryModel=new u.Models.Query)},initializeFilterCollection:function(){this.filterCollection=new u.Collections.FilterCollection(c());this.filterCollection.set(n.Data._bootstrap.searchNav,{remove:!1,parse:!0});this.filterCollection.sortOptions()},initializeListeners:function(){this.listenTo(this.queryModel.subset,"change",this.onSubsetChange)},getKeywords:function(){return new t.Collection({title:this.queryModel.get("query")})},getQueryModel:function(){return this.queryModel},getFilterCollection:function(){return this.filterCollection},hasQuery:function(){return this.queryModel.has("query")},hasSubset:function(){return this.queryModel.subset&&this.queryModel.subset.get("id")},getCustomFilterDecription:function(){var n=[];return this.filterCollection.each(function(t){if(t.get("type")!==i.SOURCES){var r=t.getDescription();r&&n.push(r)}}),n.join("<br>")},getFilterDescription:function(){var t=this.filterCollection.get(i.SOURCES).getDescription(),n="";return t&&(n+="in "+t),_.any(this.filterCollection.filter(function(n){return n.get("type")!==i.SOURCES}),function(n){return n.options.hasOptionSelected()})&&(n+=' with a <strong data-html="true" title="'+this.getCustomFilterDecription()+'">custom filter<\/strong>'),n.trim()},getFilterQueryString:function(){var n=this.filterCollection.getQueryString();return n.endsWith("&")&&(n=n.slice(0,-1)),n},getQueryString:function(){var n="query="+this.queryModel.get("query")+"&"+this.getFilterQueryString();return n.endsWith("&")&&(n=n.slice(0,-1)),n},getHumanizedQueryString:function(){var n="query="+this.queryModel.get("query")+"&"+this.filterCollection.getHumanizedQueryString();return n.endsWith("&")&&(n=n.slice(0,-1)),n},hasActiveFilters:function(){return this.filterCollection.hasOptionSelected()},clearActiveFilters:function(){this.filterCollection.clearFilters()},clearActiveDynamicFilters:function(){this.filterCollection.clearDynamicFilters()},clearSources:function(){this.filterCollection.get(i.SOURCES).options.clearActive()},fetchDynamicFilters:function(){this.filterCollection.clearDynamicFilters();this.filterCollection.fetch({data:this.getQueryString()})},onSubsetChange:function(){this.clearSources();this.clearActiveDynamicFilters();this.parseSubset()},parseSubset:function(){if(this.hasSubset()){var n=this.queryModel.subset.toJSON();switch(n.type){case"category":this.selectCategory(n.name);break;case"series":this.selectSeries(n.name);break;case"topic":this.selectTopic(n.name)}n.area&&(n.area===o.WORKSPACE&&this.selectSources("workspace"),n.area===o.EXCHANGE&&this.selectSources("exchange"),n.area===o.LIBRARY&&this.selectSources("library-"+n.libraryId))}},parseQueryString:function(){var n=$.deparam(window.location.search.slice(1));this.queryModel.set("query",n.query);this.selectFilters(n);this.setInitialVisibility()},selectFilters:function(n){var t=this;_.each(_.keys(n),function(u){var f=n[u];u=u.toLowerCase();_.contains(l,u)&&t.selectAdvanced(u,f);u===i.SOURCES&&t.selectSources(f);u===i.DURATION&&t.selectDurations(f);u===r.CATEGORY&&t.selectCategory(f);u===i.PRODUCTION_YEAR.toLowerCase()&&t.selectProductionYear(f);u===r.RATINGS&&t.selectRating(f);u===i.SERIES&&t.selectSeries(f);u===i.TOPIC&&t.selectTopic(f)})},selectSources:function(n){var u=n.split(","),t=this.filterCollection.get(i.SOURCES);t.options.length?_.each(u,function(n){var f=t.options.find(function(t){return t.get("type").toLowerCase()===n.toLowerCase()}),i,u,e;f?f.set("active",!0,{dontTriggerUrl:!0}):n!==r.LIBRARIES?(i=n.split("-")[1],i&&(u=t.options.findWhere({id:+i}),u&&u.set("active",!0,{dontTriggerUrl:!0}))):(e=t.options.where({type:"hosted_library"}),_.each(e,function(n){return n.set("active",!0,{dontTriggerUrl:!0})}))}):_.each(u,function(n){t.options.add({id:n,name:n,dry:!0,active:!0,type:n})})},setInitialVisibility:function(){if(!this._initialVisiblitySet){var n=this.filterCollection.take(s),t=this.filterCollection.last(this.filterCollection.length-s);_.any(t,function(n){return n.options.hasOptionSelected()})&&(n=[].concat(_toConsumableArray(n),_toConsumableArray(t)));_.each(n,function(n){return n.set("visible",!0)});this._initialVisiblitySet=!0}},selectAdvanced:function(n,t){var r=this.filterCollection.get(i.ADVANCED).options.find(function(t){return t.get("id").toLowerCase()===n.toLowerCase()});r&&r.set("active",t,{dontTriggerUrl:!0})},selectDurations:function(n){var e=this.filterCollection.get(i.DURATION),t=void 0,u=0,o;(n.indexOf(r.LONGER_THAN)>=0&&(t=n.replace(r.LONGER_THAN,"")),n.indexOf(r.SHORTER_THAN)>=0&&(u=n.replace(r.SHORTER_THAN,"")),n.indexOf(r.TO)>=0)&&(o=n.split(r.TO),t=o[0],u=o[1]);t=t?moment.duration("PT"+t.toUpperCase()).asMilliseconds():0;u=u?moment.duration("PT"+u.toUpperCase()).asMilliseconds():Number.MAX_VALUE;e.options.each(function(n){var i=n.get("start"),r=n.get("end");t<=i+1001&&t>=i-1001&&u>=r-1001&&u<=r+1001&&n.set("active",!0,{dontTriggerUrl:!0})});e.options.any(function(n){return n.get("active")})||e.options.add([{id:"custom",start:t,end:u,name:"Custom",description:""+n.replace(/-/g," "),active:!0}].concat(_toConsumableArray(f.DURATION)))},selectCategory:function(n){var t=this.filterCollection.get(i.CATEGORIES),r=t.options.find(function(t){return t.get("id").toLowerCase()===n.toLowerCase()});r?r.set("active",!0,{dontTriggerUrl:!0}):t.options.add([].concat(_toConsumableArray(t.options.toJSON()),[{id:n,value:n,name:n,count:0,active:!0}]))},selectProductionYear:function(n){var u=this.filterCollection.get(i.PRODUCTION_YEAR),t=void 0,e=void 0,o;(n.indexOf(r.SINCE)>=0&&(t=n.replace(r.SINCE,"")),n.indexOf(r.BEFORE)>=0&&(e=n.replace(r.BEFORE,"")),n.indexOf(r.TO)>=0)&&(o=n.split(r.TO),t=o[0],e=o[1]);u.options.each(function(n){+n.get("from")==+t&&n.set("active",!0,{dontTriggerUrl:!0})});u.options.any(function(n){return n.get("active")})||u.options.add([{id:n,from:t,to:e,name:"Custom",value:n,active:!0}].concat(_toConsumableArray(f.PRODUCTION_YEAR)))},selectRating:function(n){var u=this.filterCollection.get(i.RATINGS),t=n.split(r.TO);t[0]&&(t[0]=t[0].trim().toLowerCase());t[1]&&(t[1]=t[1].trim().toLowerCase());var f=u.options.find(function(n){return n.get("name").replace("+","").toLowerCase()===t[0]}),e=u.options.find(function(n){return n.get("name").replace("+","").toLowerCase()===t[1]}),o=f&&f.get("value"),s=e&&e.get("value")||o,h=u.options.filter(function(n){return n.get("value")>=o&&n.get("value")<=s});_.each(h,function(n){return n.set("active",!0,{dontTriggerUrl:!0})})},selectSeries:function(n){this.filterCollection.get(i.SERIES).options.add({id:n,value:n,name:n,count:0,active:!0})},selectTopic:function(n){this.filterCollection.get(i.TOPIC).options.add({id:n,value:n,name:n,count:0,active:!0})}})}(ClickView,EasyMoney),function(n,t){"use strict";var r,u,f,o=n.SearchApp,i=(n.Shared,o.Utils.Enums.FilterTypes),l=o.Utils.Constants,e=l.QUERY_STRING,h=l.LIBRARY_TYPES,a=function(){var t=n.Data._bootstrap;return _.find(t&&t.sources,function(n){return n.type===h.EXCHANGE})||{}},v=function(){var t=n.Data._bootstrap;return _.find(t&&t.sources,function(n){return n.type===h.WORKSPACE})||{}},c=function(){var t=n.Data._bootstrap;return _.filter(t&&t.sources,function(n){return n.type===h.HOSTED_LIBRARY})||{}},s=function(n){if(!n||n===Number.MAX_VALUE)return"";var t=Math.ceil(n/1e3);return moment.duration(1e3*t).toISOString().replace("PT","")},y=(_defineProperty(r={},i.SOURCES,function(t){var r=n.Data._bootstrap,i=t.options.filter(function(n){return n.get("active")});return i.length||(i=t.options.models),i.length===r.sources&&r.sources.length?null:$.param({sources:_.map(i,function(n){return n.get("id")})},!0)}),_defineProperty(r,i.CATEGORIES,function(n){var t=n.options.find(function(n){return n.get("active")});return t?$.param({filters:{category:t.get("value")}}):null}),_defineProperty(r,i.ADVANCED,function(n){var t={};return n.options.each(function(n){n.get("active")&&(t[n.get("value")]=!0)}),_.keys(t)?$.param({filters:t}):null}),_defineProperty(r,i.RATINGS,function(n){var u=n.options.filter(function(n){return n.get("active")}),i=_.map(u,function(n){return n.get("value")}),t,r;return i.length?(t=_.min(i),t===n.options.first().get("value")&&(t=0),r=t+"..."+_.max(i),$.param({filters:{rating:r}})):null}),_defineProperty(r,i.PRODUCTION_YEAR,function(n){var t=n.options.find(function(n){return n.get("active")}),i,r,u;return t?(i=t.get("from")||"",r=t.get("to")||"",!i&&!r)?null:(u=i+"..."+r,$.param({filters:{productionYear:u}})):null}),_defineProperty(r,i.DURATION,function(n){var t=n.options.filter(function(n){return n.get("active")}),r;if(!t.length)return null;var u=_.map(t,function(n){return n.get("start")}),f=_.map(t,function(n){return n.get("end")}),e=_.min(u),i=_.max(f);return i===Number.MAX_VALUE&&(i=""),r=e+"..."+i,$.param({filters:{duration:r}})}),_defineProperty(r,i.SERIES,function(n){var t=n.options.find(function(n){return n.get("active")});return t?$.param({filters:{series:t.get("value")}}):null}),_defineProperty(r,i.TOPIC,function(n){var t=n.options.find(function(n){return n.get("active")});return t?$.param({filters:{topic:t.get("value")}}):null}),r),p=(_defineProperty(u={},i.SOURCES,function(t){var u,i,f,r;return t.options.any(function(n){return n.get("dry")})?(u=[],t.options.each(function(n){return u.push(n.get("id"))}),"sources="+u.join(",")):(i=_.map(t.options.filter(function(n){return n.get("active")}),function(n){return n.get("id")}),i.length||(i=t.options.models),f=n.Data._bootstrap.sources?n.Data._bootstrap.sources.length:0,i.length===f)?null:(r=[],_.every(c(),function(n){return i.indexOf(n.id)>=0})?r.push(e.LIBRARIES):_.each(c(),function(n){i.indexOf(n.id)>=0&&r.push("library-"+n.id)}),_.contains(i,a().id)&&r.push("exchange"),_.contains(i,v().id)&&r.push("workspace"),"sources="+r.join(","))}),_defineProperty(u,i.CATEGORIES,function(n){var t=n.options.find(function(n){return n.get("active")});return t?$.param({category:t.get("value")}):null}),_defineProperty(u,i.ADVANCED,function(n){var t={};return n.options.each(function(n){n.get("active")&&(t[n.get("value")]=!0)}),_.keys(t)?$.param(t):null}),_defineProperty(u,i.RATINGS,function(n){var t=n.options.filter(function(n){return n.get("active")});if(!_.map(t,function(n){return n.get("value")}).length)return null;var i=_.min(t,function(n){return n.get("value")}),r=_.max(t,function(n){return n.get("value")}),u=""+i.get("name")+e.TO+r.get("name");return i.get("name")===r.get("name")&&(u=i.get("name")),"ratings="+u}),_defineProperty(u,i.PRODUCTION_YEAR,function(n){var r=n.options.find(function(n){return n.get("active")}),t,i;return r?(t=r.get("from"),i=r.get("to"),t||i?t&&!i?"productionYear="+e.SINCE+t:i&&!t?"productionYear="+e.BEFORE+i:"productionYear="+t+e.TO+i:""):null}),_defineProperty(u,i.DURATION,function(n){var r=n.options.filter(function(n){return n.get("active")});if(!r.length)return null;var u=_.min(r,function(n){return n.get("start")}),f=_.max(r,function(n){return n.get("end")}),t=s(u.get("start")),i=s(f.get("end"));return t&&!i?"duration="+e.LONGER_THAN+t.toLowerCase():i&&!t?"duration="+e.SHORTER_THAN+i.toLowerCase():"duration="+t.toLowerCase()+e.TO+i.toLowerCase()}),_defineProperty(u,i.SERIES,function(n){var t=n.options.find(function(n){return n.get("active")});return t?$.param({series:t.get("value")}):null}),_defineProperty(u,i.TOPIC,function(n){var t=n.options.find(function(n){return n.get("active")});return t?$.param({topic:t.get("value")}):null}),u),w=(_defineProperty(f={},i.SOURCES,function(t){var r=_.map(t.options.filter(function(n){return n.get("active")}),function(n){return n.get("id")}),o=n.Data._bootstrap.sources?n.Data._bootstrap.sources.length:0,e,i,f,u;return r.length===o?null:(e=_.every(c(),function(n){return r.indexOf(n.id)>=0}),i=[],e?(f="Libraries",r<=1&&(f="Library"),i.push("your <strong>"+f+"<\/strong>")):_.each(r,function(t){var r=_.find(n.Data._bootstrap.sources,function(n){return n.id==t&&"hosted_library"===n.type});r&&i.push("<strong>"+r.name+"<\/strong>")}),_.contains(r,a().id)&&i.push("the <strong>Exchange<\/strong>"),_.contains(r,v().id)&&i.push("your <strong>Workspace<\/strong>"),i.length>3)?(u=i.slice(2,i.length),u=_.map(u,function(n){return n.replace("<strong>","").replace("<\/strong>","")}),i[0]+", "+i[1]+' and <strong data-html="true" title="'+u.join("<br>")+'">'+(i.length-2)+" others<\/strong>"):i.length>2?i.slice(0,i.length-1).join(", ")+" and "+i.pop():i.length>1?i.join(" and "):i[0]}),_defineProperty(f,i.CATEGORIES,function(n){var t=n.options.find(function(n){return n.get("active")});return t?"Category: "+t.get("value"):""}),_defineProperty(f,i.SERIES,function(n){var t=n.options.find(function(n){return n.get("active")});return t?"Series: "+t.get("value"):""}),_defineProperty(f,i.TOPIC,function(n){var t=n.options.find(function(n){return n.get("active")});return t?"Topic: "+t.get("value"):""}),_defineProperty(f,i.ADVANCED,function(n){var t=[];return n.options.each(function(n){n.get("active")&&t.push(n.get("name"))}),t.length?"Features: "+t.join(", "):""}),_defineProperty(f,i.RATINGS,function(n){var t=n.options.filter(function(n){return n.get("active")});if(!_.map(t,function(n){return n.get("value")}).length)return"";var i=_.min(t,function(n){return n.get("value")}),r=_.max(t,function(n){return n.get("value")}),u="From "+i.get("name")+" to "+r.get("name");return i.get("name")===r.get("name")&&(u=i.get("name")),"Ratings: "+u}),_defineProperty(f,i.PRODUCTION_YEAR,function(n){var r=n.options.find(function(n){return n.get("active")}),t,i;return r?(t=r.get("from"),i=r.get("to"),t||i?t&&!i?"Production year: Since "+t:i&&!t?"Production year: Before "+i:"Production year: from "+t+" to "+i:""):""}),_defineProperty(f,i.DURATION,function(n){var r=n.options.filter(function(n){return n.get("active")});if(!r.length)return"";var u=_.min(r,function(n){return n.get("start")}),f=_.max(r,function(n){return n.get("end")}),t=s(u.get("start")),i=s(f.get("end"));return t&&!i?"Duration: longer than "+t.toLowerCase():i&&!t?"Duration: shorter than "+i.toLowerCase():"Duration: from "+t.toLowerCase()+" to "+i.toLowerCase()}),f);o.Models.Filter=t.NestedModel.extend({idAttribute:"type",defaults:{title:"Filter",options:[]},associations:{options:function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.parse=!0,new o.Collections.OptionCollection(n,t)}},getQueryString:function(){return _.isFunction(y[this.get("type")])?y[this.get("type")](this):""},getHumanizedQueryString:function(){return _.isFunction(p[this.get("type")])?p[this.get("type")](this):""},getDescription:function(){return _.isFunction(w[this.get("type")])?w[this.get("type")](this):""}})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.SearchApp;n.Shared;i.Models.Option=t.Model.extend({defaults:{active:!1}});i.Models.DynamicOption=i.Models.Option.extend({idAttribute:"value"})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.SearchApp;n.Shared;i.Models.Query=t.NestedModel.extend({defaults:{subset:{}},associations:{subset:function(t,i){return new n.SearchApp.Models.Subset(t,i)}}});i.Models.Subset=t.Model.extend({})}(ClickView,EasyMoney),function(n,t){"use strict";var r=n.SearchApp,i=n.Shared,u=i.Models.MasterVideo.prototype,f=i.Models.MasterVideo.extend({initialize:function(){u.initialize.apply(this,arguments);this.set("libraries",new n.Shared.Collections.LibraryCollection({id:0,type:"cloud_247"}).toJSON())}});r.Collections.CloudVideoCollection=t.PagedCollection.extend({model:f})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.SearchApp;n.Shared;i.Utils.Enums.FilterTypes;i.Collections.FilterCollection=t.Collection.extend({url:"/api/v2/search/nav",model:i.Models.Filter,initialize:function(){this.listenTo(this,"sync",this.onSync)},onSync:function(){this.loaded=!0},isLoaded:function(){return this.loaded},fetch:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n.remove=!1,t.Collection.prototype.fetch.call(this,n)},getQueryString:function(){var n=this.map(function(n){return n.getQueryString()});return _.filter(n,function(n){return n}).join("&")},getHumanizedQueryString:function(){var n=this.map(function(n){return n.getHumanizedQueryString()});return _.filter(n,function(n){return n}).join("&")},parse:function(n){return _.map(_.keys(n),function(t){var i=n[t];return{type:t,options:_.map(i,function(n){return{value:n}})}})},clearFilters:function(){this.each(function(n){return n.options.clearActive()})},clearDynamicFilters:function(){this.each(function(n){return n.options.clearActiveIfDynamic()})},hasOptionSelected:function(){return this.any(function(n){return n.options.hasOptionSelected()})},getFilterName:function(n){return filterNames[n]||""},sortOptions:function(){this.each(function(n){return n.options.sort()})}})}(ClickView,EasyMoney),function(n,t){"use strict";var r=n.SearchApp,i=(n.Shared,r.Utils.Enums.FilterTypes),u=[i.CATEGORIES,i.PRODUCTION_YEAR,i.SERIES,i.TOPIC],f=[i.CATEGORIES,i.SERIES,i.TOPIC];r.Collections.OptionCollection=t.Collection.extend({model:r.Models.Option,comparator:function(n){if(this.parent)switch(this.parent.get("type")){case i.RATINGS:return n.get("value");default:return}},initialize:function(){this.listenTo(this,"change:active",this.onOptionSelected)},onOptionSelected:function(n){if(this.isExclusiveSet()){var t=this.filter(function(t){return t.id!=n.get("id")});_.each(t,function(n){return n.set("active",!1,{silent:!0})})}},isExclusiveSet:function(){return _.contains(u,this.getType())},getType:function(){return this.parent.get("type")},hasOptionSelected:function(){return this.any(function(n){return n.get("active")})},clearActive:function(){this.each(function(n){return n.set("active",!1)})},clearActiveIfDynamic:function(){_.contains(f,this.getType())&&this.clearActive()},parse:function(n){return _.each(n,function(n){n&&!n.id&&(n.id=n.value)}),n},set:function(){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).remove=!0,t.Collection.prototype.set.apply(this,arguments)}});r.Collections.DynamicOptionCollection=r.Collections.OptionCollection.extend({model:r.Models.DynamicOption,comparator:function(n){return-n.count}})}(ClickView,EasyMoney),function(n,t){"use strict";var r=n.SearchApp,u=n.Shared,i=t.PagedCollection.prototype;r.Collections.ResultCollection=t.PagedCollection.extend({model:u.Models.MasterVideo,sources:[],filters:[],query:"",url:"/api/v2/search",_new:!0,initialize:function(){this.listenTo(this,"sync",this.onSync);this.listenTo(this,"request",this.onRequest)},onRequest:function(){this.loaded=!1},onSync:function(){this._new=!1;this.loaded=!0},hasFetched:function(){return this.loaded},isNew:function(){return this._new},isLoaded:function(){return this.hasFetched()},onFetchSuccess:function(n,t){var r,u;if(!t.cloud247Videos)return i.onFetchSuccess.apply(this,arguments);r=n.page;this.__private__.hasPageData&&t&&(u=t.masterVideos[this.dataProperties.pagination][this.pageDataProperties.page],u&&(r=u));n.silentPaging||this.trigger("getpage",r,this);n.silentPaging&&!n.reload||this.__private__.lastLoadedPage!=r&&null!=this.__private__.lastLoadedPage&&this.trigger("pagechanged",r,this);this.__private__.lastLoadedPage=r},getKeywords:function(){if(!this.query)return!1;var n=this.query.split(" ").map(function(n){return{title:n}});return new t.Collection(n)},parse:function(n){return this.cloudVideos=null,n.masterVideos?n.cloud247Videos&&n.cloud247Videos.data?(this.cloudVideos=n.cloud247Videos,i.parse.call(this,n.masterVideos)):i.parse.call(this,n.masterVideos):i.parse.apply(this,arguments)}})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.SearchApp,f=(n.Shared,i.Utils.Constants),r=f.CHANNEL_NAME,u=f.EVENTS,e=(u.DATA,u.RENDER,u.ACTION),o=t.View.extend({tagName:"li",template:i.Templates.FilterItem,className:"filter-item",radioChannels:[r],bindings:{"[name=checkbox]":"active",".nav-radio":"active"},initialize:function(){this.listenTo(this.model,"change:active",this.onChangeActive)},onChangeActive:function(n,t,i){i&&i.dontTriggerUrl||this.radio[r].trigger(e.FILTER_CHANGED,{model:n})},viewOptions:function(){return{name:this.model.get("name")||this.model.get("value"),isExclusive:this.model.collection.isExclusiveSet(),group:this.options.group}},onRender:function(){this.stickit()}});i.Views.BaseFilterListView=t.ListView.extend({template:i.Templates.FilterList,childView:o,radioChannels:[r],ui:{$list:".list-viewpart"},events:{"click .clear-filters":"onClickClearFilters"},initialize:function(){this.listenTo(this.model,"change:visible",this.toggleVisability);this.listenTo(this.collection,"change:active",this.render);this.listenTo(this.collection,"add",this.render)},toggleVisability:function(){this.model.get("visible")?this.show():this.hide()},onClickClearFilters:function(){this.collection.clearActive();this.radio[r].trigger(e.FILTER_CHANGED,{clear:!0,collection:this.collection})},buildChildView:function(n){var t=_.extend({group:this.model.get("type")},_.omit(this.options,["collection","model","id"]),{model:n});return new this.childView(t)},addOne:function(n){this.renderView(this.ui.$list,this.buildChildView.call(this,n),{empty:!1})},onBeforeRender:function(){if(!this.collection.length)return!1},onRender:function(){this.toggleVisability()},viewOptions:function(){return{title:this.model.get("title"),showClear:this.collection.hasOptionSelected()}}})}(ClickView,EasyMoney),function(n,t){"use strict";var i,r=n.SearchApp,h=n.Shared,e=r.Utils.Constants,f=e.CHANNEL_NAME,o=e.EVENTS,s=e.FILTERS,c=(o.DATA,o.RENDER),u=o.ACTION,l=(s.CATEGORIES,s.RATINGS,s.PRODUCTION_YEAR,t.View.extend({template:r.Templates.EmptySearchLanding,className:"empty-search-query"}));r.Views.SearchAppView=t.View.extend((i={template:r.Templates.SearchApp,radioChannels:[f],className:"search-app-view",ui:{$results:".results-viewpart"},events:{"click .back-button":"onClickBackButton"}},_defineProperty(i,f,function(){var n;return _defineProperty(n={},c.APP,"renderApp"),_defineProperty(n,u.CLEAR_FILTERS,"clearFilters"),_defineProperty(n,u.TOGGLE_FILTERS,"toggleFilters"),_defineProperty(n,u.FILTER_CHANGED,_.debounce(this.onFilterChanged,200)),_defineProperty(n,u.NAVIGATE,"navigate"),_defineProperty(n,u.EMPTY_RESULTS,"logEmptyResults"),n}),_defineProperty(i,"initialize",function(){this.initializeFilterService();this.initializeCollection();this.bindListeners();this.analyticsService=h.Utils.AnalyticsService}),_defineProperty(i,"initializeFilterService",function(){this.filterService=this.options.filterService;this.filterService||(this.filterService=new r.Services.FilterService)}),_defineProperty(i,"initializeCollection",function(){this.resultCollection=new r.Collections.ResultCollection}),_defineProperty(i,"bindListeners",function(){this.listenTo(this.filterService.getQueryModel(),u.SEARCH_SUBMIT,this.onSearchSubmit)}),_defineProperty(i,"logFilterChange",function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=i.collection,t=i.model,u=i.clear,f=i.silent,n;_.isEmpty(i)||f||(n={},t&&(n.type=t.collection.parent.get("type"),n.value=t.get("name")||t.get("value"),n.active=!!t.get("active")),r&&u&&(n.type=r.parent.get("type"),n.active=!1),r||t||!u||(n.type="allFilters",n.active=!1),this.analyticsService.logSearchFilter(n))}),_defineProperty(i,"logEmptyResults",function(){var n=this.filterService.getQueryModel();this.analyticsService.logSearchEmptyResults({query:n.get("query")})}),_defineProperty(i,"onSearchSubmit",function(){this.filterService.fetchDynamicFilters()}),_defineProperty(i,"onQueryUpdate",function(){this.filterService.fetchDynamicFilters();this.onFilterChanged()}),_defineProperty(i,"onFilterChanged",function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=n.silent,o=void 0!==e&&e;if(!this.filterService.hasQuery())return!1;if(this.fetchResults(n),this.logFilterChange(n),!o){var i=this.filterService.getHumanizedQueryString(),r=this.getPageQueryString(n),t="/search";i&&(t=t+"?"+i);r&&(t+=i?"&"+r:"?"+r);this.radio[f].trigger(u.UPDATE_ROUTE,t,n)}}),_defineProperty(i,"fetchResults",function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.filterService.getQueryString(),r=i.page||1,t=i.limit||this.resultCollection.pageSize();return r>1&&(n+="&page="+r),t&&25!=t&&(n+="&limit="+t),this.resultCollection.fetch({data:n})}),_defineProperty(i,"clearFilters",function(){this.filterService.clearActiveFilters();this.radio[f].trigger(u.FILTER_CHANGED,{clear:!0})}),_defineProperty(i,"navigate",function(n){var t=$.deparam(n),i=t.page,r=void 0===i?1:i,u=t.limit,f=void 0===u?25:u,e=(t.sources,t.query);this.analyticsService.logSearch({text:e,"new":!0});this.filterService.parseQueryString();this.resultCollection.setPageData({page:r,pageSize:f});this.onFilterChanged({silent:!0,page:r});this.resultsView||this.renderApp()}),_defineProperty(i,"getPageQueryString",function(){var n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).page||1,t=void 0;return n>1&&(t=$.param({page:n})),t}),_defineProperty(i,"getHeadingCallback",function(){var n=this;return function(){var t=n.resultCollection.totalItems(),i=n.filterService.getQueryModel().get("query");return null===t?"":"Showing <strong>"+t+" results<\/strong> for <strong>"+i+"<\/strong> "+n.filterService.getFilterDescription()}}),_defineProperty(i,"renderLandingPage",function(){this.renderView(this.ui.$results,new l);this.analyticsService.logSearchLanding()}),_defineProperty(i,"renderFilters",function(){var n=new r.Views.FiltersView({collection:this.filterService.getFilterCollection()});this.renderView(this.options.leftNav,n)}),_defineProperty(i,"renderResults",function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.resultsView=this.resultsView||new r.Views.MediaCollectionView({collection:this.resultCollection,model:new t.Model({name:"results"}),showSorting:!1,showBanner:!1,filterService:this.filterService,heading:this.getHeadingCallback()});this.renderView(this.ui.$results,this.resultsView)}),_defineProperty(i,"renderLanding",function(){this.renderLandingPage()}),_defineProperty(i,"renderApp",function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n.showLanding?this.renderLanding():(this.renderResults(n),this.renderFilters())}),i))}(ClickView,EasyMoney),function(n){"use strict";var t=n.SearchApp,u=(n.Shared,t.Utils.Constants),i=(u.CHANNEL_NAME,u.EVENTS),r=(i.DATA,i.RENDER,i.ACTION,t.Views.BaseFilterListView);t.Views.CategoryFilterListView=r.extend({defaults:{limit:5},events:_.extend({},r.prototype.events,{"click .show-more":"onClickShowMore"}),initialize:function(){r.prototype.initialize.apply(this,arguments);this.limit=this.options.limit},onClickShowMore:function(){this.limit=this.collection.length;this.render()},renderItems:function(){var i=this,n=this.collection.take(this.limit),t=this.collection.last(this.collection.length-this.limit);_.any(t,function(n){return n.get("active")})&&(n=[].concat(_toConsumableArray(n),_toConsumableArray(t)),this.limit=this.collection.length);this._amountRendered=n.length;_.each(n,function(n){return i.addOne(n)});this.renderShowMore()},renderShowMore:function(){this._amountRendered<this.collection.length&&this.$el.append('<a class="show-more">Show all<\/a>')},onRender:function(){this.toggleVisability();this.collection.length||this.ui.$list.html('<p class="no-options">No categories found<\/p>')}})}(ClickView,EasyMoney),function(n,t){"use strict";var i,r=n.SearchApp,f=r.Utils.Constants,s=f.CHANNEL_NAME,e=f.EVENTS,o=(f.FILTERS,e.DATA,e.RENDER,e.ACTION),u="DurationChannel",h=t.View.extend({template:r.Templates.DurationFilterItem,tagName:"li",radioChannels:[u],attributes:function(){var n=100/this.options.siblings+"%";return{title:this.model.get("description"),style:"width: "+n}},className:function(){if(this.model.get("active"))return"selected"},events:{click:"onClick"},onClick:function(){this.radio[u].trigger(o.DURATION_SELECTED,this.model)},onRender:function(){this.$el.tooltip({container:".duration-filter"})},onClose:function(){this.$el.tooltip("destroy")}}),c=r.Views.BaseFilterListView;r.Views.DurationFilterListView=c.extend((_defineProperty(i={className:"duration-filter button-list",childView:h,radioChannels:[s,u]},u,_defineProperty({},o.DURATION_SELECTED,"onSelected")),_defineProperty(i,"onSelected",function(n){var t=n.get("active");this.collection.clearActive();n.set("active",!t,{dontTriggerUrl:!0});this.radio[s].trigger(o.FILTER_CHANGED,{model:n})}),_defineProperty(i,"buildChildView",function(n){var t=_.extend({group:this.model.get("type")},_.omit(this.options,["collection","model","id"]),{model:n});return t.siblings=this.collection.length,new this.childView(t)}),i))}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.SearchApp,o=n.Shared,r=i.Utils.Constants,e=(r.CHANNEL_NAME,r.EVENTS),u=r.FILTERS,f=(e.DATA,e.RENDER,u.CATEGORIES,u.RATINGS,u.PRODUCTION_YEAR,i.Utils.Enums.FilterTypes);i.Views.FiltersBodyView=t.View.extend({template:!1,className:"filters-body",initialize:function(){this.listenTo(this.collection,"sync",this.onSync);this.listenTo(this.collection,"request",this.onRequest)},onRequest:function(){this.navLoaded=!1;this.renderPartialLoader()},onSync:function(){this.navLoaded=!0;this.render()},renderPartialLoader:function(){var n=new o.Views.PartialLoadingLeftNavView({showHeader:!1});this.renderView(this.$el,n)},renderFilter:function(n){var t=void 0;n.get("type")===f.RATINGS&&(t=new i.Views.RatingsFilterListView({model:n,collection:n.options}));n.get("type")===f.CATEGORIES&&(t=new i.Views.CategoryFilterListView({model:n,collection:n.options}));n.get("type")===f.DURATION&&(t=new i.Views.DurationFilterListView({model:n,collection:n.options}));t||(t=new i.Views.BaseFilterListView({model:n,collection:n.options}));this.renderView(this.$el,t,{empty:!1})},renderFilters:function(){var n=this;this.collection.each(function(t){return n.renderFilter(t)})},onRender:function(){this.renderFilters()}})}(ClickView,EasyMoney),function(n,t){"use strict";var i,r=n.SearchApp,e=(n.Shared,r.Utils.Constants),u=e.CHANNEL_NAME,f=e.EVENTS,o=(f.DATA,f.RENDER,f.ACTION);r.Views.FiltersHeaderView=t.View.extend((i={template:r.Templates.FiltersHeader,radioChannels:[u],events:{"click .clear-filters":"onClickClearFilters"}},_defineProperty(i,u,_defineProperty({},o.FILTER_CHANGED,"render")),_defineProperty(i,"initialize",function(){this.listenTo(this.collection,"change:visible",this.render)}),_defineProperty(i,"onClickClearFilters",function(){this.radio[u].trigger(o.CLEAR_FILTERS)}),_defineProperty(i,"viewOptions",function(){return{showClear:this.collection.hasOptionSelected()}}),i))}(ClickView,EasyMoney),function(n,t){"use strict";var i,r=n.SearchApp,f=(n.Shared,r.Utils.Constants),u=f.CHANNEL_NAME,e=f.EVENTS,s=f.HIDDEN_FILTER_COUNT,o=(e.DATA,e.RENDER,"searchapp:filters:showmore"),h=t.View.extend({tagName:"a",className:"toggle-more-filters",template:"{{text}}",radioChannels:[u],events:{click:"onClick"},onClick:function(){this.radio[u].trigger(o)}});r.Views.FiltersView=t.View.extend((i={template:r.Templates.Filters,radioChannels:[u],className:"filters-viewpart",ui:{$header:".header-viewpart",$body:".body-viewpart",$showMore:".show-more-container"}},_defineProperty(i,u,_defineProperty({},o,"onClickShowMore")),_defineProperty(i,"initialize",function(){this.listenTo(this.collection,"change:visible",this.renderShowMore)}),_defineProperty(i,"onClickShowMore",function(){if(this.allVisible()){var n=this.collection.last(this.collection.length-s);return _.each(n,function(n){return n.set("visible",!1)}),void this.renderShowMore()}this.collection.each(function(n){return n.set("visible",!0)});this.renderShowMore()}),_defineProperty(i,"allVisible",function(){return this.countVisible()>=this.collection.length}),_defineProperty(i,"countVisible",function(){return this.collection.reduce(function(n,t){return t&&t.get("visible")?n+1:n},0)}),_defineProperty(i,"getShowMoreText",function(){return this.allVisible()?"Show less filters":"Show more filters"}),_defineProperty(i,"renderHeader",function(){var n=new r.Views.FiltersHeaderView({collection:this.collection});this.renderView(this.ui.$header,n)}),_defineProperty(i,"renderBody",function(){var n=new r.Views.FiltersBodyView({collection:this.collection});this.renderView(this.ui.$body,n)}),_defineProperty(i,"renderShowMore",function(){var n=new h({text:this.getShowMoreText()});this.renderView(this.ui.$showMore,n);t.Events.trigger("recalculate-sticky-components")}),_defineProperty(i,"onRender",function(){this.renderHeader();this.renderBody();this.renderShowMore()}),i))}(ClickView,EasyMoney),function(n,t){"use strict";var i,r=n.SearchApp,f=r.Utils.Constants,s=f.CHANNEL_NAME,e=f.EVENTS,o=(f.FILTERS,e.DATA,e.RENDER,e.ACTION),u="RatingsChannel",h={"MA15+":"MA","R18+":"R",R13:"13",R15:"15",R16:"16",R18:"18"},c=t.View.extend({tagName:"li",template:r.Templates.RatingItem,radioChannels:[u],className:function(){return this.model.get("active")?"selected":null},attributes:function(){return{style:"width: "+(100/this.options.siblings+"%"),title:this.getFullName()}},events:{click:"onClick"},initialize:function(){this.listenTo(this.model,"change:active",this.render)},getFullName:function(){var n=this.model.get("fullName");return this.model.get("name")&&(n+=" ("+this.model.get("name")+")"),n},onClick:function(){this.radio[u].trigger(o.RATING_SELECTED,this.model)},viewOptions:function(){var n=this.model.get("name");return h[n]&&(n=h[n]),{name:n}},onRender:function(){this.$el.tooltip({container:".ratings-filter"})},onClose:function(){this.$el.tooltip("destroy")}}),l=r.Views.BaseFilterListView;r.Views.RatingsFilterListView=l.extend((_defineProperty(i={className:"ratings-filter button-list",childView:c,radioChannels:[s,u]},u,_defineProperty({},o.RATING_SELECTED,"onSelected")),_defineProperty(i,"onSelected",function(n){this.collection.clearActive();var t=this.collection.filter(function(t){return t.get("value")<=n.get("value")});_.each(t,function(n){return n.set("active",!0)});this.radio[s].trigger(o.FILTER_CHANGED,{model:n})}),_defineProperty(i,"buildChildView",function(n){var t=_.extend({group:this.model.get("type")},_.omit(this.options,["collection","model","id"]),{model:n});return t.siblings=this.collection.length,new this.childView(t)}),_defineProperty(i,"addOne",function(n){this.renderView(this.ui.$list,this.buildChildView.call(this,n),{empty:!1})}),_defineProperty(i,"onBeforeRender",function(){if(this.collection.length<=1)return!1}),i))}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.SearchApp,e=n.Shared,u=i.Helpers,r=i.Utils.Constants,v=r.SEARCH_NAV_CHANNEL,h=r.EVENTS.ACTION,c=r.SEARCH_MIN_WIDTH,l=r.FULL_SEARCH_MIN_WIDTH,f=r.SUGGESTION_LIMITS,o=r.LIBRARY_TYPES,y=o.EXCHANGE,p=o.HOSTED_LIBRARY,w=o.WORKSPACE,a=e.Utils.Constants.CONTEXTS,s=a.SEARCH_NAV,b=a.AREA,k=e.Utils.Constants.ENUMS.CONTEXT_TYPES;i.Views.SearchNavAppView=t.View.extend({name:"SearchNavAppView.js",tagName:"form",className:"query-container",template:i.Templates.SearchNavApp,_recentSearchEvents:!1,_recentSearchStorageKey:"_c-"+n.Data.User.username+":recent-searches",radioChannels:_defineProperty({},v,_defineProperty({},h.CLOSE_SUBSET,"clearSubset")),bindings:{"[name=query]":"query"},ui:{$input:"#query",$subset:".subset-viewpart"},events:{submit:"onSubmit","click .search-icon":"onSearch","click .close":"hideResponsiveSearch","keydown input":"onKeydown","click a":"onClick"},initialize:function(){if(n.Data.Config.isDebug&&!this.options.controller)throw Error("Controller type must be passed during instantiation.");this.localStorageHelper=n.Shared.Utils.LocalStorageHelper;this.objectLinkService=n.Shared.Services.ObjectLinkService;this.contextService=n.Shared.Services.ContextService;this.listenTo(this.contextService,"set-context:"+s,this.onContextChange);this.listenTo(this.contextService,"clear-context:"+s,this.clearSubset);this.listenTo(this.model.subset,"change",this.renderSubset);this.listenTo(this.model,"change:query",this.onQueryChange);this.initializeFilterService();this.initializeNavElements()},initializeFilterService:function(){this.filterService=this.options.filterService;this.filterService||(this.filterService=new i.Services.FilterService)},initializeNavElements:function(){this.$mainNav=$(".navbar-nav");this.$navContainer=$(".container");this.$navParent=$("#collapse-target");this.$searchParent=$("#search-area-nav")},clearSubset:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=n.refocus,i=n.ignoreSubset;this.subsetView&&(this.model.subset.set({active:!1,ignoreSubset:!!i},{silent:!0}),this.$el.removeClass("has-subset"),this.subsetView.close(),t&&this.ui.$input.focus())},onSearch:function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n.preventDefault()&&n.stopPropagation(),this.responsiveNav&&!this.responsiveActive?(this.showResponsiveSearch(),!1):(this.onSubmit(n,t),!1)},onQueryChange:function(){this.checkAndHideRecentResults()},showResponsiveSearch:function(){this.$navParent.addClass("search-focused search-active");this.$el.addClass("active");this.responsiveActive=!0},hideResponsiveSearch:function(){this.$navParent.removeClass("search-focused search-active");this.$el.removeClass("active");this.responsiveActive=!1},showFullSearch:function(){this.responsiveActive&&this.hideResponsiveSearch();this.$searchParent.removeClass("search-responsive");this.responsiveNav=!1},hideFullSearch:function(){this.$searchParent.addClass("search-responsive");this.responsiveNav=!0},onSubmit:function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i,r,f;return(n.preventDefault()&&n.stopPropagation(),i=t.goToResult,r=this.model.get("query"),!r)?!1:(i||this.updateSearchHistory({add:!0,query:r}),f=void 0,f=i?u.getDirectUrl(_.extend({},t,{objectLinkService:this.objectLinkService})):this.hasActiveSubset()?"/search?"+this.filterService.getHumanizedQueryString():"/search?query="+this.model.get("query"),this.logSearch(t),this.navigateTo(f),this.model.trigger(h.SEARCH_SUBMIT),!1)},onDeleteRecentSearchClick:function(n){var i;n.stopPropagation();var t=this.$el.find(".tt-dataset-recent-searches"),r=t.find(".tt-cursor"),u=r.text();return this.updateSearchHistory({remove:!0,query:u}),i=t.children(".tt-selectable").length<=1,this.model.get("query"),i?t.empty():r.remove(),i&&this.checkAndHideRecentResults(),e.Utils.AnalyticsService.logRemoveRecentSearch({query:u.trim()}),!1},onKeydown:function(n){this.model.get("subset")&&(this.model.get("query")&&this.model.get("query").length?this.$el.hasClass("active")||this.ui.$input.typeahead("open"):n.keyCode===r.BACKSPACE_KEY_CODE&&0===this.ui.$input.text().length&&this.clearSubset())},onContextChange:function(){var n=this.contextService.getContext(s),e=this.contextService.getContext(b),r,i,f;n instanceof t.Model&&(r=u.ReadableContextTypes[n.get("typeId")],r&&(i=void 0,n.libraries&&(f=n.libraries.find(function(n){return _.contains([y,p,w],n.get("type"))}),i=f?f.get("id"):null),n.get("typeId")===k.LIBRARY&&(i=n.get("id")),this.model.subset.set({label:r,id:n.get("id"),name:n.get("name"),type:n.get("type"),libraryId:i,area:e?e.get("area"):null})))},hasActiveSubset:function(){return this.filterService.hasSubset()&&this.model.subset.get("active")},getRecentSearchHistory:function(){var n=this.localStorageHelper.get(this._recentSearchStorageKey);return _.isArray(n)||(n=[]),n},setRecentSearchHistory:function(n){_.isArray(n)&&this.localStorageHelper.set(this._recentSearchStorageKey,n)},getRecentSearchBloodhound:function(){var n=this.getRecentSearchHistory();return new Bloodhound({datumTokenizer:Bloodhound.tokenizers.whitespace,queryTokenizer:Bloodhound.tokenizers.whitespace,limit:f.DEFAULT,local:n})},updateSearchHistory:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.query,i;n=n.trim();i=this.updateRecentSearch(_.extend({},t,{query:n}));this._recentStorageEngine.clear();this._recentStorageEngine.add(i)},updateRecentSearch:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},u=t.add,e=t.remove,r=t.query,n=this.getRecentSearchHistory(),i=n.indexOf(r);return u&&-1===i&&n.unshift(r),e&&i>-1&&n.splice(i,1),n.length>f.RECENT_SEARCH&&(n=n.slice(0,f.RECENT_SEARCH)),this.setRecentSearchHistory(n),n},bindRecentSearchEvents:function(){this._recentSearchEvents=!0;var n=_.bind(this.onDeleteRecentSearchClick,this);this.$el.find(".recent svg").on("click",n)},logSearch:function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},u=i.suggestion,n=void 0===u?{}:u,f=i.source,t=this.model.subset.pick("id","area","type","name"),o=t.id,s=t.area,h=t.type,c=t.name,l={query:this.model.get("query"),location:this.options.controller,subset:{id:o,type:h,name:c,area:s},library:{id:n.libraryId,name:n.libraryName,type:n.libraryType},selected:{id:n.id,name:n.name,type:f||r.SEARCH_TYPES.DIRECT}};e.Utils.AnalyticsService.logInstantSearch(l)},navigateTo:function(n){this.ui.$input.typeahead("close");e.Helpers.isSamePageRoute(n)?t.Events.trigger("navigate",n):window.location.href=n},initializeTypeahead:function(){var n=[].concat(_toConsumableArray(this.getDirectSearchSources()),_toConsumableArray(this.getDynamicSearchSources()),_toConsumableArray(this.getRecentSearchSources()),_toConsumableArray(this.getAlbertSearchSources()));this.ui.$input.typeahead({minLength:0,highlight:!0},n);this.setUpTypeaheadListeners()},getDirectSearchSources:function(){return[{name:r.SEARCH_TYPES.DIRECT,source:u.HandleQuery(),display:function(n){return n.query},templates:{suggestion:u.GetTemplate(i.Templates.DirectSearchSuggestion),footer:i.Templates.DatasetFooter}}]},getAlbertSearchSources:function(){var t=n.Data.User;return 2===t.role&&t.modules&&t.modules.curriculum?[{name:r.SEARCH_TYPES.ALBERT,source:u.HandleQuery(),display:function(n){return n.query},templates:{suggestion:u.GetTemplate(i.Templates.AlbertSuggestion)}}]:[]},getDynamicSearchSources:function(){var n=this;return _.map(this.getBloodhounds(),function(t,f){return{name:t.name,source:u.HandleQuery(t.bloodhound),limit:u.GetLimits(t),display:function(n){return n.name},async:!0,templates:{header:t.name===r.QUERY_TYPE.SUGGESTION?null:u.GetTemplate(i.Templates.DatasetHeader),pending:0===f?u.GetTemplate(i.Templates.PartialLoading):i.Templates.NotFound,notFound:i.Templates.NotFound,suggestion:n.getDynamicTemplate(t.name),footer:i.Templates.DatasetFooter}}})},getRecentSearchSources:function(){return this._recentStorageEngine=this.getRecentSearchBloodhound(),[{name:r.SEARCH_TYPES.RECENT,source:u.HandleQuery(this._recentStorageEngine,{name:r.SEARCH_TYPES.RECENT}),limit:f.RECENT_SEARCH,templates:{header:i.Templates.RecentSearchesHeader,suggestion:i.Templates.RecentSearchSuggestion,footer:i.Templates.DatasetFooter}}]},getDynamicTemplate:function(n){var t=r.QUERY_TYPE;return n===t.SUGGESTION?i.Templates.SpellingSuggestion:n===t.VIDEO?i.Templates.VideoResult:n===t.CATEGORY?i.Templates.CategoryResult:n===t.SERIES?i.Templates.SeriesResult:void 0},getSubsetQuery:function(n,t){return this.hasActiveSubset()?t.url+"?"+this.filterService.getQueryString():t.url+"?query="+n},getBloodhounds:function(){var n=_.bind(this.getSubsetQuery,this),t=r.QUERY_TYPE;return _.map(t,function(t){return{bloodhound:new Bloodhound({datumTokenizer:Bloodhound.tokenizers.obj.whitespace("label"),queryTokenizer:Bloodhound.tokenizers.whitespace,limit:f.RECENT_SEARCH,remote:{url:"/api/v2/search/autocomplete",prepare:n,transform:_.partial(u.TransformResult,_,t,{objectLinkService:this.objectLinkService})}}),name:t}},this)},setUpTypeaheadListeners:function(){this.handleBlur();this.ui.$input.bind("typeahead:select",_.bind(this.onTypeaheadSelect,this));this.ui.$input.bind("typeahead:render",_.bind(this.onTypeaheadRender,this));this.ui.$input.bind("typeahead:close",_.bind(this.onTypeaheadClose,this));this.ui.$input.bind("typeahead:open",_.bind(this.onTypeaheadOpen,this))},handleBlur:function(){var n=this;this.ui.$input.off("blur");this.ui.$input.on("blur",function(t){t.stopImmediatePropagation();setTimeout(function(){$(document.activeElement).hasClass("remove-tag")?n.clearSubset({refocus:!0}):(n.model.subset.set("ignoreSubset",!1,{silent:!0}),n.ui.$input.typeahead("close"))},1)})},deactivateTypeahead:function(){this.ui.$input.typeahead("val","");this.ui.$input.typeahead("deactivate")},checkAndHideRecentResults:function(){var n=this.model.get("query");if((!n||n&&n.length<f.MIN)&&!this.getRecentSearchHistory().length)return this.$el.addClass("hide-results"),!0;this.$el.removeClass("hide-results")},onTypeaheadSelect:function(n,t,i){var f,e;if(n.preventDefault()&&n.stopPropagation(),i===r.SEARCH_TYPES.ALBERT)return this.logSearch({suggestion:t,source:i}),void this.navigateTo("/albert/search");"string"==typeof t&&(t={query:t});f=t.query||t.name;this.model.set({query:f});this.ui.$input.typeahead("val",f);e=u.DirectUrlWhitelist[i];return this.onSubmit(n,{suggestion:t,source:i,goToResult:e})},onClick:function(n){n.preventDefault()},onTypeaheadRender:function(n,t,i,u){if(u!==r.SEARCH_TYPES.RECENT)return!1;this.bindRecentSearchEvents()},onTypeaheadOpen:function(){if(this.$el.addClass("active"),this.checkAndHideRecentResults(),!this.model.subset.get("id")||this.model.subset.get("active")||this.model.subset.get("ignoreSubset")||this.renderSubset(),!this._recentSearchEvents){var n=this.model.get("query");n&&n.length>=r.TYPEAHEAD_ACTIVATION_LENGTH&&this.ui.$input.typeahead("val",n);this.bindRecentSearchEvents()}},onTypeaheadClose:function(){this.$el.removeClass("active");this._recentSearchEvents&&(this._recentSearchEvents=!1,this.$el.find(".recent svg").off("click"))},bindResize:function(){this.boundResize||(this.boundResize=_.bind(_.debounce(this.onResize,250),this),$(window).on("resize",this.boundResize),this.boundResize())},onResize:function(){this.navOffset=this.$mainNav.offset().left+this.$mainNav.width();var n=this.$navContainer.offset().left+this.$navContainer.width()-this.navOffset;this.navOffset<150?(!this.responsiveNav&&n<l&&this.hideFullSearch(),this.responsiveNav&&n>=l&&this.showFullSearch()):(!this.responsiveNav&&n<c&&this.hideFullSearch(),this.responsiveNav&&n>=c&&this.showFullSearch())},renderSubset:function(){this.subsetView=new i.Views.SubsetView({model:this.model.subset,radio:this.radio});this.model.subset.get("id")&&(this.model.subset.set("active",!0,{silent:!0}),this.$el.addClass("has-subset"));this.renderView(this.ui.$subset,this.subsetView)},onRender:function(){this.stickit();this.initializeTypeahead();this.bindResize()},onClose:function(){$(window).off("resize",this.boundResize);this.ui.$input.off("focus");this.ui.$input.off("blur")}})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.SearchApp,r=(n.Shared,i.Utils.Constants),u=r.SEARCH_NAV_CHANNEL,f=r.EVENTS.ACTION;i.Views.SubsetView=t.View.extend({name:"SubsetView.js",template:i.Templates.Subset,radioChannels:[u],className:"subset tag-container",events:{"click .remove-tag":"onClickClose"},ui:{subsetSearch:".subset-search"},onClickClose:function(n){return n.preventDefault(),n.stopImmediatePropagation(),this.radio[u].trigger(f.CLOSE_SUBSET,{refocus:!0,ignoreSubset:!0}),!1},onRender:function(){this.ui.subsetSearch.tooltip({placement:"left"})},onClose:function(){this.ui.subsetSearch.tooltip("destroy")}})}(ClickView,EasyMoney),function(n,t){"use strict";var r=n.SearchApp,i=n.Shared,u=(t.PagedCollection.prototype,r.Utils.Constants),f=u.CHANNEL_NAME,e=u.EVENTS.ACTION,o=i.Views.MediaCollectionPaginatorItemView.extend({name:"SearchPaginatorItemView",radioChannels:[f],navigate:function(n){n.preventDefault();var t=_.extend({},i.Helpers.GetQueryString(),{page:this.pageId,scrollToTop:!0});return this.radio[f].trigger(e.FILTER_CHANGED,t),!1}});r.Views.SearchMediaCollectionPaginatorView=i.Views.PaginatorView.extend({name:"SearchMediaCollectionPaginatorView.js",childView:o})}(ClickView,EasyMoney),function(n,t){"use strict";var i=n.SearchApp,r=n.Shared,c=r.Views.MediaCollectionView.prototype,f=i.Utils.Constants,u=f.CHANNEL_NAME,e=f.EVENTS,o=f.TV_ITEM_FREQUENCY,s=(e.DATA,e.RENDER,e.ACTION),h=t.View.extend({template:i.Templates.EmptyMedia,className:"empty-video",viewOptions:function(){return{hasFilters:this.options.filterService.hasActiveFilters()}}}),l=r.Views.MasterVideoListView.extend({radioChannels:[u],initialize:function(){r.Views.MasterVideoListView.prototype.initialize.apply(this,arguments);this.initCloudResults()},initCloudResults:function(){this.hasCloudResults()&&(this.tvCollection=new i.Collections.CloudVideoCollection(this.collection.cloudVideos))},onSync:function(){this.initCloudResults();r.Views.MasterVideoListView.prototype.onSync.apply(this,arguments)},buildChildView:function(n){return n.set("parentName",this.options.name),new this.childView({model:n,allowDownload:this.options.allowDownload,currentUser:this.options.currentUser,isotope:!0,showPreview:!1,showCheckbox:this.options.bulkActions,rootUrl:this.options.rootUrl,keywords:this.options.filterService.getKeywords(),tileMode:this.options.tileMode,lazyload:!0,parent:this.options.parent,origin:!0,showCategory:!0})},hasCloudResults:function(){return this.collection.cloudVideos&&this.collection.cloudVideos.data&&this.collection.cloudVideos.data.length},renderTvItem:function(n){if(this.tvCollection){var r=((this.collection.currentPage()-1)*this.collection.pageSize()+n+1)/o-1,t=this.tvCollection.at(r);t&&this.renderView(this.$el,new i.Views.TvResultItemView({model:t,totalResults:this.collection.cloudVideos.pagination.totalItems,filterService:this.options.filterService}),{empty:!1})}},shouldRenderTvItem:function(t){return 2==n.Data.User.role&&!this.options.filterService.hasActiveFilters()&&!!this.hasCloudResults()&&(t+1)%o==0},renderItems:function(){var n=this;this.options.showPartialLoader&&this.collection&&!this.collection.isLoaded()||(this.$el.empty(),this.collection.each(function(t,i){n.addOne(t);n.shouldRenderTvItem(i)&&n.renderTvItem(i)}),this.lazyLoad())},onBeforeRender:function(){return!(this.collection.isLoaded()&&!this.collection.length)||(this.renderView(this.$el,new h({collection:this.collection,filterService:this.options.filterService})),this.radio[u].trigger(s.EMPTY_RESULTS),!1)}});i.Views.MediaCollectionView=r.Views.MediaCollectionView.extend({name:"SearchAppMediaCollectionView",radioChannels:[u],videoListView:l,initialize:function(){c.initialize.apply(this,arguments);this.listenTo(this.collection,"request",this.onRequest);this.listenTo(this.collection,"sync",this.onSync);this.renderLanding=this.options.renderLanding},onSync:function(){this.renderLanding=!1;this.renderHeading()},hasSubCategories:function(){return!1},isLoaded:function(){return this.collection.isLoaded()||!this.collection.length},renderEmptySearchResults:function(){this.renderView(this.$el,new h({collection:this.collection}));this.radio[u].trigger(s.EMPTY_RESULTS)},renderPagination:function(){var n=new i.Views.SearchMediaCollectionPaginatorView({collection:this.collection,title:this.model.get("name"),sortService:this.sortService,radio:this.radio});this.renderView(this.ui.pagination,n,{empty:!1})},onBeforeRender:function(){return this.collection.isLoaded()||this._resetClassName(),!0},onRender:function(){this._resetClassName();this.renderBanner();this.renderHeading();this.renderMediaList({filterService:this.options.filterService,radio:this.radio});this.renderPagination();this._showLayoutToggle()&&this.changeLayout(this.getLayoutPreference())}})}(ClickView,EasyMoney),function(n,t){"use strict";var r=n.SearchApp,i=n.Shared,u=i.Utils.Constants.CONTEXTS;r.Views.TvResultItemView=t.View.extend({name:"TvResultItemView.js",template:r.Templates.TvResultItem,className:"cv-video isotope-tile-item tv-result-item",initialize:function(){this.filterService=this.options.filterService;this.contextService=i.Services.ContextService},ui:{adsFree:".has-ads-free"},events:{"click .video-link":"onClick","click .cv-thumbnail":"onClick","click .tv-results-count":"onClick"},logClickthrough:function(n){var t={};t.type=n.hasClass("series-link")?"series":n.hasClass("category-link")?"category":"video";t.link=n.attr("href")||this.getActionUrl();i.Utils.AnalyticsService.logVideoClickthrough({mediaCollection:this.contextService.getContext(u.MEDIA_COLLECTION),area:this.contextService.getContext(u.AREA),video:this.model,clickthrough:t},{origin:"tv"})},onClick:function(n){var t=$(n.currentTarget);return t&&this.logClickthrough(t),!0},viewOptions:function(){var n=moment.utc(this.model.get("startTime")).local(),t=this.filterService.getKeywords().pluck("title");return{title:CV.Utils.HandleBarsHelper.WordsHighlighter(this.model.get("title"),t),description:CV.Utils.HandleBarsHelper.WordsHighlighter(this.model.get("description"),t),origin:"tv",badgeTitle:"The programme comes from ClickView TV",formattedStartDate:n.format("Mo MMMM"),formatterStartTime:n.format("h:mm a"),resultCount:this.options.totalResults,thumbUrl:this.model.get("thumbnailUrl"),actionUrl:this.getProgrammeUrl(),cloudSearchUrl:this.getSearchUrl()}},onRender:function(){this.ui.adsFree.tooltip()},getProgrammeUrl:function(){return this.getSearchUrl()+"&id="+this.model.get("id")},getSearchUrl:function(){var t=encodeURIComponent(this.filterService.getQueryModel().get("query"));return n.Data.Config.urls.cloud247+"/#/search?q="+t}})}(ClickView,EasyMoney),function(n,t){"use strict";var i,f=n.SearchApp,r=n.Shared,s=r.Controllers.SharedController.prototype,o=f.Utils.Constants,e=o.CHANNEL_NAME,u=o.EVENTS,h=(u.DATA,u.RENDER,u.ACTION),c=r.Utils.Constants.CONTEXTS.AREA,l=r.Utils.Constants.STRINGS.AREA.SEARCH;f.Controllers.SearchAppController=r.Controllers.SharedController.extend((_defineProperty(i={id:"searchApp",name:"SearchAppController",routePrefix:"search",searchable:!0,routes:{"(/)":"renderApp","?*queryString":"updateQuery"},initialize:function(){this.$leftNav=$(".left-container");this.filterService=new f.Services.FilterService;this.navHistoryService=r.Services.NavigationHistoryService;this.renderInitial();this.initChannels(this.options.channels);s.initialize.apply(this,arguments)},renderInitial:function(){var n=new f.Views.SearchAppView({leftNav:this.$leftNav,filterService:this.filterService});$("#search-app").html(n.render().el);n.trigger("rendered")},initChannels:function(n){var i=this,r;if(n=_.isArray(n)?n:[n],!t.Global&&!t.Global.radio)throw Error("EasyMoney.Global.radio instance does not exist.");if(!t.Global.radio.areRadioChannels(n))throw Error("Provided channels must be a Channel Service instance.");this.channels={};r=_.bind(function(n){var t=n.get("name");_.isFunction(i[t])&&(i.listenTo(n,"all",i[t]),i.channels[t]=n)},this);n.forEach(r)}},e,function(){var n=[].concat(Array.prototype.slice.call(arguments)),t=n[0],i=n.slice(1);switch(t){case h.UPDATE_ROUTE:this.updateRoute.apply(this,i)}}),_defineProperty(i,"renderApp",function(n){n||(n={});var t=n.showLanding,i=void 0===t||t;return this.showLeftNav(),this.appIsRendered||(this.appIsRendered=!0),this.channels[e].trigger(u.RENDER.APP,{showLanding:i}),!1}),_defineProperty(i,"updateQuery",function(n){return this.appIsRendered||this.renderApp({showLanding:!1}),this.channels[e].trigger(u.ACTION.NAVIGATE,n),this.navHistoryService.addPage("Search Results"),!1}),_defineProperty(i,"updateRoute",function(n){var i=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).scrollToTop,r=void 0!==i&&i;n&&(t.Events.trigger("navigate",n,{trigger:!1,scrollToTop:r}),this.navHistoryService.addPage("Search Results"),this.logPageView())}),_defineProperty(i,"onBeforeRouteAction",function(){return this.contextService.setContext(c,{area:l}),r.Controllers.SharedController.prototype.onBeforeRouteAction.apply(this,arguments)}),i))}(ClickView,EasyMoney),function(n){"use strict";n.SearchApp.Router=n.Shared.Router.BaseRouter.extend({container:$("#search-app"),history:!0,_routeToRegExp:function(t){var i=n.Shared.Router.BaseRouter.prototype._routeToRegExp.call(this,t);return new RegExp(i.source,"i")}})}(ClickView,EasyMoney),function(n,t){"use strict";n.SearchApp.AppStart=function(){var i=n.Data._bootstrap;if(i&&(!i||i.initSearchApp)){var r=n.SearchApp,e=r.Utils.Constants.CHANNEL_NAME,u=new r.Router,f=new t.RadioChannel({name:e,logging:!1});t.Global||(t.Global={});t.Global.radio=new t.Radio({channels:[f]});u.addController(new r.Controllers.SearchAppController({channels:[f]}));u.start()}}}(ClickView,EasyMoney)