@clickview/library-editor 1.1.49-rc.1 → 1.1.50-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundles.json +2 -2
- package/dist/en.json +1 -1
- package/dist/scripts/{0-39b4264c40.chunk.js → 0-5f0c2cd8fe.chunk.js} +1 -1
- package/dist/scripts/{1-c2f2ee50e1.chunk.js → 1-7a35a849f0.chunk.js} +1 -1
- package/dist/scripts/{10-74b6a07baa.chunk.js → 10-45d2a5ef25.chunk.js} +1 -1
- package/dist/scripts/{11-f9ca151e61.chunk.js → 11-74bc3f2d9f.chunk.js} +1 -1
- package/dist/scripts/{12-a961dabbb5.chunk.js → 12-f0c771aad1.chunk.js} +1 -1
- package/dist/scripts/{13-31b759d4dc.chunk.js → 13-d70fedb2e0.chunk.js} +1 -1
- package/dist/scripts/{14-28ab8d5025.chunk.js → 14-fafea6f32c.chunk.js} +1 -1
- package/dist/scripts/{15-e326770074.chunk.js → 15-7aa65c016d.chunk.js} +1 -1
- package/dist/scripts/{16-33bc415c72.chunk.js → 16-56c022c016.chunk.js} +1 -1
- package/dist/scripts/{17-4d85362caa.chunk.js → 17-14a7b2aed1.chunk.js} +1 -1
- package/dist/scripts/{2-6334a56d75.chunk.js → 2-0c5fba8b60.chunk.js} +1 -1
- package/dist/scripts/{20-be33eea416.chunk.js → 20-48346c1412.chunk.js} +1 -1
- package/dist/scripts/{21-d07eac93af.chunk.js → 21-f9ff3e0692.chunk.js} +1 -1
- package/dist/scripts/{22-f61848d852.chunk.js → 22-82ad962fa7.chunk.js} +1 -1
- package/dist/scripts/{23-883535facb.chunk.js → 23-d534e3d903.chunk.js} +1 -1
- package/dist/scripts/{24-28d1ee1ddb.chunk.js → 24-264b454456.chunk.js} +1 -1
- package/dist/scripts/{25-36f6c0f04c.chunk.js → 25-e1743bb45d.chunk.js} +1 -1
- package/dist/scripts/{26-41d73fb1cc.chunk.js → 26-0d7e56893b.chunk.js} +1 -1
- package/dist/scripts/{27-9faadbc5ad.chunk.js → 27-4ddeaff155.chunk.js} +1 -1
- package/dist/scripts/{28-1abda5ddcd.chunk.js → 28-96aef6893a.chunk.js} +1 -1
- package/dist/scripts/{29-e1b5688929.chunk.js → 29-554f426b85.chunk.js} +1 -1
- package/dist/scripts/{3-c468e5f805.chunk.js → 3-75a0223960.chunk.js} +1 -1
- package/dist/scripts/{30-4331611384.chunk.js → 30-9bdc787ec5.chunk.js} +1 -1
- package/dist/scripts/{31-f594f549df.chunk.js → 31-67f46f7d90.chunk.js} +1 -1
- package/dist/scripts/{32-b5a8e7c2a3.chunk.js → 32-afdbc7da12.chunk.js} +1 -1
- package/dist/scripts/{33-b88d856ab0.chunk.js → 33-6c83870de4.chunk.js} +1 -1
- package/dist/scripts/{34-7fcaaeddea.chunk.js → 34-486d783b77.chunk.js} +1 -1
- package/dist/scripts/{35-e210da4f12.chunk.js → 35-44dfa1d229.chunk.js} +1 -1
- package/dist/scripts/{36-524bf056e4.chunk.js → 36-6e22a76e9d.chunk.js} +1 -1
- package/dist/scripts/{37-0336031536.chunk.js → 37-247574943e.chunk.js} +1 -1
- package/dist/scripts/{38-1aa8ca825c.chunk.js → 38-c053771304.chunk.js} +1 -1
- package/dist/scripts/{39-faf8a59822.chunk.js → 39-0034f40388.chunk.js} +1 -1
- package/dist/scripts/{4-4c62127fb2.chunk.js → 4-bbf9a27d2b.chunk.js} +1 -1
- package/dist/scripts/{40-9b473a87c2.chunk.js → 40-4c9075f25f.chunk.js} +1 -1
- package/dist/scripts/{41-20fe91435b.chunk.js → 41-9ef30d9bce.chunk.js} +1 -1
- package/dist/scripts/{42-143ac3914b.chunk.js → 42-d5ebd7e173.chunk.js} +1 -1
- package/dist/scripts/{43-ce726c3839.chunk.js → 43-18cb4a605c.chunk.js} +1 -1
- package/dist/scripts/{44-fc7c025c5f.chunk.js → 44-c501392a17.chunk.js} +1 -1
- package/dist/scripts/{45-1e84cd6639.chunk.js → 45-6f27b84b9a.chunk.js} +1 -1
- package/dist/scripts/{46-26b40a870e.chunk.js → 46-26943c79e1.chunk.js} +1 -1
- package/dist/scripts/{47-f03e03252c.chunk.js → 47-58f15ff5f7.chunk.js} +1 -1
- package/dist/scripts/{48-c9a61fd1e3.chunk.js → 48-59c60086c6.chunk.js} +1 -1
- package/dist/scripts/{49-2879e96eed.chunk.js → 49-c7095beb6f.chunk.js} +1 -1
- package/dist/scripts/{5-96980a85ac.chunk.js → 5-a06b2153c3.chunk.js} +1 -1
- package/dist/scripts/{50-b76b6c7d52.chunk.js → 50-015c9c420c.chunk.js} +1 -1
- package/dist/scripts/{51-c252822f95.chunk.js → 51-0cca989dae.chunk.js} +1 -1
- package/dist/scripts/{52-ecde4fecf3.chunk.js → 52-3cc8a4a0c6.chunk.js} +1 -1
- package/dist/scripts/{53-3ab3b83088.chunk.js → 53-b0a20bc5a0.chunk.js} +1 -1
- package/dist/scripts/{54-0e921db390.chunk.js → 54-79dca3d489.chunk.js} +1 -1
- package/dist/scripts/{55-bd9dc838cd.chunk.js → 55-8c5eba8730.chunk.js} +1 -1
- package/dist/scripts/{56-6528a68474.chunk.js → 56-4d5b5fecd6.chunk.js} +1 -1
- package/dist/scripts/{57-3477d4f9b5.chunk.js → 57-84eff54b39.chunk.js} +1 -1
- package/dist/scripts/{58-2c62df5dbd.chunk.js → 58-c0d48a915f.chunk.js} +1 -1
- package/dist/scripts/{59-13ade58ba1.chunk.js → 59-53d002a1db.chunk.js} +1 -1
- package/dist/scripts/{6-1fdfa2191a.chunk.js → 6-6c8dac1a42.chunk.js} +1 -1
- package/dist/scripts/{60-f36c57ef33.chunk.js → 60-9ba5670a0b.chunk.js} +1 -1
- package/dist/scripts/{61-24acf3201f.chunk.js → 61-7189b10e86.chunk.js} +1 -1
- package/dist/scripts/{62-d869eccf9a.chunk.js → 62-6c382c4af3.chunk.js} +1 -1
- package/dist/scripts/{63-d35e9ced47.chunk.js → 63-d55def5355.chunk.js} +1 -1
- package/dist/scripts/{64-dfc3cd19ee.chunk.js → 64-4925cb46d4.chunk.js} +1 -1
- package/dist/scripts/{65-b66a158393.chunk.js → 65-28d1f3d305.chunk.js} +1 -1
- package/dist/scripts/{66-89b577d70f.chunk.js → 66-dd4f73d58f.chunk.js} +1 -1
- package/dist/scripts/{67-83b2b3ad1a.chunk.js → 67-25c6582829.chunk.js} +1 -1
- package/dist/scripts/{68-452e0327d9.chunk.js → 68-4962d3fcfc.chunk.js} +1 -1
- package/dist/scripts/{69-0491a8faf5.chunk.js → 69-2067a2189e.chunk.js} +1 -1
- package/dist/scripts/{7-13b4886b73.chunk.js → 7-881a9b64de.chunk.js} +1 -1
- package/dist/scripts/{70-62aff2ab4e.chunk.js → 70-d2472d2122.chunk.js} +1 -1
- package/dist/scripts/{71-91b4d4dfcb.chunk.js → 71-3f1e0d4f31.chunk.js} +1 -1
- package/dist/scripts/{72-4d851db609.chunk.js → 72-d5c52637ca.chunk.js} +1 -1
- package/dist/scripts/{8-55ea9736c8.chunk.js → 8-ef172e304b.chunk.js} +1 -1
- package/dist/scripts/{9-175ec73a5d.chunk.js → 9-d5b2cc8210.chunk.js} +1 -1
- package/dist/scripts/bundle-d3ae57b538.min.js +10 -0
- package/dist/scripts/polyfills-35ff77d456.min.js +1 -0
- package/package.json +3 -3
- package/dist/scripts/bundle-48597dce2c.min.js +0 -10
- package/dist/scripts/polyfills-e2b8375767.min.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(window.webpackJsonp_clickview_library_editor=window.webpackJsonp_clickview_library_editor||[]).push([[23],{1033:function(e,t,n){"use strict";var o=n(1038),r=n(1034),i=(n(1035),n(3),n(1039)),a=(n(1041),n(1037));n.d(t,"a",(function(){return o.a})),n.d(t,"d",(function(){return r.g})),n.d(t,"g",(function(){return r.j})),n.d(t,"f",(function(){return r.i})),n.d(t,"c",(function(){return r.f})),n.d(t,"e",(function(){return r.h})),n.d(t,"b",(function(){return i.a})),n.d(t,"h",(function(){return a.a}))},1034:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"k",(function(){return h})),n.d(t,"g",(function(){return m})),n.d(t,"e",(function(){return y})),n.d(t,"j",(function(){return g})),n.d(t,"i",(function(){return v})),n.d(t,"c",(function(){return w})),n.d(t,"b",(function(){return C})),n.d(t,"d",(function(){return S})),n.d(t,"f",(function(){return k})),n.d(t,"h",(function(){return b}));var o=n(2),r=n(1),i=n(18),a=n(29),s=n(3),l="libraryEditor.utils",u=["tags","thumbnail","chapters","resources","subtitles","disabled","links","restrictions","categories"];function c(e,t){if(e){var n=r.reduce(e,(function(e,n,o){var i=t[o];return n||i?r.isObject(n)&&r.isObject(i)&&!r.isUndefined(n.id)&&n.id===i.id?e:r.isArray(n)?f(n,i).length?e.concat(o):e:r.isEqual(n,i)?e:e.concat(o):e}),[]);if(n.length)return r.object(r.map(n,(function(n){return r.isArray(t[n])?[n,f(e[n],t[n])]:[n,t[n]]})))}}function f(e,t){var n=[];return r.each(t,(function(t){var o=r.findWhere(e,{id:t.id});if(!r.isUndefined(o)||0!==Object.keys(t).length){var i=r.isUndefined(o)?t:c(o,t);i&&(t.id<0&&!t.value||(!o||t.id<0?n.push(t):(i.id=t.id,n.push(i))))}})),n}var p={getChanges:function(e,t){var n=c(r.omit(e.toJSON(),u),r.omit(t.toJSON(),u));if(n)return r.object(r.map(r.keys(n),(function(e){return[e,p.formatChanges(e,n[e])]})))},formatChanges:function(e,t){if(!t)return null;if(r.isObject(t)&&r.isEmpty(t))return null;switch(e){case"name":case"description":case"productionYear":case"dateBroadcast":case"fields":case"episodeNumber":return t;case"channel":case"series":case"rating":case"season":return{id:t.id};case"distributors":case"producers":case"directors":case"productionCompanies":return r.map(t,(function(e){return e.id}));case"dateModified":case"hasBroadcast":return;default:o.a.ErrorHelper.throw(new i.a("There are no formatting settings for ".concat(e)))}},updateModelState:function(e,t,n){var i=["distributors","producers","directors","productionCompanies"];for(var a in r.each(r.keys(n),(function(e){i.includes(e)&&(n[e]=t.get(e).toJSON())})),t.set(r.clone(n),{silent:!0}),e.set(t.toJSON(),{silent:!0}),n){if(!n[a]&&e.associations[a]){var s=e.get(a);(s instanceof o.a.Model||s instanceof o.a.NestedModel)&&s.clear()}}},getRemovedObjectIds:function(e,t){var n=["distributors","productionCompanies","producers","directors"],o={};return r.each(r.keys(e.toJSON()),(function(i){if(r.contains(n,i)){var a=e.get(i).map((function(e){return e.id})),s=t.get(i).map((function(e){return e.id})),l=r.filter(a,(function(e){return e&&!r.contains(s,e)}));l.length&&(o[i]=l)}})),o}},h={name:[{required:!0,msg:function(){return s.a.getPhrase(l,"videoTitleRequired")}},{maxLength:255,msg:function(){return s.a.getPhrase(l,"videoTitleExceeds")}}],description:[{required:!1},{maxLength:16e3,msg:function(){return s.a.getPhrase(l,"videoDescriptionExceeds")}}],episodeNumber:function(e,t,n){return e&&e<1?s.a.getPhrase(l,"episodeNumberLessThanOne"):e&&e>2147483647?s.a.getPhrase(l,"episodeNumberExceeds"):e%1!=0?s.a.getPhrase(l,"episodeNumberNotWhole"):n.season&&n.season.get("number")>=0&&null===e?s.a.getPhrase(l,"episodeNumberNoSeason"):""},season:function(e,t,n){return n.season&&n.season.get("number")||e&&e.number||!n.episodeNumber?"":s.a.getPhrase(l,"seasonNoEpisodeNumber")}},d=a().year(),y={productionYear:function(e){return e||0===e?(e=+e,isNaN(e)?"Production year must be a number.":e<1900||e>d?s.a.getPhrase(l,"validProductionYears",{currentYear:d}):void 0):""}},m={name:[{required:!0,msg:function(){return s.a.getPhrase(l,"resourceNameRequired")}}]},g={suggestion:[{required:!0,msg:function(){return s.a.getPhrase(l,"suggestEditRequired")}},{maxLength:16e3,msg:function(){return s.a.getPhrase(l,"suggestEditExceeds")}}],reason:[{required:!0,msg:function(){return s.a.getPhrase(l,"suggestEditReasonRequired")}},{maxLength:16e3,msg:function(){return s.a.getPhrase(l,"suggestEditReasonExceeds")}}]},b={number:function(e){return e?+e<1?s.a.getPhrase(l,"seasonLessThanOne"):+e>3e3?s.a.getPhrase(l,"seasonExceeds"):+e%1!=0?s.a.getPhrase(l,"seasonNotWhole"):"":s.a.getPhrase(l,"seasonRequired")}},v={empty:function(){return s.a.getPhrase(l,"suggestEditRatingRequired")},original:function(){return s.a.getPhrase(l,"suggestEditRatingInvalid")}},k={url:[{required:!0,pattern:"url",msg:function(){return s.a.getPhrase(l,"linkUrlRequired")}},{maxLength:16e3,msg:function(){return s.a.getPhrase(l,"linkUrlExceeds")}}],name:[{required:!0,msg:function(){return s.a.getPhrase(l,"linkNameRequired")}},{maxLength:255,msg:function(){return s.a.getPhrase(l,"linkNameExceeds")}}]},w={name:[{maxLength:128,msg:function(){return s.a.getPhrase(l,"fieldNameExceeds")}}],value:[{maxLength:16e3,msg:function(){return s.a.getPhrase(l,"fieldValueExceeds")}}]},C={fields:function(e){return e&&e.length?e.all((function(e){return!1!==e.isValid()}))?"":s.a.getPhrase(l,"fieldsInvalid"):""}};function S(){return[{id:-1,name:"Admin Notes",value:"",placeholder:"Notes that only admins will see"}]}},1035:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var o=n(1),r=n(48),i=n(166),a=n(3),s="libraryEditor.utils",l={name:[{required:!0,msg:function(){return a.a.getPhrase(s,"folderNameRequired")}},{maxLength:255,msg:function(){return a.a.getPhrase(s,"folderNameExceeds")}}]},u=function(e,t){return{parentId:function(n){return n?r.a.calculateDestinationFolderDepth(e,n,t)>i.a.MAX_FOLDER_DEPTH?a.a.getPhrase(s,"maxFolderDepth",{maxDepth:i.a.MAX_FOLDER_DEPTH}):"":a.a.getPhrase(s,"selectParentFolder")}}},c=function(e){var t=e.validateName,n=e.validateParent,r=e.folder,i=e.collection;return t&&n?o.extend({},l,u(r,i)):t?l:n?u(r,i):void 0}},1037:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var o=n(17),r=n(3),i=n(196),a=n(1053),s=n(61);function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var u,c="libraryEditor.utils";!function(e){e.Pdf="pdf",e.Image="image",e.PowerPoint="powerpoint",e.Document="document",e.Excel="excel",e.Zip="archive",e.File="text"}(u||(u={}));var f={mapRatingToClass:function(e){if(!e)return"";return function(e){switch(!0){case e<32:return"bg-purple";case e<48:return"bg-green";case e<80:return"bg-info";case e<96:return"bg-red";case e<128:return"bg-pink";case e>=128:return"bg-yellow";default:return""}}(e)},mapSourceToDisplayName:function(e){switch(e.get("type")){case s.a.HostedLibrary:case s.a.CustomLibrary:return e.get("name");case s.a.Exchange:return r.a.getPhrase(c,"exchange");case s.a.Workspace:return r.a.getPhrase(c,"workspace");default:return""}},mapSourceToClass:function(e){switch(e){case s.a.HostedLibrary:case s.a.CustomLibrary:return"bg-info";case s.a.Exchange:return"bg-green";case s.a.Workspace:default:return"bg-red"}},isInteractive:function(e){return!(!e||!e.interactives)&&!!e.interactives.length},mapTypeToSvg:function(e){var t,n=(l(t={},u.Pdf,o.b.FilePDF),l(t,u.Image,o.b.FileImg),l(t,u.PowerPoint,o.b.FilePowerpoint),l(t,u.Document,o.b.FileWord),l(t,u.Excel,o.b.FileExcel),l(t,u.Zip,o.b.FileZip),l(t,u.File,o.b.File),t)[e];return n||(n=o.b.Folder),o.a.getSvg(n)},mapTypeToClass:function(e){switch(e){case u.Pdf:return"icon-red";case u.Image:return"icon-purple";case u.Document:return"icon-blue";case u.Excel:return"icon-green";case u.PowerPoint:return"icon-orange";case u.Zip:return"icon-teal";case u.File:return"icon-gray";default:return""}},mapTypeToExtension:function(e){if(!e)return"";return{pdf:"pdf",image:"png",powerpoint:"pptx"}[e.toLowerCase()]},mapTypeToName:function(e){if(!e)return"";switch(e){case u.Pdf:return r.a.getPhrase(c,"pdf");case u.Image:return r.a.getPhrase(c,"image");case u.Document:return r.a.getPhrase(c,"document");case u.Excel:return r.a.getPhrase(c,"spreadsheet");case u.PowerPoint:return r.a.getPhrase(c,"presentation");case u.Zip:return r.a.getPhrase(c,"zipArchive");case u.File:return r.a.getPhrase(c,"file");default:return""}},translateMetadataCollectionNames:function(e){return new a.a(e.map((function(e){return Object.assign(Object.assign({},e.toJSON()),{name:f.translateMetadataName(e.get("name"))})})))},translateMetadataName:function(e){var t="suggestEdit";switch(e){case i.MetadataType.VideoTitle:t+="VideoTitle";break;case i.MetadataType.Description:t+="Description";break;case i.MetadataType.Rating:t+="Rating";break;case i.MetadataType.SeriesTitle:t+="SeriesTitle";break;case i.MetadataType.Season:t+="SeasonNumber";break;case i.MetadataType.EpisodeNumber:t+="EpisodeNumber";break;case i.MetadataType.BroadcastDate:t+="BroadcastDate";break;case i.MetadataType.Channel:t+="Channel";break;case i.MetadataType.ProductionYear:t+="ProductionYear";break;case i.MetadataType.Distributors:t+="Distributors";break;case i.MetadataType.ProductionCompanies:t+="ProductionCompanies";break;case i.MetadataType.Directors:t+="Directors";break;case i.MetadataType.Producers:t+="Producers";break;case i.MetadataType.Other:t+="Other"}return r.a.getPhrase(c,t)}}},1038:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var o=n(1),r=n(13),i=n(3),a="libraryEditor.utils",s={isValidChapterTime:function(e,t,n,i){if(i){if(!o.isNumber(t))return l.StartTime.Invalid();if(t<0)return l.StartTime.Invalid();if(t>r.x.millisecondsToSeconds(n))return l.StartTime.Exceeds();if(i.some((function(n){return!(n.id&&n.id===e.id||n.cid===e.cid)&&n.get("startTime")===t})))return l.StartTime.Exists()}},isValidChapterName:function(e,t,n){return t?t.length>255?l.Name.MaxLength():n.some((function(n){return!(n.id&&n.id===e.id||n.cid===e.cid)&&n.get("name").trim()===t.trim()}))?l.Name.Exists():o.isEmpty(t.trim())?l.Name.Invalid():void 0:l.Name.Invalid()},mapPhysicalChapters:function(e){var t=0;return o.map(e,(function(e,n){var o={name:e.title,startTime:t,index:n,isPhysicalChapter:!0};return t+=e.duration,o}))}},l={Name:{Invalid:function(){return i.a.getPhrase(a,"chapterNameInvalid")},Exists:function(){return i.a.getPhrase(a,"chapterNameExists")},MaxLength:function(){return i.a.getPhrase(a,"chapterNameExceeds")}},StartTime:{Invalid:function(){return i.a.getPhrase(a,"chapterStartTimeInvalid")},Exists:function(){return i.a.getPhrase(a,"chapterStartTimeExists")},Exceeds:function(){return i.a.getPhrase(a,"chapterStartTimeExceeds")}}}},1039:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n(3),r="libraryEditor.utils",i={name:[{required:!0,msg:function(){return o.a.getPhrase(r,"libraryNameRequired")}},{maxLength:255,msg:function(){return o.a.getPhrase(r,"libraryNameExceeds")}}]}},1041:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n(3),r=n(1034),i=o.a.encloseNamespace("libraryEditor.utils"),a={name:[{required:!0,msg:function(){return i("videoTitleRequired")}}],folderId:[{required:!0,msg:function(){return i("uploadFolderRequired")}}],libraryId:[{required:!0,msg:function(){return i("uploadLibraryRequired")}}],episodeNumber:function(e,t,n){return e&&e<1?i("episodeNumberLessThanOne"):e&&e>255?i("episodeNumberExceeds"):e&&e%1!=0?i("episodeNumberNotWhole"):n.season&&n.season.get("number")>=0&&null===e?i("episodeNumberNoSeason"):""},season:function(e,t,n){return n.season&&n.season.get("number")||e&&e.number||!n.episodeNumber?"":i("seasonNoEpisodeNumber")},productionYear:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r.e.productionYear.apply(null,t)}}},1053:function(e,t,n){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=l(e);if(t){var r=l(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return s(this,n)}}function s(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return u}));var u=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(n,e);var t=a(n);function n(){return r(this,n),t.apply(this,arguments)}return n}(n(2).a.Collection)},1084:function(e,t,n){"use strict";n.d(t,"a",(function(){return y}));var o=n(1),r=n(2),i=n(1085),a=n.n(i),s=n(1086),l=n.n(s);function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=d(e);if(t){var r=d(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return h(this,n)}}function h(e,t){return!t||"object"!==u(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}(s,e);var t,n,r,i=p(s);function s(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),i.call(this,e)}return t=s,(n=[{key:"name",get:function(){return"TabsView"}},{key:"className",get:function(){var e="bg-white py-2 border-bottom";return this.options.className&&(e+=" ".concat(this.options.className)),e}},{key:"template",get:function(){return l.a}},{key:"appLinks",get:function(){var e={};return this.options.tabs.forEach((function(t){return e[t.link.selector]=t.link.appLink})),e}},{key:"viewOptions",value:function(){var e=this.options.tabs.map((function(e){return Object.assign(Object.assign({},e),{link:e.link.selector.replace(".","")})}));return{styles:a.a,tabs:e}}},{key:"setActiveTab",value:function(){var e=this,t=!1;if(this.options.tabs.forEach((function(n){n.active=!1,n.link.selector===e.options.activeTab&&(n.active=!0,t=!0)})),!t){var n=o.first(this.options.tabs);n&&(n.active=!0)}}},{key:"onBeforeRender",value:function(){this.setActiveTab()}}])&&c(t.prototype,n),r&&c(t,r),s}(r.a.Component)},1085:function(e,t,n){e.exports={link:"_5idZs",active:"_3Ty4M"}},1086:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r,i,a){var s;e.propertyIsEnumerable;return null!=(s=n.unless.call(null!=t?t:e.nullContext||{},null!=t?t.hide:t,{name:"unless",hash:{},fn:e.program(2,r,0,i,a),inverse:e.noop,data:r}))?s:""},2:function(e,t,n,o,r,i,a){e.propertyIsEnumerable;var s,l=e.lambda,u=e.escapeExpression;return' <a class="'+u(l(null!=(s=null!=(s=null!=a[1]?a[1].options:a[1])?s.styles:s)?s.link:s,t))+" p-2 "+u(l(null!=t?t.link:t,t))+" "+(null!=(s=n.if.call(null!=t?t:e.nullContext||{},null!=t?t.active:t,{name:"if",hash:{},fn:e.program(3,r,0,i,a),inverse:e.noop,data:r}))?s:"")+'">'+u(l(null!=t?t.name:t,t))+"</a>\r\n"},3:function(e,t,n,o,r,i,a){var s;e.propertyIsEnumerable;return e.escapeExpression(e.lambda(null!=(s=null!=(s=null!=a[1]?a[1].options:a[1])?s.styles:s)?s.active:s,t))+" border-bottom border-primary text-primary"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r,i,a){var s;e.propertyIsEnumerable;return null!=(s=n.each.call(null!=t?t:e.nullContext||{},null!=(s=null!=t?t.options:t)?s.tabs:s,{name:"each",hash:{},fn:e.program(1,r,0,i,a),inverse:e.noop,data:r}))?s:""},useData:!0,useDepths:!0})},1094:function(e,t,n){"use strict";n.d(t,"a",(function(){return k}));var o=n(1),r=n(6),i=n(2),a=n(18),s=n(17),l=n(99),u=n(13),c=n(1145),f=n.n(c),p=n(1146),h=n.n(p);function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function y(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=v(e);if(t){var r=v(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return b(this,n)}}function b(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var k=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(d,e);var t,n,c,p=g(d);function d(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d),p.call(this,e)}return t=d,(n=[{key:"name",get:function(){return"SearchTypeaheadComponent"}},{key:"template",get:function(){return f.a}},{key:"className",get:function(){return"search-container ".concat(h.a.typeaheadContainer," mb-2")}},{key:"channelName",get:function(){return u.k.generateUniqueChannelName(this)}},{key:"elements",get:function(){return{input:"#".concat(this.options.inputId)}}},{key:"defaults",get:function(){return{inputId:"search-typeahead",placeholderText:"Search",stickItProperty:"name",selectEvent:"select:result",additionalClasses:"",editable:!0}}},{key:"events",value:function(){return{submit:"onSubmit","click .remove":"onClickRemove"}}},{key:"initialize",value:function(){this.model||this.options.parentChannelName||i.a.ErrorHelper.throw(new a.a("Either pass a model or a channelName to access the typeahead selection")),this.model||(this.model=new i.a.Model),this.options.inputName||(this.options.inputName=this.options.inputId),this.bindListeners()}},{key:"bindListeners",value:function(){this.options.parentChannelName&&(this.parentChannel=r.Radio.channel(this.options.parentChannelName)),this.listenTo(this.channelName,"typeahead:set:input",this.setInput),this.listenTo(this.channelName,"typeahead:clear:input",this.clearInput)}},{key:"bindings",get:function(){var e,t,n,o="[name=".concat(this.options.inputName,"]");return e={},t=o,n={observe:this.options.stickItProperty,setOptions:{validate:!0}},t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},{key:"clearInput",value:function(){this.getUI("input").typeahead("val",null)}},{key:"setInput",value:function(e){this.getUI("input").typeahead("val",e)}},{key:"onTypeaheadSelect",value:function(e,t){var n;e.preventDefault(),n="string"==typeof t?t:t.title||t.name||t.query,this.model.set(this.options.stickItProperty,n),this.parentChannel&&this.options.selectEvent&&this.parentChannel.trigger(this.options.selectEvent,t),this.onSubmit(e),this.toggleRemove()}},{key:"onSubmit",value:function(e){var t=this;if(e.preventDefault(),!this.isDestroyed()&&this.getTypeaheadActionOptions().clearOnSelect)return this.getUI("input").typeahead("close"),setTimeout((function(){t.model.clear(),t.clearInput()}),0),!1}},{key:"onClickRemove",value:function(){this.model.clear(),this.parentChannel.trigger(this.options.removeEvent,this.model),this.toggleRemove()}},{key:"getSources",value:function(){return o.isArray(this.options.typeaheadConfigs)?l.a.getSearchSources(this.options.typeaheadConfigs):l.a.getSearchSources([this.options.typeaheadConfigs])}},{key:"getTypeaheadOptions",value:function(){var e={minLength:1,highlight:!0};return this.options.typeaheadOptions?o.extend({},e,this.options.typeaheadOptions):e}},{key:"getTypeaheadActionOptions",value:function(){var e={clearOnSelect:!1};return o.isObject(this.options.actionOptions)?o.extend({},e,this.options.actionOptions):e}},{key:"bindOptionalCallbacks",value:function(){o.isObject(this.options.callbacks)&&(o.isFunction(this.options.callbacks.onRender)&&this.getUI("input").on("typeahead:render",o.bind(this.options.callbacks.onRender,this)),o.isFunction(this.options.callbacks.onInput)&&this.listenTo(this.model,"change:".concat(this.options.stickItProperty),this.options.callbacks.onInput),o.isFunction(this.options.callbacks.onBlur)&&this.getUI("input").on("blur",o.bind(this.options.callbacks.onBlur,this,this.channelName,this.options.stickItProperty)))}},{key:"initTypeahead",value:function(){this.getUI("input").typeahead(this.getTypeaheadOptions(),this.getSources())}},{key:"initTypeaheadListeners",value:function(){this.getUI("input").on("typeahead:select",o.bind(this.onTypeaheadSelect,this)),this.bindOptionalCallbacks()}},{key:"toggleRemove",value:function(){this.shouldShowRemove()?this.$el.find(".remove").show():this.$el.find(".remove").hide()}},{key:"shouldShowRemove",value:function(){return!!this.options.editable&&(!!this.options.forceShowRemoveButton||this.options.removeEvent&&!!this.model.get(this.options.stickItProperty))}},{key:"viewOptions",value:function(){return Object.assign(Object.assign({styles:h.a},this.options),{showRemove:this.shouldShowRemove(),svgRemove:s.a.getSvg(s.b.Close)})}},{key:"onRender",value:function(){var e=this;this.stickit(),this.initTypeahead(),this.initTypeaheadListeners(),r.Validation.bind(this),this.toggleRemove(),this.options.autofocus&&window.requestAnimationFrame((function(){e.getUI("input").focus()}))}},{key:"onClose",value:function(){this.getUI("input").off(),this.unstickit(),r.Validation.unbind(this)}}])&&y(t.prototype,n),c&&y(t,c),d}(i.a.Component)},1106:function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var o=n(6),r=n(2),i=n(17),a=n(1107),s=n.n(a),l=n(1108),u=n.n(l),c=n(0),f=n(1084);function p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function h(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=g(e);if(t){var r=g(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return m(this,n)}}function m(e,t){return!t||"object"!==p(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var b=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(l,e);var t,n,r,a=y(l);function l(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),a.call(this,e)}return t=l,(n=[{key:"name",get:function(){return"EditVideoTabsComponent"}},{key:"className",get:function(){return"bg-white"}},{key:"regions",value:function(){return{tabs:{el:".tabs-region",replaceElement:!0}}}},{key:"template",get:function(){return u.a}},{key:"appLinks",get:function(){var e,t,n,o=this.options.goBackTab.link;return e={},t=o.selector,n=o.appLink,t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},{key:"viewOptions",value:function(){var e=Object.assign(Object.assign({},this.options.goBackTab),{link:this.options.goBackTab.link.selector.replace(".","")});return{styles:s.a,backTab:e,backArrow:i.a.getSvg(i.b.ArrowLeft)}}},{key:"onSave",value:function(){o.Radio.channel(c.b.LIBRARY_EDITOR).trigger(c.a.LibraryEditor.SAVE_VIDEO)}},{key:"onRender",value:function(){this.showChildView("tabs",new f.a({tabs:this.options.tabs,activeTab:this.options.activeTab}))}}])&&h(t.prototype,n),r&&h(t,r),l}(r.a.Component)},1107:function(e,t,n){e.exports={svgContainer:"_27gR6"}},1108:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=e.lambda,s=e.escapeExpression;return'<div class="row">\r\n <h4>\r\n <a class="d-inline-flex align-items-center '+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.link:i,t))+" "+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.backTab:i)?i.link:i,t))+'">\r\n <span class="'+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+' d-inline-block mx-2">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.backArrow:i,t))?i:"")+"</span>\r\n "+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.backTab:i)?i.name:i,t))+'\r\n </a>\r\n </h4>\r\n</div>\r\n<div class="tabs-region pl-2"></div>'},useData:!0})},1120:function(e,t,n){"use strict";var o=n(2),r=n(6),i=n(1132),a=n.n(i),s=n(111),l=n(4),u=n(42),c=n(17),f=n(1121),p=n(1133),h=n.n(p),d=n(1134),y=n.n(d);function m(e){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function g(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=w(e);if(t){var r=w(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return k(this,n)}}function k(e,t){return!t||"object"!==m(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function w(e){return(w=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var C=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&b(e,t)}(i,e);var t,n,o,r=v(i);function i(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),r.call(this,e)}return t=i,(n=[{key:"name",get:function(){return"ResourceItemComponent"}},{key:"template",get:function(){return h.a}},{key:"className",get:function(){return"".concat(y.a.container," rounded p-2 mb-2")}},{key:"events",value:function(){return{"click .delete":"onClickDelete","click .edit":"onClickEdit"}}},{key:"appLinks",get:function(){return{".edit":this.options.getEditAppLink(this.model.get("id"))}}},{key:"onClickEdit",value:function(){var e=u.a.mergeOptions(this.options.analyticsOptions,{actionType:l.UserAction.Edit,entity:l.EntityType.Resource,workflowPhase:l.WorkflowPhase.Start}),t={id:this.model.get("id"),parentId:+this.options.videoId};u.a.logUserAction(t,e)}},{key:"onClickDelete",value:function(){s.a.isFunction(this.options.onClickDelete)&&this.options.onClickDelete(this.model)}},{key:"viewOptions",value:function(){var e=this.model.get("metadata"),t=e?e.type:"";return{editable:this.options.editable,extension:f.a.mapTypeToExtension(t),svg:c.a.getSvg(f.a.mapTypeToSvg(t)),iconClass:f.a.mapTypeToClass(t),resourceType:f.a.mapTypeToName(t),editSvg:c.a.getSvg(c.b.Edit),trashSvg:c.a.getSvg(c.b.Delete)}}}])&&g(t.prototype,n),o&&g(t,o),i}(o.a.Component),S=n(3),O=n(120),E=n(151),P=n(203);function x(e){return(x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function R(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function T(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function N(e,t,n){return t&&T(e.prototype,t),n&&T(e,n),e}function _(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&I(e,t)}function I(e,t){return(I=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=D(e);if(t){var r=D(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return L(this,n)}}function L(e,t){return!t||"object"!==x(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function D(e){return(D=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"b",(function(){return V})),n.d(t,"a",(function(){return U}));var V=function(e){_(n,e);var t=j(n);function n(e){return R(this,n),t.call(this,e)}return N(n,[{key:"name",get:function(){return"VideoResourcesComponentCollection"}},{key:"className",get:function(){return"mt-3"}},{key:"lang",get:function(){return"libraryEditor.videoResources"}},{key:"childView",get:function(){return C}},{key:"childViewOptions",get:function(){var e=this;return{editable:this.options.editable,videoId:this.options.videoId,analyticsOptions:this.options.analyticsOptions,onClickDelete:function(t){return e.onClickDelete(t)},getEditAppLink:function(t){return{application:O.a.LIBRARY_EDITOR,action:E.a.LibraryEditor.EDIT_RESOURCE,args:[e.options.videoId,t]}}}}},{key:"onClickDelete",value:function(e){var t=this;new P.a({title:S.a.getPhrase(this.lang,"removeHeading"),text:S.a.getPhrase(this.lang,"removeBody",{resourceName:e.get("name")}),buttons:[{text:S.a.getPhrase(this.lang,"remove"),className:"btn btn-danger",success:!0},{text:S.a.getPhrase(this.lang,"cancel"),className:"btn btn-secondary",close:!0}],channelName:"".concat(this.name).concat(this.cid)}).render().done((function(){r.Radio.channel(t.options.channelName).trigger("delete:resource",e.get("id"))}))}}]),n}(o.a.ComponentCollection),U=function(e){_(n,e);var t=j(n);function n(e){return R(this,n),t.call(this,e)}return N(n,[{key:"name",get:function(){return"VideoResourcesComponent"}},{key:"template",get:function(){return a.a}},{key:"lang",get:function(){return"libraryEditor.videoResources"}},{key:"channelName",get:function(){return"".concat(this.name).concat(this.cid)}},{key:"className",get:function(){return this.options.customCollection?"":"py-3 border-top"}},{key:"regions",value:function(){return{resources:{replaceElement:!0,el:".resource-list-region"}}}},{key:"renderResources",value:function(){var e=new V({collection:this.options.customCollection||this.model.resources,editable:this.options.editable||!1,videoId:this.options.videoId||this.model.get("id"),channelName:this.options.parentChannelName||this.channelName});this.showChildView("resources",e)}},{key:"viewOptions",value:function(){return{resourcesHeadingText:this.options.headerText||S.a.getPhrase(this.lang,"heading"),emptyStateText:this.options.emptyStateText}}},{key:"onRender",value:function(){this.renderResources()}}]),n}(o.a.Component)},1121:function(e,t,n){"use strict";var o,r=n(3),i=n(17),a=n(61);function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e){e.Pdf="pdf",e.Image="image",e.PowerPoint="powerpoint",e.Document="document",e.Excel="excel",e.Zip="archive",e.File="text"}(o||(o={})),n.d(t,"a",(function(){return u}));var l="shared.shared-utils",u={mapRatingToClass:function(e){if(!e)return"";return function(e){switch(!0){case e<32:return"bg-purple";case e<48:return"bg-green";case e<80:return"bg-info";case e<96:return"bg-red";case e<128:return"bg-pink";case e>=128:return"bg-yellow";default:return""}}(e)},mapSourceToDisplayName:function(e){switch(e.type){case a.a.HostedLibrary:case a.a.CustomLibrary:return e.name;case a.a.Exchange:return r.a.getPhrase(l,"exchange");case a.a.Workspace:return r.a.getPhrase(l,"workspace");default:return""}},mapSourceToClass:function(e){switch(e){case a.a.HostedLibrary:case a.a.CustomLibrary:return"bg-info";case a.a.Exchange:return"bg-green";case a.a.Workspace:default:return"bg-red"}},isInteractive:function(e){var t,n;return!!(null===(n=null===(t=null==e?void 0:e.interactives)||void 0===t?void 0:t.data)||void 0===n?void 0:n.length)},mapTypeToSvg:function(e){var t,n=(s(t={},o.Pdf,i.b.FilePDF),s(t,o.Image,i.b.FileImg),s(t,o.PowerPoint,i.b.FilePowerpoint),s(t,o.Document,i.b.FileWord),s(t,o.Excel,i.b.FileExcel),s(t,o.Zip,i.b.FileZip),s(t,o.File,i.b.File),t)[e];return n||(n=i.b.Folder),n},mapTypeToClass:function(e){switch(e){case o.Pdf:return"icon-red";case o.Image:return"icon-purple";case o.Document:return"icon-blue";case o.Excel:return"icon-green";case o.PowerPoint:return"icon-orange";case o.Zip:return"icon-teal";case o.File:return"icon-gray";default:return""}},mapTypeToExtension:function(e){if(!e)return"";return{pdf:"pdf",image:"png",powerpoint:"pptx"}[e.toLowerCase()]},mapTypeToName:function(e){if(!e)return"";switch(e){case o.Pdf:return r.a.getPhrase(l,"pdf");case o.Image:return r.a.getPhrase(l,"image");case o.Document:return r.a.getPhrase(l,"document");case o.Excel:return r.a.getPhrase(l,"spreadsheet");case o.PowerPoint:return r.a.getPhrase(l,"presentation");case o.Zip:return r.a.getPhrase(l,"zipArchive");case o.File:return r.a.getPhrase(l,"file");default:return""}}}},1132:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r){var i;e.propertyIsEnumerable;return"<p>"+e.escapeExpression(e.lambda(null!=(i=null!=t?t.options:t)?i.emptyStateText:i,t))+"</p>"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){var i;e.propertyIsEnumerable;return"<h5>"+e.escapeExpression(e.lambda(null!=(i=null!=t?t.options:t)?i.resourcesHeadingText:i,t))+"</h5>\r\n"+(null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.emptyStateText:i,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r}))?i:"")+'\r\n<div class="resource-list-region"></div>'},useData:!0})},1133:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=e.lambda;return'<a class="float-right svg-container cursor-pointer text-muted delete">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.trashSvg:i,t))?i:"")+'</a>\r\n<a class="float-right svg-container cursor-pointer text-muted edit">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.editSvg:i,t))?i:"")+"</a>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a,s=e.lambda,l=e.escapeExpression,u=null!=t?t:e.nullContext||{},c=e.hooks.helperMissing;return'<span title="'+l(s(null!=(i=null!=t?t.options:t)?i.resourceType:i,t))+'" class="d-inline-block align-middle mr-2 svg-container '+l(s(null!=(i=null!=t?t.options:t)?i.iconClass:i,t))+'">'+(null!=(i=s(null!=(i=null!=t?t.options:t)?i.svg:i,t))?i:"")+'</span>\r\n<a href="'+l("function"==typeof(a=null!=(a=n.url||(null!=t?t.url:t))?a:c)?a.call(u,{name:"url",hash:{},data:r}):a)+"?name="+l("function"==typeof(a=null!=(a=n.name||(null!=t?t.name:t))?a:c)?a.call(u,{name:"name",hash:{},data:r}):a)+'" class="align-middle">\r\n '+l("function"==typeof(a=null!=(a=n.name||(null!=t?t.name:t))?a:c)?a.call(u,{name:"name",hash:{},data:r}):a)+"\r\n</a>\r\n"+(null!=(i=n.if.call(u,null!=(i=null!=t?t.options:t)?i.editable:i,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r}))?i:"")},useData:!0})},1134:function(e,t,n){e.exports={container:"f6lVD"}},1139:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=e.lambda,s=e.escapeExpression;return'<a class="float-right '+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+" "+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.actionSvg:i,t))+' text-muted delete">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.trashSvg:i,t))?i:"")+'</a>\r\n<a class="float-right '+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+" "+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.actionSvg:i,t))+' text-muted edit">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.editSvg:i,t))?i:"")+"</a>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a,s=e.lambda,l=e.escapeExpression,u=null!=t?t:e.nullContext||{},c=e.hooks.helperMissing;return'<span class="d-inline-block align-middle mr-2 icon-blue '+l(s(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+'">'+(null!=(i=s(null!=(i=null!=t?t.options:t)?i.linkSvg:i,t))?i:"")+'</span>\r\n<a href="'+l("function"==typeof(a=null!=(a=n.url||(null!=t?t.url:t))?a:c)?a.call(u,{name:"url",hash:{},data:r}):a)+'" target="_blank" class="align-middle">\r\n '+l("function"==typeof(a=null!=(a=n.name||(null!=t?t.name:t))?a:c)?a.call(u,{name:"name",hash:{},data:r}):a)+"\r\n</a>\r\n"+(null!=(i=n.if.call(u,null!=(i=null!=t?t.options:t)?i.editable:i,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r}))?i:"")},useData:!0})},1140:function(e,t,n){e.exports={container:"_3Qewt",svgContainer:"_3T40U",actionSvg:"_3FRzz"}},1141:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r){var i;e.propertyIsEnumerable;return"<p>"+e.escapeExpression(e.lambda(null!=(i=null!=t?t.options:t)?i.emptyStateText:i,t))+"</p>"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){var i;e.propertyIsEnumerable;return"<h5>"+e.escapeExpression(e.lambda(null!=(i=null!=t?t.options:t)?i.headingText:i,t))+"</h5>\r\n"+(null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.emptyStateText:i,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r}))?i:"")+'\r\n<div class="links-region"></div>'},useData:!0})},1145:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r){var i;e.propertyIsEnumerable;return e.escapeExpression(e.lambda(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.disabled:i,t))},3:function(e,t,n,o,r){return"autofocus"},5:function(e,t,n,o,r){return"disabled"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=e.lambda,s=e.escapeExpression,l=null!=t?t:e.nullContext||{};return'<input\r\n name="'+s(a(null!=(i=null!=t?t.options:t)?i.inputName:i,t))+'"\r\n type="text"\r\n class="form-control '+(null!=(i=n.unless.call(l,null!=(i=null!=t?t.options:t)?i.editable:i,{name:"unless",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r}))?i:"")+" "+s(a(null!=(i=null!=t?t.options:t)?i.additionalClasses:i,t))+'"\r\n id="'+s(a(null!=(i=null!=t?t.options:t)?i.inputId:i,t))+'"\r\n autocomplete="off"\r\n placeholder="'+s(a(null!=(i=null!=t?t.options:t)?i.placeholderText:i,t))+'"\r\n '+(null!=(i=n.if.call(l,null!=(i=null!=t?t.options:t)?i.autofocus:i,{name:"if",hash:{},fn:e.program(3,r,0),inverse:e.noop,data:r}))?i:"")+"\r\n "+(null!=(i=n.unless.call(l,null!=(i=null!=t?t.options:t)?i.editable:i,{name:"unless",hash:{},fn:e.program(5,r,0),inverse:e.noop,data:r}))?i:"")+'\r\n></input>\r\n<span class="svg-container mb-2 '+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svg:i,t))+' remove" style="display: none;">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.svgRemove:i,t))?i:"")+"</span>"},useData:!0})},1146:function(e,t,n){e.exports={svg:"_1iL3O",typeaheadContainer:"_1SWXc",disabled:"_3C2O8"}},1147:function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var o=n(2),r=n(263),i=n(13),a=n(3),s=n(303),l=n(196),u=n(1148),c=n.n(u),f=n(1149),p=n.n(f);function h(e){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function y(e,t){return(y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=b(e);if(t){var r=b(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return g(this,n)}}function g(e,t){return!t||"object"!==h(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var v=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&y(e,t)}(h,e);var t,n,u,f=m(h);function h(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,h),f.call(this,e)}return t=h,(n=[{key:"initialize",value:function(){this.spinnerModel=new o.a.Model({showSpinner:this.isProcessing()}),this.listenTo(this.options.channelName,l.LibraryEditorActions.MergeChapters,this.onClickMergeChapters)}},{key:"name",get:function(){return"ConcatenateRequestComponent"}},{key:"template",get:function(){return c.a}},{key:"lang",get:function(){return"libraryEditor.concatenateRequest"}},{key:"className",get:function(){return"mt-3"}},{key:"regions",value:function(){return{button:{el:".btn-region",replaceElement:!0}}}},{key:"onClickMergeChapters",value:function(){this.spinnerModel.set(r.c.ShowSpinner,!0),this.render()}},{key:"isProcessing",value:function(){return!(!this.model||!this.model.get("status")||this.model.get("status")!==s.a.New&&this.model.get("status")!==s.a.Concatenating)}},{key:"renderButton",value:function(){var e={chapters:a.a.getPhrase(this.lang,"mergeChapters"),subtitles:a.a.getPhrase(this.lang,"mergeChapters"),clickViewSubtitles:a.a.getPhrase(this.lang,"enabledCustomSubtitles")},t=new r.a({buttonText:e[this.options.type],extraButtonClass:"btn-primary ".concat(p.a.btn),model:this.spinnerModel,spinnerOptions:{size:i.s.Small,type:i.t.Light,extraClasses:"mx-auto"},channelName:this.options.channelName,saveEvent:l.LibraryEditorActions.MergeChapters});this.showChildView("button",t)}},{key:"viewOptions",value:function(){var e={chapters:{heading:a.a.getPhrase(this.lang,"chaptersHeading"),line1:a.a.getPhrase(this.lang,"chaptersInfo1"),line2:a.a.getPhrase(this.lang,"chaptersInfo2")},subtitles:{heading:a.a.getPhrase(this.lang,"subtitlesHeading"),line1:a.a.getPhrase(this.lang,"subtitlesInfo1"),line2:a.a.getPhrase(this.lang,"subtitlesInfo2")},clickViewSubtitles:{heading:a.a.getPhrase(this.lang,"cvSubtitlesHeading"),line1:a.a.getPhrase(this.lang,"cvSubtitlesInfo1"),line2:a.a.getPhrase(this.lang,"cvSubtitlesInfo2")}};return{progress:this.model&&this.model.get("progress")&&a.a.getPhrase(this.lang,"progress",{progress:this.model.get("progress")}),componentOptions:e[this.options.type],processing:this.spinnerModel.get(r.c.ShowSpinner),failed:this.model&&this.model.get("status")&&this.model.get("status")===s.a.ConcatenationFailed}}},{key:"onRender",value:function(){this.renderButton()}}])&&d(t.prototype,n),u&&d(t,u),h}(o.a.Component)},1148:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r){var i;e.propertyIsEnumerable;return null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.progress:i,{name:"if",hash:{},fn:e.program(2,r,0),inverse:e.noop,data:r}))?i:""},2:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=e.escapeExpression;return' <span class="m-3 text-muted">'+a(e.lambda(null!=(i=null!=t?t.options:t)?i.progress:i,t))+'</span>\r\n <p class="pt-2">'+a((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"processing",{name:"lang",hash:{},data:r}))+"</p>\r\n"},4:function(e,t,n,o,r){var i;e.propertyIsEnumerable;return null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.failed:i,{name:"if",hash:{},fn:e.program(5,r,0),inverse:e.noop,data:r}))?i:""},5:function(e,t,n,o,r){e.propertyIsEnumerable;return'<p class="pt-2 text-danger">'+e.escapeExpression((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"failed",{name:"lang",hash:{},data:r}))+"</p>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=e.lambda,s=e.escapeExpression;return"<h4>"+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.componentOptions:i)?i.heading:i,t))+"</h4>\r\n<p>"+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.componentOptions:i)?i.line1:i,t))+"</p>\r\n<p>"+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.componentOptions:i)?i.line2:i,t))+'</p>\r\n<div class="btn-region"></div>\r\n'+(null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.processing:i,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.program(4,r,0),data:r}))?i:"")},useData:!0})},1149:function(e,t,n){e.exports={btn:"_59zg9"}},1185:function(e,t,n){"use strict";var o=n(2),r=n(6),i=n(17),a=n(4),s=n(42),l=n(13),u=n(0),c=n(1139),f=n.n(c),p=n(1140),h=n.n(p),d=n(3);function y(e){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function m(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function b(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=k(e);if(t){var r=k(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return v(this,n)}}function v(e,t){return!t||"object"!==y(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function k(e){return(k=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var w=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&g(e,t)}(p,e);var t,n,o,c=b(p);function p(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,p),c.call(this,e)}return t=p,(n=[{key:"name",get:function(){return"LinkItemComponent"}},{key:"template",get:function(){return f.a}},{key:"className",get:function(){return"".concat(h.a.container," rounded p-2 mb-2")}},{key:"lang",get:function(){return"libraryEditor.editLinks"}},{key:"events",value:function(){return{"click .delete":"onClickDelete","click .edit":"onClickEdit"}}},{key:"appLinks",get:function(){return{".edit":{application:u.b.LIBRARY_EDITOR,action:u.a.LibraryEditor.EDIT_LINK,args:[this.options.videoId,this.model.get("id")]}}}},{key:"onClickEdit",value:function(){var e=s.a.mergeOptions(this.options.analyticsOptions,{actionType:a.UserAction.Edit,entity:a.EntityType.Resource,workflowPhase:a.WorkflowPhase.Start}),t={id:this.model.get("id"),parentId:+this.options.videoId};s.a.logUserAction(t,e)}},{key:"onClickDelete",value:function(){var e=this;new l.d({title:d.a.getPhrase(this.lang,"removeHeading"),text:d.a.getPhrase(this.lang,"removeConfirm",{name:l.w.escapeExpression(this.model.get("name"))}),buttons:[{text:d.a.getPhrase(this.lang,"remove"),className:"btn btn-danger",success:!0},{text:d.a.getPhrase(this.lang,"cancel"),className:"btn btn-secondary",close:!0}],channelName:l.k.generateUniqueChannelName(this)}).render().done((function(){r.Radio.channel(e.options.channelName).trigger("delete:link",e.model.get("id"))}))}},{key:"viewOptions",value:function(){return{styles:h.a,editable:this.options.editable,linkSvg:i.a.getSvg(i.b.Link),editSvg:i.a.getSvg(i.b.Edit),trashSvg:i.a.getSvg(i.b.Delete)}}}])&&m(t.prototype,n),o&&m(t,o),p}(o.a.Component),C=n(1141),S=n.n(C);function O(e){return(O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function E(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function P(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function x(e,t,n){return t&&P(e.prototype,t),n&&P(e,n),e}function R(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&T(e,t)}function T(e,t){return(T=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function N(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=I(e);if(t){var r=I(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return _(this,n)}}function _(e,t){return!t||"object"!==O(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function I(e){return(I=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return j}));var j=function(e){R(n,e);var t=N(n);function n(e){return E(this,n),t.call(this,e)}return x(n,[{key:"name",get:function(){return"VideoLinksComponent"}},{key:"template",get:function(){return S.a}},{key:"className",get:function(){return this.options.customCollection?"":"py-3 border-top"}},{key:"regions",value:function(){return{links:{el:".links-region",replaceElement:!0}}}},{key:"viewOptions",value:function(){return this.options}},{key:"onRender",value:function(){this.showChildView("links",new L({collection:this.options.customCollection||this.model.get("links"),channelName:this.options.channelName,analyticsOptions:this.options.analyticsOptions,editable:this.options.editable,videoId:this.options.videoId,headingText:this.options.headingText,emptyStateText:this.options.emptyStateText}))}}]),n}(o.a.Component),L=function(e){R(n,e);var t=N(n);function n(e){return E(this,n),t.call(this,e)}return x(n,[{key:"name",get:function(){return"LinkItemComponentCollection"}},{key:"childViewOptions",get:function(){return this.options}},{key:"childView",get:function(){return w}}]),n}(o.a.ComponentCollection)},1276:function(e,t,n){e.exports={fileDrop:"_3-Sp5",dropMask:"TuDHp",dragOver:"_3Dz1H"}},1277:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a,s=e.escapeExpression;return'<div class="'+s("function"==typeof(a=null!=(a=n.dropMask||(null!=t?t.dropMask:t))?a:e.hooks.helperMissing)?a.call(null!=t?t:e.nullContext||{},{name:"dropMask",hash:{},data:r}):a)+'">\r\n <h3>'+s(e.lambda(null!=(i=null!=t?t.options:t)?i.fileDropText:i,t))+"</h3>\r\n</div>"},useData:!0})},1278:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r){var i;e.propertyIsEnumerable;return'<p class="alert alert-warning mb-0">'+e.escapeExpression(e.lambda(null!=(i=null!=t?t.options:t)?i.limitText:i,t))+"</p>\r\n"},3:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=e.lambda,s=e.escapeExpression,l=null!=t?t:e.nullContext||{};return'<div class="file-drop '+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.fileDrop:i,t))+" p-2"+(null!=(i=n.if.call(l,null!=(i=null!=t?t.options:t)?i.limitText:i,{name:"if",hash:{},fn:e.program(4,r,0),inverse:e.noop,data:r}))?i:"")+'">\r\n <button class="browse btn btn-light mr-2">'+s((n.lang||t&&t.lang||e.hooks.helperMissing).call(l,"browse",{name:"lang",hash:{},data:r}))+'</button>\r\n <span class="text-muted align-middle">'+s(a(null!=(i=null!=t?t.options:t)?i.alternateText:i,t))+"</span>\r\n</div>\r\n"},4:function(e,t,n,o,r){return" col-6 "},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=e.lambda;return"<h5>"+e.escapeExpression(a(null!=(i=null!=t?t.options:t)?i.title:i,t))+"</h5>\r\n<p>"+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.description:i,t))?i:"")+"</p>\r\n"+(null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.limitText:i,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.program(3,r,0),data:r}))?i:"")},useData:!0})},1279:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=e.lambda;return'<span class="d-inline-block align-middle mr-2 '+e.escapeExpression(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+' float-right text-success">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.tickSvg:i,t))?i:"")+"</span>\r\n"},3:function(e,t,n,o,r){var i;e.propertyIsEnumerable;return'<span class="d-inline-block align-middle mr-2 '+e.escapeExpression(e.lambda(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+' cursor-pointer cancel-upload close float-right">×</span>\r\n'},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a,s=e.lambda,l=e.escapeExpression,u=null!=t?t:e.nullContext||{},c=e.hooks.helperMissing;return'<span class="d-inline-block align-middle mr-2 '+l(s(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+'">'+(null!=(i=s(null!=(i=null!=t?t.options:t)?i.svg:i,t))?i:"")+'</span>\r\n<span class="align-middle">\r\n '+l("function"==typeof(a=null!=(a=n.name||(null!=t?t.name:t))?a:c)?a.call(u,{name:"name",hash:{},data:r}):a)+"\r\n</span>\r\n"+(null!=(i=n.if.call(u,null!=(i=null!=t?t.options:t)?i.finished:i,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.program(3,r,0),data:r}))?i:"")+'\r\n<div class="progress my-2 '+l(s(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.progress:i,t))+' mt-2">\r\n <div class="progress-bar bg-info" style="width: '+l("function"==typeof(a=null!=(a=n.progress||(null!=t?t.progress:t))?a:c)?a.call(u,{name:"progress",hash:{},data:r}):a)+'%" aria-valuenow="'+l("function"==typeof(a=null!=(a=n.progress||(null!=t?t.progress:t))?a:c)?a.call(u,{name:"progress",hash:{},data:r}):a)+'" aria-valuemin="0" aria-valuemax="100"></div>\r\n</div>'},useData:!0})},1280:function(e,t,n){e.exports={svgContainer:"QNFLR",progress:"_1q_ig"}},1281:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;return'<form>\r\n <div class="form-group">\r\n <label for="language">'+e.escapeExpression((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"label",{name:"lang",hash:{},data:r}))+'</label>\r\n <div class="typahead-region"></div>\r\n </div>\r\n</form>'},useData:!0})},1282:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=e.lambda,s=e.escapeExpression;return'<a class="float-right '+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+" "+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.actionSvg:i,t))+' text-muted delete">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.trashSvg:i,t))?i:"")+"</a>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a,s=e.lambda,l=e.escapeExpression,u=null!=t?t:e.nullContext||{};return'<span class="d-inline-block align-middle mr-2 '+l(s(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+'">'+(null!=(i=s(null!=(i=null!=t?t.options:t)?i.svg:i,t))?i:"")+'</span>\r\n<a href="'+l("function"==typeof(a=null!=(a=n.url||(null!=t?t.url:t))?a:e.hooks.helperMissing)?a.call(u,{name:"url",hash:{},data:r}):a)+"?name="+l(s(null!=(i=null!=t?t.options:t)?i.name:i,t))+'" class="align-middle">\r\n '+l(s(null!=(i=null!=t?t.options:t)?i.name:i,t))+"\r\n</a>\r\n"+(null!=(i=n.unless.call(u,null!=(i=null!=t?t.options:t)?i.isClickViewContent:i,{name:"unless",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r}))?i:"")},useData:!0})},1283:function(e,t,n){e.exports={container:"_2GdEa",svgContainer:"_186X3",actionSvg:"_3_l1b"}},1284:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r){var i;e.propertyIsEnumerable;return e.escapeExpression(e.lambda(null!=(i=null!=t?t.options:t)?i.emptyStateText:i,t))},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){var i;e.propertyIsEnumerable;return"<h5>"+e.escapeExpression(e.lambda(null!=(i=null!=t?t.options:t)?i.headerText:i,t))+"</h5>\r\n"+(null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.emptyStateText:i,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r}))?i:"")+'\r\n<div class="subtitles-list-region"></div>'},useData:!0})},1285:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r){var i;e.propertyIsEnumerable;return'<p class="alert alert-warning col-8">'+e.escapeExpression((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"limit",{name:"lang",hash:{limit:null!=(i=null!=t?t.options:t)?i.limit:i},data:r}))+"</p>\r\n"},3:function(e,t,n,o,r){e.propertyIsEnumerable;var i=null!=t?t:e.nullContext||{},a=e.hooks.helperMissing,s=e.escapeExpression;return"<p>"+s((n.lang||t&&t.lang||a).call(i,"subheading",{name:"lang",hash:{},data:r}))+'</p>\r\n<div class="form-group mb-1">\r\n <label for="url">'+s((n.lang||t&&t.lang||a).call(i,"urlLabel",{name:"lang",hash:{},data:r}))+'</label>\r\n <input name="url" id="url" class="form-control" type="text" placeholder="'+s((n.lang||t&&t.lang||a).call(i,"urlPlaceholder",{name:"lang",hash:{},data:r}))+'">\r\n <div class="form-feedback"></div>\r\n</div>\r\n<div class="form-group mb-1" id="name-container" style="display: none;">\r\n <input type="text" class="form-control" name="name" placeholder="'+s((n.lang||t&&t.lang||a).call(i,"namePlaceholder",{name:"lang",hash:{},data:r}))+'">\r\n <div class="form-feedback"></div>\r\n</div>\r\n<div class="attach-btn-region"></div>\r\n'},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){var i;e.propertyIsEnumerable;return'<h5 class="pt-2">Resource Links</h5>\r\n'+(null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.hide:i,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.program(3,r,0),data:r}))?i:"")},useData:!0})},1286:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r){return"col-5"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=null!=t?t:e.nullContext||{};return'<div class="tab-region"></div>\r\n\r\n<div class="row py-3">\r\n <div class="'+(null!=(i=n.if.call(a,null!=(i=null!=t?t.options:t)?i.isClickViewContent:i,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r}))?i:"")+'">\r\n <div class="clickview-subtitles-list-region"></div>\r\n </div>\r\n <div class="col-7">\r\n <div class="subtitles-upload-region"></div>\r\n <div class="subtitles-upload-list-region p-0 col-8"></div>\r\n <div class="customer-subtitles-list-region p-0 col-8"></div>\r\n </div>\r\n</div>\r\n\r\n<div class="row border-top py-3">\r\n <div class="'+(null!=(i=n.if.call(a,null!=(i=null!=t?t.options:t)?i.isClickViewContent:i,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r}))?i:"")+'">\r\n <div class="clickview-resources-list-region"></div>\r\n </div>\r\n <div class="col-7">\r\n <div class="resources-upload-region"></div>\r\n <div class="resources-upload-list-region p-0 col-8"></div>\r\n <div class="customer-resources-list-region p-0 col-8"></div>\r\n </div>\r\n</div>\r\n\r\n<div class="row border-top py-3">\r\n <div class="'+(null!=(i=n.if.call(a,null!=(i=null!=t?t.options:t)?i.isClickViewContent:i,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r}))?i:"")+'">\r\n <div class="clickview-link-list-region"></div>\r\n </div>\r\n <div class="col-7">\r\n <div class="add-links-region mb-2"></div>\r\n <div class="customer-link-list-region p-0 col-8"></div>\r\n </div>\r\n</div>'},useData:!0})},1454:function(e,t,n){"use strict";n.r(t);var o=n(1),r=n(6),i=n(2),a=n(5),s=n(3),l=n(15),u=n(121),c=n(322),f=n(44),p=n(186),h=n(314),d=n(685),y=n(1276),m=n.n(y),g=n(1277),b=n.n(g),v=n(1278),k=n.n(v);function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function C(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function S(e,t){return(S=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function O(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=P(e);if(t){var r=P(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return E(this,n)}}function E(e,t){return!t||"object"!==w(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function P(e){return(P=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var x=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&S(e,t)}(i,e);var t,n,o,r=O(i);function i(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),r.call(this,e)}return t=i,(n=[{key:"name",get:function(){return"FileSelectComponent"}},{key:"template",get:function(){return k.a}},{key:"lang",get:function(){return"shared._fileSelect"}},{key:"elements",get:function(){return{dropArea:".file-drop"}}},{key:"defaults",get:function(){return{acceptMultiple:!0}}},{key:"behaviors",get:function(){return[{behaviorClass:h.a,buttonSelector:".browse",channelName:this.options.channelName,acceptMultiple:this.options.acceptMultiple,mimeType:this.options.mimeType},{behaviorClass:d.a,channelName:this.options.channelName,acceptMultiple:this.options.acceptMultiple}]}},{key:"events",value:function(){var e,t,n,o="dragleave .".concat(m.a.dropMask);return n="onDragLeave",(t=o)in(e={"drop .file-drop":"onDrop","dragover .file-drop":"onDragOver"})?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},{key:"onDrop",value:function(){this.$el.removeClass(m.a.dragOver)}},{key:"onDragOver",value:function(e){this.$el.addClass(m.a.dragOver),e.preventDefault()}},{key:"onDragLeave",value:function(){this.$el.removeClass(m.a.dragOver)}},{key:"viewOptions",value:function(){return Object.assign(Object.assign({},this.options),{styles:m.a,limitText:this.options.limitText,isClickViewContent:this.options.isClickViewContent})}},{key:"onRender",value:function(){this.getUI("dropArea").append(b()({dropMask:m.a.dropMask,fileDropText:s.a.getPhrase(this.lang,"drop")}))}}])&&C(t.prototype,n),o&&C(t,o),i}(i.a.Component),R=n(0),T=n(13),N=n(182),_=n(9),I=n(302),j=n(143),L=n(1120),D=n(1147),V=n(17),U=n(1279),B=n.n(U),F=n(1280),M=n.n(F),A=n(111);function q(e){return(q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function H(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function z(e,t){return(z=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function J(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=Y(e);if(t){var r=Y(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return W(this,n)}}function W(e,t){return!t||"object"!==q(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Y(e){return(Y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Z=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&z(e,t)}(i,e);var t,n,o,r=J(i);function i(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),r.call(this,e)}return t=i,(n=[{key:"initialize",value:function(){this.listenTo(this.model,"change:progress",this.render)}},{key:"name",get:function(){return"FileUploadComponent"}},{key:"template",get:function(){return B.a}},{key:"events",value:function(){return{"click .cancel-upload":"onClickCancelUpload"}}},{key:"onClickCancelUpload",value:function(){A.a.isFunction(this.options.onClickCancelUpload)&&this.options.onClickCancelUpload(this.model.get("id"))}},{key:"viewOptions",value:function(){return{styles:M.a,svg:V.a.getSvg(V.b.Folder),tickSvg:V.a.getSvg(V.b.Check),finished:this.model.get("progress")>=100}}}])&&H(t.prototype,n),o&&H(t,o),i}(i.a.Component);function Q(e){return(Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function X(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function G(e,t){return(G=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function K(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=te(e);if(t){var r=te(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return ee(this,n)}}function ee(e,t){return!t||"object"!==Q(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function te(e){return(te=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ne=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&G(e,t)}(a,e);var t,n,o,i=K(a);function a(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.call(this,e)}return t=a,(n=[{key:"name",get:function(){return"FileUploadsComponentCollection"}},{key:"childView",get:function(){return Z}},{key:"childViewOptions",get:function(){var e=this;return{onClickCancelUpload:function(t){r.Radio.channel(e.options.channelName).trigger("cancel:upload",t)}}}}])&&X(t.prototype,n),o&&X(t,o),a}(i.a.ComponentCollection),oe=n(30),re=n(1094),ie=n(139),ae={handleQuery:function(){return function(e,t){var n=[];if(e){var r=CVLanguages.getEnglishNameContains(e);return o.each(r,(function(e,t){n.push({key:t,name:e.englishName})})),t(n)}t()}},getTypeaheadConfig:function(){return function(){return{name:"languages",source:ae.handleQuery(),limit:5,display:function(e){return e.name},templates:{suggestion:ie.d,pending:ie.b,notFound:ie.c}}}}},se=n(1281),le=n.n(se);function ue(e){return(ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ce(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function fe(e,t){return(fe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function pe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=de(e);if(t){var r=de(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return he(this,n)}}function he(e,t){return!t||"object"!==ue(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function de(e){return(de=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ye=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&fe(e,t)}(i,e);var t,n,o,r=pe(i);function i(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),r.call(this,e)}return t=i,(n=[{key:"initialize",value:function(e){this.model=oe.a.get("subtitle:language",e.defaultLanguage),this.model.addValidation(T.u),this.listenTo(this.channelName,"select:language",this.onLanguageSelected)}},{key:"template",get:function(){return le.a}},{key:"name",get:function(){return"LanguageSelectComponent"}},{key:"lang",get:function(){return"libraryEditor.languageSelect"}},{key:"events",value:function(){return{"click .submit":"onClickSubmit",submit:"onClickSubmit"}}},{key:"behaviors",get:function(){return[{behaviorClass:I.e,title:s.a.getPhrase(this.lang,"heading"),buttons:[{text:s.a.getPhrase(this.lang,"submit"),type:"submit",className:"btn btn-primary submit"}]},{behaviorClass:I.a}]}},{key:"regions",value:function(){return{typeahead:".typahead-region"}}},{key:"channelName",get:function(){return"".concat(this.name).concat(this.cid)}},{key:"getTypeaheadConfigs",value:function(){return[{name:"languages",typeaheadConfig:ae.getTypeaheadConfig()}]}},{key:"renderTypeahead",value:function(){this.showChildView("typeahead",new re.a({model:this.model,parentChannelName:this.channelName,inputId:"language",selectEvent:"select:language",typeaheadConfigs:this.getTypeaheadConfigs()}))}},{key:"onLanguageSelected",value:function(e){this.model.set("code",e.key)}},{key:"onClickSubmit",value:function(){this.model.validate(),this.model.isValid()&&(this.options.promise.resolve(this.model.toJSON()),this.triggerMethod("hide"))}},{key:"onBeforeDestroy",value:function(){"pending"===this.options.promise.state()&&this.options.promise.reject()}},{key:"onRender",value:function(){this.renderTypeahead()}}])&&ce(t.prototype,n),o&&ce(t,o),i}(i.a.Component),me=n(1106),ge=n(1121),be=function(e,t){var n,o,r=e.language;return o=(null==t?void 0:t.filter((function(e){return e.language!==r}))).length>0?CVLanguages.getFullEnglishName(r):CVLanguages.getEnglishName(r),(null===(n=e.metadata)||void 0===n?void 0:n.autoGenerated)?s.a.getPhrase("shared.shared-utils","autoGeneratedSubtitle",{name:o}):o},ve=n(1282),ke=n.n(ve),we=n(1283),Ce=n.n(we);function Se(e){return(Se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Oe(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Ee(e,t){return(Ee=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Pe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=Re(e);if(t){var r=Re(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return xe(this,n)}}function xe(e,t){return!t||"object"!==Se(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Re(e){return(Re=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Te=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ee(e,t)}(i,e);var t,n,o,r=Pe(i);function i(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),r.call(this,e)}return t=i,(n=[{key:"name",get:function(){return"SubtitleItemComponent"}},{key:"template",get:function(){return ke.a}},{key:"className",get:function(){return"".concat(Ce.a.container," rounded p-2 mb-2")}},{key:"events",value:function(){return{"click .delete":"onClickDelete"}}},{key:"getEnglishName",value:function(){return be(this.model.toJSON(),this.model.collection.toJSON())}},{key:"onClickDelete",value:function(){!this.options.isClickViewContent&&A.a.isFunction(this.options.onClickDelete)&&this.options.onClickDelete(this.model)}},{key:"viewOptions",value:function(){return{styles:Ce.a,svg:V.a.getSvg(ge.a.mapTypeToSvg("subtitle")),trashSvg:V.a.getSvg(V.b.Delete),name:this.getEnglishName(),isClickViewContent:this.options.isClickViewContent}}}])&&Oe(t.prototype,n),o&&Oe(t,o),i}(i.a.Component),Ne=n(203),_e=n(1284),Ie=n.n(_e);function je(e){return(je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Le(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function De(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Ve(e,t,n){return t&&De(e.prototype,t),n&&De(e,n),e}function Ue(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Be(e,t)}function Be(e,t){return(Be=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Fe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=Ae(e);if(t){var r=Ae(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return Me(this,n)}}function Me(e,t){return!t||"object"!==je(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ae(e){return(Ae=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var qe=function(e){Ue(n,e);var t=Fe(n);function n(e){return Le(this,n),t.call(this,e)}return Ve(n,[{key:"name",get:function(){return"VideoSubtitlesComponent"}},{key:"template",get:function(){return Ie.a}},{key:"regions",value:function(){return{subtitles:{el:".subtitles-list-region",replaceElement:!0}}}},{key:"viewOptions",value:function(){return{headerText:this.options.headerText,emptyStateText:this.options.emptyStateText}}},{key:"onRender",value:function(){this.showChildView("subtitles",new He({collection:this.collection,channelName:this.options.channelName,isClickViewContent:this.options.isClickViewContent}))}}]),n}(i.a.Component),He=function(e){Ue(n,e);var t=Fe(n);function n(e){return Le(this,n),t.call(this,e)}return Ve(n,[{key:"name",get:function(){return"VideoSubtitlesComponentCollection"}},{key:"lang",get:function(){return"libraryEditor.videoSubtitles"}},{key:"childView",get:function(){return Te}},{key:"childViewOptions",get:function(){var e=this;return{isClickViewContent:this.options.isClickViewContent,onClickDelete:function(t){return e.onClickDelete(t)}}}},{key:"onClickDelete",value:function(e){var t=this;this.options.isClickViewContent||new Ne.a({title:s.a.getPhrase(this.lang,"removeHeading"),text:s.a.getPhrase(this.lang,"removeBody",{language:this.getEnglishName(e)}),buttons:[{text:s.a.getPhrase(this.lang,"remove"),className:"btn btn-danger",success:!0},{text:s.a.getPhrase(this.lang,"cancel"),className:"btn btn-secondary",close:!0}],channelName:"".concat(this.name).concat(this.cid)}).render().done((function(){r.Radio.channel(t.options.channelName).trigger("delete:subtitle",e.get("id"))}))}},{key:"getEnglishName",value:function(e){return be(e.toJSON(),e.collection.toJSON())}}]),n}(i.a.ComponentCollection),ze=n(263),Je=n(1033),We=n(1285),Ye=n.n(We);function Ze(e){return(Ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Qe(e,t){return(Qe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Xe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=Ke(e);if(t){var r=Ke(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return Ge(this,n)}}function Ge(e,t){return!t||"object"!==Ze(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ke(e){return(Ke=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var et=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Qe(e,t)}(a,e);var t,n,o,i=Xe(a);function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).showNameField=!1,t.disableBtn=!0,t}return t=a,(n=[{key:"initialize",value:function(){this.model=oe.a.get(this.viewModelName),this.model.addValidation(Je.c),this.bindListeners()}},{key:"name",get:function(){return"AddLinksComponent"}},{key:"template",get:function(){return Ye.a}},{key:"lang",get:function(){return"libraryEditor.addLinks"}},{key:"tagName",get:function(){return"form"}},{key:"bindings",get:function(){return{"[name=url]":{observe:"url",setOptions:{validate:!0}},"[name=name]":{observe:"name",setOptions:{validate:!0}}}}},{key:"regions",value:function(){return{attachBtn:".attach-btn-region"}}},{key:"behaviors",get:function(){return[{behaviorClass:I.f},{behaviorClass:I.a}]}},{key:"elements",get:function(){return{nameField:"#name-container"}}},{key:"viewModelName",get:function(){return"".concat(this.name,":").concat(this.cid)}},{key:"bindListeners",value:function(){this.listenTo(this.model,"change:url",this.onChangeUrl),this.listenTo(this.model,"change:name",this.onChangeName),this.listenTo(this.options.channelName,"attach:link",this.onClickAttach)}},{key:"onChangeUrl",value:function(){this.showNameField&&!this.model.isValid("url")?(this.getUI("nameField").hide(),this.model.set("name",""),this.showNameField=!1):!this.showNameField&&this.model.isValid("url")&&(this.getUI("nameField").show(),this.showNameField=!0)}},{key:"onChangeName",value:function(){this.model.validate("name"),this.disableBtn=!this.model.isValid(),this.renderAttachButton()}},{key:"onClickAttach",value:function(){var e=this.model.toJSON();this.model.clear(),r.Radio.channel(this.options.channelName).trigger("add:link",e),this.render()}},{key:"renderAttachButton",value:function(){this.options.hide||this.showChildView("attachBtn",new ze.a({saveEvent:"attach:link",channelName:this.options.channelName,buttonText:s.a.getPhrase(this.lang,"attach"),extraButtonClass:"btn-light attach",disabled:this.disableBtn,buttonType:"submit",spinnerOptions:{size:T.s.Medium,type:T.t.Light,extraClasses:"mx-auto"}}))}},{key:"viewOptions",value:function(){return{limit:this.options.limit,hide:this.options.hide}}},{key:"onRender",value:function(){this.renderAttachButton(),this.stickit(),r.Validation.bind(this)}},{key:"onClose",value:function(){this.unstickit(),r.Validation.unbind(this)}}])&&$e(t.prototype,n),o&&$e(t,o),a}(i.a.Component),tt=n(1185),nt=n(36);function ot(e){return(ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function rt(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function it(e,t){return(it=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function at(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=lt(e);if(t){var r=lt(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return st(this,n)}}function st(e,t){return!t||"object"!==ot(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function lt(e){return(lt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ut="shared.errors.tooManyResources",ct=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&it(e,t)}(i,e);var t,n,o,r=at(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=r.call(this,"Cannot add that many resources")).resourceLimit=e,t}return t=i,(n=[{key:"name",get:function(){return"TooManyResourcesError"}},{key:"dialogOptions",get:function(){return{title:s.a.getPhrase(ut,"heading"),text:s.a.getPhrase(ut,"body",{resourceLimit:this.resourceLimit}),buttons:[{text:s.a.getPhrase(ut,"okay"),className:"btn btn-primary",success:!0}]}}}])&&rt(t.prototype,n),o&&rt(t,o),i}(nt.a);function ft(e){return(ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pt(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function ht(e,t){return(ht=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function dt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=mt(e);if(t){var r=mt(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return yt(this,n)}}function yt(e,t){return!t||"object"!==ft(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function mt(e){return(mt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var gt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ht(e,t)}(i,e);var t,n,o,r=dt(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=r.call(this,"Cannot add that many subtitles")).subtileLimit=e,t}return t=i,(n=[{key:"name",get:function(){return"TooManySubtitlesError"}},{key:"dialogOptions",get:function(){return{title:s.a.getPhrase("shared.errors.tooManySubtitles","heading"),text:s.a.getPhrase("shared.errors.tooManySubtitles","body",{subtitleLimit:this.subtileLimit}),buttons:[{text:s.a.getPhrase("shared.errors.tooManySubtitles","okay"),className:"btn btn-primary",success:!0}]}}}])&&pt(t.prototype,n),o&&pt(t,o),i}(nt.a),bt=n(202),vt=n(196),kt=n(303),wt=n(264),Ct=n(4),St=n(42),Ot=n(1286),Et=n.n(Ot);function Pt(e){return(Pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xt(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Rt(e,t){return(Rt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Tt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=_t(e);if(t){var r=_t(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return Nt(this,n)}}function Nt(e,t){return!t||"object"!==Pt(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function _t(e){return(_t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"EditResourcesView",(function(){return It}));var It=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Rt(e,t)}(y,e);var t,n,h,d=Tt(y);function y(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,y),d.call(this,e)}return t=y,(n=[{key:"initialize",value:function(){this.initializeUploadServices(),this.bindDataListeners(),this.bindViewListeners(),this.bindFileSelectListeners(),T.v.initBackButton(),this.chapterDataService=a.a.getInstance(R.g.Chapter,this),this.videoDataService=a.a.getInstance(R.g.Video,this),this.linkDataService=a.a.getInstance(R.g.Link,this),this.resourceDataService=a.a.getInstance(R.g.Resource,this),this.subtitleDataService=a.a.getInstance(R.g.Subtitle,this),this.resourceUploads=[],this.resourceUploadCount=0}},{key:"name",get:function(){return"EditResourcesView"}},{key:"lang",get:function(){return"libraryEditor.editResources"}},{key:"title",get:function(){return this.model&&this.model.get("name")||"Edit Resources"}},{key:"template",get:function(){return Et.a}},{key:"props",get:function(){return["videoDataService"]}},{key:"className",get:function(){return"bg-white p-3"}},{key:"channelName",get:function(){return T.k.generateUniqueChannelName(this)}},{key:"behaviors",get:function(){return[{behaviorClass:I.d}]}},{key:"requiredResources",get:function(){return{currentUser:j.b.currentUser}}},{key:"initializeUploadServices",value:function(){this.resourceUploadService=new c.b,this.listenTo(R.w.RESOURCE_UPLOAD,f.a.UPLOAD_COMPLETE,this.onResourceUploadComplete),this.subtitleUploadService=new c.c,this.listenTo(R.w.SUBTITLE_UPLOAD,f.a.UPLOAD_COMPLETE,this.onSubtitleUploadComplete)}},{key:"bindDataListeners",value:function(){this.listenTo(R.e.VIDEO,"".concat(R.f.VIDEOS,":").concat(this.options.videoId,":sync"),this.render),this.listenTo(R.e.VIDEO,"".concat(R.f.VIDEOS,":").concat(this.options.videoId,":error"),this.onVideoDataError),this.listenTo(R.e.VIDEO,"".concat(R.f.VIDEO_HAS_PHYSICAL_CHAPTERS,":").concat(this.options.videoId,":sync"),this.render),this.listenTo(R.e.CHAPTER,"".concat(R.f.CONCATENATE_STATUS,":").concat(this.options.videoId,":error"),this.onConcatenateDataError)}},{key:"bindViewListeners",value:function(){this.listenTo(this.channelName,"add:link",this.onAddLink),this.listenTo(this.channelName,"delete:subtitle",this.onDeleteSubtitle),this.listenTo(this.channelName,"delete:resource",this.onDeleteResource),this.listenTo(this.channelName,"delete:link",this.onDeleteLink),this.listenTo(this.channelName,"cancel:upload",this.onCancelUpload),this.listenTo(this.channelName,vt.LibraryEditorActions.MergeChapters,this.onMergeChapters)}},{key:"bindFileSelectListeners",value:function(){this.listenTo(this.getSubtitleSelectChannelName(),f.a.FILES_SELECTED,this.onSubtitleFilesAdded),this.listenTo(this.getResourceSelectChannelName(),f.a.FILES_SELECTED,this.onResourceFilesAdded)}},{key:"getSubtitleSelectChannelName",value:function(){return"".concat(this.name).concat(this.cid,"subtitles")}},{key:"getResourceSelectChannelName",value:function(){return"".concat(this.name).concat(this.cid,"resources")}},{key:"onVideoDataError",value:function(e){switch(e.type){case u.a.NotFound:i.a.ErrorHelper.throw(new bt.l);break;case u.a.Forbidden:i.a.ErrorHelper.throw(new bt.f)}}},{key:"onConcatenateDataError",value:function(e){e.type===u.a.NotFound&&(this.concatenateRequestNotFound=!0,this.render())}},{key:"onSubtitleFilesAdded",value:function(e,t){e.length>5-this.model.subtitles.length?i.a.ErrorHelper.throw(new gt(5)):(t&&(this.interactionType=t),this.subtitleUploadService.addFiles(e))}},{key:"onResourceFilesAdded",value:function(e,t){e.length>25-this.model.resources.length?i.a.ErrorHelper.throw(new ct(25)):(this.resourceUploadCount+=e.length,t&&(this.interactionType=t),this.resourceUploadService.addFiles(e))}},{key:"onAddLink",value:function(e){var t=this;25!==this.model.links.length&&(this.model.links.length+1===25&&this.renderAddLinks(!0),this.linkDataService.addLink(this.model.get("id"),e,(function(e){t.model.links.add(e),t.render()})))}},{key:"regions",value:function(){return{tabs:{el:".tab-region",partialLoading:_.h.EditVideoTabs},subtitlesUpload:{el:".subtitles-upload-region",partialLoading:_.h.EditVideoUploadArea},subtitlesUploadList:".subtitles-upload-list-region",customerSubtitlesList:".customer-subtitles-list-region",clickViewSubtitlesList:".clickview-subtitles-list-region",resourcesUpload:{el:".resources-upload-region",partialLoading:_.h.EditVideoUploadArea},resourcesUploadList:".resources-upload-list-region",customerResourcesList:".customer-resources-list-region",clickViewResourcesList:".clickview-resources-list-region",addLinks:{el:".add-links-region",partialLoading:_.h.EditVideoUploadArea},customerLinkList:".customer-link-list-region",clickViewLinkList:".clickview-link-list-region"}}},{key:"startPollingConcatenation",value:function(){if(this.concatenateRequest){var e=[kt.a.SingleFile,kt.a.ConcatenationFailed];o.contains(e,this.concatenateRequest.get("status"))||this.pollConcatenation()}}},{key:"pollConcatenation",value:function(){var e=this;this.isDestroyed()||this.chapterDataService.getConcatenateRequest(this.options.videoId,(function(t){if(e.concatenateRequest=t,e.concatenateRequest.get("status")!==kt.a.SingleFile)return setTimeout((function(){return e.pollConcatenation()}),5e3),void e.renderConcatenationRequest();e.videoDataService.clearPhysicialChaptersCache(),e.videoDataService.hasPhysicalChapters(e.options.videoId,(function(t){e.hasPhysicalChapters=t,e.renderSubtitleFileSelect()}))}))}},{key:"onDeleteResource",value:function(e){var t=this;this.resourceDataService.deleteResource(this.options.videoId,e,(function(){t.logDeleteAction(Ct.EntityType.Resource,e),t.render()}))}},{key:"onDeleteSubtitle",value:function(e){var t=this;this.subtitleDataService.deleteSubtitle(this.options.videoId,e,(function(){t.logDeleteAction(Ct.EntityType.Subtitle,e),t.render()}))}},{key:"onDeleteLink",value:function(e){var t=this;this.linkDataService.deleteLink(this.options.videoId,e,(function(){t.logDeleteAction(Ct.EntityType.Link,e),t.render()}))}},{key:"onCancelUpload",value:function(e){this.resourceUploadService.cancelUpload(e),this.subtitleUploadService.cancelUpload(e)}},{key:"onResourceUploadComplete",value:function(e){var t=this,n=e.toJSON(),o={fileId:n.fileInfo.id,uploadId:n.file.cvUpload.uploadId,name:n.fileInfo.name,type:p.a.getResourceType(n.fileInfo.extension),extension:n.fileInfo.extension,fileSize:n.fileInfo.size,fileUrl:n.fileInfo.url,ingestUrl:n.file.cvUpload.ingestUrl,metaData:{type:p.a.getResourceType(n.fileInfo.extension)},contribution:!1,url:n.fileInfo.url,fileIdType:2};this.resourceUploads.push(o),this.resourceUploadCount--,this.resourceUploadCount>0||(this.resourceDataService.addResource(this.options.videoId,this.resourceUploads,(function(e){t.model.resources.add(e);var n=t.resourceUploadService.getCollection().filter((function(t){return t.get("fileInfo").id===e.get("fileId")}));t.resourceUploadService.getCollection().remove(n),t.logUploadAction(e),t.render()})),this.resourceUploads=[])}},{key:"onSubtitleUploadComplete",value:function(e){var t=this,n=$.Deferred(),o=new ye({defaultLanguage:{code:"en",name:"English"},promise:n});n.done((function(n){var o=e.toJSON(),r={fileId:o.fileInfo.id,name:n.name,language:n.code,type:p.a.getResourceType(o.fileInfo.extension),fileIdType:2};t.subtitleDataService.addSubtitle(t.options.videoId,r,(function(n){t.model.subtitles.add(n),t.subtitleUploadService.getCollection().remove(e),t.logUploadAction(n),t.render()}))})).fail((function(){t.subtitleUploadService.cancelUpload(e.get("id"))})),r.Radio.channel(l.a.POPUP).trigger(i.a.EventNames.SHOW_POPUP,o)}},{key:"logUploadAction",value:function(e){var t=e instanceof N.a?Ct.EntityType.Resource:Ct.EntityType.Subtitle,n=St.a.mapInteractionType(this.interactionType),o={location:Ct.LocationContext.EditVideoResources,actionType:Ct.UserAction.Upload,entity:t,descriptor:n};St.a.logUserAction(e,o)}},{key:"logDeleteAction",value:function(e,t){var n={location:Ct.LocationContext.EditVideoResources,actionType:Ct.UserAction.Delete,entity:e},o={id:t,parentId:+this.options.videoId};St.a.logUserAction(o,n)}},{key:"onMergeChapters",value:function(){var e=this;this.chapterDataService.addConcatenateRequest(this.options.videoId,(function(){e.pollConcatenation()}))}},{key:"renderTabs",value:function(){var e=!T.j.canEditVideo(this.model);this.showChildView("tabs",new me.a({tabs:T.v.getEditVideoTabs(this.options.videoId,{hideChaptersTab:e}),activeTab:".edit-resources-subtitles-applink",goBackTab:T.v.getBackButton(this.options.videoId)}))}},{key:"renderSubtitleFileSelect",value:function(){if(this.hasPhysicalChapters.get("value"))this.renderConcatenationRequest();else{var e=s.a.getPhrase(this.lang,"subtitlesLimit",{limit:5});this.showChildView("subtitlesUpload",new x({title:this.isClickViewContent?s.a.getPhrase(this.lang,"customerSubtitles"):s.a.getPhrase(this.lang,"subtitles"),description:s.a.getPhrase(this.lang,"subtitlesInfo"),alternateText:s.a.getPhrase(this.lang,"subtitlesAlternative"),mimeType:p.b.SUBTITLES,channelName:this.getSubtitleSelectChannelName(),acceptMultiple:!1,limitText:this.model.subtitles.length>=5?e:null,isClickViewContent:this.isClickViewContent}))}}},{key:"renderSubtitleUploadList",value:function(){var e=this.subtitleUploadService.getCollection();this.showChildView("subtitlesUploadList",new ne({collection:e,channelName:this.channelName}))}},{key:"renderSubtitlesLists",value:function(){this.renderClickViewSubtitlesList(),this.renderCustomerSubtitlesList()}},{key:"renderClickViewSubtitlesList",value:function(){if(this.isClickViewContent){var e=T.j.filterObjectsByOwnerType(this.model.subtitles,wt.a.ClickView);this.showChildView("clickViewSubtitlesList",new qe({collection:e,channelName:this.channelName,isClickViewContent:!0,headerText:s.a.getPhrase(this.lang,"clickViewSubtitles"),emptyStateText:e.models.length?"":s.a.getPhrase(this.lang,"clickViewSubtitlesEmpty")}))}}},{key:"renderCustomerSubtitlesList",value:function(){this.showChildView("customerSubtitlesList",new qe({collection:T.j.filterObjectsByOwnerType(this.model.subtitles,wt.a.Customer,this.currentUser.get("customerId")),channelName:this.channelName}))}},{key:"renderConcatenationRequest",value:function(){this.isRendered()&&this.showChildView("subtitlesUpload",new D.a({type:this.isClickViewContent?"clickViewSubtitles":"subtitles",channelName:this.channelName,model:this.concatenateRequest}))}},{key:"renderResourcesFileSelect",value:function(){var e=s.a.getPhrase(this.lang,"resourcesLimit",{limit:25});this.showChildView("resourcesUpload",new x({title:this.isClickViewContent?s.a.getPhrase(this.lang,"customerResources"):s.a.getPhrase(this.lang,"resources"),description:s.a.getPhrase(this.lang,"resourcesDescription"),alternateText:s.a.getPhrase(this.lang,"resourcesAlternative"),mimeType:p.b.RESOURCES,channelName:this.getResourceSelectChannelName(),limitText:this.model.resources.length>=25?e:null,isClickViewContent:this.isClickViewContent}))}},{key:"renderResourcesUploadList",value:function(){var e=this.resourceUploadService.getCollection();this.showChildView("resourcesUploadList",new ne({collection:e,channelName:this.channelName}))}},{key:"renderResourcesLists",value:function(){this.renderClickViewResourcesList(),this.renderCustomerResourcesList()}},{key:"renderClickViewResourcesList",value:function(){if(this.isClickViewContent){var e=T.j.filterObjectsByOwnerType(this.model.resources,wt.a.ClickView);this.showChildView("clickViewResourcesList",new L.a({model:this.model,customCollection:e,editable:!1,videoId:this.options.videoId,parentChannelName:this.channelName,headerText:s.a.getPhrase(this.lang,"clickViewResources"),emptyStateText:e.models.length?"":s.a.getPhrase(this.lang,"clickViewResourcesEmpty"),analyticsOptions:{location:Ct.LocationContext.EditVideoResources}}))}}},{key:"renderCustomerResourcesList",value:function(){this.showChildView("customerResourcesList",new L.b({collection:T.j.filterObjectsByOwnerType(this.model.resources,wt.a.Customer,this.currentUser.get("customerId")),editable:!0,videoId:this.options.videoId,channelName:this.channelName,analyticsOptions:{location:Ct.LocationContext.EditVideoResources}}))}},{key:"renderAddLinks",value:function(e){this.showChildView("addLinks",new et({collection:this.model.get("links"),channelName:this.channelName,hide:e||25===this.model.get("links").length,limit:25}))}},{key:"renderLinkLists",value:function(){var e={channelName:this.channelName,analyticsOptions:{location:Ct.LocationContext.EditVideoResources},videoId:this.options.videoId};this.renderClickViewLinkList(e),this.renderCustomerLinkList(e)}},{key:"renderClickViewLinkList",value:function(e){if(this.isClickViewContent){var t=T.j.filterObjectsByOwnerType(this.model.links,wt.a.ClickView);this.showChildView("clickViewLinkList",new tt.a(Object.assign(Object.assign({},e),{headingText:"Resource Links by ClickView",emptyStateText:t.models.length?"":"There are no ClickView links for this video",customCollection:t,editable:!1})))}}},{key:"renderCustomerLinkList",value:function(e){this.showChildView("customerLinkList",new tt.a(Object.assign(Object.assign({},e),{customCollection:T.j.filterObjectsByOwnerType(this.model.links,wt.a.Customer,this.currentUser.get("customerId")),editable:!0})))}},{key:"fetchData",value:function(){var e=this;this.model=this.videoDataService.getVideo(this.options.videoId),this.hasPhysicalChapters=this.videoDataService.hasPhysicalChapters(this.options.videoId),this.isClickViewContent=this.model&&!T.j.canEditVideo(this.model),this.hasPhysicalChapters&&this.hasPhysicalChapters.get("value")&&!this.getConcatenateRequestSent&&(this.chapterDataService.getConcatenateRequest(this.options.videoId,(function(t){e.concatenateRequest=t,e.render()})),this.getConcatenateRequestSent=!0)}},{key:"shouldRender",value:function(){return!(!this.model||!this.hasPhysicalChapters||this.hasPhysicalChapters.get("value")&&!this.concatenateRequest&&!this.concatenateRequestNotFound)}},{key:"onBeforeRender",value:function(){return this.fetchData(),this.shouldRender()}},{key:"viewOptions",value:function(){return{isClickViewContent:this.isClickViewContent}}},{key:"onRender",value:function(){this.renderTabs(),this.renderSubtitleFileSelect(),this.renderSubtitleUploadList(),this.renderSubtitlesLists(),this.renderResourcesFileSelect(),this.renderResourcesUploadList(),this.renderResourcesLists(),this.renderAddLinks(),this.renderLinkLists(),this.startPollingConcatenation()}},{key:"onDestroy",value:function(){this.subtitleUploadService.destroy(),this.resourceUploadService.destroy()}}])&&xt(t.prototype,n),h&&xt(t,h),y}(i.a.View)}}]);
|
|
1
|
+
(window.webpackJsonp_clickview_library_editor=window.webpackJsonp_clickview_library_editor||[]).push([[23],{1036:function(e,t,n){"use strict";var o=n(1041),r=n(1037),i=(n(1038),n(3),n(1042)),a=(n(1044),n(1040));n.d(t,"a",(function(){return o.a})),n.d(t,"d",(function(){return r.g})),n.d(t,"g",(function(){return r.j})),n.d(t,"f",(function(){return r.i})),n.d(t,"c",(function(){return r.f})),n.d(t,"e",(function(){return r.h})),n.d(t,"b",(function(){return i.a})),n.d(t,"h",(function(){return a.a}))},1037:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"k",(function(){return h})),n.d(t,"g",(function(){return m})),n.d(t,"e",(function(){return y})),n.d(t,"j",(function(){return g})),n.d(t,"i",(function(){return v})),n.d(t,"c",(function(){return w})),n.d(t,"b",(function(){return C})),n.d(t,"d",(function(){return S})),n.d(t,"f",(function(){return k})),n.d(t,"h",(function(){return b}));var o=n(2),r=n(1),i=n(19),a=n(29),s=n(3),l="libraryEditor.utils",u=["tags","thumbnail","chapters","resources","subtitles","disabled","links","restrictions","categories"];function c(e,t){if(e){var n=r.reduce(e,(function(e,n,o){var i=t[o];return n||i?r.isObject(n)&&r.isObject(i)&&!r.isUndefined(n.id)&&n.id===i.id?e:r.isArray(n)?f(n,i).length?e.concat(o):e:r.isEqual(n,i)?e:e.concat(o):e}),[]);if(n.length)return r.object(r.map(n,(function(n){return r.isArray(t[n])?[n,f(e[n],t[n])]:[n,t[n]]})))}}function f(e,t){var n=[];return r.each(t,(function(t){var o=r.findWhere(e,{id:t.id});if(!r.isUndefined(o)||0!==Object.keys(t).length){var i=r.isUndefined(o)?t:c(o,t);i&&(t.id<0&&!t.value||(!o||t.id<0?n.push(t):(i.id=t.id,n.push(i))))}})),n}var p={getChanges:function(e,t){var n=c(r.omit(e.toJSON(),u),r.omit(t.toJSON(),u));if(n)return r.object(r.map(r.keys(n),(function(e){return[e,p.formatChanges(e,n[e])]})))},formatChanges:function(e,t){if(!t)return null;if(r.isObject(t)&&r.isEmpty(t))return null;switch(e){case"name":case"description":case"productionYear":case"dateBroadcast":case"fields":case"episodeNumber":return t;case"channel":case"series":case"rating":case"season":return{id:t.id};case"distributors":case"producers":case"directors":case"productionCompanies":return r.map(t,(function(e){return e.id}));case"dateModified":case"hasBroadcast":return;default:o.a.ErrorHelper.throw(new i.a("There are no formatting settings for ".concat(e)))}},updateModelState:function(e,t,n){var i=["distributors","producers","directors","productionCompanies"];for(var a in r.each(r.keys(n),(function(e){i.includes(e)&&(n[e]=t.get(e).toJSON())})),t.set(r.clone(n),{silent:!0}),e.set(t.toJSON(),{silent:!0}),n){if(!n[a]&&e.associations[a]){var s=e.get(a);(s instanceof o.a.Model||s instanceof o.a.NestedModel)&&s.clear()}}},getRemovedObjectIds:function(e,t){var n=["distributors","productionCompanies","producers","directors"],o={};return r.each(r.keys(e.toJSON()),(function(i){if(r.contains(n,i)){var a=e.get(i).map((function(e){return e.id})),s=t.get(i).map((function(e){return e.id})),l=r.filter(a,(function(e){return e&&!r.contains(s,e)}));l.length&&(o[i]=l)}})),o}},h={name:[{required:!0,msg:function(){return s.a.getPhrase(l,"videoTitleRequired")}},{maxLength:255,msg:function(){return s.a.getPhrase(l,"videoTitleExceeds")}}],description:[{required:!1},{maxLength:16e3,msg:function(){return s.a.getPhrase(l,"videoDescriptionExceeds")}}],episodeNumber:function(e,t,n){return e&&e<1?s.a.getPhrase(l,"episodeNumberLessThanOne"):e&&e>2147483647?s.a.getPhrase(l,"episodeNumberExceeds"):e%1!=0?s.a.getPhrase(l,"episodeNumberNotWhole"):n.season&&n.season.get("number")>=0&&null===e?s.a.getPhrase(l,"episodeNumberNoSeason"):""},season:function(e,t,n){return n.season&&n.season.get("number")||e&&e.number||!n.episodeNumber?"":s.a.getPhrase(l,"seasonNoEpisodeNumber")}},d=a().year(),y={productionYear:function(e){return e||0===e?(e=+e,isNaN(e)?"Production year must be a number.":e<1900||e>d?s.a.getPhrase(l,"validProductionYears",{currentYear:d}):void 0):""}},m={name:[{required:!0,msg:function(){return s.a.getPhrase(l,"resourceNameRequired")}}]},g={suggestion:[{required:!0,msg:function(){return s.a.getPhrase(l,"suggestEditRequired")}},{maxLength:16e3,msg:function(){return s.a.getPhrase(l,"suggestEditExceeds")}}],reason:[{required:!0,msg:function(){return s.a.getPhrase(l,"suggestEditReasonRequired")}},{maxLength:16e3,msg:function(){return s.a.getPhrase(l,"suggestEditReasonExceeds")}}]},b={number:function(e){return e?+e<1?s.a.getPhrase(l,"seasonLessThanOne"):+e>3e3?s.a.getPhrase(l,"seasonExceeds"):+e%1!=0?s.a.getPhrase(l,"seasonNotWhole"):"":s.a.getPhrase(l,"seasonRequired")}},v={empty:function(){return s.a.getPhrase(l,"suggestEditRatingRequired")},original:function(){return s.a.getPhrase(l,"suggestEditRatingInvalid")}},k={url:[{required:!0,pattern:"url",msg:function(){return s.a.getPhrase(l,"linkUrlRequired")}},{maxLength:16e3,msg:function(){return s.a.getPhrase(l,"linkUrlExceeds")}}],name:[{required:!0,msg:function(){return s.a.getPhrase(l,"linkNameRequired")}},{maxLength:255,msg:function(){return s.a.getPhrase(l,"linkNameExceeds")}}]},w={name:[{maxLength:128,msg:function(){return s.a.getPhrase(l,"fieldNameExceeds")}}],value:[{maxLength:16e3,msg:function(){return s.a.getPhrase(l,"fieldValueExceeds")}}]},C={fields:function(e){return e&&e.length?e.all((function(e){return!1!==e.isValid()}))?"":s.a.getPhrase(l,"fieldsInvalid"):""}};function S(){return[{id:-1,name:"Admin Notes",value:"",placeholder:"Notes that only admins will see"}]}},1038:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var o=n(1),r=n(48),i=n(168),a=n(3),s="libraryEditor.utils",l={name:[{required:!0,msg:function(){return a.a.getPhrase(s,"folderNameRequired")}},{maxLength:255,msg:function(){return a.a.getPhrase(s,"folderNameExceeds")}}]},u=function(e,t){return{parentId:function(n){return n?r.a.calculateDestinationFolderDepth(e,n,t)>i.a.MAX_FOLDER_DEPTH?a.a.getPhrase(s,"maxFolderDepth",{maxDepth:i.a.MAX_FOLDER_DEPTH}):"":a.a.getPhrase(s,"selectParentFolder")}}},c=function(e){var t=e.validateName,n=e.validateParent,r=e.folder,i=e.collection;return t&&n?o.extend({},l,u(r,i)):t?l:n?u(r,i):void 0}},1040:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var o=n(16),r=n(3),i=n(199),a=n(1056),s=n(62);function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var u,c="libraryEditor.utils";!function(e){e.Pdf="pdf",e.Image="image",e.PowerPoint="powerpoint",e.Document="document",e.Excel="excel",e.Zip="archive",e.File="text"}(u||(u={}));var f={mapRatingToClass:function(e){if(!e)return"";return function(e){switch(!0){case e<32:return"bg-purple";case e<48:return"bg-green";case e<80:return"bg-info";case e<96:return"bg-red";case e<128:return"bg-pink";case e>=128:return"bg-yellow";default:return""}}(e)},mapSourceToDisplayName:function(e){switch(e.get("type")){case s.a.HostedLibrary:case s.a.CustomLibrary:return e.get("name");case s.a.Exchange:return r.a.getPhrase(c,"exchange");case s.a.Workspace:return r.a.getPhrase(c,"workspace");default:return""}},mapSourceToClass:function(e){switch(e){case s.a.HostedLibrary:case s.a.CustomLibrary:return"bg-info";case s.a.Exchange:return"bg-green";case s.a.Workspace:default:return"bg-red"}},isInteractive:function(e){return!(!e||!e.interactives)&&!!e.interactives.length},mapTypeToSvg:function(e){var t,n=(l(t={},u.Pdf,o.b.FilePDF),l(t,u.Image,o.b.FileImg),l(t,u.PowerPoint,o.b.FilePowerpoint),l(t,u.Document,o.b.FileWord),l(t,u.Excel,o.b.FileExcel),l(t,u.Zip,o.b.FileZip),l(t,u.File,o.b.File),t)[e];return n||(n=o.b.Folder),o.a.getSvg(n)},mapTypeToClass:function(e){switch(e){case u.Pdf:return"icon-red";case u.Image:return"icon-purple";case u.Document:return"icon-blue";case u.Excel:return"icon-green";case u.PowerPoint:return"icon-orange";case u.Zip:return"icon-teal";case u.File:return"icon-gray";default:return""}},mapTypeToExtension:function(e){if(!e)return"";return{pdf:"pdf",image:"png",powerpoint:"pptx"}[e.toLowerCase()]},mapTypeToName:function(e){if(!e)return"";switch(e){case u.Pdf:return r.a.getPhrase(c,"pdf");case u.Image:return r.a.getPhrase(c,"image");case u.Document:return r.a.getPhrase(c,"document");case u.Excel:return r.a.getPhrase(c,"spreadsheet");case u.PowerPoint:return r.a.getPhrase(c,"presentation");case u.Zip:return r.a.getPhrase(c,"zipArchive");case u.File:return r.a.getPhrase(c,"file");default:return""}},translateMetadataCollectionNames:function(e){return new a.a(e.map((function(e){return Object.assign(Object.assign({},e.toJSON()),{name:f.translateMetadataName(e.get("name"))})})))},translateMetadataName:function(e){var t="suggestEdit";switch(e){case i.MetadataType.VideoTitle:t+="VideoTitle";break;case i.MetadataType.Description:t+="Description";break;case i.MetadataType.Rating:t+="Rating";break;case i.MetadataType.SeriesTitle:t+="SeriesTitle";break;case i.MetadataType.Season:t+="SeasonNumber";break;case i.MetadataType.EpisodeNumber:t+="EpisodeNumber";break;case i.MetadataType.BroadcastDate:t+="BroadcastDate";break;case i.MetadataType.Channel:t+="Channel";break;case i.MetadataType.ProductionYear:t+="ProductionYear";break;case i.MetadataType.Distributors:t+="Distributors";break;case i.MetadataType.ProductionCompanies:t+="ProductionCompanies";break;case i.MetadataType.Directors:t+="Directors";break;case i.MetadataType.Producers:t+="Producers";break;case i.MetadataType.Other:t+="Other"}return r.a.getPhrase(c,t)}}},1041:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var o=n(1),r=n(13),i=n(3),a="libraryEditor.utils",s={isValidChapterTime:function(e,t,n,i){if(i){if(!o.isNumber(t))return l.StartTime.Invalid();if(t<0)return l.StartTime.Invalid();if(t>r.x.millisecondsToSeconds(n))return l.StartTime.Exceeds();if(i.some((function(n){return!(n.id&&n.id===e.id||n.cid===e.cid)&&n.get("startTime")===t})))return l.StartTime.Exists()}},isValidChapterName:function(e,t,n){return t?t.length>255?l.Name.MaxLength():n.some((function(n){return!(n.id&&n.id===e.id||n.cid===e.cid)&&n.get("name").trim()===t.trim()}))?l.Name.Exists():o.isEmpty(t.trim())?l.Name.Invalid():void 0:l.Name.Invalid()},mapPhysicalChapters:function(e){var t=0;return o.map(e,(function(e,n){var o={name:e.title,startTime:t,index:n,isPhysicalChapter:!0};return t+=e.duration,o}))}},l={Name:{Invalid:function(){return i.a.getPhrase(a,"chapterNameInvalid")},Exists:function(){return i.a.getPhrase(a,"chapterNameExists")},MaxLength:function(){return i.a.getPhrase(a,"chapterNameExceeds")}},StartTime:{Invalid:function(){return i.a.getPhrase(a,"chapterStartTimeInvalid")},Exists:function(){return i.a.getPhrase(a,"chapterStartTimeExists")},Exceeds:function(){return i.a.getPhrase(a,"chapterStartTimeExceeds")}}}},1042:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n(3),r="libraryEditor.utils",i={name:[{required:!0,msg:function(){return o.a.getPhrase(r,"libraryNameRequired")}},{maxLength:255,msg:function(){return o.a.getPhrase(r,"libraryNameExceeds")}}]}},1044:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n(3),r=n(1037),i=o.a.encloseNamespace("libraryEditor.utils"),a={name:[{required:!0,msg:function(){return i("videoTitleRequired")}}],folderId:[{required:!0,msg:function(){return i("uploadFolderRequired")}}],libraryId:[{required:!0,msg:function(){return i("uploadLibraryRequired")}}],episodeNumber:function(e,t,n){return e&&e<1?i("episodeNumberLessThanOne"):e&&e>255?i("episodeNumberExceeds"):e&&e%1!=0?i("episodeNumberNotWhole"):n.season&&n.season.get("number")>=0&&null===e?i("episodeNumberNoSeason"):""},season:function(e,t,n){return n.season&&n.season.get("number")||e&&e.number||!n.episodeNumber?"":i("seasonNoEpisodeNumber")},productionYear:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r.e.productionYear.apply(null,t)}}},1056:function(e,t,n){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=l(e);if(t){var r=l(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return s(this,n)}}function s(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return u}));var u=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(n,e);var t=a(n);function n(){return r(this,n),t.apply(this,arguments)}return n}(n(2).a.Collection)},1087:function(e,t,n){"use strict";n.d(t,"a",(function(){return y}));var o=n(1),r=n(2),i=n(1088),a=n.n(i),s=n(1089),l=n.n(s);function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=d(e);if(t){var r=d(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return h(this,n)}}function h(e,t){return!t||"object"!==u(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}(s,e);var t,n,r,i=p(s);function s(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),i.call(this,e)}return t=s,(n=[{key:"name",get:function(){return"TabsView"}},{key:"className",get:function(){var e="bg-white py-2 border-bottom";return this.options.className&&(e+=" ".concat(this.options.className)),e}},{key:"template",get:function(){return l.a}},{key:"appLinks",get:function(){var e={};return this.options.tabs.forEach((function(t){return e[t.link.selector]=t.link.appLink})),e}},{key:"viewOptions",value:function(){var e=this.options.tabs.map((function(e){return Object.assign(Object.assign({},e),{link:e.link.selector.replace(".","")})}));return{styles:a.a,tabs:e}}},{key:"setActiveTab",value:function(){var e=this,t=!1;if(this.options.tabs.forEach((function(n){n.active=!1,n.link.selector===e.options.activeTab&&(n.active=!0,t=!0)})),!t){var n=o.first(this.options.tabs);n&&(n.active=!0)}}},{key:"onBeforeRender",value:function(){this.setActiveTab()}}])&&c(t.prototype,n),r&&c(t,r),s}(r.a.Component)},1088:function(e,t,n){e.exports={link:"_5idZs",active:"_3Ty4M"}},1089:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r,i,a){var s;e.propertyIsEnumerable;return null!=(s=n.unless.call(null!=t?t:e.nullContext||{},null!=t?t.hide:t,{name:"unless",hash:{},fn:e.program(2,r,0,i,a),inverse:e.noop,data:r}))?s:""},2:function(e,t,n,o,r,i,a){e.propertyIsEnumerable;var s,l=e.lambda,u=e.escapeExpression;return' <a class="'+u(l(null!=(s=null!=(s=null!=a[1]?a[1].options:a[1])?s.styles:s)?s.link:s,t))+" p-2 "+u(l(null!=t?t.link:t,t))+" "+(null!=(s=n.if.call(null!=t?t:e.nullContext||{},null!=t?t.active:t,{name:"if",hash:{},fn:e.program(3,r,0,i,a),inverse:e.noop,data:r}))?s:"")+'">'+u(l(null!=t?t.name:t,t))+"</a>\r\n"},3:function(e,t,n,o,r,i,a){var s;e.propertyIsEnumerable;return e.escapeExpression(e.lambda(null!=(s=null!=(s=null!=a[1]?a[1].options:a[1])?s.styles:s)?s.active:s,t))+" border-bottom border-primary text-primary"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r,i,a){var s;e.propertyIsEnumerable;return null!=(s=n.each.call(null!=t?t:e.nullContext||{},null!=(s=null!=t?t.options:t)?s.tabs:s,{name:"each",hash:{},fn:e.program(1,r,0,i,a),inverse:e.noop,data:r}))?s:""},useData:!0,useDepths:!0})},1097:function(e,t,n){"use strict";n.d(t,"a",(function(){return k}));var o=n(1),r=n(6),i=n(2),a=n(19),s=n(16),l=n(99),u=n(13),c=n(1148),f=n.n(c),p=n(1149),h=n.n(p);function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function y(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=v(e);if(t){var r=v(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return b(this,n)}}function b(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var k=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(d,e);var t,n,c,p=g(d);function d(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d),p.call(this,e)}return t=d,(n=[{key:"name",get:function(){return"SearchTypeaheadComponent"}},{key:"template",get:function(){return f.a}},{key:"className",get:function(){return"search-container ".concat(h.a.typeaheadContainer," mb-2")}},{key:"channelName",get:function(){return u.k.generateUniqueChannelName(this)}},{key:"elements",get:function(){return{input:"#".concat(this.options.inputId)}}},{key:"defaults",get:function(){return{inputId:"search-typeahead",placeholderText:"Search",stickItProperty:"name",selectEvent:"select:result",additionalClasses:"",editable:!0}}},{key:"events",value:function(){return{submit:"onSubmit","click .remove":"onClickRemove"}}},{key:"initialize",value:function(){this.model||this.options.parentChannelName||i.a.ErrorHelper.throw(new a.a("Either pass a model or a channelName to access the typeahead selection")),this.model||(this.model=new i.a.Model),this.options.inputName||(this.options.inputName=this.options.inputId),this.bindListeners()}},{key:"bindListeners",value:function(){this.options.parentChannelName&&(this.parentChannel=r.Radio.channel(this.options.parentChannelName)),this.listenTo(this.channelName,"typeahead:set:input",this.setInput),this.listenTo(this.channelName,"typeahead:clear:input",this.clearInput)}},{key:"bindings",get:function(){var e,t,n,o="[name=".concat(this.options.inputName,"]");return e={},t=o,n={observe:this.options.stickItProperty,setOptions:{validate:!0}},t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},{key:"clearInput",value:function(){this.getUI("input").typeahead("val",null)}},{key:"setInput",value:function(e){this.getUI("input").typeahead("val",e)}},{key:"onTypeaheadSelect",value:function(e,t){var n;e.preventDefault(),n="string"==typeof t?t:t.title||t.name||t.query,this.model.set(this.options.stickItProperty,n),this.parentChannel&&this.options.selectEvent&&this.parentChannel.trigger(this.options.selectEvent,t),this.onSubmit(e),this.toggleRemove()}},{key:"onSubmit",value:function(e){var t=this;if(e.preventDefault(),!this.isDestroyed()&&this.getTypeaheadActionOptions().clearOnSelect)return this.getUI("input").typeahead("close"),setTimeout((function(){t.model.clear(),t.clearInput()}),0),!1}},{key:"onClickRemove",value:function(){this.model.clear(),this.parentChannel.trigger(this.options.removeEvent,this.model),this.toggleRemove()}},{key:"getSources",value:function(){return o.isArray(this.options.typeaheadConfigs)?l.a.getSearchSources(this.options.typeaheadConfigs):l.a.getSearchSources([this.options.typeaheadConfigs])}},{key:"getTypeaheadOptions",value:function(){var e={minLength:1,highlight:!0};return this.options.typeaheadOptions?o.extend({},e,this.options.typeaheadOptions):e}},{key:"getTypeaheadActionOptions",value:function(){var e={clearOnSelect:!1};return o.isObject(this.options.actionOptions)?o.extend({},e,this.options.actionOptions):e}},{key:"bindOptionalCallbacks",value:function(){o.isObject(this.options.callbacks)&&(o.isFunction(this.options.callbacks.onRender)&&this.getUI("input").on("typeahead:render",o.bind(this.options.callbacks.onRender,this)),o.isFunction(this.options.callbacks.onInput)&&this.listenTo(this.model,"change:".concat(this.options.stickItProperty),this.options.callbacks.onInput),o.isFunction(this.options.callbacks.onBlur)&&this.getUI("input").on("blur",o.bind(this.options.callbacks.onBlur,this,this.channelName,this.options.stickItProperty)))}},{key:"initTypeahead",value:function(){this.getUI("input").typeahead(this.getTypeaheadOptions(),this.getSources())}},{key:"initTypeaheadListeners",value:function(){this.getUI("input").on("typeahead:select",o.bind(this.onTypeaheadSelect,this)),this.bindOptionalCallbacks()}},{key:"toggleRemove",value:function(){this.shouldShowRemove()?this.$el.find(".remove").show():this.$el.find(".remove").hide()}},{key:"shouldShowRemove",value:function(){return!!this.options.editable&&(!!this.options.forceShowRemoveButton||this.options.removeEvent&&!!this.model.get(this.options.stickItProperty))}},{key:"viewOptions",value:function(){return Object.assign(Object.assign({styles:h.a},this.options),{showRemove:this.shouldShowRemove(),svgRemove:s.a.getSvg(s.b.Close)})}},{key:"onRender",value:function(){var e=this;this.stickit(),this.initTypeahead(),this.initTypeaheadListeners(),r.Validation.bind(this),this.toggleRemove(),this.options.autofocus&&window.requestAnimationFrame((function(){e.getUI("input").focus()}))}},{key:"onClose",value:function(){this.getUI("input").off(),this.unstickit(),r.Validation.unbind(this)}}])&&y(t.prototype,n),c&&y(t,c),d}(i.a.Component)},1109:function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var o=n(6),r=n(2),i=n(16),a=n(1110),s=n.n(a),l=n(1111),u=n.n(l),c=n(0),f=n(1087);function p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function h(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=g(e);if(t){var r=g(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return m(this,n)}}function m(e,t){return!t||"object"!==p(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var b=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(l,e);var t,n,r,a=y(l);function l(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),a.call(this,e)}return t=l,(n=[{key:"name",get:function(){return"EditVideoTabsComponent"}},{key:"className",get:function(){return"bg-white"}},{key:"regions",value:function(){return{tabs:{el:".tabs-region",replaceElement:!0}}}},{key:"template",get:function(){return u.a}},{key:"appLinks",get:function(){var e,t,n,o=this.options.goBackTab.link;return e={},t=o.selector,n=o.appLink,t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},{key:"viewOptions",value:function(){var e=Object.assign(Object.assign({},this.options.goBackTab),{link:this.options.goBackTab.link.selector.replace(".","")});return{styles:s.a,backTab:e,backArrow:i.a.getSvg(i.b.ArrowLeft)}}},{key:"onSave",value:function(){o.Radio.channel(c.b.LIBRARY_EDITOR).trigger(c.a.LibraryEditor.SAVE_VIDEO)}},{key:"onRender",value:function(){this.showChildView("tabs",new f.a({tabs:this.options.tabs,activeTab:this.options.activeTab}))}}])&&h(t.prototype,n),r&&h(t,r),l}(r.a.Component)},1110:function(e,t,n){e.exports={svgContainer:"_27gR6"}},1111:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=e.lambda,s=e.escapeExpression;return'<div class="row">\r\n <h4>\r\n <a class="d-inline-flex align-items-center '+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.link:i,t))+" "+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.backTab:i)?i.link:i,t))+'">\r\n <span class="'+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+' d-inline-block mx-2">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.backArrow:i,t))?i:"")+"</span>\r\n "+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.backTab:i)?i.name:i,t))+'\r\n </a>\r\n </h4>\r\n</div>\r\n<div class="tabs-region pl-2"></div>'},useData:!0})},1123:function(e,t,n){"use strict";var o=n(2),r=n(6),i=n(1135),a=n.n(i),s=n(111),l=n(4),u=n(42),c=n(16),f=n(1124),p=n(1136),h=n.n(p),d=n(1137),y=n.n(d);function m(e){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function g(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=w(e);if(t){var r=w(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return k(this,n)}}function k(e,t){return!t||"object"!==m(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function w(e){return(w=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var C=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&b(e,t)}(i,e);var t,n,o,r=v(i);function i(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),r.call(this,e)}return t=i,(n=[{key:"name",get:function(){return"ResourceItemComponent"}},{key:"template",get:function(){return h.a}},{key:"className",get:function(){return"".concat(y.a.container," rounded p-2 mb-2")}},{key:"events",value:function(){return{"click .delete":"onClickDelete","click .edit":"onClickEdit"}}},{key:"appLinks",get:function(){return{".edit":this.options.getEditAppLink(this.model.get("id"))}}},{key:"onClickEdit",value:function(){var e=u.a.mergeOptions(this.options.analyticsOptions,{actionType:l.UserAction.Edit,entity:l.EntityType.Resource,workflowPhase:l.WorkflowPhase.Start}),t={id:this.model.get("id"),parentId:+this.options.videoId};u.a.logUserAction(t,e)}},{key:"onClickDelete",value:function(){s.a.isFunction(this.options.onClickDelete)&&this.options.onClickDelete(this.model)}},{key:"viewOptions",value:function(){var e=this.model.get("metadata"),t=e?e.type:"";return{editable:this.options.editable,extension:f.a.mapTypeToExtension(t),svg:c.a.getSvg(f.a.mapTypeToSvg(t)),iconClass:f.a.mapTypeToClass(t),resourceType:f.a.mapTypeToName(t),editSvg:c.a.getSvg(c.b.Edit),trashSvg:c.a.getSvg(c.b.Delete)}}}])&&g(t.prototype,n),o&&g(t,o),i}(o.a.Component),S=n(3),O=n(120),E=n(152),P=n(206);function x(e){return(x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function R(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function T(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function N(e,t,n){return t&&T(e.prototype,t),n&&T(e,n),e}function _(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&I(e,t)}function I(e,t){return(I=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=D(e);if(t){var r=D(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return L(this,n)}}function L(e,t){return!t||"object"!==x(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function D(e){return(D=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"b",(function(){return V})),n.d(t,"a",(function(){return U}));var V=function(e){_(n,e);var t=j(n);function n(e){return R(this,n),t.call(this,e)}return N(n,[{key:"name",get:function(){return"VideoResourcesComponentCollection"}},{key:"className",get:function(){return"mt-3"}},{key:"lang",get:function(){return"libraryEditor.videoResources"}},{key:"childView",get:function(){return C}},{key:"childViewOptions",get:function(){var e=this;return{editable:this.options.editable,videoId:this.options.videoId,analyticsOptions:this.options.analyticsOptions,onClickDelete:function(t){return e.onClickDelete(t)},getEditAppLink:function(t){return{application:O.a.LIBRARY_EDITOR,action:E.a.LibraryEditor.EDIT_RESOURCE,args:[e.options.videoId,t]}}}}},{key:"onClickDelete",value:function(e){var t=this;new P.a({title:S.a.getPhrase(this.lang,"removeHeading"),text:S.a.getPhrase(this.lang,"removeBody",{resourceName:e.get("name")}),buttons:[{text:S.a.getPhrase(this.lang,"remove"),className:"btn btn-danger",success:!0},{text:S.a.getPhrase(this.lang,"cancel"),className:"btn btn-secondary",close:!0}],channelName:"".concat(this.name).concat(this.cid)}).render().done((function(){r.Radio.channel(t.options.channelName).trigger("delete:resource",e.get("id"))}))}}]),n}(o.a.ComponentCollection),U=function(e){_(n,e);var t=j(n);function n(e){return R(this,n),t.call(this,e)}return N(n,[{key:"name",get:function(){return"VideoResourcesComponent"}},{key:"template",get:function(){return a.a}},{key:"lang",get:function(){return"libraryEditor.videoResources"}},{key:"channelName",get:function(){return"".concat(this.name).concat(this.cid)}},{key:"className",get:function(){return this.options.customCollection?"":"py-3 border-top"}},{key:"regions",value:function(){return{resources:{replaceElement:!0,el:".resource-list-region"}}}},{key:"renderResources",value:function(){var e=new V({collection:this.options.customCollection||this.model.resources,editable:this.options.editable||!1,videoId:this.options.videoId||this.model.get("id"),channelName:this.options.parentChannelName||this.channelName});this.showChildView("resources",e)}},{key:"viewOptions",value:function(){return{resourcesHeadingText:this.options.headerText||S.a.getPhrase(this.lang,"heading"),emptyStateText:this.options.emptyStateText}}},{key:"onRender",value:function(){this.renderResources()}}]),n}(o.a.Component)},1124:function(e,t,n){"use strict";var o,r=n(3),i=n(16),a=n(62);function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e){e.Pdf="pdf",e.Image="image",e.PowerPoint="powerpoint",e.Document="document",e.Excel="excel",e.Zip="archive",e.File="text"}(o||(o={})),n.d(t,"a",(function(){return u}));var l="shared.shared-utils",u={mapRatingToClass:function(e){if(!e)return"";return function(e){switch(!0){case e<32:return"bg-purple";case e<48:return"bg-green";case e<80:return"bg-info";case e<96:return"bg-red";case e<128:return"bg-pink";case e>=128:return"bg-yellow";default:return""}}(e)},mapSourceToDisplayName:function(e){switch(e.type){case a.a.HostedLibrary:case a.a.CustomLibrary:return e.name;case a.a.Exchange:return r.a.getPhrase(l,"exchange");case a.a.Workspace:return r.a.getPhrase(l,"workspace");default:return""}},mapSourceToClass:function(e){switch(e){case a.a.HostedLibrary:case a.a.CustomLibrary:return"bg-info";case a.a.Exchange:return"bg-green";case a.a.Workspace:default:return"bg-red"}},isInteractive:function(e){var t,n;return!!(null===(n=null===(t=null==e?void 0:e.interactives)||void 0===t?void 0:t.data)||void 0===n?void 0:n.length)},mapTypeToSvg:function(e){var t,n=(s(t={},o.Pdf,i.b.FilePDF),s(t,o.Image,i.b.FileImg),s(t,o.PowerPoint,i.b.FilePowerpoint),s(t,o.Document,i.b.FileWord),s(t,o.Excel,i.b.FileExcel),s(t,o.Zip,i.b.FileZip),s(t,o.File,i.b.File),t)[e];return n||(n=i.b.Folder),n},mapTypeToClass:function(e){switch(e){case o.Pdf:return"icon-red";case o.Image:return"icon-purple";case o.Document:return"icon-blue";case o.Excel:return"icon-green";case o.PowerPoint:return"icon-orange";case o.Zip:return"icon-teal";case o.File:return"icon-gray";default:return""}},mapTypeToExtension:function(e){if(!e)return"";return{pdf:"pdf",image:"png",powerpoint:"pptx"}[e.toLowerCase()]},mapTypeToName:function(e){if(!e)return"";switch(e){case o.Pdf:return r.a.getPhrase(l,"pdf");case o.Image:return r.a.getPhrase(l,"image");case o.Document:return r.a.getPhrase(l,"document");case o.Excel:return r.a.getPhrase(l,"spreadsheet");case o.PowerPoint:return r.a.getPhrase(l,"presentation");case o.Zip:return r.a.getPhrase(l,"zipArchive");case o.File:return r.a.getPhrase(l,"file");default:return""}}}},1135:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r){var i;e.propertyIsEnumerable;return"<p>"+e.escapeExpression(e.lambda(null!=(i=null!=t?t.options:t)?i.emptyStateText:i,t))+"</p>"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){var i;e.propertyIsEnumerable;return"<h5>"+e.escapeExpression(e.lambda(null!=(i=null!=t?t.options:t)?i.resourcesHeadingText:i,t))+"</h5>\r\n"+(null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.emptyStateText:i,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r}))?i:"")+'\r\n<div class="resource-list-region"></div>'},useData:!0})},1136:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=e.lambda;return'<a class="float-right svg-container cursor-pointer text-muted delete">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.trashSvg:i,t))?i:"")+'</a>\r\n<a class="float-right svg-container cursor-pointer text-muted edit">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.editSvg:i,t))?i:"")+"</a>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a,s=e.lambda,l=e.escapeExpression,u=null!=t?t:e.nullContext||{},c=e.hooks.helperMissing;return'<span title="'+l(s(null!=(i=null!=t?t.options:t)?i.resourceType:i,t))+'" class="d-inline-block align-middle mr-2 svg-container '+l(s(null!=(i=null!=t?t.options:t)?i.iconClass:i,t))+'">'+(null!=(i=s(null!=(i=null!=t?t.options:t)?i.svg:i,t))?i:"")+'</span>\r\n<a href="'+l("function"==typeof(a=null!=(a=n.url||(null!=t?t.url:t))?a:c)?a.call(u,{name:"url",hash:{},data:r}):a)+"?name="+l("function"==typeof(a=null!=(a=n.name||(null!=t?t.name:t))?a:c)?a.call(u,{name:"name",hash:{},data:r}):a)+'" class="align-middle">\r\n '+l("function"==typeof(a=null!=(a=n.name||(null!=t?t.name:t))?a:c)?a.call(u,{name:"name",hash:{},data:r}):a)+"\r\n</a>\r\n"+(null!=(i=n.if.call(u,null!=(i=null!=t?t.options:t)?i.editable:i,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r}))?i:"")},useData:!0})},1137:function(e,t,n){e.exports={container:"f6lVD"}},1142:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=e.lambda,s=e.escapeExpression;return'<a class="float-right '+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+" "+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.actionSvg:i,t))+' text-muted delete">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.trashSvg:i,t))?i:"")+'</a>\r\n<a class="float-right '+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+" "+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.actionSvg:i,t))+' text-muted edit">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.editSvg:i,t))?i:"")+"</a>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a,s=e.lambda,l=e.escapeExpression,u=null!=t?t:e.nullContext||{},c=e.hooks.helperMissing;return'<span class="d-inline-block align-middle mr-2 icon-blue '+l(s(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+'">'+(null!=(i=s(null!=(i=null!=t?t.options:t)?i.linkSvg:i,t))?i:"")+'</span>\r\n<a href="'+l("function"==typeof(a=null!=(a=n.url||(null!=t?t.url:t))?a:c)?a.call(u,{name:"url",hash:{},data:r}):a)+'" target="_blank" class="align-middle">\r\n '+l("function"==typeof(a=null!=(a=n.name||(null!=t?t.name:t))?a:c)?a.call(u,{name:"name",hash:{},data:r}):a)+"\r\n</a>\r\n"+(null!=(i=n.if.call(u,null!=(i=null!=t?t.options:t)?i.editable:i,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r}))?i:"")},useData:!0})},1143:function(e,t,n){e.exports={container:"_3Qewt",svgContainer:"_3T40U",actionSvg:"_3FRzz"}},1144:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r){var i;e.propertyIsEnumerable;return"<p>"+e.escapeExpression(e.lambda(null!=(i=null!=t?t.options:t)?i.emptyStateText:i,t))+"</p>"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){var i;e.propertyIsEnumerable;return"<h5>"+e.escapeExpression(e.lambda(null!=(i=null!=t?t.options:t)?i.headingText:i,t))+"</h5>\r\n"+(null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.emptyStateText:i,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r}))?i:"")+'\r\n<div class="links-region"></div>'},useData:!0})},1148:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r){var i;e.propertyIsEnumerable;return e.escapeExpression(e.lambda(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.disabled:i,t))},3:function(e,t,n,o,r){return"autofocus"},5:function(e,t,n,o,r){return"disabled"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=e.lambda,s=e.escapeExpression,l=null!=t?t:e.nullContext||{};return'<input\r\n name="'+s(a(null!=(i=null!=t?t.options:t)?i.inputName:i,t))+'"\r\n type="text"\r\n class="form-control '+(null!=(i=n.unless.call(l,null!=(i=null!=t?t.options:t)?i.editable:i,{name:"unless",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r}))?i:"")+" "+s(a(null!=(i=null!=t?t.options:t)?i.additionalClasses:i,t))+'"\r\n id="'+s(a(null!=(i=null!=t?t.options:t)?i.inputId:i,t))+'"\r\n autocomplete="off"\r\n placeholder="'+s(a(null!=(i=null!=t?t.options:t)?i.placeholderText:i,t))+'"\r\n '+(null!=(i=n.if.call(l,null!=(i=null!=t?t.options:t)?i.autofocus:i,{name:"if",hash:{},fn:e.program(3,r,0),inverse:e.noop,data:r}))?i:"")+"\r\n "+(null!=(i=n.unless.call(l,null!=(i=null!=t?t.options:t)?i.editable:i,{name:"unless",hash:{},fn:e.program(5,r,0),inverse:e.noop,data:r}))?i:"")+'\r\n></input>\r\n<span class="svg-container mb-2 '+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svg:i,t))+' remove" style="display: none;">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.svgRemove:i,t))?i:"")+"</span>"},useData:!0})},1149:function(e,t,n){e.exports={svg:"_1iL3O",typeaheadContainer:"_1SWXc",disabled:"_3C2O8"}},1150:function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var o=n(2),r=n(264),i=n(13),a=n(3),s=n(304),l=n(199),u=n(1151),c=n.n(u),f=n(1152),p=n.n(f);function h(e){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function y(e,t){return(y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=b(e);if(t){var r=b(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return g(this,n)}}function g(e,t){return!t||"object"!==h(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var v=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&y(e,t)}(h,e);var t,n,u,f=m(h);function h(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,h),f.call(this,e)}return t=h,(n=[{key:"initialize",value:function(){this.spinnerModel=new o.a.Model({showSpinner:this.isProcessing()}),this.listenTo(this.options.channelName,l.LibraryEditorActions.MergeChapters,this.onClickMergeChapters)}},{key:"name",get:function(){return"ConcatenateRequestComponent"}},{key:"template",get:function(){return c.a}},{key:"lang",get:function(){return"libraryEditor.concatenateRequest"}},{key:"className",get:function(){return"mt-3"}},{key:"regions",value:function(){return{button:{el:".btn-region",replaceElement:!0}}}},{key:"onClickMergeChapters",value:function(){this.spinnerModel.set(r.c.ShowSpinner,!0),this.render()}},{key:"isProcessing",value:function(){return!(!this.model||!this.model.get("status")||this.model.get("status")!==s.a.New&&this.model.get("status")!==s.a.Concatenating)}},{key:"renderButton",value:function(){var e={chapters:a.a.getPhrase(this.lang,"mergeChapters"),subtitles:a.a.getPhrase(this.lang,"mergeChapters"),clickViewSubtitles:a.a.getPhrase(this.lang,"enabledCustomSubtitles")},t=new r.a({buttonText:e[this.options.type],extraButtonClass:"btn-primary ".concat(p.a.btn),model:this.spinnerModel,spinnerOptions:{size:i.s.Small,type:i.t.Light,extraClasses:"mx-auto"},channelName:this.options.channelName,saveEvent:l.LibraryEditorActions.MergeChapters});this.showChildView("button",t)}},{key:"viewOptions",value:function(){var e={chapters:{heading:a.a.getPhrase(this.lang,"chaptersHeading"),line1:a.a.getPhrase(this.lang,"chaptersInfo1"),line2:a.a.getPhrase(this.lang,"chaptersInfo2")},subtitles:{heading:a.a.getPhrase(this.lang,"subtitlesHeading"),line1:a.a.getPhrase(this.lang,"subtitlesInfo1"),line2:a.a.getPhrase(this.lang,"subtitlesInfo2")},clickViewSubtitles:{heading:a.a.getPhrase(this.lang,"cvSubtitlesHeading"),line1:a.a.getPhrase(this.lang,"cvSubtitlesInfo1"),line2:a.a.getPhrase(this.lang,"cvSubtitlesInfo2")}};return{progress:this.model&&this.model.get("progress")&&a.a.getPhrase(this.lang,"progress",{progress:this.model.get("progress")}),componentOptions:e[this.options.type],processing:this.spinnerModel.get(r.c.ShowSpinner),failed:this.model&&this.model.get("status")&&this.model.get("status")===s.a.ConcatenationFailed}}},{key:"onRender",value:function(){this.renderButton()}}])&&d(t.prototype,n),u&&d(t,u),h}(o.a.Component)},1151:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r){var i;e.propertyIsEnumerable;return null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.progress:i,{name:"if",hash:{},fn:e.program(2,r,0),inverse:e.noop,data:r}))?i:""},2:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=e.escapeExpression;return' <span class="m-3 text-muted">'+a(e.lambda(null!=(i=null!=t?t.options:t)?i.progress:i,t))+'</span>\r\n <p class="pt-2">'+a((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"processing",{name:"lang",hash:{},data:r}))+"</p>\r\n"},4:function(e,t,n,o,r){var i;e.propertyIsEnumerable;return null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.failed:i,{name:"if",hash:{},fn:e.program(5,r,0),inverse:e.noop,data:r}))?i:""},5:function(e,t,n,o,r){e.propertyIsEnumerable;return'<p class="pt-2 text-danger">'+e.escapeExpression((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"failed",{name:"lang",hash:{},data:r}))+"</p>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=e.lambda,s=e.escapeExpression;return"<h4>"+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.componentOptions:i)?i.heading:i,t))+"</h4>\r\n<p>"+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.componentOptions:i)?i.line1:i,t))+"</p>\r\n<p>"+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.componentOptions:i)?i.line2:i,t))+'</p>\r\n<div class="btn-region"></div>\r\n'+(null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.processing:i,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.program(4,r,0),data:r}))?i:"")},useData:!0})},1152:function(e,t,n){e.exports={btn:"_59zg9"}},1188:function(e,t,n){"use strict";var o=n(2),r=n(6),i=n(16),a=n(4),s=n(42),l=n(13),u=n(0),c=n(1142),f=n.n(c),p=n(1143),h=n.n(p),d=n(3);function y(e){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function m(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function b(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=k(e);if(t){var r=k(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return v(this,n)}}function v(e,t){return!t||"object"!==y(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function k(e){return(k=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var w=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&g(e,t)}(p,e);var t,n,o,c=b(p);function p(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,p),c.call(this,e)}return t=p,(n=[{key:"name",get:function(){return"LinkItemComponent"}},{key:"template",get:function(){return f.a}},{key:"className",get:function(){return"".concat(h.a.container," rounded p-2 mb-2")}},{key:"lang",get:function(){return"libraryEditor.editLinks"}},{key:"events",value:function(){return{"click .delete":"onClickDelete","click .edit":"onClickEdit"}}},{key:"appLinks",get:function(){return{".edit":{application:u.b.LIBRARY_EDITOR,action:u.a.LibraryEditor.EDIT_LINK,args:[this.options.videoId,this.model.get("id")]}}}},{key:"onClickEdit",value:function(){var e=s.a.mergeOptions(this.options.analyticsOptions,{actionType:a.UserAction.Edit,entity:a.EntityType.Resource,workflowPhase:a.WorkflowPhase.Start}),t={id:this.model.get("id"),parentId:+this.options.videoId};s.a.logUserAction(t,e)}},{key:"onClickDelete",value:function(){var e=this;new l.d({title:d.a.getPhrase(this.lang,"removeHeading"),text:d.a.getPhrase(this.lang,"removeConfirm",{name:l.w.escapeExpression(this.model.get("name"))}),buttons:[{text:d.a.getPhrase(this.lang,"remove"),className:"btn btn-danger",success:!0},{text:d.a.getPhrase(this.lang,"cancel"),className:"btn btn-secondary",close:!0}],channelName:l.k.generateUniqueChannelName(this)}).render().done((function(){r.Radio.channel(e.options.channelName).trigger("delete:link",e.model.get("id"))}))}},{key:"viewOptions",value:function(){return{styles:h.a,editable:this.options.editable,linkSvg:i.a.getSvg(i.b.Link),editSvg:i.a.getSvg(i.b.Edit),trashSvg:i.a.getSvg(i.b.Delete)}}}])&&m(t.prototype,n),o&&m(t,o),p}(o.a.Component),C=n(1144),S=n.n(C);function O(e){return(O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function E(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function P(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function x(e,t,n){return t&&P(e.prototype,t),n&&P(e,n),e}function R(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&T(e,t)}function T(e,t){return(T=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function N(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=I(e);if(t){var r=I(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return _(this,n)}}function _(e,t){return!t||"object"!==O(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function I(e){return(I=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return j}));var j=function(e){R(n,e);var t=N(n);function n(e){return E(this,n),t.call(this,e)}return x(n,[{key:"name",get:function(){return"VideoLinksComponent"}},{key:"template",get:function(){return S.a}},{key:"className",get:function(){return this.options.customCollection?"":"py-3 border-top"}},{key:"regions",value:function(){return{links:{el:".links-region",replaceElement:!0}}}},{key:"viewOptions",value:function(){return this.options}},{key:"onRender",value:function(){this.showChildView("links",new L({collection:this.options.customCollection||this.model.get("links"),channelName:this.options.channelName,analyticsOptions:this.options.analyticsOptions,editable:this.options.editable,videoId:this.options.videoId,headingText:this.options.headingText,emptyStateText:this.options.emptyStateText}))}}]),n}(o.a.Component),L=function(e){R(n,e);var t=N(n);function n(e){return E(this,n),t.call(this,e)}return x(n,[{key:"name",get:function(){return"LinkItemComponentCollection"}},{key:"childViewOptions",get:function(){return this.options}},{key:"childView",get:function(){return w}}]),n}(o.a.ComponentCollection)},1279:function(e,t,n){e.exports={fileDrop:"_3-Sp5",dropMask:"TuDHp",dragOver:"_3Dz1H"}},1280:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a,s=e.escapeExpression;return'<div class="'+s("function"==typeof(a=null!=(a=n.dropMask||(null!=t?t.dropMask:t))?a:e.hooks.helperMissing)?a.call(null!=t?t:e.nullContext||{},{name:"dropMask",hash:{},data:r}):a)+'">\r\n <h3>'+s(e.lambda(null!=(i=null!=t?t.options:t)?i.fileDropText:i,t))+"</h3>\r\n</div>"},useData:!0})},1281:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r){var i;e.propertyIsEnumerable;return'<p class="alert alert-warning mb-0">'+e.escapeExpression(e.lambda(null!=(i=null!=t?t.options:t)?i.limitText:i,t))+"</p>\r\n"},3:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=e.lambda,s=e.escapeExpression,l=null!=t?t:e.nullContext||{};return'<div class="file-drop '+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.fileDrop:i,t))+" p-2"+(null!=(i=n.if.call(l,null!=(i=null!=t?t.options:t)?i.limitText:i,{name:"if",hash:{},fn:e.program(4,r,0),inverse:e.noop,data:r}))?i:"")+'">\r\n <button class="browse btn btn-light mr-2">'+s((n.lang||t&&t.lang||e.hooks.helperMissing).call(l,"browse",{name:"lang",hash:{},data:r}))+'</button>\r\n <span class="text-muted align-middle">'+s(a(null!=(i=null!=t?t.options:t)?i.alternateText:i,t))+"</span>\r\n</div>\r\n"},4:function(e,t,n,o,r){return" col-6 "},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=e.lambda;return"<h5>"+e.escapeExpression(a(null!=(i=null!=t?t.options:t)?i.title:i,t))+"</h5>\r\n<p>"+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.description:i,t))?i:"")+"</p>\r\n"+(null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.limitText:i,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.program(3,r,0),data:r}))?i:"")},useData:!0})},1282:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=e.lambda;return'<span class="d-inline-block align-middle mr-2 '+e.escapeExpression(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+' float-right text-success">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.tickSvg:i,t))?i:"")+"</span>\r\n"},3:function(e,t,n,o,r){var i;e.propertyIsEnumerable;return'<span class="d-inline-block align-middle mr-2 '+e.escapeExpression(e.lambda(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+' cursor-pointer cancel-upload close float-right">×</span>\r\n'},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a,s=e.lambda,l=e.escapeExpression,u=null!=t?t:e.nullContext||{},c=e.hooks.helperMissing;return'<span class="d-inline-block align-middle mr-2 '+l(s(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+'">'+(null!=(i=s(null!=(i=null!=t?t.options:t)?i.svg:i,t))?i:"")+'</span>\r\n<span class="align-middle">\r\n '+l("function"==typeof(a=null!=(a=n.name||(null!=t?t.name:t))?a:c)?a.call(u,{name:"name",hash:{},data:r}):a)+"\r\n</span>\r\n"+(null!=(i=n.if.call(u,null!=(i=null!=t?t.options:t)?i.finished:i,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.program(3,r,0),data:r}))?i:"")+'\r\n<div class="progress my-2 '+l(s(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.progress:i,t))+' mt-2">\r\n <div class="progress-bar bg-info" style="width: '+l("function"==typeof(a=null!=(a=n.progress||(null!=t?t.progress:t))?a:c)?a.call(u,{name:"progress",hash:{},data:r}):a)+'%" aria-valuenow="'+l("function"==typeof(a=null!=(a=n.progress||(null!=t?t.progress:t))?a:c)?a.call(u,{name:"progress",hash:{},data:r}):a)+'" aria-valuemin="0" aria-valuemax="100"></div>\r\n</div>'},useData:!0})},1283:function(e,t,n){e.exports={svgContainer:"QNFLR",progress:"_1q_ig"}},1284:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;return'<form>\r\n <div class="form-group">\r\n <label for="language">'+e.escapeExpression((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"label",{name:"lang",hash:{},data:r}))+'</label>\r\n <div class="typahead-region"></div>\r\n </div>\r\n</form>'},useData:!0})},1285:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=e.lambda,s=e.escapeExpression;return'<a class="float-right '+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+" "+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.actionSvg:i,t))+' text-muted delete">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.trashSvg:i,t))?i:"")+"</a>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a,s=e.lambda,l=e.escapeExpression,u=null!=t?t:e.nullContext||{};return'<span class="d-inline-block align-middle mr-2 '+l(s(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+'">'+(null!=(i=s(null!=(i=null!=t?t.options:t)?i.svg:i,t))?i:"")+'</span>\r\n<a href="'+l("function"==typeof(a=null!=(a=n.url||(null!=t?t.url:t))?a:e.hooks.helperMissing)?a.call(u,{name:"url",hash:{},data:r}):a)+"?name="+l(s(null!=(i=null!=t?t.options:t)?i.name:i,t))+'" class="align-middle">\r\n '+l(s(null!=(i=null!=t?t.options:t)?i.name:i,t))+"\r\n</a>\r\n"+(null!=(i=n.unless.call(u,null!=(i=null!=t?t.options:t)?i.isClickViewContent:i,{name:"unless",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r}))?i:"")},useData:!0})},1286:function(e,t,n){e.exports={container:"_2GdEa",svgContainer:"_186X3",actionSvg:"_3_l1b"}},1287:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r){var i;e.propertyIsEnumerable;return e.escapeExpression(e.lambda(null!=(i=null!=t?t.options:t)?i.emptyStateText:i,t))},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){var i;e.propertyIsEnumerable;return"<h5>"+e.escapeExpression(e.lambda(null!=(i=null!=t?t.options:t)?i.headerText:i,t))+"</h5>\r\n"+(null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.emptyStateText:i,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r}))?i:"")+'\r\n<div class="subtitles-list-region"></div>'},useData:!0})},1288:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r){var i;e.propertyIsEnumerable;return'<p class="alert alert-warning col-8">'+e.escapeExpression((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"limit",{name:"lang",hash:{limit:null!=(i=null!=t?t.options:t)?i.limit:i},data:r}))+"</p>\r\n"},3:function(e,t,n,o,r){e.propertyIsEnumerable;var i=null!=t?t:e.nullContext||{},a=e.hooks.helperMissing,s=e.escapeExpression;return"<p>"+s((n.lang||t&&t.lang||a).call(i,"subheading",{name:"lang",hash:{},data:r}))+'</p>\r\n<div class="form-group mb-1">\r\n <label for="url">'+s((n.lang||t&&t.lang||a).call(i,"urlLabel",{name:"lang",hash:{},data:r}))+'</label>\r\n <input name="url" id="url" class="form-control" type="text" placeholder="'+s((n.lang||t&&t.lang||a).call(i,"urlPlaceholder",{name:"lang",hash:{},data:r}))+'">\r\n <div class="form-feedback"></div>\r\n</div>\r\n<div class="form-group mb-1" id="name-container" style="display: none;">\r\n <input type="text" class="form-control" name="name" placeholder="'+s((n.lang||t&&t.lang||a).call(i,"namePlaceholder",{name:"lang",hash:{},data:r}))+'">\r\n <div class="form-feedback"></div>\r\n</div>\r\n<div class="attach-btn-region"></div>\r\n'},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){var i;e.propertyIsEnumerable;return'<h5 class="pt-2">Resource Links</h5>\r\n'+(null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.hide:i,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.program(3,r,0),data:r}))?i:"")},useData:!0})},1289:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r){return"col-5"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=null!=t?t:e.nullContext||{};return'<div class="tab-region"></div>\r\n\r\n<div class="row py-3">\r\n <div class="'+(null!=(i=n.if.call(a,null!=(i=null!=t?t.options:t)?i.isClickViewContent:i,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r}))?i:"")+'">\r\n <div class="clickview-subtitles-list-region"></div>\r\n </div>\r\n <div class="col-7">\r\n <div class="subtitles-upload-region"></div>\r\n <div class="subtitles-upload-list-region p-0 col-8"></div>\r\n <div class="customer-subtitles-list-region p-0 col-8"></div>\r\n </div>\r\n</div>\r\n\r\n<div class="row border-top py-3">\r\n <div class="'+(null!=(i=n.if.call(a,null!=(i=null!=t?t.options:t)?i.isClickViewContent:i,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r}))?i:"")+'">\r\n <div class="clickview-resources-list-region"></div>\r\n </div>\r\n <div class="col-7">\r\n <div class="resources-upload-region"></div>\r\n <div class="resources-upload-list-region p-0 col-8"></div>\r\n <div class="customer-resources-list-region p-0 col-8"></div>\r\n </div>\r\n</div>\r\n\r\n<div class="row border-top py-3">\r\n <div class="'+(null!=(i=n.if.call(a,null!=(i=null!=t?t.options:t)?i.isClickViewContent:i,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r}))?i:"")+'">\r\n <div class="clickview-link-list-region"></div>\r\n </div>\r\n <div class="col-7">\r\n <div class="add-links-region mb-2"></div>\r\n <div class="customer-link-list-region p-0 col-8"></div>\r\n </div>\r\n</div>'},useData:!0})},1457:function(e,t,n){"use strict";n.r(t);var o=n(1),r=n(6),i=n(2),a=n(5),s=n(3),l=n(15),u=n(121),c=n(323),f=n(44),p=n(188),h=n(315),d=n(686),y=n(1279),m=n.n(y),g=n(1280),b=n.n(g),v=n(1281),k=n.n(v);function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function C(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function S(e,t){return(S=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function O(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=P(e);if(t){var r=P(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return E(this,n)}}function E(e,t){return!t||"object"!==w(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function P(e){return(P=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var x=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&S(e,t)}(i,e);var t,n,o,r=O(i);function i(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),r.call(this,e)}return t=i,(n=[{key:"name",get:function(){return"FileSelectComponent"}},{key:"template",get:function(){return k.a}},{key:"lang",get:function(){return"shared._fileSelect"}},{key:"elements",get:function(){return{dropArea:".file-drop"}}},{key:"defaults",get:function(){return{acceptMultiple:!0}}},{key:"behaviors",get:function(){return[{behaviorClass:h.a,buttonSelector:".browse",channelName:this.options.channelName,acceptMultiple:this.options.acceptMultiple,mimeType:this.options.mimeType},{behaviorClass:d.a,channelName:this.options.channelName,acceptMultiple:this.options.acceptMultiple}]}},{key:"events",value:function(){var e,t,n,o="dragleave .".concat(m.a.dropMask);return n="onDragLeave",(t=o)in(e={"drop .file-drop":"onDrop","dragover .file-drop":"onDragOver"})?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},{key:"onDrop",value:function(){this.$el.removeClass(m.a.dragOver)}},{key:"onDragOver",value:function(e){this.$el.addClass(m.a.dragOver),e.preventDefault()}},{key:"onDragLeave",value:function(){this.$el.removeClass(m.a.dragOver)}},{key:"viewOptions",value:function(){return Object.assign(Object.assign({},this.options),{styles:m.a,limitText:this.options.limitText,isClickViewContent:this.options.isClickViewContent})}},{key:"onRender",value:function(){this.getUI("dropArea").append(b()({dropMask:m.a.dropMask,fileDropText:s.a.getPhrase(this.lang,"drop")}))}}])&&C(t.prototype,n),o&&C(t,o),i}(i.a.Component),R=n(0),T=n(13),N=n(184),_=n(9),I=n(303),j=n(144),L=n(1123),D=n(1150),V=n(16),U=n(1282),B=n.n(U),F=n(1283),M=n.n(F),A=n(111);function q(e){return(q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function H(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function z(e,t){return(z=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function J(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=Y(e);if(t){var r=Y(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return W(this,n)}}function W(e,t){return!t||"object"!==q(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Y(e){return(Y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Z=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&z(e,t)}(i,e);var t,n,o,r=J(i);function i(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),r.call(this,e)}return t=i,(n=[{key:"initialize",value:function(){this.listenTo(this.model,"change:progress",this.render)}},{key:"name",get:function(){return"FileUploadComponent"}},{key:"template",get:function(){return B.a}},{key:"events",value:function(){return{"click .cancel-upload":"onClickCancelUpload"}}},{key:"onClickCancelUpload",value:function(){A.a.isFunction(this.options.onClickCancelUpload)&&this.options.onClickCancelUpload(this.model.get("id"))}},{key:"viewOptions",value:function(){return{styles:M.a,svg:V.a.getSvg(V.b.Folder),tickSvg:V.a.getSvg(V.b.Check),finished:this.model.get("progress")>=100}}}])&&H(t.prototype,n),o&&H(t,o),i}(i.a.Component);function Q(e){return(Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function X(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function G(e,t){return(G=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function K(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=te(e);if(t){var r=te(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return ee(this,n)}}function ee(e,t){return!t||"object"!==Q(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function te(e){return(te=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ne=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&G(e,t)}(a,e);var t,n,o,i=K(a);function a(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.call(this,e)}return t=a,(n=[{key:"name",get:function(){return"FileUploadsComponentCollection"}},{key:"childView",get:function(){return Z}},{key:"childViewOptions",get:function(){var e=this;return{onClickCancelUpload:function(t){r.Radio.channel(e.options.channelName).trigger("cancel:upload",t)}}}}])&&X(t.prototype,n),o&&X(t,o),a}(i.a.ComponentCollection),oe=n(30),re=n(1097),ie=n(140),ae={handleQuery:function(){return function(e,t){var n=[];if(e){var r=CVLanguages.getEnglishNameContains(e);return o.each(r,(function(e,t){n.push({key:t,name:e.englishName})})),t(n)}t()}},getTypeaheadConfig:function(){return function(){return{name:"languages",source:ae.handleQuery(),limit:5,display:function(e){return e.name},templates:{suggestion:ie.d,pending:ie.b,notFound:ie.c}}}}},se=n(1284),le=n.n(se);function ue(e){return(ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ce(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function fe(e,t){return(fe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function pe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=de(e);if(t){var r=de(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return he(this,n)}}function he(e,t){return!t||"object"!==ue(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function de(e){return(de=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ye=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&fe(e,t)}(i,e);var t,n,o,r=pe(i);function i(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),r.call(this,e)}return t=i,(n=[{key:"initialize",value:function(e){this.model=oe.a.get("subtitle:language",e.defaultLanguage),this.model.addValidation(T.u),this.listenTo(this.channelName,"select:language",this.onLanguageSelected)}},{key:"template",get:function(){return le.a}},{key:"name",get:function(){return"LanguageSelectComponent"}},{key:"lang",get:function(){return"libraryEditor.languageSelect"}},{key:"events",value:function(){return{"click .submit":"onClickSubmit",submit:"onClickSubmit"}}},{key:"behaviors",get:function(){return[{behaviorClass:I.e,title:s.a.getPhrase(this.lang,"heading"),buttons:[{text:s.a.getPhrase(this.lang,"submit"),type:"submit",className:"btn btn-primary submit"}]},{behaviorClass:I.a}]}},{key:"regions",value:function(){return{typeahead:".typahead-region"}}},{key:"channelName",get:function(){return"".concat(this.name).concat(this.cid)}},{key:"getTypeaheadConfigs",value:function(){return[{name:"languages",typeaheadConfig:ae.getTypeaheadConfig()}]}},{key:"renderTypeahead",value:function(){this.showChildView("typeahead",new re.a({model:this.model,parentChannelName:this.channelName,inputId:"language",selectEvent:"select:language",typeaheadConfigs:this.getTypeaheadConfigs()}))}},{key:"onLanguageSelected",value:function(e){this.model.set("code",e.key)}},{key:"onClickSubmit",value:function(){this.model.validate(),this.model.isValid()&&(this.options.promise.resolve(this.model.toJSON()),this.triggerMethod("hide"))}},{key:"onBeforeDestroy",value:function(){"pending"===this.options.promise.state()&&this.options.promise.reject()}},{key:"onRender",value:function(){this.renderTypeahead()}}])&&ce(t.prototype,n),o&&ce(t,o),i}(i.a.Component),me=n(1109),ge=n(1124),be=function(e,t){var n,o,r=e.language;return o=(null==t?void 0:t.filter((function(e){return e.language!==r}))).length>0?CVLanguages.getFullEnglishName(r):CVLanguages.getEnglishName(r),(null===(n=e.metadata)||void 0===n?void 0:n.autoGenerated)?s.a.getPhrase("shared.shared-utils","autoGeneratedSubtitle",{name:o}):o},ve=n(1285),ke=n.n(ve),we=n(1286),Ce=n.n(we);function Se(e){return(Se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Oe(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Ee(e,t){return(Ee=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Pe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=Re(e);if(t){var r=Re(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return xe(this,n)}}function xe(e,t){return!t||"object"!==Se(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Re(e){return(Re=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Te=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ee(e,t)}(i,e);var t,n,o,r=Pe(i);function i(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),r.call(this,e)}return t=i,(n=[{key:"name",get:function(){return"SubtitleItemComponent"}},{key:"template",get:function(){return ke.a}},{key:"className",get:function(){return"".concat(Ce.a.container," rounded p-2 mb-2")}},{key:"events",value:function(){return{"click .delete":"onClickDelete"}}},{key:"getEnglishName",value:function(){return be(this.model.toJSON(),this.model.collection.toJSON())}},{key:"onClickDelete",value:function(){!this.options.isClickViewContent&&A.a.isFunction(this.options.onClickDelete)&&this.options.onClickDelete(this.model)}},{key:"viewOptions",value:function(){return{styles:Ce.a,svg:V.a.getSvg(ge.a.mapTypeToSvg("subtitle")),trashSvg:V.a.getSvg(V.b.Delete),name:this.getEnglishName(),isClickViewContent:this.options.isClickViewContent}}}])&&Oe(t.prototype,n),o&&Oe(t,o),i}(i.a.Component),Ne=n(206),_e=n(1287),Ie=n.n(_e);function je(e){return(je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Le(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function De(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Ve(e,t,n){return t&&De(e.prototype,t),n&&De(e,n),e}function Ue(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Be(e,t)}function Be(e,t){return(Be=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Fe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=Ae(e);if(t){var r=Ae(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return Me(this,n)}}function Me(e,t){return!t||"object"!==je(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ae(e){return(Ae=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var qe=function(e){Ue(n,e);var t=Fe(n);function n(e){return Le(this,n),t.call(this,e)}return Ve(n,[{key:"name",get:function(){return"VideoSubtitlesComponent"}},{key:"template",get:function(){return Ie.a}},{key:"regions",value:function(){return{subtitles:{el:".subtitles-list-region",replaceElement:!0}}}},{key:"viewOptions",value:function(){return{headerText:this.options.headerText,emptyStateText:this.options.emptyStateText}}},{key:"onRender",value:function(){this.showChildView("subtitles",new He({collection:this.collection,channelName:this.options.channelName,isClickViewContent:this.options.isClickViewContent}))}}]),n}(i.a.Component),He=function(e){Ue(n,e);var t=Fe(n);function n(e){return Le(this,n),t.call(this,e)}return Ve(n,[{key:"name",get:function(){return"VideoSubtitlesComponentCollection"}},{key:"lang",get:function(){return"libraryEditor.videoSubtitles"}},{key:"childView",get:function(){return Te}},{key:"childViewOptions",get:function(){var e=this;return{isClickViewContent:this.options.isClickViewContent,onClickDelete:function(t){return e.onClickDelete(t)}}}},{key:"onClickDelete",value:function(e){var t=this;this.options.isClickViewContent||new Ne.a({title:s.a.getPhrase(this.lang,"removeHeading"),text:s.a.getPhrase(this.lang,"removeBody",{language:this.getEnglishName(e)}),buttons:[{text:s.a.getPhrase(this.lang,"remove"),className:"btn btn-danger",success:!0},{text:s.a.getPhrase(this.lang,"cancel"),className:"btn btn-secondary",close:!0}],channelName:"".concat(this.name).concat(this.cid)}).render().done((function(){r.Radio.channel(t.options.channelName).trigger("delete:subtitle",e.get("id"))}))}},{key:"getEnglishName",value:function(e){return be(e.toJSON(),e.collection.toJSON())}}]),n}(i.a.ComponentCollection),ze=n(264),Je=n(1036),We=n(1288),Ye=n.n(We);function Ze(e){return(Ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Qe(e,t){return(Qe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Xe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=Ke(e);if(t){var r=Ke(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return Ge(this,n)}}function Ge(e,t){return!t||"object"!==Ze(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ke(e){return(Ke=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var et=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Qe(e,t)}(a,e);var t,n,o,i=Xe(a);function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).showNameField=!1,t.disableBtn=!0,t}return t=a,(n=[{key:"initialize",value:function(){this.model=oe.a.get(this.viewModelName),this.model.addValidation(Je.c),this.bindListeners()}},{key:"name",get:function(){return"AddLinksComponent"}},{key:"template",get:function(){return Ye.a}},{key:"lang",get:function(){return"libraryEditor.addLinks"}},{key:"tagName",get:function(){return"form"}},{key:"bindings",get:function(){return{"[name=url]":{observe:"url",setOptions:{validate:!0}},"[name=name]":{observe:"name",setOptions:{validate:!0}}}}},{key:"regions",value:function(){return{attachBtn:".attach-btn-region"}}},{key:"behaviors",get:function(){return[{behaviorClass:I.f},{behaviorClass:I.a}]}},{key:"elements",get:function(){return{nameField:"#name-container"}}},{key:"viewModelName",get:function(){return"".concat(this.name,":").concat(this.cid)}},{key:"bindListeners",value:function(){this.listenTo(this.model,"change:url",this.onChangeUrl),this.listenTo(this.model,"change:name",this.onChangeName),this.listenTo(this.options.channelName,"attach:link",this.onClickAttach)}},{key:"onChangeUrl",value:function(){this.showNameField&&!this.model.isValid("url")?(this.getUI("nameField").hide(),this.model.set("name",""),this.showNameField=!1):!this.showNameField&&this.model.isValid("url")&&(this.getUI("nameField").show(),this.showNameField=!0)}},{key:"onChangeName",value:function(){this.model.validate("name"),this.disableBtn=!this.model.isValid(),this.renderAttachButton()}},{key:"onClickAttach",value:function(){var e=this.model.toJSON();this.model.clear(),r.Radio.channel(this.options.channelName).trigger("add:link",e),this.render()}},{key:"renderAttachButton",value:function(){this.options.hide||this.showChildView("attachBtn",new ze.a({saveEvent:"attach:link",channelName:this.options.channelName,buttonText:s.a.getPhrase(this.lang,"attach"),extraButtonClass:"btn-light attach",disabled:this.disableBtn,buttonType:"submit",spinnerOptions:{size:T.s.Medium,type:T.t.Light,extraClasses:"mx-auto"}}))}},{key:"viewOptions",value:function(){return{limit:this.options.limit,hide:this.options.hide}}},{key:"onRender",value:function(){this.renderAttachButton(),this.stickit(),r.Validation.bind(this)}},{key:"onClose",value:function(){this.unstickit(),r.Validation.unbind(this)}}])&&$e(t.prototype,n),o&&$e(t,o),a}(i.a.Component),tt=n(1188),nt=n(36);function ot(e){return(ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function rt(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function it(e,t){return(it=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function at(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=lt(e);if(t){var r=lt(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return st(this,n)}}function st(e,t){return!t||"object"!==ot(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function lt(e){return(lt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ut="shared.errors.tooManyResources",ct=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&it(e,t)}(i,e);var t,n,o,r=at(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=r.call(this,"Cannot add that many resources")).resourceLimit=e,t}return t=i,(n=[{key:"name",get:function(){return"TooManyResourcesError"}},{key:"dialogOptions",get:function(){return{title:s.a.getPhrase(ut,"heading"),text:s.a.getPhrase(ut,"body",{resourceLimit:this.resourceLimit}),buttons:[{text:s.a.getPhrase(ut,"okay"),className:"btn btn-primary",success:!0}]}}}])&&rt(t.prototype,n),o&&rt(t,o),i}(nt.a);function ft(e){return(ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pt(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function ht(e,t){return(ht=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function dt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=mt(e);if(t){var r=mt(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return yt(this,n)}}function yt(e,t){return!t||"object"!==ft(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function mt(e){return(mt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var gt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ht(e,t)}(i,e);var t,n,o,r=dt(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=r.call(this,"Cannot add that many subtitles")).subtileLimit=e,t}return t=i,(n=[{key:"name",get:function(){return"TooManySubtitlesError"}},{key:"dialogOptions",get:function(){return{title:s.a.getPhrase("shared.errors.tooManySubtitles","heading"),text:s.a.getPhrase("shared.errors.tooManySubtitles","body",{subtitleLimit:this.subtileLimit}),buttons:[{text:s.a.getPhrase("shared.errors.tooManySubtitles","okay"),className:"btn btn-primary",success:!0}]}}}])&&pt(t.prototype,n),o&&pt(t,o),i}(nt.a),bt=n(205),vt=n(199),kt=n(304),wt=n(265),Ct=n(4),St=n(42),Ot=n(1289),Et=n.n(Ot);function Pt(e){return(Pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xt(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Rt(e,t){return(Rt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Tt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=_t(e);if(t){var r=_t(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return Nt(this,n)}}function Nt(e,t){return!t||"object"!==Pt(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function _t(e){return(_t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"EditResourcesView",(function(){return It}));var It=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Rt(e,t)}(y,e);var t,n,h,d=Tt(y);function y(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,y),d.call(this,e)}return t=y,(n=[{key:"initialize",value:function(){this.initializeUploadServices(),this.bindDataListeners(),this.bindViewListeners(),this.bindFileSelectListeners(),T.v.initBackButton(),this.chapterDataService=a.a.getInstance(R.g.Chapter,this),this.videoDataService=a.a.getInstance(R.g.Video,this),this.linkDataService=a.a.getInstance(R.g.Link,this),this.resourceDataService=a.a.getInstance(R.g.Resource,this),this.subtitleDataService=a.a.getInstance(R.g.Subtitle,this),this.resourceUploads=[],this.resourceUploadCount=0}},{key:"name",get:function(){return"EditResourcesView"}},{key:"lang",get:function(){return"libraryEditor.editResources"}},{key:"title",get:function(){return this.model&&this.model.get("name")||"Edit Resources"}},{key:"template",get:function(){return Et.a}},{key:"props",get:function(){return["videoDataService"]}},{key:"className",get:function(){return"bg-white p-3"}},{key:"channelName",get:function(){return T.k.generateUniqueChannelName(this)}},{key:"behaviors",get:function(){return[{behaviorClass:I.d}]}},{key:"requiredResources",get:function(){return{currentUser:j.b.currentUser}}},{key:"initializeUploadServices",value:function(){this.resourceUploadService=new c.b,this.listenTo(R.w.RESOURCE_UPLOAD,f.a.UPLOAD_COMPLETE,this.onResourceUploadComplete),this.subtitleUploadService=new c.c,this.listenTo(R.w.SUBTITLE_UPLOAD,f.a.UPLOAD_COMPLETE,this.onSubtitleUploadComplete)}},{key:"bindDataListeners",value:function(){this.listenTo(R.e.VIDEO,"".concat(R.f.VIDEOS,":").concat(this.options.videoId,":sync"),this.render),this.listenTo(R.e.VIDEO,"".concat(R.f.VIDEOS,":").concat(this.options.videoId,":error"),this.onVideoDataError),this.listenTo(R.e.VIDEO,"".concat(R.f.VIDEO_HAS_PHYSICAL_CHAPTERS,":").concat(this.options.videoId,":sync"),this.render),this.listenTo(R.e.CHAPTER,"".concat(R.f.CONCATENATE_STATUS,":").concat(this.options.videoId,":error"),this.onConcatenateDataError)}},{key:"bindViewListeners",value:function(){this.listenTo(this.channelName,"add:link",this.onAddLink),this.listenTo(this.channelName,"delete:subtitle",this.onDeleteSubtitle),this.listenTo(this.channelName,"delete:resource",this.onDeleteResource),this.listenTo(this.channelName,"delete:link",this.onDeleteLink),this.listenTo(this.channelName,"cancel:upload",this.onCancelUpload),this.listenTo(this.channelName,vt.LibraryEditorActions.MergeChapters,this.onMergeChapters)}},{key:"bindFileSelectListeners",value:function(){this.listenTo(this.getSubtitleSelectChannelName(),f.a.FILES_SELECTED,this.onSubtitleFilesAdded),this.listenTo(this.getResourceSelectChannelName(),f.a.FILES_SELECTED,this.onResourceFilesAdded)}},{key:"getSubtitleSelectChannelName",value:function(){return"".concat(this.name).concat(this.cid,"subtitles")}},{key:"getResourceSelectChannelName",value:function(){return"".concat(this.name).concat(this.cid,"resources")}},{key:"onVideoDataError",value:function(e){switch(e.type){case u.a.NotFound:i.a.ErrorHelper.throw(new bt.l);break;case u.a.Forbidden:i.a.ErrorHelper.throw(new bt.f)}}},{key:"onConcatenateDataError",value:function(e){e.type===u.a.NotFound&&(this.concatenateRequestNotFound=!0,this.render())}},{key:"onSubtitleFilesAdded",value:function(e,t){e.length>5-this.model.subtitles.length?i.a.ErrorHelper.throw(new gt(5)):(t&&(this.interactionType=t),this.subtitleUploadService.addFiles(e))}},{key:"onResourceFilesAdded",value:function(e,t){e.length>25-this.model.resources.length?i.a.ErrorHelper.throw(new ct(25)):(this.resourceUploadCount+=e.length,t&&(this.interactionType=t),this.resourceUploadService.addFiles(e))}},{key:"onAddLink",value:function(e){var t=this;25!==this.model.links.length&&(this.model.links.length+1===25&&this.renderAddLinks(!0),this.linkDataService.addLink(this.model.get("id"),e,(function(e){t.model.links.add(e),t.render()})))}},{key:"regions",value:function(){return{tabs:{el:".tab-region",partialLoading:_.h.EditVideoTabs},subtitlesUpload:{el:".subtitles-upload-region",partialLoading:_.h.EditVideoUploadArea},subtitlesUploadList:".subtitles-upload-list-region",customerSubtitlesList:".customer-subtitles-list-region",clickViewSubtitlesList:".clickview-subtitles-list-region",resourcesUpload:{el:".resources-upload-region",partialLoading:_.h.EditVideoUploadArea},resourcesUploadList:".resources-upload-list-region",customerResourcesList:".customer-resources-list-region",clickViewResourcesList:".clickview-resources-list-region",addLinks:{el:".add-links-region",partialLoading:_.h.EditVideoUploadArea},customerLinkList:".customer-link-list-region",clickViewLinkList:".clickview-link-list-region"}}},{key:"startPollingConcatenation",value:function(){if(this.concatenateRequest){var e=[kt.a.SingleFile,kt.a.ConcatenationFailed];o.contains(e,this.concatenateRequest.get("status"))||this.pollConcatenation()}}},{key:"pollConcatenation",value:function(){var e=this;this.isDestroyed()||this.chapterDataService.getConcatenateRequest(this.options.videoId,(function(t){if(e.concatenateRequest=t,e.concatenateRequest.get("status")!==kt.a.SingleFile)return setTimeout((function(){return e.pollConcatenation()}),5e3),void e.renderConcatenationRequest();e.videoDataService.clearPhysicialChaptersCache(),e.videoDataService.hasPhysicalChapters(e.options.videoId,(function(t){e.hasPhysicalChapters=t,e.renderSubtitleFileSelect()}))}))}},{key:"onDeleteResource",value:function(e){var t=this;this.resourceDataService.deleteResource(this.options.videoId,e,(function(){t.logDeleteAction(Ct.EntityType.Resource,e),t.render()}))}},{key:"onDeleteSubtitle",value:function(e){var t=this;this.subtitleDataService.deleteSubtitle(this.options.videoId,e,(function(){t.logDeleteAction(Ct.EntityType.Subtitle,e),t.render()}))}},{key:"onDeleteLink",value:function(e){var t=this;this.linkDataService.deleteLink(this.options.videoId,e,(function(){t.logDeleteAction(Ct.EntityType.Link,e),t.render()}))}},{key:"onCancelUpload",value:function(e){this.resourceUploadService.cancelUpload(e),this.subtitleUploadService.cancelUpload(e)}},{key:"onResourceUploadComplete",value:function(e){var t=this,n=e.toJSON(),o={fileId:n.fileInfo.id,uploadId:n.file.cvUpload.uploadId,name:n.fileInfo.name,type:p.a.getResourceType(n.fileInfo.extension),extension:n.fileInfo.extension,fileSize:n.fileInfo.size,fileUrl:n.fileInfo.url,ingestUrl:n.file.cvUpload.ingestUrl,metaData:{type:p.a.getResourceType(n.fileInfo.extension)},contribution:!1,url:n.fileInfo.url,fileIdType:2};this.resourceUploads.push(o),this.resourceUploadCount--,this.resourceUploadCount>0||(this.resourceDataService.addResource(this.options.videoId,this.resourceUploads,(function(e){t.model.resources.add(e);var n=t.resourceUploadService.getCollection().filter((function(t){return t.get("fileInfo").id===e.get("fileId")}));t.resourceUploadService.getCollection().remove(n),t.logUploadAction(e),t.render()})),this.resourceUploads=[])}},{key:"onSubtitleUploadComplete",value:function(e){var t=this,n=$.Deferred(),o=new ye({defaultLanguage:{code:"en",name:"English"},promise:n});n.done((function(n){var o=e.toJSON(),r={fileId:o.fileInfo.id,name:n.name,language:n.code,type:p.a.getResourceType(o.fileInfo.extension),fileIdType:2};t.subtitleDataService.addSubtitle(t.options.videoId,r,(function(n){t.model.subtitles.add(n),t.subtitleUploadService.getCollection().remove(e),t.logUploadAction(n),t.render()}))})).fail((function(){t.subtitleUploadService.cancelUpload(e.get("id"))})),r.Radio.channel(l.a.POPUP).trigger(i.a.EventNames.SHOW_POPUP,o)}},{key:"logUploadAction",value:function(e){var t=e instanceof N.a?Ct.EntityType.Resource:Ct.EntityType.Subtitle,n=St.a.mapInteractionType(this.interactionType),o={location:Ct.LocationContext.EditVideoResources,actionType:Ct.UserAction.Upload,entity:t,descriptor:n};St.a.logUserAction(e,o)}},{key:"logDeleteAction",value:function(e,t){var n={location:Ct.LocationContext.EditVideoResources,actionType:Ct.UserAction.Delete,entity:e},o={id:t,parentId:+this.options.videoId};St.a.logUserAction(o,n)}},{key:"onMergeChapters",value:function(){var e=this;this.chapterDataService.addConcatenateRequest(this.options.videoId,(function(){e.pollConcatenation()}))}},{key:"renderTabs",value:function(){var e=!T.j.canEditVideo(this.model);this.showChildView("tabs",new me.a({tabs:T.v.getEditVideoTabs(this.options.videoId,{hideChaptersTab:e}),activeTab:".edit-resources-subtitles-applink",goBackTab:T.v.getBackButton(this.options.videoId)}))}},{key:"renderSubtitleFileSelect",value:function(){if(this.hasPhysicalChapters.get("value"))this.renderConcatenationRequest();else{var e=s.a.getPhrase(this.lang,"subtitlesLimit",{limit:5});this.showChildView("subtitlesUpload",new x({title:this.isClickViewContent?s.a.getPhrase(this.lang,"customerSubtitles"):s.a.getPhrase(this.lang,"subtitles"),description:s.a.getPhrase(this.lang,"subtitlesInfo"),alternateText:s.a.getPhrase(this.lang,"subtitlesAlternative"),mimeType:p.b.SUBTITLES,channelName:this.getSubtitleSelectChannelName(),acceptMultiple:!1,limitText:this.model.subtitles.length>=5?e:null,isClickViewContent:this.isClickViewContent}))}}},{key:"renderSubtitleUploadList",value:function(){var e=this.subtitleUploadService.getCollection();this.showChildView("subtitlesUploadList",new ne({collection:e,channelName:this.channelName}))}},{key:"renderSubtitlesLists",value:function(){this.renderClickViewSubtitlesList(),this.renderCustomerSubtitlesList()}},{key:"renderClickViewSubtitlesList",value:function(){if(this.isClickViewContent){var e=T.j.filterObjectsByOwnerType(this.model.subtitles,wt.a.ClickView);this.showChildView("clickViewSubtitlesList",new qe({collection:e,channelName:this.channelName,isClickViewContent:!0,headerText:s.a.getPhrase(this.lang,"clickViewSubtitles"),emptyStateText:e.models.length?"":s.a.getPhrase(this.lang,"clickViewSubtitlesEmpty")}))}}},{key:"renderCustomerSubtitlesList",value:function(){this.showChildView("customerSubtitlesList",new qe({collection:T.j.filterObjectsByOwnerType(this.model.subtitles,wt.a.Customer,this.currentUser.get("customerId")),channelName:this.channelName}))}},{key:"renderConcatenationRequest",value:function(){this.isRendered()&&this.showChildView("subtitlesUpload",new D.a({type:this.isClickViewContent?"clickViewSubtitles":"subtitles",channelName:this.channelName,model:this.concatenateRequest}))}},{key:"renderResourcesFileSelect",value:function(){var e=s.a.getPhrase(this.lang,"resourcesLimit",{limit:25});this.showChildView("resourcesUpload",new x({title:this.isClickViewContent?s.a.getPhrase(this.lang,"customerResources"):s.a.getPhrase(this.lang,"resources"),description:s.a.getPhrase(this.lang,"resourcesDescription"),alternateText:s.a.getPhrase(this.lang,"resourcesAlternative"),mimeType:p.b.RESOURCES,channelName:this.getResourceSelectChannelName(),limitText:this.model.resources.length>=25?e:null,isClickViewContent:this.isClickViewContent}))}},{key:"renderResourcesUploadList",value:function(){var e=this.resourceUploadService.getCollection();this.showChildView("resourcesUploadList",new ne({collection:e,channelName:this.channelName}))}},{key:"renderResourcesLists",value:function(){this.renderClickViewResourcesList(),this.renderCustomerResourcesList()}},{key:"renderClickViewResourcesList",value:function(){if(this.isClickViewContent){var e=T.j.filterObjectsByOwnerType(this.model.resources,wt.a.ClickView);this.showChildView("clickViewResourcesList",new L.a({model:this.model,customCollection:e,editable:!1,videoId:this.options.videoId,parentChannelName:this.channelName,headerText:s.a.getPhrase(this.lang,"clickViewResources"),emptyStateText:e.models.length?"":s.a.getPhrase(this.lang,"clickViewResourcesEmpty"),analyticsOptions:{location:Ct.LocationContext.EditVideoResources}}))}}},{key:"renderCustomerResourcesList",value:function(){this.showChildView("customerResourcesList",new L.b({collection:T.j.filterObjectsByOwnerType(this.model.resources,wt.a.Customer,this.currentUser.get("customerId")),editable:!0,videoId:this.options.videoId,channelName:this.channelName,analyticsOptions:{location:Ct.LocationContext.EditVideoResources}}))}},{key:"renderAddLinks",value:function(e){this.showChildView("addLinks",new et({collection:this.model.get("links"),channelName:this.channelName,hide:e||25===this.model.get("links").length,limit:25}))}},{key:"renderLinkLists",value:function(){var e={channelName:this.channelName,analyticsOptions:{location:Ct.LocationContext.EditVideoResources},videoId:this.options.videoId};this.renderClickViewLinkList(e),this.renderCustomerLinkList(e)}},{key:"renderClickViewLinkList",value:function(e){if(this.isClickViewContent){var t=T.j.filterObjectsByOwnerType(this.model.links,wt.a.ClickView);this.showChildView("clickViewLinkList",new tt.a(Object.assign(Object.assign({},e),{headingText:"Resource Links by ClickView",emptyStateText:t.models.length?"":"There are no ClickView links for this video",customCollection:t,editable:!1})))}}},{key:"renderCustomerLinkList",value:function(e){this.showChildView("customerLinkList",new tt.a(Object.assign(Object.assign({},e),{customCollection:T.j.filterObjectsByOwnerType(this.model.links,wt.a.Customer,this.currentUser.get("customerId")),editable:!0})))}},{key:"fetchData",value:function(){var e=this;this.model=this.videoDataService.getVideo(this.options.videoId),this.hasPhysicalChapters=this.videoDataService.hasPhysicalChapters(this.options.videoId),this.isClickViewContent=this.model&&!T.j.canEditVideo(this.model),this.hasPhysicalChapters&&this.hasPhysicalChapters.get("value")&&!this.getConcatenateRequestSent&&(this.chapterDataService.getConcatenateRequest(this.options.videoId,(function(t){e.concatenateRequest=t,e.render()})),this.getConcatenateRequestSent=!0)}},{key:"shouldRender",value:function(){return!(!this.model||!this.hasPhysicalChapters||this.hasPhysicalChapters.get("value")&&!this.concatenateRequest&&!this.concatenateRequestNotFound)}},{key:"onBeforeRender",value:function(){return this.fetchData(),this.shouldRender()}},{key:"viewOptions",value:function(){return{isClickViewContent:this.isClickViewContent}}},{key:"onRender",value:function(){this.renderTabs(),this.renderSubtitleFileSelect(),this.renderSubtitleUploadList(),this.renderSubtitlesLists(),this.renderResourcesFileSelect(),this.renderResourcesUploadList(),this.renderResourcesLists(),this.renderAddLinks(),this.renderLinkLists(),this.startPollingConcatenation()}},{key:"onDestroy",value:function(){this.subtitleUploadService.destroy(),this.resourceUploadService.destroy()}}])&&xt(t.prototype,n),h&&xt(t,h),y}(i.a.View)}}]);
|