@clickview/library-editor 1.3.1-dev.1 → 1.4.0-rc.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.
Files changed (81) hide show
  1. package/dist/bundles.json +3 -3
  2. package/dist/css/{library-editor-app-070c979de9.css → library-editor-app-bc12f8ea16.css} +1 -1
  3. package/dist/en.json +1 -1
  4. package/dist/scripts/{0-aa50fa9da5.chunk.js → 0-bb8d151788.chunk.js} +1 -1
  5. package/dist/scripts/{1-fd3e4736ec.chunk.js → 1-8da41f8348.chunk.js} +1 -1
  6. package/dist/scripts/{10-7591f02932.chunk.js → 10-228d8c45fe.chunk.js} +1 -1
  7. package/dist/scripts/{11-02eba260f6.chunk.js → 11-9b1312be2e.chunk.js} +1 -1
  8. package/dist/scripts/{12-6d82741731.chunk.js → 12-25fd567bfa.chunk.js} +1 -1
  9. package/dist/scripts/{13-724a96f11e.chunk.js → 13-5594f01c32.chunk.js} +1 -1
  10. package/dist/scripts/{14-f0e8d0ad52.chunk.js → 14-d3e9f7ac99.chunk.js} +1 -1
  11. package/dist/scripts/{15-0dc89981e2.chunk.js → 15-9c2702f643.chunk.js} +1 -1
  12. package/dist/scripts/{16-28fbb0fbe5.chunk.js → 16-35ac442692.chunk.js} +1 -1
  13. package/dist/scripts/{17-3c94d08d78.chunk.js → 17-229a9e354b.chunk.js} +1 -1
  14. package/dist/scripts/{18-3fadb1f394.chunk.js → 18-71ca059d9a.chunk.js} +1 -1
  15. package/dist/scripts/{19-8e572002ab.chunk.js → 19-b229508fdd.chunk.js} +1 -1
  16. package/dist/scripts/{2-7a78d29f44.chunk.js → 2-3ae9732722.chunk.js} +1 -1
  17. package/dist/scripts/{22-9a3adda6ad.chunk.js → 22-ac521a0096.chunk.js} +1 -1
  18. package/dist/scripts/{23-be4588004c.chunk.js → 23-c697c32cec.chunk.js} +1 -1
  19. package/dist/scripts/{24-ab5d254e7f.chunk.js → 24-6eb3e57e82.chunk.js} +1 -1
  20. package/dist/scripts/{25-4df309effa.chunk.js → 25-6b696e6ef2.chunk.js} +1 -1
  21. package/dist/scripts/{26-e6e5871cfd.chunk.js → 26-ee7f9d7fd1.chunk.js} +1 -1
  22. package/dist/scripts/{27-5e3aeba07e.chunk.js → 27-87b1e6230a.chunk.js} +1 -1
  23. package/dist/scripts/{28-cc856d5e95.chunk.js → 28-c605108bb7.chunk.js} +1 -1
  24. package/dist/scripts/{29-9f77baca01.chunk.js → 29-8efdbc6583.chunk.js} +1 -1
  25. package/dist/scripts/{3-79f80333be.chunk.js → 3-55457ff399.chunk.js} +1 -1
  26. package/dist/scripts/{30-68fb832db0.chunk.js → 30-f3bf572703.chunk.js} +1 -1
  27. package/dist/scripts/{31-d80dd32cc1.chunk.js → 31-c1ce0f719e.chunk.js} +1 -1
  28. package/dist/scripts/{32-cfb32aaa08.chunk.js → 32-f5db4cacf9.chunk.js} +1 -1
  29. package/dist/scripts/{33-8c76b774b6.chunk.js → 33-17b481dedb.chunk.js} +1 -1
  30. package/dist/scripts/{34-9e83c63cb8.chunk.js → 34-918d865f34.chunk.js} +1 -1
  31. package/dist/scripts/{35-2a9acc8597.chunk.js → 35-de8b68b764.chunk.js} +1 -1
  32. package/dist/scripts/{36-d6d7b848e2.chunk.js → 36-23d5a73fbf.chunk.js} +1 -1
  33. package/dist/scripts/{37-ad8e6f67c5.chunk.js → 37-c08483de1b.chunk.js} +1 -1
  34. package/dist/scripts/{38-f681bc9e2e.chunk.js → 38-288855b754.chunk.js} +1 -1
  35. package/dist/scripts/{39-19eec511f5.chunk.js → 39-4d0f862a76.chunk.js} +1 -1
  36. package/dist/scripts/{4-2a82a84056.chunk.js → 4-0eb5ce96d3.chunk.js} +1 -1
  37. package/dist/scripts/{40-cca507ba93.chunk.js → 40-adec67fce9.chunk.js} +1 -1
  38. package/dist/scripts/{41-fc6a0fe7e4.chunk.js → 41-305ec13d1c.chunk.js} +1 -1
  39. package/dist/scripts/{42-5452d6de34.chunk.js → 42-7227e7bd2c.chunk.js} +1 -1
  40. package/dist/scripts/{43-fb162a1122.chunk.js → 43-e38791d4a7.chunk.js} +1 -1
  41. package/dist/scripts/{44-b3b4565828.chunk.js → 44-bd0a532d8e.chunk.js} +1 -1
  42. package/dist/scripts/{45-8412ccea6c.chunk.js → 45-0e2409cd60.chunk.js} +1 -1
  43. package/dist/scripts/{46-372fa93c13.chunk.js → 46-912320ce94.chunk.js} +1 -1
  44. package/dist/scripts/{47-56c363e4a6.chunk.js → 47-3cbfd2a2ac.chunk.js} +1 -1
  45. package/dist/scripts/{48-f0403bcb83.chunk.js → 48-8d42e561b1.chunk.js} +1 -1
  46. package/dist/scripts/{49-13b2893542.chunk.js → 49-1ba48a0e60.chunk.js} +1 -1
  47. package/dist/scripts/{5-b2986c85d0.chunk.js → 5-f3d75e93a6.chunk.js} +1 -1
  48. package/dist/scripts/{50-8c3fb5c1c4.chunk.js → 50-3b7b3dc488.chunk.js} +1 -1
  49. package/dist/scripts/{51-ec94176992.chunk.js → 51-2f0874d3b6.chunk.js} +1 -1
  50. package/dist/scripts/{52-f541d887ed.chunk.js → 52-38139e2d72.chunk.js} +1 -1
  51. package/dist/scripts/{53-f827f8b6e0.chunk.js → 53-8bf2c662ed.chunk.js} +1 -1
  52. package/dist/scripts/{54-1ebcc9fcaf.chunk.js → 54-2010b7d990.chunk.js} +1 -1
  53. package/dist/scripts/{55-4c0d184ca3.chunk.js → 55-ac90e52766.chunk.js} +1 -1
  54. package/dist/scripts/{56-de18389621.chunk.js → 56-556404b07f.chunk.js} +1 -1
  55. package/dist/scripts/{57-a85e67a482.chunk.js → 57-0e77443044.chunk.js} +1 -1
  56. package/dist/scripts/{58-be172a6ca4.chunk.js → 58-b52ecfb254.chunk.js} +1 -1
  57. package/dist/scripts/{59-4bf5baafed.chunk.js → 59-3e7a2e50d2.chunk.js} +1 -1
  58. package/dist/scripts/{6-53d64f6a85.chunk.js → 6-e2b6f0a280.chunk.js} +1 -1
  59. package/dist/scripts/{60-03e44d916c.chunk.js → 60-48d410eac3.chunk.js} +1 -1
  60. package/dist/scripts/{61-11a1a5f41c.chunk.js → 61-de1dca97c1.chunk.js} +1 -1
  61. package/dist/scripts/{62-78089903fa.chunk.js → 62-b68b548732.chunk.js} +1 -1
  62. package/dist/scripts/{63-fe138e1f54.chunk.js → 63-f863898f45.chunk.js} +1 -1
  63. package/dist/scripts/{64-1460024bea.chunk.js → 64-440e44bd4c.chunk.js} +1 -1
  64. package/dist/scripts/{65-81c6f0a1d0.chunk.js → 65-1cd1a11fd2.chunk.js} +1 -1
  65. package/dist/scripts/{66-469cc41ce6.chunk.js → 66-8580a8395b.chunk.js} +1 -1
  66. package/dist/scripts/{67-dd181df1c4.chunk.js → 67-7c04f32d25.chunk.js} +1 -1
  67. package/dist/scripts/{68-bf1905261e.chunk.js → 68-a8c262b62d.chunk.js} +1 -1
  68. package/dist/scripts/{69-c77da01389.chunk.js → 69-e24052e605.chunk.js} +1 -1
  69. package/dist/scripts/{7-f2452d62fd.chunk.js → 7-7fcaf2b89f.chunk.js} +1 -1
  70. package/dist/scripts/{70-e79d42e859.chunk.js → 70-fa3e9a9a9d.chunk.js} +1 -1
  71. package/dist/scripts/{71-8bee00418c.chunk.js → 71-822760c520.chunk.js} +1 -1
  72. package/dist/scripts/{72-c9c79df587.chunk.js → 72-39aa9e9fc7.chunk.js} +1 -1
  73. package/dist/scripts/{73-172b46004e.chunk.js → 73-77a89058bc.chunk.js} +1 -1
  74. package/dist/scripts/{74-3a572e4113.chunk.js → 74-bf5fd5de31.chunk.js} +1 -1
  75. package/dist/scripts/{8-223910870f.chunk.js → 8-4674a9a713.chunk.js} +1 -1
  76. package/dist/scripts/{9-1e67205927.chunk.js → 9-f2dd265540.chunk.js} +1 -1
  77. package/dist/scripts/{bundle-108691b784.min.js → bundle-39a40aaa3e.min.js} +3 -3
  78. package/dist/scripts/polyfills-fba7714a3a.min.js +1 -0
  79. package/package.json +2 -2
  80. package/dist/scripts/bundle-81edf9131b.min.js +0 -10
  81. package/dist/scripts/polyfills-afb66ec8cc.min.js +0 -1
