var __assign,__extends,ClickView;this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.AccordionItem=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<div class="accordion-content">\r\n    <h1 class="accordion-heading">'+n.escapeExpression((f=(f=i.title||(t!=null?t.title:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"title",hash:{},data:u}):f))+'<\/h1>\r\n    <div class="accordion-actions"><\/div>\r\n<\/div>\r\n<div class="accordion-child-content"><\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.DownloadToLocalCachePopup=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<div class="add-to-cache-content-container">\r\n    <p class="description">Local Cache allows you to reliably stream video in your classroom.<\/p>\r\n\r\n    <img alt="ClickView Local Cache" title="ClickView Local Cache" class="add-to-cache-image" src="/Assets/images/svg/src/shared/add_to_local_cache.svg" />\r\n    \r\n    <p class="description">Add your video to Local Cache if you want to ensure seamless playback, regardless of internet quality. <span class="info-badge-container"><\/span><\/p>\r\n<\/div>\r\n\r\n<div class="popup-button-container-fake">\r\n    <div class="btn-viewpart"><\/div>\r\n    <a class="btn grey close-button">Close<\/a>\r\n<\/div>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.InfoBadge=Handlebars.template({"1":function(n,t,i,r,u){var f;return"<a href="+n.escapeExpression((f=(f=i.link||(t!=null?t.link:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"link",hash:{},data:u}):f))+' target="_blank">'},"3":function(){return"<\/a>"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f,e=t!=null?t:n.nullContext||{};return((f=i["if"].call(e,t!=null?t.link:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?f:"")+'\r\n<svg class="question-mark-icon">\r\n    <use xlink:href="#icn-questionmark"><\/use>\r\n<\/svg>\r\n'+((f=i["if"].call(e,t!=null?t.link:t,{name:"if",hash:{},fn:n.program(3,u,0),inverse:n.noop,data:u}))!=null?f:"")},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.NotificationBanner=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<div class="inner">\r\n    <p>'+n.escapeExpression((f=(f=i.text||(t!=null?t.text:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"text",hash:{},data:u}):f))+'<\/p>\r\n<\/div>\r\n<span class="close"><svg><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#cross-icon"><\/use><\/svg><\/span>\r\n'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.RestrictedAccessPopup=Handlebars.template({"1":function(){return'    <a class="unrestrict">Allow full access<\/a>\r\n'},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{};return'<div class="form-group select-viewpart">\r\n    <label for="restrict-from">Restrict access from: <span class="info-badge-container"><\/span><\/label>\r\n    <select id="restrict-from" name="restrict-from"><\/select>\r\n<\/div>\r\n<div class="year-group-viewpart button-list"><\/div>\r\n<div class="restrict-access-restriction-description">'+((e=(f=(f=i.restrictionDescription||(t!=null?t.restrictionDescription:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(o,{name:"restrictionDescription",hash:{},data:u}):f))!=null?e:"")+'<\/div>\r\n<div class="popup-button-container-fake">\r\n    <span class="confirm-button-container"><\/span>\r\n'+((e=i.unless.call(o,t!=null?t.isNewRestriction:t,{name:"unless",hash:{},fn:n.program(1,u,0),inverse:n.noop,data:u}))!=null?e:"")+"<\/div>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.RestrictedBadge=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(){return'<svg class="restricted-badge-image">\r\n    <use xlink:href="#restricted-padlock-filled"><\/use>\r\n<\/svg>'},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.RestrictedThumbnail=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<svg class="restricted-badge-image">\r\n    <use xlink:href="#restricted-padlock"><\/use>\r\n<\/svg>\r\n<h2 class="restricted-thumb-text">'+n.escapeExpression((f=(f=i.text||(t!=null?t.text:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"text",hash:{},data:u}):f))+"<\/h2>"},useData:!0});this.ClickView=this.ClickView||{};this.ClickView.Shared=this.ClickView.Shared||{};this.ClickView.Shared.Templates=this.ClickView.Shared.Templates||{};this.ClickView.Shared.Templates.RestrictionInfo=Handlebars.template({"1":function(n,t,i,r,u){var e,f,o=t!=null?t:n.nullContext||{},s=i.helperMissing,h="function",c=n.escapeExpression;return"<p "+((e=i["if"].call(o,t!=null?t.urgent:t,{name:"if",hash:{},fn:n.program(2,u,0),inverse:n.noop,data:u}))!=null?e:"")+">Will automatically be added "+((e=i["if"].call(o,t!=null?t.library:t,{name:"if",hash:{},fn:n.program(4,u,0),inverse:n.noop,data:u}))!=null?e:"")+'<strong><time class="timeago" datetime='+c((f=(f=i.expiryTime||(t!=null?t.expiryTime:t))!=null?f:s,typeof f===h?f.call(o,{name:"expiryTime",hash:{},data:u}):f))+">"+c((f=(f=i.expiresOn||(t!=null?t.expiresOn:t))!=null?f:s,typeof f===h?f.call(o,{name:"expiresOn",hash:{},data:u}):f))+"<\/time<\/strong><\/p>\r\n"},"2":function(){return'class="urgent"'},"4":function(n,t,i,r,u){var f;return"to "+n.escapeExpression((f=(f=i.library||(t!=null?t.library:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"library",hash:{},data:u}):f))+" "},"6":function(n,t,i,r,u){var f;return"<p><strong>"+n.escapeExpression((f=(f=i.restrictionDescription||(t!=null?t.restrictionDescription:t))!=null?f:i.helperMissing,typeof f=="function"?f.call(t!=null?t:n.nullContext||{},{name:"restrictionDescription",hash:{},data:u}):f))+"<\/strong><\/p>\r\n"},compiler:[7,">= 4.0.0"],main:function(n,t,i,r,u){var f;return'<div class="restriction-info-wrapper">\r\n'+((f=i["if"].call(t!=null?t:n.nullContext||{},t!=null?t.expiryTime:t,{name:"if",hash:{},fn:n.program(1,u,0),inverse:n.program(6,u,0),data:u}))!=null?f:"")+"<\/div>"},useData:!0});!function(n){var t;(function(n){function o(n){return"Students in Year "+n+" and below"}var e,r,t,c,s,i,y,l,a,v,u,h,f;(e=n.OnlineUserRole||(n.OnlineUserRole={}))[e.Unspecified=0]="Unspecified";e[e.Student=1]="Student";e[e.Staff=2]="Staff";e[e.Admin=3]="Admin";e[e.CVAdmin=4]="CVAdmin";e[e.FreeUser=5]="FreeUser";e[e.ReadOnly=6]="ReadOnly";(t=r=n.OnlineYearGroups||(n.OnlineYearGroups={}))[t.All=0]="All";t[t.Kindergarten=1]="Kindergarten";t[t.Year1=2]="Year1";t[t.Year2=3]="Year2";t[t.Year3=4]="Year3";t[t.Year4=5]="Year4";t[t.Year5=6]="Year5";t[t.Year6=7]="Year6";t[t.Year7=8]="Year7";t[t.Year8=9]="Year8";t[t.Year9=10]="Year9";t[t.Year10=11]="Year10";t[t.Year11=12]="Year11";t[t.Year12=13]="Year12";t[t.Year13=14]="Year13";t[t.Students=15]="Students";t[t.Staff=16]="Staff";(c=n.MasterRoles||(n.MasterRoles={}))[c.Guest=16]="Guest";c[c.User=32]="User";c[c.Admin=48]="Admin";c[c.SuperAdmin=64]="SuperAdmin";c[c.System=255]="System";f="cannot access this video";n.OnlineYearGroupMetadata=((u={})[r.All]={name:"Everyone",label:"Students and staff",description:"Students and staff",get displayText(){return this.description+" "+f},individualGroup:!1,countries:["AU","UK","NZ"]},u[r.Kindergarten]={name:"Kindergarten",label:"K",description:"Students in Kindergarten",get displayText(){return this.description+" "+f},individualGroup:!0,countries:["AU"]},u[r.Year1]={name:"Year 1",label:"Y1",description:o(1),get displayText(){return this.description+" "+f},individualGroup:!0,countries:["AU","UK","NZ"]},u[r.Year2]={name:"Year 2",label:"Y2",description:o(2),get displayText(){return this.description+" "+f},individualGroup:!0,countries:["AU","UK","NZ"]},u[r.Year3]={name:"Year 3",label:"Y3",description:o(3),get displayText(){return this.description+" "+f},individualGroup:!0,countries:["AU","UK","NZ"]},u[r.Year4]={name:"Year 4",label:"Y4",description:o(4),get displayText(){return this.description+" "+f},individualGroup:!0,countries:["AU","UK","NZ"]},u[r.Year5]={name:"Year 5",label:"Y5",description:o(5),get displayText(){return this.description+" "+f},individualGroup:!0,countries:["AU","UK","NZ"]},u[r.Year6]={name:"Year 6",label:"Y6",description:o(6),get displayText(){return this.description+" "+f},individualGroup:!0,countries:["AU","UK","NZ"]},u[r.Year7]={name:"Year 7",label:"Y7",description:o(7),get displayText(){return this.description+" "+f},individualGroup:!0,countries:["AU","UK","NZ"]},u[r.Year8]={name:"Year 8",label:"Y8",description:o(8),get displayText(){return this.description+" "+f},individualGroup:!0,countries:["AU","UK","NZ"]},u[r.Year9]={name:"Year 9",label:"Y9",description:o(9),get displayText(){return this.description+" "+f},individualGroup:!0,countries:["AU","UK","NZ"]},u[r.Year10]={name:"Year 10",label:"Y10",description:o(10),get displayText(){return this.description+" "+f},individualGroup:!0,countries:["AU","UK","NZ"]},u[r.Year11]={name:"Year 11",label:"Y11",description:o(11),get displayText(){return this.description+" "+f},individualGroup:!0,countries:["AU","UK","NZ"]},u[r.Year12]={name:"Year 12",label:"Y12",description:o(12),get displayText(){return this.description+" "+f},individualGroup:!0,countries:["AU","UK","NZ"]},u[r.Year13]={name:"Year 13",label:"Y13",description:o(13),get displayText(){return this.description+" "+f},individualGroup:!0,countries:["UK","NZ"]},u[r.Students]={name:"Students",label:"Students",description:"Students",get displayText(){return this.description+" "+f},individualGroup:!1,countries:["AU","UK","NZ"]},u[r.Staff]={name:"Staff",label:"All staff",description:"Students and staff",get displayText(){return this.description+" "+f},individualGroup:!1,countries:["AU","UK","NZ"]},u);(i=s=n.SchoolTypes||(n.SchoolTypes={}))[i.Unclassified=0]="Unclassified";i[i.Primary=1]="Primary";i[i.Secondary=2]="Secondary";i[i.K12=3]="K12";i[i.Tertiary=4]="Tertiary";i[i.NonEducational=5]="NonEducational";i[i.Partners=6]="Partners";i[i.Internal=7]="Internal";i[i.Other=8]="Other";i[i.HostedLibrary=9]="HostedLibrary";n.SchoolTypeMetadata=((h={})[s.Unclassified]={hasYearGroups:!0},h[s.Primary]={hasYearGroups:!0},h[s.Secondary]={hasYearGroups:!0},h[s.K12]={hasYearGroups:!0},h[s.Tertiary]={hasYearGroups:!1},h[s.NonEducational]={hasYearGroups:!1},h[s.Partners]={hasYearGroups:!0},h[s.Internal]={hasYearGroups:!0},h[s.Other]={hasYearGroups:!0},h[s.HostedLibrary]={hasYearGroups:!0},h);(y=n.SettingOptions||(n.SettingOptions={})).Permanent={LIBRARY_REVIEW:"library_review",SCHOOL_MESSAGING:"school_messaging",STUDENT_WS_SHARING:"student_ws_sharing",HIDE_RESOURCES_FOR_STUDENTS:"hide_resources_for_students",STUDENT_TO_STUDENT_MESSAGING:"student_to_student_messaging"};y.Temporary={LEGACY_TV_NAMING:"legacy_tv_naming",LEGACY_ALBERT_CUSTOMER:"legacy_albert_customer",LIBRARY_REVIEW_WIZARD_SEEN:"library_review_wizard_seen"};(l=n.LocalCacheDownloadStatus||(n.LocalCacheDownloadStatus={}))[l.InProgress=0]="InProgress";l[l.Completed=1]="Completed";l[l.Error=2]="Error";l[l.Expired=3]="Expired";(a=n.SettingKind||(n.SettingKind={}))[a.Permanent=0]="Permanent";a[a.Temporary=1]="Temporary";(v=n.RestrictedObjectType||(n.RestrictedObjectType={}))[v.TermUpdate=1]="TermUpdate";v[v.RestrictedByAdmin=2]="RestrictedByAdmin"})((t=n.Shared||(n.Shared={})).Constants||(t.Constants={}))}(ClickView||(ClickView={}));__assign=this&&this.__assign||Object.assign||function(n){for(var r,i,t=1,u=arguments.length;t<u;t++)for(i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n};!function(n){n.Shared||(n.Shared={});n.Shared.Helpers=_.extend({},n.Shared.Helpers,{PropertyMixin:function(n,t){var i=t&&t.initProps;return{initProps:__assign({},n,i)}}})}(ClickView||(ClickView={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();!function(n){var t,i,r;t=n.Shared||(n.Shared={});i=t.Models||(t.Models={});r=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return __extends(t,n),Object.defineProperty(t.prototype,"name",{get:function(){return"MasterAvatar.ts"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"urlRoot",{get:function(){return"/api/settings/account/profile/avatar"},enumerable:!0,configurable:!0}),t}(EasyMoney.Model);i.Avatar=r}(ClickView||(ClickView={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();!function(n){var t,i,r;t=n.Shared||(n.Shared={});i=t.Models||(t.Models={});r=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return __extends(t,n),Object.defineProperty(t.prototype,"name",{get:function(){return"LocalCacheDownload.ts"},enumerable:!0,configurable:!0}),t}(EasyMoney.Model);i.LocalCacheDownload=r}(ClickView||(ClickView={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();!function(n){var t,i,r;t=n.Shared||(n.Shared={});i=t.Models||(t.Models={});r=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return __extends(i,n),Object.defineProperty(i.prototype,"defaults",{get:function(){return{type:t.Constants.RestrictedObjectType.RestrictedByAdmin}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"name",{get:function(){return"Restriction.ts"},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"idAttribute",{get:function(){return"groupId"},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"url",{get:function(){var n=this;return function(){return"/api/restriction/"+n.get("objectId")}},enumerable:!0,configurable:!0}),i.prototype.getMetadata=function(){return t.Constants.OnlineYearGroupMetadata[this.get("groupId")]},i}(EasyMoney.Model);i.Restriction=r}(ClickView||(ClickView={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();!function(n){var t,u,i,r;t=n.Shared||(n.Shared={});u=t.Models||(t.Models={});i=n.Shared.Constants;r=function(r){function u(){return null!==r&&r.apply(this,arguments)||this}return __extends(u,r),Object.defineProperty(u.prototype,"defaults",{get:function(){return{customerSettings:n.Data.CustomerSettings,userSettings:n.Data.UserSettings}},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"associations",{get:function(){return{customerSettings:function(n,t){return new EasyMoney.Collection(n,t)},userSettings:function(n,t){return new EasyMoney.Collection(n,t)}}},enumerable:!0,configurable:!0}),u.prototype.isAdmin=function(){return this.get("masterRole")===t.Constants.MasterRoles.Admin||this.get("masterRole")===t.Constants.MasterRoles.SuperAdmin},u.prototype.isStaff=function(){return 2===this.get("role")},u.prototype.isStudent=function(){return 1===this.get("role")},u.prototype.isTertiaryCustomer=function(){return this.get("schoolType")===i.SchoolTypes.Tertiary},u.prototype.hasLibraryReview=function(){return!!this.isAdmin()&&this.hasCustomerSetting(i.SettingOptions.Permanent.LIBRARY_REVIEW)},u.prototype.hasCustomerSetting=function(n){return this.customerSettings.any(function(t){return t.get("name")===n&&!0===t.get("value")})},u.prototype.setCustomerSetting=function(n,i,r){var f=this,e="/api/v1/customers/settings/"+n,u={value:i,name:n,kind:r};return t.Utils.AjaxHelper.put(e,u).then(function(){var t=f.customerSettings.findWhere({name:n});t&&t.set(u)})},u.prototype.hasUserSetting=function(n){return this.userSettings.any(function(t){return t.get("name")===n&&!0===t.get("value")})},u.prototype.setUserSetting=function(n,i,r){var f=this,e="/api/v1/users/settings/"+n,u={value:i,name:n,kind:r};return t.Utils.AjaxHelper.put(e,u).then(function(){var t=f.userSettings.findWhere({name:n});t&&t.set(u)})},u.prototype.hasLibraryReviewWizard=function(){return this.hasLibraryReview()&&!this.hasUserSetting(i.SettingOptions.Temporary.LIBRARY_REVIEW_WIZARD_SEEN)},u.prototype.enableLibraryReview=function(){return this.setCustomerSetting(t.Constants.SettingOptions.Permanent.LIBRARY_REVIEW,!0,t.Constants.SettingKind.Permanent)},u.prototype.disableLibraryReview=function(){return this.setCustomerSetting(t.Constants.SettingOptions.Permanent.LIBRARY_REVIEW,!1,t.Constants.SettingKind.Permanent)},u.prototype.disableLibraryReviewWizard=function(){return this.setUserSetting(t.Constants.SettingOptions.Temporary.LIBRARY_REVIEW_WIZARD_SEEN,!0,t.Constants.SettingKind.Temporary)},u.prototype.enableLibraryReviewWizard=function(){return this.setUserSetting(t.Constants.SettingOptions.Temporary.LIBRARY_REVIEW_WIZARD_SEEN,!1,t.Constants.SettingKind.Temporary)},u.prototype.schoolHasYearGroups=function(){return t.Constants.SchoolTypeMetadata[this.get("schoolType")].hasYearGroups},u.prototype.hasSyncedLibary=function(){return!!this.get("modules")&&this.get("modules").syncedLibrary},u.prototype.hasLocalCache=function(){return!!this.get("modules")&&this.get("modules").localCache},u}(EasyMoney.NestedModel);u.User=r;n.currentUser=new r(n.Data.User)}(ClickView||(ClickView={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();__assign=this&&this.__assign||Object.assign||function(n){for(var r,i,t=1,u=arguments.length;t<u;t++)for(i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n};!function(n){var t,r,i,u,f,e;t=n.Shared||(n.Shared={});r=t.Collections||(t.Collections={});i=n.Shared;u=i.Helpers;f={name:"LocalCacheDownloadCollection",model:i.Models.LocalCacheDownload};e=function(n){function t(t,i){return n.call(this,t,__assign({},i,u.PropertyMixin(f,i)))||this}return __extends(t,n),t}(EasyMoney.Collection);r.LocalCacheDownloadCollection=e}(ClickView||(ClickView={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();__assign=this&&this.__assign||Object.assign||function(n){for(var r,i,t=1,u=arguments.length;t<u;t++)for(i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n};!function(n){var t,r,i,u,f,e;t=n.Shared||(n.Shared={});r=t.Collections||(t.Collections={});i=n.Shared;u=i.Helpers;f={name:"RestrictionCollection",model:i.Models.Restriction};e=function(n){function t(t,i){return n.call(this,t,__assign({},i,u.PropertyMixin(f,i)))||this}return __extends(t,n),t}(EasyMoney.Collection);r.RestrictionCollection=e}(ClickView||(ClickView={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();__assign=this&&this.__assign||Object.assign||function(n){for(var r,i,t=1,u=arguments.length;t<u;t++)for(i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n};!function(n){var t,i,r,u,f;t=n.Shared||(n.Shared={});i=t.Views||(t.Views={});r={name:"$AccordionItemView",template:t.Templates.AccordionItem,className:"accordion-item"};u=function(n){function i(i){return n.call(this,__assign({},i,t.Helpers.PropertyMixin(r,i)))||this}return __extends(i,n),Object.defineProperty(i.prototype,"events",{get:function(){return{"click .accordion-content":"onClick"}},enumerable:!0,configurable:!0}),i.prototype.initialize=function(){this.listenTo(this.model,"destroy",this.onDestroy)},i.prototype.onDestroy=function(){this.close()},i.prototype.onClick=function(n){if(n.stopPropagation(),this.cachedView)return this.cachedView.close(),delete this.cachedView,this.$el.removeClass("open"),void this.model.set("open",!1);this.renderChild()},i.prototype.createView=function(n){var i=this.model.get(n),r=this.model.get("childModel"),u=this.model.get("childCollection"),t;return i?(t={model:r,collection:u,accordion:this.model},"childView"===n&&this.model.get("childViewOptions")&&_.extend(t,this.model.get("childViewOptions")),"actionView"===n&&this.model.get("actionViewOptions")&&_.extend(t,this.model.get("actionViewOptions")),new i(t)):null},i.prototype.renderChild=function(){this.cachedView=this.createView("childView");this.renderView(this.$(".accordion-child-content"),this.cachedView);this.$el.addClass("open");this.model.set("open",!0)},i.prototype.onBeforeRender=function(){var n=this.model.get("childCollection"),t;if(n){if(!n.length)return this.$el.hide(),!1;if(!n.first().get("childCollection"))return!0;if(t=!0,n.each(function(n){n.get("childCollection")&&n.get("childCollection").length&&(t=!1)}),t)return this.$el.hide(),!1}},i.prototype.onRender=function(){var n=this.createView("actionView");n&&this.renderView(this.$(".accordion-actions"),n);this.model.get("open")&&this.renderChild()},i}(EasyMoney.View);f=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return __extends(t,n),Object.defineProperty(t.prototype,"name",{get:function(){return"AccordionView.ts"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"childView",{get:function(){return u},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"className",{get:function(){return"accordion-view"},enumerable:!0,configurable:!0}),t}(EasyMoney.ListView);i.AccordionView=f}(ClickView||(ClickView={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();__assign=this&&this.__assign||Object.assign||function(n){for(var r,i,t=1,u=arguments.length;t<u;t++)for(i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n};!function(n){var t,i,r,u,f;t=n.Shared||(n.Shared={});i=t.Views||(t.Views={});r=t.Helpers;u={name:"DownloadToLocalCachePopupView",template:t.Templates.DownloadToLocalCachePopup,ui:{infoBadge:".info-badge-container",saveButton:".btn-viewpart"},events:{"click .close-button":"close","click .cache-download-btn":"onClickDownload"},className:"add-to-cache-popup"};f=function(f){function e(n){return f.call(this,__assign({},n,r.PropertyMixin(u,n)))||this}return __extends(e,f),e.prototype.initialize=function(){if(!(this.options.videoModel instanceof t.Models.MasterVideo))throw new Error(this.name+" must be provided an instance of ClickView.Shared.Models.MasterVideo");this.videoModel=this.options.videoModel;this.spinnerModel=new t.Models.SpinnerModel},e.prototype.onClickDownload=function(n){var r=this,u,i,f;return n.preventDefault(),this.spinnerModel.show(),i=this.videoModel.get("id"),t.Helpers.Guid.isGuid(i)&&!t.Helpers.Guid.isEmptyGuid(i)&&(u=this.videoModel.get("trackingCode")),f={videoId:i,trackingCode:u},t.Utils.AjaxHelper.post("/api/localcache/download",f).done(function(){return r.onSuccess()}).fail(function(){return r.onError()}),!1},e.prototype.onSuccess=function(){this.close();this.logAnalytics({success:!0});n.Utils.Dialog({title:"Success!",content:"<p>This video will be added to your Local Cache.<\/p>",buttons:[{text:"Close",success:!0,className:"btn primary"}]})},e.prototype.onError=function(){this.close();this.logAnalytics({success:!1});n.Utils.Dialog({title:"An error occured",content:"<p>This video could not be added to your Local Cache. Please try again.<\/p>",buttons:[{text:"Close",success:!0,className:"btn primary"}]})},e.prototype.logAnalytics=function(n){void 0===n&&(n={});var i=n.success;t.Utils.AnalyticsService.logLocalCacheDownload(this.videoModel,{origin:!0,success:i})},e.prototype.viewOptions=function(){return{buttonText:this.options.buttonText}},e.prototype.renderInfoBadge=function(){var n=new i.InfoBadgeView({text:"Click here to find out more.",link:"https://www.clickviewsupport.com/hc/en-us/articles/360000164068"});this.renderView(this.ui.infoBadge,n)},e.prototype.renderSaveButton=function(){var n=new t.Views.SpinnerButtonView({model:this.spinnerModel,buttonText:"Add to Local Cache",className:"btn orange cache-download-btn",spinJSOptions:{spinColor:"#ffffff",spinnerSize:"medium"}});this.renderView(this.ui.saveButton,n)},e.prototype.onRender=function(){this.renderInfoBadge();this.renderSaveButton()},e}(EasyMoney.View);i.DownloadToLocalCachePopupView=f}(ClickView||(ClickView={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();!function(n){var t,i,r;t=n.Shared||(n.Shared={});i=t.Views||(t.Views={});r=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return __extends(i,n),Object.defineProperty(i.prototype,"name",{get:function(){return"InfoBadgeView"},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"tagName",{get:function(){return"div"},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"className",{get:function(){return"info-badge"},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"template",{get:function(){return t.Templates.InfoBadge},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"attributes",{get:function(){var n=this;return{"data-toggle":"tooltip","data-placement":"top","data-container":"body",title:function(){return n.options.text}}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"events",{get:function(){return{click:"onClick"}},enumerable:!0,configurable:!0}),i.prototype.onClick=function(){this.options.onClick&&_.isFunction(this.options.onClick)&&this.options.onClick()},i.prototype.onRender=function(){this.$el.tooltip()},i}(EasyMoney.View);i.InfoBadgeView=r}(ClickView||(ClickView={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();__assign=this&&this.__assign||Object.assign||function(n){for(var r,i,t=1,u=arguments.length;t<u;t++)for(i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n};!function(n){var t,i,r,u;t=n.Shared||(n.Shared={});i=t.Views||(t.Views={});r={name:"NotificationBanner",template:t.Templates.NotificationBanner,className:function(){return"notification-banner "+this.options.type+"-message"},defaults:{text:"Notification banner",type:"info",timeout:0},events:{"click .close":"close"}};u=function(n){function i(i){return n.call(this,__assign({},i,t.Helpers.PropertyMixin(r,i)))||this}return __extends(i,n),i.prototype.initialize=function(){this.model&&this.listenTo(this.model,"banner:close",this.close);this.listenTo(this,"banner:close",this.close)},i.prototype.viewOptions=function(){return{text:this.options.text}},i.prototype.onRender=function(){if(this.options.timeout){var n=_.bind(this.close,this);setTimeout(n,this.options.timeout)}},i}(EasyMoney.View);i.NotificationBanner=u}(ClickView||(ClickView={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();__assign=this&&this.__assign||Object.assign||function(n){for(var r,i,t=1,u=arguments.length;t<u;t++)for(i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n};!function(n){var t,f,e,i,r,u,o,s,h,c;t=n.Shared||(n.Shared={});f=t.Views||(t.Views={});e=t.Helpers;i=t.Constants.OnlineYearGroupMetadata;r=t.Constants.OnlineYearGroups.Students;u=t.Constants.OnlineYearGroups.All;o=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return __extends(t,n),Object.defineProperty(t.prototype,"name",{get:function(){return"RestrictAccessYearGroupItemView"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"tagName",{get:function(){return"li"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"className",{get:function(){return this.model&&this.model.get("selected")?"selected":null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"template",{get:function(){return function(n){return n.label}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"attributes",{get:function(){return{style:"width: "+100/this.options.siblings+"%"}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"events",{get:function(){return{click:"onClick"}},enumerable:!0,configurable:!0}),t.prototype.initialize=function(){this.listenTo(this.model,"change:selected",this.resetClass)},t.prototype.resetClass=function(){this.$el.attr("class",this.className)},t.prototype.onClick=function(){this.model.collection.trigger("selected",this.model)},t}(EasyMoney.View);s=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return __extends(t,n),Object.defineProperty(t.prototype,"name",{get:function(){return"RestrictAccessYearGroupListView"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"className",{get:function(){return"list-viewpart"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"childView",{get:function(){return o},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bindings",{get:function(){return{"[name=yearGroups]":{observe:"type",selectOptions:{collection:"this.collection",labelPath:"label",valuePath:"id"}}}},enumerable:!0,configurable:!0}),t.prototype.buildChildView=function(n){var t=_.extend({group:this.model.get("groupId")},_.omit(this.options,["collection","model","id"]),{model:n});return t.siblings=this.collection.length,new this.childView(t)},t.prototype.onRender=function(){this.stickit()},t}(EasyMoney.ListView);h={name:"RestrictedAccessPopupView",template:t.Templates.RestrictedAccessPopup,className:"restrict-access-popup",ui:{yearGroups:".year-group-viewpart",infoBadge:".info-badge-container",createRestrictionBtn:".create-restriction"},events:{"click .close-button":"close","click .create-restriction":"onClickCreateRestriction","click .unrestrict":"onClickUnRestrict"},bindings:{"[name=restrict-from]":{observe:"type",selectOptions:{collection:"this.collection",labelPath:"label",valuePath:"id"}}}};c=function(o){function c(n){return o.call(this,__assign({},n,e.PropertyMixin(h,n)))||this}return __extends(c,o),c.prototype.initialize=function(){if(!(this.options.videoModel instanceof t.Models.MasterVideo))throw new Error(this.name+" must be provided an instance of ClickView.Shared.Models.MasterVideo");this.spinnerModel=new t.Models.SpinnerModel;this.videoModel=this.options.videoModel;var f=this.videoModel.getRestriction();f||(this.isNewRestriction=!0);this.model=f||new t.Models.Restriction({groupId:r});this.setRestrictedObjectType();this.model.set("objectId",this.videoModel.get("id"));this.optionsModel=this.model.get("groupId")===r||this.model.get("groupId")===u?new EasyMoney.Model({type:this.model.get("groupId")}):new EasyMoney.Model({type:-1});this.listenTo(this.optionsModel,"change:type",this.handleOptionSelect);this.collection=new EasyMoney.Collection([{id:r,label:i[r].label},{id:u,label:i[u].label}]);n.currentUser.schoolHasYearGroups()&&(this.collection.add({id:-1,label:"Certain year groups"},{at:1}),this.yearGroupCollection=new EasyMoney.Collection(this.getYearGroups()),-1===this.optionsModel.get("type")&&this.setInitialYearGroup(),this.listenTo(this.yearGroupCollection,"selected",this.onYearGroupSelected))},c.prototype.setRestrictedObjectType=function(){this.model.get("type")===t.Constants.RestrictedObjectType.TermUpdate&&this.model.set("groupId",r)},c.prototype.getYearGroups=function(){var t=[];return _.each(_.keys(i),function(r){-1!==i[r].countries.indexOf(n.Data.Config.region.code)&&i[r].individualGroup&&t.push({id:r,label:i[r].label})}),t},c.prototype.setInitialYearGroup=function(){var n=this.model.getMetadata().label,t=this.yearGroupCollection.findWhere({label:n});this.onYearGroupSelected(t)},c.prototype.handleOptionSelect=function(){if(-1!==this.optionsModel.get("type")&&this.model.set("groupId",this.optionsModel.get("type")),-1===this.optionsModel.get("type")){var n=this.yearGroupCollection.where({selected:!0}).pop();n&&this.model.set("groupId",n.get("id"));n||this.model.unset("groupId")}this.render()},c.prototype.onYearGroupSelected=function(n){this.yearGroupCollection.each(function(n){return n.set("selected",!1)});for(var i=this.yearGroupCollection.indexOf(n),t=0;t<=i;t++)this.yearGroupCollection.at(t).set("selected",!0);this.model.set("groupId",n.get("id"));this.render()},c.prototype.getRestrictionDescription=function(){var n=this.model.getMetadata(),t;return n?(t=n.individualGroup?n.name:n.label,this.model.get("groupId")!==this.yearGroupCollection.at(0).get("id")&&n.individualGroup&&(t+=" and below"),n.individualGroup?"Students in <strong>"+t+"<\/strong> will not be able to access this video.":"<strong>"+t+"<\/strong> will not be able to access this video."):"<strong>Select which year groups you want to prevent from accessing this video.<\/strong>"},c.prototype.onClickCreateRestriction=function(){var n=this;null!=this.model.get("groupId")&&(this.spinnerModel.set({showSpinner:!0}),this.model.save(null,{success:function(t){return n.onSuccess(t)},error:this.onError.bind(this)}))},c.prototype.onClickUnRestrict=function(){var t=this;this.close();n.Utils.Dialog({title:"Allow full access to this video?",content:"<p>Are you sure you want all staff and students to have access to this video?<\/p>",buttons:[{text:"Allow Access",className:"btn orange",success:!0},{text:"Cancel",className:"btn grey"}]}).done(function(){t.videoModel.hasRestriction()&&t.videoModel.getRestriction().destroy({success:function(){t.videoModel.set("restrictions",[]);t.videoModel.trigger("itemUnrestricted",t.videoModel)}})})},c.prototype.onSuccess=function(t){this.videoModel.set("restrictions",[t.toJSON()]);this.videoModel.trigger("itemRestricted",this.videoModel);var i="<strong>"+this.videoModel.getRestriction().get("description")+"<\/strong> can't access this video.";this.close();n.Utils.Dialog({title:"Video access has been updated",content:"<p>"+i+'<\/p><p class="school-settings-link">You can manage access to all restricted videos from your school <a href="/settings/access">settings<\/a>.<\/p>',buttons:[{text:"Okay",success:!0,className:"btn primary"}]})},c.prototype.onError=function(){this.close();n.Utils.Dialog({title:"An error occured",content:"<p>The restriction was not added to the video. Please try again.<\/p>",buttons:[{text:"Okay",success:!0,className:"btn primary"}]})},c.prototype.renderInfoBadge=function(){var n=new f.InfoBadgeView({text:"Click here to find out more about Video Access",link:"https://www.clickviewsupport.com/hc/en-us/articles/360000153947"});this.renderView(this.ui.infoBadge,n)},c.prototype.renderConfirmButton=function(){var n=new t.Views.SpinnerButtonView({buttonText:this.options.buttonText,className:"btn create-restriction "+(null!=this.model.get("groupId")?"orange":"disabled"),tooltip:null!=this.model.get("groupId")?"":"Please select a year group to restrict access from",model:this.spinnerModel});this.renderView(this.$(".confirm-button-container"),n)},c.prototype.renderYearGroupsList=function(){var n=new s({model:this.model,collection:this.yearGroupCollection});this.renderView(this.ui.yearGroups,n)},c.prototype.viewOptions=function(){return{restrictionDescription:this.getRestrictionDescription(),restrictionSet:null!=this.model.get("groupId"),isNewRestriction:this.isNewRestriction}},c.prototype.onRender=function(){this.stickit(this.optionsModel);this.renderInfoBadge();this.renderConfirmButton();-1===this.optionsModel.get("type")&&this.renderYearGroupsList();null==this.model.get("groupId")&&this.ui.createRestrictionBtn.tooltip()},c}(EasyMoney.View);f.RestrictAccessPopupView=c}(ClickView||(ClickView={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();__assign=this&&this.__assign||Object.assign||function(n){for(var r,i,t=1,u=arguments.length;t<u;t++)for(i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n};!function(n){var t,i,r,u;t=n.Shared||(n.Shared={});i=t.Views||(t.Views={});r={name:"RestrictedBadgeView",tagName:"div",className:"restricted-badge",template:t.Templates.RestrictedBadge};u=function(i){function u(n){return i.call(this,__assign({},n,t.Helpers.PropertyMixin(r,n)))||this}return __extends(u,i),Object.defineProperty(u.prototype,"attributes",{get:function(){var n=this;return{"data-toggle":"tooltip","data-placement":"top","data-container":"body",title:function(){return n.getRestrictionDescription()}}},enumerable:!0,configurable:!0}),u.prototype.getRestrictionDescription=function(){var t=this.model.getRestriction();return this.model.restrictionHasExpiry()?n.currentUser.isAdmin()?"This video is awaiting your approval":"This video is pending approval by your ClickView Administrator":t.get("displayText")},u.prototype.onRender=function(){this.$el.tooltip()},u}(EasyMoney.View);i.RestrictedBadgeView=u}(ClickView||(ClickView={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();__assign=this&&this.__assign||Object.assign||function(n){for(var r,i,t=1,u=arguments.length;t<u;t++)for(i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n};!function(n){var t,i,r,u;t=n.Shared||(n.Shared={});i=t.Views||(t.Views={});r={name:"RestrictedThumbnailView",className:"restricted-thumbnail",template:t.Templates.RestrictedThumbnail};u=function(n){function i(i){return n.call(this,__assign({},i,t.Helpers.PropertyMixin(r,i)))||this}return __extends(i,n),i.prototype.viewOptions=function(){return{text:this.options.text}},i}(EasyMoney.View);i.RestrictedThumbnailView=u}(ClickView||(ClickView={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();__assign=this&&this.__assign||Object.assign||function(n){for(var r,i,t=1,u=arguments.length;t<u;t++)for(i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n};!function(n){var t,i,r,u;t=n.Shared||(n.Shared={});i=t.Views||(t.Views={});r={name:"RestrictionInfoView",template:t.Templates.RestrictionInfo,ui:{timestamp:"time.timeago"}};u=function(i){function u(n){return i.call(this,__assign({},n,t.Helpers.PropertyMixin(r,n)))||this}return __extends(u,i),Object.defineProperty(u.prototype,"className",{get:function(){var n="restriction-info";return this.options.showBanner?n+" restriction-banner":n},enumerable:!0,configurable:!0}),u.prototype.getRestrictionInfo=function(){return this.model.isRestricted()?{restrictionDescription:this.model.restrictionHasExpiry()?"This video is pending approval by your ClickView Administrator":"Access to this video has been restricted by "+this.model.getRestrictedBy()}:n.currentUser.isAdmin()&&!this.model.restrictionHasExpiry()&&this.options.showRestrictionToAdmin?{restrictionDescription:this.model.getRestriction().get("displayText")}:this.model.restrictionHasExpiry()&&n.currentUser.isAdmin()?this.getExpiryInfo():void 0},u.prototype.getExpiryInfo=function(){var n=moment(this.model.getRestriction().get("expiresOn")),t=n.toDate().toISOString(),i=n.isBefore(moment().add(7,"days")),r=this.getLibraries();return{expiresOn:n.format("dddd, MMMM Do YYYY, h:mm:ss a"),expiryTime:t,urgent:i,library:r}},u.prototype.getLibraries=function(){var n=[],t=this.model.get("libraries");if(t&&t.length)return t.each(function(t){n.push(t.get("name"))}),n.length>1?n.slice(0,-1).join(", ")+" and "+n.slice(-1):n[0]},u.prototype.viewOptions=function(){return this.getRestrictionInfo()},u.prototype.onBeforeRender=function(){return!_.isEmpty(this.getRestrictionInfo())},u.prototype.onRender=function(){(this.model.restrictionHasExpiry()||n.currentUser.isAdmin())&&this.ui.timestamp.timeago()},u}(EasyMoney.View);i.RestrictionInfoView=u}(ClickView||(ClickView={}))