@@ -1 +1 @@
1
- (window.webpackJsonp_clickview_library_editor=window.webpackJsonp_clickview_library_editor||[]).push([[30],{1059:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var o=n(1),i=n(2),r=n(312);function a(e){return(a="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 l(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?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function c(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 i=d(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return u(this,n)}}function u(e,t){if(t&&("object"===a(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var f=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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s(e,t)}(u,e);var t,n,i,a=c(u);function u(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),a.call(this,e)}return t=u,(n=[{key:"name",get:function(){return"DropdownCollectionComponent"}},{key:"className",get:function(){return"dropdown-menu items-viewpart ".concat(this.getExtraClasses(this.options.displayOptions))}},{key:"attributes",get:function(){return{"aria-labelledby":"dropdownSelector"}}},{key:"initialize",value:function(){this.listenTo(this.options.channelName,"center:dropdown",this.centerSelectedItem)}},{key:"childView",get:function(){return r.a}},{key:"childViewOptions",get:function(){var e={channelName:this.options.channelName,analyticsHelper:this.options.analyticsHelper};return o.extend(e,this.options.childOptions)}},{key:"getExtraClasses",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.alignment,n=void 0===t?"left":t,o=e.extraClasses,i="dropdown-menu-".concat(n);return o&&(i="".concat(i," ").concat(o)),i}},{key:"centerSelectedItem",value:function(){var e=this.$el.find(".active");if(e.length){var t=this.$el.scrollTop()+e.position().top,n=.5*this.$el.height()+.5*e.height();this.$el.scrollTop(t-n)}}}])&&l(t.prototype,n),i&&l(t,i),Object.defineProperty(t,"prototype",{writable:!1}),u}(i.a.ComponentCollection)},1064:function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var o=n(6),i=n(2),r=n(3),a=n(1103),l=n(12),s=n(1066),c=n.n(s),u=n(1067),d=n.n(u);function f(e){return(f="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 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 h(e,t){return(h=Object.setPrototypeOf?Object.setPrototypeOf.bind():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 i=g(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return m(this,n)}}function m(e,t){if(t&&("object"===f(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf.bind():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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(u,e);var t,n,i,s=y(u);function u(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),s.call(this,e)}return t=u,(n=[{key:"initialize",value:function(){this.listenTo(this.options.channelName,"folder:selected new:folder:selected",this.setButtonText),this.listenTo(this.options.channelName,"re:render:selector",this.renderSelector),this.disabledIds=this.options.disabledIds&&this.options.disabledIds.reduce((function(e,t){return Object.assign(Object.assign({},e),function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},t,!0))}),{})}},{key:"name",get:function(){return"TreeDropdownComponent"}},{key:"template",get:function(){return c.a}},{key:"className",get:function(){return"position-relative"}},{key:"lang",get:function(){return"libraryEditor.treeDropdown"}},{key:"regions",value:function(){return{selector:{el:".selector-region",replaceElement:!1}}}},{key:"events",value:function(){return{"click .create-new":"onClickCreateNew"}}},{key:"defaults",get:function(){return{disabledIds:[]}}},{key:"elements",get:function(){return{button:".custom-select"}}},{key:"onClickCreateNew",value:function(e){e.preventDefault(),o.Radio.channel(this.options.channelName).trigger("create:folder:clicked")}},{key:"setButtonText",value:function(e,t){if(e&&!t){var n=e.get("name");this.getUI("button").text(n)}else{var o=l.f.getSelected(this.options.folderTreeKey,this.collection),i=o?o.get("name"):r.a.getPhrase(this.lang,"button");this.getUI("button").text(i)}}},{key:"renderSelector",value:function(){this.showChildView("selector",new a.a({styles:d.a,collection:this.collection,channelName:this.options.channelName,childrenProperty:"children",folderTreeId:this.options.folderTreeKey,extraClass:d.a.list,extraClasses:d.a.list,isSelector:!0,disabledIds:this.disabledIds||{}}))}},{key:"viewOptions",value:function(){return{styles:d.a,name:this.options.name||this.options.channelName,buttonText:this.buttonText,canCreateNew:this.options.canCreateNew}}},{key:"onRender",value:function(){this.setButtonText(),this.renderSelector()}}])&&p(t.prototype,n),i&&p(t,i),Object.defineProperty(t,"prototype",{writable:!1}),u}(i.a.Component)},1066:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,i){e.propertyIsEnumerable;var r,a=e.escapeExpression;return' <button class="create-new btn font-weight-bold rounded-0 w-100 text-left '+a(e.lambda(null!=(r=null!=(r=null!=t?t.options:t)?r.styles:r)?r.customItem:r,t))+'">'+a((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"createNew",{name:"lang",hash:{},data:i}))+"</button>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,i){e.propertyIsEnumerable;var r,a=e.lambda,l=e.escapeExpression;return'<button\r\n class="'+l(a(null!=(r=null!=(r=null!=t?t.options:t)?r.styles:r)?r.selectBtn:r,t))+' custom-select form-control"\r\n data-toggle="dropdown"\r\n aria-haspopup="true"\r\n aria-expanded="false"\r\n name='+l(a(null!=(r=null!=t?t.options:t)?r.name:r,t))+"\r\n>"+l(a(null!=(r=null!=t?t.options:t)?r.buttonText:r,t))+'</button>\r\n<div class="dropdown-menu '+l(a(null!=(r=null!=(r=null!=t?t.options:t)?r.styles:r)?r.selector:r,t))+'">\r\n <div class="selector-region"></div>\r\n'+(null!=(r=n.if.call(null!=t?t:e.nullContext||{},null!=(r=null!=t?t.options:t)?r.canCreateNew:r,{name:"if",hash:{},fn:e.program(1,i,0),inverse:e.noop,data:i}))?r:"")+'</div>\r\n<div class="form-feedback"></div>'},useData:!0})},1067:function(e,t,n){e.exports={selectBtn:"_2TTgs",list:"_3wN7o",selector:"_3Xf1P",customItem:"_199PI"}},1105:function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var o=n(1),i=n(6),r=n(2),a=n(1059),l=n(12),s=n(1106),c=n.n(s),u=n(1107),d=n.n(u);function f(e){return(f="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 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 h(e,t){return(h=Object.setPrototypeOf?Object.setPrototypeOf.bind():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 i=g(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return m(this,n)}}function m(e,t){if(t&&("object"===f(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf.bind():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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(u,e);var t,n,r,s=y(u);function u(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),(t=s.call(this,e)).selectSearch="",t.sameCharIndex=1,t.optionStep=1,t}return t=u,(n=[{key:"initialize",value:function(){this.setModel(),this.bindListeners()}},{key:"name",get:function(){return"SelectComponent"}},{key:"template",get:function(){return c.a}},{key:"regions",value:function(){return{dropdown:{el:".dropdown-region",replaceElement:!0}}}},{key:"events",value:function(){return{keydown:"onKeydown","shown.bs.dropdown":"onShowDropdown"}}},{key:"defaults",get:function(){return{displayProperty:"name"}}},{key:"elements",get:function(){return{dropdownToggle:".dropdown-toggle"}}},{key:"bindListeners",value:function(){this.listenTo(this.options.channelName,this.options.childOptions.eventName,this.onSelect)}},{key:"onShowDropdown",value:function(){i.Radio.channel(this.options.channelName).trigger("center:dropdown")}},{key:"onKeydown",value:function(e){38===e.keyCode||40===e.keyCode?this.onArrowKeyDown(e):13===e.keyCode?this.render():this.onType(e),i.Radio.channel(this.options.channelName).trigger("center:dropdown")}},{key:"onArrowKeyDown",value:function(e){l.c.getSelected(this.collection)?this.optionStep=1:this.optionStep=0;var t=this.getNextModel(e.keyCode);for(t||(l.c.deselectAll(this.collection),t=this.getNextModel(e.keyCode));this.isDisabled(t);)this.optionStep++,t=this.getNextModel(e.keyCode);this.onSelect(t)}},{key:"onType",value:function(e){if(1===e.key.toString().length){var t=this.getModelMatch(e);t&&this.onSelect(t),this.runTimer()}}},{key:"onSelect",value:function(e){this.isDisabled(e)||(l.c.setSelected(e.get("id"),this.collection),this.setModel(),this.getUI("dropdownToggle").text(this.getButtonText()),i.Radio.channel(this.options.channelName).trigger("select:option:selected",e))}},{key:"setModel",value:function(){this.model=l.c.getSelected(this.collection)}},{key:"getNextModel",value:function(e){var t,n=l.c.getSelected(this.collection)||this.collection.first(),o=this.collection.indexOf(n);return(t=38===e?this.collection.at(o-this.optionStep):this.collection.at(o+this.optionStep))||(l.c.deselectAll(this.collection),t=this.collection.first(),this.optionStep=0),t}},{key:"getModelMatch",value:function(e){var t,n=this;return 1===this.selectSearch.length&&this.selectSearch===e.key?t=this.handleSameCharIndex(e.key):(this.selectSearch+=e.key,this.sameCharIndex=1),t||(t=o.find(this.collection.models,(function(e){return e.get(n.options.displayProperty).toLowerCase().slice(0,n.selectSearch.length).includes(n.selectSearch.toLowerCase())}))),t}},{key:"handleSameCharIndex",value:function(e){var t=this,n=o.filter(this.collection.models,(function(n){return n.get(t.options.displayProperty).toLowerCase().slice(0,1)===e}));if(n.length>1){var i=n[this.sameCharIndex];return i||(i=o.first(n),this.sameCharIndex=0),this.sameCharIndex++,i}return o.first(n)}},{key:"runTimer",value:function(){var e=this;this.scopedTimerIndex&&clearTimeout(this.scopedTimerIndex),this.scopedTimerIndex=window.setTimeout((function(){e.selectSearch=""}),500)}},{key:"isDisabled",value:function(e){var t;if(e.get("divider"))return!0;if(!o.isFunction(this.options.childOptions.isDisabled))return!1;for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return(t=this.options.childOptions.isDisabled).call.apply(t,[this,e].concat(i))}},{key:"getButtonText",value:function(){if(this.options.disabled)return this.options.noOptionsText;var e=l.c.getSelected(this.collection);return e&&e.get(this.options.displayProperty)||this.options.placeholderText}},{key:"viewOptions",value:function(){return{styles:d.a,inputName:this.options.inputName,disabled:this.options.disabled,placeholderText:this.getButtonText()}}},{key:"onRender",value:function(){this.showChildView("dropdown",new a.a({collection:this.collection,channelName:this.options.channelName,childOptions:o.extend(this.options.childOptions),displayOptions:{extraClasses:"w-100 ".concat(d.a.dropdownMenu)},analyticsHelper:this.options.analyticsHelper}))}}])&&p(t.prototype,n),r&&p(t,r),Object.defineProperty(t,"prototype",{writable:!1}),u}(r.a.Component)},1106:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,i){var r;e.propertyIsEnumerable;return e.escapeExpression(e.lambda(null!=(r=null!=(r=null!=t?t.options:t)?r.styles:r)?r.disabled:r,t))},3:function(e,t,n,o,i){return" disabled"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,i){e.propertyIsEnumerable;var r,a=e.lambda,l=e.escapeExpression,s=null!=t?t:e.nullContext||{};return'<button \r\n class="dropdown-toggle form-control btn-block text-left position-relative '+l(a(null!=(r=null!=(r=null!=t?t.options:t)?r.styles:r)?r.selectButton:r,t))+" "+(null!=(r=n.if.call(s,null!=(r=null!=t?t.options:t)?r.disabled:r,{name:"if",hash:{},fn:e.program(1,i,0),inverse:e.noop,data:i}))?r:"")+'" \r\n type="button" \r\n id="dropdownMenuButton" \r\n data-toggle="dropdown" \r\n aria-haspopup="true" \r\n aria-expanded="false"\r\n '+(null!=(r=n.if.call(s,null!=(r=null!=t?t.options:t)?r.disabled:r,{name:"if",hash:{},fn:e.program(3,i,0),inverse:e.noop,data:i}))?r:"")+' \r\n name="'+l(a(null!=(r=null!=t?t.options:t)?r.inputName:r,t))+'"\r\n >\r\n '+l(a(null!=(r=null!=t?t.options:t)?r.placeholderText:r,t))+'\r\n</button>\r\n<div class="dropdown-region"></div>\r\n<div class="form-feedback"></div>'},useData:!0})},1107:function(e,t,n){e.exports={dropdownMenu:"_2RaQu",selectButton:"_2xGqi",disabled:"_15kWr"}},1359: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,i){return'<div class="top-actions-region"></div>\r\n<div class="videos-region"></div>\r\n<div class="bottom-actions-region"></div>'},useData:!0})},1360: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,i){e.propertyIsEnumerable;return'<div class="finish-button-region"></div>\r\n<button class="btn btn-secondary float-right add-more-videos">'+e.escapeExpression((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"addMore",{name:"lang",hash:{},data:i}))+"</button>"},useData:!0})},1361: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,i){return'<div class="dropdown-menu-region"></div>'},useData:!0})},1362:function(e,t,n){e.exports={requiredStar:"_3m_pH"}},1363:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,i){var r;e.propertyIsEnumerable;return'<span class="'+e.escapeExpression(e.lambda(null!=(r=null!=(r=null!=t?t.options:t)?r.styles:r)?r.requiredStar:r,t))+'">*</span>'},3:function(e,t,n,o,i){return' <div class="library-select-region form-group col-6"></div>\r\n'},5:function(e,t,n,o,i){return"col-6"},7:function(e,t,n,o,i){return"col-12"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,i){e.propertyIsEnumerable;var r,a=null!=t?t:e.nullContext||{};return"<h5>"+e.escapeExpression((n.lang||t&&t.lang||e.hooks.helperMissing).call(a,"uploadDestination",{name:"lang",hash:{},data:i}))+(null!=(r=n.if.call(a,null!=(r=null!=(r=null!=t?t.options:t)?r.requiredFields:r)?r.uploadDestination:r,{name:"if",hash:{},fn:e.program(1,i,0),inverse:e.noop,data:i}))?r:"")+'</h5>\r\n <div class="container-fluid px-0">\r\n <div class="row">\r\n'+(null!=(r=n.if.call(a,null!=(r=null!=t?t.options:t)?r.hasMultipleLibraries:r,{name:"if",hash:{},fn:e.program(3,i,0),inverse:e.noop,data:i}))?r:"")+' <div class="folder-select-region form-group '+(null!=(r=n.if.call(a,null!=(r=null!=t?t.options:t)?r.hasMultipleLibraries:r,{name:"if",hash:{},fn:e.program(5,i,0),inverse:e.program(7,i,0),data:i}))?r:"")+'"></div>\r\n </div>\r\n </div>\r\n</div>'},useData:!0})},1364: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,i){e.propertyIsEnumerable;var r,a=null!=t?t:e.nullContext||{},l=e.hooks.helperMissing,s=e.escapeExpression;return'<div class="progress-bar bg-info" style="width: '+s("function"==typeof(r=null!=(r=n.progress||(null!=t?t.progress:t))?r:l)?r.call(a,{name:"progress",hash:{},data:i}):r)+'%" aria-valuenow="'+s("function"==typeof(r=null!=(r=n.progress||(null!=t?t.progress:t))?r:l)?r.call(a,{name:"progress",hash:{},data:i}):r)+'" aria-valuemin="0" aria-valuemax="100"></div>'},useData:!0})},1365:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,i){e.propertyIsEnumerable;return e.escapeExpression((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"hideMetadata",{name:"lang",hash:{},data:i}))},3:function(e,t,n,o,i){e.propertyIsEnumerable;return e.escapeExpression((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"addMetadata",{name:"lang",hash:{},data:i}))},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,i){e.propertyIsEnumerable;var r,a,l=e.escapeExpression,s=null!=t?t:e.nullContext||{},c=e.hooks.helperMissing;return'<div class="upload-title-region"></div>\r\n<div class="container-fluid border-bottom">\r\n <div class="row">\r\n <div class="col-4 p-3">\r\n <div class="thumbnail-region"></div>\r\n <div class="upload-progress-region"></div>\r\n <div class="my-3">\r\n <h5 class="'+l(e.lambda(null!=(r=null!=(r=null!=t?t.options:t)?r.styles:r)?r.title:r,t))+'">'+l("function"==typeof(a=null!=(a=n.name||(null!=t?t.name:t))?a:c)?a.call(s,{name:"name",hash:{},data:i}):a)+'</h5>\r\n <div class="text-progress-region"></div>\r\n <button class="btn btn-secondary cancel-upload">'+l((n.lang||t&&t.lang||c).call(s,"cancel",{name:"lang",hash:{},data:i}))+'</button>\r\n </div>\r\n\r\n </div>\r\n <div class="col-8 py-3 pr-3">\r\n <div class="video-details-region"></div>\r\n <div class="folder-select-region"></div>\r\n <div class="additional-info-region"></div>\r\n <div class="production-info-region"></div>\r\n <div class="video-options-region"></div>\r\n </div>\r\n </div>\r\n</div>\r\n<div class="p-2 text-center">\r\n <button class="add-advanced-metadata btn btn-link">'+(null!=(r=n.if.call(s,null!=(r=null!=t?t.options:t)?r.showAdvanced:r,{name:"if",hash:{},fn:e.program(1,i,0),inverse:e.program(3,i,0),data:i}))?r:"")+"</a>\r\n</div>"},useData:!0})},1366: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,i){var r;e.propertyIsEnumerable;return e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.name:r,t))},useData:!0})},1367: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,i){var r;e.propertyIsEnumerable;return e.escapeExpression((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"uploading",{name:"lang",hash:{percentage:null!=(r=null!=t?t.options:t)?r.percentage:r},data:i}))},useData:!0})},1368:function(e,t,n){e.exports={title:"_2yTdm"}},1369:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,i){return" on"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,i){e.propertyIsEnumerable;var r,a=null!=t?t:e.nullContext||{},l=e.hooks.helperMissing,s=e.escapeExpression;return"<h5>"+s((n.lang||t&&t.lang||l).call(a,"heading",{name:"lang",hash:{},data:i}))+'</h5>\r\n<div class="container-fluid">\r\n <div class="row">\r\n <div class="form-group col-6 p-0">\r\n <div class="d-block">\r\n <label>'+s((n.lang||t&&t.lang||l).call(a,"autoCaptioningHeading",{name:"lang",hash:{},data:i}))+'</label>\r\n <div class="custom-toggle toggle-option float-right'+(null!=(r=n.if.call(a,null!=(r=null!=t?t.options:t)?r.isSelected:r,{name:"if",hash:{},fn:e.program(1,i,0),inverse:e.noop,data:i}))?r:"")+'"><span class="handle"></span></div>\r\n </div>\r\n <p class=\'mb-0 mr-5\'>'+s((n.lang||t&&t.lang||l).call(a,"autoCaptioningInfo",{name:"lang",hash:{},data:i}))+"</p>\r\n </div>\r\n </div>\r\n</div>\r\n \r\n"},useData:!0})},1474:function(e,t,n){"use strict";n.r(t);var o=n(1),i=n(6),r=n(2),a=n(30),l=n(5),s=n(3),c=n(51),u=n(15),d=n(68),f=n(1359),p=n.n(f),h=n(325),y=n(317),m=n(12),g=n(265),v=n(1360),b=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 k(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?Object.setPrototypeOf.bind():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=N(e);if(t){var i=N(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return C(this,n)}}function C(e,t){if(t&&("object"===w(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function N(e){return(N=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var P=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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&S(e,t)}(l,e);var t,n,o,r=O(l);function l(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),r.call(this,e)}return t=l,(n=[{key:"initialize",value:function(){this.model=a.a.get("upload:progress:".concat(h.d.Video)),this.listenTo(this.model,"change:done",this.render),this.listenTo(this.channelName,"continue",this.onClickContinue),this.listenTo(this.options.uploadChannelName,"start:spinner",this.startSpinner)}},{key:"name",get:function(){return"UploadActionsComponent"}},{key:"lang",get:function(){return"upload.uploadActions"}},{key:"template",get:function(){return b.a}},{key:"className",get:function(){return"clearfix my-3"}},{key:"channelName",get:function(){return"".concat(this.name).concat(this.cid)}},{key:"regions",value:function(){return{finishButton:{el:".finish-button-region",replaceElement:!0}}}},{key:"behaviors",get:function(){return[{behaviorClass:y.a,buttonSelector:".add-more-videos",channelName:this.options.uploadChannelName,acceptMultiple:!0,mimeType:"video/*"}]}},{key:"startSpinner",value:function(){i.Radio.channel(this.channelName).trigger(g.b.ShowSpinner)}},{key:"onClickContinue",value:function(){this.model.get("done")&&i.Radio.channel(this.options.uploadChannelName).trigger("continue")}},{key:"onRender",value:function(){this.showChildView("finishButton",new g.a({channelName:this.channelName,disabled:!this.model.get("done"),saveEvent:"continue",extraButtonClass:"btn-primary float-right ml-3",buttonText:s.a.getPhrase(this.lang,"finish"),spinnerOptions:{size:m.s.Small,type:m.t.Light,extraClasses:"mx-auto"},tooltip:{title:this.model.get("done")?"":s.a.getPhrase(this.lang,"stillUploading")}}))}}])&&k(t.prototype,n),o&&k(t,o),Object.defineProperty(t,"prototype",{writable:!1}),l}(r.a.Component),x=n(29),T=n(203),j=n(205),E=n(103),_=n(1205),I=n(1208),R=n(1210),D=n(1058),A=(n(322),n(323),n(154)),L=n(87),M=n(1064),F=n(42),V=n(48),U=n(62),B=n(1105),z=n(1361),H=n.n(z);function J(e){return(J="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 K(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 q(e,t){return(q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function W(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 i=Y(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return G(this,n)}}function G(e,t){if(t&&("object"===J(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Y(e){return(Y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Q=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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&q(e,t)}(l,e);var t,n,r,a=W(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:"initialize",value:function(){this.prepareData(),this.bindListeners()}},{key:"lang",get:function(){return"libraryEditor.folderSelect"}},{key:"prepareData",value:function(){var e=this.options.library?this.options.library.collection:this.collection;this.collection=V.a.flatten(e),m.c.setSelected(this.options.currentFolderId,this.collection),this.options.canCreateFolder&&this.collection.add({name:s.a.getPhrase(this.lang,"createNew"),eventName:"create:folder"})}},{key:"bindListeners",value:function(){var e=this;this.listenTo(this.channelName,"create:folder",this.onClickCreateFolder),this.listenTo(this.channelName,"select:option:selected",(function(t){i.Radio.channel(e.options.channelName).trigger("folder:selected",t)}))}},{key:"channelName",get:function(){return"".concat(this.name).concat(this.cid)}},{key:"folderTreeKey",get:function(){return"folderselect:".concat(this.cid)}},{key:"name",get:function(){return"FolderSelectView"}},{key:"className",get:function(){return"position-relative"}},{key:"template",get:function(){return H.a}},{key:"regions",value:function(){return{dropdown:{el:".dropdown-menu-region",replaceElement:!0}}}},{key:"onClickCreateFolder",value:function(){i.Radio.channel(this.options.channelName).trigger("create:folder:clicked")}},{key:"generatePrefix",value:function(){var e=this.model.get("depth");if(!o.isNumber(e)||this.model.get("hidePrefix"))return"";for(var t="",n=0;n<e;n++)t+="&nbsp;&nbsp;";return e&&(t+="- "),t}},{key:"getIsOptionDisabledFn",value:function(){var e=this.options.disableLibraries,t=this.options.disabledFolderIds;return function(n){var i=n||this.model;return!(!e||i.get("type")!==U.a.CustomLibrary)||!(!t||!o.contains(t,i.get("id").toString()))}}},{key:"onRender",value:function(){this.showChildView("dropdown",new B.a({collection:this.collection,channelName:this.channelName,childOptions:{titleProperty:"name",eventName:"select:option:click",prefixHandler:this.generatePrefix,currentSelectedMessage:this.options.currentSelectedMessage||s.a.getPhrase(this.lang,"current"),isDisabled:this.getIsOptionDisabledFn(),truncateOptionNames:!0},placeholderText:this.options.placeholderText||s.a.getPhrase(this.lang,"placeholder"),noOptionsText:s.a.getPhrase(this.lang,"noFolders"),inputName:this.options.inputName,disabled:0===this.collection.length||this.options.disabled,analyticsHelper:F.a}))}}])&&K(t.prototype,n),r&&K(t,r),Object.defineProperty(t,"prototype",{writable:!1}),l}(r.a.Component),X=n(1362),Z=n.n(X),ee=n(1363),te=n.n(ee);function ne(e){return(ne="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 ie(e,t){return(ie=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function re(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=le(e);if(t){var i=le(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return ae(this,n)}}function ae(e,t){if(t&&("object"===ne(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function le(e){return(le=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var se=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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ie(e,t)}(a,e);var t,n,o,r=re(a);function a(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),r.call(this,e)}return t=a,(n=[{key:"initialize",value:function(){var e=this;this.librariesWithoutFolders=new A.a,this.collection.each((function(t){return e.librariesWithoutFolders.add(t.toFlatJSON())})),this.listenTo(this.libraryChannelName,"folder:selected",this.onLibrarySelected),this.listenTo(this.channelName,"folder:selected new:folder:selected",this.onFolderSelected),this.listenTo(this.channelName,"create:folder:clicked",this.onCreateFolderClicked),!this.hasMultipleLibraries()&&this.librariesWithoutFolders.first()&&this.model.set("libraryId",this.librariesWithoutFolders.first().get("id"));var t=this.collection.get(this.model.get("libraryId"));if(t){var n=m.f.getSelected(this.folderTreeKey,t.children);this.options.preselectedFolderId&&!n&&this.onFolderSelected(this.options.preselectedFolderId)}}},{key:"name",get:function(){return"UploadFolderSelectComponent"}},{key:"template",get:function(){return te.a}},{key:"lang",get:function(){return"upload.uploadFolderSelect"}},{key:"folderTreeKey",get:function(){return"folder:tree:".concat(this.model.cid)}},{key:"regions",value:function(){return{librarySelect:".library-select-region",folderSelect:".folder-select-region"}}},{key:"hasMultipleLibraries",value:function(){return this.librariesWithoutFolders.length>1}},{key:"libraryChannelName",get:function(){return"".concat(this.channelName,":").concat(this.options.selectId,":libraries")}},{key:"channelName",get:function(){return"".concat(this.name).concat(this.cid).concat(this.options.selectId)}},{key:"onLibrarySelected",value:function(e){this.model.set("libraryId",e.get("id")),this.model.unset("folderId"),this.render()}},{key:"onFolderSelected",value:function(e){var t=e;e instanceof L.a&&(t=e.get("id")),this.model.set("folderId",t);var n=this.collection.get(this.model.get("libraryId")).children;m.f.setSelected(this.folderTreeKey,t,n),this.model.validate()}},{key:"onCreateFolderClicked",value:function(){i.Radio.channel(this.options.channelName).trigger("show:new:folder",this.model.get("libraryId"),this.channelName)}},{key:"renderLibrarySelect",value:function(){if(this.hasMultipleLibraries()){var e=new Q({collection:this.librariesWithoutFolders,channelName:this.libraryChannelName,placeholderText:s.a.getPhrase(this.lang,"selectLibraryPlaceholder"),currentFolderId:this.model.get("libraryId"),currentSelectedMessage:s.a.getPhrase(this.lang,"currentLibrary"),inputName:"libraryId",canCreateFolder:!1});this.showChildView("librarySelect",e)}}},{key:"renderFolderSelect",value:function(){var e=this.model.get("libraryId");if(e){var t=this.collection.get(e);this.showChildView("folderSelect",new M.a({collection:t.children,channelName:this.channelName,folderTreeKey:this.folderTreeKey,canCreateNew:!0,name:"folderId"}))}}},{key:"viewOptions",value:function(){return{styles:Z.a,hasMultipleLibraries:this.hasMultipleLibraries(),requiredFields:this.options.requiredFields}}},{key:"onRender",value:function(){this.renderLibrarySelect(),this.renderFolderSelect()}}])&&oe(t.prototype,n),o&&oe(t,o),Object.defineProperty(t,"prototype",{writable:!1}),a}(r.a.Component),ce=n(1364),ue=n.n(ce);function de(e){return(de="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 fe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pe(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 he(e,t){return(he=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function ye(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=ge(e);if(t){var i=ge(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return me(this,n)}}function me(e,t){if(t&&("object"===de(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ge(e){return(ge=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ve=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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&he(e,t)}(r,e);var t,n,o,i=ye(r);function r(){return fe(this,r),i.apply(this,arguments)}return t=r,(n=[{key:"initialize",value:function(){this.listenTo(this.model,"change:progress",this.update)}},{key:"name",get:function(){return"UploadProgressComponent"}},{key:"template",get:function(){return ue.a}},{key:"className",get:function(){return"progress my-3"}},{key:"elements",get:function(){return{progressBar:".progress-bar"}}},{key:"update",value:function(){var e=this.model.get("progress"),t=this.getUI("progressBar");t&&t.get(0)&&$(t.get(0)).css("width","".concat(e,"%"))}}])&&pe(t.prototype,n),o&&pe(t,o),Object.defineProperty(t,"prototype",{writable:!1}),r}(r.a.Component),be=n(1365),we=n.n(be),ke=n(1366),Se=n.n(ke),Oe=n(1367),Ce=n.n(Oe),Ne=n(1368),Pe=n.n(Ne),xe=n(1369),Te=n.n(xe);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 Ee(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 _e(e,t){return(_e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Ie(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 i=De(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return Re(this,n)}}function Re(e,t){if(t&&("object"===je(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function De(e){return(De=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ae=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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_e(e,t)}(r,e);var t,n,o,i=Ie(r);function r(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),i.call(this,e)}return t=r,(n=[{key:"name",get:function(){return"UploadVideoOptionsComponent"}},{key:"template",get:function(){return Te.a}},{key:"lang",get:function(){return"upload.uploadVideoOptions"}},{key:"tagName",get:function(){return"form"}},{key:"className",get:function(){return"border-top pt-3"}},{key:"events",value:function(){return{"click .toggle-option":"onToggleAutoCaptioning"}}},{key:"onToggleAutoCaptioning",value:function(e){e.stopPropagation(),this.model.set("autoCaption",!this.model.get("autoCaption")),this.render()}},{key:"viewOptions",value:function(){return{isSelected:this.model.get("autoCaption")}}}])&&Ee(t.prototype,n),o&&Ee(t,o),Object.defineProperty(t,"prototype",{writable:!1}),r}(r.a.Component);function Le(e){return(Le="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 Me(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fe(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&&Fe(e.prototype,t),n&&Fe(e,n),Object.defineProperty(e,"prototype",{writable:!1}),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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Be(e,t)}function Be(e,t){return(Be=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function ze(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=Je(e);if(t){var i=Je(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return He(this,n)}}function He(e,t){if(t&&("object"===Le(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Je(e){return(Je=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ke=function(e){Ue(n,e);var t=ze(n);function n(){return Me(this,n),t.apply(this,arguments)}return Ve(n,[{key:"initialize",value:function(){this.listenTo(this.model,"change:name",this.render)}},{key:"name",get:function(){return"UploadTitleComponent"}},{key:"template",get:function(){return Se.a}},{key:"tagName",get:function(){return"h3"}},{key:"className",get:function(){return"mb-0 border-bottom p-3 ".concat(Pe.a.title)}},{key:"viewOptions",value:function(){return{name:this.model.get("name")||this.model.get("fileName")}}}]),n}(r.a.Component),qe=function(e){Ue(n,e);var t=ze(n);function n(){return Me(this,n),t.apply(this,arguments)}return Ve(n,[{key:"initialize",value:function(){this.listenTo(this.model,"change:progress",this.render)}},{key:"name",get:function(){return"TextProgressComponent"}},{key:"template",get:function(){return Ce.a}},{key:"lang",get:function(){return"upload.uploadVideo"}},{key:"className",get:function(){return" text-muted"}},{key:"tagName",get:function(){return"p"}},{key:"viewOptions",value:function(){return{percentage:Math.round(this.model.get("progress")||0)}}}]),n}(r.a.Component),We=function(e){Ue(n,e);var t=ze(n);function n(e){return Me(this,n),t.call(this,e)}return Ve(n,[{key:"initialize",value:function(){this.viewModel=a.a.get("upload:".concat(this.model.get("id")),{name:this.model.get("name"),fileName:this.model.get("name"),showAdvanced:this.options.openAdvancedMetadata,rating:this.options.ratings.findWhere({value:0}),folderId:this.options.folderId,libraryId:this.options.libraryId,timeInitialized:x(),autoCaption:!1},{ctor:E.a}),this.viewModel.addValidation(D.a),this.listenTo(this.channelName,"select:rating",o.partial(this.onAssociationSelected,o,"rating")),this.listenTo(this.channelName,"select:channel",o.partial(this.onAssociationSelected,o,"channel")),this.listenTo(this.channelName,"add:producers",this.onSelectProducer),this.listenTo(this.channelName,"add:distributors",this.onSelectDistributor),this.listenTo(this.channelName,"add:productionCompanies",this.onSelectProductionCompany),this.listenTo(this.channelName,"add:directors",this.onSelectDirector),this.listenTo(this.channelName,"select:series",this.onSelectSeries),this.listenTo(this.channelName,"add:season",this.onSelectSeason),this.listenTo(this.options.uploadChannelName,"invalid:".concat(this.model.get("id")),this.scrollTo)}},{key:"name",get:function(){return"UploadVideoComponent"}},{key:"template",get:function(){return we.a}},{key:"className",get:function(){return"bg-white mb-3"}},{key:"lang",get:function(){return"upload.uploadVideo"}},{key:"events",value:function(){return{"click .add-advanced-metadata":"onClickAddAdvancedMetadata","click .cancel-upload":"onClickCancelUpload"}}},{key:"channelName",get:function(){return"".concat(this.name).concat(this.cid)}},{key:"regions",value:function(){return{progress:{el:".upload-progress-region",replaceElement:!0},thumbnail:{el:".thumbnail-region",replaceElement:!0},uploadTitle:{el:".upload-title-region",replaceElement:!0},folderSelect:{el:".folder-select-region",replaceElement:!0},textProgress:{el:".text-progress-region",replaceElement:!0},videoDetails:{el:".video-details-region",replaceElement:!0},productionInfo:{el:".production-info-region",replaceElement:!0},advancedDetails:{el:".additional-info-region",replaceElement:!0},uploadOptions:{el:".video-options-region",replaceElement:!0}}}},{key:"onClickAddAdvancedMetadata",value:function(){this.viewModel.set("showAdvanced",!this.viewModel.get("showAdvanced")),this.render()}},{key:"onClickCancelUpload",value:function(){var e=this,t={title:s.a.getPhrase(this.lang,"cancelHeading"),text:s.a.getPhrase(this.lang,"cancelBody",{videoTitle:this.model.get("name")}),buttons:[{text:s.a.getPhrase(this.lang,"yes"),className:"btn btn-primary",success:!0},{text:s.a.getPhrase(this.lang,"no"),className:"btn btn-link",close:!0}],channelName:this.channelName};new m.d(t).render().done((function(){i.Radio.channel(e.options.uploadChannelName).trigger("cancel:upload",e.model.get("id"))}))}},{key:"onAssociationSelected",value:function(e,t){var n=this.viewModel.get(t);if(n instanceof r.a.Collection){var i=n.filter((function(t){return!t.id||t.name===e.name}));o.each(i,(function(e){return n.remove(e)})),this.viewModel.get(t).add(e)}else this.viewModel.set(t,e)}},{key:"onSelectSeries",value:function(e){var t=this,n=i.Radio.channel(this.options.uploadChannelName);e.id?n.trigger("get:series",e.id,(function(e){t.onAssociationSelected(e.toJSON(),"series"),t.renderAdvancedVideoDetails()})):e.name&&n.trigger("create:series",e.name,(function(e){t.onAssociationSelected(e.toJSON(),"series"),t.renderAdvancedVideoDetails()}))}},{key:"onSelectSeason",value:function(e){var t=this;if(o.isNull(e))return this.viewModel.get("season").clear({silent:!0}),m.c.deselectAll(this.viewModel.get("series.seasons")),this.onAssociationSelected(null,"season"),void this.renderAdvancedVideoDetails();if(e.id)return m.c.setSelected(e.id,this.viewModel.get("series.seasons")),this.onAssociationSelected(e,"season"),void this.renderAdvancedVideoDetails();if(e.number){var n=this.viewModel.get("series.id");i.Radio.channel(this.options.uploadChannelName).trigger("create:season",e,n,(function(e){t.viewModel.get("series.seasons").add(e.toJSON()),m.c.setSelected(e.id,t.viewModel.get("series.seasons")),t.onAssociationSelected(e.toJSON(),"season"),t.renderAdvancedVideoDetails()}))}}},{key:"onSelectDistributor",value:function(e){var t=this;e.id?this.onAssociationSelected(e,"distributors"):e.name&&i.Radio.channel(this.options.uploadChannelName).trigger("create:company",e.name,(function(e){t.onAssociationSelected(e.toJSON(),"distributors")}))}},{key:"onSelectProductionCompany",value:function(e){var t=this;e.id?this.onAssociationSelected(e,"productionCompanies"):e.name&&i.Radio.channel(this.options.uploadChannelName).trigger("create:company",e.name,(function(e){t.onAssociationSelected(e.toJSON(),"productionCompanies")}))}},{key:"onSelectDirector",value:function(e){var t=this;e.id?this.onAssociationSelected(e,"directors"):e.name&&i.Radio.channel(this.options.uploadChannelName).trigger("create:person",e.name,(function(e){t.onAssociationSelected(e.toJSON(),"directors")}))}},{key:"onSelectProducer",value:function(e){var t=this;e.id?this.onAssociationSelected(e,"producers"):e.name&&i.Radio.channel(this.options.uploadChannelName).trigger("create:person",e.name,(function(e){t.onAssociationSelected(e.toJSON(),"producers")}))}},{key:"getRequiredFields",value:function(){return{uploadDestination:!0}}},{key:"renderTitle",value:function(){var e=new Ke({model:this.viewModel});this.showChildView("uploadTitle",e)}},{key:"renderThumbnail",value:function(){var e=new T.a({model:this.viewModel,thumbnailOptions:{size:j.a.Medium}});this.showChildView("thumbnail",e)}},{key:"renderProgress",value:function(){var e=new ve({model:this.model});this.showChildView("progress",e);var t=new qe({model:this.model});this.showChildView("textProgress",t)}},{key:"renderBasicVideoDetails",value:function(){var e=new _.a({model:this.viewModel,channelName:this.channelName,ratings:this.options.ratings,requiredFields:this.getRequiredFields(),editable:!0});this.showChildView("videoDetails",e)}},{key:"renderFolderSelect",value:function(){var e=new se({collection:this.options.libraries,selectId:this.model.get("id"),model:this.viewModel,channelName:this.options.uploadChannelName,requiredFields:this.getRequiredFields(),preselectedFolderId:this.options.folderId});this.showChildView("folderSelect",e)}},{key:"renderAdvancedVideoDetails",value:function(){if(this.viewModel.get("showAdvanced")){var e=new I.a({channelName:this.channelName,model:this.viewModel,libraries:this.options.libraries,hostedLibraries:this.options.hostedLibraries,editable:!0}),t=new R.a({channelName:this.channelName,model:this.viewModel,editable:!0});this.showChildView("advancedDetails",e),this.showChildView("productionInfo",t),this.options.allowAutoCaptioning&&this.showChildView("uploadOptions",new Ae({model:this.viewModel}))}}},{key:"scrollTo",value:function(){$("html,body").animate({scrollTop:this.$el.offset().top},250)}},{key:"viewOptions",value:function(){return Object.assign({styles:Pe.a},this.viewModel.toJSON())}},{key:"onRender",value:function(){this.renderTitle(),this.renderThumbnail(),this.renderProgress(),this.renderBasicVideoDetails(),this.renderFolderSelect(),this.renderAdvancedVideoDetails(),i.Validation.bind(this,{model:this.viewModel})}},{key:"onDestroy",value:function(){i.Validation.unbind(this)}}]),n}(r.a.Component);function $e(e){return($e="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 Ge(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 Ye(e,t){return(Ye=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Qe(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=Ze(e);if(t){var i=Ze(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return Xe(this,n)}}function Xe(e,t){if(t&&("object"===$e(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Ze(e){return(Ze=Object.setPrototypeOf?Object.getPrototypeOf.bind():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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ye(e,t)}(r,e);var t,n,o,i=Qe(r);function r(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),i.call(this,e)}return t=r,(n=[{key:"name",get:function(){return"UploadVideoComponentCollection"}},{key:"childView",get:function(){return We}},{key:"childViewOptions",get:function(){return{ratings:this.options.ratings,libraries:this.options.libraries,hostedLibraries:this.options.hostedLibraries,uploadChannelName:this.options.uploadChannelName,folderId:this.options.folderId,libraryId:this.options.libraryId,allowAutoCaptioning:this.options.allowAutoCaptioning,openAdvancedMetadata:this.collection.length<=1}}}])&&Ge(t.prototype,n),o&&Ge(t,o),Object.defineProperty(t,"prototype",{writable:!1}),r}(r.a.ComponentCollection),tt=n(0),nt=n(201),ot=n(145),it=n(147),rt=n(4),at=n(45),lt=n(104);function st(e){return(st="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 ct(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 ut(e,t){return(ut=Object.setPrototypeOf?Object.setPrototypeOf.bind():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=pt(e);if(t){var i=pt(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return ft(this,n)}}function ft(e,t){if(t&&("object"===st(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function pt(e){return(pt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"UploadVideosView",(function(){return ht}));var ht=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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ut(e,t)}(y,e);var t,n,f,h=dt(y);function y(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,y),h.call(this,e)}return t=y,(n=[{key:"initialize",value:function(){this.initServices(),this.initDataListeners(),this.initComponentListeners(),this.initCollectionListeners(),this.initShellListeners()}},{key:"name",get:function(){return"UploadVideosView"}},{key:"title",get:function(){return s.a.getPhrase(this.lang,"title")}},{key:"lang",get:function(){return"upload.uploadVideos"}},{key:"template",get:function(){return p.a}},{key:"regions",value:function(){return{topActions:{el:".top-actions-region",replaceElement:!0},bottomActions:{el:".bottom-actions-region",replaceElement:!0},videos:{el:".videos-region",replaceElement:!0}}}},{key:"channelName",get:function(){return"".concat(this.name).concat(this.cid)}},{key:"initServices",value:function(){this.videoDataService=l.a.getInstance(tt.g.Video,this),this.libraryDataService=l.a.getInstance(tt.g.Library,this),this.videoUploadService=l.a.getInstance(tt.x.VideoUpload,this),this.videoUploadDataService=l.a.getInstance(tt.g.VideoUpload,this),this.seriesDataService=l.a.getInstance(tt.g.Series,this),this.ratingsDataService=l.a.getInstance(tt.g.Ratings,this),this.companyDataService=l.a.getInstance(tt.g.Company,this),this.personDataService=l.a.getInstance(tt.g.Person,this),this.alertService=l.a.getInstance(tt.x.Alerts,this),this.navLockService=l.a.getInstance(tt.x.NavLock,this),this.settingsDataService=l.a.getInstance(tt.g.Settings,this)}},{key:"initDataListeners",value:function(){this.listenTo(tt.e.RATINGS,"".concat(tt.f.RATINGS,":sync"),this.render),this.listenTo(tt.e.LIBRARY,"hosted:libraries:sync",this.render),this.listenTo(tt.e.LIBRARY,"folder:created",this.onFolderCreated)}},{key:"initComponentListeners",value:function(){this.listenTo(this.channelName,"continue",this.onClickContinue),this.listenTo(this.channelName,"cancel:upload",this.cancelUpload),this.listenTo(this.channelName,at.a.FILES_SELECTED,this.onFilesSelected),this.listenTo(this.channelName,"show:new:folder",this.onClickNewFolder),this.listenTo(this.channelName,"get:series",this.onSelectSeries),this.listenTo(this.channelName,"create:series",this.onCreateSeries),this.listenTo(this.channelName,"create:season",this.onCreateSeason),this.listenTo(this.channelName,"create:company",this.onCreateCompany),this.listenTo(this.channelName,"create:person",this.onCreatePerson)}},{key:"initCollectionListeners",value:function(){var e=this.videoUploadService.getCollection();this.listenTo(e,"remove",this.onCollectionChange)}},{key:"initShellListeners",value:function(){this.listenTo(u.a.SHELL,r.a.EventNames.NAV_UNLOCKED_BY_USER,this.onNavigateAway)}},{key:"cancelUpload",value:function(e){this.logCancelAction(e),this.videoUploadService.cancelUpload(e)}},{key:"onNavigateAway",value:function(){this.logCancelAction(),this.videoUploadService.cancelAllUploads()}},{key:"onCollectionChange",value:function(e,t){t.length||(this.navLockService.unlock(),r.a.AppLinkHelper.trigger({application:tt.b.UPLOAD,action:tt.a.Upload.FILE_SELECTION}))}},{key:"onSelectSeries",value:function(e,t){this.seriesDataService.getSeries(e,t)}},{key:"onCreateSeries",value:function(e,t){this.seriesDataService.createSeries(e,t)}},{key:"onCreateSeason",value:function(e,t,n){this.seriesDataService.createSeason(e,t,n)}},{key:"onCreateCompany",value:function(e,t){this.companyDataService.createCompany(e,t)}},{key:"onCreatePerson",value:function(e,t){this.personDataService.createPerson(e,t)}},{key:"onClickContinue",value:function(){var e,t=this,n=i.Radio.channel(this.channelName),o=this.videoUploadService.getCollection(),u=!0;if(o.each((function(t){var n=a.a.get("upload:".concat(t.get("id")),null,{ctor:E.a});n.validate();var o=n.isValid();!1!==o||e||(e=t.id),u=u&&o})),e&&n.trigger("invalid:".concat(e)),u){n.trigger("start:spinner");var d=[];o.each((function(e){var n=e.get("file"),i=a.a.get("upload:".concat(e.get("id")),null,{ctor:E.a});if(lt.a.hasExpired(i,t.config.get("uploadSessionExpiryTime")))return t.alertService.createAlert({heading:s.a.getPhrase(t.lang,"uploadErrorHeading"),message:s.a.getPhrase(t.lang,"uploadErrorBody",{videoName:i.get("name")}),type:c.a.Fail}),void o.remove(e);i.set("fileId",n.cvUpload.fileId),i.set("fileSize",n.size),d.push(i)})),this.videoUploadDataService.completeVideoUploads(this.currentUser.get("id"),this.currentUser.get("customerId"),d,(function(){t.navLockService.unlock(),l.a.getInstance(tt.x.PendingItems).forceFetchPendingItems(),l.a.releaseInstance(tt.x.PendingItems),r.a.AppLinkHelper.trigger({application:tt.b.UPLOAD,action:d.length?tt.a.Upload.UPLOAD_COMPLETE:tt.a.Upload.FILE_SELECTION}),t.logFinishAction(d),t.videoDataService.clearVideoCache()}))}}},{key:"onFilesSelected",value:function(e,t){this.videoUploadService.addFiles(e),this.logStartAction(e,t)}},{key:"onClickNewFolder",value:function(e,t){this.setFolderChannel=t,this.navLockService.unlock(),r.a.AppLinkHelper.trigger({application:tt.b.UPLOAD,action:tt.a.Shared.NEW_FOLDER,args:[e]}),this.lockNav()}},{key:"onFolderCreated",value:function(e){this.setFolderChannel&&(i.Radio.channel(this.setFolderChannel).trigger("new:folder:selected",e),this.render())}},{key:"logStartAction",value:function(e,t){var n=F.a.mergeOptions(this.options.analyticsOptions,{workflowPhase:rt.WorkflowPhase.Start,descriptor:F.a.mapInteractionType(t)});F.a.logUserAction(e,n)}},{key:"logCancelAction",value:function(e){var t=this.videoUploadService.getCollection();if(t.length){var n=e?t.get(e):t,o=F.a.mergeOptions(this.options.analyticsOptions,{workflowPhase:rt.WorkflowPhase.Discard,descriptor:e?rt.OperationDescriptor.Single:rt.OperationDescriptor.All});F.a.logUserAction(n.toJSON(),o)}}},{key:"logFinishAction",value:function(e){if(e.length){var t=o.map(e,(function(e){return e.toJSON()})),n=F.a.mergeOptions(this.options.analyticsOptions,{workflowPhase:rt.WorkflowPhase.Complete});F.a.logUserAction(t,n)}}},{key:"fetchData",value:function(){this.ratings=this.ratingsDataService.getAllRatings(),this.hostedLibraries=this.libraryDataService.getLibraries(),this.autoCaptioning=this.settingsDataService.getSetting(this.currentUser.get("customerId"),d.a.AutoCaptioning)}},{key:"renderUploadActions",value:function(){this.showChildView("topActions",new P({uploadChannelName:this.channelName})),this.showChildView("bottomActions",new P({uploadChannelName:this.channelName}))}},{key:"renderVideos",value:function(){var e={collection:this.videoUploadService.getCollection(),ratings:this.ratings,libraries:this.libraries,hostedLibraries:this.hostedLibraries,uploadChannelName:this.channelName,allowAutoCaptioning:this.autoCaptioning.get("value")};if(this.options.folderId){var t=m.f.getLibrary(this.options.folderId,this.libraries);t&&(e.folderId=this.options.folderId,e.libraryId=t.get("id"))}var n=new et(e);this.showChildView("videos",n)}},{key:"lockNav",value:function(){this.navLockService.lock({title:s.a.getPhrase(this.lang,"navLockHeading"),text:s.a.getPhrase(this.lang,"navLockBody")})}},{key:"requiredResources",get:function(){return{currentUser:ot.b.currentUser,libraries:it.b.libraries,config:nt.b.config}}},{key:"onBeforeRender",value:function(){return this.fetchData(),!!this.ratings&&!!this.hostedLibraries&&!!this.autoCaptioning}},{key:"onRender",value:function(){this.lockNav(),this.renderUploadActions(),this.renderVideos()}}])&&ct(t.prototype,n),f&&ct(t,f),Object.defineProperty(t,"prototype",{writable:!1}),y}(r.a.View)}}]);
1
+ (window.webpackJsonp_clickview_library_editor=window.webpackJsonp_clickview_library_editor||[]).push([[30],{1063:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var o=n(1),i=n(2),r=n(312);function a(e){return(a="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 l(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?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function c(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 i=d(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return u(this,n)}}function u(e,t){if(t&&("object"===a(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var f=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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s(e,t)}(u,e);var t,n,i,a=c(u);function u(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),a.call(this,e)}return t=u,(n=[{key:"name",get:function(){return"DropdownCollectionComponent"}},{key:"className",get:function(){return"dropdown-menu items-viewpart ".concat(this.getExtraClasses(this.options.displayOptions))}},{key:"attributes",get:function(){return{"aria-labelledby":"dropdownSelector"}}},{key:"initialize",value:function(){this.listenTo(this.options.channelName,"center:dropdown",this.centerSelectedItem)}},{key:"childView",get:function(){return r.a}},{key:"childViewOptions",get:function(){var e={channelName:this.options.channelName,analyticsHelper:this.options.analyticsHelper};return o.extend(e,this.options.childOptions)}},{key:"getExtraClasses",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.alignment,n=void 0===t?"left":t,o=e.extraClasses,i="dropdown-menu-".concat(n);return o&&(i="".concat(i," ").concat(o)),i}},{key:"centerSelectedItem",value:function(){var e=this.$el.find(".active");if(e.length){var t=this.$el.scrollTop()+e.position().top,n=.5*this.$el.height()+.5*e.height();this.$el.scrollTop(t-n)}}}])&&l(t.prototype,n),i&&l(t,i),Object.defineProperty(t,"prototype",{writable:!1}),u}(i.a.ComponentCollection)},1068:function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var o=n(6),i=n(2),r=n(3),a=n(1107),l=n(12),s=n(1070),c=n.n(s),u=n(1071),d=n.n(u);function f(e){return(f="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 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 h(e,t){return(h=Object.setPrototypeOf?Object.setPrototypeOf.bind():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 i=g(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return m(this,n)}}function m(e,t){if(t&&("object"===f(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf.bind():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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(u,e);var t,n,i,s=y(u);function u(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),s.call(this,e)}return t=u,(n=[{key:"initialize",value:function(){this.listenTo(this.options.channelName,"folder:selected new:folder:selected",this.setButtonText),this.listenTo(this.options.channelName,"re:render:selector",this.renderSelector),this.disabledIds=this.options.disabledIds&&this.options.disabledIds.reduce((function(e,t){return Object.assign(Object.assign({},e),function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},t,!0))}),{})}},{key:"name",get:function(){return"TreeDropdownComponent"}},{key:"template",get:function(){return c.a}},{key:"className",get:function(){return"position-relative"}},{key:"lang",get:function(){return"libraryEditor.treeDropdown"}},{key:"regions",value:function(){return{selector:{el:".selector-region",replaceElement:!1}}}},{key:"events",value:function(){return{"click .create-new":"onClickCreateNew"}}},{key:"defaults",get:function(){return{disabledIds:[]}}},{key:"elements",get:function(){return{button:".custom-select"}}},{key:"onClickCreateNew",value:function(e){e.preventDefault(),o.Radio.channel(this.options.channelName).trigger("create:folder:clicked")}},{key:"setButtonText",value:function(e,t){if(e&&!t){var n=e.get("name");this.getUI("button").text(n)}else{var o=l.f.getSelected(this.options.folderTreeKey,this.collection),i=o?o.get("name"):r.a.getPhrase(this.lang,"button");this.getUI("button").text(i)}}},{key:"renderSelector",value:function(){this.showChildView("selector",new a.a({styles:d.a,collection:this.collection,channelName:this.options.channelName,childrenProperty:"children",folderTreeId:this.options.folderTreeKey,extraClass:d.a.list,extraClasses:d.a.list,isSelector:!0,disabledIds:this.disabledIds||{}}))}},{key:"viewOptions",value:function(){return{styles:d.a,name:this.options.name||this.options.channelName,buttonText:this.buttonText,canCreateNew:this.options.canCreateNew}}},{key:"onRender",value:function(){this.setButtonText(),this.renderSelector()}}])&&p(t.prototype,n),i&&p(t,i),Object.defineProperty(t,"prototype",{writable:!1}),u}(i.a.Component)},1070:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,i){e.propertyIsEnumerable;var r,a=e.escapeExpression;return' <button class="create-new btn font-weight-bold rounded-0 w-100 text-left '+a(e.lambda(null!=(r=null!=(r=null!=t?t.options:t)?r.styles:r)?r.customItem:r,t))+'">'+a((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"createNew",{name:"lang",hash:{},data:i}))+"</button>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,i){e.propertyIsEnumerable;var r,a=e.lambda,l=e.escapeExpression;return'<button\r\n class="'+l(a(null!=(r=null!=(r=null!=t?t.options:t)?r.styles:r)?r.selectBtn:r,t))+' custom-select form-control"\r\n data-toggle="dropdown"\r\n aria-haspopup="true"\r\n aria-expanded="false"\r\n name='+l(a(null!=(r=null!=t?t.options:t)?r.name:r,t))+"\r\n>"+l(a(null!=(r=null!=t?t.options:t)?r.buttonText:r,t))+'</button>\r\n<div class="dropdown-menu '+l(a(null!=(r=null!=(r=null!=t?t.options:t)?r.styles:r)?r.selector:r,t))+'">\r\n <div class="selector-region"></div>\r\n'+(null!=(r=n.if.call(null!=t?t:e.nullContext||{},null!=(r=null!=t?t.options:t)?r.canCreateNew:r,{name:"if",hash:{},fn:e.program(1,i,0),inverse:e.noop,data:i}))?r:"")+'</div>\r\n<div class="form-feedback"></div>'},useData:!0})},1071:function(e,t,n){e.exports={selectBtn:"_2TTgs",list:"_3wN7o",selector:"_3Xf1P",customItem:"_199PI"}},1109:function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var o=n(1),i=n(6),r=n(2),a=n(1063),l=n(12),s=n(1110),c=n.n(s),u=n(1111),d=n.n(u);function f(e){return(f="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 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 h(e,t){return(h=Object.setPrototypeOf?Object.setPrototypeOf.bind():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 i=g(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return m(this,n)}}function m(e,t){if(t&&("object"===f(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf.bind():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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(u,e);var t,n,r,s=y(u);function u(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),(t=s.call(this,e)).selectSearch="",t.sameCharIndex=1,t.optionStep=1,t}return t=u,(n=[{key:"initialize",value:function(){this.setModel(),this.bindListeners()}},{key:"name",get:function(){return"SelectComponent"}},{key:"template",get:function(){return c.a}},{key:"regions",value:function(){return{dropdown:{el:".dropdown-region",replaceElement:!0}}}},{key:"events",value:function(){return{keydown:"onKeydown","shown.bs.dropdown":"onShowDropdown"}}},{key:"defaults",get:function(){return{displayProperty:"name"}}},{key:"elements",get:function(){return{dropdownToggle:".dropdown-toggle"}}},{key:"bindListeners",value:function(){this.listenTo(this.options.channelName,this.options.childOptions.eventName,this.onSelect)}},{key:"onShowDropdown",value:function(){i.Radio.channel(this.options.channelName).trigger("center:dropdown")}},{key:"onKeydown",value:function(e){38===e.keyCode||40===e.keyCode?this.onArrowKeyDown(e):13===e.keyCode?this.render():this.onType(e),i.Radio.channel(this.options.channelName).trigger("center:dropdown")}},{key:"onArrowKeyDown",value:function(e){l.c.getSelected(this.collection)?this.optionStep=1:this.optionStep=0;var t=this.getNextModel(e.keyCode);for(t||(l.c.deselectAll(this.collection),t=this.getNextModel(e.keyCode));this.isDisabled(t);)this.optionStep++,t=this.getNextModel(e.keyCode);this.onSelect(t)}},{key:"onType",value:function(e){if(1===e.key.toString().length){var t=this.getModelMatch(e);t&&this.onSelect(t),this.runTimer()}}},{key:"onSelect",value:function(e){this.isDisabled(e)||(l.c.setSelected(e.get("id"),this.collection),this.setModel(),this.getUI("dropdownToggle").text(this.getButtonText()),i.Radio.channel(this.options.channelName).trigger("select:option:selected",e))}},{key:"setModel",value:function(){this.model=l.c.getSelected(this.collection)}},{key:"getNextModel",value:function(e){var t,n=l.c.getSelected(this.collection)||this.collection.first(),o=this.collection.indexOf(n);return(t=38===e?this.collection.at(o-this.optionStep):this.collection.at(o+this.optionStep))||(l.c.deselectAll(this.collection),t=this.collection.first(),this.optionStep=0),t}},{key:"getModelMatch",value:function(e){var t,n=this;return 1===this.selectSearch.length&&this.selectSearch===e.key?t=this.handleSameCharIndex(e.key):(this.selectSearch+=e.key,this.sameCharIndex=1),t||(t=o.find(this.collection.models,(function(e){return e.get(n.options.displayProperty).toLowerCase().slice(0,n.selectSearch.length).includes(n.selectSearch.toLowerCase())}))),t}},{key:"handleSameCharIndex",value:function(e){var t=this,n=o.filter(this.collection.models,(function(n){return n.get(t.options.displayProperty).toLowerCase().slice(0,1)===e}));if(n.length>1){var i=n[this.sameCharIndex];return i||(i=o.first(n),this.sameCharIndex=0),this.sameCharIndex++,i}return o.first(n)}},{key:"runTimer",value:function(){var e=this;this.scopedTimerIndex&&clearTimeout(this.scopedTimerIndex),this.scopedTimerIndex=window.setTimeout((function(){e.selectSearch=""}),500)}},{key:"isDisabled",value:function(e){var t;if(e.get("divider"))return!0;if(!o.isFunction(this.options.childOptions.isDisabled))return!1;for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return(t=this.options.childOptions.isDisabled).call.apply(t,[this,e].concat(i))}},{key:"getButtonText",value:function(){if(this.options.disabled)return this.options.noOptionsText;var e=l.c.getSelected(this.collection);return e&&e.get(this.options.displayProperty)||this.options.placeholderText}},{key:"viewOptions",value:function(){return{styles:d.a,inputName:this.options.inputName,disabled:this.options.disabled,placeholderText:this.getButtonText()}}},{key:"onRender",value:function(){this.showChildView("dropdown",new a.a({collection:this.collection,channelName:this.options.channelName,childOptions:o.extend(this.options.childOptions),displayOptions:{extraClasses:"w-100 ".concat(d.a.dropdownMenu)},analyticsHelper:this.options.analyticsHelper}))}}])&&p(t.prototype,n),r&&p(t,r),Object.defineProperty(t,"prototype",{writable:!1}),u}(r.a.Component)},1110:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,i){var r;e.propertyIsEnumerable;return e.escapeExpression(e.lambda(null!=(r=null!=(r=null!=t?t.options:t)?r.styles:r)?r.disabled:r,t))},3:function(e,t,n,o,i){return" disabled"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,i){e.propertyIsEnumerable;var r,a=e.lambda,l=e.escapeExpression,s=null!=t?t:e.nullContext||{};return'<button \r\n class="dropdown-toggle form-control btn-block text-left position-relative '+l(a(null!=(r=null!=(r=null!=t?t.options:t)?r.styles:r)?r.selectButton:r,t))+" "+(null!=(r=n.if.call(s,null!=(r=null!=t?t.options:t)?r.disabled:r,{name:"if",hash:{},fn:e.program(1,i,0),inverse:e.noop,data:i}))?r:"")+'" \r\n type="button" \r\n id="dropdownMenuButton" \r\n data-toggle="dropdown" \r\n aria-haspopup="true" \r\n aria-expanded="false"\r\n '+(null!=(r=n.if.call(s,null!=(r=null!=t?t.options:t)?r.disabled:r,{name:"if",hash:{},fn:e.program(3,i,0),inverse:e.noop,data:i}))?r:"")+' \r\n name="'+l(a(null!=(r=null!=t?t.options:t)?r.inputName:r,t))+'"\r\n >\r\n '+l(a(null!=(r=null!=t?t.options:t)?r.placeholderText:r,t))+'\r\n</button>\r\n<div class="dropdown-region"></div>\r\n<div class="form-feedback"></div>'},useData:!0})},1111:function(e,t,n){e.exports={dropdownMenu:"_2RaQu",selectButton:"_2xGqi",disabled:"_15kWr"}},1363: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,i){return'<div class="top-actions-region"></div>\r\n<div class="videos-region"></div>\r\n<div class="bottom-actions-region"></div>'},useData:!0})},1364: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,i){e.propertyIsEnumerable;return'<div class="finish-button-region"></div>\r\n<button class="btn btn-secondary float-right add-more-videos">'+e.escapeExpression((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"addMore",{name:"lang",hash:{},data:i}))+"</button>"},useData:!0})},1365: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,i){return'<div class="dropdown-menu-region"></div>'},useData:!0})},1366:function(e,t,n){e.exports={requiredStar:"_3m_pH"}},1367:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,i){var r;e.propertyIsEnumerable;return'<span class="'+e.escapeExpression(e.lambda(null!=(r=null!=(r=null!=t?t.options:t)?r.styles:r)?r.requiredStar:r,t))+'">*</span>'},3:function(e,t,n,o,i){return' <div class="library-select-region form-group col-6"></div>\r\n'},5:function(e,t,n,o,i){return"col-6"},7:function(e,t,n,o,i){return"col-12"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,i){e.propertyIsEnumerable;var r,a=null!=t?t:e.nullContext||{};return"<h5>"+e.escapeExpression((n.lang||t&&t.lang||e.hooks.helperMissing).call(a,"uploadDestination",{name:"lang",hash:{},data:i}))+(null!=(r=n.if.call(a,null!=(r=null!=(r=null!=t?t.options:t)?r.requiredFields:r)?r.uploadDestination:r,{name:"if",hash:{},fn:e.program(1,i,0),inverse:e.noop,data:i}))?r:"")+'</h5>\r\n <div class="container-fluid px-0">\r\n <div class="row">\r\n'+(null!=(r=n.if.call(a,null!=(r=null!=t?t.options:t)?r.hasMultipleLibraries:r,{name:"if",hash:{},fn:e.program(3,i,0),inverse:e.noop,data:i}))?r:"")+' <div class="folder-select-region form-group '+(null!=(r=n.if.call(a,null!=(r=null!=t?t.options:t)?r.hasMultipleLibraries:r,{name:"if",hash:{},fn:e.program(5,i,0),inverse:e.program(7,i,0),data:i}))?r:"")+'"></div>\r\n </div>\r\n </div>\r\n</div>'},useData:!0})},1368: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,i){e.propertyIsEnumerable;var r,a=null!=t?t:e.nullContext||{},l=e.hooks.helperMissing,s=e.escapeExpression;return'<div class="progress-bar bg-info" style="width: '+s("function"==typeof(r=null!=(r=n.progress||(null!=t?t.progress:t))?r:l)?r.call(a,{name:"progress",hash:{},data:i}):r)+'%" aria-valuenow="'+s("function"==typeof(r=null!=(r=n.progress||(null!=t?t.progress:t))?r:l)?r.call(a,{name:"progress",hash:{},data:i}):r)+'" aria-valuemin="0" aria-valuemax="100"></div>'},useData:!0})},1369:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,i){e.propertyIsEnumerable;return e.escapeExpression((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"hideMetadata",{name:"lang",hash:{},data:i}))},3:function(e,t,n,o,i){e.propertyIsEnumerable;return e.escapeExpression((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"addMetadata",{name:"lang",hash:{},data:i}))},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,i){e.propertyIsEnumerable;var r,a,l=e.escapeExpression,s=null!=t?t:e.nullContext||{},c=e.hooks.helperMissing;return'<div class="upload-title-region"></div>\r\n<div class="container-fluid border-bottom">\r\n <div class="row">\r\n <div class="col-4 p-3">\r\n <div class="thumbnail-region"></div>\r\n <div class="upload-progress-region"></div>\r\n <div class="my-3">\r\n <h5 class="'+l(e.lambda(null!=(r=null!=(r=null!=t?t.options:t)?r.styles:r)?r.title:r,t))+'">'+l("function"==typeof(a=null!=(a=n.name||(null!=t?t.name:t))?a:c)?a.call(s,{name:"name",hash:{},data:i}):a)+'</h5>\r\n <div class="text-progress-region"></div>\r\n <button class="btn btn-secondary cancel-upload">'+l((n.lang||t&&t.lang||c).call(s,"cancel",{name:"lang",hash:{},data:i}))+'</button>\r\n </div>\r\n\r\n </div>\r\n <div class="col-8 py-3 pr-3">\r\n <div class="video-details-region"></div>\r\n <div class="folder-select-region"></div>\r\n <div class="additional-info-region"></div>\r\n <div class="production-info-region"></div>\r\n <div class="video-options-region"></div>\r\n </div>\r\n </div>\r\n</div>\r\n<div class="p-2 text-center">\r\n <button class="add-advanced-metadata btn btn-link">'+(null!=(r=n.if.call(s,null!=(r=null!=t?t.options:t)?r.showAdvanced:r,{name:"if",hash:{},fn:e.program(1,i,0),inverse:e.program(3,i,0),data:i}))?r:"")+"</a>\r\n</div>"},useData:!0})},1370: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,i){var r;e.propertyIsEnumerable;return e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.name:r,t))},useData:!0})},1371: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,i){var r;e.propertyIsEnumerable;return e.escapeExpression((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"uploading",{name:"lang",hash:{percentage:null!=(r=null!=t?t.options:t)?r.percentage:r},data:i}))},useData:!0})},1372:function(e,t,n){e.exports={title:"_2yTdm"}},1373:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,i){return" on"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,i){e.propertyIsEnumerable;var r,a=null!=t?t:e.nullContext||{},l=e.hooks.helperMissing,s=e.escapeExpression;return"<h5>"+s((n.lang||t&&t.lang||l).call(a,"heading",{name:"lang",hash:{},data:i}))+'</h5>\r\n<div class="container-fluid">\r\n <div class="row">\r\n <div class="form-group col-6 p-0">\r\n <div class="d-block">\r\n <label>'+s((n.lang||t&&t.lang||l).call(a,"autoCaptioningHeading",{name:"lang",hash:{},data:i}))+'</label>\r\n <div class="custom-toggle toggle-option float-right'+(null!=(r=n.if.call(a,null!=(r=null!=t?t.options:t)?r.isSelected:r,{name:"if",hash:{},fn:e.program(1,i,0),inverse:e.noop,data:i}))?r:"")+'"><span class="handle"></span></div>\r\n </div>\r\n <p class=\'mb-0 mr-5\'>'+s((n.lang||t&&t.lang||l).call(a,"autoCaptioningInfo",{name:"lang",hash:{},data:i}))+"</p>\r\n </div>\r\n </div>\r\n</div>\r\n \r\n"},useData:!0})},1478:function(e,t,n){"use strict";n.r(t);var o=n(1),i=n(6),r=n(2),a=n(30),l=n(5),s=n(3),c=n(51),u=n(15),d=n(68),f=n(1363),p=n.n(f),h=n(325),y=n(317),m=n(12),g=n(265),v=n(1364),b=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 k(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?Object.setPrototypeOf.bind():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=N(e);if(t){var i=N(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return C(this,n)}}function C(e,t){if(t&&("object"===w(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function N(e){return(N=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var P=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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&S(e,t)}(l,e);var t,n,o,r=O(l);function l(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),r.call(this,e)}return t=l,(n=[{key:"initialize",value:function(){this.model=a.a.get("upload:progress:".concat(h.d.Video)),this.listenTo(this.model,"change:done",this.render),this.listenTo(this.channelName,"continue",this.onClickContinue),this.listenTo(this.options.uploadChannelName,"start:spinner",this.startSpinner)}},{key:"name",get:function(){return"UploadActionsComponent"}},{key:"lang",get:function(){return"upload.uploadActions"}},{key:"template",get:function(){return b.a}},{key:"className",get:function(){return"clearfix my-3"}},{key:"channelName",get:function(){return"".concat(this.name).concat(this.cid)}},{key:"regions",value:function(){return{finishButton:{el:".finish-button-region",replaceElement:!0}}}},{key:"behaviors",get:function(){return[{behaviorClass:y.a,buttonSelector:".add-more-videos",channelName:this.options.uploadChannelName,acceptMultiple:!0,mimeType:"video/*"}]}},{key:"startSpinner",value:function(){i.Radio.channel(this.channelName).trigger(g.b.ShowSpinner)}},{key:"onClickContinue",value:function(){this.model.get("done")&&i.Radio.channel(this.options.uploadChannelName).trigger("continue")}},{key:"onRender",value:function(){this.showChildView("finishButton",new g.a({channelName:this.channelName,disabled:!this.model.get("done"),saveEvent:"continue",extraButtonClass:"btn-primary float-right ml-3",buttonText:s.a.getPhrase(this.lang,"finish"),spinnerOptions:{size:m.s.Small,type:m.t.Light,extraClasses:"mx-auto"},tooltip:{title:this.model.get("done")?"":s.a.getPhrase(this.lang,"stillUploading")}}))}}])&&k(t.prototype,n),o&&k(t,o),Object.defineProperty(t,"prototype",{writable:!1}),l}(r.a.Component),x=n(29),T=n(204),j=n(206),E=n(103),_=n(1209),I=n(1212),R=n(1214),D=n(1062),A=(n(322),n(323),n(154)),L=n(87),M=n(1068),F=n(42),V=n(48),U=n(62),B=n(1109),z=n(1365),H=n.n(z);function J(e){return(J="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 K(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 q(e,t){return(q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function W(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 i=Y(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return G(this,n)}}function G(e,t){if(t&&("object"===J(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Y(e){return(Y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Q=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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&q(e,t)}(l,e);var t,n,r,a=W(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:"initialize",value:function(){this.prepareData(),this.bindListeners()}},{key:"lang",get:function(){return"libraryEditor.folderSelect"}},{key:"prepareData",value:function(){var e=this.options.library?this.options.library.collection:this.collection;this.collection=V.a.flatten(e),m.c.setSelected(this.options.currentFolderId,this.collection),this.options.canCreateFolder&&this.collection.add({name:s.a.getPhrase(this.lang,"createNew"),eventName:"create:folder"})}},{key:"bindListeners",value:function(){var e=this;this.listenTo(this.channelName,"create:folder",this.onClickCreateFolder),this.listenTo(this.channelName,"select:option:selected",(function(t){i.Radio.channel(e.options.channelName).trigger("folder:selected",t)}))}},{key:"channelName",get:function(){return"".concat(this.name).concat(this.cid)}},{key:"folderTreeKey",get:function(){return"folderselect:".concat(this.cid)}},{key:"name",get:function(){return"FolderSelectView"}},{key:"className",get:function(){return"position-relative"}},{key:"template",get:function(){return H.a}},{key:"regions",value:function(){return{dropdown:{el:".dropdown-menu-region",replaceElement:!0}}}},{key:"onClickCreateFolder",value:function(){i.Radio.channel(this.options.channelName).trigger("create:folder:clicked")}},{key:"generatePrefix",value:function(){var e=this.model.get("depth");if(!o.isNumber(e)||this.model.get("hidePrefix"))return"";for(var t="",n=0;n<e;n++)t+="&nbsp;&nbsp;";return e&&(t+="- "),t}},{key:"getIsOptionDisabledFn",value:function(){var e=this.options.disableLibraries,t=this.options.disabledFolderIds;return function(n){var i=n||this.model;return!(!e||i.get("type")!==U.a.CustomLibrary)||!(!t||!o.contains(t,i.get("id").toString()))}}},{key:"onRender",value:function(){this.showChildView("dropdown",new B.a({collection:this.collection,channelName:this.channelName,childOptions:{titleProperty:"name",eventName:"select:option:click",prefixHandler:this.generatePrefix,currentSelectedMessage:this.options.currentSelectedMessage||s.a.getPhrase(this.lang,"current"),isDisabled:this.getIsOptionDisabledFn(),truncateOptionNames:!0},placeholderText:this.options.placeholderText||s.a.getPhrase(this.lang,"placeholder"),noOptionsText:s.a.getPhrase(this.lang,"noFolders"),inputName:this.options.inputName,disabled:0===this.collection.length||this.options.disabled,analyticsHelper:F.a}))}}])&&K(t.prototype,n),r&&K(t,r),Object.defineProperty(t,"prototype",{writable:!1}),l}(r.a.Component),X=n(1366),Z=n.n(X),ee=n(1367),te=n.n(ee);function ne(e){return(ne="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 ie(e,t){return(ie=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function re(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=le(e);if(t){var i=le(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return ae(this,n)}}function ae(e,t){if(t&&("object"===ne(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function le(e){return(le=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var se=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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ie(e,t)}(a,e);var t,n,o,r=re(a);function a(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),r.call(this,e)}return t=a,(n=[{key:"initialize",value:function(){var e=this;this.librariesWithoutFolders=new A.a,this.collection.each((function(t){return e.librariesWithoutFolders.add(t.toFlatJSON())})),this.listenTo(this.libraryChannelName,"folder:selected",this.onLibrarySelected),this.listenTo(this.channelName,"folder:selected new:folder:selected",this.onFolderSelected),this.listenTo(this.channelName,"create:folder:clicked",this.onCreateFolderClicked),!this.hasMultipleLibraries()&&this.librariesWithoutFolders.first()&&this.model.set("libraryId",this.librariesWithoutFolders.first().get("id"));var t=this.collection.get(this.model.get("libraryId"));if(t){var n=m.f.getSelected(this.folderTreeKey,t.children);this.options.preselectedFolderId&&!n&&this.onFolderSelected(this.options.preselectedFolderId)}}},{key:"name",get:function(){return"UploadFolderSelectComponent"}},{key:"template",get:function(){return te.a}},{key:"lang",get:function(){return"upload.uploadFolderSelect"}},{key:"folderTreeKey",get:function(){return"folder:tree:".concat(this.model.cid)}},{key:"regions",value:function(){return{librarySelect:".library-select-region",folderSelect:".folder-select-region"}}},{key:"hasMultipleLibraries",value:function(){return this.librariesWithoutFolders.length>1}},{key:"libraryChannelName",get:function(){return"".concat(this.channelName,":").concat(this.options.selectId,":libraries")}},{key:"channelName",get:function(){return"".concat(this.name).concat(this.cid).concat(this.options.selectId)}},{key:"onLibrarySelected",value:function(e){this.model.set("libraryId",e.get("id")),this.model.unset("folderId"),this.render()}},{key:"onFolderSelected",value:function(e){var t=e;e instanceof L.a&&(t=e.get("id")),this.model.set("folderId",t);var n=this.collection.get(this.model.get("libraryId")).children;m.f.setSelected(this.folderTreeKey,t,n),this.model.validate()}},{key:"onCreateFolderClicked",value:function(){i.Radio.channel(this.options.channelName).trigger("show:new:folder",this.model.get("libraryId"),this.channelName)}},{key:"renderLibrarySelect",value:function(){if(this.hasMultipleLibraries()){var e=new Q({collection:this.librariesWithoutFolders,channelName:this.libraryChannelName,placeholderText:s.a.getPhrase(this.lang,"selectLibraryPlaceholder"),currentFolderId:this.model.get("libraryId"),currentSelectedMessage:s.a.getPhrase(this.lang,"currentLibrary"),inputName:"libraryId",canCreateFolder:!1});this.showChildView("librarySelect",e)}}},{key:"renderFolderSelect",value:function(){var e=this.model.get("libraryId");if(e){var t=this.collection.get(e);this.showChildView("folderSelect",new M.a({collection:t.children,channelName:this.channelName,folderTreeKey:this.folderTreeKey,canCreateNew:!0,name:"folderId"}))}}},{key:"viewOptions",value:function(){return{styles:Z.a,hasMultipleLibraries:this.hasMultipleLibraries(),requiredFields:this.options.requiredFields}}},{key:"onRender",value:function(){this.renderLibrarySelect(),this.renderFolderSelect()}}])&&oe(t.prototype,n),o&&oe(t,o),Object.defineProperty(t,"prototype",{writable:!1}),a}(r.a.Component),ce=n(1368),ue=n.n(ce);function de(e){return(de="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 fe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pe(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 he(e,t){return(he=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function ye(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=ge(e);if(t){var i=ge(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return me(this,n)}}function me(e,t){if(t&&("object"===de(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ge(e){return(ge=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ve=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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&he(e,t)}(r,e);var t,n,o,i=ye(r);function r(){return fe(this,r),i.apply(this,arguments)}return t=r,(n=[{key:"initialize",value:function(){this.listenTo(this.model,"change:progress",this.update)}},{key:"name",get:function(){return"UploadProgressComponent"}},{key:"template",get:function(){return ue.a}},{key:"className",get:function(){return"progress my-3"}},{key:"elements",get:function(){return{progressBar:".progress-bar"}}},{key:"update",value:function(){var e=this.model.get("progress"),t=this.getUI("progressBar");t&&t.get(0)&&$(t.get(0)).css("width","".concat(e,"%"))}}])&&pe(t.prototype,n),o&&pe(t,o),Object.defineProperty(t,"prototype",{writable:!1}),r}(r.a.Component),be=n(1369),we=n.n(be),ke=n(1370),Se=n.n(ke),Oe=n(1371),Ce=n.n(Oe),Ne=n(1372),Pe=n.n(Ne),xe=n(1373),Te=n.n(xe);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 Ee(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 _e(e,t){return(_e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Ie(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 i=De(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return Re(this,n)}}function Re(e,t){if(t&&("object"===je(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function De(e){return(De=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ae=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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_e(e,t)}(r,e);var t,n,o,i=Ie(r);function r(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),i.call(this,e)}return t=r,(n=[{key:"name",get:function(){return"UploadVideoOptionsComponent"}},{key:"template",get:function(){return Te.a}},{key:"lang",get:function(){return"upload.uploadVideoOptions"}},{key:"tagName",get:function(){return"form"}},{key:"className",get:function(){return"border-top pt-3"}},{key:"events",value:function(){return{"click .toggle-option":"onToggleAutoCaptioning"}}},{key:"onToggleAutoCaptioning",value:function(e){e.stopPropagation(),this.model.set("autoCaption",!this.model.get("autoCaption")),this.render()}},{key:"viewOptions",value:function(){return{isSelected:this.model.get("autoCaption")}}}])&&Ee(t.prototype,n),o&&Ee(t,o),Object.defineProperty(t,"prototype",{writable:!1}),r}(r.a.Component);function Le(e){return(Le="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 Me(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fe(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&&Fe(e.prototype,t),n&&Fe(e,n),Object.defineProperty(e,"prototype",{writable:!1}),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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Be(e,t)}function Be(e,t){return(Be=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function ze(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=Je(e);if(t){var i=Je(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return He(this,n)}}function He(e,t){if(t&&("object"===Le(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Je(e){return(Je=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ke=function(e){Ue(n,e);var t=ze(n);function n(){return Me(this,n),t.apply(this,arguments)}return Ve(n,[{key:"initialize",value:function(){this.listenTo(this.model,"change:name",this.render)}},{key:"name",get:function(){return"UploadTitleComponent"}},{key:"template",get:function(){return Se.a}},{key:"tagName",get:function(){return"h3"}},{key:"className",get:function(){return"mb-0 border-bottom p-3 ".concat(Pe.a.title)}},{key:"viewOptions",value:function(){return{name:this.model.get("name")||this.model.get("fileName")}}}]),n}(r.a.Component),qe=function(e){Ue(n,e);var t=ze(n);function n(){return Me(this,n),t.apply(this,arguments)}return Ve(n,[{key:"initialize",value:function(){this.listenTo(this.model,"change:progress",this.render)}},{key:"name",get:function(){return"TextProgressComponent"}},{key:"template",get:function(){return Ce.a}},{key:"lang",get:function(){return"upload.uploadVideo"}},{key:"className",get:function(){return" text-muted"}},{key:"tagName",get:function(){return"p"}},{key:"viewOptions",value:function(){return{percentage:Math.round(this.model.get("progress")||0)}}}]),n}(r.a.Component),We=function(e){Ue(n,e);var t=ze(n);function n(e){return Me(this,n),t.call(this,e)}return Ve(n,[{key:"initialize",value:function(){this.viewModel=a.a.get("upload:".concat(this.model.get("id")),{name:this.model.get("name"),fileName:this.model.get("name"),showAdvanced:this.options.openAdvancedMetadata,rating:this.options.ratings.findWhere({value:0}),folderId:this.options.folderId,libraryId:this.options.libraryId,timeInitialized:x(),autoCaption:!1},{ctor:E.a}),this.viewModel.addValidation(D.a),this.listenTo(this.channelName,"select:rating",o.partial(this.onAssociationSelected,o,"rating")),this.listenTo(this.channelName,"select:channel",o.partial(this.onAssociationSelected,o,"channel")),this.listenTo(this.channelName,"add:producers",this.onSelectProducer),this.listenTo(this.channelName,"add:distributors",this.onSelectDistributor),this.listenTo(this.channelName,"add:productionCompanies",this.onSelectProductionCompany),this.listenTo(this.channelName,"add:directors",this.onSelectDirector),this.listenTo(this.channelName,"select:series",this.onSelectSeries),this.listenTo(this.channelName,"add:season",this.onSelectSeason),this.listenTo(this.options.uploadChannelName,"invalid:".concat(this.model.get("id")),this.scrollTo)}},{key:"name",get:function(){return"UploadVideoComponent"}},{key:"template",get:function(){return we.a}},{key:"className",get:function(){return"bg-white mb-3"}},{key:"lang",get:function(){return"upload.uploadVideo"}},{key:"events",value:function(){return{"click .add-advanced-metadata":"onClickAddAdvancedMetadata","click .cancel-upload":"onClickCancelUpload"}}},{key:"channelName",get:function(){return"".concat(this.name).concat(this.cid)}},{key:"regions",value:function(){return{progress:{el:".upload-progress-region",replaceElement:!0},thumbnail:{el:".thumbnail-region",replaceElement:!0},uploadTitle:{el:".upload-title-region",replaceElement:!0},folderSelect:{el:".folder-select-region",replaceElement:!0},textProgress:{el:".text-progress-region",replaceElement:!0},videoDetails:{el:".video-details-region",replaceElement:!0},productionInfo:{el:".production-info-region",replaceElement:!0},advancedDetails:{el:".additional-info-region",replaceElement:!0},uploadOptions:{el:".video-options-region",replaceElement:!0}}}},{key:"onClickAddAdvancedMetadata",value:function(){this.viewModel.set("showAdvanced",!this.viewModel.get("showAdvanced")),this.render()}},{key:"onClickCancelUpload",value:function(){var e=this,t={title:s.a.getPhrase(this.lang,"cancelHeading"),text:s.a.getPhrase(this.lang,"cancelBody",{videoTitle:this.model.get("name")}),buttons:[{text:s.a.getPhrase(this.lang,"yes"),className:"btn btn-primary",success:!0},{text:s.a.getPhrase(this.lang,"no"),className:"btn btn-link",close:!0}],channelName:this.channelName};new m.d(t).render().done((function(){i.Radio.channel(e.options.uploadChannelName).trigger("cancel:upload",e.model.get("id"))}))}},{key:"onAssociationSelected",value:function(e,t){var n=this.viewModel.get(t);if(n instanceof r.a.Collection){var i=n.filter((function(t){return!t.id||t.name===e.name}));o.each(i,(function(e){return n.remove(e)})),this.viewModel.get(t).add(e)}else this.viewModel.set(t,e)}},{key:"onSelectSeries",value:function(e){var t=this,n=i.Radio.channel(this.options.uploadChannelName);e.id?n.trigger("get:series",e.id,(function(e){t.onAssociationSelected(e.toJSON(),"series"),t.renderAdvancedVideoDetails()})):e.name&&n.trigger("create:series",e.name,(function(e){t.onAssociationSelected(e.toJSON(),"series"),t.renderAdvancedVideoDetails()}))}},{key:"onSelectSeason",value:function(e){var t=this;if(o.isNull(e))return this.viewModel.get("season").clear({silent:!0}),m.c.deselectAll(this.viewModel.get("series.seasons")),this.onAssociationSelected(null,"season"),void this.renderAdvancedVideoDetails();if(e.id)return m.c.setSelected(e.id,this.viewModel.get("series.seasons")),this.onAssociationSelected(e,"season"),void this.renderAdvancedVideoDetails();if(e.number){var n=this.viewModel.get("series.id");i.Radio.channel(this.options.uploadChannelName).trigger("create:season",e,n,(function(e){t.viewModel.get("series.seasons").add(e.toJSON()),m.c.setSelected(e.id,t.viewModel.get("series.seasons")),t.onAssociationSelected(e.toJSON(),"season"),t.renderAdvancedVideoDetails()}))}}},{key:"onSelectDistributor",value:function(e){var t=this;e.id?this.onAssociationSelected(e,"distributors"):e.name&&i.Radio.channel(this.options.uploadChannelName).trigger("create:company",e.name,(function(e){t.onAssociationSelected(e.toJSON(),"distributors")}))}},{key:"onSelectProductionCompany",value:function(e){var t=this;e.id?this.onAssociationSelected(e,"productionCompanies"):e.name&&i.Radio.channel(this.options.uploadChannelName).trigger("create:company",e.name,(function(e){t.onAssociationSelected(e.toJSON(),"productionCompanies")}))}},{key:"onSelectDirector",value:function(e){var t=this;e.id?this.onAssociationSelected(e,"directors"):e.name&&i.Radio.channel(this.options.uploadChannelName).trigger("create:person",e.name,(function(e){t.onAssociationSelected(e.toJSON(),"directors")}))}},{key:"onSelectProducer",value:function(e){var t=this;e.id?this.onAssociationSelected(e,"producers"):e.name&&i.Radio.channel(this.options.uploadChannelName).trigger("create:person",e.name,(function(e){t.onAssociationSelected(e.toJSON(),"producers")}))}},{key:"getRequiredFields",value:function(){return{uploadDestination:!0}}},{key:"renderTitle",value:function(){var e=new Ke({model:this.viewModel});this.showChildView("uploadTitle",e)}},{key:"renderThumbnail",value:function(){var e=new T.a({model:this.viewModel,thumbnailOptions:{size:j.a.Medium}});this.showChildView("thumbnail",e)}},{key:"renderProgress",value:function(){var e=new ve({model:this.model});this.showChildView("progress",e);var t=new qe({model:this.model});this.showChildView("textProgress",t)}},{key:"renderBasicVideoDetails",value:function(){var e=new _.a({model:this.viewModel,channelName:this.channelName,ratings:this.options.ratings,requiredFields:this.getRequiredFields(),editable:!0});this.showChildView("videoDetails",e)}},{key:"renderFolderSelect",value:function(){var e=new se({collection:this.options.libraries,selectId:this.model.get("id"),model:this.viewModel,channelName:this.options.uploadChannelName,requiredFields:this.getRequiredFields(),preselectedFolderId:this.options.folderId});this.showChildView("folderSelect",e)}},{key:"renderAdvancedVideoDetails",value:function(){if(this.viewModel.get("showAdvanced")){var e=new I.a({channelName:this.channelName,model:this.viewModel,libraries:this.options.libraries,hostedLibraries:this.options.hostedLibraries,editable:!0}),t=new R.a({channelName:this.channelName,model:this.viewModel,editable:!0});this.showChildView("advancedDetails",e),this.showChildView("productionInfo",t),this.options.allowAutoCaptioning&&this.showChildView("uploadOptions",new Ae({model:this.viewModel}))}}},{key:"scrollTo",value:function(){$("html,body").animate({scrollTop:this.$el.offset().top},250)}},{key:"viewOptions",value:function(){return Object.assign({styles:Pe.a},this.viewModel.toJSON())}},{key:"onRender",value:function(){this.renderTitle(),this.renderThumbnail(),this.renderProgress(),this.renderBasicVideoDetails(),this.renderFolderSelect(),this.renderAdvancedVideoDetails(),i.Validation.bind(this,{model:this.viewModel})}},{key:"onDestroy",value:function(){i.Validation.unbind(this)}}]),n}(r.a.Component);function $e(e){return($e="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 Ge(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 Ye(e,t){return(Ye=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Qe(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=Ze(e);if(t){var i=Ze(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return Xe(this,n)}}function Xe(e,t){if(t&&("object"===$e(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Ze(e){return(Ze=Object.setPrototypeOf?Object.getPrototypeOf.bind():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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ye(e,t)}(r,e);var t,n,o,i=Qe(r);function r(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),i.call(this,e)}return t=r,(n=[{key:"name",get:function(){return"UploadVideoComponentCollection"}},{key:"childView",get:function(){return We}},{key:"childViewOptions",get:function(){return{ratings:this.options.ratings,libraries:this.options.libraries,hostedLibraries:this.options.hostedLibraries,uploadChannelName:this.options.uploadChannelName,folderId:this.options.folderId,libraryId:this.options.libraryId,allowAutoCaptioning:this.options.allowAutoCaptioning,openAdvancedMetadata:this.collection.length<=1}}}])&&Ge(t.prototype,n),o&&Ge(t,o),Object.defineProperty(t,"prototype",{writable:!1}),r}(r.a.ComponentCollection),tt=n(0),nt=n(202),ot=n(145),it=n(147),rt=n(4),at=n(45),lt=n(104);function st(e){return(st="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 ct(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 ut(e,t){return(ut=Object.setPrototypeOf?Object.setPrototypeOf.bind():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=pt(e);if(t){var i=pt(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return ft(this,n)}}function ft(e,t){if(t&&("object"===st(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function pt(e){return(pt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"UploadVideosView",(function(){return ht}));var ht=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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ut(e,t)}(y,e);var t,n,f,h=dt(y);function y(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,y),h.call(this,e)}return t=y,(n=[{key:"initialize",value:function(){this.initServices(),this.initDataListeners(),this.initComponentListeners(),this.initCollectionListeners(),this.initShellListeners()}},{key:"name",get:function(){return"UploadVideosView"}},{key:"title",get:function(){return s.a.getPhrase(this.lang,"title")}},{key:"lang",get:function(){return"upload.uploadVideos"}},{key:"template",get:function(){return p.a}},{key:"regions",value:function(){return{topActions:{el:".top-actions-region",replaceElement:!0},bottomActions:{el:".bottom-actions-region",replaceElement:!0},videos:{el:".videos-region",replaceElement:!0}}}},{key:"channelName",get:function(){return"".concat(this.name).concat(this.cid)}},{key:"initServices",value:function(){this.videoDataService=l.a.getInstance(tt.g.Video,this),this.libraryDataService=l.a.getInstance(tt.g.Library,this),this.videoUploadService=l.a.getInstance(tt.x.VideoUpload,this),this.videoUploadDataService=l.a.getInstance(tt.g.VideoUpload,this),this.seriesDataService=l.a.getInstance(tt.g.Series,this),this.ratingsDataService=l.a.getInstance(tt.g.Ratings,this),this.companyDataService=l.a.getInstance(tt.g.Company,this),this.personDataService=l.a.getInstance(tt.g.Person,this),this.alertService=l.a.getInstance(tt.x.Alerts,this),this.navLockService=l.a.getInstance(tt.x.NavLock,this),this.settingsDataService=l.a.getInstance(tt.g.Settings,this)}},{key:"initDataListeners",value:function(){this.listenTo(tt.e.RATINGS,"".concat(tt.f.RATINGS,":sync"),this.render),this.listenTo(tt.e.LIBRARY,"hosted:libraries:sync",this.render),this.listenTo(tt.e.LIBRARY,"folder:created",this.onFolderCreated)}},{key:"initComponentListeners",value:function(){this.listenTo(this.channelName,"continue",this.onClickContinue),this.listenTo(this.channelName,"cancel:upload",this.cancelUpload),this.listenTo(this.channelName,at.a.FILES_SELECTED,this.onFilesSelected),this.listenTo(this.channelName,"show:new:folder",this.onClickNewFolder),this.listenTo(this.channelName,"get:series",this.onSelectSeries),this.listenTo(this.channelName,"create:series",this.onCreateSeries),this.listenTo(this.channelName,"create:season",this.onCreateSeason),this.listenTo(this.channelName,"create:company",this.onCreateCompany),this.listenTo(this.channelName,"create:person",this.onCreatePerson)}},{key:"initCollectionListeners",value:function(){var e=this.videoUploadService.getCollection();this.listenTo(e,"remove",this.onCollectionChange)}},{key:"initShellListeners",value:function(){this.listenTo(u.a.SHELL,r.a.EventNames.NAV_UNLOCKED_BY_USER,this.onNavigateAway)}},{key:"cancelUpload",value:function(e){this.logCancelAction(e),this.videoUploadService.cancelUpload(e)}},{key:"onNavigateAway",value:function(){this.logCancelAction(),this.videoUploadService.cancelAllUploads()}},{key:"onCollectionChange",value:function(e,t){t.length||(this.navLockService.unlock(),r.a.AppLinkHelper.trigger({application:tt.b.UPLOAD,action:tt.a.Upload.FILE_SELECTION}))}},{key:"onSelectSeries",value:function(e,t){this.seriesDataService.getSeries(e,t)}},{key:"onCreateSeries",value:function(e,t){this.seriesDataService.createSeries(e,t)}},{key:"onCreateSeason",value:function(e,t,n){this.seriesDataService.createSeason(e,t,n)}},{key:"onCreateCompany",value:function(e,t){this.companyDataService.createCompany(e,t)}},{key:"onCreatePerson",value:function(e,t){this.personDataService.createPerson(e,t)}},{key:"onClickContinue",value:function(){var e,t=this,n=i.Radio.channel(this.channelName),o=this.videoUploadService.getCollection(),u=!0;if(o.each((function(t){var n=a.a.get("upload:".concat(t.get("id")),null,{ctor:E.a});n.validate();var o=n.isValid();!1!==o||e||(e=t.id),u=u&&o})),e&&n.trigger("invalid:".concat(e)),u){n.trigger("start:spinner");var d=[];o.each((function(e){var n=e.get("file"),i=a.a.get("upload:".concat(e.get("id")),null,{ctor:E.a});if(lt.a.hasExpired(i,t.config.get("uploadSessionExpiryTime")))return t.alertService.createAlert({heading:s.a.getPhrase(t.lang,"uploadErrorHeading"),message:s.a.getPhrase(t.lang,"uploadErrorBody",{videoName:i.get("name")}),type:c.a.Fail}),void o.remove(e);i.set("fileId",n.cvUpload.fileId),i.set("fileSize",n.size),d.push(i)})),this.videoUploadDataService.completeVideoUploads(this.currentUser.get("id"),this.currentUser.get("customerId"),d,(function(){t.navLockService.unlock(),l.a.getInstance(tt.x.PendingItems).forceFetchPendingItems(),l.a.releaseInstance(tt.x.PendingItems),r.a.AppLinkHelper.trigger({application:tt.b.UPLOAD,action:d.length?tt.a.Upload.UPLOAD_COMPLETE:tt.a.Upload.FILE_SELECTION}),t.logFinishAction(d),t.videoDataService.clearVideoCache()}))}}},{key:"onFilesSelected",value:function(e,t){this.videoUploadService.addFiles(e),this.logStartAction(e,t)}},{key:"onClickNewFolder",value:function(e,t){this.setFolderChannel=t,this.navLockService.unlock(),r.a.AppLinkHelper.trigger({application:tt.b.UPLOAD,action:tt.a.Shared.NEW_FOLDER,args:[e]}),this.lockNav()}},{key:"onFolderCreated",value:function(e){this.setFolderChannel&&(i.Radio.channel(this.setFolderChannel).trigger("new:folder:selected",e),this.render())}},{key:"logStartAction",value:function(e,t){var n=F.a.mergeOptions(this.options.analyticsOptions,{workflowPhase:rt.WorkflowPhase.Start,descriptor:F.a.mapInteractionType(t)});F.a.logUserAction(e,n)}},{key:"logCancelAction",value:function(e){var t=this.videoUploadService.getCollection();if(t.length){var n=e?t.get(e):t,o=F.a.mergeOptions(this.options.analyticsOptions,{workflowPhase:rt.WorkflowPhase.Discard,descriptor:e?rt.OperationDescriptor.Single:rt.OperationDescriptor.All});F.a.logUserAction(n.toJSON(),o)}}},{key:"logFinishAction",value:function(e){if(e.length){var t=o.map(e,(function(e){return e.toJSON()})),n=F.a.mergeOptions(this.options.analyticsOptions,{workflowPhase:rt.WorkflowPhase.Complete});F.a.logUserAction(t,n)}}},{key:"fetchData",value:function(){this.ratings=this.ratingsDataService.getAllRatings(),this.hostedLibraries=this.libraryDataService.getLibraries(),this.autoCaptioning=this.settingsDataService.getSetting(this.currentUser.get("customerId"),d.a.AutoCaptioning)}},{key:"renderUploadActions",value:function(){this.showChildView("topActions",new P({uploadChannelName:this.channelName})),this.showChildView("bottomActions",new P({uploadChannelName:this.channelName}))}},{key:"renderVideos",value:function(){var e={collection:this.videoUploadService.getCollection(),ratings:this.ratings,libraries:this.libraries,hostedLibraries:this.hostedLibraries,uploadChannelName:this.channelName,allowAutoCaptioning:this.autoCaptioning.get("value")};if(this.options.folderId){var t=m.f.getLibrary(this.options.folderId,this.libraries);t&&(e.folderId=this.options.folderId,e.libraryId=t.get("id"))}var n=new et(e);this.showChildView("videos",n)}},{key:"lockNav",value:function(){this.navLockService.lock({title:s.a.getPhrase(this.lang,"navLockHeading"),text:s.a.getPhrase(this.lang,"navLockBody")})}},{key:"requiredResources",get:function(){return{currentUser:ot.b.currentUser,libraries:it.b.libraries,config:nt.b.config}}},{key:"onBeforeRender",value:function(){return this.fetchData(),!!this.ratings&&!!this.hostedLibraries&&!!this.autoCaptioning}},{key:"onRender",value:function(){this.lockNav(),this.renderUploadActions(),this.renderVideos()}}])&&ct(t.prototype,n),f&&ct(t,f),Object.defineProperty(t,"prototype",{writable:!1}),y}(r.a.View)}}]);